1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262 |
- var __defProp = Object.defineProperty;
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
- var __publicField = (obj, key, value) => {
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
- return value;
- };
- (function() {
- "use strict";
- const version = "1.0.0";
- class JsSpiderSDK {
- // 初始化,传入规则
- constructor(rules = [], config = {}) {
- __publicField(this, "rulesList", []);
- __publicField(this, "config", {
- useAsync: true
- });
- this.rulesList = rules;
- Object.assign(this.config, config);
- }
- async run(conf) {
- const { useAsync } = this.config;
- let result = [];
- if (useAsync) {
- const rulesRunPromiseList = this.rulesList.map((rule) => rule.run());
- result = await Promise.all(rulesRunPromiseList);
- } else {
- for (let i = 0; i < this.rulesList.length; i++) {
- const rule = this.rulesList[i];
- const runRes = await rule.run(conf);
- result.push(runRes);
- }
- }
- return result;
- }
- check() {
- }
- }
- var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
- function getDefaultExportFromCjs(x) {
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
- }
- var jquery = { exports: {} };
- /*!
- * jQuery JavaScript Library v3.7.1
- * https://jquery.com/
- *
- * Copyright OpenJS Foundation and other contributors
- * Released under the MIT license
- * https://jquery.org/license
- *
- * Date: 2023-08-28T13:37Z
- */
- (function(module) {
- (function(global2, factory) {
- {
- module.exports = global2.document ? factory(global2, true) : function(w) {
- if (!w.document) {
- throw new Error("jQuery requires a window with a document");
- }
- return factory(w);
- };
- }
- })(typeof window !== "undefined" ? window : commonjsGlobal, function(window2, noGlobal) {
- var arr = [];
- var getProto = Object.getPrototypeOf;
- var slice = arr.slice;
- var flat = arr.flat ? function(array) {
- return arr.flat.call(array);
- } : function(array) {
- return arr.concat.apply([], array);
- };
- var push = arr.push;
- var indexOf = arr.indexOf;
- var class2type = {};
- var toString = class2type.toString;
- var hasOwn = class2type.hasOwnProperty;
- var fnToString = hasOwn.toString;
- var ObjectFunctionString = fnToString.call(Object);
- var support = {};
- var isFunction = function isFunction2(obj) {
- return typeof obj === "function" && typeof obj.nodeType !== "number" && typeof obj.item !== "function";
- };
- var isWindow = function isWindow2(obj) {
- return obj != null && obj === obj.window;
- };
- var document2 = window2.document;
- var preservedScriptAttributes = {
- type: true,
- src: true,
- nonce: true,
- noModule: true
- };
- function DOMEval(code, node, doc) {
- doc = doc || document2;
- var i, val, script = doc.createElement("script");
- script.text = code;
- if (node) {
- for (i in preservedScriptAttributes) {
- val = node[i] || node.getAttribute && node.getAttribute(i);
- if (val) {
- script.setAttribute(i, val);
- }
- }
- }
- doc.head.appendChild(script).parentNode.removeChild(script);
- }
- function toType(obj) {
- if (obj == null) {
- return obj + "";
- }
- return typeof obj === "object" || typeof obj === "function" ? class2type[toString.call(obj)] || "object" : typeof obj;
- }
- var version2 = "3.7.1", rhtmlSuffix = /HTML$/i, jQuery = function(selector, context) {
- return new jQuery.fn.init(selector, context);
- };
- jQuery.fn = jQuery.prototype = {
- // The current version of jQuery being used
- jquery: version2,
- constructor: jQuery,
- // The default length of a jQuery object is 0
- length: 0,
- toArray: function() {
- return slice.call(this);
- },
- // Get the Nth element in the matched element set OR
- // Get the whole matched element set as a clean array
- get: function(num) {
- if (num == null) {
- return slice.call(this);
- }
- return num < 0 ? this[num + this.length] : this[num];
- },
- // Take an array of elements and push it onto the stack
- // (returning the new matched element set)
- pushStack: function(elems) {
- var ret = jQuery.merge(this.constructor(), elems);
- ret.prevObject = this;
- return ret;
- },
- // Execute a callback for every element in the matched set.
- each: function(callback) {
- return jQuery.each(this, callback);
- },
- map: function(callback) {
- return this.pushStack(jQuery.map(this, function(elem, i) {
- return callback.call(elem, i, elem);
- }));
- },
- slice: function() {
- return this.pushStack(slice.apply(this, arguments));
- },
- first: function() {
- return this.eq(0);
- },
- last: function() {
- return this.eq(-1);
- },
- even: function() {
- return this.pushStack(jQuery.grep(this, function(_elem, i) {
- return (i + 1) % 2;
- }));
- },
- odd: function() {
- return this.pushStack(jQuery.grep(this, function(_elem, i) {
- return i % 2;
- }));
- },
- eq: function(i) {
- var len = this.length, j = +i + (i < 0 ? len : 0);
- return this.pushStack(j >= 0 && j < len ? [this[j]] : []);
- },
- end: function() {
- return this.prevObject || this.constructor();
- },
- // For internal use only.
- // Behaves like an Array's method, not like a jQuery method.
- push,
- sort: arr.sort,
- splice: arr.splice
- };
- jQuery.extend = jQuery.fn.extend = function() {
- var options, name, src, copy, copyIsArray, clone, target = arguments[0] || {}, i = 1, length = arguments.length, deep = false;
- if (typeof target === "boolean") {
- deep = target;
- target = arguments[i] || {};
- i++;
- }
- if (typeof target !== "object" && !isFunction(target)) {
- target = {};
- }
- if (i === length) {
- target = this;
- i--;
- }
- for (; i < length; i++) {
- if ((options = arguments[i]) != null) {
- for (name in options) {
- copy = options[name];
- if (name === "__proto__" || target === copy) {
- continue;
- }
- if (deep && copy && (jQuery.isPlainObject(copy) || (copyIsArray = Array.isArray(copy)))) {
- src = target[name];
- if (copyIsArray && !Array.isArray(src)) {
- clone = [];
- } else if (!copyIsArray && !jQuery.isPlainObject(src)) {
- clone = {};
- } else {
- clone = src;
- }
- copyIsArray = false;
- target[name] = jQuery.extend(deep, clone, copy);
- } else if (copy !== void 0) {
- target[name] = copy;
- }
- }
- }
- }
- return target;
- };
- jQuery.extend({
- // Unique for each copy of jQuery on the page
- expando: "jQuery" + (version2 + Math.random()).replace(/\D/g, ""),
- // Assume jQuery is ready without the ready module
- isReady: true,
- error: function(msg) {
- throw new Error(msg);
- },
- noop: function() {
- },
- isPlainObject: function(obj) {
- var proto, Ctor;
- if (!obj || toString.call(obj) !== "[object Object]") {
- return false;
- }
- proto = getProto(obj);
- if (!proto) {
- return true;
- }
- Ctor = hasOwn.call(proto, "constructor") && proto.constructor;
- return typeof Ctor === "function" && fnToString.call(Ctor) === ObjectFunctionString;
- },
- isEmptyObject: function(obj) {
- var name;
- for (name in obj) {
- return false;
- }
- return true;
- },
- // Evaluates a script in a provided context; falls back to the global one
- // if not specified.
- globalEval: function(code, options, doc) {
- DOMEval(code, { nonce: options && options.nonce }, doc);
- },
- each: function(obj, callback) {
- var length, i = 0;
- if (isArrayLike(obj)) {
- length = obj.length;
- for (; i < length; i++) {
- if (callback.call(obj[i], i, obj[i]) === false) {
- break;
- }
- }
- } else {
- for (i in obj) {
- if (callback.call(obj[i], i, obj[i]) === false) {
- break;
- }
- }
- }
- return obj;
- },
- // Retrieve the text value of an array of DOM nodes
- text: function(elem) {
- var node, ret = "", i = 0, nodeType = elem.nodeType;
- if (!nodeType) {
- while (node = elem[i++]) {
- ret += jQuery.text(node);
- }
- }
- if (nodeType === 1 || nodeType === 11) {
- return elem.textContent;
- }
- if (nodeType === 9) {
- return elem.documentElement.textContent;
- }
- if (nodeType === 3 || nodeType === 4) {
- return elem.nodeValue;
- }
- return ret;
- },
- // results is for internal usage only
- makeArray: function(arr2, results) {
- var ret = results || [];
- if (arr2 != null) {
- if (isArrayLike(Object(arr2))) {
- jQuery.merge(
- ret,
- typeof arr2 === "string" ? [arr2] : arr2
- );
- } else {
- push.call(ret, arr2);
- }
- }
- return ret;
- },
- inArray: function(elem, arr2, i) {
- return arr2 == null ? -1 : indexOf.call(arr2, elem, i);
- },
- isXMLDoc: function(elem) {
- var namespace = elem && elem.namespaceURI, docElem = elem && (elem.ownerDocument || elem).documentElement;
- return !rhtmlSuffix.test(namespace || docElem && docElem.nodeName || "HTML");
- },
- // Support: Android <=4.0 only, PhantomJS 1 only
- // push.apply(_, arraylike) throws on ancient WebKit
- merge: function(first, second) {
- var len = +second.length, j = 0, i = first.length;
- for (; j < len; j++) {
- first[i++] = second[j];
- }
- first.length = i;
- return first;
- },
- grep: function(elems, callback, invert) {
- var callbackInverse, matches = [], i = 0, length = elems.length, callbackExpect = !invert;
- for (; i < length; i++) {
- callbackInverse = !callback(elems[i], i);
- if (callbackInverse !== callbackExpect) {
- matches.push(elems[i]);
- }
- }
- return matches;
- },
- // arg is for internal usage only
- map: function(elems, callback, arg) {
- var length, value, i = 0, ret = [];
- if (isArrayLike(elems)) {
- length = elems.length;
- for (; i < length; i++) {
- value = callback(elems[i], i, arg);
- if (value != null) {
- ret.push(value);
- }
- }
- } else {
- for (i in elems) {
- value = callback(elems[i], i, arg);
- if (value != null) {
- ret.push(value);
- }
- }
- }
- return flat(ret);
- },
- // A global GUID counter for objects
- guid: 1,
- // jQuery.support is not used in Core but other projects attach their
- // properties to it so it needs to exist.
- support
- });
- if (typeof Symbol === "function") {
- jQuery.fn[Symbol.iterator] = arr[Symbol.iterator];
- }
- jQuery.each(
- "Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),
- function(_i, name) {
- class2type["[object " + name + "]"] = name.toLowerCase();
- }
- );
- function isArrayLike(obj) {
- var length = !!obj && "length" in obj && obj.length, type = toType(obj);
- if (isFunction(obj) || isWindow(obj)) {
- return false;
- }
- return type === "array" || length === 0 || typeof length === "number" && length > 0 && length - 1 in obj;
- }
- function nodeName(elem, name) {
- return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
- }
- var pop = arr.pop;
- var sort = arr.sort;
- var splice = arr.splice;
- var whitespace = "[\\x20\\t\\r\\n\\f]";
- var rtrimCSS = new RegExp(
- "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$",
- "g"
- );
- jQuery.contains = function(a, b) {
- var bup = b && b.parentNode;
- return a === bup || !!(bup && bup.nodeType === 1 && // Support: IE 9 - 11+
- // IE doesn't have `contains` on SVG.
- (a.contains ? a.contains(bup) : a.compareDocumentPosition && a.compareDocumentPosition(bup) & 16));
- };
- var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;
- function fcssescape(ch, asCodePoint) {
- if (asCodePoint) {
- if (ch === "\0") {
- return "�";
- }
- return ch.slice(0, -1) + "\\" + ch.charCodeAt(ch.length - 1).toString(16) + " ";
- }
- return "\\" + ch;
- }
- jQuery.escapeSelector = function(sel) {
- return (sel + "").replace(rcssescape, fcssescape);
- };
- var preferredDoc = document2, pushNative = push;
- (function() {
- 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) {
- if (a === b) {
- hasDuplicate = true;
- }
- return 0;
- }, 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)
- "*([*^$|!~]?=)" + whitespace + // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
- `*(?:'((?:\\\\.|[^\\\\'])*)'|"((?:\\\\.|[^\\\\"])*)"|(` + 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 = {
- ID: new RegExp("^#(" + identifier + ")"),
- CLASS: new RegExp("^\\.(" + identifier + ")"),
- TAG: new RegExp("^(" + identifier + "|[*])"),
- ATTR: new RegExp("^" + attributes),
- PSEUDO: new RegExp("^" + pseudos),
- CHILD: new RegExp(
- "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)",
- "i"
- ),
- bool: new RegExp("^(?:" + booleans + ")$", "i"),
- // For use in libraries implementing .is()
- // We use this for POS matching in `select`
- needsContext: new RegExp("^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i")
- }, 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) {
- var high = "0x" + escape.slice(1) - 65536;
- if (nonHex) {
- return nonHex;
- }
- return high < 0 ? String.fromCharCode(high + 65536) : String.fromCharCode(high >> 10 | 55296, high & 1023 | 56320);
- }, unloadHandler = function() {
- setDocument();
- }, inDisabledFieldset = addCombinator(
- function(elem) {
- return elem.disabled === true && nodeName(elem, "fieldset");
- },
- { dir: "parentNode", next: "legend" }
- );
- function safeActiveElement() {
- try {
- return document3.activeElement;
- } catch (err) {
- }
- }
- try {
- push2.apply(
- arr = slice.call(preferredDoc.childNodes),
- preferredDoc.childNodes
- );
- arr[preferredDoc.childNodes.length].nodeType;
- } catch (e) {
- push2 = {
- apply: function(target, els) {
- pushNative.apply(target, slice.call(els));
- },
- call: function(target) {
- pushNative.apply(target, slice.call(arguments, 1));
- }
- };
- }
- function find(selector, context, results, seed) {
- var m, i2, elem, nid, match, groups, newSelector, newContext = context && context.ownerDocument, nodeType = context ? context.nodeType : 9;
- results = results || [];
- if (typeof selector !== "string" || !selector || nodeType !== 1 && nodeType !== 9 && nodeType !== 11) {
- return results;
- }
- if (!seed) {
- setDocument(context);
- context = context || document3;
- if (documentIsHTML) {
- if (nodeType !== 11 && (match = rquickExpr2.exec(selector))) {
- if (m = match[1]) {
- if (nodeType === 9) {
- if (elem = context.getElementById(m)) {
- if (elem.id === m) {
- push2.call(results, elem);
- return results;
- }
- } else {
- return results;
- }
- } else {
- if (newContext && (elem = newContext.getElementById(m)) && find.contains(context, elem) && elem.id === m) {
- push2.call(results, elem);
- return results;
- }
- }
- } else if (match[2]) {
- push2.apply(results, context.getElementsByTagName(selector));
- return results;
- } else if ((m = match[3]) && context.getElementsByClassName) {
- push2.apply(results, context.getElementsByClassName(m));
- return results;
- }
- }
- if (!nonnativeSelectorCache[selector + " "] && (!rbuggyQSA || !rbuggyQSA.test(selector))) {
- newSelector = selector;
- newContext = context;
- if (nodeType === 1 && (rdescend.test(selector) || rleadingCombinator.test(selector))) {
- newContext = rsibling.test(selector) && testContext(context.parentNode) || context;
- if (newContext != context || !support.scope) {
- if (nid = context.getAttribute("id")) {
- nid = jQuery.escapeSelector(nid);
- } else {
- context.setAttribute("id", nid = expando);
- }
- }
- groups = tokenize(selector);
- i2 = groups.length;
- while (i2--) {
- groups[i2] = (nid ? "#" + nid : ":scope") + " " + toSelector(groups[i2]);
- }
- newSelector = groups.join(",");
- }
- try {
- push2.apply(
- results,
- newContext.querySelectorAll(newSelector)
- );
- return results;
- } catch (qsaError) {
- nonnativeSelectorCache(selector, true);
- } finally {
- if (nid === expando) {
- context.removeAttribute("id");
- }
- }
- }
- }
- }
- return select(selector.replace(rtrimCSS, "$1"), context, results, seed);
- }
- function createCache() {
- var keys = [];
- function cache(key, value) {
- if (keys.push(key + " ") > Expr.cacheLength) {
- delete cache[keys.shift()];
- }
- return cache[key + " "] = value;
- }
- return cache;
- }
- function markFunction(fn) {
- fn[expando] = true;
- return fn;
- }
- function assert(fn) {
- var el = document3.createElement("fieldset");
- try {
- return !!fn(el);
- } catch (e) {
- return false;
- } finally {
- if (el.parentNode) {
- el.parentNode.removeChild(el);
- }
- el = null;
- }
- }
- function createInputPseudo(type) {
- return function(elem) {
- return nodeName(elem, "input") && elem.type === type;
- };
- }
- function createButtonPseudo(type) {
- return function(elem) {
- return (nodeName(elem, "input") || nodeName(elem, "button")) && elem.type === type;
- };
- }
- function createDisabledPseudo(disabled) {
- return function(elem) {
- if ("form" in elem) {
- if (elem.parentNode && elem.disabled === false) {
- if ("label" in elem) {
- if ("label" in elem.parentNode) {
- return elem.parentNode.disabled === disabled;
- } else {
- return elem.disabled === disabled;
- }
- }
- return elem.isDisabled === disabled || // Where there is no isDisabled, check manually
- elem.isDisabled !== !disabled && inDisabledFieldset(elem) === disabled;
- }
- return elem.disabled === disabled;
- } else if ("label" in elem) {
- return elem.disabled === disabled;
- }
- return false;
- };
- }
- function createPositionalPseudo(fn) {
- return markFunction(function(argument) {
- argument = +argument;
- return markFunction(function(seed, matches2) {
- var j, matchIndexes = fn([], seed.length, argument), i2 = matchIndexes.length;
- while (i2--) {
- if (seed[j = matchIndexes[i2]]) {
- seed[j] = !(matches2[j] = seed[j]);
- }
- }
- });
- });
- }
- function testContext(context) {
- return context && typeof context.getElementsByTagName !== "undefined" && context;
- }
- function setDocument(node) {
- var subWindow, doc = node ? node.ownerDocument || node : preferredDoc;
- if (doc == document3 || doc.nodeType !== 9 || !doc.documentElement) {
- return document3;
- }
- document3 = doc;
- documentElement2 = document3.documentElement;
- documentIsHTML = !jQuery.isXMLDoc(document3);
- matches = documentElement2.matches || documentElement2.webkitMatchesSelector || documentElement2.msMatchesSelector;
- if (documentElement2.msMatchesSelector && // Support: IE 11+, Edge 17 - 18+
- // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
- // two documents; shallow comparisons work.
- // eslint-disable-next-line eqeqeq
- preferredDoc != document3 && (subWindow = document3.defaultView) && subWindow.top !== subWindow) {
- subWindow.addEventListener("unload", unloadHandler);
- }
- support.getById = assert(function(el) {
- documentElement2.appendChild(el).id = jQuery.expando;
- return !document3.getElementsByName || !document3.getElementsByName(jQuery.expando).length;
- });
- support.disconnectedMatch = assert(function(el) {
- return matches.call(el, "*");
- });
- support.scope = assert(function() {
- return document3.querySelectorAll(":scope");
- });
- support.cssHas = assert(function() {
- try {
- document3.querySelector(":has(*,:jqfake)");
- return false;
- } catch (e) {
- return true;
- }
- });
- if (support.getById) {
- Expr.filter.ID = function(id) {
- var attrId = id.replace(runescape, funescape);
- return function(elem) {
- return elem.getAttribute("id") === attrId;
- };
- };
- Expr.find.ID = function(id, context) {
- if (typeof context.getElementById !== "undefined" && documentIsHTML) {
- var elem = context.getElementById(id);
- return elem ? [elem] : [];
- }
- };
- } else {
- Expr.filter.ID = function(id) {
- var attrId = id.replace(runescape, funescape);
- return function(elem) {
- var node2 = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
- return node2 && node2.value === attrId;
- };
- };
- Expr.find.ID = function(id, context) {
- if (typeof context.getElementById !== "undefined" && documentIsHTML) {
- var node2, i2, elems, elem = context.getElementById(id);
- if (elem) {
- node2 = elem.getAttributeNode("id");
- if (node2 && node2.value === id) {
- return [elem];
- }
- elems = context.getElementsByName(id);
- i2 = 0;
- while (elem = elems[i2++]) {
- node2 = elem.getAttributeNode("id");
- if (node2 && node2.value === id) {
- return [elem];
- }
- }
- }
- return [];
- }
- };
- }
- Expr.find.TAG = function(tag, context) {
- if (typeof context.getElementsByTagName !== "undefined") {
- return context.getElementsByTagName(tag);
- } else {
- return context.querySelectorAll(tag);
- }
- };
- Expr.find.CLASS = function(className, context) {
- if (typeof context.getElementsByClassName !== "undefined" && documentIsHTML) {
- return context.getElementsByClassName(className);
- }
- };
- rbuggyQSA = [];
- assert(function(el) {
- var input;
- documentElement2.appendChild(el).innerHTML = "<a id='" + expando + "' href='' disabled='disabled'></a><select id='" + expando + "-\r\\' disabled='disabled'><option selected=''></option></select>";
- if (!el.querySelectorAll("[selected]").length) {
- rbuggyQSA.push("\\[" + whitespace + "*(?:value|" + booleans + ")");
- }
- if (!el.querySelectorAll("[id~=" + expando + "-]").length) {
- rbuggyQSA.push("~=");
- }
- if (!el.querySelectorAll("a#" + expando + "+*").length) {
- rbuggyQSA.push(".#.+[+~]");
- }
- if (!el.querySelectorAll(":checked").length) {
- rbuggyQSA.push(":checked");
- }
- input = document3.createElement("input");
- input.setAttribute("type", "hidden");
- el.appendChild(input).setAttribute("name", "D");
- documentElement2.appendChild(el).disabled = true;
- if (el.querySelectorAll(":disabled").length !== 2) {
- rbuggyQSA.push(":enabled", ":disabled");
- }
- input = document3.createElement("input");
- input.setAttribute("name", "");
- el.appendChild(input);
- if (!el.querySelectorAll("[name='']").length) {
- rbuggyQSA.push("\\[" + whitespace + "*name" + whitespace + "*=" + whitespace + `*(?:''|"")`);
- }
- });
- if (!support.cssHas) {
- rbuggyQSA.push(":has");
- }
- rbuggyQSA = rbuggyQSA.length && new RegExp(rbuggyQSA.join("|"));
- sortOrder = function(a, b) {
- if (a === b) {
- hasDuplicate = true;
- return 0;
- }
- var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
- if (compare) {
- return compare;
- }
- compare = (a.ownerDocument || a) == (b.ownerDocument || b) ? a.compareDocumentPosition(b) : (
- // Otherwise we know they are disconnected
- 1
- );
- if (compare & 1 || !support.sortDetached && b.compareDocumentPosition(a) === compare) {
- if (a === document3 || a.ownerDocument == preferredDoc && find.contains(preferredDoc, a)) {
- return -1;
- }
- if (b === document3 || b.ownerDocument == preferredDoc && find.contains(preferredDoc, b)) {
- return 1;
- }
- return sortInput ? indexOf.call(sortInput, a) - indexOf.call(sortInput, b) : 0;
- }
- return compare & 4 ? -1 : 1;
- };
- return document3;
- }
- find.matches = function(expr, elements) {
- return find(expr, null, null, elements);
- };
- find.matchesSelector = function(elem, expr) {
- setDocument(elem);
- if (documentIsHTML && !nonnativeSelectorCache[expr + " "] && (!rbuggyQSA || !rbuggyQSA.test(expr))) {
- try {
- var ret = matches.call(elem, expr);
- if (ret || support.disconnectedMatch || // As well, disconnected nodes are said to be in a document
- // fragment in IE 9
- elem.document && elem.document.nodeType !== 11) {
- return ret;
- }
- } catch (e) {
- nonnativeSelectorCache(expr, true);
- }
- }
- return find(expr, document3, null, [elem]).length > 0;
- };
- find.contains = function(context, elem) {
- if ((context.ownerDocument || context) != document3) {
- setDocument(context);
- }
- return jQuery.contains(context, elem);
- };
- find.attr = function(elem, name) {
- if ((elem.ownerDocument || elem) != document3) {
- setDocument(elem);
- }
- var fn = Expr.attrHandle[name.toLowerCase()], val = fn && hasOwn.call(Expr.attrHandle, name.toLowerCase()) ? fn(elem, name, !documentIsHTML) : void 0;
- if (val !== void 0) {
- return val;
- }
- return elem.getAttribute(name);
- };
- find.error = function(msg) {
- throw new Error("Syntax error, unrecognized expression: " + msg);
- };
- jQuery.uniqueSort = function(results) {
- var elem, duplicates = [], j = 0, i2 = 0;
- hasDuplicate = !support.sortStable;
- sortInput = !support.sortStable && slice.call(results, 0);
- sort.call(results, sortOrder);
- if (hasDuplicate) {
- while (elem = results[i2++]) {
- if (elem === results[i2]) {
- j = duplicates.push(i2);
- }
- }
- while (j--) {
- splice.call(results, duplicates[j], 1);
- }
- }
- sortInput = null;
- return results;
- };
- jQuery.fn.uniqueSort = function() {
- return this.pushStack(jQuery.uniqueSort(slice.apply(this)));
- };
- Expr = jQuery.expr = {
- // Can be adjusted by the user
- cacheLength: 50,
- createPseudo: markFunction,
- match: matchExpr,
- attrHandle: {},
- find: {},
- relative: {
- ">": { dir: "parentNode", first: true },
- " ": { dir: "parentNode" },
- "+": { dir: "previousSibling", first: true },
- "~": { dir: "previousSibling" }
- },
- preFilter: {
- ATTR: function(match) {
- match[1] = match[1].replace(runescape, funescape);
- match[3] = (match[3] || match[4] || match[5] || "").replace(runescape, funescape);
- if (match[2] === "~=") {
- match[3] = " " + match[3] + " ";
- }
- return match.slice(0, 4);
- },
- CHILD: function(match) {
- match[1] = match[1].toLowerCase();
- if (match[1].slice(0, 3) === "nth") {
- if (!match[3]) {
- find.error(match[0]);
- }
- match[4] = +(match[4] ? match[5] + (match[6] || 1) : 2 * (match[3] === "even" || match[3] === "odd"));
- match[5] = +(match[7] + match[8] || match[3] === "odd");
- } else if (match[3]) {
- find.error(match[0]);
- }
- return match;
- },
- PSEUDO: function(match) {
- var excess, unquoted = !match[6] && match[2];
- if (matchExpr.CHILD.test(match[0])) {
- return null;
- }
- if (match[3]) {
- match[2] = match[4] || match[5] || "";
- } else if (unquoted && rpseudo.test(unquoted) && // Get excess from tokenize (recursively)
- (excess = tokenize(unquoted, true)) && // advance to the next closing parenthesis
- (excess = unquoted.indexOf(")", unquoted.length - excess) - unquoted.length)) {
- match[0] = match[0].slice(0, excess);
- match[2] = unquoted.slice(0, excess);
- }
- return match.slice(0, 3);
- }
- },
- filter: {
- TAG: function(nodeNameSelector) {
- var expectedNodeName = nodeNameSelector.replace(runescape, funescape).toLowerCase();
- return nodeNameSelector === "*" ? function() {
- return true;
- } : function(elem) {
- return nodeName(elem, expectedNodeName);
- };
- },
- CLASS: function(className) {
- var pattern = classCache[className + " "];
- return pattern || (pattern = new RegExp("(^|" + whitespace + ")" + className + "(" + whitespace + "|$)")) && classCache(className, function(elem) {
- return pattern.test(
- typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || ""
- );
- });
- },
- ATTR: function(name, operator, check) {
- return function(elem) {
- var result = find.attr(elem, name);
- if (result == null) {
- return operator === "!=";
- }
- if (!operator) {
- return true;
- }
- result += "";
- if (operator === "=") {
- return result === check;
- }
- if (operator === "!=") {
- return result !== check;
- }
- if (operator === "^=") {
- return check && result.indexOf(check) === 0;
- }
- if (operator === "*=") {
- return check && result.indexOf(check) > -1;
- }
- if (operator === "$=") {
- return check && result.slice(-check.length) === check;
- }
- if (operator === "~=") {
- return (" " + result.replace(rwhitespace, " ") + " ").indexOf(check) > -1;
- }
- if (operator === "|=") {
- return result === check || result.slice(0, check.length + 1) === check + "-";
- }
- return false;
- };
- },
- CHILD: function(type, what, _argument, first, last) {
- var simple = type.slice(0, 3) !== "nth", forward = type.slice(-4) !== "last", ofType = what === "of-type";
- return first === 1 && last === 0 ? (
- // Shortcut for :nth-*(n)
- function(elem) {
- return !!elem.parentNode;
- }
- ) : function(elem, _context, xml) {
- var cache, outerCache, node, nodeIndex, start, dir2 = simple !== forward ? "nextSibling" : "previousSibling", parent = elem.parentNode, name = ofType && elem.nodeName.toLowerCase(), useCache = !xml && !ofType, diff = false;
- if (parent) {
- if (simple) {
- while (dir2) {
- node = elem;
- while (node = node[dir2]) {
- if (ofType ? nodeName(node, name) : node.nodeType === 1) {
- return false;
- }
- }
- start = dir2 = type === "only" && !start && "nextSibling";
- }
- return true;
- }
- start = [forward ? parent.firstChild : parent.lastChild];
- if (forward && useCache) {
- outerCache = parent[expando] || (parent[expando] = {});
- cache = outerCache[type] || [];
- nodeIndex = cache[0] === dirruns && cache[1];
- diff = nodeIndex && cache[2];
- node = nodeIndex && parent.childNodes[nodeIndex];
- while (node = ++nodeIndex && node && node[dir2] || // Fallback to seeking `elem` from the start
- (diff = nodeIndex = 0) || start.pop()) {
- if (node.nodeType === 1 && ++diff && node === elem) {
- outerCache[type] = [dirruns, nodeIndex, diff];
- break;
- }
- }
- } else {
- if (useCache) {
- outerCache = elem[expando] || (elem[expando] = {});
- cache = outerCache[type] || [];
- nodeIndex = cache[0] === dirruns && cache[1];
- diff = nodeIndex;
- }
- if (diff === false) {
- while (node = ++nodeIndex && node && node[dir2] || (diff = nodeIndex = 0) || start.pop()) {
- if ((ofType ? nodeName(node, name) : node.nodeType === 1) && ++diff) {
- if (useCache) {
- outerCache = node[expando] || (node[expando] = {});
- outerCache[type] = [dirruns, diff];
- }
- if (node === elem) {
- break;
- }
- }
- }
- }
- }
- diff -= last;
- return diff === first || diff % first === 0 && diff / first >= 0;
- }
- };
- },
- PSEUDO: function(pseudo, argument) {
- var args, fn = Expr.pseudos[pseudo] || Expr.setFilters[pseudo.toLowerCase()] || find.error("unsupported pseudo: " + pseudo);
- if (fn[expando]) {
- return fn(argument);
- }
- if (fn.length > 1) {
- args = [pseudo, pseudo, "", argument];
- return Expr.setFilters.hasOwnProperty(pseudo.toLowerCase()) ? markFunction(function(seed, matches2) {
- var idx, matched = fn(seed, argument), i2 = matched.length;
- while (i2--) {
- idx = indexOf.call(seed, matched[i2]);
- seed[idx] = !(matches2[idx] = matched[i2]);
- }
- }) : function(elem) {
- return fn(elem, 0, args);
- };
- }
- return fn;
- }
- },
- pseudos: {
- // Potentially complex pseudos
- not: markFunction(function(selector) {
- var input = [], results = [], matcher = compile(selector.replace(rtrimCSS, "$1"));
- return matcher[expando] ? markFunction(function(seed, matches2, _context, xml) {
- var elem, unmatched = matcher(seed, null, xml, []), i2 = seed.length;
- while (i2--) {
- if (elem = unmatched[i2]) {
- seed[i2] = !(matches2[i2] = elem);
- }
- }
- }) : function(elem, _context, xml) {
- input[0] = elem;
- matcher(input, null, xml, results);
- input[0] = null;
- return !results.pop();
- };
- }),
- has: markFunction(function(selector) {
- return function(elem) {
- return find(selector, elem).length > 0;
- };
- }),
- contains: markFunction(function(text) {
- text = text.replace(runescape, funescape);
- return function(elem) {
- return (elem.textContent || jQuery.text(elem)).indexOf(text) > -1;
- };
- }),
- // "Whether an element is represented by a :lang() selector
- // is based solely on the element's language value
- // being equal to the identifier C,
- // or beginning with the identifier C immediately followed by "-".
- // The matching of C against the element's language value is performed case-insensitively.
- // The identifier C does not have to be a valid language name."
- // https://www.w3.org/TR/selectors/#lang-pseudo
- lang: markFunction(function(lang) {
- if (!ridentifier.test(lang || "")) {
- find.error("unsupported lang: " + lang);
- }
- lang = lang.replace(runescape, funescape).toLowerCase();
- return function(elem) {
- var elemLang;
- do {
- if (elemLang = documentIsHTML ? elem.lang : elem.getAttribute("xml:lang") || elem.getAttribute("lang")) {
- elemLang = elemLang.toLowerCase();
- return elemLang === lang || elemLang.indexOf(lang + "-") === 0;
- }
- } while ((elem = elem.parentNode) && elem.nodeType === 1);
- return false;
- };
- }),
- // Miscellaneous
- target: function(elem) {
- var hash = window2.location && window2.location.hash;
- return hash && hash.slice(1) === elem.id;
- },
- root: function(elem) {
- return elem === documentElement2;
- },
- focus: function(elem) {
- return elem === safeActiveElement() && document3.hasFocus() && !!(elem.type || elem.href || ~elem.tabIndex);
- },
- // Boolean properties
- enabled: createDisabledPseudo(false),
- disabled: createDisabledPseudo(true),
- checked: function(elem) {
- return nodeName(elem, "input") && !!elem.checked || nodeName(elem, "option") && !!elem.selected;
- },
- selected: function(elem) {
- if (elem.parentNode) {
- elem.parentNode.selectedIndex;
- }
- return elem.selected === true;
- },
- // Contents
- empty: function(elem) {
- for (elem = elem.firstChild; elem; elem = elem.nextSibling) {
- if (elem.nodeType < 6) {
- return false;
- }
- }
- return true;
- },
- parent: function(elem) {
- return !Expr.pseudos.empty(elem);
- },
- // Element/input types
- header: function(elem) {
- return rheader.test(elem.nodeName);
- },
- input: function(elem) {
- return rinputs.test(elem.nodeName);
- },
- button: function(elem) {
- return nodeName(elem, "input") && elem.type === "button" || nodeName(elem, "button");
- },
- text: function(elem) {
- var attr;
- return nodeName(elem, "input") && elem.type === "text" && // Support: IE <10 only
- // New HTML5 attribute values (e.g., "search") appear
- // with elem.type === "text"
- ((attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text");
- },
- // Position-in-collection
- first: createPositionalPseudo(function() {
- return [0];
- }),
- last: createPositionalPseudo(function(_matchIndexes, length) {
- return [length - 1];
- }),
- eq: createPositionalPseudo(function(_matchIndexes, length, argument) {
- return [argument < 0 ? argument + length : argument];
- }),
- even: createPositionalPseudo(function(matchIndexes, length) {
- var i2 = 0;
- for (; i2 < length; i2 += 2) {
- matchIndexes.push(i2);
- }
- return matchIndexes;
- }),
- odd: createPositionalPseudo(function(matchIndexes, length) {
- var i2 = 1;
- for (; i2 < length; i2 += 2) {
- matchIndexes.push(i2);
- }
- return matchIndexes;
- }),
- lt: createPositionalPseudo(function(matchIndexes, length, argument) {
- var i2;
- if (argument < 0) {
- i2 = argument + length;
- } else if (argument > length) {
- i2 = length;
- } else {
- i2 = argument;
- }
- for (; --i2 >= 0; ) {
- matchIndexes.push(i2);
- }
- return matchIndexes;
- }),
- gt: createPositionalPseudo(function(matchIndexes, length, argument) {
- var i2 = argument < 0 ? argument + length : argument;
- for (; ++i2 < length; ) {
- matchIndexes.push(i2);
- }
- return matchIndexes;
- })
- }
- };
- Expr.pseudos.nth = Expr.pseudos.eq;
- for (i in { radio: true, checkbox: true, file: true, password: true, image: true }) {
- Expr.pseudos[i] = createInputPseudo(i);
- }
- for (i in { submit: true, reset: true }) {
- Expr.pseudos[i] = createButtonPseudo(i);
- }
- function setFilters() {
- }
- setFilters.prototype = Expr.filters = Expr.pseudos;
- Expr.setFilters = new setFilters();
- function tokenize(selector, parseOnly) {
- var matched, match, tokens, type, soFar, groups, preFilters, cached = tokenCache[selector + " "];
- if (cached) {
- return parseOnly ? 0 : cached.slice(0);
- }
- soFar = selector;
- groups = [];
- preFilters = Expr.preFilter;
- while (soFar) {
- if (!matched || (match = rcomma.exec(soFar))) {
- if (match) {
- soFar = soFar.slice(match[0].length) || soFar;
- }
- groups.push(tokens = []);
- }
- matched = false;
- if (match = rleadingCombinator.exec(soFar)) {
- matched = match.shift();
- tokens.push({
- value: matched,
- // Cast descendant combinators to space
- type: match[0].replace(rtrimCSS, " ")
- });
- soFar = soFar.slice(matched.length);
- }
- for (type in Expr.filter) {
- if ((match = matchExpr[type].exec(soFar)) && (!preFilters[type] || (match = preFilters[type](match)))) {
- matched = match.shift();
- tokens.push({
- value: matched,
- type,
- matches: match
- });
- soFar = soFar.slice(matched.length);
- }
- }
- if (!matched) {
- break;
- }
- }
- if (parseOnly) {
- return soFar.length;
- }
- return soFar ? find.error(selector) : (
- // Cache the tokens
- tokenCache(selector, groups).slice(0)
- );
- }
- function toSelector(tokens) {
- var i2 = 0, len = tokens.length, selector = "";
- for (; i2 < len; i2++) {
- selector += tokens[i2].value;
- }
- return selector;
- }
- function addCombinator(matcher, combinator, base) {
- var dir2 = combinator.dir, skip = combinator.next, key = skip || dir2, checkNonElements = base && key === "parentNode", doneName = done++;
- return combinator.first ? (
- // Check against closest ancestor/preceding element
- function(elem, context, xml) {
- while (elem = elem[dir2]) {
- if (elem.nodeType === 1 || checkNonElements) {
- return matcher(elem, context, xml);
- }
- }
- return false;
- }
- ) : (
- // Check against all ancestor/preceding elements
- function(elem, context, xml) {
- var oldCache, outerCache, newCache = [dirruns, doneName];
- if (xml) {
- while (elem = elem[dir2]) {
- if (elem.nodeType === 1 || checkNonElements) {
- if (matcher(elem, context, xml)) {
- return true;
- }
- }
- }
- } else {
- while (elem = elem[dir2]) {
- if (elem.nodeType === 1 || checkNonElements) {
- outerCache = elem[expando] || (elem[expando] = {});
- if (skip && nodeName(elem, skip)) {
- elem = elem[dir2] || elem;
- } else if ((oldCache = outerCache[key]) && oldCache[0] === dirruns && oldCache[1] === doneName) {
- return newCache[2] = oldCache[2];
- } else {
- outerCache[key] = newCache;
- if (newCache[2] = matcher(elem, context, xml)) {
- return true;
- }
- }
- }
- }
- }
- return false;
- }
- );
- }
- function elementMatcher(matchers) {
- return matchers.length > 1 ? function(elem, context, xml) {
- var i2 = matchers.length;
- while (i2--) {
- if (!matchers[i2](elem, context, xml)) {
- return false;
- }
- }
- return true;
- } : matchers[0];
- }
- function multipleContexts(selector, contexts, results) {
- var i2 = 0, len = contexts.length;
- for (; i2 < len; i2++) {
- find(selector, contexts[i2], results);
- }
- return results;
- }
- function condense(unmatched, map, filter, context, xml) {
- var elem, newUnmatched = [], i2 = 0, len = unmatched.length, mapped = map != null;
- for (; i2 < len; i2++) {
- if (elem = unmatched[i2]) {
- if (!filter || filter(elem, context, xml)) {
- newUnmatched.push(elem);
- if (mapped) {
- map.push(i2);
- }
- }
- }
- }
- return newUnmatched;
- }
- function setMatcher(preFilter, selector, matcher, postFilter, postFinder, postSelector) {
- if (postFilter && !postFilter[expando]) {
- postFilter = setMatcher(postFilter);
- }
- if (postFinder && !postFinder[expando]) {
- postFinder = setMatcher(postFinder, postSelector);
- }
- return markFunction(function(seed, results, context, xml) {
- var temp, i2, elem, matcherOut, preMap = [], postMap = [], preexisting = results.length, elems = seed || multipleContexts(
- selector || "*",
- context.nodeType ? [context] : context,
- []
- ), matcherIn = preFilter && (seed || !selector) ? condense(elems, preMap, preFilter, context, xml) : elems;
- if (matcher) {
- matcherOut = postFinder || (seed ? preFilter : preexisting || postFilter) ? (
- // ...intermediate processing is necessary
- []
- ) : (
- // ...otherwise use results directly
- results
- );
- matcher(matcherIn, matcherOut, context, xml);
- } else {
- matcherOut = matcherIn;
- }
- if (postFilter) {
- temp = condense(matcherOut, postMap);
- postFilter(temp, [], context, xml);
- i2 = temp.length;
- while (i2--) {
- if (elem = temp[i2]) {
- matcherOut[postMap[i2]] = !(matcherIn[postMap[i2]] = elem);
- }
- }
- }
- if (seed) {
- if (postFinder || preFilter) {
- if (postFinder) {
- temp = [];
- i2 = matcherOut.length;
- while (i2--) {
- if (elem = matcherOut[i2]) {
- temp.push(matcherIn[i2] = elem);
- }
- }
- postFinder(null, matcherOut = [], temp, xml);
- }
- i2 = matcherOut.length;
- while (i2--) {
- if ((elem = matcherOut[i2]) && (temp = postFinder ? indexOf.call(seed, elem) : preMap[i2]) > -1) {
- seed[temp] = !(results[temp] = elem);
- }
- }
- }
- } else {
- matcherOut = condense(
- matcherOut === results ? matcherOut.splice(preexisting, matcherOut.length) : matcherOut
- );
- if (postFinder) {
- postFinder(null, results, matcherOut, xml);
- } else {
- push2.apply(results, matcherOut);
- }
- }
- });
- }
- function matcherFromTokens(tokens) {
- 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) {
- return elem === checkContext;
- }, implicitRelative, true), matchAnyContext = addCombinator(function(elem) {
- return indexOf.call(checkContext, elem) > -1;
- }, implicitRelative, true), matchers = [function(elem, context, xml) {
- var ret = !leadingRelative && (xml || context != outermostContext) || ((checkContext = context).nodeType ? matchContext(elem, context, xml) : matchAnyContext(elem, context, xml));
- checkContext = null;
- return ret;
- }];
- for (; i2 < len; i2++) {
- if (matcher = Expr.relative[tokens[i2].type]) {
- matchers = [addCombinator(elementMatcher(matchers), matcher)];
- } else {
- matcher = Expr.filter[tokens[i2].type].apply(null, tokens[i2].matches);
- if (matcher[expando]) {
- j = ++i2;
- for (; j < len; j++) {
- if (Expr.relative[tokens[j].type]) {
- break;
- }
- }
- return setMatcher(
- i2 > 1 && elementMatcher(matchers),
- i2 > 1 && toSelector(
- // If the preceding token was a descendant combinator, insert an implicit any-element `*`
- tokens.slice(0, i2 - 1).concat({ value: tokens[i2 - 2].type === " " ? "*" : "" })
- ).replace(rtrimCSS, "$1"),
- matcher,
- i2 < j && matcherFromTokens(tokens.slice(i2, j)),
- j < len && matcherFromTokens(tokens = tokens.slice(j)),
- j < len && toSelector(tokens)
- );
- }
- matchers.push(matcher);
- }
- }
- return elementMatcher(matchers);
- }
- function matcherFromGroupMatchers(elementMatchers, setMatchers) {
- var bySet = setMatchers.length > 0, byElement = elementMatchers.length > 0, superMatcher = function(seed, context, xml, results, outermost) {
- var elem, j, matcher, matchedCount = 0, 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;
- if (outermost) {
- outermostContext = context == document3 || context || outermost;
- }
- for (; i2 !== len && (elem = elems[i2]) != null; i2++) {
- if (byElement && elem) {
- j = 0;
- if (!context && elem.ownerDocument != document3) {
- setDocument(elem);
- xml = !documentIsHTML;
- }
- while (matcher = elementMatchers[j++]) {
- if (matcher(elem, context || document3, xml)) {
- push2.call(results, elem);
- break;
- }
- }
- if (outermost) {
- dirruns = dirrunsUnique;
- }
- }
- if (bySet) {
- if (elem = !matcher && elem) {
- matchedCount--;
- }
- if (seed) {
- unmatched.push(elem);
- }
- }
- }
- matchedCount += i2;
- if (bySet && i2 !== matchedCount) {
- j = 0;
- while (matcher = setMatchers[j++]) {
- matcher(unmatched, setMatched, context, xml);
- }
- if (seed) {
- if (matchedCount > 0) {
- while (i2--) {
- if (!(unmatched[i2] || setMatched[i2])) {
- setMatched[i2] = pop.call(results);
- }
- }
- }
- setMatched = condense(setMatched);
- }
- push2.apply(results, setMatched);
- if (outermost && !seed && setMatched.length > 0 && matchedCount + setMatchers.length > 1) {
- jQuery.uniqueSort(results);
- }
- }
- if (outermost) {
- dirruns = dirrunsUnique;
- outermostContext = contextBackup;
- }
- return unmatched;
- };
- return bySet ? markFunction(superMatcher) : superMatcher;
- }
- function compile(selector, match) {
- var i2, setMatchers = [], elementMatchers = [], cached = compilerCache[selector + " "];
- if (!cached) {
- if (!match) {
- match = tokenize(selector);
- }
- i2 = match.length;
- while (i2--) {
- cached = matcherFromTokens(match[i2]);
- if (cached[expando]) {
- setMatchers.push(cached);
- } else {
- elementMatchers.push(cached);
- }
- }
- cached = compilerCache(
- selector,
- matcherFromGroupMatchers(elementMatchers, setMatchers)
- );
- cached.selector = selector;
- }
- return cached;
- }
- function select(selector, context, results, seed) {
- var i2, tokens, token, type, find2, compiled = typeof selector === "function" && selector, match = !seed && tokenize(selector = compiled.selector || selector);
- results = results || [];
- if (match.length === 1) {
- tokens = match[0] = match[0].slice(0);
- if (tokens.length > 2 && (token = tokens[0]).type === "ID" && context.nodeType === 9 && documentIsHTML && Expr.relative[tokens[1].type]) {
- context = (Expr.find.ID(
- token.matches[0].replace(runescape, funescape),
- context
- ) || [])[0];
- if (!context) {
- return results;
- } else if (compiled) {
- context = context.parentNode;
- }
- selector = selector.slice(tokens.shift().value.length);
- }
- i2 = matchExpr.needsContext.test(selector) ? 0 : tokens.length;
- while (i2--) {
- token = tokens[i2];
- if (Expr.relative[type = token.type]) {
- break;
- }
- if (find2 = Expr.find[type]) {
- if (seed = find2(
- token.matches[0].replace(runescape, funescape),
- rsibling.test(tokens[0].type) && testContext(context.parentNode) || context
- )) {
- tokens.splice(i2, 1);
- selector = seed.length && toSelector(tokens);
- if (!selector) {
- push2.apply(results, seed);
- return results;
- }
- break;
- }
- }
- }
- }
- (compiled || compile(selector, match))(
- seed,
- context,
- !documentIsHTML,
- results,
- !context || rsibling.test(selector) && testContext(context.parentNode) || context
- );
- return results;
- }
- support.sortStable = expando.split("").sort(sortOrder).join("") === expando;
- setDocument();
- support.sortDetached = assert(function(el) {
- return el.compareDocumentPosition(document3.createElement("fieldset")) & 1;
- });
- jQuery.find = find;
- jQuery.expr[":"] = jQuery.expr.pseudos;
- jQuery.unique = jQuery.uniqueSort;
- find.compile = compile;
- find.select = select;
- find.setDocument = setDocument;
- find.tokenize = tokenize;
- find.escape = jQuery.escapeSelector;
- find.getText = jQuery.text;
- find.isXML = jQuery.isXMLDoc;
- find.selectors = jQuery.expr;
- find.support = jQuery.support;
- find.uniqueSort = jQuery.uniqueSort;
- })();
- var dir = function(elem, dir2, until) {
- var matched = [], truncate = until !== void 0;
- while ((elem = elem[dir2]) && elem.nodeType !== 9) {
- if (elem.nodeType === 1) {
- if (truncate && jQuery(elem).is(until)) {
- break;
- }
- matched.push(elem);
- }
- }
- return matched;
- };
- var siblings = function(n, elem) {
- var matched = [];
- for (; n; n = n.nextSibling) {
- if (n.nodeType === 1 && n !== elem) {
- matched.push(n);
- }
- }
- return matched;
- };
- var rneedsContext = jQuery.expr.match.needsContext;
- var rsingleTag = /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;
- function winnow(elements, qualifier, not) {
- if (isFunction(qualifier)) {
- return jQuery.grep(elements, function(elem, i) {
- return !!qualifier.call(elem, i, elem) !== not;
- });
- }
- if (qualifier.nodeType) {
- return jQuery.grep(elements, function(elem) {
- return elem === qualifier !== not;
- });
- }
- if (typeof qualifier !== "string") {
- return jQuery.grep(elements, function(elem) {
- return indexOf.call(qualifier, elem) > -1 !== not;
- });
- }
- return jQuery.filter(qualifier, elements, not);
- }
- jQuery.filter = function(expr, elems, not) {
- var elem = elems[0];
- if (not) {
- expr = ":not(" + expr + ")";
- }
- if (elems.length === 1 && elem.nodeType === 1) {
- return jQuery.find.matchesSelector(elem, expr) ? [elem] : [];
- }
- return jQuery.find.matches(expr, jQuery.grep(elems, function(elem2) {
- return elem2.nodeType === 1;
- }));
- };
- jQuery.fn.extend({
- find: function(selector) {
- var i, ret, len = this.length, self2 = this;
- if (typeof selector !== "string") {
- return this.pushStack(jQuery(selector).filter(function() {
- for (i = 0; i < len; i++) {
- if (jQuery.contains(self2[i], this)) {
- return true;
- }
- }
- }));
- }
- ret = this.pushStack([]);
- for (i = 0; i < len; i++) {
- jQuery.find(selector, self2[i], ret);
- }
- return len > 1 ? jQuery.uniqueSort(ret) : ret;
- },
- filter: function(selector) {
- return this.pushStack(winnow(this, selector || [], false));
- },
- not: function(selector) {
- return this.pushStack(winnow(this, selector || [], true));
- },
- is: function(selector) {
- return !!winnow(
- this,
- // If this is a positional/relative selector, check membership in the returned set
- // so $("p:first").is("p:last") won't return true for a doc with two "p".
- typeof selector === "string" && rneedsContext.test(selector) ? jQuery(selector) : selector || [],
- false
- ).length;
- }
- });
- var rootjQuery, rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, init = jQuery.fn.init = function(selector, context, root) {
- var match, elem;
- if (!selector) {
- return this;
- }
- root = root || rootjQuery;
- if (typeof selector === "string") {
- if (selector[0] === "<" && selector[selector.length - 1] === ">" && selector.length >= 3) {
- match = [null, selector, null];
- } else {
- match = rquickExpr.exec(selector);
- }
- if (match && (match[1] || !context)) {
- if (match[1]) {
- context = context instanceof jQuery ? context[0] : context;
- jQuery.merge(this, jQuery.parseHTML(
- match[1],
- context && context.nodeType ? context.ownerDocument || context : document2,
- true
- ));
- if (rsingleTag.test(match[1]) && jQuery.isPlainObject(context)) {
- for (match in context) {
- if (isFunction(this[match])) {
- this[match](context[match]);
- } else {
- this.attr(match, context[match]);
- }
- }
- }
- return this;
- } else {
- elem = document2.getElementById(match[2]);
- if (elem) {
- this[0] = elem;
- this.length = 1;
- }
- return this;
- }
- } else if (!context || context.jquery) {
- return (context || root).find(selector);
- } else {
- return this.constructor(context).find(selector);
- }
- } else if (selector.nodeType) {
- this[0] = selector;
- this.length = 1;
- return this;
- } else if (isFunction(selector)) {
- return root.ready !== void 0 ? root.ready(selector) : (
- // Execute immediately if ready is not present
- selector(jQuery)
- );
- }
- return jQuery.makeArray(selector, this);
- };
- init.prototype = jQuery.fn;
- rootjQuery = jQuery(document2);
- var rparentsprev = /^(?:parents|prev(?:Until|All))/, guaranteedUnique = {
- children: true,
- contents: true,
- next: true,
- prev: true
- };
- jQuery.fn.extend({
- has: function(target) {
- var targets = jQuery(target, this), l = targets.length;
- return this.filter(function() {
- var i = 0;
- for (; i < l; i++) {
- if (jQuery.contains(this, targets[i])) {
- return true;
- }
- }
- });
- },
- closest: function(selectors, context) {
- var cur, i = 0, l = this.length, matched = [], targets = typeof selectors !== "string" && jQuery(selectors);
- if (!rneedsContext.test(selectors)) {
- for (; i < l; i++) {
- for (cur = this[i]; cur && cur !== context; cur = cur.parentNode) {
- if (cur.nodeType < 11 && (targets ? targets.index(cur) > -1 : (
- // Don't pass non-elements to jQuery#find
- cur.nodeType === 1 && jQuery.find.matchesSelector(cur, selectors)
- ))) {
- matched.push(cur);
- break;
- }
- }
- }
- }
- return this.pushStack(matched.length > 1 ? jQuery.uniqueSort(matched) : matched);
- },
- // Determine the position of an element within the set
- index: function(elem) {
- if (!elem) {
- return this[0] && this[0].parentNode ? this.first().prevAll().length : -1;
- }
- if (typeof elem === "string") {
- return indexOf.call(jQuery(elem), this[0]);
- }
- return indexOf.call(
- this,
- // If it receives a jQuery object, the first element is used
- elem.jquery ? elem[0] : elem
- );
- },
- add: function(selector, context) {
- return this.pushStack(
- jQuery.uniqueSort(
- jQuery.merge(this.get(), jQuery(selector, context))
- )
- );
- },
- addBack: function(selector) {
- return this.add(
- selector == null ? this.prevObject : this.prevObject.filter(selector)
- );
- }
- });
- function sibling(cur, dir2) {
- while ((cur = cur[dir2]) && cur.nodeType !== 1) {
- }
- return cur;
- }
- jQuery.each({
- parent: function(elem) {
- var parent = elem.parentNode;
- return parent && parent.nodeType !== 11 ? parent : null;
- },
- parents: function(elem) {
- return dir(elem, "parentNode");
- },
- parentsUntil: function(elem, _i, until) {
- return dir(elem, "parentNode", until);
- },
- next: function(elem) {
- return sibling(elem, "nextSibling");
- },
- prev: function(elem) {
- return sibling(elem, "previousSibling");
- },
- nextAll: function(elem) {
- return dir(elem, "nextSibling");
- },
- prevAll: function(elem) {
- return dir(elem, "previousSibling");
- },
- nextUntil: function(elem, _i, until) {
- return dir(elem, "nextSibling", until);
- },
- prevUntil: function(elem, _i, until) {
- return dir(elem, "previousSibling", until);
- },
- siblings: function(elem) {
- return siblings((elem.parentNode || {}).firstChild, elem);
- },
- children: function(elem) {
- return siblings(elem.firstChild);
- },
- contents: function(elem) {
- if (elem.contentDocument != null && // Support: IE 11+
- // <object> elements with no `data` attribute has an object
- // `contentDocument` with a `null` prototype.
- getProto(elem.contentDocument)) {
- return elem.contentDocument;
- }
- if (nodeName(elem, "template")) {
- elem = elem.content || elem;
- }
- return jQuery.merge([], elem.childNodes);
- }
- }, function(name, fn) {
- jQuery.fn[name] = function(until, selector) {
- var matched = jQuery.map(this, fn, until);
- if (name.slice(-5) !== "Until") {
- selector = until;
- }
- if (selector && typeof selector === "string") {
- matched = jQuery.filter(selector, matched);
- }
- if (this.length > 1) {
- if (!guaranteedUnique[name]) {
- jQuery.uniqueSort(matched);
- }
- if (rparentsprev.test(name)) {
- matched.reverse();
- }
- }
- return this.pushStack(matched);
- };
- });
- var rnothtmlwhite = /[^\x20\t\r\n\f]+/g;
- function createOptions(options) {
- var object = {};
- jQuery.each(options.match(rnothtmlwhite) || [], function(_, flag) {
- object[flag] = true;
- });
- return object;
- }
- jQuery.Callbacks = function(options) {
- options = typeof options === "string" ? createOptions(options) : jQuery.extend({}, options);
- var firing, memory, fired, locked, list = [], queue = [], firingIndex = -1, fire = function() {
- locked = locked || options.once;
- fired = firing = true;
- for (; queue.length; firingIndex = -1) {
- memory = queue.shift();
- while (++firingIndex < list.length) {
- if (list[firingIndex].apply(memory[0], memory[1]) === false && options.stopOnFalse) {
- firingIndex = list.length;
- memory = false;
- }
- }
- }
- if (!options.memory) {
- memory = false;
- }
- firing = false;
- if (locked) {
- if (memory) {
- list = [];
- } else {
- list = "";
- }
- }
- }, self2 = {
- // Add a callback or a collection of callbacks to the list
- add: function() {
- if (list) {
- if (memory && !firing) {
- firingIndex = list.length - 1;
- queue.push(memory);
- }
- (function add(args) {
- jQuery.each(args, function(_, arg) {
- if (isFunction(arg)) {
- if (!options.unique || !self2.has(arg)) {
- list.push(arg);
- }
- } else if (arg && arg.length && toType(arg) !== "string") {
- add(arg);
- }
- });
- })(arguments);
- if (memory && !firing) {
- fire();
- }
- }
- return this;
- },
- // Remove a callback from the list
- remove: function() {
- jQuery.each(arguments, function(_, arg) {
- var index;
- while ((index = jQuery.inArray(arg, list, index)) > -1) {
- list.splice(index, 1);
- if (index <= firingIndex) {
- firingIndex--;
- }
- }
- });
- return this;
- },
- // Check if a given callback is in the list.
- // If no argument is given, return whether or not list has callbacks attached.
- has: function(fn) {
- return fn ? jQuery.inArray(fn, list) > -1 : list.length > 0;
- },
- // Remove all callbacks from the list
- empty: function() {
- if (list) {
- list = [];
- }
- return this;
- },
- // Disable .fire and .add
- // Abort any current/pending executions
- // Clear all callbacks and values
- disable: function() {
- locked = queue = [];
- list = memory = "";
- return this;
- },
- disabled: function() {
- return !list;
- },
- // Disable .fire
- // Also disable .add unless we have memory (since it would have no effect)
- // Abort any pending executions
- lock: function() {
- locked = queue = [];
- if (!memory && !firing) {
- list = memory = "";
- }
- return this;
- },
- locked: function() {
- return !!locked;
- },
- // Call all callbacks with the given context and arguments
- fireWith: function(context, args) {
- if (!locked) {
- args = args || [];
- args = [context, args.slice ? args.slice() : args];
- queue.push(args);
- if (!firing) {
- fire();
- }
- }
- return this;
- },
- // Call all the callbacks with the given arguments
- fire: function() {
- self2.fireWith(this, arguments);
- return this;
- },
- // To know if the callbacks have already been called at least once
- fired: function() {
- return !!fired;
- }
- };
- return self2;
- };
- function Identity(v) {
- return v;
- }
- function Thrower(ex) {
- throw ex;
- }
- function adoptValue(value, resolve, reject, noValue) {
- var method;
- try {
- if (value && isFunction(method = value.promise)) {
- method.call(value).done(resolve).fail(reject);
- } else if (value && isFunction(method = value.then)) {
- method.call(value, resolve, reject);
- } else {
- resolve.apply(void 0, [value].slice(noValue));
- }
- } catch (value2) {
- reject.apply(void 0, [value2]);
- }
- }
- jQuery.extend({
- Deferred: function(func) {
- var tuples = [
- // action, add listener, callbacks,
- // ... .then handlers, argument index, [final state]
- [
- "notify",
- "progress",
- jQuery.Callbacks("memory"),
- jQuery.Callbacks("memory"),
- 2
- ],
- [
- "resolve",
- "done",
- jQuery.Callbacks("once memory"),
- jQuery.Callbacks("once memory"),
- 0,
- "resolved"
- ],
- [
- "reject",
- "fail",
- jQuery.Callbacks("once memory"),
- jQuery.Callbacks("once memory"),
- 1,
- "rejected"
- ]
- ], state = "pending", promise = {
- state: function() {
- return state;
- },
- always: function() {
- deferred.done(arguments).fail(arguments);
- return this;
- },
- "catch": function(fn) {
- return promise.then(null, fn);
- },
- // Keep pipe for back-compat
- pipe: function() {
- var fns = arguments;
- return jQuery.Deferred(function(newDefer) {
- jQuery.each(tuples, function(_i, tuple) {
- var fn = isFunction(fns[tuple[4]]) && fns[tuple[4]];
- deferred[tuple[1]](function() {
- var returned = fn && fn.apply(this, arguments);
- if (returned && isFunction(returned.promise)) {
- returned.promise().progress(newDefer.notify).done(newDefer.resolve).fail(newDefer.reject);
- } else {
- newDefer[tuple[0] + "With"](
- this,
- fn ? [returned] : arguments
- );
- }
- });
- });
- fns = null;
- }).promise();
- },
- then: function(onFulfilled, onRejected, onProgress) {
- var maxDepth = 0;
- function resolve(depth, deferred2, handler, special) {
- return function() {
- var that = this, args = arguments, mightThrow = function() {
- var returned, then;
- if (depth < maxDepth) {
- return;
- }
- returned = handler.apply(that, args);
- if (returned === deferred2.promise()) {
- throw new TypeError("Thenable self-resolution");
- }
- then = returned && // Support: Promises/A+ section 2.3.4
- // https://promisesaplus.com/#point-64
- // Only check objects and functions for thenability
- (typeof returned === "object" || typeof returned === "function") && returned.then;
- if (isFunction(then)) {
- if (special) {
- then.call(
- returned,
- resolve(maxDepth, deferred2, Identity, special),
- resolve(maxDepth, deferred2, Thrower, special)
- );
- } else {
- maxDepth++;
- then.call(
- returned,
- resolve(maxDepth, deferred2, Identity, special),
- resolve(maxDepth, deferred2, Thrower, special),
- resolve(
- maxDepth,
- deferred2,
- Identity,
- deferred2.notifyWith
- )
- );
- }
- } else {
- if (handler !== Identity) {
- that = void 0;
- args = [returned];
- }
- (special || deferred2.resolveWith)(that, args);
- }
- }, process = special ? mightThrow : function() {
- try {
- mightThrow();
- } catch (e) {
- if (jQuery.Deferred.exceptionHook) {
- jQuery.Deferred.exceptionHook(
- e,
- process.error
- );
- }
- if (depth + 1 >= maxDepth) {
- if (handler !== Thrower) {
- that = void 0;
- args = [e];
- }
- deferred2.rejectWith(that, args);
- }
- }
- };
- if (depth) {
- process();
- } else {
- if (jQuery.Deferred.getErrorHook) {
- process.error = jQuery.Deferred.getErrorHook();
- } else if (jQuery.Deferred.getStackHook) {
- process.error = jQuery.Deferred.getStackHook();
- }
- window2.setTimeout(process);
- }
- };
- }
- return jQuery.Deferred(function(newDefer) {
- tuples[0][3].add(
- resolve(
- 0,
- newDefer,
- isFunction(onProgress) ? onProgress : Identity,
- newDefer.notifyWith
- )
- );
- tuples[1][3].add(
- resolve(
- 0,
- newDefer,
- isFunction(onFulfilled) ? onFulfilled : Identity
- )
- );
- tuples[2][3].add(
- resolve(
- 0,
- newDefer,
- isFunction(onRejected) ? onRejected : Thrower
- )
- );
- }).promise();
- },
- // Get a promise for this deferred
- // If obj is provided, the promise aspect is added to the object
- promise: function(obj) {
- return obj != null ? jQuery.extend(obj, promise) : promise;
- }
- }, deferred = {};
- jQuery.each(tuples, function(i, tuple) {
- var list = tuple[2], stateString = tuple[5];
- promise[tuple[1]] = list.add;
- if (stateString) {
- list.add(
- function() {
- state = stateString;
- },
- // rejected_callbacks.disable
- // fulfilled_callbacks.disable
- tuples[3 - i][2].disable,
- // rejected_handlers.disable
- // fulfilled_handlers.disable
- tuples[3 - i][3].disable,
- // progress_callbacks.lock
- tuples[0][2].lock,
- // progress_handlers.lock
- tuples[0][3].lock
- );
- }
- list.add(tuple[3].fire);
- deferred[tuple[0]] = function() {
- deferred[tuple[0] + "With"](this === deferred ? void 0 : this, arguments);
- return this;
- };
- deferred[tuple[0] + "With"] = list.fireWith;
- });
- promise.promise(deferred);
- if (func) {
- func.call(deferred, deferred);
- }
- return deferred;
- },
- // Deferred helper
- when: function(singleValue) {
- var remaining = arguments.length, i = remaining, resolveContexts = Array(i), resolveValues = slice.call(arguments), primary = jQuery.Deferred(), updateFunc = function(i2) {
- return function(value) {
- resolveContexts[i2] = this;
- resolveValues[i2] = arguments.length > 1 ? slice.call(arguments) : value;
- if (!--remaining) {
- primary.resolveWith(resolveContexts, resolveValues);
- }
- };
- };
- if (remaining <= 1) {
- adoptValue(
- singleValue,
- primary.done(updateFunc(i)).resolve,
- primary.reject,
- !remaining
- );
- if (primary.state() === "pending" || isFunction(resolveValues[i] && resolveValues[i].then)) {
- return primary.then();
- }
- }
- while (i--) {
- adoptValue(resolveValues[i], updateFunc(i), primary.reject);
- }
- return primary.promise();
- }
- });
- var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
- jQuery.Deferred.exceptionHook = function(error, asyncError) {
- if (window2.console && window2.console.warn && error && rerrorNames.test(error.name)) {
- window2.console.warn(
- "jQuery.Deferred exception: " + error.message,
- error.stack,
- asyncError
- );
- }
- };
- jQuery.readyException = function(error) {
- window2.setTimeout(function() {
- throw error;
- });
- };
- var readyList = jQuery.Deferred();
- jQuery.fn.ready = function(fn) {
- readyList.then(fn).catch(function(error) {
- jQuery.readyException(error);
- });
- return this;
- };
- jQuery.extend({
- // Is the DOM ready to be used? Set to true once it occurs.
- isReady: false,
- // A counter to track how many items to wait for before
- // the ready event fires. See trac-6781
- readyWait: 1,
- // Handle when the DOM is ready
- ready: function(wait) {
- if (wait === true ? --jQuery.readyWait : jQuery.isReady) {
- return;
- }
- jQuery.isReady = true;
- if (wait !== true && --jQuery.readyWait > 0) {
- return;
- }
- readyList.resolveWith(document2, [jQuery]);
- }
- });
- jQuery.ready.then = readyList.then;
- function completed() {
- document2.removeEventListener("DOMContentLoaded", completed);
- window2.removeEventListener("load", completed);
- jQuery.ready();
- }
- if (document2.readyState === "complete" || document2.readyState !== "loading" && !document2.documentElement.doScroll) {
- window2.setTimeout(jQuery.ready);
- } else {
- document2.addEventListener("DOMContentLoaded", completed);
- window2.addEventListener("load", completed);
- }
- var access = function(elems, fn, key, value, chainable, emptyGet, raw) {
- var i = 0, len = elems.length, bulk = key == null;
- if (toType(key) === "object") {
- chainable = true;
- for (i in key) {
- access(elems, fn, i, key[i], true, emptyGet, raw);
- }
- } else if (value !== void 0) {
- chainable = true;
- if (!isFunction(value)) {
- raw = true;
- }
- if (bulk) {
- if (raw) {
- fn.call(elems, value);
- fn = null;
- } else {
- bulk = fn;
- fn = function(elem, _key, value2) {
- return bulk.call(jQuery(elem), value2);
- };
- }
- }
- if (fn) {
- for (; i < len; i++) {
- fn(
- elems[i],
- key,
- raw ? value : value.call(elems[i], i, fn(elems[i], key))
- );
- }
- }
- }
- if (chainable) {
- return elems;
- }
- if (bulk) {
- return fn.call(elems);
- }
- return len ? fn(elems[0], key) : emptyGet;
- };
- var rmsPrefix = /^-ms-/, rdashAlpha = /-([a-z])/g;
- function fcamelCase(_all, letter) {
- return letter.toUpperCase();
- }
- function camelCase(string) {
- return string.replace(rmsPrefix, "ms-").replace(rdashAlpha, fcamelCase);
- }
- var acceptData = function(owner) {
- return owner.nodeType === 1 || owner.nodeType === 9 || !+owner.nodeType;
- };
- function Data() {
- this.expando = jQuery.expando + Data.uid++;
- }
- Data.uid = 1;
- Data.prototype = {
- cache: function(owner) {
- var value = owner[this.expando];
- if (!value) {
- value = {};
- if (acceptData(owner)) {
- if (owner.nodeType) {
- owner[this.expando] = value;
- } else {
- Object.defineProperty(owner, this.expando, {
- value,
- configurable: true
- });
- }
- }
- }
- return value;
- },
- set: function(owner, data, value) {
- var prop, cache = this.cache(owner);
- if (typeof data === "string") {
- cache[camelCase(data)] = value;
- } else {
- for (prop in data) {
- cache[camelCase(prop)] = data[prop];
- }
- }
- return cache;
- },
- get: function(owner, key) {
- return key === void 0 ? this.cache(owner) : (
- // Always use camelCase key (gh-2257)
- owner[this.expando] && owner[this.expando][camelCase(key)]
- );
- },
- access: function(owner, key, value) {
- if (key === void 0 || key && typeof key === "string" && value === void 0) {
- return this.get(owner, key);
- }
- this.set(owner, key, value);
- return value !== void 0 ? value : key;
- },
- remove: function(owner, key) {
- var i, cache = owner[this.expando];
- if (cache === void 0) {
- return;
- }
- if (key !== void 0) {
- if (Array.isArray(key)) {
- key = key.map(camelCase);
- } else {
- key = camelCase(key);
- key = key in cache ? [key] : key.match(rnothtmlwhite) || [];
- }
- i = key.length;
- while (i--) {
- delete cache[key[i]];
- }
- }
- if (key === void 0 || jQuery.isEmptyObject(cache)) {
- if (owner.nodeType) {
- owner[this.expando] = void 0;
- } else {
- delete owner[this.expando];
- }
- }
- },
- hasData: function(owner) {
- var cache = owner[this.expando];
- return cache !== void 0 && !jQuery.isEmptyObject(cache);
- }
- };
- var dataPriv = new Data();
- var dataUser = new Data();
- var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, rmultiDash = /[A-Z]/g;
- function getData(data) {
- if (data === "true") {
- return true;
- }
- if (data === "false") {
- return false;
- }
- if (data === "null") {
- return null;
- }
- if (data === +data + "") {
- return +data;
- }
- if (rbrace.test(data)) {
- return JSON.parse(data);
- }
- return data;
- }
- function dataAttr(elem, key, data) {
- var name;
- if (data === void 0 && elem.nodeType === 1) {
- name = "data-" + key.replace(rmultiDash, "-$&").toLowerCase();
- data = elem.getAttribute(name);
- if (typeof data === "string") {
- try {
- data = getData(data);
- } catch (e) {
- }
- dataUser.set(elem, key, data);
- } else {
- data = void 0;
- }
- }
- return data;
- }
- jQuery.extend({
- hasData: function(elem) {
- return dataUser.hasData(elem) || dataPriv.hasData(elem);
- },
- data: function(elem, name, data) {
- return dataUser.access(elem, name, data);
- },
- removeData: function(elem, name) {
- dataUser.remove(elem, name);
- },
- // TODO: Now that all calls to _data and _removeData have been replaced
- // with direct calls to dataPriv methods, these can be deprecated.
- _data: function(elem, name, data) {
- return dataPriv.access(elem, name, data);
- },
- _removeData: function(elem, name) {
- dataPriv.remove(elem, name);
- }
- });
- jQuery.fn.extend({
- data: function(key, value) {
- var i, name, data, elem = this[0], attrs = elem && elem.attributes;
- if (key === void 0) {
- if (this.length) {
- data = dataUser.get(elem);
- if (elem.nodeType === 1 && !dataPriv.get(elem, "hasDataAttrs")) {
- i = attrs.length;
- while (i--) {
- if (attrs[i]) {
- name = attrs[i].name;
- if (name.indexOf("data-") === 0) {
- name = camelCase(name.slice(5));
- dataAttr(elem, name, data[name]);
- }
- }
- }
- dataPriv.set(elem, "hasDataAttrs", true);
- }
- }
- return data;
- }
- if (typeof key === "object") {
- return this.each(function() {
- dataUser.set(this, key);
- });
- }
- return access(this, function(value2) {
- var data2;
- if (elem && value2 === void 0) {
- data2 = dataUser.get(elem, key);
- if (data2 !== void 0) {
- return data2;
- }
- data2 = dataAttr(elem, key);
- if (data2 !== void 0) {
- return data2;
- }
- return;
- }
- this.each(function() {
- dataUser.set(this, key, value2);
- });
- }, null, value, arguments.length > 1, null, true);
- },
- removeData: function(key) {
- return this.each(function() {
- dataUser.remove(this, key);
- });
- }
- });
- jQuery.extend({
- queue: function(elem, type, data) {
- var queue;
- if (elem) {
- type = (type || "fx") + "queue";
- queue = dataPriv.get(elem, type);
- if (data) {
- if (!queue || Array.isArray(data)) {
- queue = dataPriv.access(elem, type, jQuery.makeArray(data));
- } else {
- queue.push(data);
- }
- }
- return queue || [];
- }
- },
- dequeue: function(elem, type) {
- type = type || "fx";
- var queue = jQuery.queue(elem, type), startLength = queue.length, fn = queue.shift(), hooks = jQuery._queueHooks(elem, type), next = function() {
- jQuery.dequeue(elem, type);
- };
- if (fn === "inprogress") {
- fn = queue.shift();
- startLength--;
- }
- if (fn) {
- if (type === "fx") {
- queue.unshift("inprogress");
- }
- delete hooks.stop;
- fn.call(elem, next, hooks);
- }
- if (!startLength && hooks) {
- hooks.empty.fire();
- }
- },
- // Not public - generate a queueHooks object, or return the current one
- _queueHooks: function(elem, type) {
- var key = type + "queueHooks";
- return dataPriv.get(elem, key) || dataPriv.access(elem, key, {
- empty: jQuery.Callbacks("once memory").add(function() {
- dataPriv.remove(elem, [type + "queue", key]);
- })
- });
- }
- });
- jQuery.fn.extend({
- queue: function(type, data) {
- var setter = 2;
- if (typeof type !== "string") {
- data = type;
- type = "fx";
- setter--;
- }
- if (arguments.length < setter) {
- return jQuery.queue(this[0], type);
- }
- return data === void 0 ? this : this.each(function() {
- var queue = jQuery.queue(this, type, data);
- jQuery._queueHooks(this, type);
- if (type === "fx" && queue[0] !== "inprogress") {
- jQuery.dequeue(this, type);
- }
- });
- },
- dequeue: function(type) {
- return this.each(function() {
- jQuery.dequeue(this, type);
- });
- },
- clearQueue: function(type) {
- return this.queue(type || "fx", []);
- },
- // Get a promise resolved when queues of a certain type
- // are emptied (fx is the type by default)
- promise: function(type, obj) {
- var tmp, count = 1, defer = jQuery.Deferred(), elements = this, i = this.length, resolve = function() {
- if (!--count) {
- defer.resolveWith(elements, [elements]);
- }
- };
- if (typeof type !== "string") {
- obj = type;
- type = void 0;
- }
- type = type || "fx";
- while (i--) {
- tmp = dataPriv.get(elements[i], type + "queueHooks");
- if (tmp && tmp.empty) {
- count++;
- tmp.empty.add(resolve);
- }
- }
- resolve();
- return defer.promise(obj);
- }
- });
- var pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source;
- var rcssNum = new RegExp("^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i");
- var cssExpand = ["Top", "Right", "Bottom", "Left"];
- var documentElement = document2.documentElement;
- var isAttached = function(elem) {
- return jQuery.contains(elem.ownerDocument, elem);
- }, composed = { composed: true };
- if (documentElement.getRootNode) {
- isAttached = function(elem) {
- return jQuery.contains(elem.ownerDocument, elem) || elem.getRootNode(composed) === elem.ownerDocument;
- };
- }
- var isHiddenWithinTree = function(elem, el) {
- elem = el || elem;
- return elem.style.display === "none" || elem.style.display === "" && // Otherwise, check computed style
- // Support: Firefox <=43 - 45
- // Disconnected elements can have computed display: none, so first confirm that elem is
- // in the document.
- isAttached(elem) && jQuery.css(elem, "display") === "none";
- };
- function adjustCSS(elem, prop, valueParts, tween) {
- var adjusted, scale, maxIterations = 20, currentValue = tween ? function() {
- return tween.cur();
- } : function() {
- return jQuery.css(elem, prop, "");
- }, initial = currentValue(), unit = valueParts && valueParts[3] || (jQuery.cssNumber[prop] ? "" : "px"), initialInUnit = elem.nodeType && (jQuery.cssNumber[prop] || unit !== "px" && +initial) && rcssNum.exec(jQuery.css(elem, prop));
- if (initialInUnit && initialInUnit[3] !== unit) {
- initial = initial / 2;
- unit = unit || initialInUnit[3];
- initialInUnit = +initial || 1;
- while (maxIterations--) {
- jQuery.style(elem, prop, initialInUnit + unit);
- if ((1 - scale) * (1 - (scale = currentValue() / initial || 0.5)) <= 0) {
- maxIterations = 0;
- }
- initialInUnit = initialInUnit / scale;
- }
- initialInUnit = initialInUnit * 2;
- jQuery.style(elem, prop, initialInUnit + unit);
- valueParts = valueParts || [];
- }
- if (valueParts) {
- initialInUnit = +initialInUnit || +initial || 0;
- adjusted = valueParts[1] ? initialInUnit + (valueParts[1] + 1) * valueParts[2] : +valueParts[2];
- if (tween) {
- tween.unit = unit;
- tween.start = initialInUnit;
- tween.end = adjusted;
- }
- }
- return adjusted;
- }
- var defaultDisplayMap = {};
- function getDefaultDisplay(elem) {
- var temp, doc = elem.ownerDocument, nodeName2 = elem.nodeName, display = defaultDisplayMap[nodeName2];
- if (display) {
- return display;
- }
- temp = doc.body.appendChild(doc.createElement(nodeName2));
- display = jQuery.css(temp, "display");
- temp.parentNode.removeChild(temp);
- if (display === "none") {
- display = "block";
- }
- defaultDisplayMap[nodeName2] = display;
- return display;
- }
- function showHide(elements, show) {
- var display, elem, values = [], index = 0, length = elements.length;
- for (; index < length; index++) {
- elem = elements[index];
- if (!elem.style) {
- continue;
- }
- display = elem.style.display;
- if (show) {
- if (display === "none") {
- values[index] = dataPriv.get(elem, "display") || null;
- if (!values[index]) {
- elem.style.display = "";
- }
- }
- if (elem.style.display === "" && isHiddenWithinTree(elem)) {
- values[index] = getDefaultDisplay(elem);
- }
- } else {
- if (display !== "none") {
- values[index] = "none";
- dataPriv.set(elem, "display", display);
- }
- }
- }
- for (index = 0; index < length; index++) {
- if (values[index] != null) {
- elements[index].style.display = values[index];
- }
- }
- return elements;
- }
- jQuery.fn.extend({
- show: function() {
- return showHide(this, true);
- },
- hide: function() {
- return showHide(this);
- },
- toggle: function(state) {
- if (typeof state === "boolean") {
- return state ? this.show() : this.hide();
- }
- return this.each(function() {
- if (isHiddenWithinTree(this)) {
- jQuery(this).show();
- } else {
- jQuery(this).hide();
- }
- });
- }
- });
- var rcheckableType = /^(?:checkbox|radio)$/i;
- var rtagName = /<([a-z][^\/\0>\x20\t\r\n\f]*)/i;
- var rscriptType = /^$|^module$|\/(?:java|ecma)script/i;
- (function() {
- var fragment = document2.createDocumentFragment(), div = fragment.appendChild(document2.createElement("div")), input = document2.createElement("input");
- input.setAttribute("type", "radio");
- input.setAttribute("checked", "checked");
- input.setAttribute("name", "t");
- div.appendChild(input);
- support.checkClone = div.cloneNode(true).cloneNode(true).lastChild.checked;
- div.innerHTML = "<textarea>x</textarea>";
- support.noCloneChecked = !!div.cloneNode(true).lastChild.defaultValue;
- div.innerHTML = "<option></option>";
- support.option = !!div.lastChild;
- })();
- var wrapMap = {
- // XHTML parsers do not magically insert elements in the
- // same way that tag soup parsers do. So we cannot shorten
- // this by omitting <tbody> or other required elements.
- thead: [1, "<table>", "</table>"],
- col: [2, "<table><colgroup>", "</colgroup></table>"],
- tr: [2, "<table><tbody>", "</tbody></table>"],
- td: [3, "<table><tbody><tr>", "</tr></tbody></table>"],
- _default: [0, "", ""]
- };
- wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
- wrapMap.th = wrapMap.td;
- if (!support.option) {
- wrapMap.optgroup = wrapMap.option = [1, "<select multiple='multiple'>", "</select>"];
- }
- function getAll(context, tag) {
- var ret;
- if (typeof context.getElementsByTagName !== "undefined") {
- ret = context.getElementsByTagName(tag || "*");
- } else if (typeof context.querySelectorAll !== "undefined") {
- ret = context.querySelectorAll(tag || "*");
- } else {
- ret = [];
- }
- if (tag === void 0 || tag && nodeName(context, tag)) {
- return jQuery.merge([context], ret);
- }
- return ret;
- }
- function setGlobalEval(elems, refElements) {
- var i = 0, l = elems.length;
- for (; i < l; i++) {
- dataPriv.set(
- elems[i],
- "globalEval",
- !refElements || dataPriv.get(refElements[i], "globalEval")
- );
- }
- }
- var rhtml = /<|&#?\w+;/;
- function buildFragment(elems, context, scripts, selection, ignored) {
- var elem, tmp, tag, wrap, attached, j, fragment = context.createDocumentFragment(), nodes = [], i = 0, l = elems.length;
- for (; i < l; i++) {
- elem = elems[i];
- if (elem || elem === 0) {
- if (toType(elem) === "object") {
- jQuery.merge(nodes, elem.nodeType ? [elem] : elem);
- } else if (!rhtml.test(elem)) {
- nodes.push(context.createTextNode(elem));
- } else {
- tmp = tmp || fragment.appendChild(context.createElement("div"));
- tag = (rtagName.exec(elem) || ["", ""])[1].toLowerCase();
- wrap = wrapMap[tag] || wrapMap._default;
- tmp.innerHTML = wrap[1] + jQuery.htmlPrefilter(elem) + wrap[2];
- j = wrap[0];
- while (j--) {
- tmp = tmp.lastChild;
- }
- jQuery.merge(nodes, tmp.childNodes);
- tmp = fragment.firstChild;
- tmp.textContent = "";
- }
- }
- }
- fragment.textContent = "";
- i = 0;
- while (elem = nodes[i++]) {
- if (selection && jQuery.inArray(elem, selection) > -1) {
- if (ignored) {
- ignored.push(elem);
- }
- continue;
- }
- attached = isAttached(elem);
- tmp = getAll(fragment.appendChild(elem), "script");
- if (attached) {
- setGlobalEval(tmp);
- }
- if (scripts) {
- j = 0;
- while (elem = tmp[j++]) {
- if (rscriptType.test(elem.type || "")) {
- scripts.push(elem);
- }
- }
- }
- }
- return fragment;
- }
- var rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
- function returnTrue() {
- return true;
- }
- function returnFalse() {
- return false;
- }
- function on(elem, types, selector, data, fn, one) {
- var origFn, type;
- if (typeof types === "object") {
- if (typeof selector !== "string") {
- data = data || selector;
- selector = void 0;
- }
- for (type in types) {
- on(elem, type, selector, data, types[type], one);
- }
- return elem;
- }
- if (data == null && fn == null) {
- fn = selector;
- data = selector = void 0;
- } else if (fn == null) {
- if (typeof selector === "string") {
- fn = data;
- data = void 0;
- } else {
- fn = data;
- data = selector;
- selector = void 0;
- }
- }
- if (fn === false) {
- fn = returnFalse;
- } else if (!fn) {
- return elem;
- }
- if (one === 1) {
- origFn = fn;
- fn = function(event) {
- jQuery().off(event);
- return origFn.apply(this, arguments);
- };
- fn.guid = origFn.guid || (origFn.guid = jQuery.guid++);
- }
- return elem.each(function() {
- jQuery.event.add(this, types, fn, data, selector);
- });
- }
- jQuery.event = {
- global: {},
- add: function(elem, types, handler, data, selector) {
- var handleObjIn, eventHandle, tmp, events, t, handleObj, special, handlers, type, namespaces, origType, elemData = dataPriv.get(elem);
- if (!acceptData(elem)) {
- return;
- }
- if (handler.handler) {
- handleObjIn = handler;
- handler = handleObjIn.handler;
- selector = handleObjIn.selector;
- }
- if (selector) {
- jQuery.find.matchesSelector(documentElement, selector);
- }
- if (!handler.guid) {
- handler.guid = jQuery.guid++;
- }
- if (!(events = elemData.events)) {
- events = elemData.events = /* @__PURE__ */ Object.create(null);
- }
- if (!(eventHandle = elemData.handle)) {
- eventHandle = elemData.handle = function(e) {
- return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? jQuery.event.dispatch.apply(elem, arguments) : void 0;
- };
- }
- types = (types || "").match(rnothtmlwhite) || [""];
- t = types.length;
- while (t--) {
- tmp = rtypenamespace.exec(types[t]) || [];
- type = origType = tmp[1];
- namespaces = (tmp[2] || "").split(".").sort();
- if (!type) {
- continue;
- }
- special = jQuery.event.special[type] || {};
- type = (selector ? special.delegateType : special.bindType) || type;
- special = jQuery.event.special[type] || {};
- handleObj = jQuery.extend({
- type,
- origType,
- data,
- handler,
- guid: handler.guid,
- selector,
- needsContext: selector && jQuery.expr.match.needsContext.test(selector),
- namespace: namespaces.join(".")
- }, handleObjIn);
- if (!(handlers = events[type])) {
- handlers = events[type] = [];
- handlers.delegateCount = 0;
- if (!special.setup || special.setup.call(elem, data, namespaces, eventHandle) === false) {
- if (elem.addEventListener) {
- elem.addEventListener(type, eventHandle);
- }
- }
- }
- if (special.add) {
- special.add.call(elem, handleObj);
- if (!handleObj.handler.guid) {
- handleObj.handler.guid = handler.guid;
- }
- }
- if (selector) {
- handlers.splice(handlers.delegateCount++, 0, handleObj);
- } else {
- handlers.push(handleObj);
- }
- jQuery.event.global[type] = true;
- }
- },
- // Detach an event or set of events from an element
- remove: function(elem, types, handler, selector, mappedTypes) {
- var j, origCount, tmp, events, t, handleObj, special, handlers, type, namespaces, origType, elemData = dataPriv.hasData(elem) && dataPriv.get(elem);
- if (!elemData || !(events = elemData.events)) {
- return;
- }
- types = (types || "").match(rnothtmlwhite) || [""];
- t = types.length;
- while (t--) {
- tmp = rtypenamespace.exec(types[t]) || [];
- type = origType = tmp[1];
- namespaces = (tmp[2] || "").split(".").sort();
- if (!type) {
- for (type in events) {
- jQuery.event.remove(elem, type + types[t], handler, selector, true);
- }
- continue;
- }
- special = jQuery.event.special[type] || {};
- type = (selector ? special.delegateType : special.bindType) || type;
- handlers = events[type] || [];
- tmp = tmp[2] && new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)");
- origCount = j = handlers.length;
- while (j--) {
- handleObj = handlers[j];
- if ((mappedTypes || origType === handleObj.origType) && (!handler || handler.guid === handleObj.guid) && (!tmp || tmp.test(handleObj.namespace)) && (!selector || selector === handleObj.selector || selector === "**" && handleObj.selector)) {
- handlers.splice(j, 1);
- if (handleObj.selector) {
- handlers.delegateCount--;
- }
- if (special.remove) {
- special.remove.call(elem, handleObj);
- }
- }
- }
- if (origCount && !handlers.length) {
- if (!special.teardown || special.teardown.call(elem, namespaces, elemData.handle) === false) {
- jQuery.removeEvent(elem, type, elemData.handle);
- }
- delete events[type];
- }
- }
- if (jQuery.isEmptyObject(events)) {
- dataPriv.remove(elem, "handle events");
- }
- },
- dispatch: function(nativeEvent) {
- 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] || {};
- args[0] = event;
- for (i = 1; i < arguments.length; i++) {
- args[i] = arguments[i];
- }
- event.delegateTarget = this;
- if (special.preDispatch && special.preDispatch.call(this, event) === false) {
- return;
- }
- handlerQueue = jQuery.event.handlers.call(this, event, handlers);
- i = 0;
- while ((matched = handlerQueue[i++]) && !event.isPropagationStopped()) {
- event.currentTarget = matched.elem;
- j = 0;
- while ((handleObj = matched.handlers[j++]) && !event.isImmediatePropagationStopped()) {
- if (!event.rnamespace || handleObj.namespace === false || event.rnamespace.test(handleObj.namespace)) {
- event.handleObj = handleObj;
- event.data = handleObj.data;
- ret = ((jQuery.event.special[handleObj.origType] || {}).handle || handleObj.handler).apply(matched.elem, args);
- if (ret !== void 0) {
- if ((event.result = ret) === false) {
- event.preventDefault();
- event.stopPropagation();
- }
- }
- }
- }
- }
- if (special.postDispatch) {
- special.postDispatch.call(this, event);
- }
- return event.result;
- },
- handlers: function(event, handlers) {
- var i, handleObj, sel, matchedHandlers, matchedSelectors, handlerQueue = [], delegateCount = handlers.delegateCount, cur = event.target;
- if (delegateCount && // Support: IE <=9
- // Black-hole SVG <use> instance trees (trac-13180)
- cur.nodeType && // Support: Firefox <=42
- // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)
- // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click
- // Support: IE 11 only
- // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343)
- !(event.type === "click" && event.button >= 1)) {
- for (; cur !== this; cur = cur.parentNode || this) {
- if (cur.nodeType === 1 && !(event.type === "click" && cur.disabled === true)) {
- matchedHandlers = [];
- matchedSelectors = {};
- for (i = 0; i < delegateCount; i++) {
- handleObj = handlers[i];
- sel = handleObj.selector + " ";
- if (matchedSelectors[sel] === void 0) {
- matchedSelectors[sel] = handleObj.needsContext ? jQuery(sel, this).index(cur) > -1 : jQuery.find(sel, this, null, [cur]).length;
- }
- if (matchedSelectors[sel]) {
- matchedHandlers.push(handleObj);
- }
- }
- if (matchedHandlers.length) {
- handlerQueue.push({ elem: cur, handlers: matchedHandlers });
- }
- }
- }
- }
- cur = this;
- if (delegateCount < handlers.length) {
- handlerQueue.push({ elem: cur, handlers: handlers.slice(delegateCount) });
- }
- return handlerQueue;
- },
- addProp: function(name, hook) {
- Object.defineProperty(jQuery.Event.prototype, name, {
- enumerable: true,
- configurable: true,
- get: isFunction(hook) ? function() {
- if (this.originalEvent) {
- return hook(this.originalEvent);
- }
- } : function() {
- if (this.originalEvent) {
- return this.originalEvent[name];
- }
- },
- set: function(value) {
- Object.defineProperty(this, name, {
- enumerable: true,
- configurable: true,
- writable: true,
- value
- });
- }
- });
- },
- fix: function(originalEvent) {
- return originalEvent[jQuery.expando] ? originalEvent : new jQuery.Event(originalEvent);
- },
- special: {
- load: {
- // Prevent triggered image.load events from bubbling to window.load
- noBubble: true
- },
- click: {
- // Utilize native event to ensure correct state for checkable inputs
- setup: function(data) {
- var el = this || data;
- if (rcheckableType.test(el.type) && el.click && nodeName(el, "input")) {
- leverageNative(el, "click", true);
- }
- return false;
- },
- trigger: function(data) {
- var el = this || data;
- if (rcheckableType.test(el.type) && el.click && nodeName(el, "input")) {
- leverageNative(el, "click");
- }
- return true;
- },
- // For cross-browser consistency, suppress native .click() on links
- // Also prevent it if we're currently inside a leveraged native-event stack
- _default: function(event) {
- var target = event.target;
- return rcheckableType.test(target.type) && target.click && nodeName(target, "input") && dataPriv.get(target, "click") || nodeName(target, "a");
- }
- },
- beforeunload: {
- postDispatch: function(event) {
- if (event.result !== void 0 && event.originalEvent) {
- event.originalEvent.returnValue = event.result;
- }
- }
- }
- }
- };
- function leverageNative(el, type, isSetup) {
- if (!isSetup) {
- if (dataPriv.get(el, type) === void 0) {
- jQuery.event.add(el, type, returnTrue);
- }
- return;
- }
- dataPriv.set(el, type, false);
- jQuery.event.add(el, type, {
- namespace: false,
- handler: function(event) {
- var result, saved = dataPriv.get(this, type);
- if (event.isTrigger & 1 && this[type]) {
- if (!saved) {
- saved = slice.call(arguments);
- dataPriv.set(this, type, saved);
- this[type]();
- result = dataPriv.get(this, type);
- dataPriv.set(this, type, false);
- if (saved !== result) {
- event.stopImmediatePropagation();
- event.preventDefault();
- return result;
- }
- } else if ((jQuery.event.special[type] || {}).delegateType) {
- event.stopPropagation();
- }
- } else if (saved) {
- dataPriv.set(this, type, jQuery.event.trigger(
- saved[0],
- saved.slice(1),
- this
- ));
- event.stopPropagation();
- event.isImmediatePropagationStopped = returnTrue;
- }
- }
- });
- }
- jQuery.removeEvent = function(elem, type, handle) {
- if (elem.removeEventListener) {
- elem.removeEventListener(type, handle);
- }
- };
- jQuery.Event = function(src, props) {
- if (!(this instanceof jQuery.Event)) {
- return new jQuery.Event(src, props);
- }
- if (src && src.type) {
- this.originalEvent = src;
- this.type = src.type;
- this.isDefaultPrevented = src.defaultPrevented || src.defaultPrevented === void 0 && // Support: Android <=2.3 only
- src.returnValue === false ? returnTrue : returnFalse;
- this.target = src.target && src.target.nodeType === 3 ? src.target.parentNode : src.target;
- this.currentTarget = src.currentTarget;
- this.relatedTarget = src.relatedTarget;
- } else {
- this.type = src;
- }
- if (props) {
- jQuery.extend(this, props);
- }
- this.timeStamp = src && src.timeStamp || Date.now();
- this[jQuery.expando] = true;
- };
- jQuery.Event.prototype = {
- constructor: jQuery.Event,
- isDefaultPrevented: returnFalse,
- isPropagationStopped: returnFalse,
- isImmediatePropagationStopped: returnFalse,
- isSimulated: false,
- preventDefault: function() {
- var e = this.originalEvent;
- this.isDefaultPrevented = returnTrue;
- if (e && !this.isSimulated) {
- e.preventDefault();
- }
- },
- stopPropagation: function() {
- var e = this.originalEvent;
- this.isPropagationStopped = returnTrue;
- if (e && !this.isSimulated) {
- e.stopPropagation();
- }
- },
- stopImmediatePropagation: function() {
- var e = this.originalEvent;
- this.isImmediatePropagationStopped = returnTrue;
- if (e && !this.isSimulated) {
- e.stopImmediatePropagation();
- }
- this.stopPropagation();
- }
- };
- jQuery.each({
- altKey: true,
- bubbles: true,
- cancelable: true,
- changedTouches: true,
- ctrlKey: true,
- detail: true,
- eventPhase: true,
- metaKey: true,
- pageX: true,
- pageY: true,
- shiftKey: true,
- view: true,
- "char": true,
- code: true,
- charCode: true,
- key: true,
- keyCode: true,
- button: true,
- buttons: true,
- clientX: true,
- clientY: true,
- offsetX: true,
- offsetY: true,
- pointerId: true,
- pointerType: true,
- screenX: true,
- screenY: true,
- targetTouches: true,
- toElement: true,
- touches: true,
- which: true
- }, jQuery.event.addProp);
- jQuery.each({ focus: "focusin", blur: "focusout" }, function(type, delegateType) {
- function focusMappedHandler(nativeEvent) {
- if (document2.documentMode) {
- var handle = dataPriv.get(this, "handle"), event = jQuery.event.fix(nativeEvent);
- event.type = nativeEvent.type === "focusin" ? "focus" : "blur";
- event.isSimulated = true;
- handle(nativeEvent);
- if (event.target === event.currentTarget) {
- handle(event);
- }
- } else {
- jQuery.event.simulate(
- delegateType,
- nativeEvent.target,
- jQuery.event.fix(nativeEvent)
- );
- }
- }
- jQuery.event.special[type] = {
- // Utilize native event if possible so blur/focus sequence is correct
- setup: function() {
- var attaches;
- leverageNative(this, type, true);
- if (document2.documentMode) {
- attaches = dataPriv.get(this, delegateType);
- if (!attaches) {
- this.addEventListener(delegateType, focusMappedHandler);
- }
- dataPriv.set(this, delegateType, (attaches || 0) + 1);
- } else {
- return false;
- }
- },
- trigger: function() {
- leverageNative(this, type);
- return true;
- },
- teardown: function() {
- var attaches;
- if (document2.documentMode) {
- attaches = dataPriv.get(this, delegateType) - 1;
- if (!attaches) {
- this.removeEventListener(delegateType, focusMappedHandler);
- dataPriv.remove(this, delegateType);
- } else {
- dataPriv.set(this, delegateType, attaches);
- }
- } else {
- return false;
- }
- },
- // Suppress native focus or blur if we're currently inside
- // a leveraged native-event stack
- _default: function(event) {
- return dataPriv.get(event.target, type);
- },
- delegateType
- };
- jQuery.event.special[delegateType] = {
- setup: function() {
- var doc = this.ownerDocument || this.document || this, dataHolder = document2.documentMode ? this : doc, attaches = dataPriv.get(dataHolder, delegateType);
- if (!attaches) {
- if (document2.documentMode) {
- this.addEventListener(delegateType, focusMappedHandler);
- } else {
- doc.addEventListener(type, focusMappedHandler, true);
- }
- }
- dataPriv.set(dataHolder, delegateType, (attaches || 0) + 1);
- },
- teardown: function() {
- var doc = this.ownerDocument || this.document || this, dataHolder = document2.documentMode ? this : doc, attaches = dataPriv.get(dataHolder, delegateType) - 1;
- if (!attaches) {
- if (document2.documentMode) {
- this.removeEventListener(delegateType, focusMappedHandler);
- } else {
- doc.removeEventListener(type, focusMappedHandler, true);
- }
- dataPriv.remove(dataHolder, delegateType);
- } else {
- dataPriv.set(dataHolder, delegateType, attaches);
- }
- }
- };
- });
- jQuery.each({
- mouseenter: "mouseover",
- mouseleave: "mouseout",
- pointerenter: "pointerover",
- pointerleave: "pointerout"
- }, function(orig, fix) {
- jQuery.event.special[orig] = {
- delegateType: fix,
- bindType: fix,
- handle: function(event) {
- var ret, target = this, related = event.relatedTarget, handleObj = event.handleObj;
- if (!related || related !== target && !jQuery.contains(target, related)) {
- event.type = handleObj.origType;
- ret = handleObj.handler.apply(this, arguments);
- event.type = fix;
- }
- return ret;
- }
- };
- });
- jQuery.fn.extend({
- on: function(types, selector, data, fn) {
- return on(this, types, selector, data, fn);
- },
- one: function(types, selector, data, fn) {
- return on(this, types, selector, data, fn, 1);
- },
- off: function(types, selector, fn) {
- var handleObj, type;
- if (types && types.preventDefault && types.handleObj) {
- handleObj = types.handleObj;
- jQuery(types.delegateTarget).off(
- handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
- handleObj.selector,
- handleObj.handler
- );
- return this;
- }
- if (typeof types === "object") {
- for (type in types) {
- this.off(type, selector, types[type]);
- }
- return this;
- }
- if (selector === false || typeof selector === "function") {
- fn = selector;
- selector = void 0;
- }
- if (fn === false) {
- fn = returnFalse;
- }
- return this.each(function() {
- jQuery.event.remove(this, types, fn, selector);
- });
- }
- });
- var rnoInnerhtml = /<script|<style|<link/i, rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, rcleanScript = /^\s*<!\[CDATA\[|\]\]>\s*$/g;
- function manipulationTarget(elem, content) {
- if (nodeName(elem, "table") && nodeName(content.nodeType !== 11 ? content : content.firstChild, "tr")) {
- return jQuery(elem).children("tbody")[0] || elem;
- }
- return elem;
- }
- function disableScript(elem) {
- elem.type = (elem.getAttribute("type") !== null) + "/" + elem.type;
- return elem;
- }
- function restoreScript(elem) {
- if ((elem.type || "").slice(0, 5) === "true/") {
- elem.type = elem.type.slice(5);
- } else {
- elem.removeAttribute("type");
- }
- return elem;
- }
- function cloneCopyEvent(src, dest) {
- var i, l, type, pdataOld, udataOld, udataCur, events;
- if (dest.nodeType !== 1) {
- return;
- }
- if (dataPriv.hasData(src)) {
- pdataOld = dataPriv.get(src);
- events = pdataOld.events;
- if (events) {
- dataPriv.remove(dest, "handle events");
- for (type in events) {
- for (i = 0, l = events[type].length; i < l; i++) {
- jQuery.event.add(dest, type, events[type][i]);
- }
- }
- }
- }
- if (dataUser.hasData(src)) {
- udataOld = dataUser.access(src);
- udataCur = jQuery.extend({}, udataOld);
- dataUser.set(dest, udataCur);
- }
- }
- function fixInput(src, dest) {
- var nodeName2 = dest.nodeName.toLowerCase();
- if (nodeName2 === "input" && rcheckableType.test(src.type)) {
- dest.checked = src.checked;
- } else if (nodeName2 === "input" || nodeName2 === "textarea") {
- dest.defaultValue = src.defaultValue;
- }
- }
- function domManip(collection, args, callback, ignored) {
- args = flat(args);
- var fragment, first, scripts, hasScripts, node, doc, i = 0, l = collection.length, iNoClone = l - 1, value = args[0], valueIsFunction = isFunction(value);
- if (valueIsFunction || l > 1 && typeof value === "string" && !support.checkClone && rchecked.test(value)) {
- return collection.each(function(index) {
- var self2 = collection.eq(index);
- if (valueIsFunction) {
- args[0] = value.call(this, index, self2.html());
- }
- domManip(self2, args, callback, ignored);
- });
- }
- if (l) {
- fragment = buildFragment(args, collection[0].ownerDocument, false, collection, ignored);
- first = fragment.firstChild;
- if (fragment.childNodes.length === 1) {
- fragment = first;
- }
- if (first || ignored) {
- scripts = jQuery.map(getAll(fragment, "script"), disableScript);
- hasScripts = scripts.length;
- for (; i < l; i++) {
- node = fragment;
- if (i !== iNoClone) {
- node = jQuery.clone(node, true, true);
- if (hasScripts) {
- jQuery.merge(scripts, getAll(node, "script"));
- }
- }
- callback.call(collection[i], node, i);
- }
- if (hasScripts) {
- doc = scripts[scripts.length - 1].ownerDocument;
- jQuery.map(scripts, restoreScript);
- for (i = 0; i < hasScripts; i++) {
- node = scripts[i];
- if (rscriptType.test(node.type || "") && !dataPriv.access(node, "globalEval") && jQuery.contains(doc, node)) {
- if (node.src && (node.type || "").toLowerCase() !== "module") {
- if (jQuery._evalUrl && !node.noModule) {
- jQuery._evalUrl(node.src, {
- nonce: node.nonce || node.getAttribute("nonce")
- }, doc);
- }
- } else {
- DOMEval(node.textContent.replace(rcleanScript, ""), node, doc);
- }
- }
- }
- }
- }
- }
- return collection;
- }
- function remove(elem, selector, keepData) {
- var node, nodes = selector ? jQuery.filter(selector, elem) : elem, i = 0;
- for (; (node = nodes[i]) != null; i++) {
- if (!keepData && node.nodeType === 1) {
- jQuery.cleanData(getAll(node));
- }
- if (node.parentNode) {
- if (keepData && isAttached(node)) {
- setGlobalEval(getAll(node, "script"));
- }
- node.parentNode.removeChild(node);
- }
- }
- return elem;
- }
- jQuery.extend({
- htmlPrefilter: function(html) {
- return html;
- },
- clone: function(elem, dataAndEvents, deepDataAndEvents) {
- var i, l, srcElements, destElements, clone = elem.cloneNode(true), inPage = isAttached(elem);
- if (!support.noCloneChecked && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem)) {
- destElements = getAll(clone);
- srcElements = getAll(elem);
- for (i = 0, l = srcElements.length; i < l; i++) {
- fixInput(srcElements[i], destElements[i]);
- }
- }
- if (dataAndEvents) {
- if (deepDataAndEvents) {
- srcElements = srcElements || getAll(elem);
- destElements = destElements || getAll(clone);
- for (i = 0, l = srcElements.length; i < l; i++) {
- cloneCopyEvent(srcElements[i], destElements[i]);
- }
- } else {
- cloneCopyEvent(elem, clone);
- }
- }
- destElements = getAll(clone, "script");
- if (destElements.length > 0) {
- setGlobalEval(destElements, !inPage && getAll(elem, "script"));
- }
- return clone;
- },
- cleanData: function(elems) {
- var data, elem, type, special = jQuery.event.special, i = 0;
- for (; (elem = elems[i]) !== void 0; i++) {
- if (acceptData(elem)) {
- if (data = elem[dataPriv.expando]) {
- if (data.events) {
- for (type in data.events) {
- if (special[type]) {
- jQuery.event.remove(elem, type);
- } else {
- jQuery.removeEvent(elem, type, data.handle);
- }
- }
- }
- elem[dataPriv.expando] = void 0;
- }
- if (elem[dataUser.expando]) {
- elem[dataUser.expando] = void 0;
- }
- }
- }
- }
- });
- jQuery.fn.extend({
- detach: function(selector) {
- return remove(this, selector, true);
- },
- remove: function(selector) {
- return remove(this, selector);
- },
- text: function(value) {
- return access(this, function(value2) {
- return value2 === void 0 ? jQuery.text(this) : this.empty().each(function() {
- if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
- this.textContent = value2;
- }
- });
- }, null, value, arguments.length);
- },
- append: function() {
- return domManip(this, arguments, function(elem) {
- if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
- var target = manipulationTarget(this, elem);
- target.appendChild(elem);
- }
- });
- },
- prepend: function() {
- return domManip(this, arguments, function(elem) {
- if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
- var target = manipulationTarget(this, elem);
- target.insertBefore(elem, target.firstChild);
- }
- });
- },
- before: function() {
- return domManip(this, arguments, function(elem) {
- if (this.parentNode) {
- this.parentNode.insertBefore(elem, this);
- }
- });
- },
- after: function() {
- return domManip(this, arguments, function(elem) {
- if (this.parentNode) {
- this.parentNode.insertBefore(elem, this.nextSibling);
- }
- });
- },
- empty: function() {
- var elem, i = 0;
- for (; (elem = this[i]) != null; i++) {
- if (elem.nodeType === 1) {
- jQuery.cleanData(getAll(elem, false));
- elem.textContent = "";
- }
- }
- return this;
- },
- clone: function(dataAndEvents, deepDataAndEvents) {
- dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
- deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
- return this.map(function() {
- return jQuery.clone(this, dataAndEvents, deepDataAndEvents);
- });
- },
- html: function(value) {
- return access(this, function(value2) {
- var elem = this[0] || {}, i = 0, l = this.length;
- if (value2 === void 0 && elem.nodeType === 1) {
- return elem.innerHTML;
- }
- if (typeof value2 === "string" && !rnoInnerhtml.test(value2) && !wrapMap[(rtagName.exec(value2) || ["", ""])[1].toLowerCase()]) {
- value2 = jQuery.htmlPrefilter(value2);
- try {
- for (; i < l; i++) {
- elem = this[i] || {};
- if (elem.nodeType === 1) {
- jQuery.cleanData(getAll(elem, false));
- elem.innerHTML = value2;
- }
- }
- elem = 0;
- } catch (e) {
- }
- }
- if (elem) {
- this.empty().append(value2);
- }
- }, null, value, arguments.length);
- },
- replaceWith: function() {
- var ignored = [];
- return domManip(this, arguments, function(elem) {
- var parent = this.parentNode;
- if (jQuery.inArray(this, ignored) < 0) {
- jQuery.cleanData(getAll(this));
- if (parent) {
- parent.replaceChild(elem, this);
- }
- }
- }, ignored);
- }
- });
- jQuery.each({
- appendTo: "append",
- prependTo: "prepend",
- insertBefore: "before",
- insertAfter: "after",
- replaceAll: "replaceWith"
- }, function(name, original) {
- jQuery.fn[name] = function(selector) {
- var elems, ret = [], insert = jQuery(selector), last = insert.length - 1, i = 0;
- for (; i <= last; i++) {
- elems = i === last ? this : this.clone(true);
- jQuery(insert[i])[original](elems);
- push.apply(ret, elems.get());
- }
- return this.pushStack(ret);
- };
- });
- var rnumnonpx = new RegExp("^(" + pnum + ")(?!px)[a-z%]+$", "i");
- var rcustomProp = /^--/;
- var getStyles = function(elem) {
- var view = elem.ownerDocument.defaultView;
- if (!view || !view.opener) {
- view = window2;
- }
- return view.getComputedStyle(elem);
- };
- var swap = function(elem, options, callback) {
- var ret, name, old = {};
- for (name in options) {
- old[name] = elem.style[name];
- elem.style[name] = options[name];
- }
- ret = callback.call(elem);
- for (name in options) {
- elem.style[name] = old[name];
- }
- return ret;
- };
- var rboxStyle = new RegExp(cssExpand.join("|"), "i");
- (function() {
- function computeStyleTests() {
- if (!div) {
- return;
- }
- container.style.cssText = "position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0";
- div.style.cssText = "position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%";
- documentElement.appendChild(container).appendChild(div);
- var divStyle = window2.getComputedStyle(div);
- pixelPositionVal = divStyle.top !== "1%";
- reliableMarginLeftVal = roundPixelMeasures(divStyle.marginLeft) === 12;
- div.style.right = "60%";
- pixelBoxStylesVal = roundPixelMeasures(divStyle.right) === 36;
- boxSizingReliableVal = roundPixelMeasures(divStyle.width) === 36;
- div.style.position = "absolute";
- scrollboxSizeVal = roundPixelMeasures(div.offsetWidth / 3) === 12;
- documentElement.removeChild(container);
- div = null;
- }
- function roundPixelMeasures(measure) {
- return Math.round(parseFloat(measure));
- }
- var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, reliableTrDimensionsVal, reliableMarginLeftVal, container = document2.createElement("div"), div = document2.createElement("div");
- if (!div.style) {
- return;
- }
- div.style.backgroundClip = "content-box";
- div.cloneNode(true).style.backgroundClip = "";
- support.clearCloneStyle = div.style.backgroundClip === "content-box";
- jQuery.extend(support, {
- boxSizingReliable: function() {
- computeStyleTests();
- return boxSizingReliableVal;
- },
- pixelBoxStyles: function() {
- computeStyleTests();
- return pixelBoxStylesVal;
- },
- pixelPosition: function() {
- computeStyleTests();
- return pixelPositionVal;
- },
- reliableMarginLeft: function() {
- computeStyleTests();
- return reliableMarginLeftVal;
- },
- scrollboxSize: function() {
- computeStyleTests();
- return scrollboxSizeVal;
- },
- // Support: IE 9 - 11+, Edge 15 - 18+
- // IE/Edge misreport `getComputedStyle` of table rows with width/height
- // set in CSS while `offset*` properties report correct values.
- // Behavior in IE 9 is more subtle than in newer versions & it passes
- // some versions of this test; make sure not to make it pass there!
- //
- // Support: Firefox 70+
- // Only Firefox includes border widths
- // in computed dimensions. (gh-4529)
- reliableTrDimensions: function() {
- var table, tr, trChild, trStyle;
- if (reliableTrDimensionsVal == null) {
- table = document2.createElement("table");
- tr = document2.createElement("tr");
- trChild = document2.createElement("div");
- table.style.cssText = "position:absolute;left:-11111px;border-collapse:separate";
- tr.style.cssText = "box-sizing:content-box;border:1px solid";
- tr.style.height = "1px";
- trChild.style.height = "9px";
- trChild.style.display = "block";
- documentElement.appendChild(table).appendChild(tr).appendChild(trChild);
- trStyle = window2.getComputedStyle(tr);
- reliableTrDimensionsVal = parseInt(trStyle.height, 10) + parseInt(trStyle.borderTopWidth, 10) + parseInt(trStyle.borderBottomWidth, 10) === tr.offsetHeight;
- documentElement.removeChild(table);
- }
- return reliableTrDimensionsVal;
- }
- });
- })();
- function curCSS(elem, name, computed) {
- var width, minWidth, maxWidth, ret, isCustomProp = rcustomProp.test(name), style = elem.style;
- computed = computed || getStyles(elem);
- if (computed) {
- ret = computed.getPropertyValue(name) || computed[name];
- if (isCustomProp && ret) {
- ret = ret.replace(rtrimCSS, "$1") || void 0;
- }
- if (ret === "" && !isAttached(elem)) {
- ret = jQuery.style(elem, name);
- }
- if (!support.pixelBoxStyles() && rnumnonpx.test(ret) && rboxStyle.test(name)) {
- width = style.width;
- minWidth = style.minWidth;
- maxWidth = style.maxWidth;
- style.minWidth = style.maxWidth = style.width = ret;
- ret = computed.width;
- style.width = width;
- style.minWidth = minWidth;
- style.maxWidth = maxWidth;
- }
- }
- return ret !== void 0 ? (
- // Support: IE <=9 - 11 only
- // IE returns zIndex value as an integer.
- ret + ""
- ) : ret;
- }
- function addGetHookIf(conditionFn, hookFn) {
- return {
- get: function() {
- if (conditionFn()) {
- delete this.get;
- return;
- }
- return (this.get = hookFn).apply(this, arguments);
- }
- };
- }
- var cssPrefixes = ["Webkit", "Moz", "ms"], emptyStyle = document2.createElement("div").style, vendorProps = {};
- function vendorPropName(name) {
- var capName = name[0].toUpperCase() + name.slice(1), i = cssPrefixes.length;
- while (i--) {
- name = cssPrefixes[i] + capName;
- if (name in emptyStyle) {
- return name;
- }
- }
- }
- function finalPropName(name) {
- var final = jQuery.cssProps[name] || vendorProps[name];
- if (final) {
- return final;
- }
- if (name in emptyStyle) {
- return name;
- }
- return vendorProps[name] = vendorPropName(name) || name;
- }
- var rdisplayswap = /^(none|table(?!-c[ea]).+)/, cssShow = { position: "absolute", visibility: "hidden", display: "block" }, cssNormalTransform = {
- letterSpacing: "0",
- fontWeight: "400"
- };
- function setPositiveNumber(_elem, value, subtract) {
- var matches = rcssNum.exec(value);
- return matches ? (
- // Guard against undefined "subtract", e.g., when used as in cssHooks
- Math.max(0, matches[2] - (subtract || 0)) + (matches[3] || "px")
- ) : value;
- }
- function boxModelAdjustment(elem, dimension, box, isBorderBox, styles, computedVal) {
- var i = dimension === "width" ? 1 : 0, extra = 0, delta = 0, marginDelta = 0;
- if (box === (isBorderBox ? "border" : "content")) {
- return 0;
- }
- for (; i < 4; i += 2) {
- if (box === "margin") {
- marginDelta += jQuery.css(elem, box + cssExpand[i], true, styles);
- }
- if (!isBorderBox) {
- delta += jQuery.css(elem, "padding" + cssExpand[i], true, styles);
- if (box !== "padding") {
- delta += jQuery.css(elem, "border" + cssExpand[i] + "Width", true, styles);
- } else {
- extra += jQuery.css(elem, "border" + cssExpand[i] + "Width", true, styles);
- }
- } else {
- if (box === "content") {
- delta -= jQuery.css(elem, "padding" + cssExpand[i], true, styles);
- }
- if (box !== "margin") {
- delta -= jQuery.css(elem, "border" + cssExpand[i] + "Width", true, styles);
- }
- }
- }
- if (!isBorderBox && computedVal >= 0) {
- delta += Math.max(0, Math.ceil(
- elem["offset" + dimension[0].toUpperCase() + dimension.slice(1)] - computedVal - delta - extra - 0.5
- // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter
- // Use an explicit zero to avoid NaN (gh-3964)
- )) || 0;
- }
- return delta + marginDelta;
- }
- function getWidthOrHeight(elem, dimension, extra) {
- 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);
- if (rnumnonpx.test(val)) {
- if (!extra) {
- return val;
- }
- val = "auto";
- }
- if ((!support.boxSizingReliable() && isBorderBox || // Support: IE 10 - 11+, Edge 15 - 18+
- // IE/Edge misreport `getComputedStyle` of table rows with width/height
- // set in CSS while `offset*` properties report correct values.
- // Interestingly, in some cases IE 9 doesn't suffer from this issue.
- !support.reliableTrDimensions() && nodeName(elem, "tr") || // Fall back to offsetWidth/offsetHeight when value is "auto"
- // This happens for inline elements with no explicit setting (gh-3571)
- val === "auto" || // Support: Android <=4.1 - 4.3 only
- // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602)
- !parseFloat(val) && jQuery.css(elem, "display", false, styles) === "inline") && // Make sure the element is visible & connected
- elem.getClientRects().length) {
- isBorderBox = jQuery.css(elem, "boxSizing", false, styles) === "border-box";
- valueIsBorderBox = offsetProp in elem;
- if (valueIsBorderBox) {
- val = elem[offsetProp];
- }
- }
- val = parseFloat(val) || 0;
- return val + boxModelAdjustment(
- elem,
- dimension,
- extra || (isBorderBox ? "border" : "content"),
- valueIsBorderBox,
- styles,
- // Provide the current computed size to request scroll gutter calculation (gh-3589)
- val
- ) + "px";
- }
- jQuery.extend({
- // Add in style property hooks for overriding the default
- // behavior of getting and setting a style property
- cssHooks: {
- opacity: {
- get: function(elem, computed) {
- if (computed) {
- var ret = curCSS(elem, "opacity");
- return ret === "" ? "1" : ret;
- }
- }
- }
- },
- // Don't automatically add "px" to these possibly-unitless properties
- cssNumber: {
- animationIterationCount: true,
- aspectRatio: true,
- borderImageSlice: true,
- columnCount: true,
- flexGrow: true,
- flexShrink: true,
- fontWeight: true,
- gridArea: true,
- gridColumn: true,
- gridColumnEnd: true,
- gridColumnStart: true,
- gridRow: true,
- gridRowEnd: true,
- gridRowStart: true,
- lineHeight: true,
- opacity: true,
- order: true,
- orphans: true,
- scale: true,
- widows: true,
- zIndex: true,
- zoom: true,
- // SVG-related
- fillOpacity: true,
- floodOpacity: true,
- stopOpacity: true,
- strokeMiterlimit: true,
- strokeOpacity: true
- },
- // Add in properties whose names you wish to fix before
- // setting or getting the value
- cssProps: {},
- // Get and set the style property on a DOM Node
- style: function(elem, name, value, extra) {
- if (!elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style) {
- return;
- }
- var ret, type, hooks, origName = camelCase(name), isCustomProp = rcustomProp.test(name), style = elem.style;
- if (!isCustomProp) {
- name = finalPropName(origName);
- }
- hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName];
- if (value !== void 0) {
- type = typeof value;
- if (type === "string" && (ret = rcssNum.exec(value)) && ret[1]) {
- value = adjustCSS(elem, name, ret);
- type = "number";
- }
- if (value == null || value !== value) {
- return;
- }
- if (type === "number" && !isCustomProp) {
- value += ret && ret[3] || (jQuery.cssNumber[origName] ? "" : "px");
- }
- if (!support.clearCloneStyle && value === "" && name.indexOf("background") === 0) {
- style[name] = "inherit";
- }
- if (!hooks || !("set" in hooks) || (value = hooks.set(elem, value, extra)) !== void 0) {
- if (isCustomProp) {
- style.setProperty(name, value);
- } else {
- style[name] = value;
- }
- }
- } else {
- if (hooks && "get" in hooks && (ret = hooks.get(elem, false, extra)) !== void 0) {
- return ret;
- }
- return style[name];
- }
- },
- css: function(elem, name, extra, styles) {
- var val, num, hooks, origName = camelCase(name), isCustomProp = rcustomProp.test(name);
- if (!isCustomProp) {
- name = finalPropName(origName);
- }
- hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName];
- if (hooks && "get" in hooks) {
- val = hooks.get(elem, true, extra);
- }
- if (val === void 0) {
- val = curCSS(elem, name, styles);
- }
- if (val === "normal" && name in cssNormalTransform) {
- val = cssNormalTransform[name];
- }
- if (extra === "" || extra) {
- num = parseFloat(val);
- return extra === true || isFinite(num) ? num || 0 : val;
- }
- return val;
- }
- });
- jQuery.each(["height", "width"], function(_i, dimension) {
- jQuery.cssHooks[dimension] = {
- get: function(elem, computed, extra) {
- if (computed) {
- return rdisplayswap.test(jQuery.css(elem, "display")) && // Support: Safari 8+
- // Table columns in Safari have non-zero offsetWidth & zero
- // getBoundingClientRect().width unless display is changed.
- // Support: IE <=11 only
- // Running getBoundingClientRect on a disconnected node
- // in IE throws an error.
- (!elem.getClientRects().length || !elem.getBoundingClientRect().width) ? swap(elem, cssShow, function() {
- return getWidthOrHeight(elem, dimension, extra);
- }) : getWidthOrHeight(elem, dimension, extra);
- }
- },
- set: function(elem, value, extra) {
- var matches, styles = getStyles(elem), scrollboxSizeBuggy = !support.scrollboxSize() && styles.position === "absolute", boxSizingNeeded = scrollboxSizeBuggy || extra, isBorderBox = boxSizingNeeded && jQuery.css(elem, "boxSizing", false, styles) === "border-box", subtract = extra ? boxModelAdjustment(
- elem,
- dimension,
- extra,
- isBorderBox,
- styles
- ) : 0;
- if (isBorderBox && scrollboxSizeBuggy) {
- subtract -= Math.ceil(
- elem["offset" + dimension[0].toUpperCase() + dimension.slice(1)] - parseFloat(styles[dimension]) - boxModelAdjustment(elem, dimension, "border", false, styles) - 0.5
- );
- }
- if (subtract && (matches = rcssNum.exec(value)) && (matches[3] || "px") !== "px") {
- elem.style[dimension] = value;
- value = jQuery.css(elem, dimension);
- }
- return setPositiveNumber(elem, value, subtract);
- }
- };
- });
- jQuery.cssHooks.marginLeft = addGetHookIf(
- support.reliableMarginLeft,
- function(elem, computed) {
- if (computed) {
- return (parseFloat(curCSS(elem, "marginLeft")) || elem.getBoundingClientRect().left - swap(elem, { marginLeft: 0 }, function() {
- return elem.getBoundingClientRect().left;
- })) + "px";
- }
- }
- );
- jQuery.each({
- margin: "",
- padding: "",
- border: "Width"
- }, function(prefix, suffix) {
- jQuery.cssHooks[prefix + suffix] = {
- expand: function(value) {
- var i = 0, expanded = {}, parts = typeof value === "string" ? value.split(" ") : [value];
- for (; i < 4; i++) {
- expanded[prefix + cssExpand[i] + suffix] = parts[i] || parts[i - 2] || parts[0];
- }
- return expanded;
- }
- };
- if (prefix !== "margin") {
- jQuery.cssHooks[prefix + suffix].set = setPositiveNumber;
- }
- });
- jQuery.fn.extend({
- css: function(name, value) {
- return access(this, function(elem, name2, value2) {
- var styles, len, map = {}, i = 0;
- if (Array.isArray(name2)) {
- styles = getStyles(elem);
- len = name2.length;
- for (; i < len; i++) {
- map[name2[i]] = jQuery.css(elem, name2[i], false, styles);
- }
- return map;
- }
- return value2 !== void 0 ? jQuery.style(elem, name2, value2) : jQuery.css(elem, name2);
- }, name, value, arguments.length > 1);
- }
- });
- function Tween(elem, options, prop, end, easing) {
- return new Tween.prototype.init(elem, options, prop, end, easing);
- }
- jQuery.Tween = Tween;
- Tween.prototype = {
- constructor: Tween,
- init: function(elem, options, prop, end, easing, unit) {
- this.elem = elem;
- this.prop = prop;
- this.easing = easing || jQuery.easing._default;
- this.options = options;
- this.start = this.now = this.cur();
- this.end = end;
- this.unit = unit || (jQuery.cssNumber[prop] ? "" : "px");
- },
- cur: function() {
- var hooks = Tween.propHooks[this.prop];
- return hooks && hooks.get ? hooks.get(this) : Tween.propHooks._default.get(this);
- },
- run: function(percent) {
- var eased, hooks = Tween.propHooks[this.prop];
- if (this.options.duration) {
- this.pos = eased = jQuery.easing[this.easing](
- percent,
- this.options.duration * percent,
- 0,
- 1,
- this.options.duration
- );
- } else {
- this.pos = eased = percent;
- }
- this.now = (this.end - this.start) * eased + this.start;
- if (this.options.step) {
- this.options.step.call(this.elem, this.now, this);
- }
- if (hooks && hooks.set) {
- hooks.set(this);
- } else {
- Tween.propHooks._default.set(this);
- }
- return this;
- }
- };
- Tween.prototype.init.prototype = Tween.prototype;
- Tween.propHooks = {
- _default: {
- get: function(tween) {
- var result;
- if (tween.elem.nodeType !== 1 || tween.elem[tween.prop] != null && tween.elem.style[tween.prop] == null) {
- return tween.elem[tween.prop];
- }
- result = jQuery.css(tween.elem, tween.prop, "");
- return !result || result === "auto" ? 0 : result;
- },
- set: function(tween) {
- if (jQuery.fx.step[tween.prop]) {
- jQuery.fx.step[tween.prop](tween);
- } else if (tween.elem.nodeType === 1 && (jQuery.cssHooks[tween.prop] || tween.elem.style[finalPropName(tween.prop)] != null)) {
- jQuery.style(tween.elem, tween.prop, tween.now + tween.unit);
- } else {
- tween.elem[tween.prop] = tween.now;
- }
- }
- }
- };
- Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
- set: function(tween) {
- if (tween.elem.nodeType && tween.elem.parentNode) {
- tween.elem[tween.prop] = tween.now;
- }
- }
- };
- jQuery.easing = {
- linear: function(p) {
- return p;
- },
- swing: function(p) {
- return 0.5 - Math.cos(p * Math.PI) / 2;
- },
- _default: "swing"
- };
- jQuery.fx = Tween.prototype.init;
- jQuery.fx.step = {};
- var fxNow, inProgress, rfxtypes = /^(?:toggle|show|hide)$/, rrun = /queueHooks$/;
- function schedule() {
- if (inProgress) {
- if (document2.hidden === false && window2.requestAnimationFrame) {
- window2.requestAnimationFrame(schedule);
- } else {
- window2.setTimeout(schedule, jQuery.fx.interval);
- }
- jQuery.fx.tick();
- }
- }
- function createFxNow() {
- window2.setTimeout(function() {
- fxNow = void 0;
- });
- return fxNow = Date.now();
- }
- function genFx(type, includeWidth) {
- var which, i = 0, attrs = { height: type };
- includeWidth = includeWidth ? 1 : 0;
- for (; i < 4; i += 2 - includeWidth) {
- which = cssExpand[i];
- attrs["margin" + which] = attrs["padding" + which] = type;
- }
- if (includeWidth) {
- attrs.opacity = attrs.width = type;
- }
- return attrs;
- }
- function createTween(value, prop, animation) {
- var tween, collection = (Animation.tweeners[prop] || []).concat(Animation.tweeners["*"]), index = 0, length = collection.length;
- for (; index < length; index++) {
- if (tween = collection[index].call(animation, prop, value)) {
- return tween;
- }
- }
- }
- function defaultPrefilter(elem, props, opts) {
- var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, isBox = "width" in props || "height" in props, anim = this, orig = {}, style = elem.style, hidden = elem.nodeType && isHiddenWithinTree(elem), dataShow = dataPriv.get(elem, "fxshow");
- if (!opts.queue) {
- hooks = jQuery._queueHooks(elem, "fx");
- if (hooks.unqueued == null) {
- hooks.unqueued = 0;
- oldfire = hooks.empty.fire;
- hooks.empty.fire = function() {
- if (!hooks.unqueued) {
- oldfire();
- }
- };
- }
- hooks.unqueued++;
- anim.always(function() {
- anim.always(function() {
- hooks.unqueued--;
- if (!jQuery.queue(elem, "fx").length) {
- hooks.empty.fire();
- }
- });
- });
- }
- for (prop in props) {
- value = props[prop];
- if (rfxtypes.test(value)) {
- delete props[prop];
- toggle = toggle || value === "toggle";
- if (value === (hidden ? "hide" : "show")) {
- if (value === "show" && dataShow && dataShow[prop] !== void 0) {
- hidden = true;
- } else {
- continue;
- }
- }
- orig[prop] = dataShow && dataShow[prop] || jQuery.style(elem, prop);
- }
- }
- propTween = !jQuery.isEmptyObject(props);
- if (!propTween && jQuery.isEmptyObject(orig)) {
- return;
- }
- if (isBox && elem.nodeType === 1) {
- opts.overflow = [style.overflow, style.overflowX, style.overflowY];
- restoreDisplay = dataShow && dataShow.display;
- if (restoreDisplay == null) {
- restoreDisplay = dataPriv.get(elem, "display");
- }
- display = jQuery.css(elem, "display");
- if (display === "none") {
- if (restoreDisplay) {
- display = restoreDisplay;
- } else {
- showHide([elem], true);
- restoreDisplay = elem.style.display || restoreDisplay;
- display = jQuery.css(elem, "display");
- showHide([elem]);
- }
- }
- if (display === "inline" || display === "inline-block" && restoreDisplay != null) {
- if (jQuery.css(elem, "float") === "none") {
- if (!propTween) {
- anim.done(function() {
- style.display = restoreDisplay;
- });
- if (restoreDisplay == null) {
- display = style.display;
- restoreDisplay = display === "none" ? "" : display;
- }
- }
- style.display = "inline-block";
- }
- }
- }
- if (opts.overflow) {
- style.overflow = "hidden";
- anim.always(function() {
- style.overflow = opts.overflow[0];
- style.overflowX = opts.overflow[1];
- style.overflowY = opts.overflow[2];
- });
- }
- propTween = false;
- for (prop in orig) {
- if (!propTween) {
- if (dataShow) {
- if ("hidden" in dataShow) {
- hidden = dataShow.hidden;
- }
- } else {
- dataShow = dataPriv.access(elem, "fxshow", { display: restoreDisplay });
- }
- if (toggle) {
- dataShow.hidden = !hidden;
- }
- if (hidden) {
- showHide([elem], true);
- }
- anim.done(function() {
- if (!hidden) {
- showHide([elem]);
- }
- dataPriv.remove(elem, "fxshow");
- for (prop in orig) {
- jQuery.style(elem, prop, orig[prop]);
- }
- });
- }
- propTween = createTween(hidden ? dataShow[prop] : 0, prop, anim);
- if (!(prop in dataShow)) {
- dataShow[prop] = propTween.start;
- if (hidden) {
- propTween.end = propTween.start;
- propTween.start = 0;
- }
- }
- }
- }
- function propFilter(props, specialEasing) {
- var index, name, easing, value, hooks;
- for (index in props) {
- name = camelCase(index);
- easing = specialEasing[name];
- value = props[index];
- if (Array.isArray(value)) {
- easing = value[1];
- value = props[index] = value[0];
- }
- if (index !== name) {
- props[name] = value;
- delete props[index];
- }
- hooks = jQuery.cssHooks[name];
- if (hooks && "expand" in hooks) {
- value = hooks.expand(value);
- delete props[name];
- for (index in value) {
- if (!(index in props)) {
- props[index] = value[index];
- specialEasing[index] = easing;
- }
- }
- } else {
- specialEasing[name] = easing;
- }
- }
- }
- function Animation(elem, properties, options) {
- var result, stopped, index = 0, length = Animation.prefilters.length, deferred = jQuery.Deferred().always(function() {
- delete tick.elem;
- }), tick = function() {
- if (stopped) {
- return false;
- }
- 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;
- for (; index2 < length2; index2++) {
- animation.tweens[index2].run(percent);
- }
- deferred.notifyWith(elem, [animation, percent, remaining]);
- if (percent < 1 && length2) {
- return remaining;
- }
- if (!length2) {
- deferred.notifyWith(elem, [animation, 1, 0]);
- }
- deferred.resolveWith(elem, [animation]);
- return false;
- }, animation = deferred.promise({
- elem,
- props: jQuery.extend({}, properties),
- opts: jQuery.extend(true, {
- specialEasing: {},
- easing: jQuery.easing._default
- }, options),
- originalProperties: properties,
- originalOptions: options,
- startTime: fxNow || createFxNow(),
- duration: options.duration,
- tweens: [],
- createTween: function(prop, end) {
- var tween = jQuery.Tween(
- elem,
- animation.opts,
- prop,
- end,
- animation.opts.specialEasing[prop] || animation.opts.easing
- );
- animation.tweens.push(tween);
- return tween;
- },
- stop: function(gotoEnd) {
- var index2 = 0, length2 = gotoEnd ? animation.tweens.length : 0;
- if (stopped) {
- return this;
- }
- stopped = true;
- for (; index2 < length2; index2++) {
- animation.tweens[index2].run(1);
- }
- if (gotoEnd) {
- deferred.notifyWith(elem, [animation, 1, 0]);
- deferred.resolveWith(elem, [animation, gotoEnd]);
- } else {
- deferred.rejectWith(elem, [animation, gotoEnd]);
- }
- return this;
- }
- }), props = animation.props;
- propFilter(props, animation.opts.specialEasing);
- for (; index < length; index++) {
- result = Animation.prefilters[index].call(animation, elem, props, animation.opts);
- if (result) {
- if (isFunction(result.stop)) {
- jQuery._queueHooks(animation.elem, animation.opts.queue).stop = result.stop.bind(result);
- }
- return result;
- }
- }
- jQuery.map(props, createTween, animation);
- if (isFunction(animation.opts.start)) {
- animation.opts.start.call(elem, animation);
- }
- animation.progress(animation.opts.progress).done(animation.opts.done, animation.opts.complete).fail(animation.opts.fail).always(animation.opts.always);
- jQuery.fx.timer(
- jQuery.extend(tick, {
- elem,
- anim: animation,
- queue: animation.opts.queue
- })
- );
- return animation;
- }
- jQuery.Animation = jQuery.extend(Animation, {
- tweeners: {
- "*": [function(prop, value) {
- var tween = this.createTween(prop, value);
- adjustCSS(tween.elem, prop, rcssNum.exec(value), tween);
- return tween;
- }]
- },
- tweener: function(props, callback) {
- if (isFunction(props)) {
- callback = props;
- props = ["*"];
- } else {
- props = props.match(rnothtmlwhite);
- }
- var prop, index = 0, length = props.length;
- for (; index < length; index++) {
- prop = props[index];
- Animation.tweeners[prop] = Animation.tweeners[prop] || [];
- Animation.tweeners[prop].unshift(callback);
- }
- },
- prefilters: [defaultPrefilter],
- prefilter: function(callback, prepend) {
- if (prepend) {
- Animation.prefilters.unshift(callback);
- } else {
- Animation.prefilters.push(callback);
- }
- }
- });
- jQuery.speed = function(speed, easing, fn) {
- var opt = speed && typeof speed === "object" ? jQuery.extend({}, speed) : {
- complete: fn || !fn && easing || isFunction(speed) && speed,
- duration: speed,
- easing: fn && easing || easing && !isFunction(easing) && easing
- };
- if (jQuery.fx.off) {
- opt.duration = 0;
- } else {
- if (typeof opt.duration !== "number") {
- if (opt.duration in jQuery.fx.speeds) {
- opt.duration = jQuery.fx.speeds[opt.duration];
- } else {
- opt.duration = jQuery.fx.speeds._default;
- }
- }
- }
- if (opt.queue == null || opt.queue === true) {
- opt.queue = "fx";
- }
- opt.old = opt.complete;
- opt.complete = function() {
- if (isFunction(opt.old)) {
- opt.old.call(this);
- }
- if (opt.queue) {
- jQuery.dequeue(this, opt.queue);
- }
- };
- return opt;
- };
- jQuery.fn.extend({
- fadeTo: function(speed, to, easing, callback) {
- return this.filter(isHiddenWithinTree).css("opacity", 0).show().end().animate({ opacity: to }, speed, easing, callback);
- },
- animate: function(prop, speed, easing, callback) {
- var empty = jQuery.isEmptyObject(prop), optall = jQuery.speed(speed, easing, callback), doAnimation = function() {
- var anim = Animation(this, jQuery.extend({}, prop), optall);
- if (empty || dataPriv.get(this, "finish")) {
- anim.stop(true);
- }
- };
- doAnimation.finish = doAnimation;
- return empty || optall.queue === false ? this.each(doAnimation) : this.queue(optall.queue, doAnimation);
- },
- stop: function(type, clearQueue, gotoEnd) {
- var stopQueue = function(hooks) {
- var stop = hooks.stop;
- delete hooks.stop;
- stop(gotoEnd);
- };
- if (typeof type !== "string") {
- gotoEnd = clearQueue;
- clearQueue = type;
- type = void 0;
- }
- if (clearQueue) {
- this.queue(type || "fx", []);
- }
- return this.each(function() {
- var dequeue = true, index = type != null && type + "queueHooks", timers = jQuery.timers, data = dataPriv.get(this);
- if (index) {
- if (data[index] && data[index].stop) {
- stopQueue(data[index]);
- }
- } else {
- for (index in data) {
- if (data[index] && data[index].stop && rrun.test(index)) {
- stopQueue(data[index]);
- }
- }
- }
- for (index = timers.length; index--; ) {
- if (timers[index].elem === this && (type == null || timers[index].queue === type)) {
- timers[index].anim.stop(gotoEnd);
- dequeue = false;
- timers.splice(index, 1);
- }
- }
- if (dequeue || !gotoEnd) {
- jQuery.dequeue(this, type);
- }
- });
- },
- finish: function(type) {
- if (type !== false) {
- type = type || "fx";
- }
- return this.each(function() {
- var index, data = dataPriv.get(this), queue = data[type + "queue"], hooks = data[type + "queueHooks"], timers = jQuery.timers, length = queue ? queue.length : 0;
- data.finish = true;
- jQuery.queue(this, type, []);
- if (hooks && hooks.stop) {
- hooks.stop.call(this, true);
- }
- for (index = timers.length; index--; ) {
- if (timers[index].elem === this && timers[index].queue === type) {
- timers[index].anim.stop(true);
- timers.splice(index, 1);
- }
- }
- for (index = 0; index < length; index++) {
- if (queue[index] && queue[index].finish) {
- queue[index].finish.call(this);
- }
- }
- delete data.finish;
- });
- }
- });
- jQuery.each(["toggle", "show", "hide"], function(_i, name) {
- var cssFn = jQuery.fn[name];
- jQuery.fn[name] = function(speed, easing, callback) {
- return speed == null || typeof speed === "boolean" ? cssFn.apply(this, arguments) : this.animate(genFx(name, true), speed, easing, callback);
- };
- });
- jQuery.each({
- slideDown: genFx("show"),
- slideUp: genFx("hide"),
- slideToggle: genFx("toggle"),
- fadeIn: { opacity: "show" },
- fadeOut: { opacity: "hide" },
- fadeToggle: { opacity: "toggle" }
- }, function(name, props) {
- jQuery.fn[name] = function(speed, easing, callback) {
- return this.animate(props, speed, easing, callback);
- };
- });
- jQuery.timers = [];
- jQuery.fx.tick = function() {
- var timer, i = 0, timers = jQuery.timers;
- fxNow = Date.now();
- for (; i < timers.length; i++) {
- timer = timers[i];
- if (!timer() && timers[i] === timer) {
- timers.splice(i--, 1);
- }
- }
- if (!timers.length) {
- jQuery.fx.stop();
- }
- fxNow = void 0;
- };
- jQuery.fx.timer = function(timer) {
- jQuery.timers.push(timer);
- jQuery.fx.start();
- };
- jQuery.fx.interval = 13;
- jQuery.fx.start = function() {
- if (inProgress) {
- return;
- }
- inProgress = true;
- schedule();
- };
- jQuery.fx.stop = function() {
- inProgress = null;
- };
- jQuery.fx.speeds = {
- slow: 600,
- fast: 200,
- // Default speed
- _default: 400
- };
- jQuery.fn.delay = function(time, type) {
- time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
- type = type || "fx";
- return this.queue(type, function(next, hooks) {
- var timeout = window2.setTimeout(next, time);
- hooks.stop = function() {
- window2.clearTimeout(timeout);
- };
- });
- };
- (function() {
- var input = document2.createElement("input"), select = document2.createElement("select"), opt = select.appendChild(document2.createElement("option"));
- input.type = "checkbox";
- support.checkOn = input.value !== "";
- support.optSelected = opt.selected;
- input = document2.createElement("input");
- input.value = "t";
- input.type = "radio";
- support.radioValue = input.value === "t";
- })();
- var boolHook, attrHandle = jQuery.expr.attrHandle;
- jQuery.fn.extend({
- attr: function(name, value) {
- return access(this, jQuery.attr, name, value, arguments.length > 1);
- },
- removeAttr: function(name) {
- return this.each(function() {
- jQuery.removeAttr(this, name);
- });
- }
- });
- jQuery.extend({
- attr: function(elem, name, value) {
- var ret, hooks, nType = elem.nodeType;
- if (nType === 3 || nType === 8 || nType === 2) {
- return;
- }
- if (typeof elem.getAttribute === "undefined") {
- return jQuery.prop(elem, name, value);
- }
- if (nType !== 1 || !jQuery.isXMLDoc(elem)) {
- hooks = jQuery.attrHooks[name.toLowerCase()] || (jQuery.expr.match.bool.test(name) ? boolHook : void 0);
- }
- if (value !== void 0) {
- if (value === null) {
- jQuery.removeAttr(elem, name);
- return;
- }
- if (hooks && "set" in hooks && (ret = hooks.set(elem, value, name)) !== void 0) {
- return ret;
- }
- elem.setAttribute(name, value + "");
- return value;
- }
- if (hooks && "get" in hooks && (ret = hooks.get(elem, name)) !== null) {
- return ret;
- }
- ret = jQuery.find.attr(elem, name);
- return ret == null ? void 0 : ret;
- },
- attrHooks: {
- type: {
- set: function(elem, value) {
- if (!support.radioValue && value === "radio" && nodeName(elem, "input")) {
- var val = elem.value;
- elem.setAttribute("type", value);
- if (val) {
- elem.value = val;
- }
- return value;
- }
- }
- }
- },
- removeAttr: function(elem, value) {
- var name, i = 0, attrNames = value && value.match(rnothtmlwhite);
- if (attrNames && elem.nodeType === 1) {
- while (name = attrNames[i++]) {
- elem.removeAttribute(name);
- }
- }
- }
- });
- boolHook = {
- set: function(elem, value, name) {
- if (value === false) {
- jQuery.removeAttr(elem, name);
- } else {
- elem.setAttribute(name, name);
- }
- return name;
- }
- };
- jQuery.each(jQuery.expr.match.bool.source.match(/\w+/g), function(_i, name) {
- var getter = attrHandle[name] || jQuery.find.attr;
- attrHandle[name] = function(elem, name2, isXML) {
- var ret, handle, lowercaseName = name2.toLowerCase();
- if (!isXML) {
- handle = attrHandle[lowercaseName];
- attrHandle[lowercaseName] = ret;
- ret = getter(elem, name2, isXML) != null ? lowercaseName : null;
- attrHandle[lowercaseName] = handle;
- }
- return ret;
- };
- });
- var rfocusable = /^(?:input|select|textarea|button)$/i, rclickable = /^(?:a|area)$/i;
- jQuery.fn.extend({
- prop: function(name, value) {
- return access(this, jQuery.prop, name, value, arguments.length > 1);
- },
- removeProp: function(name) {
- return this.each(function() {
- delete this[jQuery.propFix[name] || name];
- });
- }
- });
- jQuery.extend({
- prop: function(elem, name, value) {
- var ret, hooks, nType = elem.nodeType;
- if (nType === 3 || nType === 8 || nType === 2) {
- return;
- }
- if (nType !== 1 || !jQuery.isXMLDoc(elem)) {
- name = jQuery.propFix[name] || name;
- hooks = jQuery.propHooks[name];
- }
- if (value !== void 0) {
- if (hooks && "set" in hooks && (ret = hooks.set(elem, value, name)) !== void 0) {
- return ret;
- }
- return elem[name] = value;
- }
- if (hooks && "get" in hooks && (ret = hooks.get(elem, name)) !== null) {
- return ret;
- }
- return elem[name];
- },
- propHooks: {
- tabIndex: {
- get: function(elem) {
- var tabindex = jQuery.find.attr(elem, "tabindex");
- if (tabindex) {
- return parseInt(tabindex, 10);
- }
- if (rfocusable.test(elem.nodeName) || rclickable.test(elem.nodeName) && elem.href) {
- return 0;
- }
- return -1;
- }
- }
- },
- propFix: {
- "for": "htmlFor",
- "class": "className"
- }
- });
- if (!support.optSelected) {
- jQuery.propHooks.selected = {
- get: function(elem) {
- var parent = elem.parentNode;
- if (parent && parent.parentNode) {
- parent.parentNode.selectedIndex;
- }
- return null;
- },
- set: function(elem) {
- var parent = elem.parentNode;
- if (parent) {
- parent.selectedIndex;
- if (parent.parentNode) {
- parent.parentNode.selectedIndex;
- }
- }
- }
- };
- }
- jQuery.each([
- "tabIndex",
- "readOnly",
- "maxLength",
- "cellSpacing",
- "cellPadding",
- "rowSpan",
- "colSpan",
- "useMap",
- "frameBorder",
- "contentEditable"
- ], function() {
- jQuery.propFix[this.toLowerCase()] = this;
- });
- function stripAndCollapse(value) {
- var tokens = value.match(rnothtmlwhite) || [];
- return tokens.join(" ");
- }
- function getClass(elem) {
- return elem.getAttribute && elem.getAttribute("class") || "";
- }
- function classesToArray(value) {
- if (Array.isArray(value)) {
- return value;
- }
- if (typeof value === "string") {
- return value.match(rnothtmlwhite) || [];
- }
- return [];
- }
- jQuery.fn.extend({
- addClass: function(value) {
- var classNames, cur, curValue, className, i, finalValue;
- if (isFunction(value)) {
- return this.each(function(j) {
- jQuery(this).addClass(value.call(this, j, getClass(this)));
- });
- }
- classNames = classesToArray(value);
- if (classNames.length) {
- return this.each(function() {
- curValue = getClass(this);
- cur = this.nodeType === 1 && " " + stripAndCollapse(curValue) + " ";
- if (cur) {
- for (i = 0; i < classNames.length; i++) {
- className = classNames[i];
- if (cur.indexOf(" " + className + " ") < 0) {
- cur += className + " ";
- }
- }
- finalValue = stripAndCollapse(cur);
- if (curValue !== finalValue) {
- this.setAttribute("class", finalValue);
- }
- }
- });
- }
- return this;
- },
- removeClass: function(value) {
- var classNames, cur, curValue, className, i, finalValue;
- if (isFunction(value)) {
- return this.each(function(j) {
- jQuery(this).removeClass(value.call(this, j, getClass(this)));
- });
- }
- if (!arguments.length) {
- return this.attr("class", "");
- }
- classNames = classesToArray(value);
- if (classNames.length) {
- return this.each(function() {
- curValue = getClass(this);
- cur = this.nodeType === 1 && " " + stripAndCollapse(curValue) + " ";
- if (cur) {
- for (i = 0; i < classNames.length; i++) {
- className = classNames[i];
- while (cur.indexOf(" " + className + " ") > -1) {
- cur = cur.replace(" " + className + " ", " ");
- }
- }
- finalValue = stripAndCollapse(cur);
- if (curValue !== finalValue) {
- this.setAttribute("class", finalValue);
- }
- }
- });
- }
- return this;
- },
- toggleClass: function(value, stateVal) {
- var classNames, className, i, self2, type = typeof value, isValidValue = type === "string" || Array.isArray(value);
- if (isFunction(value)) {
- return this.each(function(i2) {
- jQuery(this).toggleClass(
- value.call(this, i2, getClass(this), stateVal),
- stateVal
- );
- });
- }
- if (typeof stateVal === "boolean" && isValidValue) {
- return stateVal ? this.addClass(value) : this.removeClass(value);
- }
- classNames = classesToArray(value);
- return this.each(function() {
- if (isValidValue) {
- self2 = jQuery(this);
- for (i = 0; i < classNames.length; i++) {
- className = classNames[i];
- if (self2.hasClass(className)) {
- self2.removeClass(className);
- } else {
- self2.addClass(className);
- }
- }
- } else if (value === void 0 || type === "boolean") {
- className = getClass(this);
- if (className) {
- dataPriv.set(this, "__className__", className);
- }
- if (this.setAttribute) {
- this.setAttribute(
- "class",
- className || value === false ? "" : dataPriv.get(this, "__className__") || ""
- );
- }
- }
- });
- },
- hasClass: function(selector) {
- var className, elem, i = 0;
- className = " " + selector + " ";
- while (elem = this[i++]) {
- if (elem.nodeType === 1 && (" " + stripAndCollapse(getClass(elem)) + " ").indexOf(className) > -1) {
- return true;
- }
- }
- return false;
- }
- });
- var rreturn = /\r/g;
- jQuery.fn.extend({
- val: function(value) {
- var hooks, ret, valueIsFunction, elem = this[0];
- if (!arguments.length) {
- if (elem) {
- hooks = jQuery.valHooks[elem.type] || jQuery.valHooks[elem.nodeName.toLowerCase()];
- if (hooks && "get" in hooks && (ret = hooks.get(elem, "value")) !== void 0) {
- return ret;
- }
- ret = elem.value;
- if (typeof ret === "string") {
- return ret.replace(rreturn, "");
- }
- return ret == null ? "" : ret;
- }
- return;
- }
- valueIsFunction = isFunction(value);
- return this.each(function(i) {
- var val;
- if (this.nodeType !== 1) {
- return;
- }
- if (valueIsFunction) {
- val = value.call(this, i, jQuery(this).val());
- } else {
- val = value;
- }
- if (val == null) {
- val = "";
- } else if (typeof val === "number") {
- val += "";
- } else if (Array.isArray(val)) {
- val = jQuery.map(val, function(value2) {
- return value2 == null ? "" : value2 + "";
- });
- }
- hooks = jQuery.valHooks[this.type] || jQuery.valHooks[this.nodeName.toLowerCase()];
- if (!hooks || !("set" in hooks) || hooks.set(this, val, "value") === void 0) {
- this.value = val;
- }
- });
- }
- });
- jQuery.extend({
- valHooks: {
- option: {
- get: function(elem) {
- var val = jQuery.find.attr(elem, "value");
- return val != null ? val : (
- // Support: IE <=10 - 11 only
- // option.text throws exceptions (trac-14686, trac-14858)
- // Strip and collapse whitespace
- // https://html.spec.whatwg.org/#strip-and-collapse-whitespace
- stripAndCollapse(jQuery.text(elem))
- );
- }
- },
- select: {
- get: function(elem) {
- var value, option, i, options = elem.options, index = elem.selectedIndex, one = elem.type === "select-one", values = one ? null : [], max = one ? index + 1 : options.length;
- if (index < 0) {
- i = max;
- } else {
- i = one ? index : 0;
- }
- for (; i < max; i++) {
- option = options[i];
- if ((option.selected || i === index) && // Don't return options that are disabled or in a disabled optgroup
- !option.disabled && (!option.parentNode.disabled || !nodeName(option.parentNode, "optgroup"))) {
- value = jQuery(option).val();
- if (one) {
- return value;
- }
- values.push(value);
- }
- }
- return values;
- },
- set: function(elem, value) {
- var optionSet, option, options = elem.options, values = jQuery.makeArray(value), i = options.length;
- while (i--) {
- option = options[i];
- if (option.selected = jQuery.inArray(jQuery.valHooks.option.get(option), values) > -1) {
- optionSet = true;
- }
- }
- if (!optionSet) {
- elem.selectedIndex = -1;
- }
- return values;
- }
- }
- }
- });
- jQuery.each(["radio", "checkbox"], function() {
- jQuery.valHooks[this] = {
- set: function(elem, value) {
- if (Array.isArray(value)) {
- return elem.checked = jQuery.inArray(jQuery(elem).val(), value) > -1;
- }
- }
- };
- if (!support.checkOn) {
- jQuery.valHooks[this].get = function(elem) {
- return elem.getAttribute("value") === null ? "on" : elem.value;
- };
- }
- });
- var location2 = window2.location;
- var nonce = { guid: Date.now() };
- var rquery = /\?/;
- jQuery.parseXML = function(data) {
- var xml, parserErrorElem;
- if (!data || typeof data !== "string") {
- return null;
- }
- try {
- xml = new window2.DOMParser().parseFromString(data, "text/xml");
- } catch (e) {
- }
- parserErrorElem = xml && xml.getElementsByTagName("parsererror")[0];
- if (!xml || parserErrorElem) {
- jQuery.error("Invalid XML: " + (parserErrorElem ? jQuery.map(parserErrorElem.childNodes, function(el) {
- return el.textContent;
- }).join("\n") : data));
- }
- return xml;
- };
- var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, stopPropagationCallback = function(e) {
- e.stopPropagation();
- };
- jQuery.extend(jQuery.event, {
- trigger: function(event, data, elem, onlyHandlers) {
- var i, cur, tmp, bubbleType, ontype, handle, special, lastElement, eventPath = [elem || document2], type = hasOwn.call(event, "type") ? event.type : event, namespaces = hasOwn.call(event, "namespace") ? event.namespace.split(".") : [];
- cur = lastElement = tmp = elem = elem || document2;
- if (elem.nodeType === 3 || elem.nodeType === 8) {
- return;
- }
- if (rfocusMorph.test(type + jQuery.event.triggered)) {
- return;
- }
- if (type.indexOf(".") > -1) {
- namespaces = type.split(".");
- type = namespaces.shift();
- namespaces.sort();
- }
- ontype = type.indexOf(":") < 0 && "on" + type;
- event = event[jQuery.expando] ? event : new jQuery.Event(type, typeof event === "object" && event);
- event.isTrigger = onlyHandlers ? 2 : 3;
- event.namespace = namespaces.join(".");
- event.rnamespace = event.namespace ? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)") : null;
- event.result = void 0;
- if (!event.target) {
- event.target = elem;
- }
- data = data == null ? [event] : jQuery.makeArray(data, [event]);
- special = jQuery.event.special[type] || {};
- if (!onlyHandlers && special.trigger && special.trigger.apply(elem, data) === false) {
- return;
- }
- if (!onlyHandlers && !special.noBubble && !isWindow(elem)) {
- bubbleType = special.delegateType || type;
- if (!rfocusMorph.test(bubbleType + type)) {
- cur = cur.parentNode;
- }
- for (; cur; cur = cur.parentNode) {
- eventPath.push(cur);
- tmp = cur;
- }
- if (tmp === (elem.ownerDocument || document2)) {
- eventPath.push(tmp.defaultView || tmp.parentWindow || window2);
- }
- }
- i = 0;
- while ((cur = eventPath[i++]) && !event.isPropagationStopped()) {
- lastElement = cur;
- event.type = i > 1 ? bubbleType : special.bindType || type;
- handle = (dataPriv.get(cur, "events") || /* @__PURE__ */ Object.create(null))[event.type] && dataPriv.get(cur, "handle");
- if (handle) {
- handle.apply(cur, data);
- }
- handle = ontype && cur[ontype];
- if (handle && handle.apply && acceptData(cur)) {
- event.result = handle.apply(cur, data);
- if (event.result === false) {
- event.preventDefault();
- }
- }
- }
- event.type = type;
- if (!onlyHandlers && !event.isDefaultPrevented()) {
- if ((!special._default || special._default.apply(eventPath.pop(), data) === false) && acceptData(elem)) {
- if (ontype && isFunction(elem[type]) && !isWindow(elem)) {
- tmp = elem[ontype];
- if (tmp) {
- elem[ontype] = null;
- }
- jQuery.event.triggered = type;
- if (event.isPropagationStopped()) {
- lastElement.addEventListener(type, stopPropagationCallback);
- }
- elem[type]();
- if (event.isPropagationStopped()) {
- lastElement.removeEventListener(type, stopPropagationCallback);
- }
- jQuery.event.triggered = void 0;
- if (tmp) {
- elem[ontype] = tmp;
- }
- }
- }
- }
- return event.result;
- },
- // Piggyback on a donor event to simulate a different one
- // Used only for `focus(in | out)` events
- simulate: function(type, elem, event) {
- var e = jQuery.extend(
- new jQuery.Event(),
- event,
- {
- type,
- isSimulated: true
- }
- );
- jQuery.event.trigger(e, null, elem);
- }
- });
- jQuery.fn.extend({
- trigger: function(type, data) {
- return this.each(function() {
- jQuery.event.trigger(type, data, this);
- });
- },
- triggerHandler: function(type, data) {
- var elem = this[0];
- if (elem) {
- return jQuery.event.trigger(type, data, elem, true);
- }
- }
- });
- var rbracket = /\[\]$/, rCRLF = /\r?\n/g, rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, rsubmittable = /^(?:input|select|textarea|keygen)/i;
- function buildParams(prefix, obj, traditional, add) {
- var name;
- if (Array.isArray(obj)) {
- jQuery.each(obj, function(i, v) {
- if (traditional || rbracket.test(prefix)) {
- add(prefix, v);
- } else {
- buildParams(
- prefix + "[" + (typeof v === "object" && v != null ? i : "") + "]",
- v,
- traditional,
- add
- );
- }
- });
- } else if (!traditional && toType(obj) === "object") {
- for (name in obj) {
- buildParams(prefix + "[" + name + "]", obj[name], traditional, add);
- }
- } else {
- add(prefix, obj);
- }
- }
- jQuery.param = function(a, traditional) {
- var prefix, s = [], add = function(key, valueOrFunction) {
- var value = isFunction(valueOrFunction) ? valueOrFunction() : valueOrFunction;
- s[s.length] = encodeURIComponent(key) + "=" + encodeURIComponent(value == null ? "" : value);
- };
- if (a == null) {
- return "";
- }
- if (Array.isArray(a) || a.jquery && !jQuery.isPlainObject(a)) {
- jQuery.each(a, function() {
- add(this.name, this.value);
- });
- } else {
- for (prefix in a) {
- buildParams(prefix, a[prefix], traditional, add);
- }
- }
- return s.join("&");
- };
- jQuery.fn.extend({
- serialize: function() {
- return jQuery.param(this.serializeArray());
- },
- serializeArray: function() {
- return this.map(function() {
- var elements = jQuery.prop(this, "elements");
- return elements ? jQuery.makeArray(elements) : this;
- }).filter(function() {
- var type = this.type;
- return this.name && !jQuery(this).is(":disabled") && rsubmittable.test(this.nodeName) && !rsubmitterTypes.test(type) && (this.checked || !rcheckableType.test(type));
- }).map(function(_i, elem) {
- var val = jQuery(this).val();
- if (val == null) {
- return null;
- }
- if (Array.isArray(val)) {
- return jQuery.map(val, function(val2) {
- return { name: elem.name, value: val2.replace(rCRLF, "\r\n") };
- });
- }
- return { name: elem.name, value: val.replace(rCRLF, "\r\n") };
- }).get();
- }
- });
- var r20 = /%20/g, rhash = /#.*$/, rantiCache = /([?&])_=[^&]*/, rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, rnoContent = /^(?:GET|HEAD)$/, rprotocol = /^\/\//, prefilters = {}, transports = {}, allTypes = "*/".concat("*"), originAnchor = document2.createElement("a");
- originAnchor.href = location2.href;
- function addToPrefiltersOrTransports(structure) {
- return function(dataTypeExpression, func) {
- if (typeof dataTypeExpression !== "string") {
- func = dataTypeExpression;
- dataTypeExpression = "*";
- }
- var dataType, i = 0, dataTypes = dataTypeExpression.toLowerCase().match(rnothtmlwhite) || [];
- if (isFunction(func)) {
- while (dataType = dataTypes[i++]) {
- if (dataType[0] === "+") {
- dataType = dataType.slice(1) || "*";
- (structure[dataType] = structure[dataType] || []).unshift(func);
- } else {
- (structure[dataType] = structure[dataType] || []).push(func);
- }
- }
- }
- };
- }
- function inspectPrefiltersOrTransports(structure, options, originalOptions, jqXHR) {
- var inspected = {}, seekingTransport = structure === transports;
- function inspect(dataType) {
- var selected;
- inspected[dataType] = true;
- jQuery.each(structure[dataType] || [], function(_, prefilterOrFactory) {
- var dataTypeOrTransport = prefilterOrFactory(options, originalOptions, jqXHR);
- if (typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[dataTypeOrTransport]) {
- options.dataTypes.unshift(dataTypeOrTransport);
- inspect(dataTypeOrTransport);
- return false;
- } else if (seekingTransport) {
- return !(selected = dataTypeOrTransport);
- }
- });
- return selected;
- }
- return inspect(options.dataTypes[0]) || !inspected["*"] && inspect("*");
- }
- function ajaxExtend(target, src) {
- var key, deep, flatOptions = jQuery.ajaxSettings.flatOptions || {};
- for (key in src) {
- if (src[key] !== void 0) {
- (flatOptions[key] ? target : deep || (deep = {}))[key] = src[key];
- }
- }
- if (deep) {
- jQuery.extend(true, target, deep);
- }
- return target;
- }
- function ajaxHandleResponses(s, jqXHR, responses) {
- var ct, type, finalDataType, firstDataType, contents = s.contents, dataTypes = s.dataTypes;
- while (dataTypes[0] === "*") {
- dataTypes.shift();
- if (ct === void 0) {
- ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
- }
- }
- if (ct) {
- for (type in contents) {
- if (contents[type] && contents[type].test(ct)) {
- dataTypes.unshift(type);
- break;
- }
- }
- }
- if (dataTypes[0] in responses) {
- finalDataType = dataTypes[0];
- } else {
- for (type in responses) {
- if (!dataTypes[0] || s.converters[type + " " + dataTypes[0]]) {
- finalDataType = type;
- break;
- }
- if (!firstDataType) {
- firstDataType = type;
- }
- }
- finalDataType = finalDataType || firstDataType;
- }
- if (finalDataType) {
- if (finalDataType !== dataTypes[0]) {
- dataTypes.unshift(finalDataType);
- }
- return responses[finalDataType];
- }
- }
- function ajaxConvert(s, response, jqXHR, isSuccess) {
- var conv2, current, conv, tmp, prev, converters = {}, dataTypes = s.dataTypes.slice();
- if (dataTypes[1]) {
- for (conv in s.converters) {
- converters[conv.toLowerCase()] = s.converters[conv];
- }
- }
- current = dataTypes.shift();
- while (current) {
- if (s.responseFields[current]) {
- jqXHR[s.responseFields[current]] = response;
- }
- if (!prev && isSuccess && s.dataFilter) {
- response = s.dataFilter(response, s.dataType);
- }
- prev = current;
- current = dataTypes.shift();
- if (current) {
- if (current === "*") {
- current = prev;
- } else if (prev !== "*" && prev !== current) {
- conv = converters[prev + " " + current] || converters["* " + current];
- if (!conv) {
- for (conv2 in converters) {
- tmp = conv2.split(" ");
- if (tmp[1] === current) {
- conv = converters[prev + " " + tmp[0]] || converters["* " + tmp[0]];
- if (conv) {
- if (conv === true) {
- conv = converters[conv2];
- } else if (converters[conv2] !== true) {
- current = tmp[0];
- dataTypes.unshift(tmp[1]);
- }
- break;
- }
- }
- }
- }
- if (conv !== true) {
- if (conv && s.throws) {
- response = conv(response);
- } else {
- try {
- response = conv(response);
- } catch (e) {
- return {
- state: "parsererror",
- error: conv ? e : "No conversion from " + prev + " to " + current
- };
- }
- }
- }
- }
- }
- }
- return { state: "success", data: response };
- }
- jQuery.extend({
- // Counter for holding the number of active queries
- active: 0,
- // Last-Modified header cache for next request
- lastModified: {},
- etag: {},
- ajaxSettings: {
- url: location2.href,
- type: "GET",
- isLocal: rlocalProtocol.test(location2.protocol),
- global: true,
- processData: true,
- async: true,
- contentType: "application/x-www-form-urlencoded; charset=UTF-8",
- /*
- timeout: 0,
- data: null,
- dataType: null,
- username: null,
- password: null,
- cache: null,
- throws: false,
- traditional: false,
- headers: {},
- */
- accepts: {
- "*": allTypes,
- text: "text/plain",
- html: "text/html",
- xml: "application/xml, text/xml",
- json: "application/json, text/javascript"
- },
- contents: {
- xml: /\bxml\b/,
- html: /\bhtml/,
- json: /\bjson\b/
- },
- responseFields: {
- xml: "responseXML",
- text: "responseText",
- json: "responseJSON"
- },
- // Data converters
- // Keys separate source (or catchall "*") and destination types with a single space
- converters: {
- // Convert anything to text
- "* text": String,
- // Text to html (true = no transformation)
- "text html": true,
- // Evaluate text as a json expression
- "text json": JSON.parse,
- // Parse text as xml
- "text xml": jQuery.parseXML
- },
- // For options that shouldn't be deep extended:
- // you can add your own custom options here if
- // and when you create one that shouldn't be
- // deep extended (see ajaxExtend)
- flatOptions: {
- url: true,
- context: true
- }
- },
- // Creates a full fledged settings object into target
- // with both ajaxSettings and settings fields.
- // If target is omitted, writes into ajaxSettings.
- ajaxSetup: function(target, settings) {
- return settings ? (
- // Building a settings object
- ajaxExtend(ajaxExtend(target, jQuery.ajaxSettings), settings)
- ) : (
- // Extending ajaxSettings
- ajaxExtend(jQuery.ajaxSettings, target)
- );
- },
- ajaxPrefilter: addToPrefiltersOrTransports(prefilters),
- ajaxTransport: addToPrefiltersOrTransports(transports),
- // Main method
- ajax: function(url, options) {
- if (typeof url === "object") {
- options = url;
- url = void 0;
- }
- options = options || {};
- 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 = {
- readyState: 0,
- // Builds headers hashtable if needed
- getResponseHeader: function(key) {
- var match;
- if (completed2) {
- if (!responseHeaders) {
- responseHeaders = {};
- while (match = rheaders.exec(responseHeadersString)) {
- responseHeaders[match[1].toLowerCase() + " "] = (responseHeaders[match[1].toLowerCase() + " "] || []).concat(match[2]);
- }
- }
- match = responseHeaders[key.toLowerCase() + " "];
- }
- return match == null ? null : match.join(", ");
- },
- // Raw string
- getAllResponseHeaders: function() {
- return completed2 ? responseHeadersString : null;
- },
- // Caches the header
- setRequestHeader: function(name, value) {
- if (completed2 == null) {
- name = requestHeadersNames[name.toLowerCase()] = requestHeadersNames[name.toLowerCase()] || name;
- requestHeaders[name] = value;
- }
- return this;
- },
- // Overrides response content-type header
- overrideMimeType: function(type) {
- if (completed2 == null) {
- s.mimeType = type;
- }
- return this;
- },
- // Status-dependent callbacks
- statusCode: function(map) {
- var code;
- if (map) {
- if (completed2) {
- jqXHR.always(map[jqXHR.status]);
- } else {
- for (code in map) {
- statusCode[code] = [statusCode[code], map[code]];
- }
- }
- }
- return this;
- },
- // Cancel the request
- abort: function(statusText) {
- var finalText = statusText || strAbort;
- if (transport) {
- transport.abort(finalText);
- }
- done(0, finalText);
- return this;
- }
- };
- deferred.promise(jqXHR);
- s.url = ((url || s.url || location2.href) + "").replace(rprotocol, location2.protocol + "//");
- s.type = options.method || options.type || s.method || s.type;
- s.dataTypes = (s.dataType || "*").toLowerCase().match(rnothtmlwhite) || [""];
- if (s.crossDomain == null) {
- urlAnchor = document2.createElement("a");
- try {
- urlAnchor.href = s.url;
- urlAnchor.href = urlAnchor.href;
- s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== urlAnchor.protocol + "//" + urlAnchor.host;
- } catch (e) {
- s.crossDomain = true;
- }
- }
- if (s.data && s.processData && typeof s.data !== "string") {
- s.data = jQuery.param(s.data, s.traditional);
- }
- inspectPrefiltersOrTransports(prefilters, s, options, jqXHR);
- if (completed2) {
- return jqXHR;
- }
- fireGlobals = jQuery.event && s.global;
- if (fireGlobals && jQuery.active++ === 0) {
- jQuery.event.trigger("ajaxStart");
- }
- s.type = s.type.toUpperCase();
- s.hasContent = !rnoContent.test(s.type);
- cacheURL = s.url.replace(rhash, "");
- if (!s.hasContent) {
- uncached = s.url.slice(cacheURL.length);
- if (s.data && (s.processData || typeof s.data === "string")) {
- cacheURL += (rquery.test(cacheURL) ? "&" : "?") + s.data;
- delete s.data;
- }
- if (s.cache === false) {
- cacheURL = cacheURL.replace(rantiCache, "$1");
- uncached = (rquery.test(cacheURL) ? "&" : "?") + "_=" + nonce.guid++ + uncached;
- }
- s.url = cacheURL + uncached;
- } else if (s.data && s.processData && (s.contentType || "").indexOf("application/x-www-form-urlencoded") === 0) {
- s.data = s.data.replace(r20, "+");
- }
- if (s.ifModified) {
- if (jQuery.lastModified[cacheURL]) {
- jqXHR.setRequestHeader("If-Modified-Since", jQuery.lastModified[cacheURL]);
- }
- if (jQuery.etag[cacheURL]) {
- jqXHR.setRequestHeader("If-None-Match", jQuery.etag[cacheURL]);
- }
- }
- if (s.data && s.hasContent && s.contentType !== false || options.contentType) {
- jqXHR.setRequestHeader("Content-Type", s.contentType);
- }
- jqXHR.setRequestHeader(
- "Accept",
- s.dataTypes[0] && s.accepts[s.dataTypes[0]] ? s.accepts[s.dataTypes[0]] + (s.dataTypes[0] !== "*" ? ", " + allTypes + "; q=0.01" : "") : s.accepts["*"]
- );
- for (i in s.headers) {
- jqXHR.setRequestHeader(i, s.headers[i]);
- }
- if (s.beforeSend && (s.beforeSend.call(callbackContext, jqXHR, s) === false || completed2)) {
- return jqXHR.abort();
- }
- strAbort = "abort";
- completeDeferred.add(s.complete);
- jqXHR.done(s.success);
- jqXHR.fail(s.error);
- transport = inspectPrefiltersOrTransports(transports, s, options, jqXHR);
- if (!transport) {
- done(-1, "No Transport");
- } else {
- jqXHR.readyState = 1;
- if (fireGlobals) {
- globalEventContext.trigger("ajaxSend", [jqXHR, s]);
- }
- if (completed2) {
- return jqXHR;
- }
- if (s.async && s.timeout > 0) {
- timeoutTimer = window2.setTimeout(function() {
- jqXHR.abort("timeout");
- }, s.timeout);
- }
- try {
- completed2 = false;
- transport.send(requestHeaders, done);
- } catch (e) {
- if (completed2) {
- throw e;
- }
- done(-1, e);
- }
- }
- function done(status, nativeStatusText, responses, headers) {
- var isSuccess, success, error, response, modified, statusText = nativeStatusText;
- if (completed2) {
- return;
- }
- completed2 = true;
- if (timeoutTimer) {
- window2.clearTimeout(timeoutTimer);
- }
- transport = void 0;
- responseHeadersString = headers || "";
- jqXHR.readyState = status > 0 ? 4 : 0;
- isSuccess = status >= 200 && status < 300 || status === 304;
- if (responses) {
- response = ajaxHandleResponses(s, jqXHR, responses);
- }
- if (!isSuccess && jQuery.inArray("script", s.dataTypes) > -1 && jQuery.inArray("json", s.dataTypes) < 0) {
- s.converters["text script"] = function() {
- };
- }
- response = ajaxConvert(s, response, jqXHR, isSuccess);
- if (isSuccess) {
- if (s.ifModified) {
- modified = jqXHR.getResponseHeader("Last-Modified");
- if (modified) {
- jQuery.lastModified[cacheURL] = modified;
- }
- modified = jqXHR.getResponseHeader("etag");
- if (modified) {
- jQuery.etag[cacheURL] = modified;
- }
- }
- if (status === 204 || s.type === "HEAD") {
- statusText = "nocontent";
- } else if (status === 304) {
- statusText = "notmodified";
- } else {
- statusText = response.state;
- success = response.data;
- error = response.error;
- isSuccess = !error;
- }
- } else {
- error = statusText;
- if (status || !statusText) {
- statusText = "error";
- if (status < 0) {
- status = 0;
- }
- }
- }
- jqXHR.status = status;
- jqXHR.statusText = (nativeStatusText || statusText) + "";
- if (isSuccess) {
- deferred.resolveWith(callbackContext, [success, statusText, jqXHR]);
- } else {
- deferred.rejectWith(callbackContext, [jqXHR, statusText, error]);
- }
- jqXHR.statusCode(statusCode);
- statusCode = void 0;
- if (fireGlobals) {
- globalEventContext.trigger(
- isSuccess ? "ajaxSuccess" : "ajaxError",
- [jqXHR, s, isSuccess ? success : error]
- );
- }
- completeDeferred.fireWith(callbackContext, [jqXHR, statusText]);
- if (fireGlobals) {
- globalEventContext.trigger("ajaxComplete", [jqXHR, s]);
- if (!--jQuery.active) {
- jQuery.event.trigger("ajaxStop");
- }
- }
- }
- return jqXHR;
- },
- getJSON: function(url, data, callback) {
- return jQuery.get(url, data, callback, "json");
- },
- getScript: function(url, callback) {
- return jQuery.get(url, void 0, callback, "script");
- }
- });
- jQuery.each(["get", "post"], function(_i, method) {
- jQuery[method] = function(url, data, callback, type) {
- if (isFunction(data)) {
- type = type || callback;
- callback = data;
- data = void 0;
- }
- return jQuery.ajax(jQuery.extend({
- url,
- type: method,
- dataType: type,
- data,
- success: callback
- }, jQuery.isPlainObject(url) && url));
- };
- });
- jQuery.ajaxPrefilter(function(s) {
- var i;
- for (i in s.headers) {
- if (i.toLowerCase() === "content-type") {
- s.contentType = s.headers[i] || "";
- }
- }
- });
- jQuery._evalUrl = function(url, options, doc) {
- return jQuery.ajax({
- url,
- // Make this explicit, since user can override this through ajaxSetup (trac-11264)
- type: "GET",
- dataType: "script",
- cache: true,
- async: false,
- global: false,
- // Only evaluate the response if it is successful (gh-4126)
- // dataFilter is not invoked for failure responses, so using it instead
- // of the default converter is kludgy but it works.
- converters: {
- "text script": function() {
- }
- },
- dataFilter: function(response) {
- jQuery.globalEval(response, options, doc);
- }
- });
- };
- jQuery.fn.extend({
- wrapAll: function(html) {
- var wrap;
- if (this[0]) {
- if (isFunction(html)) {
- html = html.call(this[0]);
- }
- wrap = jQuery(html, this[0].ownerDocument).eq(0).clone(true);
- if (this[0].parentNode) {
- wrap.insertBefore(this[0]);
- }
- wrap.map(function() {
- var elem = this;
- while (elem.firstElementChild) {
- elem = elem.firstElementChild;
- }
- return elem;
- }).append(this);
- }
- return this;
- },
- wrapInner: function(html) {
- if (isFunction(html)) {
- return this.each(function(i) {
- jQuery(this).wrapInner(html.call(this, i));
- });
- }
- return this.each(function() {
- var self2 = jQuery(this), contents = self2.contents();
- if (contents.length) {
- contents.wrapAll(html);
- } else {
- self2.append(html);
- }
- });
- },
- wrap: function(html) {
- var htmlIsFunction = isFunction(html);
- return this.each(function(i) {
- jQuery(this).wrapAll(htmlIsFunction ? html.call(this, i) : html);
- });
- },
- unwrap: function(selector) {
- this.parent(selector).not("body").each(function() {
- jQuery(this).replaceWith(this.childNodes);
- });
- return this;
- }
- });
- jQuery.expr.pseudos.hidden = function(elem) {
- return !jQuery.expr.pseudos.visible(elem);
- };
- jQuery.expr.pseudos.visible = function(elem) {
- return !!(elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length);
- };
- jQuery.ajaxSettings.xhr = function() {
- try {
- return new window2.XMLHttpRequest();
- } catch (e) {
- }
- };
- var xhrSuccessStatus = {
- // File protocol always yields status code 0, assume 200
- 0: 200,
- // Support: IE <=9 only
- // trac-1450: sometimes IE returns 1223 when it should be 204
- 1223: 204
- }, xhrSupported = jQuery.ajaxSettings.xhr();
- support.cors = !!xhrSupported && "withCredentials" in xhrSupported;
- support.ajax = xhrSupported = !!xhrSupported;
- jQuery.ajaxTransport(function(options) {
- var callback, errorCallback;
- if (support.cors || xhrSupported && !options.crossDomain) {
- return {
- send: function(headers, complete) {
- var i, xhr = options.xhr();
- xhr.open(
- options.type,
- options.url,
- options.async,
- options.username,
- options.password
- );
- if (options.xhrFields) {
- for (i in options.xhrFields) {
- xhr[i] = options.xhrFields[i];
- }
- }
- if (options.mimeType && xhr.overrideMimeType) {
- xhr.overrideMimeType(options.mimeType);
- }
- if (!options.crossDomain && !headers["X-Requested-With"]) {
- headers["X-Requested-With"] = "XMLHttpRequest";
- }
- for (i in headers) {
- xhr.setRequestHeader(i, headers[i]);
- }
- callback = function(type) {
- return function() {
- if (callback) {
- callback = errorCallback = xhr.onload = xhr.onerror = xhr.onabort = xhr.ontimeout = xhr.onreadystatechange = null;
- if (type === "abort") {
- xhr.abort();
- } else if (type === "error") {
- if (typeof xhr.status !== "number") {
- complete(0, "error");
- } else {
- complete(
- // File: protocol always yields status 0; see trac-8605, trac-14207
- xhr.status,
- xhr.statusText
- );
- }
- } else {
- complete(
- xhrSuccessStatus[xhr.status] || xhr.status,
- xhr.statusText,
- // Support: IE <=9 only
- // IE9 has no XHR2 but throws on binary (trac-11426)
- // For XHR2 non-text, let the caller handle it (gh-2498)
- (xhr.responseType || "text") !== "text" || typeof xhr.responseText !== "string" ? { binary: xhr.response } : { text: xhr.responseText },
- xhr.getAllResponseHeaders()
- );
- }
- }
- };
- };
- xhr.onload = callback();
- errorCallback = xhr.onerror = xhr.ontimeout = callback("error");
- if (xhr.onabort !== void 0) {
- xhr.onabort = errorCallback;
- } else {
- xhr.onreadystatechange = function() {
- if (xhr.readyState === 4) {
- window2.setTimeout(function() {
- if (callback) {
- errorCallback();
- }
- });
- }
- };
- }
- callback = callback("abort");
- try {
- xhr.send(options.hasContent && options.data || null);
- } catch (e) {
- if (callback) {
- throw e;
- }
- }
- },
- abort: function() {
- if (callback) {
- callback();
- }
- }
- };
- }
- });
- jQuery.ajaxPrefilter(function(s) {
- if (s.crossDomain) {
- s.contents.script = false;
- }
- });
- jQuery.ajaxSetup({
- accepts: {
- script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
- },
- contents: {
- script: /\b(?:java|ecma)script\b/
- },
- converters: {
- "text script": function(text) {
- jQuery.globalEval(text);
- return text;
- }
- }
- });
- jQuery.ajaxPrefilter("script", function(s) {
- if (s.cache === void 0) {
- s.cache = false;
- }
- if (s.crossDomain) {
- s.type = "GET";
- }
- });
- jQuery.ajaxTransport("script", function(s) {
- if (s.crossDomain || s.scriptAttrs) {
- var script, callback;
- return {
- send: function(_, complete) {
- script = jQuery("<script>").attr(s.scriptAttrs || {}).prop({ charset: s.scriptCharset, src: s.url }).on("load error", callback = function(evt) {
- script.remove();
- callback = null;
- if (evt) {
- complete(evt.type === "error" ? 404 : 200, evt.type);
- }
- });
- document2.head.appendChild(script[0]);
- },
- abort: function() {
- if (callback) {
- callback();
- }
- }
- };
- }
- });
- var oldCallbacks = [], rjsonp = /(=)\?(?=&|$)|\?\?/;
- jQuery.ajaxSetup({
- jsonp: "callback",
- jsonpCallback: function() {
- var callback = oldCallbacks.pop() || jQuery.expando + "_" + nonce.guid++;
- this[callback] = true;
- return callback;
- }
- });
- jQuery.ajaxPrefilter("json jsonp", function(s, originalSettings, jqXHR) {
- var callbackName, overwritten, responseContainer, jsonProp = s.jsonp !== false && (rjsonp.test(s.url) ? "url" : typeof s.data === "string" && (s.contentType || "").indexOf("application/x-www-form-urlencoded") === 0 && rjsonp.test(s.data) && "data");
- if (jsonProp || s.dataTypes[0] === "jsonp") {
- callbackName = s.jsonpCallback = isFunction(s.jsonpCallback) ? s.jsonpCallback() : s.jsonpCallback;
- if (jsonProp) {
- s[jsonProp] = s[jsonProp].replace(rjsonp, "$1" + callbackName);
- } else if (s.jsonp !== false) {
- s.url += (rquery.test(s.url) ? "&" : "?") + s.jsonp + "=" + callbackName;
- }
- s.converters["script json"] = function() {
- if (!responseContainer) {
- jQuery.error(callbackName + " was not called");
- }
- return responseContainer[0];
- };
- s.dataTypes[0] = "json";
- overwritten = window2[callbackName];
- window2[callbackName] = function() {
- responseContainer = arguments;
- };
- jqXHR.always(function() {
- if (overwritten === void 0) {
- jQuery(window2).removeProp(callbackName);
- } else {
- window2[callbackName] = overwritten;
- }
- if (s[callbackName]) {
- s.jsonpCallback = originalSettings.jsonpCallback;
- oldCallbacks.push(callbackName);
- }
- if (responseContainer && isFunction(overwritten)) {
- overwritten(responseContainer[0]);
- }
- responseContainer = overwritten = void 0;
- });
- return "script";
- }
- });
- support.createHTMLDocument = function() {
- var body = document2.implementation.createHTMLDocument("").body;
- body.innerHTML = "<form></form><form></form>";
- return body.childNodes.length === 2;
- }();
- jQuery.parseHTML = function(data, context, keepScripts) {
- if (typeof data !== "string") {
- return [];
- }
- if (typeof context === "boolean") {
- keepScripts = context;
- context = false;
- }
- var base, parsed, scripts;
- if (!context) {
- if (support.createHTMLDocument) {
- context = document2.implementation.createHTMLDocument("");
- base = context.createElement("base");
- base.href = document2.location.href;
- context.head.appendChild(base);
- } else {
- context = document2;
- }
- }
- parsed = rsingleTag.exec(data);
- scripts = !keepScripts && [];
- if (parsed) {
- return [context.createElement(parsed[1])];
- }
- parsed = buildFragment([data], context, scripts);
- if (scripts && scripts.length) {
- jQuery(scripts).remove();
- }
- return jQuery.merge([], parsed.childNodes);
- };
- jQuery.fn.load = function(url, params, callback) {
- var selector, type, response, self2 = this, off = url.indexOf(" ");
- if (off > -1) {
- selector = stripAndCollapse(url.slice(off));
- url = url.slice(0, off);
- }
- if (isFunction(params)) {
- callback = params;
- params = void 0;
- } else if (params && typeof params === "object") {
- type = "POST";
- }
- if (self2.length > 0) {
- jQuery.ajax({
- url,
- // If "type" variable is undefined, then "GET" method will be used.
- // Make value of this field explicit since
- // user can override it through ajaxSetup method
- type: type || "GET",
- dataType: "html",
- data: params
- }).done(function(responseText) {
- response = arguments;
- self2.html(selector ? (
- // If a selector was specified, locate the right elements in a dummy div
- // Exclude scripts to avoid IE 'Permission Denied' errors
- jQuery("<div>").append(jQuery.parseHTML(responseText)).find(selector)
- ) : (
- // Otherwise use the full result
- responseText
- ));
- }).always(callback && function(jqXHR, status) {
- self2.each(function() {
- callback.apply(this, response || [jqXHR.responseText, status, jqXHR]);
- });
- });
- }
- return this;
- };
- jQuery.expr.pseudos.animated = function(elem) {
- return jQuery.grep(jQuery.timers, function(fn) {
- return elem === fn.elem;
- }).length;
- };
- jQuery.offset = {
- setOffset: function(elem, options, i) {
- var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, position = jQuery.css(elem, "position"), curElem = jQuery(elem), props = {};
- if (position === "static") {
- elem.style.position = "relative";
- }
- curOffset = curElem.offset();
- curCSSTop = jQuery.css(elem, "top");
- curCSSLeft = jQuery.css(elem, "left");
- calculatePosition = (position === "absolute" || position === "fixed") && (curCSSTop + curCSSLeft).indexOf("auto") > -1;
- if (calculatePosition) {
- curPosition = curElem.position();
- curTop = curPosition.top;
- curLeft = curPosition.left;
- } else {
- curTop = parseFloat(curCSSTop) || 0;
- curLeft = parseFloat(curCSSLeft) || 0;
- }
- if (isFunction(options)) {
- options = options.call(elem, i, jQuery.extend({}, curOffset));
- }
- if (options.top != null) {
- props.top = options.top - curOffset.top + curTop;
- }
- if (options.left != null) {
- props.left = options.left - curOffset.left + curLeft;
- }
- if ("using" in options) {
- options.using.call(elem, props);
- } else {
- curElem.css(props);
- }
- }
- };
- jQuery.fn.extend({
- // offset() relates an element's border box to the document origin
- offset: function(options) {
- if (arguments.length) {
- return options === void 0 ? this : this.each(function(i) {
- jQuery.offset.setOffset(this, options, i);
- });
- }
- var rect, win, elem = this[0];
- if (!elem) {
- return;
- }
- if (!elem.getClientRects().length) {
- return { top: 0, left: 0 };
- }
- rect = elem.getBoundingClientRect();
- win = elem.ownerDocument.defaultView;
- return {
- top: rect.top + win.pageYOffset,
- left: rect.left + win.pageXOffset
- };
- },
- // position() relates an element's margin box to its offset parent's padding box
- // This corresponds to the behavior of CSS absolute positioning
- position: function() {
- if (!this[0]) {
- return;
- }
- var offsetParent, offset, doc, elem = this[0], parentOffset = { top: 0, left: 0 };
- if (jQuery.css(elem, "position") === "fixed") {
- offset = elem.getBoundingClientRect();
- } else {
- offset = this.offset();
- doc = elem.ownerDocument;
- offsetParent = elem.offsetParent || doc.documentElement;
- while (offsetParent && (offsetParent === doc.body || offsetParent === doc.documentElement) && jQuery.css(offsetParent, "position") === "static") {
- offsetParent = offsetParent.parentNode;
- }
- if (offsetParent && offsetParent !== elem && offsetParent.nodeType === 1) {
- parentOffset = jQuery(offsetParent).offset();
- parentOffset.top += jQuery.css(offsetParent, "borderTopWidth", true);
- parentOffset.left += jQuery.css(offsetParent, "borderLeftWidth", true);
- }
- }
- return {
- top: offset.top - parentOffset.top - jQuery.css(elem, "marginTop", true),
- left: offset.left - parentOffset.left - jQuery.css(elem, "marginLeft", true)
- };
- },
- // This method will return documentElement in the following cases:
- // 1) For the element inside the iframe without offsetParent, this method will return
- // documentElement of the parent window
- // 2) For the hidden or detached element
- // 3) For body or html element, i.e. in case of the html node - it will return itself
- //
- // but those exceptions were never presented as a real life use-cases
- // and might be considered as more preferable results.
- //
- // This logic, however, is not guaranteed and can change at any point in the future
- offsetParent: function() {
- return this.map(function() {
- var offsetParent = this.offsetParent;
- while (offsetParent && jQuery.css(offsetParent, "position") === "static") {
- offsetParent = offsetParent.offsetParent;
- }
- return offsetParent || documentElement;
- });
- }
- });
- jQuery.each({ scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function(method, prop) {
- var top = "pageYOffset" === prop;
- jQuery.fn[method] = function(val) {
- return access(this, function(elem, method2, val2) {
- var win;
- if (isWindow(elem)) {
- win = elem;
- } else if (elem.nodeType === 9) {
- win = elem.defaultView;
- }
- if (val2 === void 0) {
- return win ? win[prop] : elem[method2];
- }
- if (win) {
- win.scrollTo(
- !top ? val2 : win.pageXOffset,
- top ? val2 : win.pageYOffset
- );
- } else {
- elem[method2] = val2;
- }
- }, method, val, arguments.length);
- };
- });
- jQuery.each(["top", "left"], function(_i, prop) {
- jQuery.cssHooks[prop] = addGetHookIf(
- support.pixelPosition,
- function(elem, computed) {
- if (computed) {
- computed = curCSS(elem, prop);
- return rnumnonpx.test(computed) ? jQuery(elem).position()[prop] + "px" : computed;
- }
- }
- );
- });
- jQuery.each({ Height: "height", Width: "width" }, function(name, type) {
- jQuery.each({
- padding: "inner" + name,
- content: type,
- "": "outer" + name
- }, function(defaultExtra, funcName) {
- jQuery.fn[funcName] = function(margin, value) {
- var chainable = arguments.length && (defaultExtra || typeof margin !== "boolean"), extra = defaultExtra || (margin === true || value === true ? "margin" : "border");
- return access(this, function(elem, type2, value2) {
- var doc;
- if (isWindow(elem)) {
- return funcName.indexOf("outer") === 0 ? elem["inner" + name] : elem.document.documentElement["client" + name];
- }
- if (elem.nodeType === 9) {
- doc = elem.documentElement;
- return Math.max(
- elem.body["scroll" + name],
- doc["scroll" + name],
- elem.body["offset" + name],
- doc["offset" + name],
- doc["client" + name]
- );
- }
- return value2 === void 0 ? (
- // Get width or height on the element, requesting but not forcing parseFloat
- jQuery.css(elem, type2, extra)
- ) : (
- // Set width or height on the element
- jQuery.style(elem, type2, value2, extra)
- );
- }, type, chainable ? margin : void 0, chainable);
- };
- });
- });
- jQuery.each([
- "ajaxStart",
- "ajaxStop",
- "ajaxComplete",
- "ajaxError",
- "ajaxSuccess",
- "ajaxSend"
- ], function(_i, type) {
- jQuery.fn[type] = function(fn) {
- return this.on(type, fn);
- };
- });
- jQuery.fn.extend({
- bind: function(types, data, fn) {
- return this.on(types, null, data, fn);
- },
- unbind: function(types, fn) {
- return this.off(types, null, fn);
- },
- delegate: function(selector, types, data, fn) {
- return this.on(types, selector, data, fn);
- },
- undelegate: function(selector, types, fn) {
- return arguments.length === 1 ? this.off(selector, "**") : this.off(types, selector || "**", fn);
- },
- hover: function(fnOver, fnOut) {
- return this.on("mouseenter", fnOver).on("mouseleave", fnOut || fnOver);
- }
- });
- jQuery.each(
- "blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),
- function(_i, name) {
- jQuery.fn[name] = function(data, fn) {
- return arguments.length > 0 ? this.on(name, null, data, fn) : this.trigger(name);
- };
- }
- );
- var rtrim = /^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;
- jQuery.proxy = function(fn, context) {
- var tmp, args, proxy;
- if (typeof context === "string") {
- tmp = fn[context];
- context = fn;
- fn = tmp;
- }
- if (!isFunction(fn)) {
- return void 0;
- }
- args = slice.call(arguments, 2);
- proxy = function() {
- return fn.apply(context || this, args.concat(slice.call(arguments)));
- };
- proxy.guid = fn.guid = fn.guid || jQuery.guid++;
- return proxy;
- };
- jQuery.holdReady = function(hold) {
- if (hold) {
- jQuery.readyWait++;
- } else {
- jQuery.ready(true);
- }
- };
- jQuery.isArray = Array.isArray;
- jQuery.parseJSON = JSON.parse;
- jQuery.nodeName = nodeName;
- jQuery.isFunction = isFunction;
- jQuery.isWindow = isWindow;
- jQuery.camelCase = camelCase;
- jQuery.type = toType;
- jQuery.now = Date.now;
- jQuery.isNumeric = function(obj) {
- var type = jQuery.type(obj);
- return (type === "number" || type === "string") && // parseFloat NaNs numeric-cast false positives ("")
- // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
- // subtraction forces infinities to NaN
- !isNaN(obj - parseFloat(obj));
- };
- jQuery.trim = function(text) {
- return text == null ? "" : (text + "").replace(rtrim, "$1");
- };
- var _jQuery = window2.jQuery, _$ = window2.$;
- jQuery.noConflict = function(deep) {
- if (window2.$ === jQuery) {
- window2.$ = _$;
- }
- if (deep && window2.jQuery === jQuery) {
- window2.jQuery = _jQuery;
- }
- return jQuery;
- };
- if (typeof noGlobal === "undefined") {
- window2.jQuery = window2.$ = jQuery;
- }
- return jQuery;
- });
- })(jquery);
- var jqueryExports = jquery.exports;
- const $$1 = /* @__PURE__ */ getDefaultExportFromCjs(jqueryExports);
- class RuleBaseInterface {
- constructor() {
- __publicField(this, "$", window.jQuery || $$1);
- // 通用属性配置,以及工具函数。可在规则类中覆盖
- __publicField(this, "minTitleLength", 8);
- // 标题最少汉字数(不能在小了,这个值变小会造成更多数据误差)
- __publicField(this, "maxDepthLevel", 30);
- // DOM树最大深度
- __publicField(this, "minDateStringLength", 3);
- // 最小时间文本长度,提取到的时间文本大于等于该值时候,才会收集
- __publicField(this, "companyNameReg", /(集团|公司|研究所|设计院|平台)$/);
- __publicField(this, "includeTags", [
- "A",
- "DIV",
- "SPAN",
- "TD",
- "H1",
- "H2",
- "H3",
- "H4",
- "H5",
- "H6",
- "P",
- "TD",
- "TR"
- ]);
- // 非法节点,需要排除
- __publicField(this, "excludeTags", ["SCRIPT", "STYLE"]);
- __publicField(this, "chineseCharReg", /[\u4e00-\u9fa5]/g);
- __publicField(this, "datePatterns", [
- /\b(\d{4})\/(\d{0,2})\/(\d{0,2})\b/,
- /\b(\d{4})-(\d{0,2})-(\d{0,2})\b/,
- /\b(\d{0,2})-(\d{0,2})\b/,
- /\b(\d{0,2})\/(\d{0,2})\b/,
- /\b(\d{4})\/(\d{0,2})\/(\d{0,2}) (\d{0,2}):(\d{0,2})\b/,
- /\b(\d{4})-(\d{0,2})-(\d{0,2}) (\d{0,2}):(\d{0,2})\b/,
- /\b(\d{2})\/(\d{0,2}) (\d{0,2}):(\d{0,2})\b/,
- /\b(\d{2})-(\d{0,2}) (\d{0,2}):(\d{0,2})\b/,
- // 匹配年月
- /\b(\d{4})\/(\d{0,2})\b/,
- /\b(\d{4})-(\d{0,2})\b/,
- // 范围更大的匹配
- /\b(\d{4})([\\\/\.\-年月日点时分秒\:])(\d{0,2})([\\\/\.\-年月日点时分秒\:])(\d{0,2})\b/,
- /\b(\d{4})([\\\/\.\-年月日点时分秒\:])(\d{0,2})\b/
- ]);
- __publicField(this, "todayDatePatternString", [
- "(%s年)(\\D+)(%s月)(\\D+)(%s日)",
- "(%s月)(\\D+)(%s日)"
- ]);
- __publicField(this, "infoTypeList", [
- "拟建",
- "采购意向",
- "预告",
- "预审",
- "预审结果",
- "论证意见",
- "需求公示",
- "招标",
- "邀标",
- "询价",
- "竞谈",
- "单一",
- "竞价",
- "中标",
- "成交",
- "废标",
- "流标",
- "合同",
- "验收",
- "违规"
- ]);
- __publicField(this, "otherKeyList", [
- "项目",
- "公告",
- "公示",
- "采购",
- "更正",
- "变更"
- ]);
- __publicField(this, "importantTags", [
- "h1",
- "h2",
- "h3",
- "h4",
- "h5",
- "a"
- ]);
- }
- run() {
- }
- check() {
- }
- get todayPatterns() {
- const now = /* @__PURE__ */ new Date();
- const year = now.getFullYear();
- const month = now.getMonth() + 1;
- const day = now.getDate();
- const monthStr = `${month}`.padStart(2, "0");
- const dayStr = `${day}`.padStart(2, "0");
- const arr = [];
- const todayDatePatternList = this.todayDatePatternString;
- if (Array.isArray(todayDatePatternList)) {
- todayDatePatternList.forEach((p) => {
- let np = p.replace("%s年", `${year}`);
- arr.push(np.replace("%s月", `${month}`).replace("%s日", `${day}`));
- arr.push(np.replace("%s月", `${month}`).replace("%s日", `${dayStr}`));
- arr.push(np.replace("%s月", `${monthStr}`).replace("%s日", `${day}`));
- arr.push(np.replace("%s月", `${monthStr}`).replace("%s日", `${dayStr}`));
- });
- return arr.map((r) => new RegExp(r));
- } else {
- return [];
- }
- }
- get importantKeyList() {
- let list = [];
- return list.concat(this.infoTypeList).concat(this.otherKeyList);
- }
- get importantTagList() {
- const tagList = this.importantTags;
- if (Array.isArray(tagList)) {
- return tagList.map((i) => i.toUpperCase());
- } else {
- return [];
- }
- }
- // 辅助函数:遍历DOM节点,查找符合条件的末级节点
- findEligibleLeafNodes(node, condition) {
- const result = [];
- const includeTags = this.includeTags;
- const excludeTags = this.excludeTags;
- function pushResult(n) {
- var _a;
- result.push({ node: n, text: (_a = n.textContent) == null ? void 0 : _a.trim(), selector: null });
- }
- function traverse(node2) {
- if (!node2)
- return;
- if (excludeTags.includes(node2.nodeName))
- return;
- if (node2.nodeType === Node.ELEMENT_NODE) {
- if (includeTags.includes(node2.nodeName) && !node2.children.length && node2.textContent) {
- if (typeof condition === "function") {
- if (condition(node2)) {
- pushResult(node2);
- }
- } else {
- pushResult(node2);
- }
- } else {
- node2.childNodes.forEach((item) => {
- traverse(item);
- });
- }
- } else if (node2.nodeType === Node.TEXT_NODE) {
- if (node2.textContent) {
- if (typeof condition === "function") {
- if (condition(node2)) {
- pushResult(node2);
- }
- } else {
- pushResult(node2);
- }
- }
- }
- }
- traverse(node);
- return result;
- }
- // 辅助函数:从文本中提取日期
- extractDates(text) {
- text = text || "";
- var dates = [];
- this.datePatterns.forEach((pattern) => {
- var match = text.match(pattern);
- if (match && match.length > 0) {
- match = match.filter((r) => !!r);
- const targetStr = match[0];
- if (targetStr && targetStr.length >= this.minDateStringLength) {
- dates.push(targetStr);
- }
- }
- });
- return dates;
- }
- // 辅助函数:生成CSS选择器
- generateCSSSelector(element) {
- if (!element) {
- return;
- }
- let selector = this.getTagName(element).toLowerCase();
- if (element.id) {
- selector = `#${element.id}`;
- } else {
- let siblings = [];
- if (element.parentNode) {
- siblings = Array.from(element.parentNode.children);
- }
- const index = siblings.indexOf(element) + 1;
- selector += `:nth-child(${index})`;
- }
- if (element.parentNode && element.parentNode !== document.body) {
- selector = `${this.generateCSSSelector(element.parentNode)} > ${selector}`;
- }
- return selector;
- }
- // 判断是否是元素节点
- isElementNode(node) {
- return node && node.nodeType === Node.ELEMENT_NODE;
- }
- // 元素是否隐藏(文本节点无法计算显示隐藏,则默认非隐藏)
- checkNodeHidden(node) {
- let isHidden = false;
- if (this.isElementNode(node)) {
- isHidden = this.$(node).is(":hidden");
- }
- return isHidden;
- }
- isCompanyName(text) {
- return this.companyNameReg.test(text);
- }
- getTagName(node) {
- if (this.isElementNode(node)) {
- return node.tagName;
- } else {
- return "";
- }
- }
- // 统计中文字符个数
- countChineseCharacters(str) {
- str = str || "";
- var matches = str.match(this.chineseCharReg);
- return matches ? matches.length : 0;
- }
- // 上报:lua脚本中会取window.result变量中的内容
- report(result) {
- window.result = result;
- }
- }
- function getSiblings(elem) {
- var _a;
- var r = [];
- var n = (_a = elem.parentNode) == null ? void 0 : _a.firstChild;
- for (; n; n = n.nextSibling) {
- if (n.nodeType === 1 && n !== elem) {
- r.push(n);
- }
- }
- return r;
- }
- function getMaxCount(arr) {
- return Math.max.apply(null, arr);
- }
- var lodash = { exports: {} };
- /**
- * @license
- * Lodash <https://lodash.com/>
- * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
- * Released under MIT license <https://lodash.com/license>
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
- */
- lodash.exports;
- (function(module, exports) {
- (function() {
- var undefined$1;
- var VERSION = "4.17.21";
- var LARGE_ARRAY_SIZE = 200;
- 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`";
- var HASH_UNDEFINED = "__lodash_hash_undefined__";
- var MAX_MEMOIZE_SIZE = 500;
- var PLACEHOLDER = "__lodash_placeholder__";
- var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4;
- var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
- 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;
- var DEFAULT_TRUNC_LENGTH = 30, DEFAULT_TRUNC_OMISSION = "...";
- var HOT_COUNT = 800, HOT_SPAN = 16;
- var LAZY_FILTER_FLAG = 1, LAZY_MAP_FLAG = 2, LAZY_WHILE_FLAG = 3;
- var INFINITY = 1 / 0, MAX_SAFE_INTEGER = 9007199254740991, MAX_INTEGER = 17976931348623157e292, NAN = 0 / 0;
- var MAX_ARRAY_LENGTH = 4294967295, MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
- var wrapFlags = [
- ["ary", WRAP_ARY_FLAG],
- ["bind", WRAP_BIND_FLAG],
- ["bindKey", WRAP_BIND_KEY_FLAG],
- ["curry", WRAP_CURRY_FLAG],
- ["curryRight", WRAP_CURRY_RIGHT_FLAG],
- ["flip", WRAP_FLIP_FLAG],
- ["partial", WRAP_PARTIAL_FLAG],
- ["partialRight", WRAP_PARTIAL_RIGHT_FLAG],
- ["rearg", WRAP_REARG_FLAG]
- ];
- var argsTag = "[object Arguments]", arrayTag = "[object Array]", asyncTag = "[object AsyncFunction]", boolTag = "[object Boolean]", dateTag = "[object Date]", domExcTag = "[object DOMException]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", nullTag = "[object Null]", objectTag = "[object Object]", promiseTag = "[object Promise]", proxyTag = "[object Proxy]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", undefinedTag = "[object Undefined]", weakMapTag = "[object WeakMap]", weakSetTag = "[object WeakSet]";
- var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
- var reEmptyStringLeading = /\b__p \+= '';/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/g, reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
- var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, reUnescapedHtml = /[&<>"']/g, reHasEscapedHtml = RegExp(reEscapedHtml.source), reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
- var reEscape = /<%-([\s\S]+?)%>/g, reEvaluate = /<%([\s\S]+?)%>/g, reInterpolate = /<%=([\s\S]+?)%>/g;
- var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar.source);
- var reTrimStart = /^\s+/;
- var reWhitespace = /\s/;
- var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, reSplitDetails = /,? & /;
- var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
- var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
- var reEscapeChar = /\\(\\)?/g;
- var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
- var reFlags = /\w*$/;
- var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
- var reIsBinary = /^0b[01]+$/i;
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
- var reIsOctal = /^0o[0-7]+$/i;
- var reIsUint = /^(?:0|[1-9]\d*)$/;
- var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
- var reNoMatch = /($^)/;
- var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
- 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;
- 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";
- 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("|") + ")";
- var reApos = RegExp(rsApos, "g");
- var reComboMark = RegExp(rsCombo, "g");
- var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g");
- var reUnicodeWord = RegExp([
- rsUpper + "?" + rsLower + "+" + rsOptContrLower + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")",
- rsMiscUpper + "+" + rsOptContrUpper + "(?=" + [rsBreak, rsUpper + rsMiscLower, "$"].join("|") + ")",
- rsUpper + "?" + rsMiscLower + "+" + rsOptContrLower,
- rsUpper + "+" + rsOptContrUpper,
- rsOrdUpper,
- rsOrdLower,
- rsDigits,
- rsEmoji
- ].join("|"), "g");
- var reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + "]");
- 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 ]/;
- var contextProps = [
- "Array",
- "Buffer",
- "DataView",
- "Date",
- "Error",
- "Float32Array",
- "Float64Array",
- "Function",
- "Int8Array",
- "Int16Array",
- "Int32Array",
- "Map",
- "Math",
- "Object",
- "Promise",
- "RegExp",
- "Set",
- "String",
- "Symbol",
- "TypeError",
- "Uint8Array",
- "Uint8ClampedArray",
- "Uint16Array",
- "Uint32Array",
- "WeakMap",
- "_",
- "clearTimeout",
- "isFinite",
- "parseInt",
- "setTimeout"
- ];
- var templateCounter = -1;
- var typedArrayTags = {};
- typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
- typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
- var cloneableTags = {};
- cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
- cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
- var deburredLetters = {
- // Latin-1 Supplement block.
- "À": "A",
- "Á": "A",
- "Â": "A",
- "Ã": "A",
- "Ä": "A",
- "Å": "A",
- "à": "a",
- "á": "a",
- "â": "a",
- "ã": "a",
- "ä": "a",
- "å": "a",
- "Ç": "C",
- "ç": "c",
- "Ð": "D",
- "ð": "d",
- "È": "E",
- "É": "E",
- "Ê": "E",
- "Ë": "E",
- "è": "e",
- "é": "e",
- "ê": "e",
- "ë": "e",
- "Ì": "I",
- "Í": "I",
- "Î": "I",
- "Ï": "I",
- "ì": "i",
- "í": "i",
- "î": "i",
- "ï": "i",
- "Ñ": "N",
- "ñ": "n",
- "Ò": "O",
- "Ó": "O",
- "Ô": "O",
- "Õ": "O",
- "Ö": "O",
- "Ø": "O",
- "ò": "o",
- "ó": "o",
- "ô": "o",
- "õ": "o",
- "ö": "o",
- "ø": "o",
- "Ù": "U",
- "Ú": "U",
- "Û": "U",
- "Ü": "U",
- "ù": "u",
- "ú": "u",
- "û": "u",
- "ü": "u",
- "Ý": "Y",
- "ý": "y",
- "ÿ": "y",
- "Æ": "Ae",
- "æ": "ae",
- "Þ": "Th",
- "þ": "th",
- "ß": "ss",
- // Latin Extended-A block.
- "Ā": "A",
- "Ă": "A",
- "Ą": "A",
- "ā": "a",
- "ă": "a",
- "ą": "a",
- "Ć": "C",
- "Ĉ": "C",
- "Ċ": "C",
- "Č": "C",
- "ć": "c",
- "ĉ": "c",
- "ċ": "c",
- "č": "c",
- "Ď": "D",
- "Đ": "D",
- "ď": "d",
- "đ": "d",
- "Ē": "E",
- "Ĕ": "E",
- "Ė": "E",
- "Ę": "E",
- "Ě": "E",
- "ē": "e",
- "ĕ": "e",
- "ė": "e",
- "ę": "e",
- "ě": "e",
- "Ĝ": "G",
- "Ğ": "G",
- "Ġ": "G",
- "Ģ": "G",
- "ĝ": "g",
- "ğ": "g",
- "ġ": "g",
- "ģ": "g",
- "Ĥ": "H",
- "Ħ": "H",
- "ĥ": "h",
- "ħ": "h",
- "Ĩ": "I",
- "Ī": "I",
- "Ĭ": "I",
- "Į": "I",
- "İ": "I",
- "ĩ": "i",
- "ī": "i",
- "ĭ": "i",
- "į": "i",
- "ı": "i",
- "Ĵ": "J",
- "ĵ": "j",
- "Ķ": "K",
- "ķ": "k",
- "ĸ": "k",
- "Ĺ": "L",
- "Ļ": "L",
- "Ľ": "L",
- "Ŀ": "L",
- "Ł": "L",
- "ĺ": "l",
- "ļ": "l",
- "ľ": "l",
- "ŀ": "l",
- "ł": "l",
- "Ń": "N",
- "Ņ": "N",
- "Ň": "N",
- "Ŋ": "N",
- "ń": "n",
- "ņ": "n",
- "ň": "n",
- "ŋ": "n",
- "Ō": "O",
- "Ŏ": "O",
- "Ő": "O",
- "ō": "o",
- "ŏ": "o",
- "ő": "o",
- "Ŕ": "R",
- "Ŗ": "R",
- "Ř": "R",
- "ŕ": "r",
- "ŗ": "r",
- "ř": "r",
- "Ś": "S",
- "Ŝ": "S",
- "Ş": "S",
- "Š": "S",
- "ś": "s",
- "ŝ": "s",
- "ş": "s",
- "š": "s",
- "Ţ": "T",
- "Ť": "T",
- "Ŧ": "T",
- "ţ": "t",
- "ť": "t",
- "ŧ": "t",
- "Ũ": "U",
- "Ū": "U",
- "Ŭ": "U",
- "Ů": "U",
- "Ű": "U",
- "Ų": "U",
- "ũ": "u",
- "ū": "u",
- "ŭ": "u",
- "ů": "u",
- "ű": "u",
- "ų": "u",
- "Ŵ": "W",
- "ŵ": "w",
- "Ŷ": "Y",
- "ŷ": "y",
- "Ÿ": "Y",
- "Ź": "Z",
- "Ż": "Z",
- "Ž": "Z",
- "ź": "z",
- "ż": "z",
- "ž": "z",
- "IJ": "IJ",
- "ij": "ij",
- "Œ": "Oe",
- "œ": "oe",
- "ʼn": "'n",
- "ſ": "s"
- };
- var htmlEscapes = {
- "&": "&",
- "<": "<",
- ">": ">",
- '"': """,
- "'": "'"
- };
- var htmlUnescapes = {
- "&": "&",
- "<": "<",
- ">": ">",
- """: '"',
- "'": "'"
- };
- var stringEscapes = {
- "\\": "\\",
- "'": "'",
- "\n": "n",
- "\r": "r",
- "\u2028": "u2028",
- "\u2029": "u2029"
- };
- var freeParseFloat = parseFloat, freeParseInt = parseInt;
- var freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
- var freeSelf = typeof self == "object" && self && self.Object === Object && self;
- var root = freeGlobal || freeSelf || Function("return this")();
- var freeExports = exports && !exports.nodeType && exports;
- var freeModule = freeExports && true && module && !module.nodeType && module;
- var moduleExports = freeModule && freeModule.exports === freeExports;
- var freeProcess = moduleExports && freeGlobal.process;
- var nodeUtil = function() {
- try {
- var types = freeModule && freeModule.require && freeModule.require("util").types;
- if (types) {
- return types;
- }
- return freeProcess && freeProcess.binding && freeProcess.binding("util");
- } catch (e) {
- }
- }();
- 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;
- function apply(func, thisArg, args) {
- switch (args.length) {
- case 0:
- return func.call(thisArg);
- case 1:
- return func.call(thisArg, args[0]);
- case 2:
- return func.call(thisArg, args[0], args[1]);
- case 3:
- return func.call(thisArg, args[0], args[1], args[2]);
- }
- return func.apply(thisArg, args);
- }
- function arrayAggregator(array, setter, iteratee, accumulator) {
- var index = -1, length = array == null ? 0 : array.length;
- while (++index < length) {
- var value = array[index];
- setter(accumulator, value, iteratee(value), array);
- }
- return accumulator;
- }
- function arrayEach(array, iteratee) {
- var index = -1, length = array == null ? 0 : array.length;
- while (++index < length) {
- if (iteratee(array[index], index, array) === false) {
- break;
- }
- }
- return array;
- }
- function arrayEachRight(array, iteratee) {
- var length = array == null ? 0 : array.length;
- while (length--) {
- if (iteratee(array[length], length, array) === false) {
- break;
- }
- }
- return array;
- }
- function arrayEvery(array, predicate) {
- var index = -1, length = array == null ? 0 : array.length;
- while (++index < length) {
- if (!predicate(array[index], index, array)) {
- return false;
- }
- }
- return true;
- }
- function arrayFilter(array, predicate) {
- var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
- while (++index < length) {
- var value = array[index];
- if (predicate(value, index, array)) {
- result[resIndex++] = value;
- }
- }
- return result;
- }
- function arrayIncludes(array, value) {
- var length = array == null ? 0 : array.length;
- return !!length && baseIndexOf(array, value, 0) > -1;
- }
- function arrayIncludesWith(array, value, comparator) {
- var index = -1, length = array == null ? 0 : array.length;
- while (++index < length) {
- if (comparator(value, array[index])) {
- return true;
- }
- }
- return false;
- }
- function arrayMap(array, iteratee) {
- var index = -1, length = array == null ? 0 : array.length, result = Array(length);
- while (++index < length) {
- result[index] = iteratee(array[index], index, array);
- }
- return result;
- }
- function arrayPush(array, values) {
- var index = -1, length = values.length, offset = array.length;
- while (++index < length) {
- array[offset + index] = values[index];
- }
- return array;
- }
- function arrayReduce(array, iteratee, accumulator, initAccum) {
- var index = -1, length = array == null ? 0 : array.length;
- if (initAccum && length) {
- accumulator = array[++index];
- }
- while (++index < length) {
- accumulator = iteratee(accumulator, array[index], index, array);
- }
- return accumulator;
- }
- function arrayReduceRight(array, iteratee, accumulator, initAccum) {
- var length = array == null ? 0 : array.length;
- if (initAccum && length) {
- accumulator = array[--length];
- }
- while (length--) {
- accumulator = iteratee(accumulator, array[length], length, array);
- }
- return accumulator;
- }
- function arraySome(array, predicate) {
- var index = -1, length = array == null ? 0 : array.length;
- while (++index < length) {
- if (predicate(array[index], index, array)) {
- return true;
- }
- }
- return false;
- }
- var asciiSize = baseProperty("length");
- function asciiToArray(string) {
- return string.split("");
- }
- function asciiWords(string) {
- return string.match(reAsciiWord) || [];
- }
- function baseFindKey(collection, predicate, eachFunc) {
- var result;
- eachFunc(collection, function(value, key, collection2) {
- if (predicate(value, key, collection2)) {
- result = key;
- return false;
- }
- });
- return result;
- }
- function baseFindIndex(array, predicate, fromIndex, fromRight) {
- var length = array.length, index = fromIndex + (fromRight ? 1 : -1);
- while (fromRight ? index-- : ++index < length) {
- if (predicate(array[index], index, array)) {
- return index;
- }
- }
- return -1;
- }
- function baseIndexOf(array, value, fromIndex) {
- return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex);
- }
- function baseIndexOfWith(array, value, fromIndex, comparator) {
- var index = fromIndex - 1, length = array.length;
- while (++index < length) {
- if (comparator(array[index], value)) {
- return index;
- }
- }
- return -1;
- }
- function baseIsNaN(value) {
- return value !== value;
- }
- function baseMean(array, iteratee) {
- var length = array == null ? 0 : array.length;
- return length ? baseSum(array, iteratee) / length : NAN;
- }
- function baseProperty(key) {
- return function(object) {
- return object == null ? undefined$1 : object[key];
- };
- }
- function basePropertyOf(object) {
- return function(key) {
- return object == null ? undefined$1 : object[key];
- };
- }
- function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
- eachFunc(collection, function(value, index, collection2) {
- accumulator = initAccum ? (initAccum = false, value) : iteratee(accumulator, value, index, collection2);
- });
- return accumulator;
- }
- function baseSortBy(array, comparer) {
- var length = array.length;
- array.sort(comparer);
- while (length--) {
- array[length] = array[length].value;
- }
- return array;
- }
- function baseSum(array, iteratee) {
- var result, index = -1, length = array.length;
- while (++index < length) {
- var current = iteratee(array[index]);
- if (current !== undefined$1) {
- result = result === undefined$1 ? current : result + current;
- }
- }
- return result;
- }
- function baseTimes(n, iteratee) {
- var index = -1, result = Array(n);
- while (++index < n) {
- result[index] = iteratee(index);
- }
- return result;
- }
- function baseToPairs(object, props) {
- return arrayMap(props, function(key) {
- return [key, object[key]];
- });
- }
- function baseTrim(string) {
- return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
- }
- function baseUnary(func) {
- return function(value) {
- return func(value);
- };
- }
- function baseValues(object, props) {
- return arrayMap(props, function(key) {
- return object[key];
- });
- }
- function cacheHas(cache, key) {
- return cache.has(key);
- }
- function charsStartIndex(strSymbols, chrSymbols) {
- var index = -1, length = strSymbols.length;
- while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {
- }
- return index;
- }
- function charsEndIndex(strSymbols, chrSymbols) {
- var index = strSymbols.length;
- while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {
- }
- return index;
- }
- function countHolders(array, placeholder) {
- var length = array.length, result = 0;
- while (length--) {
- if (array[length] === placeholder) {
- ++result;
- }
- }
- return result;
- }
- var deburrLetter = basePropertyOf(deburredLetters);
- var escapeHtmlChar = basePropertyOf(htmlEscapes);
- function escapeStringChar(chr) {
- return "\\" + stringEscapes[chr];
- }
- function getValue(object, key) {
- return object == null ? undefined$1 : object[key];
- }
- function hasUnicode(string) {
- return reHasUnicode.test(string);
- }
- function hasUnicodeWord(string) {
- return reHasUnicodeWord.test(string);
- }
- function iteratorToArray(iterator) {
- var data, result = [];
- while (!(data = iterator.next()).done) {
- result.push(data.value);
- }
- return result;
- }
- function mapToArray(map) {
- var index = -1, result = Array(map.size);
- map.forEach(function(value, key) {
- result[++index] = [key, value];
- });
- return result;
- }
- function overArg(func, transform) {
- return function(arg) {
- return func(transform(arg));
- };
- }
- function replaceHolders(array, placeholder) {
- var index = -1, length = array.length, resIndex = 0, result = [];
- while (++index < length) {
- var value = array[index];
- if (value === placeholder || value === PLACEHOLDER) {
- array[index] = PLACEHOLDER;
- result[resIndex++] = index;
- }
- }
- return result;
- }
- function setToArray(set) {
- var index = -1, result = Array(set.size);
- set.forEach(function(value) {
- result[++index] = value;
- });
- return result;
- }
- function setToPairs(set) {
- var index = -1, result = Array(set.size);
- set.forEach(function(value) {
- result[++index] = [value, value];
- });
- return result;
- }
- function strictIndexOf(array, value, fromIndex) {
- var index = fromIndex - 1, length = array.length;
- while (++index < length) {
- if (array[index] === value) {
- return index;
- }
- }
- return -1;
- }
- function strictLastIndexOf(array, value, fromIndex) {
- var index = fromIndex + 1;
- while (index--) {
- if (array[index] === value) {
- return index;
- }
- }
- return index;
- }
- function stringSize(string) {
- return hasUnicode(string) ? unicodeSize(string) : asciiSize(string);
- }
- function stringToArray(string) {
- return hasUnicode(string) ? unicodeToArray(string) : asciiToArray(string);
- }
- function trimmedEndIndex(string) {
- var index = string.length;
- while (index-- && reWhitespace.test(string.charAt(index))) {
- }
- return index;
- }
- var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
- function unicodeSize(string) {
- var result = reUnicode.lastIndex = 0;
- while (reUnicode.test(string)) {
- ++result;
- }
- return result;
- }
- function unicodeToArray(string) {
- return string.match(reUnicode) || [];
- }
- function unicodeWords(string) {
- return string.match(reUnicodeWord) || [];
- }
- var runInContext = function runInContext2(context) {
- context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
- 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;
- var arrayProto = Array2.prototype, funcProto = Function2.prototype, objectProto = Object2.prototype;
- var coreJsData = context["__core-js_shared__"];
- var funcToString = funcProto.toString;
- var hasOwnProperty = objectProto.hasOwnProperty;
- var idCounter = 0;
- var maskSrcKey = function() {
- var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
- return uid ? "Symbol(src)_1." + uid : "";
- }();
- var nativeObjectToString = objectProto.toString;
- var objectCtorString = funcToString.call(Object2);
- var oldDash = root._;
- var reIsNative = RegExp2(
- "^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
- );
- 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;
- var defineProperty = function() {
- try {
- var func = getNative(Object2, "defineProperty");
- func({}, "", {});
- return func;
- } catch (e) {
- }
- }();
- var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, ctxNow = Date2 && Date2.now !== root.Date.now && Date2.now, ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
- 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;
- 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");
- var metaMap = WeakMap && new WeakMap();
- var realNames = {};
- var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set), weakMapCtorString = toSource(WeakMap);
- var symbolProto = Symbol2 ? Symbol2.prototype : undefined$1, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined$1, symbolToString = symbolProto ? symbolProto.toString : undefined$1;
- function lodash2(value) {
- if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
- if (value instanceof LodashWrapper) {
- return value;
- }
- if (hasOwnProperty.call(value, "__wrapped__")) {
- return wrapperClone(value);
- }
- }
- return new LodashWrapper(value);
- }
- var baseCreate = function() {
- function object() {
- }
- return function(proto) {
- if (!isObject(proto)) {
- return {};
- }
- if (objectCreate) {
- return objectCreate(proto);
- }
- object.prototype = proto;
- var result2 = new object();
- object.prototype = undefined$1;
- return result2;
- };
- }();
- function baseLodash() {
- }
- function LodashWrapper(value, chainAll) {
- this.__wrapped__ = value;
- this.__actions__ = [];
- this.__chain__ = !!chainAll;
- this.__index__ = 0;
- this.__values__ = undefined$1;
- }
- lodash2.templateSettings = {
- /**
- * Used to detect `data` property values to be HTML-escaped.
- *
- * @memberOf _.templateSettings
- * @type {RegExp}
- */
- "escape": reEscape,
- /**
- * Used to detect code to be evaluated.
- *
- * @memberOf _.templateSettings
- * @type {RegExp}
- */
- "evaluate": reEvaluate,
- /**
- * Used to detect `data` property values to inject.
- *
- * @memberOf _.templateSettings
- * @type {RegExp}
- */
- "interpolate": reInterpolate,
- /**
- * Used to reference the data object in the template text.
- *
- * @memberOf _.templateSettings
- * @type {string}
- */
- "variable": "",
- /**
- * Used to import variables into the compiled template.
- *
- * @memberOf _.templateSettings
- * @type {Object}
- */
- "imports": {
- /**
- * A reference to the `lodash` function.
- *
- * @memberOf _.templateSettings.imports
- * @type {Function}
- */
- "_": lodash2
- }
- };
- lodash2.prototype = baseLodash.prototype;
- lodash2.prototype.constructor = lodash2;
- LodashWrapper.prototype = baseCreate(baseLodash.prototype);
- LodashWrapper.prototype.constructor = LodashWrapper;
- function LazyWrapper(value) {
- this.__wrapped__ = value;
- this.__actions__ = [];
- this.__dir__ = 1;
- this.__filtered__ = false;
- this.__iteratees__ = [];
- this.__takeCount__ = MAX_ARRAY_LENGTH;
- this.__views__ = [];
- }
- function lazyClone() {
- var result2 = new LazyWrapper(this.__wrapped__);
- result2.__actions__ = copyArray(this.__actions__);
- result2.__dir__ = this.__dir__;
- result2.__filtered__ = this.__filtered__;
- result2.__iteratees__ = copyArray(this.__iteratees__);
- result2.__takeCount__ = this.__takeCount__;
- result2.__views__ = copyArray(this.__views__);
- return result2;
- }
- function lazyReverse() {
- if (this.__filtered__) {
- var result2 = new LazyWrapper(this);
- result2.__dir__ = -1;
- result2.__filtered__ = true;
- } else {
- result2 = this.clone();
- result2.__dir__ *= -1;
- }
- return result2;
- }
- function lazyValue() {
- var array = this.__wrapped__.value(), dir = this.__dir__, isArr = isArray(array), isRight = dir < 0, arrLength = isArr ? array.length : 0, view = getView(0, arrLength, this.__views__), start = view.start, end = view.end, length = end - start, index = isRight ? end : start - 1, iteratees = this.__iteratees__, iterLength = iteratees.length, resIndex = 0, takeCount = nativeMin(length, this.__takeCount__);
- if (!isArr || !isRight && arrLength == length && takeCount == length) {
- return baseWrapperValue(array, this.__actions__);
- }
- var result2 = [];
- outer:
- while (length-- && resIndex < takeCount) {
- index += dir;
- var iterIndex = -1, value = array[index];
- while (++iterIndex < iterLength) {
- var data = iteratees[iterIndex], iteratee2 = data.iteratee, type = data.type, computed = iteratee2(value);
- if (type == LAZY_MAP_FLAG) {
- value = computed;
- } else if (!computed) {
- if (type == LAZY_FILTER_FLAG) {
- continue outer;
- } else {
- break outer;
- }
- }
- }
- result2[resIndex++] = value;
- }
- return result2;
- }
- LazyWrapper.prototype = baseCreate(baseLodash.prototype);
- LazyWrapper.prototype.constructor = LazyWrapper;
- function Hash(entries) {
- var index = -1, length = entries == null ? 0 : entries.length;
- this.clear();
- while (++index < length) {
- var entry = entries[index];
- this.set(entry[0], entry[1]);
- }
- }
- function hashClear() {
- this.__data__ = nativeCreate ? nativeCreate(null) : {};
- this.size = 0;
- }
- function hashDelete(key) {
- var result2 = this.has(key) && delete this.__data__[key];
- this.size -= result2 ? 1 : 0;
- return result2;
- }
- function hashGet(key) {
- var data = this.__data__;
- if (nativeCreate) {
- var result2 = data[key];
- return result2 === HASH_UNDEFINED ? undefined$1 : result2;
- }
- return hasOwnProperty.call(data, key) ? data[key] : undefined$1;
- }
- function hashHas(key) {
- var data = this.__data__;
- return nativeCreate ? data[key] !== undefined$1 : hasOwnProperty.call(data, key);
- }
- function hashSet(key, value) {
- var data = this.__data__;
- this.size += this.has(key) ? 0 : 1;
- data[key] = nativeCreate && value === undefined$1 ? HASH_UNDEFINED : value;
- return this;
- }
- Hash.prototype.clear = hashClear;
- Hash.prototype["delete"] = hashDelete;
- Hash.prototype.get = hashGet;
- Hash.prototype.has = hashHas;
- Hash.prototype.set = hashSet;
- function ListCache(entries) {
- var index = -1, length = entries == null ? 0 : entries.length;
- this.clear();
- while (++index < length) {
- var entry = entries[index];
- this.set(entry[0], entry[1]);
- }
- }
- function listCacheClear() {
- this.__data__ = [];
- this.size = 0;
- }
- function listCacheDelete(key) {
- var data = this.__data__, index = assocIndexOf(data, key);
- if (index < 0) {
- return false;
- }
- var lastIndex = data.length - 1;
- if (index == lastIndex) {
- data.pop();
- } else {
- splice.call(data, index, 1);
- }
- --this.size;
- return true;
- }
- function listCacheGet(key) {
- var data = this.__data__, index = assocIndexOf(data, key);
- return index < 0 ? undefined$1 : data[index][1];
- }
- function listCacheHas(key) {
- return assocIndexOf(this.__data__, key) > -1;
- }
- function listCacheSet(key, value) {
- var data = this.__data__, index = assocIndexOf(data, key);
- if (index < 0) {
- ++this.size;
- data.push([key, value]);
- } else {
- data[index][1] = value;
- }
- return this;
- }
- ListCache.prototype.clear = listCacheClear;
- ListCache.prototype["delete"] = listCacheDelete;
- ListCache.prototype.get = listCacheGet;
- ListCache.prototype.has = listCacheHas;
- ListCache.prototype.set = listCacheSet;
- function MapCache(entries) {
- var index = -1, length = entries == null ? 0 : entries.length;
- this.clear();
- while (++index < length) {
- var entry = entries[index];
- this.set(entry[0], entry[1]);
- }
- }
- function mapCacheClear() {
- this.size = 0;
- this.__data__ = {
- "hash": new Hash(),
- "map": new (Map || ListCache)(),
- "string": new Hash()
- };
- }
- function mapCacheDelete(key) {
- var result2 = getMapData(this, key)["delete"](key);
- this.size -= result2 ? 1 : 0;
- return result2;
- }
- function mapCacheGet(key) {
- return getMapData(this, key).get(key);
- }
- function mapCacheHas(key) {
- return getMapData(this, key).has(key);
- }
- function mapCacheSet(key, value) {
- var data = getMapData(this, key), size2 = data.size;
- data.set(key, value);
- this.size += data.size == size2 ? 0 : 1;
- return this;
- }
- MapCache.prototype.clear = mapCacheClear;
- MapCache.prototype["delete"] = mapCacheDelete;
- MapCache.prototype.get = mapCacheGet;
- MapCache.prototype.has = mapCacheHas;
- MapCache.prototype.set = mapCacheSet;
- function SetCache(values2) {
- var index = -1, length = values2 == null ? 0 : values2.length;
- this.__data__ = new MapCache();
- while (++index < length) {
- this.add(values2[index]);
- }
- }
- function setCacheAdd(value) {
- this.__data__.set(value, HASH_UNDEFINED);
- return this;
- }
- function setCacheHas(value) {
- return this.__data__.has(value);
- }
- SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
- SetCache.prototype.has = setCacheHas;
- function Stack(entries) {
- var data = this.__data__ = new ListCache(entries);
- this.size = data.size;
- }
- function stackClear() {
- this.__data__ = new ListCache();
- this.size = 0;
- }
- function stackDelete(key) {
- var data = this.__data__, result2 = data["delete"](key);
- this.size = data.size;
- return result2;
- }
- function stackGet(key) {
- return this.__data__.get(key);
- }
- function stackHas(key) {
- return this.__data__.has(key);
- }
- function stackSet(key, value) {
- var data = this.__data__;
- if (data instanceof ListCache) {
- var pairs = data.__data__;
- if (!Map || pairs.length < LARGE_ARRAY_SIZE - 1) {
- pairs.push([key, value]);
- this.size = ++data.size;
- return this;
- }
- data = this.__data__ = new MapCache(pairs);
- }
- data.set(key, value);
- this.size = data.size;
- return this;
- }
- Stack.prototype.clear = stackClear;
- Stack.prototype["delete"] = stackDelete;
- Stack.prototype.get = stackGet;
- Stack.prototype.has = stackHas;
- Stack.prototype.set = stackSet;
- function arrayLikeKeys(value, inherited) {
- var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result2 = skipIndexes ? baseTimes(value.length, String2) : [], length = result2.length;
- for (var key in value) {
- if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
- (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
- isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
- isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
- isIndex(key, length)))) {
- result2.push(key);
- }
- }
- return result2;
- }
- function arraySample(array) {
- var length = array.length;
- return length ? array[baseRandom(0, length - 1)] : undefined$1;
- }
- function arraySampleSize(array, n) {
- return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
- }
- function arrayShuffle(array) {
- return shuffleSelf(copyArray(array));
- }
- function assignMergeValue(object, key, value) {
- if (value !== undefined$1 && !eq(object[key], value) || value === undefined$1 && !(key in object)) {
- baseAssignValue(object, key, value);
- }
- }
- function assignValue(object, key, value) {
- var objValue = object[key];
- if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === undefined$1 && !(key in object)) {
- baseAssignValue(object, key, value);
- }
- }
- function assocIndexOf(array, key) {
- var length = array.length;
- while (length--) {
- if (eq(array[length][0], key)) {
- return length;
- }
- }
- return -1;
- }
- function baseAggregator(collection, setter, iteratee2, accumulator) {
- baseEach(collection, function(value, key, collection2) {
- setter(accumulator, value, iteratee2(value), collection2);
- });
- return accumulator;
- }
- function baseAssign(object, source) {
- return object && copyObject(source, keys(source), object);
- }
- function baseAssignIn(object, source) {
- return object && copyObject(source, keysIn(source), object);
- }
- function baseAssignValue(object, key, value) {
- if (key == "__proto__" && defineProperty) {
- defineProperty(object, key, {
- "configurable": true,
- "enumerable": true,
- "value": value,
- "writable": true
- });
- } else {
- object[key] = value;
- }
- }
- function baseAt(object, paths) {
- var index = -1, length = paths.length, result2 = Array2(length), skip = object == null;
- while (++index < length) {
- result2[index] = skip ? undefined$1 : get(object, paths[index]);
- }
- return result2;
- }
- function baseClamp(number, lower, upper) {
- if (number === number) {
- if (upper !== undefined$1) {
- number = number <= upper ? number : upper;
- }
- if (lower !== undefined$1) {
- number = number >= lower ? number : lower;
- }
- }
- return number;
- }
- function baseClone(value, bitmask, customizer, key, object, stack) {
- var result2, isDeep = bitmask & CLONE_DEEP_FLAG, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG;
- if (customizer) {
- result2 = object ? customizer(value, key, object, stack) : customizer(value);
- }
- if (result2 !== undefined$1) {
- return result2;
- }
- if (!isObject(value)) {
- return value;
- }
- var isArr = isArray(value);
- if (isArr) {
- result2 = initCloneArray(value);
- if (!isDeep) {
- return copyArray(value, result2);
- }
- } else {
- var tag = getTag(value), isFunc = tag == funcTag || tag == genTag;
- if (isBuffer(value)) {
- return cloneBuffer(value, isDeep);
- }
- if (tag == objectTag || tag == argsTag || isFunc && !object) {
- result2 = isFlat || isFunc ? {} : initCloneObject(value);
- if (!isDeep) {
- return isFlat ? copySymbolsIn(value, baseAssignIn(result2, value)) : copySymbols(value, baseAssign(result2, value));
- }
- } else {
- if (!cloneableTags[tag]) {
- return object ? value : {};
- }
- result2 = initCloneByTag(value, tag, isDeep);
- }
- }
- stack || (stack = new Stack());
- var stacked = stack.get(value);
- if (stacked) {
- return stacked;
- }
- stack.set(value, result2);
- if (isSet(value)) {
- value.forEach(function(subValue) {
- result2.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
- });
- } else if (isMap(value)) {
- value.forEach(function(subValue, key2) {
- result2.set(key2, baseClone(subValue, bitmask, customizer, key2, value, stack));
- });
- }
- var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys;
- var props = isArr ? undefined$1 : keysFunc(value);
- arrayEach(props || value, function(subValue, key2) {
- if (props) {
- key2 = subValue;
- subValue = value[key2];
- }
- assignValue(result2, key2, baseClone(subValue, bitmask, customizer, key2, value, stack));
- });
- return result2;
- }
- function baseConforms(source) {
- var props = keys(source);
- return function(object) {
- return baseConformsTo(object, source, props);
- };
- }
- function baseConformsTo(object, source, props) {
- var length = props.length;
- if (object == null) {
- return !length;
- }
- object = Object2(object);
- while (length--) {
- var key = props[length], predicate = source[key], value = object[key];
- if (value === undefined$1 && !(key in object) || !predicate(value)) {
- return false;
- }
- }
- return true;
- }
- function baseDelay(func, wait, args) {
- if (typeof func != "function") {
- throw new TypeError2(FUNC_ERROR_TEXT);
- }
- return setTimeout(function() {
- func.apply(undefined$1, args);
- }, wait);
- }
- function baseDifference(array, values2, iteratee2, comparator) {
- var index = -1, includes2 = arrayIncludes, isCommon = true, length = array.length, result2 = [], valuesLength = values2.length;
- if (!length) {
- return result2;
- }
- if (iteratee2) {
- values2 = arrayMap(values2, baseUnary(iteratee2));
- }
- if (comparator) {
- includes2 = arrayIncludesWith;
- isCommon = false;
- } else if (values2.length >= LARGE_ARRAY_SIZE) {
- includes2 = cacheHas;
- isCommon = false;
- values2 = new SetCache(values2);
- }
- outer:
- while (++index < length) {
- var value = array[index], computed = iteratee2 == null ? value : iteratee2(value);
- value = comparator || value !== 0 ? value : 0;
- if (isCommon && computed === computed) {
- var valuesIndex = valuesLength;
- while (valuesIndex--) {
- if (values2[valuesIndex] === computed) {
- continue outer;
- }
- }
- result2.push(value);
- } else if (!includes2(values2, computed, comparator)) {
- result2.push(value);
- }
- }
- return result2;
- }
- var baseEach = createBaseEach(baseForOwn);
- var baseEachRight = createBaseEach(baseForOwnRight, true);
- function baseEvery(collection, predicate) {
- var result2 = true;
- baseEach(collection, function(value, index, collection2) {
- result2 = !!predicate(value, index, collection2);
- return result2;
- });
- return result2;
- }
- function baseExtremum(array, iteratee2, comparator) {
- var index = -1, length = array.length;
- while (++index < length) {
- var value = array[index], current = iteratee2(value);
- if (current != null && (computed === undefined$1 ? current === current && !isSymbol(current) : comparator(current, computed))) {
- var computed = current, result2 = value;
- }
- }
- return result2;
- }
- function baseFill(array, value, start, end) {
- var length = array.length;
- start = toInteger(start);
- if (start < 0) {
- start = -start > length ? 0 : length + start;
- }
- end = end === undefined$1 || end > length ? length : toInteger(end);
- if (end < 0) {
- end += length;
- }
- end = start > end ? 0 : toLength(end);
- while (start < end) {
- array[start++] = value;
- }
- return array;
- }
- function baseFilter(collection, predicate) {
- var result2 = [];
- baseEach(collection, function(value, index, collection2) {
- if (predicate(value, index, collection2)) {
- result2.push(value);
- }
- });
- return result2;
- }
- function baseFlatten(array, depth, predicate, isStrict, result2) {
- var index = -1, length = array.length;
- predicate || (predicate = isFlattenable);
- result2 || (result2 = []);
- while (++index < length) {
- var value = array[index];
- if (depth > 0 && predicate(value)) {
- if (depth > 1) {
- baseFlatten(value, depth - 1, predicate, isStrict, result2);
- } else {
- arrayPush(result2, value);
- }
- } else if (!isStrict) {
- result2[result2.length] = value;
- }
- }
- return result2;
- }
- var baseFor = createBaseFor();
- var baseForRight = createBaseFor(true);
- function baseForOwn(object, iteratee2) {
- return object && baseFor(object, iteratee2, keys);
- }
- function baseForOwnRight(object, iteratee2) {
- return object && baseForRight(object, iteratee2, keys);
- }
- function baseFunctions(object, props) {
- return arrayFilter(props, function(key) {
- return isFunction(object[key]);
- });
- }
- function baseGet(object, path) {
- path = castPath(path, object);
- var index = 0, length = path.length;
- while (object != null && index < length) {
- object = object[toKey(path[index++])];
- }
- return index && index == length ? object : undefined$1;
- }
- function baseGetAllKeys(object, keysFunc, symbolsFunc) {
- var result2 = keysFunc(object);
- return isArray(object) ? result2 : arrayPush(result2, symbolsFunc(object));
- }
- function baseGetTag(value) {
- if (value == null) {
- return value === undefined$1 ? undefinedTag : nullTag;
- }
- return symToStringTag && symToStringTag in Object2(value) ? getRawTag(value) : objectToString(value);
- }
- function baseGt(value, other) {
- return value > other;
- }
- function baseHas(object, key) {
- return object != null && hasOwnProperty.call(object, key);
- }
- function baseHasIn(object, key) {
- return object != null && key in Object2(object);
- }
- function baseInRange(number, start, end) {
- return number >= nativeMin(start, end) && number < nativeMax(start, end);
- }
- function baseIntersection(arrays, iteratee2, comparator) {
- var includes2 = comparator ? arrayIncludesWith : arrayIncludes, length = arrays[0].length, othLength = arrays.length, othIndex = othLength, caches = Array2(othLength), maxLength = Infinity, result2 = [];
- while (othIndex--) {
- var array = arrays[othIndex];
- if (othIndex && iteratee2) {
- array = arrayMap(array, baseUnary(iteratee2));
- }
- maxLength = nativeMin(array.length, maxLength);
- caches[othIndex] = !comparator && (iteratee2 || length >= 120 && array.length >= 120) ? new SetCache(othIndex && array) : undefined$1;
- }
- array = arrays[0];
- var index = -1, seen = caches[0];
- outer:
- while (++index < length && result2.length < maxLength) {
- var value = array[index], computed = iteratee2 ? iteratee2(value) : value;
- value = comparator || value !== 0 ? value : 0;
- if (!(seen ? cacheHas(seen, computed) : includes2(result2, computed, comparator))) {
- othIndex = othLength;
- while (--othIndex) {
- var cache = caches[othIndex];
- if (!(cache ? cacheHas(cache, computed) : includes2(arrays[othIndex], computed, comparator))) {
- continue outer;
- }
- }
- if (seen) {
- seen.push(computed);
- }
- result2.push(value);
- }
- }
- return result2;
- }
- function baseInverter(object, setter, iteratee2, accumulator) {
- baseForOwn(object, function(value, key, object2) {
- setter(accumulator, iteratee2(value), key, object2);
- });
- return accumulator;
- }
- function baseInvoke(object, path, args) {
- path = castPath(path, object);
- object = parent(object, path);
- var func = object == null ? object : object[toKey(last(path))];
- return func == null ? undefined$1 : apply(func, object, args);
- }
- function baseIsArguments(value) {
- return isObjectLike(value) && baseGetTag(value) == argsTag;
- }
- function baseIsArrayBuffer(value) {
- return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
- }
- function baseIsDate(value) {
- return isObjectLike(value) && baseGetTag(value) == dateTag;
- }
- function baseIsEqual(value, other, bitmask, customizer, stack) {
- if (value === other) {
- return true;
- }
- if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
- return value !== value && other !== other;
- }
- return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
- }
- function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
- var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other);
- objTag = objTag == argsTag ? objectTag : objTag;
- othTag = othTag == argsTag ? objectTag : othTag;
- var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
- if (isSameTag && isBuffer(object)) {
- if (!isBuffer(other)) {
- return false;
- }
- objIsArr = true;
- objIsObj = false;
- }
- if (isSameTag && !objIsObj) {
- stack || (stack = new Stack());
- return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
- }
- if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
- var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
- if (objIsWrapped || othIsWrapped) {
- var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
- stack || (stack = new Stack());
- return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
- }
- }
- if (!isSameTag) {
- return false;
- }
- stack || (stack = new Stack());
- return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
- }
- function baseIsMap(value) {
- return isObjectLike(value) && getTag(value) == mapTag;
- }
- function baseIsMatch(object, source, matchData, customizer) {
- var index = matchData.length, length = index, noCustomizer = !customizer;
- if (object == null) {
- return !length;
- }
- object = Object2(object);
- while (index--) {
- var data = matchData[index];
- if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
- return false;
- }
- }
- while (++index < length) {
- data = matchData[index];
- var key = data[0], objValue = object[key], srcValue = data[1];
- if (noCustomizer && data[2]) {
- if (objValue === undefined$1 && !(key in object)) {
- return false;
- }
- } else {
- var stack = new Stack();
- if (customizer) {
- var result2 = customizer(objValue, srcValue, key, object, source, stack);
- }
- if (!(result2 === undefined$1 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) : result2)) {
- return false;
- }
- }
- }
- return true;
- }
- function baseIsNative(value) {
- if (!isObject(value) || isMasked(value)) {
- return false;
- }
- var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
- return pattern.test(toSource(value));
- }
- function baseIsRegExp(value) {
- return isObjectLike(value) && baseGetTag(value) == regexpTag;
- }
- function baseIsSet(value) {
- return isObjectLike(value) && getTag(value) == setTag;
- }
- function baseIsTypedArray(value) {
- return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
- }
- function baseIteratee(value) {
- if (typeof value == "function") {
- return value;
- }
- if (value == null) {
- return identity;
- }
- if (typeof value == "object") {
- return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
- }
- return property(value);
- }
- function baseKeys(object) {
- if (!isPrototype(object)) {
- return nativeKeys(object);
- }
- var result2 = [];
- for (var key in Object2(object)) {
- if (hasOwnProperty.call(object, key) && key != "constructor") {
- result2.push(key);
- }
- }
- return result2;
- }
- function baseKeysIn(object) {
- if (!isObject(object)) {
- return nativeKeysIn(object);
- }
- var isProto = isPrototype(object), result2 = [];
- for (var key in object) {
- if (!(key == "constructor" && (isProto || !hasOwnProperty.call(object, key)))) {
- result2.push(key);
- }
- }
- return result2;
- }
- function baseLt(value, other) {
- return value < other;
- }
- function baseMap(collection, iteratee2) {
- var index = -1, result2 = isArrayLike(collection) ? Array2(collection.length) : [];
- baseEach(collection, function(value, key, collection2) {
- result2[++index] = iteratee2(value, key, collection2);
- });
- return result2;
- }
- function baseMatches(source) {
- var matchData = getMatchData(source);
- if (matchData.length == 1 && matchData[0][2]) {
- return matchesStrictComparable(matchData[0][0], matchData[0][1]);
- }
- return function(object) {
- return object === source || baseIsMatch(object, source, matchData);
- };
- }
- function baseMatchesProperty(path, srcValue) {
- if (isKey(path) && isStrictComparable(srcValue)) {
- return matchesStrictComparable(toKey(path), srcValue);
- }
- return function(object) {
- var objValue = get(object, path);
- return objValue === undefined$1 && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
- };
- }
- function baseMerge(object, source, srcIndex, customizer, stack) {
- if (object === source) {
- return;
- }
- baseFor(source, function(srcValue, key) {
- stack || (stack = new Stack());
- if (isObject(srcValue)) {
- baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
- } else {
- var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + "", object, source, stack) : undefined$1;
- if (newValue === undefined$1) {
- newValue = srcValue;
- }
- assignMergeValue(object, key, newValue);
- }
- }, keysIn);
- }
- function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
- var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack.get(srcValue);
- if (stacked) {
- assignMergeValue(object, key, stacked);
- return;
- }
- var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack) : undefined$1;
- var isCommon = newValue === undefined$1;
- if (isCommon) {
- var isArr = isArray(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue);
- newValue = srcValue;
- if (isArr || isBuff || isTyped) {
- if (isArray(objValue)) {
- newValue = objValue;
- } else if (isArrayLikeObject(objValue)) {
- newValue = copyArray(objValue);
- } else if (isBuff) {
- isCommon = false;
- newValue = cloneBuffer(srcValue, true);
- } else if (isTyped) {
- isCommon = false;
- newValue = cloneTypedArray(srcValue, true);
- } else {
- newValue = [];
- }
- } else if (isPlainObject(srcValue) || isArguments(srcValue)) {
- newValue = objValue;
- if (isArguments(objValue)) {
- newValue = toPlainObject(objValue);
- } else if (!isObject(objValue) || isFunction(objValue)) {
- newValue = initCloneObject(srcValue);
- }
- } else {
- isCommon = false;
- }
- }
- if (isCommon) {
- stack.set(srcValue, newValue);
- mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
- stack["delete"](srcValue);
- }
- assignMergeValue(object, key, newValue);
- }
- function baseNth(array, n) {
- var length = array.length;
- if (!length) {
- return;
- }
- n += n < 0 ? length : 0;
- return isIndex(n, length) ? array[n] : undefined$1;
- }
- function baseOrderBy(collection, iteratees, orders) {
- if (iteratees.length) {
- iteratees = arrayMap(iteratees, function(iteratee2) {
- if (isArray(iteratee2)) {
- return function(value) {
- return baseGet(value, iteratee2.length === 1 ? iteratee2[0] : iteratee2);
- };
- }
- return iteratee2;
- });
- } else {
- iteratees = [identity];
- }
- var index = -1;
- iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
- var result2 = baseMap(collection, function(value, key, collection2) {
- var criteria = arrayMap(iteratees, function(iteratee2) {
- return iteratee2(value);
- });
- return { "criteria": criteria, "index": ++index, "value": value };
- });
- return baseSortBy(result2, function(object, other) {
- return compareMultiple(object, other, orders);
- });
- }
- function basePick(object, paths) {
- return basePickBy(object, paths, function(value, path) {
- return hasIn(object, path);
- });
- }
- function basePickBy(object, paths, predicate) {
- var index = -1, length = paths.length, result2 = {};
- while (++index < length) {
- var path = paths[index], value = baseGet(object, path);
- if (predicate(value, path)) {
- baseSet(result2, castPath(path, object), value);
- }
- }
- return result2;
- }
- function basePropertyDeep(path) {
- return function(object) {
- return baseGet(object, path);
- };
- }
- function basePullAll(array, values2, iteratee2, comparator) {
- var indexOf2 = comparator ? baseIndexOfWith : baseIndexOf, index = -1, length = values2.length, seen = array;
- if (array === values2) {
- values2 = copyArray(values2);
- }
- if (iteratee2) {
- seen = arrayMap(array, baseUnary(iteratee2));
- }
- while (++index < length) {
- var fromIndex = 0, value = values2[index], computed = iteratee2 ? iteratee2(value) : value;
- while ((fromIndex = indexOf2(seen, computed, fromIndex, comparator)) > -1) {
- if (seen !== array) {
- splice.call(seen, fromIndex, 1);
- }
- splice.call(array, fromIndex, 1);
- }
- }
- return array;
- }
- function basePullAt(array, indexes) {
- var length = array ? indexes.length : 0, lastIndex = length - 1;
- while (length--) {
- var index = indexes[length];
- if (length == lastIndex || index !== previous) {
- var previous = index;
- if (isIndex(index)) {
- splice.call(array, index, 1);
- } else {
- baseUnset(array, index);
- }
- }
- }
- return array;
- }
- function baseRandom(lower, upper) {
- return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
- }
- function baseRange(start, end, step, fromRight) {
- var index = -1, length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), result2 = Array2(length);
- while (length--) {
- result2[fromRight ? length : ++index] = start;
- start += step;
- }
- return result2;
- }
- function baseRepeat(string, n) {
- var result2 = "";
- if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
- return result2;
- }
- do {
- if (n % 2) {
- result2 += string;
- }
- n = nativeFloor(n / 2);
- if (n) {
- string += string;
- }
- } while (n);
- return result2;
- }
- function baseRest(func, start) {
- return setToString(overRest(func, start, identity), func + "");
- }
- function baseSample(collection) {
- return arraySample(values(collection));
- }
- function baseSampleSize(collection, n) {
- var array = values(collection);
- return shuffleSelf(array, baseClamp(n, 0, array.length));
- }
- function baseSet(object, path, value, customizer) {
- if (!isObject(object)) {
- return object;
- }
- path = castPath(path, object);
- var index = -1, length = path.length, lastIndex = length - 1, nested = object;
- while (nested != null && ++index < length) {
- var key = toKey(path[index]), newValue = value;
- if (key === "__proto__" || key === "constructor" || key === "prototype") {
- return object;
- }
- if (index != lastIndex) {
- var objValue = nested[key];
- newValue = customizer ? customizer(objValue, key, nested) : undefined$1;
- if (newValue === undefined$1) {
- newValue = isObject(objValue) ? objValue : isIndex(path[index + 1]) ? [] : {};
- }
- }
- assignValue(nested, key, newValue);
- nested = nested[key];
- }
- return object;
- }
- var baseSetData = !metaMap ? identity : function(func, data) {
- metaMap.set(func, data);
- return func;
- };
- var baseSetToString = !defineProperty ? identity : function(func, string) {
- return defineProperty(func, "toString", {
- "configurable": true,
- "enumerable": false,
- "value": constant(string),
- "writable": true
- });
- };
- function baseShuffle(collection) {
- return shuffleSelf(values(collection));
- }
- function baseSlice(array, start, end) {
- var index = -1, length = array.length;
- if (start < 0) {
- start = -start > length ? 0 : length + start;
- }
- end = end > length ? length : end;
- if (end < 0) {
- end += length;
- }
- length = start > end ? 0 : end - start >>> 0;
- start >>>= 0;
- var result2 = Array2(length);
- while (++index < length) {
- result2[index] = array[index + start];
- }
- return result2;
- }
- function baseSome(collection, predicate) {
- var result2;
- baseEach(collection, function(value, index, collection2) {
- result2 = predicate(value, index, collection2);
- return !result2;
- });
- return !!result2;
- }
- function baseSortedIndex(array, value, retHighest) {
- var low = 0, high = array == null ? low : array.length;
- if (typeof value == "number" && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
- while (low < high) {
- var mid = low + high >>> 1, computed = array[mid];
- if (computed !== null && !isSymbol(computed) && (retHighest ? computed <= value : computed < value)) {
- low = mid + 1;
- } else {
- high = mid;
- }
- }
- return high;
- }
- return baseSortedIndexBy(array, value, identity, retHighest);
- }
- function baseSortedIndexBy(array, value, iteratee2, retHighest) {
- var low = 0, high = array == null ? 0 : array.length;
- if (high === 0) {
- return 0;
- }
- value = iteratee2(value);
- var valIsNaN = value !== value, valIsNull = value === null, valIsSymbol = isSymbol(value), valIsUndefined = value === undefined$1;
- while (low < high) {
- var mid = nativeFloor((low + high) / 2), computed = iteratee2(array[mid]), othIsDefined = computed !== undefined$1, othIsNull = computed === null, othIsReflexive = computed === computed, othIsSymbol = isSymbol(computed);
- if (valIsNaN) {
- var setLow = retHighest || othIsReflexive;
- } else if (valIsUndefined) {
- setLow = othIsReflexive && (retHighest || othIsDefined);
- } else if (valIsNull) {
- setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
- } else if (valIsSymbol) {
- setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
- } else if (othIsNull || othIsSymbol) {
- setLow = false;
- } else {
- setLow = retHighest ? computed <= value : computed < value;
- }
- if (setLow) {
- low = mid + 1;
- } else {
- high = mid;
- }
- }
- return nativeMin(high, MAX_ARRAY_INDEX);
- }
- function baseSortedUniq(array, iteratee2) {
- var index = -1, length = array.length, resIndex = 0, result2 = [];
- while (++index < length) {
- var value = array[index], computed = iteratee2 ? iteratee2(value) : value;
- if (!index || !eq(computed, seen)) {
- var seen = computed;
- result2[resIndex++] = value === 0 ? 0 : value;
- }
- }
- return result2;
- }
- function baseToNumber(value) {
- if (typeof value == "number") {
- return value;
- }
- if (isSymbol(value)) {
- return NAN;
- }
- return +value;
- }
- function baseToString(value) {
- if (typeof value == "string") {
- return value;
- }
- if (isArray(value)) {
- return arrayMap(value, baseToString) + "";
- }
- if (isSymbol(value)) {
- return symbolToString ? symbolToString.call(value) : "";
- }
- var result2 = value + "";
- return result2 == "0" && 1 / value == -INFINITY ? "-0" : result2;
- }
- function baseUniq(array, iteratee2, comparator) {
- var index = -1, includes2 = arrayIncludes, length = array.length, isCommon = true, result2 = [], seen = result2;
- if (comparator) {
- isCommon = false;
- includes2 = arrayIncludesWith;
- } else if (length >= LARGE_ARRAY_SIZE) {
- var set2 = iteratee2 ? null : createSet(array);
- if (set2) {
- return setToArray(set2);
- }
- isCommon = false;
- includes2 = cacheHas;
- seen = new SetCache();
- } else {
- seen = iteratee2 ? [] : result2;
- }
- outer:
- while (++index < length) {
- var value = array[index], computed = iteratee2 ? iteratee2(value) : value;
- value = comparator || value !== 0 ? value : 0;
- if (isCommon && computed === computed) {
- var seenIndex = seen.length;
- while (seenIndex--) {
- if (seen[seenIndex] === computed) {
- continue outer;
- }
- }
- if (iteratee2) {
- seen.push(computed);
- }
- result2.push(value);
- } else if (!includes2(seen, computed, comparator)) {
- if (seen !== result2) {
- seen.push(computed);
- }
- result2.push(value);
- }
- }
- return result2;
- }
- function baseUnset(object, path) {
- path = castPath(path, object);
- object = parent(object, path);
- return object == null || delete object[toKey(last(path))];
- }
- function baseUpdate(object, path, updater, customizer) {
- return baseSet(object, path, updater(baseGet(object, path)), customizer);
- }
- function baseWhile(array, predicate, isDrop, fromRight) {
- var length = array.length, index = fromRight ? length : -1;
- while ((fromRight ? index-- : ++index < length) && predicate(array[index], index, array)) {
- }
- return isDrop ? baseSlice(array, fromRight ? 0 : index, fromRight ? index + 1 : length) : baseSlice(array, fromRight ? index + 1 : 0, fromRight ? length : index);
- }
- function baseWrapperValue(value, actions) {
- var result2 = value;
- if (result2 instanceof LazyWrapper) {
- result2 = result2.value();
- }
- return arrayReduce(actions, function(result3, action) {
- return action.func.apply(action.thisArg, arrayPush([result3], action.args));
- }, result2);
- }
- function baseXor(arrays, iteratee2, comparator) {
- var length = arrays.length;
- if (length < 2) {
- return length ? baseUniq(arrays[0]) : [];
- }
- var index = -1, result2 = Array2(length);
- while (++index < length) {
- var array = arrays[index], othIndex = -1;
- while (++othIndex < length) {
- if (othIndex != index) {
- result2[index] = baseDifference(result2[index] || array, arrays[othIndex], iteratee2, comparator);
- }
- }
- }
- return baseUniq(baseFlatten(result2, 1), iteratee2, comparator);
- }
- function baseZipObject(props, values2, assignFunc) {
- var index = -1, length = props.length, valsLength = values2.length, result2 = {};
- while (++index < length) {
- var value = index < valsLength ? values2[index] : undefined$1;
- assignFunc(result2, props[index], value);
- }
- return result2;
- }
- function castArrayLikeObject(value) {
- return isArrayLikeObject(value) ? value : [];
- }
- function castFunction(value) {
- return typeof value == "function" ? value : identity;
- }
- function castPath(value, object) {
- if (isArray(value)) {
- return value;
- }
- return isKey(value, object) ? [value] : stringToPath(toString(value));
- }
- var castRest = baseRest;
- function castSlice(array, start, end) {
- var length = array.length;
- end = end === undefined$1 ? length : end;
- return !start && end >= length ? array : baseSlice(array, start, end);
- }
- var clearTimeout = ctxClearTimeout || function(id) {
- return root.clearTimeout(id);
- };
- function cloneBuffer(buffer, isDeep) {
- if (isDeep) {
- return buffer.slice();
- }
- var length = buffer.length, result2 = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
- buffer.copy(result2);
- return result2;
- }
- function cloneArrayBuffer(arrayBuffer) {
- var result2 = new arrayBuffer.constructor(arrayBuffer.byteLength);
- new Uint8Array2(result2).set(new Uint8Array2(arrayBuffer));
- return result2;
- }
- function cloneDataView(dataView, isDeep) {
- var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
- return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
- }
- function cloneRegExp(regexp) {
- var result2 = new regexp.constructor(regexp.source, reFlags.exec(regexp));
- result2.lastIndex = regexp.lastIndex;
- return result2;
- }
- function cloneSymbol(symbol) {
- return symbolValueOf ? Object2(symbolValueOf.call(symbol)) : {};
- }
- function cloneTypedArray(typedArray, isDeep) {
- var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
- return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
- }
- function compareAscending(value, other) {
- if (value !== other) {
- var valIsDefined = value !== undefined$1, valIsNull = value === null, valIsReflexive = value === value, valIsSymbol = isSymbol(value);
- var othIsDefined = other !== undefined$1, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol(other);
- if (!othIsNull && !othIsSymbol && !valIsSymbol && value > other || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) {
- return 1;
- }
- if (!valIsNull && !valIsSymbol && !othIsSymbol && value < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) {
- return -1;
- }
- }
- return 0;
- }
- function compareMultiple(object, other, orders) {
- var index = -1, objCriteria = object.criteria, othCriteria = other.criteria, length = objCriteria.length, ordersLength = orders.length;
- while (++index < length) {
- var result2 = compareAscending(objCriteria[index], othCriteria[index]);
- if (result2) {
- if (index >= ordersLength) {
- return result2;
- }
- var order = orders[index];
- return result2 * (order == "desc" ? -1 : 1);
- }
- }
- return object.index - other.index;
- }
- function composeArgs(args, partials, holders, isCurried) {
- var argsIndex = -1, argsLength = args.length, holdersLength = holders.length, leftIndex = -1, leftLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result2 = Array2(leftLength + rangeLength), isUncurried = !isCurried;
- while (++leftIndex < leftLength) {
- result2[leftIndex] = partials[leftIndex];
- }
- while (++argsIndex < holdersLength) {
- if (isUncurried || argsIndex < argsLength) {
- result2[holders[argsIndex]] = args[argsIndex];
- }
- }
- while (rangeLength--) {
- result2[leftIndex++] = args[argsIndex++];
- }
- return result2;
- }
- function composeArgsRight(args, partials, holders, isCurried) {
- var argsIndex = -1, argsLength = args.length, holdersIndex = -1, holdersLength = holders.length, rightIndex = -1, rightLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result2 = Array2(rangeLength + rightLength), isUncurried = !isCurried;
- while (++argsIndex < rangeLength) {
- result2[argsIndex] = args[argsIndex];
- }
- var offset = argsIndex;
- while (++rightIndex < rightLength) {
- result2[offset + rightIndex] = partials[rightIndex];
- }
- while (++holdersIndex < holdersLength) {
- if (isUncurried || argsIndex < argsLength) {
- result2[offset + holders[holdersIndex]] = args[argsIndex++];
- }
- }
- return result2;
- }
- function copyArray(source, array) {
- var index = -1, length = source.length;
- array || (array = Array2(length));
- while (++index < length) {
- array[index] = source[index];
- }
- return array;
- }
- function copyObject(source, props, object, customizer) {
- var isNew = !object;
- object || (object = {});
- var index = -1, length = props.length;
- while (++index < length) {
- var key = props[index];
- var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined$1;
- if (newValue === undefined$1) {
- newValue = source[key];
- }
- if (isNew) {
- baseAssignValue(object, key, newValue);
- } else {
- assignValue(object, key, newValue);
- }
- }
- return object;
- }
- function copySymbols(source, object) {
- return copyObject(source, getSymbols(source), object);
- }
- function copySymbolsIn(source, object) {
- return copyObject(source, getSymbolsIn(source), object);
- }
- function createAggregator(setter, initializer) {
- return function(collection, iteratee2) {
- var func = isArray(collection) ? arrayAggregator : baseAggregator, accumulator = initializer ? initializer() : {};
- return func(collection, setter, getIteratee(iteratee2, 2), accumulator);
- };
- }
- function createAssigner(assigner) {
- return baseRest(function(object, sources) {
- var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined$1, guard = length > 2 ? sources[2] : undefined$1;
- customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : undefined$1;
- if (guard && isIterateeCall(sources[0], sources[1], guard)) {
- customizer = length < 3 ? undefined$1 : customizer;
- length = 1;
- }
- object = Object2(object);
- while (++index < length) {
- var source = sources[index];
- if (source) {
- assigner(object, source, index, customizer);
- }
- }
- return object;
- });
- }
- function createBaseEach(eachFunc, fromRight) {
- return function(collection, iteratee2) {
- if (collection == null) {
- return collection;
- }
- if (!isArrayLike(collection)) {
- return eachFunc(collection, iteratee2);
- }
- var length = collection.length, index = fromRight ? length : -1, iterable = Object2(collection);
- while (fromRight ? index-- : ++index < length) {
- if (iteratee2(iterable[index], index, iterable) === false) {
- break;
- }
- }
- return collection;
- };
- }
- function createBaseFor(fromRight) {
- return function(object, iteratee2, keysFunc) {
- var index = -1, iterable = Object2(object), props = keysFunc(object), length = props.length;
- while (length--) {
- var key = props[fromRight ? length : ++index];
- if (iteratee2(iterable[key], key, iterable) === false) {
- break;
- }
- }
- return object;
- };
- }
- function createBind(func, bitmask, thisArg) {
- var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func);
- function wrapper() {
- var fn = this && this !== root && this instanceof wrapper ? Ctor : func;
- return fn.apply(isBind ? thisArg : this, arguments);
- }
- return wrapper;
- }
- function createCaseFirst(methodName) {
- return function(string) {
- string = toString(string);
- var strSymbols = hasUnicode(string) ? stringToArray(string) : undefined$1;
- var chr = strSymbols ? strSymbols[0] : string.charAt(0);
- var trailing = strSymbols ? castSlice(strSymbols, 1).join("") : string.slice(1);
- return chr[methodName]() + trailing;
- };
- }
- function createCompounder(callback) {
- return function(string) {
- return arrayReduce(words(deburr(string).replace(reApos, "")), callback, "");
- };
- }
- function createCtor(Ctor) {
- return function() {
- var args = arguments;
- switch (args.length) {
- case 0:
- return new Ctor();
- case 1:
- return new Ctor(args[0]);
- case 2:
- return new Ctor(args[0], args[1]);
- case 3:
- return new Ctor(args[0], args[1], args[2]);
- case 4:
- return new Ctor(args[0], args[1], args[2], args[3]);
- case 5:
- return new Ctor(args[0], args[1], args[2], args[3], args[4]);
- case 6:
- return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
- case 7:
- return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
- }
- var thisBinding = baseCreate(Ctor.prototype), result2 = Ctor.apply(thisBinding, args);
- return isObject(result2) ? result2 : thisBinding;
- };
- }
- function createCurry(func, bitmask, arity) {
- var Ctor = createCtor(func);
- function wrapper() {
- var length = arguments.length, args = Array2(length), index = length, placeholder = getHolder(wrapper);
- while (index--) {
- args[index] = arguments[index];
- }
- var holders = length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder ? [] : replaceHolders(args, placeholder);
- length -= holders.length;
- if (length < arity) {
- return createRecurry(
- func,
- bitmask,
- createHybrid,
- wrapper.placeholder,
- undefined$1,
- args,
- holders,
- undefined$1,
- undefined$1,
- arity - length
- );
- }
- var fn = this && this !== root && this instanceof wrapper ? Ctor : func;
- return apply(fn, this, args);
- }
- return wrapper;
- }
- function createFind(findIndexFunc) {
- return function(collection, predicate, fromIndex) {
- var iterable = Object2(collection);
- if (!isArrayLike(collection)) {
- var iteratee2 = getIteratee(predicate, 3);
- collection = keys(collection);
- predicate = function(key) {
- return iteratee2(iterable[key], key, iterable);
- };
- }
- var index = findIndexFunc(collection, predicate, fromIndex);
- return index > -1 ? iterable[iteratee2 ? collection[index] : index] : undefined$1;
- };
- }
- function createFlow(fromRight) {
- return flatRest(function(funcs) {
- var length = funcs.length, index = length, prereq = LodashWrapper.prototype.thru;
- if (fromRight) {
- funcs.reverse();
- }
- while (index--) {
- var func = funcs[index];
- if (typeof func != "function") {
- throw new TypeError2(FUNC_ERROR_TEXT);
- }
- if (prereq && !wrapper && getFuncName(func) == "wrapper") {
- var wrapper = new LodashWrapper([], true);
- }
- }
- index = wrapper ? index : length;
- while (++index < length) {
- func = funcs[index];
- var funcName = getFuncName(func), data = funcName == "wrapper" ? getData(func) : undefined$1;
- if (data && isLaziable(data[0]) && data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && !data[4].length && data[9] == 1) {
- wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
- } else {
- wrapper = func.length == 1 && isLaziable(func) ? wrapper[funcName]() : wrapper.thru(func);
- }
- }
- return function() {
- var args = arguments, value = args[0];
- if (wrapper && args.length == 1 && isArray(value)) {
- return wrapper.plant(value).value();
- }
- var index2 = 0, result2 = length ? funcs[index2].apply(this, args) : value;
- while (++index2 < length) {
- result2 = funcs[index2].call(this, result2);
- }
- return result2;
- };
- });
- }
- function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary2, arity) {
- var isAry = bitmask & WRAP_ARY_FLAG, isBind = bitmask & WRAP_BIND_FLAG, isBindKey = bitmask & WRAP_BIND_KEY_FLAG, isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), isFlip = bitmask & WRAP_FLIP_FLAG, Ctor = isBindKey ? undefined$1 : createCtor(func);
- function wrapper() {
- var length = arguments.length, args = Array2(length), index = length;
- while (index--) {
- args[index] = arguments[index];
- }
- if (isCurried) {
- var placeholder = getHolder(wrapper), holdersCount = countHolders(args, placeholder);
- }
- if (partials) {
- args = composeArgs(args, partials, holders, isCurried);
- }
- if (partialsRight) {
- args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
- }
- length -= holdersCount;
- if (isCurried && length < arity) {
- var newHolders = replaceHolders(args, placeholder);
- return createRecurry(
- func,
- bitmask,
- createHybrid,
- wrapper.placeholder,
- thisArg,
- args,
- newHolders,
- argPos,
- ary2,
- arity - length
- );
- }
- var thisBinding = isBind ? thisArg : this, fn = isBindKey ? thisBinding[func] : func;
- length = args.length;
- if (argPos) {
- args = reorder(args, argPos);
- } else if (isFlip && length > 1) {
- args.reverse();
- }
- if (isAry && ary2 < length) {
- args.length = ary2;
- }
- if (this && this !== root && this instanceof wrapper) {
- fn = Ctor || createCtor(fn);
- }
- return fn.apply(thisBinding, args);
- }
- return wrapper;
- }
- function createInverter(setter, toIteratee) {
- return function(object, iteratee2) {
- return baseInverter(object, setter, toIteratee(iteratee2), {});
- };
- }
- function createMathOperation(operator, defaultValue) {
- return function(value, other) {
- var result2;
- if (value === undefined$1 && other === undefined$1) {
- return defaultValue;
- }
- if (value !== undefined$1) {
- result2 = value;
- }
- if (other !== undefined$1) {
- if (result2 === undefined$1) {
- return other;
- }
- if (typeof value == "string" || typeof other == "string") {
- value = baseToString(value);
- other = baseToString(other);
- } else {
- value = baseToNumber(value);
- other = baseToNumber(other);
- }
- result2 = operator(value, other);
- }
- return result2;
- };
- }
- function createOver(arrayFunc) {
- return flatRest(function(iteratees) {
- iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
- return baseRest(function(args) {
- var thisArg = this;
- return arrayFunc(iteratees, function(iteratee2) {
- return apply(iteratee2, thisArg, args);
- });
- });
- });
- }
- function createPadding(length, chars) {
- chars = chars === undefined$1 ? " " : baseToString(chars);
- var charsLength = chars.length;
- if (charsLength < 2) {
- return charsLength ? baseRepeat(chars, length) : chars;
- }
- var result2 = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
- return hasUnicode(chars) ? castSlice(stringToArray(result2), 0, length).join("") : result2.slice(0, length);
- }
- function createPartial(func, bitmask, thisArg, partials) {
- var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func);
- function wrapper() {
- var argsIndex = -1, argsLength = arguments.length, leftIndex = -1, leftLength = partials.length, args = Array2(leftLength + argsLength), fn = this && this !== root && this instanceof wrapper ? Ctor : func;
- while (++leftIndex < leftLength) {
- args[leftIndex] = partials[leftIndex];
- }
- while (argsLength--) {
- args[leftIndex++] = arguments[++argsIndex];
- }
- return apply(fn, isBind ? thisArg : this, args);
- }
- return wrapper;
- }
- function createRange(fromRight) {
- return function(start, end, step) {
- if (step && typeof step != "number" && isIterateeCall(start, end, step)) {
- end = step = undefined$1;
- }
- start = toFinite(start);
- if (end === undefined$1) {
- end = start;
- start = 0;
- } else {
- end = toFinite(end);
- }
- step = step === undefined$1 ? start < end ? 1 : -1 : toFinite(step);
- return baseRange(start, end, step, fromRight);
- };
- }
- function createRelationalOperation(operator) {
- return function(value, other) {
- if (!(typeof value == "string" && typeof other == "string")) {
- value = toNumber(value);
- other = toNumber(other);
- }
- return operator(value, other);
- };
- }
- function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary2, arity) {
- 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;
- bitmask |= isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG;
- bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
- if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
- bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
- }
- var newData = [
- func,
- bitmask,
- thisArg,
- newPartials,
- newHolders,
- newPartialsRight,
- newHoldersRight,
- argPos,
- ary2,
- arity
- ];
- var result2 = wrapFunc.apply(undefined$1, newData);
- if (isLaziable(func)) {
- setData(result2, newData);
- }
- result2.placeholder = placeholder;
- return setWrapToString(result2, func, bitmask);
- }
- function createRound(methodName) {
- var func = Math2[methodName];
- return function(number, precision) {
- number = toNumber(number);
- precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
- if (precision && nativeIsFinite(number)) {
- var pair = (toString(number) + "e").split("e"), value = func(pair[0] + "e" + (+pair[1] + precision));
- pair = (toString(value) + "e").split("e");
- return +(pair[0] + "e" + (+pair[1] - precision));
- }
- return func(number);
- };
- }
- var createSet = !(Set && 1 / setToArray(new Set([, -0]))[1] == INFINITY) ? noop : function(values2) {
- return new Set(values2);
- };
- function createToPairs(keysFunc) {
- return function(object) {
- var tag = getTag(object);
- if (tag == mapTag) {
- return mapToArray(object);
- }
- if (tag == setTag) {
- return setToPairs(object);
- }
- return baseToPairs(object, keysFunc(object));
- };
- }
- function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary2, arity) {
- var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
- if (!isBindKey && typeof func != "function") {
- throw new TypeError2(FUNC_ERROR_TEXT);
- }
- var length = partials ? partials.length : 0;
- if (!length) {
- bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
- partials = holders = undefined$1;
- }
- ary2 = ary2 === undefined$1 ? ary2 : nativeMax(toInteger(ary2), 0);
- arity = arity === undefined$1 ? arity : toInteger(arity);
- length -= holders ? holders.length : 0;
- if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
- var partialsRight = partials, holdersRight = holders;
- partials = holders = undefined$1;
- }
- var data = isBindKey ? undefined$1 : getData(func);
- var newData = [
- func,
- bitmask,
- thisArg,
- partials,
- holders,
- partialsRight,
- holdersRight,
- argPos,
- ary2,
- arity
- ];
- if (data) {
- mergeData(newData, data);
- }
- func = newData[0];
- bitmask = newData[1];
- thisArg = newData[2];
- partials = newData[3];
- holders = newData[4];
- arity = newData[9] = newData[9] === undefined$1 ? isBindKey ? 0 : func.length : nativeMax(newData[9] - length, 0);
- if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
- bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
- }
- if (!bitmask || bitmask == WRAP_BIND_FLAG) {
- var result2 = createBind(func, bitmask, thisArg);
- } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
- result2 = createCurry(func, bitmask, arity);
- } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
- result2 = createPartial(func, bitmask, thisArg, partials);
- } else {
- result2 = createHybrid.apply(undefined$1, newData);
- }
- var setter = data ? baseSetData : setData;
- return setWrapToString(setter(result2, newData), func, bitmask);
- }
- function customDefaultsAssignIn(objValue, srcValue, key, object) {
- if (objValue === undefined$1 || eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key)) {
- return srcValue;
- }
- return objValue;
- }
- function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
- if (isObject(objValue) && isObject(srcValue)) {
- stack.set(srcValue, objValue);
- baseMerge(objValue, srcValue, undefined$1, customDefaultsMerge, stack);
- stack["delete"](srcValue);
- }
- return objValue;
- }
- function customOmitClone(value) {
- return isPlainObject(value) ? undefined$1 : value;
- }
- function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length;
- if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
- return false;
- }
- var arrStacked = stack.get(array);
- var othStacked = stack.get(other);
- if (arrStacked && othStacked) {
- return arrStacked == other && othStacked == array;
- }
- var index = -1, result2 = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : undefined$1;
- stack.set(array, other);
- stack.set(other, array);
- while (++index < arrLength) {
- var arrValue = array[index], othValue = other[index];
- if (customizer) {
- var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
- }
- if (compared !== undefined$1) {
- if (compared) {
- continue;
- }
- result2 = false;
- break;
- }
- if (seen) {
- if (!arraySome(other, function(othValue2, othIndex) {
- if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
- return seen.push(othIndex);
- }
- })) {
- result2 = false;
- break;
- }
- } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
- result2 = false;
- break;
- }
- }
- stack["delete"](array);
- stack["delete"](other);
- return result2;
- }
- function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
- switch (tag) {
- case dataViewTag:
- if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
- return false;
- }
- object = object.buffer;
- other = other.buffer;
- case arrayBufferTag:
- if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other))) {
- return false;
- }
- return true;
- case boolTag:
- case dateTag:
- case numberTag:
- return eq(+object, +other);
- case errorTag:
- return object.name == other.name && object.message == other.message;
- case regexpTag:
- case stringTag:
- return object == other + "";
- case mapTag:
- var convert = mapToArray;
- case setTag:
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
- convert || (convert = setToArray);
- if (object.size != other.size && !isPartial) {
- return false;
- }
- var stacked = stack.get(object);
- if (stacked) {
- return stacked == other;
- }
- bitmask |= COMPARE_UNORDERED_FLAG;
- stack.set(object, other);
- var result2 = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
- stack["delete"](object);
- return result2;
- case symbolTag:
- if (symbolValueOf) {
- return symbolValueOf.call(object) == symbolValueOf.call(other);
- }
- }
- return false;
- }
- function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
- if (objLength != othLength && !isPartial) {
- return false;
- }
- var index = objLength;
- while (index--) {
- var key = objProps[index];
- if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
- return false;
- }
- }
- var objStacked = stack.get(object);
- var othStacked = stack.get(other);
- if (objStacked && othStacked) {
- return objStacked == other && othStacked == object;
- }
- var result2 = true;
- stack.set(object, other);
- stack.set(other, object);
- var skipCtor = isPartial;
- while (++index < objLength) {
- key = objProps[index];
- var objValue = object[key], othValue = other[key];
- if (customizer) {
- var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
- }
- if (!(compared === undefined$1 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
- result2 = false;
- break;
- }
- skipCtor || (skipCtor = key == "constructor");
- }
- if (result2 && !skipCtor) {
- var objCtor = object.constructor, othCtor = other.constructor;
- if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
- result2 = false;
- }
- }
- stack["delete"](object);
- stack["delete"](other);
- return result2;
- }
- function flatRest(func) {
- return setToString(overRest(func, undefined$1, flatten), func + "");
- }
- function getAllKeys(object) {
- return baseGetAllKeys(object, keys, getSymbols);
- }
- function getAllKeysIn(object) {
- return baseGetAllKeys(object, keysIn, getSymbolsIn);
- }
- var getData = !metaMap ? noop : function(func) {
- return metaMap.get(func);
- };
- function getFuncName(func) {
- var result2 = func.name + "", array = realNames[result2], length = hasOwnProperty.call(realNames, result2) ? array.length : 0;
- while (length--) {
- var data = array[length], otherFunc = data.func;
- if (otherFunc == null || otherFunc == func) {
- return data.name;
- }
- }
- return result2;
- }
- function getHolder(func) {
- var object = hasOwnProperty.call(lodash2, "placeholder") ? lodash2 : func;
- return object.placeholder;
- }
- function getIteratee() {
- var result2 = lodash2.iteratee || iteratee;
- result2 = result2 === iteratee ? baseIteratee : result2;
- return arguments.length ? result2(arguments[0], arguments[1]) : result2;
- }
- function getMapData(map2, key) {
- var data = map2.__data__;
- return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
- }
- function getMatchData(object) {
- var result2 = keys(object), length = result2.length;
- while (length--) {
- var key = result2[length], value = object[key];
- result2[length] = [key, value, isStrictComparable(value)];
- }
- return result2;
- }
- function getNative(object, key) {
- var value = getValue(object, key);
- return baseIsNative(value) ? value : undefined$1;
- }
- function getRawTag(value) {
- var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
- try {
- value[symToStringTag] = undefined$1;
- var unmasked = true;
- } catch (e) {
- }
- var result2 = nativeObjectToString.call(value);
- if (unmasked) {
- if (isOwn) {
- value[symToStringTag] = tag;
- } else {
- delete value[symToStringTag];
- }
- }
- return result2;
- }
- var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
- if (object == null) {
- return [];
- }
- object = Object2(object);
- return arrayFilter(nativeGetSymbols(object), function(symbol) {
- return propertyIsEnumerable.call(object, symbol);
- });
- };
- var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
- var result2 = [];
- while (object) {
- arrayPush(result2, getSymbols(object));
- object = getPrototype(object);
- }
- return result2;
- };
- var getTag = baseGetTag;
- 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) {
- getTag = function(value) {
- var result2 = baseGetTag(value), Ctor = result2 == objectTag ? value.constructor : undefined$1, ctorString = Ctor ? toSource(Ctor) : "";
- if (ctorString) {
- switch (ctorString) {
- case dataViewCtorString:
- return dataViewTag;
- case mapCtorString:
- return mapTag;
- case promiseCtorString:
- return promiseTag;
- case setCtorString:
- return setTag;
- case weakMapCtorString:
- return weakMapTag;
- }
- }
- return result2;
- };
- }
- function getView(start, end, transforms) {
- var index = -1, length = transforms.length;
- while (++index < length) {
- var data = transforms[index], size2 = data.size;
- switch (data.type) {
- case "drop":
- start += size2;
- break;
- case "dropRight":
- end -= size2;
- break;
- case "take":
- end = nativeMin(end, start + size2);
- break;
- case "takeRight":
- start = nativeMax(start, end - size2);
- break;
- }
- }
- return { "start": start, "end": end };
- }
- function getWrapDetails(source) {
- var match = source.match(reWrapDetails);
- return match ? match[1].split(reSplitDetails) : [];
- }
- function hasPath(object, path, hasFunc) {
- path = castPath(path, object);
- var index = -1, length = path.length, result2 = false;
- while (++index < length) {
- var key = toKey(path[index]);
- if (!(result2 = object != null && hasFunc(object, key))) {
- break;
- }
- object = object[key];
- }
- if (result2 || ++index != length) {
- return result2;
- }
- length = object == null ? 0 : object.length;
- return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object));
- }
- function initCloneArray(array) {
- var length = array.length, result2 = new array.constructor(length);
- if (length && typeof array[0] == "string" && hasOwnProperty.call(array, "index")) {
- result2.index = array.index;
- result2.input = array.input;
- }
- return result2;
- }
- function initCloneObject(object) {
- return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
- }
- function initCloneByTag(object, tag, isDeep) {
- var Ctor = object.constructor;
- switch (tag) {
- case arrayBufferTag:
- return cloneArrayBuffer(object);
- case boolTag:
- case dateTag:
- return new Ctor(+object);
- case dataViewTag:
- return cloneDataView(object, isDeep);
- case float32Tag:
- case float64Tag:
- case int8Tag:
- case int16Tag:
- case int32Tag:
- case uint8Tag:
- case uint8ClampedTag:
- case uint16Tag:
- case uint32Tag:
- return cloneTypedArray(object, isDeep);
- case mapTag:
- return new Ctor();
- case numberTag:
- case stringTag:
- return new Ctor(object);
- case regexpTag:
- return cloneRegExp(object);
- case setTag:
- return new Ctor();
- case symbolTag:
- return cloneSymbol(object);
- }
- }
- function insertWrapDetails(source, details) {
- var length = details.length;
- if (!length) {
- return source;
- }
- var lastIndex = length - 1;
- details[lastIndex] = (length > 1 ? "& " : "") + details[lastIndex];
- details = details.join(length > 2 ? ", " : " ");
- return source.replace(reWrapComment, "{\n/* [wrapped with " + details + "] */\n");
- }
- function isFlattenable(value) {
- return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
- }
- function isIndex(value, length) {
- var type = typeof value;
- length = length == null ? MAX_SAFE_INTEGER : length;
- return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
- }
- function isIterateeCall(value, index, object) {
- if (!isObject(object)) {
- return false;
- }
- var type = typeof index;
- if (type == "number" ? isArrayLike(object) && isIndex(index, object.length) : type == "string" && index in object) {
- return eq(object[index], value);
- }
- return false;
- }
- function isKey(value, object) {
- if (isArray(value)) {
- return false;
- }
- var type = typeof value;
- if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) {
- return true;
- }
- return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object2(object);
- }
- function isKeyable(value) {
- var type = typeof value;
- return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
- }
- function isLaziable(func) {
- var funcName = getFuncName(func), other = lodash2[funcName];
- if (typeof other != "function" || !(funcName in LazyWrapper.prototype)) {
- return false;
- }
- if (func === other) {
- return true;
- }
- var data = getData(other);
- return !!data && func === data[0];
- }
- function isMasked(func) {
- return !!maskSrcKey && maskSrcKey in func;
- }
- var isMaskable = coreJsData ? isFunction : stubFalse;
- function isPrototype(value) {
- var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
- return value === proto;
- }
- function isStrictComparable(value) {
- return value === value && !isObject(value);
- }
- function matchesStrictComparable(key, srcValue) {
- return function(object) {
- if (object == null) {
- return false;
- }
- return object[key] === srcValue && (srcValue !== undefined$1 || key in Object2(object));
- };
- }
- function memoizeCapped(func) {
- var result2 = memoize(func, function(key) {
- if (cache.size === MAX_MEMOIZE_SIZE) {
- cache.clear();
- }
- return key;
- });
- var cache = result2.cache;
- return result2;
- }
- function mergeData(data, source) {
- var bitmask = data[1], srcBitmask = source[1], newBitmask = bitmask | srcBitmask, isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
- var isCombo = srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_CURRY_FLAG || srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_REARG_FLAG && data[7].length <= source[8] || srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG) && source[7].length <= source[8] && bitmask == WRAP_CURRY_FLAG;
- if (!(isCommon || isCombo)) {
- return data;
- }
- if (srcBitmask & WRAP_BIND_FLAG) {
- data[2] = source[2];
- newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
- }
- var value = source[3];
- if (value) {
- var partials = data[3];
- data[3] = partials ? composeArgs(partials, value, source[4]) : value;
- data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
- }
- value = source[5];
- if (value) {
- partials = data[5];
- data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
- data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
- }
- value = source[7];
- if (value) {
- data[7] = value;
- }
- if (srcBitmask & WRAP_ARY_FLAG) {
- data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
- }
- if (data[9] == null) {
- data[9] = source[9];
- }
- data[0] = source[0];
- data[1] = newBitmask;
- return data;
- }
- function nativeKeysIn(object) {
- var result2 = [];
- if (object != null) {
- for (var key in Object2(object)) {
- result2.push(key);
- }
- }
- return result2;
- }
- function objectToString(value) {
- return nativeObjectToString.call(value);
- }
- function overRest(func, start, transform2) {
- start = nativeMax(start === undefined$1 ? func.length - 1 : start, 0);
- return function() {
- var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array2(length);
- while (++index < length) {
- array[index] = args[start + index];
- }
- index = -1;
- var otherArgs = Array2(start + 1);
- while (++index < start) {
- otherArgs[index] = args[index];
- }
- otherArgs[start] = transform2(array);
- return apply(func, this, otherArgs);
- };
- }
- function parent(object, path) {
- return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
- }
- function reorder(array, indexes) {
- var arrLength = array.length, length = nativeMin(indexes.length, arrLength), oldArray = copyArray(array);
- while (length--) {
- var index = indexes[length];
- array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined$1;
- }
- return array;
- }
- function safeGet(object, key) {
- if (key === "constructor" && typeof object[key] === "function") {
- return;
- }
- if (key == "__proto__") {
- return;
- }
- return object[key];
- }
- var setData = shortOut(baseSetData);
- var setTimeout = ctxSetTimeout || function(func, wait) {
- return root.setTimeout(func, wait);
- };
- var setToString = shortOut(baseSetToString);
- function setWrapToString(wrapper, reference, bitmask) {
- var source = reference + "";
- return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
- }
- function shortOut(func) {
- var count = 0, lastCalled = 0;
- return function() {
- var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
- lastCalled = stamp;
- if (remaining > 0) {
- if (++count >= HOT_COUNT) {
- return arguments[0];
- }
- } else {
- count = 0;
- }
- return func.apply(undefined$1, arguments);
- };
- }
- function shuffleSelf(array, size2) {
- var index = -1, length = array.length, lastIndex = length - 1;
- size2 = size2 === undefined$1 ? length : size2;
- while (++index < size2) {
- var rand = baseRandom(index, lastIndex), value = array[rand];
- array[rand] = array[index];
- array[index] = value;
- }
- array.length = size2;
- return array;
- }
- var stringToPath = memoizeCapped(function(string) {
- var result2 = [];
- if (string.charCodeAt(0) === 46) {
- result2.push("");
- }
- string.replace(rePropName, function(match, number, quote, subString) {
- result2.push(quote ? subString.replace(reEscapeChar, "$1") : number || match);
- });
- return result2;
- });
- function toKey(value) {
- if (typeof value == "string" || isSymbol(value)) {
- return value;
- }
- var result2 = value + "";
- return result2 == "0" && 1 / value == -INFINITY ? "-0" : result2;
- }
- function toSource(func) {
- if (func != null) {
- try {
- return funcToString.call(func);
- } catch (e) {
- }
- try {
- return func + "";
- } catch (e) {
- }
- }
- return "";
- }
- function updateWrapDetails(details, bitmask) {
- arrayEach(wrapFlags, function(pair) {
- var value = "_." + pair[0];
- if (bitmask & pair[1] && !arrayIncludes(details, value)) {
- details.push(value);
- }
- });
- return details.sort();
- }
- function wrapperClone(wrapper) {
- if (wrapper instanceof LazyWrapper) {
- return wrapper.clone();
- }
- var result2 = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
- result2.__actions__ = copyArray(wrapper.__actions__);
- result2.__index__ = wrapper.__index__;
- result2.__values__ = wrapper.__values__;
- return result2;
- }
- function chunk(array, size2, guard) {
- if (guard ? isIterateeCall(array, size2, guard) : size2 === undefined$1) {
- size2 = 1;
- } else {
- size2 = nativeMax(toInteger(size2), 0);
- }
- var length = array == null ? 0 : array.length;
- if (!length || size2 < 1) {
- return [];
- }
- var index = 0, resIndex = 0, result2 = Array2(nativeCeil(length / size2));
- while (index < length) {
- result2[resIndex++] = baseSlice(array, index, index += size2);
- }
- return result2;
- }
- function compact(array) {
- var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result2 = [];
- while (++index < length) {
- var value = array[index];
- if (value) {
- result2[resIndex++] = value;
- }
- }
- return result2;
- }
- function concat() {
- var length = arguments.length;
- if (!length) {
- return [];
- }
- var args = Array2(length - 1), array = arguments[0], index = length;
- while (index--) {
- args[index - 1] = arguments[index];
- }
- return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
- }
- var difference = baseRest(function(array, values2) {
- return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values2, 1, isArrayLikeObject, true)) : [];
- });
- var differenceBy = baseRest(function(array, values2) {
- var iteratee2 = last(values2);
- if (isArrayLikeObject(iteratee2)) {
- iteratee2 = undefined$1;
- }
- return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values2, 1, isArrayLikeObject, true), getIteratee(iteratee2, 2)) : [];
- });
- var differenceWith = baseRest(function(array, values2) {
- var comparator = last(values2);
- if (isArrayLikeObject(comparator)) {
- comparator = undefined$1;
- }
- return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values2, 1, isArrayLikeObject, true), undefined$1, comparator) : [];
- });
- function drop(array, n, guard) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return [];
- }
- n = guard || n === undefined$1 ? 1 : toInteger(n);
- return baseSlice(array, n < 0 ? 0 : n, length);
- }
- function dropRight(array, n, guard) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return [];
- }
- n = guard || n === undefined$1 ? 1 : toInteger(n);
- n = length - n;
- return baseSlice(array, 0, n < 0 ? 0 : n);
- }
- function dropRightWhile(array, predicate) {
- return array && array.length ? baseWhile(array, getIteratee(predicate, 3), true, true) : [];
- }
- function dropWhile(array, predicate) {
- return array && array.length ? baseWhile(array, getIteratee(predicate, 3), true) : [];
- }
- function fill(array, value, start, end) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return [];
- }
- if (start && typeof start != "number" && isIterateeCall(array, value, start)) {
- start = 0;
- end = length;
- }
- return baseFill(array, value, start, end);
- }
- function findIndex(array, predicate, fromIndex) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return -1;
- }
- var index = fromIndex == null ? 0 : toInteger(fromIndex);
- if (index < 0) {
- index = nativeMax(length + index, 0);
- }
- return baseFindIndex(array, getIteratee(predicate, 3), index);
- }
- function findLastIndex(array, predicate, fromIndex) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return -1;
- }
- var index = length - 1;
- if (fromIndex !== undefined$1) {
- index = toInteger(fromIndex);
- index = fromIndex < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
- }
- return baseFindIndex(array, getIteratee(predicate, 3), index, true);
- }
- function flatten(array) {
- var length = array == null ? 0 : array.length;
- return length ? baseFlatten(array, 1) : [];
- }
- function flattenDeep(array) {
- var length = array == null ? 0 : array.length;
- return length ? baseFlatten(array, INFINITY) : [];
- }
- function flattenDepth(array, depth) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return [];
- }
- depth = depth === undefined$1 ? 1 : toInteger(depth);
- return baseFlatten(array, depth);
- }
- function fromPairs(pairs) {
- var index = -1, length = pairs == null ? 0 : pairs.length, result2 = {};
- while (++index < length) {
- var pair = pairs[index];
- result2[pair[0]] = pair[1];
- }
- return result2;
- }
- function head(array) {
- return array && array.length ? array[0] : undefined$1;
- }
- function indexOf(array, value, fromIndex) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return -1;
- }
- var index = fromIndex == null ? 0 : toInteger(fromIndex);
- if (index < 0) {
- index = nativeMax(length + index, 0);
- }
- return baseIndexOf(array, value, index);
- }
- function initial(array) {
- var length = array == null ? 0 : array.length;
- return length ? baseSlice(array, 0, -1) : [];
- }
- var intersection = baseRest(function(arrays) {
- var mapped = arrayMap(arrays, castArrayLikeObject);
- return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped) : [];
- });
- var intersectionBy = baseRest(function(arrays) {
- var iteratee2 = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject);
- if (iteratee2 === last(mapped)) {
- iteratee2 = undefined$1;
- } else {
- mapped.pop();
- }
- return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, getIteratee(iteratee2, 2)) : [];
- });
- var intersectionWith = baseRest(function(arrays) {
- var comparator = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject);
- comparator = typeof comparator == "function" ? comparator : undefined$1;
- if (comparator) {
- mapped.pop();
- }
- return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, undefined$1, comparator) : [];
- });
- function join(array, separator) {
- return array == null ? "" : nativeJoin.call(array, separator);
- }
- function last(array) {
- var length = array == null ? 0 : array.length;
- return length ? array[length - 1] : undefined$1;
- }
- function lastIndexOf(array, value, fromIndex) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return -1;
- }
- var index = length;
- if (fromIndex !== undefined$1) {
- index = toInteger(fromIndex);
- index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
- }
- return value === value ? strictLastIndexOf(array, value, index) : baseFindIndex(array, baseIsNaN, index, true);
- }
- function nth(array, n) {
- return array && array.length ? baseNth(array, toInteger(n)) : undefined$1;
- }
- var pull = baseRest(pullAll);
- function pullAll(array, values2) {
- return array && array.length && values2 && values2.length ? basePullAll(array, values2) : array;
- }
- function pullAllBy(array, values2, iteratee2) {
- return array && array.length && values2 && values2.length ? basePullAll(array, values2, getIteratee(iteratee2, 2)) : array;
- }
- function pullAllWith(array, values2, comparator) {
- return array && array.length && values2 && values2.length ? basePullAll(array, values2, undefined$1, comparator) : array;
- }
- var pullAt = flatRest(function(array, indexes) {
- var length = array == null ? 0 : array.length, result2 = baseAt(array, indexes);
- basePullAt(array, arrayMap(indexes, function(index) {
- return isIndex(index, length) ? +index : index;
- }).sort(compareAscending));
- return result2;
- });
- function remove(array, predicate) {
- var result2 = [];
- if (!(array && array.length)) {
- return result2;
- }
- var index = -1, indexes = [], length = array.length;
- predicate = getIteratee(predicate, 3);
- while (++index < length) {
- var value = array[index];
- if (predicate(value, index, array)) {
- result2.push(value);
- indexes.push(index);
- }
- }
- basePullAt(array, indexes);
- return result2;
- }
- function reverse(array) {
- return array == null ? array : nativeReverse.call(array);
- }
- function slice(array, start, end) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return [];
- }
- if (end && typeof end != "number" && isIterateeCall(array, start, end)) {
- start = 0;
- end = length;
- } else {
- start = start == null ? 0 : toInteger(start);
- end = end === undefined$1 ? length : toInteger(end);
- }
- return baseSlice(array, start, end);
- }
- function sortedIndex(array, value) {
- return baseSortedIndex(array, value);
- }
- function sortedIndexBy(array, value, iteratee2) {
- return baseSortedIndexBy(array, value, getIteratee(iteratee2, 2));
- }
- function sortedIndexOf(array, value) {
- var length = array == null ? 0 : array.length;
- if (length) {
- var index = baseSortedIndex(array, value);
- if (index < length && eq(array[index], value)) {
- return index;
- }
- }
- return -1;
- }
- function sortedLastIndex(array, value) {
- return baseSortedIndex(array, value, true);
- }
- function sortedLastIndexBy(array, value, iteratee2) {
- return baseSortedIndexBy(array, value, getIteratee(iteratee2, 2), true);
- }
- function sortedLastIndexOf(array, value) {
- var length = array == null ? 0 : array.length;
- if (length) {
- var index = baseSortedIndex(array, value, true) - 1;
- if (eq(array[index], value)) {
- return index;
- }
- }
- return -1;
- }
- function sortedUniq(array) {
- return array && array.length ? baseSortedUniq(array) : [];
- }
- function sortedUniqBy(array, iteratee2) {
- return array && array.length ? baseSortedUniq(array, getIteratee(iteratee2, 2)) : [];
- }
- function tail(array) {
- var length = array == null ? 0 : array.length;
- return length ? baseSlice(array, 1, length) : [];
- }
- function take(array, n, guard) {
- if (!(array && array.length)) {
- return [];
- }
- n = guard || n === undefined$1 ? 1 : toInteger(n);
- return baseSlice(array, 0, n < 0 ? 0 : n);
- }
- function takeRight(array, n, guard) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return [];
- }
- n = guard || n === undefined$1 ? 1 : toInteger(n);
- n = length - n;
- return baseSlice(array, n < 0 ? 0 : n, length);
- }
- function takeRightWhile(array, predicate) {
- return array && array.length ? baseWhile(array, getIteratee(predicate, 3), false, true) : [];
- }
- function takeWhile(array, predicate) {
- return array && array.length ? baseWhile(array, getIteratee(predicate, 3)) : [];
- }
- var union = baseRest(function(arrays) {
- return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
- });
- var unionBy = baseRest(function(arrays) {
- var iteratee2 = last(arrays);
- if (isArrayLikeObject(iteratee2)) {
- iteratee2 = undefined$1;
- }
- return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee2, 2));
- });
- var unionWith = baseRest(function(arrays) {
- var comparator = last(arrays);
- comparator = typeof comparator == "function" ? comparator : undefined$1;
- return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined$1, comparator);
- });
- function uniq(array) {
- return array && array.length ? baseUniq(array) : [];
- }
- function uniqBy(array, iteratee2) {
- return array && array.length ? baseUniq(array, getIteratee(iteratee2, 2)) : [];
- }
- function uniqWith(array, comparator) {
- comparator = typeof comparator == "function" ? comparator : undefined$1;
- return array && array.length ? baseUniq(array, undefined$1, comparator) : [];
- }
- function unzip(array) {
- if (!(array && array.length)) {
- return [];
- }
- var length = 0;
- array = arrayFilter(array, function(group) {
- if (isArrayLikeObject(group)) {
- length = nativeMax(group.length, length);
- return true;
- }
- });
- return baseTimes(length, function(index) {
- return arrayMap(array, baseProperty(index));
- });
- }
- function unzipWith(array, iteratee2) {
- if (!(array && array.length)) {
- return [];
- }
- var result2 = unzip(array);
- if (iteratee2 == null) {
- return result2;
- }
- return arrayMap(result2, function(group) {
- return apply(iteratee2, undefined$1, group);
- });
- }
- var without = baseRest(function(array, values2) {
- return isArrayLikeObject(array) ? baseDifference(array, values2) : [];
- });
- var xor = baseRest(function(arrays) {
- return baseXor(arrayFilter(arrays, isArrayLikeObject));
- });
- var xorBy = baseRest(function(arrays) {
- var iteratee2 = last(arrays);
- if (isArrayLikeObject(iteratee2)) {
- iteratee2 = undefined$1;
- }
- return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee2, 2));
- });
- var xorWith = baseRest(function(arrays) {
- var comparator = last(arrays);
- comparator = typeof comparator == "function" ? comparator : undefined$1;
- return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined$1, comparator);
- });
- var zip = baseRest(unzip);
- function zipObject(props, values2) {
- return baseZipObject(props || [], values2 || [], assignValue);
- }
- function zipObjectDeep(props, values2) {
- return baseZipObject(props || [], values2 || [], baseSet);
- }
- var zipWith = baseRest(function(arrays) {
- var length = arrays.length, iteratee2 = length > 1 ? arrays[length - 1] : undefined$1;
- iteratee2 = typeof iteratee2 == "function" ? (arrays.pop(), iteratee2) : undefined$1;
- return unzipWith(arrays, iteratee2);
- });
- function chain(value) {
- var result2 = lodash2(value);
- result2.__chain__ = true;
- return result2;
- }
- function tap(value, interceptor) {
- interceptor(value);
- return value;
- }
- function thru(value, interceptor) {
- return interceptor(value);
- }
- var wrapperAt = flatRest(function(paths) {
- var length = paths.length, start = length ? paths[0] : 0, value = this.__wrapped__, interceptor = function(object) {
- return baseAt(object, paths);
- };
- if (length > 1 || this.__actions__.length || !(value instanceof LazyWrapper) || !isIndex(start)) {
- return this.thru(interceptor);
- }
- value = value.slice(start, +start + (length ? 1 : 0));
- value.__actions__.push({
- "func": thru,
- "args": [interceptor],
- "thisArg": undefined$1
- });
- return new LodashWrapper(value, this.__chain__).thru(function(array) {
- if (length && !array.length) {
- array.push(undefined$1);
- }
- return array;
- });
- });
- function wrapperChain() {
- return chain(this);
- }
- function wrapperCommit() {
- return new LodashWrapper(this.value(), this.__chain__);
- }
- function wrapperNext() {
- if (this.__values__ === undefined$1) {
- this.__values__ = toArray(this.value());
- }
- var done = this.__index__ >= this.__values__.length, value = done ? undefined$1 : this.__values__[this.__index__++];
- return { "done": done, "value": value };
- }
- function wrapperToIterator() {
- return this;
- }
- function wrapperPlant(value) {
- var result2, parent2 = this;
- while (parent2 instanceof baseLodash) {
- var clone2 = wrapperClone(parent2);
- clone2.__index__ = 0;
- clone2.__values__ = undefined$1;
- if (result2) {
- previous.__wrapped__ = clone2;
- } else {
- result2 = clone2;
- }
- var previous = clone2;
- parent2 = parent2.__wrapped__;
- }
- previous.__wrapped__ = value;
- return result2;
- }
- function wrapperReverse() {
- var value = this.__wrapped__;
- if (value instanceof LazyWrapper) {
- var wrapped = value;
- if (this.__actions__.length) {
- wrapped = new LazyWrapper(this);
- }
- wrapped = wrapped.reverse();
- wrapped.__actions__.push({
- "func": thru,
- "args": [reverse],
- "thisArg": undefined$1
- });
- return new LodashWrapper(wrapped, this.__chain__);
- }
- return this.thru(reverse);
- }
- function wrapperValue() {
- return baseWrapperValue(this.__wrapped__, this.__actions__);
- }
- var countBy = createAggregator(function(result2, value, key) {
- if (hasOwnProperty.call(result2, key)) {
- ++result2[key];
- } else {
- baseAssignValue(result2, key, 1);
- }
- });
- function every(collection, predicate, guard) {
- var func = isArray(collection) ? arrayEvery : baseEvery;
- if (guard && isIterateeCall(collection, predicate, guard)) {
- predicate = undefined$1;
- }
- return func(collection, getIteratee(predicate, 3));
- }
- function filter(collection, predicate) {
- var func = isArray(collection) ? arrayFilter : baseFilter;
- return func(collection, getIteratee(predicate, 3));
- }
- var find = createFind(findIndex);
- var findLast = createFind(findLastIndex);
- function flatMap(collection, iteratee2) {
- return baseFlatten(map(collection, iteratee2), 1);
- }
- function flatMapDeep(collection, iteratee2) {
- return baseFlatten(map(collection, iteratee2), INFINITY);
- }
- function flatMapDepth(collection, iteratee2, depth) {
- depth = depth === undefined$1 ? 1 : toInteger(depth);
- return baseFlatten(map(collection, iteratee2), depth);
- }
- function forEach(collection, iteratee2) {
- var func = isArray(collection) ? arrayEach : baseEach;
- return func(collection, getIteratee(iteratee2, 3));
- }
- function forEachRight(collection, iteratee2) {
- var func = isArray(collection) ? arrayEachRight : baseEachRight;
- return func(collection, getIteratee(iteratee2, 3));
- }
- var groupBy = createAggregator(function(result2, value, key) {
- if (hasOwnProperty.call(result2, key)) {
- result2[key].push(value);
- } else {
- baseAssignValue(result2, key, [value]);
- }
- });
- function includes(collection, value, fromIndex, guard) {
- collection = isArrayLike(collection) ? collection : values(collection);
- fromIndex = fromIndex && !guard ? toInteger(fromIndex) : 0;
- var length = collection.length;
- if (fromIndex < 0) {
- fromIndex = nativeMax(length + fromIndex, 0);
- }
- return isString(collection) ? fromIndex <= length && collection.indexOf(value, fromIndex) > -1 : !!length && baseIndexOf(collection, value, fromIndex) > -1;
- }
- var invokeMap = baseRest(function(collection, path, args) {
- var index = -1, isFunc = typeof path == "function", result2 = isArrayLike(collection) ? Array2(collection.length) : [];
- baseEach(collection, function(value) {
- result2[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
- });
- return result2;
- });
- var keyBy = createAggregator(function(result2, value, key) {
- baseAssignValue(result2, key, value);
- });
- function map(collection, iteratee2) {
- var func = isArray(collection) ? arrayMap : baseMap;
- return func(collection, getIteratee(iteratee2, 3));
- }
- function orderBy(collection, iteratees, orders, guard) {
- if (collection == null) {
- return [];
- }
- if (!isArray(iteratees)) {
- iteratees = iteratees == null ? [] : [iteratees];
- }
- orders = guard ? undefined$1 : orders;
- if (!isArray(orders)) {
- orders = orders == null ? [] : [orders];
- }
- return baseOrderBy(collection, iteratees, orders);
- }
- var partition = createAggregator(function(result2, value, key) {
- result2[key ? 0 : 1].push(value);
- }, function() {
- return [[], []];
- });
- function reduce(collection, iteratee2, accumulator) {
- var func = isArray(collection) ? arrayReduce : baseReduce, initAccum = arguments.length < 3;
- return func(collection, getIteratee(iteratee2, 4), accumulator, initAccum, baseEach);
- }
- function reduceRight(collection, iteratee2, accumulator) {
- var func = isArray(collection) ? arrayReduceRight : baseReduce, initAccum = arguments.length < 3;
- return func(collection, getIteratee(iteratee2, 4), accumulator, initAccum, baseEachRight);
- }
- function reject(collection, predicate) {
- var func = isArray(collection) ? arrayFilter : baseFilter;
- return func(collection, negate(getIteratee(predicate, 3)));
- }
- function sample(collection) {
- var func = isArray(collection) ? arraySample : baseSample;
- return func(collection);
- }
- function sampleSize(collection, n, guard) {
- if (guard ? isIterateeCall(collection, n, guard) : n === undefined$1) {
- n = 1;
- } else {
- n = toInteger(n);
- }
- var func = isArray(collection) ? arraySampleSize : baseSampleSize;
- return func(collection, n);
- }
- function shuffle(collection) {
- var func = isArray(collection) ? arrayShuffle : baseShuffle;
- return func(collection);
- }
- function size(collection) {
- if (collection == null) {
- return 0;
- }
- if (isArrayLike(collection)) {
- return isString(collection) ? stringSize(collection) : collection.length;
- }
- var tag = getTag(collection);
- if (tag == mapTag || tag == setTag) {
- return collection.size;
- }
- return baseKeys(collection).length;
- }
- function some(collection, predicate, guard) {
- var func = isArray(collection) ? arraySome : baseSome;
- if (guard && isIterateeCall(collection, predicate, guard)) {
- predicate = undefined$1;
- }
- return func(collection, getIteratee(predicate, 3));
- }
- var sortBy = baseRest(function(collection, iteratees) {
- if (collection == null) {
- return [];
- }
- var length = iteratees.length;
- if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
- iteratees = [];
- } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
- iteratees = [iteratees[0]];
- }
- return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
- });
- var now = ctxNow || function() {
- return root.Date.now();
- };
- function after(n, func) {
- if (typeof func != "function") {
- throw new TypeError2(FUNC_ERROR_TEXT);
- }
- n = toInteger(n);
- return function() {
- if (--n < 1) {
- return func.apply(this, arguments);
- }
- };
- }
- function ary(func, n, guard) {
- n = guard ? undefined$1 : n;
- n = func && n == null ? func.length : n;
- return createWrap(func, WRAP_ARY_FLAG, undefined$1, undefined$1, undefined$1, undefined$1, n);
- }
- function before(n, func) {
- var result2;
- if (typeof func != "function") {
- throw new TypeError2(FUNC_ERROR_TEXT);
- }
- n = toInteger(n);
- return function() {
- if (--n > 0) {
- result2 = func.apply(this, arguments);
- }
- if (n <= 1) {
- func = undefined$1;
- }
- return result2;
- };
- }
- var bind = baseRest(function(func, thisArg, partials) {
- var bitmask = WRAP_BIND_FLAG;
- if (partials.length) {
- var holders = replaceHolders(partials, getHolder(bind));
- bitmask |= WRAP_PARTIAL_FLAG;
- }
- return createWrap(func, bitmask, thisArg, partials, holders);
- });
- var bindKey = baseRest(function(object, key, partials) {
- var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
- if (partials.length) {
- var holders = replaceHolders(partials, getHolder(bindKey));
- bitmask |= WRAP_PARTIAL_FLAG;
- }
- return createWrap(key, bitmask, object, partials, holders);
- });
- function curry(func, arity, guard) {
- arity = guard ? undefined$1 : arity;
- var result2 = createWrap(func, WRAP_CURRY_FLAG, undefined$1, undefined$1, undefined$1, undefined$1, undefined$1, arity);
- result2.placeholder = curry.placeholder;
- return result2;
- }
- function curryRight(func, arity, guard) {
- arity = guard ? undefined$1 : arity;
- var result2 = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined$1, undefined$1, undefined$1, undefined$1, undefined$1, arity);
- result2.placeholder = curryRight.placeholder;
- return result2;
- }
- function debounce(func, wait, options) {
- var lastArgs, lastThis, maxWait, result2, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
- if (typeof func != "function") {
- throw new TypeError2(FUNC_ERROR_TEXT);
- }
- wait = toNumber(wait) || 0;
- if (isObject(options)) {
- leading = !!options.leading;
- maxing = "maxWait" in options;
- maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
- trailing = "trailing" in options ? !!options.trailing : trailing;
- }
- function invokeFunc(time) {
- var args = lastArgs, thisArg = lastThis;
- lastArgs = lastThis = undefined$1;
- lastInvokeTime = time;
- result2 = func.apply(thisArg, args);
- return result2;
- }
- function leadingEdge(time) {
- lastInvokeTime = time;
- timerId = setTimeout(timerExpired, wait);
- return leading ? invokeFunc(time) : result2;
- }
- function remainingWait(time) {
- var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
- return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
- }
- function shouldInvoke(time) {
- var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
- return lastCallTime === undefined$1 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
- }
- function timerExpired() {
- var time = now();
- if (shouldInvoke(time)) {
- return trailingEdge(time);
- }
- timerId = setTimeout(timerExpired, remainingWait(time));
- }
- function trailingEdge(time) {
- timerId = undefined$1;
- if (trailing && lastArgs) {
- return invokeFunc(time);
- }
- lastArgs = lastThis = undefined$1;
- return result2;
- }
- function cancel() {
- if (timerId !== undefined$1) {
- clearTimeout(timerId);
- }
- lastInvokeTime = 0;
- lastArgs = lastCallTime = lastThis = timerId = undefined$1;
- }
- function flush() {
- return timerId === undefined$1 ? result2 : trailingEdge(now());
- }
- function debounced() {
- var time = now(), isInvoking = shouldInvoke(time);
- lastArgs = arguments;
- lastThis = this;
- lastCallTime = time;
- if (isInvoking) {
- if (timerId === undefined$1) {
- return leadingEdge(lastCallTime);
- }
- if (maxing) {
- clearTimeout(timerId);
- timerId = setTimeout(timerExpired, wait);
- return invokeFunc(lastCallTime);
- }
- }
- if (timerId === undefined$1) {
- timerId = setTimeout(timerExpired, wait);
- }
- return result2;
- }
- debounced.cancel = cancel;
- debounced.flush = flush;
- return debounced;
- }
- var defer = baseRest(function(func, args) {
- return baseDelay(func, 1, args);
- });
- var delay = baseRest(function(func, wait, args) {
- return baseDelay(func, toNumber(wait) || 0, args);
- });
- function flip(func) {
- return createWrap(func, WRAP_FLIP_FLAG);
- }
- function memoize(func, resolver) {
- if (typeof func != "function" || resolver != null && typeof resolver != "function") {
- throw new TypeError2(FUNC_ERROR_TEXT);
- }
- var memoized = function() {
- var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
- if (cache.has(key)) {
- return cache.get(key);
- }
- var result2 = func.apply(this, args);
- memoized.cache = cache.set(key, result2) || cache;
- return result2;
- };
- memoized.cache = new (memoize.Cache || MapCache)();
- return memoized;
- }
- memoize.Cache = MapCache;
- function negate(predicate) {
- if (typeof predicate != "function") {
- throw new TypeError2(FUNC_ERROR_TEXT);
- }
- return function() {
- var args = arguments;
- switch (args.length) {
- case 0:
- return !predicate.call(this);
- case 1:
- return !predicate.call(this, args[0]);
- case 2:
- return !predicate.call(this, args[0], args[1]);
- case 3:
- return !predicate.call(this, args[0], args[1], args[2]);
- }
- return !predicate.apply(this, args);
- };
- }
- function once(func) {
- return before(2, func);
- }
- var overArgs = castRest(function(func, transforms) {
- transforms = transforms.length == 1 && isArray(transforms[0]) ? arrayMap(transforms[0], baseUnary(getIteratee())) : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
- var funcsLength = transforms.length;
- return baseRest(function(args) {
- var index = -1, length = nativeMin(args.length, funcsLength);
- while (++index < length) {
- args[index] = transforms[index].call(this, args[index]);
- }
- return apply(func, this, args);
- });
- });
- var partial = baseRest(function(func, partials) {
- var holders = replaceHolders(partials, getHolder(partial));
- return createWrap(func, WRAP_PARTIAL_FLAG, undefined$1, partials, holders);
- });
- var partialRight = baseRest(function(func, partials) {
- var holders = replaceHolders(partials, getHolder(partialRight));
- return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined$1, partials, holders);
- });
- var rearg = flatRest(function(func, indexes) {
- return createWrap(func, WRAP_REARG_FLAG, undefined$1, undefined$1, undefined$1, indexes);
- });
- function rest(func, start) {
- if (typeof func != "function") {
- throw new TypeError2(FUNC_ERROR_TEXT);
- }
- start = start === undefined$1 ? start : toInteger(start);
- return baseRest(func, start);
- }
- function spread(func, start) {
- if (typeof func != "function") {
- throw new TypeError2(FUNC_ERROR_TEXT);
- }
- start = start == null ? 0 : nativeMax(toInteger(start), 0);
- return baseRest(function(args) {
- var array = args[start], otherArgs = castSlice(args, 0, start);
- if (array) {
- arrayPush(otherArgs, array);
- }
- return apply(func, this, otherArgs);
- });
- }
- function throttle(func, wait, options) {
- var leading = true, trailing = true;
- if (typeof func != "function") {
- throw new TypeError2(FUNC_ERROR_TEXT);
- }
- if (isObject(options)) {
- leading = "leading" in options ? !!options.leading : leading;
- trailing = "trailing" in options ? !!options.trailing : trailing;
- }
- return debounce(func, wait, {
- "leading": leading,
- "maxWait": wait,
- "trailing": trailing
- });
- }
- function unary(func) {
- return ary(func, 1);
- }
- function wrap(value, wrapper) {
- return partial(castFunction(wrapper), value);
- }
- function castArray() {
- if (!arguments.length) {
- return [];
- }
- var value = arguments[0];
- return isArray(value) ? value : [value];
- }
- function clone(value) {
- return baseClone(value, CLONE_SYMBOLS_FLAG);
- }
- function cloneWith(value, customizer) {
- customizer = typeof customizer == "function" ? customizer : undefined$1;
- return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
- }
- function cloneDeep(value) {
- return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
- }
- function cloneDeepWith(value, customizer) {
- customizer = typeof customizer == "function" ? customizer : undefined$1;
- return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
- }
- function conformsTo(object, source) {
- return source == null || baseConformsTo(object, source, keys(source));
- }
- function eq(value, other) {
- return value === other || value !== value && other !== other;
- }
- var gt = createRelationalOperation(baseGt);
- var gte = createRelationalOperation(function(value, other) {
- return value >= other;
- });
- var isArguments = baseIsArguments(function() {
- return arguments;
- }()) ? baseIsArguments : function(value) {
- return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
- };
- var isArray = Array2.isArray;
- var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
- function isArrayLike(value) {
- return value != null && isLength(value.length) && !isFunction(value);
- }
- function isArrayLikeObject(value) {
- return isObjectLike(value) && isArrayLike(value);
- }
- function isBoolean(value) {
- return value === true || value === false || isObjectLike(value) && baseGetTag(value) == boolTag;
- }
- var isBuffer = nativeIsBuffer || stubFalse;
- var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
- function isElement(value) {
- return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
- }
- function isEmpty(value) {
- if (value == null) {
- return true;
- }
- if (isArrayLike(value) && (isArray(value) || typeof value == "string" || typeof value.splice == "function" || isBuffer(value) || isTypedArray(value) || isArguments(value))) {
- return !value.length;
- }
- var tag = getTag(value);
- if (tag == mapTag || tag == setTag) {
- return !value.size;
- }
- if (isPrototype(value)) {
- return !baseKeys(value).length;
- }
- for (var key in value) {
- if (hasOwnProperty.call(value, key)) {
- return false;
- }
- }
- return true;
- }
- function isEqual(value, other) {
- return baseIsEqual(value, other);
- }
- function isEqualWith(value, other, customizer) {
- customizer = typeof customizer == "function" ? customizer : undefined$1;
- var result2 = customizer ? customizer(value, other) : undefined$1;
- return result2 === undefined$1 ? baseIsEqual(value, other, undefined$1, customizer) : !!result2;
- }
- function isError(value) {
- if (!isObjectLike(value)) {
- return false;
- }
- var tag = baseGetTag(value);
- return tag == errorTag || tag == domExcTag || typeof value.message == "string" && typeof value.name == "string" && !isPlainObject(value);
- }
- function isFinite2(value) {
- return typeof value == "number" && nativeIsFinite(value);
- }
- function isFunction(value) {
- if (!isObject(value)) {
- return false;
- }
- var tag = baseGetTag(value);
- return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
- }
- function isInteger(value) {
- return typeof value == "number" && value == toInteger(value);
- }
- function isLength(value) {
- return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
- }
- function isObject(value) {
- var type = typeof value;
- return value != null && (type == "object" || type == "function");
- }
- function isObjectLike(value) {
- return value != null && typeof value == "object";
- }
- var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
- function isMatch(object, source) {
- return object === source || baseIsMatch(object, source, getMatchData(source));
- }
- function isMatchWith(object, source, customizer) {
- customizer = typeof customizer == "function" ? customizer : undefined$1;
- return baseIsMatch(object, source, getMatchData(source), customizer);
- }
- function isNaN2(value) {
- return isNumber(value) && value != +value;
- }
- function isNative(value) {
- if (isMaskable(value)) {
- throw new Error2(CORE_ERROR_TEXT);
- }
- return baseIsNative(value);
- }
- function isNull(value) {
- return value === null;
- }
- function isNil(value) {
- return value == null;
- }
- function isNumber(value) {
- return typeof value == "number" || isObjectLike(value) && baseGetTag(value) == numberTag;
- }
- function isPlainObject(value) {
- if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
- return false;
- }
- var proto = getPrototype(value);
- if (proto === null) {
- return true;
- }
- var Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor;
- return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
- }
- var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
- function isSafeInteger(value) {
- return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
- }
- var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
- function isString(value) {
- return typeof value == "string" || !isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag;
- }
- function isSymbol(value) {
- return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag;
- }
- var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
- function isUndefined(value) {
- return value === undefined$1;
- }
- function isWeakMap(value) {
- return isObjectLike(value) && getTag(value) == weakMapTag;
- }
- function isWeakSet(value) {
- return isObjectLike(value) && baseGetTag(value) == weakSetTag;
- }
- var lt = createRelationalOperation(baseLt);
- var lte = createRelationalOperation(function(value, other) {
- return value <= other;
- });
- function toArray(value) {
- if (!value) {
- return [];
- }
- if (isArrayLike(value)) {
- return isString(value) ? stringToArray(value) : copyArray(value);
- }
- if (symIterator && value[symIterator]) {
- return iteratorToArray(value[symIterator]());
- }
- var tag = getTag(value), func = tag == mapTag ? mapToArray : tag == setTag ? setToArray : values;
- return func(value);
- }
- function toFinite(value) {
- if (!value) {
- return value === 0 ? value : 0;
- }
- value = toNumber(value);
- if (value === INFINITY || value === -INFINITY) {
- var sign = value < 0 ? -1 : 1;
- return sign * MAX_INTEGER;
- }
- return value === value ? value : 0;
- }
- function toInteger(value) {
- var result2 = toFinite(value), remainder = result2 % 1;
- return result2 === result2 ? remainder ? result2 - remainder : result2 : 0;
- }
- function toLength(value) {
- return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
- }
- function toNumber(value) {
- if (typeof value == "number") {
- return value;
- }
- if (isSymbol(value)) {
- return NAN;
- }
- if (isObject(value)) {
- var other = typeof value.valueOf == "function" ? value.valueOf() : value;
- value = isObject(other) ? other + "" : other;
- }
- if (typeof value != "string") {
- return value === 0 ? value : +value;
- }
- value = baseTrim(value);
- var isBinary = reIsBinary.test(value);
- return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
- }
- function toPlainObject(value) {
- return copyObject(value, keysIn(value));
- }
- function toSafeInteger(value) {
- return value ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) : value === 0 ? value : 0;
- }
- function toString(value) {
- return value == null ? "" : baseToString(value);
- }
- var assign = createAssigner(function(object, source) {
- if (isPrototype(source) || isArrayLike(source)) {
- copyObject(source, keys(source), object);
- return;
- }
- for (var key in source) {
- if (hasOwnProperty.call(source, key)) {
- assignValue(object, key, source[key]);
- }
- }
- });
- var assignIn = createAssigner(function(object, source) {
- copyObject(source, keysIn(source), object);
- });
- var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
- copyObject(source, keysIn(source), object, customizer);
- });
- var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
- copyObject(source, keys(source), object, customizer);
- });
- var at = flatRest(baseAt);
- function create(prototype, properties) {
- var result2 = baseCreate(prototype);
- return properties == null ? result2 : baseAssign(result2, properties);
- }
- var defaults = baseRest(function(object, sources) {
- object = Object2(object);
- var index = -1;
- var length = sources.length;
- var guard = length > 2 ? sources[2] : undefined$1;
- if (guard && isIterateeCall(sources[0], sources[1], guard)) {
- length = 1;
- }
- while (++index < length) {
- var source = sources[index];
- var props = keysIn(source);
- var propsIndex = -1;
- var propsLength = props.length;
- while (++propsIndex < propsLength) {
- var key = props[propsIndex];
- var value = object[key];
- if (value === undefined$1 || eq(value, objectProto[key]) && !hasOwnProperty.call(object, key)) {
- object[key] = source[key];
- }
- }
- }
- return object;
- });
- var defaultsDeep = baseRest(function(args) {
- args.push(undefined$1, customDefaultsMerge);
- return apply(mergeWith, undefined$1, args);
- });
- function findKey(object, predicate) {
- return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
- }
- function findLastKey(object, predicate) {
- return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
- }
- function forIn(object, iteratee2) {
- return object == null ? object : baseFor(object, getIteratee(iteratee2, 3), keysIn);
- }
- function forInRight(object, iteratee2) {
- return object == null ? object : baseForRight(object, getIteratee(iteratee2, 3), keysIn);
- }
- function forOwn(object, iteratee2) {
- return object && baseForOwn(object, getIteratee(iteratee2, 3));
- }
- function forOwnRight(object, iteratee2) {
- return object && baseForOwnRight(object, getIteratee(iteratee2, 3));
- }
- function functions(object) {
- return object == null ? [] : baseFunctions(object, keys(object));
- }
- function functionsIn(object) {
- return object == null ? [] : baseFunctions(object, keysIn(object));
- }
- function get(object, path, defaultValue) {
- var result2 = object == null ? undefined$1 : baseGet(object, path);
- return result2 === undefined$1 ? defaultValue : result2;
- }
- function has(object, path) {
- return object != null && hasPath(object, path, baseHas);
- }
- function hasIn(object, path) {
- return object != null && hasPath(object, path, baseHasIn);
- }
- var invert = createInverter(function(result2, value, key) {
- if (value != null && typeof value.toString != "function") {
- value = nativeObjectToString.call(value);
- }
- result2[value] = key;
- }, constant(identity));
- var invertBy = createInverter(function(result2, value, key) {
- if (value != null && typeof value.toString != "function") {
- value = nativeObjectToString.call(value);
- }
- if (hasOwnProperty.call(result2, value)) {
- result2[value].push(key);
- } else {
- result2[value] = [key];
- }
- }, getIteratee);
- var invoke = baseRest(baseInvoke);
- function keys(object) {
- return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
- }
- function keysIn(object) {
- return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
- }
- function mapKeys(object, iteratee2) {
- var result2 = {};
- iteratee2 = getIteratee(iteratee2, 3);
- baseForOwn(object, function(value, key, object2) {
- baseAssignValue(result2, iteratee2(value, key, object2), value);
- });
- return result2;
- }
- function mapValues(object, iteratee2) {
- var result2 = {};
- iteratee2 = getIteratee(iteratee2, 3);
- baseForOwn(object, function(value, key, object2) {
- baseAssignValue(result2, key, iteratee2(value, key, object2));
- });
- return result2;
- }
- var merge = createAssigner(function(object, source, srcIndex) {
- baseMerge(object, source, srcIndex);
- });
- var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
- baseMerge(object, source, srcIndex, customizer);
- });
- var omit = flatRest(function(object, paths) {
- var result2 = {};
- if (object == null) {
- return result2;
- }
- var isDeep = false;
- paths = arrayMap(paths, function(path) {
- path = castPath(path, object);
- isDeep || (isDeep = path.length > 1);
- return path;
- });
- copyObject(object, getAllKeysIn(object), result2);
- if (isDeep) {
- result2 = baseClone(result2, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
- }
- var length = paths.length;
- while (length--) {
- baseUnset(result2, paths[length]);
- }
- return result2;
- });
- function omitBy(object, predicate) {
- return pickBy(object, negate(getIteratee(predicate)));
- }
- var pick = flatRest(function(object, paths) {
- return object == null ? {} : basePick(object, paths);
- });
- function pickBy(object, predicate) {
- if (object == null) {
- return {};
- }
- var props = arrayMap(getAllKeysIn(object), function(prop) {
- return [prop];
- });
- predicate = getIteratee(predicate);
- return basePickBy(object, props, function(value, path) {
- return predicate(value, path[0]);
- });
- }
- function result(object, path, defaultValue) {
- path = castPath(path, object);
- var index = -1, length = path.length;
- if (!length) {
- length = 1;
- object = undefined$1;
- }
- while (++index < length) {
- var value = object == null ? undefined$1 : object[toKey(path[index])];
- if (value === undefined$1) {
- index = length;
- value = defaultValue;
- }
- object = isFunction(value) ? value.call(object) : value;
- }
- return object;
- }
- function set(object, path, value) {
- return object == null ? object : baseSet(object, path, value);
- }
- function setWith(object, path, value, customizer) {
- customizer = typeof customizer == "function" ? customizer : undefined$1;
- return object == null ? object : baseSet(object, path, value, customizer);
- }
- var toPairs = createToPairs(keys);
- var toPairsIn = createToPairs(keysIn);
- function transform(object, iteratee2, accumulator) {
- var isArr = isArray(object), isArrLike = isArr || isBuffer(object) || isTypedArray(object);
- iteratee2 = getIteratee(iteratee2, 4);
- if (accumulator == null) {
- var Ctor = object && object.constructor;
- if (isArrLike) {
- accumulator = isArr ? new Ctor() : [];
- } else if (isObject(object)) {
- accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
- } else {
- accumulator = {};
- }
- }
- (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object2) {
- return iteratee2(accumulator, value, index, object2);
- });
- return accumulator;
- }
- function unset(object, path) {
- return object == null ? true : baseUnset(object, path);
- }
- function update(object, path, updater) {
- return object == null ? object : baseUpdate(object, path, castFunction(updater));
- }
- function updateWith(object, path, updater, customizer) {
- customizer = typeof customizer == "function" ? customizer : undefined$1;
- return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
- }
- function values(object) {
- return object == null ? [] : baseValues(object, keys(object));
- }
- function valuesIn(object) {
- return object == null ? [] : baseValues(object, keysIn(object));
- }
- function clamp(number, lower, upper) {
- if (upper === undefined$1) {
- upper = lower;
- lower = undefined$1;
- }
- if (upper !== undefined$1) {
- upper = toNumber(upper);
- upper = upper === upper ? upper : 0;
- }
- if (lower !== undefined$1) {
- lower = toNumber(lower);
- lower = lower === lower ? lower : 0;
- }
- return baseClamp(toNumber(number), lower, upper);
- }
- function inRange(number, start, end) {
- start = toFinite(start);
- if (end === undefined$1) {
- end = start;
- start = 0;
- } else {
- end = toFinite(end);
- }
- number = toNumber(number);
- return baseInRange(number, start, end);
- }
- function random(lower, upper, floating) {
- if (floating && typeof floating != "boolean" && isIterateeCall(lower, upper, floating)) {
- upper = floating = undefined$1;
- }
- if (floating === undefined$1) {
- if (typeof upper == "boolean") {
- floating = upper;
- upper = undefined$1;
- } else if (typeof lower == "boolean") {
- floating = lower;
- lower = undefined$1;
- }
- }
- if (lower === undefined$1 && upper === undefined$1) {
- lower = 0;
- upper = 1;
- } else {
- lower = toFinite(lower);
- if (upper === undefined$1) {
- upper = lower;
- lower = 0;
- } else {
- upper = toFinite(upper);
- }
- }
- if (lower > upper) {
- var temp = lower;
- lower = upper;
- upper = temp;
- }
- if (floating || lower % 1 || upper % 1) {
- var rand = nativeRandom();
- return nativeMin(lower + rand * (upper - lower + freeParseFloat("1e-" + ((rand + "").length - 1))), upper);
- }
- return baseRandom(lower, upper);
- }
- var camelCase = createCompounder(function(result2, word, index) {
- word = word.toLowerCase();
- return result2 + (index ? capitalize(word) : word);
- });
- function capitalize(string) {
- return upperFirst(toString(string).toLowerCase());
- }
- function deburr(string) {
- string = toString(string);
- return string && string.replace(reLatin, deburrLetter).replace(reComboMark, "");
- }
- function endsWith(string, target, position) {
- string = toString(string);
- target = baseToString(target);
- var length = string.length;
- position = position === undefined$1 ? length : baseClamp(toInteger(position), 0, length);
- var end = position;
- position -= target.length;
- return position >= 0 && string.slice(position, end) == target;
- }
- function escape(string) {
- string = toString(string);
- return string && reHasUnescapedHtml.test(string) ? string.replace(reUnescapedHtml, escapeHtmlChar) : string;
- }
- function escapeRegExp(string) {
- string = toString(string);
- return string && reHasRegExpChar.test(string) ? string.replace(reRegExpChar, "\\$&") : string;
- }
- var kebabCase = createCompounder(function(result2, word, index) {
- return result2 + (index ? "-" : "") + word.toLowerCase();
- });
- var lowerCase = createCompounder(function(result2, word, index) {
- return result2 + (index ? " " : "") + word.toLowerCase();
- });
- var lowerFirst = createCaseFirst("toLowerCase");
- function pad(string, length, chars) {
- string = toString(string);
- length = toInteger(length);
- var strLength = length ? stringSize(string) : 0;
- if (!length || strLength >= length) {
- return string;
- }
- var mid = (length - strLength) / 2;
- return createPadding(nativeFloor(mid), chars) + string + createPadding(nativeCeil(mid), chars);
- }
- function padEnd(string, length, chars) {
- string = toString(string);
- length = toInteger(length);
- var strLength = length ? stringSize(string) : 0;
- return length && strLength < length ? string + createPadding(length - strLength, chars) : string;
- }
- function padStart(string, length, chars) {
- string = toString(string);
- length = toInteger(length);
- var strLength = length ? stringSize(string) : 0;
- return length && strLength < length ? createPadding(length - strLength, chars) + string : string;
- }
- function parseInt2(string, radix, guard) {
- if (guard || radix == null) {
- radix = 0;
- } else if (radix) {
- radix = +radix;
- }
- return nativeParseInt(toString(string).replace(reTrimStart, ""), radix || 0);
- }
- function repeat(string, n, guard) {
- if (guard ? isIterateeCall(string, n, guard) : n === undefined$1) {
- n = 1;
- } else {
- n = toInteger(n);
- }
- return baseRepeat(toString(string), n);
- }
- function replace() {
- var args = arguments, string = toString(args[0]);
- return args.length < 3 ? string : string.replace(args[1], args[2]);
- }
- var snakeCase = createCompounder(function(result2, word, index) {
- return result2 + (index ? "_" : "") + word.toLowerCase();
- });
- function split(string, separator, limit) {
- if (limit && typeof limit != "number" && isIterateeCall(string, separator, limit)) {
- separator = limit = undefined$1;
- }
- limit = limit === undefined$1 ? MAX_ARRAY_LENGTH : limit >>> 0;
- if (!limit) {
- return [];
- }
- string = toString(string);
- if (string && (typeof separator == "string" || separator != null && !isRegExp(separator))) {
- separator = baseToString(separator);
- if (!separator && hasUnicode(string)) {
- return castSlice(stringToArray(string), 0, limit);
- }
- }
- return string.split(separator, limit);
- }
- var startCase = createCompounder(function(result2, word, index) {
- return result2 + (index ? " " : "") + upperFirst(word);
- });
- function startsWith(string, target, position) {
- string = toString(string);
- position = position == null ? 0 : baseClamp(toInteger(position), 0, string.length);
- target = baseToString(target);
- return string.slice(position, position + target.length) == target;
- }
- function template(string, options, guard) {
- var settings = lodash2.templateSettings;
- if (guard && isIterateeCall(string, options, guard)) {
- options = undefined$1;
- }
- string = toString(string);
- options = assignInWith({}, options, settings, customDefaultsAssignIn);
- var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn), importsKeys = keys(imports), importsValues = baseValues(imports, importsKeys);
- var isEscaping, isEvaluating, index = 0, interpolate = options.interpolate || reNoMatch, source = "__p += '";
- var reDelimiters = RegExp2(
- (options.escape || reNoMatch).source + "|" + interpolate.source + "|" + (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + "|" + (options.evaluate || reNoMatch).source + "|$",
- "g"
- );
- var sourceURL = "//# sourceURL=" + (hasOwnProperty.call(options, "sourceURL") ? (options.sourceURL + "").replace(/\s/g, " ") : "lodash.templateSources[" + ++templateCounter + "]") + "\n";
- string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
- interpolateValue || (interpolateValue = esTemplateValue);
- source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
- if (escapeValue) {
- isEscaping = true;
- source += "' +\n__e(" + escapeValue + ") +\n'";
- }
- if (evaluateValue) {
- isEvaluating = true;
- source += "';\n" + evaluateValue + ";\n__p += '";
- }
- if (interpolateValue) {
- source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
- }
- index = offset + match.length;
- return match;
- });
- source += "';\n";
- var variable = hasOwnProperty.call(options, "variable") && options.variable;
- if (!variable) {
- source = "with (obj) {\n" + source + "\n}\n";
- } else if (reForbiddenIdentifierChars.test(variable)) {
- throw new Error2(INVALID_TEMPL_VAR_ERROR_TEXT);
- }
- source = (isEvaluating ? source.replace(reEmptyStringLeading, "") : source).replace(reEmptyStringMiddle, "$1").replace(reEmptyStringTrailing, "$1;");
- 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}";
- var result2 = attempt(function() {
- return Function2(importsKeys, sourceURL + "return " + source).apply(undefined$1, importsValues);
- });
- result2.source = source;
- if (isError(result2)) {
- throw result2;
- }
- return result2;
- }
- function toLower(value) {
- return toString(value).toLowerCase();
- }
- function toUpper(value) {
- return toString(value).toUpperCase();
- }
- function trim(string, chars, guard) {
- string = toString(string);
- if (string && (guard || chars === undefined$1)) {
- return baseTrim(string);
- }
- if (!string || !(chars = baseToString(chars))) {
- return string;
- }
- var strSymbols = stringToArray(string), chrSymbols = stringToArray(chars), start = charsStartIndex(strSymbols, chrSymbols), end = charsEndIndex(strSymbols, chrSymbols) + 1;
- return castSlice(strSymbols, start, end).join("");
- }
- function trimEnd(string, chars, guard) {
- string = toString(string);
- if (string && (guard || chars === undefined$1)) {
- return string.slice(0, trimmedEndIndex(string) + 1);
- }
- if (!string || !(chars = baseToString(chars))) {
- return string;
- }
- var strSymbols = stringToArray(string), end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
- return castSlice(strSymbols, 0, end).join("");
- }
- function trimStart(string, chars, guard) {
- string = toString(string);
- if (string && (guard || chars === undefined$1)) {
- return string.replace(reTrimStart, "");
- }
- if (!string || !(chars = baseToString(chars))) {
- return string;
- }
- var strSymbols = stringToArray(string), start = charsStartIndex(strSymbols, stringToArray(chars));
- return castSlice(strSymbols, start).join("");
- }
- function truncate(string, options) {
- var length = DEFAULT_TRUNC_LENGTH, omission = DEFAULT_TRUNC_OMISSION;
- if (isObject(options)) {
- var separator = "separator" in options ? options.separator : separator;
- length = "length" in options ? toInteger(options.length) : length;
- omission = "omission" in options ? baseToString(options.omission) : omission;
- }
- string = toString(string);
- var strLength = string.length;
- if (hasUnicode(string)) {
- var strSymbols = stringToArray(string);
- strLength = strSymbols.length;
- }
- if (length >= strLength) {
- return string;
- }
- var end = length - stringSize(omission);
- if (end < 1) {
- return omission;
- }
- var result2 = strSymbols ? castSlice(strSymbols, 0, end).join("") : string.slice(0, end);
- if (separator === undefined$1) {
- return result2 + omission;
- }
- if (strSymbols) {
- end += result2.length - end;
- }
- if (isRegExp(separator)) {
- if (string.slice(end).search(separator)) {
- var match, substring = result2;
- if (!separator.global) {
- separator = RegExp2(separator.source, toString(reFlags.exec(separator)) + "g");
- }
- separator.lastIndex = 0;
- while (match = separator.exec(substring)) {
- var newEnd = match.index;
- }
- result2 = result2.slice(0, newEnd === undefined$1 ? end : newEnd);
- }
- } else if (string.indexOf(baseToString(separator), end) != end) {
- var index = result2.lastIndexOf(separator);
- if (index > -1) {
- result2 = result2.slice(0, index);
- }
- }
- return result2 + omission;
- }
- function unescape(string) {
- string = toString(string);
- return string && reHasEscapedHtml.test(string) ? string.replace(reEscapedHtml, unescapeHtmlChar) : string;
- }
- var upperCase = createCompounder(function(result2, word, index) {
- return result2 + (index ? " " : "") + word.toUpperCase();
- });
- var upperFirst = createCaseFirst("toUpperCase");
- function words(string, pattern, guard) {
- string = toString(string);
- pattern = guard ? undefined$1 : pattern;
- if (pattern === undefined$1) {
- return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
- }
- return string.match(pattern) || [];
- }
- var attempt = baseRest(function(func, args) {
- try {
- return apply(func, undefined$1, args);
- } catch (e) {
- return isError(e) ? e : new Error2(e);
- }
- });
- var bindAll = flatRest(function(object, methodNames) {
- arrayEach(methodNames, function(key) {
- key = toKey(key);
- baseAssignValue(object, key, bind(object[key], object));
- });
- return object;
- });
- function cond(pairs) {
- var length = pairs == null ? 0 : pairs.length, toIteratee = getIteratee();
- pairs = !length ? [] : arrayMap(pairs, function(pair) {
- if (typeof pair[1] != "function") {
- throw new TypeError2(FUNC_ERROR_TEXT);
- }
- return [toIteratee(pair[0]), pair[1]];
- });
- return baseRest(function(args) {
- var index = -1;
- while (++index < length) {
- var pair = pairs[index];
- if (apply(pair[0], this, args)) {
- return apply(pair[1], this, args);
- }
- }
- });
- }
- function conforms(source) {
- return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
- }
- function constant(value) {
- return function() {
- return value;
- };
- }
- function defaultTo(value, defaultValue) {
- return value == null || value !== value ? defaultValue : value;
- }
- var flow = createFlow();
- var flowRight = createFlow(true);
- function identity(value) {
- return value;
- }
- function iteratee(func) {
- return baseIteratee(typeof func == "function" ? func : baseClone(func, CLONE_DEEP_FLAG));
- }
- function matches(source) {
- return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
- }
- function matchesProperty(path, srcValue) {
- return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
- }
- var method = baseRest(function(path, args) {
- return function(object) {
- return baseInvoke(object, path, args);
- };
- });
- var methodOf = baseRest(function(object, args) {
- return function(path) {
- return baseInvoke(object, path, args);
- };
- });
- function mixin(object, source, options) {
- var props = keys(source), methodNames = baseFunctions(source, props);
- if (options == null && !(isObject(source) && (methodNames.length || !props.length))) {
- options = source;
- source = object;
- object = this;
- methodNames = baseFunctions(source, keys(source));
- }
- var chain2 = !(isObject(options) && "chain" in options) || !!options.chain, isFunc = isFunction(object);
- arrayEach(methodNames, function(methodName) {
- var func = source[methodName];
- object[methodName] = func;
- if (isFunc) {
- object.prototype[methodName] = function() {
- var chainAll = this.__chain__;
- if (chain2 || chainAll) {
- var result2 = object(this.__wrapped__), actions = result2.__actions__ = copyArray(this.__actions__);
- actions.push({ "func": func, "args": arguments, "thisArg": object });
- result2.__chain__ = chainAll;
- return result2;
- }
- return func.apply(object, arrayPush([this.value()], arguments));
- };
- }
- });
- return object;
- }
- function noConflict() {
- if (root._ === this) {
- root._ = oldDash;
- }
- return this;
- }
- function noop() {
- }
- function nthArg(n) {
- n = toInteger(n);
- return baseRest(function(args) {
- return baseNth(args, n);
- });
- }
- var over = createOver(arrayMap);
- var overEvery = createOver(arrayEvery);
- var overSome = createOver(arraySome);
- function property(path) {
- return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
- }
- function propertyOf(object) {
- return function(path) {
- return object == null ? undefined$1 : baseGet(object, path);
- };
- }
- var range = createRange();
- var rangeRight = createRange(true);
- function stubArray() {
- return [];
- }
- function stubFalse() {
- return false;
- }
- function stubObject() {
- return {};
- }
- function stubString() {
- return "";
- }
- function stubTrue() {
- return true;
- }
- function times(n, iteratee2) {
- n = toInteger(n);
- if (n < 1 || n > MAX_SAFE_INTEGER) {
- return [];
- }
- var index = MAX_ARRAY_LENGTH, length = nativeMin(n, MAX_ARRAY_LENGTH);
- iteratee2 = getIteratee(iteratee2);
- n -= MAX_ARRAY_LENGTH;
- var result2 = baseTimes(length, iteratee2);
- while (++index < n) {
- iteratee2(index);
- }
- return result2;
- }
- function toPath(value) {
- if (isArray(value)) {
- return arrayMap(value, toKey);
- }
- return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
- }
- function uniqueId(prefix) {
- var id = ++idCounter;
- return toString(prefix) + id;
- }
- var add = createMathOperation(function(augend, addend) {
- return augend + addend;
- }, 0);
- var ceil = createRound("ceil");
- var divide = createMathOperation(function(dividend, divisor) {
- return dividend / divisor;
- }, 1);
- var floor = createRound("floor");
- function max(array) {
- return array && array.length ? baseExtremum(array, identity, baseGt) : undefined$1;
- }
- function maxBy(array, iteratee2) {
- return array && array.length ? baseExtremum(array, getIteratee(iteratee2, 2), baseGt) : undefined$1;
- }
- function mean(array) {
- return baseMean(array, identity);
- }
- function meanBy(array, iteratee2) {
- return baseMean(array, getIteratee(iteratee2, 2));
- }
- function min(array) {
- return array && array.length ? baseExtremum(array, identity, baseLt) : undefined$1;
- }
- function minBy(array, iteratee2) {
- return array && array.length ? baseExtremum(array, getIteratee(iteratee2, 2), baseLt) : undefined$1;
- }
- var multiply = createMathOperation(function(multiplier, multiplicand) {
- return multiplier * multiplicand;
- }, 1);
- var round = createRound("round");
- var subtract = createMathOperation(function(minuend, subtrahend) {
- return minuend - subtrahend;
- }, 0);
- function sum(array) {
- return array && array.length ? baseSum(array, identity) : 0;
- }
- function sumBy(array, iteratee2) {
- return array && array.length ? baseSum(array, getIteratee(iteratee2, 2)) : 0;
- }
- lodash2.after = after;
- lodash2.ary = ary;
- lodash2.assign = assign;
- lodash2.assignIn = assignIn;
- lodash2.assignInWith = assignInWith;
- lodash2.assignWith = assignWith;
- lodash2.at = at;
- lodash2.before = before;
- lodash2.bind = bind;
- lodash2.bindAll = bindAll;
- lodash2.bindKey = bindKey;
- lodash2.castArray = castArray;
- lodash2.chain = chain;
- lodash2.chunk = chunk;
- lodash2.compact = compact;
- lodash2.concat = concat;
- lodash2.cond = cond;
- lodash2.conforms = conforms;
- lodash2.constant = constant;
- lodash2.countBy = countBy;
- lodash2.create = create;
- lodash2.curry = curry;
- lodash2.curryRight = curryRight;
- lodash2.debounce = debounce;
- lodash2.defaults = defaults;
- lodash2.defaultsDeep = defaultsDeep;
- lodash2.defer = defer;
- lodash2.delay = delay;
- lodash2.difference = difference;
- lodash2.differenceBy = differenceBy;
- lodash2.differenceWith = differenceWith;
- lodash2.drop = drop;
- lodash2.dropRight = dropRight;
- lodash2.dropRightWhile = dropRightWhile;
- lodash2.dropWhile = dropWhile;
- lodash2.fill = fill;
- lodash2.filter = filter;
- lodash2.flatMap = flatMap;
- lodash2.flatMapDeep = flatMapDeep;
- lodash2.flatMapDepth = flatMapDepth;
- lodash2.flatten = flatten;
- lodash2.flattenDeep = flattenDeep;
- lodash2.flattenDepth = flattenDepth;
- lodash2.flip = flip;
- lodash2.flow = flow;
- lodash2.flowRight = flowRight;
- lodash2.fromPairs = fromPairs;
- lodash2.functions = functions;
- lodash2.functionsIn = functionsIn;
- lodash2.groupBy = groupBy;
- lodash2.initial = initial;
- lodash2.intersection = intersection;
- lodash2.intersectionBy = intersectionBy;
- lodash2.intersectionWith = intersectionWith;
- lodash2.invert = invert;
- lodash2.invertBy = invertBy;
- lodash2.invokeMap = invokeMap;
- lodash2.iteratee = iteratee;
- lodash2.keyBy = keyBy;
- lodash2.keys = keys;
- lodash2.keysIn = keysIn;
- lodash2.map = map;
- lodash2.mapKeys = mapKeys;
- lodash2.mapValues = mapValues;
- lodash2.matches = matches;
- lodash2.matchesProperty = matchesProperty;
- lodash2.memoize = memoize;
- lodash2.merge = merge;
- lodash2.mergeWith = mergeWith;
- lodash2.method = method;
- lodash2.methodOf = methodOf;
- lodash2.mixin = mixin;
- lodash2.negate = negate;
- lodash2.nthArg = nthArg;
- lodash2.omit = omit;
- lodash2.omitBy = omitBy;
- lodash2.once = once;
- lodash2.orderBy = orderBy;
- lodash2.over = over;
- lodash2.overArgs = overArgs;
- lodash2.overEvery = overEvery;
- lodash2.overSome = overSome;
- lodash2.partial = partial;
- lodash2.partialRight = partialRight;
- lodash2.partition = partition;
- lodash2.pick = pick;
- lodash2.pickBy = pickBy;
- lodash2.property = property;
- lodash2.propertyOf = propertyOf;
- lodash2.pull = pull;
- lodash2.pullAll = pullAll;
- lodash2.pullAllBy = pullAllBy;
- lodash2.pullAllWith = pullAllWith;
- lodash2.pullAt = pullAt;
- lodash2.range = range;
- lodash2.rangeRight = rangeRight;
- lodash2.rearg = rearg;
- lodash2.reject = reject;
- lodash2.remove = remove;
- lodash2.rest = rest;
- lodash2.reverse = reverse;
- lodash2.sampleSize = sampleSize;
- lodash2.set = set;
- lodash2.setWith = setWith;
- lodash2.shuffle = shuffle;
- lodash2.slice = slice;
- lodash2.sortBy = sortBy;
- lodash2.sortedUniq = sortedUniq;
- lodash2.sortedUniqBy = sortedUniqBy;
- lodash2.split = split;
- lodash2.spread = spread;
- lodash2.tail = tail;
- lodash2.take = take;
- lodash2.takeRight = takeRight;
- lodash2.takeRightWhile = takeRightWhile;
- lodash2.takeWhile = takeWhile;
- lodash2.tap = tap;
- lodash2.throttle = throttle;
- lodash2.thru = thru;
- lodash2.toArray = toArray;
- lodash2.toPairs = toPairs;
- lodash2.toPairsIn = toPairsIn;
- lodash2.toPath = toPath;
- lodash2.toPlainObject = toPlainObject;
- lodash2.transform = transform;
- lodash2.unary = unary;
- lodash2.union = union;
- lodash2.unionBy = unionBy;
- lodash2.unionWith = unionWith;
- lodash2.uniq = uniq;
- lodash2.uniqBy = uniqBy;
- lodash2.uniqWith = uniqWith;
- lodash2.unset = unset;
- lodash2.unzip = unzip;
- lodash2.unzipWith = unzipWith;
- lodash2.update = update;
- lodash2.updateWith = updateWith;
- lodash2.values = values;
- lodash2.valuesIn = valuesIn;
- lodash2.without = without;
- lodash2.words = words;
- lodash2.wrap = wrap;
- lodash2.xor = xor;
- lodash2.xorBy = xorBy;
- lodash2.xorWith = xorWith;
- lodash2.zip = zip;
- lodash2.zipObject = zipObject;
- lodash2.zipObjectDeep = zipObjectDeep;
- lodash2.zipWith = zipWith;
- lodash2.entries = toPairs;
- lodash2.entriesIn = toPairsIn;
- lodash2.extend = assignIn;
- lodash2.extendWith = assignInWith;
- mixin(lodash2, lodash2);
- lodash2.add = add;
- lodash2.attempt = attempt;
- lodash2.camelCase = camelCase;
- lodash2.capitalize = capitalize;
- lodash2.ceil = ceil;
- lodash2.clamp = clamp;
- lodash2.clone = clone;
- lodash2.cloneDeep = cloneDeep;
- lodash2.cloneDeepWith = cloneDeepWith;
- lodash2.cloneWith = cloneWith;
- lodash2.conformsTo = conformsTo;
- lodash2.deburr = deburr;
- lodash2.defaultTo = defaultTo;
- lodash2.divide = divide;
- lodash2.endsWith = endsWith;
- lodash2.eq = eq;
- lodash2.escape = escape;
- lodash2.escapeRegExp = escapeRegExp;
- lodash2.every = every;
- lodash2.find = find;
- lodash2.findIndex = findIndex;
- lodash2.findKey = findKey;
- lodash2.findLast = findLast;
- lodash2.findLastIndex = findLastIndex;
- lodash2.findLastKey = findLastKey;
- lodash2.floor = floor;
- lodash2.forEach = forEach;
- lodash2.forEachRight = forEachRight;
- lodash2.forIn = forIn;
- lodash2.forInRight = forInRight;
- lodash2.forOwn = forOwn;
- lodash2.forOwnRight = forOwnRight;
- lodash2.get = get;
- lodash2.gt = gt;
- lodash2.gte = gte;
- lodash2.has = has;
- lodash2.hasIn = hasIn;
- lodash2.head = head;
- lodash2.identity = identity;
- lodash2.includes = includes;
- lodash2.indexOf = indexOf;
- lodash2.inRange = inRange;
- lodash2.invoke = invoke;
- lodash2.isArguments = isArguments;
- lodash2.isArray = isArray;
- lodash2.isArrayBuffer = isArrayBuffer;
- lodash2.isArrayLike = isArrayLike;
- lodash2.isArrayLikeObject = isArrayLikeObject;
- lodash2.isBoolean = isBoolean;
- lodash2.isBuffer = isBuffer;
- lodash2.isDate = isDate;
- lodash2.isElement = isElement;
- lodash2.isEmpty = isEmpty;
- lodash2.isEqual = isEqual;
- lodash2.isEqualWith = isEqualWith;
- lodash2.isError = isError;
- lodash2.isFinite = isFinite2;
- lodash2.isFunction = isFunction;
- lodash2.isInteger = isInteger;
- lodash2.isLength = isLength;
- lodash2.isMap = isMap;
- lodash2.isMatch = isMatch;
- lodash2.isMatchWith = isMatchWith;
- lodash2.isNaN = isNaN2;
- lodash2.isNative = isNative;
- lodash2.isNil = isNil;
- lodash2.isNull = isNull;
- lodash2.isNumber = isNumber;
- lodash2.isObject = isObject;
- lodash2.isObjectLike = isObjectLike;
- lodash2.isPlainObject = isPlainObject;
- lodash2.isRegExp = isRegExp;
- lodash2.isSafeInteger = isSafeInteger;
- lodash2.isSet = isSet;
- lodash2.isString = isString;
- lodash2.isSymbol = isSymbol;
- lodash2.isTypedArray = isTypedArray;
- lodash2.isUndefined = isUndefined;
- lodash2.isWeakMap = isWeakMap;
- lodash2.isWeakSet = isWeakSet;
- lodash2.join = join;
- lodash2.kebabCase = kebabCase;
- lodash2.last = last;
- lodash2.lastIndexOf = lastIndexOf;
- lodash2.lowerCase = lowerCase;
- lodash2.lowerFirst = lowerFirst;
- lodash2.lt = lt;
- lodash2.lte = lte;
- lodash2.max = max;
- lodash2.maxBy = maxBy;
- lodash2.mean = mean;
- lodash2.meanBy = meanBy;
- lodash2.min = min;
- lodash2.minBy = minBy;
- lodash2.stubArray = stubArray;
- lodash2.stubFalse = stubFalse;
- lodash2.stubObject = stubObject;
- lodash2.stubString = stubString;
- lodash2.stubTrue = stubTrue;
- lodash2.multiply = multiply;
- lodash2.nth = nth;
- lodash2.noConflict = noConflict;
- lodash2.noop = noop;
- lodash2.now = now;
- lodash2.pad = pad;
- lodash2.padEnd = padEnd;
- lodash2.padStart = padStart;
- lodash2.parseInt = parseInt2;
- lodash2.random = random;
- lodash2.reduce = reduce;
- lodash2.reduceRight = reduceRight;
- lodash2.repeat = repeat;
- lodash2.replace = replace;
- lodash2.result = result;
- lodash2.round = round;
- lodash2.runInContext = runInContext2;
- lodash2.sample = sample;
- lodash2.size = size;
- lodash2.snakeCase = snakeCase;
- lodash2.some = some;
- lodash2.sortedIndex = sortedIndex;
- lodash2.sortedIndexBy = sortedIndexBy;
- lodash2.sortedIndexOf = sortedIndexOf;
- lodash2.sortedLastIndex = sortedLastIndex;
- lodash2.sortedLastIndexBy = sortedLastIndexBy;
- lodash2.sortedLastIndexOf = sortedLastIndexOf;
- lodash2.startCase = startCase;
- lodash2.startsWith = startsWith;
- lodash2.subtract = subtract;
- lodash2.sum = sum;
- lodash2.sumBy = sumBy;
- lodash2.template = template;
- lodash2.times = times;
- lodash2.toFinite = toFinite;
- lodash2.toInteger = toInteger;
- lodash2.toLength = toLength;
- lodash2.toLower = toLower;
- lodash2.toNumber = toNumber;
- lodash2.toSafeInteger = toSafeInteger;
- lodash2.toString = toString;
- lodash2.toUpper = toUpper;
- lodash2.trim = trim;
- lodash2.trimEnd = trimEnd;
- lodash2.trimStart = trimStart;
- lodash2.truncate = truncate;
- lodash2.unescape = unescape;
- lodash2.uniqueId = uniqueId;
- lodash2.upperCase = upperCase;
- lodash2.upperFirst = upperFirst;
- lodash2.each = forEach;
- lodash2.eachRight = forEachRight;
- lodash2.first = head;
- mixin(lodash2, function() {
- var source = {};
- baseForOwn(lodash2, function(func, methodName) {
- if (!hasOwnProperty.call(lodash2.prototype, methodName)) {
- source[methodName] = func;
- }
- });
- return source;
- }(), { "chain": false });
- lodash2.VERSION = VERSION;
- arrayEach(["bind", "bindKey", "curry", "curryRight", "partial", "partialRight"], function(methodName) {
- lodash2[methodName].placeholder = lodash2;
- });
- arrayEach(["drop", "take"], function(methodName, index) {
- LazyWrapper.prototype[methodName] = function(n) {
- n = n === undefined$1 ? 1 : nativeMax(toInteger(n), 0);
- var result2 = this.__filtered__ && !index ? new LazyWrapper(this) : this.clone();
- if (result2.__filtered__) {
- result2.__takeCount__ = nativeMin(n, result2.__takeCount__);
- } else {
- result2.__views__.push({
- "size": nativeMin(n, MAX_ARRAY_LENGTH),
- "type": methodName + (result2.__dir__ < 0 ? "Right" : "")
- });
- }
- return result2;
- };
- LazyWrapper.prototype[methodName + "Right"] = function(n) {
- return this.reverse()[methodName](n).reverse();
- };
- });
- arrayEach(["filter", "map", "takeWhile"], function(methodName, index) {
- var type = index + 1, isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
- LazyWrapper.prototype[methodName] = function(iteratee2) {
- var result2 = this.clone();
- result2.__iteratees__.push({
- "iteratee": getIteratee(iteratee2, 3),
- "type": type
- });
- result2.__filtered__ = result2.__filtered__ || isFilter;
- return result2;
- };
- });
- arrayEach(["head", "last"], function(methodName, index) {
- var takeName = "take" + (index ? "Right" : "");
- LazyWrapper.prototype[methodName] = function() {
- return this[takeName](1).value()[0];
- };
- });
- arrayEach(["initial", "tail"], function(methodName, index) {
- var dropName = "drop" + (index ? "" : "Right");
- LazyWrapper.prototype[methodName] = function() {
- return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
- };
- });
- LazyWrapper.prototype.compact = function() {
- return this.filter(identity);
- };
- LazyWrapper.prototype.find = function(predicate) {
- return this.filter(predicate).head();
- };
- LazyWrapper.prototype.findLast = function(predicate) {
- return this.reverse().find(predicate);
- };
- LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
- if (typeof path == "function") {
- return new LazyWrapper(this);
- }
- return this.map(function(value) {
- return baseInvoke(value, path, args);
- });
- });
- LazyWrapper.prototype.reject = function(predicate) {
- return this.filter(negate(getIteratee(predicate)));
- };
- LazyWrapper.prototype.slice = function(start, end) {
- start = toInteger(start);
- var result2 = this;
- if (result2.__filtered__ && (start > 0 || end < 0)) {
- return new LazyWrapper(result2);
- }
- if (start < 0) {
- result2 = result2.takeRight(-start);
- } else if (start) {
- result2 = result2.drop(start);
- }
- if (end !== undefined$1) {
- end = toInteger(end);
- result2 = end < 0 ? result2.dropRight(-end) : result2.take(end - start);
- }
- return result2;
- };
- LazyWrapper.prototype.takeRightWhile = function(predicate) {
- return this.reverse().takeWhile(predicate).reverse();
- };
- LazyWrapper.prototype.toArray = function() {
- return this.take(MAX_ARRAY_LENGTH);
- };
- baseForOwn(LazyWrapper.prototype, function(func, methodName) {
- 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);
- if (!lodashFunc) {
- return;
- }
- lodash2.prototype[methodName] = function() {
- var value = this.__wrapped__, args = isTaker ? [1] : arguments, isLazy = value instanceof LazyWrapper, iteratee2 = args[0], useLazy = isLazy || isArray(value);
- var interceptor = function(value2) {
- var result3 = lodashFunc.apply(lodash2, arrayPush([value2], args));
- return isTaker && chainAll ? result3[0] : result3;
- };
- if (useLazy && checkIteratee && typeof iteratee2 == "function" && iteratee2.length != 1) {
- isLazy = useLazy = false;
- }
- var chainAll = this.__chain__, isHybrid = !!this.__actions__.length, isUnwrapped = retUnwrapped && !chainAll, onlyLazy = isLazy && !isHybrid;
- if (!retUnwrapped && useLazy) {
- value = onlyLazy ? value : new LazyWrapper(this);
- var result2 = func.apply(value, args);
- result2.__actions__.push({ "func": thru, "args": [interceptor], "thisArg": undefined$1 });
- return new LodashWrapper(result2, chainAll);
- }
- if (isUnwrapped && onlyLazy) {
- return func.apply(this, args);
- }
- result2 = this.thru(interceptor);
- return isUnwrapped ? isTaker ? result2.value()[0] : result2.value() : result2;
- };
- });
- arrayEach(["pop", "push", "shift", "sort", "splice", "unshift"], function(methodName) {
- var func = arrayProto[methodName], chainName = /^(?:push|sort|unshift)$/.test(methodName) ? "tap" : "thru", retUnwrapped = /^(?:pop|shift)$/.test(methodName);
- lodash2.prototype[methodName] = function() {
- var args = arguments;
- if (retUnwrapped && !this.__chain__) {
- var value = this.value();
- return func.apply(isArray(value) ? value : [], args);
- }
- return this[chainName](function(value2) {
- return func.apply(isArray(value2) ? value2 : [], args);
- });
- };
- });
- baseForOwn(LazyWrapper.prototype, function(func, methodName) {
- var lodashFunc = lodash2[methodName];
- if (lodashFunc) {
- var key = lodashFunc.name + "";
- if (!hasOwnProperty.call(realNames, key)) {
- realNames[key] = [];
- }
- realNames[key].push({ "name": methodName, "func": lodashFunc });
- }
- });
- realNames[createHybrid(undefined$1, WRAP_BIND_KEY_FLAG).name] = [{
- "name": "wrapper",
- "func": undefined$1
- }];
- LazyWrapper.prototype.clone = lazyClone;
- LazyWrapper.prototype.reverse = lazyReverse;
- LazyWrapper.prototype.value = lazyValue;
- lodash2.prototype.at = wrapperAt;
- lodash2.prototype.chain = wrapperChain;
- lodash2.prototype.commit = wrapperCommit;
- lodash2.prototype.next = wrapperNext;
- lodash2.prototype.plant = wrapperPlant;
- lodash2.prototype.reverse = wrapperReverse;
- lodash2.prototype.toJSON = lodash2.prototype.valueOf = lodash2.prototype.value = wrapperValue;
- lodash2.prototype.first = lodash2.prototype.head;
- if (symIterator) {
- lodash2.prototype[symIterator] = wrapperToIterator;
- }
- return lodash2;
- };
- var _ = runInContext();
- if (freeModule) {
- (freeModule.exports = _)._ = _;
- freeExports._ = _;
- } else {
- root._ = _;
- }
- }).call(commonjsGlobal);
- })(lodash, lodash.exports);
- var lodashExports = lodash.exports;
- class ListRuleB extends RuleBaseInterface {
- constructor(config = {}) {
- super();
- __publicField(this, "config", {
- onlyTodayData: false,
- // 是否只保留当天的数据
- defaultContainerSelector: "body",
- defaultContainer: document.body
- });
- // 寻找父级列表时,找寻的最大级数
- __publicField(this, "findParentsMaxDeep", 5);
- if (config) {
- Object.assign(this.config, config);
- if (config.defaultContainerSelector) {
- const wrapper = document.querySelector(config.defaultContainerSelector);
- if (wrapper) {
- this.config.defaultContainer = wrapper;
- }
- }
- }
- }
- // 主函数:处理DOM并返回所需信息
- run(container = this.config.defaultContainer) {
- if (typeof container === "string") {
- container = document.querySelector(container);
- }
- const { onlyTodayData } = this.config;
- const eligibleNodes = this.findEligibleLeafNodesForContentLtMark(container);
- const findResultNodeList = this.findResultNodeList(eligibleNodes);
- const resultNode = findResultNodeList.filter((temp) => {
- return temp.length > 0;
- });
- const { resultList, todayList, listSelector } = this.calcResultList(resultNode);
- const result = {
- todayHasData: todayList.length > 0,
- todayData: onlyTodayData ? todayList : resultList,
- listSelector
- };
- this.report(result);
- console.log(result, todayList);
- return result;
- }
- check() {
- }
- // 节点过滤
- findResultNodeList(eligibleNodes = []) {
- eligibleNodes.forEach((node, index) => {
- node._index_find = index;
- });
- const groupedNodes = this.groupNodes(eligibleNodes);
- const needNodes = this.checkNeedGroupNode(groupedNodes);
- const correctedNodes = this.checkNodeCountCorrect(needNodes);
- const nodeInfoList = this.calcNodesInfo(correctedNodes);
- return nodeInfoList;
- }
- calcNodesInfo(list = []) {
- const result = list.map((group) => {
- const parentSelector = this.generateCSSSelector(group[0]._listItem);
- const hasDateNode = group.filter((gChildren) => {
- const arr = this.hasDateElement(gChildren._listItem);
- return arr.some((item) => item.hasDate);
- });
- const dateElementSelector = hasDateNode.map((item) => {
- const date = this.hasDateElement(item._listItem).filter((temp) => {
- return temp.hasDate;
- });
- return {
- ...item,
- dateArr: date
- };
- });
- const formatted = dateElementSelector.map((nodeObj) => {
- nodeObj.selector = this.generateCSSSelector(nodeObj.node);
- const href = this.getNodeHref(nodeObj);
- return {
- text: nodeObj.text,
- date: nodeObj.dateArr[0].date,
- selector: nodeObj.selector,
- href,
- listSelector: this.generateCSSSelector(nodeObj._list),
- parentSelector,
- // 后续排序索引
- _index_find: nodeObj._index_find,
- _index_in_list: this.$(nodeObj._listItem).index()
- };
- });
- return formatted;
- });
- return result;
- }
- getNodeHref(node) {
- var _a;
- let href = "";
- if (node._listItem) {
- const $listItem = this.$(node._listItem);
- const $a = $listItem.find("a[href]");
- href = (_a = $a[0]) == null ? void 0 : _a.href;
- }
- return href;
- }
- todayDateTest(text = "") {
- let pass = false;
- if (!text)
- return pass;
- const nowDayRegList = this.getTodayDateReg();
- for (let i = 0; i < nowDayRegList.length; i++) {
- const item = nowDayRegList[i];
- if (item.test(text)) {
- pass = true;
- break;
- }
- }
- return pass;
- }
- calcResultList(resultNode = []) {
- const todayList = [];
- const resultList = resultNode.flat();
- let calcSortKey = "_index_find";
- if (resultList[0] && resultList[0]._index_in_list) {
- const _index_in_list = resultList[0]._index_in_list;
- if (_index_in_list !== -1) {
- calcSortKey = "_index_in_list";
- }
- }
- const sortedResultList = resultList.sort((a, b) => a[calcSortKey] - b[calcSortKey]);
- sortedResultList.forEach((r2) => {
- const dateArr = r2.date;
- delete r2._index_find;
- delete r2._index_in_list;
- if (Array.isArray(dateArr)) {
- for (let i = 0; i < dateArr.length; i++) {
- const item = dateArr[i];
- const today = this.todayDateTest(item);
- if (today) {
- todayList.push(r2);
- break;
- }
- }
- }
- });
- const r = {
- resultList: sortedResultList,
- todayList
- };
- if (Array.isArray(resultList) && resultList.length > 0) {
- const target = resultList[0];
- if (target) {
- r.listSelector = target == null ? void 0 : target.listSelector;
- }
- }
- return r;
- }
- // 辅助函数:遍历DOM节点,查找符合条件的末级节点
- findEligibleLeafNodesForContentLtMark(node) {
- return this.findEligibleLeafNodes(node, (node2) => {
- const chineseChars = this.countChineseCharacters((node2 == null ? void 0 : node2.textContent) || "");
- return chineseChars >= this.minTitleLength && !this.checkNodeHidden(node2);
- });
- }
- // 辅助函数:根据父节点对末级节点进行分组
- groupNodes(nodes) {
- this.findTableInPage();
- let result = this.groupNodesBySiblings(nodes);
- if (this.checkNeedGroupNode(result).length <= 0) {
- result = this.groupNodesByParent(nodes);
- }
- return result;
- }
- findTableInPage() {
- const step = 3;
- const table = this.$("table");
- if (table.length > 0) {
- this.findParentsMaxDeep += step;
- }
- }
- // 保留元素个数在5个以上的分组
- checkNeedGroupNode(list) {
- const s = list.filter((group) => group.length > 5);
- return s;
- }
- // 分组函数(以nodesItem中的某个值为id进行分组)
- groupedListByList(nodes, key = "_list") {
- const groupArr = [];
- nodes.forEach((nodeObj) => {
- const target = groupArr.find((g) => g.id === nodeObj[key]);
- if (target && Array.isArray(target.list)) {
- target.list.push(nodeObj);
- } else {
- groupArr.push({
- id: nodeObj[key],
- list: [nodeObj]
- });
- }
- });
- const sortedArr = [];
- groupArr.forEach((g) => {
- if (Array.isArray(g.list) && g.list.length > 0) {
- sortedArr.push(g.list);
- }
- });
- return sortedArr;
- }
- groupNodesBySiblings(nodes) {
- nodes.forEach((node) => {
- var _a;
- const {
- parentNodeArr,
- // parentSiblingsCountArr,
- parentSiblingsWeightArr
- } = this.getNodeParentsSiblingsArr(node.node);
- const targetArr = parentSiblingsWeightArr;
- const maxSiblingCount = getMaxCount(targetArr);
- const maxIndex = targetArr.indexOf(maxSiblingCount);
- node._listItem = parentNodeArr[maxIndex];
- node._list = (_a = node._listItem) == null ? void 0 : _a.parentNode;
- node.weight = this.calcWeight(node);
- });
- const grouped1 = this.groupedListByList(nodes);
- return grouped1;
- }
- createGroupId(node) {
- var _a, _b;
- if (node._list) {
- const pClassNameStr = (_a = node._list) == null ? void 0 : _a.className;
- const listItemClassNameStr = (_b = node._listItem) == null ? void 0 : _b.className;
- node._groupId = `${this.getTagName(node._list)}__${pClassNameStr}__${this.getTagName(node.node)}__${listItemClassNameStr}`;
- } else {
- node._groupId = node._list;
- }
- }
- // 列表根据元素标签,元素className进行分类。
- calcClassifyNode(nodeList = []) {
- if (!Array.isArray(nodeList))
- return;
- const map = {};
- nodeList.forEach((item) => {
- const elem = item.node;
- if (!elem)
- return;
- let id = "__";
- if (elem.nodeType === Node.ELEMENT_NODE) {
- id = `${elem.tagName}_${Array.from(elem.classList)}`;
- } else if (elem.nodeType === Node.TEXT_NODE) {
- id = `text_`;
- }
- if (map[id]) {
- map[id].push(item);
- } else {
- map[id] = [item];
- }
- });
- return map;
- }
- getMaxValueLength(map = {}) {
- if (!map)
- return;
- let max = -Infinity;
- let maxItem = "";
- for (const key in map) {
- const item = key;
- if (Array.isArray(item)) {
- if (item.length > max && item.length > 0) {
- max = item.length;
- maxItem = item;
- }
- }
- }
- return maxItem;
- }
- checkNodeCountCorrect(needNode = []) {
- var _a;
- const listChildrenArr = [];
- const listDOMChildrenArr = [];
- needNode.forEach((group) => {
- if (Array.isArray(group)) {
- listChildrenArr.push(group.length);
- if (group[0] && group[0]._list) {
- const _list = group[0]._list;
- listDOMChildrenArr.push(_list == null ? void 0 : _list.childElementCount);
- }
- }
- });
- if (lodashExports.isEqual(listChildrenArr, listDOMChildrenArr) && needNode.length <= 1) {
- return needNode;
- }
- let targetList = needNode.flat().sort((a, b) => {
- return b.weight - a.weight;
- });
- targetList = lodashExports.uniqWith(targetList, function(a, b) {
- const hasListItem = a._listItem && b._listItem;
- return hasListItem && a._listItem === b._listItem;
- });
- const textGroupArr = this.groupedListByList(targetList);
- if (Array.isArray(textGroupArr) && textGroupArr.length > 0) {
- let maxWeight = -Infinity;
- let maxWeightArr = [];
- textGroupArr.forEach((group) => {
- if (Array.isArray(group)) {
- const groupLength = group.length > 3;
- const avg = lodashExports.meanBy(group, "weight");
- if (avg > maxWeight && groupLength) {
- maxWeight = avg;
- maxWeightArr = group;
- }
- }
- });
- if (maxWeightArr.length > 0) {
- let maxNodeExample = maxWeightArr[0];
- const resMap = this.calcClassifyNode(maxWeightArr);
- if (Object.keys(resMap).length > 1) {
- const maxItem = this.getMaxValueLength(resMap);
- if (Array.isArray(maxItem) && maxItem.length > 0) {
- maxNodeExample = maxItem[0];
- }
- }
- let maxNodeExampleNode = maxNodeExample.node;
- const useParentNode = maxNodeExampleNode.nodeType === Node.TEXT_NODE;
- let maxNodeExampleNodeParentNode = "";
- let nodeIndexInParent = 0;
- if (useParentNode) {
- maxNodeExampleNodeParentNode = maxNodeExampleNode.parentNode;
- if ((_a = maxNodeExample._listItem) == null ? void 0 : _a.contains(maxNodeExampleNodeParentNode)) {
- maxNodeExampleNode = maxNodeExampleNodeParentNode;
- const childNodes = maxNodeExampleNodeParentNode.childNodes;
- for (let i = 0; i < childNodes.length; i++) {
- if (maxNodeExample.node === childNodes[i]) {
- nodeIndexInParent = i;
- break;
- }
- }
- } else {
- maxWeightArr = [];
- return;
- }
- }
- const maxNodeTextSelector = [`${maxNodeExampleNode.localName}`];
- if (maxNodeExampleNode.classList) {
- maxNodeTextSelector.push(`${Array.from(maxNodeExampleNode.classList).join(".")}`);
- }
- const maxNodeTextSelectorText = maxNodeTextSelector.filter((v) => !!v).join(".");
- const maxNodeExampleList = maxNodeExample._list;
- if (maxNodeExampleList) {
- const $list = this.$(maxNodeExampleList);
- const listChildren = $list.children();
- const listItemArr = maxWeightArr.map((node) => {
- return node._listItem;
- });
- listChildren.each((_, item) => {
- var _a2;
- const $listItem = this.$(item);
- let target = $listItem.find(maxNodeTextSelectorText);
- if (useParentNode) {
- if (target && target.length) {
- const childrenNodesTarget = (_a2 = target[0]) == null ? void 0 : _a2.childNodes;
- if (childrenNodesTarget && childrenNodesTarget.length > 0) {
- target = $(childrenNodesTarget[nodeIndexInParent]);
- }
- }
- }
- const text = target.text();
- if (listItemArr.includes(item)) {
- const index = listItemArr.findIndex((ir) => ir === item);
- const maxWeightItem = maxWeightArr[index];
- if ((text == null ? void 0 : text.includes(maxWeightItem.text)) || maxWeightItem.text.includes(text))
- ;
- else {
- if (text) {
- const nodeItemExp = maxWeightItem;
- nodeItemExp.node = target[0];
- nodeItemExp.text = text;
- nodeItemExp.weight = this.calcWeight(nodeItemExp);
- }
- }
- } else {
- if (text) {
- const nodeItemExp = Object.assign({}, maxNodeExample);
- nodeItemExp.node = target[0];
- nodeItemExp.text = text;
- nodeItemExp.weight = this.calcWeight(nodeItemExp);
- nodeItemExp._listItem = item;
- maxWeightArr.push(nodeItemExp);
- }
- }
- });
- }
- }
- if (maxWeightArr.length > 0) {
- return [maxWeightArr];
- } else {
- return [];
- }
- } else {
- return [targetList];
- }
- }
- // 分组算法1:根据父元素进行分组,相同父元素为一组
- groupNodesByParent(nodes = []) {
- const groups = {};
- nodes.forEach((nodeObj) => {
- const parent = nodeObj.node.parentNode;
- if (!groups[parent]) {
- groups[parent] = [];
- }
- groups[parent].push(nodeObj);
- });
- return Object.entries(groups).map(([_, group]) => group);
- }
- // 获取每个元素的父级,最多获取5级,如果遇到取不到parentNode的情况,直接结束寻找,并返回结果
- // 排除body和body的直接子集
- getNodeParentsSiblingsArr(node) {
- const parentNodeArr = [];
- const parentSiblingsCountArr = [];
- const parentSiblingsWeightArr = [];
- const maxDeep = this.findParentsMaxDeep;
- let parent = node.parentNode;
- for (let i = 0; i < maxDeep; i++) {
- if (!parent) {
- break;
- }
- if (parent.tagName === "BODY") {
- parentNodeArr.pop();
- parentSiblingsCountArr.pop();
- parentSiblingsWeightArr.pop();
- break;
- }
- const parentSiblings = getSiblings(parent);
- if (Array.isArray(parentSiblings)) {
- parentSiblingsCountArr.push(parentSiblings.length);
- const weight = parentSiblings.length * ((maxDeep - i) * 20);
- parentSiblingsWeightArr.push(weight);
- }
- parentNodeArr.push(parent);
- parent = parent.parentNode;
- }
- return {
- parentNodeArr,
- parentSiblingsCountArr,
- parentSiblingsWeightArr
- };
- }
- // 辅助函数:检测节点或其后代中是否包含日期元素
- hasDateElement(node) {
- let tagList = this.findEligibleLeafNodes(node, () => true);
- tagList = tagList.map((i) => i.node);
- const arr = tagList.map((elem) => {
- var _a;
- const dateArr = this.extractDates((_a = elem.textContent) == null ? void 0 : _a.trim());
- return {
- date: dateArr,
- hasDate: dateArr.length > 0,
- textContent: elem.textContent
- };
- });
- return arr;
- }
- // 辅助函数:整理今日日期格式
- getTodayDateReg() {
- return this.todayPatterns;
- }
- // 传入node计算权重
- // 1. 包含特殊字符的权重为10
- // 2. 特殊标签h1/h2/h3/h4/h5/a权重为8
- // 3. 文字长度权重=文字长度*0.05
- calcWeight(node) {
- var _a, _b;
- const titleMaxLength = 35;
- const weightMap = {
- importKey: 14,
- importTag: 8,
- className: 3,
- textLength: 0.05,
- maxTextLength: -0.1,
- companyName: -3
- };
- let weight = 0;
- for (let i = 0; i < this.importantKeyList.length; i++) {
- const key = this.importantKeyList[i];
- if (node.text.includes(key)) {
- weight += weightMap.importKey;
- break;
- }
- }
- const tagName = this.getTagName(node.node);
- if (this.importantTagList.includes(tagName)) {
- weight += weightMap.importTag;
- }
- if ((_a = node.node) == null ? void 0 : _a.className) {
- const className = (_b = node.node) == null ? void 0 : _b.className;
- const targetStrList = ["title"];
- for (let i = 0; i < targetStrList.length; i++) {
- const item = targetStrList[i];
- if (className.includes(item)) {
- weight += weightMap.className;
- break;
- }
- }
- }
- if (this.isCompanyName(node.text)) {
- weight += weightMap.companyName;
- }
- const textLength = node.text ? node.text.length : 0;
- weight += textLength * weightMap.textLength;
- if (textLength >= titleMaxLength) {
- const maxTextLengthWeight = (textLength - weightMap.maxTextLength) * weightMap.maxTextLength;
- weight += maxTextLengthWeight;
- }
- return weight;
- }
- }
- class FindFileAttachment {
- constructor({ autoUpload } = {}) {
- __publicField(this, "autoUpload", false);
- __publicField(this, "extensions", ["pdf", "doc", "docx", "xls", "xlsx", "zip", "rar", "PDF", "DOC", "DOCX", "XLS", "XLSX", "ZIP", "RAR"]);
- __publicField(this, "uploadUrl", "http://127.0.0.1:18080/uploadFile");
- this.autoUpload = autoUpload;
- }
- run(container = document.body) {
- const fileAttachmentTagOptions = this.findFileAttachmentTag(container);
- if (this.autoUpload) {
- this.doFileListDownload(fileAttachmentTagOptions);
- }
- const targetFiles = fileAttachmentTagOptions.map((f) => {
- return {
- title: f.title,
- href: f.href,
- filename: f.filename
- };
- });
- const result = {
- files: targetFiles
- };
- console.log({
- ...result,
- fileAttachmentTagOptions
- });
- return result;
- }
- findFileAttachmentTag(container) {
- const ns = [];
- const extensions = this.extensions;
- const extensionRegex = new RegExp("\\.(" + extensions.join("|") + ")$", "i");
- const aTagList = container.querySelectorAll("a[href]");
- aTagList.forEach((v, i) => {
- v.setAttribute("target", "_blank");
- const linkText = v.innerText;
- const href = v.href;
- const filename = v.download || v.filename || linkText;
- if (extensionRegex.test(linkText.toLowerCase()) || extensionRegex.test(href.toLowerCase())) {
- ns.push({
- node: v,
- title: linkText,
- href: v.href,
- filename
- });
- }
- });
- return ns;
- }
- // 文件批量下载
- doFileListDownload(list = []) {
- if (Array.isArray(list)) {
- list.forEach((item) => {
- this.download(item.href, item.filename);
- });
- }
- }
- // 文件下载上传
- // 这是一个JavaScript代码,用于劫持浏览器下载附件。首先通过fetch请求获取文件内容,然后将文件内容转换为blob对象。接着创建一个FormData对象,将文件名和文件内容添加到其中。最后,将文件上传到服务器,并在上传成功后处理服务器返回的数据。
- download(href, filename) {
- const articleUrl = location.href;
- fetch(href).then((response) => {
- if (!response.ok) {
- throw new Error("Network response was not ok");
- }
- return response.blob();
- }).then((blob) => {
- const formData = new FormData();
- formData.append("filename", filename);
- formData.append("file", blob, filename);
- formData.append("orgurl", href);
- formData.append("articleurl", articleUrl);
- return fetch(this.uploadUrl, {
- method: "POST",
- body: formData
- });
- }).then((uploadResponse) => {
- if (!uploadResponse.ok) {
- throw new Error("Upload failed!");
- }
- console.log("File uploaded successfully!");
- return uploadResponse.json();
- }).then((data) => {
- console.log(data);
- }).catch((error) => {
- console.error("Error:", error);
- });
- }
- }
- class ContentRuleA extends RuleBaseInterface {
- constructor(config) {
- super();
- __publicField(this, "importPublishTimeKey", ["发布时间"]);
- __publicField(this, "minContentTextLength", 50);
- // 正文最小值,小于该值的丢弃
- __publicField(this, "maxDeep", 5);
- __publicField(this, "config", {
- titleList: []
- });
- if (config) {
- Object.assign(this.config, config);
- }
- }
- // 主函数:处理DOM并返回所需信息
- run(conf) {
- var _a;
- const { titleList } = this.config;
- let titleInfo = null;
- let dateTimeInfo = null;
- let contentNode = null;
- let articleInfo = null;
- if (conf && Object.keys(conf).length > 0) {
- console.log("根据选择器获取数据...");
- articleInfo = this.getArticleInfoWithSelector(conf);
- } else {
- console.log("根据规则计算数据...");
- articleInfo = this.getArticleInfo();
- }
- titleInfo = articleInfo.titleInfo;
- dateTimeInfo = articleInfo.dateTimeInfo;
- contentNode = articleInfo.contentNode;
- const files = this.getFileList();
- const result = {
- href: location.href,
- title: titleInfo == null ? void 0 : titleInfo.text,
- titleSelector: titleInfo == null ? void 0 : titleInfo.selector,
- listTitle: Array.isArray(titleList) ? titleList[0] : titleList,
- content: contentNode ? (_a = contentNode.node) == null ? void 0 : _a.innerHTML : "",
- contentSelector: contentNode ? this.generateCSSSelector(contentNode.node) : "",
- publishtime: dateTimeInfo == null ? void 0 : dateTimeInfo.text,
- publishtimeSelector: dateTimeInfo == null ? void 0 : dateTimeInfo.selector,
- files
- };
- this.report(result);
- return result;
- }
- getArticleInfo(container = document.body) {
- const { titleList } = this.config;
- let eligibleNodes = [];
- if (Array.isArray(titleList)) {
- titleList.forEach((t) => {
- const gotNodes = this.findEligibleLeafNodesForContentLtMark(container, t);
- if (Array.isArray(gotNodes) && gotNodes.length > 0) {
- eligibleNodes = eligibleNodes.concat(gotNodes);
- }
- });
- } else if (typeof titleList === "string") {
- eligibleNodes = this.findEligibleLeafNodesForContentLtMark(container, titleList);
- }
- const needNodes = this.calcNodesInfo(eligibleNodes);
- const titleInfo = this.getTitleText(needNodes);
- const contentNodeOptions = this.getNeedNodesParentsAndSiblings(needNodes);
- const dateTimeInfo = this.findTargetDateTime(needNodes);
- let targetNode = null;
- if (contentNodeOptions.length > 0) {
- targetNode = contentNodeOptions[0];
- if (targetNode.node) {
- targetNode.node = this.simplifyDOM(targetNode.node);
- }
- }
- console.log({
- eligibleNodes,
- needNodes,
- contentNodeOptions,
- targetNode
- });
- return {
- titleInfo,
- dateTimeInfo,
- contentNode: targetNode
- };
- }
- // 通过选择器获取数据
- getArticleInfoWithSelector(conf = {}) {
- const { titleSelector, contentSelector, publishtimeSelector } = conf;
- let titleInfo = null;
- let dateTimeInfo = null;
- let contentNode = null;
- if (titleSelector) {
- const titleDOM = document.querySelector(titleSelector);
- titleInfo = {
- selector: titleSelector,
- // text: titleDOM?.innerText,
- text: this.getTitleTextWithDOM(titleDOM)
- };
- }
- if (contentSelector) {
- const contentDOM = document.querySelector(contentSelector);
- contentNode = {
- node: contentDOM,
- text: contentDOM == null ? void 0 : contentDOM.innerHTML
- };
- ({
- selector: contentSelector,
- text: contentDOM == null ? void 0 : contentDOM.innerHTML
- });
- }
- if (publishtimeSelector) {
- const pbDOM = document.querySelector(publishtimeSelector);
- dateTimeInfo = {
- selector: publishtimeSelector,
- // text: pbDOM?.innerHTML,
- text: this.getTitleDateTimeWithDOM(pbDOM)
- };
- }
- return {
- titleInfo,
- dateTimeInfo,
- contentNode
- };
- }
- getTitleTextWithDOM(dom) {
- if (!dom) {
- return;
- }
- const nodeList = [
- {
- node: dom,
- text: dom == null ? void 0 : dom.textContent
- }
- ];
- const info = this.getTitleText(nodeList);
- return info.text;
- }
- getTitleDateTimeWithDOM(dom) {
- if (!dom) {
- return;
- }
- const text = this.findTargetDateTimeWithDOM(dom);
- return text;
- }
- findEligibleLeafNodesForContentLtMark(node, markText) {
- if (!markText) {
- markText = "";
- }
- const maskTextSorted = markText.trim().replace(/\.{2,}/g, "");
- return this.findEligibleLeafNodes(node, (node2) => {
- const contentText = node2 == null ? void 0 : node2.textContent;
- if (contentText && contentText.includes(maskTextSorted)) {
- if (this.checkNodeHidden(node2)) {
- return false;
- } else {
- return true;
- }
- } else {
- return false;
- }
- });
- }
- // 找到精确的node(会有可能找到文本节点)
- findExactNode(elem, str) {
- if (elem.childElementCount <= 0)
- return elem;
- const childNodes = elem.childNodes;
- if (!childNodes)
- return elem;
- if (childNodes.length <= 0)
- return elem;
- const list = Array.from(childNodes);
- let target = null;
- for (let i = 0; i < list.length; i++) {
- const item = list[i];
- if (this.excludeTags.includes(item.nodeName)) {
- continue;
- }
- if (item.textContent.includes(str)) {
- const r = this.findExactNode(item, str);
- if (r) {
- target = r;
- break;
- }
- }
- }
- return target;
- }
- // 找精确elem
- findExactElement(elem, str) {
- const node = this.findExactNode(elem, str);
- if ((node == null ? void 0 : node.nodeType) === Node.TEXT_NODE) {
- return node.parentNode;
- } else {
- return node;
- }
- }
- // 找发布时间(也找了兄弟元素)
- findTargetDateTime(nodes = []) {
- if (!Array.isArray(nodes)) {
- return;
- }
- if (nodes.length <= 0) {
- return;
- }
- let targetList = [];
- for (let i = 0; i < nodes.length; i++) {
- const node = nodes[i];
- const dateTimeArr = this.findDateTimeString(node);
- dateTimeArr.forEach((item) => {
- item.baseNodeIndex = i;
- });
- targetList = targetList.concat(dateTimeArr);
- }
- targetList.forEach((item) => {
- item.weight = this.calcDateTimeWeight(item);
- });
- const sorted = targetList.sort((a, b) => b.weight - a.weight);
- const resultArr = sorted.filter((item) => {
- return this.hasMatchPublishTimeKey(item);
- });
- let tarArr = resultArr.length > 0 ? resultArr : sorted;
- const tar = tarArr[0];
- if (Array.isArray(tar == null ? void 0 : tar.times) && (tar == null ? void 0 : tar.times.length) > 0) {
- const text = tar == null ? void 0 : tar.times[0];
- const pbNode = this.findExactElement(tar.node, text);
- const selector = this.generateCSSSelector(pbNode);
- return {
- text,
- selector
- };
- }
- }
- findTargetDateTimeWithDOM(dom) {
- const r = this.findTargetDateTimeFilter(dom);
- if (r) {
- const { times } = r;
- const text = times[0];
- return text;
- } else {
- return "";
- }
- }
- findTargetDateTimeFilter(dom) {
- const text = dom.innerHTML;
- if (text) {
- const r = this.extractDates(text);
- if (r && Array.isArray(r) && r.length > 0) {
- return {
- times: r,
- node: dom
- };
- } else {
- return false;
- }
- } else {
- return false;
- }
- }
- findDateTimeString(node) {
- const elem = node.node;
- if (!node.node) {
- return;
- }
- const arr = this.getEachNeedNodeParentsAndSiblings(elem, ({ item, deep }) => {
- return this.findTargetDateTimeFilter(item);
- });
- return arr.filter((r) => !!r);
- }
- getNeedNodesParentsAndSiblings(nodes = []) {
- if (!Array.isArray(nodes))
- return;
- let arr = [];
- nodes.forEach((node) => {
- const passInfoArr = this.getEachNeedNodeParentsAndSiblings(node.node, ({ item, deep }) => {
- const text = item.innerText;
- if (text && text.length > this.minContentTextLength) {
- const passInfo = {
- node: item,
- text
- };
- passInfo.weight = this.calcContentWeight(passInfo, deep);
- return passInfo;
- } else {
- return false;
- }
- });
- if (passInfoArr.length > 0) {
- arr = arr.concat(passInfoArr);
- }
- });
- return arr.sort((a, b) => b.weight - a.weight);
- }
- getTitleText(titleNeedList = []) {
- if (!Array.isArray(titleNeedList))
- return;
- if (titleNeedList.length === 0)
- return;
- const maxWeightNode = titleNeedList[0];
- if (maxWeightNode) {
- const exactNode = this.findExactElement(maxWeightNode.node, maxWeightNode.text);
- const selector = this.generateCSSSelector(exactNode);
- return {
- ...maxWeightNode,
- selector
- };
- }
- }
- // 通用函数:找兄弟元素以及父级元素兄弟元素
- getEachNeedNodeParentsAndSiblings(elem, callback, deep = this.maxDeep) {
- if (!elem)
- return;
- let passElemArr = [];
- const $elem = this.$(elem);
- const $parent = $elem.parent();
- const siblings = $elem.siblings();
- if (siblings.length > 0) {
- siblings.each((i, item) => {
- const tagName = this.getTagName(item);
- const isExcludeTags = this.excludeTags.includes(tagName);
- const passInfo = callback && callback({ item, deep });
- if (passInfo && !isExcludeTags) {
- passElemArr.push(passInfo);
- }
- });
- }
- if (deep > 0) {
- const passArr = this.getEachNeedNodeParentsAndSiblings($parent[0], callback, --deep);
- passElemArr = passElemArr.concat(passArr);
- }
- return passElemArr;
- }
- calcNodesInfo(nodes = []) {
- if (!Array.isArray(nodes))
- return;
- const weightNodes = nodes.map((n) => {
- n.weight = this.calcTitleWeight(n);
- return n;
- });
- return weightNodes.sort((a, b) => b.weight - a.weight);
- }
- simplifyDOM(elem) {
- const $elem = this.$(elem);
- $elem.find("style").remove();
- $elem.find("script").remove();
- return elem;
- }
- calcTitleWeight(node) {
- var _a, _b;
- const titleMaxLength = 25;
- const weightMap = {
- importTag: 8,
- className: 3,
- textLength: 0.05,
- maxTextLength: -0.1
- };
- let weight = 0;
- const tagName = this.getTagName(node.node);
- if (this.importantTagList.includes(tagName)) {
- weight += weightMap.importTag;
- }
- if ((_a = node.node) == null ? void 0 : _a.className) {
- const className = (_b = node.node) == null ? void 0 : _b.className;
- const targetStrList = ["title"];
- for (let i = 0; i < targetStrList.length; i++) {
- const item = targetStrList[i];
- if (className.includes(item)) {
- weight += weightMap.className;
- break;
- }
- }
- }
- const textLength = node.text ? node.text.length : 0;
- weight += textLength * weightMap.textLength;
- if (textLength >= titleMaxLength) {
- const maxTextLengthWeight = (textLength - weightMap.maxTextLength) * weightMap.maxTextLength;
- weight += maxTextLengthWeight;
- }
- return weight;
- }
- calcContentWeight(node, deep) {
- const weightMap = {
- textLength: 0.05,
- deep: [200, 170, 90, 50, 20, 10]
- // 从元素往上走,兄弟元素视为第0级,
- // children: -1, // 子元素越多,权重越小
- };
- let weight = 0;
- const weightDeepValue = weightMap.deep[this.maxDeep - deep] || 1;
- const textLength = node.text ? node.text.length : 0;
- weight += textLength * weightMap.textLength;
- if (weightDeepValue) {
- weight += weightDeepValue;
- }
- return weight;
- }
- calcDateTimeWeight(node) {
- const textMaxLength = 30;
- const weightMap = {
- importKey: 300,
- className: 30,
- baseNodeIndex: [200, 170, 90, 50, 20, 10],
- // 从元素往上走,兄弟元素视为第0级,
- maxTextLength: -3
- };
- let weight = 0;
- if (!node)
- return weight;
- const elem = node.node;
- const baseIndex = node.baseNodeIndex;
- const weightDeepValue = weightMap.baseNodeIndex[baseIndex] || 1;
- if (weightDeepValue) {
- weight += weightDeepValue;
- }
- if (elem == null ? void 0 : elem.className) {
- const className = elem == null ? void 0 : elem.className;
- const targetStrList = ["time"];
- for (let i = 0; i < targetStrList.length; i++) {
- const item = targetStrList[i];
- if (className.includes(item)) {
- weight += weightMap.className;
- break;
- }
- }
- }
- if (elem == null ? void 0 : elem.innerText) {
- const text = elem == null ? void 0 : elem.innerText;
- if (text.length >= textMaxLength) {
- const maxTextLengthWeight = (text.length - textMaxLength) * weightMap.maxTextLength;
- weight += maxTextLengthWeight;
- }
- }
- return weight;
- }
- hasMatchPublishTimeKey(node) {
- const elem = node.node;
- const target = [];
- for (let i = 0; i < this.importPublishTimeKey.length; i++) {
- const key = this.importPublishTimeKey[i];
- const selfText = elem == null ? void 0 : elem.innerText;
- if (selfText.includes(key)) {
- target.push(node);
- break;
- }
- const arr = this.getEachNeedNodeParentsAndSiblings(elem, ({ item }) => {
- const text = item.innerText;
- if (text) {
- const matched = text.includes(key);
- if (matched) {
- return elem;
- }
- }
- }, 0);
- if (arr.length > 0) {
- target.push(node);
- break;
- }
- }
- return target.length > 0;
- }
- getFileList() {
- const fileAttachmentFinder = new FindFileAttachment();
- this.fileAttachmentFinder = fileAttachmentFinder;
- const { files } = fileAttachmentFinder.run();
- return files;
- }
- }
- function getPageList(selector) {
- const rulesList = [
- new ListRuleB()
- ];
- const runner = new JsSpiderSDK(rulesList, {
- useAsync: false
- });
- runner.run(selector);
- return {
- core: runner,
- rulesList
- };
- }
- function getContentInfo(titleSelector, publishtimeSelector, contentSelector) {
- const rulesList = [
- new ContentRuleA({
- titleList: [
- 'titlename'
- // http://www.bigdatahefei.com/index.php/index/show/index?id=2309
- ]
- })
- ];
- const runner = new JsSpiderSDK(rulesList, {
- useAsync: false
- });
- const config = {
- titleSelector,
- publishtimeSelector,
- contentSelector
- // titleSelector: 'div:nth-child(8) > div:nth-child(2) > div:nth-child(2) > div:nth-child(1)',
- // publishtimeSelector: 'div:nth-child(8) > div:nth-child(2) > div:nth-child(2) > div:nth-child(2) > div:nth-child(1)',
- // contentSelector: 'div:nth-child(8) > div:nth-child(2) > div:nth-child(2) > #zoom'
- };
- for (const key in config) {
- if (config[key]) {
- continue;
- } else {
- delete config[key];
- }
- }
- runner.run(config);
- return {
- core: runner,
- rulesList
- };
- }
- function fileUpload() {
- const rulesList = [
- new FindFileAttachment({ autoUpload: true })
- ];
- const runner = new JsSpiderSDK(rulesList, {
- useAsync: false
- });
- runner.run();
- return {
- core: runner,
- rulesList
- };
- }
- getContentInfo('title_selector', 'publishtime_selector', 'content_selector');
- window.spiderSdk = {
- version,
- SpiderCore: JsSpiderSDK,
- RuleBase: RuleBaseInterface,
- ListRuleB,
- ContentRuleA,
- FindFileAttachment,
- getPageList,
- getContentInfo,
- fileUpload
- };
- })();
- result;
|