attachment.js_bak 494 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964
  1. var __defProp = Object.defineProperty;
  2. var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
  3. var __publicField = (obj, key, value) => {
  4. __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
  5. return value;
  6. };
  7. (function() {
  8. "use strict";
  9. const version = "1.0.0";
  10. class JsSpiderSDK {
  11. // 初始化,传入规则
  12. constructor(rules = [], config = {}) {
  13. __publicField(this, "rulesList", []);
  14. __publicField(this, "config", {
  15. useAsync: true
  16. });
  17. this.rulesList = rules;
  18. Object.assign(this.config, config);
  19. }
  20. async run() {
  21. const { useAsync } = this.config;
  22. let result = [];
  23. if (useAsync) {
  24. const rulesRunPromiseList = this.rulesList.map((rule) => rule.run());
  25. result = await Promise.all(rulesRunPromiseList);
  26. } else {
  27. for (let i = 0; i < this.rulesList.length; i++) {
  28. const rule = this.rulesList[i];
  29. const runRes = await rule.run();
  30. result.push(runRes);
  31. }
  32. }
  33. return result;
  34. }
  35. check() {
  36. }
  37. }
  38. var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
  39. function getDefaultExportFromCjs(x) {
  40. return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
  41. }
  42. var jquery = { exports: {} };
  43. /*!
  44. * jQuery JavaScript Library v3.7.1
  45. * https://jquery.com/
  46. *
  47. * Copyright OpenJS Foundation and other contributors
  48. * Released under the MIT license
  49. * https://jquery.org/license
  50. *
  51. * Date: 2023-08-28T13:37Z
  52. */
  53. (function(module) {
  54. (function(global2, factory) {
  55. {
  56. module.exports = global2.document ? factory(global2, true) : function(w) {
  57. if (!w.document) {
  58. throw new Error("jQuery requires a window with a document");
  59. }
  60. return factory(w);
  61. };
  62. }
  63. })(typeof window !== "undefined" ? window : commonjsGlobal, function(window2, noGlobal) {
  64. var arr = [];
  65. var getProto = Object.getPrototypeOf;
  66. var slice = arr.slice;
  67. var flat = arr.flat ? function(array) {
  68. return arr.flat.call(array);
  69. } : function(array) {
  70. return arr.concat.apply([], array);
  71. };
  72. var push = arr.push;
  73. var indexOf = arr.indexOf;
  74. var class2type = {};
  75. var toString = class2type.toString;
  76. var hasOwn = class2type.hasOwnProperty;
  77. var fnToString = hasOwn.toString;
  78. var ObjectFunctionString = fnToString.call(Object);
  79. var support = {};
  80. var isFunction = function isFunction2(obj) {
  81. return typeof obj === "function" && typeof obj.nodeType !== "number" && typeof obj.item !== "function";
  82. };
  83. var isWindow = function isWindow2(obj) {
  84. return obj != null && obj === obj.window;
  85. };
  86. var document2 = window2.document;
  87. var preservedScriptAttributes = {
  88. type: true,
  89. src: true,
  90. nonce: true,
  91. noModule: true
  92. };
  93. function DOMEval(code, node, doc) {
  94. doc = doc || document2;
  95. var i, val, script = doc.createElement("script");
  96. script.text = code;
  97. if (node) {
  98. for (i in preservedScriptAttributes) {
  99. val = node[i] || node.getAttribute && node.getAttribute(i);
  100. if (val) {
  101. script.setAttribute(i, val);
  102. }
  103. }
  104. }
  105. doc.head.appendChild(script).parentNode.removeChild(script);
  106. }
  107. function toType(obj) {
  108. if (obj == null) {
  109. return obj + "";
  110. }
  111. return typeof obj === "object" || typeof obj === "function" ? class2type[toString.call(obj)] || "object" : typeof obj;
  112. }
  113. var version2 = "3.7.1", rhtmlSuffix = /HTML$/i, jQuery = function(selector, context) {
  114. return new jQuery.fn.init(selector, context);
  115. };
  116. jQuery.fn = jQuery.prototype = {
  117. // The current version of jQuery being used
  118. jquery: version2,
  119. constructor: jQuery,
  120. // The default length of a jQuery object is 0
  121. length: 0,
  122. toArray: function() {
  123. return slice.call(this);
  124. },
  125. // Get the Nth element in the matched element set OR
  126. // Get the whole matched element set as a clean array
  127. get: function(num) {
  128. if (num == null) {
  129. return slice.call(this);
  130. }
  131. return num < 0 ? this[num + this.length] : this[num];
  132. },
  133. // Take an array of elements and push it onto the stack
  134. // (returning the new matched element set)
  135. pushStack: function(elems) {
  136. var ret = jQuery.merge(this.constructor(), elems);
  137. ret.prevObject = this;
  138. return ret;
  139. },
  140. // Execute a callback for every element in the matched set.
  141. each: function(callback) {
  142. return jQuery.each(this, callback);
  143. },
  144. map: function(callback) {
  145. return this.pushStack(jQuery.map(this, function(elem, i) {
  146. return callback.call(elem, i, elem);
  147. }));
  148. },
  149. slice: function() {
  150. return this.pushStack(slice.apply(this, arguments));
  151. },
  152. first: function() {
  153. return this.eq(0);
  154. },
  155. last: function() {
  156. return this.eq(-1);
  157. },
  158. even: function() {
  159. return this.pushStack(jQuery.grep(this, function(_elem, i) {
  160. return (i + 1) % 2;
  161. }));
  162. },
  163. odd: function() {
  164. return this.pushStack(jQuery.grep(this, function(_elem, i) {
  165. return i % 2;
  166. }));
  167. },
  168. eq: function(i) {
  169. var len = this.length, j = +i + (i < 0 ? len : 0);
  170. return this.pushStack(j >= 0 && j < len ? [this[j]] : []);
  171. },
  172. end: function() {
  173. return this.prevObject || this.constructor();
  174. },
  175. // For internal use only.
  176. // Behaves like an Array's method, not like a jQuery method.
  177. push,
  178. sort: arr.sort,
  179. splice: arr.splice
  180. };
  181. jQuery.extend = jQuery.fn.extend = function() {
  182. var options, name, src, copy, copyIsArray, clone, target = arguments[0] || {}, i = 1, length = arguments.length, deep = false;
  183. if (typeof target === "boolean") {
  184. deep = target;
  185. target = arguments[i] || {};
  186. i++;
  187. }
  188. if (typeof target !== "object" && !isFunction(target)) {
  189. target = {};
  190. }
  191. if (i === length) {
  192. target = this;
  193. i--;
  194. }
  195. for (; i < length; i++) {
  196. if ((options = arguments[i]) != null) {
  197. for (name in options) {
  198. copy = options[name];
  199. if (name === "__proto__" || target === copy) {
  200. continue;
  201. }
  202. if (deep && copy && (jQuery.isPlainObject(copy) || (copyIsArray = Array.isArray(copy)))) {
  203. src = target[name];
  204. if (copyIsArray && !Array.isArray(src)) {
  205. clone = [];
  206. } else if (!copyIsArray && !jQuery.isPlainObject(src)) {
  207. clone = {};
  208. } else {
  209. clone = src;
  210. }
  211. copyIsArray = false;
  212. target[name] = jQuery.extend(deep, clone, copy);
  213. } else if (copy !== void 0) {
  214. target[name] = copy;
  215. }
  216. }
  217. }
  218. }
  219. return target;
  220. };
  221. jQuery.extend({
  222. // Unique for each copy of jQuery on the page
  223. expando: "jQuery" + (version2 + Math.random()).replace(/\D/g, ""),
  224. // Assume jQuery is ready without the ready module
  225. isReady: true,
  226. error: function(msg) {
  227. throw new Error(msg);
  228. },
  229. noop: function() {
  230. },
  231. isPlainObject: function(obj) {
  232. var proto, Ctor;
  233. if (!obj || toString.call(obj) !== "[object Object]") {
  234. return false;
  235. }
  236. proto = getProto(obj);
  237. if (!proto) {
  238. return true;
  239. }
  240. Ctor = hasOwn.call(proto, "constructor") && proto.constructor;
  241. return typeof Ctor === "function" && fnToString.call(Ctor) === ObjectFunctionString;
  242. },
  243. isEmptyObject: function(obj) {
  244. var name;
  245. for (name in obj) {
  246. return false;
  247. }
  248. return true;
  249. },
  250. // Evaluates a script in a provided context; falls back to the global one
  251. // if not specified.
  252. globalEval: function(code, options, doc) {
  253. DOMEval(code, { nonce: options && options.nonce }, doc);
  254. },
  255. each: function(obj, callback) {
  256. var length, i = 0;
  257. if (isArrayLike(obj)) {
  258. length = obj.length;
  259. for (; i < length; i++) {
  260. if (callback.call(obj[i], i, obj[i]) === false) {
  261. break;
  262. }
  263. }
  264. } else {
  265. for (i in obj) {
  266. if (callback.call(obj[i], i, obj[i]) === false) {
  267. break;
  268. }
  269. }
  270. }
  271. return obj;
  272. },
  273. // Retrieve the text value of an array of DOM nodes
  274. text: function(elem) {
  275. var node, ret = "", i = 0, nodeType = elem.nodeType;
  276. if (!nodeType) {
  277. while (node = elem[i++]) {
  278. ret += jQuery.text(node);
  279. }
  280. }
  281. if (nodeType === 1 || nodeType === 11) {
  282. return elem.textContent;
  283. }
  284. if (nodeType === 9) {
  285. return elem.documentElement.textContent;
  286. }
  287. if (nodeType === 3 || nodeType === 4) {
  288. return elem.nodeValue;
  289. }
  290. return ret;
  291. },
  292. // results is for internal usage only
  293. makeArray: function(arr2, results) {
  294. var ret = results || [];
  295. if (arr2 != null) {
  296. if (isArrayLike(Object(arr2))) {
  297. jQuery.merge(
  298. ret,
  299. typeof arr2 === "string" ? [arr2] : arr2
  300. );
  301. } else {
  302. push.call(ret, arr2);
  303. }
  304. }
  305. return ret;
  306. },
  307. inArray: function(elem, arr2, i) {
  308. return arr2 == null ? -1 : indexOf.call(arr2, elem, i);
  309. },
  310. isXMLDoc: function(elem) {
  311. var namespace = elem && elem.namespaceURI, docElem = elem && (elem.ownerDocument || elem).documentElement;
  312. return !rhtmlSuffix.test(namespace || docElem && docElem.nodeName || "HTML");
  313. },
  314. // Support: Android <=4.0 only, PhantomJS 1 only
  315. // push.apply(_, arraylike) throws on ancient WebKit
  316. merge: function(first, second) {
  317. var len = +second.length, j = 0, i = first.length;
  318. for (; j < len; j++) {
  319. first[i++] = second[j];
  320. }
  321. first.length = i;
  322. return first;
  323. },
  324. grep: function(elems, callback, invert) {
  325. var callbackInverse, matches = [], i = 0, length = elems.length, callbackExpect = !invert;
  326. for (; i < length; i++) {
  327. callbackInverse = !callback(elems[i], i);
  328. if (callbackInverse !== callbackExpect) {
  329. matches.push(elems[i]);
  330. }
  331. }
  332. return matches;
  333. },
  334. // arg is for internal usage only
  335. map: function(elems, callback, arg) {
  336. var length, value, i = 0, ret = [];
  337. if (isArrayLike(elems)) {
  338. length = elems.length;
  339. for (; i < length; i++) {
  340. value = callback(elems[i], i, arg);
  341. if (value != null) {
  342. ret.push(value);
  343. }
  344. }
  345. } else {
  346. for (i in elems) {
  347. value = callback(elems[i], i, arg);
  348. if (value != null) {
  349. ret.push(value);
  350. }
  351. }
  352. }
  353. return flat(ret);
  354. },
  355. // A global GUID counter for objects
  356. guid: 1,
  357. // jQuery.support is not used in Core but other projects attach their
  358. // properties to it so it needs to exist.
  359. support
  360. });
  361. if (typeof Symbol === "function") {
  362. jQuery.fn[Symbol.iterator] = arr[Symbol.iterator];
  363. }
  364. jQuery.each(
  365. "Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),
  366. function(_i, name) {
  367. class2type["[object " + name + "]"] = name.toLowerCase();
  368. }
  369. );
  370. function isArrayLike(obj) {
  371. var length = !!obj && "length" in obj && obj.length, type = toType(obj);
  372. if (isFunction(obj) || isWindow(obj)) {
  373. return false;
  374. }
  375. return type === "array" || length === 0 || typeof length === "number" && length > 0 && length - 1 in obj;
  376. }
  377. function nodeName(elem, name) {
  378. return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
  379. }
  380. var pop = arr.pop;
  381. var sort = arr.sort;
  382. var splice = arr.splice;
  383. var whitespace = "[\\x20\\t\\r\\n\\f]";
  384. var rtrimCSS = new RegExp(
  385. "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$",
  386. "g"
  387. );
  388. jQuery.contains = function(a, b) {
  389. var bup = b && b.parentNode;
  390. return a === bup || !!(bup && bup.nodeType === 1 && // Support: IE 9 - 11+
  391. // IE doesn't have `contains` on SVG.
  392. (a.contains ? a.contains(bup) : a.compareDocumentPosition && a.compareDocumentPosition(bup) & 16));
  393. };
  394. var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;
  395. function fcssescape(ch, asCodePoint) {
  396. if (asCodePoint) {
  397. if (ch === "\0") {
  398. return "�";
  399. }
  400. return ch.slice(0, -1) + "\\" + ch.charCodeAt(ch.length - 1).toString(16) + " ";
  401. }
  402. return "\\" + ch;
  403. }
  404. jQuery.escapeSelector = function(sel) {
  405. return (sel + "").replace(rcssescape, fcssescape);
  406. };
  407. var preferredDoc = document2, pushNative = push;
  408. (function() {
  409. var i, Expr, outermostContext, sortInput, hasDuplicate, push2 = pushNative, document3, documentElement2, documentIsHTML, rbuggyQSA, matches, expando = jQuery.expando, dirruns = 0, done = 0, classCache = createCache(), tokenCache = createCache(), compilerCache = createCache(), nonnativeSelectorCache = createCache(), sortOrder = function(a, b) {
  410. if (a === b) {
  411. hasDuplicate = true;
  412. }
  413. return 0;
  414. }, booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+", attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + // Operator (capture 2)
  415. "*([*^$|!~]?=)" + whitespace + // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
  416. `*(?:'((?:\\\\.|[^\\\\'])*)'|"((?:\\\\.|[^\\\\"])*)"|(` + identifier + "))|)" + whitespace + "*\\]", pseudos = ":(" + identifier + `)(?:\\((('((?:\\\\.|[^\\\\'])*)'|"((?:\\\\.|[^\\\\"])*)")|((?:\\\\.|[^\\\\()[\\]]|` + attributes + ")*)|.*)\\)|)", rwhitespace = new RegExp(whitespace + "+", "g"), rcomma = new RegExp("^" + whitespace + "*," + whitespace + "*"), rleadingCombinator = new RegExp("^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*"), rdescend = new RegExp(whitespace + "|>"), rpseudo = new RegExp(pseudos), ridentifier = new RegExp("^" + identifier + "$"), matchExpr = {
  417. ID: new RegExp("^#(" + identifier + ")"),
  418. CLASS: new RegExp("^\\.(" + identifier + ")"),
  419. TAG: new RegExp("^(" + identifier + "|[*])"),
  420. ATTR: new RegExp("^" + attributes),
  421. PSEUDO: new RegExp("^" + pseudos),
  422. CHILD: new RegExp(
  423. "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)",
  424. "i"
  425. ),
  426. bool: new RegExp("^(?:" + booleans + ")$", "i"),
  427. // For use in libraries implementing .is()
  428. // We use this for POS matching in `select`
  429. needsContext: new RegExp("^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i")
  430. }, rinputs = /^(?:input|select|textarea|button)$/i, rheader = /^h\d$/i, rquickExpr2 = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, rsibling = /[+~]/, runescape = new RegExp("\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g"), funescape = function(escape, nonHex) {
  431. var high = "0x" + escape.slice(1) - 65536;
  432. if (nonHex) {
  433. return nonHex;
  434. }
  435. return high < 0 ? String.fromCharCode(high + 65536) : String.fromCharCode(high >> 10 | 55296, high & 1023 | 56320);
  436. }, unloadHandler = function() {
  437. setDocument();
  438. }, inDisabledFieldset = addCombinator(
  439. function(elem) {
  440. return elem.disabled === true && nodeName(elem, "fieldset");
  441. },
  442. { dir: "parentNode", next: "legend" }
  443. );
  444. function safeActiveElement() {
  445. try {
  446. return document3.activeElement;
  447. } catch (err) {
  448. }
  449. }
  450. try {
  451. push2.apply(
  452. arr = slice.call(preferredDoc.childNodes),
  453. preferredDoc.childNodes
  454. );
  455. arr[preferredDoc.childNodes.length].nodeType;
  456. } catch (e) {
  457. push2 = {
  458. apply: function(target, els) {
  459. pushNative.apply(target, slice.call(els));
  460. },
  461. call: function(target) {
  462. pushNative.apply(target, slice.call(arguments, 1));
  463. }
  464. };
  465. }
  466. function find(selector, context, results, seed) {
  467. var m, i2, elem, nid, match, groups, newSelector, newContext = context && context.ownerDocument, nodeType = context ? context.nodeType : 9;
  468. results = results || [];
  469. if (typeof selector !== "string" || !selector || nodeType !== 1 && nodeType !== 9 && nodeType !== 11) {
  470. return results;
  471. }
  472. if (!seed) {
  473. setDocument(context);
  474. context = context || document3;
  475. if (documentIsHTML) {
  476. if (nodeType !== 11 && (match = rquickExpr2.exec(selector))) {
  477. if (m = match[1]) {
  478. if (nodeType === 9) {
  479. if (elem = context.getElementById(m)) {
  480. if (elem.id === m) {
  481. push2.call(results, elem);
  482. return results;
  483. }
  484. } else {
  485. return results;
  486. }
  487. } else {
  488. if (newContext && (elem = newContext.getElementById(m)) && find.contains(context, elem) && elem.id === m) {
  489. push2.call(results, elem);
  490. return results;
  491. }
  492. }
  493. } else if (match[2]) {
  494. push2.apply(results, context.getElementsByTagName(selector));
  495. return results;
  496. } else if ((m = match[3]) && context.getElementsByClassName) {
  497. push2.apply(results, context.getElementsByClassName(m));
  498. return results;
  499. }
  500. }
  501. if (!nonnativeSelectorCache[selector + " "] && (!rbuggyQSA || !rbuggyQSA.test(selector))) {
  502. newSelector = selector;
  503. newContext = context;
  504. if (nodeType === 1 && (rdescend.test(selector) || rleadingCombinator.test(selector))) {
  505. newContext = rsibling.test(selector) && testContext(context.parentNode) || context;
  506. if (newContext != context || !support.scope) {
  507. if (nid = context.getAttribute("id")) {
  508. nid = jQuery.escapeSelector(nid);
  509. } else {
  510. context.setAttribute("id", nid = expando);
  511. }
  512. }
  513. groups = tokenize(selector);
  514. i2 = groups.length;
  515. while (i2--) {
  516. groups[i2] = (nid ? "#" + nid : ":scope") + " " + toSelector(groups[i2]);
  517. }
  518. newSelector = groups.join(",");
  519. }
  520. try {
  521. push2.apply(
  522. results,
  523. newContext.querySelectorAll(newSelector)
  524. );
  525. return results;
  526. } catch (qsaError) {
  527. nonnativeSelectorCache(selector, true);
  528. } finally {
  529. if (nid === expando) {
  530. context.removeAttribute("id");
  531. }
  532. }
  533. }
  534. }
  535. }
  536. return select(selector.replace(rtrimCSS, "$1"), context, results, seed);
  537. }
  538. function createCache() {
  539. var keys = [];
  540. function cache(key, value) {
  541. if (keys.push(key + " ") > Expr.cacheLength) {
  542. delete cache[keys.shift()];
  543. }
  544. return cache[key + " "] = value;
  545. }
  546. return cache;
  547. }
  548. function markFunction(fn) {
  549. fn[expando] = true;
  550. return fn;
  551. }
  552. function assert(fn) {
  553. var el = document3.createElement("fieldset");
  554. try {
  555. return !!fn(el);
  556. } catch (e) {
  557. return false;
  558. } finally {
  559. if (el.parentNode) {
  560. el.parentNode.removeChild(el);
  561. }
  562. el = null;
  563. }
  564. }
  565. function createInputPseudo(type) {
  566. return function(elem) {
  567. return nodeName(elem, "input") && elem.type === type;
  568. };
  569. }
  570. function createButtonPseudo(type) {
  571. return function(elem) {
  572. return (nodeName(elem, "input") || nodeName(elem, "button")) && elem.type === type;
  573. };
  574. }
  575. function createDisabledPseudo(disabled) {
  576. return function(elem) {
  577. if ("form" in elem) {
  578. if (elem.parentNode && elem.disabled === false) {
  579. if ("label" in elem) {
  580. if ("label" in elem.parentNode) {
  581. return elem.parentNode.disabled === disabled;
  582. } else {
  583. return elem.disabled === disabled;
  584. }
  585. }
  586. return elem.isDisabled === disabled || // Where there is no isDisabled, check manually
  587. elem.isDisabled !== !disabled && inDisabledFieldset(elem) === disabled;
  588. }
  589. return elem.disabled === disabled;
  590. } else if ("label" in elem) {
  591. return elem.disabled === disabled;
  592. }
  593. return false;
  594. };
  595. }
  596. function createPositionalPseudo(fn) {
  597. return markFunction(function(argument) {
  598. argument = +argument;
  599. return markFunction(function(seed, matches2) {
  600. var j, matchIndexes = fn([], seed.length, argument), i2 = matchIndexes.length;
  601. while (i2--) {
  602. if (seed[j = matchIndexes[i2]]) {
  603. seed[j] = !(matches2[j] = seed[j]);
  604. }
  605. }
  606. });
  607. });
  608. }
  609. function testContext(context) {
  610. return context && typeof context.getElementsByTagName !== "undefined" && context;
  611. }
  612. function setDocument(node) {
  613. var subWindow, doc = node ? node.ownerDocument || node : preferredDoc;
  614. if (doc == document3 || doc.nodeType !== 9 || !doc.documentElement) {
  615. return document3;
  616. }
  617. document3 = doc;
  618. documentElement2 = document3.documentElement;
  619. documentIsHTML = !jQuery.isXMLDoc(document3);
  620. matches = documentElement2.matches || documentElement2.webkitMatchesSelector || documentElement2.msMatchesSelector;
  621. if (documentElement2.msMatchesSelector && // Support: IE 11+, Edge 17 - 18+
  622. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  623. // two documents; shallow comparisons work.
  624. // eslint-disable-next-line eqeqeq
  625. preferredDoc != document3 && (subWindow = document3.defaultView) && subWindow.top !== subWindow) {
  626. subWindow.addEventListener("unload", unloadHandler);
  627. }
  628. support.getById = assert(function(el) {
  629. documentElement2.appendChild(el).id = jQuery.expando;
  630. return !document3.getElementsByName || !document3.getElementsByName(jQuery.expando).length;
  631. });
  632. support.disconnectedMatch = assert(function(el) {
  633. return matches.call(el, "*");
  634. });
  635. support.scope = assert(function() {
  636. return document3.querySelectorAll(":scope");
  637. });
  638. support.cssHas = assert(function() {
  639. try {
  640. document3.querySelector(":has(*,:jqfake)");
  641. return false;
  642. } catch (e) {
  643. return true;
  644. }
  645. });
  646. if (support.getById) {
  647. Expr.filter.ID = function(id) {
  648. var attrId = id.replace(runescape, funescape);
  649. return function(elem) {
  650. return elem.getAttribute("id") === attrId;
  651. };
  652. };
  653. Expr.find.ID = function(id, context) {
  654. if (typeof context.getElementById !== "undefined" && documentIsHTML) {
  655. var elem = context.getElementById(id);
  656. return elem ? [elem] : [];
  657. }
  658. };
  659. } else {
  660. Expr.filter.ID = function(id) {
  661. var attrId = id.replace(runescape, funescape);
  662. return function(elem) {
  663. var node2 = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
  664. return node2 && node2.value === attrId;
  665. };
  666. };
  667. Expr.find.ID = function(id, context) {
  668. if (typeof context.getElementById !== "undefined" && documentIsHTML) {
  669. var node2, i2, elems, elem = context.getElementById(id);
  670. if (elem) {
  671. node2 = elem.getAttributeNode("id");
  672. if (node2 && node2.value === id) {
  673. return [elem];
  674. }
  675. elems = context.getElementsByName(id);
  676. i2 = 0;
  677. while (elem = elems[i2++]) {
  678. node2 = elem.getAttributeNode("id");
  679. if (node2 && node2.value === id) {
  680. return [elem];
  681. }
  682. }
  683. }
  684. return [];
  685. }
  686. };
  687. }
  688. Expr.find.TAG = function(tag, context) {
  689. if (typeof context.getElementsByTagName !== "undefined") {
  690. return context.getElementsByTagName(tag);
  691. } else {
  692. return context.querySelectorAll(tag);
  693. }
  694. };
  695. Expr.find.CLASS = function(className, context) {
  696. if (typeof context.getElementsByClassName !== "undefined" && documentIsHTML) {
  697. return context.getElementsByClassName(className);
  698. }
  699. };
  700. rbuggyQSA = [];
  701. assert(function(el) {
  702. var input;
  703. documentElement2.appendChild(el).innerHTML = "<a id='" + expando + "' href='' disabled='disabled'></a><select id='" + expando + "-\r\\' disabled='disabled'><option selected=''></option></select>";
  704. if (!el.querySelectorAll("[selected]").length) {
  705. rbuggyQSA.push("\\[" + whitespace + "*(?:value|" + booleans + ")");
  706. }
  707. if (!el.querySelectorAll("[id~=" + expando + "-]").length) {
  708. rbuggyQSA.push("~=");
  709. }
  710. if (!el.querySelectorAll("a#" + expando + "+*").length) {
  711. rbuggyQSA.push(".#.+[+~]");
  712. }
  713. if (!el.querySelectorAll(":checked").length) {
  714. rbuggyQSA.push(":checked");
  715. }
  716. input = document3.createElement("input");
  717. input.setAttribute("type", "hidden");
  718. el.appendChild(input).setAttribute("name", "D");
  719. documentElement2.appendChild(el).disabled = true;
  720. if (el.querySelectorAll(":disabled").length !== 2) {
  721. rbuggyQSA.push(":enabled", ":disabled");
  722. }
  723. input = document3.createElement("input");
  724. input.setAttribute("name", "");
  725. el.appendChild(input);
  726. if (!el.querySelectorAll("[name='']").length) {
  727. rbuggyQSA.push("\\[" + whitespace + "*name" + whitespace + "*=" + whitespace + `*(?:''|"")`);
  728. }
  729. });
  730. if (!support.cssHas) {
  731. rbuggyQSA.push(":has");
  732. }
  733. rbuggyQSA = rbuggyQSA.length && new RegExp(rbuggyQSA.join("|"));
  734. sortOrder = function(a, b) {
  735. if (a === b) {
  736. hasDuplicate = true;
  737. return 0;
  738. }
  739. var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
  740. if (compare) {
  741. return compare;
  742. }
  743. compare = (a.ownerDocument || a) == (b.ownerDocument || b) ? a.compareDocumentPosition(b) : (
  744. // Otherwise we know they are disconnected
  745. 1
  746. );
  747. if (compare & 1 || !support.sortDetached && b.compareDocumentPosition(a) === compare) {
  748. if (a === document3 || a.ownerDocument == preferredDoc && find.contains(preferredDoc, a)) {
  749. return -1;
  750. }
  751. if (b === document3 || b.ownerDocument == preferredDoc && find.contains(preferredDoc, b)) {
  752. return 1;
  753. }
  754. return sortInput ? indexOf.call(sortInput, a) - indexOf.call(sortInput, b) : 0;
  755. }
  756. return compare & 4 ? -1 : 1;
  757. };
  758. return document3;
  759. }
  760. find.matches = function(expr, elements) {
  761. return find(expr, null, null, elements);
  762. };
  763. find.matchesSelector = function(elem, expr) {
  764. setDocument(elem);
  765. if (documentIsHTML && !nonnativeSelectorCache[expr + " "] && (!rbuggyQSA || !rbuggyQSA.test(expr))) {
  766. try {
  767. var ret = matches.call(elem, expr);
  768. if (ret || support.disconnectedMatch || // As well, disconnected nodes are said to be in a document
  769. // fragment in IE 9
  770. elem.document && elem.document.nodeType !== 11) {
  771. return ret;
  772. }
  773. } catch (e) {
  774. nonnativeSelectorCache(expr, true);
  775. }
  776. }
  777. return find(expr, document3, null, [elem]).length > 0;
  778. };
  779. find.contains = function(context, elem) {
  780. if ((context.ownerDocument || context) != document3) {
  781. setDocument(context);
  782. }
  783. return jQuery.contains(context, elem);
  784. };
  785. find.attr = function(elem, name) {
  786. if ((elem.ownerDocument || elem) != document3) {
  787. setDocument(elem);
  788. }
  789. var fn = Expr.attrHandle[name.toLowerCase()], val = fn && hasOwn.call(Expr.attrHandle, name.toLowerCase()) ? fn(elem, name, !documentIsHTML) : void 0;
  790. if (val !== void 0) {
  791. return val;
  792. }
  793. return elem.getAttribute(name);
  794. };
  795. find.error = function(msg) {
  796. throw new Error("Syntax error, unrecognized expression: " + msg);
  797. };
  798. jQuery.uniqueSort = function(results) {
  799. var elem, duplicates = [], j = 0, i2 = 0;
  800. hasDuplicate = !support.sortStable;
  801. sortInput = !support.sortStable && slice.call(results, 0);
  802. sort.call(results, sortOrder);
  803. if (hasDuplicate) {
  804. while (elem = results[i2++]) {
  805. if (elem === results[i2]) {
  806. j = duplicates.push(i2);
  807. }
  808. }
  809. while (j--) {
  810. splice.call(results, duplicates[j], 1);
  811. }
  812. }
  813. sortInput = null;
  814. return results;
  815. };
  816. jQuery.fn.uniqueSort = function() {
  817. return this.pushStack(jQuery.uniqueSort(slice.apply(this)));
  818. };
  819. Expr = jQuery.expr = {
  820. // Can be adjusted by the user
  821. cacheLength: 50,
  822. createPseudo: markFunction,
  823. match: matchExpr,
  824. attrHandle: {},
  825. find: {},
  826. relative: {
  827. ">": { dir: "parentNode", first: true },
  828. " ": { dir: "parentNode" },
  829. "+": { dir: "previousSibling", first: true },
  830. "~": { dir: "previousSibling" }
  831. },
  832. preFilter: {
  833. ATTR: function(match) {
  834. match[1] = match[1].replace(runescape, funescape);
  835. match[3] = (match[3] || match[4] || match[5] || "").replace(runescape, funescape);
  836. if (match[2] === "~=") {
  837. match[3] = " " + match[3] + " ";
  838. }
  839. return match.slice(0, 4);
  840. },
  841. CHILD: function(match) {
  842. match[1] = match[1].toLowerCase();
  843. if (match[1].slice(0, 3) === "nth") {
  844. if (!match[3]) {
  845. find.error(match[0]);
  846. }
  847. match[4] = +(match[4] ? match[5] + (match[6] || 1) : 2 * (match[3] === "even" || match[3] === "odd"));
  848. match[5] = +(match[7] + match[8] || match[3] === "odd");
  849. } else if (match[3]) {
  850. find.error(match[0]);
  851. }
  852. return match;
  853. },
  854. PSEUDO: function(match) {
  855. var excess, unquoted = !match[6] && match[2];
  856. if (matchExpr.CHILD.test(match[0])) {
  857. return null;
  858. }
  859. if (match[3]) {
  860. match[2] = match[4] || match[5] || "";
  861. } else if (unquoted && rpseudo.test(unquoted) && // Get excess from tokenize (recursively)
  862. (excess = tokenize(unquoted, true)) && // advance to the next closing parenthesis
  863. (excess = unquoted.indexOf(")", unquoted.length - excess) - unquoted.length)) {
  864. match[0] = match[0].slice(0, excess);
  865. match[2] = unquoted.slice(0, excess);
  866. }
  867. return match.slice(0, 3);
  868. }
  869. },
  870. filter: {
  871. TAG: function(nodeNameSelector) {
  872. var expectedNodeName = nodeNameSelector.replace(runescape, funescape).toLowerCase();
  873. return nodeNameSelector === "*" ? function() {
  874. return true;
  875. } : function(elem) {
  876. return nodeName(elem, expectedNodeName);
  877. };
  878. },
  879. CLASS: function(className) {
  880. var pattern = classCache[className + " "];
  881. return pattern || (pattern = new RegExp("(^|" + whitespace + ")" + className + "(" + whitespace + "|$)")) && classCache(className, function(elem) {
  882. return pattern.test(
  883. typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || ""
  884. );
  885. });
  886. },
  887. ATTR: function(name, operator, check) {
  888. return function(elem) {
  889. var result = find.attr(elem, name);
  890. if (result == null) {
  891. return operator === "!=";
  892. }
  893. if (!operator) {
  894. return true;
  895. }
  896. result += "";
  897. if (operator === "=") {
  898. return result === check;
  899. }
  900. if (operator === "!=") {
  901. return result !== check;
  902. }
  903. if (operator === "^=") {
  904. return check && result.indexOf(check) === 0;
  905. }
  906. if (operator === "*=") {
  907. return check && result.indexOf(check) > -1;
  908. }
  909. if (operator === "$=") {
  910. return check && result.slice(-check.length) === check;
  911. }
  912. if (operator === "~=") {
  913. return (" " + result.replace(rwhitespace, " ") + " ").indexOf(check) > -1;
  914. }
  915. if (operator === "|=") {
  916. return result === check || result.slice(0, check.length + 1) === check + "-";
  917. }
  918. return false;
  919. };
  920. },
  921. CHILD: function(type, what, _argument, first, last) {
  922. var simple = type.slice(0, 3) !== "nth", forward = type.slice(-4) !== "last", ofType = what === "of-type";
  923. return first === 1 && last === 0 ? (
  924. // Shortcut for :nth-*(n)
  925. function(elem) {
  926. return !!elem.parentNode;
  927. }
  928. ) : function(elem, _context, xml) {
  929. var cache, outerCache, node, nodeIndex, start, dir2 = simple !== forward ? "nextSibling" : "previousSibling", parent = elem.parentNode, name = ofType && elem.nodeName.toLowerCase(), useCache = !xml && !ofType, diff = false;
  930. if (parent) {
  931. if (simple) {
  932. while (dir2) {
  933. node = elem;
  934. while (node = node[dir2]) {
  935. if (ofType ? nodeName(node, name) : node.nodeType === 1) {
  936. return false;
  937. }
  938. }
  939. start = dir2 = type === "only" && !start && "nextSibling";
  940. }
  941. return true;
  942. }
  943. start = [forward ? parent.firstChild : parent.lastChild];
  944. if (forward && useCache) {
  945. outerCache = parent[expando] || (parent[expando] = {});
  946. cache = outerCache[type] || [];
  947. nodeIndex = cache[0] === dirruns && cache[1];
  948. diff = nodeIndex && cache[2];
  949. node = nodeIndex && parent.childNodes[nodeIndex];
  950. while (node = ++nodeIndex && node && node[dir2] || // Fallback to seeking `elem` from the start
  951. (diff = nodeIndex = 0) || start.pop()) {
  952. if (node.nodeType === 1 && ++diff && node === elem) {
  953. outerCache[type] = [dirruns, nodeIndex, diff];
  954. break;
  955. }
  956. }
  957. } else {
  958. if (useCache) {
  959. outerCache = elem[expando] || (elem[expando] = {});
  960. cache = outerCache[type] || [];
  961. nodeIndex = cache[0] === dirruns && cache[1];
  962. diff = nodeIndex;
  963. }
  964. if (diff === false) {
  965. while (node = ++nodeIndex && node && node[dir2] || (diff = nodeIndex = 0) || start.pop()) {
  966. if ((ofType ? nodeName(node, name) : node.nodeType === 1) && ++diff) {
  967. if (useCache) {
  968. outerCache = node[expando] || (node[expando] = {});
  969. outerCache[type] = [dirruns, diff];
  970. }
  971. if (node === elem) {
  972. break;
  973. }
  974. }
  975. }
  976. }
  977. }
  978. diff -= last;
  979. return diff === first || diff % first === 0 && diff / first >= 0;
  980. }
  981. };
  982. },
  983. PSEUDO: function(pseudo, argument) {
  984. var args, fn = Expr.pseudos[pseudo] || Expr.setFilters[pseudo.toLowerCase()] || find.error("unsupported pseudo: " + pseudo);
  985. if (fn[expando]) {
  986. return fn(argument);
  987. }
  988. if (fn.length > 1) {
  989. args = [pseudo, pseudo, "", argument];
  990. return Expr.setFilters.hasOwnProperty(pseudo.toLowerCase()) ? markFunction(function(seed, matches2) {
  991. var idx, matched = fn(seed, argument), i2 = matched.length;
  992. while (i2--) {
  993. idx = indexOf.call(seed, matched[i2]);
  994. seed[idx] = !(matches2[idx] = matched[i2]);
  995. }
  996. }) : function(elem) {
  997. return fn(elem, 0, args);
  998. };
  999. }
  1000. return fn;
  1001. }
  1002. },
  1003. pseudos: {
  1004. // Potentially complex pseudos
  1005. not: markFunction(function(selector) {
  1006. var input = [], results = [], matcher = compile(selector.replace(rtrimCSS, "$1"));
  1007. return matcher[expando] ? markFunction(function(seed, matches2, _context, xml) {
  1008. var elem, unmatched = matcher(seed, null, xml, []), i2 = seed.length;
  1009. while (i2--) {
  1010. if (elem = unmatched[i2]) {
  1011. seed[i2] = !(matches2[i2] = elem);
  1012. }
  1013. }
  1014. }) : function(elem, _context, xml) {
  1015. input[0] = elem;
  1016. matcher(input, null, xml, results);
  1017. input[0] = null;
  1018. return !results.pop();
  1019. };
  1020. }),
  1021. has: markFunction(function(selector) {
  1022. return function(elem) {
  1023. return find(selector, elem).length > 0;
  1024. };
  1025. }),
  1026. contains: markFunction(function(text) {
  1027. text = text.replace(runescape, funescape);
  1028. return function(elem) {
  1029. return (elem.textContent || jQuery.text(elem)).indexOf(text) > -1;
  1030. };
  1031. }),
  1032. // "Whether an element is represented by a :lang() selector
  1033. // is based solely on the element's language value
  1034. // being equal to the identifier C,
  1035. // or beginning with the identifier C immediately followed by "-".
  1036. // The matching of C against the element's language value is performed case-insensitively.
  1037. // The identifier C does not have to be a valid language name."
  1038. // https://www.w3.org/TR/selectors/#lang-pseudo
  1039. lang: markFunction(function(lang) {
  1040. if (!ridentifier.test(lang || "")) {
  1041. find.error("unsupported lang: " + lang);
  1042. }
  1043. lang = lang.replace(runescape, funescape).toLowerCase();
  1044. return function(elem) {
  1045. var elemLang;
  1046. do {
  1047. if (elemLang = documentIsHTML ? elem.lang : elem.getAttribute("xml:lang") || elem.getAttribute("lang")) {
  1048. elemLang = elemLang.toLowerCase();
  1049. return elemLang === lang || elemLang.indexOf(lang + "-") === 0;
  1050. }
  1051. } while ((elem = elem.parentNode) && elem.nodeType === 1);
  1052. return false;
  1053. };
  1054. }),
  1055. // Miscellaneous
  1056. target: function(elem) {
  1057. var hash = window2.location && window2.location.hash;
  1058. return hash && hash.slice(1) === elem.id;
  1059. },
  1060. root: function(elem) {
  1061. return elem === documentElement2;
  1062. },
  1063. focus: function(elem) {
  1064. return elem === safeActiveElement() && document3.hasFocus() && !!(elem.type || elem.href || ~elem.tabIndex);
  1065. },
  1066. // Boolean properties
  1067. enabled: createDisabledPseudo(false),
  1068. disabled: createDisabledPseudo(true),
  1069. checked: function(elem) {
  1070. return nodeName(elem, "input") && !!elem.checked || nodeName(elem, "option") && !!elem.selected;
  1071. },
  1072. selected: function(elem) {
  1073. if (elem.parentNode) {
  1074. elem.parentNode.selectedIndex;
  1075. }
  1076. return elem.selected === true;
  1077. },
  1078. // Contents
  1079. empty: function(elem) {
  1080. for (elem = elem.firstChild; elem; elem = elem.nextSibling) {
  1081. if (elem.nodeType < 6) {
  1082. return false;
  1083. }
  1084. }
  1085. return true;
  1086. },
  1087. parent: function(elem) {
  1088. return !Expr.pseudos.empty(elem);
  1089. },
  1090. // Element/input types
  1091. header: function(elem) {
  1092. return rheader.test(elem.nodeName);
  1093. },
  1094. input: function(elem) {
  1095. return rinputs.test(elem.nodeName);
  1096. },
  1097. button: function(elem) {
  1098. return nodeName(elem, "input") && elem.type === "button" || nodeName(elem, "button");
  1099. },
  1100. text: function(elem) {
  1101. var attr;
  1102. return nodeName(elem, "input") && elem.type === "text" && // Support: IE <10 only
  1103. // New HTML5 attribute values (e.g., "search") appear
  1104. // with elem.type === "text"
  1105. ((attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text");
  1106. },
  1107. // Position-in-collection
  1108. first: createPositionalPseudo(function() {
  1109. return [0];
  1110. }),
  1111. last: createPositionalPseudo(function(_matchIndexes, length) {
  1112. return [length - 1];
  1113. }),
  1114. eq: createPositionalPseudo(function(_matchIndexes, length, argument) {
  1115. return [argument < 0 ? argument + length : argument];
  1116. }),
  1117. even: createPositionalPseudo(function(matchIndexes, length) {
  1118. var i2 = 0;
  1119. for (; i2 < length; i2 += 2) {
  1120. matchIndexes.push(i2);
  1121. }
  1122. return matchIndexes;
  1123. }),
  1124. odd: createPositionalPseudo(function(matchIndexes, length) {
  1125. var i2 = 1;
  1126. for (; i2 < length; i2 += 2) {
  1127. matchIndexes.push(i2);
  1128. }
  1129. return matchIndexes;
  1130. }),
  1131. lt: createPositionalPseudo(function(matchIndexes, length, argument) {
  1132. var i2;
  1133. if (argument < 0) {
  1134. i2 = argument + length;
  1135. } else if (argument > length) {
  1136. i2 = length;
  1137. } else {
  1138. i2 = argument;
  1139. }
  1140. for (; --i2 >= 0; ) {
  1141. matchIndexes.push(i2);
  1142. }
  1143. return matchIndexes;
  1144. }),
  1145. gt: createPositionalPseudo(function(matchIndexes, length, argument) {
  1146. var i2 = argument < 0 ? argument + length : argument;
  1147. for (; ++i2 < length; ) {
  1148. matchIndexes.push(i2);
  1149. }
  1150. return matchIndexes;
  1151. })
  1152. }
  1153. };
  1154. Expr.pseudos.nth = Expr.pseudos.eq;
  1155. for (i in { radio: true, checkbox: true, file: true, password: true, image: true }) {
  1156. Expr.pseudos[i] = createInputPseudo(i);
  1157. }
  1158. for (i in { submit: true, reset: true }) {
  1159. Expr.pseudos[i] = createButtonPseudo(i);
  1160. }
  1161. function setFilters() {
  1162. }
  1163. setFilters.prototype = Expr.filters = Expr.pseudos;
  1164. Expr.setFilters = new setFilters();
  1165. function tokenize(selector, parseOnly) {
  1166. var matched, match, tokens, type, soFar, groups, preFilters, cached = tokenCache[selector + " "];
  1167. if (cached) {
  1168. return parseOnly ? 0 : cached.slice(0);
  1169. }
  1170. soFar = selector;
  1171. groups = [];
  1172. preFilters = Expr.preFilter;
  1173. while (soFar) {
  1174. if (!matched || (match = rcomma.exec(soFar))) {
  1175. if (match) {
  1176. soFar = soFar.slice(match[0].length) || soFar;
  1177. }
  1178. groups.push(tokens = []);
  1179. }
  1180. matched = false;
  1181. if (match = rleadingCombinator.exec(soFar)) {
  1182. matched = match.shift();
  1183. tokens.push({
  1184. value: matched,
  1185. // Cast descendant combinators to space
  1186. type: match[0].replace(rtrimCSS, " ")
  1187. });
  1188. soFar = soFar.slice(matched.length);
  1189. }
  1190. for (type in Expr.filter) {
  1191. if ((match = matchExpr[type].exec(soFar)) && (!preFilters[type] || (match = preFilters[type](match)))) {
  1192. matched = match.shift();
  1193. tokens.push({
  1194. value: matched,
  1195. type,
  1196. matches: match
  1197. });
  1198. soFar = soFar.slice(matched.length);
  1199. }
  1200. }
  1201. if (!matched) {
  1202. break;
  1203. }
  1204. }
  1205. if (parseOnly) {
  1206. return soFar.length;
  1207. }
  1208. return soFar ? find.error(selector) : (
  1209. // Cache the tokens
  1210. tokenCache(selector, groups).slice(0)
  1211. );
  1212. }
  1213. function toSelector(tokens) {
  1214. var i2 = 0, len = tokens.length, selector = "";
  1215. for (; i2 < len; i2++) {
  1216. selector += tokens[i2].value;
  1217. }
  1218. return selector;
  1219. }
  1220. function addCombinator(matcher, combinator, base) {
  1221. var dir2 = combinator.dir, skip = combinator.next, key = skip || dir2, checkNonElements = base && key === "parentNode", doneName = done++;
  1222. return combinator.first ? (
  1223. // Check against closest ancestor/preceding element
  1224. function(elem, context, xml) {
  1225. while (elem = elem[dir2]) {
  1226. if (elem.nodeType === 1 || checkNonElements) {
  1227. return matcher(elem, context, xml);
  1228. }
  1229. }
  1230. return false;
  1231. }
  1232. ) : (
  1233. // Check against all ancestor/preceding elements
  1234. function(elem, context, xml) {
  1235. var oldCache, outerCache, newCache = [dirruns, doneName];
  1236. if (xml) {
  1237. while (elem = elem[dir2]) {
  1238. if (elem.nodeType === 1 || checkNonElements) {
  1239. if (matcher(elem, context, xml)) {
  1240. return true;
  1241. }
  1242. }
  1243. }
  1244. } else {
  1245. while (elem = elem[dir2]) {
  1246. if (elem.nodeType === 1 || checkNonElements) {
  1247. outerCache = elem[expando] || (elem[expando] = {});
  1248. if (skip && nodeName(elem, skip)) {
  1249. elem = elem[dir2] || elem;
  1250. } else if ((oldCache = outerCache[key]) && oldCache[0] === dirruns && oldCache[1] === doneName) {
  1251. return newCache[2] = oldCache[2];
  1252. } else {
  1253. outerCache[key] = newCache;
  1254. if (newCache[2] = matcher(elem, context, xml)) {
  1255. return true;
  1256. }
  1257. }
  1258. }
  1259. }
  1260. }
  1261. return false;
  1262. }
  1263. );
  1264. }
  1265. function elementMatcher(matchers) {
  1266. return matchers.length > 1 ? function(elem, context, xml) {
  1267. var i2 = matchers.length;
  1268. while (i2--) {
  1269. if (!matchers[i2](elem, context, xml)) {
  1270. return false;
  1271. }
  1272. }
  1273. return true;
  1274. } : matchers[0];
  1275. }
  1276. function multipleContexts(selector, contexts, results) {
  1277. var i2 = 0, len = contexts.length;
  1278. for (; i2 < len; i2++) {
  1279. find(selector, contexts[i2], results);
  1280. }
  1281. return results;
  1282. }
  1283. function condense(unmatched, map, filter, context, xml) {
  1284. var elem, newUnmatched = [], i2 = 0, len = unmatched.length, mapped = map != null;
  1285. for (; i2 < len; i2++) {
  1286. if (elem = unmatched[i2]) {
  1287. if (!filter || filter(elem, context, xml)) {
  1288. newUnmatched.push(elem);
  1289. if (mapped) {
  1290. map.push(i2);
  1291. }
  1292. }
  1293. }
  1294. }
  1295. return newUnmatched;
  1296. }
  1297. function setMatcher(preFilter, selector, matcher, postFilter, postFinder, postSelector) {
  1298. if (postFilter && !postFilter[expando]) {
  1299. postFilter = setMatcher(postFilter);
  1300. }
  1301. if (postFinder && !postFinder[expando]) {
  1302. postFinder = setMatcher(postFinder, postSelector);
  1303. }
  1304. return markFunction(function(seed, results, context, xml) {
  1305. var temp, i2, elem, matcherOut, preMap = [], postMap = [], preexisting = results.length, elems = seed || multipleContexts(
  1306. selector || "*",
  1307. context.nodeType ? [context] : context,
  1308. []
  1309. ), matcherIn = preFilter && (seed || !selector) ? condense(elems, preMap, preFilter, context, xml) : elems;
  1310. if (matcher) {
  1311. matcherOut = postFinder || (seed ? preFilter : preexisting || postFilter) ? (
  1312. // ...intermediate processing is necessary
  1313. []
  1314. ) : (
  1315. // ...otherwise use results directly
  1316. results
  1317. );
  1318. matcher(matcherIn, matcherOut, context, xml);
  1319. } else {
  1320. matcherOut = matcherIn;
  1321. }
  1322. if (postFilter) {
  1323. temp = condense(matcherOut, postMap);
  1324. postFilter(temp, [], context, xml);
  1325. i2 = temp.length;
  1326. while (i2--) {
  1327. if (elem = temp[i2]) {
  1328. matcherOut[postMap[i2]] = !(matcherIn[postMap[i2]] = elem);
  1329. }
  1330. }
  1331. }
  1332. if (seed) {
  1333. if (postFinder || preFilter) {
  1334. if (postFinder) {
  1335. temp = [];
  1336. i2 = matcherOut.length;
  1337. while (i2--) {
  1338. if (elem = matcherOut[i2]) {
  1339. temp.push(matcherIn[i2] = elem);
  1340. }
  1341. }
  1342. postFinder(null, matcherOut = [], temp, xml);
  1343. }
  1344. i2 = matcherOut.length;
  1345. while (i2--) {
  1346. if ((elem = matcherOut[i2]) && (temp = postFinder ? indexOf.call(seed, elem) : preMap[i2]) > -1) {
  1347. seed[temp] = !(results[temp] = elem);
  1348. }
  1349. }
  1350. }
  1351. } else {
  1352. matcherOut = condense(
  1353. matcherOut === results ? matcherOut.splice(preexisting, matcherOut.length) : matcherOut
  1354. );
  1355. if (postFinder) {
  1356. postFinder(null, results, matcherOut, xml);
  1357. } else {
  1358. push2.apply(results, matcherOut);
  1359. }
  1360. }
  1361. });
  1362. }
  1363. function matcherFromTokens(tokens) {
  1364. var checkContext, matcher, j, len = tokens.length, leadingRelative = Expr.relative[tokens[0].type], implicitRelative = leadingRelative || Expr.relative[" "], i2 = leadingRelative ? 1 : 0, matchContext = addCombinator(function(elem) {
  1365. return elem === checkContext;
  1366. }, implicitRelative, true), matchAnyContext = addCombinator(function(elem) {
  1367. return indexOf.call(checkContext, elem) > -1;
  1368. }, implicitRelative, true), matchers = [function(elem, context, xml) {
  1369. var ret = !leadingRelative && (xml || context != outermostContext) || ((checkContext = context).nodeType ? matchContext(elem, context, xml) : matchAnyContext(elem, context, xml));
  1370. checkContext = null;
  1371. return ret;
  1372. }];
  1373. for (; i2 < len; i2++) {
  1374. if (matcher = Expr.relative[tokens[i2].type]) {
  1375. matchers = [addCombinator(elementMatcher(matchers), matcher)];
  1376. } else {
  1377. matcher = Expr.filter[tokens[i2].type].apply(null, tokens[i2].matches);
  1378. if (matcher[expando]) {
  1379. j = ++i2;
  1380. for (; j < len; j++) {
  1381. if (Expr.relative[tokens[j].type]) {
  1382. break;
  1383. }
  1384. }
  1385. return setMatcher(
  1386. i2 > 1 && elementMatcher(matchers),
  1387. i2 > 1 && toSelector(
  1388. // If the preceding token was a descendant combinator, insert an implicit any-element `*`
  1389. tokens.slice(0, i2 - 1).concat({ value: tokens[i2 - 2].type === " " ? "*" : "" })
  1390. ).replace(rtrimCSS, "$1"),
  1391. matcher,
  1392. i2 < j && matcherFromTokens(tokens.slice(i2, j)),
  1393. j < len && matcherFromTokens(tokens = tokens.slice(j)),
  1394. j < len && toSelector(tokens)
  1395. );
  1396. }
  1397. matchers.push(matcher);
  1398. }
  1399. }
  1400. return elementMatcher(matchers);
  1401. }
  1402. function matcherFromGroupMatchers(elementMatchers, setMatchers) {
  1403. var bySet = setMatchers.length > 0, byElement = elementMatchers.length > 0, superMatcher = function(seed, context, xml, results, outermost) {
  1404. var elem, j, matcher, matchedCount = 0, i2 = "0", unmatched = seed && [], setMatched = [], contextBackup = outermostContext, elems = seed || byElement && Expr.find.TAG("*", outermost), dirrunsUnique = dirruns += contextBackup == null ? 1 : Math.random() || 0.1, len = elems.length;
  1405. if (outermost) {
  1406. outermostContext = context == document3 || context || outermost;
  1407. }
  1408. for (; i2 !== len && (elem = elems[i2]) != null; i2++) {
  1409. if (byElement && elem) {
  1410. j = 0;
  1411. if (!context && elem.ownerDocument != document3) {
  1412. setDocument(elem);
  1413. xml = !documentIsHTML;
  1414. }
  1415. while (matcher = elementMatchers[j++]) {
  1416. if (matcher(elem, context || document3, xml)) {
  1417. push2.call(results, elem);
  1418. break;
  1419. }
  1420. }
  1421. if (outermost) {
  1422. dirruns = dirrunsUnique;
  1423. }
  1424. }
  1425. if (bySet) {
  1426. if (elem = !matcher && elem) {
  1427. matchedCount--;
  1428. }
  1429. if (seed) {
  1430. unmatched.push(elem);
  1431. }
  1432. }
  1433. }
  1434. matchedCount += i2;
  1435. if (bySet && i2 !== matchedCount) {
  1436. j = 0;
  1437. while (matcher = setMatchers[j++]) {
  1438. matcher(unmatched, setMatched, context, xml);
  1439. }
  1440. if (seed) {
  1441. if (matchedCount > 0) {
  1442. while (i2--) {
  1443. if (!(unmatched[i2] || setMatched[i2])) {
  1444. setMatched[i2] = pop.call(results);
  1445. }
  1446. }
  1447. }
  1448. setMatched = condense(setMatched);
  1449. }
  1450. push2.apply(results, setMatched);
  1451. if (outermost && !seed && setMatched.length > 0 && matchedCount + setMatchers.length > 1) {
  1452. jQuery.uniqueSort(results);
  1453. }
  1454. }
  1455. if (outermost) {
  1456. dirruns = dirrunsUnique;
  1457. outermostContext = contextBackup;
  1458. }
  1459. return unmatched;
  1460. };
  1461. return bySet ? markFunction(superMatcher) : superMatcher;
  1462. }
  1463. function compile(selector, match) {
  1464. var i2, setMatchers = [], elementMatchers = [], cached = compilerCache[selector + " "];
  1465. if (!cached) {
  1466. if (!match) {
  1467. match = tokenize(selector);
  1468. }
  1469. i2 = match.length;
  1470. while (i2--) {
  1471. cached = matcherFromTokens(match[i2]);
  1472. if (cached[expando]) {
  1473. setMatchers.push(cached);
  1474. } else {
  1475. elementMatchers.push(cached);
  1476. }
  1477. }
  1478. cached = compilerCache(
  1479. selector,
  1480. matcherFromGroupMatchers(elementMatchers, setMatchers)
  1481. );
  1482. cached.selector = selector;
  1483. }
  1484. return cached;
  1485. }
  1486. function select(selector, context, results, seed) {
  1487. var i2, tokens, token, type, find2, compiled = typeof selector === "function" && selector, match = !seed && tokenize(selector = compiled.selector || selector);
  1488. results = results || [];
  1489. if (match.length === 1) {
  1490. tokens = match[0] = match[0].slice(0);
  1491. if (tokens.length > 2 && (token = tokens[0]).type === "ID" && context.nodeType === 9 && documentIsHTML && Expr.relative[tokens[1].type]) {
  1492. context = (Expr.find.ID(
  1493. token.matches[0].replace(runescape, funescape),
  1494. context
  1495. ) || [])[0];
  1496. if (!context) {
  1497. return results;
  1498. } else if (compiled) {
  1499. context = context.parentNode;
  1500. }
  1501. selector = selector.slice(tokens.shift().value.length);
  1502. }
  1503. i2 = matchExpr.needsContext.test(selector) ? 0 : tokens.length;
  1504. while (i2--) {
  1505. token = tokens[i2];
  1506. if (Expr.relative[type = token.type]) {
  1507. break;
  1508. }
  1509. if (find2 = Expr.find[type]) {
  1510. if (seed = find2(
  1511. token.matches[0].replace(runescape, funescape),
  1512. rsibling.test(tokens[0].type) && testContext(context.parentNode) || context
  1513. )) {
  1514. tokens.splice(i2, 1);
  1515. selector = seed.length && toSelector(tokens);
  1516. if (!selector) {
  1517. push2.apply(results, seed);
  1518. return results;
  1519. }
  1520. break;
  1521. }
  1522. }
  1523. }
  1524. }
  1525. (compiled || compile(selector, match))(
  1526. seed,
  1527. context,
  1528. !documentIsHTML,
  1529. results,
  1530. !context || rsibling.test(selector) && testContext(context.parentNode) || context
  1531. );
  1532. return results;
  1533. }
  1534. support.sortStable = expando.split("").sort(sortOrder).join("") === expando;
  1535. setDocument();
  1536. support.sortDetached = assert(function(el) {
  1537. return el.compareDocumentPosition(document3.createElement("fieldset")) & 1;
  1538. });
  1539. jQuery.find = find;
  1540. jQuery.expr[":"] = jQuery.expr.pseudos;
  1541. jQuery.unique = jQuery.uniqueSort;
  1542. find.compile = compile;
  1543. find.select = select;
  1544. find.setDocument = setDocument;
  1545. find.tokenize = tokenize;
  1546. find.escape = jQuery.escapeSelector;
  1547. find.getText = jQuery.text;
  1548. find.isXML = jQuery.isXMLDoc;
  1549. find.selectors = jQuery.expr;
  1550. find.support = jQuery.support;
  1551. find.uniqueSort = jQuery.uniqueSort;
  1552. })();
  1553. var dir = function(elem, dir2, until) {
  1554. var matched = [], truncate = until !== void 0;
  1555. while ((elem = elem[dir2]) && elem.nodeType !== 9) {
  1556. if (elem.nodeType === 1) {
  1557. if (truncate && jQuery(elem).is(until)) {
  1558. break;
  1559. }
  1560. matched.push(elem);
  1561. }
  1562. }
  1563. return matched;
  1564. };
  1565. var siblings = function(n, elem) {
  1566. var matched = [];
  1567. for (; n; n = n.nextSibling) {
  1568. if (n.nodeType === 1 && n !== elem) {
  1569. matched.push(n);
  1570. }
  1571. }
  1572. return matched;
  1573. };
  1574. var rneedsContext = jQuery.expr.match.needsContext;
  1575. var rsingleTag = /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;
  1576. function winnow(elements, qualifier, not) {
  1577. if (isFunction(qualifier)) {
  1578. return jQuery.grep(elements, function(elem, i) {
  1579. return !!qualifier.call(elem, i, elem) !== not;
  1580. });
  1581. }
  1582. if (qualifier.nodeType) {
  1583. return jQuery.grep(elements, function(elem) {
  1584. return elem === qualifier !== not;
  1585. });
  1586. }
  1587. if (typeof qualifier !== "string") {
  1588. return jQuery.grep(elements, function(elem) {
  1589. return indexOf.call(qualifier, elem) > -1 !== not;
  1590. });
  1591. }
  1592. return jQuery.filter(qualifier, elements, not);
  1593. }
  1594. jQuery.filter = function(expr, elems, not) {
  1595. var elem = elems[0];
  1596. if (not) {
  1597. expr = ":not(" + expr + ")";
  1598. }
  1599. if (elems.length === 1 && elem.nodeType === 1) {
  1600. return jQuery.find.matchesSelector(elem, expr) ? [elem] : [];
  1601. }
  1602. return jQuery.find.matches(expr, jQuery.grep(elems, function(elem2) {
  1603. return elem2.nodeType === 1;
  1604. }));
  1605. };
  1606. jQuery.fn.extend({
  1607. find: function(selector) {
  1608. var i, ret, len = this.length, self2 = this;
  1609. if (typeof selector !== "string") {
  1610. return this.pushStack(jQuery(selector).filter(function() {
  1611. for (i = 0; i < len; i++) {
  1612. if (jQuery.contains(self2[i], this)) {
  1613. return true;
  1614. }
  1615. }
  1616. }));
  1617. }
  1618. ret = this.pushStack([]);
  1619. for (i = 0; i < len; i++) {
  1620. jQuery.find(selector, self2[i], ret);
  1621. }
  1622. return len > 1 ? jQuery.uniqueSort(ret) : ret;
  1623. },
  1624. filter: function(selector) {
  1625. return this.pushStack(winnow(this, selector || [], false));
  1626. },
  1627. not: function(selector) {
  1628. return this.pushStack(winnow(this, selector || [], true));
  1629. },
  1630. is: function(selector) {
  1631. return !!winnow(
  1632. this,
  1633. // If this is a positional/relative selector, check membership in the returned set
  1634. // so $("p:first").is("p:last") won't return true for a doc with two "p".
  1635. typeof selector === "string" && rneedsContext.test(selector) ? jQuery(selector) : selector || [],
  1636. false
  1637. ).length;
  1638. }
  1639. });
  1640. var rootjQuery, rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, init = jQuery.fn.init = function(selector, context, root) {
  1641. var match, elem;
  1642. if (!selector) {
  1643. return this;
  1644. }
  1645. root = root || rootjQuery;
  1646. if (typeof selector === "string") {
  1647. if (selector[0] === "<" && selector[selector.length - 1] === ">" && selector.length >= 3) {
  1648. match = [null, selector, null];
  1649. } else {
  1650. match = rquickExpr.exec(selector);
  1651. }
  1652. if (match && (match[1] || !context)) {
  1653. if (match[1]) {
  1654. context = context instanceof jQuery ? context[0] : context;
  1655. jQuery.merge(this, jQuery.parseHTML(
  1656. match[1],
  1657. context && context.nodeType ? context.ownerDocument || context : document2,
  1658. true
  1659. ));
  1660. if (rsingleTag.test(match[1]) && jQuery.isPlainObject(context)) {
  1661. for (match in context) {
  1662. if (isFunction(this[match])) {
  1663. this[match](context[match]);
  1664. } else {
  1665. this.attr(match, context[match]);
  1666. }
  1667. }
  1668. }
  1669. return this;
  1670. } else {
  1671. elem = document2.getElementById(match[2]);
  1672. if (elem) {
  1673. this[0] = elem;
  1674. this.length = 1;
  1675. }
  1676. return this;
  1677. }
  1678. } else if (!context || context.jquery) {
  1679. return (context || root).find(selector);
  1680. } else {
  1681. return this.constructor(context).find(selector);
  1682. }
  1683. } else if (selector.nodeType) {
  1684. this[0] = selector;
  1685. this.length = 1;
  1686. return this;
  1687. } else if (isFunction(selector)) {
  1688. return root.ready !== void 0 ? root.ready(selector) : (
  1689. // Execute immediately if ready is not present
  1690. selector(jQuery)
  1691. );
  1692. }
  1693. return jQuery.makeArray(selector, this);
  1694. };
  1695. init.prototype = jQuery.fn;
  1696. rootjQuery = jQuery(document2);
  1697. var rparentsprev = /^(?:parents|prev(?:Until|All))/, guaranteedUnique = {
  1698. children: true,
  1699. contents: true,
  1700. next: true,
  1701. prev: true
  1702. };
  1703. jQuery.fn.extend({
  1704. has: function(target) {
  1705. var targets = jQuery(target, this), l = targets.length;
  1706. return this.filter(function() {
  1707. var i = 0;
  1708. for (; i < l; i++) {
  1709. if (jQuery.contains(this, targets[i])) {
  1710. return true;
  1711. }
  1712. }
  1713. });
  1714. },
  1715. closest: function(selectors, context) {
  1716. var cur, i = 0, l = this.length, matched = [], targets = typeof selectors !== "string" && jQuery(selectors);
  1717. if (!rneedsContext.test(selectors)) {
  1718. for (; i < l; i++) {
  1719. for (cur = this[i]; cur && cur !== context; cur = cur.parentNode) {
  1720. if (cur.nodeType < 11 && (targets ? targets.index(cur) > -1 : (
  1721. // Don't pass non-elements to jQuery#find
  1722. cur.nodeType === 1 && jQuery.find.matchesSelector(cur, selectors)
  1723. ))) {
  1724. matched.push(cur);
  1725. break;
  1726. }
  1727. }
  1728. }
  1729. }
  1730. return this.pushStack(matched.length > 1 ? jQuery.uniqueSort(matched) : matched);
  1731. },
  1732. // Determine the position of an element within the set
  1733. index: function(elem) {
  1734. if (!elem) {
  1735. return this[0] && this[0].parentNode ? this.first().prevAll().length : -1;
  1736. }
  1737. if (typeof elem === "string") {
  1738. return indexOf.call(jQuery(elem), this[0]);
  1739. }
  1740. return indexOf.call(
  1741. this,
  1742. // If it receives a jQuery object, the first element is used
  1743. elem.jquery ? elem[0] : elem
  1744. );
  1745. },
  1746. add: function(selector, context) {
  1747. return this.pushStack(
  1748. jQuery.uniqueSort(
  1749. jQuery.merge(this.get(), jQuery(selector, context))
  1750. )
  1751. );
  1752. },
  1753. addBack: function(selector) {
  1754. return this.add(
  1755. selector == null ? this.prevObject : this.prevObject.filter(selector)
  1756. );
  1757. }
  1758. });
  1759. function sibling(cur, dir2) {
  1760. while ((cur = cur[dir2]) && cur.nodeType !== 1) {
  1761. }
  1762. return cur;
  1763. }
  1764. jQuery.each({
  1765. parent: function(elem) {
  1766. var parent = elem.parentNode;
  1767. return parent && parent.nodeType !== 11 ? parent : null;
  1768. },
  1769. parents: function(elem) {
  1770. return dir(elem, "parentNode");
  1771. },
  1772. parentsUntil: function(elem, _i, until) {
  1773. return dir(elem, "parentNode", until);
  1774. },
  1775. next: function(elem) {
  1776. return sibling(elem, "nextSibling");
  1777. },
  1778. prev: function(elem) {
  1779. return sibling(elem, "previousSibling");
  1780. },
  1781. nextAll: function(elem) {
  1782. return dir(elem, "nextSibling");
  1783. },
  1784. prevAll: function(elem) {
  1785. return dir(elem, "previousSibling");
  1786. },
  1787. nextUntil: function(elem, _i, until) {
  1788. return dir(elem, "nextSibling", until);
  1789. },
  1790. prevUntil: function(elem, _i, until) {
  1791. return dir(elem, "previousSibling", until);
  1792. },
  1793. siblings: function(elem) {
  1794. return siblings((elem.parentNode || {}).firstChild, elem);
  1795. },
  1796. children: function(elem) {
  1797. return siblings(elem.firstChild);
  1798. },
  1799. contents: function(elem) {
  1800. if (elem.contentDocument != null && // Support: IE 11+
  1801. // <object> elements with no `data` attribute has an object
  1802. // `contentDocument` with a `null` prototype.
  1803. getProto(elem.contentDocument)) {
  1804. return elem.contentDocument;
  1805. }
  1806. if (nodeName(elem, "template")) {
  1807. elem = elem.content || elem;
  1808. }
  1809. return jQuery.merge([], elem.childNodes);
  1810. }
  1811. }, function(name, fn) {
  1812. jQuery.fn[name] = function(until, selector) {
  1813. var matched = jQuery.map(this, fn, until);
  1814. if (name.slice(-5) !== "Until") {
  1815. selector = until;
  1816. }
  1817. if (selector && typeof selector === "string") {
  1818. matched = jQuery.filter(selector, matched);
  1819. }
  1820. if (this.length > 1) {
  1821. if (!guaranteedUnique[name]) {
  1822. jQuery.uniqueSort(matched);
  1823. }
  1824. if (rparentsprev.test(name)) {
  1825. matched.reverse();
  1826. }
  1827. }
  1828. return this.pushStack(matched);
  1829. };
  1830. });
  1831. var rnothtmlwhite = /[^\x20\t\r\n\f]+/g;
  1832. function createOptions(options) {
  1833. var object = {};
  1834. jQuery.each(options.match(rnothtmlwhite) || [], function(_, flag) {
  1835. object[flag] = true;
  1836. });
  1837. return object;
  1838. }
  1839. jQuery.Callbacks = function(options) {
  1840. options = typeof options === "string" ? createOptions(options) : jQuery.extend({}, options);
  1841. var firing, memory, fired, locked, list = [], queue = [], firingIndex = -1, fire = function() {
  1842. locked = locked || options.once;
  1843. fired = firing = true;
  1844. for (; queue.length; firingIndex = -1) {
  1845. memory = queue.shift();
  1846. while (++firingIndex < list.length) {
  1847. if (list[firingIndex].apply(memory[0], memory[1]) === false && options.stopOnFalse) {
  1848. firingIndex = list.length;
  1849. memory = false;
  1850. }
  1851. }
  1852. }
  1853. if (!options.memory) {
  1854. memory = false;
  1855. }
  1856. firing = false;
  1857. if (locked) {
  1858. if (memory) {
  1859. list = [];
  1860. } else {
  1861. list = "";
  1862. }
  1863. }
  1864. }, self2 = {
  1865. // Add a callback or a collection of callbacks to the list
  1866. add: function() {
  1867. if (list) {
  1868. if (memory && !firing) {
  1869. firingIndex = list.length - 1;
  1870. queue.push(memory);
  1871. }
  1872. (function add(args) {
  1873. jQuery.each(args, function(_, arg) {
  1874. if (isFunction(arg)) {
  1875. if (!options.unique || !self2.has(arg)) {
  1876. list.push(arg);
  1877. }
  1878. } else if (arg && arg.length && toType(arg) !== "string") {
  1879. add(arg);
  1880. }
  1881. });
  1882. })(arguments);
  1883. if (memory && !firing) {
  1884. fire();
  1885. }
  1886. }
  1887. return this;
  1888. },
  1889. // Remove a callback from the list
  1890. remove: function() {
  1891. jQuery.each(arguments, function(_, arg) {
  1892. var index;
  1893. while ((index = jQuery.inArray(arg, list, index)) > -1) {
  1894. list.splice(index, 1);
  1895. if (index <= firingIndex) {
  1896. firingIndex--;
  1897. }
  1898. }
  1899. });
  1900. return this;
  1901. },
  1902. // Check if a given callback is in the list.
  1903. // If no argument is given, return whether or not list has callbacks attached.
  1904. has: function(fn) {
  1905. return fn ? jQuery.inArray(fn, list) > -1 : list.length > 0;
  1906. },
  1907. // Remove all callbacks from the list
  1908. empty: function() {
  1909. if (list) {
  1910. list = [];
  1911. }
  1912. return this;
  1913. },
  1914. // Disable .fire and .add
  1915. // Abort any current/pending executions
  1916. // Clear all callbacks and values
  1917. disable: function() {
  1918. locked = queue = [];
  1919. list = memory = "";
  1920. return this;
  1921. },
  1922. disabled: function() {
  1923. return !list;
  1924. },
  1925. // Disable .fire
  1926. // Also disable .add unless we have memory (since it would have no effect)
  1927. // Abort any pending executions
  1928. lock: function() {
  1929. locked = queue = [];
  1930. if (!memory && !firing) {
  1931. list = memory = "";
  1932. }
  1933. return this;
  1934. },
  1935. locked: function() {
  1936. return !!locked;
  1937. },
  1938. // Call all callbacks with the given context and arguments
  1939. fireWith: function(context, args) {
  1940. if (!locked) {
  1941. args = args || [];
  1942. args = [context, args.slice ? args.slice() : args];
  1943. queue.push(args);
  1944. if (!firing) {
  1945. fire();
  1946. }
  1947. }
  1948. return this;
  1949. },
  1950. // Call all the callbacks with the given arguments
  1951. fire: function() {
  1952. self2.fireWith(this, arguments);
  1953. return this;
  1954. },
  1955. // To know if the callbacks have already been called at least once
  1956. fired: function() {
  1957. return !!fired;
  1958. }
  1959. };
  1960. return self2;
  1961. };
  1962. function Identity(v) {
  1963. return v;
  1964. }
  1965. function Thrower(ex) {
  1966. throw ex;
  1967. }
  1968. function adoptValue(value, resolve, reject, noValue) {
  1969. var method;
  1970. try {
  1971. if (value && isFunction(method = value.promise)) {
  1972. method.call(value).done(resolve).fail(reject);
  1973. } else if (value && isFunction(method = value.then)) {
  1974. method.call(value, resolve, reject);
  1975. } else {
  1976. resolve.apply(void 0, [value].slice(noValue));
  1977. }
  1978. } catch (value2) {
  1979. reject.apply(void 0, [value2]);
  1980. }
  1981. }
  1982. jQuery.extend({
  1983. Deferred: function(func) {
  1984. var tuples = [
  1985. // action, add listener, callbacks,
  1986. // ... .then handlers, argument index, [final state]
  1987. [
  1988. "notify",
  1989. "progress",
  1990. jQuery.Callbacks("memory"),
  1991. jQuery.Callbacks("memory"),
  1992. 2
  1993. ],
  1994. [
  1995. "resolve",
  1996. "done",
  1997. jQuery.Callbacks("once memory"),
  1998. jQuery.Callbacks("once memory"),
  1999. 0,
  2000. "resolved"
  2001. ],
  2002. [
  2003. "reject",
  2004. "fail",
  2005. jQuery.Callbacks("once memory"),
  2006. jQuery.Callbacks("once memory"),
  2007. 1,
  2008. "rejected"
  2009. ]
  2010. ], state = "pending", promise = {
  2011. state: function() {
  2012. return state;
  2013. },
  2014. always: function() {
  2015. deferred.done(arguments).fail(arguments);
  2016. return this;
  2017. },
  2018. "catch": function(fn) {
  2019. return promise.then(null, fn);
  2020. },
  2021. // Keep pipe for back-compat
  2022. pipe: function() {
  2023. var fns = arguments;
  2024. return jQuery.Deferred(function(newDefer) {
  2025. jQuery.each(tuples, function(_i, tuple) {
  2026. var fn = isFunction(fns[tuple[4]]) && fns[tuple[4]];
  2027. deferred[tuple[1]](function() {
  2028. var returned = fn && fn.apply(this, arguments);
  2029. if (returned && isFunction(returned.promise)) {
  2030. returned.promise().progress(newDefer.notify).done(newDefer.resolve).fail(newDefer.reject);
  2031. } else {
  2032. newDefer[tuple[0] + "With"](
  2033. this,
  2034. fn ? [returned] : arguments
  2035. );
  2036. }
  2037. });
  2038. });
  2039. fns = null;
  2040. }).promise();
  2041. },
  2042. then: function(onFulfilled, onRejected, onProgress) {
  2043. var maxDepth = 0;
  2044. function resolve(depth, deferred2, handler, special) {
  2045. return function() {
  2046. var that = this, args = arguments, mightThrow = function() {
  2047. var returned, then;
  2048. if (depth < maxDepth) {
  2049. return;
  2050. }
  2051. returned = handler.apply(that, args);
  2052. if (returned === deferred2.promise()) {
  2053. throw new TypeError("Thenable self-resolution");
  2054. }
  2055. then = returned && // Support: Promises/A+ section 2.3.4
  2056. // https://promisesaplus.com/#point-64
  2057. // Only check objects and functions for thenability
  2058. (typeof returned === "object" || typeof returned === "function") && returned.then;
  2059. if (isFunction(then)) {
  2060. if (special) {
  2061. then.call(
  2062. returned,
  2063. resolve(maxDepth, deferred2, Identity, special),
  2064. resolve(maxDepth, deferred2, Thrower, special)
  2065. );
  2066. } else {
  2067. maxDepth++;
  2068. then.call(
  2069. returned,
  2070. resolve(maxDepth, deferred2, Identity, special),
  2071. resolve(maxDepth, deferred2, Thrower, special),
  2072. resolve(
  2073. maxDepth,
  2074. deferred2,
  2075. Identity,
  2076. deferred2.notifyWith
  2077. )
  2078. );
  2079. }
  2080. } else {
  2081. if (handler !== Identity) {
  2082. that = void 0;
  2083. args = [returned];
  2084. }
  2085. (special || deferred2.resolveWith)(that, args);
  2086. }
  2087. }, process = special ? mightThrow : function() {
  2088. try {
  2089. mightThrow();
  2090. } catch (e) {
  2091. if (jQuery.Deferred.exceptionHook) {
  2092. jQuery.Deferred.exceptionHook(
  2093. e,
  2094. process.error
  2095. );
  2096. }
  2097. if (depth + 1 >= maxDepth) {
  2098. if (handler !== Thrower) {
  2099. that = void 0;
  2100. args = [e];
  2101. }
  2102. deferred2.rejectWith(that, args);
  2103. }
  2104. }
  2105. };
  2106. if (depth) {
  2107. process();
  2108. } else {
  2109. if (jQuery.Deferred.getErrorHook) {
  2110. process.error = jQuery.Deferred.getErrorHook();
  2111. } else if (jQuery.Deferred.getStackHook) {
  2112. process.error = jQuery.Deferred.getStackHook();
  2113. }
  2114. window2.setTimeout(process);
  2115. }
  2116. };
  2117. }
  2118. return jQuery.Deferred(function(newDefer) {
  2119. tuples[0][3].add(
  2120. resolve(
  2121. 0,
  2122. newDefer,
  2123. isFunction(onProgress) ? onProgress : Identity,
  2124. newDefer.notifyWith
  2125. )
  2126. );
  2127. tuples[1][3].add(
  2128. resolve(
  2129. 0,
  2130. newDefer,
  2131. isFunction(onFulfilled) ? onFulfilled : Identity
  2132. )
  2133. );
  2134. tuples[2][3].add(
  2135. resolve(
  2136. 0,
  2137. newDefer,
  2138. isFunction(onRejected) ? onRejected : Thrower
  2139. )
  2140. );
  2141. }).promise();
  2142. },
  2143. // Get a promise for this deferred
  2144. // If obj is provided, the promise aspect is added to the object
  2145. promise: function(obj) {
  2146. return obj != null ? jQuery.extend(obj, promise) : promise;
  2147. }
  2148. }, deferred = {};
  2149. jQuery.each(tuples, function(i, tuple) {
  2150. var list = tuple[2], stateString = tuple[5];
  2151. promise[tuple[1]] = list.add;
  2152. if (stateString) {
  2153. list.add(
  2154. function() {
  2155. state = stateString;
  2156. },
  2157. // rejected_callbacks.disable
  2158. // fulfilled_callbacks.disable
  2159. tuples[3 - i][2].disable,
  2160. // rejected_handlers.disable
  2161. // fulfilled_handlers.disable
  2162. tuples[3 - i][3].disable,
  2163. // progress_callbacks.lock
  2164. tuples[0][2].lock,
  2165. // progress_handlers.lock
  2166. tuples[0][3].lock
  2167. );
  2168. }
  2169. list.add(tuple[3].fire);
  2170. deferred[tuple[0]] = function() {
  2171. deferred[tuple[0] + "With"](this === deferred ? void 0 : this, arguments);
  2172. return this;
  2173. };
  2174. deferred[tuple[0] + "With"] = list.fireWith;
  2175. });
  2176. promise.promise(deferred);
  2177. if (func) {
  2178. func.call(deferred, deferred);
  2179. }
  2180. return deferred;
  2181. },
  2182. // Deferred helper
  2183. when: function(singleValue) {
  2184. var remaining = arguments.length, i = remaining, resolveContexts = Array(i), resolveValues = slice.call(arguments), primary = jQuery.Deferred(), updateFunc = function(i2) {
  2185. return function(value) {
  2186. resolveContexts[i2] = this;
  2187. resolveValues[i2] = arguments.length > 1 ? slice.call(arguments) : value;
  2188. if (!--remaining) {
  2189. primary.resolveWith(resolveContexts, resolveValues);
  2190. }
  2191. };
  2192. };
  2193. if (remaining <= 1) {
  2194. adoptValue(
  2195. singleValue,
  2196. primary.done(updateFunc(i)).resolve,
  2197. primary.reject,
  2198. !remaining
  2199. );
  2200. if (primary.state() === "pending" || isFunction(resolveValues[i] && resolveValues[i].then)) {
  2201. return primary.then();
  2202. }
  2203. }
  2204. while (i--) {
  2205. adoptValue(resolveValues[i], updateFunc(i), primary.reject);
  2206. }
  2207. return primary.promise();
  2208. }
  2209. });
  2210. var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
  2211. jQuery.Deferred.exceptionHook = function(error, asyncError) {
  2212. if (window2.console && window2.console.warn && error && rerrorNames.test(error.name)) {
  2213. window2.console.warn(
  2214. "jQuery.Deferred exception: " + error.message,
  2215. error.stack,
  2216. asyncError
  2217. );
  2218. }
  2219. };
  2220. jQuery.readyException = function(error) {
  2221. window2.setTimeout(function() {
  2222. throw error;
  2223. });
  2224. };
  2225. var readyList = jQuery.Deferred();
  2226. jQuery.fn.ready = function(fn) {
  2227. readyList.then(fn).catch(function(error) {
  2228. jQuery.readyException(error);
  2229. });
  2230. return this;
  2231. };
  2232. jQuery.extend({
  2233. // Is the DOM ready to be used? Set to true once it occurs.
  2234. isReady: false,
  2235. // A counter to track how many items to wait for before
  2236. // the ready event fires. See trac-6781
  2237. readyWait: 1,
  2238. // Handle when the DOM is ready
  2239. ready: function(wait) {
  2240. if (wait === true ? --jQuery.readyWait : jQuery.isReady) {
  2241. return;
  2242. }
  2243. jQuery.isReady = true;
  2244. if (wait !== true && --jQuery.readyWait > 0) {
  2245. return;
  2246. }
  2247. readyList.resolveWith(document2, [jQuery]);
  2248. }
  2249. });
  2250. jQuery.ready.then = readyList.then;
  2251. function completed() {
  2252. document2.removeEventListener("DOMContentLoaded", completed);
  2253. window2.removeEventListener("load", completed);
  2254. jQuery.ready();
  2255. }
  2256. if (document2.readyState === "complete" || document2.readyState !== "loading" && !document2.documentElement.doScroll) {
  2257. window2.setTimeout(jQuery.ready);
  2258. } else {
  2259. document2.addEventListener("DOMContentLoaded", completed);
  2260. window2.addEventListener("load", completed);
  2261. }
  2262. var access = function(elems, fn, key, value, chainable, emptyGet, raw) {
  2263. var i = 0, len = elems.length, bulk = key == null;
  2264. if (toType(key) === "object") {
  2265. chainable = true;
  2266. for (i in key) {
  2267. access(elems, fn, i, key[i], true, emptyGet, raw);
  2268. }
  2269. } else if (value !== void 0) {
  2270. chainable = true;
  2271. if (!isFunction(value)) {
  2272. raw = true;
  2273. }
  2274. if (bulk) {
  2275. if (raw) {
  2276. fn.call(elems, value);
  2277. fn = null;
  2278. } else {
  2279. bulk = fn;
  2280. fn = function(elem, _key, value2) {
  2281. return bulk.call(jQuery(elem), value2);
  2282. };
  2283. }
  2284. }
  2285. if (fn) {
  2286. for (; i < len; i++) {
  2287. fn(
  2288. elems[i],
  2289. key,
  2290. raw ? value : value.call(elems[i], i, fn(elems[i], key))
  2291. );
  2292. }
  2293. }
  2294. }
  2295. if (chainable) {
  2296. return elems;
  2297. }
  2298. if (bulk) {
  2299. return fn.call(elems);
  2300. }
  2301. return len ? fn(elems[0], key) : emptyGet;
  2302. };
  2303. var rmsPrefix = /^-ms-/, rdashAlpha = /-([a-z])/g;
  2304. function fcamelCase(_all, letter) {
  2305. return letter.toUpperCase();
  2306. }
  2307. function camelCase(string) {
  2308. return string.replace(rmsPrefix, "ms-").replace(rdashAlpha, fcamelCase);
  2309. }
  2310. var acceptData = function(owner) {
  2311. return owner.nodeType === 1 || owner.nodeType === 9 || !+owner.nodeType;
  2312. };
  2313. function Data() {
  2314. this.expando = jQuery.expando + Data.uid++;
  2315. }
  2316. Data.uid = 1;
  2317. Data.prototype = {
  2318. cache: function(owner) {
  2319. var value = owner[this.expando];
  2320. if (!value) {
  2321. value = {};
  2322. if (acceptData(owner)) {
  2323. if (owner.nodeType) {
  2324. owner[this.expando] = value;
  2325. } else {
  2326. Object.defineProperty(owner, this.expando, {
  2327. value,
  2328. configurable: true
  2329. });
  2330. }
  2331. }
  2332. }
  2333. return value;
  2334. },
  2335. set: function(owner, data, value) {
  2336. var prop, cache = this.cache(owner);
  2337. if (typeof data === "string") {
  2338. cache[camelCase(data)] = value;
  2339. } else {
  2340. for (prop in data) {
  2341. cache[camelCase(prop)] = data[prop];
  2342. }
  2343. }
  2344. return cache;
  2345. },
  2346. get: function(owner, key) {
  2347. return key === void 0 ? this.cache(owner) : (
  2348. // Always use camelCase key (gh-2257)
  2349. owner[this.expando] && owner[this.expando][camelCase(key)]
  2350. );
  2351. },
  2352. access: function(owner, key, value) {
  2353. if (key === void 0 || key && typeof key === "string" && value === void 0) {
  2354. return this.get(owner, key);
  2355. }
  2356. this.set(owner, key, value);
  2357. return value !== void 0 ? value : key;
  2358. },
  2359. remove: function(owner, key) {
  2360. var i, cache = owner[this.expando];
  2361. if (cache === void 0) {
  2362. return;
  2363. }
  2364. if (key !== void 0) {
  2365. if (Array.isArray(key)) {
  2366. key = key.map(camelCase);
  2367. } else {
  2368. key = camelCase(key);
  2369. key = key in cache ? [key] : key.match(rnothtmlwhite) || [];
  2370. }
  2371. i = key.length;
  2372. while (i--) {
  2373. delete cache[key[i]];
  2374. }
  2375. }
  2376. if (key === void 0 || jQuery.isEmptyObject(cache)) {
  2377. if (owner.nodeType) {
  2378. owner[this.expando] = void 0;
  2379. } else {
  2380. delete owner[this.expando];
  2381. }
  2382. }
  2383. },
  2384. hasData: function(owner) {
  2385. var cache = owner[this.expando];
  2386. return cache !== void 0 && !jQuery.isEmptyObject(cache);
  2387. }
  2388. };
  2389. var dataPriv = new Data();
  2390. var dataUser = new Data();
  2391. var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, rmultiDash = /[A-Z]/g;
  2392. function getData(data) {
  2393. if (data === "true") {
  2394. return true;
  2395. }
  2396. if (data === "false") {
  2397. return false;
  2398. }
  2399. if (data === "null") {
  2400. return null;
  2401. }
  2402. if (data === +data + "") {
  2403. return +data;
  2404. }
  2405. if (rbrace.test(data)) {
  2406. return JSON.parse(data);
  2407. }
  2408. return data;
  2409. }
  2410. function dataAttr(elem, key, data) {
  2411. var name;
  2412. if (data === void 0 && elem.nodeType === 1) {
  2413. name = "data-" + key.replace(rmultiDash, "-$&").toLowerCase();
  2414. data = elem.getAttribute(name);
  2415. if (typeof data === "string") {
  2416. try {
  2417. data = getData(data);
  2418. } catch (e) {
  2419. }
  2420. dataUser.set(elem, key, data);
  2421. } else {
  2422. data = void 0;
  2423. }
  2424. }
  2425. return data;
  2426. }
  2427. jQuery.extend({
  2428. hasData: function(elem) {
  2429. return dataUser.hasData(elem) || dataPriv.hasData(elem);
  2430. },
  2431. data: function(elem, name, data) {
  2432. return dataUser.access(elem, name, data);
  2433. },
  2434. removeData: function(elem, name) {
  2435. dataUser.remove(elem, name);
  2436. },
  2437. // TODO: Now that all calls to _data and _removeData have been replaced
  2438. // with direct calls to dataPriv methods, these can be deprecated.
  2439. _data: function(elem, name, data) {
  2440. return dataPriv.access(elem, name, data);
  2441. },
  2442. _removeData: function(elem, name) {
  2443. dataPriv.remove(elem, name);
  2444. }
  2445. });
  2446. jQuery.fn.extend({
  2447. data: function(key, value) {
  2448. var i, name, data, elem = this[0], attrs = elem && elem.attributes;
  2449. if (key === void 0) {
  2450. if (this.length) {
  2451. data = dataUser.get(elem);
  2452. if (elem.nodeType === 1 && !dataPriv.get(elem, "hasDataAttrs")) {
  2453. i = attrs.length;
  2454. while (i--) {
  2455. if (attrs[i]) {
  2456. name = attrs[i].name;
  2457. if (name.indexOf("data-") === 0) {
  2458. name = camelCase(name.slice(5));
  2459. dataAttr(elem, name, data[name]);
  2460. }
  2461. }
  2462. }
  2463. dataPriv.set(elem, "hasDataAttrs", true);
  2464. }
  2465. }
  2466. return data;
  2467. }
  2468. if (typeof key === "object") {
  2469. return this.each(function() {
  2470. dataUser.set(this, key);
  2471. });
  2472. }
  2473. return access(this, function(value2) {
  2474. var data2;
  2475. if (elem && value2 === void 0) {
  2476. data2 = dataUser.get(elem, key);
  2477. if (data2 !== void 0) {
  2478. return data2;
  2479. }
  2480. data2 = dataAttr(elem, key);
  2481. if (data2 !== void 0) {
  2482. return data2;
  2483. }
  2484. return;
  2485. }
  2486. this.each(function() {
  2487. dataUser.set(this, key, value2);
  2488. });
  2489. }, null, value, arguments.length > 1, null, true);
  2490. },
  2491. removeData: function(key) {
  2492. return this.each(function() {
  2493. dataUser.remove(this, key);
  2494. });
  2495. }
  2496. });
  2497. jQuery.extend({
  2498. queue: function(elem, type, data) {
  2499. var queue;
  2500. if (elem) {
  2501. type = (type || "fx") + "queue";
  2502. queue = dataPriv.get(elem, type);
  2503. if (data) {
  2504. if (!queue || Array.isArray(data)) {
  2505. queue = dataPriv.access(elem, type, jQuery.makeArray(data));
  2506. } else {
  2507. queue.push(data);
  2508. }
  2509. }
  2510. return queue || [];
  2511. }
  2512. },
  2513. dequeue: function(elem, type) {
  2514. type = type || "fx";
  2515. var queue = jQuery.queue(elem, type), startLength = queue.length, fn = queue.shift(), hooks = jQuery._queueHooks(elem, type), next = function() {
  2516. jQuery.dequeue(elem, type);
  2517. };
  2518. if (fn === "inprogress") {
  2519. fn = queue.shift();
  2520. startLength--;
  2521. }
  2522. if (fn) {
  2523. if (type === "fx") {
  2524. queue.unshift("inprogress");
  2525. }
  2526. delete hooks.stop;
  2527. fn.call(elem, next, hooks);
  2528. }
  2529. if (!startLength && hooks) {
  2530. hooks.empty.fire();
  2531. }
  2532. },
  2533. // Not public - generate a queueHooks object, or return the current one
  2534. _queueHooks: function(elem, type) {
  2535. var key = type + "queueHooks";
  2536. return dataPriv.get(elem, key) || dataPriv.access(elem, key, {
  2537. empty: jQuery.Callbacks("once memory").add(function() {
  2538. dataPriv.remove(elem, [type + "queue", key]);
  2539. })
  2540. });
  2541. }
  2542. });
  2543. jQuery.fn.extend({
  2544. queue: function(type, data) {
  2545. var setter = 2;
  2546. if (typeof type !== "string") {
  2547. data = type;
  2548. type = "fx";
  2549. setter--;
  2550. }
  2551. if (arguments.length < setter) {
  2552. return jQuery.queue(this[0], type);
  2553. }
  2554. return data === void 0 ? this : this.each(function() {
  2555. var queue = jQuery.queue(this, type, data);
  2556. jQuery._queueHooks(this, type);
  2557. if (type === "fx" && queue[0] !== "inprogress") {
  2558. jQuery.dequeue(this, type);
  2559. }
  2560. });
  2561. },
  2562. dequeue: function(type) {
  2563. return this.each(function() {
  2564. jQuery.dequeue(this, type);
  2565. });
  2566. },
  2567. clearQueue: function(type) {
  2568. return this.queue(type || "fx", []);
  2569. },
  2570. // Get a promise resolved when queues of a certain type
  2571. // are emptied (fx is the type by default)
  2572. promise: function(type, obj) {
  2573. var tmp, count = 1, defer = jQuery.Deferred(), elements = this, i = this.length, resolve = function() {
  2574. if (!--count) {
  2575. defer.resolveWith(elements, [elements]);
  2576. }
  2577. };
  2578. if (typeof type !== "string") {
  2579. obj = type;
  2580. type = void 0;
  2581. }
  2582. type = type || "fx";
  2583. while (i--) {
  2584. tmp = dataPriv.get(elements[i], type + "queueHooks");
  2585. if (tmp && tmp.empty) {
  2586. count++;
  2587. tmp.empty.add(resolve);
  2588. }
  2589. }
  2590. resolve();
  2591. return defer.promise(obj);
  2592. }
  2593. });
  2594. var pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source;
  2595. var rcssNum = new RegExp("^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i");
  2596. var cssExpand = ["Top", "Right", "Bottom", "Left"];
  2597. var documentElement = document2.documentElement;
  2598. var isAttached = function(elem) {
  2599. return jQuery.contains(elem.ownerDocument, elem);
  2600. }, composed = { composed: true };
  2601. if (documentElement.getRootNode) {
  2602. isAttached = function(elem) {
  2603. return jQuery.contains(elem.ownerDocument, elem) || elem.getRootNode(composed) === elem.ownerDocument;
  2604. };
  2605. }
  2606. var isHiddenWithinTree = function(elem, el) {
  2607. elem = el || elem;
  2608. return elem.style.display === "none" || elem.style.display === "" && // Otherwise, check computed style
  2609. // Support: Firefox <=43 - 45
  2610. // Disconnected elements can have computed display: none, so first confirm that elem is
  2611. // in the document.
  2612. isAttached(elem) && jQuery.css(elem, "display") === "none";
  2613. };
  2614. function adjustCSS(elem, prop, valueParts, tween) {
  2615. var adjusted, scale, maxIterations = 20, currentValue = tween ? function() {
  2616. return tween.cur();
  2617. } : function() {
  2618. return jQuery.css(elem, prop, "");
  2619. }, initial = currentValue(), unit = valueParts && valueParts[3] || (jQuery.cssNumber[prop] ? "" : "px"), initialInUnit = elem.nodeType && (jQuery.cssNumber[prop] || unit !== "px" && +initial) && rcssNum.exec(jQuery.css(elem, prop));
  2620. if (initialInUnit && initialInUnit[3] !== unit) {
  2621. initial = initial / 2;
  2622. unit = unit || initialInUnit[3];
  2623. initialInUnit = +initial || 1;
  2624. while (maxIterations--) {
  2625. jQuery.style(elem, prop, initialInUnit + unit);
  2626. if ((1 - scale) * (1 - (scale = currentValue() / initial || 0.5)) <= 0) {
  2627. maxIterations = 0;
  2628. }
  2629. initialInUnit = initialInUnit / scale;
  2630. }
  2631. initialInUnit = initialInUnit * 2;
  2632. jQuery.style(elem, prop, initialInUnit + unit);
  2633. valueParts = valueParts || [];
  2634. }
  2635. if (valueParts) {
  2636. initialInUnit = +initialInUnit || +initial || 0;
  2637. adjusted = valueParts[1] ? initialInUnit + (valueParts[1] + 1) * valueParts[2] : +valueParts[2];
  2638. if (tween) {
  2639. tween.unit = unit;
  2640. tween.start = initialInUnit;
  2641. tween.end = adjusted;
  2642. }
  2643. }
  2644. return adjusted;
  2645. }
  2646. var defaultDisplayMap = {};
  2647. function getDefaultDisplay(elem) {
  2648. var temp, doc = elem.ownerDocument, nodeName2 = elem.nodeName, display = defaultDisplayMap[nodeName2];
  2649. if (display) {
  2650. return display;
  2651. }
  2652. temp = doc.body.appendChild(doc.createElement(nodeName2));
  2653. display = jQuery.css(temp, "display");
  2654. temp.parentNode.removeChild(temp);
  2655. if (display === "none") {
  2656. display = "block";
  2657. }
  2658. defaultDisplayMap[nodeName2] = display;
  2659. return display;
  2660. }
  2661. function showHide(elements, show) {
  2662. var display, elem, values = [], index = 0, length = elements.length;
  2663. for (; index < length; index++) {
  2664. elem = elements[index];
  2665. if (!elem.style) {
  2666. continue;
  2667. }
  2668. display = elem.style.display;
  2669. if (show) {
  2670. if (display === "none") {
  2671. values[index] = dataPriv.get(elem, "display") || null;
  2672. if (!values[index]) {
  2673. elem.style.display = "";
  2674. }
  2675. }
  2676. if (elem.style.display === "" && isHiddenWithinTree(elem)) {
  2677. values[index] = getDefaultDisplay(elem);
  2678. }
  2679. } else {
  2680. if (display !== "none") {
  2681. values[index] = "none";
  2682. dataPriv.set(elem, "display", display);
  2683. }
  2684. }
  2685. }
  2686. for (index = 0; index < length; index++) {
  2687. if (values[index] != null) {
  2688. elements[index].style.display = values[index];
  2689. }
  2690. }
  2691. return elements;
  2692. }
  2693. jQuery.fn.extend({
  2694. show: function() {
  2695. return showHide(this, true);
  2696. },
  2697. hide: function() {
  2698. return showHide(this);
  2699. },
  2700. toggle: function(state) {
  2701. if (typeof state === "boolean") {
  2702. return state ? this.show() : this.hide();
  2703. }
  2704. return this.each(function() {
  2705. if (isHiddenWithinTree(this)) {
  2706. jQuery(this).show();
  2707. } else {
  2708. jQuery(this).hide();
  2709. }
  2710. });
  2711. }
  2712. });
  2713. var rcheckableType = /^(?:checkbox|radio)$/i;
  2714. var rtagName = /<([a-z][^\/\0>\x20\t\r\n\f]*)/i;
  2715. var rscriptType = /^$|^module$|\/(?:java|ecma)script/i;
  2716. (function() {
  2717. var fragment = document2.createDocumentFragment(), div = fragment.appendChild(document2.createElement("div")), input = document2.createElement("input");
  2718. input.setAttribute("type", "radio");
  2719. input.setAttribute("checked", "checked");
  2720. input.setAttribute("name", "t");
  2721. div.appendChild(input);
  2722. support.checkClone = div.cloneNode(true).cloneNode(true).lastChild.checked;
  2723. div.innerHTML = "<textarea>x</textarea>";
  2724. support.noCloneChecked = !!div.cloneNode(true).lastChild.defaultValue;
  2725. div.innerHTML = "<option></option>";
  2726. support.option = !!div.lastChild;
  2727. })();
  2728. var wrapMap = {
  2729. // XHTML parsers do not magically insert elements in the
  2730. // same way that tag soup parsers do. So we cannot shorten
  2731. // this by omitting <tbody> or other required elements.
  2732. thead: [1, "<table>", "</table>"],
  2733. col: [2, "<table><colgroup>", "</colgroup></table>"],
  2734. tr: [2, "<table><tbody>", "</tbody></table>"],
  2735. td: [3, "<table><tbody><tr>", "</tr></tbody></table>"],
  2736. _default: [0, "", ""]
  2737. };
  2738. wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
  2739. wrapMap.th = wrapMap.td;
  2740. if (!support.option) {
  2741. wrapMap.optgroup = wrapMap.option = [1, "<select multiple='multiple'>", "</select>"];
  2742. }
  2743. function getAll(context, tag) {
  2744. var ret;
  2745. if (typeof context.getElementsByTagName !== "undefined") {
  2746. ret = context.getElementsByTagName(tag || "*");
  2747. } else if (typeof context.querySelectorAll !== "undefined") {
  2748. ret = context.querySelectorAll(tag || "*");
  2749. } else {
  2750. ret = [];
  2751. }
  2752. if (tag === void 0 || tag && nodeName(context, tag)) {
  2753. return jQuery.merge([context], ret);
  2754. }
  2755. return ret;
  2756. }
  2757. function setGlobalEval(elems, refElements) {
  2758. var i = 0, l = elems.length;
  2759. for (; i < l; i++) {
  2760. dataPriv.set(
  2761. elems[i],
  2762. "globalEval",
  2763. !refElements || dataPriv.get(refElements[i], "globalEval")
  2764. );
  2765. }
  2766. }
  2767. var rhtml = /<|&#?\w+;/;
  2768. function buildFragment(elems, context, scripts, selection, ignored) {
  2769. var elem, tmp, tag, wrap, attached, j, fragment = context.createDocumentFragment(), nodes = [], i = 0, l = elems.length;
  2770. for (; i < l; i++) {
  2771. elem = elems[i];
  2772. if (elem || elem === 0) {
  2773. if (toType(elem) === "object") {
  2774. jQuery.merge(nodes, elem.nodeType ? [elem] : elem);
  2775. } else if (!rhtml.test(elem)) {
  2776. nodes.push(context.createTextNode(elem));
  2777. } else {
  2778. tmp = tmp || fragment.appendChild(context.createElement("div"));
  2779. tag = (rtagName.exec(elem) || ["", ""])[1].toLowerCase();
  2780. wrap = wrapMap[tag] || wrapMap._default;
  2781. tmp.innerHTML = wrap[1] + jQuery.htmlPrefilter(elem) + wrap[2];
  2782. j = wrap[0];
  2783. while (j--) {
  2784. tmp = tmp.lastChild;
  2785. }
  2786. jQuery.merge(nodes, tmp.childNodes);
  2787. tmp = fragment.firstChild;
  2788. tmp.textContent = "";
  2789. }
  2790. }
  2791. }
  2792. fragment.textContent = "";
  2793. i = 0;
  2794. while (elem = nodes[i++]) {
  2795. if (selection && jQuery.inArray(elem, selection) > -1) {
  2796. if (ignored) {
  2797. ignored.push(elem);
  2798. }
  2799. continue;
  2800. }
  2801. attached = isAttached(elem);
  2802. tmp = getAll(fragment.appendChild(elem), "script");
  2803. if (attached) {
  2804. setGlobalEval(tmp);
  2805. }
  2806. if (scripts) {
  2807. j = 0;
  2808. while (elem = tmp[j++]) {
  2809. if (rscriptType.test(elem.type || "")) {
  2810. scripts.push(elem);
  2811. }
  2812. }
  2813. }
  2814. }
  2815. return fragment;
  2816. }
  2817. var rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
  2818. function returnTrue() {
  2819. return true;
  2820. }
  2821. function returnFalse() {
  2822. return false;
  2823. }
  2824. function on(elem, types, selector, data, fn, one) {
  2825. var origFn, type;
  2826. if (typeof types === "object") {
  2827. if (typeof selector !== "string") {
  2828. data = data || selector;
  2829. selector = void 0;
  2830. }
  2831. for (type in types) {
  2832. on(elem, type, selector, data, types[type], one);
  2833. }
  2834. return elem;
  2835. }
  2836. if (data == null && fn == null) {
  2837. fn = selector;
  2838. data = selector = void 0;
  2839. } else if (fn == null) {
  2840. if (typeof selector === "string") {
  2841. fn = data;
  2842. data = void 0;
  2843. } else {
  2844. fn = data;
  2845. data = selector;
  2846. selector = void 0;
  2847. }
  2848. }
  2849. if (fn === false) {
  2850. fn = returnFalse;
  2851. } else if (!fn) {
  2852. return elem;
  2853. }
  2854. if (one === 1) {
  2855. origFn = fn;
  2856. fn = function(event) {
  2857. jQuery().off(event);
  2858. return origFn.apply(this, arguments);
  2859. };
  2860. fn.guid = origFn.guid || (origFn.guid = jQuery.guid++);
  2861. }
  2862. return elem.each(function() {
  2863. jQuery.event.add(this, types, fn, data, selector);
  2864. });
  2865. }
  2866. jQuery.event = {
  2867. global: {},
  2868. add: function(elem, types, handler, data, selector) {
  2869. var handleObjIn, eventHandle, tmp, events, t, handleObj, special, handlers, type, namespaces, origType, elemData = dataPriv.get(elem);
  2870. if (!acceptData(elem)) {
  2871. return;
  2872. }
  2873. if (handler.handler) {
  2874. handleObjIn = handler;
  2875. handler = handleObjIn.handler;
  2876. selector = handleObjIn.selector;
  2877. }
  2878. if (selector) {
  2879. jQuery.find.matchesSelector(documentElement, selector);
  2880. }
  2881. if (!handler.guid) {
  2882. handler.guid = jQuery.guid++;
  2883. }
  2884. if (!(events = elemData.events)) {
  2885. events = elemData.events = /* @__PURE__ */ Object.create(null);
  2886. }
  2887. if (!(eventHandle = elemData.handle)) {
  2888. eventHandle = elemData.handle = function(e) {
  2889. return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? jQuery.event.dispatch.apply(elem, arguments) : void 0;
  2890. };
  2891. }
  2892. types = (types || "").match(rnothtmlwhite) || [""];
  2893. t = types.length;
  2894. while (t--) {
  2895. tmp = rtypenamespace.exec(types[t]) || [];
  2896. type = origType = tmp[1];
  2897. namespaces = (tmp[2] || "").split(".").sort();
  2898. if (!type) {
  2899. continue;
  2900. }
  2901. special = jQuery.event.special[type] || {};
  2902. type = (selector ? special.delegateType : special.bindType) || type;
  2903. special = jQuery.event.special[type] || {};
  2904. handleObj = jQuery.extend({
  2905. type,
  2906. origType,
  2907. data,
  2908. handler,
  2909. guid: handler.guid,
  2910. selector,
  2911. needsContext: selector && jQuery.expr.match.needsContext.test(selector),
  2912. namespace: namespaces.join(".")
  2913. }, handleObjIn);
  2914. if (!(handlers = events[type])) {
  2915. handlers = events[type] = [];
  2916. handlers.delegateCount = 0;
  2917. if (!special.setup || special.setup.call(elem, data, namespaces, eventHandle) === false) {
  2918. if (elem.addEventListener) {
  2919. elem.addEventListener(type, eventHandle);
  2920. }
  2921. }
  2922. }
  2923. if (special.add) {
  2924. special.add.call(elem, handleObj);
  2925. if (!handleObj.handler.guid) {
  2926. handleObj.handler.guid = handler.guid;
  2927. }
  2928. }
  2929. if (selector) {
  2930. handlers.splice(handlers.delegateCount++, 0, handleObj);
  2931. } else {
  2932. handlers.push(handleObj);
  2933. }
  2934. jQuery.event.global[type] = true;
  2935. }
  2936. },
  2937. // Detach an event or set of events from an element
  2938. remove: function(elem, types, handler, selector, mappedTypes) {
  2939. var j, origCount, tmp, events, t, handleObj, special, handlers, type, namespaces, origType, elemData = dataPriv.hasData(elem) && dataPriv.get(elem);
  2940. if (!elemData || !(events = elemData.events)) {
  2941. return;
  2942. }
  2943. types = (types || "").match(rnothtmlwhite) || [""];
  2944. t = types.length;
  2945. while (t--) {
  2946. tmp = rtypenamespace.exec(types[t]) || [];
  2947. type = origType = tmp[1];
  2948. namespaces = (tmp[2] || "").split(".").sort();
  2949. if (!type) {
  2950. for (type in events) {
  2951. jQuery.event.remove(elem, type + types[t], handler, selector, true);
  2952. }
  2953. continue;
  2954. }
  2955. special = jQuery.event.special[type] || {};
  2956. type = (selector ? special.delegateType : special.bindType) || type;
  2957. handlers = events[type] || [];
  2958. tmp = tmp[2] && new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)");
  2959. origCount = j = handlers.length;
  2960. while (j--) {
  2961. handleObj = handlers[j];
  2962. if ((mappedTypes || origType === handleObj.origType) && (!handler || handler.guid === handleObj.guid) && (!tmp || tmp.test(handleObj.namespace)) && (!selector || selector === handleObj.selector || selector === "**" && handleObj.selector)) {
  2963. handlers.splice(j, 1);
  2964. if (handleObj.selector) {
  2965. handlers.delegateCount--;
  2966. }
  2967. if (special.remove) {
  2968. special.remove.call(elem, handleObj);
  2969. }
  2970. }
  2971. }
  2972. if (origCount && !handlers.length) {
  2973. if (!special.teardown || special.teardown.call(elem, namespaces, elemData.handle) === false) {
  2974. jQuery.removeEvent(elem, type, elemData.handle);
  2975. }
  2976. delete events[type];
  2977. }
  2978. }
  2979. if (jQuery.isEmptyObject(events)) {
  2980. dataPriv.remove(elem, "handle events");
  2981. }
  2982. },
  2983. dispatch: function(nativeEvent) {
  2984. var i, j, ret, matched, handleObj, handlerQueue, args = new Array(arguments.length), event = jQuery.event.fix(nativeEvent), handlers = (dataPriv.get(this, "events") || /* @__PURE__ */ Object.create(null))[event.type] || [], special = jQuery.event.special[event.type] || {};
  2985. args[0] = event;
  2986. for (i = 1; i < arguments.length; i++) {
  2987. args[i] = arguments[i];
  2988. }
  2989. event.delegateTarget = this;
  2990. if (special.preDispatch && special.preDispatch.call(this, event) === false) {
  2991. return;
  2992. }
  2993. handlerQueue = jQuery.event.handlers.call(this, event, handlers);
  2994. i = 0;
  2995. while ((matched = handlerQueue[i++]) && !event.isPropagationStopped()) {
  2996. event.currentTarget = matched.elem;
  2997. j = 0;
  2998. while ((handleObj = matched.handlers[j++]) && !event.isImmediatePropagationStopped()) {
  2999. if (!event.rnamespace || handleObj.namespace === false || event.rnamespace.test(handleObj.namespace)) {
  3000. event.handleObj = handleObj;
  3001. event.data = handleObj.data;
  3002. ret = ((jQuery.event.special[handleObj.origType] || {}).handle || handleObj.handler).apply(matched.elem, args);
  3003. if (ret !== void 0) {
  3004. if ((event.result = ret) === false) {
  3005. event.preventDefault();
  3006. event.stopPropagation();
  3007. }
  3008. }
  3009. }
  3010. }
  3011. }
  3012. if (special.postDispatch) {
  3013. special.postDispatch.call(this, event);
  3014. }
  3015. return event.result;
  3016. },
  3017. handlers: function(event, handlers) {
  3018. var i, handleObj, sel, matchedHandlers, matchedSelectors, handlerQueue = [], delegateCount = handlers.delegateCount, cur = event.target;
  3019. if (delegateCount && // Support: IE <=9
  3020. // Black-hole SVG <use> instance trees (trac-13180)
  3021. cur.nodeType && // Support: Firefox <=42
  3022. // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)
  3023. // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click
  3024. // Support: IE 11 only
  3025. // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343)
  3026. !(event.type === "click" && event.button >= 1)) {
  3027. for (; cur !== this; cur = cur.parentNode || this) {
  3028. if (cur.nodeType === 1 && !(event.type === "click" && cur.disabled === true)) {
  3029. matchedHandlers = [];
  3030. matchedSelectors = {};
  3031. for (i = 0; i < delegateCount; i++) {
  3032. handleObj = handlers[i];
  3033. sel = handleObj.selector + " ";
  3034. if (matchedSelectors[sel] === void 0) {
  3035. matchedSelectors[sel] = handleObj.needsContext ? jQuery(sel, this).index(cur) > -1 : jQuery.find(sel, this, null, [cur]).length;
  3036. }
  3037. if (matchedSelectors[sel]) {
  3038. matchedHandlers.push(handleObj);
  3039. }
  3040. }
  3041. if (matchedHandlers.length) {
  3042. handlerQueue.push({ elem: cur, handlers: matchedHandlers });
  3043. }
  3044. }
  3045. }
  3046. }
  3047. cur = this;
  3048. if (delegateCount < handlers.length) {
  3049. handlerQueue.push({ elem: cur, handlers: handlers.slice(delegateCount) });
  3050. }
  3051. return handlerQueue;
  3052. },
  3053. addProp: function(name, hook) {
  3054. Object.defineProperty(jQuery.Event.prototype, name, {
  3055. enumerable: true,
  3056. configurable: true,
  3057. get: isFunction(hook) ? function() {
  3058. if (this.originalEvent) {
  3059. return hook(this.originalEvent);
  3060. }
  3061. } : function() {
  3062. if (this.originalEvent) {
  3063. return this.originalEvent[name];
  3064. }
  3065. },
  3066. set: function(value) {
  3067. Object.defineProperty(this, name, {
  3068. enumerable: true,
  3069. configurable: true,
  3070. writable: true,
  3071. value
  3072. });
  3073. }
  3074. });
  3075. },
  3076. fix: function(originalEvent) {
  3077. return originalEvent[jQuery.expando] ? originalEvent : new jQuery.Event(originalEvent);
  3078. },
  3079. special: {
  3080. load: {
  3081. // Prevent triggered image.load events from bubbling to window.load
  3082. noBubble: true
  3083. },
  3084. click: {
  3085. // Utilize native event to ensure correct state for checkable inputs
  3086. setup: function(data) {
  3087. var el = this || data;
  3088. if (rcheckableType.test(el.type) && el.click && nodeName(el, "input")) {
  3089. leverageNative(el, "click", true);
  3090. }
  3091. return false;
  3092. },
  3093. trigger: function(data) {
  3094. var el = this || data;
  3095. if (rcheckableType.test(el.type) && el.click && nodeName(el, "input")) {
  3096. leverageNative(el, "click");
  3097. }
  3098. return true;
  3099. },
  3100. // For cross-browser consistency, suppress native .click() on links
  3101. // Also prevent it if we're currently inside a leveraged native-event stack
  3102. _default: function(event) {
  3103. var target = event.target;
  3104. return rcheckableType.test(target.type) && target.click && nodeName(target, "input") && dataPriv.get(target, "click") || nodeName(target, "a");
  3105. }
  3106. },
  3107. beforeunload: {
  3108. postDispatch: function(event) {
  3109. if (event.result !== void 0 && event.originalEvent) {
  3110. event.originalEvent.returnValue = event.result;
  3111. }
  3112. }
  3113. }
  3114. }
  3115. };
  3116. function leverageNative(el, type, isSetup) {
  3117. if (!isSetup) {
  3118. if (dataPriv.get(el, type) === void 0) {
  3119. jQuery.event.add(el, type, returnTrue);
  3120. }
  3121. return;
  3122. }
  3123. dataPriv.set(el, type, false);
  3124. jQuery.event.add(el, type, {
  3125. namespace: false,
  3126. handler: function(event) {
  3127. var result, saved = dataPriv.get(this, type);
  3128. if (event.isTrigger & 1 && this[type]) {
  3129. if (!saved) {
  3130. saved = slice.call(arguments);
  3131. dataPriv.set(this, type, saved);
  3132. this[type]();
  3133. result = dataPriv.get(this, type);
  3134. dataPriv.set(this, type, false);
  3135. if (saved !== result) {
  3136. event.stopImmediatePropagation();
  3137. event.preventDefault();
  3138. return result;
  3139. }
  3140. } else if ((jQuery.event.special[type] || {}).delegateType) {
  3141. event.stopPropagation();
  3142. }
  3143. } else if (saved) {
  3144. dataPriv.set(this, type, jQuery.event.trigger(
  3145. saved[0],
  3146. saved.slice(1),
  3147. this
  3148. ));
  3149. event.stopPropagation();
  3150. event.isImmediatePropagationStopped = returnTrue;
  3151. }
  3152. }
  3153. });
  3154. }
  3155. jQuery.removeEvent = function(elem, type, handle) {
  3156. if (elem.removeEventListener) {
  3157. elem.removeEventListener(type, handle);
  3158. }
  3159. };
  3160. jQuery.Event = function(src, props) {
  3161. if (!(this instanceof jQuery.Event)) {
  3162. return new jQuery.Event(src, props);
  3163. }
  3164. if (src && src.type) {
  3165. this.originalEvent = src;
  3166. this.type = src.type;
  3167. this.isDefaultPrevented = src.defaultPrevented || src.defaultPrevented === void 0 && // Support: Android <=2.3 only
  3168. src.returnValue === false ? returnTrue : returnFalse;
  3169. this.target = src.target && src.target.nodeType === 3 ? src.target.parentNode : src.target;
  3170. this.currentTarget = src.currentTarget;
  3171. this.relatedTarget = src.relatedTarget;
  3172. } else {
  3173. this.type = src;
  3174. }
  3175. if (props) {
  3176. jQuery.extend(this, props);
  3177. }
  3178. this.timeStamp = src && src.timeStamp || Date.now();
  3179. this[jQuery.expando] = true;
  3180. };
  3181. jQuery.Event.prototype = {
  3182. constructor: jQuery.Event,
  3183. isDefaultPrevented: returnFalse,
  3184. isPropagationStopped: returnFalse,
  3185. isImmediatePropagationStopped: returnFalse,
  3186. isSimulated: false,
  3187. preventDefault: function() {
  3188. var e = this.originalEvent;
  3189. this.isDefaultPrevented = returnTrue;
  3190. if (e && !this.isSimulated) {
  3191. e.preventDefault();
  3192. }
  3193. },
  3194. stopPropagation: function() {
  3195. var e = this.originalEvent;
  3196. this.isPropagationStopped = returnTrue;
  3197. if (e && !this.isSimulated) {
  3198. e.stopPropagation();
  3199. }
  3200. },
  3201. stopImmediatePropagation: function() {
  3202. var e = this.originalEvent;
  3203. this.isImmediatePropagationStopped = returnTrue;
  3204. if (e && !this.isSimulated) {
  3205. e.stopImmediatePropagation();
  3206. }
  3207. this.stopPropagation();
  3208. }
  3209. };
  3210. jQuery.each({
  3211. altKey: true,
  3212. bubbles: true,
  3213. cancelable: true,
  3214. changedTouches: true,
  3215. ctrlKey: true,
  3216. detail: true,
  3217. eventPhase: true,
  3218. metaKey: true,
  3219. pageX: true,
  3220. pageY: true,
  3221. shiftKey: true,
  3222. view: true,
  3223. "char": true,
  3224. code: true,
  3225. charCode: true,
  3226. key: true,
  3227. keyCode: true,
  3228. button: true,
  3229. buttons: true,
  3230. clientX: true,
  3231. clientY: true,
  3232. offsetX: true,
  3233. offsetY: true,
  3234. pointerId: true,
  3235. pointerType: true,
  3236. screenX: true,
  3237. screenY: true,
  3238. targetTouches: true,
  3239. toElement: true,
  3240. touches: true,
  3241. which: true
  3242. }, jQuery.event.addProp);
  3243. jQuery.each({ focus: "focusin", blur: "focusout" }, function(type, delegateType) {
  3244. function focusMappedHandler(nativeEvent) {
  3245. if (document2.documentMode) {
  3246. var handle = dataPriv.get(this, "handle"), event = jQuery.event.fix(nativeEvent);
  3247. event.type = nativeEvent.type === "focusin" ? "focus" : "blur";
  3248. event.isSimulated = true;
  3249. handle(nativeEvent);
  3250. if (event.target === event.currentTarget) {
  3251. handle(event);
  3252. }
  3253. } else {
  3254. jQuery.event.simulate(
  3255. delegateType,
  3256. nativeEvent.target,
  3257. jQuery.event.fix(nativeEvent)
  3258. );
  3259. }
  3260. }
  3261. jQuery.event.special[type] = {
  3262. // Utilize native event if possible so blur/focus sequence is correct
  3263. setup: function() {
  3264. var attaches;
  3265. leverageNative(this, type, true);
  3266. if (document2.documentMode) {
  3267. attaches = dataPriv.get(this, delegateType);
  3268. if (!attaches) {
  3269. this.addEventListener(delegateType, focusMappedHandler);
  3270. }
  3271. dataPriv.set(this, delegateType, (attaches || 0) + 1);
  3272. } else {
  3273. return false;
  3274. }
  3275. },
  3276. trigger: function() {
  3277. leverageNative(this, type);
  3278. return true;
  3279. },
  3280. teardown: function() {
  3281. var attaches;
  3282. if (document2.documentMode) {
  3283. attaches = dataPriv.get(this, delegateType) - 1;
  3284. if (!attaches) {
  3285. this.removeEventListener(delegateType, focusMappedHandler);
  3286. dataPriv.remove(this, delegateType);
  3287. } else {
  3288. dataPriv.set(this, delegateType, attaches);
  3289. }
  3290. } else {
  3291. return false;
  3292. }
  3293. },
  3294. // Suppress native focus or blur if we're currently inside
  3295. // a leveraged native-event stack
  3296. _default: function(event) {
  3297. return dataPriv.get(event.target, type);
  3298. },
  3299. delegateType
  3300. };
  3301. jQuery.event.special[delegateType] = {
  3302. setup: function() {
  3303. var doc = this.ownerDocument || this.document || this, dataHolder = document2.documentMode ? this : doc, attaches = dataPriv.get(dataHolder, delegateType);
  3304. if (!attaches) {
  3305. if (document2.documentMode) {
  3306. this.addEventListener(delegateType, focusMappedHandler);
  3307. } else {
  3308. doc.addEventListener(type, focusMappedHandler, true);
  3309. }
  3310. }
  3311. dataPriv.set(dataHolder, delegateType, (attaches || 0) + 1);
  3312. },
  3313. teardown: function() {
  3314. var doc = this.ownerDocument || this.document || this, dataHolder = document2.documentMode ? this : doc, attaches = dataPriv.get(dataHolder, delegateType) - 1;
  3315. if (!attaches) {
  3316. if (document2.documentMode) {
  3317. this.removeEventListener(delegateType, focusMappedHandler);
  3318. } else {
  3319. doc.removeEventListener(type, focusMappedHandler, true);
  3320. }
  3321. dataPriv.remove(dataHolder, delegateType);
  3322. } else {
  3323. dataPriv.set(dataHolder, delegateType, attaches);
  3324. }
  3325. }
  3326. };
  3327. });
  3328. jQuery.each({
  3329. mouseenter: "mouseover",
  3330. mouseleave: "mouseout",
  3331. pointerenter: "pointerover",
  3332. pointerleave: "pointerout"
  3333. }, function(orig, fix) {
  3334. jQuery.event.special[orig] = {
  3335. delegateType: fix,
  3336. bindType: fix,
  3337. handle: function(event) {
  3338. var ret, target = this, related = event.relatedTarget, handleObj = event.handleObj;
  3339. if (!related || related !== target && !jQuery.contains(target, related)) {
  3340. event.type = handleObj.origType;
  3341. ret = handleObj.handler.apply(this, arguments);
  3342. event.type = fix;
  3343. }
  3344. return ret;
  3345. }
  3346. };
  3347. });
  3348. jQuery.fn.extend({
  3349. on: function(types, selector, data, fn) {
  3350. return on(this, types, selector, data, fn);
  3351. },
  3352. one: function(types, selector, data, fn) {
  3353. return on(this, types, selector, data, fn, 1);
  3354. },
  3355. off: function(types, selector, fn) {
  3356. var handleObj, type;
  3357. if (types && types.preventDefault && types.handleObj) {
  3358. handleObj = types.handleObj;
  3359. jQuery(types.delegateTarget).off(
  3360. handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
  3361. handleObj.selector,
  3362. handleObj.handler
  3363. );
  3364. return this;
  3365. }
  3366. if (typeof types === "object") {
  3367. for (type in types) {
  3368. this.off(type, selector, types[type]);
  3369. }
  3370. return this;
  3371. }
  3372. if (selector === false || typeof selector === "function") {
  3373. fn = selector;
  3374. selector = void 0;
  3375. }
  3376. if (fn === false) {
  3377. fn = returnFalse;
  3378. }
  3379. return this.each(function() {
  3380. jQuery.event.remove(this, types, fn, selector);
  3381. });
  3382. }
  3383. });
  3384. var rnoInnerhtml = /<script|<style|<link/i, rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, rcleanScript = /^\s*<!\[CDATA\[|\]\]>\s*$/g;
  3385. function manipulationTarget(elem, content) {
  3386. if (nodeName(elem, "table") && nodeName(content.nodeType !== 11 ? content : content.firstChild, "tr")) {
  3387. return jQuery(elem).children("tbody")[0] || elem;
  3388. }
  3389. return elem;
  3390. }
  3391. function disableScript(elem) {
  3392. elem.type = (elem.getAttribute("type") !== null) + "/" + elem.type;
  3393. return elem;
  3394. }
  3395. function restoreScript(elem) {
  3396. if ((elem.type || "").slice(0, 5) === "true/") {
  3397. elem.type = elem.type.slice(5);
  3398. } else {
  3399. elem.removeAttribute("type");
  3400. }
  3401. return elem;
  3402. }
  3403. function cloneCopyEvent(src, dest) {
  3404. var i, l, type, pdataOld, udataOld, udataCur, events;
  3405. if (dest.nodeType !== 1) {
  3406. return;
  3407. }
  3408. if (dataPriv.hasData(src)) {
  3409. pdataOld = dataPriv.get(src);
  3410. events = pdataOld.events;
  3411. if (events) {
  3412. dataPriv.remove(dest, "handle events");
  3413. for (type in events) {
  3414. for (i = 0, l = events[type].length; i < l; i++) {
  3415. jQuery.event.add(dest, type, events[type][i]);
  3416. }
  3417. }
  3418. }
  3419. }
  3420. if (dataUser.hasData(src)) {
  3421. udataOld = dataUser.access(src);
  3422. udataCur = jQuery.extend({}, udataOld);
  3423. dataUser.set(dest, udataCur);
  3424. }
  3425. }
  3426. function fixInput(src, dest) {
  3427. var nodeName2 = dest.nodeName.toLowerCase();
  3428. if (nodeName2 === "input" && rcheckableType.test(src.type)) {
  3429. dest.checked = src.checked;
  3430. } else if (nodeName2 === "input" || nodeName2 === "textarea") {
  3431. dest.defaultValue = src.defaultValue;
  3432. }
  3433. }
  3434. function domManip(collection, args, callback, ignored) {
  3435. args = flat(args);
  3436. var fragment, first, scripts, hasScripts, node, doc, i = 0, l = collection.length, iNoClone = l - 1, value = args[0], valueIsFunction = isFunction(value);
  3437. if (valueIsFunction || l > 1 && typeof value === "string" && !support.checkClone && rchecked.test(value)) {
  3438. return collection.each(function(index) {
  3439. var self2 = collection.eq(index);
  3440. if (valueIsFunction) {
  3441. args[0] = value.call(this, index, self2.html());
  3442. }
  3443. domManip(self2, args, callback, ignored);
  3444. });
  3445. }
  3446. if (l) {
  3447. fragment = buildFragment(args, collection[0].ownerDocument, false, collection, ignored);
  3448. first = fragment.firstChild;
  3449. if (fragment.childNodes.length === 1) {
  3450. fragment = first;
  3451. }
  3452. if (first || ignored) {
  3453. scripts = jQuery.map(getAll(fragment, "script"), disableScript);
  3454. hasScripts = scripts.length;
  3455. for (; i < l; i++) {
  3456. node = fragment;
  3457. if (i !== iNoClone) {
  3458. node = jQuery.clone(node, true, true);
  3459. if (hasScripts) {
  3460. jQuery.merge(scripts, getAll(node, "script"));
  3461. }
  3462. }
  3463. callback.call(collection[i], node, i);
  3464. }
  3465. if (hasScripts) {
  3466. doc = scripts[scripts.length - 1].ownerDocument;
  3467. jQuery.map(scripts, restoreScript);
  3468. for (i = 0; i < hasScripts; i++) {
  3469. node = scripts[i];
  3470. if (rscriptType.test(node.type || "") && !dataPriv.access(node, "globalEval") && jQuery.contains(doc, node)) {
  3471. if (node.src && (node.type || "").toLowerCase() !== "module") {
  3472. if (jQuery._evalUrl && !node.noModule) {
  3473. jQuery._evalUrl(node.src, {
  3474. nonce: node.nonce || node.getAttribute("nonce")
  3475. }, doc);
  3476. }
  3477. } else {
  3478. DOMEval(node.textContent.replace(rcleanScript, ""), node, doc);
  3479. }
  3480. }
  3481. }
  3482. }
  3483. }
  3484. }
  3485. return collection;
  3486. }
  3487. function remove(elem, selector, keepData) {
  3488. var node, nodes = selector ? jQuery.filter(selector, elem) : elem, i = 0;
  3489. for (; (node = nodes[i]) != null; i++) {
  3490. if (!keepData && node.nodeType === 1) {
  3491. jQuery.cleanData(getAll(node));
  3492. }
  3493. if (node.parentNode) {
  3494. if (keepData && isAttached(node)) {
  3495. setGlobalEval(getAll(node, "script"));
  3496. }
  3497. node.parentNode.removeChild(node);
  3498. }
  3499. }
  3500. return elem;
  3501. }
  3502. jQuery.extend({
  3503. htmlPrefilter: function(html) {
  3504. return html;
  3505. },
  3506. clone: function(elem, dataAndEvents, deepDataAndEvents) {
  3507. var i, l, srcElements, destElements, clone = elem.cloneNode(true), inPage = isAttached(elem);
  3508. if (!support.noCloneChecked && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem)) {
  3509. destElements = getAll(clone);
  3510. srcElements = getAll(elem);
  3511. for (i = 0, l = srcElements.length; i < l; i++) {
  3512. fixInput(srcElements[i], destElements[i]);
  3513. }
  3514. }
  3515. if (dataAndEvents) {
  3516. if (deepDataAndEvents) {
  3517. srcElements = srcElements || getAll(elem);
  3518. destElements = destElements || getAll(clone);
  3519. for (i = 0, l = srcElements.length; i < l; i++) {
  3520. cloneCopyEvent(srcElements[i], destElements[i]);
  3521. }
  3522. } else {
  3523. cloneCopyEvent(elem, clone);
  3524. }
  3525. }
  3526. destElements = getAll(clone, "script");
  3527. if (destElements.length > 0) {
  3528. setGlobalEval(destElements, !inPage && getAll(elem, "script"));
  3529. }
  3530. return clone;
  3531. },
  3532. cleanData: function(elems) {
  3533. var data, elem, type, special = jQuery.event.special, i = 0;
  3534. for (; (elem = elems[i]) !== void 0; i++) {
  3535. if (acceptData(elem)) {
  3536. if (data = elem[dataPriv.expando]) {
  3537. if (data.events) {
  3538. for (type in data.events) {
  3539. if (special[type]) {
  3540. jQuery.event.remove(elem, type);
  3541. } else {
  3542. jQuery.removeEvent(elem, type, data.handle);
  3543. }
  3544. }
  3545. }
  3546. elem[dataPriv.expando] = void 0;
  3547. }
  3548. if (elem[dataUser.expando]) {
  3549. elem[dataUser.expando] = void 0;
  3550. }
  3551. }
  3552. }
  3553. }
  3554. });
  3555. jQuery.fn.extend({
  3556. detach: function(selector) {
  3557. return remove(this, selector, true);
  3558. },
  3559. remove: function(selector) {
  3560. return remove(this, selector);
  3561. },
  3562. text: function(value) {
  3563. return access(this, function(value2) {
  3564. return value2 === void 0 ? jQuery.text(this) : this.empty().each(function() {
  3565. if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
  3566. this.textContent = value2;
  3567. }
  3568. });
  3569. }, null, value, arguments.length);
  3570. },
  3571. append: function() {
  3572. return domManip(this, arguments, function(elem) {
  3573. if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
  3574. var target = manipulationTarget(this, elem);
  3575. target.appendChild(elem);
  3576. }
  3577. });
  3578. },
  3579. prepend: function() {
  3580. return domManip(this, arguments, function(elem) {
  3581. if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
  3582. var target = manipulationTarget(this, elem);
  3583. target.insertBefore(elem, target.firstChild);
  3584. }
  3585. });
  3586. },
  3587. before: function() {
  3588. return domManip(this, arguments, function(elem) {
  3589. if (this.parentNode) {
  3590. this.parentNode.insertBefore(elem, this);
  3591. }
  3592. });
  3593. },
  3594. after: function() {
  3595. return domManip(this, arguments, function(elem) {
  3596. if (this.parentNode) {
  3597. this.parentNode.insertBefore(elem, this.nextSibling);
  3598. }
  3599. });
  3600. },
  3601. empty: function() {
  3602. var elem, i = 0;
  3603. for (; (elem = this[i]) != null; i++) {
  3604. if (elem.nodeType === 1) {
  3605. jQuery.cleanData(getAll(elem, false));
  3606. elem.textContent = "";
  3607. }
  3608. }
  3609. return this;
  3610. },
  3611. clone: function(dataAndEvents, deepDataAndEvents) {
  3612. dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
  3613. deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
  3614. return this.map(function() {
  3615. return jQuery.clone(this, dataAndEvents, deepDataAndEvents);
  3616. });
  3617. },
  3618. html: function(value) {
  3619. return access(this, function(value2) {
  3620. var elem = this[0] || {}, i = 0, l = this.length;
  3621. if (value2 === void 0 && elem.nodeType === 1) {
  3622. return elem.innerHTML;
  3623. }
  3624. if (typeof value2 === "string" && !rnoInnerhtml.test(value2) && !wrapMap[(rtagName.exec(value2) || ["", ""])[1].toLowerCase()]) {
  3625. value2 = jQuery.htmlPrefilter(value2);
  3626. try {
  3627. for (; i < l; i++) {
  3628. elem = this[i] || {};
  3629. if (elem.nodeType === 1) {
  3630. jQuery.cleanData(getAll(elem, false));
  3631. elem.innerHTML = value2;
  3632. }
  3633. }
  3634. elem = 0;
  3635. } catch (e) {
  3636. }
  3637. }
  3638. if (elem) {
  3639. this.empty().append(value2);
  3640. }
  3641. }, null, value, arguments.length);
  3642. },
  3643. replaceWith: function() {
  3644. var ignored = [];
  3645. return domManip(this, arguments, function(elem) {
  3646. var parent = this.parentNode;
  3647. if (jQuery.inArray(this, ignored) < 0) {
  3648. jQuery.cleanData(getAll(this));
  3649. if (parent) {
  3650. parent.replaceChild(elem, this);
  3651. }
  3652. }
  3653. }, ignored);
  3654. }
  3655. });
  3656. jQuery.each({
  3657. appendTo: "append",
  3658. prependTo: "prepend",
  3659. insertBefore: "before",
  3660. insertAfter: "after",
  3661. replaceAll: "replaceWith"
  3662. }, function(name, original) {
  3663. jQuery.fn[name] = function(selector) {
  3664. var elems, ret = [], insert = jQuery(selector), last = insert.length - 1, i = 0;
  3665. for (; i <= last; i++) {
  3666. elems = i === last ? this : this.clone(true);
  3667. jQuery(insert[i])[original](elems);
  3668. push.apply(ret, elems.get());
  3669. }
  3670. return this.pushStack(ret);
  3671. };
  3672. });
  3673. var rnumnonpx = new RegExp("^(" + pnum + ")(?!px)[a-z%]+$", "i");
  3674. var rcustomProp = /^--/;
  3675. var getStyles = function(elem) {
  3676. var view = elem.ownerDocument.defaultView;
  3677. if (!view || !view.opener) {
  3678. view = window2;
  3679. }
  3680. return view.getComputedStyle(elem);
  3681. };
  3682. var swap = function(elem, options, callback) {
  3683. var ret, name, old = {};
  3684. for (name in options) {
  3685. old[name] = elem.style[name];
  3686. elem.style[name] = options[name];
  3687. }
  3688. ret = callback.call(elem);
  3689. for (name in options) {
  3690. elem.style[name] = old[name];
  3691. }
  3692. return ret;
  3693. };
  3694. var rboxStyle = new RegExp(cssExpand.join("|"), "i");
  3695. (function() {
  3696. function computeStyleTests() {
  3697. if (!div) {
  3698. return;
  3699. }
  3700. container.style.cssText = "position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0";
  3701. div.style.cssText = "position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%";
  3702. documentElement.appendChild(container).appendChild(div);
  3703. var divStyle = window2.getComputedStyle(div);
  3704. pixelPositionVal = divStyle.top !== "1%";
  3705. reliableMarginLeftVal = roundPixelMeasures(divStyle.marginLeft) === 12;
  3706. div.style.right = "60%";
  3707. pixelBoxStylesVal = roundPixelMeasures(divStyle.right) === 36;
  3708. boxSizingReliableVal = roundPixelMeasures(divStyle.width) === 36;
  3709. div.style.position = "absolute";
  3710. scrollboxSizeVal = roundPixelMeasures(div.offsetWidth / 3) === 12;
  3711. documentElement.removeChild(container);
  3712. div = null;
  3713. }
  3714. function roundPixelMeasures(measure) {
  3715. return Math.round(parseFloat(measure));
  3716. }
  3717. var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, reliableTrDimensionsVal, reliableMarginLeftVal, container = document2.createElement("div"), div = document2.createElement("div");
  3718. if (!div.style) {
  3719. return;
  3720. }
  3721. div.style.backgroundClip = "content-box";
  3722. div.cloneNode(true).style.backgroundClip = "";
  3723. support.clearCloneStyle = div.style.backgroundClip === "content-box";
  3724. jQuery.extend(support, {
  3725. boxSizingReliable: function() {
  3726. computeStyleTests();
  3727. return boxSizingReliableVal;
  3728. },
  3729. pixelBoxStyles: function() {
  3730. computeStyleTests();
  3731. return pixelBoxStylesVal;
  3732. },
  3733. pixelPosition: function() {
  3734. computeStyleTests();
  3735. return pixelPositionVal;
  3736. },
  3737. reliableMarginLeft: function() {
  3738. computeStyleTests();
  3739. return reliableMarginLeftVal;
  3740. },
  3741. scrollboxSize: function() {
  3742. computeStyleTests();
  3743. return scrollboxSizeVal;
  3744. },
  3745. // Support: IE 9 - 11+, Edge 15 - 18+
  3746. // IE/Edge misreport `getComputedStyle` of table rows with width/height
  3747. // set in CSS while `offset*` properties report correct values.
  3748. // Behavior in IE 9 is more subtle than in newer versions & it passes
  3749. // some versions of this test; make sure not to make it pass there!
  3750. //
  3751. // Support: Firefox 70+
  3752. // Only Firefox includes border widths
  3753. // in computed dimensions. (gh-4529)
  3754. reliableTrDimensions: function() {
  3755. var table, tr, trChild, trStyle;
  3756. if (reliableTrDimensionsVal == null) {
  3757. table = document2.createElement("table");
  3758. tr = document2.createElement("tr");
  3759. trChild = document2.createElement("div");
  3760. table.style.cssText = "position:absolute;left:-11111px;border-collapse:separate";
  3761. tr.style.cssText = "box-sizing:content-box;border:1px solid";
  3762. tr.style.height = "1px";
  3763. trChild.style.height = "9px";
  3764. trChild.style.display = "block";
  3765. documentElement.appendChild(table).appendChild(tr).appendChild(trChild);
  3766. trStyle = window2.getComputedStyle(tr);
  3767. reliableTrDimensionsVal = parseInt(trStyle.height, 10) + parseInt(trStyle.borderTopWidth, 10) + parseInt(trStyle.borderBottomWidth, 10) === tr.offsetHeight;
  3768. documentElement.removeChild(table);
  3769. }
  3770. return reliableTrDimensionsVal;
  3771. }
  3772. });
  3773. })();
  3774. function curCSS(elem, name, computed) {
  3775. var width, minWidth, maxWidth, ret, isCustomProp = rcustomProp.test(name), style = elem.style;
  3776. computed = computed || getStyles(elem);
  3777. if (computed) {
  3778. ret = computed.getPropertyValue(name) || computed[name];
  3779. if (isCustomProp && ret) {
  3780. ret = ret.replace(rtrimCSS, "$1") || void 0;
  3781. }
  3782. if (ret === "" && !isAttached(elem)) {
  3783. ret = jQuery.style(elem, name);
  3784. }
  3785. if (!support.pixelBoxStyles() && rnumnonpx.test(ret) && rboxStyle.test(name)) {
  3786. width = style.width;
  3787. minWidth = style.minWidth;
  3788. maxWidth = style.maxWidth;
  3789. style.minWidth = style.maxWidth = style.width = ret;
  3790. ret = computed.width;
  3791. style.width = width;
  3792. style.minWidth = minWidth;
  3793. style.maxWidth = maxWidth;
  3794. }
  3795. }
  3796. return ret !== void 0 ? (
  3797. // Support: IE <=9 - 11 only
  3798. // IE returns zIndex value as an integer.
  3799. ret + ""
  3800. ) : ret;
  3801. }
  3802. function addGetHookIf(conditionFn, hookFn) {
  3803. return {
  3804. get: function() {
  3805. if (conditionFn()) {
  3806. delete this.get;
  3807. return;
  3808. }
  3809. return (this.get = hookFn).apply(this, arguments);
  3810. }
  3811. };
  3812. }
  3813. var cssPrefixes = ["Webkit", "Moz", "ms"], emptyStyle = document2.createElement("div").style, vendorProps = {};
  3814. function vendorPropName(name) {
  3815. var capName = name[0].toUpperCase() + name.slice(1), i = cssPrefixes.length;
  3816. while (i--) {
  3817. name = cssPrefixes[i] + capName;
  3818. if (name in emptyStyle) {
  3819. return name;
  3820. }
  3821. }
  3822. }
  3823. function finalPropName(name) {
  3824. var final = jQuery.cssProps[name] || vendorProps[name];
  3825. if (final) {
  3826. return final;
  3827. }
  3828. if (name in emptyStyle) {
  3829. return name;
  3830. }
  3831. return vendorProps[name] = vendorPropName(name) || name;
  3832. }
  3833. var rdisplayswap = /^(none|table(?!-c[ea]).+)/, cssShow = { position: "absolute", visibility: "hidden", display: "block" }, cssNormalTransform = {
  3834. letterSpacing: "0",
  3835. fontWeight: "400"
  3836. };
  3837. function setPositiveNumber(_elem, value, subtract) {
  3838. var matches = rcssNum.exec(value);
  3839. return matches ? (
  3840. // Guard against undefined "subtract", e.g., when used as in cssHooks
  3841. Math.max(0, matches[2] - (subtract || 0)) + (matches[3] || "px")
  3842. ) : value;
  3843. }
  3844. function boxModelAdjustment(elem, dimension, box, isBorderBox, styles, computedVal) {
  3845. var i = dimension === "width" ? 1 : 0, extra = 0, delta = 0, marginDelta = 0;
  3846. if (box === (isBorderBox ? "border" : "content")) {
  3847. return 0;
  3848. }
  3849. for (; i < 4; i += 2) {
  3850. if (box === "margin") {
  3851. marginDelta += jQuery.css(elem, box + cssExpand[i], true, styles);
  3852. }
  3853. if (!isBorderBox) {
  3854. delta += jQuery.css(elem, "padding" + cssExpand[i], true, styles);
  3855. if (box !== "padding") {
  3856. delta += jQuery.css(elem, "border" + cssExpand[i] + "Width", true, styles);
  3857. } else {
  3858. extra += jQuery.css(elem, "border" + cssExpand[i] + "Width", true, styles);
  3859. }
  3860. } else {
  3861. if (box === "content") {
  3862. delta -= jQuery.css(elem, "padding" + cssExpand[i], true, styles);
  3863. }
  3864. if (box !== "margin") {
  3865. delta -= jQuery.css(elem, "border" + cssExpand[i] + "Width", true, styles);
  3866. }
  3867. }
  3868. }
  3869. if (!isBorderBox && computedVal >= 0) {
  3870. delta += Math.max(0, Math.ceil(
  3871. elem["offset" + dimension[0].toUpperCase() + dimension.slice(1)] - computedVal - delta - extra - 0.5
  3872. // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter
  3873. // Use an explicit zero to avoid NaN (gh-3964)
  3874. )) || 0;
  3875. }
  3876. return delta + marginDelta;
  3877. }
  3878. function getWidthOrHeight(elem, dimension, extra) {
  3879. var styles = getStyles(elem), 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);
  3880. if (rnumnonpx.test(val)) {
  3881. if (!extra) {
  3882. return val;
  3883. }
  3884. val = "auto";
  3885. }
  3886. if ((!support.boxSizingReliable() && isBorderBox || // Support: IE 10 - 11+, Edge 15 - 18+
  3887. // IE/Edge misreport `getComputedStyle` of table rows with width/height
  3888. // set in CSS while `offset*` properties report correct values.
  3889. // Interestingly, in some cases IE 9 doesn't suffer from this issue.
  3890. !support.reliableTrDimensions() && nodeName(elem, "tr") || // Fall back to offsetWidth/offsetHeight when value is "auto"
  3891. // This happens for inline elements with no explicit setting (gh-3571)
  3892. val === "auto" || // Support: Android <=4.1 - 4.3 only
  3893. // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602)
  3894. !parseFloat(val) && jQuery.css(elem, "display", false, styles) === "inline") && // Make sure the element is visible & connected
  3895. elem.getClientRects().length) {
  3896. isBorderBox = jQuery.css(elem, "boxSizing", false, styles) === "border-box";
  3897. valueIsBorderBox = offsetProp in elem;
  3898. if (valueIsBorderBox) {
  3899. val = elem[offsetProp];
  3900. }
  3901. }
  3902. val = parseFloat(val) || 0;
  3903. return val + boxModelAdjustment(
  3904. elem,
  3905. dimension,
  3906. extra || (isBorderBox ? "border" : "content"),
  3907. valueIsBorderBox,
  3908. styles,
  3909. // Provide the current computed size to request scroll gutter calculation (gh-3589)
  3910. val
  3911. ) + "px";
  3912. }
  3913. jQuery.extend({
  3914. // Add in style property hooks for overriding the default
  3915. // behavior of getting and setting a style property
  3916. cssHooks: {
  3917. opacity: {
  3918. get: function(elem, computed) {
  3919. if (computed) {
  3920. var ret = curCSS(elem, "opacity");
  3921. return ret === "" ? "1" : ret;
  3922. }
  3923. }
  3924. }
  3925. },
  3926. // Don't automatically add "px" to these possibly-unitless properties
  3927. cssNumber: {
  3928. animationIterationCount: true,
  3929. aspectRatio: true,
  3930. borderImageSlice: true,
  3931. columnCount: true,
  3932. flexGrow: true,
  3933. flexShrink: true,
  3934. fontWeight: true,
  3935. gridArea: true,
  3936. gridColumn: true,
  3937. gridColumnEnd: true,
  3938. gridColumnStart: true,
  3939. gridRow: true,
  3940. gridRowEnd: true,
  3941. gridRowStart: true,
  3942. lineHeight: true,
  3943. opacity: true,
  3944. order: true,
  3945. orphans: true,
  3946. scale: true,
  3947. widows: true,
  3948. zIndex: true,
  3949. zoom: true,
  3950. // SVG-related
  3951. fillOpacity: true,
  3952. floodOpacity: true,
  3953. stopOpacity: true,
  3954. strokeMiterlimit: true,
  3955. strokeOpacity: true
  3956. },
  3957. // Add in properties whose names you wish to fix before
  3958. // setting or getting the value
  3959. cssProps: {},
  3960. // Get and set the style property on a DOM Node
  3961. style: function(elem, name, value, extra) {
  3962. if (!elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style) {
  3963. return;
  3964. }
  3965. var ret, type, hooks, origName = camelCase(name), isCustomProp = rcustomProp.test(name), style = elem.style;
  3966. if (!isCustomProp) {
  3967. name = finalPropName(origName);
  3968. }
  3969. hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName];
  3970. if (value !== void 0) {
  3971. type = typeof value;
  3972. if (type === "string" && (ret = rcssNum.exec(value)) && ret[1]) {
  3973. value = adjustCSS(elem, name, ret);
  3974. type = "number";
  3975. }
  3976. if (value == null || value !== value) {
  3977. return;
  3978. }
  3979. if (type === "number" && !isCustomProp) {
  3980. value += ret && ret[3] || (jQuery.cssNumber[origName] ? "" : "px");
  3981. }
  3982. if (!support.clearCloneStyle && value === "" && name.indexOf("background") === 0) {
  3983. style[name] = "inherit";
  3984. }
  3985. if (!hooks || !("set" in hooks) || (value = hooks.set(elem, value, extra)) !== void 0) {
  3986. if (isCustomProp) {
  3987. style.setProperty(name, value);
  3988. } else {
  3989. style[name] = value;
  3990. }
  3991. }
  3992. } else {
  3993. if (hooks && "get" in hooks && (ret = hooks.get(elem, false, extra)) !== void 0) {
  3994. return ret;
  3995. }
  3996. return style[name];
  3997. }
  3998. },
  3999. css: function(elem, name, extra, styles) {
  4000. var val, num, hooks, origName = camelCase(name), isCustomProp = rcustomProp.test(name);
  4001. if (!isCustomProp) {
  4002. name = finalPropName(origName);
  4003. }
  4004. hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName];
  4005. if (hooks && "get" in hooks) {
  4006. val = hooks.get(elem, true, extra);
  4007. }
  4008. if (val === void 0) {
  4009. val = curCSS(elem, name, styles);
  4010. }
  4011. if (val === "normal" && name in cssNormalTransform) {
  4012. val = cssNormalTransform[name];
  4013. }
  4014. if (extra === "" || extra) {
  4015. num = parseFloat(val);
  4016. return extra === true || isFinite(num) ? num || 0 : val;
  4017. }
  4018. return val;
  4019. }
  4020. });
  4021. jQuery.each(["height", "width"], function(_i, dimension) {
  4022. jQuery.cssHooks[dimension] = {
  4023. get: function(elem, computed, extra) {
  4024. if (computed) {
  4025. return rdisplayswap.test(jQuery.css(elem, "display")) && // Support: Safari 8+
  4026. // Table columns in Safari have non-zero offsetWidth & zero
  4027. // getBoundingClientRect().width unless display is changed.
  4028. // Support: IE <=11 only
  4029. // Running getBoundingClientRect on a disconnected node
  4030. // in IE throws an error.
  4031. (!elem.getClientRects().length || !elem.getBoundingClientRect().width) ? swap(elem, cssShow, function() {
  4032. return getWidthOrHeight(elem, dimension, extra);
  4033. }) : getWidthOrHeight(elem, dimension, extra);
  4034. }
  4035. },
  4036. set: function(elem, value, extra) {
  4037. var matches, styles = getStyles(elem), scrollboxSizeBuggy = !support.scrollboxSize() && styles.position === "absolute", boxSizingNeeded = scrollboxSizeBuggy || extra, isBorderBox = boxSizingNeeded && jQuery.css(elem, "boxSizing", false, styles) === "border-box", subtract = extra ? boxModelAdjustment(
  4038. elem,
  4039. dimension,
  4040. extra,
  4041. isBorderBox,
  4042. styles
  4043. ) : 0;
  4044. if (isBorderBox && scrollboxSizeBuggy) {
  4045. subtract -= Math.ceil(
  4046. elem["offset" + dimension[0].toUpperCase() + dimension.slice(1)] - parseFloat(styles[dimension]) - boxModelAdjustment(elem, dimension, "border", false, styles) - 0.5
  4047. );
  4048. }
  4049. if (subtract && (matches = rcssNum.exec(value)) && (matches[3] || "px") !== "px") {
  4050. elem.style[dimension] = value;
  4051. value = jQuery.css(elem, dimension);
  4052. }
  4053. return setPositiveNumber(elem, value, subtract);
  4054. }
  4055. };
  4056. });
  4057. jQuery.cssHooks.marginLeft = addGetHookIf(
  4058. support.reliableMarginLeft,
  4059. function(elem, computed) {
  4060. if (computed) {
  4061. return (parseFloat(curCSS(elem, "marginLeft")) || elem.getBoundingClientRect().left - swap(elem, { marginLeft: 0 }, function() {
  4062. return elem.getBoundingClientRect().left;
  4063. })) + "px";
  4064. }
  4065. }
  4066. );
  4067. jQuery.each({
  4068. margin: "",
  4069. padding: "",
  4070. border: "Width"
  4071. }, function(prefix, suffix) {
  4072. jQuery.cssHooks[prefix + suffix] = {
  4073. expand: function(value) {
  4074. var i = 0, expanded = {}, parts = typeof value === "string" ? value.split(" ") : [value];
  4075. for (; i < 4; i++) {
  4076. expanded[prefix + cssExpand[i] + suffix] = parts[i] || parts[i - 2] || parts[0];
  4077. }
  4078. return expanded;
  4079. }
  4080. };
  4081. if (prefix !== "margin") {
  4082. jQuery.cssHooks[prefix + suffix].set = setPositiveNumber;
  4083. }
  4084. });
  4085. jQuery.fn.extend({
  4086. css: function(name, value) {
  4087. return access(this, function(elem, name2, value2) {
  4088. var styles, len, map = {}, i = 0;
  4089. if (Array.isArray(name2)) {
  4090. styles = getStyles(elem);
  4091. len = name2.length;
  4092. for (; i < len; i++) {
  4093. map[name2[i]] = jQuery.css(elem, name2[i], false, styles);
  4094. }
  4095. return map;
  4096. }
  4097. return value2 !== void 0 ? jQuery.style(elem, name2, value2) : jQuery.css(elem, name2);
  4098. }, name, value, arguments.length > 1);
  4099. }
  4100. });
  4101. function Tween(elem, options, prop, end, easing) {
  4102. return new Tween.prototype.init(elem, options, prop, end, easing);
  4103. }
  4104. jQuery.Tween = Tween;
  4105. Tween.prototype = {
  4106. constructor: Tween,
  4107. init: function(elem, options, prop, end, easing, unit) {
  4108. this.elem = elem;
  4109. this.prop = prop;
  4110. this.easing = easing || jQuery.easing._default;
  4111. this.options = options;
  4112. this.start = this.now = this.cur();
  4113. this.end = end;
  4114. this.unit = unit || (jQuery.cssNumber[prop] ? "" : "px");
  4115. },
  4116. cur: function() {
  4117. var hooks = Tween.propHooks[this.prop];
  4118. return hooks && hooks.get ? hooks.get(this) : Tween.propHooks._default.get(this);
  4119. },
  4120. run: function(percent) {
  4121. var eased, hooks = Tween.propHooks[this.prop];
  4122. if (this.options.duration) {
  4123. this.pos = eased = jQuery.easing[this.easing](
  4124. percent,
  4125. this.options.duration * percent,
  4126. 0,
  4127. 1,
  4128. this.options.duration
  4129. );
  4130. } else {
  4131. this.pos = eased = percent;
  4132. }
  4133. this.now = (this.end - this.start) * eased + this.start;
  4134. if (this.options.step) {
  4135. this.options.step.call(this.elem, this.now, this);
  4136. }
  4137. if (hooks && hooks.set) {
  4138. hooks.set(this);
  4139. } else {
  4140. Tween.propHooks._default.set(this);
  4141. }
  4142. return this;
  4143. }
  4144. };
  4145. Tween.prototype.init.prototype = Tween.prototype;
  4146. Tween.propHooks = {
  4147. _default: {
  4148. get: function(tween) {
  4149. var result;
  4150. if (tween.elem.nodeType !== 1 || tween.elem[tween.prop] != null && tween.elem.style[tween.prop] == null) {
  4151. return tween.elem[tween.prop];
  4152. }
  4153. result = jQuery.css(tween.elem, tween.prop, "");
  4154. return !result || result === "auto" ? 0 : result;
  4155. },
  4156. set: function(tween) {
  4157. if (jQuery.fx.step[tween.prop]) {
  4158. jQuery.fx.step[tween.prop](tween);
  4159. } else if (tween.elem.nodeType === 1 && (jQuery.cssHooks[tween.prop] || tween.elem.style[finalPropName(tween.prop)] != null)) {
  4160. jQuery.style(tween.elem, tween.prop, tween.now + tween.unit);
  4161. } else {
  4162. tween.elem[tween.prop] = tween.now;
  4163. }
  4164. }
  4165. }
  4166. };
  4167. Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
  4168. set: function(tween) {
  4169. if (tween.elem.nodeType && tween.elem.parentNode) {
  4170. tween.elem[tween.prop] = tween.now;
  4171. }
  4172. }
  4173. };
  4174. jQuery.easing = {
  4175. linear: function(p) {
  4176. return p;
  4177. },
  4178. swing: function(p) {
  4179. return 0.5 - Math.cos(p * Math.PI) / 2;
  4180. },
  4181. _default: "swing"
  4182. };
  4183. jQuery.fx = Tween.prototype.init;
  4184. jQuery.fx.step = {};
  4185. var fxNow, inProgress, rfxtypes = /^(?:toggle|show|hide)$/, rrun = /queueHooks$/;
  4186. function schedule() {
  4187. if (inProgress) {
  4188. if (document2.hidden === false && window2.requestAnimationFrame) {
  4189. window2.requestAnimationFrame(schedule);
  4190. } else {
  4191. window2.setTimeout(schedule, jQuery.fx.interval);
  4192. }
  4193. jQuery.fx.tick();
  4194. }
  4195. }
  4196. function createFxNow() {
  4197. window2.setTimeout(function() {
  4198. fxNow = void 0;
  4199. });
  4200. return fxNow = Date.now();
  4201. }
  4202. function genFx(type, includeWidth) {
  4203. var which, i = 0, attrs = { height: type };
  4204. includeWidth = includeWidth ? 1 : 0;
  4205. for (; i < 4; i += 2 - includeWidth) {
  4206. which = cssExpand[i];
  4207. attrs["margin" + which] = attrs["padding" + which] = type;
  4208. }
  4209. if (includeWidth) {
  4210. attrs.opacity = attrs.width = type;
  4211. }
  4212. return attrs;
  4213. }
  4214. function createTween(value, prop, animation) {
  4215. var tween, collection = (Animation.tweeners[prop] || []).concat(Animation.tweeners["*"]), index = 0, length = collection.length;
  4216. for (; index < length; index++) {
  4217. if (tween = collection[index].call(animation, prop, value)) {
  4218. return tween;
  4219. }
  4220. }
  4221. }
  4222. function defaultPrefilter(elem, props, opts) {
  4223. 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");
  4224. if (!opts.queue) {
  4225. hooks = jQuery._queueHooks(elem, "fx");
  4226. if (hooks.unqueued == null) {
  4227. hooks.unqueued = 0;
  4228. oldfire = hooks.empty.fire;
  4229. hooks.empty.fire = function() {
  4230. if (!hooks.unqueued) {
  4231. oldfire();
  4232. }
  4233. };
  4234. }
  4235. hooks.unqueued++;
  4236. anim.always(function() {
  4237. anim.always(function() {
  4238. hooks.unqueued--;
  4239. if (!jQuery.queue(elem, "fx").length) {
  4240. hooks.empty.fire();
  4241. }
  4242. });
  4243. });
  4244. }
  4245. for (prop in props) {
  4246. value = props[prop];
  4247. if (rfxtypes.test(value)) {
  4248. delete props[prop];
  4249. toggle = toggle || value === "toggle";
  4250. if (value === (hidden ? "hide" : "show")) {
  4251. if (value === "show" && dataShow && dataShow[prop] !== void 0) {
  4252. hidden = true;
  4253. } else {
  4254. continue;
  4255. }
  4256. }
  4257. orig[prop] = dataShow && dataShow[prop] || jQuery.style(elem, prop);
  4258. }
  4259. }
  4260. propTween = !jQuery.isEmptyObject(props);
  4261. if (!propTween && jQuery.isEmptyObject(orig)) {
  4262. return;
  4263. }
  4264. if (isBox && elem.nodeType === 1) {
  4265. opts.overflow = [style.overflow, style.overflowX, style.overflowY];
  4266. restoreDisplay = dataShow && dataShow.display;
  4267. if (restoreDisplay == null) {
  4268. restoreDisplay = dataPriv.get(elem, "display");
  4269. }
  4270. display = jQuery.css(elem, "display");
  4271. if (display === "none") {
  4272. if (restoreDisplay) {
  4273. display = restoreDisplay;
  4274. } else {
  4275. showHide([elem], true);
  4276. restoreDisplay = elem.style.display || restoreDisplay;
  4277. display = jQuery.css(elem, "display");
  4278. showHide([elem]);
  4279. }
  4280. }
  4281. if (display === "inline" || display === "inline-block" && restoreDisplay != null) {
  4282. if (jQuery.css(elem, "float") === "none") {
  4283. if (!propTween) {
  4284. anim.done(function() {
  4285. style.display = restoreDisplay;
  4286. });
  4287. if (restoreDisplay == null) {
  4288. display = style.display;
  4289. restoreDisplay = display === "none" ? "" : display;
  4290. }
  4291. }
  4292. style.display = "inline-block";
  4293. }
  4294. }
  4295. }
  4296. if (opts.overflow) {
  4297. style.overflow = "hidden";
  4298. anim.always(function() {
  4299. style.overflow = opts.overflow[0];
  4300. style.overflowX = opts.overflow[1];
  4301. style.overflowY = opts.overflow[2];
  4302. });
  4303. }
  4304. propTween = false;
  4305. for (prop in orig) {
  4306. if (!propTween) {
  4307. if (dataShow) {
  4308. if ("hidden" in dataShow) {
  4309. hidden = dataShow.hidden;
  4310. }
  4311. } else {
  4312. dataShow = dataPriv.access(elem, "fxshow", { display: restoreDisplay });
  4313. }
  4314. if (toggle) {
  4315. dataShow.hidden = !hidden;
  4316. }
  4317. if (hidden) {
  4318. showHide([elem], true);
  4319. }
  4320. anim.done(function() {
  4321. if (!hidden) {
  4322. showHide([elem]);
  4323. }
  4324. dataPriv.remove(elem, "fxshow");
  4325. for (prop in orig) {
  4326. jQuery.style(elem, prop, orig[prop]);
  4327. }
  4328. });
  4329. }
  4330. propTween = createTween(hidden ? dataShow[prop] : 0, prop, anim);
  4331. if (!(prop in dataShow)) {
  4332. dataShow[prop] = propTween.start;
  4333. if (hidden) {
  4334. propTween.end = propTween.start;
  4335. propTween.start = 0;
  4336. }
  4337. }
  4338. }
  4339. }
  4340. function propFilter(props, specialEasing) {
  4341. var index, name, easing, value, hooks;
  4342. for (index in props) {
  4343. name = camelCase(index);
  4344. easing = specialEasing[name];
  4345. value = props[index];
  4346. if (Array.isArray(value)) {
  4347. easing = value[1];
  4348. value = props[index] = value[0];
  4349. }
  4350. if (index !== name) {
  4351. props[name] = value;
  4352. delete props[index];
  4353. }
  4354. hooks = jQuery.cssHooks[name];
  4355. if (hooks && "expand" in hooks) {
  4356. value = hooks.expand(value);
  4357. delete props[name];
  4358. for (index in value) {
  4359. if (!(index in props)) {
  4360. props[index] = value[index];
  4361. specialEasing[index] = easing;
  4362. }
  4363. }
  4364. } else {
  4365. specialEasing[name] = easing;
  4366. }
  4367. }
  4368. }
  4369. function Animation(elem, properties, options) {
  4370. var result, stopped, index = 0, length = Animation.prefilters.length, deferred = jQuery.Deferred().always(function() {
  4371. delete tick.elem;
  4372. }), tick = function() {
  4373. if (stopped) {
  4374. return false;
  4375. }
  4376. var currentTime = fxNow || createFxNow(), remaining = Math.max(0, animation.startTime + animation.duration - currentTime), temp = remaining / animation.duration || 0, percent = 1 - temp, index2 = 0, length2 = animation.tweens.length;
  4377. for (; index2 < length2; index2++) {
  4378. animation.tweens[index2].run(percent);
  4379. }
  4380. deferred.notifyWith(elem, [animation, percent, remaining]);
  4381. if (percent < 1 && length2) {
  4382. return remaining;
  4383. }
  4384. if (!length2) {
  4385. deferred.notifyWith(elem, [animation, 1, 0]);
  4386. }
  4387. deferred.resolveWith(elem, [animation]);
  4388. return false;
  4389. }, animation = deferred.promise({
  4390. elem,
  4391. props: jQuery.extend({}, properties),
  4392. opts: jQuery.extend(true, {
  4393. specialEasing: {},
  4394. easing: jQuery.easing._default
  4395. }, options),
  4396. originalProperties: properties,
  4397. originalOptions: options,
  4398. startTime: fxNow || createFxNow(),
  4399. duration: options.duration,
  4400. tweens: [],
  4401. createTween: function(prop, end) {
  4402. var tween = jQuery.Tween(
  4403. elem,
  4404. animation.opts,
  4405. prop,
  4406. end,
  4407. animation.opts.specialEasing[prop] || animation.opts.easing
  4408. );
  4409. animation.tweens.push(tween);
  4410. return tween;
  4411. },
  4412. stop: function(gotoEnd) {
  4413. var index2 = 0, length2 = gotoEnd ? animation.tweens.length : 0;
  4414. if (stopped) {
  4415. return this;
  4416. }
  4417. stopped = true;
  4418. for (; index2 < length2; index2++) {
  4419. animation.tweens[index2].run(1);
  4420. }
  4421. if (gotoEnd) {
  4422. deferred.notifyWith(elem, [animation, 1, 0]);
  4423. deferred.resolveWith(elem, [animation, gotoEnd]);
  4424. } else {
  4425. deferred.rejectWith(elem, [animation, gotoEnd]);
  4426. }
  4427. return this;
  4428. }
  4429. }), props = animation.props;
  4430. propFilter(props, animation.opts.specialEasing);
  4431. for (; index < length; index++) {
  4432. result = Animation.prefilters[index].call(animation, elem, props, animation.opts);
  4433. if (result) {
  4434. if (isFunction(result.stop)) {
  4435. jQuery._queueHooks(animation.elem, animation.opts.queue).stop = result.stop.bind(result);
  4436. }
  4437. return result;
  4438. }
  4439. }
  4440. jQuery.map(props, createTween, animation);
  4441. if (isFunction(animation.opts.start)) {
  4442. animation.opts.start.call(elem, animation);
  4443. }
  4444. animation.progress(animation.opts.progress).done(animation.opts.done, animation.opts.complete).fail(animation.opts.fail).always(animation.opts.always);
  4445. jQuery.fx.timer(
  4446. jQuery.extend(tick, {
  4447. elem,
  4448. anim: animation,
  4449. queue: animation.opts.queue
  4450. })
  4451. );
  4452. return animation;
  4453. }
  4454. jQuery.Animation = jQuery.extend(Animation, {
  4455. tweeners: {
  4456. "*": [function(prop, value) {
  4457. var tween = this.createTween(prop, value);
  4458. adjustCSS(tween.elem, prop, rcssNum.exec(value), tween);
  4459. return tween;
  4460. }]
  4461. },
  4462. tweener: function(props, callback) {
  4463. if (isFunction(props)) {
  4464. callback = props;
  4465. props = ["*"];
  4466. } else {
  4467. props = props.match(rnothtmlwhite);
  4468. }
  4469. var prop, index = 0, length = props.length;
  4470. for (; index < length; index++) {
  4471. prop = props[index];
  4472. Animation.tweeners[prop] = Animation.tweeners[prop] || [];
  4473. Animation.tweeners[prop].unshift(callback);
  4474. }
  4475. },
  4476. prefilters: [defaultPrefilter],
  4477. prefilter: function(callback, prepend) {
  4478. if (prepend) {
  4479. Animation.prefilters.unshift(callback);
  4480. } else {
  4481. Animation.prefilters.push(callback);
  4482. }
  4483. }
  4484. });
  4485. jQuery.speed = function(speed, easing, fn) {
  4486. var opt = speed && typeof speed === "object" ? jQuery.extend({}, speed) : {
  4487. complete: fn || !fn && easing || isFunction(speed) && speed,
  4488. duration: speed,
  4489. easing: fn && easing || easing && !isFunction(easing) && easing
  4490. };
  4491. if (jQuery.fx.off) {
  4492. opt.duration = 0;
  4493. } else {
  4494. if (typeof opt.duration !== "number") {
  4495. if (opt.duration in jQuery.fx.speeds) {
  4496. opt.duration = jQuery.fx.speeds[opt.duration];
  4497. } else {
  4498. opt.duration = jQuery.fx.speeds._default;
  4499. }
  4500. }
  4501. }
  4502. if (opt.queue == null || opt.queue === true) {
  4503. opt.queue = "fx";
  4504. }
  4505. opt.old = opt.complete;
  4506. opt.complete = function() {
  4507. if (isFunction(opt.old)) {
  4508. opt.old.call(this);
  4509. }
  4510. if (opt.queue) {
  4511. jQuery.dequeue(this, opt.queue);
  4512. }
  4513. };
  4514. return opt;
  4515. };
  4516. jQuery.fn.extend({
  4517. fadeTo: function(speed, to, easing, callback) {
  4518. return this.filter(isHiddenWithinTree).css("opacity", 0).show().end().animate({ opacity: to }, speed, easing, callback);
  4519. },
  4520. animate: function(prop, speed, easing, callback) {
  4521. var empty = jQuery.isEmptyObject(prop), optall = jQuery.speed(speed, easing, callback), doAnimation = function() {
  4522. var anim = Animation(this, jQuery.extend({}, prop), optall);
  4523. if (empty || dataPriv.get(this, "finish")) {
  4524. anim.stop(true);
  4525. }
  4526. };
  4527. doAnimation.finish = doAnimation;
  4528. return empty || optall.queue === false ? this.each(doAnimation) : this.queue(optall.queue, doAnimation);
  4529. },
  4530. stop: function(type, clearQueue, gotoEnd) {
  4531. var stopQueue = function(hooks) {
  4532. var stop = hooks.stop;
  4533. delete hooks.stop;
  4534. stop(gotoEnd);
  4535. };
  4536. if (typeof type !== "string") {
  4537. gotoEnd = clearQueue;
  4538. clearQueue = type;
  4539. type = void 0;
  4540. }
  4541. if (clearQueue) {
  4542. this.queue(type || "fx", []);
  4543. }
  4544. return this.each(function() {
  4545. var dequeue = true, index = type != null && type + "queueHooks", timers = jQuery.timers, data = dataPriv.get(this);
  4546. if (index) {
  4547. if (data[index] && data[index].stop) {
  4548. stopQueue(data[index]);
  4549. }
  4550. } else {
  4551. for (index in data) {
  4552. if (data[index] && data[index].stop && rrun.test(index)) {
  4553. stopQueue(data[index]);
  4554. }
  4555. }
  4556. }
  4557. for (index = timers.length; index--; ) {
  4558. if (timers[index].elem === this && (type == null || timers[index].queue === type)) {
  4559. timers[index].anim.stop(gotoEnd);
  4560. dequeue = false;
  4561. timers.splice(index, 1);
  4562. }
  4563. }
  4564. if (dequeue || !gotoEnd) {
  4565. jQuery.dequeue(this, type);
  4566. }
  4567. });
  4568. },
  4569. finish: function(type) {
  4570. if (type !== false) {
  4571. type = type || "fx";
  4572. }
  4573. return this.each(function() {
  4574. var index, data = dataPriv.get(this), queue = data[type + "queue"], hooks = data[type + "queueHooks"], timers = jQuery.timers, length = queue ? queue.length : 0;
  4575. data.finish = true;
  4576. jQuery.queue(this, type, []);
  4577. if (hooks && hooks.stop) {
  4578. hooks.stop.call(this, true);
  4579. }
  4580. for (index = timers.length; index--; ) {
  4581. if (timers[index].elem === this && timers[index].queue === type) {
  4582. timers[index].anim.stop(true);
  4583. timers.splice(index, 1);
  4584. }
  4585. }
  4586. for (index = 0; index < length; index++) {
  4587. if (queue[index] && queue[index].finish) {
  4588. queue[index].finish.call(this);
  4589. }
  4590. }
  4591. delete data.finish;
  4592. });
  4593. }
  4594. });
  4595. jQuery.each(["toggle", "show", "hide"], function(_i, name) {
  4596. var cssFn = jQuery.fn[name];
  4597. jQuery.fn[name] = function(speed, easing, callback) {
  4598. return speed == null || typeof speed === "boolean" ? cssFn.apply(this, arguments) : this.animate(genFx(name, true), speed, easing, callback);
  4599. };
  4600. });
  4601. jQuery.each({
  4602. slideDown: genFx("show"),
  4603. slideUp: genFx("hide"),
  4604. slideToggle: genFx("toggle"),
  4605. fadeIn: { opacity: "show" },
  4606. fadeOut: { opacity: "hide" },
  4607. fadeToggle: { opacity: "toggle" }
  4608. }, function(name, props) {
  4609. jQuery.fn[name] = function(speed, easing, callback) {
  4610. return this.animate(props, speed, easing, callback);
  4611. };
  4612. });
  4613. jQuery.timers = [];
  4614. jQuery.fx.tick = function() {
  4615. var timer, i = 0, timers = jQuery.timers;
  4616. fxNow = Date.now();
  4617. for (; i < timers.length; i++) {
  4618. timer = timers[i];
  4619. if (!timer() && timers[i] === timer) {
  4620. timers.splice(i--, 1);
  4621. }
  4622. }
  4623. if (!timers.length) {
  4624. jQuery.fx.stop();
  4625. }
  4626. fxNow = void 0;
  4627. };
  4628. jQuery.fx.timer = function(timer) {
  4629. jQuery.timers.push(timer);
  4630. jQuery.fx.start();
  4631. };
  4632. jQuery.fx.interval = 13;
  4633. jQuery.fx.start = function() {
  4634. if (inProgress) {
  4635. return;
  4636. }
  4637. inProgress = true;
  4638. schedule();
  4639. };
  4640. jQuery.fx.stop = function() {
  4641. inProgress = null;
  4642. };
  4643. jQuery.fx.speeds = {
  4644. slow: 600,
  4645. fast: 200,
  4646. // Default speed
  4647. _default: 400
  4648. };
  4649. jQuery.fn.delay = function(time, type) {
  4650. time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
  4651. type = type || "fx";
  4652. return this.queue(type, function(next, hooks) {
  4653. var timeout = window2.setTimeout(next, time);
  4654. hooks.stop = function() {
  4655. window2.clearTimeout(timeout);
  4656. };
  4657. });
  4658. };
  4659. (function() {
  4660. var input = document2.createElement("input"), select = document2.createElement("select"), opt = select.appendChild(document2.createElement("option"));
  4661. input.type = "checkbox";
  4662. support.checkOn = input.value !== "";
  4663. support.optSelected = opt.selected;
  4664. input = document2.createElement("input");
  4665. input.value = "t";
  4666. input.type = "radio";
  4667. support.radioValue = input.value === "t";
  4668. })();
  4669. var boolHook, attrHandle = jQuery.expr.attrHandle;
  4670. jQuery.fn.extend({
  4671. attr: function(name, value) {
  4672. return access(this, jQuery.attr, name, value, arguments.length > 1);
  4673. },
  4674. removeAttr: function(name) {
  4675. return this.each(function() {
  4676. jQuery.removeAttr(this, name);
  4677. });
  4678. }
  4679. });
  4680. jQuery.extend({
  4681. attr: function(elem, name, value) {
  4682. var ret, hooks, nType = elem.nodeType;
  4683. if (nType === 3 || nType === 8 || nType === 2) {
  4684. return;
  4685. }
  4686. if (typeof elem.getAttribute === "undefined") {
  4687. return jQuery.prop(elem, name, value);
  4688. }
  4689. if (nType !== 1 || !jQuery.isXMLDoc(elem)) {
  4690. hooks = jQuery.attrHooks[name.toLowerCase()] || (jQuery.expr.match.bool.test(name) ? boolHook : void 0);
  4691. }
  4692. if (value !== void 0) {
  4693. if (value === null) {
  4694. jQuery.removeAttr(elem, name);
  4695. return;
  4696. }
  4697. if (hooks && "set" in hooks && (ret = hooks.set(elem, value, name)) !== void 0) {
  4698. return ret;
  4699. }
  4700. elem.setAttribute(name, value + "");
  4701. return value;
  4702. }
  4703. if (hooks && "get" in hooks && (ret = hooks.get(elem, name)) !== null) {
  4704. return ret;
  4705. }
  4706. ret = jQuery.find.attr(elem, name);
  4707. return ret == null ? void 0 : ret;
  4708. },
  4709. attrHooks: {
  4710. type: {
  4711. set: function(elem, value) {
  4712. if (!support.radioValue && value === "radio" && nodeName(elem, "input")) {
  4713. var val = elem.value;
  4714. elem.setAttribute("type", value);
  4715. if (val) {
  4716. elem.value = val;
  4717. }
  4718. return value;
  4719. }
  4720. }
  4721. }
  4722. },
  4723. removeAttr: function(elem, value) {
  4724. var name, i = 0, attrNames = value && value.match(rnothtmlwhite);
  4725. if (attrNames && elem.nodeType === 1) {
  4726. while (name = attrNames[i++]) {
  4727. elem.removeAttribute(name);
  4728. }
  4729. }
  4730. }
  4731. });
  4732. boolHook = {
  4733. set: function(elem, value, name) {
  4734. if (value === false) {
  4735. jQuery.removeAttr(elem, name);
  4736. } else {
  4737. elem.setAttribute(name, name);
  4738. }
  4739. return name;
  4740. }
  4741. };
  4742. jQuery.each(jQuery.expr.match.bool.source.match(/\w+/g), function(_i, name) {
  4743. var getter = attrHandle[name] || jQuery.find.attr;
  4744. attrHandle[name] = function(elem, name2, isXML) {
  4745. var ret, handle, lowercaseName = name2.toLowerCase();
  4746. if (!isXML) {
  4747. handle = attrHandle[lowercaseName];
  4748. attrHandle[lowercaseName] = ret;
  4749. ret = getter(elem, name2, isXML) != null ? lowercaseName : null;
  4750. attrHandle[lowercaseName] = handle;
  4751. }
  4752. return ret;
  4753. };
  4754. });
  4755. var rfocusable = /^(?:input|select|textarea|button)$/i, rclickable = /^(?:a|area)$/i;
  4756. jQuery.fn.extend({
  4757. prop: function(name, value) {
  4758. return access(this, jQuery.prop, name, value, arguments.length > 1);
  4759. },
  4760. removeProp: function(name) {
  4761. return this.each(function() {
  4762. delete this[jQuery.propFix[name] || name];
  4763. });
  4764. }
  4765. });
  4766. jQuery.extend({
  4767. prop: function(elem, name, value) {
  4768. var ret, hooks, nType = elem.nodeType;
  4769. if (nType === 3 || nType === 8 || nType === 2) {
  4770. return;
  4771. }
  4772. if (nType !== 1 || !jQuery.isXMLDoc(elem)) {
  4773. name = jQuery.propFix[name] || name;
  4774. hooks = jQuery.propHooks[name];
  4775. }
  4776. if (value !== void 0) {
  4777. if (hooks && "set" in hooks && (ret = hooks.set(elem, value, name)) !== void 0) {
  4778. return ret;
  4779. }
  4780. return elem[name] = value;
  4781. }
  4782. if (hooks && "get" in hooks && (ret = hooks.get(elem, name)) !== null) {
  4783. return ret;
  4784. }
  4785. return elem[name];
  4786. },
  4787. propHooks: {
  4788. tabIndex: {
  4789. get: function(elem) {
  4790. var tabindex = jQuery.find.attr(elem, "tabindex");
  4791. if (tabindex) {
  4792. return parseInt(tabindex, 10);
  4793. }
  4794. if (rfocusable.test(elem.nodeName) || rclickable.test(elem.nodeName) && elem.href) {
  4795. return 0;
  4796. }
  4797. return -1;
  4798. }
  4799. }
  4800. },
  4801. propFix: {
  4802. "for": "htmlFor",
  4803. "class": "className"
  4804. }
  4805. });
  4806. if (!support.optSelected) {
  4807. jQuery.propHooks.selected = {
  4808. get: function(elem) {
  4809. var parent = elem.parentNode;
  4810. if (parent && parent.parentNode) {
  4811. parent.parentNode.selectedIndex;
  4812. }
  4813. return null;
  4814. },
  4815. set: function(elem) {
  4816. var parent = elem.parentNode;
  4817. if (parent) {
  4818. parent.selectedIndex;
  4819. if (parent.parentNode) {
  4820. parent.parentNode.selectedIndex;
  4821. }
  4822. }
  4823. }
  4824. };
  4825. }
  4826. jQuery.each([
  4827. "tabIndex",
  4828. "readOnly",
  4829. "maxLength",
  4830. "cellSpacing",
  4831. "cellPadding",
  4832. "rowSpan",
  4833. "colSpan",
  4834. "useMap",
  4835. "frameBorder",
  4836. "contentEditable"
  4837. ], function() {
  4838. jQuery.propFix[this.toLowerCase()] = this;
  4839. });
  4840. function stripAndCollapse(value) {
  4841. var tokens = value.match(rnothtmlwhite) || [];
  4842. return tokens.join(" ");
  4843. }
  4844. function getClass(elem) {
  4845. return elem.getAttribute && elem.getAttribute("class") || "";
  4846. }
  4847. function classesToArray(value) {
  4848. if (Array.isArray(value)) {
  4849. return value;
  4850. }
  4851. if (typeof value === "string") {
  4852. return value.match(rnothtmlwhite) || [];
  4853. }
  4854. return [];
  4855. }
  4856. jQuery.fn.extend({
  4857. addClass: function(value) {
  4858. var classNames, cur, curValue, className, i, finalValue;
  4859. if (isFunction(value)) {
  4860. return this.each(function(j) {
  4861. jQuery(this).addClass(value.call(this, j, getClass(this)));
  4862. });
  4863. }
  4864. classNames = classesToArray(value);
  4865. if (classNames.length) {
  4866. return this.each(function() {
  4867. curValue = getClass(this);
  4868. cur = this.nodeType === 1 && " " + stripAndCollapse(curValue) + " ";
  4869. if (cur) {
  4870. for (i = 0; i < classNames.length; i++) {
  4871. className = classNames[i];
  4872. if (cur.indexOf(" " + className + " ") < 0) {
  4873. cur += className + " ";
  4874. }
  4875. }
  4876. finalValue = stripAndCollapse(cur);
  4877. if (curValue !== finalValue) {
  4878. this.setAttribute("class", finalValue);
  4879. }
  4880. }
  4881. });
  4882. }
  4883. return this;
  4884. },
  4885. removeClass: function(value) {
  4886. var classNames, cur, curValue, className, i, finalValue;
  4887. if (isFunction(value)) {
  4888. return this.each(function(j) {
  4889. jQuery(this).removeClass(value.call(this, j, getClass(this)));
  4890. });
  4891. }
  4892. if (!arguments.length) {
  4893. return this.attr("class", "");
  4894. }
  4895. classNames = classesToArray(value);
  4896. if (classNames.length) {
  4897. return this.each(function() {
  4898. curValue = getClass(this);
  4899. cur = this.nodeType === 1 && " " + stripAndCollapse(curValue) + " ";
  4900. if (cur) {
  4901. for (i = 0; i < classNames.length; i++) {
  4902. className = classNames[i];
  4903. while (cur.indexOf(" " + className + " ") > -1) {
  4904. cur = cur.replace(" " + className + " ", " ");
  4905. }
  4906. }
  4907. finalValue = stripAndCollapse(cur);
  4908. if (curValue !== finalValue) {
  4909. this.setAttribute("class", finalValue);
  4910. }
  4911. }
  4912. });
  4913. }
  4914. return this;
  4915. },
  4916. toggleClass: function(value, stateVal) {
  4917. var classNames, className, i, self2, type = typeof value, isValidValue = type === "string" || Array.isArray(value);
  4918. if (isFunction(value)) {
  4919. return this.each(function(i2) {
  4920. jQuery(this).toggleClass(
  4921. value.call(this, i2, getClass(this), stateVal),
  4922. stateVal
  4923. );
  4924. });
  4925. }
  4926. if (typeof stateVal === "boolean" && isValidValue) {
  4927. return stateVal ? this.addClass(value) : this.removeClass(value);
  4928. }
  4929. classNames = classesToArray(value);
  4930. return this.each(function() {
  4931. if (isValidValue) {
  4932. self2 = jQuery(this);
  4933. for (i = 0; i < classNames.length; i++) {
  4934. className = classNames[i];
  4935. if (self2.hasClass(className)) {
  4936. self2.removeClass(className);
  4937. } else {
  4938. self2.addClass(className);
  4939. }
  4940. }
  4941. } else if (value === void 0 || type === "boolean") {
  4942. className = getClass(this);
  4943. if (className) {
  4944. dataPriv.set(this, "__className__", className);
  4945. }
  4946. if (this.setAttribute) {
  4947. this.setAttribute(
  4948. "class",
  4949. className || value === false ? "" : dataPriv.get(this, "__className__") || ""
  4950. );
  4951. }
  4952. }
  4953. });
  4954. },
  4955. hasClass: function(selector) {
  4956. var className, elem, i = 0;
  4957. className = " " + selector + " ";
  4958. while (elem = this[i++]) {
  4959. if (elem.nodeType === 1 && (" " + stripAndCollapse(getClass(elem)) + " ").indexOf(className) > -1) {
  4960. return true;
  4961. }
  4962. }
  4963. return false;
  4964. }
  4965. });
  4966. var rreturn = /\r/g;
  4967. jQuery.fn.extend({
  4968. val: function(value) {
  4969. var hooks, ret, valueIsFunction, elem = this[0];
  4970. if (!arguments.length) {
  4971. if (elem) {
  4972. hooks = jQuery.valHooks[elem.type] || jQuery.valHooks[elem.nodeName.toLowerCase()];
  4973. if (hooks && "get" in hooks && (ret = hooks.get(elem, "value")) !== void 0) {
  4974. return ret;
  4975. }
  4976. ret = elem.value;
  4977. if (typeof ret === "string") {
  4978. return ret.replace(rreturn, "");
  4979. }
  4980. return ret == null ? "" : ret;
  4981. }
  4982. return;
  4983. }
  4984. valueIsFunction = isFunction(value);
  4985. return this.each(function(i) {
  4986. var val;
  4987. if (this.nodeType !== 1) {
  4988. return;
  4989. }
  4990. if (valueIsFunction) {
  4991. val = value.call(this, i, jQuery(this).val());
  4992. } else {
  4993. val = value;
  4994. }
  4995. if (val == null) {
  4996. val = "";
  4997. } else if (typeof val === "number") {
  4998. val += "";
  4999. } else if (Array.isArray(val)) {
  5000. val = jQuery.map(val, function(value2) {
  5001. return value2 == null ? "" : value2 + "";
  5002. });
  5003. }
  5004. hooks = jQuery.valHooks[this.type] || jQuery.valHooks[this.nodeName.toLowerCase()];
  5005. if (!hooks || !("set" in hooks) || hooks.set(this, val, "value") === void 0) {
  5006. this.value = val;
  5007. }
  5008. });
  5009. }
  5010. });
  5011. jQuery.extend({
  5012. valHooks: {
  5013. option: {
  5014. get: function(elem) {
  5015. var val = jQuery.find.attr(elem, "value");
  5016. return val != null ? val : (
  5017. // Support: IE <=10 - 11 only
  5018. // option.text throws exceptions (trac-14686, trac-14858)
  5019. // Strip and collapse whitespace
  5020. // https://html.spec.whatwg.org/#strip-and-collapse-whitespace
  5021. stripAndCollapse(jQuery.text(elem))
  5022. );
  5023. }
  5024. },
  5025. select: {
  5026. get: function(elem) {
  5027. var value, option, i, options = elem.options, index = elem.selectedIndex, one = elem.type === "select-one", values = one ? null : [], max = one ? index + 1 : options.length;
  5028. if (index < 0) {
  5029. i = max;
  5030. } else {
  5031. i = one ? index : 0;
  5032. }
  5033. for (; i < max; i++) {
  5034. option = options[i];
  5035. if ((option.selected || i === index) && // Don't return options that are disabled or in a disabled optgroup
  5036. !option.disabled && (!option.parentNode.disabled || !nodeName(option.parentNode, "optgroup"))) {
  5037. value = jQuery(option).val();
  5038. if (one) {
  5039. return value;
  5040. }
  5041. values.push(value);
  5042. }
  5043. }
  5044. return values;
  5045. },
  5046. set: function(elem, value) {
  5047. var optionSet, option, options = elem.options, values = jQuery.makeArray(value), i = options.length;
  5048. while (i--) {
  5049. option = options[i];
  5050. if (option.selected = jQuery.inArray(jQuery.valHooks.option.get(option), values) > -1) {
  5051. optionSet = true;
  5052. }
  5053. }
  5054. if (!optionSet) {
  5055. elem.selectedIndex = -1;
  5056. }
  5057. return values;
  5058. }
  5059. }
  5060. }
  5061. });
  5062. jQuery.each(["radio", "checkbox"], function() {
  5063. jQuery.valHooks[this] = {
  5064. set: function(elem, value) {
  5065. if (Array.isArray(value)) {
  5066. return elem.checked = jQuery.inArray(jQuery(elem).val(), value) > -1;
  5067. }
  5068. }
  5069. };
  5070. if (!support.checkOn) {
  5071. jQuery.valHooks[this].get = function(elem) {
  5072. return elem.getAttribute("value") === null ? "on" : elem.value;
  5073. };
  5074. }
  5075. });
  5076. var location2 = window2.location;
  5077. var nonce = { guid: Date.now() };
  5078. var rquery = /\?/;
  5079. jQuery.parseXML = function(data) {
  5080. var xml, parserErrorElem;
  5081. if (!data || typeof data !== "string") {
  5082. return null;
  5083. }
  5084. try {
  5085. xml = new window2.DOMParser().parseFromString(data, "text/xml");
  5086. } catch (e) {
  5087. }
  5088. parserErrorElem = xml && xml.getElementsByTagName("parsererror")[0];
  5089. if (!xml || parserErrorElem) {
  5090. jQuery.error("Invalid XML: " + (parserErrorElem ? jQuery.map(parserErrorElem.childNodes, function(el) {
  5091. return el.textContent;
  5092. }).join("\n") : data));
  5093. }
  5094. return xml;
  5095. };
  5096. var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, stopPropagationCallback = function(e) {
  5097. e.stopPropagation();
  5098. };
  5099. jQuery.extend(jQuery.event, {
  5100. trigger: function(event, data, elem, onlyHandlers) {
  5101. var i, cur, tmp, bubbleType, ontype, handle, special, lastElement, eventPath = [elem || document2], type = hasOwn.call(event, "type") ? event.type : event, namespaces = hasOwn.call(event, "namespace") ? event.namespace.split(".") : [];
  5102. cur = lastElement = tmp = elem = elem || document2;
  5103. if (elem.nodeType === 3 || elem.nodeType === 8) {
  5104. return;
  5105. }
  5106. if (rfocusMorph.test(type + jQuery.event.triggered)) {
  5107. return;
  5108. }
  5109. if (type.indexOf(".") > -1) {
  5110. namespaces = type.split(".");
  5111. type = namespaces.shift();
  5112. namespaces.sort();
  5113. }
  5114. ontype = type.indexOf(":") < 0 && "on" + type;
  5115. event = event[jQuery.expando] ? event : new jQuery.Event(type, typeof event === "object" && event);
  5116. event.isTrigger = onlyHandlers ? 2 : 3;
  5117. event.namespace = namespaces.join(".");
  5118. event.rnamespace = event.namespace ? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)") : null;
  5119. event.result = void 0;
  5120. if (!event.target) {
  5121. event.target = elem;
  5122. }
  5123. data = data == null ? [event] : jQuery.makeArray(data, [event]);
  5124. special = jQuery.event.special[type] || {};
  5125. if (!onlyHandlers && special.trigger && special.trigger.apply(elem, data) === false) {
  5126. return;
  5127. }
  5128. if (!onlyHandlers && !special.noBubble && !isWindow(elem)) {
  5129. bubbleType = special.delegateType || type;
  5130. if (!rfocusMorph.test(bubbleType + type)) {
  5131. cur = cur.parentNode;
  5132. }
  5133. for (; cur; cur = cur.parentNode) {
  5134. eventPath.push(cur);
  5135. tmp = cur;
  5136. }
  5137. if (tmp === (elem.ownerDocument || document2)) {
  5138. eventPath.push(tmp.defaultView || tmp.parentWindow || window2);
  5139. }
  5140. }
  5141. i = 0;
  5142. while ((cur = eventPath[i++]) && !event.isPropagationStopped()) {
  5143. lastElement = cur;
  5144. event.type = i > 1 ? bubbleType : special.bindType || type;
  5145. handle = (dataPriv.get(cur, "events") || /* @__PURE__ */ Object.create(null))[event.type] && dataPriv.get(cur, "handle");
  5146. if (handle) {
  5147. handle.apply(cur, data);
  5148. }
  5149. handle = ontype && cur[ontype];
  5150. if (handle && handle.apply && acceptData(cur)) {
  5151. event.result = handle.apply(cur, data);
  5152. if (event.result === false) {
  5153. event.preventDefault();
  5154. }
  5155. }
  5156. }
  5157. event.type = type;
  5158. if (!onlyHandlers && !event.isDefaultPrevented()) {
  5159. if ((!special._default || special._default.apply(eventPath.pop(), data) === false) && acceptData(elem)) {
  5160. if (ontype && isFunction(elem[type]) && !isWindow(elem)) {
  5161. tmp = elem[ontype];
  5162. if (tmp) {
  5163. elem[ontype] = null;
  5164. }
  5165. jQuery.event.triggered = type;
  5166. if (event.isPropagationStopped()) {
  5167. lastElement.addEventListener(type, stopPropagationCallback);
  5168. }
  5169. elem[type]();
  5170. if (event.isPropagationStopped()) {
  5171. lastElement.removeEventListener(type, stopPropagationCallback);
  5172. }
  5173. jQuery.event.triggered = void 0;
  5174. if (tmp) {
  5175. elem[ontype] = tmp;
  5176. }
  5177. }
  5178. }
  5179. }
  5180. return event.result;
  5181. },
  5182. // Piggyback on a donor event to simulate a different one
  5183. // Used only for `focus(in | out)` events
  5184. simulate: function(type, elem, event) {
  5185. var e = jQuery.extend(
  5186. new jQuery.Event(),
  5187. event,
  5188. {
  5189. type,
  5190. isSimulated: true
  5191. }
  5192. );
  5193. jQuery.event.trigger(e, null, elem);
  5194. }
  5195. });
  5196. jQuery.fn.extend({
  5197. trigger: function(type, data) {
  5198. return this.each(function() {
  5199. jQuery.event.trigger(type, data, this);
  5200. });
  5201. },
  5202. triggerHandler: function(type, data) {
  5203. var elem = this[0];
  5204. if (elem) {
  5205. return jQuery.event.trigger(type, data, elem, true);
  5206. }
  5207. }
  5208. });
  5209. var rbracket = /\[\]$/, rCRLF = /\r?\n/g, rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, rsubmittable = /^(?:input|select|textarea|keygen)/i;
  5210. function buildParams(prefix, obj, traditional, add) {
  5211. var name;
  5212. if (Array.isArray(obj)) {
  5213. jQuery.each(obj, function(i, v) {
  5214. if (traditional || rbracket.test(prefix)) {
  5215. add(prefix, v);
  5216. } else {
  5217. buildParams(
  5218. prefix + "[" + (typeof v === "object" && v != null ? i : "") + "]",
  5219. v,
  5220. traditional,
  5221. add
  5222. );
  5223. }
  5224. });
  5225. } else if (!traditional && toType(obj) === "object") {
  5226. for (name in obj) {
  5227. buildParams(prefix + "[" + name + "]", obj[name], traditional, add);
  5228. }
  5229. } else {
  5230. add(prefix, obj);
  5231. }
  5232. }
  5233. jQuery.param = function(a, traditional) {
  5234. var prefix, s = [], add = function(key, valueOrFunction) {
  5235. var value = isFunction(valueOrFunction) ? valueOrFunction() : valueOrFunction;
  5236. s[s.length] = encodeURIComponent(key) + "=" + encodeURIComponent(value == null ? "" : value);
  5237. };
  5238. if (a == null) {
  5239. return "";
  5240. }
  5241. if (Array.isArray(a) || a.jquery && !jQuery.isPlainObject(a)) {
  5242. jQuery.each(a, function() {
  5243. add(this.name, this.value);
  5244. });
  5245. } else {
  5246. for (prefix in a) {
  5247. buildParams(prefix, a[prefix], traditional, add);
  5248. }
  5249. }
  5250. return s.join("&");
  5251. };
  5252. jQuery.fn.extend({
  5253. serialize: function() {
  5254. return jQuery.param(this.serializeArray());
  5255. },
  5256. serializeArray: function() {
  5257. return this.map(function() {
  5258. var elements = jQuery.prop(this, "elements");
  5259. return elements ? jQuery.makeArray(elements) : this;
  5260. }).filter(function() {
  5261. var type = this.type;
  5262. return this.name && !jQuery(this).is(":disabled") && rsubmittable.test(this.nodeName) && !rsubmitterTypes.test(type) && (this.checked || !rcheckableType.test(type));
  5263. }).map(function(_i, elem) {
  5264. var val = jQuery(this).val();
  5265. if (val == null) {
  5266. return null;
  5267. }
  5268. if (Array.isArray(val)) {
  5269. return jQuery.map(val, function(val2) {
  5270. return { name: elem.name, value: val2.replace(rCRLF, "\r\n") };
  5271. });
  5272. }
  5273. return { name: elem.name, value: val.replace(rCRLF, "\r\n") };
  5274. }).get();
  5275. }
  5276. });
  5277. var r20 = /%20/g, rhash = /#.*$/, rantiCache = /([?&])_=[^&]*/, rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, rnoContent = /^(?:GET|HEAD)$/, rprotocol = /^\/\//, prefilters = {}, transports = {}, allTypes = "*/".concat("*"), originAnchor = document2.createElement("a");
  5278. originAnchor.href = location2.href;
  5279. function addToPrefiltersOrTransports(structure) {
  5280. return function(dataTypeExpression, func) {
  5281. if (typeof dataTypeExpression !== "string") {
  5282. func = dataTypeExpression;
  5283. dataTypeExpression = "*";
  5284. }
  5285. var dataType, i = 0, dataTypes = dataTypeExpression.toLowerCase().match(rnothtmlwhite) || [];
  5286. if (isFunction(func)) {
  5287. while (dataType = dataTypes[i++]) {
  5288. if (dataType[0] === "+") {
  5289. dataType = dataType.slice(1) || "*";
  5290. (structure[dataType] = structure[dataType] || []).unshift(func);
  5291. } else {
  5292. (structure[dataType] = structure[dataType] || []).push(func);
  5293. }
  5294. }
  5295. }
  5296. };
  5297. }
  5298. function inspectPrefiltersOrTransports(structure, options, originalOptions, jqXHR) {
  5299. var inspected = {}, seekingTransport = structure === transports;
  5300. function inspect(dataType) {
  5301. var selected;
  5302. inspected[dataType] = true;
  5303. jQuery.each(structure[dataType] || [], function(_, prefilterOrFactory) {
  5304. var dataTypeOrTransport = prefilterOrFactory(options, originalOptions, jqXHR);
  5305. if (typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[dataTypeOrTransport]) {
  5306. options.dataTypes.unshift(dataTypeOrTransport);
  5307. inspect(dataTypeOrTransport);
  5308. return false;
  5309. } else if (seekingTransport) {
  5310. return !(selected = dataTypeOrTransport);
  5311. }
  5312. });
  5313. return selected;
  5314. }
  5315. return inspect(options.dataTypes[0]) || !inspected["*"] && inspect("*");
  5316. }
  5317. function ajaxExtend(target, src) {
  5318. var key, deep, flatOptions = jQuery.ajaxSettings.flatOptions || {};
  5319. for (key in src) {
  5320. if (src[key] !== void 0) {
  5321. (flatOptions[key] ? target : deep || (deep = {}))[key] = src[key];
  5322. }
  5323. }
  5324. if (deep) {
  5325. jQuery.extend(true, target, deep);
  5326. }
  5327. return target;
  5328. }
  5329. function ajaxHandleResponses(s, jqXHR, responses) {
  5330. var ct, type, finalDataType, firstDataType, contents = s.contents, dataTypes = s.dataTypes;
  5331. while (dataTypes[0] === "*") {
  5332. dataTypes.shift();
  5333. if (ct === void 0) {
  5334. ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
  5335. }
  5336. }
  5337. if (ct) {
  5338. for (type in contents) {
  5339. if (contents[type] && contents[type].test(ct)) {
  5340. dataTypes.unshift(type);
  5341. break;
  5342. }
  5343. }
  5344. }
  5345. if (dataTypes[0] in responses) {
  5346. finalDataType = dataTypes[0];
  5347. } else {
  5348. for (type in responses) {
  5349. if (!dataTypes[0] || s.converters[type + " " + dataTypes[0]]) {
  5350. finalDataType = type;
  5351. break;
  5352. }
  5353. if (!firstDataType) {
  5354. firstDataType = type;
  5355. }
  5356. }
  5357. finalDataType = finalDataType || firstDataType;
  5358. }
  5359. if (finalDataType) {
  5360. if (finalDataType !== dataTypes[0]) {
  5361. dataTypes.unshift(finalDataType);
  5362. }
  5363. return responses[finalDataType];
  5364. }
  5365. }
  5366. function ajaxConvert(s, response, jqXHR, isSuccess) {
  5367. var conv2, current, conv, tmp, prev, converters = {}, dataTypes = s.dataTypes.slice();
  5368. if (dataTypes[1]) {
  5369. for (conv in s.converters) {
  5370. converters[conv.toLowerCase()] = s.converters[conv];
  5371. }
  5372. }
  5373. current = dataTypes.shift();
  5374. while (current) {
  5375. if (s.responseFields[current]) {
  5376. jqXHR[s.responseFields[current]] = response;
  5377. }
  5378. if (!prev && isSuccess && s.dataFilter) {
  5379. response = s.dataFilter(response, s.dataType);
  5380. }
  5381. prev = current;
  5382. current = dataTypes.shift();
  5383. if (current) {
  5384. if (current === "*") {
  5385. current = prev;
  5386. } else if (prev !== "*" && prev !== current) {
  5387. conv = converters[prev + " " + current] || converters["* " + current];
  5388. if (!conv) {
  5389. for (conv2 in converters) {
  5390. tmp = conv2.split(" ");
  5391. if (tmp[1] === current) {
  5392. conv = converters[prev + " " + tmp[0]] || converters["* " + tmp[0]];
  5393. if (conv) {
  5394. if (conv === true) {
  5395. conv = converters[conv2];
  5396. } else if (converters[conv2] !== true) {
  5397. current = tmp[0];
  5398. dataTypes.unshift(tmp[1]);
  5399. }
  5400. break;
  5401. }
  5402. }
  5403. }
  5404. }
  5405. if (conv !== true) {
  5406. if (conv && s.throws) {
  5407. response = conv(response);
  5408. } else {
  5409. try {
  5410. response = conv(response);
  5411. } catch (e) {
  5412. return {
  5413. state: "parsererror",
  5414. error: conv ? e : "No conversion from " + prev + " to " + current
  5415. };
  5416. }
  5417. }
  5418. }
  5419. }
  5420. }
  5421. }
  5422. return { state: "success", data: response };
  5423. }
  5424. jQuery.extend({
  5425. // Counter for holding the number of active queries
  5426. active: 0,
  5427. // Last-Modified header cache for next request
  5428. lastModified: {},
  5429. etag: {},
  5430. ajaxSettings: {
  5431. url: location2.href,
  5432. type: "GET",
  5433. isLocal: rlocalProtocol.test(location2.protocol),
  5434. global: true,
  5435. processData: true,
  5436. async: true,
  5437. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  5438. /*
  5439. timeout: 0,
  5440. data: null,
  5441. dataType: null,
  5442. username: null,
  5443. password: null,
  5444. cache: null,
  5445. throws: false,
  5446. traditional: false,
  5447. headers: {},
  5448. */
  5449. accepts: {
  5450. "*": allTypes,
  5451. text: "text/plain",
  5452. html: "text/html",
  5453. xml: "application/xml, text/xml",
  5454. json: "application/json, text/javascript"
  5455. },
  5456. contents: {
  5457. xml: /\bxml\b/,
  5458. html: /\bhtml/,
  5459. json: /\bjson\b/
  5460. },
  5461. responseFields: {
  5462. xml: "responseXML",
  5463. text: "responseText",
  5464. json: "responseJSON"
  5465. },
  5466. // Data converters
  5467. // Keys separate source (or catchall "*") and destination types with a single space
  5468. converters: {
  5469. // Convert anything to text
  5470. "* text": String,
  5471. // Text to html (true = no transformation)
  5472. "text html": true,
  5473. // Evaluate text as a json expression
  5474. "text json": JSON.parse,
  5475. // Parse text as xml
  5476. "text xml": jQuery.parseXML
  5477. },
  5478. // For options that shouldn't be deep extended:
  5479. // you can add your own custom options here if
  5480. // and when you create one that shouldn't be
  5481. // deep extended (see ajaxExtend)
  5482. flatOptions: {
  5483. url: true,
  5484. context: true
  5485. }
  5486. },
  5487. // Creates a full fledged settings object into target
  5488. // with both ajaxSettings and settings fields.
  5489. // If target is omitted, writes into ajaxSettings.
  5490. ajaxSetup: function(target, settings) {
  5491. return settings ? (
  5492. // Building a settings object
  5493. ajaxExtend(ajaxExtend(target, jQuery.ajaxSettings), settings)
  5494. ) : (
  5495. // Extending ajaxSettings
  5496. ajaxExtend(jQuery.ajaxSettings, target)
  5497. );
  5498. },
  5499. ajaxPrefilter: addToPrefiltersOrTransports(prefilters),
  5500. ajaxTransport: addToPrefiltersOrTransports(transports),
  5501. // Main method
  5502. ajax: function(url, options) {
  5503. if (typeof url === "object") {
  5504. options = url;
  5505. url = void 0;
  5506. }
  5507. options = options || {};
  5508. var transport, cacheURL, responseHeadersString, responseHeaders, timeoutTimer, urlAnchor, completed2, fireGlobals, i, uncached, s = jQuery.ajaxSetup({}, options), callbackContext = s.context || s, globalEventContext = s.context && (callbackContext.nodeType || callbackContext.jquery) ? jQuery(callbackContext) : jQuery.event, deferred = jQuery.Deferred(), completeDeferred = jQuery.Callbacks("once memory"), statusCode = s.statusCode || {}, requestHeaders = {}, requestHeadersNames = {}, strAbort = "canceled", jqXHR = {
  5509. readyState: 0,
  5510. // Builds headers hashtable if needed
  5511. getResponseHeader: function(key) {
  5512. var match;
  5513. if (completed2) {
  5514. if (!responseHeaders) {
  5515. responseHeaders = {};
  5516. while (match = rheaders.exec(responseHeadersString)) {
  5517. responseHeaders[match[1].toLowerCase() + " "] = (responseHeaders[match[1].toLowerCase() + " "] || []).concat(match[2]);
  5518. }
  5519. }
  5520. match = responseHeaders[key.toLowerCase() + " "];
  5521. }
  5522. return match == null ? null : match.join(", ");
  5523. },
  5524. // Raw string
  5525. getAllResponseHeaders: function() {
  5526. return completed2 ? responseHeadersString : null;
  5527. },
  5528. // Caches the header
  5529. setRequestHeader: function(name, value) {
  5530. if (completed2 == null) {
  5531. name = requestHeadersNames[name.toLowerCase()] = requestHeadersNames[name.toLowerCase()] || name;
  5532. requestHeaders[name] = value;
  5533. }
  5534. return this;
  5535. },
  5536. // Overrides response content-type header
  5537. overrideMimeType: function(type) {
  5538. if (completed2 == null) {
  5539. s.mimeType = type;
  5540. }
  5541. return this;
  5542. },
  5543. // Status-dependent callbacks
  5544. statusCode: function(map) {
  5545. var code;
  5546. if (map) {
  5547. if (completed2) {
  5548. jqXHR.always(map[jqXHR.status]);
  5549. } else {
  5550. for (code in map) {
  5551. statusCode[code] = [statusCode[code], map[code]];
  5552. }
  5553. }
  5554. }
  5555. return this;
  5556. },
  5557. // Cancel the request
  5558. abort: function(statusText) {
  5559. var finalText = statusText || strAbort;
  5560. if (transport) {
  5561. transport.abort(finalText);
  5562. }
  5563. done(0, finalText);
  5564. return this;
  5565. }
  5566. };
  5567. deferred.promise(jqXHR);
  5568. s.url = ((url || s.url || location2.href) + "").replace(rprotocol, location2.protocol + "//");
  5569. s.type = options.method || options.type || s.method || s.type;
  5570. s.dataTypes = (s.dataType || "*").toLowerCase().match(rnothtmlwhite) || [""];
  5571. if (s.crossDomain == null) {
  5572. urlAnchor = document2.createElement("a");
  5573. try {
  5574. urlAnchor.href = s.url;
  5575. urlAnchor.href = urlAnchor.href;
  5576. s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== urlAnchor.protocol + "//" + urlAnchor.host;
  5577. } catch (e) {
  5578. s.crossDomain = true;
  5579. }
  5580. }
  5581. if (s.data && s.processData && typeof s.data !== "string") {
  5582. s.data = jQuery.param(s.data, s.traditional);
  5583. }
  5584. inspectPrefiltersOrTransports(prefilters, s, options, jqXHR);
  5585. if (completed2) {
  5586. return jqXHR;
  5587. }
  5588. fireGlobals = jQuery.event && s.global;
  5589. if (fireGlobals && jQuery.active++ === 0) {
  5590. jQuery.event.trigger("ajaxStart");
  5591. }
  5592. s.type = s.type.toUpperCase();
  5593. s.hasContent = !rnoContent.test(s.type);
  5594. cacheURL = s.url.replace(rhash, "");
  5595. if (!s.hasContent) {
  5596. uncached = s.url.slice(cacheURL.length);
  5597. if (s.data && (s.processData || typeof s.data === "string")) {
  5598. cacheURL += (rquery.test(cacheURL) ? "&" : "?") + s.data;
  5599. delete s.data;
  5600. }
  5601. if (s.cache === false) {
  5602. cacheURL = cacheURL.replace(rantiCache, "$1");
  5603. uncached = (rquery.test(cacheURL) ? "&" : "?") + "_=" + nonce.guid++ + uncached;
  5604. }
  5605. s.url = cacheURL + uncached;
  5606. } else if (s.data && s.processData && (s.contentType || "").indexOf("application/x-www-form-urlencoded") === 0) {
  5607. s.data = s.data.replace(r20, "+");
  5608. }
  5609. if (s.ifModified) {
  5610. if (jQuery.lastModified[cacheURL]) {
  5611. jqXHR.setRequestHeader("If-Modified-Since", jQuery.lastModified[cacheURL]);
  5612. }
  5613. if (jQuery.etag[cacheURL]) {
  5614. jqXHR.setRequestHeader("If-None-Match", jQuery.etag[cacheURL]);
  5615. }
  5616. }
  5617. if (s.data && s.hasContent && s.contentType !== false || options.contentType) {
  5618. jqXHR.setRequestHeader("Content-Type", s.contentType);
  5619. }
  5620. jqXHR.setRequestHeader(
  5621. "Accept",
  5622. s.dataTypes[0] && s.accepts[s.dataTypes[0]] ? s.accepts[s.dataTypes[0]] + (s.dataTypes[0] !== "*" ? ", " + allTypes + "; q=0.01" : "") : s.accepts["*"]
  5623. );
  5624. for (i in s.headers) {
  5625. jqXHR.setRequestHeader(i, s.headers[i]);
  5626. }
  5627. if (s.beforeSend && (s.beforeSend.call(callbackContext, jqXHR, s) === false || completed2)) {
  5628. return jqXHR.abort();
  5629. }
  5630. strAbort = "abort";
  5631. completeDeferred.add(s.complete);
  5632. jqXHR.done(s.success);
  5633. jqXHR.fail(s.error);
  5634. transport = inspectPrefiltersOrTransports(transports, s, options, jqXHR);
  5635. if (!transport) {
  5636. done(-1, "No Transport");
  5637. } else {
  5638. jqXHR.readyState = 1;
  5639. if (fireGlobals) {
  5640. globalEventContext.trigger("ajaxSend", [jqXHR, s]);
  5641. }
  5642. if (completed2) {
  5643. return jqXHR;
  5644. }
  5645. if (s.async && s.timeout > 0) {
  5646. timeoutTimer = window2.setTimeout(function() {
  5647. jqXHR.abort("timeout");
  5648. }, s.timeout);
  5649. }
  5650. try {
  5651. completed2 = false;
  5652. transport.send(requestHeaders, done);
  5653. } catch (e) {
  5654. if (completed2) {
  5655. throw e;
  5656. }
  5657. done(-1, e);
  5658. }
  5659. }
  5660. function done(status, nativeStatusText, responses, headers) {
  5661. var isSuccess, success, error, response, modified, statusText = nativeStatusText;
  5662. if (completed2) {
  5663. return;
  5664. }
  5665. completed2 = true;
  5666. if (timeoutTimer) {
  5667. window2.clearTimeout(timeoutTimer);
  5668. }
  5669. transport = void 0;
  5670. responseHeadersString = headers || "";
  5671. jqXHR.readyState = status > 0 ? 4 : 0;
  5672. isSuccess = status >= 200 && status < 300 || status === 304;
  5673. if (responses) {
  5674. response = ajaxHandleResponses(s, jqXHR, responses);
  5675. }
  5676. if (!isSuccess && jQuery.inArray("script", s.dataTypes) > -1 && jQuery.inArray("json", s.dataTypes) < 0) {
  5677. s.converters["text script"] = function() {
  5678. };
  5679. }
  5680. response = ajaxConvert(s, response, jqXHR, isSuccess);
  5681. if (isSuccess) {
  5682. if (s.ifModified) {
  5683. modified = jqXHR.getResponseHeader("Last-Modified");
  5684. if (modified) {
  5685. jQuery.lastModified[cacheURL] = modified;
  5686. }
  5687. modified = jqXHR.getResponseHeader("etag");
  5688. if (modified) {
  5689. jQuery.etag[cacheURL] = modified;
  5690. }
  5691. }
  5692. if (status === 204 || s.type === "HEAD") {
  5693. statusText = "nocontent";
  5694. } else if (status === 304) {
  5695. statusText = "notmodified";
  5696. } else {
  5697. statusText = response.state;
  5698. success = response.data;
  5699. error = response.error;
  5700. isSuccess = !error;
  5701. }
  5702. } else {
  5703. error = statusText;
  5704. if (status || !statusText) {
  5705. statusText = "error";
  5706. if (status < 0) {
  5707. status = 0;
  5708. }
  5709. }
  5710. }
  5711. jqXHR.status = status;
  5712. jqXHR.statusText = (nativeStatusText || statusText) + "";
  5713. if (isSuccess) {
  5714. deferred.resolveWith(callbackContext, [success, statusText, jqXHR]);
  5715. } else {
  5716. deferred.rejectWith(callbackContext, [jqXHR, statusText, error]);
  5717. }
  5718. jqXHR.statusCode(statusCode);
  5719. statusCode = void 0;
  5720. if (fireGlobals) {
  5721. globalEventContext.trigger(
  5722. isSuccess ? "ajaxSuccess" : "ajaxError",
  5723. [jqXHR, s, isSuccess ? success : error]
  5724. );
  5725. }
  5726. completeDeferred.fireWith(callbackContext, [jqXHR, statusText]);
  5727. if (fireGlobals) {
  5728. globalEventContext.trigger("ajaxComplete", [jqXHR, s]);
  5729. if (!--jQuery.active) {
  5730. jQuery.event.trigger("ajaxStop");
  5731. }
  5732. }
  5733. }
  5734. return jqXHR;
  5735. },
  5736. getJSON: function(url, data, callback) {
  5737. return jQuery.get(url, data, callback, "json");
  5738. },
  5739. getScript: function(url, callback) {
  5740. return jQuery.get(url, void 0, callback, "script");
  5741. }
  5742. });
  5743. jQuery.each(["get", "post"], function(_i, method) {
  5744. jQuery[method] = function(url, data, callback, type) {
  5745. if (isFunction(data)) {
  5746. type = type || callback;
  5747. callback = data;
  5748. data = void 0;
  5749. }
  5750. return jQuery.ajax(jQuery.extend({
  5751. url,
  5752. type: method,
  5753. dataType: type,
  5754. data,
  5755. success: callback
  5756. }, jQuery.isPlainObject(url) && url));
  5757. };
  5758. });
  5759. jQuery.ajaxPrefilter(function(s) {
  5760. var i;
  5761. for (i in s.headers) {
  5762. if (i.toLowerCase() === "content-type") {
  5763. s.contentType = s.headers[i] || "";
  5764. }
  5765. }
  5766. });
  5767. jQuery._evalUrl = function(url, options, doc) {
  5768. return jQuery.ajax({
  5769. url,
  5770. // Make this explicit, since user can override this through ajaxSetup (trac-11264)
  5771. type: "GET",
  5772. dataType: "script",
  5773. cache: true,
  5774. async: false,
  5775. global: false,
  5776. // Only evaluate the response if it is successful (gh-4126)
  5777. // dataFilter is not invoked for failure responses, so using it instead
  5778. // of the default converter is kludgy but it works.
  5779. converters: {
  5780. "text script": function() {
  5781. }
  5782. },
  5783. dataFilter: function(response) {
  5784. jQuery.globalEval(response, options, doc);
  5785. }
  5786. });
  5787. };
  5788. jQuery.fn.extend({
  5789. wrapAll: function(html) {
  5790. var wrap;
  5791. if (this[0]) {
  5792. if (isFunction(html)) {
  5793. html = html.call(this[0]);
  5794. }
  5795. wrap = jQuery(html, this[0].ownerDocument).eq(0).clone(true);
  5796. if (this[0].parentNode) {
  5797. wrap.insertBefore(this[0]);
  5798. }
  5799. wrap.map(function() {
  5800. var elem = this;
  5801. while (elem.firstElementChild) {
  5802. elem = elem.firstElementChild;
  5803. }
  5804. return elem;
  5805. }).append(this);
  5806. }
  5807. return this;
  5808. },
  5809. wrapInner: function(html) {
  5810. if (isFunction(html)) {
  5811. return this.each(function(i) {
  5812. jQuery(this).wrapInner(html.call(this, i));
  5813. });
  5814. }
  5815. return this.each(function() {
  5816. var self2 = jQuery(this), contents = self2.contents();
  5817. if (contents.length) {
  5818. contents.wrapAll(html);
  5819. } else {
  5820. self2.append(html);
  5821. }
  5822. });
  5823. },
  5824. wrap: function(html) {
  5825. var htmlIsFunction = isFunction(html);
  5826. return this.each(function(i) {
  5827. jQuery(this).wrapAll(htmlIsFunction ? html.call(this, i) : html);
  5828. });
  5829. },
  5830. unwrap: function(selector) {
  5831. this.parent(selector).not("body").each(function() {
  5832. jQuery(this).replaceWith(this.childNodes);
  5833. });
  5834. return this;
  5835. }
  5836. });
  5837. jQuery.expr.pseudos.hidden = function(elem) {
  5838. return !jQuery.expr.pseudos.visible(elem);
  5839. };
  5840. jQuery.expr.pseudos.visible = function(elem) {
  5841. return !!(elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length);
  5842. };
  5843. jQuery.ajaxSettings.xhr = function() {
  5844. try {
  5845. return new window2.XMLHttpRequest();
  5846. } catch (e) {
  5847. }
  5848. };
  5849. var xhrSuccessStatus = {
  5850. // File protocol always yields status code 0, assume 200
  5851. 0: 200,
  5852. // Support: IE <=9 only
  5853. // trac-1450: sometimes IE returns 1223 when it should be 204
  5854. 1223: 204
  5855. }, xhrSupported = jQuery.ajaxSettings.xhr();
  5856. support.cors = !!xhrSupported && "withCredentials" in xhrSupported;
  5857. support.ajax = xhrSupported = !!xhrSupported;
  5858. jQuery.ajaxTransport(function(options) {
  5859. var callback, errorCallback;
  5860. if (support.cors || xhrSupported && !options.crossDomain) {
  5861. return {
  5862. send: function(headers, complete) {
  5863. var i, xhr = options.xhr();
  5864. xhr.open(
  5865. options.type,
  5866. options.url,
  5867. options.async,
  5868. options.username,
  5869. options.password
  5870. );
  5871. if (options.xhrFields) {
  5872. for (i in options.xhrFields) {
  5873. xhr[i] = options.xhrFields[i];
  5874. }
  5875. }
  5876. if (options.mimeType && xhr.overrideMimeType) {
  5877. xhr.overrideMimeType(options.mimeType);
  5878. }
  5879. if (!options.crossDomain && !headers["X-Requested-With"]) {
  5880. headers["X-Requested-With"] = "XMLHttpRequest";
  5881. }
  5882. for (i in headers) {
  5883. xhr.setRequestHeader(i, headers[i]);
  5884. }
  5885. callback = function(type) {
  5886. return function() {
  5887. if (callback) {
  5888. callback = errorCallback = xhr.onload = xhr.onerror = xhr.onabort = xhr.ontimeout = xhr.onreadystatechange = null;
  5889. if (type === "abort") {
  5890. xhr.abort();
  5891. } else if (type === "error") {
  5892. if (typeof xhr.status !== "number") {
  5893. complete(0, "error");
  5894. } else {
  5895. complete(
  5896. // File: protocol always yields status 0; see trac-8605, trac-14207
  5897. xhr.status,
  5898. xhr.statusText
  5899. );
  5900. }
  5901. } else {
  5902. complete(
  5903. xhrSuccessStatus[xhr.status] || xhr.status,
  5904. xhr.statusText,
  5905. // Support: IE <=9 only
  5906. // IE9 has no XHR2 but throws on binary (trac-11426)
  5907. // For XHR2 non-text, let the caller handle it (gh-2498)
  5908. (xhr.responseType || "text") !== "text" || typeof xhr.responseText !== "string" ? { binary: xhr.response } : { text: xhr.responseText },
  5909. xhr.getAllResponseHeaders()
  5910. );
  5911. }
  5912. }
  5913. };
  5914. };
  5915. xhr.onload = callback();
  5916. errorCallback = xhr.onerror = xhr.ontimeout = callback("error");
  5917. if (xhr.onabort !== void 0) {
  5918. xhr.onabort = errorCallback;
  5919. } else {
  5920. xhr.onreadystatechange = function() {
  5921. if (xhr.readyState === 4) {
  5922. window2.setTimeout(function() {
  5923. if (callback) {
  5924. errorCallback();
  5925. }
  5926. });
  5927. }
  5928. };
  5929. }
  5930. callback = callback("abort");
  5931. try {
  5932. xhr.send(options.hasContent && options.data || null);
  5933. } catch (e) {
  5934. if (callback) {
  5935. throw e;
  5936. }
  5937. }
  5938. },
  5939. abort: function() {
  5940. if (callback) {
  5941. callback();
  5942. }
  5943. }
  5944. };
  5945. }
  5946. });
  5947. jQuery.ajaxPrefilter(function(s) {
  5948. if (s.crossDomain) {
  5949. s.contents.script = false;
  5950. }
  5951. });
  5952. jQuery.ajaxSetup({
  5953. accepts: {
  5954. script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
  5955. },
  5956. contents: {
  5957. script: /\b(?:java|ecma)script\b/
  5958. },
  5959. converters: {
  5960. "text script": function(text) {
  5961. jQuery.globalEval(text);
  5962. return text;
  5963. }
  5964. }
  5965. });
  5966. jQuery.ajaxPrefilter("script", function(s) {
  5967. if (s.cache === void 0) {
  5968. s.cache = false;
  5969. }
  5970. if (s.crossDomain) {
  5971. s.type = "GET";
  5972. }
  5973. });
  5974. jQuery.ajaxTransport("script", function(s) {
  5975. if (s.crossDomain || s.scriptAttrs) {
  5976. var script, callback;
  5977. return {
  5978. send: function(_, complete) {
  5979. script = jQuery("<script>").attr(s.scriptAttrs || {}).prop({ charset: s.scriptCharset, src: s.url }).on("load error", callback = function(evt) {
  5980. script.remove();
  5981. callback = null;
  5982. if (evt) {
  5983. complete(evt.type === "error" ? 404 : 200, evt.type);
  5984. }
  5985. });
  5986. document2.head.appendChild(script[0]);
  5987. },
  5988. abort: function() {
  5989. if (callback) {
  5990. callback();
  5991. }
  5992. }
  5993. };
  5994. }
  5995. });
  5996. var oldCallbacks = [], rjsonp = /(=)\?(?=&|$)|\?\?/;
  5997. jQuery.ajaxSetup({
  5998. jsonp: "callback",
  5999. jsonpCallback: function() {
  6000. var callback = oldCallbacks.pop() || jQuery.expando + "_" + nonce.guid++;
  6001. this[callback] = true;
  6002. return callback;
  6003. }
  6004. });
  6005. jQuery.ajaxPrefilter("json jsonp", function(s, originalSettings, jqXHR) {
  6006. 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");
  6007. if (jsonProp || s.dataTypes[0] === "jsonp") {
  6008. callbackName = s.jsonpCallback = isFunction(s.jsonpCallback) ? s.jsonpCallback() : s.jsonpCallback;
  6009. if (jsonProp) {
  6010. s[jsonProp] = s[jsonProp].replace(rjsonp, "$1" + callbackName);
  6011. } else if (s.jsonp !== false) {
  6012. s.url += (rquery.test(s.url) ? "&" : "?") + s.jsonp + "=" + callbackName;
  6013. }
  6014. s.converters["script json"] = function() {
  6015. if (!responseContainer) {
  6016. jQuery.error(callbackName + " was not called");
  6017. }
  6018. return responseContainer[0];
  6019. };
  6020. s.dataTypes[0] = "json";
  6021. overwritten = window2[callbackName];
  6022. window2[callbackName] = function() {
  6023. responseContainer = arguments;
  6024. };
  6025. jqXHR.always(function() {
  6026. if (overwritten === void 0) {
  6027. jQuery(window2).removeProp(callbackName);
  6028. } else {
  6029. window2[callbackName] = overwritten;
  6030. }
  6031. if (s[callbackName]) {
  6032. s.jsonpCallback = originalSettings.jsonpCallback;
  6033. oldCallbacks.push(callbackName);
  6034. }
  6035. if (responseContainer && isFunction(overwritten)) {
  6036. overwritten(responseContainer[0]);
  6037. }
  6038. responseContainer = overwritten = void 0;
  6039. });
  6040. return "script";
  6041. }
  6042. });
  6043. support.createHTMLDocument = function() {
  6044. var body = document2.implementation.createHTMLDocument("").body;
  6045. body.innerHTML = "<form></form><form></form>";
  6046. return body.childNodes.length === 2;
  6047. }();
  6048. jQuery.parseHTML = function(data, context, keepScripts) {
  6049. if (typeof data !== "string") {
  6050. return [];
  6051. }
  6052. if (typeof context === "boolean") {
  6053. keepScripts = context;
  6054. context = false;
  6055. }
  6056. var base, parsed, scripts;
  6057. if (!context) {
  6058. if (support.createHTMLDocument) {
  6059. context = document2.implementation.createHTMLDocument("");
  6060. base = context.createElement("base");
  6061. base.href = document2.location.href;
  6062. context.head.appendChild(base);
  6063. } else {
  6064. context = document2;
  6065. }
  6066. }
  6067. parsed = rsingleTag.exec(data);
  6068. scripts = !keepScripts && [];
  6069. if (parsed) {
  6070. return [context.createElement(parsed[1])];
  6071. }
  6072. parsed = buildFragment([data], context, scripts);
  6073. if (scripts && scripts.length) {
  6074. jQuery(scripts).remove();
  6075. }
  6076. return jQuery.merge([], parsed.childNodes);
  6077. };
  6078. jQuery.fn.load = function(url, params, callback) {
  6079. var selector, type, response, self2 = this, off = url.indexOf(" ");
  6080. if (off > -1) {
  6081. selector = stripAndCollapse(url.slice(off));
  6082. url = url.slice(0, off);
  6083. }
  6084. if (isFunction(params)) {
  6085. callback = params;
  6086. params = void 0;
  6087. } else if (params && typeof params === "object") {
  6088. type = "POST";
  6089. }
  6090. if (self2.length > 0) {
  6091. jQuery.ajax({
  6092. url,
  6093. // If "type" variable is undefined, then "GET" method will be used.
  6094. // Make value of this field explicit since
  6095. // user can override it through ajaxSetup method
  6096. type: type || "GET",
  6097. dataType: "html",
  6098. data: params
  6099. }).done(function(responseText) {
  6100. response = arguments;
  6101. self2.html(selector ? (
  6102. // If a selector was specified, locate the right elements in a dummy div
  6103. // Exclude scripts to avoid IE 'Permission Denied' errors
  6104. jQuery("<div>").append(jQuery.parseHTML(responseText)).find(selector)
  6105. ) : (
  6106. // Otherwise use the full result
  6107. responseText
  6108. ));
  6109. }).always(callback && function(jqXHR, status) {
  6110. self2.each(function() {
  6111. callback.apply(this, response || [jqXHR.responseText, status, jqXHR]);
  6112. });
  6113. });
  6114. }
  6115. return this;
  6116. };
  6117. jQuery.expr.pseudos.animated = function(elem) {
  6118. return jQuery.grep(jQuery.timers, function(fn) {
  6119. return elem === fn.elem;
  6120. }).length;
  6121. };
  6122. jQuery.offset = {
  6123. setOffset: function(elem, options, i) {
  6124. var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, position = jQuery.css(elem, "position"), curElem = jQuery(elem), props = {};
  6125. if (position === "static") {
  6126. elem.style.position = "relative";
  6127. }
  6128. curOffset = curElem.offset();
  6129. curCSSTop = jQuery.css(elem, "top");
  6130. curCSSLeft = jQuery.css(elem, "left");
  6131. calculatePosition = (position === "absolute" || position === "fixed") && (curCSSTop + curCSSLeft).indexOf("auto") > -1;
  6132. if (calculatePosition) {
  6133. curPosition = curElem.position();
  6134. curTop = curPosition.top;
  6135. curLeft = curPosition.left;
  6136. } else {
  6137. curTop = parseFloat(curCSSTop) || 0;
  6138. curLeft = parseFloat(curCSSLeft) || 0;
  6139. }
  6140. if (isFunction(options)) {
  6141. options = options.call(elem, i, jQuery.extend({}, curOffset));
  6142. }
  6143. if (options.top != null) {
  6144. props.top = options.top - curOffset.top + curTop;
  6145. }
  6146. if (options.left != null) {
  6147. props.left = options.left - curOffset.left + curLeft;
  6148. }
  6149. if ("using" in options) {
  6150. options.using.call(elem, props);
  6151. } else {
  6152. curElem.css(props);
  6153. }
  6154. }
  6155. };
  6156. jQuery.fn.extend({
  6157. // offset() relates an element's border box to the document origin
  6158. offset: function(options) {
  6159. if (arguments.length) {
  6160. return options === void 0 ? this : this.each(function(i) {
  6161. jQuery.offset.setOffset(this, options, i);
  6162. });
  6163. }
  6164. var rect, win, elem = this[0];
  6165. if (!elem) {
  6166. return;
  6167. }
  6168. if (!elem.getClientRects().length) {
  6169. return { top: 0, left: 0 };
  6170. }
  6171. rect = elem.getBoundingClientRect();
  6172. win = elem.ownerDocument.defaultView;
  6173. return {
  6174. top: rect.top + win.pageYOffset,
  6175. left: rect.left + win.pageXOffset
  6176. };
  6177. },
  6178. // position() relates an element's margin box to its offset parent's padding box
  6179. // This corresponds to the behavior of CSS absolute positioning
  6180. position: function() {
  6181. if (!this[0]) {
  6182. return;
  6183. }
  6184. var offsetParent, offset, doc, elem = this[0], parentOffset = { top: 0, left: 0 };
  6185. if (jQuery.css(elem, "position") === "fixed") {
  6186. offset = elem.getBoundingClientRect();
  6187. } else {
  6188. offset = this.offset();
  6189. doc = elem.ownerDocument;
  6190. offsetParent = elem.offsetParent || doc.documentElement;
  6191. while (offsetParent && (offsetParent === doc.body || offsetParent === doc.documentElement) && jQuery.css(offsetParent, "position") === "static") {
  6192. offsetParent = offsetParent.parentNode;
  6193. }
  6194. if (offsetParent && offsetParent !== elem && offsetParent.nodeType === 1) {
  6195. parentOffset = jQuery(offsetParent).offset();
  6196. parentOffset.top += jQuery.css(offsetParent, "borderTopWidth", true);
  6197. parentOffset.left += jQuery.css(offsetParent, "borderLeftWidth", true);
  6198. }
  6199. }
  6200. return {
  6201. top: offset.top - parentOffset.top - jQuery.css(elem, "marginTop", true),
  6202. left: offset.left - parentOffset.left - jQuery.css(elem, "marginLeft", true)
  6203. };
  6204. },
  6205. // This method will return documentElement in the following cases:
  6206. // 1) For the element inside the iframe without offsetParent, this method will return
  6207. // documentElement of the parent window
  6208. // 2) For the hidden or detached element
  6209. // 3) For body or html element, i.e. in case of the html node - it will return itself
  6210. //
  6211. // but those exceptions were never presented as a real life use-cases
  6212. // and might be considered as more preferable results.
  6213. //
  6214. // This logic, however, is not guaranteed and can change at any point in the future
  6215. offsetParent: function() {
  6216. return this.map(function() {
  6217. var offsetParent = this.offsetParent;
  6218. while (offsetParent && jQuery.css(offsetParent, "position") === "static") {
  6219. offsetParent = offsetParent.offsetParent;
  6220. }
  6221. return offsetParent || documentElement;
  6222. });
  6223. }
  6224. });
  6225. jQuery.each({ scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function(method, prop) {
  6226. var top = "pageYOffset" === prop;
  6227. jQuery.fn[method] = function(val) {
  6228. return access(this, function(elem, method2, val2) {
  6229. var win;
  6230. if (isWindow(elem)) {
  6231. win = elem;
  6232. } else if (elem.nodeType === 9) {
  6233. win = elem.defaultView;
  6234. }
  6235. if (val2 === void 0) {
  6236. return win ? win[prop] : elem[method2];
  6237. }
  6238. if (win) {
  6239. win.scrollTo(
  6240. !top ? val2 : win.pageXOffset,
  6241. top ? val2 : win.pageYOffset
  6242. );
  6243. } else {
  6244. elem[method2] = val2;
  6245. }
  6246. }, method, val, arguments.length);
  6247. };
  6248. });
  6249. jQuery.each(["top", "left"], function(_i, prop) {
  6250. jQuery.cssHooks[prop] = addGetHookIf(
  6251. support.pixelPosition,
  6252. function(elem, computed) {
  6253. if (computed) {
  6254. computed = curCSS(elem, prop);
  6255. return rnumnonpx.test(computed) ? jQuery(elem).position()[prop] + "px" : computed;
  6256. }
  6257. }
  6258. );
  6259. });
  6260. jQuery.each({ Height: "height", Width: "width" }, function(name, type) {
  6261. jQuery.each({
  6262. padding: "inner" + name,
  6263. content: type,
  6264. "": "outer" + name
  6265. }, function(defaultExtra, funcName) {
  6266. jQuery.fn[funcName] = function(margin, value) {
  6267. var chainable = arguments.length && (defaultExtra || typeof margin !== "boolean"), extra = defaultExtra || (margin === true || value === true ? "margin" : "border");
  6268. return access(this, function(elem, type2, value2) {
  6269. var doc;
  6270. if (isWindow(elem)) {
  6271. return funcName.indexOf("outer") === 0 ? elem["inner" + name] : elem.document.documentElement["client" + name];
  6272. }
  6273. if (elem.nodeType === 9) {
  6274. doc = elem.documentElement;
  6275. return Math.max(
  6276. elem.body["scroll" + name],
  6277. doc["scroll" + name],
  6278. elem.body["offset" + name],
  6279. doc["offset" + name],
  6280. doc["client" + name]
  6281. );
  6282. }
  6283. return value2 === void 0 ? (
  6284. // Get width or height on the element, requesting but not forcing parseFloat
  6285. jQuery.css(elem, type2, extra)
  6286. ) : (
  6287. // Set width or height on the element
  6288. jQuery.style(elem, type2, value2, extra)
  6289. );
  6290. }, type, chainable ? margin : void 0, chainable);
  6291. };
  6292. });
  6293. });
  6294. jQuery.each([
  6295. "ajaxStart",
  6296. "ajaxStop",
  6297. "ajaxComplete",
  6298. "ajaxError",
  6299. "ajaxSuccess",
  6300. "ajaxSend"
  6301. ], function(_i, type) {
  6302. jQuery.fn[type] = function(fn) {
  6303. return this.on(type, fn);
  6304. };
  6305. });
  6306. jQuery.fn.extend({
  6307. bind: function(types, data, fn) {
  6308. return this.on(types, null, data, fn);
  6309. },
  6310. unbind: function(types, fn) {
  6311. return this.off(types, null, fn);
  6312. },
  6313. delegate: function(selector, types, data, fn) {
  6314. return this.on(types, selector, data, fn);
  6315. },
  6316. undelegate: function(selector, types, fn) {
  6317. return arguments.length === 1 ? this.off(selector, "**") : this.off(types, selector || "**", fn);
  6318. },
  6319. hover: function(fnOver, fnOut) {
  6320. return this.on("mouseenter", fnOver).on("mouseleave", fnOut || fnOver);
  6321. }
  6322. });
  6323. jQuery.each(
  6324. "blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),
  6325. function(_i, name) {
  6326. jQuery.fn[name] = function(data, fn) {
  6327. return arguments.length > 0 ? this.on(name, null, data, fn) : this.trigger(name);
  6328. };
  6329. }
  6330. );
  6331. var rtrim = /^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;
  6332. jQuery.proxy = function(fn, context) {
  6333. var tmp, args, proxy;
  6334. if (typeof context === "string") {
  6335. tmp = fn[context];
  6336. context = fn;
  6337. fn = tmp;
  6338. }
  6339. if (!isFunction(fn)) {
  6340. return void 0;
  6341. }
  6342. args = slice.call(arguments, 2);
  6343. proxy = function() {
  6344. return fn.apply(context || this, args.concat(slice.call(arguments)));
  6345. };
  6346. proxy.guid = fn.guid = fn.guid || jQuery.guid++;
  6347. return proxy;
  6348. };
  6349. jQuery.holdReady = function(hold) {
  6350. if (hold) {
  6351. jQuery.readyWait++;
  6352. } else {
  6353. jQuery.ready(true);
  6354. }
  6355. };
  6356. jQuery.isArray = Array.isArray;
  6357. jQuery.parseJSON = JSON.parse;
  6358. jQuery.nodeName = nodeName;
  6359. jQuery.isFunction = isFunction;
  6360. jQuery.isWindow = isWindow;
  6361. jQuery.camelCase = camelCase;
  6362. jQuery.type = toType;
  6363. jQuery.now = Date.now;
  6364. jQuery.isNumeric = function(obj) {
  6365. var type = jQuery.type(obj);
  6366. return (type === "number" || type === "string") && // parseFloat NaNs numeric-cast false positives ("")
  6367. // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
  6368. // subtraction forces infinities to NaN
  6369. !isNaN(obj - parseFloat(obj));
  6370. };
  6371. jQuery.trim = function(text) {
  6372. return text == null ? "" : (text + "").replace(rtrim, "$1");
  6373. };
  6374. var _jQuery = window2.jQuery, _$ = window2.$;
  6375. jQuery.noConflict = function(deep) {
  6376. if (window2.$ === jQuery) {
  6377. window2.$ = _$;
  6378. }
  6379. if (deep && window2.jQuery === jQuery) {
  6380. window2.jQuery = _jQuery;
  6381. }
  6382. return jQuery;
  6383. };
  6384. if (typeof noGlobal === "undefined") {
  6385. window2.jQuery = window2.$ = jQuery;
  6386. }
  6387. return jQuery;
  6388. });
  6389. })(jquery);
  6390. var jqueryExports = jquery.exports;
  6391. const $ = /* @__PURE__ */ getDefaultExportFromCjs(jqueryExports);
  6392. class RuleBaseInterface {
  6393. constructor() {
  6394. __publicField(this, "$", window.jQuery || $);
  6395. // 通用属性配置,以及工具函数。可在规则类中覆盖
  6396. __publicField(this, "minTitleLength", 8);
  6397. // 标题最少汉字数(不能在小了,这个值变小会造成更多数据误差)
  6398. __publicField(this, "maxDepthLevel", 30);
  6399. // DOM树最大深度
  6400. __publicField(this, "companyNameReg", /(公司|研究所|平台)$/);
  6401. __publicField(this, "includeTags", [
  6402. "A",
  6403. "DIV",
  6404. "SPAN",
  6405. "TD",
  6406. "H1",
  6407. "H2",
  6408. "H3",
  6409. "H4",
  6410. "H5",
  6411. "H6",
  6412. "P",
  6413. "TD",
  6414. "TR"
  6415. ]);
  6416. // 非法节点,需要排除
  6417. __publicField(this, "excludeTags", ["SCRIPT", "STYLE"]);
  6418. __publicField(this, "chineseCharReg", /[\u4e00-\u9fa5]/g);
  6419. __publicField(this, "datePatterns", [
  6420. /\b(\d{4})\/(\d{0,2})\/(\d{0,2})\b/,
  6421. /\b(\d{4})-(\d{0,2})-(\d{0,2})\b/,
  6422. /\b(\d{0,2})-(\d{0,2})\b/,
  6423. /\b(\d{0,2})\/(\d{0,2})\b/,
  6424. /\b(\d{4})\/(\d{0,2})\/(\d{0,2}) (\d{0,2}):(\d{0,2})\b/,
  6425. /\b(\d{4})-(\d{0,2})-(\d{0,2}) (\d{0,2}):(\d{0,2})\b/,
  6426. /\b(\d{2})\/(\d{0,2}) (\d{0,2}):(\d{0,2})\b/,
  6427. /\b(\d{2})-(\d{0,2}) (\d{0,2}):(\d{0,2})\b/,
  6428. // 匹配年月
  6429. /\b(\d{4})\/(\d{0,2})\b/,
  6430. /\b(\d{4})-(\d{0,2})\b/,
  6431. // 范围更大的匹配
  6432. /\b(\d{4})([\\\/\.\-年月日点时分秒\:])(\d{0,2})([\\\/\.\-年月日点时分秒\:])(\d{0,2})\b/,
  6433. /\b(\d{4})([\\\/\.\-年月日点时分秒\:])(\d{0,2})\b/
  6434. ]);
  6435. __publicField(this, "todayDatePatternString", [
  6436. "(%s年)(\\D+)(%s月)(\\D+)(%s日)",
  6437. "(%s月)(\\D+)(%s日)"
  6438. ]);
  6439. __publicField(this, "infoTypeList", [
  6440. "拟建",
  6441. "采购意向",
  6442. "预告",
  6443. "预审",
  6444. "预审结果",
  6445. "论证意见",
  6446. "需求公示",
  6447. "招标",
  6448. "邀标",
  6449. "询价",
  6450. "竞谈",
  6451. "单一",
  6452. "竞价",
  6453. "中标",
  6454. "成交",
  6455. "废标",
  6456. "流标",
  6457. "合同",
  6458. "验收",
  6459. "违规"
  6460. ]);
  6461. __publicField(this, "otherKeyList", [
  6462. "项目",
  6463. "公告",
  6464. "公示",
  6465. "采购",
  6466. "更正",
  6467. "变更"
  6468. ]);
  6469. __publicField(this, "importantTags", [
  6470. "h1",
  6471. "h2",
  6472. "h3",
  6473. "h4",
  6474. "h5",
  6475. "a"
  6476. ]);
  6477. }
  6478. run() {
  6479. }
  6480. check() {
  6481. }
  6482. get todayPatterns() {
  6483. const now = /* @__PURE__ */ new Date();
  6484. const year = now.getFullYear();
  6485. const month = now.getMonth() + 1;
  6486. const day = now.getDate();
  6487. const monthStr = `${month}`.padStart(2, "0");
  6488. const dayStr = `${day}`.padStart(2, "0");
  6489. const arr = [];
  6490. const todayDatePatternList = this.todayDatePatternString;
  6491. if (Array.isArray(todayDatePatternList)) {
  6492. todayDatePatternList.forEach((p) => {
  6493. let np = p.replace("%s年", `${year}`);
  6494. arr.push(np.replace("%s月", `${month}`).replace("%s日", `${day}`));
  6495. arr.push(np.replace("%s月", `${month}`).replace("%s日", `${dayStr}`));
  6496. arr.push(np.replace("%s月", `${monthStr}`).replace("%s日", `${day}`));
  6497. arr.push(np.replace("%s月", `${monthStr}`).replace("%s日", `${dayStr}`));
  6498. });
  6499. return arr.map((r) => new RegExp(r));
  6500. } else {
  6501. return [];
  6502. }
  6503. }
  6504. get importantKeyList() {
  6505. let list = [];
  6506. return list.concat(this.infoTypeList).concat(this.otherKeyList);
  6507. }
  6508. get importantTagList() {
  6509. const tagList = this.importantTags;
  6510. if (Array.isArray(tagList)) {
  6511. return tagList.map((i) => i.toUpperCase());
  6512. } else {
  6513. return [];
  6514. }
  6515. }
  6516. // 辅助函数:遍历DOM节点,查找符合条件的末级节点
  6517. findEligibleLeafNodes(node, condition) {
  6518. const result = [];
  6519. const includeTags = this.includeTags;
  6520. const excludeTags = this.excludeTags;
  6521. function pushResult(n) {
  6522. var _a;
  6523. result.push({ node: n, text: (_a = n.textContent) == null ? void 0 : _a.trim(), selector: null });
  6524. }
  6525. function traverse(node2) {
  6526. if (!node2)
  6527. return;
  6528. if (excludeTags.includes(node2.nodeName))
  6529. return;
  6530. if (node2.nodeType === Node.ELEMENT_NODE) {
  6531. if (includeTags.includes(node2.nodeName) && !node2.children.length && node2.textContent) {
  6532. if (typeof condition === "function") {
  6533. if (condition(node2)) {
  6534. pushResult(node2);
  6535. }
  6536. } else {
  6537. pushResult(node2);
  6538. }
  6539. } else {
  6540. node2.childNodes.forEach((item) => {
  6541. traverse(item);
  6542. });
  6543. }
  6544. } else if (node2.nodeType === Node.TEXT_NODE) {
  6545. if (node2.textContent) {
  6546. if (typeof condition === "function") {
  6547. if (condition(node2)) {
  6548. pushResult(node2);
  6549. }
  6550. } else {
  6551. pushResult(node2);
  6552. }
  6553. }
  6554. }
  6555. }
  6556. traverse(node);
  6557. return result;
  6558. }
  6559. // 辅助函数:从文本中提取日期
  6560. extractDates(text) {
  6561. text = text || "";
  6562. var dates = [];
  6563. this.datePatterns.forEach((pattern) => {
  6564. var match = text.match(pattern);
  6565. if (match && match.length > 0) {
  6566. dates.push(match[0]);
  6567. }
  6568. });
  6569. return dates;
  6570. }
  6571. // 判断是否是元素节点
  6572. isElementNode(node) {
  6573. return node && node.nodeType === Node.ELEMENT_NODE;
  6574. }
  6575. // 元素是否隐藏(文本节点无法计算显示隐藏,则默认非隐藏)
  6576. checkNodeHidden(node) {
  6577. let isHidden = false;
  6578. if (this.isElementNode(node)) {
  6579. isHidden = this.$(node).is(":hidden");
  6580. }
  6581. return isHidden;
  6582. }
  6583. isCompanyName(text) {
  6584. return this.companyNameReg.test(text);
  6585. }
  6586. getTagName(node) {
  6587. if (this.isElementNode(node)) {
  6588. return node.tagName;
  6589. } else {
  6590. return "";
  6591. }
  6592. }
  6593. // 统计中文字符个数
  6594. countChineseCharacters(str) {
  6595. str = str || "";
  6596. var matches = str.match(this.chineseCharReg);
  6597. return matches ? matches.length : 0;
  6598. }
  6599. // 上报:lua脚本中会取window.result变量中的内容
  6600. report(result) {
  6601. window.result = result;
  6602. }
  6603. }
  6604. function getSiblings(elem) {
  6605. var _a;
  6606. var r = [];
  6607. var n = (_a = elem.parentNode) == null ? void 0 : _a.firstChild;
  6608. for (; n; n = n.nextSibling) {
  6609. if (n.nodeType === 1 && n !== elem) {
  6610. r.push(n);
  6611. }
  6612. }
  6613. return r;
  6614. }
  6615. function getMaxCount(arr) {
  6616. return Math.max.apply(null, arr);
  6617. }
  6618. var lodash = { exports: {} };
  6619. /**
  6620. * @license
  6621. * Lodash <https://lodash.com/>
  6622. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  6623. * Released under MIT license <https://lodash.com/license>
  6624. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  6625. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  6626. */
  6627. lodash.exports;
  6628. (function(module, exports) {
  6629. (function() {
  6630. var undefined$1;
  6631. var VERSION = "4.17.21";
  6632. var LARGE_ARRAY_SIZE = 200;
  6633. var CORE_ERROR_TEXT = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", FUNC_ERROR_TEXT = "Expected a function", INVALID_TEMPL_VAR_ERROR_TEXT = "Invalid `variable` option passed into `_.template`";
  6634. var HASH_UNDEFINED = "__lodash_hash_undefined__";
  6635. var MAX_MEMOIZE_SIZE = 500;
  6636. var PLACEHOLDER = "__lodash_placeholder__";
  6637. var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4;
  6638. var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
  6639. 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;
  6640. var DEFAULT_TRUNC_LENGTH = 30, DEFAULT_TRUNC_OMISSION = "...";
  6641. var HOT_COUNT = 800, HOT_SPAN = 16;
  6642. var LAZY_FILTER_FLAG = 1, LAZY_MAP_FLAG = 2, LAZY_WHILE_FLAG = 3;
  6643. var INFINITY = 1 / 0, MAX_SAFE_INTEGER = 9007199254740991, MAX_INTEGER = 17976931348623157e292, NAN = 0 / 0;
  6644. var MAX_ARRAY_LENGTH = 4294967295, MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  6645. var wrapFlags = [
  6646. ["ary", WRAP_ARY_FLAG],
  6647. ["bind", WRAP_BIND_FLAG],
  6648. ["bindKey", WRAP_BIND_KEY_FLAG],
  6649. ["curry", WRAP_CURRY_FLAG],
  6650. ["curryRight", WRAP_CURRY_RIGHT_FLAG],
  6651. ["flip", WRAP_FLIP_FLAG],
  6652. ["partial", WRAP_PARTIAL_FLAG],
  6653. ["partialRight", WRAP_PARTIAL_RIGHT_FLAG],
  6654. ["rearg", WRAP_REARG_FLAG]
  6655. ];
  6656. 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]";
  6657. 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]";
  6658. var reEmptyStringLeading = /\b__p \+= '';/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/g, reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  6659. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, reUnescapedHtml = /[&<>"']/g, reHasEscapedHtml = RegExp(reEscapedHtml.source), reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  6660. var reEscape = /<%-([\s\S]+?)%>/g, reEvaluate = /<%([\s\S]+?)%>/g, reInterpolate = /<%=([\s\S]+?)%>/g;
  6661. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  6662. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar.source);
  6663. var reTrimStart = /^\s+/;
  6664. var reWhitespace = /\s/;
  6665. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, reSplitDetails = /,? & /;
  6666. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  6667. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  6668. var reEscapeChar = /\\(\\)?/g;
  6669. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  6670. var reFlags = /\w*$/;
  6671. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  6672. var reIsBinary = /^0b[01]+$/i;
  6673. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  6674. var reIsOctal = /^0o[0-7]+$/i;
  6675. var reIsUint = /^(?:0|[1-9]\d*)$/;
  6676. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  6677. var reNoMatch = /($^)/;
  6678. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  6679. 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;
  6680. var rsApos = "['’]", 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";
  6681. 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("|") + ")";
  6682. var reApos = RegExp(rsApos, "g");
  6683. var reComboMark = RegExp(rsCombo, "g");
  6684. var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g");
  6685. var reUnicodeWord = RegExp([
  6686. rsUpper + "?" + rsLower + "+" + rsOptContrLower + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")",
  6687. rsMiscUpper + "+" + rsOptContrUpper + "(?=" + [rsBreak, rsUpper + rsMiscLower, "$"].join("|") + ")",
  6688. rsUpper + "?" + rsMiscLower + "+" + rsOptContrLower,
  6689. rsUpper + "+" + rsOptContrUpper,
  6690. rsOrdUpper,
  6691. rsOrdLower,
  6692. rsDigits,
  6693. rsEmoji
  6694. ].join("|"), "g");
  6695. var reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + "]");
  6696. 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 ]/;
  6697. var contextProps = [
  6698. "Array",
  6699. "Buffer",
  6700. "DataView",
  6701. "Date",
  6702. "Error",
  6703. "Float32Array",
  6704. "Float64Array",
  6705. "Function",
  6706. "Int8Array",
  6707. "Int16Array",
  6708. "Int32Array",
  6709. "Map",
  6710. "Math",
  6711. "Object",
  6712. "Promise",
  6713. "RegExp",
  6714. "Set",
  6715. "String",
  6716. "Symbol",
  6717. "TypeError",
  6718. "Uint8Array",
  6719. "Uint8ClampedArray",
  6720. "Uint16Array",
  6721. "Uint32Array",
  6722. "WeakMap",
  6723. "_",
  6724. "clearTimeout",
  6725. "isFinite",
  6726. "parseInt",
  6727. "setTimeout"
  6728. ];
  6729. var templateCounter = -1;
  6730. var typedArrayTags = {};
  6731. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
  6732. 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;
  6733. var cloneableTags = {};
  6734. 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;
  6735. cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
  6736. var deburredLetters = {
  6737. // Latin-1 Supplement block.
  6738. "À": "A",
  6739. "Á": "A",
  6740. "Â": "A",
  6741. "Ã": "A",
  6742. "Ä": "A",
  6743. "Å": "A",
  6744. "à": "a",
  6745. "á": "a",
  6746. "â": "a",
  6747. "ã": "a",
  6748. "ä": "a",
  6749. "å": "a",
  6750. "Ç": "C",
  6751. "ç": "c",
  6752. "Ð": "D",
  6753. "ð": "d",
  6754. "È": "E",
  6755. "É": "E",
  6756. "Ê": "E",
  6757. "Ë": "E",
  6758. "è": "e",
  6759. "é": "e",
  6760. "ê": "e",
  6761. "ë": "e",
  6762. "Ì": "I",
  6763. "Í": "I",
  6764. "Î": "I",
  6765. "Ï": "I",
  6766. "ì": "i",
  6767. "í": "i",
  6768. "î": "i",
  6769. "ï": "i",
  6770. "Ñ": "N",
  6771. "ñ": "n",
  6772. "Ò": "O",
  6773. "Ó": "O",
  6774. "Ô": "O",
  6775. "Õ": "O",
  6776. "Ö": "O",
  6777. "Ø": "O",
  6778. "ò": "o",
  6779. "ó": "o",
  6780. "ô": "o",
  6781. "õ": "o",
  6782. "ö": "o",
  6783. "ø": "o",
  6784. "Ù": "U",
  6785. "Ú": "U",
  6786. "Û": "U",
  6787. "Ü": "U",
  6788. "ù": "u",
  6789. "ú": "u",
  6790. "û": "u",
  6791. "ü": "u",
  6792. "Ý": "Y",
  6793. "ý": "y",
  6794. "ÿ": "y",
  6795. "Æ": "Ae",
  6796. "æ": "ae",
  6797. "Þ": "Th",
  6798. "þ": "th",
  6799. "ß": "ss",
  6800. // Latin Extended-A block.
  6801. "Ā": "A",
  6802. "Ă": "A",
  6803. "Ą": "A",
  6804. "ā": "a",
  6805. "ă": "a",
  6806. "ą": "a",
  6807. "Ć": "C",
  6808. "Ĉ": "C",
  6809. "Ċ": "C",
  6810. "Č": "C",
  6811. "ć": "c",
  6812. "ĉ": "c",
  6813. "ċ": "c",
  6814. "č": "c",
  6815. "Ď": "D",
  6816. "Đ": "D",
  6817. "ď": "d",
  6818. "đ": "d",
  6819. "Ē": "E",
  6820. "Ĕ": "E",
  6821. "Ė": "E",
  6822. "Ę": "E",
  6823. "Ě": "E",
  6824. "ē": "e",
  6825. "ĕ": "e",
  6826. "ė": "e",
  6827. "ę": "e",
  6828. "ě": "e",
  6829. "Ĝ": "G",
  6830. "Ğ": "G",
  6831. "Ġ": "G",
  6832. "Ģ": "G",
  6833. "ĝ": "g",
  6834. "ğ": "g",
  6835. "ġ": "g",
  6836. "ģ": "g",
  6837. "Ĥ": "H",
  6838. "Ħ": "H",
  6839. "ĥ": "h",
  6840. "ħ": "h",
  6841. "Ĩ": "I",
  6842. "Ī": "I",
  6843. "Ĭ": "I",
  6844. "Į": "I",
  6845. "İ": "I",
  6846. "ĩ": "i",
  6847. "ī": "i",
  6848. "ĭ": "i",
  6849. "į": "i",
  6850. "ı": "i",
  6851. "Ĵ": "J",
  6852. "ĵ": "j",
  6853. "Ķ": "K",
  6854. "ķ": "k",
  6855. "ĸ": "k",
  6856. "Ĺ": "L",
  6857. "Ļ": "L",
  6858. "Ľ": "L",
  6859. "Ŀ": "L",
  6860. "Ł": "L",
  6861. "ĺ": "l",
  6862. "ļ": "l",
  6863. "ľ": "l",
  6864. "ŀ": "l",
  6865. "ł": "l",
  6866. "Ń": "N",
  6867. "Ņ": "N",
  6868. "Ň": "N",
  6869. "Ŋ": "N",
  6870. "ń": "n",
  6871. "ņ": "n",
  6872. "ň": "n",
  6873. "ŋ": "n",
  6874. "Ō": "O",
  6875. "Ŏ": "O",
  6876. "Ő": "O",
  6877. "ō": "o",
  6878. "ŏ": "o",
  6879. "ő": "o",
  6880. "Ŕ": "R",
  6881. "Ŗ": "R",
  6882. "Ř": "R",
  6883. "ŕ": "r",
  6884. "ŗ": "r",
  6885. "ř": "r",
  6886. "Ś": "S",
  6887. "Ŝ": "S",
  6888. "Ş": "S",
  6889. "Š": "S",
  6890. "ś": "s",
  6891. "ŝ": "s",
  6892. "ş": "s",
  6893. "š": "s",
  6894. "Ţ": "T",
  6895. "Ť": "T",
  6896. "Ŧ": "T",
  6897. "ţ": "t",
  6898. "ť": "t",
  6899. "ŧ": "t",
  6900. "Ũ": "U",
  6901. "Ū": "U",
  6902. "Ŭ": "U",
  6903. "Ů": "U",
  6904. "Ű": "U",
  6905. "Ų": "U",
  6906. "ũ": "u",
  6907. "ū": "u",
  6908. "ŭ": "u",
  6909. "ů": "u",
  6910. "ű": "u",
  6911. "ų": "u",
  6912. "Ŵ": "W",
  6913. "ŵ": "w",
  6914. "Ŷ": "Y",
  6915. "ŷ": "y",
  6916. "Ÿ": "Y",
  6917. "Ź": "Z",
  6918. "Ż": "Z",
  6919. "Ž": "Z",
  6920. "ź": "z",
  6921. "ż": "z",
  6922. "ž": "z",
  6923. "IJ": "IJ",
  6924. "ij": "ij",
  6925. "Œ": "Oe",
  6926. "œ": "oe",
  6927. "ʼn": "'n",
  6928. "ſ": "s"
  6929. };
  6930. var htmlEscapes = {
  6931. "&": "&amp;",
  6932. "<": "&lt;",
  6933. ">": "&gt;",
  6934. '"': "&quot;",
  6935. "'": "&#39;"
  6936. };
  6937. var htmlUnescapes = {
  6938. "&amp;": "&",
  6939. "&lt;": "<",
  6940. "&gt;": ">",
  6941. "&quot;": '"',
  6942. "&#39;": "'"
  6943. };
  6944. var stringEscapes = {
  6945. "\\": "\\",
  6946. "'": "'",
  6947. "\n": "n",
  6948. "\r": "r",
  6949. "\u2028": "u2028",
  6950. "\u2029": "u2029"
  6951. };
  6952. var freeParseFloat = parseFloat, freeParseInt = parseInt;
  6953. var freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
  6954. var freeSelf = typeof self == "object" && self && self.Object === Object && self;
  6955. var root = freeGlobal || freeSelf || Function("return this")();
  6956. var freeExports = exports && !exports.nodeType && exports;
  6957. var freeModule = freeExports && true && module && !module.nodeType && module;
  6958. var moduleExports = freeModule && freeModule.exports === freeExports;
  6959. var freeProcess = moduleExports && freeGlobal.process;
  6960. var nodeUtil = function() {
  6961. try {
  6962. var types = freeModule && freeModule.require && freeModule.require("util").types;
  6963. if (types) {
  6964. return types;
  6965. }
  6966. return freeProcess && freeProcess.binding && freeProcess.binding("util");
  6967. } catch (e) {
  6968. }
  6969. }();
  6970. 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;
  6971. function apply(func, thisArg, args) {
  6972. switch (args.length) {
  6973. case 0:
  6974. return func.call(thisArg);
  6975. case 1:
  6976. return func.call(thisArg, args[0]);
  6977. case 2:
  6978. return func.call(thisArg, args[0], args[1]);
  6979. case 3:
  6980. return func.call(thisArg, args[0], args[1], args[2]);
  6981. }
  6982. return func.apply(thisArg, args);
  6983. }
  6984. function arrayAggregator(array, setter, iteratee, accumulator) {
  6985. var index = -1, length = array == null ? 0 : array.length;
  6986. while (++index < length) {
  6987. var value = array[index];
  6988. setter(accumulator, value, iteratee(value), array);
  6989. }
  6990. return accumulator;
  6991. }
  6992. function arrayEach(array, iteratee) {
  6993. var index = -1, length = array == null ? 0 : array.length;
  6994. while (++index < length) {
  6995. if (iteratee(array[index], index, array) === false) {
  6996. break;
  6997. }
  6998. }
  6999. return array;
  7000. }
  7001. function arrayEachRight(array, iteratee) {
  7002. var length = array == null ? 0 : array.length;
  7003. while (length--) {
  7004. if (iteratee(array[length], length, array) === false) {
  7005. break;
  7006. }
  7007. }
  7008. return array;
  7009. }
  7010. function arrayEvery(array, predicate) {
  7011. var index = -1, length = array == null ? 0 : array.length;
  7012. while (++index < length) {
  7013. if (!predicate(array[index], index, array)) {
  7014. return false;
  7015. }
  7016. }
  7017. return true;
  7018. }
  7019. function arrayFilter(array, predicate) {
  7020. var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
  7021. while (++index < length) {
  7022. var value = array[index];
  7023. if (predicate(value, index, array)) {
  7024. result[resIndex++] = value;
  7025. }
  7026. }
  7027. return result;
  7028. }
  7029. function arrayIncludes(array, value) {
  7030. var length = array == null ? 0 : array.length;
  7031. return !!length && baseIndexOf(array, value, 0) > -1;
  7032. }
  7033. function arrayIncludesWith(array, value, comparator) {
  7034. var index = -1, length = array == null ? 0 : array.length;
  7035. while (++index < length) {
  7036. if (comparator(value, array[index])) {
  7037. return true;
  7038. }
  7039. }
  7040. return false;
  7041. }
  7042. function arrayMap(array, iteratee) {
  7043. var index = -1, length = array == null ? 0 : array.length, result = Array(length);
  7044. while (++index < length) {
  7045. result[index] = iteratee(array[index], index, array);
  7046. }
  7047. return result;
  7048. }
  7049. function arrayPush(array, values) {
  7050. var index = -1, length = values.length, offset = array.length;
  7051. while (++index < length) {
  7052. array[offset + index] = values[index];
  7053. }
  7054. return array;
  7055. }
  7056. function arrayReduce(array, iteratee, accumulator, initAccum) {
  7057. var index = -1, length = array == null ? 0 : array.length;
  7058. if (initAccum && length) {
  7059. accumulator = array[++index];
  7060. }
  7061. while (++index < length) {
  7062. accumulator = iteratee(accumulator, array[index], index, array);
  7063. }
  7064. return accumulator;
  7065. }
  7066. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  7067. var length = array == null ? 0 : array.length;
  7068. if (initAccum && length) {
  7069. accumulator = array[--length];
  7070. }
  7071. while (length--) {
  7072. accumulator = iteratee(accumulator, array[length], length, array);
  7073. }
  7074. return accumulator;
  7075. }
  7076. function arraySome(array, predicate) {
  7077. var index = -1, length = array == null ? 0 : array.length;
  7078. while (++index < length) {
  7079. if (predicate(array[index], index, array)) {
  7080. return true;
  7081. }
  7082. }
  7083. return false;
  7084. }
  7085. var asciiSize = baseProperty("length");
  7086. function asciiToArray(string) {
  7087. return string.split("");
  7088. }
  7089. function asciiWords(string) {
  7090. return string.match(reAsciiWord) || [];
  7091. }
  7092. function baseFindKey(collection, predicate, eachFunc) {
  7093. var result;
  7094. eachFunc(collection, function(value, key, collection2) {
  7095. if (predicate(value, key, collection2)) {
  7096. result = key;
  7097. return false;
  7098. }
  7099. });
  7100. return result;
  7101. }
  7102. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  7103. var length = array.length, index = fromIndex + (fromRight ? 1 : -1);
  7104. while (fromRight ? index-- : ++index < length) {
  7105. if (predicate(array[index], index, array)) {
  7106. return index;
  7107. }
  7108. }
  7109. return -1;
  7110. }
  7111. function baseIndexOf(array, value, fromIndex) {
  7112. return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex);
  7113. }
  7114. function baseIndexOfWith(array, value, fromIndex, comparator) {
  7115. var index = fromIndex - 1, length = array.length;
  7116. while (++index < length) {
  7117. if (comparator(array[index], value)) {
  7118. return index;
  7119. }
  7120. }
  7121. return -1;
  7122. }
  7123. function baseIsNaN(value) {
  7124. return value !== value;
  7125. }
  7126. function baseMean(array, iteratee) {
  7127. var length = array == null ? 0 : array.length;
  7128. return length ? baseSum(array, iteratee) / length : NAN;
  7129. }
  7130. function baseProperty(key) {
  7131. return function(object) {
  7132. return object == null ? undefined$1 : object[key];
  7133. };
  7134. }
  7135. function basePropertyOf(object) {
  7136. return function(key) {
  7137. return object == null ? undefined$1 : object[key];
  7138. };
  7139. }
  7140. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  7141. eachFunc(collection, function(value, index, collection2) {
  7142. accumulator = initAccum ? (initAccum = false, value) : iteratee(accumulator, value, index, collection2);
  7143. });
  7144. return accumulator;
  7145. }
  7146. function baseSortBy(array, comparer) {
  7147. var length = array.length;
  7148. array.sort(comparer);
  7149. while (length--) {
  7150. array[length] = array[length].value;
  7151. }
  7152. return array;
  7153. }
  7154. function baseSum(array, iteratee) {
  7155. var result, index = -1, length = array.length;
  7156. while (++index < length) {
  7157. var current = iteratee(array[index]);
  7158. if (current !== undefined$1) {
  7159. result = result === undefined$1 ? current : result + current;
  7160. }
  7161. }
  7162. return result;
  7163. }
  7164. function baseTimes(n, iteratee) {
  7165. var index = -1, result = Array(n);
  7166. while (++index < n) {
  7167. result[index] = iteratee(index);
  7168. }
  7169. return result;
  7170. }
  7171. function baseToPairs(object, props) {
  7172. return arrayMap(props, function(key) {
  7173. return [key, object[key]];
  7174. });
  7175. }
  7176. function baseTrim(string) {
  7177. return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
  7178. }
  7179. function baseUnary(func) {
  7180. return function(value) {
  7181. return func(value);
  7182. };
  7183. }
  7184. function baseValues(object, props) {
  7185. return arrayMap(props, function(key) {
  7186. return object[key];
  7187. });
  7188. }
  7189. function cacheHas(cache, key) {
  7190. return cache.has(key);
  7191. }
  7192. function charsStartIndex(strSymbols, chrSymbols) {
  7193. var index = -1, length = strSymbols.length;
  7194. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {
  7195. }
  7196. return index;
  7197. }
  7198. function charsEndIndex(strSymbols, chrSymbols) {
  7199. var index = strSymbols.length;
  7200. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {
  7201. }
  7202. return index;
  7203. }
  7204. function countHolders(array, placeholder) {
  7205. var length = array.length, result = 0;
  7206. while (length--) {
  7207. if (array[length] === placeholder) {
  7208. ++result;
  7209. }
  7210. }
  7211. return result;
  7212. }
  7213. var deburrLetter = basePropertyOf(deburredLetters);
  7214. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  7215. function escapeStringChar(chr) {
  7216. return "\\" + stringEscapes[chr];
  7217. }
  7218. function getValue(object, key) {
  7219. return object == null ? undefined$1 : object[key];
  7220. }
  7221. function hasUnicode(string) {
  7222. return reHasUnicode.test(string);
  7223. }
  7224. function hasUnicodeWord(string) {
  7225. return reHasUnicodeWord.test(string);
  7226. }
  7227. function iteratorToArray(iterator) {
  7228. var data, result = [];
  7229. while (!(data = iterator.next()).done) {
  7230. result.push(data.value);
  7231. }
  7232. return result;
  7233. }
  7234. function mapToArray(map) {
  7235. var index = -1, result = Array(map.size);
  7236. map.forEach(function(value, key) {
  7237. result[++index] = [key, value];
  7238. });
  7239. return result;
  7240. }
  7241. function overArg(func, transform) {
  7242. return function(arg) {
  7243. return func(transform(arg));
  7244. };
  7245. }
  7246. function replaceHolders(array, placeholder) {
  7247. var index = -1, length = array.length, resIndex = 0, result = [];
  7248. while (++index < length) {
  7249. var value = array[index];
  7250. if (value === placeholder || value === PLACEHOLDER) {
  7251. array[index] = PLACEHOLDER;
  7252. result[resIndex++] = index;
  7253. }
  7254. }
  7255. return result;
  7256. }
  7257. function setToArray(set) {
  7258. var index = -1, result = Array(set.size);
  7259. set.forEach(function(value) {
  7260. result[++index] = value;
  7261. });
  7262. return result;
  7263. }
  7264. function setToPairs(set) {
  7265. var index = -1, result = Array(set.size);
  7266. set.forEach(function(value) {
  7267. result[++index] = [value, value];
  7268. });
  7269. return result;
  7270. }
  7271. function strictIndexOf(array, value, fromIndex) {
  7272. var index = fromIndex - 1, length = array.length;
  7273. while (++index < length) {
  7274. if (array[index] === value) {
  7275. return index;
  7276. }
  7277. }
  7278. return -1;
  7279. }
  7280. function strictLastIndexOf(array, value, fromIndex) {
  7281. var index = fromIndex + 1;
  7282. while (index--) {
  7283. if (array[index] === value) {
  7284. return index;
  7285. }
  7286. }
  7287. return index;
  7288. }
  7289. function stringSize(string) {
  7290. return hasUnicode(string) ? unicodeSize(string) : asciiSize(string);
  7291. }
  7292. function stringToArray(string) {
  7293. return hasUnicode(string) ? unicodeToArray(string) : asciiToArray(string);
  7294. }
  7295. function trimmedEndIndex(string) {
  7296. var index = string.length;
  7297. while (index-- && reWhitespace.test(string.charAt(index))) {
  7298. }
  7299. return index;
  7300. }
  7301. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  7302. function unicodeSize(string) {
  7303. var result = reUnicode.lastIndex = 0;
  7304. while (reUnicode.test(string)) {
  7305. ++result;
  7306. }
  7307. return result;
  7308. }
  7309. function unicodeToArray(string) {
  7310. return string.match(reUnicode) || [];
  7311. }
  7312. function unicodeWords(string) {
  7313. return string.match(reUnicodeWord) || [];
  7314. }
  7315. var runInContext = function runInContext2(context) {
  7316. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  7317. var Array2 = context.Array, Date2 = context.Date, Error2 = context.Error, Function2 = context.Function, Math2 = context.Math, Object2 = context.Object, RegExp2 = context.RegExp, String2 = context.String, TypeError2 = context.TypeError;
  7318. var arrayProto = Array2.prototype, funcProto = Function2.prototype, objectProto = Object2.prototype;
  7319. var coreJsData = context["__core-js_shared__"];
  7320. var funcToString = funcProto.toString;
  7321. var hasOwnProperty = objectProto.hasOwnProperty;
  7322. var idCounter = 0;
  7323. var maskSrcKey = function() {
  7324. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
  7325. return uid ? "Symbol(src)_1." + uid : "";
  7326. }();
  7327. var nativeObjectToString = objectProto.toString;
  7328. var objectCtorString = funcToString.call(Object2);
  7329. var oldDash = root._;
  7330. var reIsNative = RegExp2(
  7331. "^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
  7332. );
  7333. var Buffer2 = moduleExports ? context.Buffer : undefined$1, Symbol2 = context.Symbol, Uint8Array2 = context.Uint8Array, allocUnsafe = Buffer2 ? Buffer2.allocUnsafe : undefined$1, getPrototype = overArg(Object2.getPrototypeOf, Object2), objectCreate = Object2.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, spreadableSymbol = Symbol2 ? Symbol2.isConcatSpreadable : undefined$1, symIterator = Symbol2 ? Symbol2.iterator : undefined$1, symToStringTag = Symbol2 ? Symbol2.toStringTag : undefined$1;
  7334. var defineProperty = function() {
  7335. try {
  7336. var func = getNative(Object2, "defineProperty");
  7337. func({}, "", {});
  7338. return func;
  7339. } catch (e) {
  7340. }
  7341. }();
  7342. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, ctxNow = Date2 && Date2.now !== root.Date.now && Date2.now, ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  7343. var nativeCeil = Math2.ceil, nativeFloor = Math2.floor, nativeGetSymbols = Object2.getOwnPropertySymbols, nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : undefined$1, nativeIsFinite = context.isFinite, nativeJoin = arrayProto.join, nativeKeys = overArg(Object2.keys, Object2), nativeMax = Math2.max, nativeMin = Math2.min, nativeNow = Date2.now, nativeParseInt = context.parseInt, nativeRandom = Math2.random, nativeReverse = arrayProto.reverse;
  7344. var DataView = getNative(context, "DataView"), Map = getNative(context, "Map"), Promise2 = getNative(context, "Promise"), Set = getNative(context, "Set"), WeakMap = getNative(context, "WeakMap"), nativeCreate = getNative(Object2, "create");
  7345. var metaMap = WeakMap && new WeakMap();
  7346. var realNames = {};
  7347. var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set), weakMapCtorString = toSource(WeakMap);
  7348. var symbolProto = Symbol2 ? Symbol2.prototype : undefined$1, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined$1, symbolToString = symbolProto ? symbolProto.toString : undefined$1;
  7349. function lodash2(value) {
  7350. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  7351. if (value instanceof LodashWrapper) {
  7352. return value;
  7353. }
  7354. if (hasOwnProperty.call(value, "__wrapped__")) {
  7355. return wrapperClone(value);
  7356. }
  7357. }
  7358. return new LodashWrapper(value);
  7359. }
  7360. var baseCreate = function() {
  7361. function object() {
  7362. }
  7363. return function(proto) {
  7364. if (!isObject(proto)) {
  7365. return {};
  7366. }
  7367. if (objectCreate) {
  7368. return objectCreate(proto);
  7369. }
  7370. object.prototype = proto;
  7371. var result2 = new object();
  7372. object.prototype = undefined$1;
  7373. return result2;
  7374. };
  7375. }();
  7376. function baseLodash() {
  7377. }
  7378. function LodashWrapper(value, chainAll) {
  7379. this.__wrapped__ = value;
  7380. this.__actions__ = [];
  7381. this.__chain__ = !!chainAll;
  7382. this.__index__ = 0;
  7383. this.__values__ = undefined$1;
  7384. }
  7385. lodash2.templateSettings = {
  7386. /**
  7387. * Used to detect `data` property values to be HTML-escaped.
  7388. *
  7389. * @memberOf _.templateSettings
  7390. * @type {RegExp}
  7391. */
  7392. "escape": reEscape,
  7393. /**
  7394. * Used to detect code to be evaluated.
  7395. *
  7396. * @memberOf _.templateSettings
  7397. * @type {RegExp}
  7398. */
  7399. "evaluate": reEvaluate,
  7400. /**
  7401. * Used to detect `data` property values to inject.
  7402. *
  7403. * @memberOf _.templateSettings
  7404. * @type {RegExp}
  7405. */
  7406. "interpolate": reInterpolate,
  7407. /**
  7408. * Used to reference the data object in the template text.
  7409. *
  7410. * @memberOf _.templateSettings
  7411. * @type {string}
  7412. */
  7413. "variable": "",
  7414. /**
  7415. * Used to import variables into the compiled template.
  7416. *
  7417. * @memberOf _.templateSettings
  7418. * @type {Object}
  7419. */
  7420. "imports": {
  7421. /**
  7422. * A reference to the `lodash` function.
  7423. *
  7424. * @memberOf _.templateSettings.imports
  7425. * @type {Function}
  7426. */
  7427. "_": lodash2
  7428. }
  7429. };
  7430. lodash2.prototype = baseLodash.prototype;
  7431. lodash2.prototype.constructor = lodash2;
  7432. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  7433. LodashWrapper.prototype.constructor = LodashWrapper;
  7434. function LazyWrapper(value) {
  7435. this.__wrapped__ = value;
  7436. this.__actions__ = [];
  7437. this.__dir__ = 1;
  7438. this.__filtered__ = false;
  7439. this.__iteratees__ = [];
  7440. this.__takeCount__ = MAX_ARRAY_LENGTH;
  7441. this.__views__ = [];
  7442. }
  7443. function lazyClone() {
  7444. var result2 = new LazyWrapper(this.__wrapped__);
  7445. result2.__actions__ = copyArray(this.__actions__);
  7446. result2.__dir__ = this.__dir__;
  7447. result2.__filtered__ = this.__filtered__;
  7448. result2.__iteratees__ = copyArray(this.__iteratees__);
  7449. result2.__takeCount__ = this.__takeCount__;
  7450. result2.__views__ = copyArray(this.__views__);
  7451. return result2;
  7452. }
  7453. function lazyReverse() {
  7454. if (this.__filtered__) {
  7455. var result2 = new LazyWrapper(this);
  7456. result2.__dir__ = -1;
  7457. result2.__filtered__ = true;
  7458. } else {
  7459. result2 = this.clone();
  7460. result2.__dir__ *= -1;
  7461. }
  7462. return result2;
  7463. }
  7464. function lazyValue() {
  7465. 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__);
  7466. if (!isArr || !isRight && arrLength == length && takeCount == length) {
  7467. return baseWrapperValue(array, this.__actions__);
  7468. }
  7469. var result2 = [];
  7470. outer:
  7471. while (length-- && resIndex < takeCount) {
  7472. index += dir;
  7473. var iterIndex = -1, value = array[index];
  7474. while (++iterIndex < iterLength) {
  7475. var data = iteratees[iterIndex], iteratee2 = data.iteratee, type = data.type, computed = iteratee2(value);
  7476. if (type == LAZY_MAP_FLAG) {
  7477. value = computed;
  7478. } else if (!computed) {
  7479. if (type == LAZY_FILTER_FLAG) {
  7480. continue outer;
  7481. } else {
  7482. break outer;
  7483. }
  7484. }
  7485. }
  7486. result2[resIndex++] = value;
  7487. }
  7488. return result2;
  7489. }
  7490. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  7491. LazyWrapper.prototype.constructor = LazyWrapper;
  7492. function Hash(entries) {
  7493. var index = -1, length = entries == null ? 0 : entries.length;
  7494. this.clear();
  7495. while (++index < length) {
  7496. var entry = entries[index];
  7497. this.set(entry[0], entry[1]);
  7498. }
  7499. }
  7500. function hashClear() {
  7501. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  7502. this.size = 0;
  7503. }
  7504. function hashDelete(key) {
  7505. var result2 = this.has(key) && delete this.__data__[key];
  7506. this.size -= result2 ? 1 : 0;
  7507. return result2;
  7508. }
  7509. function hashGet(key) {
  7510. var data = this.__data__;
  7511. if (nativeCreate) {
  7512. var result2 = data[key];
  7513. return result2 === HASH_UNDEFINED ? undefined$1 : result2;
  7514. }
  7515. return hasOwnProperty.call(data, key) ? data[key] : undefined$1;
  7516. }
  7517. function hashHas(key) {
  7518. var data = this.__data__;
  7519. return nativeCreate ? data[key] !== undefined$1 : hasOwnProperty.call(data, key);
  7520. }
  7521. function hashSet(key, value) {
  7522. var data = this.__data__;
  7523. this.size += this.has(key) ? 0 : 1;
  7524. data[key] = nativeCreate && value === undefined$1 ? HASH_UNDEFINED : value;
  7525. return this;
  7526. }
  7527. Hash.prototype.clear = hashClear;
  7528. Hash.prototype["delete"] = hashDelete;
  7529. Hash.prototype.get = hashGet;
  7530. Hash.prototype.has = hashHas;
  7531. Hash.prototype.set = hashSet;
  7532. function ListCache(entries) {
  7533. var index = -1, length = entries == null ? 0 : entries.length;
  7534. this.clear();
  7535. while (++index < length) {
  7536. var entry = entries[index];
  7537. this.set(entry[0], entry[1]);
  7538. }
  7539. }
  7540. function listCacheClear() {
  7541. this.__data__ = [];
  7542. this.size = 0;
  7543. }
  7544. function listCacheDelete(key) {
  7545. var data = this.__data__, index = assocIndexOf(data, key);
  7546. if (index < 0) {
  7547. return false;
  7548. }
  7549. var lastIndex = data.length - 1;
  7550. if (index == lastIndex) {
  7551. data.pop();
  7552. } else {
  7553. splice.call(data, index, 1);
  7554. }
  7555. --this.size;
  7556. return true;
  7557. }
  7558. function listCacheGet(key) {
  7559. var data = this.__data__, index = assocIndexOf(data, key);
  7560. return index < 0 ? undefined$1 : data[index][1];
  7561. }
  7562. function listCacheHas(key) {
  7563. return assocIndexOf(this.__data__, key) > -1;
  7564. }
  7565. function listCacheSet(key, value) {
  7566. var data = this.__data__, index = assocIndexOf(data, key);
  7567. if (index < 0) {
  7568. ++this.size;
  7569. data.push([key, value]);
  7570. } else {
  7571. data[index][1] = value;
  7572. }
  7573. return this;
  7574. }
  7575. ListCache.prototype.clear = listCacheClear;
  7576. ListCache.prototype["delete"] = listCacheDelete;
  7577. ListCache.prototype.get = listCacheGet;
  7578. ListCache.prototype.has = listCacheHas;
  7579. ListCache.prototype.set = listCacheSet;
  7580. function MapCache(entries) {
  7581. var index = -1, length = entries == null ? 0 : entries.length;
  7582. this.clear();
  7583. while (++index < length) {
  7584. var entry = entries[index];
  7585. this.set(entry[0], entry[1]);
  7586. }
  7587. }
  7588. function mapCacheClear() {
  7589. this.size = 0;
  7590. this.__data__ = {
  7591. "hash": new Hash(),
  7592. "map": new (Map || ListCache)(),
  7593. "string": new Hash()
  7594. };
  7595. }
  7596. function mapCacheDelete(key) {
  7597. var result2 = getMapData(this, key)["delete"](key);
  7598. this.size -= result2 ? 1 : 0;
  7599. return result2;
  7600. }
  7601. function mapCacheGet(key) {
  7602. return getMapData(this, key).get(key);
  7603. }
  7604. function mapCacheHas(key) {
  7605. return getMapData(this, key).has(key);
  7606. }
  7607. function mapCacheSet(key, value) {
  7608. var data = getMapData(this, key), size2 = data.size;
  7609. data.set(key, value);
  7610. this.size += data.size == size2 ? 0 : 1;
  7611. return this;
  7612. }
  7613. MapCache.prototype.clear = mapCacheClear;
  7614. MapCache.prototype["delete"] = mapCacheDelete;
  7615. MapCache.prototype.get = mapCacheGet;
  7616. MapCache.prototype.has = mapCacheHas;
  7617. MapCache.prototype.set = mapCacheSet;
  7618. function SetCache(values2) {
  7619. var index = -1, length = values2 == null ? 0 : values2.length;
  7620. this.__data__ = new MapCache();
  7621. while (++index < length) {
  7622. this.add(values2[index]);
  7623. }
  7624. }
  7625. function setCacheAdd(value) {
  7626. this.__data__.set(value, HASH_UNDEFINED);
  7627. return this;
  7628. }
  7629. function setCacheHas(value) {
  7630. return this.__data__.has(value);
  7631. }
  7632. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  7633. SetCache.prototype.has = setCacheHas;
  7634. function Stack(entries) {
  7635. var data = this.__data__ = new ListCache(entries);
  7636. this.size = data.size;
  7637. }
  7638. function stackClear() {
  7639. this.__data__ = new ListCache();
  7640. this.size = 0;
  7641. }
  7642. function stackDelete(key) {
  7643. var data = this.__data__, result2 = data["delete"](key);
  7644. this.size = data.size;
  7645. return result2;
  7646. }
  7647. function stackGet(key) {
  7648. return this.__data__.get(key);
  7649. }
  7650. function stackHas(key) {
  7651. return this.__data__.has(key);
  7652. }
  7653. function stackSet(key, value) {
  7654. var data = this.__data__;
  7655. if (data instanceof ListCache) {
  7656. var pairs = data.__data__;
  7657. if (!Map || pairs.length < LARGE_ARRAY_SIZE - 1) {
  7658. pairs.push([key, value]);
  7659. this.size = ++data.size;
  7660. return this;
  7661. }
  7662. data = this.__data__ = new MapCache(pairs);
  7663. }
  7664. data.set(key, value);
  7665. this.size = data.size;
  7666. return this;
  7667. }
  7668. Stack.prototype.clear = stackClear;
  7669. Stack.prototype["delete"] = stackDelete;
  7670. Stack.prototype.get = stackGet;
  7671. Stack.prototype.has = stackHas;
  7672. Stack.prototype.set = stackSet;
  7673. function arrayLikeKeys(value, inherited) {
  7674. var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result2 = skipIndexes ? baseTimes(value.length, String2) : [], length = result2.length;
  7675. for (var key in value) {
  7676. if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
  7677. (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
  7678. isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
  7679. isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
  7680. isIndex(key, length)))) {
  7681. result2.push(key);
  7682. }
  7683. }
  7684. return result2;
  7685. }
  7686. function arraySample(array) {
  7687. var length = array.length;
  7688. return length ? array[baseRandom(0, length - 1)] : undefined$1;
  7689. }
  7690. function arraySampleSize(array, n) {
  7691. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  7692. }
  7693. function arrayShuffle(array) {
  7694. return shuffleSelf(copyArray(array));
  7695. }
  7696. function assignMergeValue(object, key, value) {
  7697. if (value !== undefined$1 && !eq(object[key], value) || value === undefined$1 && !(key in object)) {
  7698. baseAssignValue(object, key, value);
  7699. }
  7700. }
  7701. function assignValue(object, key, value) {
  7702. var objValue = object[key];
  7703. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === undefined$1 && !(key in object)) {
  7704. baseAssignValue(object, key, value);
  7705. }
  7706. }
  7707. function assocIndexOf(array, key) {
  7708. var length = array.length;
  7709. while (length--) {
  7710. if (eq(array[length][0], key)) {
  7711. return length;
  7712. }
  7713. }
  7714. return -1;
  7715. }
  7716. function baseAggregator(collection, setter, iteratee2, accumulator) {
  7717. baseEach(collection, function(value, key, collection2) {
  7718. setter(accumulator, value, iteratee2(value), collection2);
  7719. });
  7720. return accumulator;
  7721. }
  7722. function baseAssign(object, source) {
  7723. return object && copyObject(source, keys(source), object);
  7724. }
  7725. function baseAssignIn(object, source) {
  7726. return object && copyObject(source, keysIn(source), object);
  7727. }
  7728. function baseAssignValue(object, key, value) {
  7729. if (key == "__proto__" && defineProperty) {
  7730. defineProperty(object, key, {
  7731. "configurable": true,
  7732. "enumerable": true,
  7733. "value": value,
  7734. "writable": true
  7735. });
  7736. } else {
  7737. object[key] = value;
  7738. }
  7739. }
  7740. function baseAt(object, paths) {
  7741. var index = -1, length = paths.length, result2 = Array2(length), skip = object == null;
  7742. while (++index < length) {
  7743. result2[index] = skip ? undefined$1 : get(object, paths[index]);
  7744. }
  7745. return result2;
  7746. }
  7747. function baseClamp(number, lower, upper) {
  7748. if (number === number) {
  7749. if (upper !== undefined$1) {
  7750. number = number <= upper ? number : upper;
  7751. }
  7752. if (lower !== undefined$1) {
  7753. number = number >= lower ? number : lower;
  7754. }
  7755. }
  7756. return number;
  7757. }
  7758. function baseClone(value, bitmask, customizer, key, object, stack) {
  7759. var result2, isDeep = bitmask & CLONE_DEEP_FLAG, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG;
  7760. if (customizer) {
  7761. result2 = object ? customizer(value, key, object, stack) : customizer(value);
  7762. }
  7763. if (result2 !== undefined$1) {
  7764. return result2;
  7765. }
  7766. if (!isObject(value)) {
  7767. return value;
  7768. }
  7769. var isArr = isArray(value);
  7770. if (isArr) {
  7771. result2 = initCloneArray(value);
  7772. if (!isDeep) {
  7773. return copyArray(value, result2);
  7774. }
  7775. } else {
  7776. var tag = getTag(value), isFunc = tag == funcTag || tag == genTag;
  7777. if (isBuffer(value)) {
  7778. return cloneBuffer(value, isDeep);
  7779. }
  7780. if (tag == objectTag || tag == argsTag || isFunc && !object) {
  7781. result2 = isFlat || isFunc ? {} : initCloneObject(value);
  7782. if (!isDeep) {
  7783. return isFlat ? copySymbolsIn(value, baseAssignIn(result2, value)) : copySymbols(value, baseAssign(result2, value));
  7784. }
  7785. } else {
  7786. if (!cloneableTags[tag]) {
  7787. return object ? value : {};
  7788. }
  7789. result2 = initCloneByTag(value, tag, isDeep);
  7790. }
  7791. }
  7792. stack || (stack = new Stack());
  7793. var stacked = stack.get(value);
  7794. if (stacked) {
  7795. return stacked;
  7796. }
  7797. stack.set(value, result2);
  7798. if (isSet(value)) {
  7799. value.forEach(function(subValue) {
  7800. result2.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  7801. });
  7802. } else if (isMap(value)) {
  7803. value.forEach(function(subValue, key2) {
  7804. result2.set(key2, baseClone(subValue, bitmask, customizer, key2, value, stack));
  7805. });
  7806. }
  7807. var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys;
  7808. var props = isArr ? undefined$1 : keysFunc(value);
  7809. arrayEach(props || value, function(subValue, key2) {
  7810. if (props) {
  7811. key2 = subValue;
  7812. subValue = value[key2];
  7813. }
  7814. assignValue(result2, key2, baseClone(subValue, bitmask, customizer, key2, value, stack));
  7815. });
  7816. return result2;
  7817. }
  7818. function baseConforms(source) {
  7819. var props = keys(source);
  7820. return function(object) {
  7821. return baseConformsTo(object, source, props);
  7822. };
  7823. }
  7824. function baseConformsTo(object, source, props) {
  7825. var length = props.length;
  7826. if (object == null) {
  7827. return !length;
  7828. }
  7829. object = Object2(object);
  7830. while (length--) {
  7831. var key = props[length], predicate = source[key], value = object[key];
  7832. if (value === undefined$1 && !(key in object) || !predicate(value)) {
  7833. return false;
  7834. }
  7835. }
  7836. return true;
  7837. }
  7838. function baseDelay(func, wait, args) {
  7839. if (typeof func != "function") {
  7840. throw new TypeError2(FUNC_ERROR_TEXT);
  7841. }
  7842. return setTimeout(function() {
  7843. func.apply(undefined$1, args);
  7844. }, wait);
  7845. }
  7846. function baseDifference(array, values2, iteratee2, comparator) {
  7847. var index = -1, includes2 = arrayIncludes, isCommon = true, length = array.length, result2 = [], valuesLength = values2.length;
  7848. if (!length) {
  7849. return result2;
  7850. }
  7851. if (iteratee2) {
  7852. values2 = arrayMap(values2, baseUnary(iteratee2));
  7853. }
  7854. if (comparator) {
  7855. includes2 = arrayIncludesWith;
  7856. isCommon = false;
  7857. } else if (values2.length >= LARGE_ARRAY_SIZE) {
  7858. includes2 = cacheHas;
  7859. isCommon = false;
  7860. values2 = new SetCache(values2);
  7861. }
  7862. outer:
  7863. while (++index < length) {
  7864. var value = array[index], computed = iteratee2 == null ? value : iteratee2(value);
  7865. value = comparator || value !== 0 ? value : 0;
  7866. if (isCommon && computed === computed) {
  7867. var valuesIndex = valuesLength;
  7868. while (valuesIndex--) {
  7869. if (values2[valuesIndex] === computed) {
  7870. continue outer;
  7871. }
  7872. }
  7873. result2.push(value);
  7874. } else if (!includes2(values2, computed, comparator)) {
  7875. result2.push(value);
  7876. }
  7877. }
  7878. return result2;
  7879. }
  7880. var baseEach = createBaseEach(baseForOwn);
  7881. var baseEachRight = createBaseEach(baseForOwnRight, true);
  7882. function baseEvery(collection, predicate) {
  7883. var result2 = true;
  7884. baseEach(collection, function(value, index, collection2) {
  7885. result2 = !!predicate(value, index, collection2);
  7886. return result2;
  7887. });
  7888. return result2;
  7889. }
  7890. function baseExtremum(array, iteratee2, comparator) {
  7891. var index = -1, length = array.length;
  7892. while (++index < length) {
  7893. var value = array[index], current = iteratee2(value);
  7894. if (current != null && (computed === undefined$1 ? current === current && !isSymbol(current) : comparator(current, computed))) {
  7895. var computed = current, result2 = value;
  7896. }
  7897. }
  7898. return result2;
  7899. }
  7900. function baseFill(array, value, start, end) {
  7901. var length = array.length;
  7902. start = toInteger(start);
  7903. if (start < 0) {
  7904. start = -start > length ? 0 : length + start;
  7905. }
  7906. end = end === undefined$1 || end > length ? length : toInteger(end);
  7907. if (end < 0) {
  7908. end += length;
  7909. }
  7910. end = start > end ? 0 : toLength(end);
  7911. while (start < end) {
  7912. array[start++] = value;
  7913. }
  7914. return array;
  7915. }
  7916. function baseFilter(collection, predicate) {
  7917. var result2 = [];
  7918. baseEach(collection, function(value, index, collection2) {
  7919. if (predicate(value, index, collection2)) {
  7920. result2.push(value);
  7921. }
  7922. });
  7923. return result2;
  7924. }
  7925. function baseFlatten(array, depth, predicate, isStrict, result2) {
  7926. var index = -1, length = array.length;
  7927. predicate || (predicate = isFlattenable);
  7928. result2 || (result2 = []);
  7929. while (++index < length) {
  7930. var value = array[index];
  7931. if (depth > 0 && predicate(value)) {
  7932. if (depth > 1) {
  7933. baseFlatten(value, depth - 1, predicate, isStrict, result2);
  7934. } else {
  7935. arrayPush(result2, value);
  7936. }
  7937. } else if (!isStrict) {
  7938. result2[result2.length] = value;
  7939. }
  7940. }
  7941. return result2;
  7942. }
  7943. var baseFor = createBaseFor();
  7944. var baseForRight = createBaseFor(true);
  7945. function baseForOwn(object, iteratee2) {
  7946. return object && baseFor(object, iteratee2, keys);
  7947. }
  7948. function baseForOwnRight(object, iteratee2) {
  7949. return object && baseForRight(object, iteratee2, keys);
  7950. }
  7951. function baseFunctions(object, props) {
  7952. return arrayFilter(props, function(key) {
  7953. return isFunction(object[key]);
  7954. });
  7955. }
  7956. function baseGet(object, path) {
  7957. path = castPath(path, object);
  7958. var index = 0, length = path.length;
  7959. while (object != null && index < length) {
  7960. object = object[toKey(path[index++])];
  7961. }
  7962. return index && index == length ? object : undefined$1;
  7963. }
  7964. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  7965. var result2 = keysFunc(object);
  7966. return isArray(object) ? result2 : arrayPush(result2, symbolsFunc(object));
  7967. }
  7968. function baseGetTag(value) {
  7969. if (value == null) {
  7970. return value === undefined$1 ? undefinedTag : nullTag;
  7971. }
  7972. return symToStringTag && symToStringTag in Object2(value) ? getRawTag(value) : objectToString(value);
  7973. }
  7974. function baseGt(value, other) {
  7975. return value > other;
  7976. }
  7977. function baseHas(object, key) {
  7978. return object != null && hasOwnProperty.call(object, key);
  7979. }
  7980. function baseHasIn(object, key) {
  7981. return object != null && key in Object2(object);
  7982. }
  7983. function baseInRange(number, start, end) {
  7984. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  7985. }
  7986. function baseIntersection(arrays, iteratee2, comparator) {
  7987. var includes2 = comparator ? arrayIncludesWith : arrayIncludes, length = arrays[0].length, othLength = arrays.length, othIndex = othLength, caches = Array2(othLength), maxLength = Infinity, result2 = [];
  7988. while (othIndex--) {
  7989. var array = arrays[othIndex];
  7990. if (othIndex && iteratee2) {
  7991. array = arrayMap(array, baseUnary(iteratee2));
  7992. }
  7993. maxLength = nativeMin(array.length, maxLength);
  7994. caches[othIndex] = !comparator && (iteratee2 || length >= 120 && array.length >= 120) ? new SetCache(othIndex && array) : undefined$1;
  7995. }
  7996. array = arrays[0];
  7997. var index = -1, seen = caches[0];
  7998. outer:
  7999. while (++index < length && result2.length < maxLength) {
  8000. var value = array[index], computed = iteratee2 ? iteratee2(value) : value;
  8001. value = comparator || value !== 0 ? value : 0;
  8002. if (!(seen ? cacheHas(seen, computed) : includes2(result2, computed, comparator))) {
  8003. othIndex = othLength;
  8004. while (--othIndex) {
  8005. var cache = caches[othIndex];
  8006. if (!(cache ? cacheHas(cache, computed) : includes2(arrays[othIndex], computed, comparator))) {
  8007. continue outer;
  8008. }
  8009. }
  8010. if (seen) {
  8011. seen.push(computed);
  8012. }
  8013. result2.push(value);
  8014. }
  8015. }
  8016. return result2;
  8017. }
  8018. function baseInverter(object, setter, iteratee2, accumulator) {
  8019. baseForOwn(object, function(value, key, object2) {
  8020. setter(accumulator, iteratee2(value), key, object2);
  8021. });
  8022. return accumulator;
  8023. }
  8024. function baseInvoke(object, path, args) {
  8025. path = castPath(path, object);
  8026. object = parent(object, path);
  8027. var func = object == null ? object : object[toKey(last(path))];
  8028. return func == null ? undefined$1 : apply(func, object, args);
  8029. }
  8030. function baseIsArguments(value) {
  8031. return isObjectLike(value) && baseGetTag(value) == argsTag;
  8032. }
  8033. function baseIsArrayBuffer(value) {
  8034. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  8035. }
  8036. function baseIsDate(value) {
  8037. return isObjectLike(value) && baseGetTag(value) == dateTag;
  8038. }
  8039. function baseIsEqual(value, other, bitmask, customizer, stack) {
  8040. if (value === other) {
  8041. return true;
  8042. }
  8043. if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
  8044. return value !== value && other !== other;
  8045. }
  8046. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  8047. }
  8048. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  8049. var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other);
  8050. objTag = objTag == argsTag ? objectTag : objTag;
  8051. othTag = othTag == argsTag ? objectTag : othTag;
  8052. var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
  8053. if (isSameTag && isBuffer(object)) {
  8054. if (!isBuffer(other)) {
  8055. return false;
  8056. }
  8057. objIsArr = true;
  8058. objIsObj = false;
  8059. }
  8060. if (isSameTag && !objIsObj) {
  8061. stack || (stack = new Stack());
  8062. return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  8063. }
  8064. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  8065. var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
  8066. if (objIsWrapped || othIsWrapped) {
  8067. var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
  8068. stack || (stack = new Stack());
  8069. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  8070. }
  8071. }
  8072. if (!isSameTag) {
  8073. return false;
  8074. }
  8075. stack || (stack = new Stack());
  8076. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  8077. }
  8078. function baseIsMap(value) {
  8079. return isObjectLike(value) && getTag(value) == mapTag;
  8080. }
  8081. function baseIsMatch(object, source, matchData, customizer) {
  8082. var index = matchData.length, length = index, noCustomizer = !customizer;
  8083. if (object == null) {
  8084. return !length;
  8085. }
  8086. object = Object2(object);
  8087. while (index--) {
  8088. var data = matchData[index];
  8089. if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
  8090. return false;
  8091. }
  8092. }
  8093. while (++index < length) {
  8094. data = matchData[index];
  8095. var key = data[0], objValue = object[key], srcValue = data[1];
  8096. if (noCustomizer && data[2]) {
  8097. if (objValue === undefined$1 && !(key in object)) {
  8098. return false;
  8099. }
  8100. } else {
  8101. var stack = new Stack();
  8102. if (customizer) {
  8103. var result2 = customizer(objValue, srcValue, key, object, source, stack);
  8104. }
  8105. if (!(result2 === undefined$1 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) : result2)) {
  8106. return false;
  8107. }
  8108. }
  8109. }
  8110. return true;
  8111. }
  8112. function baseIsNative(value) {
  8113. if (!isObject(value) || isMasked(value)) {
  8114. return false;
  8115. }
  8116. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  8117. return pattern.test(toSource(value));
  8118. }
  8119. function baseIsRegExp(value) {
  8120. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  8121. }
  8122. function baseIsSet(value) {
  8123. return isObjectLike(value) && getTag(value) == setTag;
  8124. }
  8125. function baseIsTypedArray(value) {
  8126. return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  8127. }
  8128. function baseIteratee(value) {
  8129. if (typeof value == "function") {
  8130. return value;
  8131. }
  8132. if (value == null) {
  8133. return identity;
  8134. }
  8135. if (typeof value == "object") {
  8136. return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
  8137. }
  8138. return property(value);
  8139. }
  8140. function baseKeys(object) {
  8141. if (!isPrototype(object)) {
  8142. return nativeKeys(object);
  8143. }
  8144. var result2 = [];
  8145. for (var key in Object2(object)) {
  8146. if (hasOwnProperty.call(object, key) && key != "constructor") {
  8147. result2.push(key);
  8148. }
  8149. }
  8150. return result2;
  8151. }
  8152. function baseKeysIn(object) {
  8153. if (!isObject(object)) {
  8154. return nativeKeysIn(object);
  8155. }
  8156. var isProto = isPrototype(object), result2 = [];
  8157. for (var key in object) {
  8158. if (!(key == "constructor" && (isProto || !hasOwnProperty.call(object, key)))) {
  8159. result2.push(key);
  8160. }
  8161. }
  8162. return result2;
  8163. }
  8164. function baseLt(value, other) {
  8165. return value < other;
  8166. }
  8167. function baseMap(collection, iteratee2) {
  8168. var index = -1, result2 = isArrayLike(collection) ? Array2(collection.length) : [];
  8169. baseEach(collection, function(value, key, collection2) {
  8170. result2[++index] = iteratee2(value, key, collection2);
  8171. });
  8172. return result2;
  8173. }
  8174. function baseMatches(source) {
  8175. var matchData = getMatchData(source);
  8176. if (matchData.length == 1 && matchData[0][2]) {
  8177. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  8178. }
  8179. return function(object) {
  8180. return object === source || baseIsMatch(object, source, matchData);
  8181. };
  8182. }
  8183. function baseMatchesProperty(path, srcValue) {
  8184. if (isKey(path) && isStrictComparable(srcValue)) {
  8185. return matchesStrictComparable(toKey(path), srcValue);
  8186. }
  8187. return function(object) {
  8188. var objValue = get(object, path);
  8189. return objValue === undefined$1 && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  8190. };
  8191. }
  8192. function baseMerge(object, source, srcIndex, customizer, stack) {
  8193. if (object === source) {
  8194. return;
  8195. }
  8196. baseFor(source, function(srcValue, key) {
  8197. stack || (stack = new Stack());
  8198. if (isObject(srcValue)) {
  8199. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  8200. } else {
  8201. var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + "", object, source, stack) : undefined$1;
  8202. if (newValue === undefined$1) {
  8203. newValue = srcValue;
  8204. }
  8205. assignMergeValue(object, key, newValue);
  8206. }
  8207. }, keysIn);
  8208. }
  8209. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  8210. var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack.get(srcValue);
  8211. if (stacked) {
  8212. assignMergeValue(object, key, stacked);
  8213. return;
  8214. }
  8215. var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack) : undefined$1;
  8216. var isCommon = newValue === undefined$1;
  8217. if (isCommon) {
  8218. var isArr = isArray(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  8219. newValue = srcValue;
  8220. if (isArr || isBuff || isTyped) {
  8221. if (isArray(objValue)) {
  8222. newValue = objValue;
  8223. } else if (isArrayLikeObject(objValue)) {
  8224. newValue = copyArray(objValue);
  8225. } else if (isBuff) {
  8226. isCommon = false;
  8227. newValue = cloneBuffer(srcValue, true);
  8228. } else if (isTyped) {
  8229. isCommon = false;
  8230. newValue = cloneTypedArray(srcValue, true);
  8231. } else {
  8232. newValue = [];
  8233. }
  8234. } else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  8235. newValue = objValue;
  8236. if (isArguments(objValue)) {
  8237. newValue = toPlainObject(objValue);
  8238. } else if (!isObject(objValue) || isFunction(objValue)) {
  8239. newValue = initCloneObject(srcValue);
  8240. }
  8241. } else {
  8242. isCommon = false;
  8243. }
  8244. }
  8245. if (isCommon) {
  8246. stack.set(srcValue, newValue);
  8247. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  8248. stack["delete"](srcValue);
  8249. }
  8250. assignMergeValue(object, key, newValue);
  8251. }
  8252. function baseNth(array, n) {
  8253. var length = array.length;
  8254. if (!length) {
  8255. return;
  8256. }
  8257. n += n < 0 ? length : 0;
  8258. return isIndex(n, length) ? array[n] : undefined$1;
  8259. }
  8260. function baseOrderBy(collection, iteratees, orders) {
  8261. if (iteratees.length) {
  8262. iteratees = arrayMap(iteratees, function(iteratee2) {
  8263. if (isArray(iteratee2)) {
  8264. return function(value) {
  8265. return baseGet(value, iteratee2.length === 1 ? iteratee2[0] : iteratee2);
  8266. };
  8267. }
  8268. return iteratee2;
  8269. });
  8270. } else {
  8271. iteratees = [identity];
  8272. }
  8273. var index = -1;
  8274. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  8275. var result2 = baseMap(collection, function(value, key, collection2) {
  8276. var criteria = arrayMap(iteratees, function(iteratee2) {
  8277. return iteratee2(value);
  8278. });
  8279. return { "criteria": criteria, "index": ++index, "value": value };
  8280. });
  8281. return baseSortBy(result2, function(object, other) {
  8282. return compareMultiple(object, other, orders);
  8283. });
  8284. }
  8285. function basePick(object, paths) {
  8286. return basePickBy(object, paths, function(value, path) {
  8287. return hasIn(object, path);
  8288. });
  8289. }
  8290. function basePickBy(object, paths, predicate) {
  8291. var index = -1, length = paths.length, result2 = {};
  8292. while (++index < length) {
  8293. var path = paths[index], value = baseGet(object, path);
  8294. if (predicate(value, path)) {
  8295. baseSet(result2, castPath(path, object), value);
  8296. }
  8297. }
  8298. return result2;
  8299. }
  8300. function basePropertyDeep(path) {
  8301. return function(object) {
  8302. return baseGet(object, path);
  8303. };
  8304. }
  8305. function basePullAll(array, values2, iteratee2, comparator) {
  8306. var indexOf2 = comparator ? baseIndexOfWith : baseIndexOf, index = -1, length = values2.length, seen = array;
  8307. if (array === values2) {
  8308. values2 = copyArray(values2);
  8309. }
  8310. if (iteratee2) {
  8311. seen = arrayMap(array, baseUnary(iteratee2));
  8312. }
  8313. while (++index < length) {
  8314. var fromIndex = 0, value = values2[index], computed = iteratee2 ? iteratee2(value) : value;
  8315. while ((fromIndex = indexOf2(seen, computed, fromIndex, comparator)) > -1) {
  8316. if (seen !== array) {
  8317. splice.call(seen, fromIndex, 1);
  8318. }
  8319. splice.call(array, fromIndex, 1);
  8320. }
  8321. }
  8322. return array;
  8323. }
  8324. function basePullAt(array, indexes) {
  8325. var length = array ? indexes.length : 0, lastIndex = length - 1;
  8326. while (length--) {
  8327. var index = indexes[length];
  8328. if (length == lastIndex || index !== previous) {
  8329. var previous = index;
  8330. if (isIndex(index)) {
  8331. splice.call(array, index, 1);
  8332. } else {
  8333. baseUnset(array, index);
  8334. }
  8335. }
  8336. }
  8337. return array;
  8338. }
  8339. function baseRandom(lower, upper) {
  8340. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  8341. }
  8342. function baseRange(start, end, step, fromRight) {
  8343. var index = -1, length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), result2 = Array2(length);
  8344. while (length--) {
  8345. result2[fromRight ? length : ++index] = start;
  8346. start += step;
  8347. }
  8348. return result2;
  8349. }
  8350. function baseRepeat(string, n) {
  8351. var result2 = "";
  8352. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  8353. return result2;
  8354. }
  8355. do {
  8356. if (n % 2) {
  8357. result2 += string;
  8358. }
  8359. n = nativeFloor(n / 2);
  8360. if (n) {
  8361. string += string;
  8362. }
  8363. } while (n);
  8364. return result2;
  8365. }
  8366. function baseRest(func, start) {
  8367. return setToString(overRest(func, start, identity), func + "");
  8368. }
  8369. function baseSample(collection) {
  8370. return arraySample(values(collection));
  8371. }
  8372. function baseSampleSize(collection, n) {
  8373. var array = values(collection);
  8374. return shuffleSelf(array, baseClamp(n, 0, array.length));
  8375. }
  8376. function baseSet(object, path, value, customizer) {
  8377. if (!isObject(object)) {
  8378. return object;
  8379. }
  8380. path = castPath(path, object);
  8381. var index = -1, length = path.length, lastIndex = length - 1, nested = object;
  8382. while (nested != null && ++index < length) {
  8383. var key = toKey(path[index]), newValue = value;
  8384. if (key === "__proto__" || key === "constructor" || key === "prototype") {
  8385. return object;
  8386. }
  8387. if (index != lastIndex) {
  8388. var objValue = nested[key];
  8389. newValue = customizer ? customizer(objValue, key, nested) : undefined$1;
  8390. if (newValue === undefined$1) {
  8391. newValue = isObject(objValue) ? objValue : isIndex(path[index + 1]) ? [] : {};
  8392. }
  8393. }
  8394. assignValue(nested, key, newValue);
  8395. nested = nested[key];
  8396. }
  8397. return object;
  8398. }
  8399. var baseSetData = !metaMap ? identity : function(func, data) {
  8400. metaMap.set(func, data);
  8401. return func;
  8402. };
  8403. var baseSetToString = !defineProperty ? identity : function(func, string) {
  8404. return defineProperty(func, "toString", {
  8405. "configurable": true,
  8406. "enumerable": false,
  8407. "value": constant(string),
  8408. "writable": true
  8409. });
  8410. };
  8411. function baseShuffle(collection) {
  8412. return shuffleSelf(values(collection));
  8413. }
  8414. function baseSlice(array, start, end) {
  8415. var index = -1, length = array.length;
  8416. if (start < 0) {
  8417. start = -start > length ? 0 : length + start;
  8418. }
  8419. end = end > length ? length : end;
  8420. if (end < 0) {
  8421. end += length;
  8422. }
  8423. length = start > end ? 0 : end - start >>> 0;
  8424. start >>>= 0;
  8425. var result2 = Array2(length);
  8426. while (++index < length) {
  8427. result2[index] = array[index + start];
  8428. }
  8429. return result2;
  8430. }
  8431. function baseSome(collection, predicate) {
  8432. var result2;
  8433. baseEach(collection, function(value, index, collection2) {
  8434. result2 = predicate(value, index, collection2);
  8435. return !result2;
  8436. });
  8437. return !!result2;
  8438. }
  8439. function baseSortedIndex(array, value, retHighest) {
  8440. var low = 0, high = array == null ? low : array.length;
  8441. if (typeof value == "number" && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  8442. while (low < high) {
  8443. var mid = low + high >>> 1, computed = array[mid];
  8444. if (computed !== null && !isSymbol(computed) && (retHighest ? computed <= value : computed < value)) {
  8445. low = mid + 1;
  8446. } else {
  8447. high = mid;
  8448. }
  8449. }
  8450. return high;
  8451. }
  8452. return baseSortedIndexBy(array, value, identity, retHighest);
  8453. }
  8454. function baseSortedIndexBy(array, value, iteratee2, retHighest) {
  8455. var low = 0, high = array == null ? 0 : array.length;
  8456. if (high === 0) {
  8457. return 0;
  8458. }
  8459. value = iteratee2(value);
  8460. var valIsNaN = value !== value, valIsNull = value === null, valIsSymbol = isSymbol(value), valIsUndefined = value === undefined$1;
  8461. while (low < high) {
  8462. var mid = nativeFloor((low + high) / 2), computed = iteratee2(array[mid]), othIsDefined = computed !== undefined$1, othIsNull = computed === null, othIsReflexive = computed === computed, othIsSymbol = isSymbol(computed);
  8463. if (valIsNaN) {
  8464. var setLow = retHighest || othIsReflexive;
  8465. } else if (valIsUndefined) {
  8466. setLow = othIsReflexive && (retHighest || othIsDefined);
  8467. } else if (valIsNull) {
  8468. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  8469. } else if (valIsSymbol) {
  8470. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  8471. } else if (othIsNull || othIsSymbol) {
  8472. setLow = false;
  8473. } else {
  8474. setLow = retHighest ? computed <= value : computed < value;
  8475. }
  8476. if (setLow) {
  8477. low = mid + 1;
  8478. } else {
  8479. high = mid;
  8480. }
  8481. }
  8482. return nativeMin(high, MAX_ARRAY_INDEX);
  8483. }
  8484. function baseSortedUniq(array, iteratee2) {
  8485. var index = -1, length = array.length, resIndex = 0, result2 = [];
  8486. while (++index < length) {
  8487. var value = array[index], computed = iteratee2 ? iteratee2(value) : value;
  8488. if (!index || !eq(computed, seen)) {
  8489. var seen = computed;
  8490. result2[resIndex++] = value === 0 ? 0 : value;
  8491. }
  8492. }
  8493. return result2;
  8494. }
  8495. function baseToNumber(value) {
  8496. if (typeof value == "number") {
  8497. return value;
  8498. }
  8499. if (isSymbol(value)) {
  8500. return NAN;
  8501. }
  8502. return +value;
  8503. }
  8504. function baseToString(value) {
  8505. if (typeof value == "string") {
  8506. return value;
  8507. }
  8508. if (isArray(value)) {
  8509. return arrayMap(value, baseToString) + "";
  8510. }
  8511. if (isSymbol(value)) {
  8512. return symbolToString ? symbolToString.call(value) : "";
  8513. }
  8514. var result2 = value + "";
  8515. return result2 == "0" && 1 / value == -INFINITY ? "-0" : result2;
  8516. }
  8517. function baseUniq(array, iteratee2, comparator) {
  8518. var index = -1, includes2 = arrayIncludes, length = array.length, isCommon = true, result2 = [], seen = result2;
  8519. if (comparator) {
  8520. isCommon = false;
  8521. includes2 = arrayIncludesWith;
  8522. } else if (length >= LARGE_ARRAY_SIZE) {
  8523. var set2 = iteratee2 ? null : createSet(array);
  8524. if (set2) {
  8525. return setToArray(set2);
  8526. }
  8527. isCommon = false;
  8528. includes2 = cacheHas;
  8529. seen = new SetCache();
  8530. } else {
  8531. seen = iteratee2 ? [] : result2;
  8532. }
  8533. outer:
  8534. while (++index < length) {
  8535. var value = array[index], computed = iteratee2 ? iteratee2(value) : value;
  8536. value = comparator || value !== 0 ? value : 0;
  8537. if (isCommon && computed === computed) {
  8538. var seenIndex = seen.length;
  8539. while (seenIndex--) {
  8540. if (seen[seenIndex] === computed) {
  8541. continue outer;
  8542. }
  8543. }
  8544. if (iteratee2) {
  8545. seen.push(computed);
  8546. }
  8547. result2.push(value);
  8548. } else if (!includes2(seen, computed, comparator)) {
  8549. if (seen !== result2) {
  8550. seen.push(computed);
  8551. }
  8552. result2.push(value);
  8553. }
  8554. }
  8555. return result2;
  8556. }
  8557. function baseUnset(object, path) {
  8558. path = castPath(path, object);
  8559. object = parent(object, path);
  8560. return object == null || delete object[toKey(last(path))];
  8561. }
  8562. function baseUpdate(object, path, updater, customizer) {
  8563. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  8564. }
  8565. function baseWhile(array, predicate, isDrop, fromRight) {
  8566. var length = array.length, index = fromRight ? length : -1;
  8567. while ((fromRight ? index-- : ++index < length) && predicate(array[index], index, array)) {
  8568. }
  8569. return isDrop ? baseSlice(array, fromRight ? 0 : index, fromRight ? index + 1 : length) : baseSlice(array, fromRight ? index + 1 : 0, fromRight ? length : index);
  8570. }
  8571. function baseWrapperValue(value, actions) {
  8572. var result2 = value;
  8573. if (result2 instanceof LazyWrapper) {
  8574. result2 = result2.value();
  8575. }
  8576. return arrayReduce(actions, function(result3, action) {
  8577. return action.func.apply(action.thisArg, arrayPush([result3], action.args));
  8578. }, result2);
  8579. }
  8580. function baseXor(arrays, iteratee2, comparator) {
  8581. var length = arrays.length;
  8582. if (length < 2) {
  8583. return length ? baseUniq(arrays[0]) : [];
  8584. }
  8585. var index = -1, result2 = Array2(length);
  8586. while (++index < length) {
  8587. var array = arrays[index], othIndex = -1;
  8588. while (++othIndex < length) {
  8589. if (othIndex != index) {
  8590. result2[index] = baseDifference(result2[index] || array, arrays[othIndex], iteratee2, comparator);
  8591. }
  8592. }
  8593. }
  8594. return baseUniq(baseFlatten(result2, 1), iteratee2, comparator);
  8595. }
  8596. function baseZipObject(props, values2, assignFunc) {
  8597. var index = -1, length = props.length, valsLength = values2.length, result2 = {};
  8598. while (++index < length) {
  8599. var value = index < valsLength ? values2[index] : undefined$1;
  8600. assignFunc(result2, props[index], value);
  8601. }
  8602. return result2;
  8603. }
  8604. function castArrayLikeObject(value) {
  8605. return isArrayLikeObject(value) ? value : [];
  8606. }
  8607. function castFunction(value) {
  8608. return typeof value == "function" ? value : identity;
  8609. }
  8610. function castPath(value, object) {
  8611. if (isArray(value)) {
  8612. return value;
  8613. }
  8614. return isKey(value, object) ? [value] : stringToPath(toString(value));
  8615. }
  8616. var castRest = baseRest;
  8617. function castSlice(array, start, end) {
  8618. var length = array.length;
  8619. end = end === undefined$1 ? length : end;
  8620. return !start && end >= length ? array : baseSlice(array, start, end);
  8621. }
  8622. var clearTimeout = ctxClearTimeout || function(id) {
  8623. return root.clearTimeout(id);
  8624. };
  8625. function cloneBuffer(buffer, isDeep) {
  8626. if (isDeep) {
  8627. return buffer.slice();
  8628. }
  8629. var length = buffer.length, result2 = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  8630. buffer.copy(result2);
  8631. return result2;
  8632. }
  8633. function cloneArrayBuffer(arrayBuffer) {
  8634. var result2 = new arrayBuffer.constructor(arrayBuffer.byteLength);
  8635. new Uint8Array2(result2).set(new Uint8Array2(arrayBuffer));
  8636. return result2;
  8637. }
  8638. function cloneDataView(dataView, isDeep) {
  8639. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  8640. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  8641. }
  8642. function cloneRegExp(regexp) {
  8643. var result2 = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  8644. result2.lastIndex = regexp.lastIndex;
  8645. return result2;
  8646. }
  8647. function cloneSymbol(symbol) {
  8648. return symbolValueOf ? Object2(symbolValueOf.call(symbol)) : {};
  8649. }
  8650. function cloneTypedArray(typedArray, isDeep) {
  8651. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  8652. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  8653. }
  8654. function compareAscending(value, other) {
  8655. if (value !== other) {
  8656. var valIsDefined = value !== undefined$1, valIsNull = value === null, valIsReflexive = value === value, valIsSymbol = isSymbol(value);
  8657. var othIsDefined = other !== undefined$1, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol(other);
  8658. if (!othIsNull && !othIsSymbol && !valIsSymbol && value > other || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) {
  8659. return 1;
  8660. }
  8661. if (!valIsNull && !valIsSymbol && !othIsSymbol && value < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) {
  8662. return -1;
  8663. }
  8664. }
  8665. return 0;
  8666. }
  8667. function compareMultiple(object, other, orders) {
  8668. var index = -1, objCriteria = object.criteria, othCriteria = other.criteria, length = objCriteria.length, ordersLength = orders.length;
  8669. while (++index < length) {
  8670. var result2 = compareAscending(objCriteria[index], othCriteria[index]);
  8671. if (result2) {
  8672. if (index >= ordersLength) {
  8673. return result2;
  8674. }
  8675. var order = orders[index];
  8676. return result2 * (order == "desc" ? -1 : 1);
  8677. }
  8678. }
  8679. return object.index - other.index;
  8680. }
  8681. function composeArgs(args, partials, holders, isCurried) {
  8682. var argsIndex = -1, argsLength = args.length, holdersLength = holders.length, leftIndex = -1, leftLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result2 = Array2(leftLength + rangeLength), isUncurried = !isCurried;
  8683. while (++leftIndex < leftLength) {
  8684. result2[leftIndex] = partials[leftIndex];
  8685. }
  8686. while (++argsIndex < holdersLength) {
  8687. if (isUncurried || argsIndex < argsLength) {
  8688. result2[holders[argsIndex]] = args[argsIndex];
  8689. }
  8690. }
  8691. while (rangeLength--) {
  8692. result2[leftIndex++] = args[argsIndex++];
  8693. }
  8694. return result2;
  8695. }
  8696. function composeArgsRight(args, partials, holders, isCurried) {
  8697. var argsIndex = -1, argsLength = args.length, holdersIndex = -1, holdersLength = holders.length, rightIndex = -1, rightLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result2 = Array2(rangeLength + rightLength), isUncurried = !isCurried;
  8698. while (++argsIndex < rangeLength) {
  8699. result2[argsIndex] = args[argsIndex];
  8700. }
  8701. var offset = argsIndex;
  8702. while (++rightIndex < rightLength) {
  8703. result2[offset + rightIndex] = partials[rightIndex];
  8704. }
  8705. while (++holdersIndex < holdersLength) {
  8706. if (isUncurried || argsIndex < argsLength) {
  8707. result2[offset + holders[holdersIndex]] = args[argsIndex++];
  8708. }
  8709. }
  8710. return result2;
  8711. }
  8712. function copyArray(source, array) {
  8713. var index = -1, length = source.length;
  8714. array || (array = Array2(length));
  8715. while (++index < length) {
  8716. array[index] = source[index];
  8717. }
  8718. return array;
  8719. }
  8720. function copyObject(source, props, object, customizer) {
  8721. var isNew = !object;
  8722. object || (object = {});
  8723. var index = -1, length = props.length;
  8724. while (++index < length) {
  8725. var key = props[index];
  8726. var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined$1;
  8727. if (newValue === undefined$1) {
  8728. newValue = source[key];
  8729. }
  8730. if (isNew) {
  8731. baseAssignValue(object, key, newValue);
  8732. } else {
  8733. assignValue(object, key, newValue);
  8734. }
  8735. }
  8736. return object;
  8737. }
  8738. function copySymbols(source, object) {
  8739. return copyObject(source, getSymbols(source), object);
  8740. }
  8741. function copySymbolsIn(source, object) {
  8742. return copyObject(source, getSymbolsIn(source), object);
  8743. }
  8744. function createAggregator(setter, initializer) {
  8745. return function(collection, iteratee2) {
  8746. var func = isArray(collection) ? arrayAggregator : baseAggregator, accumulator = initializer ? initializer() : {};
  8747. return func(collection, setter, getIteratee(iteratee2, 2), accumulator);
  8748. };
  8749. }
  8750. function createAssigner(assigner) {
  8751. return baseRest(function(object, sources) {
  8752. var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined$1, guard = length > 2 ? sources[2] : undefined$1;
  8753. customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : undefined$1;
  8754. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  8755. customizer = length < 3 ? undefined$1 : customizer;
  8756. length = 1;
  8757. }
  8758. object = Object2(object);
  8759. while (++index < length) {
  8760. var source = sources[index];
  8761. if (source) {
  8762. assigner(object, source, index, customizer);
  8763. }
  8764. }
  8765. return object;
  8766. });
  8767. }
  8768. function createBaseEach(eachFunc, fromRight) {
  8769. return function(collection, iteratee2) {
  8770. if (collection == null) {
  8771. return collection;
  8772. }
  8773. if (!isArrayLike(collection)) {
  8774. return eachFunc(collection, iteratee2);
  8775. }
  8776. var length = collection.length, index = fromRight ? length : -1, iterable = Object2(collection);
  8777. while (fromRight ? index-- : ++index < length) {
  8778. if (iteratee2(iterable[index], index, iterable) === false) {
  8779. break;
  8780. }
  8781. }
  8782. return collection;
  8783. };
  8784. }
  8785. function createBaseFor(fromRight) {
  8786. return function(object, iteratee2, keysFunc) {
  8787. var index = -1, iterable = Object2(object), props = keysFunc(object), length = props.length;
  8788. while (length--) {
  8789. var key = props[fromRight ? length : ++index];
  8790. if (iteratee2(iterable[key], key, iterable) === false) {
  8791. break;
  8792. }
  8793. }
  8794. return object;
  8795. };
  8796. }
  8797. function createBind(func, bitmask, thisArg) {
  8798. var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func);
  8799. function wrapper() {
  8800. var fn = this && this !== root && this instanceof wrapper ? Ctor : func;
  8801. return fn.apply(isBind ? thisArg : this, arguments);
  8802. }
  8803. return wrapper;
  8804. }
  8805. function createCaseFirst(methodName) {
  8806. return function(string) {
  8807. string = toString(string);
  8808. var strSymbols = hasUnicode(string) ? stringToArray(string) : undefined$1;
  8809. var chr = strSymbols ? strSymbols[0] : string.charAt(0);
  8810. var trailing = strSymbols ? castSlice(strSymbols, 1).join("") : string.slice(1);
  8811. return chr[methodName]() + trailing;
  8812. };
  8813. }
  8814. function createCompounder(callback) {
  8815. return function(string) {
  8816. return arrayReduce(words(deburr(string).replace(reApos, "")), callback, "");
  8817. };
  8818. }
  8819. function createCtor(Ctor) {
  8820. return function() {
  8821. var args = arguments;
  8822. switch (args.length) {
  8823. case 0:
  8824. return new Ctor();
  8825. case 1:
  8826. return new Ctor(args[0]);
  8827. case 2:
  8828. return new Ctor(args[0], args[1]);
  8829. case 3:
  8830. return new Ctor(args[0], args[1], args[2]);
  8831. case 4:
  8832. return new Ctor(args[0], args[1], args[2], args[3]);
  8833. case 5:
  8834. return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  8835. case 6:
  8836. return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  8837. case 7:
  8838. return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  8839. }
  8840. var thisBinding = baseCreate(Ctor.prototype), result2 = Ctor.apply(thisBinding, args);
  8841. return isObject(result2) ? result2 : thisBinding;
  8842. };
  8843. }
  8844. function createCurry(func, bitmask, arity) {
  8845. var Ctor = createCtor(func);
  8846. function wrapper() {
  8847. var length = arguments.length, args = Array2(length), index = length, placeholder = getHolder(wrapper);
  8848. while (index--) {
  8849. args[index] = arguments[index];
  8850. }
  8851. var holders = length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder ? [] : replaceHolders(args, placeholder);
  8852. length -= holders.length;
  8853. if (length < arity) {
  8854. return createRecurry(
  8855. func,
  8856. bitmask,
  8857. createHybrid,
  8858. wrapper.placeholder,
  8859. undefined$1,
  8860. args,
  8861. holders,
  8862. undefined$1,
  8863. undefined$1,
  8864. arity - length
  8865. );
  8866. }
  8867. var fn = this && this !== root && this instanceof wrapper ? Ctor : func;
  8868. return apply(fn, this, args);
  8869. }
  8870. return wrapper;
  8871. }
  8872. function createFind(findIndexFunc) {
  8873. return function(collection, predicate, fromIndex) {
  8874. var iterable = Object2(collection);
  8875. if (!isArrayLike(collection)) {
  8876. var iteratee2 = getIteratee(predicate, 3);
  8877. collection = keys(collection);
  8878. predicate = function(key) {
  8879. return iteratee2(iterable[key], key, iterable);
  8880. };
  8881. }
  8882. var index = findIndexFunc(collection, predicate, fromIndex);
  8883. return index > -1 ? iterable[iteratee2 ? collection[index] : index] : undefined$1;
  8884. };
  8885. }
  8886. function createFlow(fromRight) {
  8887. return flatRest(function(funcs) {
  8888. var length = funcs.length, index = length, prereq = LodashWrapper.prototype.thru;
  8889. if (fromRight) {
  8890. funcs.reverse();
  8891. }
  8892. while (index--) {
  8893. var func = funcs[index];
  8894. if (typeof func != "function") {
  8895. throw new TypeError2(FUNC_ERROR_TEXT);
  8896. }
  8897. if (prereq && !wrapper && getFuncName(func) == "wrapper") {
  8898. var wrapper = new LodashWrapper([], true);
  8899. }
  8900. }
  8901. index = wrapper ? index : length;
  8902. while (++index < length) {
  8903. func = funcs[index];
  8904. var funcName = getFuncName(func), data = funcName == "wrapper" ? getData(func) : undefined$1;
  8905. 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) {
  8906. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  8907. } else {
  8908. wrapper = func.length == 1 && isLaziable(func) ? wrapper[funcName]() : wrapper.thru(func);
  8909. }
  8910. }
  8911. return function() {
  8912. var args = arguments, value = args[0];
  8913. if (wrapper && args.length == 1 && isArray(value)) {
  8914. return wrapper.plant(value).value();
  8915. }
  8916. var index2 = 0, result2 = length ? funcs[index2].apply(this, args) : value;
  8917. while (++index2 < length) {
  8918. result2 = funcs[index2].call(this, result2);
  8919. }
  8920. return result2;
  8921. };
  8922. });
  8923. }
  8924. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary2, arity) {
  8925. 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$1 : createCtor(func);
  8926. function wrapper() {
  8927. var length = arguments.length, args = Array2(length), index = length;
  8928. while (index--) {
  8929. args[index] = arguments[index];
  8930. }
  8931. if (isCurried) {
  8932. var placeholder = getHolder(wrapper), holdersCount = countHolders(args, placeholder);
  8933. }
  8934. if (partials) {
  8935. args = composeArgs(args, partials, holders, isCurried);
  8936. }
  8937. if (partialsRight) {
  8938. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  8939. }
  8940. length -= holdersCount;
  8941. if (isCurried && length < arity) {
  8942. var newHolders = replaceHolders(args, placeholder);
  8943. return createRecurry(
  8944. func,
  8945. bitmask,
  8946. createHybrid,
  8947. wrapper.placeholder,
  8948. thisArg,
  8949. args,
  8950. newHolders,
  8951. argPos,
  8952. ary2,
  8953. arity - length
  8954. );
  8955. }
  8956. var thisBinding = isBind ? thisArg : this, fn = isBindKey ? thisBinding[func] : func;
  8957. length = args.length;
  8958. if (argPos) {
  8959. args = reorder(args, argPos);
  8960. } else if (isFlip && length > 1) {
  8961. args.reverse();
  8962. }
  8963. if (isAry && ary2 < length) {
  8964. args.length = ary2;
  8965. }
  8966. if (this && this !== root && this instanceof wrapper) {
  8967. fn = Ctor || createCtor(fn);
  8968. }
  8969. return fn.apply(thisBinding, args);
  8970. }
  8971. return wrapper;
  8972. }
  8973. function createInverter(setter, toIteratee) {
  8974. return function(object, iteratee2) {
  8975. return baseInverter(object, setter, toIteratee(iteratee2), {});
  8976. };
  8977. }
  8978. function createMathOperation(operator, defaultValue) {
  8979. return function(value, other) {
  8980. var result2;
  8981. if (value === undefined$1 && other === undefined$1) {
  8982. return defaultValue;
  8983. }
  8984. if (value !== undefined$1) {
  8985. result2 = value;
  8986. }
  8987. if (other !== undefined$1) {
  8988. if (result2 === undefined$1) {
  8989. return other;
  8990. }
  8991. if (typeof value == "string" || typeof other == "string") {
  8992. value = baseToString(value);
  8993. other = baseToString(other);
  8994. } else {
  8995. value = baseToNumber(value);
  8996. other = baseToNumber(other);
  8997. }
  8998. result2 = operator(value, other);
  8999. }
  9000. return result2;
  9001. };
  9002. }
  9003. function createOver(arrayFunc) {
  9004. return flatRest(function(iteratees) {
  9005. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  9006. return baseRest(function(args) {
  9007. var thisArg = this;
  9008. return arrayFunc(iteratees, function(iteratee2) {
  9009. return apply(iteratee2, thisArg, args);
  9010. });
  9011. });
  9012. });
  9013. }
  9014. function createPadding(length, chars) {
  9015. chars = chars === undefined$1 ? " " : baseToString(chars);
  9016. var charsLength = chars.length;
  9017. if (charsLength < 2) {
  9018. return charsLength ? baseRepeat(chars, length) : chars;
  9019. }
  9020. var result2 = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  9021. return hasUnicode(chars) ? castSlice(stringToArray(result2), 0, length).join("") : result2.slice(0, length);
  9022. }
  9023. function createPartial(func, bitmask, thisArg, partials) {
  9024. var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func);
  9025. function wrapper() {
  9026. var argsIndex = -1, argsLength = arguments.length, leftIndex = -1, leftLength = partials.length, args = Array2(leftLength + argsLength), fn = this && this !== root && this instanceof wrapper ? Ctor : func;
  9027. while (++leftIndex < leftLength) {
  9028. args[leftIndex] = partials[leftIndex];
  9029. }
  9030. while (argsLength--) {
  9031. args[leftIndex++] = arguments[++argsIndex];
  9032. }
  9033. return apply(fn, isBind ? thisArg : this, args);
  9034. }
  9035. return wrapper;
  9036. }
  9037. function createRange(fromRight) {
  9038. return function(start, end, step) {
  9039. if (step && typeof step != "number" && isIterateeCall(start, end, step)) {
  9040. end = step = undefined$1;
  9041. }
  9042. start = toFinite(start);
  9043. if (end === undefined$1) {
  9044. end = start;
  9045. start = 0;
  9046. } else {
  9047. end = toFinite(end);
  9048. }
  9049. step = step === undefined$1 ? start < end ? 1 : -1 : toFinite(step);
  9050. return baseRange(start, end, step, fromRight);
  9051. };
  9052. }
  9053. function createRelationalOperation(operator) {
  9054. return function(value, other) {
  9055. if (!(typeof value == "string" && typeof other == "string")) {
  9056. value = toNumber(value);
  9057. other = toNumber(other);
  9058. }
  9059. return operator(value, other);
  9060. };
  9061. }
  9062. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary2, arity) {
  9063. var isCurry = bitmask & WRAP_CURRY_FLAG, newHolders = isCurry ? holders : undefined$1, newHoldersRight = isCurry ? undefined$1 : holders, newPartials = isCurry ? partials : undefined$1, newPartialsRight = isCurry ? undefined$1 : partials;
  9064. bitmask |= isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG;
  9065. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  9066. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  9067. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  9068. }
  9069. var newData = [
  9070. func,
  9071. bitmask,
  9072. thisArg,
  9073. newPartials,
  9074. newHolders,
  9075. newPartialsRight,
  9076. newHoldersRight,
  9077. argPos,
  9078. ary2,
  9079. arity
  9080. ];
  9081. var result2 = wrapFunc.apply(undefined$1, newData);
  9082. if (isLaziable(func)) {
  9083. setData(result2, newData);
  9084. }
  9085. result2.placeholder = placeholder;
  9086. return setWrapToString(result2, func, bitmask);
  9087. }
  9088. function createRound(methodName) {
  9089. var func = Math2[methodName];
  9090. return function(number, precision) {
  9091. number = toNumber(number);
  9092. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  9093. if (precision && nativeIsFinite(number)) {
  9094. var pair = (toString(number) + "e").split("e"), value = func(pair[0] + "e" + (+pair[1] + precision));
  9095. pair = (toString(value) + "e").split("e");
  9096. return +(pair[0] + "e" + (+pair[1] - precision));
  9097. }
  9098. return func(number);
  9099. };
  9100. }
  9101. var createSet = !(Set && 1 / setToArray(new Set([, -0]))[1] == INFINITY) ? noop : function(values2) {
  9102. return new Set(values2);
  9103. };
  9104. function createToPairs(keysFunc) {
  9105. return function(object) {
  9106. var tag = getTag(object);
  9107. if (tag == mapTag) {
  9108. return mapToArray(object);
  9109. }
  9110. if (tag == setTag) {
  9111. return setToPairs(object);
  9112. }
  9113. return baseToPairs(object, keysFunc(object));
  9114. };
  9115. }
  9116. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary2, arity) {
  9117. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  9118. if (!isBindKey && typeof func != "function") {
  9119. throw new TypeError2(FUNC_ERROR_TEXT);
  9120. }
  9121. var length = partials ? partials.length : 0;
  9122. if (!length) {
  9123. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  9124. partials = holders = undefined$1;
  9125. }
  9126. ary2 = ary2 === undefined$1 ? ary2 : nativeMax(toInteger(ary2), 0);
  9127. arity = arity === undefined$1 ? arity : toInteger(arity);
  9128. length -= holders ? holders.length : 0;
  9129. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  9130. var partialsRight = partials, holdersRight = holders;
  9131. partials = holders = undefined$1;
  9132. }
  9133. var data = isBindKey ? undefined$1 : getData(func);
  9134. var newData = [
  9135. func,
  9136. bitmask,
  9137. thisArg,
  9138. partials,
  9139. holders,
  9140. partialsRight,
  9141. holdersRight,
  9142. argPos,
  9143. ary2,
  9144. arity
  9145. ];
  9146. if (data) {
  9147. mergeData(newData, data);
  9148. }
  9149. func = newData[0];
  9150. bitmask = newData[1];
  9151. thisArg = newData[2];
  9152. partials = newData[3];
  9153. holders = newData[4];
  9154. arity = newData[9] = newData[9] === undefined$1 ? isBindKey ? 0 : func.length : nativeMax(newData[9] - length, 0);
  9155. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  9156. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  9157. }
  9158. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  9159. var result2 = createBind(func, bitmask, thisArg);
  9160. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  9161. result2 = createCurry(func, bitmask, arity);
  9162. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  9163. result2 = createPartial(func, bitmask, thisArg, partials);
  9164. } else {
  9165. result2 = createHybrid.apply(undefined$1, newData);
  9166. }
  9167. var setter = data ? baseSetData : setData;
  9168. return setWrapToString(setter(result2, newData), func, bitmask);
  9169. }
  9170. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  9171. if (objValue === undefined$1 || eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key)) {
  9172. return srcValue;
  9173. }
  9174. return objValue;
  9175. }
  9176. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  9177. if (isObject(objValue) && isObject(srcValue)) {
  9178. stack.set(srcValue, objValue);
  9179. baseMerge(objValue, srcValue, undefined$1, customDefaultsMerge, stack);
  9180. stack["delete"](srcValue);
  9181. }
  9182. return objValue;
  9183. }
  9184. function customOmitClone(value) {
  9185. return isPlainObject(value) ? undefined$1 : value;
  9186. }
  9187. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  9188. var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length;
  9189. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  9190. return false;
  9191. }
  9192. var arrStacked = stack.get(array);
  9193. var othStacked = stack.get(other);
  9194. if (arrStacked && othStacked) {
  9195. return arrStacked == other && othStacked == array;
  9196. }
  9197. var index = -1, result2 = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : undefined$1;
  9198. stack.set(array, other);
  9199. stack.set(other, array);
  9200. while (++index < arrLength) {
  9201. var arrValue = array[index], othValue = other[index];
  9202. if (customizer) {
  9203. var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
  9204. }
  9205. if (compared !== undefined$1) {
  9206. if (compared) {
  9207. continue;
  9208. }
  9209. result2 = false;
  9210. break;
  9211. }
  9212. if (seen) {
  9213. if (!arraySome(other, function(othValue2, othIndex) {
  9214. if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
  9215. return seen.push(othIndex);
  9216. }
  9217. })) {
  9218. result2 = false;
  9219. break;
  9220. }
  9221. } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  9222. result2 = false;
  9223. break;
  9224. }
  9225. }
  9226. stack["delete"](array);
  9227. stack["delete"](other);
  9228. return result2;
  9229. }
  9230. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  9231. switch (tag) {
  9232. case dataViewTag:
  9233. if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
  9234. return false;
  9235. }
  9236. object = object.buffer;
  9237. other = other.buffer;
  9238. case arrayBufferTag:
  9239. if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other))) {
  9240. return false;
  9241. }
  9242. return true;
  9243. case boolTag:
  9244. case dateTag:
  9245. case numberTag:
  9246. return eq(+object, +other);
  9247. case errorTag:
  9248. return object.name == other.name && object.message == other.message;
  9249. case regexpTag:
  9250. case stringTag:
  9251. return object == other + "";
  9252. case mapTag:
  9253. var convert = mapToArray;
  9254. case setTag:
  9255. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  9256. convert || (convert = setToArray);
  9257. if (object.size != other.size && !isPartial) {
  9258. return false;
  9259. }
  9260. var stacked = stack.get(object);
  9261. if (stacked) {
  9262. return stacked == other;
  9263. }
  9264. bitmask |= COMPARE_UNORDERED_FLAG;
  9265. stack.set(object, other);
  9266. var result2 = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  9267. stack["delete"](object);
  9268. return result2;
  9269. case symbolTag:
  9270. if (symbolValueOf) {
  9271. return symbolValueOf.call(object) == symbolValueOf.call(other);
  9272. }
  9273. }
  9274. return false;
  9275. }
  9276. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  9277. var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
  9278. if (objLength != othLength && !isPartial) {
  9279. return false;
  9280. }
  9281. var index = objLength;
  9282. while (index--) {
  9283. var key = objProps[index];
  9284. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  9285. return false;
  9286. }
  9287. }
  9288. var objStacked = stack.get(object);
  9289. var othStacked = stack.get(other);
  9290. if (objStacked && othStacked) {
  9291. return objStacked == other && othStacked == object;
  9292. }
  9293. var result2 = true;
  9294. stack.set(object, other);
  9295. stack.set(other, object);
  9296. var skipCtor = isPartial;
  9297. while (++index < objLength) {
  9298. key = objProps[index];
  9299. var objValue = object[key], othValue = other[key];
  9300. if (customizer) {
  9301. var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
  9302. }
  9303. if (!(compared === undefined$1 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
  9304. result2 = false;
  9305. break;
  9306. }
  9307. skipCtor || (skipCtor = key == "constructor");
  9308. }
  9309. if (result2 && !skipCtor) {
  9310. var objCtor = object.constructor, othCtor = other.constructor;
  9311. if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
  9312. result2 = false;
  9313. }
  9314. }
  9315. stack["delete"](object);
  9316. stack["delete"](other);
  9317. return result2;
  9318. }
  9319. function flatRest(func) {
  9320. return setToString(overRest(func, undefined$1, flatten), func + "");
  9321. }
  9322. function getAllKeys(object) {
  9323. return baseGetAllKeys(object, keys, getSymbols);
  9324. }
  9325. function getAllKeysIn(object) {
  9326. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  9327. }
  9328. var getData = !metaMap ? noop : function(func) {
  9329. return metaMap.get(func);
  9330. };
  9331. function getFuncName(func) {
  9332. var result2 = func.name + "", array = realNames[result2], length = hasOwnProperty.call(realNames, result2) ? array.length : 0;
  9333. while (length--) {
  9334. var data = array[length], otherFunc = data.func;
  9335. if (otherFunc == null || otherFunc == func) {
  9336. return data.name;
  9337. }
  9338. }
  9339. return result2;
  9340. }
  9341. function getHolder(func) {
  9342. var object = hasOwnProperty.call(lodash2, "placeholder") ? lodash2 : func;
  9343. return object.placeholder;
  9344. }
  9345. function getIteratee() {
  9346. var result2 = lodash2.iteratee || iteratee;
  9347. result2 = result2 === iteratee ? baseIteratee : result2;
  9348. return arguments.length ? result2(arguments[0], arguments[1]) : result2;
  9349. }
  9350. function getMapData(map2, key) {
  9351. var data = map2.__data__;
  9352. return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
  9353. }
  9354. function getMatchData(object) {
  9355. var result2 = keys(object), length = result2.length;
  9356. while (length--) {
  9357. var key = result2[length], value = object[key];
  9358. result2[length] = [key, value, isStrictComparable(value)];
  9359. }
  9360. return result2;
  9361. }
  9362. function getNative(object, key) {
  9363. var value = getValue(object, key);
  9364. return baseIsNative(value) ? value : undefined$1;
  9365. }
  9366. function getRawTag(value) {
  9367. var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
  9368. try {
  9369. value[symToStringTag] = undefined$1;
  9370. var unmasked = true;
  9371. } catch (e) {
  9372. }
  9373. var result2 = nativeObjectToString.call(value);
  9374. if (unmasked) {
  9375. if (isOwn) {
  9376. value[symToStringTag] = tag;
  9377. } else {
  9378. delete value[symToStringTag];
  9379. }
  9380. }
  9381. return result2;
  9382. }
  9383. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  9384. if (object == null) {
  9385. return [];
  9386. }
  9387. object = Object2(object);
  9388. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  9389. return propertyIsEnumerable.call(object, symbol);
  9390. });
  9391. };
  9392. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  9393. var result2 = [];
  9394. while (object) {
  9395. arrayPush(result2, getSymbols(object));
  9396. object = getPrototype(object);
  9397. }
  9398. return result2;
  9399. };
  9400. var getTag = baseGetTag;
  9401. if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map && getTag(new Map()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set && getTag(new Set()) != setTag || WeakMap && getTag(new WeakMap()) != weakMapTag) {
  9402. getTag = function(value) {
  9403. var result2 = baseGetTag(value), Ctor = result2 == objectTag ? value.constructor : undefined$1, ctorString = Ctor ? toSource(Ctor) : "";
  9404. if (ctorString) {
  9405. switch (ctorString) {
  9406. case dataViewCtorString:
  9407. return dataViewTag;
  9408. case mapCtorString:
  9409. return mapTag;
  9410. case promiseCtorString:
  9411. return promiseTag;
  9412. case setCtorString:
  9413. return setTag;
  9414. case weakMapCtorString:
  9415. return weakMapTag;
  9416. }
  9417. }
  9418. return result2;
  9419. };
  9420. }
  9421. function getView(start, end, transforms) {
  9422. var index = -1, length = transforms.length;
  9423. while (++index < length) {
  9424. var data = transforms[index], size2 = data.size;
  9425. switch (data.type) {
  9426. case "drop":
  9427. start += size2;
  9428. break;
  9429. case "dropRight":
  9430. end -= size2;
  9431. break;
  9432. case "take":
  9433. end = nativeMin(end, start + size2);
  9434. break;
  9435. case "takeRight":
  9436. start = nativeMax(start, end - size2);
  9437. break;
  9438. }
  9439. }
  9440. return { "start": start, "end": end };
  9441. }
  9442. function getWrapDetails(source) {
  9443. var match = source.match(reWrapDetails);
  9444. return match ? match[1].split(reSplitDetails) : [];
  9445. }
  9446. function hasPath(object, path, hasFunc) {
  9447. path = castPath(path, object);
  9448. var index = -1, length = path.length, result2 = false;
  9449. while (++index < length) {
  9450. var key = toKey(path[index]);
  9451. if (!(result2 = object != null && hasFunc(object, key))) {
  9452. break;
  9453. }
  9454. object = object[key];
  9455. }
  9456. if (result2 || ++index != length) {
  9457. return result2;
  9458. }
  9459. length = object == null ? 0 : object.length;
  9460. return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object));
  9461. }
  9462. function initCloneArray(array) {
  9463. var length = array.length, result2 = new array.constructor(length);
  9464. if (length && typeof array[0] == "string" && hasOwnProperty.call(array, "index")) {
  9465. result2.index = array.index;
  9466. result2.input = array.input;
  9467. }
  9468. return result2;
  9469. }
  9470. function initCloneObject(object) {
  9471. return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
  9472. }
  9473. function initCloneByTag(object, tag, isDeep) {
  9474. var Ctor = object.constructor;
  9475. switch (tag) {
  9476. case arrayBufferTag:
  9477. return cloneArrayBuffer(object);
  9478. case boolTag:
  9479. case dateTag:
  9480. return new Ctor(+object);
  9481. case dataViewTag:
  9482. return cloneDataView(object, isDeep);
  9483. case float32Tag:
  9484. case float64Tag:
  9485. case int8Tag:
  9486. case int16Tag:
  9487. case int32Tag:
  9488. case uint8Tag:
  9489. case uint8ClampedTag:
  9490. case uint16Tag:
  9491. case uint32Tag:
  9492. return cloneTypedArray(object, isDeep);
  9493. case mapTag:
  9494. return new Ctor();
  9495. case numberTag:
  9496. case stringTag:
  9497. return new Ctor(object);
  9498. case regexpTag:
  9499. return cloneRegExp(object);
  9500. case setTag:
  9501. return new Ctor();
  9502. case symbolTag:
  9503. return cloneSymbol(object);
  9504. }
  9505. }
  9506. function insertWrapDetails(source, details) {
  9507. var length = details.length;
  9508. if (!length) {
  9509. return source;
  9510. }
  9511. var lastIndex = length - 1;
  9512. details[lastIndex] = (length > 1 ? "& " : "") + details[lastIndex];
  9513. details = details.join(length > 2 ? ", " : " ");
  9514. return source.replace(reWrapComment, "{\n/* [wrapped with " + details + "] */\n");
  9515. }
  9516. function isFlattenable(value) {
  9517. return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
  9518. }
  9519. function isIndex(value, length) {
  9520. var type = typeof value;
  9521. length = length == null ? MAX_SAFE_INTEGER : length;
  9522. return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
  9523. }
  9524. function isIterateeCall(value, index, object) {
  9525. if (!isObject(object)) {
  9526. return false;
  9527. }
  9528. var type = typeof index;
  9529. if (type == "number" ? isArrayLike(object) && isIndex(index, object.length) : type == "string" && index in object) {
  9530. return eq(object[index], value);
  9531. }
  9532. return false;
  9533. }
  9534. function isKey(value, object) {
  9535. if (isArray(value)) {
  9536. return false;
  9537. }
  9538. var type = typeof value;
  9539. if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) {
  9540. return true;
  9541. }
  9542. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object2(object);
  9543. }
  9544. function isKeyable(value) {
  9545. var type = typeof value;
  9546. return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
  9547. }
  9548. function isLaziable(func) {
  9549. var funcName = getFuncName(func), other = lodash2[funcName];
  9550. if (typeof other != "function" || !(funcName in LazyWrapper.prototype)) {
  9551. return false;
  9552. }
  9553. if (func === other) {
  9554. return true;
  9555. }
  9556. var data = getData(other);
  9557. return !!data && func === data[0];
  9558. }
  9559. function isMasked(func) {
  9560. return !!maskSrcKey && maskSrcKey in func;
  9561. }
  9562. var isMaskable = coreJsData ? isFunction : stubFalse;
  9563. function isPrototype(value) {
  9564. var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
  9565. return value === proto;
  9566. }
  9567. function isStrictComparable(value) {
  9568. return value === value && !isObject(value);
  9569. }
  9570. function matchesStrictComparable(key, srcValue) {
  9571. return function(object) {
  9572. if (object == null) {
  9573. return false;
  9574. }
  9575. return object[key] === srcValue && (srcValue !== undefined$1 || key in Object2(object));
  9576. };
  9577. }
  9578. function memoizeCapped(func) {
  9579. var result2 = memoize(func, function(key) {
  9580. if (cache.size === MAX_MEMOIZE_SIZE) {
  9581. cache.clear();
  9582. }
  9583. return key;
  9584. });
  9585. var cache = result2.cache;
  9586. return result2;
  9587. }
  9588. function mergeData(data, source) {
  9589. var bitmask = data[1], srcBitmask = source[1], newBitmask = bitmask | srcBitmask, isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  9590. 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;
  9591. if (!(isCommon || isCombo)) {
  9592. return data;
  9593. }
  9594. if (srcBitmask & WRAP_BIND_FLAG) {
  9595. data[2] = source[2];
  9596. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  9597. }
  9598. var value = source[3];
  9599. if (value) {
  9600. var partials = data[3];
  9601. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  9602. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  9603. }
  9604. value = source[5];
  9605. if (value) {
  9606. partials = data[5];
  9607. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  9608. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  9609. }
  9610. value = source[7];
  9611. if (value) {
  9612. data[7] = value;
  9613. }
  9614. if (srcBitmask & WRAP_ARY_FLAG) {
  9615. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  9616. }
  9617. if (data[9] == null) {
  9618. data[9] = source[9];
  9619. }
  9620. data[0] = source[0];
  9621. data[1] = newBitmask;
  9622. return data;
  9623. }
  9624. function nativeKeysIn(object) {
  9625. var result2 = [];
  9626. if (object != null) {
  9627. for (var key in Object2(object)) {
  9628. result2.push(key);
  9629. }
  9630. }
  9631. return result2;
  9632. }
  9633. function objectToString(value) {
  9634. return nativeObjectToString.call(value);
  9635. }
  9636. function overRest(func, start, transform2) {
  9637. start = nativeMax(start === undefined$1 ? func.length - 1 : start, 0);
  9638. return function() {
  9639. var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array2(length);
  9640. while (++index < length) {
  9641. array[index] = args[start + index];
  9642. }
  9643. index = -1;
  9644. var otherArgs = Array2(start + 1);
  9645. while (++index < start) {
  9646. otherArgs[index] = args[index];
  9647. }
  9648. otherArgs[start] = transform2(array);
  9649. return apply(func, this, otherArgs);
  9650. };
  9651. }
  9652. function parent(object, path) {
  9653. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  9654. }
  9655. function reorder(array, indexes) {
  9656. var arrLength = array.length, length = nativeMin(indexes.length, arrLength), oldArray = copyArray(array);
  9657. while (length--) {
  9658. var index = indexes[length];
  9659. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined$1;
  9660. }
  9661. return array;
  9662. }
  9663. function safeGet(object, key) {
  9664. if (key === "constructor" && typeof object[key] === "function") {
  9665. return;
  9666. }
  9667. if (key == "__proto__") {
  9668. return;
  9669. }
  9670. return object[key];
  9671. }
  9672. var setData = shortOut(baseSetData);
  9673. var setTimeout = ctxSetTimeout || function(func, wait) {
  9674. return root.setTimeout(func, wait);
  9675. };
  9676. var setToString = shortOut(baseSetToString);
  9677. function setWrapToString(wrapper, reference, bitmask) {
  9678. var source = reference + "";
  9679. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  9680. }
  9681. function shortOut(func) {
  9682. var count = 0, lastCalled = 0;
  9683. return function() {
  9684. var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
  9685. lastCalled = stamp;
  9686. if (remaining > 0) {
  9687. if (++count >= HOT_COUNT) {
  9688. return arguments[0];
  9689. }
  9690. } else {
  9691. count = 0;
  9692. }
  9693. return func.apply(undefined$1, arguments);
  9694. };
  9695. }
  9696. function shuffleSelf(array, size2) {
  9697. var index = -1, length = array.length, lastIndex = length - 1;
  9698. size2 = size2 === undefined$1 ? length : size2;
  9699. while (++index < size2) {
  9700. var rand = baseRandom(index, lastIndex), value = array[rand];
  9701. array[rand] = array[index];
  9702. array[index] = value;
  9703. }
  9704. array.length = size2;
  9705. return array;
  9706. }
  9707. var stringToPath = memoizeCapped(function(string) {
  9708. var result2 = [];
  9709. if (string.charCodeAt(0) === 46) {
  9710. result2.push("");
  9711. }
  9712. string.replace(rePropName, function(match, number, quote, subString) {
  9713. result2.push(quote ? subString.replace(reEscapeChar, "$1") : number || match);
  9714. });
  9715. return result2;
  9716. });
  9717. function toKey(value) {
  9718. if (typeof value == "string" || isSymbol(value)) {
  9719. return value;
  9720. }
  9721. var result2 = value + "";
  9722. return result2 == "0" && 1 / value == -INFINITY ? "-0" : result2;
  9723. }
  9724. function toSource(func) {
  9725. if (func != null) {
  9726. try {
  9727. return funcToString.call(func);
  9728. } catch (e) {
  9729. }
  9730. try {
  9731. return func + "";
  9732. } catch (e) {
  9733. }
  9734. }
  9735. return "";
  9736. }
  9737. function updateWrapDetails(details, bitmask) {
  9738. arrayEach(wrapFlags, function(pair) {
  9739. var value = "_." + pair[0];
  9740. if (bitmask & pair[1] && !arrayIncludes(details, value)) {
  9741. details.push(value);
  9742. }
  9743. });
  9744. return details.sort();
  9745. }
  9746. function wrapperClone(wrapper) {
  9747. if (wrapper instanceof LazyWrapper) {
  9748. return wrapper.clone();
  9749. }
  9750. var result2 = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  9751. result2.__actions__ = copyArray(wrapper.__actions__);
  9752. result2.__index__ = wrapper.__index__;
  9753. result2.__values__ = wrapper.__values__;
  9754. return result2;
  9755. }
  9756. function chunk(array, size2, guard) {
  9757. if (guard ? isIterateeCall(array, size2, guard) : size2 === undefined$1) {
  9758. size2 = 1;
  9759. } else {
  9760. size2 = nativeMax(toInteger(size2), 0);
  9761. }
  9762. var length = array == null ? 0 : array.length;
  9763. if (!length || size2 < 1) {
  9764. return [];
  9765. }
  9766. var index = 0, resIndex = 0, result2 = Array2(nativeCeil(length / size2));
  9767. while (index < length) {
  9768. result2[resIndex++] = baseSlice(array, index, index += size2);
  9769. }
  9770. return result2;
  9771. }
  9772. function compact(array) {
  9773. var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result2 = [];
  9774. while (++index < length) {
  9775. var value = array[index];
  9776. if (value) {
  9777. result2[resIndex++] = value;
  9778. }
  9779. }
  9780. return result2;
  9781. }
  9782. function concat() {
  9783. var length = arguments.length;
  9784. if (!length) {
  9785. return [];
  9786. }
  9787. var args = Array2(length - 1), array = arguments[0], index = length;
  9788. while (index--) {
  9789. args[index - 1] = arguments[index];
  9790. }
  9791. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  9792. }
  9793. var difference = baseRest(function(array, values2) {
  9794. return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values2, 1, isArrayLikeObject, true)) : [];
  9795. });
  9796. var differenceBy = baseRest(function(array, values2) {
  9797. var iteratee2 = last(values2);
  9798. if (isArrayLikeObject(iteratee2)) {
  9799. iteratee2 = undefined$1;
  9800. }
  9801. return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values2, 1, isArrayLikeObject, true), getIteratee(iteratee2, 2)) : [];
  9802. });
  9803. var differenceWith = baseRest(function(array, values2) {
  9804. var comparator = last(values2);
  9805. if (isArrayLikeObject(comparator)) {
  9806. comparator = undefined$1;
  9807. }
  9808. return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values2, 1, isArrayLikeObject, true), undefined$1, comparator) : [];
  9809. });
  9810. function drop(array, n, guard) {
  9811. var length = array == null ? 0 : array.length;
  9812. if (!length) {
  9813. return [];
  9814. }
  9815. n = guard || n === undefined$1 ? 1 : toInteger(n);
  9816. return baseSlice(array, n < 0 ? 0 : n, length);
  9817. }
  9818. function dropRight(array, n, guard) {
  9819. var length = array == null ? 0 : array.length;
  9820. if (!length) {
  9821. return [];
  9822. }
  9823. n = guard || n === undefined$1 ? 1 : toInteger(n);
  9824. n = length - n;
  9825. return baseSlice(array, 0, n < 0 ? 0 : n);
  9826. }
  9827. function dropRightWhile(array, predicate) {
  9828. return array && array.length ? baseWhile(array, getIteratee(predicate, 3), true, true) : [];
  9829. }
  9830. function dropWhile(array, predicate) {
  9831. return array && array.length ? baseWhile(array, getIteratee(predicate, 3), true) : [];
  9832. }
  9833. function fill(array, value, start, end) {
  9834. var length = array == null ? 0 : array.length;
  9835. if (!length) {
  9836. return [];
  9837. }
  9838. if (start && typeof start != "number" && isIterateeCall(array, value, start)) {
  9839. start = 0;
  9840. end = length;
  9841. }
  9842. return baseFill(array, value, start, end);
  9843. }
  9844. function findIndex(array, predicate, fromIndex) {
  9845. var length = array == null ? 0 : array.length;
  9846. if (!length) {
  9847. return -1;
  9848. }
  9849. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  9850. if (index < 0) {
  9851. index = nativeMax(length + index, 0);
  9852. }
  9853. return baseFindIndex(array, getIteratee(predicate, 3), index);
  9854. }
  9855. function findLastIndex(array, predicate, fromIndex) {
  9856. var length = array == null ? 0 : array.length;
  9857. if (!length) {
  9858. return -1;
  9859. }
  9860. var index = length - 1;
  9861. if (fromIndex !== undefined$1) {
  9862. index = toInteger(fromIndex);
  9863. index = fromIndex < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  9864. }
  9865. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  9866. }
  9867. function flatten(array) {
  9868. var length = array == null ? 0 : array.length;
  9869. return length ? baseFlatten(array, 1) : [];
  9870. }
  9871. function flattenDeep(array) {
  9872. var length = array == null ? 0 : array.length;
  9873. return length ? baseFlatten(array, INFINITY) : [];
  9874. }
  9875. function flattenDepth(array, depth) {
  9876. var length = array == null ? 0 : array.length;
  9877. if (!length) {
  9878. return [];
  9879. }
  9880. depth = depth === undefined$1 ? 1 : toInteger(depth);
  9881. return baseFlatten(array, depth);
  9882. }
  9883. function fromPairs(pairs) {
  9884. var index = -1, length = pairs == null ? 0 : pairs.length, result2 = {};
  9885. while (++index < length) {
  9886. var pair = pairs[index];
  9887. result2[pair[0]] = pair[1];
  9888. }
  9889. return result2;
  9890. }
  9891. function head(array) {
  9892. return array && array.length ? array[0] : undefined$1;
  9893. }
  9894. function indexOf(array, value, fromIndex) {
  9895. var length = array == null ? 0 : array.length;
  9896. if (!length) {
  9897. return -1;
  9898. }
  9899. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  9900. if (index < 0) {
  9901. index = nativeMax(length + index, 0);
  9902. }
  9903. return baseIndexOf(array, value, index);
  9904. }
  9905. function initial(array) {
  9906. var length = array == null ? 0 : array.length;
  9907. return length ? baseSlice(array, 0, -1) : [];
  9908. }
  9909. var intersection = baseRest(function(arrays) {
  9910. var mapped = arrayMap(arrays, castArrayLikeObject);
  9911. return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped) : [];
  9912. });
  9913. var intersectionBy = baseRest(function(arrays) {
  9914. var iteratee2 = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject);
  9915. if (iteratee2 === last(mapped)) {
  9916. iteratee2 = undefined$1;
  9917. } else {
  9918. mapped.pop();
  9919. }
  9920. return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, getIteratee(iteratee2, 2)) : [];
  9921. });
  9922. var intersectionWith = baseRest(function(arrays) {
  9923. var comparator = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject);
  9924. comparator = typeof comparator == "function" ? comparator : undefined$1;
  9925. if (comparator) {
  9926. mapped.pop();
  9927. }
  9928. return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, undefined$1, comparator) : [];
  9929. });
  9930. function join(array, separator) {
  9931. return array == null ? "" : nativeJoin.call(array, separator);
  9932. }
  9933. function last(array) {
  9934. var length = array == null ? 0 : array.length;
  9935. return length ? array[length - 1] : undefined$1;
  9936. }
  9937. function lastIndexOf(array, value, fromIndex) {
  9938. var length = array == null ? 0 : array.length;
  9939. if (!length) {
  9940. return -1;
  9941. }
  9942. var index = length;
  9943. if (fromIndex !== undefined$1) {
  9944. index = toInteger(fromIndex);
  9945. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  9946. }
  9947. return value === value ? strictLastIndexOf(array, value, index) : baseFindIndex(array, baseIsNaN, index, true);
  9948. }
  9949. function nth(array, n) {
  9950. return array && array.length ? baseNth(array, toInteger(n)) : undefined$1;
  9951. }
  9952. var pull = baseRest(pullAll);
  9953. function pullAll(array, values2) {
  9954. return array && array.length && values2 && values2.length ? basePullAll(array, values2) : array;
  9955. }
  9956. function pullAllBy(array, values2, iteratee2) {
  9957. return array && array.length && values2 && values2.length ? basePullAll(array, values2, getIteratee(iteratee2, 2)) : array;
  9958. }
  9959. function pullAllWith(array, values2, comparator) {
  9960. return array && array.length && values2 && values2.length ? basePullAll(array, values2, undefined$1, comparator) : array;
  9961. }
  9962. var pullAt = flatRest(function(array, indexes) {
  9963. var length = array == null ? 0 : array.length, result2 = baseAt(array, indexes);
  9964. basePullAt(array, arrayMap(indexes, function(index) {
  9965. return isIndex(index, length) ? +index : index;
  9966. }).sort(compareAscending));
  9967. return result2;
  9968. });
  9969. function remove(array, predicate) {
  9970. var result2 = [];
  9971. if (!(array && array.length)) {
  9972. return result2;
  9973. }
  9974. var index = -1, indexes = [], length = array.length;
  9975. predicate = getIteratee(predicate, 3);
  9976. while (++index < length) {
  9977. var value = array[index];
  9978. if (predicate(value, index, array)) {
  9979. result2.push(value);
  9980. indexes.push(index);
  9981. }
  9982. }
  9983. basePullAt(array, indexes);
  9984. return result2;
  9985. }
  9986. function reverse(array) {
  9987. return array == null ? array : nativeReverse.call(array);
  9988. }
  9989. function slice(array, start, end) {
  9990. var length = array == null ? 0 : array.length;
  9991. if (!length) {
  9992. return [];
  9993. }
  9994. if (end && typeof end != "number" && isIterateeCall(array, start, end)) {
  9995. start = 0;
  9996. end = length;
  9997. } else {
  9998. start = start == null ? 0 : toInteger(start);
  9999. end = end === undefined$1 ? length : toInteger(end);
  10000. }
  10001. return baseSlice(array, start, end);
  10002. }
  10003. function sortedIndex(array, value) {
  10004. return baseSortedIndex(array, value);
  10005. }
  10006. function sortedIndexBy(array, value, iteratee2) {
  10007. return baseSortedIndexBy(array, value, getIteratee(iteratee2, 2));
  10008. }
  10009. function sortedIndexOf(array, value) {
  10010. var length = array == null ? 0 : array.length;
  10011. if (length) {
  10012. var index = baseSortedIndex(array, value);
  10013. if (index < length && eq(array[index], value)) {
  10014. return index;
  10015. }
  10016. }
  10017. return -1;
  10018. }
  10019. function sortedLastIndex(array, value) {
  10020. return baseSortedIndex(array, value, true);
  10021. }
  10022. function sortedLastIndexBy(array, value, iteratee2) {
  10023. return baseSortedIndexBy(array, value, getIteratee(iteratee2, 2), true);
  10024. }
  10025. function sortedLastIndexOf(array, value) {
  10026. var length = array == null ? 0 : array.length;
  10027. if (length) {
  10028. var index = baseSortedIndex(array, value, true) - 1;
  10029. if (eq(array[index], value)) {
  10030. return index;
  10031. }
  10032. }
  10033. return -1;
  10034. }
  10035. function sortedUniq(array) {
  10036. return array && array.length ? baseSortedUniq(array) : [];
  10037. }
  10038. function sortedUniqBy(array, iteratee2) {
  10039. return array && array.length ? baseSortedUniq(array, getIteratee(iteratee2, 2)) : [];
  10040. }
  10041. function tail(array) {
  10042. var length = array == null ? 0 : array.length;
  10043. return length ? baseSlice(array, 1, length) : [];
  10044. }
  10045. function take(array, n, guard) {
  10046. if (!(array && array.length)) {
  10047. return [];
  10048. }
  10049. n = guard || n === undefined$1 ? 1 : toInteger(n);
  10050. return baseSlice(array, 0, n < 0 ? 0 : n);
  10051. }
  10052. function takeRight(array, n, guard) {
  10053. var length = array == null ? 0 : array.length;
  10054. if (!length) {
  10055. return [];
  10056. }
  10057. n = guard || n === undefined$1 ? 1 : toInteger(n);
  10058. n = length - n;
  10059. return baseSlice(array, n < 0 ? 0 : n, length);
  10060. }
  10061. function takeRightWhile(array, predicate) {
  10062. return array && array.length ? baseWhile(array, getIteratee(predicate, 3), false, true) : [];
  10063. }
  10064. function takeWhile(array, predicate) {
  10065. return array && array.length ? baseWhile(array, getIteratee(predicate, 3)) : [];
  10066. }
  10067. var union = baseRest(function(arrays) {
  10068. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  10069. });
  10070. var unionBy = baseRest(function(arrays) {
  10071. var iteratee2 = last(arrays);
  10072. if (isArrayLikeObject(iteratee2)) {
  10073. iteratee2 = undefined$1;
  10074. }
  10075. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee2, 2));
  10076. });
  10077. var unionWith = baseRest(function(arrays) {
  10078. var comparator = last(arrays);
  10079. comparator = typeof comparator == "function" ? comparator : undefined$1;
  10080. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined$1, comparator);
  10081. });
  10082. function uniq(array) {
  10083. return array && array.length ? baseUniq(array) : [];
  10084. }
  10085. function uniqBy(array, iteratee2) {
  10086. return array && array.length ? baseUniq(array, getIteratee(iteratee2, 2)) : [];
  10087. }
  10088. function uniqWith(array, comparator) {
  10089. comparator = typeof comparator == "function" ? comparator : undefined$1;
  10090. return array && array.length ? baseUniq(array, undefined$1, comparator) : [];
  10091. }
  10092. function unzip(array) {
  10093. if (!(array && array.length)) {
  10094. return [];
  10095. }
  10096. var length = 0;
  10097. array = arrayFilter(array, function(group) {
  10098. if (isArrayLikeObject(group)) {
  10099. length = nativeMax(group.length, length);
  10100. return true;
  10101. }
  10102. });
  10103. return baseTimes(length, function(index) {
  10104. return arrayMap(array, baseProperty(index));
  10105. });
  10106. }
  10107. function unzipWith(array, iteratee2) {
  10108. if (!(array && array.length)) {
  10109. return [];
  10110. }
  10111. var result2 = unzip(array);
  10112. if (iteratee2 == null) {
  10113. return result2;
  10114. }
  10115. return arrayMap(result2, function(group) {
  10116. return apply(iteratee2, undefined$1, group);
  10117. });
  10118. }
  10119. var without = baseRest(function(array, values2) {
  10120. return isArrayLikeObject(array) ? baseDifference(array, values2) : [];
  10121. });
  10122. var xor = baseRest(function(arrays) {
  10123. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  10124. });
  10125. var xorBy = baseRest(function(arrays) {
  10126. var iteratee2 = last(arrays);
  10127. if (isArrayLikeObject(iteratee2)) {
  10128. iteratee2 = undefined$1;
  10129. }
  10130. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee2, 2));
  10131. });
  10132. var xorWith = baseRest(function(arrays) {
  10133. var comparator = last(arrays);
  10134. comparator = typeof comparator == "function" ? comparator : undefined$1;
  10135. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined$1, comparator);
  10136. });
  10137. var zip = baseRest(unzip);
  10138. function zipObject(props, values2) {
  10139. return baseZipObject(props || [], values2 || [], assignValue);
  10140. }
  10141. function zipObjectDeep(props, values2) {
  10142. return baseZipObject(props || [], values2 || [], baseSet);
  10143. }
  10144. var zipWith = baseRest(function(arrays) {
  10145. var length = arrays.length, iteratee2 = length > 1 ? arrays[length - 1] : undefined$1;
  10146. iteratee2 = typeof iteratee2 == "function" ? (arrays.pop(), iteratee2) : undefined$1;
  10147. return unzipWith(arrays, iteratee2);
  10148. });
  10149. function chain(value) {
  10150. var result2 = lodash2(value);
  10151. result2.__chain__ = true;
  10152. return result2;
  10153. }
  10154. function tap(value, interceptor) {
  10155. interceptor(value);
  10156. return value;
  10157. }
  10158. function thru(value, interceptor) {
  10159. return interceptor(value);
  10160. }
  10161. var wrapperAt = flatRest(function(paths) {
  10162. var length = paths.length, start = length ? paths[0] : 0, value = this.__wrapped__, interceptor = function(object) {
  10163. return baseAt(object, paths);
  10164. };
  10165. if (length > 1 || this.__actions__.length || !(value instanceof LazyWrapper) || !isIndex(start)) {
  10166. return this.thru(interceptor);
  10167. }
  10168. value = value.slice(start, +start + (length ? 1 : 0));
  10169. value.__actions__.push({
  10170. "func": thru,
  10171. "args": [interceptor],
  10172. "thisArg": undefined$1
  10173. });
  10174. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  10175. if (length && !array.length) {
  10176. array.push(undefined$1);
  10177. }
  10178. return array;
  10179. });
  10180. });
  10181. function wrapperChain() {
  10182. return chain(this);
  10183. }
  10184. function wrapperCommit() {
  10185. return new LodashWrapper(this.value(), this.__chain__);
  10186. }
  10187. function wrapperNext() {
  10188. if (this.__values__ === undefined$1) {
  10189. this.__values__ = toArray(this.value());
  10190. }
  10191. var done = this.__index__ >= this.__values__.length, value = done ? undefined$1 : this.__values__[this.__index__++];
  10192. return { "done": done, "value": value };
  10193. }
  10194. function wrapperToIterator() {
  10195. return this;
  10196. }
  10197. function wrapperPlant(value) {
  10198. var result2, parent2 = this;
  10199. while (parent2 instanceof baseLodash) {
  10200. var clone2 = wrapperClone(parent2);
  10201. clone2.__index__ = 0;
  10202. clone2.__values__ = undefined$1;
  10203. if (result2) {
  10204. previous.__wrapped__ = clone2;
  10205. } else {
  10206. result2 = clone2;
  10207. }
  10208. var previous = clone2;
  10209. parent2 = parent2.__wrapped__;
  10210. }
  10211. previous.__wrapped__ = value;
  10212. return result2;
  10213. }
  10214. function wrapperReverse() {
  10215. var value = this.__wrapped__;
  10216. if (value instanceof LazyWrapper) {
  10217. var wrapped = value;
  10218. if (this.__actions__.length) {
  10219. wrapped = new LazyWrapper(this);
  10220. }
  10221. wrapped = wrapped.reverse();
  10222. wrapped.__actions__.push({
  10223. "func": thru,
  10224. "args": [reverse],
  10225. "thisArg": undefined$1
  10226. });
  10227. return new LodashWrapper(wrapped, this.__chain__);
  10228. }
  10229. return this.thru(reverse);
  10230. }
  10231. function wrapperValue() {
  10232. return baseWrapperValue(this.__wrapped__, this.__actions__);
  10233. }
  10234. var countBy = createAggregator(function(result2, value, key) {
  10235. if (hasOwnProperty.call(result2, key)) {
  10236. ++result2[key];
  10237. } else {
  10238. baseAssignValue(result2, key, 1);
  10239. }
  10240. });
  10241. function every(collection, predicate, guard) {
  10242. var func = isArray(collection) ? arrayEvery : baseEvery;
  10243. if (guard && isIterateeCall(collection, predicate, guard)) {
  10244. predicate = undefined$1;
  10245. }
  10246. return func(collection, getIteratee(predicate, 3));
  10247. }
  10248. function filter(collection, predicate) {
  10249. var func = isArray(collection) ? arrayFilter : baseFilter;
  10250. return func(collection, getIteratee(predicate, 3));
  10251. }
  10252. var find = createFind(findIndex);
  10253. var findLast = createFind(findLastIndex);
  10254. function flatMap(collection, iteratee2) {
  10255. return baseFlatten(map(collection, iteratee2), 1);
  10256. }
  10257. function flatMapDeep(collection, iteratee2) {
  10258. return baseFlatten(map(collection, iteratee2), INFINITY);
  10259. }
  10260. function flatMapDepth(collection, iteratee2, depth) {
  10261. depth = depth === undefined$1 ? 1 : toInteger(depth);
  10262. return baseFlatten(map(collection, iteratee2), depth);
  10263. }
  10264. function forEach(collection, iteratee2) {
  10265. var func = isArray(collection) ? arrayEach : baseEach;
  10266. return func(collection, getIteratee(iteratee2, 3));
  10267. }
  10268. function forEachRight(collection, iteratee2) {
  10269. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  10270. return func(collection, getIteratee(iteratee2, 3));
  10271. }
  10272. var groupBy = createAggregator(function(result2, value, key) {
  10273. if (hasOwnProperty.call(result2, key)) {
  10274. result2[key].push(value);
  10275. } else {
  10276. baseAssignValue(result2, key, [value]);
  10277. }
  10278. });
  10279. function includes(collection, value, fromIndex, guard) {
  10280. collection = isArrayLike(collection) ? collection : values(collection);
  10281. fromIndex = fromIndex && !guard ? toInteger(fromIndex) : 0;
  10282. var length = collection.length;
  10283. if (fromIndex < 0) {
  10284. fromIndex = nativeMax(length + fromIndex, 0);
  10285. }
  10286. return isString(collection) ? fromIndex <= length && collection.indexOf(value, fromIndex) > -1 : !!length && baseIndexOf(collection, value, fromIndex) > -1;
  10287. }
  10288. var invokeMap = baseRest(function(collection, path, args) {
  10289. var index = -1, isFunc = typeof path == "function", result2 = isArrayLike(collection) ? Array2(collection.length) : [];
  10290. baseEach(collection, function(value) {
  10291. result2[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  10292. });
  10293. return result2;
  10294. });
  10295. var keyBy = createAggregator(function(result2, value, key) {
  10296. baseAssignValue(result2, key, value);
  10297. });
  10298. function map(collection, iteratee2) {
  10299. var func = isArray(collection) ? arrayMap : baseMap;
  10300. return func(collection, getIteratee(iteratee2, 3));
  10301. }
  10302. function orderBy(collection, iteratees, orders, guard) {
  10303. if (collection == null) {
  10304. return [];
  10305. }
  10306. if (!isArray(iteratees)) {
  10307. iteratees = iteratees == null ? [] : [iteratees];
  10308. }
  10309. orders = guard ? undefined$1 : orders;
  10310. if (!isArray(orders)) {
  10311. orders = orders == null ? [] : [orders];
  10312. }
  10313. return baseOrderBy(collection, iteratees, orders);
  10314. }
  10315. var partition = createAggregator(function(result2, value, key) {
  10316. result2[key ? 0 : 1].push(value);
  10317. }, function() {
  10318. return [[], []];
  10319. });
  10320. function reduce(collection, iteratee2, accumulator) {
  10321. var func = isArray(collection) ? arrayReduce : baseReduce, initAccum = arguments.length < 3;
  10322. return func(collection, getIteratee(iteratee2, 4), accumulator, initAccum, baseEach);
  10323. }
  10324. function reduceRight(collection, iteratee2, accumulator) {
  10325. var func = isArray(collection) ? arrayReduceRight : baseReduce, initAccum = arguments.length < 3;
  10326. return func(collection, getIteratee(iteratee2, 4), accumulator, initAccum, baseEachRight);
  10327. }
  10328. function reject(collection, predicate) {
  10329. var func = isArray(collection) ? arrayFilter : baseFilter;
  10330. return func(collection, negate(getIteratee(predicate, 3)));
  10331. }
  10332. function sample(collection) {
  10333. var func = isArray(collection) ? arraySample : baseSample;
  10334. return func(collection);
  10335. }
  10336. function sampleSize(collection, n, guard) {
  10337. if (guard ? isIterateeCall(collection, n, guard) : n === undefined$1) {
  10338. n = 1;
  10339. } else {
  10340. n = toInteger(n);
  10341. }
  10342. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10343. return func(collection, n);
  10344. }
  10345. function shuffle(collection) {
  10346. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10347. return func(collection);
  10348. }
  10349. function size(collection) {
  10350. if (collection == null) {
  10351. return 0;
  10352. }
  10353. if (isArrayLike(collection)) {
  10354. return isString(collection) ? stringSize(collection) : collection.length;
  10355. }
  10356. var tag = getTag(collection);
  10357. if (tag == mapTag || tag == setTag) {
  10358. return collection.size;
  10359. }
  10360. return baseKeys(collection).length;
  10361. }
  10362. function some(collection, predicate, guard) {
  10363. var func = isArray(collection) ? arraySome : baseSome;
  10364. if (guard && isIterateeCall(collection, predicate, guard)) {
  10365. predicate = undefined$1;
  10366. }
  10367. return func(collection, getIteratee(predicate, 3));
  10368. }
  10369. var sortBy = baseRest(function(collection, iteratees) {
  10370. if (collection == null) {
  10371. return [];
  10372. }
  10373. var length = iteratees.length;
  10374. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10375. iteratees = [];
  10376. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10377. iteratees = [iteratees[0]];
  10378. }
  10379. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10380. });
  10381. var now = ctxNow || function() {
  10382. return root.Date.now();
  10383. };
  10384. function after(n, func) {
  10385. if (typeof func != "function") {
  10386. throw new TypeError2(FUNC_ERROR_TEXT);
  10387. }
  10388. n = toInteger(n);
  10389. return function() {
  10390. if (--n < 1) {
  10391. return func.apply(this, arguments);
  10392. }
  10393. };
  10394. }
  10395. function ary(func, n, guard) {
  10396. n = guard ? undefined$1 : n;
  10397. n = func && n == null ? func.length : n;
  10398. return createWrap(func, WRAP_ARY_FLAG, undefined$1, undefined$1, undefined$1, undefined$1, n);
  10399. }
  10400. function before(n, func) {
  10401. var result2;
  10402. if (typeof func != "function") {
  10403. throw new TypeError2(FUNC_ERROR_TEXT);
  10404. }
  10405. n = toInteger(n);
  10406. return function() {
  10407. if (--n > 0) {
  10408. result2 = func.apply(this, arguments);
  10409. }
  10410. if (n <= 1) {
  10411. func = undefined$1;
  10412. }
  10413. return result2;
  10414. };
  10415. }
  10416. var bind = baseRest(function(func, thisArg, partials) {
  10417. var bitmask = WRAP_BIND_FLAG;
  10418. if (partials.length) {
  10419. var holders = replaceHolders(partials, getHolder(bind));
  10420. bitmask |= WRAP_PARTIAL_FLAG;
  10421. }
  10422. return createWrap(func, bitmask, thisArg, partials, holders);
  10423. });
  10424. var bindKey = baseRest(function(object, key, partials) {
  10425. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10426. if (partials.length) {
  10427. var holders = replaceHolders(partials, getHolder(bindKey));
  10428. bitmask |= WRAP_PARTIAL_FLAG;
  10429. }
  10430. return createWrap(key, bitmask, object, partials, holders);
  10431. });
  10432. function curry(func, arity, guard) {
  10433. arity = guard ? undefined$1 : arity;
  10434. var result2 = createWrap(func, WRAP_CURRY_FLAG, undefined$1, undefined$1, undefined$1, undefined$1, undefined$1, arity);
  10435. result2.placeholder = curry.placeholder;
  10436. return result2;
  10437. }
  10438. function curryRight(func, arity, guard) {
  10439. arity = guard ? undefined$1 : arity;
  10440. var result2 = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined$1, undefined$1, undefined$1, undefined$1, undefined$1, arity);
  10441. result2.placeholder = curryRight.placeholder;
  10442. return result2;
  10443. }
  10444. function debounce(func, wait, options) {
  10445. var lastArgs, lastThis, maxWait, result2, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
  10446. if (typeof func != "function") {
  10447. throw new TypeError2(FUNC_ERROR_TEXT);
  10448. }
  10449. wait = toNumber(wait) || 0;
  10450. if (isObject(options)) {
  10451. leading = !!options.leading;
  10452. maxing = "maxWait" in options;
  10453. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10454. trailing = "trailing" in options ? !!options.trailing : trailing;
  10455. }
  10456. function invokeFunc(time) {
  10457. var args = lastArgs, thisArg = lastThis;
  10458. lastArgs = lastThis = undefined$1;
  10459. lastInvokeTime = time;
  10460. result2 = func.apply(thisArg, args);
  10461. return result2;
  10462. }
  10463. function leadingEdge(time) {
  10464. lastInvokeTime = time;
  10465. timerId = setTimeout(timerExpired, wait);
  10466. return leading ? invokeFunc(time) : result2;
  10467. }
  10468. function remainingWait(time) {
  10469. var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
  10470. return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
  10471. }
  10472. function shouldInvoke(time) {
  10473. var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
  10474. return lastCallTime === undefined$1 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
  10475. }
  10476. function timerExpired() {
  10477. var time = now();
  10478. if (shouldInvoke(time)) {
  10479. return trailingEdge(time);
  10480. }
  10481. timerId = setTimeout(timerExpired, remainingWait(time));
  10482. }
  10483. function trailingEdge(time) {
  10484. timerId = undefined$1;
  10485. if (trailing && lastArgs) {
  10486. return invokeFunc(time);
  10487. }
  10488. lastArgs = lastThis = undefined$1;
  10489. return result2;
  10490. }
  10491. function cancel() {
  10492. if (timerId !== undefined$1) {
  10493. clearTimeout(timerId);
  10494. }
  10495. lastInvokeTime = 0;
  10496. lastArgs = lastCallTime = lastThis = timerId = undefined$1;
  10497. }
  10498. function flush() {
  10499. return timerId === undefined$1 ? result2 : trailingEdge(now());
  10500. }
  10501. function debounced() {
  10502. var time = now(), isInvoking = shouldInvoke(time);
  10503. lastArgs = arguments;
  10504. lastThis = this;
  10505. lastCallTime = time;
  10506. if (isInvoking) {
  10507. if (timerId === undefined$1) {
  10508. return leadingEdge(lastCallTime);
  10509. }
  10510. if (maxing) {
  10511. clearTimeout(timerId);
  10512. timerId = setTimeout(timerExpired, wait);
  10513. return invokeFunc(lastCallTime);
  10514. }
  10515. }
  10516. if (timerId === undefined$1) {
  10517. timerId = setTimeout(timerExpired, wait);
  10518. }
  10519. return result2;
  10520. }
  10521. debounced.cancel = cancel;
  10522. debounced.flush = flush;
  10523. return debounced;
  10524. }
  10525. var defer = baseRest(function(func, args) {
  10526. return baseDelay(func, 1, args);
  10527. });
  10528. var delay = baseRest(function(func, wait, args) {
  10529. return baseDelay(func, toNumber(wait) || 0, args);
  10530. });
  10531. function flip(func) {
  10532. return createWrap(func, WRAP_FLIP_FLAG);
  10533. }
  10534. function memoize(func, resolver) {
  10535. if (typeof func != "function" || resolver != null && typeof resolver != "function") {
  10536. throw new TypeError2(FUNC_ERROR_TEXT);
  10537. }
  10538. var memoized = function() {
  10539. var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
  10540. if (cache.has(key)) {
  10541. return cache.get(key);
  10542. }
  10543. var result2 = func.apply(this, args);
  10544. memoized.cache = cache.set(key, result2) || cache;
  10545. return result2;
  10546. };
  10547. memoized.cache = new (memoize.Cache || MapCache)();
  10548. return memoized;
  10549. }
  10550. memoize.Cache = MapCache;
  10551. function negate(predicate) {
  10552. if (typeof predicate != "function") {
  10553. throw new TypeError2(FUNC_ERROR_TEXT);
  10554. }
  10555. return function() {
  10556. var args = arguments;
  10557. switch (args.length) {
  10558. case 0:
  10559. return !predicate.call(this);
  10560. case 1:
  10561. return !predicate.call(this, args[0]);
  10562. case 2:
  10563. return !predicate.call(this, args[0], args[1]);
  10564. case 3:
  10565. return !predicate.call(this, args[0], args[1], args[2]);
  10566. }
  10567. return !predicate.apply(this, args);
  10568. };
  10569. }
  10570. function once(func) {
  10571. return before(2, func);
  10572. }
  10573. var overArgs = castRest(function(func, transforms) {
  10574. transforms = transforms.length == 1 && isArray(transforms[0]) ? arrayMap(transforms[0], baseUnary(getIteratee())) : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  10575. var funcsLength = transforms.length;
  10576. return baseRest(function(args) {
  10577. var index = -1, length = nativeMin(args.length, funcsLength);
  10578. while (++index < length) {
  10579. args[index] = transforms[index].call(this, args[index]);
  10580. }
  10581. return apply(func, this, args);
  10582. });
  10583. });
  10584. var partial = baseRest(function(func, partials) {
  10585. var holders = replaceHolders(partials, getHolder(partial));
  10586. return createWrap(func, WRAP_PARTIAL_FLAG, undefined$1, partials, holders);
  10587. });
  10588. var partialRight = baseRest(function(func, partials) {
  10589. var holders = replaceHolders(partials, getHolder(partialRight));
  10590. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined$1, partials, holders);
  10591. });
  10592. var rearg = flatRest(function(func, indexes) {
  10593. return createWrap(func, WRAP_REARG_FLAG, undefined$1, undefined$1, undefined$1, indexes);
  10594. });
  10595. function rest(func, start) {
  10596. if (typeof func != "function") {
  10597. throw new TypeError2(FUNC_ERROR_TEXT);
  10598. }
  10599. start = start === undefined$1 ? start : toInteger(start);
  10600. return baseRest(func, start);
  10601. }
  10602. function spread(func, start) {
  10603. if (typeof func != "function") {
  10604. throw new TypeError2(FUNC_ERROR_TEXT);
  10605. }
  10606. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  10607. return baseRest(function(args) {
  10608. var array = args[start], otherArgs = castSlice(args, 0, start);
  10609. if (array) {
  10610. arrayPush(otherArgs, array);
  10611. }
  10612. return apply(func, this, otherArgs);
  10613. });
  10614. }
  10615. function throttle(func, wait, options) {
  10616. var leading = true, trailing = true;
  10617. if (typeof func != "function") {
  10618. throw new TypeError2(FUNC_ERROR_TEXT);
  10619. }
  10620. if (isObject(options)) {
  10621. leading = "leading" in options ? !!options.leading : leading;
  10622. trailing = "trailing" in options ? !!options.trailing : trailing;
  10623. }
  10624. return debounce(func, wait, {
  10625. "leading": leading,
  10626. "maxWait": wait,
  10627. "trailing": trailing
  10628. });
  10629. }
  10630. function unary(func) {
  10631. return ary(func, 1);
  10632. }
  10633. function wrap(value, wrapper) {
  10634. return partial(castFunction(wrapper), value);
  10635. }
  10636. function castArray() {
  10637. if (!arguments.length) {
  10638. return [];
  10639. }
  10640. var value = arguments[0];
  10641. return isArray(value) ? value : [value];
  10642. }
  10643. function clone(value) {
  10644. return baseClone(value, CLONE_SYMBOLS_FLAG);
  10645. }
  10646. function cloneWith(value, customizer) {
  10647. customizer = typeof customizer == "function" ? customizer : undefined$1;
  10648. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  10649. }
  10650. function cloneDeep(value) {
  10651. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  10652. }
  10653. function cloneDeepWith(value, customizer) {
  10654. customizer = typeof customizer == "function" ? customizer : undefined$1;
  10655. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  10656. }
  10657. function conformsTo(object, source) {
  10658. return source == null || baseConformsTo(object, source, keys(source));
  10659. }
  10660. function eq(value, other) {
  10661. return value === other || value !== value && other !== other;
  10662. }
  10663. var gt = createRelationalOperation(baseGt);
  10664. var gte = createRelationalOperation(function(value, other) {
  10665. return value >= other;
  10666. });
  10667. var isArguments = baseIsArguments(function() {
  10668. return arguments;
  10669. }()) ? baseIsArguments : function(value) {
  10670. return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
  10671. };
  10672. var isArray = Array2.isArray;
  10673. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  10674. function isArrayLike(value) {
  10675. return value != null && isLength(value.length) && !isFunction(value);
  10676. }
  10677. function isArrayLikeObject(value) {
  10678. return isObjectLike(value) && isArrayLike(value);
  10679. }
  10680. function isBoolean(value) {
  10681. return value === true || value === false || isObjectLike(value) && baseGetTag(value) == boolTag;
  10682. }
  10683. var isBuffer = nativeIsBuffer || stubFalse;
  10684. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  10685. function isElement(value) {
  10686. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  10687. }
  10688. function isEmpty(value) {
  10689. if (value == null) {
  10690. return true;
  10691. }
  10692. if (isArrayLike(value) && (isArray(value) || typeof value == "string" || typeof value.splice == "function" || isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  10693. return !value.length;
  10694. }
  10695. var tag = getTag(value);
  10696. if (tag == mapTag || tag == setTag) {
  10697. return !value.size;
  10698. }
  10699. if (isPrototype(value)) {
  10700. return !baseKeys(value).length;
  10701. }
  10702. for (var key in value) {
  10703. if (hasOwnProperty.call(value, key)) {
  10704. return false;
  10705. }
  10706. }
  10707. return true;
  10708. }
  10709. function isEqual(value, other) {
  10710. return baseIsEqual(value, other);
  10711. }
  10712. function isEqualWith(value, other, customizer) {
  10713. customizer = typeof customizer == "function" ? customizer : undefined$1;
  10714. var result2 = customizer ? customizer(value, other) : undefined$1;
  10715. return result2 === undefined$1 ? baseIsEqual(value, other, undefined$1, customizer) : !!result2;
  10716. }
  10717. function isError(value) {
  10718. if (!isObjectLike(value)) {
  10719. return false;
  10720. }
  10721. var tag = baseGetTag(value);
  10722. return tag == errorTag || tag == domExcTag || typeof value.message == "string" && typeof value.name == "string" && !isPlainObject(value);
  10723. }
  10724. function isFinite2(value) {
  10725. return typeof value == "number" && nativeIsFinite(value);
  10726. }
  10727. function isFunction(value) {
  10728. if (!isObject(value)) {
  10729. return false;
  10730. }
  10731. var tag = baseGetTag(value);
  10732. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  10733. }
  10734. function isInteger(value) {
  10735. return typeof value == "number" && value == toInteger(value);
  10736. }
  10737. function isLength(value) {
  10738. return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  10739. }
  10740. function isObject(value) {
  10741. var type = typeof value;
  10742. return value != null && (type == "object" || type == "function");
  10743. }
  10744. function isObjectLike(value) {
  10745. return value != null && typeof value == "object";
  10746. }
  10747. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  10748. function isMatch(object, source) {
  10749. return object === source || baseIsMatch(object, source, getMatchData(source));
  10750. }
  10751. function isMatchWith(object, source, customizer) {
  10752. customizer = typeof customizer == "function" ? customizer : undefined$1;
  10753. return baseIsMatch(object, source, getMatchData(source), customizer);
  10754. }
  10755. function isNaN2(value) {
  10756. return isNumber(value) && value != +value;
  10757. }
  10758. function isNative(value) {
  10759. if (isMaskable(value)) {
  10760. throw new Error2(CORE_ERROR_TEXT);
  10761. }
  10762. return baseIsNative(value);
  10763. }
  10764. function isNull(value) {
  10765. return value === null;
  10766. }
  10767. function isNil(value) {
  10768. return value == null;
  10769. }
  10770. function isNumber(value) {
  10771. return typeof value == "number" || isObjectLike(value) && baseGetTag(value) == numberTag;
  10772. }
  10773. function isPlainObject(value) {
  10774. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  10775. return false;
  10776. }
  10777. var proto = getPrototype(value);
  10778. if (proto === null) {
  10779. return true;
  10780. }
  10781. var Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor;
  10782. return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
  10783. }
  10784. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  10785. function isSafeInteger(value) {
  10786. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  10787. }
  10788. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  10789. function isString(value) {
  10790. return typeof value == "string" || !isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag;
  10791. }
  10792. function isSymbol(value) {
  10793. return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag;
  10794. }
  10795. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  10796. function isUndefined(value) {
  10797. return value === undefined$1;
  10798. }
  10799. function isWeakMap(value) {
  10800. return isObjectLike(value) && getTag(value) == weakMapTag;
  10801. }
  10802. function isWeakSet(value) {
  10803. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  10804. }
  10805. var lt = createRelationalOperation(baseLt);
  10806. var lte = createRelationalOperation(function(value, other) {
  10807. return value <= other;
  10808. });
  10809. function toArray(value) {
  10810. if (!value) {
  10811. return [];
  10812. }
  10813. if (isArrayLike(value)) {
  10814. return isString(value) ? stringToArray(value) : copyArray(value);
  10815. }
  10816. if (symIterator && value[symIterator]) {
  10817. return iteratorToArray(value[symIterator]());
  10818. }
  10819. var tag = getTag(value), func = tag == mapTag ? mapToArray : tag == setTag ? setToArray : values;
  10820. return func(value);
  10821. }
  10822. function toFinite(value) {
  10823. if (!value) {
  10824. return value === 0 ? value : 0;
  10825. }
  10826. value = toNumber(value);
  10827. if (value === INFINITY || value === -INFINITY) {
  10828. var sign = value < 0 ? -1 : 1;
  10829. return sign * MAX_INTEGER;
  10830. }
  10831. return value === value ? value : 0;
  10832. }
  10833. function toInteger(value) {
  10834. var result2 = toFinite(value), remainder = result2 % 1;
  10835. return result2 === result2 ? remainder ? result2 - remainder : result2 : 0;
  10836. }
  10837. function toLength(value) {
  10838. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  10839. }
  10840. function toNumber(value) {
  10841. if (typeof value == "number") {
  10842. return value;
  10843. }
  10844. if (isSymbol(value)) {
  10845. return NAN;
  10846. }
  10847. if (isObject(value)) {
  10848. var other = typeof value.valueOf == "function" ? value.valueOf() : value;
  10849. value = isObject(other) ? other + "" : other;
  10850. }
  10851. if (typeof value != "string") {
  10852. return value === 0 ? value : +value;
  10853. }
  10854. value = baseTrim(value);
  10855. var isBinary = reIsBinary.test(value);
  10856. return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
  10857. }
  10858. function toPlainObject(value) {
  10859. return copyObject(value, keysIn(value));
  10860. }
  10861. function toSafeInteger(value) {
  10862. return value ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) : value === 0 ? value : 0;
  10863. }
  10864. function toString(value) {
  10865. return value == null ? "" : baseToString(value);
  10866. }
  10867. var assign = createAssigner(function(object, source) {
  10868. if (isPrototype(source) || isArrayLike(source)) {
  10869. copyObject(source, keys(source), object);
  10870. return;
  10871. }
  10872. for (var key in source) {
  10873. if (hasOwnProperty.call(source, key)) {
  10874. assignValue(object, key, source[key]);
  10875. }
  10876. }
  10877. });
  10878. var assignIn = createAssigner(function(object, source) {
  10879. copyObject(source, keysIn(source), object);
  10880. });
  10881. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  10882. copyObject(source, keysIn(source), object, customizer);
  10883. });
  10884. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  10885. copyObject(source, keys(source), object, customizer);
  10886. });
  10887. var at = flatRest(baseAt);
  10888. function create(prototype, properties) {
  10889. var result2 = baseCreate(prototype);
  10890. return properties == null ? result2 : baseAssign(result2, properties);
  10891. }
  10892. var defaults = baseRest(function(object, sources) {
  10893. object = Object2(object);
  10894. var index = -1;
  10895. var length = sources.length;
  10896. var guard = length > 2 ? sources[2] : undefined$1;
  10897. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  10898. length = 1;
  10899. }
  10900. while (++index < length) {
  10901. var source = sources[index];
  10902. var props = keysIn(source);
  10903. var propsIndex = -1;
  10904. var propsLength = props.length;
  10905. while (++propsIndex < propsLength) {
  10906. var key = props[propsIndex];
  10907. var value = object[key];
  10908. if (value === undefined$1 || eq(value, objectProto[key]) && !hasOwnProperty.call(object, key)) {
  10909. object[key] = source[key];
  10910. }
  10911. }
  10912. }
  10913. return object;
  10914. });
  10915. var defaultsDeep = baseRest(function(args) {
  10916. args.push(undefined$1, customDefaultsMerge);
  10917. return apply(mergeWith, undefined$1, args);
  10918. });
  10919. function findKey(object, predicate) {
  10920. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  10921. }
  10922. function findLastKey(object, predicate) {
  10923. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  10924. }
  10925. function forIn(object, iteratee2) {
  10926. return object == null ? object : baseFor(object, getIteratee(iteratee2, 3), keysIn);
  10927. }
  10928. function forInRight(object, iteratee2) {
  10929. return object == null ? object : baseForRight(object, getIteratee(iteratee2, 3), keysIn);
  10930. }
  10931. function forOwn(object, iteratee2) {
  10932. return object && baseForOwn(object, getIteratee(iteratee2, 3));
  10933. }
  10934. function forOwnRight(object, iteratee2) {
  10935. return object && baseForOwnRight(object, getIteratee(iteratee2, 3));
  10936. }
  10937. function functions(object) {
  10938. return object == null ? [] : baseFunctions(object, keys(object));
  10939. }
  10940. function functionsIn(object) {
  10941. return object == null ? [] : baseFunctions(object, keysIn(object));
  10942. }
  10943. function get(object, path, defaultValue) {
  10944. var result2 = object == null ? undefined$1 : baseGet(object, path);
  10945. return result2 === undefined$1 ? defaultValue : result2;
  10946. }
  10947. function has(object, path) {
  10948. return object != null && hasPath(object, path, baseHas);
  10949. }
  10950. function hasIn(object, path) {
  10951. return object != null && hasPath(object, path, baseHasIn);
  10952. }
  10953. var invert = createInverter(function(result2, value, key) {
  10954. if (value != null && typeof value.toString != "function") {
  10955. value = nativeObjectToString.call(value);
  10956. }
  10957. result2[value] = key;
  10958. }, constant(identity));
  10959. var invertBy = createInverter(function(result2, value, key) {
  10960. if (value != null && typeof value.toString != "function") {
  10961. value = nativeObjectToString.call(value);
  10962. }
  10963. if (hasOwnProperty.call(result2, value)) {
  10964. result2[value].push(key);
  10965. } else {
  10966. result2[value] = [key];
  10967. }
  10968. }, getIteratee);
  10969. var invoke = baseRest(baseInvoke);
  10970. function keys(object) {
  10971. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  10972. }
  10973. function keysIn(object) {
  10974. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  10975. }
  10976. function mapKeys(object, iteratee2) {
  10977. var result2 = {};
  10978. iteratee2 = getIteratee(iteratee2, 3);
  10979. baseForOwn(object, function(value, key, object2) {
  10980. baseAssignValue(result2, iteratee2(value, key, object2), value);
  10981. });
  10982. return result2;
  10983. }
  10984. function mapValues(object, iteratee2) {
  10985. var result2 = {};
  10986. iteratee2 = getIteratee(iteratee2, 3);
  10987. baseForOwn(object, function(value, key, object2) {
  10988. baseAssignValue(result2, key, iteratee2(value, key, object2));
  10989. });
  10990. return result2;
  10991. }
  10992. var merge = createAssigner(function(object, source, srcIndex) {
  10993. baseMerge(object, source, srcIndex);
  10994. });
  10995. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  10996. baseMerge(object, source, srcIndex, customizer);
  10997. });
  10998. var omit = flatRest(function(object, paths) {
  10999. var result2 = {};
  11000. if (object == null) {
  11001. return result2;
  11002. }
  11003. var isDeep = false;
  11004. paths = arrayMap(paths, function(path) {
  11005. path = castPath(path, object);
  11006. isDeep || (isDeep = path.length > 1);
  11007. return path;
  11008. });
  11009. copyObject(object, getAllKeysIn(object), result2);
  11010. if (isDeep) {
  11011. result2 = baseClone(result2, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  11012. }
  11013. var length = paths.length;
  11014. while (length--) {
  11015. baseUnset(result2, paths[length]);
  11016. }
  11017. return result2;
  11018. });
  11019. function omitBy(object, predicate) {
  11020. return pickBy(object, negate(getIteratee(predicate)));
  11021. }
  11022. var pick = flatRest(function(object, paths) {
  11023. return object == null ? {} : basePick(object, paths);
  11024. });
  11025. function pickBy(object, predicate) {
  11026. if (object == null) {
  11027. return {};
  11028. }
  11029. var props = arrayMap(getAllKeysIn(object), function(prop) {
  11030. return [prop];
  11031. });
  11032. predicate = getIteratee(predicate);
  11033. return basePickBy(object, props, function(value, path) {
  11034. return predicate(value, path[0]);
  11035. });
  11036. }
  11037. function result(object, path, defaultValue) {
  11038. path = castPath(path, object);
  11039. var index = -1, length = path.length;
  11040. if (!length) {
  11041. length = 1;
  11042. object = undefined$1;
  11043. }
  11044. while (++index < length) {
  11045. var value = object == null ? undefined$1 : object[toKey(path[index])];
  11046. if (value === undefined$1) {
  11047. index = length;
  11048. value = defaultValue;
  11049. }
  11050. object = isFunction(value) ? value.call(object) : value;
  11051. }
  11052. return object;
  11053. }
  11054. function set(object, path, value) {
  11055. return object == null ? object : baseSet(object, path, value);
  11056. }
  11057. function setWith(object, path, value, customizer) {
  11058. customizer = typeof customizer == "function" ? customizer : undefined$1;
  11059. return object == null ? object : baseSet(object, path, value, customizer);
  11060. }
  11061. var toPairs = createToPairs(keys);
  11062. var toPairsIn = createToPairs(keysIn);
  11063. function transform(object, iteratee2, accumulator) {
  11064. var isArr = isArray(object), isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  11065. iteratee2 = getIteratee(iteratee2, 4);
  11066. if (accumulator == null) {
  11067. var Ctor = object && object.constructor;
  11068. if (isArrLike) {
  11069. accumulator = isArr ? new Ctor() : [];
  11070. } else if (isObject(object)) {
  11071. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  11072. } else {
  11073. accumulator = {};
  11074. }
  11075. }
  11076. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object2) {
  11077. return iteratee2(accumulator, value, index, object2);
  11078. });
  11079. return accumulator;
  11080. }
  11081. function unset(object, path) {
  11082. return object == null ? true : baseUnset(object, path);
  11083. }
  11084. function update(object, path, updater) {
  11085. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  11086. }
  11087. function updateWith(object, path, updater, customizer) {
  11088. customizer = typeof customizer == "function" ? customizer : undefined$1;
  11089. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  11090. }
  11091. function values(object) {
  11092. return object == null ? [] : baseValues(object, keys(object));
  11093. }
  11094. function valuesIn(object) {
  11095. return object == null ? [] : baseValues(object, keysIn(object));
  11096. }
  11097. function clamp(number, lower, upper) {
  11098. if (upper === undefined$1) {
  11099. upper = lower;
  11100. lower = undefined$1;
  11101. }
  11102. if (upper !== undefined$1) {
  11103. upper = toNumber(upper);
  11104. upper = upper === upper ? upper : 0;
  11105. }
  11106. if (lower !== undefined$1) {
  11107. lower = toNumber(lower);
  11108. lower = lower === lower ? lower : 0;
  11109. }
  11110. return baseClamp(toNumber(number), lower, upper);
  11111. }
  11112. function inRange(number, start, end) {
  11113. start = toFinite(start);
  11114. if (end === undefined$1) {
  11115. end = start;
  11116. start = 0;
  11117. } else {
  11118. end = toFinite(end);
  11119. }
  11120. number = toNumber(number);
  11121. return baseInRange(number, start, end);
  11122. }
  11123. function random(lower, upper, floating) {
  11124. if (floating && typeof floating != "boolean" && isIterateeCall(lower, upper, floating)) {
  11125. upper = floating = undefined$1;
  11126. }
  11127. if (floating === undefined$1) {
  11128. if (typeof upper == "boolean") {
  11129. floating = upper;
  11130. upper = undefined$1;
  11131. } else if (typeof lower == "boolean") {
  11132. floating = lower;
  11133. lower = undefined$1;
  11134. }
  11135. }
  11136. if (lower === undefined$1 && upper === undefined$1) {
  11137. lower = 0;
  11138. upper = 1;
  11139. } else {
  11140. lower = toFinite(lower);
  11141. if (upper === undefined$1) {
  11142. upper = lower;
  11143. lower = 0;
  11144. } else {
  11145. upper = toFinite(upper);
  11146. }
  11147. }
  11148. if (lower > upper) {
  11149. var temp = lower;
  11150. lower = upper;
  11151. upper = temp;
  11152. }
  11153. if (floating || lower % 1 || upper % 1) {
  11154. var rand = nativeRandom();
  11155. return nativeMin(lower + rand * (upper - lower + freeParseFloat("1e-" + ((rand + "").length - 1))), upper);
  11156. }
  11157. return baseRandom(lower, upper);
  11158. }
  11159. var camelCase = createCompounder(function(result2, word, index) {
  11160. word = word.toLowerCase();
  11161. return result2 + (index ? capitalize(word) : word);
  11162. });
  11163. function capitalize(string) {
  11164. return upperFirst(toString(string).toLowerCase());
  11165. }
  11166. function deburr(string) {
  11167. string = toString(string);
  11168. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, "");
  11169. }
  11170. function endsWith(string, target, position) {
  11171. string = toString(string);
  11172. target = baseToString(target);
  11173. var length = string.length;
  11174. position = position === undefined$1 ? length : baseClamp(toInteger(position), 0, length);
  11175. var end = position;
  11176. position -= target.length;
  11177. return position >= 0 && string.slice(position, end) == target;
  11178. }
  11179. function escape(string) {
  11180. string = toString(string);
  11181. return string && reHasUnescapedHtml.test(string) ? string.replace(reUnescapedHtml, escapeHtmlChar) : string;
  11182. }
  11183. function escapeRegExp(string) {
  11184. string = toString(string);
  11185. return string && reHasRegExpChar.test(string) ? string.replace(reRegExpChar, "\\$&") : string;
  11186. }
  11187. var kebabCase = createCompounder(function(result2, word, index) {
  11188. return result2 + (index ? "-" : "") + word.toLowerCase();
  11189. });
  11190. var lowerCase = createCompounder(function(result2, word, index) {
  11191. return result2 + (index ? " " : "") + word.toLowerCase();
  11192. });
  11193. var lowerFirst = createCaseFirst("toLowerCase");
  11194. function pad(string, length, chars) {
  11195. string = toString(string);
  11196. length = toInteger(length);
  11197. var strLength = length ? stringSize(string) : 0;
  11198. if (!length || strLength >= length) {
  11199. return string;
  11200. }
  11201. var mid = (length - strLength) / 2;
  11202. return createPadding(nativeFloor(mid), chars) + string + createPadding(nativeCeil(mid), chars);
  11203. }
  11204. function padEnd(string, length, chars) {
  11205. string = toString(string);
  11206. length = toInteger(length);
  11207. var strLength = length ? stringSize(string) : 0;
  11208. return length && strLength < length ? string + createPadding(length - strLength, chars) : string;
  11209. }
  11210. function padStart(string, length, chars) {
  11211. string = toString(string);
  11212. length = toInteger(length);
  11213. var strLength = length ? stringSize(string) : 0;
  11214. return length && strLength < length ? createPadding(length - strLength, chars) + string : string;
  11215. }
  11216. function parseInt2(string, radix, guard) {
  11217. if (guard || radix == null) {
  11218. radix = 0;
  11219. } else if (radix) {
  11220. radix = +radix;
  11221. }
  11222. return nativeParseInt(toString(string).replace(reTrimStart, ""), radix || 0);
  11223. }
  11224. function repeat(string, n, guard) {
  11225. if (guard ? isIterateeCall(string, n, guard) : n === undefined$1) {
  11226. n = 1;
  11227. } else {
  11228. n = toInteger(n);
  11229. }
  11230. return baseRepeat(toString(string), n);
  11231. }
  11232. function replace() {
  11233. var args = arguments, string = toString(args[0]);
  11234. return args.length < 3 ? string : string.replace(args[1], args[2]);
  11235. }
  11236. var snakeCase = createCompounder(function(result2, word, index) {
  11237. return result2 + (index ? "_" : "") + word.toLowerCase();
  11238. });
  11239. function split(string, separator, limit) {
  11240. if (limit && typeof limit != "number" && isIterateeCall(string, separator, limit)) {
  11241. separator = limit = undefined$1;
  11242. }
  11243. limit = limit === undefined$1 ? MAX_ARRAY_LENGTH : limit >>> 0;
  11244. if (!limit) {
  11245. return [];
  11246. }
  11247. string = toString(string);
  11248. if (string && (typeof separator == "string" || separator != null && !isRegExp(separator))) {
  11249. separator = baseToString(separator);
  11250. if (!separator && hasUnicode(string)) {
  11251. return castSlice(stringToArray(string), 0, limit);
  11252. }
  11253. }
  11254. return string.split(separator, limit);
  11255. }
  11256. var startCase = createCompounder(function(result2, word, index) {
  11257. return result2 + (index ? " " : "") + upperFirst(word);
  11258. });
  11259. function startsWith(string, target, position) {
  11260. string = toString(string);
  11261. position = position == null ? 0 : baseClamp(toInteger(position), 0, string.length);
  11262. target = baseToString(target);
  11263. return string.slice(position, position + target.length) == target;
  11264. }
  11265. function template(string, options, guard) {
  11266. var settings = lodash2.templateSettings;
  11267. if (guard && isIterateeCall(string, options, guard)) {
  11268. options = undefined$1;
  11269. }
  11270. string = toString(string);
  11271. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  11272. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn), importsKeys = keys(imports), importsValues = baseValues(imports, importsKeys);
  11273. var isEscaping, isEvaluating, index = 0, interpolate = options.interpolate || reNoMatch, source = "__p += '";
  11274. var reDelimiters = RegExp2(
  11275. (options.escape || reNoMatch).source + "|" + interpolate.source + "|" + (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + "|" + (options.evaluate || reNoMatch).source + "|$",
  11276. "g"
  11277. );
  11278. var sourceURL = "//# sourceURL=" + (hasOwnProperty.call(options, "sourceURL") ? (options.sourceURL + "").replace(/\s/g, " ") : "lodash.templateSources[" + ++templateCounter + "]") + "\n";
  11279. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  11280. interpolateValue || (interpolateValue = esTemplateValue);
  11281. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  11282. if (escapeValue) {
  11283. isEscaping = true;
  11284. source += "' +\n__e(" + escapeValue + ") +\n'";
  11285. }
  11286. if (evaluateValue) {
  11287. isEvaluating = true;
  11288. source += "';\n" + evaluateValue + ";\n__p += '";
  11289. }
  11290. if (interpolateValue) {
  11291. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  11292. }
  11293. index = offset + match.length;
  11294. return match;
  11295. });
  11296. source += "';\n";
  11297. var variable = hasOwnProperty.call(options, "variable") && options.variable;
  11298. if (!variable) {
  11299. source = "with (obj) {\n" + source + "\n}\n";
  11300. } else if (reForbiddenIdentifierChars.test(variable)) {
  11301. throw new Error2(INVALID_TEMPL_VAR_ERROR_TEXT);
  11302. }
  11303. source = (isEvaluating ? source.replace(reEmptyStringLeading, "") : source).replace(reEmptyStringMiddle, "$1").replace(reEmptyStringTrailing, "$1;");
  11304. source = "function(" + (variable || "obj") + ") {\n" + (variable ? "" : "obj || (obj = {});\n") + "var __t, __p = ''" + (isEscaping ? ", __e = _.escape" : "") + (isEvaluating ? ", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n" : ";\n") + source + "return __p\n}";
  11305. var result2 = attempt(function() {
  11306. return Function2(importsKeys, sourceURL + "return " + source).apply(undefined$1, importsValues);
  11307. });
  11308. result2.source = source;
  11309. if (isError(result2)) {
  11310. throw result2;
  11311. }
  11312. return result2;
  11313. }
  11314. function toLower(value) {
  11315. return toString(value).toLowerCase();
  11316. }
  11317. function toUpper(value) {
  11318. return toString(value).toUpperCase();
  11319. }
  11320. function trim(string, chars, guard) {
  11321. string = toString(string);
  11322. if (string && (guard || chars === undefined$1)) {
  11323. return baseTrim(string);
  11324. }
  11325. if (!string || !(chars = baseToString(chars))) {
  11326. return string;
  11327. }
  11328. var strSymbols = stringToArray(string), chrSymbols = stringToArray(chars), start = charsStartIndex(strSymbols, chrSymbols), end = charsEndIndex(strSymbols, chrSymbols) + 1;
  11329. return castSlice(strSymbols, start, end).join("");
  11330. }
  11331. function trimEnd(string, chars, guard) {
  11332. string = toString(string);
  11333. if (string && (guard || chars === undefined$1)) {
  11334. return string.slice(0, trimmedEndIndex(string) + 1);
  11335. }
  11336. if (!string || !(chars = baseToString(chars))) {
  11337. return string;
  11338. }
  11339. var strSymbols = stringToArray(string), end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  11340. return castSlice(strSymbols, 0, end).join("");
  11341. }
  11342. function trimStart(string, chars, guard) {
  11343. string = toString(string);
  11344. if (string && (guard || chars === undefined$1)) {
  11345. return string.replace(reTrimStart, "");
  11346. }
  11347. if (!string || !(chars = baseToString(chars))) {
  11348. return string;
  11349. }
  11350. var strSymbols = stringToArray(string), start = charsStartIndex(strSymbols, stringToArray(chars));
  11351. return castSlice(strSymbols, start).join("");
  11352. }
  11353. function truncate(string, options) {
  11354. var length = DEFAULT_TRUNC_LENGTH, omission = DEFAULT_TRUNC_OMISSION;
  11355. if (isObject(options)) {
  11356. var separator = "separator" in options ? options.separator : separator;
  11357. length = "length" in options ? toInteger(options.length) : length;
  11358. omission = "omission" in options ? baseToString(options.omission) : omission;
  11359. }
  11360. string = toString(string);
  11361. var strLength = string.length;
  11362. if (hasUnicode(string)) {
  11363. var strSymbols = stringToArray(string);
  11364. strLength = strSymbols.length;
  11365. }
  11366. if (length >= strLength) {
  11367. return string;
  11368. }
  11369. var end = length - stringSize(omission);
  11370. if (end < 1) {
  11371. return omission;
  11372. }
  11373. var result2 = strSymbols ? castSlice(strSymbols, 0, end).join("") : string.slice(0, end);
  11374. if (separator === undefined$1) {
  11375. return result2 + omission;
  11376. }
  11377. if (strSymbols) {
  11378. end += result2.length - end;
  11379. }
  11380. if (isRegExp(separator)) {
  11381. if (string.slice(end).search(separator)) {
  11382. var match, substring = result2;
  11383. if (!separator.global) {
  11384. separator = RegExp2(separator.source, toString(reFlags.exec(separator)) + "g");
  11385. }
  11386. separator.lastIndex = 0;
  11387. while (match = separator.exec(substring)) {
  11388. var newEnd = match.index;
  11389. }
  11390. result2 = result2.slice(0, newEnd === undefined$1 ? end : newEnd);
  11391. }
  11392. } else if (string.indexOf(baseToString(separator), end) != end) {
  11393. var index = result2.lastIndexOf(separator);
  11394. if (index > -1) {
  11395. result2 = result2.slice(0, index);
  11396. }
  11397. }
  11398. return result2 + omission;
  11399. }
  11400. function unescape(string) {
  11401. string = toString(string);
  11402. return string && reHasEscapedHtml.test(string) ? string.replace(reEscapedHtml, unescapeHtmlChar) : string;
  11403. }
  11404. var upperCase = createCompounder(function(result2, word, index) {
  11405. return result2 + (index ? " " : "") + word.toUpperCase();
  11406. });
  11407. var upperFirst = createCaseFirst("toUpperCase");
  11408. function words(string, pattern, guard) {
  11409. string = toString(string);
  11410. pattern = guard ? undefined$1 : pattern;
  11411. if (pattern === undefined$1) {
  11412. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  11413. }
  11414. return string.match(pattern) || [];
  11415. }
  11416. var attempt = baseRest(function(func, args) {
  11417. try {
  11418. return apply(func, undefined$1, args);
  11419. } catch (e) {
  11420. return isError(e) ? e : new Error2(e);
  11421. }
  11422. });
  11423. var bindAll = flatRest(function(object, methodNames) {
  11424. arrayEach(methodNames, function(key) {
  11425. key = toKey(key);
  11426. baseAssignValue(object, key, bind(object[key], object));
  11427. });
  11428. return object;
  11429. });
  11430. function cond(pairs) {
  11431. var length = pairs == null ? 0 : pairs.length, toIteratee = getIteratee();
  11432. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  11433. if (typeof pair[1] != "function") {
  11434. throw new TypeError2(FUNC_ERROR_TEXT);
  11435. }
  11436. return [toIteratee(pair[0]), pair[1]];
  11437. });
  11438. return baseRest(function(args) {
  11439. var index = -1;
  11440. while (++index < length) {
  11441. var pair = pairs[index];
  11442. if (apply(pair[0], this, args)) {
  11443. return apply(pair[1], this, args);
  11444. }
  11445. }
  11446. });
  11447. }
  11448. function conforms(source) {
  11449. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  11450. }
  11451. function constant(value) {
  11452. return function() {
  11453. return value;
  11454. };
  11455. }
  11456. function defaultTo(value, defaultValue) {
  11457. return value == null || value !== value ? defaultValue : value;
  11458. }
  11459. var flow = createFlow();
  11460. var flowRight = createFlow(true);
  11461. function identity(value) {
  11462. return value;
  11463. }
  11464. function iteratee(func) {
  11465. return baseIteratee(typeof func == "function" ? func : baseClone(func, CLONE_DEEP_FLAG));
  11466. }
  11467. function matches(source) {
  11468. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  11469. }
  11470. function matchesProperty(path, srcValue) {
  11471. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  11472. }
  11473. var method = baseRest(function(path, args) {
  11474. return function(object) {
  11475. return baseInvoke(object, path, args);
  11476. };
  11477. });
  11478. var methodOf = baseRest(function(object, args) {
  11479. return function(path) {
  11480. return baseInvoke(object, path, args);
  11481. };
  11482. });
  11483. function mixin(object, source, options) {
  11484. var props = keys(source), methodNames = baseFunctions(source, props);
  11485. if (options == null && !(isObject(source) && (methodNames.length || !props.length))) {
  11486. options = source;
  11487. source = object;
  11488. object = this;
  11489. methodNames = baseFunctions(source, keys(source));
  11490. }
  11491. var chain2 = !(isObject(options) && "chain" in options) || !!options.chain, isFunc = isFunction(object);
  11492. arrayEach(methodNames, function(methodName) {
  11493. var func = source[methodName];
  11494. object[methodName] = func;
  11495. if (isFunc) {
  11496. object.prototype[methodName] = function() {
  11497. var chainAll = this.__chain__;
  11498. if (chain2 || chainAll) {
  11499. var result2 = object(this.__wrapped__), actions = result2.__actions__ = copyArray(this.__actions__);
  11500. actions.push({ "func": func, "args": arguments, "thisArg": object });
  11501. result2.__chain__ = chainAll;
  11502. return result2;
  11503. }
  11504. return func.apply(object, arrayPush([this.value()], arguments));
  11505. };
  11506. }
  11507. });
  11508. return object;
  11509. }
  11510. function noConflict() {
  11511. if (root._ === this) {
  11512. root._ = oldDash;
  11513. }
  11514. return this;
  11515. }
  11516. function noop() {
  11517. }
  11518. function nthArg(n) {
  11519. n = toInteger(n);
  11520. return baseRest(function(args) {
  11521. return baseNth(args, n);
  11522. });
  11523. }
  11524. var over = createOver(arrayMap);
  11525. var overEvery = createOver(arrayEvery);
  11526. var overSome = createOver(arraySome);
  11527. function property(path) {
  11528. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  11529. }
  11530. function propertyOf(object) {
  11531. return function(path) {
  11532. return object == null ? undefined$1 : baseGet(object, path);
  11533. };
  11534. }
  11535. var range = createRange();
  11536. var rangeRight = createRange(true);
  11537. function stubArray() {
  11538. return [];
  11539. }
  11540. function stubFalse() {
  11541. return false;
  11542. }
  11543. function stubObject() {
  11544. return {};
  11545. }
  11546. function stubString() {
  11547. return "";
  11548. }
  11549. function stubTrue() {
  11550. return true;
  11551. }
  11552. function times(n, iteratee2) {
  11553. n = toInteger(n);
  11554. if (n < 1 || n > MAX_SAFE_INTEGER) {
  11555. return [];
  11556. }
  11557. var index = MAX_ARRAY_LENGTH, length = nativeMin(n, MAX_ARRAY_LENGTH);
  11558. iteratee2 = getIteratee(iteratee2);
  11559. n -= MAX_ARRAY_LENGTH;
  11560. var result2 = baseTimes(length, iteratee2);
  11561. while (++index < n) {
  11562. iteratee2(index);
  11563. }
  11564. return result2;
  11565. }
  11566. function toPath(value) {
  11567. if (isArray(value)) {
  11568. return arrayMap(value, toKey);
  11569. }
  11570. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  11571. }
  11572. function uniqueId(prefix) {
  11573. var id = ++idCounter;
  11574. return toString(prefix) + id;
  11575. }
  11576. var add = createMathOperation(function(augend, addend) {
  11577. return augend + addend;
  11578. }, 0);
  11579. var ceil = createRound("ceil");
  11580. var divide = createMathOperation(function(dividend, divisor) {
  11581. return dividend / divisor;
  11582. }, 1);
  11583. var floor = createRound("floor");
  11584. function max(array) {
  11585. return array && array.length ? baseExtremum(array, identity, baseGt) : undefined$1;
  11586. }
  11587. function maxBy(array, iteratee2) {
  11588. return array && array.length ? baseExtremum(array, getIteratee(iteratee2, 2), baseGt) : undefined$1;
  11589. }
  11590. function mean(array) {
  11591. return baseMean(array, identity);
  11592. }
  11593. function meanBy(array, iteratee2) {
  11594. return baseMean(array, getIteratee(iteratee2, 2));
  11595. }
  11596. function min(array) {
  11597. return array && array.length ? baseExtremum(array, identity, baseLt) : undefined$1;
  11598. }
  11599. function minBy(array, iteratee2) {
  11600. return array && array.length ? baseExtremum(array, getIteratee(iteratee2, 2), baseLt) : undefined$1;
  11601. }
  11602. var multiply = createMathOperation(function(multiplier, multiplicand) {
  11603. return multiplier * multiplicand;
  11604. }, 1);
  11605. var round = createRound("round");
  11606. var subtract = createMathOperation(function(minuend, subtrahend) {
  11607. return minuend - subtrahend;
  11608. }, 0);
  11609. function sum(array) {
  11610. return array && array.length ? baseSum(array, identity) : 0;
  11611. }
  11612. function sumBy(array, iteratee2) {
  11613. return array && array.length ? baseSum(array, getIteratee(iteratee2, 2)) : 0;
  11614. }
  11615. lodash2.after = after;
  11616. lodash2.ary = ary;
  11617. lodash2.assign = assign;
  11618. lodash2.assignIn = assignIn;
  11619. lodash2.assignInWith = assignInWith;
  11620. lodash2.assignWith = assignWith;
  11621. lodash2.at = at;
  11622. lodash2.before = before;
  11623. lodash2.bind = bind;
  11624. lodash2.bindAll = bindAll;
  11625. lodash2.bindKey = bindKey;
  11626. lodash2.castArray = castArray;
  11627. lodash2.chain = chain;
  11628. lodash2.chunk = chunk;
  11629. lodash2.compact = compact;
  11630. lodash2.concat = concat;
  11631. lodash2.cond = cond;
  11632. lodash2.conforms = conforms;
  11633. lodash2.constant = constant;
  11634. lodash2.countBy = countBy;
  11635. lodash2.create = create;
  11636. lodash2.curry = curry;
  11637. lodash2.curryRight = curryRight;
  11638. lodash2.debounce = debounce;
  11639. lodash2.defaults = defaults;
  11640. lodash2.defaultsDeep = defaultsDeep;
  11641. lodash2.defer = defer;
  11642. lodash2.delay = delay;
  11643. lodash2.difference = difference;
  11644. lodash2.differenceBy = differenceBy;
  11645. lodash2.differenceWith = differenceWith;
  11646. lodash2.drop = drop;
  11647. lodash2.dropRight = dropRight;
  11648. lodash2.dropRightWhile = dropRightWhile;
  11649. lodash2.dropWhile = dropWhile;
  11650. lodash2.fill = fill;
  11651. lodash2.filter = filter;
  11652. lodash2.flatMap = flatMap;
  11653. lodash2.flatMapDeep = flatMapDeep;
  11654. lodash2.flatMapDepth = flatMapDepth;
  11655. lodash2.flatten = flatten;
  11656. lodash2.flattenDeep = flattenDeep;
  11657. lodash2.flattenDepth = flattenDepth;
  11658. lodash2.flip = flip;
  11659. lodash2.flow = flow;
  11660. lodash2.flowRight = flowRight;
  11661. lodash2.fromPairs = fromPairs;
  11662. lodash2.functions = functions;
  11663. lodash2.functionsIn = functionsIn;
  11664. lodash2.groupBy = groupBy;
  11665. lodash2.initial = initial;
  11666. lodash2.intersection = intersection;
  11667. lodash2.intersectionBy = intersectionBy;
  11668. lodash2.intersectionWith = intersectionWith;
  11669. lodash2.invert = invert;
  11670. lodash2.invertBy = invertBy;
  11671. lodash2.invokeMap = invokeMap;
  11672. lodash2.iteratee = iteratee;
  11673. lodash2.keyBy = keyBy;
  11674. lodash2.keys = keys;
  11675. lodash2.keysIn = keysIn;
  11676. lodash2.map = map;
  11677. lodash2.mapKeys = mapKeys;
  11678. lodash2.mapValues = mapValues;
  11679. lodash2.matches = matches;
  11680. lodash2.matchesProperty = matchesProperty;
  11681. lodash2.memoize = memoize;
  11682. lodash2.merge = merge;
  11683. lodash2.mergeWith = mergeWith;
  11684. lodash2.method = method;
  11685. lodash2.methodOf = methodOf;
  11686. lodash2.mixin = mixin;
  11687. lodash2.negate = negate;
  11688. lodash2.nthArg = nthArg;
  11689. lodash2.omit = omit;
  11690. lodash2.omitBy = omitBy;
  11691. lodash2.once = once;
  11692. lodash2.orderBy = orderBy;
  11693. lodash2.over = over;
  11694. lodash2.overArgs = overArgs;
  11695. lodash2.overEvery = overEvery;
  11696. lodash2.overSome = overSome;
  11697. lodash2.partial = partial;
  11698. lodash2.partialRight = partialRight;
  11699. lodash2.partition = partition;
  11700. lodash2.pick = pick;
  11701. lodash2.pickBy = pickBy;
  11702. lodash2.property = property;
  11703. lodash2.propertyOf = propertyOf;
  11704. lodash2.pull = pull;
  11705. lodash2.pullAll = pullAll;
  11706. lodash2.pullAllBy = pullAllBy;
  11707. lodash2.pullAllWith = pullAllWith;
  11708. lodash2.pullAt = pullAt;
  11709. lodash2.range = range;
  11710. lodash2.rangeRight = rangeRight;
  11711. lodash2.rearg = rearg;
  11712. lodash2.reject = reject;
  11713. lodash2.remove = remove;
  11714. lodash2.rest = rest;
  11715. lodash2.reverse = reverse;
  11716. lodash2.sampleSize = sampleSize;
  11717. lodash2.set = set;
  11718. lodash2.setWith = setWith;
  11719. lodash2.shuffle = shuffle;
  11720. lodash2.slice = slice;
  11721. lodash2.sortBy = sortBy;
  11722. lodash2.sortedUniq = sortedUniq;
  11723. lodash2.sortedUniqBy = sortedUniqBy;
  11724. lodash2.split = split;
  11725. lodash2.spread = spread;
  11726. lodash2.tail = tail;
  11727. lodash2.take = take;
  11728. lodash2.takeRight = takeRight;
  11729. lodash2.takeRightWhile = takeRightWhile;
  11730. lodash2.takeWhile = takeWhile;
  11731. lodash2.tap = tap;
  11732. lodash2.throttle = throttle;
  11733. lodash2.thru = thru;
  11734. lodash2.toArray = toArray;
  11735. lodash2.toPairs = toPairs;
  11736. lodash2.toPairsIn = toPairsIn;
  11737. lodash2.toPath = toPath;
  11738. lodash2.toPlainObject = toPlainObject;
  11739. lodash2.transform = transform;
  11740. lodash2.unary = unary;
  11741. lodash2.union = union;
  11742. lodash2.unionBy = unionBy;
  11743. lodash2.unionWith = unionWith;
  11744. lodash2.uniq = uniq;
  11745. lodash2.uniqBy = uniqBy;
  11746. lodash2.uniqWith = uniqWith;
  11747. lodash2.unset = unset;
  11748. lodash2.unzip = unzip;
  11749. lodash2.unzipWith = unzipWith;
  11750. lodash2.update = update;
  11751. lodash2.updateWith = updateWith;
  11752. lodash2.values = values;
  11753. lodash2.valuesIn = valuesIn;
  11754. lodash2.without = without;
  11755. lodash2.words = words;
  11756. lodash2.wrap = wrap;
  11757. lodash2.xor = xor;
  11758. lodash2.xorBy = xorBy;
  11759. lodash2.xorWith = xorWith;
  11760. lodash2.zip = zip;
  11761. lodash2.zipObject = zipObject;
  11762. lodash2.zipObjectDeep = zipObjectDeep;
  11763. lodash2.zipWith = zipWith;
  11764. lodash2.entries = toPairs;
  11765. lodash2.entriesIn = toPairsIn;
  11766. lodash2.extend = assignIn;
  11767. lodash2.extendWith = assignInWith;
  11768. mixin(lodash2, lodash2);
  11769. lodash2.add = add;
  11770. lodash2.attempt = attempt;
  11771. lodash2.camelCase = camelCase;
  11772. lodash2.capitalize = capitalize;
  11773. lodash2.ceil = ceil;
  11774. lodash2.clamp = clamp;
  11775. lodash2.clone = clone;
  11776. lodash2.cloneDeep = cloneDeep;
  11777. lodash2.cloneDeepWith = cloneDeepWith;
  11778. lodash2.cloneWith = cloneWith;
  11779. lodash2.conformsTo = conformsTo;
  11780. lodash2.deburr = deburr;
  11781. lodash2.defaultTo = defaultTo;
  11782. lodash2.divide = divide;
  11783. lodash2.endsWith = endsWith;
  11784. lodash2.eq = eq;
  11785. lodash2.escape = escape;
  11786. lodash2.escapeRegExp = escapeRegExp;
  11787. lodash2.every = every;
  11788. lodash2.find = find;
  11789. lodash2.findIndex = findIndex;
  11790. lodash2.findKey = findKey;
  11791. lodash2.findLast = findLast;
  11792. lodash2.findLastIndex = findLastIndex;
  11793. lodash2.findLastKey = findLastKey;
  11794. lodash2.floor = floor;
  11795. lodash2.forEach = forEach;
  11796. lodash2.forEachRight = forEachRight;
  11797. lodash2.forIn = forIn;
  11798. lodash2.forInRight = forInRight;
  11799. lodash2.forOwn = forOwn;
  11800. lodash2.forOwnRight = forOwnRight;
  11801. lodash2.get = get;
  11802. lodash2.gt = gt;
  11803. lodash2.gte = gte;
  11804. lodash2.has = has;
  11805. lodash2.hasIn = hasIn;
  11806. lodash2.head = head;
  11807. lodash2.identity = identity;
  11808. lodash2.includes = includes;
  11809. lodash2.indexOf = indexOf;
  11810. lodash2.inRange = inRange;
  11811. lodash2.invoke = invoke;
  11812. lodash2.isArguments = isArguments;
  11813. lodash2.isArray = isArray;
  11814. lodash2.isArrayBuffer = isArrayBuffer;
  11815. lodash2.isArrayLike = isArrayLike;
  11816. lodash2.isArrayLikeObject = isArrayLikeObject;
  11817. lodash2.isBoolean = isBoolean;
  11818. lodash2.isBuffer = isBuffer;
  11819. lodash2.isDate = isDate;
  11820. lodash2.isElement = isElement;
  11821. lodash2.isEmpty = isEmpty;
  11822. lodash2.isEqual = isEqual;
  11823. lodash2.isEqualWith = isEqualWith;
  11824. lodash2.isError = isError;
  11825. lodash2.isFinite = isFinite2;
  11826. lodash2.isFunction = isFunction;
  11827. lodash2.isInteger = isInteger;
  11828. lodash2.isLength = isLength;
  11829. lodash2.isMap = isMap;
  11830. lodash2.isMatch = isMatch;
  11831. lodash2.isMatchWith = isMatchWith;
  11832. lodash2.isNaN = isNaN2;
  11833. lodash2.isNative = isNative;
  11834. lodash2.isNil = isNil;
  11835. lodash2.isNull = isNull;
  11836. lodash2.isNumber = isNumber;
  11837. lodash2.isObject = isObject;
  11838. lodash2.isObjectLike = isObjectLike;
  11839. lodash2.isPlainObject = isPlainObject;
  11840. lodash2.isRegExp = isRegExp;
  11841. lodash2.isSafeInteger = isSafeInteger;
  11842. lodash2.isSet = isSet;
  11843. lodash2.isString = isString;
  11844. lodash2.isSymbol = isSymbol;
  11845. lodash2.isTypedArray = isTypedArray;
  11846. lodash2.isUndefined = isUndefined;
  11847. lodash2.isWeakMap = isWeakMap;
  11848. lodash2.isWeakSet = isWeakSet;
  11849. lodash2.join = join;
  11850. lodash2.kebabCase = kebabCase;
  11851. lodash2.last = last;
  11852. lodash2.lastIndexOf = lastIndexOf;
  11853. lodash2.lowerCase = lowerCase;
  11854. lodash2.lowerFirst = lowerFirst;
  11855. lodash2.lt = lt;
  11856. lodash2.lte = lte;
  11857. lodash2.max = max;
  11858. lodash2.maxBy = maxBy;
  11859. lodash2.mean = mean;
  11860. lodash2.meanBy = meanBy;
  11861. lodash2.min = min;
  11862. lodash2.minBy = minBy;
  11863. lodash2.stubArray = stubArray;
  11864. lodash2.stubFalse = stubFalse;
  11865. lodash2.stubObject = stubObject;
  11866. lodash2.stubString = stubString;
  11867. lodash2.stubTrue = stubTrue;
  11868. lodash2.multiply = multiply;
  11869. lodash2.nth = nth;
  11870. lodash2.noConflict = noConflict;
  11871. lodash2.noop = noop;
  11872. lodash2.now = now;
  11873. lodash2.pad = pad;
  11874. lodash2.padEnd = padEnd;
  11875. lodash2.padStart = padStart;
  11876. lodash2.parseInt = parseInt2;
  11877. lodash2.random = random;
  11878. lodash2.reduce = reduce;
  11879. lodash2.reduceRight = reduceRight;
  11880. lodash2.repeat = repeat;
  11881. lodash2.replace = replace;
  11882. lodash2.result = result;
  11883. lodash2.round = round;
  11884. lodash2.runInContext = runInContext2;
  11885. lodash2.sample = sample;
  11886. lodash2.size = size;
  11887. lodash2.snakeCase = snakeCase;
  11888. lodash2.some = some;
  11889. lodash2.sortedIndex = sortedIndex;
  11890. lodash2.sortedIndexBy = sortedIndexBy;
  11891. lodash2.sortedIndexOf = sortedIndexOf;
  11892. lodash2.sortedLastIndex = sortedLastIndex;
  11893. lodash2.sortedLastIndexBy = sortedLastIndexBy;
  11894. lodash2.sortedLastIndexOf = sortedLastIndexOf;
  11895. lodash2.startCase = startCase;
  11896. lodash2.startsWith = startsWith;
  11897. lodash2.subtract = subtract;
  11898. lodash2.sum = sum;
  11899. lodash2.sumBy = sumBy;
  11900. lodash2.template = template;
  11901. lodash2.times = times;
  11902. lodash2.toFinite = toFinite;
  11903. lodash2.toInteger = toInteger;
  11904. lodash2.toLength = toLength;
  11905. lodash2.toLower = toLower;
  11906. lodash2.toNumber = toNumber;
  11907. lodash2.toSafeInteger = toSafeInteger;
  11908. lodash2.toString = toString;
  11909. lodash2.toUpper = toUpper;
  11910. lodash2.trim = trim;
  11911. lodash2.trimEnd = trimEnd;
  11912. lodash2.trimStart = trimStart;
  11913. lodash2.truncate = truncate;
  11914. lodash2.unescape = unescape;
  11915. lodash2.uniqueId = uniqueId;
  11916. lodash2.upperCase = upperCase;
  11917. lodash2.upperFirst = upperFirst;
  11918. lodash2.each = forEach;
  11919. lodash2.eachRight = forEachRight;
  11920. lodash2.first = head;
  11921. mixin(lodash2, function() {
  11922. var source = {};
  11923. baseForOwn(lodash2, function(func, methodName) {
  11924. if (!hasOwnProperty.call(lodash2.prototype, methodName)) {
  11925. source[methodName] = func;
  11926. }
  11927. });
  11928. return source;
  11929. }(), { "chain": false });
  11930. lodash2.VERSION = VERSION;
  11931. arrayEach(["bind", "bindKey", "curry", "curryRight", "partial", "partialRight"], function(methodName) {
  11932. lodash2[methodName].placeholder = lodash2;
  11933. });
  11934. arrayEach(["drop", "take"], function(methodName, index) {
  11935. LazyWrapper.prototype[methodName] = function(n) {
  11936. n = n === undefined$1 ? 1 : nativeMax(toInteger(n), 0);
  11937. var result2 = this.__filtered__ && !index ? new LazyWrapper(this) : this.clone();
  11938. if (result2.__filtered__) {
  11939. result2.__takeCount__ = nativeMin(n, result2.__takeCount__);
  11940. } else {
  11941. result2.__views__.push({
  11942. "size": nativeMin(n, MAX_ARRAY_LENGTH),
  11943. "type": methodName + (result2.__dir__ < 0 ? "Right" : "")
  11944. });
  11945. }
  11946. return result2;
  11947. };
  11948. LazyWrapper.prototype[methodName + "Right"] = function(n) {
  11949. return this.reverse()[methodName](n).reverse();
  11950. };
  11951. });
  11952. arrayEach(["filter", "map", "takeWhile"], function(methodName, index) {
  11953. var type = index + 1, isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  11954. LazyWrapper.prototype[methodName] = function(iteratee2) {
  11955. var result2 = this.clone();
  11956. result2.__iteratees__.push({
  11957. "iteratee": getIteratee(iteratee2, 3),
  11958. "type": type
  11959. });
  11960. result2.__filtered__ = result2.__filtered__ || isFilter;
  11961. return result2;
  11962. };
  11963. });
  11964. arrayEach(["head", "last"], function(methodName, index) {
  11965. var takeName = "take" + (index ? "Right" : "");
  11966. LazyWrapper.prototype[methodName] = function() {
  11967. return this[takeName](1).value()[0];
  11968. };
  11969. });
  11970. arrayEach(["initial", "tail"], function(methodName, index) {
  11971. var dropName = "drop" + (index ? "" : "Right");
  11972. LazyWrapper.prototype[methodName] = function() {
  11973. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  11974. };
  11975. });
  11976. LazyWrapper.prototype.compact = function() {
  11977. return this.filter(identity);
  11978. };
  11979. LazyWrapper.prototype.find = function(predicate) {
  11980. return this.filter(predicate).head();
  11981. };
  11982. LazyWrapper.prototype.findLast = function(predicate) {
  11983. return this.reverse().find(predicate);
  11984. };
  11985. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  11986. if (typeof path == "function") {
  11987. return new LazyWrapper(this);
  11988. }
  11989. return this.map(function(value) {
  11990. return baseInvoke(value, path, args);
  11991. });
  11992. });
  11993. LazyWrapper.prototype.reject = function(predicate) {
  11994. return this.filter(negate(getIteratee(predicate)));
  11995. };
  11996. LazyWrapper.prototype.slice = function(start, end) {
  11997. start = toInteger(start);
  11998. var result2 = this;
  11999. if (result2.__filtered__ && (start > 0 || end < 0)) {
  12000. return new LazyWrapper(result2);
  12001. }
  12002. if (start < 0) {
  12003. result2 = result2.takeRight(-start);
  12004. } else if (start) {
  12005. result2 = result2.drop(start);
  12006. }
  12007. if (end !== undefined$1) {
  12008. end = toInteger(end);
  12009. result2 = end < 0 ? result2.dropRight(-end) : result2.take(end - start);
  12010. }
  12011. return result2;
  12012. };
  12013. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  12014. return this.reverse().takeWhile(predicate).reverse();
  12015. };
  12016. LazyWrapper.prototype.toArray = function() {
  12017. return this.take(MAX_ARRAY_LENGTH);
  12018. };
  12019. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  12020. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName), isTaker = /^(?:head|last)$/.test(methodName), lodashFunc = lodash2[isTaker ? "take" + (methodName == "last" ? "Right" : "") : methodName], retUnwrapped = isTaker || /^find/.test(methodName);
  12021. if (!lodashFunc) {
  12022. return;
  12023. }
  12024. lodash2.prototype[methodName] = function() {
  12025. var value = this.__wrapped__, args = isTaker ? [1] : arguments, isLazy = value instanceof LazyWrapper, iteratee2 = args[0], useLazy = isLazy || isArray(value);
  12026. var interceptor = function(value2) {
  12027. var result3 = lodashFunc.apply(lodash2, arrayPush([value2], args));
  12028. return isTaker && chainAll ? result3[0] : result3;
  12029. };
  12030. if (useLazy && checkIteratee && typeof iteratee2 == "function" && iteratee2.length != 1) {
  12031. isLazy = useLazy = false;
  12032. }
  12033. var chainAll = this.__chain__, isHybrid = !!this.__actions__.length, isUnwrapped = retUnwrapped && !chainAll, onlyLazy = isLazy && !isHybrid;
  12034. if (!retUnwrapped && useLazy) {
  12035. value = onlyLazy ? value : new LazyWrapper(this);
  12036. var result2 = func.apply(value, args);
  12037. result2.__actions__.push({ "func": thru, "args": [interceptor], "thisArg": undefined$1 });
  12038. return new LodashWrapper(result2, chainAll);
  12039. }
  12040. if (isUnwrapped && onlyLazy) {
  12041. return func.apply(this, args);
  12042. }
  12043. result2 = this.thru(interceptor);
  12044. return isUnwrapped ? isTaker ? result2.value()[0] : result2.value() : result2;
  12045. };
  12046. });
  12047. arrayEach(["pop", "push", "shift", "sort", "splice", "unshift"], function(methodName) {
  12048. var func = arrayProto[methodName], chainName = /^(?:push|sort|unshift)$/.test(methodName) ? "tap" : "thru", retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  12049. lodash2.prototype[methodName] = function() {
  12050. var args = arguments;
  12051. if (retUnwrapped && !this.__chain__) {
  12052. var value = this.value();
  12053. return func.apply(isArray(value) ? value : [], args);
  12054. }
  12055. return this[chainName](function(value2) {
  12056. return func.apply(isArray(value2) ? value2 : [], args);
  12057. });
  12058. };
  12059. });
  12060. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  12061. var lodashFunc = lodash2[methodName];
  12062. if (lodashFunc) {
  12063. var key = lodashFunc.name + "";
  12064. if (!hasOwnProperty.call(realNames, key)) {
  12065. realNames[key] = [];
  12066. }
  12067. realNames[key].push({ "name": methodName, "func": lodashFunc });
  12068. }
  12069. });
  12070. realNames[createHybrid(undefined$1, WRAP_BIND_KEY_FLAG).name] = [{
  12071. "name": "wrapper",
  12072. "func": undefined$1
  12073. }];
  12074. LazyWrapper.prototype.clone = lazyClone;
  12075. LazyWrapper.prototype.reverse = lazyReverse;
  12076. LazyWrapper.prototype.value = lazyValue;
  12077. lodash2.prototype.at = wrapperAt;
  12078. lodash2.prototype.chain = wrapperChain;
  12079. lodash2.prototype.commit = wrapperCommit;
  12080. lodash2.prototype.next = wrapperNext;
  12081. lodash2.prototype.plant = wrapperPlant;
  12082. lodash2.prototype.reverse = wrapperReverse;
  12083. lodash2.prototype.toJSON = lodash2.prototype.valueOf = lodash2.prototype.value = wrapperValue;
  12084. lodash2.prototype.first = lodash2.prototype.head;
  12085. if (symIterator) {
  12086. lodash2.prototype[symIterator] = wrapperToIterator;
  12087. }
  12088. return lodash2;
  12089. };
  12090. var _ = runInContext();
  12091. if (freeModule) {
  12092. (freeModule.exports = _)._ = _;
  12093. freeExports._ = _;
  12094. } else {
  12095. root._ = _;
  12096. }
  12097. }).call(commonjsGlobal);
  12098. })(lodash, lodash.exports);
  12099. var lodashExports = lodash.exports;
  12100. class ListRuleB extends RuleBaseInterface {
  12101. constructor(config) {
  12102. super();
  12103. __publicField(this, "config", {
  12104. onlyTodayData: false
  12105. // 是否只保留当天的数据
  12106. });
  12107. // 寻找父级列表时,找寻的最大级数
  12108. __publicField(this, "findParentsMaxDeep", 5);
  12109. if (config) {
  12110. Object.assign(this.config, config);
  12111. }
  12112. }
  12113. // 主函数:处理DOM并返回所需信息
  12114. run(container = document.body) {
  12115. const { onlyTodayData } = this.config;
  12116. const eligibleNodes = this.findEligibleLeafNodesForContentLtMark(container);
  12117. const findResultNodeList = this.findResultNodeList(eligibleNodes);
  12118. const resultNode = findResultNodeList.filter((temp) => {
  12119. return temp.length > 0;
  12120. });
  12121. const { resultList, todayList } = this.calcResultList(resultNode);
  12122. const result = {
  12123. todayHasData: todayList.length > 0,
  12124. todayData: onlyTodayData ? todayList : resultList
  12125. };
  12126. this.report(result);
  12127. console.log(result, todayList);
  12128. return result;
  12129. }
  12130. check() {
  12131. }
  12132. // 节点过滤
  12133. findResultNodeList(eligibleNodes = []) {
  12134. const groupedNodes = this.groupNodes(eligibleNodes);
  12135. const needNodes = this.checkNeedGroupNode(groupedNodes);
  12136. const correctedNodes = this.checkNodeCountCorrect(needNodes);
  12137. const nodeInfoList = this.calcNodesInfo(correctedNodes);
  12138. return nodeInfoList;
  12139. }
  12140. calcNodesInfo(list = []) {
  12141. return list.map((group) => {
  12142. const parentSelector = this.generateCSSSelector(group[0]._listItem);
  12143. const hasDateNode = group.filter((gChildren) => {
  12144. const arr = this.hasDateElement(gChildren._listItem);
  12145. return arr.some((item) => item.hasDate);
  12146. });
  12147. const dateElementSelector = hasDateNode.map((item) => {
  12148. const date = this.hasDateElement(item._listItem).filter((temp) => {
  12149. return temp.hasDate;
  12150. });
  12151. return {
  12152. ...item,
  12153. dateArr: date
  12154. };
  12155. });
  12156. return dateElementSelector.map((nodeObj) => {
  12157. nodeObj.selector = this.generateCSSSelector(nodeObj.node);
  12158. const href = this.getNodeHref(nodeObj);
  12159. return {
  12160. text: nodeObj.text,
  12161. date: nodeObj.dateArr[0].date,
  12162. selector: nodeObj.selector,
  12163. href,
  12164. // listSelector: this.generateCSSSelector(nodeObj._list),
  12165. parentSelector
  12166. };
  12167. });
  12168. });
  12169. }
  12170. getNodeHref(node) {
  12171. var _a;
  12172. let href = "";
  12173. if (node._listItem) {
  12174. const $listItem = this.$(node._listItem);
  12175. const $a = $listItem.find("a[href]");
  12176. href = (_a = $a[0]) == null ? void 0 : _a.href;
  12177. }
  12178. return href;
  12179. }
  12180. todayDateTest(text = "") {
  12181. let pass = false;
  12182. if (!text)
  12183. return pass;
  12184. const nowDayRegList = this.getTodayDateReg();
  12185. for (let i = 0; i < nowDayRegList.length; i++) {
  12186. const item = nowDayRegList[i];
  12187. if (item.test(text)) {
  12188. pass = true;
  12189. break;
  12190. }
  12191. }
  12192. return pass;
  12193. }
  12194. calcResultList(resultNode = []) {
  12195. const todayList = [];
  12196. const resultList = resultNode.flat();
  12197. resultList.forEach((r) => {
  12198. const dateArr = r.date;
  12199. if (Array.isArray(dateArr)) {
  12200. for (let i = 0; i < dateArr.length; i++) {
  12201. const item = dateArr[i];
  12202. const today = this.todayDateTest(item);
  12203. if (today) {
  12204. todayList.push(r);
  12205. break;
  12206. }
  12207. }
  12208. }
  12209. });
  12210. return {
  12211. resultList,
  12212. todayList
  12213. };
  12214. }
  12215. // 辅助函数:遍历DOM节点,查找符合条件的末级节点
  12216. findEligibleLeafNodesForContentLtMark(node) {
  12217. return this.findEligibleLeafNodes(node, (node2) => {
  12218. const chineseChars = this.countChineseCharacters((node2 == null ? void 0 : node2.textContent) || "");
  12219. return chineseChars >= this.minTitleLength && !this.checkNodeHidden(node2);
  12220. });
  12221. }
  12222. // 辅助函数:根据父节点对末级节点进行分组
  12223. groupNodes(nodes) {
  12224. this.findTableInPage();
  12225. let result = this.groupNodesBySiblings(nodes);
  12226. if (this.checkNeedGroupNode(result).length <= 0) {
  12227. result = this.groupNodesByParent(nodes);
  12228. }
  12229. return result;
  12230. }
  12231. findTableInPage() {
  12232. const step = 3;
  12233. const table = this.$("table");
  12234. if (table.length > 0) {
  12235. this.findParentsMaxDeep += step;
  12236. }
  12237. }
  12238. // 保留元素个数在5个以上的分组
  12239. checkNeedGroupNode(list) {
  12240. const s = list.filter((group) => group.length > 5);
  12241. return s;
  12242. }
  12243. // 分组函数(以nodesItem中的某个值为id进行分组)
  12244. groupedListByList(nodes, key = "_list") {
  12245. const groupArr = [];
  12246. nodes.forEach((nodeObj) => {
  12247. const target = groupArr.find((g) => g.id === nodeObj[key]);
  12248. if (target && Array.isArray(target.list)) {
  12249. target.list.push(nodeObj);
  12250. } else {
  12251. groupArr.push({
  12252. id: nodeObj[key],
  12253. list: [nodeObj]
  12254. });
  12255. }
  12256. });
  12257. const sortedArr = [];
  12258. groupArr.forEach((g) => {
  12259. if (Array.isArray(g.list) && g.list.length > 0) {
  12260. sortedArr.push(g.list);
  12261. }
  12262. });
  12263. return sortedArr;
  12264. }
  12265. groupNodesBySiblings(nodes) {
  12266. nodes.forEach((node) => {
  12267. var _a;
  12268. const {
  12269. parentNodeArr,
  12270. // parentSiblingsCountArr,
  12271. parentSiblingsWeightArr
  12272. } = this.getNodeParentsSiblingsArr(node.node);
  12273. const targetArr = parentSiblingsWeightArr;
  12274. const maxSiblingCount = getMaxCount(targetArr);
  12275. const maxIndex = targetArr.indexOf(maxSiblingCount);
  12276. node._listItem = parentNodeArr[maxIndex];
  12277. node._list = (_a = node._listItem) == null ? void 0 : _a.parentNode;
  12278. node.weight = this.calcWeight(node);
  12279. });
  12280. const grouped1 = this.groupedListByList(nodes);
  12281. return grouped1;
  12282. }
  12283. createGroupId(node) {
  12284. var _a, _b;
  12285. if (node._list) {
  12286. const pClassNameStr = (_a = node._list) == null ? void 0 : _a.className;
  12287. const listItemClassNameStr = (_b = node._listItem) == null ? void 0 : _b.className;
  12288. node._groupId = `${this.getTagName(node._list)}__${pClassNameStr}__${this.getTagName(node.node)}__${listItemClassNameStr}`;
  12289. } else {
  12290. node._groupId = node._list;
  12291. }
  12292. }
  12293. // 列表根据元素标签,元素className进行分类。
  12294. calcClassifyNode(nodeList = []) {
  12295. if (!Array.isArray(nodeList))
  12296. return;
  12297. const map = {};
  12298. nodeList.forEach((item) => {
  12299. const elem = item.node;
  12300. if (!elem)
  12301. return;
  12302. let id = "__";
  12303. if (elem.nodeType === Node.ELEMENT_NODE) {
  12304. id = `${elem.tagName}_${Array.from(elem.classList)}`;
  12305. } else if (elem.nodeType === Node.TEXT_NODE) {
  12306. id = `text_`;
  12307. }
  12308. if (map[id]) {
  12309. map[id].push(item);
  12310. } else {
  12311. map[id] = [item];
  12312. }
  12313. });
  12314. return map;
  12315. }
  12316. getMaxValueLength(map = {}) {
  12317. if (!map)
  12318. return;
  12319. let max = -Infinity;
  12320. let maxItem = "";
  12321. for (const key in map) {
  12322. const item = key;
  12323. if (Array.isArray(item)) {
  12324. if (item.length > max && item.length > 0) {
  12325. max = item.length;
  12326. maxItem = item;
  12327. }
  12328. }
  12329. }
  12330. return maxItem;
  12331. }
  12332. checkNodeCountCorrect(needNode = []) {
  12333. const listChildrenArr = [];
  12334. const listDOMChildrenArr = [];
  12335. needNode.forEach((group) => {
  12336. if (Array.isArray(group)) {
  12337. listChildrenArr.push(group.length);
  12338. if (group[0] && group[0]._list) {
  12339. const _list = group[0]._list;
  12340. listDOMChildrenArr.push(_list == null ? void 0 : _list.childElementCount);
  12341. }
  12342. }
  12343. });
  12344. if (lodashExports.isEqual(listChildrenArr, listDOMChildrenArr) && needNode.length <= 1) {
  12345. return needNode;
  12346. }
  12347. let targetList = needNode.flat().sort((a, b) => {
  12348. return b.weight - a.weight;
  12349. });
  12350. targetList = lodashExports.uniqWith(targetList, function(a, b) {
  12351. const hasListItem = a._listItem && b._listItem;
  12352. return hasListItem && a._listItem === b._listItem;
  12353. });
  12354. const textGroupArr = this.groupedListByList(targetList);
  12355. if (Array.isArray(textGroupArr) && textGroupArr.length > 0) {
  12356. let maxWeight = -Infinity;
  12357. let maxWeightArr = [];
  12358. textGroupArr.forEach((group) => {
  12359. if (Array.isArray(group)) {
  12360. const groupLength = group.length > 3;
  12361. const avg = lodashExports.meanBy(group, "weight");
  12362. if (avg > maxWeight && groupLength) {
  12363. maxWeight = avg;
  12364. maxWeightArr = group;
  12365. }
  12366. }
  12367. });
  12368. if (maxWeightArr.length > 0) {
  12369. let maxNodeExample = maxWeightArr[0];
  12370. const resMap = this.calcClassifyNode(maxWeightArr);
  12371. if (Object.keys(resMap).length > 1) {
  12372. const maxItem = this.getMaxValueLength(resMap);
  12373. if (Array.isArray(maxItem) && maxItem.length > 0) {
  12374. maxNodeExample = maxItem[0];
  12375. }
  12376. }
  12377. const maxNodeExampleNode = maxNodeExample.node;
  12378. const maxNodeTextSelector = [`${maxNodeExampleNode.localName}`];
  12379. if (maxNodeExampleNode.classList) {
  12380. maxNodeTextSelector.push(`${Array.from(maxNodeExampleNode.classList).join(".")}`);
  12381. }
  12382. const maxNodeTextSelectorText = maxNodeTextSelector.filter((v) => !!v).join(".");
  12383. const maxNodeExampleList = maxNodeExample._list;
  12384. if (maxNodeExampleList) {
  12385. const $list = this.$(maxNodeExampleList);
  12386. const listChildren = $list.children();
  12387. const listItemArr = maxWeightArr.map((node) => {
  12388. return node._listItem;
  12389. });
  12390. listChildren.each((_, item) => {
  12391. if (!listItemArr.includes(item)) {
  12392. const nodeItemExp = Object.assign({}, maxNodeExample);
  12393. const $listItem = this.$(item);
  12394. const target = $listItem.find(maxNodeTextSelectorText);
  12395. const text = target.text();
  12396. if (text) {
  12397. nodeItemExp.node = target[0];
  12398. nodeItemExp.text = text;
  12399. nodeItemExp.weight = this.calcWeight(nodeItemExp);
  12400. nodeItemExp._listItem = item;
  12401. maxWeightArr.push(nodeItemExp);
  12402. }
  12403. }
  12404. });
  12405. }
  12406. }
  12407. if (maxWeightArr.length > 0) {
  12408. return [maxWeightArr];
  12409. } else {
  12410. return [];
  12411. }
  12412. } else {
  12413. return [targetList];
  12414. }
  12415. }
  12416. // 分组算法1:根据父元素进行分组,相同父元素为一组
  12417. groupNodesByParent(nodes = []) {
  12418. const groups = {};
  12419. nodes.forEach((nodeObj) => {
  12420. const parent = nodeObj.node.parentNode;
  12421. if (!groups[parent]) {
  12422. groups[parent] = [];
  12423. }
  12424. groups[parent].push(nodeObj);
  12425. });
  12426. return Object.entries(groups).map(([_, group]) => group);
  12427. }
  12428. // 获取每个元素的父级,最多获取5级,如果遇到取不到parentNode的情况,直接结束寻找,并返回结果
  12429. // 排除body和body的直接子集
  12430. getNodeParentsSiblingsArr(node) {
  12431. const parentNodeArr = [];
  12432. const parentSiblingsCountArr = [];
  12433. const parentSiblingsWeightArr = [];
  12434. const maxDeep = this.findParentsMaxDeep;
  12435. let parent = node.parentNode;
  12436. for (let i = 0; i < maxDeep; i++) {
  12437. if (!parent) {
  12438. break;
  12439. }
  12440. if (parent.tagName === "BODY") {
  12441. parentNodeArr.pop();
  12442. parentSiblingsCountArr.pop();
  12443. parentSiblingsWeightArr.pop();
  12444. break;
  12445. }
  12446. const parentSiblings = getSiblings(parent);
  12447. if (Array.isArray(parentSiblings)) {
  12448. parentSiblingsCountArr.push(parentSiblings.length);
  12449. const weight = parentSiblings.length * ((maxDeep - i) * 20);
  12450. parentSiblingsWeightArr.push(weight);
  12451. }
  12452. parentNodeArr.push(parent);
  12453. parent = parent.parentNode;
  12454. }
  12455. return {
  12456. parentNodeArr,
  12457. parentSiblingsCountArr,
  12458. parentSiblingsWeightArr
  12459. };
  12460. }
  12461. // 辅助函数:生成CSS选择器
  12462. generateCSSSelector(element) {
  12463. if (!element) {
  12464. return;
  12465. }
  12466. let selector = this.getTagName(element).toLowerCase();
  12467. if (element.id) {
  12468. selector = `#${element.id}`;
  12469. } else {
  12470. let siblings = [];
  12471. if (element.parentNode) {
  12472. siblings = Array.from(element.parentNode.children);
  12473. }
  12474. const index = siblings.indexOf(element) + 1;
  12475. selector += `:nth-child(${index})`;
  12476. }
  12477. if (element.parentNode && element.parentNode !== document.body) {
  12478. selector = `${this.generateCSSSelector(element.parentNode)} > ${selector}`;
  12479. }
  12480. return selector;
  12481. }
  12482. // 辅助函数:检测节点或其后代中是否包含日期元素
  12483. hasDateElement(node) {
  12484. let tagList = this.findEligibleLeafNodes(node, () => true);
  12485. tagList = tagList.map((i) => i.node);
  12486. const arr = tagList.map((elem) => {
  12487. var _a;
  12488. const dateArr = this.extractDates((_a = elem.textContent) == null ? void 0 : _a.trim());
  12489. return {
  12490. date: dateArr,
  12491. hasDate: dateArr.length > 0,
  12492. textContent: elem.textContent
  12493. };
  12494. });
  12495. return arr;
  12496. }
  12497. // 辅助函数:整理今日日期格式
  12498. getTodayDateReg() {
  12499. return this.todayPatterns;
  12500. }
  12501. // 传入node计算权重
  12502. // 1. 包含特殊字符的权重为10
  12503. // 2. 特殊标签h1/h2/h3/h4/h5/a权重为8
  12504. // 3. 文字长度权重=文字长度*0.05
  12505. calcWeight(node) {
  12506. var _a, _b;
  12507. const titleMaxLength = 35;
  12508. const weightMap = {
  12509. importKey: 14,
  12510. importTag: 8,
  12511. className: 3,
  12512. textLength: 0.05,
  12513. maxTextLength: -0.1,
  12514. companyName: -3
  12515. };
  12516. let weight = 0;
  12517. for (let i = 0; i < this.importantKeyList.length; i++) {
  12518. const key = this.importantKeyList[i];
  12519. if (node.text.includes(key)) {
  12520. weight += weightMap.importKey;
  12521. break;
  12522. }
  12523. }
  12524. const tagName = this.getTagName(node.node);
  12525. if (this.importantTagList.includes(tagName)) {
  12526. weight += weightMap.importTag;
  12527. }
  12528. if ((_a = node.node) == null ? void 0 : _a.className) {
  12529. const className = (_b = node.node) == null ? void 0 : _b.className;
  12530. const targetStrList = ["title"];
  12531. for (let i = 0; i < targetStrList.length; i++) {
  12532. const item = targetStrList[i];
  12533. if (className.includes(item)) {
  12534. weight += weightMap.className;
  12535. break;
  12536. }
  12537. }
  12538. }
  12539. if (this.isCompanyName(node.text)) {
  12540. weight += weightMap.companyName;
  12541. }
  12542. const textLength = node.text ? node.text.length : 0;
  12543. weight += textLength * weightMap.textLength;
  12544. if (textLength >= titleMaxLength) {
  12545. const maxTextLengthWeight = (textLength - weightMap.maxTextLength) * weightMap.maxTextLength;
  12546. weight += maxTextLengthWeight;
  12547. }
  12548. return weight;
  12549. }
  12550. }
  12551. class ContentRuleA extends RuleBaseInterface {
  12552. constructor(config) {
  12553. super();
  12554. __publicField(this, "importPublishTimeKey", ["发布时间"]);
  12555. __publicField(this, "minContentTextLength", 50);
  12556. // 正文最小值,小于该值的丢弃
  12557. __publicField(this, "maxDeep", 5);
  12558. __publicField(this, "config", {
  12559. titleList: []
  12560. });
  12561. if (config) {
  12562. Object.assign(this.config, config);
  12563. }
  12564. }
  12565. // 主函数:处理DOM并返回所需信息
  12566. run(container = document.body) {
  12567. var _a;
  12568. const { titleList } = this.config;
  12569. let eligibleNodes = [];
  12570. if (Array.isArray(titleList)) {
  12571. titleList.forEach((t) => {
  12572. const gotNodes = this.findEligibleLeafNodesForContentLtMark(container, t);
  12573. if (Array.isArray(gotNodes) && gotNodes.length > 0) {
  12574. eligibleNodes = eligibleNodes.concat(gotNodes);
  12575. }
  12576. });
  12577. } else if (typeof titleList === "string") {
  12578. eligibleNodes = this.findEligibleLeafNodesForContentLtMark(container, titleList);
  12579. }
  12580. const needNodes = this.calcNodesInfo(eligibleNodes);
  12581. const contentNodeOptions = this.getNeedNodesParentsAndSiblings(needNodes);
  12582. const dateTime = this.findTargetDateTime(needNodes);
  12583. let targetNode = null;
  12584. if (contentNodeOptions.length > 0) {
  12585. targetNode = contentNodeOptions[0];
  12586. if (targetNode.node) {
  12587. targetNode.node = this.simplifyDOM(targetNode.node);
  12588. }
  12589. }
  12590. const result = {
  12591. href: location.href,
  12592. title: titleList[0],
  12593. content: targetNode ? (_a = targetNode.node) == null ? void 0 : _a.innerHTML : "",
  12594. publishtime: dateTime
  12595. };
  12596. console.log({
  12597. ...result,
  12598. eligibleNodes,
  12599. needNodes,
  12600. contentNodeOptions,
  12601. targetNode
  12602. });
  12603. this.report(result);
  12604. return result;
  12605. }
  12606. check() {
  12607. }
  12608. findEligibleLeafNodesForContentLtMark(node, markText) {
  12609. if (!markText) {
  12610. markText = "";
  12611. }
  12612. const maskTextSorted = markText.trim().replace(/\.{2,}/g, "");
  12613. return this.findEligibleLeafNodes(node, (node2) => {
  12614. const contentText = node2 == null ? void 0 : node2.textContent;
  12615. if (contentText && contentText.includes(maskTextSorted)) {
  12616. return true;
  12617. } else {
  12618. return false;
  12619. }
  12620. });
  12621. }
  12622. // 找发布时间
  12623. findTargetDateTime(nodes = []) {
  12624. if (!Array.isArray(nodes)) {
  12625. return;
  12626. }
  12627. if (nodes.length <= 0) {
  12628. return;
  12629. }
  12630. let targetList = [];
  12631. for (let i = 0; i < nodes.length; i++) {
  12632. const node = nodes[i];
  12633. const dateTimeArr = this.findDateTimeString(node);
  12634. dateTimeArr.forEach((item) => {
  12635. item.baseNodeIndex = i;
  12636. });
  12637. targetList = targetList.concat(dateTimeArr);
  12638. }
  12639. targetList = targetList.filter((item) => {
  12640. return this.hasMatchPublishTimeKey(item);
  12641. });
  12642. targetList.forEach((item) => {
  12643. item.weight = this.calcDateTimeWeight(item);
  12644. });
  12645. const sorted = targetList.sort((a, b) => b.weight - a.weight);
  12646. if (sorted.length > 1) {
  12647. const tar = sorted[0];
  12648. if (Array.isArray(tar.times) && tar.times.length > 1) {
  12649. return tar.times[0];
  12650. }
  12651. }
  12652. }
  12653. findDateTimeString(node) {
  12654. const elem = node.node;
  12655. if (!node.node) {
  12656. return;
  12657. }
  12658. const arr = this.getEachNeedNodeParentsAndSiblings(elem, ({ item, deep }) => {
  12659. const text = item.innerText;
  12660. if (text) {
  12661. const r = this.extractDates(text);
  12662. if (r && Array.isArray(r) && r.length > 0) {
  12663. return {
  12664. times: r,
  12665. node: item
  12666. };
  12667. } else {
  12668. return false;
  12669. }
  12670. } else {
  12671. return false;
  12672. }
  12673. });
  12674. return arr;
  12675. }
  12676. getNeedNodesParentsAndSiblings(nodes = []) {
  12677. if (!Array.isArray(nodes))
  12678. return;
  12679. let arr = [];
  12680. nodes.forEach((node) => {
  12681. const passInfoArr = this.getEachNeedNodeParentsAndSiblings(node.node, ({ item, deep }) => {
  12682. const text = item.innerText;
  12683. if (text && text.length > this.minContentTextLength) {
  12684. const passInfo = {
  12685. node: item,
  12686. text
  12687. };
  12688. passInfo.weight = this.calcContentWeight(passInfo, deep);
  12689. return passInfo;
  12690. } else {
  12691. return false;
  12692. }
  12693. });
  12694. if (passInfoArr.length > 0) {
  12695. arr = arr.concat(passInfoArr);
  12696. }
  12697. });
  12698. return arr.sort((a, b) => b.weight - a.weight);
  12699. }
  12700. // 通用函数:找兄弟元素以及父级元素兄弟元素
  12701. getEachNeedNodeParentsAndSiblings(elem, callback, deep = this.maxDeep) {
  12702. if (!elem)
  12703. return;
  12704. let passElemArr = [];
  12705. const $elem = this.$(elem);
  12706. const $parent = $elem.parent();
  12707. const siblings = $elem.siblings();
  12708. if (siblings.length > 0) {
  12709. siblings.each((i, item) => {
  12710. const tagName = this.getTagName(item);
  12711. const isExcludeTags = this.excludeTags.includes(tagName);
  12712. const passInfo = callback && callback({ item, deep });
  12713. if (passInfo && !isExcludeTags) {
  12714. passElemArr.push(passInfo);
  12715. }
  12716. });
  12717. }
  12718. if (deep > 0) {
  12719. const passArr = this.getEachNeedNodeParentsAndSiblings($parent[0], callback, --deep);
  12720. passElemArr = passElemArr.concat(passArr);
  12721. }
  12722. return passElemArr;
  12723. }
  12724. calcNodesInfo(nodes = []) {
  12725. if (!Array.isArray(nodes))
  12726. return;
  12727. const weightNodes = nodes.map((n) => {
  12728. n.weight = this.calcTitleWeight(n);
  12729. return n;
  12730. });
  12731. return weightNodes.sort((a, b) => b.weight - a.weight);
  12732. }
  12733. simplifyDOM(elem) {
  12734. const $elem = this.$(elem);
  12735. $elem.find("style").remove();
  12736. $elem.find("script").remove();
  12737. return elem;
  12738. }
  12739. calcTitleWeight(node) {
  12740. var _a, _b;
  12741. const titleMaxLength = 25;
  12742. const weightMap = {
  12743. importTag: 8,
  12744. className: 3,
  12745. textLength: 0.05,
  12746. maxTextLength: -0.1
  12747. };
  12748. let weight = 0;
  12749. const tagName = this.getTagName(node.node);
  12750. if (this.importantTagList.includes(tagName)) {
  12751. weight += weightMap.importTag;
  12752. }
  12753. if ((_a = node.node) == null ? void 0 : _a.className) {
  12754. const className = (_b = node.node) == null ? void 0 : _b.className;
  12755. const targetStrList = ["title"];
  12756. for (let i = 0; i < targetStrList.length; i++) {
  12757. const item = targetStrList[i];
  12758. if (className.includes(item)) {
  12759. weight += weightMap.className;
  12760. break;
  12761. }
  12762. }
  12763. }
  12764. const textLength = node.text ? node.text.length : 0;
  12765. weight += textLength * weightMap.textLength;
  12766. if (textLength >= titleMaxLength) {
  12767. const maxTextLengthWeight = (textLength - weightMap.maxTextLength) * weightMap.maxTextLength;
  12768. weight += maxTextLengthWeight;
  12769. }
  12770. return weight;
  12771. }
  12772. calcContentWeight(node, deep) {
  12773. const weightMap = {
  12774. textLength: 0.05,
  12775. deep: [200, 170, 90, 50, 20, 10]
  12776. // 从元素往上走,兄弟元素视为第0级,
  12777. // children: -1, // 子元素越多,权重越小
  12778. };
  12779. let weight = 0;
  12780. const weightDeepValue = weightMap.deep[this.maxDeep - deep] || 1;
  12781. const textLength = node.text ? node.text.length : 0;
  12782. weight += textLength * weightMap.textLength;
  12783. if (weightDeepValue) {
  12784. weight += weightDeepValue;
  12785. }
  12786. return weight;
  12787. }
  12788. calcDateTimeWeight(node) {
  12789. const textMaxLength = 30;
  12790. const weightMap = {
  12791. importKey: 300,
  12792. className: 30,
  12793. baseNodeIndex: [200, 170, 90, 50, 20, 10],
  12794. // 从元素往上走,兄弟元素视为第0级,
  12795. maxTextLength: -3
  12796. };
  12797. let weight = 0;
  12798. if (!node)
  12799. return weight;
  12800. const elem = node.node;
  12801. const baseIndex = node.baseNodeIndex;
  12802. const weightDeepValue = weightMap.baseNodeIndex[baseIndex] || 1;
  12803. if (weightDeepValue) {
  12804. weight += weightDeepValue;
  12805. }
  12806. if (elem == null ? void 0 : elem.className) {
  12807. const className = elem == null ? void 0 : elem.className;
  12808. const targetStrList = ["time"];
  12809. for (let i = 0; i < targetStrList.length; i++) {
  12810. const item = targetStrList[i];
  12811. if (className.includes(item)) {
  12812. weight += weightMap.className;
  12813. break;
  12814. }
  12815. }
  12816. }
  12817. if (elem == null ? void 0 : elem.innerText) {
  12818. const text = elem == null ? void 0 : elem.innerText;
  12819. if (text.length >= textMaxLength) {
  12820. const maxTextLengthWeight = (text.length - textMaxLength) * weightMap.maxTextLength;
  12821. weight += maxTextLengthWeight;
  12822. }
  12823. }
  12824. return weight;
  12825. }
  12826. hasMatchPublishTimeKey(node) {
  12827. const elem = node.node;
  12828. const target = [];
  12829. for (let i = 0; i < this.importPublishTimeKey.length; i++) {
  12830. const key = this.importPublishTimeKey[i];
  12831. const selfText = elem == null ? void 0 : elem.innerText;
  12832. if (selfText.includes(key)) {
  12833. target.push(node);
  12834. break;
  12835. }
  12836. const arr = this.getEachNeedNodeParentsAndSiblings(elem, ({ item }) => {
  12837. const text = item.innerText;
  12838. if (text) {
  12839. const matched = text.includes(key);
  12840. if (matched) {
  12841. return elem;
  12842. }
  12843. }
  12844. }, 0);
  12845. if (arr.length > 0) {
  12846. target.push(node);
  12847. break;
  12848. }
  12849. }
  12850. return target.length > 0;
  12851. }
  12852. }
  12853. class FindFileAttachment {
  12854. constructor() {
  12855. __publicField(this, "extensions", ["pdf", "doc", "docx", "xls", "xlsx", "zip", "rar", "PDF", "DOC", "DOCX", "XLS", "XLSX", "ZIP", "RAR"]);
  12856. __publicField(this, "uploadUrl", "http://127.0.0.1:18080/uploadFile");
  12857. }
  12858. run(container = document.body) {
  12859. const fileAttachmentTagOptions = this.findFileAttachmentTag(container);
  12860. this.doFileListDownload(fileAttachmentTagOptions);
  12861. const targetFiles = fileAttachmentTagOptions.map((f) => {
  12862. return {
  12863. title: f.title,
  12864. href: f.href,
  12865. filename: f.filename
  12866. };
  12867. });
  12868. const result = {
  12869. files: targetFiles
  12870. };
  12871. console.log({
  12872. ...result,
  12873. fileAttachmentTagOptions
  12874. });
  12875. return result;
  12876. }
  12877. findFileAttachmentTag(container) {
  12878. const ns = [];
  12879. const extensions = this.extensions;
  12880. const extensionRegex = new RegExp("\\.(" + extensions.join("|") + ")$", "i");
  12881. const aTagList = container.querySelectorAll("a[href]");
  12882. aTagList.forEach((v, i) => {
  12883. v.setAttribute("target", "_blank");
  12884. const linkText = v.innerText;
  12885. const href = v.href;
  12886. const filename = v.download || v.filename || linkText;
  12887. if (extensionRegex.test(linkText.toLowerCase()) || extensionRegex.test(href.toLowerCase())) {
  12888. ns.push({
  12889. node: v,
  12890. title: linkText,
  12891. href: v.href,
  12892. filename
  12893. });
  12894. }
  12895. });
  12896. return ns;
  12897. }
  12898. // 文件批量下载
  12899. doFileListDownload(list = []) {
  12900. if (Array.isArray(list)) {
  12901. list.forEach((item) => {
  12902. this.download(item.href, item.filename);
  12903. });
  12904. }
  12905. }
  12906. // 文件下载上传
  12907. // 这是一个JavaScript代码,用于劫持浏览器下载附件。首先通过fetch请求获取文件内容,然后将文件内容转换为blob对象。接着创建一个FormData对象,将文件名和文件内容添加到其中。最后,将文件上传到服务器,并在上传成功后处理服务器返回的数据。
  12908. download(href, filename) {
  12909. const articleUrl = location.href;
  12910. fetch(href).then((response) => {
  12911. if (!response.ok) {
  12912. throw new Error("Network response was not ok");
  12913. }
  12914. return response.blob();
  12915. }).then((blob) => {
  12916. const formData = new FormData();
  12917. formData.append("filename", filename);
  12918. formData.append("file", blob, filename);
  12919. formData.append("orgurl", href);
  12920. formData.append("articleurl", articleUrl);
  12921. return fetch(this.uploadUrl, {
  12922. method: "POST",
  12923. body: formData
  12924. });
  12925. }).then((uploadResponse) => {
  12926. if (!uploadResponse.ok) {
  12927. throw new Error("Upload failed!");
  12928. }
  12929. console.log("File uploaded successfully!");
  12930. return uploadResponse.json();
  12931. }).then((data) => {
  12932. console.log(data);
  12933. }).catch((error) => {
  12934. console.error("Error:", error);
  12935. });
  12936. }
  12937. }
  12938. function runNow() {
  12939. const rulesList = [
  12940. // new ListRuleA(),
  12941. // new ListRuleB()
  12942. // new ContentRuleA(),
  12943. new FindFileAttachment()
  12944. ];
  12945. const r = new JsSpiderSDK(rulesList, {
  12946. useAsync: false
  12947. });
  12948. r.run();
  12949. return {
  12950. core: r,
  12951. rulesList
  12952. };
  12953. }
  12954. window.spiderSdk = {
  12955. version,
  12956. SpiderCore: JsSpiderSDK,
  12957. RuleBase: RuleBaseInterface,
  12958. ListRuleB,
  12959. ContentRuleA,
  12960. FindFileAttachment,
  12961. runNow
  12962. };
  12963. runNow();
  12964. })();