main.js 571 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601
  1. import { global as global$1, addEl, clearEl, isInIframe, getElementXPaths, readXPath, handleElement, handleDescendents, clearParameters, generateParameters, clearReady, selectAllElements, LANG } from './global.js';
  2. import { collectSingle, collectMultiNoPattern, collectMultiWithPattern, sendSingleClick, sendChangeOption, sendMouseMove, sendLoopMouseMove, sendLoopClickSingle, sendLoopClickEvery, input } from './messageInteraction.js';
  3. import { createNotification } from './trail.js';
  4. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  5. function createCommonjsModule(fn) {
  6. var module = { exports: {} };
  7. return fn(module, module.exports), module.exports;
  8. }
  9. /*!
  10. * jQuery JavaScript Library v3.7.0
  11. * https://jquery.com/
  12. *
  13. * Copyright OpenJS Foundation and other contributors
  14. * Released under the MIT license
  15. * https://jquery.org/license
  16. *
  17. * Date: 2023-05-11T18:29Z
  18. */
  19. var jquery = createCommonjsModule(function (module) {
  20. ( function( global, factory ) {
  21. {
  22. // For CommonJS and CommonJS-like environments where a proper `window`
  23. // is present, execute the factory and get jQuery.
  24. // For environments that do not have a `window` with a `document`
  25. // (such as Node.js), expose a factory as module.exports.
  26. // This accentuates the need for the creation of a real `window`.
  27. // e.g. var jQuery = require("jquery")(window);
  28. // See ticket trac-14549 for more info.
  29. module.exports = global.document ?
  30. factory( global, true ) :
  31. function( w ) {
  32. if ( !w.document ) {
  33. throw new Error( "jQuery requires a window with a document" );
  34. }
  35. return factory( w );
  36. };
  37. }
  38. // Pass this if window is not defined yet
  39. } )( typeof window !== "undefined" ? window : commonjsGlobal, function( window, noGlobal ) {
  40. var arr = [];
  41. var getProto = Object.getPrototypeOf;
  42. var slice = arr.slice;
  43. var flat = arr.flat ? function( array ) {
  44. return arr.flat.call( array );
  45. } : function( array ) {
  46. return arr.concat.apply( [], array );
  47. };
  48. var push = arr.push;
  49. var indexOf = arr.indexOf;
  50. var class2type = {};
  51. var toString = class2type.toString;
  52. var hasOwn = class2type.hasOwnProperty;
  53. var fnToString = hasOwn.toString;
  54. var ObjectFunctionString = fnToString.call( Object );
  55. var support = {};
  56. var isFunction = function isFunction( obj ) {
  57. // Support: Chrome <=57, Firefox <=52
  58. // In some browsers, typeof returns "function" for HTML <object> elements
  59. // (i.e., `typeof document.createElement( "object" ) === "function"`).
  60. // We don't want to classify *any* DOM node as a function.
  61. // Support: QtWeb <=3.8.5, WebKit <=534.34, wkhtmltopdf tool <=0.12.5
  62. // Plus for old WebKit, typeof returns "function" for HTML collections
  63. // (e.g., `typeof document.getElementsByTagName("div") === "function"`). (gh-4756)
  64. return typeof obj === "function" && typeof obj.nodeType !== "number" &&
  65. typeof obj.item !== "function";
  66. };
  67. var isWindow = function isWindow( obj ) {
  68. return obj != null && obj === obj.window;
  69. };
  70. var document = window.document;
  71. var preservedScriptAttributes = {
  72. type: true,
  73. src: true,
  74. nonce: true,
  75. noModule: true
  76. };
  77. function DOMEval( code, node, doc ) {
  78. doc = doc || document;
  79. var i, val,
  80. script = doc.createElement( "script" );
  81. script.text = code;
  82. if ( node ) {
  83. for ( i in preservedScriptAttributes ) {
  84. // Support: Firefox 64+, Edge 18+
  85. // Some browsers don't support the "nonce" property on scripts.
  86. // On the other hand, just using `getAttribute` is not enough as
  87. // the `nonce` attribute is reset to an empty string whenever it
  88. // becomes browsing-context connected.
  89. // See https://github.com/whatwg/html/issues/2369
  90. // See https://html.spec.whatwg.org/#nonce-attributes
  91. // The `node.getAttribute` check was added for the sake of
  92. // `jQuery.globalEval` so that it can fake a nonce-containing node
  93. // via an object.
  94. val = node[ i ] || node.getAttribute && node.getAttribute( i );
  95. if ( val ) {
  96. script.setAttribute( i, val );
  97. }
  98. }
  99. }
  100. doc.head.appendChild( script ).parentNode.removeChild( script );
  101. }
  102. function toType( obj ) {
  103. if ( obj == null ) {
  104. return obj + "";
  105. }
  106. // Support: Android <=2.3 only (functionish RegExp)
  107. return typeof obj === "object" || typeof obj === "function" ?
  108. class2type[ toString.call( obj ) ] || "object" :
  109. typeof obj;
  110. }
  111. /* global Symbol */
  112. // Defining this global in .eslintrc.json would create a danger of using the global
  113. // unguarded in another place, it seems safer to define global only for this module
  114. var version = "3.7.0",
  115. rhtmlSuffix = /HTML$/i,
  116. // Define a local copy of jQuery
  117. jQuery = function( selector, context ) {
  118. // The jQuery object is actually just the init constructor 'enhanced'
  119. // Need init if jQuery is called (just allow error to be thrown if not included)
  120. return new jQuery.fn.init( selector, context );
  121. };
  122. jQuery.fn = jQuery.prototype = {
  123. // The current version of jQuery being used
  124. jquery: version,
  125. constructor: jQuery,
  126. // The default length of a jQuery object is 0
  127. length: 0,
  128. toArray: function() {
  129. return slice.call( this );
  130. },
  131. // Get the Nth element in the matched element set OR
  132. // Get the whole matched element set as a clean array
  133. get: function( num ) {
  134. // Return all the elements in a clean array
  135. if ( num == null ) {
  136. return slice.call( this );
  137. }
  138. // Return just the one element from the set
  139. return num < 0 ? this[ num + this.length ] : this[ num ];
  140. },
  141. // Take an array of elements and push it onto the stack
  142. // (returning the new matched element set)
  143. pushStack: function( elems ) {
  144. // Build a new jQuery matched element set
  145. var ret = jQuery.merge( this.constructor(), elems );
  146. // Add the old object onto the stack (as a reference)
  147. ret.prevObject = this;
  148. // Return the newly-formed element set
  149. return ret;
  150. },
  151. // Execute a callback for every element in the matched set.
  152. each: function( callback ) {
  153. return jQuery.each( this, callback );
  154. },
  155. map: function( callback ) {
  156. return this.pushStack( jQuery.map( this, function( elem, i ) {
  157. return callback.call( elem, i, elem );
  158. } ) );
  159. },
  160. slice: function() {
  161. return this.pushStack( slice.apply( this, arguments ) );
  162. },
  163. first: function() {
  164. return this.eq( 0 );
  165. },
  166. last: function() {
  167. return this.eq( -1 );
  168. },
  169. even: function() {
  170. return this.pushStack( jQuery.grep( this, function( _elem, i ) {
  171. return ( i + 1 ) % 2;
  172. } ) );
  173. },
  174. odd: function() {
  175. return this.pushStack( jQuery.grep( this, function( _elem, i ) {
  176. return i % 2;
  177. } ) );
  178. },
  179. eq: function( i ) {
  180. var len = this.length,
  181. j = +i + ( i < 0 ? len : 0 );
  182. return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
  183. },
  184. end: function() {
  185. return this.prevObject || this.constructor();
  186. },
  187. // For internal use only.
  188. // Behaves like an Array's method, not like a jQuery method.
  189. push: push,
  190. sort: arr.sort,
  191. splice: arr.splice
  192. };
  193. jQuery.extend = jQuery.fn.extend = function() {
  194. var options, name, src, copy, copyIsArray, clone,
  195. target = arguments[ 0 ] || {},
  196. i = 1,
  197. length = arguments.length,
  198. deep = false;
  199. // Handle a deep copy situation
  200. if ( typeof target === "boolean" ) {
  201. deep = target;
  202. // Skip the boolean and the target
  203. target = arguments[ i ] || {};
  204. i++;
  205. }
  206. // Handle case when target is a string or something (possible in deep copy)
  207. if ( typeof target !== "object" && !isFunction( target ) ) {
  208. target = {};
  209. }
  210. // Extend jQuery itself if only one argument is passed
  211. if ( i === length ) {
  212. target = this;
  213. i--;
  214. }
  215. for ( ; i < length; i++ ) {
  216. // Only deal with non-null/undefined values
  217. if ( ( options = arguments[ i ] ) != null ) {
  218. // Extend the base object
  219. for ( name in options ) {
  220. copy = options[ name ];
  221. // Prevent Object.prototype pollution
  222. // Prevent never-ending loop
  223. if ( name === "__proto__" || target === copy ) {
  224. continue;
  225. }
  226. // Recurse if we're merging plain objects or arrays
  227. if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
  228. ( copyIsArray = Array.isArray( copy ) ) ) ) {
  229. src = target[ name ];
  230. // Ensure proper type for the source value
  231. if ( copyIsArray && !Array.isArray( src ) ) {
  232. clone = [];
  233. } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) {
  234. clone = {};
  235. } else {
  236. clone = src;
  237. }
  238. copyIsArray = false;
  239. // Never move original objects, clone them
  240. target[ name ] = jQuery.extend( deep, clone, copy );
  241. // Don't bring in undefined values
  242. } else if ( copy !== undefined ) {
  243. target[ name ] = copy;
  244. }
  245. }
  246. }
  247. }
  248. // Return the modified object
  249. return target;
  250. };
  251. jQuery.extend( {
  252. // Unique for each copy of jQuery on the page
  253. expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
  254. // Assume jQuery is ready without the ready module
  255. isReady: true,
  256. error: function( msg ) {
  257. throw new Error( msg );
  258. },
  259. noop: function() {},
  260. isPlainObject: function( obj ) {
  261. var proto, Ctor;
  262. // Detect obvious negatives
  263. // Use toString instead of jQuery.type to catch host objects
  264. if ( !obj || toString.call( obj ) !== "[object Object]" ) {
  265. return false;
  266. }
  267. proto = getProto( obj );
  268. // Objects with no prototype (e.g., `Object.create( null )`) are plain
  269. if ( !proto ) {
  270. return true;
  271. }
  272. // Objects with prototype are plain iff they were constructed by a global Object function
  273. Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor;
  274. return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString;
  275. },
  276. isEmptyObject: function( obj ) {
  277. var name;
  278. for ( name in obj ) {
  279. return false;
  280. }
  281. return true;
  282. },
  283. // Evaluates a script in a provided context; falls back to the global one
  284. // if not specified.
  285. globalEval: function( code, options, doc ) {
  286. DOMEval( code, { nonce: options && options.nonce }, doc );
  287. },
  288. each: function( obj, callback ) {
  289. var length, i = 0;
  290. if ( isArrayLike( obj ) ) {
  291. length = obj.length;
  292. for ( ; i < length; i++ ) {
  293. if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
  294. break;
  295. }
  296. }
  297. } else {
  298. for ( i in obj ) {
  299. if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
  300. break;
  301. }
  302. }
  303. }
  304. return obj;
  305. },
  306. // Retrieve the text value of an array of DOM nodes
  307. text: function( elem ) {
  308. var node,
  309. ret = "",
  310. i = 0,
  311. nodeType = elem.nodeType;
  312. if ( !nodeType ) {
  313. // If no nodeType, this is expected to be an array
  314. while ( ( node = elem[ i++ ] ) ) {
  315. // Do not traverse comment nodes
  316. ret += jQuery.text( node );
  317. }
  318. } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
  319. return elem.textContent;
  320. } else if ( nodeType === 3 || nodeType === 4 ) {
  321. return elem.nodeValue;
  322. }
  323. // Do not include comment or processing instruction nodes
  324. return ret;
  325. },
  326. // results is for internal usage only
  327. makeArray: function( arr, results ) {
  328. var ret = results || [];
  329. if ( arr != null ) {
  330. if ( isArrayLike( Object( arr ) ) ) {
  331. jQuery.merge( ret,
  332. typeof arr === "string" ?
  333. [ arr ] : arr
  334. );
  335. } else {
  336. push.call( ret, arr );
  337. }
  338. }
  339. return ret;
  340. },
  341. inArray: function( elem, arr, i ) {
  342. return arr == null ? -1 : indexOf.call( arr, elem, i );
  343. },
  344. isXMLDoc: function( elem ) {
  345. var namespace = elem && elem.namespaceURI,
  346. docElem = elem && ( elem.ownerDocument || elem ).documentElement;
  347. // Assume HTML when documentElement doesn't yet exist, such as inside
  348. // document fragments.
  349. return !rhtmlSuffix.test( namespace || docElem && docElem.nodeName || "HTML" );
  350. },
  351. // Support: Android <=4.0 only, PhantomJS 1 only
  352. // push.apply(_, arraylike) throws on ancient WebKit
  353. merge: function( first, second ) {
  354. var len = +second.length,
  355. j = 0,
  356. i = first.length;
  357. for ( ; j < len; j++ ) {
  358. first[ i++ ] = second[ j ];
  359. }
  360. first.length = i;
  361. return first;
  362. },
  363. grep: function( elems, callback, invert ) {
  364. var callbackInverse,
  365. matches = [],
  366. i = 0,
  367. length = elems.length,
  368. callbackExpect = !invert;
  369. // Go through the array, only saving the items
  370. // that pass the validator function
  371. for ( ; i < length; i++ ) {
  372. callbackInverse = !callback( elems[ i ], i );
  373. if ( callbackInverse !== callbackExpect ) {
  374. matches.push( elems[ i ] );
  375. }
  376. }
  377. return matches;
  378. },
  379. // arg is for internal usage only
  380. map: function( elems, callback, arg ) {
  381. var length, value,
  382. i = 0,
  383. ret = [];
  384. // Go through the array, translating each of the items to their new values
  385. if ( isArrayLike( elems ) ) {
  386. length = elems.length;
  387. for ( ; i < length; i++ ) {
  388. value = callback( elems[ i ], i, arg );
  389. if ( value != null ) {
  390. ret.push( value );
  391. }
  392. }
  393. // Go through every key on the object,
  394. } else {
  395. for ( i in elems ) {
  396. value = callback( elems[ i ], i, arg );
  397. if ( value != null ) {
  398. ret.push( value );
  399. }
  400. }
  401. }
  402. // Flatten any nested arrays
  403. return flat( ret );
  404. },
  405. // A global GUID counter for objects
  406. guid: 1,
  407. // jQuery.support is not used in Core but other projects attach their
  408. // properties to it so it needs to exist.
  409. support: support
  410. } );
  411. if ( typeof Symbol === "function" ) {
  412. jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
  413. }
  414. // Populate the class2type map
  415. jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
  416. function( _i, name ) {
  417. class2type[ "[object " + name + "]" ] = name.toLowerCase();
  418. } );
  419. function isArrayLike( obj ) {
  420. // Support: real iOS 8.2 only (not reproducible in simulator)
  421. // `in` check used to prevent JIT error (gh-2145)
  422. // hasOwn isn't used here due to false negatives
  423. // regarding Nodelist length in IE
  424. var length = !!obj && "length" in obj && obj.length,
  425. type = toType( obj );
  426. if ( isFunction( obj ) || isWindow( obj ) ) {
  427. return false;
  428. }
  429. return type === "array" || length === 0 ||
  430. typeof length === "number" && length > 0 && ( length - 1 ) in obj;
  431. }
  432. function nodeName( elem, name ) {
  433. return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
  434. }
  435. var pop = arr.pop;
  436. var sort = arr.sort;
  437. var splice = arr.splice;
  438. var whitespace = "[\\x20\\t\\r\\n\\f]";
  439. var rtrimCSS = new RegExp(
  440. "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$",
  441. "g"
  442. );
  443. // Note: an element does not contain itself
  444. jQuery.contains = function( a, b ) {
  445. var bup = b && b.parentNode;
  446. return a === bup || !!( bup && bup.nodeType === 1 && (
  447. // Support: IE 9 - 11+
  448. // IE doesn't have `contains` on SVG.
  449. a.contains ?
  450. a.contains( bup ) :
  451. a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
  452. ) );
  453. };
  454. // CSS string/identifier serialization
  455. // https://drafts.csswg.org/cssom/#common-serializing-idioms
  456. var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;
  457. function fcssescape( ch, asCodePoint ) {
  458. if ( asCodePoint ) {
  459. // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
  460. if ( ch === "\0" ) {
  461. return "\uFFFD";
  462. }
  463. // Control characters and (dependent upon position) numbers get escaped as code points
  464. return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
  465. }
  466. // Other potentially-special ASCII characters get backslash-escaped
  467. return "\\" + ch;
  468. }
  469. jQuery.escapeSelector = function( sel ) {
  470. return ( sel + "" ).replace( rcssescape, fcssescape );
  471. };
  472. var preferredDoc = document,
  473. pushNative = push;
  474. ( function() {
  475. var i,
  476. Expr,
  477. outermostContext,
  478. sortInput,
  479. hasDuplicate,
  480. push = pushNative,
  481. // Local document vars
  482. document,
  483. documentElement,
  484. documentIsHTML,
  485. rbuggyQSA,
  486. matches,
  487. // Instance-specific data
  488. expando = jQuery.expando,
  489. dirruns = 0,
  490. done = 0,
  491. classCache = createCache(),
  492. tokenCache = createCache(),
  493. compilerCache = createCache(),
  494. nonnativeSelectorCache = createCache(),
  495. sortOrder = function( a, b ) {
  496. if ( a === b ) {
  497. hasDuplicate = true;
  498. }
  499. return 0;
  500. },
  501. booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|" +
  502. "loop|multiple|open|readonly|required|scoped",
  503. // Regular expressions
  504. // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram
  505. identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace +
  506. "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",
  507. // Attribute selectors: https://www.w3.org/TR/selectors/#attribute-selectors
  508. attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
  509. // Operator (capture 2)
  510. "*([*^$|!~]?=)" + whitespace +
  511. // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
  512. "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" +
  513. whitespace + "*\\]",
  514. pseudos = ":(" + identifier + ")(?:\\((" +
  515. // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
  516. // 1. quoted (capture 3; capture 4 or capture 5)
  517. "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
  518. // 2. simple (capture 6)
  519. "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
  520. // 3. anything else (capture 2)
  521. ".*" +
  522. ")\\)|)",
  523. // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
  524. rwhitespace = new RegExp( whitespace + "+", "g" ),
  525. rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
  526. rleadingCombinator = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" +
  527. whitespace + "*" ),
  528. rdescend = new RegExp( whitespace + "|>" ),
  529. rpseudo = new RegExp( pseudos ),
  530. ridentifier = new RegExp( "^" + identifier + "$" ),
  531. matchExpr = {
  532. ID: new RegExp( "^#(" + identifier + ")" ),
  533. CLASS: new RegExp( "^\\.(" + identifier + ")" ),
  534. TAG: new RegExp( "^(" + identifier + "|[*])" ),
  535. ATTR: new RegExp( "^" + attributes ),
  536. PSEUDO: new RegExp( "^" + pseudos ),
  537. CHILD: new RegExp(
  538. "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" +
  539. whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" +
  540. whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
  541. bool: new RegExp( "^(?:" + booleans + ")$", "i" ),
  542. // For use in libraries implementing .is()
  543. // We use this for POS matching in `select`
  544. needsContext: new RegExp( "^" + whitespace +
  545. "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace +
  546. "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
  547. },
  548. rinputs = /^(?:input|select|textarea|button)$/i,
  549. rheader = /^h\d$/i,
  550. // Easily-parseable/retrievable ID or TAG or CLASS selectors
  551. rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
  552. rsibling = /[+~]/,
  553. // CSS escapes
  554. // https://www.w3.org/TR/CSS21/syndata.html#escaped-characters
  555. runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace +
  556. "?|\\\\([^\\r\\n\\f])", "g" ),
  557. funescape = function( escape, nonHex ) {
  558. var high = "0x" + escape.slice( 1 ) - 0x10000;
  559. if ( nonHex ) {
  560. // Strip the backslash prefix from a non-hex escape sequence
  561. return nonHex;
  562. }
  563. // Replace a hexadecimal escape sequence with the encoded Unicode code point
  564. // Support: IE <=11+
  565. // For values outside the Basic Multilingual Plane (BMP), manually construct a
  566. // surrogate pair
  567. return high < 0 ?
  568. String.fromCharCode( high + 0x10000 ) :
  569. String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
  570. },
  571. // Used for iframes; see `setDocument`.
  572. // Support: IE 9 - 11+, Edge 12 - 18+
  573. // Removing the function wrapper causes a "Permission Denied"
  574. // error in IE/Edge.
  575. unloadHandler = function() {
  576. setDocument();
  577. },
  578. inDisabledFieldset = addCombinator(
  579. function( elem ) {
  580. return elem.disabled === true && nodeName( elem, "fieldset" );
  581. },
  582. { dir: "parentNode", next: "legend" }
  583. );
  584. // Support: IE <=9 only
  585. // Accessing document.activeElement can throw unexpectedly
  586. // https://bugs.jquery.com/ticket/13393
  587. function safeActiveElement() {
  588. try {
  589. return document.activeElement;
  590. } catch ( err ) { }
  591. }
  592. // Optimize for push.apply( _, NodeList )
  593. try {
  594. push.apply(
  595. ( arr = slice.call( preferredDoc.childNodes ) ),
  596. preferredDoc.childNodes
  597. );
  598. // Support: Android <=4.0
  599. // Detect silently failing push.apply
  600. // eslint-disable-next-line no-unused-expressions
  601. arr[ preferredDoc.childNodes.length ].nodeType;
  602. } catch ( e ) {
  603. push = {
  604. apply: function( target, els ) {
  605. pushNative.apply( target, slice.call( els ) );
  606. },
  607. call: function( target ) {
  608. pushNative.apply( target, slice.call( arguments, 1 ) );
  609. }
  610. };
  611. }
  612. function find( selector, context, results, seed ) {
  613. var m, i, elem, nid, match, groups, newSelector,
  614. newContext = context && context.ownerDocument,
  615. // nodeType defaults to 9, since context defaults to document
  616. nodeType = context ? context.nodeType : 9;
  617. results = results || [];
  618. // Return early from calls with invalid selector or context
  619. if ( typeof selector !== "string" || !selector ||
  620. nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
  621. return results;
  622. }
  623. // Try to shortcut find operations (as opposed to filters) in HTML documents
  624. if ( !seed ) {
  625. setDocument( context );
  626. context = context || document;
  627. if ( documentIsHTML ) {
  628. // If the selector is sufficiently simple, try using a "get*By*" DOM method
  629. // (excepting DocumentFragment context, where the methods don't exist)
  630. if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) {
  631. // ID selector
  632. if ( ( m = match[ 1 ] ) ) {
  633. // Document context
  634. if ( nodeType === 9 ) {
  635. if ( ( elem = context.getElementById( m ) ) ) {
  636. // Support: IE 9 only
  637. // getElementById can match elements by name instead of ID
  638. if ( elem.id === m ) {
  639. push.call( results, elem );
  640. return results;
  641. }
  642. } else {
  643. return results;
  644. }
  645. // Element context
  646. } else {
  647. // Support: IE 9 only
  648. // getElementById can match elements by name instead of ID
  649. if ( newContext && ( elem = newContext.getElementById( m ) ) &&
  650. find.contains( context, elem ) &&
  651. elem.id === m ) {
  652. push.call( results, elem );
  653. return results;
  654. }
  655. }
  656. // Type selector
  657. } else if ( match[ 2 ] ) {
  658. push.apply( results, context.getElementsByTagName( selector ) );
  659. return results;
  660. // Class selector
  661. } else if ( ( m = match[ 3 ] ) && context.getElementsByClassName ) {
  662. push.apply( results, context.getElementsByClassName( m ) );
  663. return results;
  664. }
  665. }
  666. // Take advantage of querySelectorAll
  667. if ( !nonnativeSelectorCache[ selector + " " ] &&
  668. ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) ) {
  669. newSelector = selector;
  670. newContext = context;
  671. // qSA considers elements outside a scoping root when evaluating child or
  672. // descendant combinators, which is not what we want.
  673. // In such cases, we work around the behavior by prefixing every selector in the
  674. // list with an ID selector referencing the scope context.
  675. // The technique has to be used as well when a leading combinator is used
  676. // as such selectors are not recognized by querySelectorAll.
  677. // Thanks to Andrew Dupont for this technique.
  678. if ( nodeType === 1 &&
  679. ( rdescend.test( selector ) || rleadingCombinator.test( selector ) ) ) {
  680. // Expand context for sibling selectors
  681. newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
  682. context;
  683. // We can use :scope instead of the ID hack if the browser
  684. // supports it & if we're not changing the context.
  685. // Support: IE 11+, Edge 17 - 18+
  686. // IE/Edge sometimes throw a "Permission denied" error when
  687. // strict-comparing two documents; shallow comparisons work.
  688. // eslint-disable-next-line eqeqeq
  689. if ( newContext != context || !support.scope ) {
  690. // Capture the context ID, setting it first if necessary
  691. if ( ( nid = context.getAttribute( "id" ) ) ) {
  692. nid = jQuery.escapeSelector( nid );
  693. } else {
  694. context.setAttribute( "id", ( nid = expando ) );
  695. }
  696. }
  697. // Prefix every selector in the list
  698. groups = tokenize( selector );
  699. i = groups.length;
  700. while ( i-- ) {
  701. groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " +
  702. toSelector( groups[ i ] );
  703. }
  704. newSelector = groups.join( "," );
  705. }
  706. try {
  707. push.apply( results,
  708. newContext.querySelectorAll( newSelector )
  709. );
  710. return results;
  711. } catch ( qsaError ) {
  712. nonnativeSelectorCache( selector, true );
  713. } finally {
  714. if ( nid === expando ) {
  715. context.removeAttribute( "id" );
  716. }
  717. }
  718. }
  719. }
  720. }
  721. // All others
  722. return select( selector.replace( rtrimCSS, "$1" ), context, results, seed );
  723. }
  724. /**
  725. * Create key-value caches of limited size
  726. * @returns {function(string, object)} Returns the Object data after storing it on itself with
  727. * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
  728. * deleting the oldest entry
  729. */
  730. function createCache() {
  731. var keys = [];
  732. function cache( key, value ) {
  733. // Use (key + " ") to avoid collision with native prototype properties
  734. // (see https://github.com/jquery/sizzle/issues/157)
  735. if ( keys.push( key + " " ) > Expr.cacheLength ) {
  736. // Only keep the most recent entries
  737. delete cache[ keys.shift() ];
  738. }
  739. return ( cache[ key + " " ] = value );
  740. }
  741. return cache;
  742. }
  743. /**
  744. * Mark a function for special use by jQuery selector module
  745. * @param {Function} fn The function to mark
  746. */
  747. function markFunction( fn ) {
  748. fn[ expando ] = true;
  749. return fn;
  750. }
  751. /**
  752. * Support testing using an element
  753. * @param {Function} fn Passed the created element and returns a boolean result
  754. */
  755. function assert( fn ) {
  756. var el = document.createElement( "fieldset" );
  757. try {
  758. return !!fn( el );
  759. } catch ( e ) {
  760. return false;
  761. } finally {
  762. // Remove from its parent by default
  763. if ( el.parentNode ) {
  764. el.parentNode.removeChild( el );
  765. }
  766. // release memory in IE
  767. el = null;
  768. }
  769. }
  770. /**
  771. * Returns a function to use in pseudos for input types
  772. * @param {String} type
  773. */
  774. function createInputPseudo( type ) {
  775. return function( elem ) {
  776. return nodeName( elem, "input" ) && elem.type === type;
  777. };
  778. }
  779. /**
  780. * Returns a function to use in pseudos for buttons
  781. * @param {String} type
  782. */
  783. function createButtonPseudo( type ) {
  784. return function( elem ) {
  785. return ( nodeName( elem, "input" ) || nodeName( elem, "button" ) ) &&
  786. elem.type === type;
  787. };
  788. }
  789. /**
  790. * Returns a function to use in pseudos for :enabled/:disabled
  791. * @param {Boolean} disabled true for :disabled; false for :enabled
  792. */
  793. function createDisabledPseudo( disabled ) {
  794. // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable
  795. return function( elem ) {
  796. // Only certain elements can match :enabled or :disabled
  797. // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled
  798. // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled
  799. if ( "form" in elem ) {
  800. // Check for inherited disabledness on relevant non-disabled elements:
  801. // * listed form-associated elements in a disabled fieldset
  802. // https://html.spec.whatwg.org/multipage/forms.html#category-listed
  803. // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled
  804. // * option elements in a disabled optgroup
  805. // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled
  806. // All such elements have a "form" property.
  807. if ( elem.parentNode && elem.disabled === false ) {
  808. // Option elements defer to a parent optgroup if present
  809. if ( "label" in elem ) {
  810. if ( "label" in elem.parentNode ) {
  811. return elem.parentNode.disabled === disabled;
  812. } else {
  813. return elem.disabled === disabled;
  814. }
  815. }
  816. // Support: IE 6 - 11+
  817. // Use the isDisabled shortcut property to check for disabled fieldset ancestors
  818. return elem.isDisabled === disabled ||
  819. // Where there is no isDisabled, check manually
  820. elem.isDisabled !== !disabled &&
  821. inDisabledFieldset( elem ) === disabled;
  822. }
  823. return elem.disabled === disabled;
  824. // Try to winnow out elements that can't be disabled before trusting the disabled property.
  825. // Some victims get caught in our net (label, legend, menu, track), but it shouldn't
  826. // even exist on them, let alone have a boolean value.
  827. } else if ( "label" in elem ) {
  828. return elem.disabled === disabled;
  829. }
  830. // Remaining elements are neither :enabled nor :disabled
  831. return false;
  832. };
  833. }
  834. /**
  835. * Returns a function to use in pseudos for positionals
  836. * @param {Function} fn
  837. */
  838. function createPositionalPseudo( fn ) {
  839. return markFunction( function( argument ) {
  840. argument = +argument;
  841. return markFunction( function( seed, matches ) {
  842. var j,
  843. matchIndexes = fn( [], seed.length, argument ),
  844. i = matchIndexes.length;
  845. // Match elements found at the specified indexes
  846. while ( i-- ) {
  847. if ( seed[ ( j = matchIndexes[ i ] ) ] ) {
  848. seed[ j ] = !( matches[ j ] = seed[ j ] );
  849. }
  850. }
  851. } );
  852. } );
  853. }
  854. /**
  855. * Checks a node for validity as a jQuery selector context
  856. * @param {Element|Object=} context
  857. * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
  858. */
  859. function testContext( context ) {
  860. return context && typeof context.getElementsByTagName !== "undefined" && context;
  861. }
  862. /**
  863. * Sets document-related variables once based on the current document
  864. * @param {Element|Object} [node] An element or document object to use to set the document
  865. * @returns {Object} Returns the current document
  866. */
  867. function setDocument( node ) {
  868. var subWindow,
  869. doc = node ? node.ownerDocument || node : preferredDoc;
  870. // Return early if doc is invalid or already selected
  871. // Support: IE 11+, Edge 17 - 18+
  872. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  873. // two documents; shallow comparisons work.
  874. // eslint-disable-next-line eqeqeq
  875. if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) {
  876. return document;
  877. }
  878. // Update global variables
  879. document = doc;
  880. documentElement = document.documentElement;
  881. documentIsHTML = !jQuery.isXMLDoc( document );
  882. // Support: iOS 7 only, IE 9 - 11+
  883. // Older browsers didn't support unprefixed `matches`.
  884. matches = documentElement.matches ||
  885. documentElement.webkitMatchesSelector ||
  886. documentElement.msMatchesSelector;
  887. // Support: IE 9 - 11+, Edge 12 - 18+
  888. // Accessing iframe documents after unload throws "permission denied" errors (see trac-13936)
  889. // Support: IE 11+, Edge 17 - 18+
  890. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  891. // two documents; shallow comparisons work.
  892. // eslint-disable-next-line eqeqeq
  893. if ( preferredDoc != document &&
  894. ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) {
  895. // Support: IE 9 - 11+, Edge 12 - 18+
  896. subWindow.addEventListener( "unload", unloadHandler );
  897. }
  898. // Support: IE <10
  899. // Check if getElementById returns elements by name
  900. // The broken getElementById methods don't pick up programmatically-set names,
  901. // so use a roundabout getElementsByName test
  902. support.getById = assert( function( el ) {
  903. documentElement.appendChild( el ).id = jQuery.expando;
  904. return !document.getElementsByName ||
  905. !document.getElementsByName( jQuery.expando ).length;
  906. } );
  907. // Support: IE 9 only
  908. // Check to see if it's possible to do matchesSelector
  909. // on a disconnected node.
  910. support.disconnectedMatch = assert( function( el ) {
  911. return matches.call( el, "*" );
  912. } );
  913. // Support: IE 9 - 11+, Edge 12 - 18+
  914. // IE/Edge don't support the :scope pseudo-class.
  915. support.scope = assert( function() {
  916. return document.querySelectorAll( ":scope" );
  917. } );
  918. // Support: Chrome 105 - 111 only, Safari 15.4 - 16.3 only
  919. // Make sure the `:has()` argument is parsed unforgivingly.
  920. // We include `*` in the test to detect buggy implementations that are
  921. // _selectively_ forgiving (specifically when the list includes at least
  922. // one valid selector).
  923. // Note that we treat complete lack of support for `:has()` as if it were
  924. // spec-compliant support, which is fine because use of `:has()` in such
  925. // environments will fail in the qSA path and fall back to jQuery traversal
  926. // anyway.
  927. support.cssHas = assert( function() {
  928. try {
  929. document.querySelector( ":has(*,:jqfake)" );
  930. return false;
  931. } catch ( e ) {
  932. return true;
  933. }
  934. } );
  935. // ID filter and find
  936. if ( support.getById ) {
  937. Expr.filter.ID = function( id ) {
  938. var attrId = id.replace( runescape, funescape );
  939. return function( elem ) {
  940. return elem.getAttribute( "id" ) === attrId;
  941. };
  942. };
  943. Expr.find.ID = function( id, context ) {
  944. if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
  945. var elem = context.getElementById( id );
  946. return elem ? [ elem ] : [];
  947. }
  948. };
  949. } else {
  950. Expr.filter.ID = function( id ) {
  951. var attrId = id.replace( runescape, funescape );
  952. return function( elem ) {
  953. var node = typeof elem.getAttributeNode !== "undefined" &&
  954. elem.getAttributeNode( "id" );
  955. return node && node.value === attrId;
  956. };
  957. };
  958. // Support: IE 6 - 7 only
  959. // getElementById is not reliable as a find shortcut
  960. Expr.find.ID = function( id, context ) {
  961. if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
  962. var node, i, elems,
  963. elem = context.getElementById( id );
  964. if ( elem ) {
  965. // Verify the id attribute
  966. node = elem.getAttributeNode( "id" );
  967. if ( node && node.value === id ) {
  968. return [ elem ];
  969. }
  970. // Fall back on getElementsByName
  971. elems = context.getElementsByName( id );
  972. i = 0;
  973. while ( ( elem = elems[ i++ ] ) ) {
  974. node = elem.getAttributeNode( "id" );
  975. if ( node && node.value === id ) {
  976. return [ elem ];
  977. }
  978. }
  979. }
  980. return [];
  981. }
  982. };
  983. }
  984. // Tag
  985. Expr.find.TAG = function( tag, context ) {
  986. if ( typeof context.getElementsByTagName !== "undefined" ) {
  987. return context.getElementsByTagName( tag );
  988. // DocumentFragment nodes don't have gEBTN
  989. } else {
  990. return context.querySelectorAll( tag );
  991. }
  992. };
  993. // Class
  994. Expr.find.CLASS = function( className, context ) {
  995. if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
  996. return context.getElementsByClassName( className );
  997. }
  998. };
  999. /* QSA/matchesSelector
  1000. ---------------------------------------------------------------------- */
  1001. // QSA and matchesSelector support
  1002. rbuggyQSA = [];
  1003. // Build QSA regex
  1004. // Regex strategy adopted from Diego Perini
  1005. assert( function( el ) {
  1006. var input;
  1007. documentElement.appendChild( el ).innerHTML =
  1008. "<a id='" + expando + "' href='' disabled='disabled'></a>" +
  1009. "<select id='" + expando + "-\r\\' disabled='disabled'>" +
  1010. "<option selected=''></option></select>";
  1011. // Support: iOS <=7 - 8 only
  1012. // Boolean attributes and "value" are not treated correctly in some XML documents
  1013. if ( !el.querySelectorAll( "[selected]" ).length ) {
  1014. rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
  1015. }
  1016. // Support: iOS <=7 - 8 only
  1017. if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
  1018. rbuggyQSA.push( "~=" );
  1019. }
  1020. // Support: iOS 8 only
  1021. // https://bugs.webkit.org/show_bug.cgi?id=136851
  1022. // In-page `selector#id sibling-combinator selector` fails
  1023. if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {
  1024. rbuggyQSA.push( ".#.+[+~]" );
  1025. }
  1026. // Support: Chrome <=105+, Firefox <=104+, Safari <=15.4+
  1027. // In some of the document kinds, these selectors wouldn't work natively.
  1028. // This is probably OK but for backwards compatibility we want to maintain
  1029. // handling them through jQuery traversal in jQuery 3.x.
  1030. if ( !el.querySelectorAll( ":checked" ).length ) {
  1031. rbuggyQSA.push( ":checked" );
  1032. }
  1033. // Support: Windows 8 Native Apps
  1034. // The type and name attributes are restricted during .innerHTML assignment
  1035. input = document.createElement( "input" );
  1036. input.setAttribute( "type", "hidden" );
  1037. el.appendChild( input ).setAttribute( "name", "D" );
  1038. // Support: IE 9 - 11+
  1039. // IE's :disabled selector does not pick up the children of disabled fieldsets
  1040. // Support: Chrome <=105+, Firefox <=104+, Safari <=15.4+
  1041. // In some of the document kinds, these selectors wouldn't work natively.
  1042. // This is probably OK but for backwards compatibility we want to maintain
  1043. // handling them through jQuery traversal in jQuery 3.x.
  1044. documentElement.appendChild( el ).disabled = true;
  1045. if ( el.querySelectorAll( ":disabled" ).length !== 2 ) {
  1046. rbuggyQSA.push( ":enabled", ":disabled" );
  1047. }
  1048. // Support: IE 11+, Edge 15 - 18+
  1049. // IE 11/Edge don't find elements on a `[name='']` query in some cases.
  1050. // Adding a temporary attribute to the document before the selection works
  1051. // around the issue.
  1052. // Interestingly, IE 10 & older don't seem to have the issue.
  1053. input = document.createElement( "input" );
  1054. input.setAttribute( "name", "" );
  1055. el.appendChild( input );
  1056. if ( !el.querySelectorAll( "[name='']" ).length ) {
  1057. rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" +
  1058. whitespace + "*(?:''|\"\")" );
  1059. }
  1060. } );
  1061. if ( !support.cssHas ) {
  1062. // Support: Chrome 105 - 110+, Safari 15.4 - 16.3+
  1063. // Our regular `try-catch` mechanism fails to detect natively-unsupported
  1064. // pseudo-classes inside `:has()` (such as `:has(:contains("Foo"))`)
  1065. // in browsers that parse the `:has()` argument as a forgiving selector list.
  1066. // https://drafts.csswg.org/selectors/#relational now requires the argument
  1067. // to be parsed unforgivingly, but browsers have not yet fully adjusted.
  1068. rbuggyQSA.push( ":has" );
  1069. }
  1070. rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) );
  1071. /* Sorting
  1072. ---------------------------------------------------------------------- */
  1073. // Document order sorting
  1074. sortOrder = function( a, b ) {
  1075. // Flag for duplicate removal
  1076. if ( a === b ) {
  1077. hasDuplicate = true;
  1078. return 0;
  1079. }
  1080. // Sort on method existence if only one input has compareDocumentPosition
  1081. var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
  1082. if ( compare ) {
  1083. return compare;
  1084. }
  1085. // Calculate position if both inputs belong to the same document
  1086. // Support: IE 11+, Edge 17 - 18+
  1087. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1088. // two documents; shallow comparisons work.
  1089. // eslint-disable-next-line eqeqeq
  1090. compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ?
  1091. a.compareDocumentPosition( b ) :
  1092. // Otherwise we know they are disconnected
  1093. 1;
  1094. // Disconnected nodes
  1095. if ( compare & 1 ||
  1096. ( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) {
  1097. // Choose the first element that is related to our preferred document
  1098. // Support: IE 11+, Edge 17 - 18+
  1099. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1100. // two documents; shallow comparisons work.
  1101. // eslint-disable-next-line eqeqeq
  1102. if ( a === document || a.ownerDocument == preferredDoc &&
  1103. find.contains( preferredDoc, a ) ) {
  1104. return -1;
  1105. }
  1106. // Support: IE 11+, Edge 17 - 18+
  1107. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1108. // two documents; shallow comparisons work.
  1109. // eslint-disable-next-line eqeqeq
  1110. if ( b === document || b.ownerDocument == preferredDoc &&
  1111. find.contains( preferredDoc, b ) ) {
  1112. return 1;
  1113. }
  1114. // Maintain original order
  1115. return sortInput ?
  1116. ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
  1117. 0;
  1118. }
  1119. return compare & 4 ? -1 : 1;
  1120. };
  1121. return document;
  1122. }
  1123. find.matches = function( expr, elements ) {
  1124. return find( expr, null, null, elements );
  1125. };
  1126. find.matchesSelector = function( elem, expr ) {
  1127. setDocument( elem );
  1128. if ( documentIsHTML &&
  1129. !nonnativeSelectorCache[ expr + " " ] &&
  1130. ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
  1131. try {
  1132. var ret = matches.call( elem, expr );
  1133. // IE 9's matchesSelector returns false on disconnected nodes
  1134. if ( ret || support.disconnectedMatch ||
  1135. // As well, disconnected nodes are said to be in a document
  1136. // fragment in IE 9
  1137. elem.document && elem.document.nodeType !== 11 ) {
  1138. return ret;
  1139. }
  1140. } catch ( e ) {
  1141. nonnativeSelectorCache( expr, true );
  1142. }
  1143. }
  1144. return find( expr, document, null, [ elem ] ).length > 0;
  1145. };
  1146. find.contains = function( context, elem ) {
  1147. // Set document vars if needed
  1148. // Support: IE 11+, Edge 17 - 18+
  1149. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1150. // two documents; shallow comparisons work.
  1151. // eslint-disable-next-line eqeqeq
  1152. if ( ( context.ownerDocument || context ) != document ) {
  1153. setDocument( context );
  1154. }
  1155. return jQuery.contains( context, elem );
  1156. };
  1157. find.attr = function( elem, name ) {
  1158. // Set document vars if needed
  1159. // Support: IE 11+, Edge 17 - 18+
  1160. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1161. // two documents; shallow comparisons work.
  1162. // eslint-disable-next-line eqeqeq
  1163. if ( ( elem.ownerDocument || elem ) != document ) {
  1164. setDocument( elem );
  1165. }
  1166. var fn = Expr.attrHandle[ name.toLowerCase() ],
  1167. // Don't get fooled by Object.prototype properties (see trac-13807)
  1168. val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
  1169. fn( elem, name, !documentIsHTML ) :
  1170. undefined;
  1171. if ( val !== undefined ) {
  1172. return val;
  1173. }
  1174. return elem.getAttribute( name );
  1175. };
  1176. find.error = function( msg ) {
  1177. throw new Error( "Syntax error, unrecognized expression: " + msg );
  1178. };
  1179. /**
  1180. * Document sorting and removing duplicates
  1181. * @param {ArrayLike} results
  1182. */
  1183. jQuery.uniqueSort = function( results ) {
  1184. var elem,
  1185. duplicates = [],
  1186. j = 0,
  1187. i = 0;
  1188. // Unless we *know* we can detect duplicates, assume their presence
  1189. //
  1190. // Support: Android <=4.0+
  1191. // Testing for detecting duplicates is unpredictable so instead assume we can't
  1192. // depend on duplicate detection in all browsers without a stable sort.
  1193. hasDuplicate = !support.sortStable;
  1194. sortInput = !support.sortStable && slice.call( results, 0 );
  1195. sort.call( results, sortOrder );
  1196. if ( hasDuplicate ) {
  1197. while ( ( elem = results[ i++ ] ) ) {
  1198. if ( elem === results[ i ] ) {
  1199. j = duplicates.push( i );
  1200. }
  1201. }
  1202. while ( j-- ) {
  1203. splice.call( results, duplicates[ j ], 1 );
  1204. }
  1205. }
  1206. // Clear input after sorting to release objects
  1207. // See https://github.com/jquery/sizzle/pull/225
  1208. sortInput = null;
  1209. return results;
  1210. };
  1211. jQuery.fn.uniqueSort = function() {
  1212. return this.pushStack( jQuery.uniqueSort( slice.apply( this ) ) );
  1213. };
  1214. Expr = jQuery.expr = {
  1215. // Can be adjusted by the user
  1216. cacheLength: 50,
  1217. createPseudo: markFunction,
  1218. match: matchExpr,
  1219. attrHandle: {},
  1220. find: {},
  1221. relative: {
  1222. ">": { dir: "parentNode", first: true },
  1223. " ": { dir: "parentNode" },
  1224. "+": { dir: "previousSibling", first: true },
  1225. "~": { dir: "previousSibling" }
  1226. },
  1227. preFilter: {
  1228. ATTR: function( match ) {
  1229. match[ 1 ] = match[ 1 ].replace( runescape, funescape );
  1230. // Move the given value to match[3] whether quoted or unquoted
  1231. match[ 3 ] = ( match[ 3 ] || match[ 4 ] || match[ 5 ] || "" )
  1232. .replace( runescape, funescape );
  1233. if ( match[ 2 ] === "~=" ) {
  1234. match[ 3 ] = " " + match[ 3 ] + " ";
  1235. }
  1236. return match.slice( 0, 4 );
  1237. },
  1238. CHILD: function( match ) {
  1239. /* matches from matchExpr["CHILD"]
  1240. 1 type (only|nth|...)
  1241. 2 what (child|of-type)
  1242. 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
  1243. 4 xn-component of xn+y argument ([+-]?\d*n|)
  1244. 5 sign of xn-component
  1245. 6 x of xn-component
  1246. 7 sign of y-component
  1247. 8 y of y-component
  1248. */
  1249. match[ 1 ] = match[ 1 ].toLowerCase();
  1250. if ( match[ 1 ].slice( 0, 3 ) === "nth" ) {
  1251. // nth-* requires argument
  1252. if ( !match[ 3 ] ) {
  1253. find.error( match[ 0 ] );
  1254. }
  1255. // numeric x and y parameters for Expr.filter.CHILD
  1256. // remember that false/true cast respectively to 0/1
  1257. match[ 4 ] = +( match[ 4 ] ?
  1258. match[ 5 ] + ( match[ 6 ] || 1 ) :
  1259. 2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" )
  1260. );
  1261. match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" );
  1262. // other types prohibit arguments
  1263. } else if ( match[ 3 ] ) {
  1264. find.error( match[ 0 ] );
  1265. }
  1266. return match;
  1267. },
  1268. PSEUDO: function( match ) {
  1269. var excess,
  1270. unquoted = !match[ 6 ] && match[ 2 ];
  1271. if ( matchExpr.CHILD.test( match[ 0 ] ) ) {
  1272. return null;
  1273. }
  1274. // Accept quoted arguments as-is
  1275. if ( match[ 3 ] ) {
  1276. match[ 2 ] = match[ 4 ] || match[ 5 ] || "";
  1277. // Strip excess characters from unquoted arguments
  1278. } else if ( unquoted && rpseudo.test( unquoted ) &&
  1279. // Get excess from tokenize (recursively)
  1280. ( excess = tokenize( unquoted, true ) ) &&
  1281. // advance to the next closing parenthesis
  1282. ( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) {
  1283. // excess is a negative index
  1284. match[ 0 ] = match[ 0 ].slice( 0, excess );
  1285. match[ 2 ] = unquoted.slice( 0, excess );
  1286. }
  1287. // Return only captures needed by the pseudo filter method (type and argument)
  1288. return match.slice( 0, 3 );
  1289. }
  1290. },
  1291. filter: {
  1292. TAG: function( nodeNameSelector ) {
  1293. var expectedNodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
  1294. return nodeNameSelector === "*" ?
  1295. function() {
  1296. return true;
  1297. } :
  1298. function( elem ) {
  1299. return nodeName( elem, expectedNodeName );
  1300. };
  1301. },
  1302. CLASS: function( className ) {
  1303. var pattern = classCache[ className + " " ];
  1304. return pattern ||
  1305. ( pattern = new RegExp( "(^|" + whitespace + ")" + className +
  1306. "(" + whitespace + "|$)" ) ) &&
  1307. classCache( className, function( elem ) {
  1308. return pattern.test(
  1309. typeof elem.className === "string" && elem.className ||
  1310. typeof elem.getAttribute !== "undefined" &&
  1311. elem.getAttribute( "class" ) ||
  1312. ""
  1313. );
  1314. } );
  1315. },
  1316. ATTR: function( name, operator, check ) {
  1317. return function( elem ) {
  1318. var result = find.attr( elem, name );
  1319. if ( result == null ) {
  1320. return operator === "!=";
  1321. }
  1322. if ( !operator ) {
  1323. return true;
  1324. }
  1325. result += "";
  1326. if ( operator === "=" ) {
  1327. return result === check;
  1328. }
  1329. if ( operator === "!=" ) {
  1330. return result !== check;
  1331. }
  1332. if ( operator === "^=" ) {
  1333. return check && result.indexOf( check ) === 0;
  1334. }
  1335. if ( operator === "*=" ) {
  1336. return check && result.indexOf( check ) > -1;
  1337. }
  1338. if ( operator === "$=" ) {
  1339. return check && result.slice( -check.length ) === check;
  1340. }
  1341. if ( operator === "~=" ) {
  1342. return ( " " + result.replace( rwhitespace, " " ) + " " )
  1343. .indexOf( check ) > -1;
  1344. }
  1345. if ( operator === "|=" ) {
  1346. return result === check || result.slice( 0, check.length + 1 ) === check + "-";
  1347. }
  1348. return false;
  1349. };
  1350. },
  1351. CHILD: function( type, what, _argument, first, last ) {
  1352. var simple = type.slice( 0, 3 ) !== "nth",
  1353. forward = type.slice( -4 ) !== "last",
  1354. ofType = what === "of-type";
  1355. return first === 1 && last === 0 ?
  1356. // Shortcut for :nth-*(n)
  1357. function( elem ) {
  1358. return !!elem.parentNode;
  1359. } :
  1360. function( elem, _context, xml ) {
  1361. var cache, outerCache, node, nodeIndex, start,
  1362. dir = simple !== forward ? "nextSibling" : "previousSibling",
  1363. parent = elem.parentNode,
  1364. name = ofType && elem.nodeName.toLowerCase(),
  1365. useCache = !xml && !ofType,
  1366. diff = false;
  1367. if ( parent ) {
  1368. // :(first|last|only)-(child|of-type)
  1369. if ( simple ) {
  1370. while ( dir ) {
  1371. node = elem;
  1372. while ( ( node = node[ dir ] ) ) {
  1373. if ( ofType ?
  1374. nodeName( node, name ) :
  1375. node.nodeType === 1 ) {
  1376. return false;
  1377. }
  1378. }
  1379. // Reverse direction for :only-* (if we haven't yet done so)
  1380. start = dir = type === "only" && !start && "nextSibling";
  1381. }
  1382. return true;
  1383. }
  1384. start = [ forward ? parent.firstChild : parent.lastChild ];
  1385. // non-xml :nth-child(...) stores cache data on `parent`
  1386. if ( forward && useCache ) {
  1387. // Seek `elem` from a previously-cached index
  1388. outerCache = parent[ expando ] || ( parent[ expando ] = {} );
  1389. cache = outerCache[ type ] || [];
  1390. nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
  1391. diff = nodeIndex && cache[ 2 ];
  1392. node = nodeIndex && parent.childNodes[ nodeIndex ];
  1393. while ( ( node = ++nodeIndex && node && node[ dir ] ||
  1394. // Fallback to seeking `elem` from the start
  1395. ( diff = nodeIndex = 0 ) || start.pop() ) ) {
  1396. // When found, cache indexes on `parent` and break
  1397. if ( node.nodeType === 1 && ++diff && node === elem ) {
  1398. outerCache[ type ] = [ dirruns, nodeIndex, diff ];
  1399. break;
  1400. }
  1401. }
  1402. } else {
  1403. // Use previously-cached element index if available
  1404. if ( useCache ) {
  1405. outerCache = elem[ expando ] || ( elem[ expando ] = {} );
  1406. cache = outerCache[ type ] || [];
  1407. nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
  1408. diff = nodeIndex;
  1409. }
  1410. // xml :nth-child(...)
  1411. // or :nth-last-child(...) or :nth(-last)?-of-type(...)
  1412. if ( diff === false ) {
  1413. // Use the same loop as above to seek `elem` from the start
  1414. while ( ( node = ++nodeIndex && node && node[ dir ] ||
  1415. ( diff = nodeIndex = 0 ) || start.pop() ) ) {
  1416. if ( ( ofType ?
  1417. nodeName( node, name ) :
  1418. node.nodeType === 1 ) &&
  1419. ++diff ) {
  1420. // Cache the index of each encountered element
  1421. if ( useCache ) {
  1422. outerCache = node[ expando ] ||
  1423. ( node[ expando ] = {} );
  1424. outerCache[ type ] = [ dirruns, diff ];
  1425. }
  1426. if ( node === elem ) {
  1427. break;
  1428. }
  1429. }
  1430. }
  1431. }
  1432. }
  1433. // Incorporate the offset, then check against cycle size
  1434. diff -= last;
  1435. return diff === first || ( diff % first === 0 && diff / first >= 0 );
  1436. }
  1437. };
  1438. },
  1439. PSEUDO: function( pseudo, argument ) {
  1440. // pseudo-class names are case-insensitive
  1441. // https://www.w3.org/TR/selectors/#pseudo-classes
  1442. // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
  1443. // Remember that setFilters inherits from pseudos
  1444. var args,
  1445. fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
  1446. find.error( "unsupported pseudo: " + pseudo );
  1447. // The user may use createPseudo to indicate that
  1448. // arguments are needed to create the filter function
  1449. // just as jQuery does
  1450. if ( fn[ expando ] ) {
  1451. return fn( argument );
  1452. }
  1453. // But maintain support for old signatures
  1454. if ( fn.length > 1 ) {
  1455. args = [ pseudo, pseudo, "", argument ];
  1456. return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
  1457. markFunction( function( seed, matches ) {
  1458. var idx,
  1459. matched = fn( seed, argument ),
  1460. i = matched.length;
  1461. while ( i-- ) {
  1462. idx = indexOf.call( seed, matched[ i ] );
  1463. seed[ idx ] = !( matches[ idx ] = matched[ i ] );
  1464. }
  1465. } ) :
  1466. function( elem ) {
  1467. return fn( elem, 0, args );
  1468. };
  1469. }
  1470. return fn;
  1471. }
  1472. },
  1473. pseudos: {
  1474. // Potentially complex pseudos
  1475. not: markFunction( function( selector ) {
  1476. // Trim the selector passed to compile
  1477. // to avoid treating leading and trailing
  1478. // spaces as combinators
  1479. var input = [],
  1480. results = [],
  1481. matcher = compile( selector.replace( rtrimCSS, "$1" ) );
  1482. return matcher[ expando ] ?
  1483. markFunction( function( seed, matches, _context, xml ) {
  1484. var elem,
  1485. unmatched = matcher( seed, null, xml, [] ),
  1486. i = seed.length;
  1487. // Match elements unmatched by `matcher`
  1488. while ( i-- ) {
  1489. if ( ( elem = unmatched[ i ] ) ) {
  1490. seed[ i ] = !( matches[ i ] = elem );
  1491. }
  1492. }
  1493. } ) :
  1494. function( elem, _context, xml ) {
  1495. input[ 0 ] = elem;
  1496. matcher( input, null, xml, results );
  1497. // Don't keep the element
  1498. // (see https://github.com/jquery/sizzle/issues/299)
  1499. input[ 0 ] = null;
  1500. return !results.pop();
  1501. };
  1502. } ),
  1503. has: markFunction( function( selector ) {
  1504. return function( elem ) {
  1505. return find( selector, elem ).length > 0;
  1506. };
  1507. } ),
  1508. contains: markFunction( function( text ) {
  1509. text = text.replace( runescape, funescape );
  1510. return function( elem ) {
  1511. return ( elem.textContent || jQuery.text( elem ) ).indexOf( text ) > -1;
  1512. };
  1513. } ),
  1514. // "Whether an element is represented by a :lang() selector
  1515. // is based solely on the element's language value
  1516. // being equal to the identifier C,
  1517. // or beginning with the identifier C immediately followed by "-".
  1518. // The matching of C against the element's language value is performed case-insensitively.
  1519. // The identifier C does not have to be a valid language name."
  1520. // https://www.w3.org/TR/selectors/#lang-pseudo
  1521. lang: markFunction( function( lang ) {
  1522. // lang value must be a valid identifier
  1523. if ( !ridentifier.test( lang || "" ) ) {
  1524. find.error( "unsupported lang: " + lang );
  1525. }
  1526. lang = lang.replace( runescape, funescape ).toLowerCase();
  1527. return function( elem ) {
  1528. var elemLang;
  1529. do {
  1530. if ( ( elemLang = documentIsHTML ?
  1531. elem.lang :
  1532. elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) {
  1533. elemLang = elemLang.toLowerCase();
  1534. return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
  1535. }
  1536. } while ( ( elem = elem.parentNode ) && elem.nodeType === 1 );
  1537. return false;
  1538. };
  1539. } ),
  1540. // Miscellaneous
  1541. target: function( elem ) {
  1542. var hash = window.location && window.location.hash;
  1543. return hash && hash.slice( 1 ) === elem.id;
  1544. },
  1545. root: function( elem ) {
  1546. return elem === documentElement;
  1547. },
  1548. focus: function( elem ) {
  1549. return elem === safeActiveElement() &&
  1550. document.hasFocus() &&
  1551. !!( elem.type || elem.href || ~elem.tabIndex );
  1552. },
  1553. // Boolean properties
  1554. enabled: createDisabledPseudo( false ),
  1555. disabled: createDisabledPseudo( true ),
  1556. checked: function( elem ) {
  1557. // In CSS3, :checked should return both checked and selected elements
  1558. // https://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
  1559. return ( nodeName( elem, "input" ) && !!elem.checked ) ||
  1560. ( nodeName( elem, "option" ) && !!elem.selected );
  1561. },
  1562. selected: function( elem ) {
  1563. // Support: IE <=11+
  1564. // Accessing the selectedIndex property
  1565. // forces the browser to treat the default option as
  1566. // selected when in an optgroup.
  1567. if ( elem.parentNode ) {
  1568. // eslint-disable-next-line no-unused-expressions
  1569. elem.parentNode.selectedIndex;
  1570. }
  1571. return elem.selected === true;
  1572. },
  1573. // Contents
  1574. empty: function( elem ) {
  1575. // https://www.w3.org/TR/selectors/#empty-pseudo
  1576. // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
  1577. // but not by others (comment: 8; processing instruction: 7; etc.)
  1578. // nodeType < 6 works because attributes (2) do not appear as children
  1579. for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
  1580. if ( elem.nodeType < 6 ) {
  1581. return false;
  1582. }
  1583. }
  1584. return true;
  1585. },
  1586. parent: function( elem ) {
  1587. return !Expr.pseudos.empty( elem );
  1588. },
  1589. // Element/input types
  1590. header: function( elem ) {
  1591. return rheader.test( elem.nodeName );
  1592. },
  1593. input: function( elem ) {
  1594. return rinputs.test( elem.nodeName );
  1595. },
  1596. button: function( elem ) {
  1597. return nodeName( elem, "input" ) && elem.type === "button" ||
  1598. nodeName( elem, "button" );
  1599. },
  1600. text: function( elem ) {
  1601. var attr;
  1602. return nodeName( elem, "input" ) && elem.type === "text" &&
  1603. // Support: IE <10 only
  1604. // New HTML5 attribute values (e.g., "search") appear
  1605. // with elem.type === "text"
  1606. ( ( attr = elem.getAttribute( "type" ) ) == null ||
  1607. attr.toLowerCase() === "text" );
  1608. },
  1609. // Position-in-collection
  1610. first: createPositionalPseudo( function() {
  1611. return [ 0 ];
  1612. } ),
  1613. last: createPositionalPseudo( function( _matchIndexes, length ) {
  1614. return [ length - 1 ];
  1615. } ),
  1616. eq: createPositionalPseudo( function( _matchIndexes, length, argument ) {
  1617. return [ argument < 0 ? argument + length : argument ];
  1618. } ),
  1619. even: createPositionalPseudo( function( matchIndexes, length ) {
  1620. var i = 0;
  1621. for ( ; i < length; i += 2 ) {
  1622. matchIndexes.push( i );
  1623. }
  1624. return matchIndexes;
  1625. } ),
  1626. odd: createPositionalPseudo( function( matchIndexes, length ) {
  1627. var i = 1;
  1628. for ( ; i < length; i += 2 ) {
  1629. matchIndexes.push( i );
  1630. }
  1631. return matchIndexes;
  1632. } ),
  1633. lt: createPositionalPseudo( function( matchIndexes, length, argument ) {
  1634. var i;
  1635. if ( argument < 0 ) {
  1636. i = argument + length;
  1637. } else if ( argument > length ) {
  1638. i = length;
  1639. } else {
  1640. i = argument;
  1641. }
  1642. for ( ; --i >= 0; ) {
  1643. matchIndexes.push( i );
  1644. }
  1645. return matchIndexes;
  1646. } ),
  1647. gt: createPositionalPseudo( function( matchIndexes, length, argument ) {
  1648. var i = argument < 0 ? argument + length : argument;
  1649. for ( ; ++i < length; ) {
  1650. matchIndexes.push( i );
  1651. }
  1652. return matchIndexes;
  1653. } )
  1654. }
  1655. };
  1656. Expr.pseudos.nth = Expr.pseudos.eq;
  1657. // Add button/input type pseudos
  1658. for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
  1659. Expr.pseudos[ i ] = createInputPseudo( i );
  1660. }
  1661. for ( i in { submit: true, reset: true } ) {
  1662. Expr.pseudos[ i ] = createButtonPseudo( i );
  1663. }
  1664. // Easy API for creating new setFilters
  1665. function setFilters() {}
  1666. setFilters.prototype = Expr.filters = Expr.pseudos;
  1667. Expr.setFilters = new setFilters();
  1668. function tokenize( selector, parseOnly ) {
  1669. var matched, match, tokens, type,
  1670. soFar, groups, preFilters,
  1671. cached = tokenCache[ selector + " " ];
  1672. if ( cached ) {
  1673. return parseOnly ? 0 : cached.slice( 0 );
  1674. }
  1675. soFar = selector;
  1676. groups = [];
  1677. preFilters = Expr.preFilter;
  1678. while ( soFar ) {
  1679. // Comma and first run
  1680. if ( !matched || ( match = rcomma.exec( soFar ) ) ) {
  1681. if ( match ) {
  1682. // Don't consume trailing commas as valid
  1683. soFar = soFar.slice( match[ 0 ].length ) || soFar;
  1684. }
  1685. groups.push( ( tokens = [] ) );
  1686. }
  1687. matched = false;
  1688. // Combinators
  1689. if ( ( match = rleadingCombinator.exec( soFar ) ) ) {
  1690. matched = match.shift();
  1691. tokens.push( {
  1692. value: matched,
  1693. // Cast descendant combinators to space
  1694. type: match[ 0 ].replace( rtrimCSS, " " )
  1695. } );
  1696. soFar = soFar.slice( matched.length );
  1697. }
  1698. // Filters
  1699. for ( type in Expr.filter ) {
  1700. if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] ||
  1701. ( match = preFilters[ type ]( match ) ) ) ) {
  1702. matched = match.shift();
  1703. tokens.push( {
  1704. value: matched,
  1705. type: type,
  1706. matches: match
  1707. } );
  1708. soFar = soFar.slice( matched.length );
  1709. }
  1710. }
  1711. if ( !matched ) {
  1712. break;
  1713. }
  1714. }
  1715. // Return the length of the invalid excess
  1716. // if we're just parsing
  1717. // Otherwise, throw an error or return tokens
  1718. if ( parseOnly ) {
  1719. return soFar.length;
  1720. }
  1721. return soFar ?
  1722. find.error( selector ) :
  1723. // Cache the tokens
  1724. tokenCache( selector, groups ).slice( 0 );
  1725. }
  1726. function toSelector( tokens ) {
  1727. var i = 0,
  1728. len = tokens.length,
  1729. selector = "";
  1730. for ( ; i < len; i++ ) {
  1731. selector += tokens[ i ].value;
  1732. }
  1733. return selector;
  1734. }
  1735. function addCombinator( matcher, combinator, base ) {
  1736. var dir = combinator.dir,
  1737. skip = combinator.next,
  1738. key = skip || dir,
  1739. checkNonElements = base && key === "parentNode",
  1740. doneName = done++;
  1741. return combinator.first ?
  1742. // Check against closest ancestor/preceding element
  1743. function( elem, context, xml ) {
  1744. while ( ( elem = elem[ dir ] ) ) {
  1745. if ( elem.nodeType === 1 || checkNonElements ) {
  1746. return matcher( elem, context, xml );
  1747. }
  1748. }
  1749. return false;
  1750. } :
  1751. // Check against all ancestor/preceding elements
  1752. function( elem, context, xml ) {
  1753. var oldCache, outerCache,
  1754. newCache = [ dirruns, doneName ];
  1755. // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
  1756. if ( xml ) {
  1757. while ( ( elem = elem[ dir ] ) ) {
  1758. if ( elem.nodeType === 1 || checkNonElements ) {
  1759. if ( matcher( elem, context, xml ) ) {
  1760. return true;
  1761. }
  1762. }
  1763. }
  1764. } else {
  1765. while ( ( elem = elem[ dir ] ) ) {
  1766. if ( elem.nodeType === 1 || checkNonElements ) {
  1767. outerCache = elem[ expando ] || ( elem[ expando ] = {} );
  1768. if ( skip && nodeName( elem, skip ) ) {
  1769. elem = elem[ dir ] || elem;
  1770. } else if ( ( oldCache = outerCache[ key ] ) &&
  1771. oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
  1772. // Assign to newCache so results back-propagate to previous elements
  1773. return ( newCache[ 2 ] = oldCache[ 2 ] );
  1774. } else {
  1775. // Reuse newcache so results back-propagate to previous elements
  1776. outerCache[ key ] = newCache;
  1777. // A match means we're done; a fail means we have to keep checking
  1778. if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) {
  1779. return true;
  1780. }
  1781. }
  1782. }
  1783. }
  1784. }
  1785. return false;
  1786. };
  1787. }
  1788. function elementMatcher( matchers ) {
  1789. return matchers.length > 1 ?
  1790. function( elem, context, xml ) {
  1791. var i = matchers.length;
  1792. while ( i-- ) {
  1793. if ( !matchers[ i ]( elem, context, xml ) ) {
  1794. return false;
  1795. }
  1796. }
  1797. return true;
  1798. } :
  1799. matchers[ 0 ];
  1800. }
  1801. function multipleContexts( selector, contexts, results ) {
  1802. var i = 0,
  1803. len = contexts.length;
  1804. for ( ; i < len; i++ ) {
  1805. find( selector, contexts[ i ], results );
  1806. }
  1807. return results;
  1808. }
  1809. function condense( unmatched, map, filter, context, xml ) {
  1810. var elem,
  1811. newUnmatched = [],
  1812. i = 0,
  1813. len = unmatched.length,
  1814. mapped = map != null;
  1815. for ( ; i < len; i++ ) {
  1816. if ( ( elem = unmatched[ i ] ) ) {
  1817. if ( !filter || filter( elem, context, xml ) ) {
  1818. newUnmatched.push( elem );
  1819. if ( mapped ) {
  1820. map.push( i );
  1821. }
  1822. }
  1823. }
  1824. }
  1825. return newUnmatched;
  1826. }
  1827. function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
  1828. if ( postFilter && !postFilter[ expando ] ) {
  1829. postFilter = setMatcher( postFilter );
  1830. }
  1831. if ( postFinder && !postFinder[ expando ] ) {
  1832. postFinder = setMatcher( postFinder, postSelector );
  1833. }
  1834. return markFunction( function( seed, results, context, xml ) {
  1835. var temp, i, elem, matcherOut,
  1836. preMap = [],
  1837. postMap = [],
  1838. preexisting = results.length,
  1839. // Get initial elements from seed or context
  1840. elems = seed ||
  1841. multipleContexts( selector || "*",
  1842. context.nodeType ? [ context ] : context, [] ),
  1843. // Prefilter to get matcher input, preserving a map for seed-results synchronization
  1844. matcherIn = preFilter && ( seed || !selector ) ?
  1845. condense( elems, preMap, preFilter, context, xml ) :
  1846. elems;
  1847. if ( matcher ) {
  1848. // If we have a postFinder, or filtered seed, or non-seed postFilter
  1849. // or preexisting results,
  1850. matcherOut = postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
  1851. // ...intermediate processing is necessary
  1852. [] :
  1853. // ...otherwise use results directly
  1854. results;
  1855. // Find primary matches
  1856. matcher( matcherIn, matcherOut, context, xml );
  1857. } else {
  1858. matcherOut = matcherIn;
  1859. }
  1860. // Apply postFilter
  1861. if ( postFilter ) {
  1862. temp = condense( matcherOut, postMap );
  1863. postFilter( temp, [], context, xml );
  1864. // Un-match failing elements by moving them back to matcherIn
  1865. i = temp.length;
  1866. while ( i-- ) {
  1867. if ( ( elem = temp[ i ] ) ) {
  1868. matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem );
  1869. }
  1870. }
  1871. }
  1872. if ( seed ) {
  1873. if ( postFinder || preFilter ) {
  1874. if ( postFinder ) {
  1875. // Get the final matcherOut by condensing this intermediate into postFinder contexts
  1876. temp = [];
  1877. i = matcherOut.length;
  1878. while ( i-- ) {
  1879. if ( ( elem = matcherOut[ i ] ) ) {
  1880. // Restore matcherIn since elem is not yet a final match
  1881. temp.push( ( matcherIn[ i ] = elem ) );
  1882. }
  1883. }
  1884. postFinder( null, ( matcherOut = [] ), temp, xml );
  1885. }
  1886. // Move matched elements from seed to results to keep them synchronized
  1887. i = matcherOut.length;
  1888. while ( i-- ) {
  1889. if ( ( elem = matcherOut[ i ] ) &&
  1890. ( temp = postFinder ? indexOf.call( seed, elem ) : preMap[ i ] ) > -1 ) {
  1891. seed[ temp ] = !( results[ temp ] = elem );
  1892. }
  1893. }
  1894. }
  1895. // Add elements to results, through postFinder if defined
  1896. } else {
  1897. matcherOut = condense(
  1898. matcherOut === results ?
  1899. matcherOut.splice( preexisting, matcherOut.length ) :
  1900. matcherOut
  1901. );
  1902. if ( postFinder ) {
  1903. postFinder( null, results, matcherOut, xml );
  1904. } else {
  1905. push.apply( results, matcherOut );
  1906. }
  1907. }
  1908. } );
  1909. }
  1910. function matcherFromTokens( tokens ) {
  1911. var checkContext, matcher, j,
  1912. len = tokens.length,
  1913. leadingRelative = Expr.relative[ tokens[ 0 ].type ],
  1914. implicitRelative = leadingRelative || Expr.relative[ " " ],
  1915. i = leadingRelative ? 1 : 0,
  1916. // The foundational matcher ensures that elements are reachable from top-level context(s)
  1917. matchContext = addCombinator( function( elem ) {
  1918. return elem === checkContext;
  1919. }, implicitRelative, true ),
  1920. matchAnyContext = addCombinator( function( elem ) {
  1921. return indexOf.call( checkContext, elem ) > -1;
  1922. }, implicitRelative, true ),
  1923. matchers = [ function( elem, context, xml ) {
  1924. // Support: IE 11+, Edge 17 - 18+
  1925. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1926. // two documents; shallow comparisons work.
  1927. // eslint-disable-next-line eqeqeq
  1928. var ret = ( !leadingRelative && ( xml || context != outermostContext ) ) || (
  1929. ( checkContext = context ).nodeType ?
  1930. matchContext( elem, context, xml ) :
  1931. matchAnyContext( elem, context, xml ) );
  1932. // Avoid hanging onto element
  1933. // (see https://github.com/jquery/sizzle/issues/299)
  1934. checkContext = null;
  1935. return ret;
  1936. } ];
  1937. for ( ; i < len; i++ ) {
  1938. if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) {
  1939. matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ];
  1940. } else {
  1941. matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches );
  1942. // Return special upon seeing a positional matcher
  1943. if ( matcher[ expando ] ) {
  1944. // Find the next relative operator (if any) for proper handling
  1945. j = ++i;
  1946. for ( ; j < len; j++ ) {
  1947. if ( Expr.relative[ tokens[ j ].type ] ) {
  1948. break;
  1949. }
  1950. }
  1951. return setMatcher(
  1952. i > 1 && elementMatcher( matchers ),
  1953. i > 1 && toSelector(
  1954. // If the preceding token was a descendant combinator, insert an implicit any-element `*`
  1955. tokens.slice( 0, i - 1 )
  1956. .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } )
  1957. ).replace( rtrimCSS, "$1" ),
  1958. matcher,
  1959. i < j && matcherFromTokens( tokens.slice( i, j ) ),
  1960. j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ),
  1961. j < len && toSelector( tokens )
  1962. );
  1963. }
  1964. matchers.push( matcher );
  1965. }
  1966. }
  1967. return elementMatcher( matchers );
  1968. }
  1969. function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
  1970. var bySet = setMatchers.length > 0,
  1971. byElement = elementMatchers.length > 0,
  1972. superMatcher = function( seed, context, xml, results, outermost ) {
  1973. var elem, j, matcher,
  1974. matchedCount = 0,
  1975. i = "0",
  1976. unmatched = seed && [],
  1977. setMatched = [],
  1978. contextBackup = outermostContext,
  1979. // We must always have either seed elements or outermost context
  1980. elems = seed || byElement && Expr.find.TAG( "*", outermost ),
  1981. // Use integer dirruns iff this is the outermost matcher
  1982. dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ),
  1983. len = elems.length;
  1984. if ( outermost ) {
  1985. // Support: IE 11+, Edge 17 - 18+
  1986. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  1987. // two documents; shallow comparisons work.
  1988. // eslint-disable-next-line eqeqeq
  1989. outermostContext = context == document || context || outermost;
  1990. }
  1991. // Add elements passing elementMatchers directly to results
  1992. // Support: iOS <=7 - 9 only
  1993. // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching
  1994. // elements by id. (see trac-14142)
  1995. for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) {
  1996. if ( byElement && elem ) {
  1997. j = 0;
  1998. // Support: IE 11+, Edge 17 - 18+
  1999. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  2000. // two documents; shallow comparisons work.
  2001. // eslint-disable-next-line eqeqeq
  2002. if ( !context && elem.ownerDocument != document ) {
  2003. setDocument( elem );
  2004. xml = !documentIsHTML;
  2005. }
  2006. while ( ( matcher = elementMatchers[ j++ ] ) ) {
  2007. if ( matcher( elem, context || document, xml ) ) {
  2008. push.call( results, elem );
  2009. break;
  2010. }
  2011. }
  2012. if ( outermost ) {
  2013. dirruns = dirrunsUnique;
  2014. }
  2015. }
  2016. // Track unmatched elements for set filters
  2017. if ( bySet ) {
  2018. // They will have gone through all possible matchers
  2019. if ( ( elem = !matcher && elem ) ) {
  2020. matchedCount--;
  2021. }
  2022. // Lengthen the array for every element, matched or not
  2023. if ( seed ) {
  2024. unmatched.push( elem );
  2025. }
  2026. }
  2027. }
  2028. // `i` is now the count of elements visited above, and adding it to `matchedCount`
  2029. // makes the latter nonnegative.
  2030. matchedCount += i;
  2031. // Apply set filters to unmatched elements
  2032. // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`
  2033. // equals `i`), unless we didn't visit _any_ elements in the above loop because we have
  2034. // no element matchers and no seed.
  2035. // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that
  2036. // case, which will result in a "00" `matchedCount` that differs from `i` but is also
  2037. // numerically zero.
  2038. if ( bySet && i !== matchedCount ) {
  2039. j = 0;
  2040. while ( ( matcher = setMatchers[ j++ ] ) ) {
  2041. matcher( unmatched, setMatched, context, xml );
  2042. }
  2043. if ( seed ) {
  2044. // Reintegrate element matches to eliminate the need for sorting
  2045. if ( matchedCount > 0 ) {
  2046. while ( i-- ) {
  2047. if ( !( unmatched[ i ] || setMatched[ i ] ) ) {
  2048. setMatched[ i ] = pop.call( results );
  2049. }
  2050. }
  2051. }
  2052. // Discard index placeholder values to get only actual matches
  2053. setMatched = condense( setMatched );
  2054. }
  2055. // Add matches to results
  2056. push.apply( results, setMatched );
  2057. // Seedless set matches succeeding multiple successful matchers stipulate sorting
  2058. if ( outermost && !seed && setMatched.length > 0 &&
  2059. ( matchedCount + setMatchers.length ) > 1 ) {
  2060. jQuery.uniqueSort( results );
  2061. }
  2062. }
  2063. // Override manipulation of globals by nested matchers
  2064. if ( outermost ) {
  2065. dirruns = dirrunsUnique;
  2066. outermostContext = contextBackup;
  2067. }
  2068. return unmatched;
  2069. };
  2070. return bySet ?
  2071. markFunction( superMatcher ) :
  2072. superMatcher;
  2073. }
  2074. function compile( selector, match /* Internal Use Only */ ) {
  2075. var i,
  2076. setMatchers = [],
  2077. elementMatchers = [],
  2078. cached = compilerCache[ selector + " " ];
  2079. if ( !cached ) {
  2080. // Generate a function of recursive functions that can be used to check each element
  2081. if ( !match ) {
  2082. match = tokenize( selector );
  2083. }
  2084. i = match.length;
  2085. while ( i-- ) {
  2086. cached = matcherFromTokens( match[ i ] );
  2087. if ( cached[ expando ] ) {
  2088. setMatchers.push( cached );
  2089. } else {
  2090. elementMatchers.push( cached );
  2091. }
  2092. }
  2093. // Cache the compiled function
  2094. cached = compilerCache( selector,
  2095. matcherFromGroupMatchers( elementMatchers, setMatchers ) );
  2096. // Save selector and tokenization
  2097. cached.selector = selector;
  2098. }
  2099. return cached;
  2100. }
  2101. /**
  2102. * A low-level selection function that works with jQuery's compiled
  2103. * selector functions
  2104. * @param {String|Function} selector A selector or a pre-compiled
  2105. * selector function built with jQuery selector compile
  2106. * @param {Element} context
  2107. * @param {Array} [results]
  2108. * @param {Array} [seed] A set of elements to match against
  2109. */
  2110. function select( selector, context, results, seed ) {
  2111. var i, tokens, token, type, find,
  2112. compiled = typeof selector === "function" && selector,
  2113. match = !seed && tokenize( ( selector = compiled.selector || selector ) );
  2114. results = results || [];
  2115. // Try to minimize operations if there is only one selector in the list and no seed
  2116. // (the latter of which guarantees us context)
  2117. if ( match.length === 1 ) {
  2118. // Reduce context if the leading compound selector is an ID
  2119. tokens = match[ 0 ] = match[ 0 ].slice( 0 );
  2120. if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" &&
  2121. context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) {
  2122. context = ( Expr.find.ID(
  2123. token.matches[ 0 ].replace( runescape, funescape ),
  2124. context
  2125. ) || [] )[ 0 ];
  2126. if ( !context ) {
  2127. return results;
  2128. // Precompiled matchers will still verify ancestry, so step up a level
  2129. } else if ( compiled ) {
  2130. context = context.parentNode;
  2131. }
  2132. selector = selector.slice( tokens.shift().value.length );
  2133. }
  2134. // Fetch a seed set for right-to-left matching
  2135. i = matchExpr.needsContext.test( selector ) ? 0 : tokens.length;
  2136. while ( i-- ) {
  2137. token = tokens[ i ];
  2138. // Abort if we hit a combinator
  2139. if ( Expr.relative[ ( type = token.type ) ] ) {
  2140. break;
  2141. }
  2142. if ( ( find = Expr.find[ type ] ) ) {
  2143. // Search, expanding context for leading sibling combinators
  2144. if ( ( seed = find(
  2145. token.matches[ 0 ].replace( runescape, funescape ),
  2146. rsibling.test( tokens[ 0 ].type ) &&
  2147. testContext( context.parentNode ) || context
  2148. ) ) ) {
  2149. // If seed is empty or no tokens remain, we can return early
  2150. tokens.splice( i, 1 );
  2151. selector = seed.length && toSelector( tokens );
  2152. if ( !selector ) {
  2153. push.apply( results, seed );
  2154. return results;
  2155. }
  2156. break;
  2157. }
  2158. }
  2159. }
  2160. }
  2161. // Compile and execute a filtering function if one is not provided
  2162. // Provide `match` to avoid retokenization if we modified the selector above
  2163. ( compiled || compile( selector, match ) )(
  2164. seed,
  2165. context,
  2166. !documentIsHTML,
  2167. results,
  2168. !context || rsibling.test( selector ) && testContext( context.parentNode ) || context
  2169. );
  2170. return results;
  2171. }
  2172. // One-time assignments
  2173. // Support: Android <=4.0 - 4.1+
  2174. // Sort stability
  2175. support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando;
  2176. // Initialize against the default document
  2177. setDocument();
  2178. // Support: Android <=4.0 - 4.1+
  2179. // Detached nodes confoundingly follow *each other*
  2180. support.sortDetached = assert( function( el ) {
  2181. // Should return 1, but returns 4 (following)
  2182. return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1;
  2183. } );
  2184. jQuery.find = find;
  2185. // Deprecated
  2186. jQuery.expr[ ":" ] = jQuery.expr.pseudos;
  2187. jQuery.unique = jQuery.uniqueSort;
  2188. // These have always been private, but they used to be documented
  2189. // as part of Sizzle so let's maintain them in the 3.x line
  2190. // for backwards compatibility purposes.
  2191. find.compile = compile;
  2192. find.select = select;
  2193. find.setDocument = setDocument;
  2194. find.escape = jQuery.escapeSelector;
  2195. find.getText = jQuery.text;
  2196. find.isXML = jQuery.isXMLDoc;
  2197. find.selectors = jQuery.expr;
  2198. find.support = jQuery.support;
  2199. find.uniqueSort = jQuery.uniqueSort;
  2200. /* eslint-enable */
  2201. } )();
  2202. var dir = function( elem, dir, until ) {
  2203. var matched = [],
  2204. truncate = until !== undefined;
  2205. while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {
  2206. if ( elem.nodeType === 1 ) {
  2207. if ( truncate && jQuery( elem ).is( until ) ) {
  2208. break;
  2209. }
  2210. matched.push( elem );
  2211. }
  2212. }
  2213. return matched;
  2214. };
  2215. var siblings = function( n, elem ) {
  2216. var matched = [];
  2217. for ( ; n; n = n.nextSibling ) {
  2218. if ( n.nodeType === 1 && n !== elem ) {
  2219. matched.push( n );
  2220. }
  2221. }
  2222. return matched;
  2223. };
  2224. var rneedsContext = jQuery.expr.match.needsContext;
  2225. var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i );
  2226. // Implement the identical functionality for filter and not
  2227. function winnow( elements, qualifier, not ) {
  2228. if ( isFunction( qualifier ) ) {
  2229. return jQuery.grep( elements, function( elem, i ) {
  2230. return !!qualifier.call( elem, i, elem ) !== not;
  2231. } );
  2232. }
  2233. // Single element
  2234. if ( qualifier.nodeType ) {
  2235. return jQuery.grep( elements, function( elem ) {
  2236. return ( elem === qualifier ) !== not;
  2237. } );
  2238. }
  2239. // Arraylike of elements (jQuery, arguments, Array)
  2240. if ( typeof qualifier !== "string" ) {
  2241. return jQuery.grep( elements, function( elem ) {
  2242. return ( indexOf.call( qualifier, elem ) > -1 ) !== not;
  2243. } );
  2244. }
  2245. // Filtered directly for both simple and complex selectors
  2246. return jQuery.filter( qualifier, elements, not );
  2247. }
  2248. jQuery.filter = function( expr, elems, not ) {
  2249. var elem = elems[ 0 ];
  2250. if ( not ) {
  2251. expr = ":not(" + expr + ")";
  2252. }
  2253. if ( elems.length === 1 && elem.nodeType === 1 ) {
  2254. return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];
  2255. }
  2256. return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
  2257. return elem.nodeType === 1;
  2258. } ) );
  2259. };
  2260. jQuery.fn.extend( {
  2261. find: function( selector ) {
  2262. var i, ret,
  2263. len = this.length,
  2264. self = this;
  2265. if ( typeof selector !== "string" ) {
  2266. return this.pushStack( jQuery( selector ).filter( function() {
  2267. for ( i = 0; i < len; i++ ) {
  2268. if ( jQuery.contains( self[ i ], this ) ) {
  2269. return true;
  2270. }
  2271. }
  2272. } ) );
  2273. }
  2274. ret = this.pushStack( [] );
  2275. for ( i = 0; i < len; i++ ) {
  2276. jQuery.find( selector, self[ i ], ret );
  2277. }
  2278. return len > 1 ? jQuery.uniqueSort( ret ) : ret;
  2279. },
  2280. filter: function( selector ) {
  2281. return this.pushStack( winnow( this, selector || [], false ) );
  2282. },
  2283. not: function( selector ) {
  2284. return this.pushStack( winnow( this, selector || [], true ) );
  2285. },
  2286. is: function( selector ) {
  2287. return !!winnow(
  2288. this,
  2289. // If this is a positional/relative selector, check membership in the returned set
  2290. // so $("p:first").is("p:last") won't return true for a doc with two "p".
  2291. typeof selector === "string" && rneedsContext.test( selector ) ?
  2292. jQuery( selector ) :
  2293. selector || [],
  2294. false
  2295. ).length;
  2296. }
  2297. } );
  2298. // Initialize a jQuery object
  2299. // A central reference to the root jQuery(document)
  2300. var rootjQuery,
  2301. // A simple way to check for HTML strings
  2302. // Prioritize #id over <tag> to avoid XSS via location.hash (trac-9521)
  2303. // Strict HTML recognition (trac-11290: must start with <)
  2304. // Shortcut simple #id case for speed
  2305. rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
  2306. init = jQuery.fn.init = function( selector, context, root ) {
  2307. var match, elem;
  2308. // HANDLE: $(""), $(null), $(undefined), $(false)
  2309. if ( !selector ) {
  2310. return this;
  2311. }
  2312. // Method init() accepts an alternate rootjQuery
  2313. // so migrate can support jQuery.sub (gh-2101)
  2314. root = root || rootjQuery;
  2315. // Handle HTML strings
  2316. if ( typeof selector === "string" ) {
  2317. if ( selector[ 0 ] === "<" &&
  2318. selector[ selector.length - 1 ] === ">" &&
  2319. selector.length >= 3 ) {
  2320. // Assume that strings that start and end with <> are HTML and skip the regex check
  2321. match = [ null, selector, null ];
  2322. } else {
  2323. match = rquickExpr.exec( selector );
  2324. }
  2325. // Match html or make sure no context is specified for #id
  2326. if ( match && ( match[ 1 ] || !context ) ) {
  2327. // HANDLE: $(html) -> $(array)
  2328. if ( match[ 1 ] ) {
  2329. context = context instanceof jQuery ? context[ 0 ] : context;
  2330. // Option to run scripts is true for back-compat
  2331. // Intentionally let the error be thrown if parseHTML is not present
  2332. jQuery.merge( this, jQuery.parseHTML(
  2333. match[ 1 ],
  2334. context && context.nodeType ? context.ownerDocument || context : document,
  2335. true
  2336. ) );
  2337. // HANDLE: $(html, props)
  2338. if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {
  2339. for ( match in context ) {
  2340. // Properties of context are called as methods if possible
  2341. if ( isFunction( this[ match ] ) ) {
  2342. this[ match ]( context[ match ] );
  2343. // ...and otherwise set as attributes
  2344. } else {
  2345. this.attr( match, context[ match ] );
  2346. }
  2347. }
  2348. }
  2349. return this;
  2350. // HANDLE: $(#id)
  2351. } else {
  2352. elem = document.getElementById( match[ 2 ] );
  2353. if ( elem ) {
  2354. // Inject the element directly into the jQuery object
  2355. this[ 0 ] = elem;
  2356. this.length = 1;
  2357. }
  2358. return this;
  2359. }
  2360. // HANDLE: $(expr, $(...))
  2361. } else if ( !context || context.jquery ) {
  2362. return ( context || root ).find( selector );
  2363. // HANDLE: $(expr, context)
  2364. // (which is just equivalent to: $(context).find(expr)
  2365. } else {
  2366. return this.constructor( context ).find( selector );
  2367. }
  2368. // HANDLE: $(DOMElement)
  2369. } else if ( selector.nodeType ) {
  2370. this[ 0 ] = selector;
  2371. this.length = 1;
  2372. return this;
  2373. // HANDLE: $(function)
  2374. // Shortcut for document ready
  2375. } else if ( isFunction( selector ) ) {
  2376. return root.ready !== undefined ?
  2377. root.ready( selector ) :
  2378. // Execute immediately if ready is not present
  2379. selector( jQuery );
  2380. }
  2381. return jQuery.makeArray( selector, this );
  2382. };
  2383. // Give the init function the jQuery prototype for later instantiation
  2384. init.prototype = jQuery.fn;
  2385. // Initialize central reference
  2386. rootjQuery = jQuery( document );
  2387. var rparentsprev = /^(?:parents|prev(?:Until|All))/,
  2388. // Methods guaranteed to produce a unique set when starting from a unique set
  2389. guaranteedUnique = {
  2390. children: true,
  2391. contents: true,
  2392. next: true,
  2393. prev: true
  2394. };
  2395. jQuery.fn.extend( {
  2396. has: function( target ) {
  2397. var targets = jQuery( target, this ),
  2398. l = targets.length;
  2399. return this.filter( function() {
  2400. var i = 0;
  2401. for ( ; i < l; i++ ) {
  2402. if ( jQuery.contains( this, targets[ i ] ) ) {
  2403. return true;
  2404. }
  2405. }
  2406. } );
  2407. },
  2408. closest: function( selectors, context ) {
  2409. var cur,
  2410. i = 0,
  2411. l = this.length,
  2412. matched = [],
  2413. targets = typeof selectors !== "string" && jQuery( selectors );
  2414. // Positional selectors never match, since there's no _selection_ context
  2415. if ( !rneedsContext.test( selectors ) ) {
  2416. for ( ; i < l; i++ ) {
  2417. for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {
  2418. // Always skip document fragments
  2419. if ( cur.nodeType < 11 && ( targets ?
  2420. targets.index( cur ) > -1 :
  2421. // Don't pass non-elements to jQuery#find
  2422. cur.nodeType === 1 &&
  2423. jQuery.find.matchesSelector( cur, selectors ) ) ) {
  2424. matched.push( cur );
  2425. break;
  2426. }
  2427. }
  2428. }
  2429. }
  2430. return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );
  2431. },
  2432. // Determine the position of an element within the set
  2433. index: function( elem ) {
  2434. // No argument, return index in parent
  2435. if ( !elem ) {
  2436. return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
  2437. }
  2438. // Index in selector
  2439. if ( typeof elem === "string" ) {
  2440. return indexOf.call( jQuery( elem ), this[ 0 ] );
  2441. }
  2442. // Locate the position of the desired element
  2443. return indexOf.call( this,
  2444. // If it receives a jQuery object, the first element is used
  2445. elem.jquery ? elem[ 0 ] : elem
  2446. );
  2447. },
  2448. add: function( selector, context ) {
  2449. return this.pushStack(
  2450. jQuery.uniqueSort(
  2451. jQuery.merge( this.get(), jQuery( selector, context ) )
  2452. )
  2453. );
  2454. },
  2455. addBack: function( selector ) {
  2456. return this.add( selector == null ?
  2457. this.prevObject : this.prevObject.filter( selector )
  2458. );
  2459. }
  2460. } );
  2461. function sibling( cur, dir ) {
  2462. while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}
  2463. return cur;
  2464. }
  2465. jQuery.each( {
  2466. parent: function( elem ) {
  2467. var parent = elem.parentNode;
  2468. return parent && parent.nodeType !== 11 ? parent : null;
  2469. },
  2470. parents: function( elem ) {
  2471. return dir( elem, "parentNode" );
  2472. },
  2473. parentsUntil: function( elem, _i, until ) {
  2474. return dir( elem, "parentNode", until );
  2475. },
  2476. next: function( elem ) {
  2477. return sibling( elem, "nextSibling" );
  2478. },
  2479. prev: function( elem ) {
  2480. return sibling( elem, "previousSibling" );
  2481. },
  2482. nextAll: function( elem ) {
  2483. return dir( elem, "nextSibling" );
  2484. },
  2485. prevAll: function( elem ) {
  2486. return dir( elem, "previousSibling" );
  2487. },
  2488. nextUntil: function( elem, _i, until ) {
  2489. return dir( elem, "nextSibling", until );
  2490. },
  2491. prevUntil: function( elem, _i, until ) {
  2492. return dir( elem, "previousSibling", until );
  2493. },
  2494. siblings: function( elem ) {
  2495. return siblings( ( elem.parentNode || {} ).firstChild, elem );
  2496. },
  2497. children: function( elem ) {
  2498. return siblings( elem.firstChild );
  2499. },
  2500. contents: function( elem ) {
  2501. if ( elem.contentDocument != null &&
  2502. // Support: IE 11+
  2503. // <object> elements with no `data` attribute has an object
  2504. // `contentDocument` with a `null` prototype.
  2505. getProto( elem.contentDocument ) ) {
  2506. return elem.contentDocument;
  2507. }
  2508. // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only
  2509. // Treat the template element as a regular one in browsers that
  2510. // don't support it.
  2511. if ( nodeName( elem, "template" ) ) {
  2512. elem = elem.content || elem;
  2513. }
  2514. return jQuery.merge( [], elem.childNodes );
  2515. }
  2516. }, function( name, fn ) {
  2517. jQuery.fn[ name ] = function( until, selector ) {
  2518. var matched = jQuery.map( this, fn, until );
  2519. if ( name.slice( -5 ) !== "Until" ) {
  2520. selector = until;
  2521. }
  2522. if ( selector && typeof selector === "string" ) {
  2523. matched = jQuery.filter( selector, matched );
  2524. }
  2525. if ( this.length > 1 ) {
  2526. // Remove duplicates
  2527. if ( !guaranteedUnique[ name ] ) {
  2528. jQuery.uniqueSort( matched );
  2529. }
  2530. // Reverse order for parents* and prev-derivatives
  2531. if ( rparentsprev.test( name ) ) {
  2532. matched.reverse();
  2533. }
  2534. }
  2535. return this.pushStack( matched );
  2536. };
  2537. } );
  2538. var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g );
  2539. // Convert String-formatted options into Object-formatted ones
  2540. function createOptions( options ) {
  2541. var object = {};
  2542. jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {
  2543. object[ flag ] = true;
  2544. } );
  2545. return object;
  2546. }
  2547. /*
  2548. * Create a callback list using the following parameters:
  2549. *
  2550. * options: an optional list of space-separated options that will change how
  2551. * the callback list behaves or a more traditional option object
  2552. *
  2553. * By default a callback list will act like an event callback list and can be
  2554. * "fired" multiple times.
  2555. *
  2556. * Possible options:
  2557. *
  2558. * once: will ensure the callback list can only be fired once (like a Deferred)
  2559. *
  2560. * memory: will keep track of previous values and will call any callback added
  2561. * after the list has been fired right away with the latest "memorized"
  2562. * values (like a Deferred)
  2563. *
  2564. * unique: will ensure a callback can only be added once (no duplicate in the list)
  2565. *
  2566. * stopOnFalse: interrupt callings when a callback returns false
  2567. *
  2568. */
  2569. jQuery.Callbacks = function( options ) {
  2570. // Convert options from String-formatted to Object-formatted if needed
  2571. // (we check in cache first)
  2572. options = typeof options === "string" ?
  2573. createOptions( options ) :
  2574. jQuery.extend( {}, options );
  2575. var // Flag to know if list is currently firing
  2576. firing,
  2577. // Last fire value for non-forgettable lists
  2578. memory,
  2579. // Flag to know if list was already fired
  2580. fired,
  2581. // Flag to prevent firing
  2582. locked,
  2583. // Actual callback list
  2584. list = [],
  2585. // Queue of execution data for repeatable lists
  2586. queue = [],
  2587. // Index of currently firing callback (modified by add/remove as needed)
  2588. firingIndex = -1,
  2589. // Fire callbacks
  2590. fire = function() {
  2591. // Enforce single-firing
  2592. locked = locked || options.once;
  2593. // Execute callbacks for all pending executions,
  2594. // respecting firingIndex overrides and runtime changes
  2595. fired = firing = true;
  2596. for ( ; queue.length; firingIndex = -1 ) {
  2597. memory = queue.shift();
  2598. while ( ++firingIndex < list.length ) {
  2599. // Run callback and check for early termination
  2600. if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&
  2601. options.stopOnFalse ) {
  2602. // Jump to end and forget the data so .add doesn't re-fire
  2603. firingIndex = list.length;
  2604. memory = false;
  2605. }
  2606. }
  2607. }
  2608. // Forget the data if we're done with it
  2609. if ( !options.memory ) {
  2610. memory = false;
  2611. }
  2612. firing = false;
  2613. // Clean up if we're done firing for good
  2614. if ( locked ) {
  2615. // Keep an empty list if we have data for future add calls
  2616. if ( memory ) {
  2617. list = [];
  2618. // Otherwise, this object is spent
  2619. } else {
  2620. list = "";
  2621. }
  2622. }
  2623. },
  2624. // Actual Callbacks object
  2625. self = {
  2626. // Add a callback or a collection of callbacks to the list
  2627. add: function() {
  2628. if ( list ) {
  2629. // If we have memory from a past run, we should fire after adding
  2630. if ( memory && !firing ) {
  2631. firingIndex = list.length - 1;
  2632. queue.push( memory );
  2633. }
  2634. ( function add( args ) {
  2635. jQuery.each( args, function( _, arg ) {
  2636. if ( isFunction( arg ) ) {
  2637. if ( !options.unique || !self.has( arg ) ) {
  2638. list.push( arg );
  2639. }
  2640. } else if ( arg && arg.length && toType( arg ) !== "string" ) {
  2641. // Inspect recursively
  2642. add( arg );
  2643. }
  2644. } );
  2645. } )( arguments );
  2646. if ( memory && !firing ) {
  2647. fire();
  2648. }
  2649. }
  2650. return this;
  2651. },
  2652. // Remove a callback from the list
  2653. remove: function() {
  2654. jQuery.each( arguments, function( _, arg ) {
  2655. var index;
  2656. while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
  2657. list.splice( index, 1 );
  2658. // Handle firing indexes
  2659. if ( index <= firingIndex ) {
  2660. firingIndex--;
  2661. }
  2662. }
  2663. } );
  2664. return this;
  2665. },
  2666. // Check if a given callback is in the list.
  2667. // If no argument is given, return whether or not list has callbacks attached.
  2668. has: function( fn ) {
  2669. return fn ?
  2670. jQuery.inArray( fn, list ) > -1 :
  2671. list.length > 0;
  2672. },
  2673. // Remove all callbacks from the list
  2674. empty: function() {
  2675. if ( list ) {
  2676. list = [];
  2677. }
  2678. return this;
  2679. },
  2680. // Disable .fire and .add
  2681. // Abort any current/pending executions
  2682. // Clear all callbacks and values
  2683. disable: function() {
  2684. locked = queue = [];
  2685. list = memory = "";
  2686. return this;
  2687. },
  2688. disabled: function() {
  2689. return !list;
  2690. },
  2691. // Disable .fire
  2692. // Also disable .add unless we have memory (since it would have no effect)
  2693. // Abort any pending executions
  2694. lock: function() {
  2695. locked = queue = [];
  2696. if ( !memory && !firing ) {
  2697. list = memory = "";
  2698. }
  2699. return this;
  2700. },
  2701. locked: function() {
  2702. return !!locked;
  2703. },
  2704. // Call all callbacks with the given context and arguments
  2705. fireWith: function( context, args ) {
  2706. if ( !locked ) {
  2707. args = args || [];
  2708. args = [ context, args.slice ? args.slice() : args ];
  2709. queue.push( args );
  2710. if ( !firing ) {
  2711. fire();
  2712. }
  2713. }
  2714. return this;
  2715. },
  2716. // Call all the callbacks with the given arguments
  2717. fire: function() {
  2718. self.fireWith( this, arguments );
  2719. return this;
  2720. },
  2721. // To know if the callbacks have already been called at least once
  2722. fired: function() {
  2723. return !!fired;
  2724. }
  2725. };
  2726. return self;
  2727. };
  2728. function Identity( v ) {
  2729. return v;
  2730. }
  2731. function Thrower( ex ) {
  2732. throw ex;
  2733. }
  2734. function adoptValue( value, resolve, reject, noValue ) {
  2735. var method;
  2736. try {
  2737. // Check for promise aspect first to privilege synchronous behavior
  2738. if ( value && isFunction( ( method = value.promise ) ) ) {
  2739. method.call( value ).done( resolve ).fail( reject );
  2740. // Other thenables
  2741. } else if ( value && isFunction( ( method = value.then ) ) ) {
  2742. method.call( value, resolve, reject );
  2743. // Other non-thenables
  2744. } else {
  2745. // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer:
  2746. // * false: [ value ].slice( 0 ) => resolve( value )
  2747. // * true: [ value ].slice( 1 ) => resolve()
  2748. resolve.apply( undefined, [ value ].slice( noValue ) );
  2749. }
  2750. // For Promises/A+, convert exceptions into rejections
  2751. // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in
  2752. // Deferred#then to conditionally suppress rejection.
  2753. } catch ( value ) {
  2754. // Support: Android 4.0 only
  2755. // Strict mode functions invoked without .call/.apply get global-object context
  2756. reject.apply( undefined, [ value ] );
  2757. }
  2758. }
  2759. jQuery.extend( {
  2760. Deferred: function( func ) {
  2761. var tuples = [
  2762. // action, add listener, callbacks,
  2763. // ... .then handlers, argument index, [final state]
  2764. [ "notify", "progress", jQuery.Callbacks( "memory" ),
  2765. jQuery.Callbacks( "memory" ), 2 ],
  2766. [ "resolve", "done", jQuery.Callbacks( "once memory" ),
  2767. jQuery.Callbacks( "once memory" ), 0, "resolved" ],
  2768. [ "reject", "fail", jQuery.Callbacks( "once memory" ),
  2769. jQuery.Callbacks( "once memory" ), 1, "rejected" ]
  2770. ],
  2771. state = "pending",
  2772. promise = {
  2773. state: function() {
  2774. return state;
  2775. },
  2776. always: function() {
  2777. deferred.done( arguments ).fail( arguments );
  2778. return this;
  2779. },
  2780. "catch": function( fn ) {
  2781. return promise.then( null, fn );
  2782. },
  2783. // Keep pipe for back-compat
  2784. pipe: function( /* fnDone, fnFail, fnProgress */ ) {
  2785. var fns = arguments;
  2786. return jQuery.Deferred( function( newDefer ) {
  2787. jQuery.each( tuples, function( _i, tuple ) {
  2788. // Map tuples (progress, done, fail) to arguments (done, fail, progress)
  2789. var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];
  2790. // deferred.progress(function() { bind to newDefer or newDefer.notify })
  2791. // deferred.done(function() { bind to newDefer or newDefer.resolve })
  2792. // deferred.fail(function() { bind to newDefer or newDefer.reject })
  2793. deferred[ tuple[ 1 ] ]( function() {
  2794. var returned = fn && fn.apply( this, arguments );
  2795. if ( returned && isFunction( returned.promise ) ) {
  2796. returned.promise()
  2797. .progress( newDefer.notify )
  2798. .done( newDefer.resolve )
  2799. .fail( newDefer.reject );
  2800. } else {
  2801. newDefer[ tuple[ 0 ] + "With" ](
  2802. this,
  2803. fn ? [ returned ] : arguments
  2804. );
  2805. }
  2806. } );
  2807. } );
  2808. fns = null;
  2809. } ).promise();
  2810. },
  2811. then: function( onFulfilled, onRejected, onProgress ) {
  2812. var maxDepth = 0;
  2813. function resolve( depth, deferred, handler, special ) {
  2814. return function() {
  2815. var that = this,
  2816. args = arguments,
  2817. mightThrow = function() {
  2818. var returned, then;
  2819. // Support: Promises/A+ section 2.3.3.3.3
  2820. // https://promisesaplus.com/#point-59
  2821. // Ignore double-resolution attempts
  2822. if ( depth < maxDepth ) {
  2823. return;
  2824. }
  2825. returned = handler.apply( that, args );
  2826. // Support: Promises/A+ section 2.3.1
  2827. // https://promisesaplus.com/#point-48
  2828. if ( returned === deferred.promise() ) {
  2829. throw new TypeError( "Thenable self-resolution" );
  2830. }
  2831. // Support: Promises/A+ sections 2.3.3.1, 3.5
  2832. // https://promisesaplus.com/#point-54
  2833. // https://promisesaplus.com/#point-75
  2834. // Retrieve `then` only once
  2835. then = returned &&
  2836. // Support: Promises/A+ section 2.3.4
  2837. // https://promisesaplus.com/#point-64
  2838. // Only check objects and functions for thenability
  2839. ( typeof returned === "object" ||
  2840. typeof returned === "function" ) &&
  2841. returned.then;
  2842. // Handle a returned thenable
  2843. if ( isFunction( then ) ) {
  2844. // Special processors (notify) just wait for resolution
  2845. if ( special ) {
  2846. then.call(
  2847. returned,
  2848. resolve( maxDepth, deferred, Identity, special ),
  2849. resolve( maxDepth, deferred, Thrower, special )
  2850. );
  2851. // Normal processors (resolve) also hook into progress
  2852. } else {
  2853. // ...and disregard older resolution values
  2854. maxDepth++;
  2855. then.call(
  2856. returned,
  2857. resolve( maxDepth, deferred, Identity, special ),
  2858. resolve( maxDepth, deferred, Thrower, special ),
  2859. resolve( maxDepth, deferred, Identity,
  2860. deferred.notifyWith )
  2861. );
  2862. }
  2863. // Handle all other returned values
  2864. } else {
  2865. // Only substitute handlers pass on context
  2866. // and multiple values (non-spec behavior)
  2867. if ( handler !== Identity ) {
  2868. that = undefined;
  2869. args = [ returned ];
  2870. }
  2871. // Process the value(s)
  2872. // Default process is resolve
  2873. ( special || deferred.resolveWith )( that, args );
  2874. }
  2875. },
  2876. // Only normal processors (resolve) catch and reject exceptions
  2877. process = special ?
  2878. mightThrow :
  2879. function() {
  2880. try {
  2881. mightThrow();
  2882. } catch ( e ) {
  2883. if ( jQuery.Deferred.exceptionHook ) {
  2884. jQuery.Deferred.exceptionHook( e,
  2885. process.error );
  2886. }
  2887. // Support: Promises/A+ section 2.3.3.3.4.1
  2888. // https://promisesaplus.com/#point-61
  2889. // Ignore post-resolution exceptions
  2890. if ( depth + 1 >= maxDepth ) {
  2891. // Only substitute handlers pass on context
  2892. // and multiple values (non-spec behavior)
  2893. if ( handler !== Thrower ) {
  2894. that = undefined;
  2895. args = [ e ];
  2896. }
  2897. deferred.rejectWith( that, args );
  2898. }
  2899. }
  2900. };
  2901. // Support: Promises/A+ section 2.3.3.3.1
  2902. // https://promisesaplus.com/#point-57
  2903. // Re-resolve promises immediately to dodge false rejection from
  2904. // subsequent errors
  2905. if ( depth ) {
  2906. process();
  2907. } else {
  2908. // Call an optional hook to record the error, in case of exception
  2909. // since it's otherwise lost when execution goes async
  2910. if ( jQuery.Deferred.getErrorHook ) {
  2911. process.error = jQuery.Deferred.getErrorHook();
  2912. // The deprecated alias of the above. While the name suggests
  2913. // returning the stack, not an error instance, jQuery just passes
  2914. // it directly to `console.warn` so both will work; an instance
  2915. // just better cooperates with source maps.
  2916. } else if ( jQuery.Deferred.getStackHook ) {
  2917. process.error = jQuery.Deferred.getStackHook();
  2918. }
  2919. window.setTimeout( process );
  2920. }
  2921. };
  2922. }
  2923. return jQuery.Deferred( function( newDefer ) {
  2924. // progress_handlers.add( ... )
  2925. tuples[ 0 ][ 3 ].add(
  2926. resolve(
  2927. 0,
  2928. newDefer,
  2929. isFunction( onProgress ) ?
  2930. onProgress :
  2931. Identity,
  2932. newDefer.notifyWith
  2933. )
  2934. );
  2935. // fulfilled_handlers.add( ... )
  2936. tuples[ 1 ][ 3 ].add(
  2937. resolve(
  2938. 0,
  2939. newDefer,
  2940. isFunction( onFulfilled ) ?
  2941. onFulfilled :
  2942. Identity
  2943. )
  2944. );
  2945. // rejected_handlers.add( ... )
  2946. tuples[ 2 ][ 3 ].add(
  2947. resolve(
  2948. 0,
  2949. newDefer,
  2950. isFunction( onRejected ) ?
  2951. onRejected :
  2952. Thrower
  2953. )
  2954. );
  2955. } ).promise();
  2956. },
  2957. // Get a promise for this deferred
  2958. // If obj is provided, the promise aspect is added to the object
  2959. promise: function( obj ) {
  2960. return obj != null ? jQuery.extend( obj, promise ) : promise;
  2961. }
  2962. },
  2963. deferred = {};
  2964. // Add list-specific methods
  2965. jQuery.each( tuples, function( i, tuple ) {
  2966. var list = tuple[ 2 ],
  2967. stateString = tuple[ 5 ];
  2968. // promise.progress = list.add
  2969. // promise.done = list.add
  2970. // promise.fail = list.add
  2971. promise[ tuple[ 1 ] ] = list.add;
  2972. // Handle state
  2973. if ( stateString ) {
  2974. list.add(
  2975. function() {
  2976. // state = "resolved" (i.e., fulfilled)
  2977. // state = "rejected"
  2978. state = stateString;
  2979. },
  2980. // rejected_callbacks.disable
  2981. // fulfilled_callbacks.disable
  2982. tuples[ 3 - i ][ 2 ].disable,
  2983. // rejected_handlers.disable
  2984. // fulfilled_handlers.disable
  2985. tuples[ 3 - i ][ 3 ].disable,
  2986. // progress_callbacks.lock
  2987. tuples[ 0 ][ 2 ].lock,
  2988. // progress_handlers.lock
  2989. tuples[ 0 ][ 3 ].lock
  2990. );
  2991. }
  2992. // progress_handlers.fire
  2993. // fulfilled_handlers.fire
  2994. // rejected_handlers.fire
  2995. list.add( tuple[ 3 ].fire );
  2996. // deferred.notify = function() { deferred.notifyWith(...) }
  2997. // deferred.resolve = function() { deferred.resolveWith(...) }
  2998. // deferred.reject = function() { deferred.rejectWith(...) }
  2999. deferred[ tuple[ 0 ] ] = function() {
  3000. deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments );
  3001. return this;
  3002. };
  3003. // deferred.notifyWith = list.fireWith
  3004. // deferred.resolveWith = list.fireWith
  3005. // deferred.rejectWith = list.fireWith
  3006. deferred[ tuple[ 0 ] + "With" ] = list.fireWith;
  3007. } );
  3008. // Make the deferred a promise
  3009. promise.promise( deferred );
  3010. // Call given func if any
  3011. if ( func ) {
  3012. func.call( deferred, deferred );
  3013. }
  3014. // All done!
  3015. return deferred;
  3016. },
  3017. // Deferred helper
  3018. when: function( singleValue ) {
  3019. var
  3020. // count of uncompleted subordinates
  3021. remaining = arguments.length,
  3022. // count of unprocessed arguments
  3023. i = remaining,
  3024. // subordinate fulfillment data
  3025. resolveContexts = Array( i ),
  3026. resolveValues = slice.call( arguments ),
  3027. // the primary Deferred
  3028. primary = jQuery.Deferred(),
  3029. // subordinate callback factory
  3030. updateFunc = function( i ) {
  3031. return function( value ) {
  3032. resolveContexts[ i ] = this;
  3033. resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
  3034. if ( !( --remaining ) ) {
  3035. primary.resolveWith( resolveContexts, resolveValues );
  3036. }
  3037. };
  3038. };
  3039. // Single- and empty arguments are adopted like Promise.resolve
  3040. if ( remaining <= 1 ) {
  3041. adoptValue( singleValue, primary.done( updateFunc( i ) ).resolve, primary.reject,
  3042. !remaining );
  3043. // Use .then() to unwrap secondary thenables (cf. gh-3000)
  3044. if ( primary.state() === "pending" ||
  3045. isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {
  3046. return primary.then();
  3047. }
  3048. }
  3049. // Multiple arguments are aggregated like Promise.all array elements
  3050. while ( i-- ) {
  3051. adoptValue( resolveValues[ i ], updateFunc( i ), primary.reject );
  3052. }
  3053. return primary.promise();
  3054. }
  3055. } );
  3056. // These usually indicate a programmer mistake during development,
  3057. // warn about them ASAP rather than swallowing them by default.
  3058. var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
  3059. // If `jQuery.Deferred.getErrorHook` is defined, `asyncError` is an error
  3060. // captured before the async barrier to get the original error cause
  3061. // which may otherwise be hidden.
  3062. jQuery.Deferred.exceptionHook = function( error, asyncError ) {
  3063. // Support: IE 8 - 9 only
  3064. // Console exists when dev tools are open, which can happen at any time
  3065. if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {
  3066. window.console.warn( "jQuery.Deferred exception: " + error.message,
  3067. error.stack, asyncError );
  3068. }
  3069. };
  3070. jQuery.readyException = function( error ) {
  3071. window.setTimeout( function() {
  3072. throw error;
  3073. } );
  3074. };
  3075. // The deferred used on DOM ready
  3076. var readyList = jQuery.Deferred();
  3077. jQuery.fn.ready = function( fn ) {
  3078. readyList
  3079. .then( fn )
  3080. // Wrap jQuery.readyException in a function so that the lookup
  3081. // happens at the time of error handling instead of callback
  3082. // registration.
  3083. .catch( function( error ) {
  3084. jQuery.readyException( error );
  3085. } );
  3086. return this;
  3087. };
  3088. jQuery.extend( {
  3089. // Is the DOM ready to be used? Set to true once it occurs.
  3090. isReady: false,
  3091. // A counter to track how many items to wait for before
  3092. // the ready event fires. See trac-6781
  3093. readyWait: 1,
  3094. // Handle when the DOM is ready
  3095. ready: function( wait ) {
  3096. // Abort if there are pending holds or we're already ready
  3097. if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
  3098. return;
  3099. }
  3100. // Remember that the DOM is ready
  3101. jQuery.isReady = true;
  3102. // If a normal DOM Ready event fired, decrement, and wait if need be
  3103. if ( wait !== true && --jQuery.readyWait > 0 ) {
  3104. return;
  3105. }
  3106. // If there are functions bound, to execute
  3107. readyList.resolveWith( document, [ jQuery ] );
  3108. }
  3109. } );
  3110. jQuery.ready.then = readyList.then;
  3111. // The ready event handler and self cleanup method
  3112. function completed() {
  3113. document.removeEventListener( "DOMContentLoaded", completed );
  3114. window.removeEventListener( "load", completed );
  3115. jQuery.ready();
  3116. }
  3117. // Catch cases where $(document).ready() is called
  3118. // after the browser event has already occurred.
  3119. // Support: IE <=9 - 10 only
  3120. // Older IE sometimes signals "interactive" too soon
  3121. if ( document.readyState === "complete" ||
  3122. ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {
  3123. // Handle it asynchronously to allow scripts the opportunity to delay ready
  3124. window.setTimeout( jQuery.ready );
  3125. } else {
  3126. // Use the handy event callback
  3127. document.addEventListener( "DOMContentLoaded", completed );
  3128. // A fallback to window.onload, that will always work
  3129. window.addEventListener( "load", completed );
  3130. }
  3131. // Multifunctional method to get and set values of a collection
  3132. // The value/s can optionally be executed if it's a function
  3133. var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
  3134. var i = 0,
  3135. len = elems.length,
  3136. bulk = key == null;
  3137. // Sets many values
  3138. if ( toType( key ) === "object" ) {
  3139. chainable = true;
  3140. for ( i in key ) {
  3141. access( elems, fn, i, key[ i ], true, emptyGet, raw );
  3142. }
  3143. // Sets one value
  3144. } else if ( value !== undefined ) {
  3145. chainable = true;
  3146. if ( !isFunction( value ) ) {
  3147. raw = true;
  3148. }
  3149. if ( bulk ) {
  3150. // Bulk operations run against the entire set
  3151. if ( raw ) {
  3152. fn.call( elems, value );
  3153. fn = null;
  3154. // ...except when executing function values
  3155. } else {
  3156. bulk = fn;
  3157. fn = function( elem, _key, value ) {
  3158. return bulk.call( jQuery( elem ), value );
  3159. };
  3160. }
  3161. }
  3162. if ( fn ) {
  3163. for ( ; i < len; i++ ) {
  3164. fn(
  3165. elems[ i ], key, raw ?
  3166. value :
  3167. value.call( elems[ i ], i, fn( elems[ i ], key ) )
  3168. );
  3169. }
  3170. }
  3171. }
  3172. if ( chainable ) {
  3173. return elems;
  3174. }
  3175. // Gets
  3176. if ( bulk ) {
  3177. return fn.call( elems );
  3178. }
  3179. return len ? fn( elems[ 0 ], key ) : emptyGet;
  3180. };
  3181. // Matches dashed string for camelizing
  3182. var rmsPrefix = /^-ms-/,
  3183. rdashAlpha = /-([a-z])/g;
  3184. // Used by camelCase as callback to replace()
  3185. function fcamelCase( _all, letter ) {
  3186. return letter.toUpperCase();
  3187. }
  3188. // Convert dashed to camelCase; used by the css and data modules
  3189. // Support: IE <=9 - 11, Edge 12 - 15
  3190. // Microsoft forgot to hump their vendor prefix (trac-9572)
  3191. function camelCase( string ) {
  3192. return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
  3193. }
  3194. var acceptData = function( owner ) {
  3195. // Accepts only:
  3196. // - Node
  3197. // - Node.ELEMENT_NODE
  3198. // - Node.DOCUMENT_NODE
  3199. // - Object
  3200. // - Any
  3201. return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
  3202. };
  3203. function Data() {
  3204. this.expando = jQuery.expando + Data.uid++;
  3205. }
  3206. Data.uid = 1;
  3207. Data.prototype = {
  3208. cache: function( owner ) {
  3209. // Check if the owner object already has a cache
  3210. var value = owner[ this.expando ];
  3211. // If not, create one
  3212. if ( !value ) {
  3213. value = {};
  3214. // We can accept data for non-element nodes in modern browsers,
  3215. // but we should not, see trac-8335.
  3216. // Always return an empty object.
  3217. if ( acceptData( owner ) ) {
  3218. // If it is a node unlikely to be stringify-ed or looped over
  3219. // use plain assignment
  3220. if ( owner.nodeType ) {
  3221. owner[ this.expando ] = value;
  3222. // Otherwise secure it in a non-enumerable property
  3223. // configurable must be true to allow the property to be
  3224. // deleted when data is removed
  3225. } else {
  3226. Object.defineProperty( owner, this.expando, {
  3227. value: value,
  3228. configurable: true
  3229. } );
  3230. }
  3231. }
  3232. }
  3233. return value;
  3234. },
  3235. set: function( owner, data, value ) {
  3236. var prop,
  3237. cache = this.cache( owner );
  3238. // Handle: [ owner, key, value ] args
  3239. // Always use camelCase key (gh-2257)
  3240. if ( typeof data === "string" ) {
  3241. cache[ camelCase( data ) ] = value;
  3242. // Handle: [ owner, { properties } ] args
  3243. } else {
  3244. // Copy the properties one-by-one to the cache object
  3245. for ( prop in data ) {
  3246. cache[ camelCase( prop ) ] = data[ prop ];
  3247. }
  3248. }
  3249. return cache;
  3250. },
  3251. get: function( owner, key ) {
  3252. return key === undefined ?
  3253. this.cache( owner ) :
  3254. // Always use camelCase key (gh-2257)
  3255. owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ];
  3256. },
  3257. access: function( owner, key, value ) {
  3258. // In cases where either:
  3259. //
  3260. // 1. No key was specified
  3261. // 2. A string key was specified, but no value provided
  3262. //
  3263. // Take the "read" path and allow the get method to determine
  3264. // which value to return, respectively either:
  3265. //
  3266. // 1. The entire cache object
  3267. // 2. The data stored at the key
  3268. //
  3269. if ( key === undefined ||
  3270. ( ( key && typeof key === "string" ) && value === undefined ) ) {
  3271. return this.get( owner, key );
  3272. }
  3273. // When the key is not a string, or both a key and value
  3274. // are specified, set or extend (existing objects) with either:
  3275. //
  3276. // 1. An object of properties
  3277. // 2. A key and value
  3278. //
  3279. this.set( owner, key, value );
  3280. // Since the "set" path can have two possible entry points
  3281. // return the expected data based on which path was taken[*]
  3282. return value !== undefined ? value : key;
  3283. },
  3284. remove: function( owner, key ) {
  3285. var i,
  3286. cache = owner[ this.expando ];
  3287. if ( cache === undefined ) {
  3288. return;
  3289. }
  3290. if ( key !== undefined ) {
  3291. // Support array or space separated string of keys
  3292. if ( Array.isArray( key ) ) {
  3293. // If key is an array of keys...
  3294. // We always set camelCase keys, so remove that.
  3295. key = key.map( camelCase );
  3296. } else {
  3297. key = camelCase( key );
  3298. // If a key with the spaces exists, use it.
  3299. // Otherwise, create an array by matching non-whitespace
  3300. key = key in cache ?
  3301. [ key ] :
  3302. ( key.match( rnothtmlwhite ) || [] );
  3303. }
  3304. i = key.length;
  3305. while ( i-- ) {
  3306. delete cache[ key[ i ] ];
  3307. }
  3308. }
  3309. // Remove the expando if there's no more data
  3310. if ( key === undefined || jQuery.isEmptyObject( cache ) ) {
  3311. // Support: Chrome <=35 - 45
  3312. // Webkit & Blink performance suffers when deleting properties
  3313. // from DOM nodes, so set to undefined instead
  3314. // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)
  3315. if ( owner.nodeType ) {
  3316. owner[ this.expando ] = undefined;
  3317. } else {
  3318. delete owner[ this.expando ];
  3319. }
  3320. }
  3321. },
  3322. hasData: function( owner ) {
  3323. var cache = owner[ this.expando ];
  3324. return cache !== undefined && !jQuery.isEmptyObject( cache );
  3325. }
  3326. };
  3327. var dataPriv = new Data();
  3328. var dataUser = new Data();
  3329. // Implementation Summary
  3330. //
  3331. // 1. Enforce API surface and semantic compatibility with 1.9.x branch
  3332. // 2. Improve the module's maintainability by reducing the storage
  3333. // paths to a single mechanism.
  3334. // 3. Use the same single mechanism to support "private" and "user" data.
  3335. // 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
  3336. // 5. Avoid exposing implementation details on user objects (eg. expando properties)
  3337. // 6. Provide a clear path for implementation upgrade to WeakMap in 2014
  3338. var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
  3339. rmultiDash = /[A-Z]/g;
  3340. function getData( data ) {
  3341. if ( data === "true" ) {
  3342. return true;
  3343. }
  3344. if ( data === "false" ) {
  3345. return false;
  3346. }
  3347. if ( data === "null" ) {
  3348. return null;
  3349. }
  3350. // Only convert to a number if it doesn't change the string
  3351. if ( data === +data + "" ) {
  3352. return +data;
  3353. }
  3354. if ( rbrace.test( data ) ) {
  3355. return JSON.parse( data );
  3356. }
  3357. return data;
  3358. }
  3359. function dataAttr( elem, key, data ) {
  3360. var name;
  3361. // If nothing was found internally, try to fetch any
  3362. // data from the HTML5 data-* attribute
  3363. if ( data === undefined && elem.nodeType === 1 ) {
  3364. name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase();
  3365. data = elem.getAttribute( name );
  3366. if ( typeof data === "string" ) {
  3367. try {
  3368. data = getData( data );
  3369. } catch ( e ) {}
  3370. // Make sure we set the data so it isn't changed later
  3371. dataUser.set( elem, key, data );
  3372. } else {
  3373. data = undefined;
  3374. }
  3375. }
  3376. return data;
  3377. }
  3378. jQuery.extend( {
  3379. hasData: function( elem ) {
  3380. return dataUser.hasData( elem ) || dataPriv.hasData( elem );
  3381. },
  3382. data: function( elem, name, data ) {
  3383. return dataUser.access( elem, name, data );
  3384. },
  3385. removeData: function( elem, name ) {
  3386. dataUser.remove( elem, name );
  3387. },
  3388. // TODO: Now that all calls to _data and _removeData have been replaced
  3389. // with direct calls to dataPriv methods, these can be deprecated.
  3390. _data: function( elem, name, data ) {
  3391. return dataPriv.access( elem, name, data );
  3392. },
  3393. _removeData: function( elem, name ) {
  3394. dataPriv.remove( elem, name );
  3395. }
  3396. } );
  3397. jQuery.fn.extend( {
  3398. data: function( key, value ) {
  3399. var i, name, data,
  3400. elem = this[ 0 ],
  3401. attrs = elem && elem.attributes;
  3402. // Gets all values
  3403. if ( key === undefined ) {
  3404. if ( this.length ) {
  3405. data = dataUser.get( elem );
  3406. if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) {
  3407. i = attrs.length;
  3408. while ( i-- ) {
  3409. // Support: IE 11 only
  3410. // The attrs elements can be null (trac-14894)
  3411. if ( attrs[ i ] ) {
  3412. name = attrs[ i ].name;
  3413. if ( name.indexOf( "data-" ) === 0 ) {
  3414. name = camelCase( name.slice( 5 ) );
  3415. dataAttr( elem, name, data[ name ] );
  3416. }
  3417. }
  3418. }
  3419. dataPriv.set( elem, "hasDataAttrs", true );
  3420. }
  3421. }
  3422. return data;
  3423. }
  3424. // Sets multiple values
  3425. if ( typeof key === "object" ) {
  3426. return this.each( function() {
  3427. dataUser.set( this, key );
  3428. } );
  3429. }
  3430. return access( this, function( value ) {
  3431. var data;
  3432. // The calling jQuery object (element matches) is not empty
  3433. // (and therefore has an element appears at this[ 0 ]) and the
  3434. // `value` parameter was not undefined. An empty jQuery object
  3435. // will result in `undefined` for elem = this[ 0 ] which will
  3436. // throw an exception if an attempt to read a data cache is made.
  3437. if ( elem && value === undefined ) {
  3438. // Attempt to get data from the cache
  3439. // The key will always be camelCased in Data
  3440. data = dataUser.get( elem, key );
  3441. if ( data !== undefined ) {
  3442. return data;
  3443. }
  3444. // Attempt to "discover" the data in
  3445. // HTML5 custom data-* attrs
  3446. data = dataAttr( elem, key );
  3447. if ( data !== undefined ) {
  3448. return data;
  3449. }
  3450. // We tried really hard, but the data doesn't exist.
  3451. return;
  3452. }
  3453. // Set the data...
  3454. this.each( function() {
  3455. // We always store the camelCased key
  3456. dataUser.set( this, key, value );
  3457. } );
  3458. }, null, value, arguments.length > 1, null, true );
  3459. },
  3460. removeData: function( key ) {
  3461. return this.each( function() {
  3462. dataUser.remove( this, key );
  3463. } );
  3464. }
  3465. } );
  3466. jQuery.extend( {
  3467. queue: function( elem, type, data ) {
  3468. var queue;
  3469. if ( elem ) {
  3470. type = ( type || "fx" ) + "queue";
  3471. queue = dataPriv.get( elem, type );
  3472. // Speed up dequeue by getting out quickly if this is just a lookup
  3473. if ( data ) {
  3474. if ( !queue || Array.isArray( data ) ) {
  3475. queue = dataPriv.access( elem, type, jQuery.makeArray( data ) );
  3476. } else {
  3477. queue.push( data );
  3478. }
  3479. }
  3480. return queue || [];
  3481. }
  3482. },
  3483. dequeue: function( elem, type ) {
  3484. type = type || "fx";
  3485. var queue = jQuery.queue( elem, type ),
  3486. startLength = queue.length,
  3487. fn = queue.shift(),
  3488. hooks = jQuery._queueHooks( elem, type ),
  3489. next = function() {
  3490. jQuery.dequeue( elem, type );
  3491. };
  3492. // If the fx queue is dequeued, always remove the progress sentinel
  3493. if ( fn === "inprogress" ) {
  3494. fn = queue.shift();
  3495. startLength--;
  3496. }
  3497. if ( fn ) {
  3498. // Add a progress sentinel to prevent the fx queue from being
  3499. // automatically dequeued
  3500. if ( type === "fx" ) {
  3501. queue.unshift( "inprogress" );
  3502. }
  3503. // Clear up the last queue stop function
  3504. delete hooks.stop;
  3505. fn.call( elem, next, hooks );
  3506. }
  3507. if ( !startLength && hooks ) {
  3508. hooks.empty.fire();
  3509. }
  3510. },
  3511. // Not public - generate a queueHooks object, or return the current one
  3512. _queueHooks: function( elem, type ) {
  3513. var key = type + "queueHooks";
  3514. return dataPriv.get( elem, key ) || dataPriv.access( elem, key, {
  3515. empty: jQuery.Callbacks( "once memory" ).add( function() {
  3516. dataPriv.remove( elem, [ type + "queue", key ] );
  3517. } )
  3518. } );
  3519. }
  3520. } );
  3521. jQuery.fn.extend( {
  3522. queue: function( type, data ) {
  3523. var setter = 2;
  3524. if ( typeof type !== "string" ) {
  3525. data = type;
  3526. type = "fx";
  3527. setter--;
  3528. }
  3529. if ( arguments.length < setter ) {
  3530. return jQuery.queue( this[ 0 ], type );
  3531. }
  3532. return data === undefined ?
  3533. this :
  3534. this.each( function() {
  3535. var queue = jQuery.queue( this, type, data );
  3536. // Ensure a hooks for this queue
  3537. jQuery._queueHooks( this, type );
  3538. if ( type === "fx" && queue[ 0 ] !== "inprogress" ) {
  3539. jQuery.dequeue( this, type );
  3540. }
  3541. } );
  3542. },
  3543. dequeue: function( type ) {
  3544. return this.each( function() {
  3545. jQuery.dequeue( this, type );
  3546. } );
  3547. },
  3548. clearQueue: function( type ) {
  3549. return this.queue( type || "fx", [] );
  3550. },
  3551. // Get a promise resolved when queues of a certain type
  3552. // are emptied (fx is the type by default)
  3553. promise: function( type, obj ) {
  3554. var tmp,
  3555. count = 1,
  3556. defer = jQuery.Deferred(),
  3557. elements = this,
  3558. i = this.length,
  3559. resolve = function() {
  3560. if ( !( --count ) ) {
  3561. defer.resolveWith( elements, [ elements ] );
  3562. }
  3563. };
  3564. if ( typeof type !== "string" ) {
  3565. obj = type;
  3566. type = undefined;
  3567. }
  3568. type = type || "fx";
  3569. while ( i-- ) {
  3570. tmp = dataPriv.get( elements[ i ], type + "queueHooks" );
  3571. if ( tmp && tmp.empty ) {
  3572. count++;
  3573. tmp.empty.add( resolve );
  3574. }
  3575. }
  3576. resolve();
  3577. return defer.promise( obj );
  3578. }
  3579. } );
  3580. var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;
  3581. var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );
  3582. var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
  3583. var documentElement = document.documentElement;
  3584. var isAttached = function( elem ) {
  3585. return jQuery.contains( elem.ownerDocument, elem );
  3586. },
  3587. composed = { composed: true };
  3588. // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only
  3589. // Check attachment across shadow DOM boundaries when possible (gh-3504)
  3590. // Support: iOS 10.0-10.2 only
  3591. // Early iOS 10 versions support `attachShadow` but not `getRootNode`,
  3592. // leading to errors. We need to check for `getRootNode`.
  3593. if ( documentElement.getRootNode ) {
  3594. isAttached = function( elem ) {
  3595. return jQuery.contains( elem.ownerDocument, elem ) ||
  3596. elem.getRootNode( composed ) === elem.ownerDocument;
  3597. };
  3598. }
  3599. var isHiddenWithinTree = function( elem, el ) {
  3600. // isHiddenWithinTree might be called from jQuery#filter function;
  3601. // in that case, element will be second argument
  3602. elem = el || elem;
  3603. // Inline style trumps all
  3604. return elem.style.display === "none" ||
  3605. elem.style.display === "" &&
  3606. // Otherwise, check computed style
  3607. // Support: Firefox <=43 - 45
  3608. // Disconnected elements can have computed display: none, so first confirm that elem is
  3609. // in the document.
  3610. isAttached( elem ) &&
  3611. jQuery.css( elem, "display" ) === "none";
  3612. };
  3613. function adjustCSS( elem, prop, valueParts, tween ) {
  3614. var adjusted, scale,
  3615. maxIterations = 20,
  3616. currentValue = tween ?
  3617. function() {
  3618. return tween.cur();
  3619. } :
  3620. function() {
  3621. return jQuery.css( elem, prop, "" );
  3622. },
  3623. initial = currentValue(),
  3624. unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
  3625. // Starting value computation is required for potential unit mismatches
  3626. initialInUnit = elem.nodeType &&
  3627. ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
  3628. rcssNum.exec( jQuery.css( elem, prop ) );
  3629. if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
  3630. // Support: Firefox <=54
  3631. // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144)
  3632. initial = initial / 2;
  3633. // Trust units reported by jQuery.css
  3634. unit = unit || initialInUnit[ 3 ];
  3635. // Iteratively approximate from a nonzero starting point
  3636. initialInUnit = +initial || 1;
  3637. while ( maxIterations-- ) {
  3638. // Evaluate and update our best guess (doubling guesses that zero out).
  3639. // Finish if the scale equals or crosses 1 (making the old*new product non-positive).
  3640. jQuery.style( elem, prop, initialInUnit + unit );
  3641. if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) {
  3642. maxIterations = 0;
  3643. }
  3644. initialInUnit = initialInUnit / scale;
  3645. }
  3646. initialInUnit = initialInUnit * 2;
  3647. jQuery.style( elem, prop, initialInUnit + unit );
  3648. // Make sure we update the tween properties later on
  3649. valueParts = valueParts || [];
  3650. }
  3651. if ( valueParts ) {
  3652. initialInUnit = +initialInUnit || +initial || 0;
  3653. // Apply relative offset (+=/-=) if specified
  3654. adjusted = valueParts[ 1 ] ?
  3655. initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :
  3656. +valueParts[ 2 ];
  3657. if ( tween ) {
  3658. tween.unit = unit;
  3659. tween.start = initialInUnit;
  3660. tween.end = adjusted;
  3661. }
  3662. }
  3663. return adjusted;
  3664. }
  3665. var defaultDisplayMap = {};
  3666. function getDefaultDisplay( elem ) {
  3667. var temp,
  3668. doc = elem.ownerDocument,
  3669. nodeName = elem.nodeName,
  3670. display = defaultDisplayMap[ nodeName ];
  3671. if ( display ) {
  3672. return display;
  3673. }
  3674. temp = doc.body.appendChild( doc.createElement( nodeName ) );
  3675. display = jQuery.css( temp, "display" );
  3676. temp.parentNode.removeChild( temp );
  3677. if ( display === "none" ) {
  3678. display = "block";
  3679. }
  3680. defaultDisplayMap[ nodeName ] = display;
  3681. return display;
  3682. }
  3683. function showHide( elements, show ) {
  3684. var display, elem,
  3685. values = [],
  3686. index = 0,
  3687. length = elements.length;
  3688. // Determine new display value for elements that need to change
  3689. for ( ; index < length; index++ ) {
  3690. elem = elements[ index ];
  3691. if ( !elem.style ) {
  3692. continue;
  3693. }
  3694. display = elem.style.display;
  3695. if ( show ) {
  3696. // Since we force visibility upon cascade-hidden elements, an immediate (and slow)
  3697. // check is required in this first loop unless we have a nonempty display value (either
  3698. // inline or about-to-be-restored)
  3699. if ( display === "none" ) {
  3700. values[ index ] = dataPriv.get( elem, "display" ) || null;
  3701. if ( !values[ index ] ) {
  3702. elem.style.display = "";
  3703. }
  3704. }
  3705. if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) {
  3706. values[ index ] = getDefaultDisplay( elem );
  3707. }
  3708. } else {
  3709. if ( display !== "none" ) {
  3710. values[ index ] = "none";
  3711. // Remember what we're overwriting
  3712. dataPriv.set( elem, "display", display );
  3713. }
  3714. }
  3715. }
  3716. // Set the display of the elements in a second loop to avoid constant reflow
  3717. for ( index = 0; index < length; index++ ) {
  3718. if ( values[ index ] != null ) {
  3719. elements[ index ].style.display = values[ index ];
  3720. }
  3721. }
  3722. return elements;
  3723. }
  3724. jQuery.fn.extend( {
  3725. show: function() {
  3726. return showHide( this, true );
  3727. },
  3728. hide: function() {
  3729. return showHide( this );
  3730. },
  3731. toggle: function( state ) {
  3732. if ( typeof state === "boolean" ) {
  3733. return state ? this.show() : this.hide();
  3734. }
  3735. return this.each( function() {
  3736. if ( isHiddenWithinTree( this ) ) {
  3737. jQuery( this ).show();
  3738. } else {
  3739. jQuery( this ).hide();
  3740. }
  3741. } );
  3742. }
  3743. } );
  3744. var rcheckableType = ( /^(?:checkbox|radio)$/i );
  3745. var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i );
  3746. var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i );
  3747. ( function() {
  3748. var fragment = document.createDocumentFragment(),
  3749. div = fragment.appendChild( document.createElement( "div" ) ),
  3750. input = document.createElement( "input" );
  3751. // Support: Android 4.0 - 4.3 only
  3752. // Check state lost if the name is set (trac-11217)
  3753. // Support: Windows Web Apps (WWA)
  3754. // `name` and `type` must use .setAttribute for WWA (trac-14901)
  3755. input.setAttribute( "type", "radio" );
  3756. input.setAttribute( "checked", "checked" );
  3757. input.setAttribute( "name", "t" );
  3758. div.appendChild( input );
  3759. // Support: Android <=4.1 only
  3760. // Older WebKit doesn't clone checked state correctly in fragments
  3761. support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
  3762. // Support: IE <=11 only
  3763. // Make sure textarea (and checkbox) defaultValue is properly cloned
  3764. div.innerHTML = "<textarea>x</textarea>";
  3765. support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
  3766. // Support: IE <=9 only
  3767. // IE <=9 replaces <option> tags with their contents when inserted outside of
  3768. // the select element.
  3769. div.innerHTML = "<option></option>";
  3770. support.option = !!div.lastChild;
  3771. } )();
  3772. // We have to close these tags to support XHTML (trac-13200)
  3773. var wrapMap = {
  3774. // XHTML parsers do not magically insert elements in the
  3775. // same way that tag soup parsers do. So we cannot shorten
  3776. // this by omitting <tbody> or other required elements.
  3777. thead: [ 1, "<table>", "</table>" ],
  3778. col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
  3779. tr: [ 2, "<table><tbody>", "</tbody></table>" ],
  3780. td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
  3781. _default: [ 0, "", "" ]
  3782. };
  3783. wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
  3784. wrapMap.th = wrapMap.td;
  3785. // Support: IE <=9 only
  3786. if ( !support.option ) {
  3787. wrapMap.optgroup = wrapMap.option = [ 1, "<select multiple='multiple'>", "</select>" ];
  3788. }
  3789. function getAll( context, tag ) {
  3790. // Support: IE <=9 - 11 only
  3791. // Use typeof to avoid zero-argument method invocation on host objects (trac-15151)
  3792. var ret;
  3793. if ( typeof context.getElementsByTagName !== "undefined" ) {
  3794. ret = context.getElementsByTagName( tag || "*" );
  3795. } else if ( typeof context.querySelectorAll !== "undefined" ) {
  3796. ret = context.querySelectorAll( tag || "*" );
  3797. } else {
  3798. ret = [];
  3799. }
  3800. if ( tag === undefined || tag && nodeName( context, tag ) ) {
  3801. return jQuery.merge( [ context ], ret );
  3802. }
  3803. return ret;
  3804. }
  3805. // Mark scripts as having already been evaluated
  3806. function setGlobalEval( elems, refElements ) {
  3807. var i = 0,
  3808. l = elems.length;
  3809. for ( ; i < l; i++ ) {
  3810. dataPriv.set(
  3811. elems[ i ],
  3812. "globalEval",
  3813. !refElements || dataPriv.get( refElements[ i ], "globalEval" )
  3814. );
  3815. }
  3816. }
  3817. var rhtml = /<|&#?\w+;/;
  3818. function buildFragment( elems, context, scripts, selection, ignored ) {
  3819. var elem, tmp, tag, wrap, attached, j,
  3820. fragment = context.createDocumentFragment(),
  3821. nodes = [],
  3822. i = 0,
  3823. l = elems.length;
  3824. for ( ; i < l; i++ ) {
  3825. elem = elems[ i ];
  3826. if ( elem || elem === 0 ) {
  3827. // Add nodes directly
  3828. if ( toType( elem ) === "object" ) {
  3829. // Support: Android <=4.0 only, PhantomJS 1 only
  3830. // push.apply(_, arraylike) throws on ancient WebKit
  3831. jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
  3832. // Convert non-html into a text node
  3833. } else if ( !rhtml.test( elem ) ) {
  3834. nodes.push( context.createTextNode( elem ) );
  3835. // Convert html into DOM nodes
  3836. } else {
  3837. tmp = tmp || fragment.appendChild( context.createElement( "div" ) );
  3838. // Deserialize a standard representation
  3839. tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
  3840. wrap = wrapMap[ tag ] || wrapMap._default;
  3841. tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];
  3842. // Descend through wrappers to the right content
  3843. j = wrap[ 0 ];
  3844. while ( j-- ) {
  3845. tmp = tmp.lastChild;
  3846. }
  3847. // Support: Android <=4.0 only, PhantomJS 1 only
  3848. // push.apply(_, arraylike) throws on ancient WebKit
  3849. jQuery.merge( nodes, tmp.childNodes );
  3850. // Remember the top-level container
  3851. tmp = fragment.firstChild;
  3852. // Ensure the created nodes are orphaned (trac-12392)
  3853. tmp.textContent = "";
  3854. }
  3855. }
  3856. }
  3857. // Remove wrapper from fragment
  3858. fragment.textContent = "";
  3859. i = 0;
  3860. while ( ( elem = nodes[ i++ ] ) ) {
  3861. // Skip elements already in the context collection (trac-4087)
  3862. if ( selection && jQuery.inArray( elem, selection ) > -1 ) {
  3863. if ( ignored ) {
  3864. ignored.push( elem );
  3865. }
  3866. continue;
  3867. }
  3868. attached = isAttached( elem );
  3869. // Append to fragment
  3870. tmp = getAll( fragment.appendChild( elem ), "script" );
  3871. // Preserve script evaluation history
  3872. if ( attached ) {
  3873. setGlobalEval( tmp );
  3874. }
  3875. // Capture executables
  3876. if ( scripts ) {
  3877. j = 0;
  3878. while ( ( elem = tmp[ j++ ] ) ) {
  3879. if ( rscriptType.test( elem.type || "" ) ) {
  3880. scripts.push( elem );
  3881. }
  3882. }
  3883. }
  3884. }
  3885. return fragment;
  3886. }
  3887. var rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
  3888. function returnTrue() {
  3889. return true;
  3890. }
  3891. function returnFalse() {
  3892. return false;
  3893. }
  3894. function on( elem, types, selector, data, fn, one ) {
  3895. var origFn, type;
  3896. // Types can be a map of types/handlers
  3897. if ( typeof types === "object" ) {
  3898. // ( types-Object, selector, data )
  3899. if ( typeof selector !== "string" ) {
  3900. // ( types-Object, data )
  3901. data = data || selector;
  3902. selector = undefined;
  3903. }
  3904. for ( type in types ) {
  3905. on( elem, type, selector, data, types[ type ], one );
  3906. }
  3907. return elem;
  3908. }
  3909. if ( data == null && fn == null ) {
  3910. // ( types, fn )
  3911. fn = selector;
  3912. data = selector = undefined;
  3913. } else if ( fn == null ) {
  3914. if ( typeof selector === "string" ) {
  3915. // ( types, selector, fn )
  3916. fn = data;
  3917. data = undefined;
  3918. } else {
  3919. // ( types, data, fn )
  3920. fn = data;
  3921. data = selector;
  3922. selector = undefined;
  3923. }
  3924. }
  3925. if ( fn === false ) {
  3926. fn = returnFalse;
  3927. } else if ( !fn ) {
  3928. return elem;
  3929. }
  3930. if ( one === 1 ) {
  3931. origFn = fn;
  3932. fn = function( event ) {
  3933. // Can use an empty set, since event contains the info
  3934. jQuery().off( event );
  3935. return origFn.apply( this, arguments );
  3936. };
  3937. // Use same guid so caller can remove using origFn
  3938. fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
  3939. }
  3940. return elem.each( function() {
  3941. jQuery.event.add( this, types, fn, data, selector );
  3942. } );
  3943. }
  3944. /*
  3945. * Helper functions for managing events -- not part of the public interface.
  3946. * Props to Dean Edwards' addEvent library for many of the ideas.
  3947. */
  3948. jQuery.event = {
  3949. global: {},
  3950. add: function( elem, types, handler, data, selector ) {
  3951. var handleObjIn, eventHandle, tmp,
  3952. events, t, handleObj,
  3953. special, handlers, type, namespaces, origType,
  3954. elemData = dataPriv.get( elem );
  3955. // Only attach events to objects that accept data
  3956. if ( !acceptData( elem ) ) {
  3957. return;
  3958. }
  3959. // Caller can pass in an object of custom data in lieu of the handler
  3960. if ( handler.handler ) {
  3961. handleObjIn = handler;
  3962. handler = handleObjIn.handler;
  3963. selector = handleObjIn.selector;
  3964. }
  3965. // Ensure that invalid selectors throw exceptions at attach time
  3966. // Evaluate against documentElement in case elem is a non-element node (e.g., document)
  3967. if ( selector ) {
  3968. jQuery.find.matchesSelector( documentElement, selector );
  3969. }
  3970. // Make sure that the handler has a unique ID, used to find/remove it later
  3971. if ( !handler.guid ) {
  3972. handler.guid = jQuery.guid++;
  3973. }
  3974. // Init the element's event structure and main handler, if this is the first
  3975. if ( !( events = elemData.events ) ) {
  3976. events = elemData.events = Object.create( null );
  3977. }
  3978. if ( !( eventHandle = elemData.handle ) ) {
  3979. eventHandle = elemData.handle = function( e ) {
  3980. // Discard the second event of a jQuery.event.trigger() and
  3981. // when an event is called after a page has unloaded
  3982. return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ?
  3983. jQuery.event.dispatch.apply( elem, arguments ) : undefined;
  3984. };
  3985. }
  3986. // Handle multiple events separated by a space
  3987. types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
  3988. t = types.length;
  3989. while ( t-- ) {
  3990. tmp = rtypenamespace.exec( types[ t ] ) || [];
  3991. type = origType = tmp[ 1 ];
  3992. namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
  3993. // There *must* be a type, no attaching namespace-only handlers
  3994. if ( !type ) {
  3995. continue;
  3996. }
  3997. // If event changes its type, use the special event handlers for the changed type
  3998. special = jQuery.event.special[ type ] || {};
  3999. // If selector defined, determine special event api type, otherwise given type
  4000. type = ( selector ? special.delegateType : special.bindType ) || type;
  4001. // Update special based on newly reset type
  4002. special = jQuery.event.special[ type ] || {};
  4003. // handleObj is passed to all event handlers
  4004. handleObj = jQuery.extend( {
  4005. type: type,
  4006. origType: origType,
  4007. data: data,
  4008. handler: handler,
  4009. guid: handler.guid,
  4010. selector: selector,
  4011. needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
  4012. namespace: namespaces.join( "." )
  4013. }, handleObjIn );
  4014. // Init the event handler queue if we're the first
  4015. if ( !( handlers = events[ type ] ) ) {
  4016. handlers = events[ type ] = [];
  4017. handlers.delegateCount = 0;
  4018. // Only use addEventListener if the special events handler returns false
  4019. if ( !special.setup ||
  4020. special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
  4021. if ( elem.addEventListener ) {
  4022. elem.addEventListener( type, eventHandle );
  4023. }
  4024. }
  4025. }
  4026. if ( special.add ) {
  4027. special.add.call( elem, handleObj );
  4028. if ( !handleObj.handler.guid ) {
  4029. handleObj.handler.guid = handler.guid;
  4030. }
  4031. }
  4032. // Add to the element's handler list, delegates in front
  4033. if ( selector ) {
  4034. handlers.splice( handlers.delegateCount++, 0, handleObj );
  4035. } else {
  4036. handlers.push( handleObj );
  4037. }
  4038. // Keep track of which events have ever been used, for event optimization
  4039. jQuery.event.global[ type ] = true;
  4040. }
  4041. },
  4042. // Detach an event or set of events from an element
  4043. remove: function( elem, types, handler, selector, mappedTypes ) {
  4044. var j, origCount, tmp,
  4045. events, t, handleObj,
  4046. special, handlers, type, namespaces, origType,
  4047. elemData = dataPriv.hasData( elem ) && dataPriv.get( elem );
  4048. if ( !elemData || !( events = elemData.events ) ) {
  4049. return;
  4050. }
  4051. // Once for each type.namespace in types; type may be omitted
  4052. types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
  4053. t = types.length;
  4054. while ( t-- ) {
  4055. tmp = rtypenamespace.exec( types[ t ] ) || [];
  4056. type = origType = tmp[ 1 ];
  4057. namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
  4058. // Unbind all events (on this namespace, if provided) for the element
  4059. if ( !type ) {
  4060. for ( type in events ) {
  4061. jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
  4062. }
  4063. continue;
  4064. }
  4065. special = jQuery.event.special[ type ] || {};
  4066. type = ( selector ? special.delegateType : special.bindType ) || type;
  4067. handlers = events[ type ] || [];
  4068. tmp = tmp[ 2 ] &&
  4069. new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" );
  4070. // Remove matching events
  4071. origCount = j = handlers.length;
  4072. while ( j-- ) {
  4073. handleObj = handlers[ j ];
  4074. if ( ( mappedTypes || origType === handleObj.origType ) &&
  4075. ( !handler || handler.guid === handleObj.guid ) &&
  4076. ( !tmp || tmp.test( handleObj.namespace ) ) &&
  4077. ( !selector || selector === handleObj.selector ||
  4078. selector === "**" && handleObj.selector ) ) {
  4079. handlers.splice( j, 1 );
  4080. if ( handleObj.selector ) {
  4081. handlers.delegateCount--;
  4082. }
  4083. if ( special.remove ) {
  4084. special.remove.call( elem, handleObj );
  4085. }
  4086. }
  4087. }
  4088. // Remove generic event handler if we removed something and no more handlers exist
  4089. // (avoids potential for endless recursion during removal of special event handlers)
  4090. if ( origCount && !handlers.length ) {
  4091. if ( !special.teardown ||
  4092. special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
  4093. jQuery.removeEvent( elem, type, elemData.handle );
  4094. }
  4095. delete events[ type ];
  4096. }
  4097. }
  4098. // Remove data and the expando if it's no longer used
  4099. if ( jQuery.isEmptyObject( events ) ) {
  4100. dataPriv.remove( elem, "handle events" );
  4101. }
  4102. },
  4103. dispatch: function( nativeEvent ) {
  4104. var i, j, ret, matched, handleObj, handlerQueue,
  4105. args = new Array( arguments.length ),
  4106. // Make a writable jQuery.Event from the native event object
  4107. event = jQuery.event.fix( nativeEvent ),
  4108. handlers = (
  4109. dataPriv.get( this, "events" ) || Object.create( null )
  4110. )[ event.type ] || [],
  4111. special = jQuery.event.special[ event.type ] || {};
  4112. // Use the fix-ed jQuery.Event rather than the (read-only) native event
  4113. args[ 0 ] = event;
  4114. for ( i = 1; i < arguments.length; i++ ) {
  4115. args[ i ] = arguments[ i ];
  4116. }
  4117. event.delegateTarget = this;
  4118. // Call the preDispatch hook for the mapped type, and let it bail if desired
  4119. if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
  4120. return;
  4121. }
  4122. // Determine handlers
  4123. handlerQueue = jQuery.event.handlers.call( this, event, handlers );
  4124. // Run delegates first; they may want to stop propagation beneath us
  4125. i = 0;
  4126. while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {
  4127. event.currentTarget = matched.elem;
  4128. j = 0;
  4129. while ( ( handleObj = matched.handlers[ j++ ] ) &&
  4130. !event.isImmediatePropagationStopped() ) {
  4131. // If the event is namespaced, then each handler is only invoked if it is
  4132. // specially universal or its namespaces are a superset of the event's.
  4133. if ( !event.rnamespace || handleObj.namespace === false ||
  4134. event.rnamespace.test( handleObj.namespace ) ) {
  4135. event.handleObj = handleObj;
  4136. event.data = handleObj.data;
  4137. ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||
  4138. handleObj.handler ).apply( matched.elem, args );
  4139. if ( ret !== undefined ) {
  4140. if ( ( event.result = ret ) === false ) {
  4141. event.preventDefault();
  4142. event.stopPropagation();
  4143. }
  4144. }
  4145. }
  4146. }
  4147. }
  4148. // Call the postDispatch hook for the mapped type
  4149. if ( special.postDispatch ) {
  4150. special.postDispatch.call( this, event );
  4151. }
  4152. return event.result;
  4153. },
  4154. handlers: function( event, handlers ) {
  4155. var i, handleObj, sel, matchedHandlers, matchedSelectors,
  4156. handlerQueue = [],
  4157. delegateCount = handlers.delegateCount,
  4158. cur = event.target;
  4159. // Find delegate handlers
  4160. if ( delegateCount &&
  4161. // Support: IE <=9
  4162. // Black-hole SVG <use> instance trees (trac-13180)
  4163. cur.nodeType &&
  4164. // Support: Firefox <=42
  4165. // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)
  4166. // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click
  4167. // Support: IE 11 only
  4168. // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343)
  4169. !( event.type === "click" && event.button >= 1 ) ) {
  4170. for ( ; cur !== this; cur = cur.parentNode || this ) {
  4171. // Don't check non-elements (trac-13208)
  4172. // Don't process clicks on disabled elements (trac-6911, trac-8165, trac-11382, trac-11764)
  4173. if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) {
  4174. matchedHandlers = [];
  4175. matchedSelectors = {};
  4176. for ( i = 0; i < delegateCount; i++ ) {
  4177. handleObj = handlers[ i ];
  4178. // Don't conflict with Object.prototype properties (trac-13203)
  4179. sel = handleObj.selector + " ";
  4180. if ( matchedSelectors[ sel ] === undefined ) {
  4181. matchedSelectors[ sel ] = handleObj.needsContext ?
  4182. jQuery( sel, this ).index( cur ) > -1 :
  4183. jQuery.find( sel, this, null, [ cur ] ).length;
  4184. }
  4185. if ( matchedSelectors[ sel ] ) {
  4186. matchedHandlers.push( handleObj );
  4187. }
  4188. }
  4189. if ( matchedHandlers.length ) {
  4190. handlerQueue.push( { elem: cur, handlers: matchedHandlers } );
  4191. }
  4192. }
  4193. }
  4194. }
  4195. // Add the remaining (directly-bound) handlers
  4196. cur = this;
  4197. if ( delegateCount < handlers.length ) {
  4198. handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );
  4199. }
  4200. return handlerQueue;
  4201. },
  4202. addProp: function( name, hook ) {
  4203. Object.defineProperty( jQuery.Event.prototype, name, {
  4204. enumerable: true,
  4205. configurable: true,
  4206. get: isFunction( hook ) ?
  4207. function() {
  4208. if ( this.originalEvent ) {
  4209. return hook( this.originalEvent );
  4210. }
  4211. } :
  4212. function() {
  4213. if ( this.originalEvent ) {
  4214. return this.originalEvent[ name ];
  4215. }
  4216. },
  4217. set: function( value ) {
  4218. Object.defineProperty( this, name, {
  4219. enumerable: true,
  4220. configurable: true,
  4221. writable: true,
  4222. value: value
  4223. } );
  4224. }
  4225. } );
  4226. },
  4227. fix: function( originalEvent ) {
  4228. return originalEvent[ jQuery.expando ] ?
  4229. originalEvent :
  4230. new jQuery.Event( originalEvent );
  4231. },
  4232. special: {
  4233. load: {
  4234. // Prevent triggered image.load events from bubbling to window.load
  4235. noBubble: true
  4236. },
  4237. click: {
  4238. // Utilize native event to ensure correct state for checkable inputs
  4239. setup: function( data ) {
  4240. // For mutual compressibility with _default, replace `this` access with a local var.
  4241. // `|| data` is dead code meant only to preserve the variable through minification.
  4242. var el = this || data;
  4243. // Claim the first handler
  4244. if ( rcheckableType.test( el.type ) &&
  4245. el.click && nodeName( el, "input" ) ) {
  4246. // dataPriv.set( el, "click", ... )
  4247. leverageNative( el, "click", true );
  4248. }
  4249. // Return false to allow normal processing in the caller
  4250. return false;
  4251. },
  4252. trigger: function( data ) {
  4253. // For mutual compressibility with _default, replace `this` access with a local var.
  4254. // `|| data` is dead code meant only to preserve the variable through minification.
  4255. var el = this || data;
  4256. // Force setup before triggering a click
  4257. if ( rcheckableType.test( el.type ) &&
  4258. el.click && nodeName( el, "input" ) ) {
  4259. leverageNative( el, "click" );
  4260. }
  4261. // Return non-false to allow normal event-path propagation
  4262. return true;
  4263. },
  4264. // For cross-browser consistency, suppress native .click() on links
  4265. // Also prevent it if we're currently inside a leveraged native-event stack
  4266. _default: function( event ) {
  4267. var target = event.target;
  4268. return rcheckableType.test( target.type ) &&
  4269. target.click && nodeName( target, "input" ) &&
  4270. dataPriv.get( target, "click" ) ||
  4271. nodeName( target, "a" );
  4272. }
  4273. },
  4274. beforeunload: {
  4275. postDispatch: function( event ) {
  4276. // Support: Firefox 20+
  4277. // Firefox doesn't alert if the returnValue field is not set.
  4278. if ( event.result !== undefined && event.originalEvent ) {
  4279. event.originalEvent.returnValue = event.result;
  4280. }
  4281. }
  4282. }
  4283. }
  4284. };
  4285. // Ensure the presence of an event listener that handles manually-triggered
  4286. // synthetic events by interrupting progress until reinvoked in response to
  4287. // *native* events that it fires directly, ensuring that state changes have
  4288. // already occurred before other listeners are invoked.
  4289. function leverageNative( el, type, isSetup ) {
  4290. // Missing `isSetup` indicates a trigger call, which must force setup through jQuery.event.add
  4291. if ( !isSetup ) {
  4292. if ( dataPriv.get( el, type ) === undefined ) {
  4293. jQuery.event.add( el, type, returnTrue );
  4294. }
  4295. return;
  4296. }
  4297. // Register the controller as a special universal handler for all event namespaces
  4298. dataPriv.set( el, type, false );
  4299. jQuery.event.add( el, type, {
  4300. namespace: false,
  4301. handler: function( event ) {
  4302. var result,
  4303. saved = dataPriv.get( this, type );
  4304. if ( ( event.isTrigger & 1 ) && this[ type ] ) {
  4305. // Interrupt processing of the outer synthetic .trigger()ed event
  4306. if ( !saved ) {
  4307. // Store arguments for use when handling the inner native event
  4308. // There will always be at least one argument (an event object), so this array
  4309. // will not be confused with a leftover capture object.
  4310. saved = slice.call( arguments );
  4311. dataPriv.set( this, type, saved );
  4312. // Trigger the native event and capture its result
  4313. this[ type ]();
  4314. result = dataPriv.get( this, type );
  4315. dataPriv.set( this, type, false );
  4316. if ( saved !== result ) {
  4317. // Cancel the outer synthetic event
  4318. event.stopImmediatePropagation();
  4319. event.preventDefault();
  4320. return result;
  4321. }
  4322. // If this is an inner synthetic event for an event with a bubbling surrogate
  4323. // (focus or blur), assume that the surrogate already propagated from triggering
  4324. // the native event and prevent that from happening again here.
  4325. // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the
  4326. // bubbling surrogate propagates *after* the non-bubbling base), but that seems
  4327. // less bad than duplication.
  4328. } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) {
  4329. event.stopPropagation();
  4330. }
  4331. // If this is a native event triggered above, everything is now in order
  4332. // Fire an inner synthetic event with the original arguments
  4333. } else if ( saved ) {
  4334. // ...and capture the result
  4335. dataPriv.set( this, type, jQuery.event.trigger(
  4336. saved[ 0 ],
  4337. saved.slice( 1 ),
  4338. this
  4339. ) );
  4340. // Abort handling of the native event by all jQuery handlers while allowing
  4341. // native handlers on the same element to run. On target, this is achieved
  4342. // by stopping immediate propagation just on the jQuery event. However,
  4343. // the native event is re-wrapped by a jQuery one on each level of the
  4344. // propagation so the only way to stop it for jQuery is to stop it for
  4345. // everyone via native `stopPropagation()`. This is not a problem for
  4346. // focus/blur which don't bubble, but it does also stop click on checkboxes
  4347. // and radios. We accept this limitation.
  4348. event.stopPropagation();
  4349. event.isImmediatePropagationStopped = returnTrue;
  4350. }
  4351. }
  4352. } );
  4353. }
  4354. jQuery.removeEvent = function( elem, type, handle ) {
  4355. // This "if" is needed for plain objects
  4356. if ( elem.removeEventListener ) {
  4357. elem.removeEventListener( type, handle );
  4358. }
  4359. };
  4360. jQuery.Event = function( src, props ) {
  4361. // Allow instantiation without the 'new' keyword
  4362. if ( !( this instanceof jQuery.Event ) ) {
  4363. return new jQuery.Event( src, props );
  4364. }
  4365. // Event object
  4366. if ( src && src.type ) {
  4367. this.originalEvent = src;
  4368. this.type = src.type;
  4369. // Events bubbling up the document may have been marked as prevented
  4370. // by a handler lower down the tree; reflect the correct value.
  4371. this.isDefaultPrevented = src.defaultPrevented ||
  4372. src.defaultPrevented === undefined &&
  4373. // Support: Android <=2.3 only
  4374. src.returnValue === false ?
  4375. returnTrue :
  4376. returnFalse;
  4377. // Create target properties
  4378. // Support: Safari <=6 - 7 only
  4379. // Target should not be a text node (trac-504, trac-13143)
  4380. this.target = ( src.target && src.target.nodeType === 3 ) ?
  4381. src.target.parentNode :
  4382. src.target;
  4383. this.currentTarget = src.currentTarget;
  4384. this.relatedTarget = src.relatedTarget;
  4385. // Event type
  4386. } else {
  4387. this.type = src;
  4388. }
  4389. // Put explicitly provided properties onto the event object
  4390. if ( props ) {
  4391. jQuery.extend( this, props );
  4392. }
  4393. // Create a timestamp if incoming event doesn't have one
  4394. this.timeStamp = src && src.timeStamp || Date.now();
  4395. // Mark it as fixed
  4396. this[ jQuery.expando ] = true;
  4397. };
  4398. // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
  4399. // https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
  4400. jQuery.Event.prototype = {
  4401. constructor: jQuery.Event,
  4402. isDefaultPrevented: returnFalse,
  4403. isPropagationStopped: returnFalse,
  4404. isImmediatePropagationStopped: returnFalse,
  4405. isSimulated: false,
  4406. preventDefault: function() {
  4407. var e = this.originalEvent;
  4408. this.isDefaultPrevented = returnTrue;
  4409. if ( e && !this.isSimulated ) {
  4410. e.preventDefault();
  4411. }
  4412. },
  4413. stopPropagation: function() {
  4414. var e = this.originalEvent;
  4415. this.isPropagationStopped = returnTrue;
  4416. if ( e && !this.isSimulated ) {
  4417. e.stopPropagation();
  4418. }
  4419. },
  4420. stopImmediatePropagation: function() {
  4421. var e = this.originalEvent;
  4422. this.isImmediatePropagationStopped = returnTrue;
  4423. if ( e && !this.isSimulated ) {
  4424. e.stopImmediatePropagation();
  4425. }
  4426. this.stopPropagation();
  4427. }
  4428. };
  4429. // Includes all common event props including KeyEvent and MouseEvent specific props
  4430. jQuery.each( {
  4431. altKey: true,
  4432. bubbles: true,
  4433. cancelable: true,
  4434. changedTouches: true,
  4435. ctrlKey: true,
  4436. detail: true,
  4437. eventPhase: true,
  4438. metaKey: true,
  4439. pageX: true,
  4440. pageY: true,
  4441. shiftKey: true,
  4442. view: true,
  4443. "char": true,
  4444. code: true,
  4445. charCode: true,
  4446. key: true,
  4447. keyCode: true,
  4448. button: true,
  4449. buttons: true,
  4450. clientX: true,
  4451. clientY: true,
  4452. offsetX: true,
  4453. offsetY: true,
  4454. pointerId: true,
  4455. pointerType: true,
  4456. screenX: true,
  4457. screenY: true,
  4458. targetTouches: true,
  4459. toElement: true,
  4460. touches: true,
  4461. which: true
  4462. }, jQuery.event.addProp );
  4463. jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) {
  4464. function focusMappedHandler( nativeEvent ) {
  4465. if ( document.documentMode ) {
  4466. // Support: IE 11+
  4467. // Attach a single focusin/focusout handler on the document while someone wants
  4468. // focus/blur. This is because the former are synchronous in IE while the latter
  4469. // are async. In other browsers, all those handlers are invoked synchronously.
  4470. // `handle` from private data would already wrap the event, but we need
  4471. // to change the `type` here.
  4472. var handle = dataPriv.get( this, "handle" ),
  4473. event = jQuery.event.fix( nativeEvent );
  4474. event.type = nativeEvent.type === "focusin" ? "focus" : "blur";
  4475. event.isSimulated = true;
  4476. // First, handle focusin/focusout
  4477. handle( nativeEvent );
  4478. // ...then, handle focus/blur
  4479. //
  4480. // focus/blur don't bubble while focusin/focusout do; simulate the former by only
  4481. // invoking the handler at the lower level.
  4482. if ( event.target === event.currentTarget ) {
  4483. // The setup part calls `leverageNative`, which, in turn, calls
  4484. // `jQuery.event.add`, so event handle will already have been set
  4485. // by this point.
  4486. handle( event );
  4487. }
  4488. } else {
  4489. // For non-IE browsers, attach a single capturing handler on the document
  4490. // while someone wants focusin/focusout.
  4491. jQuery.event.simulate( delegateType, nativeEvent.target,
  4492. jQuery.event.fix( nativeEvent ) );
  4493. }
  4494. }
  4495. jQuery.event.special[ type ] = {
  4496. // Utilize native event if possible so blur/focus sequence is correct
  4497. setup: function() {
  4498. var attaches;
  4499. // Claim the first handler
  4500. // dataPriv.set( this, "focus", ... )
  4501. // dataPriv.set( this, "blur", ... )
  4502. leverageNative( this, type, true );
  4503. if ( document.documentMode ) {
  4504. // Support: IE 9 - 11+
  4505. // We use the same native handler for focusin & focus (and focusout & blur)
  4506. // so we need to coordinate setup & teardown parts between those events.
  4507. // Use `delegateType` as the key as `type` is already used by `leverageNative`.
  4508. attaches = dataPriv.get( this, delegateType );
  4509. if ( !attaches ) {
  4510. this.addEventListener( delegateType, focusMappedHandler );
  4511. }
  4512. dataPriv.set( this, delegateType, ( attaches || 0 ) + 1 );
  4513. } else {
  4514. // Return false to allow normal processing in the caller
  4515. return false;
  4516. }
  4517. },
  4518. trigger: function() {
  4519. // Force setup before trigger
  4520. leverageNative( this, type );
  4521. // Return non-false to allow normal event-path propagation
  4522. return true;
  4523. },
  4524. teardown: function() {
  4525. var attaches;
  4526. if ( document.documentMode ) {
  4527. attaches = dataPriv.get( this, delegateType ) - 1;
  4528. if ( !attaches ) {
  4529. this.removeEventListener( delegateType, focusMappedHandler );
  4530. dataPriv.remove( this, delegateType );
  4531. } else {
  4532. dataPriv.set( this, delegateType, attaches );
  4533. }
  4534. } else {
  4535. // Return false to indicate standard teardown should be applied
  4536. return false;
  4537. }
  4538. },
  4539. // Suppress native focus or blur if we're currently inside
  4540. // a leveraged native-event stack
  4541. _default: function( event ) {
  4542. return dataPriv.get( event.target, type );
  4543. },
  4544. delegateType: delegateType
  4545. };
  4546. // Support: Firefox <=44
  4547. // Firefox doesn't have focus(in | out) events
  4548. // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
  4549. //
  4550. // Support: Chrome <=48 - 49, Safari <=9.0 - 9.1
  4551. // focus(in | out) events fire after focus & blur events,
  4552. // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
  4553. // Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857
  4554. //
  4555. // Support: IE 9 - 11+
  4556. // To preserve relative focusin/focus & focusout/blur event order guaranteed on the 3.x branch,
  4557. // attach a single handler for both events in IE.
  4558. jQuery.event.special[ delegateType ] = {
  4559. setup: function() {
  4560. // Handle: regular nodes (via `this.ownerDocument`), window
  4561. // (via `this.document`) & document (via `this`).
  4562. var doc = this.ownerDocument || this.document || this,
  4563. dataHolder = document.documentMode ? this : doc,
  4564. attaches = dataPriv.get( dataHolder, delegateType );
  4565. // Support: IE 9 - 11+
  4566. // We use the same native handler for focusin & focus (and focusout & blur)
  4567. // so we need to coordinate setup & teardown parts between those events.
  4568. // Use `delegateType` as the key as `type` is already used by `leverageNative`.
  4569. if ( !attaches ) {
  4570. if ( document.documentMode ) {
  4571. this.addEventListener( delegateType, focusMappedHandler );
  4572. } else {
  4573. doc.addEventListener( type, focusMappedHandler, true );
  4574. }
  4575. }
  4576. dataPriv.set( dataHolder, delegateType, ( attaches || 0 ) + 1 );
  4577. },
  4578. teardown: function() {
  4579. var doc = this.ownerDocument || this.document || this,
  4580. dataHolder = document.documentMode ? this : doc,
  4581. attaches = dataPriv.get( dataHolder, delegateType ) - 1;
  4582. if ( !attaches ) {
  4583. if ( document.documentMode ) {
  4584. this.removeEventListener( delegateType, focusMappedHandler );
  4585. } else {
  4586. doc.removeEventListener( type, focusMappedHandler, true );
  4587. }
  4588. dataPriv.remove( dataHolder, delegateType );
  4589. } else {
  4590. dataPriv.set( dataHolder, delegateType, attaches );
  4591. }
  4592. }
  4593. };
  4594. } );
  4595. // Create mouseenter/leave events using mouseover/out and event-time checks
  4596. // so that event delegation works in jQuery.
  4597. // Do the same for pointerenter/pointerleave and pointerover/pointerout
  4598. //
  4599. // Support: Safari 7 only
  4600. // Safari sends mouseenter too often; see:
  4601. // https://bugs.chromium.org/p/chromium/issues/detail?id=470258
  4602. // for the description of the bug (it existed in older Chrome versions as well).
  4603. jQuery.each( {
  4604. mouseenter: "mouseover",
  4605. mouseleave: "mouseout",
  4606. pointerenter: "pointerover",
  4607. pointerleave: "pointerout"
  4608. }, function( orig, fix ) {
  4609. jQuery.event.special[ orig ] = {
  4610. delegateType: fix,
  4611. bindType: fix,
  4612. handle: function( event ) {
  4613. var ret,
  4614. target = this,
  4615. related = event.relatedTarget,
  4616. handleObj = event.handleObj;
  4617. // For mouseenter/leave call the handler if related is outside the target.
  4618. // NB: No relatedTarget if the mouse left/entered the browser window
  4619. if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {
  4620. event.type = handleObj.origType;
  4621. ret = handleObj.handler.apply( this, arguments );
  4622. event.type = fix;
  4623. }
  4624. return ret;
  4625. }
  4626. };
  4627. } );
  4628. jQuery.fn.extend( {
  4629. on: function( types, selector, data, fn ) {
  4630. return on( this, types, selector, data, fn );
  4631. },
  4632. one: function( types, selector, data, fn ) {
  4633. return on( this, types, selector, data, fn, 1 );
  4634. },
  4635. off: function( types, selector, fn ) {
  4636. var handleObj, type;
  4637. if ( types && types.preventDefault && types.handleObj ) {
  4638. // ( event ) dispatched jQuery.Event
  4639. handleObj = types.handleObj;
  4640. jQuery( types.delegateTarget ).off(
  4641. handleObj.namespace ?
  4642. handleObj.origType + "." + handleObj.namespace :
  4643. handleObj.origType,
  4644. handleObj.selector,
  4645. handleObj.handler
  4646. );
  4647. return this;
  4648. }
  4649. if ( typeof types === "object" ) {
  4650. // ( types-object [, selector] )
  4651. for ( type in types ) {
  4652. this.off( type, selector, types[ type ] );
  4653. }
  4654. return this;
  4655. }
  4656. if ( selector === false || typeof selector === "function" ) {
  4657. // ( types [, fn] )
  4658. fn = selector;
  4659. selector = undefined;
  4660. }
  4661. if ( fn === false ) {
  4662. fn = returnFalse;
  4663. }
  4664. return this.each( function() {
  4665. jQuery.event.remove( this, types, fn, selector );
  4666. } );
  4667. }
  4668. } );
  4669. var
  4670. // Support: IE <=10 - 11, Edge 12 - 13 only
  4671. // In IE/Edge using regex groups here causes severe slowdowns.
  4672. // See https://connect.microsoft.com/IE/feedback/details/1736512/
  4673. rnoInnerhtml = /<script|<style|<link/i,
  4674. // checked="checked" or checked
  4675. rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
  4676. rcleanScript = /^\s*<!\[CDATA\[|\]\]>\s*$/g;
  4677. // Prefer a tbody over its parent table for containing new rows
  4678. function manipulationTarget( elem, content ) {
  4679. if ( nodeName( elem, "table" ) &&
  4680. nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) {
  4681. return jQuery( elem ).children( "tbody" )[ 0 ] || elem;
  4682. }
  4683. return elem;
  4684. }
  4685. // Replace/restore the type attribute of script elements for safe DOM manipulation
  4686. function disableScript( elem ) {
  4687. elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type;
  4688. return elem;
  4689. }
  4690. function restoreScript( elem ) {
  4691. if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) {
  4692. elem.type = elem.type.slice( 5 );
  4693. } else {
  4694. elem.removeAttribute( "type" );
  4695. }
  4696. return elem;
  4697. }
  4698. function cloneCopyEvent( src, dest ) {
  4699. var i, l, type, pdataOld, udataOld, udataCur, events;
  4700. if ( dest.nodeType !== 1 ) {
  4701. return;
  4702. }
  4703. // 1. Copy private data: events, handlers, etc.
  4704. if ( dataPriv.hasData( src ) ) {
  4705. pdataOld = dataPriv.get( src );
  4706. events = pdataOld.events;
  4707. if ( events ) {
  4708. dataPriv.remove( dest, "handle events" );
  4709. for ( type in events ) {
  4710. for ( i = 0, l = events[ type ].length; i < l; i++ ) {
  4711. jQuery.event.add( dest, type, events[ type ][ i ] );
  4712. }
  4713. }
  4714. }
  4715. }
  4716. // 2. Copy user data
  4717. if ( dataUser.hasData( src ) ) {
  4718. udataOld = dataUser.access( src );
  4719. udataCur = jQuery.extend( {}, udataOld );
  4720. dataUser.set( dest, udataCur );
  4721. }
  4722. }
  4723. // Fix IE bugs, see support tests
  4724. function fixInput( src, dest ) {
  4725. var nodeName = dest.nodeName.toLowerCase();
  4726. // Fails to persist the checked state of a cloned checkbox or radio button.
  4727. if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
  4728. dest.checked = src.checked;
  4729. // Fails to return the selected option to the default selected state when cloning options
  4730. } else if ( nodeName === "input" || nodeName === "textarea" ) {
  4731. dest.defaultValue = src.defaultValue;
  4732. }
  4733. }
  4734. function domManip( collection, args, callback, ignored ) {
  4735. // Flatten any nested arrays
  4736. args = flat( args );
  4737. var fragment, first, scripts, hasScripts, node, doc,
  4738. i = 0,
  4739. l = collection.length,
  4740. iNoClone = l - 1,
  4741. value = args[ 0 ],
  4742. valueIsFunction = isFunction( value );
  4743. // We can't cloneNode fragments that contain checked, in WebKit
  4744. if ( valueIsFunction ||
  4745. ( l > 1 && typeof value === "string" &&
  4746. !support.checkClone && rchecked.test( value ) ) ) {
  4747. return collection.each( function( index ) {
  4748. var self = collection.eq( index );
  4749. if ( valueIsFunction ) {
  4750. args[ 0 ] = value.call( this, index, self.html() );
  4751. }
  4752. domManip( self, args, callback, ignored );
  4753. } );
  4754. }
  4755. if ( l ) {
  4756. fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );
  4757. first = fragment.firstChild;
  4758. if ( fragment.childNodes.length === 1 ) {
  4759. fragment = first;
  4760. }
  4761. // Require either new content or an interest in ignored elements to invoke the callback
  4762. if ( first || ignored ) {
  4763. scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
  4764. hasScripts = scripts.length;
  4765. // Use the original fragment for the last item
  4766. // instead of the first because it can end up
  4767. // being emptied incorrectly in certain situations (trac-8070).
  4768. for ( ; i < l; i++ ) {
  4769. node = fragment;
  4770. if ( i !== iNoClone ) {
  4771. node = jQuery.clone( node, true, true );
  4772. // Keep references to cloned scripts for later restoration
  4773. if ( hasScripts ) {
  4774. // Support: Android <=4.0 only, PhantomJS 1 only
  4775. // push.apply(_, arraylike) throws on ancient WebKit
  4776. jQuery.merge( scripts, getAll( node, "script" ) );
  4777. }
  4778. }
  4779. callback.call( collection[ i ], node, i );
  4780. }
  4781. if ( hasScripts ) {
  4782. doc = scripts[ scripts.length - 1 ].ownerDocument;
  4783. // Reenable scripts
  4784. jQuery.map( scripts, restoreScript );
  4785. // Evaluate executable scripts on first document insertion
  4786. for ( i = 0; i < hasScripts; i++ ) {
  4787. node = scripts[ i ];
  4788. if ( rscriptType.test( node.type || "" ) &&
  4789. !dataPriv.access( node, "globalEval" ) &&
  4790. jQuery.contains( doc, node ) ) {
  4791. if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) {
  4792. // Optional AJAX dependency, but won't run scripts if not present
  4793. if ( jQuery._evalUrl && !node.noModule ) {
  4794. jQuery._evalUrl( node.src, {
  4795. nonce: node.nonce || node.getAttribute( "nonce" )
  4796. }, doc );
  4797. }
  4798. } else {
  4799. // Unwrap a CDATA section containing script contents. This shouldn't be
  4800. // needed as in XML documents they're already not visible when
  4801. // inspecting element contents and in HTML documents they have no
  4802. // meaning but we're preserving that logic for backwards compatibility.
  4803. // This will be removed completely in 4.0. See gh-4904.
  4804. DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc );
  4805. }
  4806. }
  4807. }
  4808. }
  4809. }
  4810. }
  4811. return collection;
  4812. }
  4813. function remove( elem, selector, keepData ) {
  4814. var node,
  4815. nodes = selector ? jQuery.filter( selector, elem ) : elem,
  4816. i = 0;
  4817. for ( ; ( node = nodes[ i ] ) != null; i++ ) {
  4818. if ( !keepData && node.nodeType === 1 ) {
  4819. jQuery.cleanData( getAll( node ) );
  4820. }
  4821. if ( node.parentNode ) {
  4822. if ( keepData && isAttached( node ) ) {
  4823. setGlobalEval( getAll( node, "script" ) );
  4824. }
  4825. node.parentNode.removeChild( node );
  4826. }
  4827. }
  4828. return elem;
  4829. }
  4830. jQuery.extend( {
  4831. htmlPrefilter: function( html ) {
  4832. return html;
  4833. },
  4834. clone: function( elem, dataAndEvents, deepDataAndEvents ) {
  4835. var i, l, srcElements, destElements,
  4836. clone = elem.cloneNode( true ),
  4837. inPage = isAttached( elem );
  4838. // Fix IE cloning issues
  4839. if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
  4840. !jQuery.isXMLDoc( elem ) ) {
  4841. // We eschew jQuery#find here for performance reasons:
  4842. // https://jsperf.com/getall-vs-sizzle/2
  4843. destElements = getAll( clone );
  4844. srcElements = getAll( elem );
  4845. for ( i = 0, l = srcElements.length; i < l; i++ ) {
  4846. fixInput( srcElements[ i ], destElements[ i ] );
  4847. }
  4848. }
  4849. // Copy the events from the original to the clone
  4850. if ( dataAndEvents ) {
  4851. if ( deepDataAndEvents ) {
  4852. srcElements = srcElements || getAll( elem );
  4853. destElements = destElements || getAll( clone );
  4854. for ( i = 0, l = srcElements.length; i < l; i++ ) {
  4855. cloneCopyEvent( srcElements[ i ], destElements[ i ] );
  4856. }
  4857. } else {
  4858. cloneCopyEvent( elem, clone );
  4859. }
  4860. }
  4861. // Preserve script evaluation history
  4862. destElements = getAll( clone, "script" );
  4863. if ( destElements.length > 0 ) {
  4864. setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
  4865. }
  4866. // Return the cloned set
  4867. return clone;
  4868. },
  4869. cleanData: function( elems ) {
  4870. var data, elem, type,
  4871. special = jQuery.event.special,
  4872. i = 0;
  4873. for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {
  4874. if ( acceptData( elem ) ) {
  4875. if ( ( data = elem[ dataPriv.expando ] ) ) {
  4876. if ( data.events ) {
  4877. for ( type in data.events ) {
  4878. if ( special[ type ] ) {
  4879. jQuery.event.remove( elem, type );
  4880. // This is a shortcut to avoid jQuery.event.remove's overhead
  4881. } else {
  4882. jQuery.removeEvent( elem, type, data.handle );
  4883. }
  4884. }
  4885. }
  4886. // Support: Chrome <=35 - 45+
  4887. // Assign undefined instead of using delete, see Data#remove
  4888. elem[ dataPriv.expando ] = undefined;
  4889. }
  4890. if ( elem[ dataUser.expando ] ) {
  4891. // Support: Chrome <=35 - 45+
  4892. // Assign undefined instead of using delete, see Data#remove
  4893. elem[ dataUser.expando ] = undefined;
  4894. }
  4895. }
  4896. }
  4897. }
  4898. } );
  4899. jQuery.fn.extend( {
  4900. detach: function( selector ) {
  4901. return remove( this, selector, true );
  4902. },
  4903. remove: function( selector ) {
  4904. return remove( this, selector );
  4905. },
  4906. text: function( value ) {
  4907. return access( this, function( value ) {
  4908. return value === undefined ?
  4909. jQuery.text( this ) :
  4910. this.empty().each( function() {
  4911. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  4912. this.textContent = value;
  4913. }
  4914. } );
  4915. }, null, value, arguments.length );
  4916. },
  4917. append: function() {
  4918. return domManip( this, arguments, function( elem ) {
  4919. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  4920. var target = manipulationTarget( this, elem );
  4921. target.appendChild( elem );
  4922. }
  4923. } );
  4924. },
  4925. prepend: function() {
  4926. return domManip( this, arguments, function( elem ) {
  4927. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  4928. var target = manipulationTarget( this, elem );
  4929. target.insertBefore( elem, target.firstChild );
  4930. }
  4931. } );
  4932. },
  4933. before: function() {
  4934. return domManip( this, arguments, function( elem ) {
  4935. if ( this.parentNode ) {
  4936. this.parentNode.insertBefore( elem, this );
  4937. }
  4938. } );
  4939. },
  4940. after: function() {
  4941. return domManip( this, arguments, function( elem ) {
  4942. if ( this.parentNode ) {
  4943. this.parentNode.insertBefore( elem, this.nextSibling );
  4944. }
  4945. } );
  4946. },
  4947. empty: function() {
  4948. var elem,
  4949. i = 0;
  4950. for ( ; ( elem = this[ i ] ) != null; i++ ) {
  4951. if ( elem.nodeType === 1 ) {
  4952. // Prevent memory leaks
  4953. jQuery.cleanData( getAll( elem, false ) );
  4954. // Remove any remaining nodes
  4955. elem.textContent = "";
  4956. }
  4957. }
  4958. return this;
  4959. },
  4960. clone: function( dataAndEvents, deepDataAndEvents ) {
  4961. dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
  4962. deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
  4963. return this.map( function() {
  4964. return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
  4965. } );
  4966. },
  4967. html: function( value ) {
  4968. return access( this, function( value ) {
  4969. var elem = this[ 0 ] || {},
  4970. i = 0,
  4971. l = this.length;
  4972. if ( value === undefined && elem.nodeType === 1 ) {
  4973. return elem.innerHTML;
  4974. }
  4975. // See if we can take a shortcut and just use innerHTML
  4976. if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
  4977. !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
  4978. value = jQuery.htmlPrefilter( value );
  4979. try {
  4980. for ( ; i < l; i++ ) {
  4981. elem = this[ i ] || {};
  4982. // Remove element nodes and prevent memory leaks
  4983. if ( elem.nodeType === 1 ) {
  4984. jQuery.cleanData( getAll( elem, false ) );
  4985. elem.innerHTML = value;
  4986. }
  4987. }
  4988. elem = 0;
  4989. // If using innerHTML throws an exception, use the fallback method
  4990. } catch ( e ) {}
  4991. }
  4992. if ( elem ) {
  4993. this.empty().append( value );
  4994. }
  4995. }, null, value, arguments.length );
  4996. },
  4997. replaceWith: function() {
  4998. var ignored = [];
  4999. // Make the changes, replacing each non-ignored context element with the new content
  5000. return domManip( this, arguments, function( elem ) {
  5001. var parent = this.parentNode;
  5002. if ( jQuery.inArray( this, ignored ) < 0 ) {
  5003. jQuery.cleanData( getAll( this ) );
  5004. if ( parent ) {
  5005. parent.replaceChild( elem, this );
  5006. }
  5007. }
  5008. // Force callback invocation
  5009. }, ignored );
  5010. }
  5011. } );
  5012. jQuery.each( {
  5013. appendTo: "append",
  5014. prependTo: "prepend",
  5015. insertBefore: "before",
  5016. insertAfter: "after",
  5017. replaceAll: "replaceWith"
  5018. }, function( name, original ) {
  5019. jQuery.fn[ name ] = function( selector ) {
  5020. var elems,
  5021. ret = [],
  5022. insert = jQuery( selector ),
  5023. last = insert.length - 1,
  5024. i = 0;
  5025. for ( ; i <= last; i++ ) {
  5026. elems = i === last ? this : this.clone( true );
  5027. jQuery( insert[ i ] )[ original ]( elems );
  5028. // Support: Android <=4.0 only, PhantomJS 1 only
  5029. // .get() because push.apply(_, arraylike) throws on ancient WebKit
  5030. push.apply( ret, elems.get() );
  5031. }
  5032. return this.pushStack( ret );
  5033. };
  5034. } );
  5035. var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
  5036. var rcustomProp = /^--/;
  5037. var getStyles = function( elem ) {
  5038. // Support: IE <=11 only, Firefox <=30 (trac-15098, trac-14150)
  5039. // IE throws on elements created in popups
  5040. // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
  5041. var view = elem.ownerDocument.defaultView;
  5042. if ( !view || !view.opener ) {
  5043. view = window;
  5044. }
  5045. return view.getComputedStyle( elem );
  5046. };
  5047. var swap = function( elem, options, callback ) {
  5048. var ret, name,
  5049. old = {};
  5050. // Remember the old values, and insert the new ones
  5051. for ( name in options ) {
  5052. old[ name ] = elem.style[ name ];
  5053. elem.style[ name ] = options[ name ];
  5054. }
  5055. ret = callback.call( elem );
  5056. // Revert the old values
  5057. for ( name in options ) {
  5058. elem.style[ name ] = old[ name ];
  5059. }
  5060. return ret;
  5061. };
  5062. var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
  5063. ( function() {
  5064. // Executing both pixelPosition & boxSizingReliable tests require only one layout
  5065. // so they're executed at the same time to save the second computation.
  5066. function computeStyleTests() {
  5067. // This is a singleton, we need to execute it only once
  5068. if ( !div ) {
  5069. return;
  5070. }
  5071. container.style.cssText = "position:absolute;left:-11111px;width:60px;" +
  5072. "margin-top:1px;padding:0;border:0";
  5073. div.style.cssText =
  5074. "position:relative;display:block;box-sizing:border-box;overflow:scroll;" +
  5075. "margin:auto;border:1px;padding:1px;" +
  5076. "width:60%;top:1%";
  5077. documentElement.appendChild( container ).appendChild( div );
  5078. var divStyle = window.getComputedStyle( div );
  5079. pixelPositionVal = divStyle.top !== "1%";
  5080. // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44
  5081. reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;
  5082. // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3
  5083. // Some styles come back with percentage values, even though they shouldn't
  5084. div.style.right = "60%";
  5085. pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;
  5086. // Support: IE 9 - 11 only
  5087. // Detect misreporting of content dimensions for box-sizing:border-box elements
  5088. boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;
  5089. // Support: IE 9 only
  5090. // Detect overflow:scroll screwiness (gh-3699)
  5091. // Support: Chrome <=64
  5092. // Don't get tricked when zoom affects offsetWidth (gh-4029)
  5093. div.style.position = "absolute";
  5094. scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;
  5095. documentElement.removeChild( container );
  5096. // Nullify the div so it wouldn't be stored in the memory and
  5097. // it will also be a sign that checks already performed
  5098. div = null;
  5099. }
  5100. function roundPixelMeasures( measure ) {
  5101. return Math.round( parseFloat( measure ) );
  5102. }
  5103. var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal,
  5104. reliableTrDimensionsVal, reliableMarginLeftVal,
  5105. container = document.createElement( "div" ),
  5106. div = document.createElement( "div" );
  5107. // Finish early in limited (non-browser) environments
  5108. if ( !div.style ) {
  5109. return;
  5110. }
  5111. // Support: IE <=9 - 11 only
  5112. // Style of cloned element affects source element cloned (trac-8908)
  5113. div.style.backgroundClip = "content-box";
  5114. div.cloneNode( true ).style.backgroundClip = "";
  5115. support.clearCloneStyle = div.style.backgroundClip === "content-box";
  5116. jQuery.extend( support, {
  5117. boxSizingReliable: function() {
  5118. computeStyleTests();
  5119. return boxSizingReliableVal;
  5120. },
  5121. pixelBoxStyles: function() {
  5122. computeStyleTests();
  5123. return pixelBoxStylesVal;
  5124. },
  5125. pixelPosition: function() {
  5126. computeStyleTests();
  5127. return pixelPositionVal;
  5128. },
  5129. reliableMarginLeft: function() {
  5130. computeStyleTests();
  5131. return reliableMarginLeftVal;
  5132. },
  5133. scrollboxSize: function() {
  5134. computeStyleTests();
  5135. return scrollboxSizeVal;
  5136. },
  5137. // Support: IE 9 - 11+, Edge 15 - 18+
  5138. // IE/Edge misreport `getComputedStyle` of table rows with width/height
  5139. // set in CSS while `offset*` properties report correct values.
  5140. // Behavior in IE 9 is more subtle than in newer versions & it passes
  5141. // some versions of this test; make sure not to make it pass there!
  5142. //
  5143. // Support: Firefox 70+
  5144. // Only Firefox includes border widths
  5145. // in computed dimensions. (gh-4529)
  5146. reliableTrDimensions: function() {
  5147. var table, tr, trChild, trStyle;
  5148. if ( reliableTrDimensionsVal == null ) {
  5149. table = document.createElement( "table" );
  5150. tr = document.createElement( "tr" );
  5151. trChild = document.createElement( "div" );
  5152. table.style.cssText = "position:absolute;left:-11111px;border-collapse:separate";
  5153. tr.style.cssText = "border:1px solid";
  5154. // Support: Chrome 86+
  5155. // Height set through cssText does not get applied.
  5156. // Computed height then comes back as 0.
  5157. tr.style.height = "1px";
  5158. trChild.style.height = "9px";
  5159. // Support: Android 8 Chrome 86+
  5160. // In our bodyBackground.html iframe,
  5161. // display for all div elements is set to "inline",
  5162. // which causes a problem only in Android 8 Chrome 86.
  5163. // Ensuring the div is display: block
  5164. // gets around this issue.
  5165. trChild.style.display = "block";
  5166. documentElement
  5167. .appendChild( table )
  5168. .appendChild( tr )
  5169. .appendChild( trChild );
  5170. trStyle = window.getComputedStyle( tr );
  5171. reliableTrDimensionsVal = ( parseInt( trStyle.height, 10 ) +
  5172. parseInt( trStyle.borderTopWidth, 10 ) +
  5173. parseInt( trStyle.borderBottomWidth, 10 ) ) === tr.offsetHeight;
  5174. documentElement.removeChild( table );
  5175. }
  5176. return reliableTrDimensionsVal;
  5177. }
  5178. } );
  5179. } )();
  5180. function curCSS( elem, name, computed ) {
  5181. var width, minWidth, maxWidth, ret,
  5182. isCustomProp = rcustomProp.test( name ),
  5183. // Support: Firefox 51+
  5184. // Retrieving style before computed somehow
  5185. // fixes an issue with getting wrong values
  5186. // on detached elements
  5187. style = elem.style;
  5188. computed = computed || getStyles( elem );
  5189. // getPropertyValue is needed for:
  5190. // .css('filter') (IE 9 only, trac-12537)
  5191. // .css('--customProperty) (gh-3144)
  5192. if ( computed ) {
  5193. // Support: IE <=9 - 11+
  5194. // IE only supports `"float"` in `getPropertyValue`; in computed styles
  5195. // it's only available as `"cssFloat"`. We no longer modify properties
  5196. // sent to `.css()` apart from camelCasing, so we need to check both.
  5197. // Normally, this would create difference in behavior: if
  5198. // `getPropertyValue` returns an empty string, the value returned
  5199. // by `.css()` would be `undefined`. This is usually the case for
  5200. // disconnected elements. However, in IE even disconnected elements
  5201. // with no styles return `"none"` for `getPropertyValue( "float" )`
  5202. ret = computed.getPropertyValue( name ) || computed[ name ];
  5203. if ( isCustomProp && ret ) {
  5204. // Support: Firefox 105+, Chrome <=105+
  5205. // Spec requires trimming whitespace for custom properties (gh-4926).
  5206. // Firefox only trims leading whitespace. Chrome just collapses
  5207. // both leading & trailing whitespace to a single space.
  5208. //
  5209. // Fall back to `undefined` if empty string returned.
  5210. // This collapses a missing definition with property defined
  5211. // and set to an empty string but there's no standard API
  5212. // allowing us to differentiate them without a performance penalty
  5213. // and returning `undefined` aligns with older jQuery.
  5214. //
  5215. // rtrimCSS treats U+000D CARRIAGE RETURN and U+000C FORM FEED
  5216. // as whitespace while CSS does not, but this is not a problem
  5217. // because CSS preprocessing replaces them with U+000A LINE FEED
  5218. // (which *is* CSS whitespace)
  5219. // https://www.w3.org/TR/css-syntax-3/#input-preprocessing
  5220. ret = ret.replace( rtrimCSS, "$1" ) || undefined;
  5221. }
  5222. if ( ret === "" && !isAttached( elem ) ) {
  5223. ret = jQuery.style( elem, name );
  5224. }
  5225. // A tribute to the "awesome hack by Dean Edwards"
  5226. // Android Browser returns percentage for some values,
  5227. // but width seems to be reliably pixels.
  5228. // This is against the CSSOM draft spec:
  5229. // https://drafts.csswg.org/cssom/#resolved-values
  5230. if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) {
  5231. // Remember the original values
  5232. width = style.width;
  5233. minWidth = style.minWidth;
  5234. maxWidth = style.maxWidth;
  5235. // Put in the new values to get a computed value out
  5236. style.minWidth = style.maxWidth = style.width = ret;
  5237. ret = computed.width;
  5238. // Revert the changed values
  5239. style.width = width;
  5240. style.minWidth = minWidth;
  5241. style.maxWidth = maxWidth;
  5242. }
  5243. }
  5244. return ret !== undefined ?
  5245. // Support: IE <=9 - 11 only
  5246. // IE returns zIndex value as an integer.
  5247. ret + "" :
  5248. ret;
  5249. }
  5250. function addGetHookIf( conditionFn, hookFn ) {
  5251. // Define the hook, we'll check on the first run if it's really needed.
  5252. return {
  5253. get: function() {
  5254. if ( conditionFn() ) {
  5255. // Hook not needed (or it's not possible to use it due
  5256. // to missing dependency), remove it.
  5257. delete this.get;
  5258. return;
  5259. }
  5260. // Hook needed; redefine it so that the support test is not executed again.
  5261. return ( this.get = hookFn ).apply( this, arguments );
  5262. }
  5263. };
  5264. }
  5265. var cssPrefixes = [ "Webkit", "Moz", "ms" ],
  5266. emptyStyle = document.createElement( "div" ).style,
  5267. vendorProps = {};
  5268. // Return a vendor-prefixed property or undefined
  5269. function vendorPropName( name ) {
  5270. // Check for vendor prefixed names
  5271. var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),
  5272. i = cssPrefixes.length;
  5273. while ( i-- ) {
  5274. name = cssPrefixes[ i ] + capName;
  5275. if ( name in emptyStyle ) {
  5276. return name;
  5277. }
  5278. }
  5279. }
  5280. // Return a potentially-mapped jQuery.cssProps or vendor prefixed property
  5281. function finalPropName( name ) {
  5282. var final = jQuery.cssProps[ name ] || vendorProps[ name ];
  5283. if ( final ) {
  5284. return final;
  5285. }
  5286. if ( name in emptyStyle ) {
  5287. return name;
  5288. }
  5289. return vendorProps[ name ] = vendorPropName( name ) || name;
  5290. }
  5291. var
  5292. // Swappable if display is none or starts with table
  5293. // except "table", "table-cell", or "table-caption"
  5294. // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
  5295. rdisplayswap = /^(none|table(?!-c[ea]).+)/,
  5296. cssShow = { position: "absolute", visibility: "hidden", display: "block" },
  5297. cssNormalTransform = {
  5298. letterSpacing: "0",
  5299. fontWeight: "400"
  5300. };
  5301. function setPositiveNumber( _elem, value, subtract ) {
  5302. // Any relative (+/-) values have already been
  5303. // normalized at this point
  5304. var matches = rcssNum.exec( value );
  5305. return matches ?
  5306. // Guard against undefined "subtract", e.g., when used as in cssHooks
  5307. Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) :
  5308. value;
  5309. }
  5310. function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) {
  5311. var i = dimension === "width" ? 1 : 0,
  5312. extra = 0,
  5313. delta = 0,
  5314. marginDelta = 0;
  5315. // Adjustment may not be necessary
  5316. if ( box === ( isBorderBox ? "border" : "content" ) ) {
  5317. return 0;
  5318. }
  5319. for ( ; i < 4; i += 2 ) {
  5320. // Both box models exclude margin
  5321. // Count margin delta separately to only add it after scroll gutter adjustment.
  5322. // This is needed to make negative margins work with `outerHeight( true )` (gh-3982).
  5323. if ( box === "margin" ) {
  5324. marginDelta += jQuery.css( elem, box + cssExpand[ i ], true, styles );
  5325. }
  5326. // If we get here with a content-box, we're seeking "padding" or "border" or "margin"
  5327. if ( !isBorderBox ) {
  5328. // Add padding
  5329. delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
  5330. // For "border" or "margin", add border
  5331. if ( box !== "padding" ) {
  5332. delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  5333. // But still keep track of it otherwise
  5334. } else {
  5335. extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  5336. }
  5337. // If we get here with a border-box (content + padding + border), we're seeking "content" or
  5338. // "padding" or "margin"
  5339. } else {
  5340. // For "content", subtract padding
  5341. if ( box === "content" ) {
  5342. delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
  5343. }
  5344. // For "content" or "padding", subtract border
  5345. if ( box !== "margin" ) {
  5346. delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  5347. }
  5348. }
  5349. }
  5350. // Account for positive content-box scroll gutter when requested by providing computedVal
  5351. if ( !isBorderBox && computedVal >= 0 ) {
  5352. // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border
  5353. // Assuming integer scroll gutter, subtract the rest and round down
  5354. delta += Math.max( 0, Math.ceil(
  5355. elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -
  5356. computedVal -
  5357. delta -
  5358. extra -
  5359. 0.5
  5360. // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter
  5361. // Use an explicit zero to avoid NaN (gh-3964)
  5362. ) ) || 0;
  5363. }
  5364. return delta + marginDelta;
  5365. }
  5366. function getWidthOrHeight( elem, dimension, extra ) {
  5367. // Start with computed style
  5368. var styles = getStyles( elem ),
  5369. // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322).
  5370. // Fake content-box until we know it's needed to know the true value.
  5371. boxSizingNeeded = !support.boxSizingReliable() || extra,
  5372. isBorderBox = boxSizingNeeded &&
  5373. jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
  5374. valueIsBorderBox = isBorderBox,
  5375. val = curCSS( elem, dimension, styles ),
  5376. offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 );
  5377. // Support: Firefox <=54
  5378. // Return a confounding non-pixel value or feign ignorance, as appropriate.
  5379. if ( rnumnonpx.test( val ) ) {
  5380. if ( !extra ) {
  5381. return val;
  5382. }
  5383. val = "auto";
  5384. }
  5385. // Support: IE 9 - 11 only
  5386. // Use offsetWidth/offsetHeight for when box sizing is unreliable.
  5387. // In those cases, the computed value can be trusted to be border-box.
  5388. if ( ( !support.boxSizingReliable() && isBorderBox ||
  5389. // Support: IE 10 - 11+, Edge 15 - 18+
  5390. // IE/Edge misreport `getComputedStyle` of table rows with width/height
  5391. // set in CSS while `offset*` properties report correct values.
  5392. // Interestingly, in some cases IE 9 doesn't suffer from this issue.
  5393. !support.reliableTrDimensions() && nodeName( elem, "tr" ) ||
  5394. // Fall back to offsetWidth/offsetHeight when value is "auto"
  5395. // This happens for inline elements with no explicit setting (gh-3571)
  5396. val === "auto" ||
  5397. // Support: Android <=4.1 - 4.3 only
  5398. // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602)
  5399. !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) &&
  5400. // Make sure the element is visible & connected
  5401. elem.getClientRects().length ) {
  5402. isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
  5403. // Where available, offsetWidth/offsetHeight approximate border box dimensions.
  5404. // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the
  5405. // retrieved value as a content box dimension.
  5406. valueIsBorderBox = offsetProp in elem;
  5407. if ( valueIsBorderBox ) {
  5408. val = elem[ offsetProp ];
  5409. }
  5410. }
  5411. // Normalize "" and auto
  5412. val = parseFloat( val ) || 0;
  5413. // Adjust for the element's box model
  5414. return ( val +
  5415. boxModelAdjustment(
  5416. elem,
  5417. dimension,
  5418. extra || ( isBorderBox ? "border" : "content" ),
  5419. valueIsBorderBox,
  5420. styles,
  5421. // Provide the current computed size to request scroll gutter calculation (gh-3589)
  5422. val
  5423. )
  5424. ) + "px";
  5425. }
  5426. jQuery.extend( {
  5427. // Add in style property hooks for overriding the default
  5428. // behavior of getting and setting a style property
  5429. cssHooks: {
  5430. opacity: {
  5431. get: function( elem, computed ) {
  5432. if ( computed ) {
  5433. // We should always get a number back from opacity
  5434. var ret = curCSS( elem, "opacity" );
  5435. return ret === "" ? "1" : ret;
  5436. }
  5437. }
  5438. }
  5439. },
  5440. // Don't automatically add "px" to these possibly-unitless properties
  5441. cssNumber: {
  5442. animationIterationCount: true,
  5443. aspectRatio: true,
  5444. borderImageSlice: true,
  5445. columnCount: true,
  5446. flexGrow: true,
  5447. flexShrink: true,
  5448. fontWeight: true,
  5449. gridArea: true,
  5450. gridColumn: true,
  5451. gridColumnEnd: true,
  5452. gridColumnStart: true,
  5453. gridRow: true,
  5454. gridRowEnd: true,
  5455. gridRowStart: true,
  5456. lineHeight: true,
  5457. opacity: true,
  5458. order: true,
  5459. orphans: true,
  5460. scale: true,
  5461. widows: true,
  5462. zIndex: true,
  5463. zoom: true,
  5464. // SVG-related
  5465. fillOpacity: true,
  5466. floodOpacity: true,
  5467. stopOpacity: true,
  5468. strokeMiterlimit: true,
  5469. strokeOpacity: true
  5470. },
  5471. // Add in properties whose names you wish to fix before
  5472. // setting or getting the value
  5473. cssProps: {},
  5474. // Get and set the style property on a DOM Node
  5475. style: function( elem, name, value, extra ) {
  5476. // Don't set styles on text and comment nodes
  5477. if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
  5478. return;
  5479. }
  5480. // Make sure that we're working with the right name
  5481. var ret, type, hooks,
  5482. origName = camelCase( name ),
  5483. isCustomProp = rcustomProp.test( name ),
  5484. style = elem.style;
  5485. // Make sure that we're working with the right name. We don't
  5486. // want to query the value if it is a CSS custom property
  5487. // since they are user-defined.
  5488. if ( !isCustomProp ) {
  5489. name = finalPropName( origName );
  5490. }
  5491. // Gets hook for the prefixed version, then unprefixed version
  5492. hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
  5493. // Check if we're setting a value
  5494. if ( value !== undefined ) {
  5495. type = typeof value;
  5496. // Convert "+=" or "-=" to relative numbers (trac-7345)
  5497. if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {
  5498. value = adjustCSS( elem, name, ret );
  5499. // Fixes bug trac-9237
  5500. type = "number";
  5501. }
  5502. // Make sure that null and NaN values aren't set (trac-7116)
  5503. if ( value == null || value !== value ) {
  5504. return;
  5505. }
  5506. // If a number was passed in, add the unit (except for certain CSS properties)
  5507. // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append
  5508. // "px" to a few hardcoded values.
  5509. if ( type === "number" && !isCustomProp ) {
  5510. value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" );
  5511. }
  5512. // background-* props affect original clone's values
  5513. if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
  5514. style[ name ] = "inherit";
  5515. }
  5516. // If a hook was provided, use that value, otherwise just set the specified value
  5517. if ( !hooks || !( "set" in hooks ) ||
  5518. ( value = hooks.set( elem, value, extra ) ) !== undefined ) {
  5519. if ( isCustomProp ) {
  5520. style.setProperty( name, value );
  5521. } else {
  5522. style[ name ] = value;
  5523. }
  5524. }
  5525. } else {
  5526. // If a hook was provided get the non-computed value from there
  5527. if ( hooks && "get" in hooks &&
  5528. ( ret = hooks.get( elem, false, extra ) ) !== undefined ) {
  5529. return ret;
  5530. }
  5531. // Otherwise just get the value from the style object
  5532. return style[ name ];
  5533. }
  5534. },
  5535. css: function( elem, name, extra, styles ) {
  5536. var val, num, hooks,
  5537. origName = camelCase( name ),
  5538. isCustomProp = rcustomProp.test( name );
  5539. // Make sure that we're working with the right name. We don't
  5540. // want to modify the value if it is a CSS custom property
  5541. // since they are user-defined.
  5542. if ( !isCustomProp ) {
  5543. name = finalPropName( origName );
  5544. }
  5545. // Try prefixed name followed by the unprefixed name
  5546. hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
  5547. // If a hook was provided get the computed value from there
  5548. if ( hooks && "get" in hooks ) {
  5549. val = hooks.get( elem, true, extra );
  5550. }
  5551. // Otherwise, if a way to get the computed value exists, use that
  5552. if ( val === undefined ) {
  5553. val = curCSS( elem, name, styles );
  5554. }
  5555. // Convert "normal" to computed value
  5556. if ( val === "normal" && name in cssNormalTransform ) {
  5557. val = cssNormalTransform[ name ];
  5558. }
  5559. // Make numeric if forced or a qualifier was provided and val looks numeric
  5560. if ( extra === "" || extra ) {
  5561. num = parseFloat( val );
  5562. return extra === true || isFinite( num ) ? num || 0 : val;
  5563. }
  5564. return val;
  5565. }
  5566. } );
  5567. jQuery.each( [ "height", "width" ], function( _i, dimension ) {
  5568. jQuery.cssHooks[ dimension ] = {
  5569. get: function( elem, computed, extra ) {
  5570. if ( computed ) {
  5571. // Certain elements can have dimension info if we invisibly show them
  5572. // but it must have a current display style that would benefit
  5573. return rdisplayswap.test( jQuery.css( elem, "display" ) ) &&
  5574. // Support: Safari 8+
  5575. // Table columns in Safari have non-zero offsetWidth & zero
  5576. // getBoundingClientRect().width unless display is changed.
  5577. // Support: IE <=11 only
  5578. // Running getBoundingClientRect on a disconnected node
  5579. // in IE throws an error.
  5580. ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?
  5581. swap( elem, cssShow, function() {
  5582. return getWidthOrHeight( elem, dimension, extra );
  5583. } ) :
  5584. getWidthOrHeight( elem, dimension, extra );
  5585. }
  5586. },
  5587. set: function( elem, value, extra ) {
  5588. var matches,
  5589. styles = getStyles( elem ),
  5590. // Only read styles.position if the test has a chance to fail
  5591. // to avoid forcing a reflow.
  5592. scrollboxSizeBuggy = !support.scrollboxSize() &&
  5593. styles.position === "absolute",
  5594. // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991)
  5595. boxSizingNeeded = scrollboxSizeBuggy || extra,
  5596. isBorderBox = boxSizingNeeded &&
  5597. jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
  5598. subtract = extra ?
  5599. boxModelAdjustment(
  5600. elem,
  5601. dimension,
  5602. extra,
  5603. isBorderBox,
  5604. styles
  5605. ) :
  5606. 0;
  5607. // Account for unreliable border-box dimensions by comparing offset* to computed and
  5608. // faking a content-box to get border and padding (gh-3699)
  5609. if ( isBorderBox && scrollboxSizeBuggy ) {
  5610. subtract -= Math.ceil(
  5611. elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -
  5612. parseFloat( styles[ dimension ] ) -
  5613. boxModelAdjustment( elem, dimension, "border", false, styles ) -
  5614. 0.5
  5615. );
  5616. }
  5617. // Convert to pixels if value adjustment is needed
  5618. if ( subtract && ( matches = rcssNum.exec( value ) ) &&
  5619. ( matches[ 3 ] || "px" ) !== "px" ) {
  5620. elem.style[ dimension ] = value;
  5621. value = jQuery.css( elem, dimension );
  5622. }
  5623. return setPositiveNumber( elem, value, subtract );
  5624. }
  5625. };
  5626. } );
  5627. jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,
  5628. function( elem, computed ) {
  5629. if ( computed ) {
  5630. return ( parseFloat( curCSS( elem, "marginLeft" ) ) ||
  5631. elem.getBoundingClientRect().left -
  5632. swap( elem, { marginLeft: 0 }, function() {
  5633. return elem.getBoundingClientRect().left;
  5634. } )
  5635. ) + "px";
  5636. }
  5637. }
  5638. );
  5639. // These hooks are used by animate to expand properties
  5640. jQuery.each( {
  5641. margin: "",
  5642. padding: "",
  5643. border: "Width"
  5644. }, function( prefix, suffix ) {
  5645. jQuery.cssHooks[ prefix + suffix ] = {
  5646. expand: function( value ) {
  5647. var i = 0,
  5648. expanded = {},
  5649. // Assumes a single number if not a string
  5650. parts = typeof value === "string" ? value.split( " " ) : [ value ];
  5651. for ( ; i < 4; i++ ) {
  5652. expanded[ prefix + cssExpand[ i ] + suffix ] =
  5653. parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
  5654. }
  5655. return expanded;
  5656. }
  5657. };
  5658. if ( prefix !== "margin" ) {
  5659. jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
  5660. }
  5661. } );
  5662. jQuery.fn.extend( {
  5663. css: function( name, value ) {
  5664. return access( this, function( elem, name, value ) {
  5665. var styles, len,
  5666. map = {},
  5667. i = 0;
  5668. if ( Array.isArray( name ) ) {
  5669. styles = getStyles( elem );
  5670. len = name.length;
  5671. for ( ; i < len; i++ ) {
  5672. map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
  5673. }
  5674. return map;
  5675. }
  5676. return value !== undefined ?
  5677. jQuery.style( elem, name, value ) :
  5678. jQuery.css( elem, name );
  5679. }, name, value, arguments.length > 1 );
  5680. }
  5681. } );
  5682. function Tween( elem, options, prop, end, easing ) {
  5683. return new Tween.prototype.init( elem, options, prop, end, easing );
  5684. }
  5685. jQuery.Tween = Tween;
  5686. Tween.prototype = {
  5687. constructor: Tween,
  5688. init: function( elem, options, prop, end, easing, unit ) {
  5689. this.elem = elem;
  5690. this.prop = prop;
  5691. this.easing = easing || jQuery.easing._default;
  5692. this.options = options;
  5693. this.start = this.now = this.cur();
  5694. this.end = end;
  5695. this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
  5696. },
  5697. cur: function() {
  5698. var hooks = Tween.propHooks[ this.prop ];
  5699. return hooks && hooks.get ?
  5700. hooks.get( this ) :
  5701. Tween.propHooks._default.get( this );
  5702. },
  5703. run: function( percent ) {
  5704. var eased,
  5705. hooks = Tween.propHooks[ this.prop ];
  5706. if ( this.options.duration ) {
  5707. this.pos = eased = jQuery.easing[ this.easing ](
  5708. percent, this.options.duration * percent, 0, 1, this.options.duration
  5709. );
  5710. } else {
  5711. this.pos = eased = percent;
  5712. }
  5713. this.now = ( this.end - this.start ) * eased + this.start;
  5714. if ( this.options.step ) {
  5715. this.options.step.call( this.elem, this.now, this );
  5716. }
  5717. if ( hooks && hooks.set ) {
  5718. hooks.set( this );
  5719. } else {
  5720. Tween.propHooks._default.set( this );
  5721. }
  5722. return this;
  5723. }
  5724. };
  5725. Tween.prototype.init.prototype = Tween.prototype;
  5726. Tween.propHooks = {
  5727. _default: {
  5728. get: function( tween ) {
  5729. var result;
  5730. // Use a property on the element directly when it is not a DOM element,
  5731. // or when there is no matching style property that exists.
  5732. if ( tween.elem.nodeType !== 1 ||
  5733. tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {
  5734. return tween.elem[ tween.prop ];
  5735. }
  5736. // Passing an empty string as a 3rd parameter to .css will automatically
  5737. // attempt a parseFloat and fallback to a string if the parse fails.
  5738. // Simple values such as "10px" are parsed to Float;
  5739. // complex values such as "rotate(1rad)" are returned as-is.
  5740. result = jQuery.css( tween.elem, tween.prop, "" );
  5741. // Empty strings, null, undefined and "auto" are converted to 0.
  5742. return !result || result === "auto" ? 0 : result;
  5743. },
  5744. set: function( tween ) {
  5745. // Use step hook for back compat.
  5746. // Use cssHook if its there.
  5747. // Use .style if available and use plain properties where available.
  5748. if ( jQuery.fx.step[ tween.prop ] ) {
  5749. jQuery.fx.step[ tween.prop ]( tween );
  5750. } else if ( tween.elem.nodeType === 1 && (
  5751. jQuery.cssHooks[ tween.prop ] ||
  5752. tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) {
  5753. jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
  5754. } else {
  5755. tween.elem[ tween.prop ] = tween.now;
  5756. }
  5757. }
  5758. }
  5759. };
  5760. // Support: IE <=9 only
  5761. // Panic based approach to setting things on disconnected nodes
  5762. Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
  5763. set: function( tween ) {
  5764. if ( tween.elem.nodeType && tween.elem.parentNode ) {
  5765. tween.elem[ tween.prop ] = tween.now;
  5766. }
  5767. }
  5768. };
  5769. jQuery.easing = {
  5770. linear: function( p ) {
  5771. return p;
  5772. },
  5773. swing: function( p ) {
  5774. return 0.5 - Math.cos( p * Math.PI ) / 2;
  5775. },
  5776. _default: "swing"
  5777. };
  5778. jQuery.fx = Tween.prototype.init;
  5779. // Back compat <1.8 extension point
  5780. jQuery.fx.step = {};
  5781. var
  5782. fxNow, inProgress,
  5783. rfxtypes = /^(?:toggle|show|hide)$/,
  5784. rrun = /queueHooks$/;
  5785. function schedule() {
  5786. if ( inProgress ) {
  5787. if ( document.hidden === false && window.requestAnimationFrame ) {
  5788. window.requestAnimationFrame( schedule );
  5789. } else {
  5790. window.setTimeout( schedule, jQuery.fx.interval );
  5791. }
  5792. jQuery.fx.tick();
  5793. }
  5794. }
  5795. // Animations created synchronously will run synchronously
  5796. function createFxNow() {
  5797. window.setTimeout( function() {
  5798. fxNow = undefined;
  5799. } );
  5800. return ( fxNow = Date.now() );
  5801. }
  5802. // Generate parameters to create a standard animation
  5803. function genFx( type, includeWidth ) {
  5804. var which,
  5805. i = 0,
  5806. attrs = { height: type };
  5807. // If we include width, step value is 1 to do all cssExpand values,
  5808. // otherwise step value is 2 to skip over Left and Right
  5809. includeWidth = includeWidth ? 1 : 0;
  5810. for ( ; i < 4; i += 2 - includeWidth ) {
  5811. which = cssExpand[ i ];
  5812. attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
  5813. }
  5814. if ( includeWidth ) {
  5815. attrs.opacity = attrs.width = type;
  5816. }
  5817. return attrs;
  5818. }
  5819. function createTween( value, prop, animation ) {
  5820. var tween,
  5821. collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ),
  5822. index = 0,
  5823. length = collection.length;
  5824. for ( ; index < length; index++ ) {
  5825. if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {
  5826. // We're done with this property
  5827. return tween;
  5828. }
  5829. }
  5830. }
  5831. function defaultPrefilter( elem, props, opts ) {
  5832. var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,
  5833. isBox = "width" in props || "height" in props,
  5834. anim = this,
  5835. orig = {},
  5836. style = elem.style,
  5837. hidden = elem.nodeType && isHiddenWithinTree( elem ),
  5838. dataShow = dataPriv.get( elem, "fxshow" );
  5839. // Queue-skipping animations hijack the fx hooks
  5840. if ( !opts.queue ) {
  5841. hooks = jQuery._queueHooks( elem, "fx" );
  5842. if ( hooks.unqueued == null ) {
  5843. hooks.unqueued = 0;
  5844. oldfire = hooks.empty.fire;
  5845. hooks.empty.fire = function() {
  5846. if ( !hooks.unqueued ) {
  5847. oldfire();
  5848. }
  5849. };
  5850. }
  5851. hooks.unqueued++;
  5852. anim.always( function() {
  5853. // Ensure the complete handler is called before this completes
  5854. anim.always( function() {
  5855. hooks.unqueued--;
  5856. if ( !jQuery.queue( elem, "fx" ).length ) {
  5857. hooks.empty.fire();
  5858. }
  5859. } );
  5860. } );
  5861. }
  5862. // Detect show/hide animations
  5863. for ( prop in props ) {
  5864. value = props[ prop ];
  5865. if ( rfxtypes.test( value ) ) {
  5866. delete props[ prop ];
  5867. toggle = toggle || value === "toggle";
  5868. if ( value === ( hidden ? "hide" : "show" ) ) {
  5869. // Pretend to be hidden if this is a "show" and
  5870. // there is still data from a stopped show/hide
  5871. if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
  5872. hidden = true;
  5873. // Ignore all other no-op show/hide data
  5874. } else {
  5875. continue;
  5876. }
  5877. }
  5878. orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
  5879. }
  5880. }
  5881. // Bail out if this is a no-op like .hide().hide()
  5882. propTween = !jQuery.isEmptyObject( props );
  5883. if ( !propTween && jQuery.isEmptyObject( orig ) ) {
  5884. return;
  5885. }
  5886. // Restrict "overflow" and "display" styles during box animations
  5887. if ( isBox && elem.nodeType === 1 ) {
  5888. // Support: IE <=9 - 11, Edge 12 - 15
  5889. // Record all 3 overflow attributes because IE does not infer the shorthand
  5890. // from identically-valued overflowX and overflowY and Edge just mirrors
  5891. // the overflowX value there.
  5892. opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
  5893. // Identify a display type, preferring old show/hide data over the CSS cascade
  5894. restoreDisplay = dataShow && dataShow.display;
  5895. if ( restoreDisplay == null ) {
  5896. restoreDisplay = dataPriv.get( elem, "display" );
  5897. }
  5898. display = jQuery.css( elem, "display" );
  5899. if ( display === "none" ) {
  5900. if ( restoreDisplay ) {
  5901. display = restoreDisplay;
  5902. } else {
  5903. // Get nonempty value(s) by temporarily forcing visibility
  5904. showHide( [ elem ], true );
  5905. restoreDisplay = elem.style.display || restoreDisplay;
  5906. display = jQuery.css( elem, "display" );
  5907. showHide( [ elem ] );
  5908. }
  5909. }
  5910. // Animate inline elements as inline-block
  5911. if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) {
  5912. if ( jQuery.css( elem, "float" ) === "none" ) {
  5913. // Restore the original display value at the end of pure show/hide animations
  5914. if ( !propTween ) {
  5915. anim.done( function() {
  5916. style.display = restoreDisplay;
  5917. } );
  5918. if ( restoreDisplay == null ) {
  5919. display = style.display;
  5920. restoreDisplay = display === "none" ? "" : display;
  5921. }
  5922. }
  5923. style.display = "inline-block";
  5924. }
  5925. }
  5926. }
  5927. if ( opts.overflow ) {
  5928. style.overflow = "hidden";
  5929. anim.always( function() {
  5930. style.overflow = opts.overflow[ 0 ];
  5931. style.overflowX = opts.overflow[ 1 ];
  5932. style.overflowY = opts.overflow[ 2 ];
  5933. } );
  5934. }
  5935. // Implement show/hide animations
  5936. propTween = false;
  5937. for ( prop in orig ) {
  5938. // General show/hide setup for this element animation
  5939. if ( !propTween ) {
  5940. if ( dataShow ) {
  5941. if ( "hidden" in dataShow ) {
  5942. hidden = dataShow.hidden;
  5943. }
  5944. } else {
  5945. dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } );
  5946. }
  5947. // Store hidden/visible for toggle so `.stop().toggle()` "reverses"
  5948. if ( toggle ) {
  5949. dataShow.hidden = !hidden;
  5950. }
  5951. // Show elements before animating them
  5952. if ( hidden ) {
  5953. showHide( [ elem ], true );
  5954. }
  5955. /* eslint-disable no-loop-func */
  5956. anim.done( function() {
  5957. /* eslint-enable no-loop-func */
  5958. // The final step of a "hide" animation is actually hiding the element
  5959. if ( !hidden ) {
  5960. showHide( [ elem ] );
  5961. }
  5962. dataPriv.remove( elem, "fxshow" );
  5963. for ( prop in orig ) {
  5964. jQuery.style( elem, prop, orig[ prop ] );
  5965. }
  5966. } );
  5967. }
  5968. // Per-property setup
  5969. propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
  5970. if ( !( prop in dataShow ) ) {
  5971. dataShow[ prop ] = propTween.start;
  5972. if ( hidden ) {
  5973. propTween.end = propTween.start;
  5974. propTween.start = 0;
  5975. }
  5976. }
  5977. }
  5978. }
  5979. function propFilter( props, specialEasing ) {
  5980. var index, name, easing, value, hooks;
  5981. // camelCase, specialEasing and expand cssHook pass
  5982. for ( index in props ) {
  5983. name = camelCase( index );
  5984. easing = specialEasing[ name ];
  5985. value = props[ index ];
  5986. if ( Array.isArray( value ) ) {
  5987. easing = value[ 1 ];
  5988. value = props[ index ] = value[ 0 ];
  5989. }
  5990. if ( index !== name ) {
  5991. props[ name ] = value;
  5992. delete props[ index ];
  5993. }
  5994. hooks = jQuery.cssHooks[ name ];
  5995. if ( hooks && "expand" in hooks ) {
  5996. value = hooks.expand( value );
  5997. delete props[ name ];
  5998. // Not quite $.extend, this won't overwrite existing keys.
  5999. // Reusing 'index' because we have the correct "name"
  6000. for ( index in value ) {
  6001. if ( !( index in props ) ) {
  6002. props[ index ] = value[ index ];
  6003. specialEasing[ index ] = easing;
  6004. }
  6005. }
  6006. } else {
  6007. specialEasing[ name ] = easing;
  6008. }
  6009. }
  6010. }
  6011. function Animation( elem, properties, options ) {
  6012. var result,
  6013. stopped,
  6014. index = 0,
  6015. length = Animation.prefilters.length,
  6016. deferred = jQuery.Deferred().always( function() {
  6017. // Don't match elem in the :animated selector
  6018. delete tick.elem;
  6019. } ),
  6020. tick = function() {
  6021. if ( stopped ) {
  6022. return false;
  6023. }
  6024. var currentTime = fxNow || createFxNow(),
  6025. remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
  6026. // Support: Android 2.3 only
  6027. // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (trac-12497)
  6028. temp = remaining / animation.duration || 0,
  6029. percent = 1 - temp,
  6030. index = 0,
  6031. length = animation.tweens.length;
  6032. for ( ; index < length; index++ ) {
  6033. animation.tweens[ index ].run( percent );
  6034. }
  6035. deferred.notifyWith( elem, [ animation, percent, remaining ] );
  6036. // If there's more to do, yield
  6037. if ( percent < 1 && length ) {
  6038. return remaining;
  6039. }
  6040. // If this was an empty animation, synthesize a final progress notification
  6041. if ( !length ) {
  6042. deferred.notifyWith( elem, [ animation, 1, 0 ] );
  6043. }
  6044. // Resolve the animation and report its conclusion
  6045. deferred.resolveWith( elem, [ animation ] );
  6046. return false;
  6047. },
  6048. animation = deferred.promise( {
  6049. elem: elem,
  6050. props: jQuery.extend( {}, properties ),
  6051. opts: jQuery.extend( true, {
  6052. specialEasing: {},
  6053. easing: jQuery.easing._default
  6054. }, options ),
  6055. originalProperties: properties,
  6056. originalOptions: options,
  6057. startTime: fxNow || createFxNow(),
  6058. duration: options.duration,
  6059. tweens: [],
  6060. createTween: function( prop, end ) {
  6061. var tween = jQuery.Tween( elem, animation.opts, prop, end,
  6062. animation.opts.specialEasing[ prop ] || animation.opts.easing );
  6063. animation.tweens.push( tween );
  6064. return tween;
  6065. },
  6066. stop: function( gotoEnd ) {
  6067. var index = 0,
  6068. // If we are going to the end, we want to run all the tweens
  6069. // otherwise we skip this part
  6070. length = gotoEnd ? animation.tweens.length : 0;
  6071. if ( stopped ) {
  6072. return this;
  6073. }
  6074. stopped = true;
  6075. for ( ; index < length; index++ ) {
  6076. animation.tweens[ index ].run( 1 );
  6077. }
  6078. // Resolve when we played the last frame; otherwise, reject
  6079. if ( gotoEnd ) {
  6080. deferred.notifyWith( elem, [ animation, 1, 0 ] );
  6081. deferred.resolveWith( elem, [ animation, gotoEnd ] );
  6082. } else {
  6083. deferred.rejectWith( elem, [ animation, gotoEnd ] );
  6084. }
  6085. return this;
  6086. }
  6087. } ),
  6088. props = animation.props;
  6089. propFilter( props, animation.opts.specialEasing );
  6090. for ( ; index < length; index++ ) {
  6091. result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );
  6092. if ( result ) {
  6093. if ( isFunction( result.stop ) ) {
  6094. jQuery._queueHooks( animation.elem, animation.opts.queue ).stop =
  6095. result.stop.bind( result );
  6096. }
  6097. return result;
  6098. }
  6099. }
  6100. jQuery.map( props, createTween, animation );
  6101. if ( isFunction( animation.opts.start ) ) {
  6102. animation.opts.start.call( elem, animation );
  6103. }
  6104. // Attach callbacks from options
  6105. animation
  6106. .progress( animation.opts.progress )
  6107. .done( animation.opts.done, animation.opts.complete )
  6108. .fail( animation.opts.fail )
  6109. .always( animation.opts.always );
  6110. jQuery.fx.timer(
  6111. jQuery.extend( tick, {
  6112. elem: elem,
  6113. anim: animation,
  6114. queue: animation.opts.queue
  6115. } )
  6116. );
  6117. return animation;
  6118. }
  6119. jQuery.Animation = jQuery.extend( Animation, {
  6120. tweeners: {
  6121. "*": [ function( prop, value ) {
  6122. var tween = this.createTween( prop, value );
  6123. adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );
  6124. return tween;
  6125. } ]
  6126. },
  6127. tweener: function( props, callback ) {
  6128. if ( isFunction( props ) ) {
  6129. callback = props;
  6130. props = [ "*" ];
  6131. } else {
  6132. props = props.match( rnothtmlwhite );
  6133. }
  6134. var prop,
  6135. index = 0,
  6136. length = props.length;
  6137. for ( ; index < length; index++ ) {
  6138. prop = props[ index ];
  6139. Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];
  6140. Animation.tweeners[ prop ].unshift( callback );
  6141. }
  6142. },
  6143. prefilters: [ defaultPrefilter ],
  6144. prefilter: function( callback, prepend ) {
  6145. if ( prepend ) {
  6146. Animation.prefilters.unshift( callback );
  6147. } else {
  6148. Animation.prefilters.push( callback );
  6149. }
  6150. }
  6151. } );
  6152. jQuery.speed = function( speed, easing, fn ) {
  6153. var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
  6154. complete: fn || !fn && easing ||
  6155. isFunction( speed ) && speed,
  6156. duration: speed,
  6157. easing: fn && easing || easing && !isFunction( easing ) && easing
  6158. };
  6159. // Go to the end state if fx are off
  6160. if ( jQuery.fx.off ) {
  6161. opt.duration = 0;
  6162. } else {
  6163. if ( typeof opt.duration !== "number" ) {
  6164. if ( opt.duration in jQuery.fx.speeds ) {
  6165. opt.duration = jQuery.fx.speeds[ opt.duration ];
  6166. } else {
  6167. opt.duration = jQuery.fx.speeds._default;
  6168. }
  6169. }
  6170. }
  6171. // Normalize opt.queue - true/undefined/null -> "fx"
  6172. if ( opt.queue == null || opt.queue === true ) {
  6173. opt.queue = "fx";
  6174. }
  6175. // Queueing
  6176. opt.old = opt.complete;
  6177. opt.complete = function() {
  6178. if ( isFunction( opt.old ) ) {
  6179. opt.old.call( this );
  6180. }
  6181. if ( opt.queue ) {
  6182. jQuery.dequeue( this, opt.queue );
  6183. }
  6184. };
  6185. return opt;
  6186. };
  6187. jQuery.fn.extend( {
  6188. fadeTo: function( speed, to, easing, callback ) {
  6189. // Show any hidden elements after setting opacity to 0
  6190. return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show()
  6191. // Animate to the value specified
  6192. .end().animate( { opacity: to }, speed, easing, callback );
  6193. },
  6194. animate: function( prop, speed, easing, callback ) {
  6195. var empty = jQuery.isEmptyObject( prop ),
  6196. optall = jQuery.speed( speed, easing, callback ),
  6197. doAnimation = function() {
  6198. // Operate on a copy of prop so per-property easing won't be lost
  6199. var anim = Animation( this, jQuery.extend( {}, prop ), optall );
  6200. // Empty animations, or finishing resolves immediately
  6201. if ( empty || dataPriv.get( this, "finish" ) ) {
  6202. anim.stop( true );
  6203. }
  6204. };
  6205. doAnimation.finish = doAnimation;
  6206. return empty || optall.queue === false ?
  6207. this.each( doAnimation ) :
  6208. this.queue( optall.queue, doAnimation );
  6209. },
  6210. stop: function( type, clearQueue, gotoEnd ) {
  6211. var stopQueue = function( hooks ) {
  6212. var stop = hooks.stop;
  6213. delete hooks.stop;
  6214. stop( gotoEnd );
  6215. };
  6216. if ( typeof type !== "string" ) {
  6217. gotoEnd = clearQueue;
  6218. clearQueue = type;
  6219. type = undefined;
  6220. }
  6221. if ( clearQueue ) {
  6222. this.queue( type || "fx", [] );
  6223. }
  6224. return this.each( function() {
  6225. var dequeue = true,
  6226. index = type != null && type + "queueHooks",
  6227. timers = jQuery.timers,
  6228. data = dataPriv.get( this );
  6229. if ( index ) {
  6230. if ( data[ index ] && data[ index ].stop ) {
  6231. stopQueue( data[ index ] );
  6232. }
  6233. } else {
  6234. for ( index in data ) {
  6235. if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
  6236. stopQueue( data[ index ] );
  6237. }
  6238. }
  6239. }
  6240. for ( index = timers.length; index--; ) {
  6241. if ( timers[ index ].elem === this &&
  6242. ( type == null || timers[ index ].queue === type ) ) {
  6243. timers[ index ].anim.stop( gotoEnd );
  6244. dequeue = false;
  6245. timers.splice( index, 1 );
  6246. }
  6247. }
  6248. // Start the next in the queue if the last step wasn't forced.
  6249. // Timers currently will call their complete callbacks, which
  6250. // will dequeue but only if they were gotoEnd.
  6251. if ( dequeue || !gotoEnd ) {
  6252. jQuery.dequeue( this, type );
  6253. }
  6254. } );
  6255. },
  6256. finish: function( type ) {
  6257. if ( type !== false ) {
  6258. type = type || "fx";
  6259. }
  6260. return this.each( function() {
  6261. var index,
  6262. data = dataPriv.get( this ),
  6263. queue = data[ type + "queue" ],
  6264. hooks = data[ type + "queueHooks" ],
  6265. timers = jQuery.timers,
  6266. length = queue ? queue.length : 0;
  6267. // Enable finishing flag on private data
  6268. data.finish = true;
  6269. // Empty the queue first
  6270. jQuery.queue( this, type, [] );
  6271. if ( hooks && hooks.stop ) {
  6272. hooks.stop.call( this, true );
  6273. }
  6274. // Look for any active animations, and finish them
  6275. for ( index = timers.length; index--; ) {
  6276. if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
  6277. timers[ index ].anim.stop( true );
  6278. timers.splice( index, 1 );
  6279. }
  6280. }
  6281. // Look for any animations in the old queue and finish them
  6282. for ( index = 0; index < length; index++ ) {
  6283. if ( queue[ index ] && queue[ index ].finish ) {
  6284. queue[ index ].finish.call( this );
  6285. }
  6286. }
  6287. // Turn off finishing flag
  6288. delete data.finish;
  6289. } );
  6290. }
  6291. } );
  6292. jQuery.each( [ "toggle", "show", "hide" ], function( _i, name ) {
  6293. var cssFn = jQuery.fn[ name ];
  6294. jQuery.fn[ name ] = function( speed, easing, callback ) {
  6295. return speed == null || typeof speed === "boolean" ?
  6296. cssFn.apply( this, arguments ) :
  6297. this.animate( genFx( name, true ), speed, easing, callback );
  6298. };
  6299. } );
  6300. // Generate shortcuts for custom animations
  6301. jQuery.each( {
  6302. slideDown: genFx( "show" ),
  6303. slideUp: genFx( "hide" ),
  6304. slideToggle: genFx( "toggle" ),
  6305. fadeIn: { opacity: "show" },
  6306. fadeOut: { opacity: "hide" },
  6307. fadeToggle: { opacity: "toggle" }
  6308. }, function( name, props ) {
  6309. jQuery.fn[ name ] = function( speed, easing, callback ) {
  6310. return this.animate( props, speed, easing, callback );
  6311. };
  6312. } );
  6313. jQuery.timers = [];
  6314. jQuery.fx.tick = function() {
  6315. var timer,
  6316. i = 0,
  6317. timers = jQuery.timers;
  6318. fxNow = Date.now();
  6319. for ( ; i < timers.length; i++ ) {
  6320. timer = timers[ i ];
  6321. // Run the timer and safely remove it when done (allowing for external removal)
  6322. if ( !timer() && timers[ i ] === timer ) {
  6323. timers.splice( i--, 1 );
  6324. }
  6325. }
  6326. if ( !timers.length ) {
  6327. jQuery.fx.stop();
  6328. }
  6329. fxNow = undefined;
  6330. };
  6331. jQuery.fx.timer = function( timer ) {
  6332. jQuery.timers.push( timer );
  6333. jQuery.fx.start();
  6334. };
  6335. jQuery.fx.interval = 13;
  6336. jQuery.fx.start = function() {
  6337. if ( inProgress ) {
  6338. return;
  6339. }
  6340. inProgress = true;
  6341. schedule();
  6342. };
  6343. jQuery.fx.stop = function() {
  6344. inProgress = null;
  6345. };
  6346. jQuery.fx.speeds = {
  6347. slow: 600,
  6348. fast: 200,
  6349. // Default speed
  6350. _default: 400
  6351. };
  6352. // Based off of the plugin by Clint Helfers, with permission.
  6353. jQuery.fn.delay = function( time, type ) {
  6354. time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
  6355. type = type || "fx";
  6356. return this.queue( type, function( next, hooks ) {
  6357. var timeout = window.setTimeout( next, time );
  6358. hooks.stop = function() {
  6359. window.clearTimeout( timeout );
  6360. };
  6361. } );
  6362. };
  6363. ( function() {
  6364. var input = document.createElement( "input" ),
  6365. select = document.createElement( "select" ),
  6366. opt = select.appendChild( document.createElement( "option" ) );
  6367. input.type = "checkbox";
  6368. // Support: Android <=4.3 only
  6369. // Default value for a checkbox should be "on"
  6370. support.checkOn = input.value !== "";
  6371. // Support: IE <=11 only
  6372. // Must access selectedIndex to make default options select
  6373. support.optSelected = opt.selected;
  6374. // Support: IE <=11 only
  6375. // An input loses its value after becoming a radio
  6376. input = document.createElement( "input" );
  6377. input.value = "t";
  6378. input.type = "radio";
  6379. support.radioValue = input.value === "t";
  6380. } )();
  6381. var boolHook,
  6382. attrHandle = jQuery.expr.attrHandle;
  6383. jQuery.fn.extend( {
  6384. attr: function( name, value ) {
  6385. return access( this, jQuery.attr, name, value, arguments.length > 1 );
  6386. },
  6387. removeAttr: function( name ) {
  6388. return this.each( function() {
  6389. jQuery.removeAttr( this, name );
  6390. } );
  6391. }
  6392. } );
  6393. jQuery.extend( {
  6394. attr: function( elem, name, value ) {
  6395. var ret, hooks,
  6396. nType = elem.nodeType;
  6397. // Don't get/set attributes on text, comment and attribute nodes
  6398. if ( nType === 3 || nType === 8 || nType === 2 ) {
  6399. return;
  6400. }
  6401. // Fallback to prop when attributes are not supported
  6402. if ( typeof elem.getAttribute === "undefined" ) {
  6403. return jQuery.prop( elem, name, value );
  6404. }
  6405. // Attribute hooks are determined by the lowercase version
  6406. // Grab necessary hook if one is defined
  6407. if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
  6408. hooks = jQuery.attrHooks[ name.toLowerCase() ] ||
  6409. ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );
  6410. }
  6411. if ( value !== undefined ) {
  6412. if ( value === null ) {
  6413. jQuery.removeAttr( elem, name );
  6414. return;
  6415. }
  6416. if ( hooks && "set" in hooks &&
  6417. ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
  6418. return ret;
  6419. }
  6420. elem.setAttribute( name, value + "" );
  6421. return value;
  6422. }
  6423. if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
  6424. return ret;
  6425. }
  6426. ret = jQuery.find.attr( elem, name );
  6427. // Non-existent attributes return null, we normalize to undefined
  6428. return ret == null ? undefined : ret;
  6429. },
  6430. attrHooks: {
  6431. type: {
  6432. set: function( elem, value ) {
  6433. if ( !support.radioValue && value === "radio" &&
  6434. nodeName( elem, "input" ) ) {
  6435. var val = elem.value;
  6436. elem.setAttribute( "type", value );
  6437. if ( val ) {
  6438. elem.value = val;
  6439. }
  6440. return value;
  6441. }
  6442. }
  6443. }
  6444. },
  6445. removeAttr: function( elem, value ) {
  6446. var name,
  6447. i = 0,
  6448. // Attribute names can contain non-HTML whitespace characters
  6449. // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
  6450. attrNames = value && value.match( rnothtmlwhite );
  6451. if ( attrNames && elem.nodeType === 1 ) {
  6452. while ( ( name = attrNames[ i++ ] ) ) {
  6453. elem.removeAttribute( name );
  6454. }
  6455. }
  6456. }
  6457. } );
  6458. // Hooks for boolean attributes
  6459. boolHook = {
  6460. set: function( elem, value, name ) {
  6461. if ( value === false ) {
  6462. // Remove boolean attributes when set to false
  6463. jQuery.removeAttr( elem, name );
  6464. } else {
  6465. elem.setAttribute( name, name );
  6466. }
  6467. return name;
  6468. }
  6469. };
  6470. jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) {
  6471. var getter = attrHandle[ name ] || jQuery.find.attr;
  6472. attrHandle[ name ] = function( elem, name, isXML ) {
  6473. var ret, handle,
  6474. lowercaseName = name.toLowerCase();
  6475. if ( !isXML ) {
  6476. // Avoid an infinite loop by temporarily removing this function from the getter
  6477. handle = attrHandle[ lowercaseName ];
  6478. attrHandle[ lowercaseName ] = ret;
  6479. ret = getter( elem, name, isXML ) != null ?
  6480. lowercaseName :
  6481. null;
  6482. attrHandle[ lowercaseName ] = handle;
  6483. }
  6484. return ret;
  6485. };
  6486. } );
  6487. var rfocusable = /^(?:input|select|textarea|button)$/i,
  6488. rclickable = /^(?:a|area)$/i;
  6489. jQuery.fn.extend( {
  6490. prop: function( name, value ) {
  6491. return access( this, jQuery.prop, name, value, arguments.length > 1 );
  6492. },
  6493. removeProp: function( name ) {
  6494. return this.each( function() {
  6495. delete this[ jQuery.propFix[ name ] || name ];
  6496. } );
  6497. }
  6498. } );
  6499. jQuery.extend( {
  6500. prop: function( elem, name, value ) {
  6501. var ret, hooks,
  6502. nType = elem.nodeType;
  6503. // Don't get/set properties on text, comment and attribute nodes
  6504. if ( nType === 3 || nType === 8 || nType === 2 ) {
  6505. return;
  6506. }
  6507. if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
  6508. // Fix name and attach hooks
  6509. name = jQuery.propFix[ name ] || name;
  6510. hooks = jQuery.propHooks[ name ];
  6511. }
  6512. if ( value !== undefined ) {
  6513. if ( hooks && "set" in hooks &&
  6514. ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
  6515. return ret;
  6516. }
  6517. return ( elem[ name ] = value );
  6518. }
  6519. if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
  6520. return ret;
  6521. }
  6522. return elem[ name ];
  6523. },
  6524. propHooks: {
  6525. tabIndex: {
  6526. get: function( elem ) {
  6527. // Support: IE <=9 - 11 only
  6528. // elem.tabIndex doesn't always return the
  6529. // correct value when it hasn't been explicitly set
  6530. // Use proper attribute retrieval (trac-12072)
  6531. var tabindex = jQuery.find.attr( elem, "tabindex" );
  6532. if ( tabindex ) {
  6533. return parseInt( tabindex, 10 );
  6534. }
  6535. if (
  6536. rfocusable.test( elem.nodeName ) ||
  6537. rclickable.test( elem.nodeName ) &&
  6538. elem.href
  6539. ) {
  6540. return 0;
  6541. }
  6542. return -1;
  6543. }
  6544. }
  6545. },
  6546. propFix: {
  6547. "for": "htmlFor",
  6548. "class": "className"
  6549. }
  6550. } );
  6551. // Support: IE <=11 only
  6552. // Accessing the selectedIndex property
  6553. // forces the browser to respect setting selected
  6554. // on the option
  6555. // The getter ensures a default option is selected
  6556. // when in an optgroup
  6557. // eslint rule "no-unused-expressions" is disabled for this code
  6558. // since it considers such accessions noop
  6559. if ( !support.optSelected ) {
  6560. jQuery.propHooks.selected = {
  6561. get: function( elem ) {
  6562. /* eslint no-unused-expressions: "off" */
  6563. var parent = elem.parentNode;
  6564. if ( parent && parent.parentNode ) {
  6565. parent.parentNode.selectedIndex;
  6566. }
  6567. return null;
  6568. },
  6569. set: function( elem ) {
  6570. /* eslint no-unused-expressions: "off" */
  6571. var parent = elem.parentNode;
  6572. if ( parent ) {
  6573. parent.selectedIndex;
  6574. if ( parent.parentNode ) {
  6575. parent.parentNode.selectedIndex;
  6576. }
  6577. }
  6578. }
  6579. };
  6580. }
  6581. jQuery.each( [
  6582. "tabIndex",
  6583. "readOnly",
  6584. "maxLength",
  6585. "cellSpacing",
  6586. "cellPadding",
  6587. "rowSpan",
  6588. "colSpan",
  6589. "useMap",
  6590. "frameBorder",
  6591. "contentEditable"
  6592. ], function() {
  6593. jQuery.propFix[ this.toLowerCase() ] = this;
  6594. } );
  6595. // Strip and collapse whitespace according to HTML spec
  6596. // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace
  6597. function stripAndCollapse( value ) {
  6598. var tokens = value.match( rnothtmlwhite ) || [];
  6599. return tokens.join( " " );
  6600. }
  6601. function getClass( elem ) {
  6602. return elem.getAttribute && elem.getAttribute( "class" ) || "";
  6603. }
  6604. function classesToArray( value ) {
  6605. if ( Array.isArray( value ) ) {
  6606. return value;
  6607. }
  6608. if ( typeof value === "string" ) {
  6609. return value.match( rnothtmlwhite ) || [];
  6610. }
  6611. return [];
  6612. }
  6613. jQuery.fn.extend( {
  6614. addClass: function( value ) {
  6615. var classNames, cur, curValue, className, i, finalValue;
  6616. if ( isFunction( value ) ) {
  6617. return this.each( function( j ) {
  6618. jQuery( this ).addClass( value.call( this, j, getClass( this ) ) );
  6619. } );
  6620. }
  6621. classNames = classesToArray( value );
  6622. if ( classNames.length ) {
  6623. return this.each( function() {
  6624. curValue = getClass( this );
  6625. cur = this.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
  6626. if ( cur ) {
  6627. for ( i = 0; i < classNames.length; i++ ) {
  6628. className = classNames[ i ];
  6629. if ( cur.indexOf( " " + className + " " ) < 0 ) {
  6630. cur += className + " ";
  6631. }
  6632. }
  6633. // Only assign if different to avoid unneeded rendering.
  6634. finalValue = stripAndCollapse( cur );
  6635. if ( curValue !== finalValue ) {
  6636. this.setAttribute( "class", finalValue );
  6637. }
  6638. }
  6639. } );
  6640. }
  6641. return this;
  6642. },
  6643. removeClass: function( value ) {
  6644. var classNames, cur, curValue, className, i, finalValue;
  6645. if ( isFunction( value ) ) {
  6646. return this.each( function( j ) {
  6647. jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );
  6648. } );
  6649. }
  6650. if ( !arguments.length ) {
  6651. return this.attr( "class", "" );
  6652. }
  6653. classNames = classesToArray( value );
  6654. if ( classNames.length ) {
  6655. return this.each( function() {
  6656. curValue = getClass( this );
  6657. // This expression is here for better compressibility (see addClass)
  6658. cur = this.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
  6659. if ( cur ) {
  6660. for ( i = 0; i < classNames.length; i++ ) {
  6661. className = classNames[ i ];
  6662. // Remove *all* instances
  6663. while ( cur.indexOf( " " + className + " " ) > -1 ) {
  6664. cur = cur.replace( " " + className + " ", " " );
  6665. }
  6666. }
  6667. // Only assign if different to avoid unneeded rendering.
  6668. finalValue = stripAndCollapse( cur );
  6669. if ( curValue !== finalValue ) {
  6670. this.setAttribute( "class", finalValue );
  6671. }
  6672. }
  6673. } );
  6674. }
  6675. return this;
  6676. },
  6677. toggleClass: function( value, stateVal ) {
  6678. var classNames, className, i, self,
  6679. type = typeof value,
  6680. isValidValue = type === "string" || Array.isArray( value );
  6681. if ( isFunction( value ) ) {
  6682. return this.each( function( i ) {
  6683. jQuery( this ).toggleClass(
  6684. value.call( this, i, getClass( this ), stateVal ),
  6685. stateVal
  6686. );
  6687. } );
  6688. }
  6689. if ( typeof stateVal === "boolean" && isValidValue ) {
  6690. return stateVal ? this.addClass( value ) : this.removeClass( value );
  6691. }
  6692. classNames = classesToArray( value );
  6693. return this.each( function() {
  6694. if ( isValidValue ) {
  6695. // Toggle individual class names
  6696. self = jQuery( this );
  6697. for ( i = 0; i < classNames.length; i++ ) {
  6698. className = classNames[ i ];
  6699. // Check each className given, space separated list
  6700. if ( self.hasClass( className ) ) {
  6701. self.removeClass( className );
  6702. } else {
  6703. self.addClass( className );
  6704. }
  6705. }
  6706. // Toggle whole class name
  6707. } else if ( value === undefined || type === "boolean" ) {
  6708. className = getClass( this );
  6709. if ( className ) {
  6710. // Store className if set
  6711. dataPriv.set( this, "__className__", className );
  6712. }
  6713. // If the element has a class name or if we're passed `false`,
  6714. // then remove the whole classname (if there was one, the above saved it).
  6715. // Otherwise bring back whatever was previously saved (if anything),
  6716. // falling back to the empty string if nothing was stored.
  6717. if ( this.setAttribute ) {
  6718. this.setAttribute( "class",
  6719. className || value === false ?
  6720. "" :
  6721. dataPriv.get( this, "__className__" ) || ""
  6722. );
  6723. }
  6724. }
  6725. } );
  6726. },
  6727. hasClass: function( selector ) {
  6728. var className, elem,
  6729. i = 0;
  6730. className = " " + selector + " ";
  6731. while ( ( elem = this[ i++ ] ) ) {
  6732. if ( elem.nodeType === 1 &&
  6733. ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) {
  6734. return true;
  6735. }
  6736. }
  6737. return false;
  6738. }
  6739. } );
  6740. var rreturn = /\r/g;
  6741. jQuery.fn.extend( {
  6742. val: function( value ) {
  6743. var hooks, ret, valueIsFunction,
  6744. elem = this[ 0 ];
  6745. if ( !arguments.length ) {
  6746. if ( elem ) {
  6747. hooks = jQuery.valHooks[ elem.type ] ||
  6748. jQuery.valHooks[ elem.nodeName.toLowerCase() ];
  6749. if ( hooks &&
  6750. "get" in hooks &&
  6751. ( ret = hooks.get( elem, "value" ) ) !== undefined
  6752. ) {
  6753. return ret;
  6754. }
  6755. ret = elem.value;
  6756. // Handle most common string cases
  6757. if ( typeof ret === "string" ) {
  6758. return ret.replace( rreturn, "" );
  6759. }
  6760. // Handle cases where value is null/undef or number
  6761. return ret == null ? "" : ret;
  6762. }
  6763. return;
  6764. }
  6765. valueIsFunction = isFunction( value );
  6766. return this.each( function( i ) {
  6767. var val;
  6768. if ( this.nodeType !== 1 ) {
  6769. return;
  6770. }
  6771. if ( valueIsFunction ) {
  6772. val = value.call( this, i, jQuery( this ).val() );
  6773. } else {
  6774. val = value;
  6775. }
  6776. // Treat null/undefined as ""; convert numbers to string
  6777. if ( val == null ) {
  6778. val = "";
  6779. } else if ( typeof val === "number" ) {
  6780. val += "";
  6781. } else if ( Array.isArray( val ) ) {
  6782. val = jQuery.map( val, function( value ) {
  6783. return value == null ? "" : value + "";
  6784. } );
  6785. }
  6786. hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
  6787. // If set returns undefined, fall back to normal setting
  6788. if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) {
  6789. this.value = val;
  6790. }
  6791. } );
  6792. }
  6793. } );
  6794. jQuery.extend( {
  6795. valHooks: {
  6796. option: {
  6797. get: function( elem ) {
  6798. var val = jQuery.find.attr( elem, "value" );
  6799. return val != null ?
  6800. val :
  6801. // Support: IE <=10 - 11 only
  6802. // option.text throws exceptions (trac-14686, trac-14858)
  6803. // Strip and collapse whitespace
  6804. // https://html.spec.whatwg.org/#strip-and-collapse-whitespace
  6805. stripAndCollapse( jQuery.text( elem ) );
  6806. }
  6807. },
  6808. select: {
  6809. get: function( elem ) {
  6810. var value, option, i,
  6811. options = elem.options,
  6812. index = elem.selectedIndex,
  6813. one = elem.type === "select-one",
  6814. values = one ? null : [],
  6815. max = one ? index + 1 : options.length;
  6816. if ( index < 0 ) {
  6817. i = max;
  6818. } else {
  6819. i = one ? index : 0;
  6820. }
  6821. // Loop through all the selected options
  6822. for ( ; i < max; i++ ) {
  6823. option = options[ i ];
  6824. // Support: IE <=9 only
  6825. // IE8-9 doesn't update selected after form reset (trac-2551)
  6826. if ( ( option.selected || i === index ) &&
  6827. // Don't return options that are disabled or in a disabled optgroup
  6828. !option.disabled &&
  6829. ( !option.parentNode.disabled ||
  6830. !nodeName( option.parentNode, "optgroup" ) ) ) {
  6831. // Get the specific value for the option
  6832. value = jQuery( option ).val();
  6833. // We don't need an array for one selects
  6834. if ( one ) {
  6835. return value;
  6836. }
  6837. // Multi-Selects return an array
  6838. values.push( value );
  6839. }
  6840. }
  6841. return values;
  6842. },
  6843. set: function( elem, value ) {
  6844. var optionSet, option,
  6845. options = elem.options,
  6846. values = jQuery.makeArray( value ),
  6847. i = options.length;
  6848. while ( i-- ) {
  6849. option = options[ i ];
  6850. /* eslint-disable no-cond-assign */
  6851. if ( option.selected =
  6852. jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1
  6853. ) {
  6854. optionSet = true;
  6855. }
  6856. /* eslint-enable no-cond-assign */
  6857. }
  6858. // Force browsers to behave consistently when non-matching value is set
  6859. if ( !optionSet ) {
  6860. elem.selectedIndex = -1;
  6861. }
  6862. return values;
  6863. }
  6864. }
  6865. }
  6866. } );
  6867. // Radios and checkboxes getter/setter
  6868. jQuery.each( [ "radio", "checkbox" ], function() {
  6869. jQuery.valHooks[ this ] = {
  6870. set: function( elem, value ) {
  6871. if ( Array.isArray( value ) ) {
  6872. return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );
  6873. }
  6874. }
  6875. };
  6876. if ( !support.checkOn ) {
  6877. jQuery.valHooks[ this ].get = function( elem ) {
  6878. return elem.getAttribute( "value" ) === null ? "on" : elem.value;
  6879. };
  6880. }
  6881. } );
  6882. // Return jQuery for attributes-only inclusion
  6883. var location = window.location;
  6884. var nonce = { guid: Date.now() };
  6885. var rquery = ( /\?/ );
  6886. // Cross-browser xml parsing
  6887. jQuery.parseXML = function( data ) {
  6888. var xml, parserErrorElem;
  6889. if ( !data || typeof data !== "string" ) {
  6890. return null;
  6891. }
  6892. // Support: IE 9 - 11 only
  6893. // IE throws on parseFromString with invalid input.
  6894. try {
  6895. xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
  6896. } catch ( e ) {}
  6897. parserErrorElem = xml && xml.getElementsByTagName( "parsererror" )[ 0 ];
  6898. if ( !xml || parserErrorElem ) {
  6899. jQuery.error( "Invalid XML: " + (
  6900. parserErrorElem ?
  6901. jQuery.map( parserErrorElem.childNodes, function( el ) {
  6902. return el.textContent;
  6903. } ).join( "\n" ) :
  6904. data
  6905. ) );
  6906. }
  6907. return xml;
  6908. };
  6909. var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
  6910. stopPropagationCallback = function( e ) {
  6911. e.stopPropagation();
  6912. };
  6913. jQuery.extend( jQuery.event, {
  6914. trigger: function( event, data, elem, onlyHandlers ) {
  6915. var i, cur, tmp, bubbleType, ontype, handle, special, lastElement,
  6916. eventPath = [ elem || document ],
  6917. type = hasOwn.call( event, "type" ) ? event.type : event,
  6918. namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : [];
  6919. cur = lastElement = tmp = elem = elem || document;
  6920. // Don't do events on text and comment nodes
  6921. if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
  6922. return;
  6923. }
  6924. // focus/blur morphs to focusin/out; ensure we're not firing them right now
  6925. if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
  6926. return;
  6927. }
  6928. if ( type.indexOf( "." ) > -1 ) {
  6929. // Namespaced trigger; create a regexp to match event type in handle()
  6930. namespaces = type.split( "." );
  6931. type = namespaces.shift();
  6932. namespaces.sort();
  6933. }
  6934. ontype = type.indexOf( ":" ) < 0 && "on" + type;
  6935. // Caller can pass in a jQuery.Event object, Object, or just an event type string
  6936. event = event[ jQuery.expando ] ?
  6937. event :
  6938. new jQuery.Event( type, typeof event === "object" && event );
  6939. // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
  6940. event.isTrigger = onlyHandlers ? 2 : 3;
  6941. event.namespace = namespaces.join( "." );
  6942. event.rnamespace = event.namespace ?
  6943. new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) :
  6944. null;
  6945. // Clean up the event in case it is being reused
  6946. event.result = undefined;
  6947. if ( !event.target ) {
  6948. event.target = elem;
  6949. }
  6950. // Clone any incoming data and prepend the event, creating the handler arg list
  6951. data = data == null ?
  6952. [ event ] :
  6953. jQuery.makeArray( data, [ event ] );
  6954. // Allow special events to draw outside the lines
  6955. special = jQuery.event.special[ type ] || {};
  6956. if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
  6957. return;
  6958. }
  6959. // Determine event propagation path in advance, per W3C events spec (trac-9951)
  6960. // Bubble up to document, then to window; watch for a global ownerDocument var (trac-9724)
  6961. if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) {
  6962. bubbleType = special.delegateType || type;
  6963. if ( !rfocusMorph.test( bubbleType + type ) ) {
  6964. cur = cur.parentNode;
  6965. }
  6966. for ( ; cur; cur = cur.parentNode ) {
  6967. eventPath.push( cur );
  6968. tmp = cur;
  6969. }
  6970. // Only add window if we got to document (e.g., not plain obj or detached DOM)
  6971. if ( tmp === ( elem.ownerDocument || document ) ) {
  6972. eventPath.push( tmp.defaultView || tmp.parentWindow || window );
  6973. }
  6974. }
  6975. // Fire handlers on the event path
  6976. i = 0;
  6977. while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {
  6978. lastElement = cur;
  6979. event.type = i > 1 ?
  6980. bubbleType :
  6981. special.bindType || type;
  6982. // jQuery handler
  6983. handle = ( dataPriv.get( cur, "events" ) || Object.create( null ) )[ event.type ] &&
  6984. dataPriv.get( cur, "handle" );
  6985. if ( handle ) {
  6986. handle.apply( cur, data );
  6987. }
  6988. // Native handler
  6989. handle = ontype && cur[ ontype ];
  6990. if ( handle && handle.apply && acceptData( cur ) ) {
  6991. event.result = handle.apply( cur, data );
  6992. if ( event.result === false ) {
  6993. event.preventDefault();
  6994. }
  6995. }
  6996. }
  6997. event.type = type;
  6998. // If nobody prevented the default action, do it now
  6999. if ( !onlyHandlers && !event.isDefaultPrevented() ) {
  7000. if ( ( !special._default ||
  7001. special._default.apply( eventPath.pop(), data ) === false ) &&
  7002. acceptData( elem ) ) {
  7003. // Call a native DOM method on the target with the same name as the event.
  7004. // Don't do default actions on window, that's where global variables be (trac-6170)
  7005. if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) {
  7006. // Don't re-trigger an onFOO event when we call its FOO() method
  7007. tmp = elem[ ontype ];
  7008. if ( tmp ) {
  7009. elem[ ontype ] = null;
  7010. }
  7011. // Prevent re-triggering of the same event, since we already bubbled it above
  7012. jQuery.event.triggered = type;
  7013. if ( event.isPropagationStopped() ) {
  7014. lastElement.addEventListener( type, stopPropagationCallback );
  7015. }
  7016. elem[ type ]();
  7017. if ( event.isPropagationStopped() ) {
  7018. lastElement.removeEventListener( type, stopPropagationCallback );
  7019. }
  7020. jQuery.event.triggered = undefined;
  7021. if ( tmp ) {
  7022. elem[ ontype ] = tmp;
  7023. }
  7024. }
  7025. }
  7026. }
  7027. return event.result;
  7028. },
  7029. // Piggyback on a donor event to simulate a different one
  7030. // Used only for `focus(in | out)` events
  7031. simulate: function( type, elem, event ) {
  7032. var e = jQuery.extend(
  7033. new jQuery.Event(),
  7034. event,
  7035. {
  7036. type: type,
  7037. isSimulated: true
  7038. }
  7039. );
  7040. jQuery.event.trigger( e, null, elem );
  7041. }
  7042. } );
  7043. jQuery.fn.extend( {
  7044. trigger: function( type, data ) {
  7045. return this.each( function() {
  7046. jQuery.event.trigger( type, data, this );
  7047. } );
  7048. },
  7049. triggerHandler: function( type, data ) {
  7050. var elem = this[ 0 ];
  7051. if ( elem ) {
  7052. return jQuery.event.trigger( type, data, elem, true );
  7053. }
  7054. }
  7055. } );
  7056. var
  7057. rbracket = /\[\]$/,
  7058. rCRLF = /\r?\n/g,
  7059. rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
  7060. rsubmittable = /^(?:input|select|textarea|keygen)/i;
  7061. function buildParams( prefix, obj, traditional, add ) {
  7062. var name;
  7063. if ( Array.isArray( obj ) ) {
  7064. // Serialize array item.
  7065. jQuery.each( obj, function( i, v ) {
  7066. if ( traditional || rbracket.test( prefix ) ) {
  7067. // Treat each array item as a scalar.
  7068. add( prefix, v );
  7069. } else {
  7070. // Item is non-scalar (array or object), encode its numeric index.
  7071. buildParams(
  7072. prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]",
  7073. v,
  7074. traditional,
  7075. add
  7076. );
  7077. }
  7078. } );
  7079. } else if ( !traditional && toType( obj ) === "object" ) {
  7080. // Serialize object item.
  7081. for ( name in obj ) {
  7082. buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
  7083. }
  7084. } else {
  7085. // Serialize scalar item.
  7086. add( prefix, obj );
  7087. }
  7088. }
  7089. // Serialize an array of form elements or a set of
  7090. // key/values into a query string
  7091. jQuery.param = function( a, traditional ) {
  7092. var prefix,
  7093. s = [],
  7094. add = function( key, valueOrFunction ) {
  7095. // If value is a function, invoke it and use its return value
  7096. var value = isFunction( valueOrFunction ) ?
  7097. valueOrFunction() :
  7098. valueOrFunction;
  7099. s[ s.length ] = encodeURIComponent( key ) + "=" +
  7100. encodeURIComponent( value == null ? "" : value );
  7101. };
  7102. if ( a == null ) {
  7103. return "";
  7104. }
  7105. // If an array was passed in, assume that it is an array of form elements.
  7106. if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
  7107. // Serialize the form elements
  7108. jQuery.each( a, function() {
  7109. add( this.name, this.value );
  7110. } );
  7111. } else {
  7112. // If traditional, encode the "old" way (the way 1.3.2 or older
  7113. // did it), otherwise encode params recursively.
  7114. for ( prefix in a ) {
  7115. buildParams( prefix, a[ prefix ], traditional, add );
  7116. }
  7117. }
  7118. // Return the resulting serialization
  7119. return s.join( "&" );
  7120. };
  7121. jQuery.fn.extend( {
  7122. serialize: function() {
  7123. return jQuery.param( this.serializeArray() );
  7124. },
  7125. serializeArray: function() {
  7126. return this.map( function() {
  7127. // Can add propHook for "elements" to filter or add form elements
  7128. var elements = jQuery.prop( this, "elements" );
  7129. return elements ? jQuery.makeArray( elements ) : this;
  7130. } ).filter( function() {
  7131. var type = this.type;
  7132. // Use .is( ":disabled" ) so that fieldset[disabled] works
  7133. return this.name && !jQuery( this ).is( ":disabled" ) &&
  7134. rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
  7135. ( this.checked || !rcheckableType.test( type ) );
  7136. } ).map( function( _i, elem ) {
  7137. var val = jQuery( this ).val();
  7138. if ( val == null ) {
  7139. return null;
  7140. }
  7141. if ( Array.isArray( val ) ) {
  7142. return jQuery.map( val, function( val ) {
  7143. return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  7144. } );
  7145. }
  7146. return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  7147. } ).get();
  7148. }
  7149. } );
  7150. var
  7151. r20 = /%20/g,
  7152. rhash = /#.*$/,
  7153. rantiCache = /([?&])_=[^&]*/,
  7154. rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
  7155. // trac-7653, trac-8125, trac-8152: local protocol detection
  7156. rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
  7157. rnoContent = /^(?:GET|HEAD)$/,
  7158. rprotocol = /^\/\//,
  7159. /* Prefilters
  7160. * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
  7161. * 2) These are called:
  7162. * - BEFORE asking for a transport
  7163. * - AFTER param serialization (s.data is a string if s.processData is true)
  7164. * 3) key is the dataType
  7165. * 4) the catchall symbol "*" can be used
  7166. * 5) execution will start with transport dataType and THEN continue down to "*" if needed
  7167. */
  7168. prefilters = {},
  7169. /* Transports bindings
  7170. * 1) key is the dataType
  7171. * 2) the catchall symbol "*" can be used
  7172. * 3) selection will start with transport dataType and THEN go to "*" if needed
  7173. */
  7174. transports = {},
  7175. // Avoid comment-prolog char sequence (trac-10098); must appease lint and evade compression
  7176. allTypes = "*/".concat( "*" ),
  7177. // Anchor tag for parsing the document origin
  7178. originAnchor = document.createElement( "a" );
  7179. originAnchor.href = location.href;
  7180. // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
  7181. function addToPrefiltersOrTransports( structure ) {
  7182. // dataTypeExpression is optional and defaults to "*"
  7183. return function( dataTypeExpression, func ) {
  7184. if ( typeof dataTypeExpression !== "string" ) {
  7185. func = dataTypeExpression;
  7186. dataTypeExpression = "*";
  7187. }
  7188. var dataType,
  7189. i = 0,
  7190. dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || [];
  7191. if ( isFunction( func ) ) {
  7192. // For each dataType in the dataTypeExpression
  7193. while ( ( dataType = dataTypes[ i++ ] ) ) {
  7194. // Prepend if requested
  7195. if ( dataType[ 0 ] === "+" ) {
  7196. dataType = dataType.slice( 1 ) || "*";
  7197. ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );
  7198. // Otherwise append
  7199. } else {
  7200. ( structure[ dataType ] = structure[ dataType ] || [] ).push( func );
  7201. }
  7202. }
  7203. }
  7204. };
  7205. }
  7206. // Base inspection function for prefilters and transports
  7207. function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
  7208. var inspected = {},
  7209. seekingTransport = ( structure === transports );
  7210. function inspect( dataType ) {
  7211. var selected;
  7212. inspected[ dataType ] = true;
  7213. jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
  7214. var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
  7215. if ( typeof dataTypeOrTransport === "string" &&
  7216. !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
  7217. options.dataTypes.unshift( dataTypeOrTransport );
  7218. inspect( dataTypeOrTransport );
  7219. return false;
  7220. } else if ( seekingTransport ) {
  7221. return !( selected = dataTypeOrTransport );
  7222. }
  7223. } );
  7224. return selected;
  7225. }
  7226. return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
  7227. }
  7228. // A special extend for ajax options
  7229. // that takes "flat" options (not to be deep extended)
  7230. // Fixes trac-9887
  7231. function ajaxExtend( target, src ) {
  7232. var key, deep,
  7233. flatOptions = jQuery.ajaxSettings.flatOptions || {};
  7234. for ( key in src ) {
  7235. if ( src[ key ] !== undefined ) {
  7236. ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
  7237. }
  7238. }
  7239. if ( deep ) {
  7240. jQuery.extend( true, target, deep );
  7241. }
  7242. return target;
  7243. }
  7244. /* Handles responses to an ajax request:
  7245. * - finds the right dataType (mediates between content-type and expected dataType)
  7246. * - returns the corresponding response
  7247. */
  7248. function ajaxHandleResponses( s, jqXHR, responses ) {
  7249. var ct, type, finalDataType, firstDataType,
  7250. contents = s.contents,
  7251. dataTypes = s.dataTypes;
  7252. // Remove auto dataType and get content-type in the process
  7253. while ( dataTypes[ 0 ] === "*" ) {
  7254. dataTypes.shift();
  7255. if ( ct === undefined ) {
  7256. ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" );
  7257. }
  7258. }
  7259. // Check if we're dealing with a known content-type
  7260. if ( ct ) {
  7261. for ( type in contents ) {
  7262. if ( contents[ type ] && contents[ type ].test( ct ) ) {
  7263. dataTypes.unshift( type );
  7264. break;
  7265. }
  7266. }
  7267. }
  7268. // Check to see if we have a response for the expected dataType
  7269. if ( dataTypes[ 0 ] in responses ) {
  7270. finalDataType = dataTypes[ 0 ];
  7271. } else {
  7272. // Try convertible dataTypes
  7273. for ( type in responses ) {
  7274. if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) {
  7275. finalDataType = type;
  7276. break;
  7277. }
  7278. if ( !firstDataType ) {
  7279. firstDataType = type;
  7280. }
  7281. }
  7282. // Or just use first one
  7283. finalDataType = finalDataType || firstDataType;
  7284. }
  7285. // If we found a dataType
  7286. // We add the dataType to the list if needed
  7287. // and return the corresponding response
  7288. if ( finalDataType ) {
  7289. if ( finalDataType !== dataTypes[ 0 ] ) {
  7290. dataTypes.unshift( finalDataType );
  7291. }
  7292. return responses[ finalDataType ];
  7293. }
  7294. }
  7295. /* Chain conversions given the request and the original response
  7296. * Also sets the responseXXX fields on the jqXHR instance
  7297. */
  7298. function ajaxConvert( s, response, jqXHR, isSuccess ) {
  7299. var conv2, current, conv, tmp, prev,
  7300. converters = {},
  7301. // Work with a copy of dataTypes in case we need to modify it for conversion
  7302. dataTypes = s.dataTypes.slice();
  7303. // Create converters map with lowercased keys
  7304. if ( dataTypes[ 1 ] ) {
  7305. for ( conv in s.converters ) {
  7306. converters[ conv.toLowerCase() ] = s.converters[ conv ];
  7307. }
  7308. }
  7309. current = dataTypes.shift();
  7310. // Convert to each sequential dataType
  7311. while ( current ) {
  7312. if ( s.responseFields[ current ] ) {
  7313. jqXHR[ s.responseFields[ current ] ] = response;
  7314. }
  7315. // Apply the dataFilter if provided
  7316. if ( !prev && isSuccess && s.dataFilter ) {
  7317. response = s.dataFilter( response, s.dataType );
  7318. }
  7319. prev = current;
  7320. current = dataTypes.shift();
  7321. if ( current ) {
  7322. // There's only work to do if current dataType is non-auto
  7323. if ( current === "*" ) {
  7324. current = prev;
  7325. // Convert response if prev dataType is non-auto and differs from current
  7326. } else if ( prev !== "*" && prev !== current ) {
  7327. // Seek a direct converter
  7328. conv = converters[ prev + " " + current ] || converters[ "* " + current ];
  7329. // If none found, seek a pair
  7330. if ( !conv ) {
  7331. for ( conv2 in converters ) {
  7332. // If conv2 outputs current
  7333. tmp = conv2.split( " " );
  7334. if ( tmp[ 1 ] === current ) {
  7335. // If prev can be converted to accepted input
  7336. conv = converters[ prev + " " + tmp[ 0 ] ] ||
  7337. converters[ "* " + tmp[ 0 ] ];
  7338. if ( conv ) {
  7339. // Condense equivalence converters
  7340. if ( conv === true ) {
  7341. conv = converters[ conv2 ];
  7342. // Otherwise, insert the intermediate dataType
  7343. } else if ( converters[ conv2 ] !== true ) {
  7344. current = tmp[ 0 ];
  7345. dataTypes.unshift( tmp[ 1 ] );
  7346. }
  7347. break;
  7348. }
  7349. }
  7350. }
  7351. }
  7352. // Apply converter (if not an equivalence)
  7353. if ( conv !== true ) {
  7354. // Unless errors are allowed to bubble, catch and return them
  7355. if ( conv && s.throws ) {
  7356. response = conv( response );
  7357. } else {
  7358. try {
  7359. response = conv( response );
  7360. } catch ( e ) {
  7361. return {
  7362. state: "parsererror",
  7363. error: conv ? e : "No conversion from " + prev + " to " + current
  7364. };
  7365. }
  7366. }
  7367. }
  7368. }
  7369. }
  7370. }
  7371. return { state: "success", data: response };
  7372. }
  7373. jQuery.extend( {
  7374. // Counter for holding the number of active queries
  7375. active: 0,
  7376. // Last-Modified header cache for next request
  7377. lastModified: {},
  7378. etag: {},
  7379. ajaxSettings: {
  7380. url: location.href,
  7381. type: "GET",
  7382. isLocal: rlocalProtocol.test( location.protocol ),
  7383. global: true,
  7384. processData: true,
  7385. async: true,
  7386. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  7387. /*
  7388. timeout: 0,
  7389. data: null,
  7390. dataType: null,
  7391. username: null,
  7392. password: null,
  7393. cache: null,
  7394. throws: false,
  7395. traditional: false,
  7396. headers: {},
  7397. */
  7398. accepts: {
  7399. "*": allTypes,
  7400. text: "text/plain",
  7401. html: "text/html",
  7402. xml: "application/xml, text/xml",
  7403. json: "application/json, text/javascript"
  7404. },
  7405. contents: {
  7406. xml: /\bxml\b/,
  7407. html: /\bhtml/,
  7408. json: /\bjson\b/
  7409. },
  7410. responseFields: {
  7411. xml: "responseXML",
  7412. text: "responseText",
  7413. json: "responseJSON"
  7414. },
  7415. // Data converters
  7416. // Keys separate source (or catchall "*") and destination types with a single space
  7417. converters: {
  7418. // Convert anything to text
  7419. "* text": String,
  7420. // Text to html (true = no transformation)
  7421. "text html": true,
  7422. // Evaluate text as a json expression
  7423. "text json": JSON.parse,
  7424. // Parse text as xml
  7425. "text xml": jQuery.parseXML
  7426. },
  7427. // For options that shouldn't be deep extended:
  7428. // you can add your own custom options here if
  7429. // and when you create one that shouldn't be
  7430. // deep extended (see ajaxExtend)
  7431. flatOptions: {
  7432. url: true,
  7433. context: true
  7434. }
  7435. },
  7436. // Creates a full fledged settings object into target
  7437. // with both ajaxSettings and settings fields.
  7438. // If target is omitted, writes into ajaxSettings.
  7439. ajaxSetup: function( target, settings ) {
  7440. return settings ?
  7441. // Building a settings object
  7442. ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
  7443. // Extending ajaxSettings
  7444. ajaxExtend( jQuery.ajaxSettings, target );
  7445. },
  7446. ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
  7447. ajaxTransport: addToPrefiltersOrTransports( transports ),
  7448. // Main method
  7449. ajax: function( url, options ) {
  7450. // If url is an object, simulate pre-1.5 signature
  7451. if ( typeof url === "object" ) {
  7452. options = url;
  7453. url = undefined;
  7454. }
  7455. // Force options to be an object
  7456. options = options || {};
  7457. var transport,
  7458. // URL without anti-cache param
  7459. cacheURL,
  7460. // Response headers
  7461. responseHeadersString,
  7462. responseHeaders,
  7463. // timeout handle
  7464. timeoutTimer,
  7465. // Url cleanup var
  7466. urlAnchor,
  7467. // Request state (becomes false upon send and true upon completion)
  7468. completed,
  7469. // To know if global events are to be dispatched
  7470. fireGlobals,
  7471. // Loop variable
  7472. i,
  7473. // uncached part of the url
  7474. uncached,
  7475. // Create the final options object
  7476. s = jQuery.ajaxSetup( {}, options ),
  7477. // Callbacks context
  7478. callbackContext = s.context || s,
  7479. // Context for global events is callbackContext if it is a DOM node or jQuery collection
  7480. globalEventContext = s.context &&
  7481. ( callbackContext.nodeType || callbackContext.jquery ) ?
  7482. jQuery( callbackContext ) :
  7483. jQuery.event,
  7484. // Deferreds
  7485. deferred = jQuery.Deferred(),
  7486. completeDeferred = jQuery.Callbacks( "once memory" ),
  7487. // Status-dependent callbacks
  7488. statusCode = s.statusCode || {},
  7489. // Headers (they are sent all at once)
  7490. requestHeaders = {},
  7491. requestHeadersNames = {},
  7492. // Default abort message
  7493. strAbort = "canceled",
  7494. // Fake xhr
  7495. jqXHR = {
  7496. readyState: 0,
  7497. // Builds headers hashtable if needed
  7498. getResponseHeader: function( key ) {
  7499. var match;
  7500. if ( completed ) {
  7501. if ( !responseHeaders ) {
  7502. responseHeaders = {};
  7503. while ( ( match = rheaders.exec( responseHeadersString ) ) ) {
  7504. responseHeaders[ match[ 1 ].toLowerCase() + " " ] =
  7505. ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] )
  7506. .concat( match[ 2 ] );
  7507. }
  7508. }
  7509. match = responseHeaders[ key.toLowerCase() + " " ];
  7510. }
  7511. return match == null ? null : match.join( ", " );
  7512. },
  7513. // Raw string
  7514. getAllResponseHeaders: function() {
  7515. return completed ? responseHeadersString : null;
  7516. },
  7517. // Caches the header
  7518. setRequestHeader: function( name, value ) {
  7519. if ( completed == null ) {
  7520. name = requestHeadersNames[ name.toLowerCase() ] =
  7521. requestHeadersNames[ name.toLowerCase() ] || name;
  7522. requestHeaders[ name ] = value;
  7523. }
  7524. return this;
  7525. },
  7526. // Overrides response content-type header
  7527. overrideMimeType: function( type ) {
  7528. if ( completed == null ) {
  7529. s.mimeType = type;
  7530. }
  7531. return this;
  7532. },
  7533. // Status-dependent callbacks
  7534. statusCode: function( map ) {
  7535. var code;
  7536. if ( map ) {
  7537. if ( completed ) {
  7538. // Execute the appropriate callbacks
  7539. jqXHR.always( map[ jqXHR.status ] );
  7540. } else {
  7541. // Lazy-add the new callbacks in a way that preserves old ones
  7542. for ( code in map ) {
  7543. statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
  7544. }
  7545. }
  7546. }
  7547. return this;
  7548. },
  7549. // Cancel the request
  7550. abort: function( statusText ) {
  7551. var finalText = statusText || strAbort;
  7552. if ( transport ) {
  7553. transport.abort( finalText );
  7554. }
  7555. done( 0, finalText );
  7556. return this;
  7557. }
  7558. };
  7559. // Attach deferreds
  7560. deferred.promise( jqXHR );
  7561. // Add protocol if not provided (prefilters might expect it)
  7562. // Handle falsy url in the settings object (trac-10093: consistency with old signature)
  7563. // We also use the url parameter if available
  7564. s.url = ( ( url || s.url || location.href ) + "" )
  7565. .replace( rprotocol, location.protocol + "//" );
  7566. // Alias method option to type as per ticket trac-12004
  7567. s.type = options.method || options.type || s.method || s.type;
  7568. // Extract dataTypes list
  7569. s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ];
  7570. // A cross-domain request is in order when the origin doesn't match the current origin.
  7571. if ( s.crossDomain == null ) {
  7572. urlAnchor = document.createElement( "a" );
  7573. // Support: IE <=8 - 11, Edge 12 - 15
  7574. // IE throws exception on accessing the href property if url is malformed,
  7575. // e.g. http://example.com:80x/
  7576. try {
  7577. urlAnchor.href = s.url;
  7578. // Support: IE <=8 - 11 only
  7579. // Anchor's host property isn't correctly set when s.url is relative
  7580. urlAnchor.href = urlAnchor.href;
  7581. s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !==
  7582. urlAnchor.protocol + "//" + urlAnchor.host;
  7583. } catch ( e ) {
  7584. // If there is an error parsing the URL, assume it is crossDomain,
  7585. // it can be rejected by the transport if it is invalid
  7586. s.crossDomain = true;
  7587. }
  7588. }
  7589. // Convert data if not already a string
  7590. if ( s.data && s.processData && typeof s.data !== "string" ) {
  7591. s.data = jQuery.param( s.data, s.traditional );
  7592. }
  7593. // Apply prefilters
  7594. inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
  7595. // If request was aborted inside a prefilter, stop there
  7596. if ( completed ) {
  7597. return jqXHR;
  7598. }
  7599. // We can fire global events as of now if asked to
  7600. // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (trac-15118)
  7601. fireGlobals = jQuery.event && s.global;
  7602. // Watch for a new set of requests
  7603. if ( fireGlobals && jQuery.active++ === 0 ) {
  7604. jQuery.event.trigger( "ajaxStart" );
  7605. }
  7606. // Uppercase the type
  7607. s.type = s.type.toUpperCase();
  7608. // Determine if request has content
  7609. s.hasContent = !rnoContent.test( s.type );
  7610. // Save the URL in case we're toying with the If-Modified-Since
  7611. // and/or If-None-Match header later on
  7612. // Remove hash to simplify url manipulation
  7613. cacheURL = s.url.replace( rhash, "" );
  7614. // More options handling for requests with no content
  7615. if ( !s.hasContent ) {
  7616. // Remember the hash so we can put it back
  7617. uncached = s.url.slice( cacheURL.length );
  7618. // If data is available and should be processed, append data to url
  7619. if ( s.data && ( s.processData || typeof s.data === "string" ) ) {
  7620. cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data;
  7621. // trac-9682: remove data so that it's not used in an eventual retry
  7622. delete s.data;
  7623. }
  7624. // Add or update anti-cache param if needed
  7625. if ( s.cache === false ) {
  7626. cacheURL = cacheURL.replace( rantiCache, "$1" );
  7627. uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce.guid++ ) +
  7628. uncached;
  7629. }
  7630. // Put hash and anti-cache on the URL that will be requested (gh-1732)
  7631. s.url = cacheURL + uncached;
  7632. // Change '%20' to '+' if this is encoded form body content (gh-2658)
  7633. } else if ( s.data && s.processData &&
  7634. ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) {
  7635. s.data = s.data.replace( r20, "+" );
  7636. }
  7637. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  7638. if ( s.ifModified ) {
  7639. if ( jQuery.lastModified[ cacheURL ] ) {
  7640. jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
  7641. }
  7642. if ( jQuery.etag[ cacheURL ] ) {
  7643. jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
  7644. }
  7645. }
  7646. // Set the correct header, if data is being sent
  7647. if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
  7648. jqXHR.setRequestHeader( "Content-Type", s.contentType );
  7649. }
  7650. // Set the Accepts header for the server, depending on the dataType
  7651. jqXHR.setRequestHeader(
  7652. "Accept",
  7653. s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?
  7654. s.accepts[ s.dataTypes[ 0 ] ] +
  7655. ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
  7656. s.accepts[ "*" ]
  7657. );
  7658. // Check for headers option
  7659. for ( i in s.headers ) {
  7660. jqXHR.setRequestHeader( i, s.headers[ i ] );
  7661. }
  7662. // Allow custom headers/mimetypes and early abort
  7663. if ( s.beforeSend &&
  7664. ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) {
  7665. // Abort if not done already and return
  7666. return jqXHR.abort();
  7667. }
  7668. // Aborting is no longer a cancellation
  7669. strAbort = "abort";
  7670. // Install callbacks on deferreds
  7671. completeDeferred.add( s.complete );
  7672. jqXHR.done( s.success );
  7673. jqXHR.fail( s.error );
  7674. // Get transport
  7675. transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
  7676. // If no transport, we auto-abort
  7677. if ( !transport ) {
  7678. done( -1, "No Transport" );
  7679. } else {
  7680. jqXHR.readyState = 1;
  7681. // Send global event
  7682. if ( fireGlobals ) {
  7683. globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
  7684. }
  7685. // If request was aborted inside ajaxSend, stop there
  7686. if ( completed ) {
  7687. return jqXHR;
  7688. }
  7689. // Timeout
  7690. if ( s.async && s.timeout > 0 ) {
  7691. timeoutTimer = window.setTimeout( function() {
  7692. jqXHR.abort( "timeout" );
  7693. }, s.timeout );
  7694. }
  7695. try {
  7696. completed = false;
  7697. transport.send( requestHeaders, done );
  7698. } catch ( e ) {
  7699. // Rethrow post-completion exceptions
  7700. if ( completed ) {
  7701. throw e;
  7702. }
  7703. // Propagate others as results
  7704. done( -1, e );
  7705. }
  7706. }
  7707. // Callback for when everything is done
  7708. function done( status, nativeStatusText, responses, headers ) {
  7709. var isSuccess, success, error, response, modified,
  7710. statusText = nativeStatusText;
  7711. // Ignore repeat invocations
  7712. if ( completed ) {
  7713. return;
  7714. }
  7715. completed = true;
  7716. // Clear timeout if it exists
  7717. if ( timeoutTimer ) {
  7718. window.clearTimeout( timeoutTimer );
  7719. }
  7720. // Dereference transport for early garbage collection
  7721. // (no matter how long the jqXHR object will be used)
  7722. transport = undefined;
  7723. // Cache response headers
  7724. responseHeadersString = headers || "";
  7725. // Set readyState
  7726. jqXHR.readyState = status > 0 ? 4 : 0;
  7727. // Determine if successful
  7728. isSuccess = status >= 200 && status < 300 || status === 304;
  7729. // Get response data
  7730. if ( responses ) {
  7731. response = ajaxHandleResponses( s, jqXHR, responses );
  7732. }
  7733. // Use a noop converter for missing script but not if jsonp
  7734. if ( !isSuccess &&
  7735. jQuery.inArray( "script", s.dataTypes ) > -1 &&
  7736. jQuery.inArray( "json", s.dataTypes ) < 0 ) {
  7737. s.converters[ "text script" ] = function() {};
  7738. }
  7739. // Convert no matter what (that way responseXXX fields are always set)
  7740. response = ajaxConvert( s, response, jqXHR, isSuccess );
  7741. // If successful, handle type chaining
  7742. if ( isSuccess ) {
  7743. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  7744. if ( s.ifModified ) {
  7745. modified = jqXHR.getResponseHeader( "Last-Modified" );
  7746. if ( modified ) {
  7747. jQuery.lastModified[ cacheURL ] = modified;
  7748. }
  7749. modified = jqXHR.getResponseHeader( "etag" );
  7750. if ( modified ) {
  7751. jQuery.etag[ cacheURL ] = modified;
  7752. }
  7753. }
  7754. // if no content
  7755. if ( status === 204 || s.type === "HEAD" ) {
  7756. statusText = "nocontent";
  7757. // if not modified
  7758. } else if ( status === 304 ) {
  7759. statusText = "notmodified";
  7760. // If we have data, let's convert it
  7761. } else {
  7762. statusText = response.state;
  7763. success = response.data;
  7764. error = response.error;
  7765. isSuccess = !error;
  7766. }
  7767. } else {
  7768. // Extract error from statusText and normalize for non-aborts
  7769. error = statusText;
  7770. if ( status || !statusText ) {
  7771. statusText = "error";
  7772. if ( status < 0 ) {
  7773. status = 0;
  7774. }
  7775. }
  7776. }
  7777. // Set data for the fake xhr object
  7778. jqXHR.status = status;
  7779. jqXHR.statusText = ( nativeStatusText || statusText ) + "";
  7780. // Success/Error
  7781. if ( isSuccess ) {
  7782. deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
  7783. } else {
  7784. deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
  7785. }
  7786. // Status-dependent callbacks
  7787. jqXHR.statusCode( statusCode );
  7788. statusCode = undefined;
  7789. if ( fireGlobals ) {
  7790. globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
  7791. [ jqXHR, s, isSuccess ? success : error ] );
  7792. }
  7793. // Complete
  7794. completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
  7795. if ( fireGlobals ) {
  7796. globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
  7797. // Handle the global AJAX counter
  7798. if ( !( --jQuery.active ) ) {
  7799. jQuery.event.trigger( "ajaxStop" );
  7800. }
  7801. }
  7802. }
  7803. return jqXHR;
  7804. },
  7805. getJSON: function( url, data, callback ) {
  7806. return jQuery.get( url, data, callback, "json" );
  7807. },
  7808. getScript: function( url, callback ) {
  7809. return jQuery.get( url, undefined, callback, "script" );
  7810. }
  7811. } );
  7812. jQuery.each( [ "get", "post" ], function( _i, method ) {
  7813. jQuery[ method ] = function( url, data, callback, type ) {
  7814. // Shift arguments if data argument was omitted
  7815. if ( isFunction( data ) ) {
  7816. type = type || callback;
  7817. callback = data;
  7818. data = undefined;
  7819. }
  7820. // The url can be an options object (which then must have .url)
  7821. return jQuery.ajax( jQuery.extend( {
  7822. url: url,
  7823. type: method,
  7824. dataType: type,
  7825. data: data,
  7826. success: callback
  7827. }, jQuery.isPlainObject( url ) && url ) );
  7828. };
  7829. } );
  7830. jQuery.ajaxPrefilter( function( s ) {
  7831. var i;
  7832. for ( i in s.headers ) {
  7833. if ( i.toLowerCase() === "content-type" ) {
  7834. s.contentType = s.headers[ i ] || "";
  7835. }
  7836. }
  7837. } );
  7838. jQuery._evalUrl = function( url, options, doc ) {
  7839. return jQuery.ajax( {
  7840. url: url,
  7841. // Make this explicit, since user can override this through ajaxSetup (trac-11264)
  7842. type: "GET",
  7843. dataType: "script",
  7844. cache: true,
  7845. async: false,
  7846. global: false,
  7847. // Only evaluate the response if it is successful (gh-4126)
  7848. // dataFilter is not invoked for failure responses, so using it instead
  7849. // of the default converter is kludgy but it works.
  7850. converters: {
  7851. "text script": function() {}
  7852. },
  7853. dataFilter: function( response ) {
  7854. jQuery.globalEval( response, options, doc );
  7855. }
  7856. } );
  7857. };
  7858. jQuery.fn.extend( {
  7859. wrapAll: function( html ) {
  7860. var wrap;
  7861. if ( this[ 0 ] ) {
  7862. if ( isFunction( html ) ) {
  7863. html = html.call( this[ 0 ] );
  7864. }
  7865. // The elements to wrap the target around
  7866. wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
  7867. if ( this[ 0 ].parentNode ) {
  7868. wrap.insertBefore( this[ 0 ] );
  7869. }
  7870. wrap.map( function() {
  7871. var elem = this;
  7872. while ( elem.firstElementChild ) {
  7873. elem = elem.firstElementChild;
  7874. }
  7875. return elem;
  7876. } ).append( this );
  7877. }
  7878. return this;
  7879. },
  7880. wrapInner: function( html ) {
  7881. if ( isFunction( html ) ) {
  7882. return this.each( function( i ) {
  7883. jQuery( this ).wrapInner( html.call( this, i ) );
  7884. } );
  7885. }
  7886. return this.each( function() {
  7887. var self = jQuery( this ),
  7888. contents = self.contents();
  7889. if ( contents.length ) {
  7890. contents.wrapAll( html );
  7891. } else {
  7892. self.append( html );
  7893. }
  7894. } );
  7895. },
  7896. wrap: function( html ) {
  7897. var htmlIsFunction = isFunction( html );
  7898. return this.each( function( i ) {
  7899. jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html );
  7900. } );
  7901. },
  7902. unwrap: function( selector ) {
  7903. this.parent( selector ).not( "body" ).each( function() {
  7904. jQuery( this ).replaceWith( this.childNodes );
  7905. } );
  7906. return this;
  7907. }
  7908. } );
  7909. jQuery.expr.pseudos.hidden = function( elem ) {
  7910. return !jQuery.expr.pseudos.visible( elem );
  7911. };
  7912. jQuery.expr.pseudos.visible = function( elem ) {
  7913. return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );
  7914. };
  7915. jQuery.ajaxSettings.xhr = function() {
  7916. try {
  7917. return new window.XMLHttpRequest();
  7918. } catch ( e ) {}
  7919. };
  7920. var xhrSuccessStatus = {
  7921. // File protocol always yields status code 0, assume 200
  7922. 0: 200,
  7923. // Support: IE <=9 only
  7924. // trac-1450: sometimes IE returns 1223 when it should be 204
  7925. 1223: 204
  7926. },
  7927. xhrSupported = jQuery.ajaxSettings.xhr();
  7928. support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
  7929. support.ajax = xhrSupported = !!xhrSupported;
  7930. jQuery.ajaxTransport( function( options ) {
  7931. var callback, errorCallback;
  7932. // Cross domain only allowed if supported through XMLHttpRequest
  7933. if ( support.cors || xhrSupported && !options.crossDomain ) {
  7934. return {
  7935. send: function( headers, complete ) {
  7936. var i,
  7937. xhr = options.xhr();
  7938. xhr.open(
  7939. options.type,
  7940. options.url,
  7941. options.async,
  7942. options.username,
  7943. options.password
  7944. );
  7945. // Apply custom fields if provided
  7946. if ( options.xhrFields ) {
  7947. for ( i in options.xhrFields ) {
  7948. xhr[ i ] = options.xhrFields[ i ];
  7949. }
  7950. }
  7951. // Override mime type if needed
  7952. if ( options.mimeType && xhr.overrideMimeType ) {
  7953. xhr.overrideMimeType( options.mimeType );
  7954. }
  7955. // X-Requested-With header
  7956. // For cross-domain requests, seeing as conditions for a preflight are
  7957. // akin to a jigsaw puzzle, we simply never set it to be sure.
  7958. // (it can always be set on a per-request basis or even using ajaxSetup)
  7959. // For same-domain requests, won't change header if already provided.
  7960. if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) {
  7961. headers[ "X-Requested-With" ] = "XMLHttpRequest";
  7962. }
  7963. // Set headers
  7964. for ( i in headers ) {
  7965. xhr.setRequestHeader( i, headers[ i ] );
  7966. }
  7967. // Callback
  7968. callback = function( type ) {
  7969. return function() {
  7970. if ( callback ) {
  7971. callback = errorCallback = xhr.onload =
  7972. xhr.onerror = xhr.onabort = xhr.ontimeout =
  7973. xhr.onreadystatechange = null;
  7974. if ( type === "abort" ) {
  7975. xhr.abort();
  7976. } else if ( type === "error" ) {
  7977. // Support: IE <=9 only
  7978. // On a manual native abort, IE9 throws
  7979. // errors on any property access that is not readyState
  7980. if ( typeof xhr.status !== "number" ) {
  7981. complete( 0, "error" );
  7982. } else {
  7983. complete(
  7984. // File: protocol always yields status 0; see trac-8605, trac-14207
  7985. xhr.status,
  7986. xhr.statusText
  7987. );
  7988. }
  7989. } else {
  7990. complete(
  7991. xhrSuccessStatus[ xhr.status ] || xhr.status,
  7992. xhr.statusText,
  7993. // Support: IE <=9 only
  7994. // IE9 has no XHR2 but throws on binary (trac-11426)
  7995. // For XHR2 non-text, let the caller handle it (gh-2498)
  7996. ( xhr.responseType || "text" ) !== "text" ||
  7997. typeof xhr.responseText !== "string" ?
  7998. { binary: xhr.response } :
  7999. { text: xhr.responseText },
  8000. xhr.getAllResponseHeaders()
  8001. );
  8002. }
  8003. }
  8004. };
  8005. };
  8006. // Listen to events
  8007. xhr.onload = callback();
  8008. errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" );
  8009. // Support: IE 9 only
  8010. // Use onreadystatechange to replace onabort
  8011. // to handle uncaught aborts
  8012. if ( xhr.onabort !== undefined ) {
  8013. xhr.onabort = errorCallback;
  8014. } else {
  8015. xhr.onreadystatechange = function() {
  8016. // Check readyState before timeout as it changes
  8017. if ( xhr.readyState === 4 ) {
  8018. // Allow onerror to be called first,
  8019. // but that will not handle a native abort
  8020. // Also, save errorCallback to a variable
  8021. // as xhr.onerror cannot be accessed
  8022. window.setTimeout( function() {
  8023. if ( callback ) {
  8024. errorCallback();
  8025. }
  8026. } );
  8027. }
  8028. };
  8029. }
  8030. // Create the abort callback
  8031. callback = callback( "abort" );
  8032. try {
  8033. // Do send the request (this may raise an exception)
  8034. xhr.send( options.hasContent && options.data || null );
  8035. } catch ( e ) {
  8036. // trac-14683: Only rethrow if this hasn't been notified as an error yet
  8037. if ( callback ) {
  8038. throw e;
  8039. }
  8040. }
  8041. },
  8042. abort: function() {
  8043. if ( callback ) {
  8044. callback();
  8045. }
  8046. }
  8047. };
  8048. }
  8049. } );
  8050. // Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)
  8051. jQuery.ajaxPrefilter( function( s ) {
  8052. if ( s.crossDomain ) {
  8053. s.contents.script = false;
  8054. }
  8055. } );
  8056. // Install script dataType
  8057. jQuery.ajaxSetup( {
  8058. accepts: {
  8059. script: "text/javascript, application/javascript, " +
  8060. "application/ecmascript, application/x-ecmascript"
  8061. },
  8062. contents: {
  8063. script: /\b(?:java|ecma)script\b/
  8064. },
  8065. converters: {
  8066. "text script": function( text ) {
  8067. jQuery.globalEval( text );
  8068. return text;
  8069. }
  8070. }
  8071. } );
  8072. // Handle cache's special case and crossDomain
  8073. jQuery.ajaxPrefilter( "script", function( s ) {
  8074. if ( s.cache === undefined ) {
  8075. s.cache = false;
  8076. }
  8077. if ( s.crossDomain ) {
  8078. s.type = "GET";
  8079. }
  8080. } );
  8081. // Bind script tag hack transport
  8082. jQuery.ajaxTransport( "script", function( s ) {
  8083. // This transport only deals with cross domain or forced-by-attrs requests
  8084. if ( s.crossDomain || s.scriptAttrs ) {
  8085. var script, callback;
  8086. return {
  8087. send: function( _, complete ) {
  8088. script = jQuery( "<script>" )
  8089. .attr( s.scriptAttrs || {} )
  8090. .prop( { charset: s.scriptCharset, src: s.url } )
  8091. .on( "load error", callback = function( evt ) {
  8092. script.remove();
  8093. callback = null;
  8094. if ( evt ) {
  8095. complete( evt.type === "error" ? 404 : 200, evt.type );
  8096. }
  8097. } );
  8098. // Use native DOM manipulation to avoid our domManip AJAX trickery
  8099. document.head.appendChild( script[ 0 ] );
  8100. },
  8101. abort: function() {
  8102. if ( callback ) {
  8103. callback();
  8104. }
  8105. }
  8106. };
  8107. }
  8108. } );
  8109. var oldCallbacks = [],
  8110. rjsonp = /(=)\?(?=&|$)|\?\?/;
  8111. // Default jsonp settings
  8112. jQuery.ajaxSetup( {
  8113. jsonp: "callback",
  8114. jsonpCallback: function() {
  8115. var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce.guid++ ) );
  8116. this[ callback ] = true;
  8117. return callback;
  8118. }
  8119. } );
  8120. // Detect, normalize options and install callbacks for jsonp requests
  8121. jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
  8122. var callbackName, overwritten, responseContainer,
  8123. jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
  8124. "url" :
  8125. typeof s.data === "string" &&
  8126. ( s.contentType || "" )
  8127. .indexOf( "application/x-www-form-urlencoded" ) === 0 &&
  8128. rjsonp.test( s.data ) && "data"
  8129. );
  8130. // Handle iff the expected data type is "jsonp" or we have a parameter to set
  8131. if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
  8132. // Get callback name, remembering preexisting value associated with it
  8133. callbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ?
  8134. s.jsonpCallback() :
  8135. s.jsonpCallback;
  8136. // Insert callback into url or form data
  8137. if ( jsonProp ) {
  8138. s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
  8139. } else if ( s.jsonp !== false ) {
  8140. s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
  8141. }
  8142. // Use data converter to retrieve json after script execution
  8143. s.converters[ "script json" ] = function() {
  8144. if ( !responseContainer ) {
  8145. jQuery.error( callbackName + " was not called" );
  8146. }
  8147. return responseContainer[ 0 ];
  8148. };
  8149. // Force json dataType
  8150. s.dataTypes[ 0 ] = "json";
  8151. // Install callback
  8152. overwritten = window[ callbackName ];
  8153. window[ callbackName ] = function() {
  8154. responseContainer = arguments;
  8155. };
  8156. // Clean-up function (fires after converters)
  8157. jqXHR.always( function() {
  8158. // If previous value didn't exist - remove it
  8159. if ( overwritten === undefined ) {
  8160. jQuery( window ).removeProp( callbackName );
  8161. // Otherwise restore preexisting value
  8162. } else {
  8163. window[ callbackName ] = overwritten;
  8164. }
  8165. // Save back as free
  8166. if ( s[ callbackName ] ) {
  8167. // Make sure that re-using the options doesn't screw things around
  8168. s.jsonpCallback = originalSettings.jsonpCallback;
  8169. // Save the callback name for future use
  8170. oldCallbacks.push( callbackName );
  8171. }
  8172. // Call if it was a function and we have a response
  8173. if ( responseContainer && isFunction( overwritten ) ) {
  8174. overwritten( responseContainer[ 0 ] );
  8175. }
  8176. responseContainer = overwritten = undefined;
  8177. } );
  8178. // Delegate to script
  8179. return "script";
  8180. }
  8181. } );
  8182. // Support: Safari 8 only
  8183. // In Safari 8 documents created via document.implementation.createHTMLDocument
  8184. // collapse sibling forms: the second one becomes a child of the first one.
  8185. // Because of that, this security measure has to be disabled in Safari 8.
  8186. // https://bugs.webkit.org/show_bug.cgi?id=137337
  8187. support.createHTMLDocument = ( function() {
  8188. var body = document.implementation.createHTMLDocument( "" ).body;
  8189. body.innerHTML = "<form></form><form></form>";
  8190. return body.childNodes.length === 2;
  8191. } )();
  8192. // Argument "data" should be string of html
  8193. // context (optional): If specified, the fragment will be created in this context,
  8194. // defaults to document
  8195. // keepScripts (optional): If true, will include scripts passed in the html string
  8196. jQuery.parseHTML = function( data, context, keepScripts ) {
  8197. if ( typeof data !== "string" ) {
  8198. return [];
  8199. }
  8200. if ( typeof context === "boolean" ) {
  8201. keepScripts = context;
  8202. context = false;
  8203. }
  8204. var base, parsed, scripts;
  8205. if ( !context ) {
  8206. // Stop scripts or inline event handlers from being executed immediately
  8207. // by using document.implementation
  8208. if ( support.createHTMLDocument ) {
  8209. context = document.implementation.createHTMLDocument( "" );
  8210. // Set the base href for the created document
  8211. // so any parsed elements with URLs
  8212. // are based on the document's URL (gh-2965)
  8213. base = context.createElement( "base" );
  8214. base.href = document.location.href;
  8215. context.head.appendChild( base );
  8216. } else {
  8217. context = document;
  8218. }
  8219. }
  8220. parsed = rsingleTag.exec( data );
  8221. scripts = !keepScripts && [];
  8222. // Single tag
  8223. if ( parsed ) {
  8224. return [ context.createElement( parsed[ 1 ] ) ];
  8225. }
  8226. parsed = buildFragment( [ data ], context, scripts );
  8227. if ( scripts && scripts.length ) {
  8228. jQuery( scripts ).remove();
  8229. }
  8230. return jQuery.merge( [], parsed.childNodes );
  8231. };
  8232. /**
  8233. * Load a url into a page
  8234. */
  8235. jQuery.fn.load = function( url, params, callback ) {
  8236. var selector, type, response,
  8237. self = this,
  8238. off = url.indexOf( " " );
  8239. if ( off > -1 ) {
  8240. selector = stripAndCollapse( url.slice( off ) );
  8241. url = url.slice( 0, off );
  8242. }
  8243. // If it's a function
  8244. if ( isFunction( params ) ) {
  8245. // We assume that it's the callback
  8246. callback = params;
  8247. params = undefined;
  8248. // Otherwise, build a param string
  8249. } else if ( params && typeof params === "object" ) {
  8250. type = "POST";
  8251. }
  8252. // If we have elements to modify, make the request
  8253. if ( self.length > 0 ) {
  8254. jQuery.ajax( {
  8255. url: url,
  8256. // If "type" variable is undefined, then "GET" method will be used.
  8257. // Make value of this field explicit since
  8258. // user can override it through ajaxSetup method
  8259. type: type || "GET",
  8260. dataType: "html",
  8261. data: params
  8262. } ).done( function( responseText ) {
  8263. // Save response for use in complete callback
  8264. response = arguments;
  8265. self.html( selector ?
  8266. // If a selector was specified, locate the right elements in a dummy div
  8267. // Exclude scripts to avoid IE 'Permission Denied' errors
  8268. jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :
  8269. // Otherwise use the full result
  8270. responseText );
  8271. // If the request succeeds, this function gets "data", "status", "jqXHR"
  8272. // but they are ignored because response was set above.
  8273. // If it fails, this function gets "jqXHR", "status", "error"
  8274. } ).always( callback && function( jqXHR, status ) {
  8275. self.each( function() {
  8276. callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );
  8277. } );
  8278. } );
  8279. }
  8280. return this;
  8281. };
  8282. jQuery.expr.pseudos.animated = function( elem ) {
  8283. return jQuery.grep( jQuery.timers, function( fn ) {
  8284. return elem === fn.elem;
  8285. } ).length;
  8286. };
  8287. jQuery.offset = {
  8288. setOffset: function( elem, options, i ) {
  8289. var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
  8290. position = jQuery.css( elem, "position" ),
  8291. curElem = jQuery( elem ),
  8292. props = {};
  8293. // Set position first, in-case top/left are set even on static elem
  8294. if ( position === "static" ) {
  8295. elem.style.position = "relative";
  8296. }
  8297. curOffset = curElem.offset();
  8298. curCSSTop = jQuery.css( elem, "top" );
  8299. curCSSLeft = jQuery.css( elem, "left" );
  8300. calculatePosition = ( position === "absolute" || position === "fixed" ) &&
  8301. ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1;
  8302. // Need to be able to calculate position if either
  8303. // top or left is auto and position is either absolute or fixed
  8304. if ( calculatePosition ) {
  8305. curPosition = curElem.position();
  8306. curTop = curPosition.top;
  8307. curLeft = curPosition.left;
  8308. } else {
  8309. curTop = parseFloat( curCSSTop ) || 0;
  8310. curLeft = parseFloat( curCSSLeft ) || 0;
  8311. }
  8312. if ( isFunction( options ) ) {
  8313. // Use jQuery.extend here to allow modification of coordinates argument (gh-1848)
  8314. options = options.call( elem, i, jQuery.extend( {}, curOffset ) );
  8315. }
  8316. if ( options.top != null ) {
  8317. props.top = ( options.top - curOffset.top ) + curTop;
  8318. }
  8319. if ( options.left != null ) {
  8320. props.left = ( options.left - curOffset.left ) + curLeft;
  8321. }
  8322. if ( "using" in options ) {
  8323. options.using.call( elem, props );
  8324. } else {
  8325. curElem.css( props );
  8326. }
  8327. }
  8328. };
  8329. jQuery.fn.extend( {
  8330. // offset() relates an element's border box to the document origin
  8331. offset: function( options ) {
  8332. // Preserve chaining for setter
  8333. if ( arguments.length ) {
  8334. return options === undefined ?
  8335. this :
  8336. this.each( function( i ) {
  8337. jQuery.offset.setOffset( this, options, i );
  8338. } );
  8339. }
  8340. var rect, win,
  8341. elem = this[ 0 ];
  8342. if ( !elem ) {
  8343. return;
  8344. }
  8345. // Return zeros for disconnected and hidden (display: none) elements (gh-2310)
  8346. // Support: IE <=11 only
  8347. // Running getBoundingClientRect on a
  8348. // disconnected node in IE throws an error
  8349. if ( !elem.getClientRects().length ) {
  8350. return { top: 0, left: 0 };
  8351. }
  8352. // Get document-relative position by adding viewport scroll to viewport-relative gBCR
  8353. rect = elem.getBoundingClientRect();
  8354. win = elem.ownerDocument.defaultView;
  8355. return {
  8356. top: rect.top + win.pageYOffset,
  8357. left: rect.left + win.pageXOffset
  8358. };
  8359. },
  8360. // position() relates an element's margin box to its offset parent's padding box
  8361. // This corresponds to the behavior of CSS absolute positioning
  8362. position: function() {
  8363. if ( !this[ 0 ] ) {
  8364. return;
  8365. }
  8366. var offsetParent, offset, doc,
  8367. elem = this[ 0 ],
  8368. parentOffset = { top: 0, left: 0 };
  8369. // position:fixed elements are offset from the viewport, which itself always has zero offset
  8370. if ( jQuery.css( elem, "position" ) === "fixed" ) {
  8371. // Assume position:fixed implies availability of getBoundingClientRect
  8372. offset = elem.getBoundingClientRect();
  8373. } else {
  8374. offset = this.offset();
  8375. // Account for the *real* offset parent, which can be the document or its root element
  8376. // when a statically positioned element is identified
  8377. doc = elem.ownerDocument;
  8378. offsetParent = elem.offsetParent || doc.documentElement;
  8379. while ( offsetParent &&
  8380. ( offsetParent === doc.body || offsetParent === doc.documentElement ) &&
  8381. jQuery.css( offsetParent, "position" ) === "static" ) {
  8382. offsetParent = offsetParent.parentNode;
  8383. }
  8384. if ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) {
  8385. // Incorporate borders into its offset, since they are outside its content origin
  8386. parentOffset = jQuery( offsetParent ).offset();
  8387. parentOffset.top += jQuery.css( offsetParent, "borderTopWidth", true );
  8388. parentOffset.left += jQuery.css( offsetParent, "borderLeftWidth", true );
  8389. }
  8390. }
  8391. // Subtract parent offsets and element margins
  8392. return {
  8393. top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
  8394. left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
  8395. };
  8396. },
  8397. // This method will return documentElement in the following cases:
  8398. // 1) For the element inside the iframe without offsetParent, this method will return
  8399. // documentElement of the parent window
  8400. // 2) For the hidden or detached element
  8401. // 3) For body or html element, i.e. in case of the html node - it will return itself
  8402. //
  8403. // but those exceptions were never presented as a real life use-cases
  8404. // and might be considered as more preferable results.
  8405. //
  8406. // This logic, however, is not guaranteed and can change at any point in the future
  8407. offsetParent: function() {
  8408. return this.map( function() {
  8409. var offsetParent = this.offsetParent;
  8410. while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) {
  8411. offsetParent = offsetParent.offsetParent;
  8412. }
  8413. return offsetParent || documentElement;
  8414. } );
  8415. }
  8416. } );
  8417. // Create scrollLeft and scrollTop methods
  8418. jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
  8419. var top = "pageYOffset" === prop;
  8420. jQuery.fn[ method ] = function( val ) {
  8421. return access( this, function( elem, method, val ) {
  8422. // Coalesce documents and windows
  8423. var win;
  8424. if ( isWindow( elem ) ) {
  8425. win = elem;
  8426. } else if ( elem.nodeType === 9 ) {
  8427. win = elem.defaultView;
  8428. }
  8429. if ( val === undefined ) {
  8430. return win ? win[ prop ] : elem[ method ];
  8431. }
  8432. if ( win ) {
  8433. win.scrollTo(
  8434. !top ? val : win.pageXOffset,
  8435. top ? val : win.pageYOffset
  8436. );
  8437. } else {
  8438. elem[ method ] = val;
  8439. }
  8440. }, method, val, arguments.length );
  8441. };
  8442. } );
  8443. // Support: Safari <=7 - 9.1, Chrome <=37 - 49
  8444. // Add the top/left cssHooks using jQuery.fn.position
  8445. // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
  8446. // Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347
  8447. // getComputedStyle returns percent when specified for top/left/bottom/right;
  8448. // rather than make the css module depend on the offset module, just check for it here
  8449. jQuery.each( [ "top", "left" ], function( _i, prop ) {
  8450. jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
  8451. function( elem, computed ) {
  8452. if ( computed ) {
  8453. computed = curCSS( elem, prop );
  8454. // If curCSS returns percentage, fallback to offset
  8455. return rnumnonpx.test( computed ) ?
  8456. jQuery( elem ).position()[ prop ] + "px" :
  8457. computed;
  8458. }
  8459. }
  8460. );
  8461. } );
  8462. // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
  8463. jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
  8464. jQuery.each( {
  8465. padding: "inner" + name,
  8466. content: type,
  8467. "": "outer" + name
  8468. }, function( defaultExtra, funcName ) {
  8469. // Margin is only for outerHeight, outerWidth
  8470. jQuery.fn[ funcName ] = function( margin, value ) {
  8471. var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
  8472. extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
  8473. return access( this, function( elem, type, value ) {
  8474. var doc;
  8475. if ( isWindow( elem ) ) {
  8476. // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)
  8477. return funcName.indexOf( "outer" ) === 0 ?
  8478. elem[ "inner" + name ] :
  8479. elem.document.documentElement[ "client" + name ];
  8480. }
  8481. // Get document width or height
  8482. if ( elem.nodeType === 9 ) {
  8483. doc = elem.documentElement;
  8484. // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
  8485. // whichever is greatest
  8486. return Math.max(
  8487. elem.body[ "scroll" + name ], doc[ "scroll" + name ],
  8488. elem.body[ "offset" + name ], doc[ "offset" + name ],
  8489. doc[ "client" + name ]
  8490. );
  8491. }
  8492. return value === undefined ?
  8493. // Get width or height on the element, requesting but not forcing parseFloat
  8494. jQuery.css( elem, type, extra ) :
  8495. // Set width or height on the element
  8496. jQuery.style( elem, type, value, extra );
  8497. }, type, chainable ? margin : undefined, chainable );
  8498. };
  8499. } );
  8500. } );
  8501. jQuery.each( [
  8502. "ajaxStart",
  8503. "ajaxStop",
  8504. "ajaxComplete",
  8505. "ajaxError",
  8506. "ajaxSuccess",
  8507. "ajaxSend"
  8508. ], function( _i, type ) {
  8509. jQuery.fn[ type ] = function( fn ) {
  8510. return this.on( type, fn );
  8511. };
  8512. } );
  8513. jQuery.fn.extend( {
  8514. bind: function( types, data, fn ) {
  8515. return this.on( types, null, data, fn );
  8516. },
  8517. unbind: function( types, fn ) {
  8518. return this.off( types, null, fn );
  8519. },
  8520. delegate: function( selector, types, data, fn ) {
  8521. return this.on( types, selector, data, fn );
  8522. },
  8523. undelegate: function( selector, types, fn ) {
  8524. // ( namespace ) or ( selector, types [, fn] )
  8525. return arguments.length === 1 ?
  8526. this.off( selector, "**" ) :
  8527. this.off( types, selector || "**", fn );
  8528. },
  8529. hover: function( fnOver, fnOut ) {
  8530. return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
  8531. }
  8532. } );
  8533. jQuery.each(
  8534. ( "blur focus focusin focusout resize scroll click dblclick " +
  8535. "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
  8536. "change select submit keydown keypress keyup contextmenu" ).split( " " ),
  8537. function( _i, name ) {
  8538. // Handle event binding
  8539. jQuery.fn[ name ] = function( data, fn ) {
  8540. return arguments.length > 0 ?
  8541. this.on( name, null, data, fn ) :
  8542. this.trigger( name );
  8543. };
  8544. }
  8545. );
  8546. // Support: Android <=4.0 only
  8547. // Make sure we trim BOM and NBSP
  8548. // Require that the "whitespace run" starts from a non-whitespace
  8549. // to avoid O(N^2) behavior when the engine would try matching "\s+$" at each space position.
  8550. var rtrim = /^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;
  8551. // Bind a function to a context, optionally partially applying any
  8552. // arguments.
  8553. // jQuery.proxy is deprecated to promote standards (specifically Function#bind)
  8554. // However, it is not slated for removal any time soon
  8555. jQuery.proxy = function( fn, context ) {
  8556. var tmp, args, proxy;
  8557. if ( typeof context === "string" ) {
  8558. tmp = fn[ context ];
  8559. context = fn;
  8560. fn = tmp;
  8561. }
  8562. // Quick check to determine if target is callable, in the spec
  8563. // this throws a TypeError, but we will just return undefined.
  8564. if ( !isFunction( fn ) ) {
  8565. return undefined;
  8566. }
  8567. // Simulated bind
  8568. args = slice.call( arguments, 2 );
  8569. proxy = function() {
  8570. return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
  8571. };
  8572. // Set the guid of unique handler to the same of original handler, so it can be removed
  8573. proxy.guid = fn.guid = fn.guid || jQuery.guid++;
  8574. return proxy;
  8575. };
  8576. jQuery.holdReady = function( hold ) {
  8577. if ( hold ) {
  8578. jQuery.readyWait++;
  8579. } else {
  8580. jQuery.ready( true );
  8581. }
  8582. };
  8583. jQuery.isArray = Array.isArray;
  8584. jQuery.parseJSON = JSON.parse;
  8585. jQuery.nodeName = nodeName;
  8586. jQuery.isFunction = isFunction;
  8587. jQuery.isWindow = isWindow;
  8588. jQuery.camelCase = camelCase;
  8589. jQuery.type = toType;
  8590. jQuery.now = Date.now;
  8591. jQuery.isNumeric = function( obj ) {
  8592. // As of jQuery 3.0, isNumeric is limited to
  8593. // strings and numbers (primitives or objects)
  8594. // that can be coerced to finite numbers (gh-2662)
  8595. var type = jQuery.type( obj );
  8596. return ( type === "number" || type === "string" ) &&
  8597. // parseFloat NaNs numeric-cast false positives ("")
  8598. // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
  8599. // subtraction forces infinities to NaN
  8600. !isNaN( obj - parseFloat( obj ) );
  8601. };
  8602. jQuery.trim = function( text ) {
  8603. return text == null ?
  8604. "" :
  8605. ( text + "" ).replace( rtrim, "$1" );
  8606. };
  8607. var
  8608. // Map over jQuery in case of overwrite
  8609. _jQuery = window.jQuery,
  8610. // Map over the $ in case of overwrite
  8611. _$ = window.$;
  8612. jQuery.noConflict = function( deep ) {
  8613. if ( window.$ === jQuery ) {
  8614. window.$ = _$;
  8615. }
  8616. if ( deep && window.jQuery === jQuery ) {
  8617. window.jQuery = _jQuery;
  8618. }
  8619. return jQuery;
  8620. };
  8621. // Expose jQuery and $ identifiers, even in AMD
  8622. // (trac-7102#comment:10, https://github.com/jquery/jquery/pull/557)
  8623. // and CommonJS for browser emulators (trac-13566)
  8624. if ( typeof noGlobal === "undefined" ) {
  8625. window.jQuery = window.$ = jQuery;
  8626. }
  8627. return jQuery;
  8628. } );
  8629. });
  8630. /*!
  8631. * Vue.js v2.7.14
  8632. * (c) 2014-2022 Evan You
  8633. * Released under the MIT License.
  8634. */
  8635. var emptyObject = Object.freeze({});
  8636. var isArray = Array.isArray;
  8637. // These helpers produce better VM code in JS engines due to their
  8638. // explicitness and function inlining.
  8639. function isUndef(v) {
  8640. return v === undefined || v === null;
  8641. }
  8642. function isDef(v) {
  8643. return v !== undefined && v !== null;
  8644. }
  8645. function isTrue(v) {
  8646. return v === true;
  8647. }
  8648. function isFalse(v) {
  8649. return v === false;
  8650. }
  8651. /**
  8652. * Check if value is primitive.
  8653. */
  8654. function isPrimitive(value) {
  8655. return (typeof value === 'string' ||
  8656. typeof value === 'number' ||
  8657. // $flow-disable-line
  8658. typeof value === 'symbol' ||
  8659. typeof value === 'boolean');
  8660. }
  8661. function isFunction(value) {
  8662. return typeof value === 'function';
  8663. }
  8664. /**
  8665. * Quick object check - this is primarily used to tell
  8666. * objects from primitive values when we know the value
  8667. * is a JSON-compliant type.
  8668. */
  8669. function isObject(obj) {
  8670. return obj !== null && typeof obj === 'object';
  8671. }
  8672. /**
  8673. * Get the raw type string of a value, e.g., [object Object].
  8674. */
  8675. var _toString = Object.prototype.toString;
  8676. function toRawType(value) {
  8677. return _toString.call(value).slice(8, -1);
  8678. }
  8679. /**
  8680. * Strict object type check. Only returns true
  8681. * for plain JavaScript objects.
  8682. */
  8683. function isPlainObject(obj) {
  8684. return _toString.call(obj) === '[object Object]';
  8685. }
  8686. function isRegExp(v) {
  8687. return _toString.call(v) === '[object RegExp]';
  8688. }
  8689. /**
  8690. * Check if val is a valid array index.
  8691. */
  8692. function isValidArrayIndex(val) {
  8693. var n = parseFloat(String(val));
  8694. return n >= 0 && Math.floor(n) === n && isFinite(val);
  8695. }
  8696. function isPromise(val) {
  8697. return (isDef(val) &&
  8698. typeof val.then === 'function' &&
  8699. typeof val.catch === 'function');
  8700. }
  8701. /**
  8702. * Convert a value to a string that is actually rendered.
  8703. */
  8704. function toString(val) {
  8705. return val == null
  8706. ? ''
  8707. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  8708. ? JSON.stringify(val, null, 2)
  8709. : String(val);
  8710. }
  8711. /**
  8712. * Convert an input value to a number for persistence.
  8713. * If the conversion fails, return original string.
  8714. */
  8715. function toNumber(val) {
  8716. var n = parseFloat(val);
  8717. return isNaN(n) ? val : n;
  8718. }
  8719. /**
  8720. * Make a map and return a function for checking if a key
  8721. * is in that map.
  8722. */
  8723. function makeMap(str, expectsLowerCase) {
  8724. var map = Object.create(null);
  8725. var list = str.split(',');
  8726. for (var i = 0; i < list.length; i++) {
  8727. map[list[i]] = true;
  8728. }
  8729. return expectsLowerCase ? function (val) { return map[val.toLowerCase()]; } : function (val) { return map[val]; };
  8730. }
  8731. /**
  8732. * Check if a tag is a built-in tag.
  8733. */
  8734. makeMap('slot,component', true);
  8735. /**
  8736. * Check if an attribute is a reserved attribute.
  8737. */
  8738. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  8739. /**
  8740. * Remove an item from an array.
  8741. */
  8742. function remove$2(arr, item) {
  8743. var len = arr.length;
  8744. if (len) {
  8745. // fast path for the only / last item
  8746. if (item === arr[len - 1]) {
  8747. arr.length = len - 1;
  8748. return;
  8749. }
  8750. var index = arr.indexOf(item);
  8751. if (index > -1) {
  8752. return arr.splice(index, 1);
  8753. }
  8754. }
  8755. }
  8756. /**
  8757. * Check whether an object has the property.
  8758. */
  8759. var hasOwnProperty = Object.prototype.hasOwnProperty;
  8760. function hasOwn(obj, key) {
  8761. return hasOwnProperty.call(obj, key);
  8762. }
  8763. /**
  8764. * Create a cached version of a pure function.
  8765. */
  8766. function cached(fn) {
  8767. var cache = Object.create(null);
  8768. return function cachedFn(str) {
  8769. var hit = cache[str];
  8770. return hit || (cache[str] = fn(str));
  8771. };
  8772. }
  8773. /**
  8774. * Camelize a hyphen-delimited string.
  8775. */
  8776. var camelizeRE = /-(\w)/g;
  8777. var camelize = cached(function (str) {
  8778. return str.replace(camelizeRE, function (_, c) { return (c ? c.toUpperCase() : ''); });
  8779. });
  8780. /**
  8781. * Capitalize a string.
  8782. */
  8783. var capitalize = cached(function (str) {
  8784. return str.charAt(0).toUpperCase() + str.slice(1);
  8785. });
  8786. /**
  8787. * Hyphenate a camelCase string.
  8788. */
  8789. var hyphenateRE = /\B([A-Z])/g;
  8790. var hyphenate = cached(function (str) {
  8791. return str.replace(hyphenateRE, '-$1').toLowerCase();
  8792. });
  8793. /**
  8794. * Simple bind polyfill for environments that do not support it,
  8795. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  8796. * since native bind is now performant enough in most browsers.
  8797. * But removing it would mean breaking code that was able to run in
  8798. * PhantomJS 1.x, so this must be kept for backward compatibility.
  8799. */
  8800. /* istanbul ignore next */
  8801. function polyfillBind(fn, ctx) {
  8802. function boundFn(a) {
  8803. var l = arguments.length;
  8804. return l
  8805. ? l > 1
  8806. ? fn.apply(ctx, arguments)
  8807. : fn.call(ctx, a)
  8808. : fn.call(ctx);
  8809. }
  8810. boundFn._length = fn.length;
  8811. return boundFn;
  8812. }
  8813. function nativeBind(fn, ctx) {
  8814. return fn.bind(ctx);
  8815. }
  8816. // @ts-expect-error bind cannot be `undefined`
  8817. var bind = Function.prototype.bind ? nativeBind : polyfillBind;
  8818. /**
  8819. * Convert an Array-like object to a real Array.
  8820. */
  8821. function toArray(list, start) {
  8822. start = start || 0;
  8823. var i = list.length - start;
  8824. var ret = new Array(i);
  8825. while (i--) {
  8826. ret[i] = list[i + start];
  8827. }
  8828. return ret;
  8829. }
  8830. /**
  8831. * Mix properties into target object.
  8832. */
  8833. function extend(to, _from) {
  8834. for (var key in _from) {
  8835. to[key] = _from[key];
  8836. }
  8837. return to;
  8838. }
  8839. /**
  8840. * Merge an Array of Objects into a single Object.
  8841. */
  8842. function toObject(arr) {
  8843. var res = {};
  8844. for (var i = 0; i < arr.length; i++) {
  8845. if (arr[i]) {
  8846. extend(res, arr[i]);
  8847. }
  8848. }
  8849. return res;
  8850. }
  8851. /* eslint-disable no-unused-vars */
  8852. /**
  8853. * Perform no operation.
  8854. * Stubbing args to make Flow happy without leaving useless transpiled code
  8855. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  8856. */
  8857. function noop(a, b, c) { }
  8858. /**
  8859. * Always return false.
  8860. */
  8861. var no = function (a, b, c) { return false; };
  8862. /* eslint-enable no-unused-vars */
  8863. /**
  8864. * Return the same value.
  8865. */
  8866. var identity = function (_) { return _; };
  8867. /**
  8868. * Check if two values are loosely equal - that is,
  8869. * if they are plain objects, do they have the same shape?
  8870. */
  8871. function looseEqual(a, b) {
  8872. if (a === b)
  8873. return true;
  8874. var isObjectA = isObject(a);
  8875. var isObjectB = isObject(b);
  8876. if (isObjectA && isObjectB) {
  8877. try {
  8878. var isArrayA = Array.isArray(a);
  8879. var isArrayB = Array.isArray(b);
  8880. if (isArrayA && isArrayB) {
  8881. return (a.length === b.length &&
  8882. a.every(function (e, i) {
  8883. return looseEqual(e, b[i]);
  8884. }));
  8885. }
  8886. else if (a instanceof Date && b instanceof Date) {
  8887. return a.getTime() === b.getTime();
  8888. }
  8889. else if (!isArrayA && !isArrayB) {
  8890. var keysA = Object.keys(a);
  8891. var keysB = Object.keys(b);
  8892. return (keysA.length === keysB.length &&
  8893. keysA.every(function (key) {
  8894. return looseEqual(a[key], b[key]);
  8895. }));
  8896. }
  8897. else {
  8898. /* istanbul ignore next */
  8899. return false;
  8900. }
  8901. }
  8902. catch (e) {
  8903. /* istanbul ignore next */
  8904. return false;
  8905. }
  8906. }
  8907. else if (!isObjectA && !isObjectB) {
  8908. return String(a) === String(b);
  8909. }
  8910. else {
  8911. return false;
  8912. }
  8913. }
  8914. /**
  8915. * Return the first index at which a loosely equal value can be
  8916. * found in the array (if value is a plain object, the array must
  8917. * contain an object of the same shape), or -1 if it is not present.
  8918. */
  8919. function looseIndexOf(arr, val) {
  8920. for (var i = 0; i < arr.length; i++) {
  8921. if (looseEqual(arr[i], val))
  8922. return i;
  8923. }
  8924. return -1;
  8925. }
  8926. /**
  8927. * Ensure a function is called only once.
  8928. */
  8929. function once(fn) {
  8930. var called = false;
  8931. return function () {
  8932. if (!called) {
  8933. called = true;
  8934. fn.apply(this, arguments);
  8935. }
  8936. };
  8937. }
  8938. // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is#polyfill
  8939. function hasChanged(x, y) {
  8940. if (x === y) {
  8941. return x === 0 && 1 / x !== 1 / y;
  8942. }
  8943. else {
  8944. return x === x || y === y;
  8945. }
  8946. }
  8947. var SSR_ATTR = 'data-server-rendered';
  8948. var ASSET_TYPES = ['component', 'directive', 'filter'];
  8949. var LIFECYCLE_HOOKS = [
  8950. 'beforeCreate',
  8951. 'created',
  8952. 'beforeMount',
  8953. 'mounted',
  8954. 'beforeUpdate',
  8955. 'updated',
  8956. 'beforeDestroy',
  8957. 'destroyed',
  8958. 'activated',
  8959. 'deactivated',
  8960. 'errorCaptured',
  8961. 'serverPrefetch',
  8962. 'renderTracked',
  8963. 'renderTriggered'
  8964. ];
  8965. var config = {
  8966. /**
  8967. * Option merge strategies (used in core/util/options)
  8968. */
  8969. // $flow-disable-line
  8970. optionMergeStrategies: Object.create(null),
  8971. /**
  8972. * Whether to suppress warnings.
  8973. */
  8974. silent: false,
  8975. /**
  8976. * Show production mode tip message on boot?
  8977. */
  8978. productionTip: "production" !== 'production',
  8979. /**
  8980. * Whether to enable devtools
  8981. */
  8982. devtools: "production" !== 'production',
  8983. /**
  8984. * Whether to record perf
  8985. */
  8986. performance: false,
  8987. /**
  8988. * Error handler for watcher errors
  8989. */
  8990. errorHandler: null,
  8991. /**
  8992. * Warn handler for watcher warns
  8993. */
  8994. warnHandler: null,
  8995. /**
  8996. * Ignore certain custom elements
  8997. */
  8998. ignoredElements: [],
  8999. /**
  9000. * Custom user key aliases for v-on
  9001. */
  9002. // $flow-disable-line
  9003. keyCodes: Object.create(null),
  9004. /**
  9005. * Check if a tag is reserved so that it cannot be registered as a
  9006. * component. This is platform-dependent and may be overwritten.
  9007. */
  9008. isReservedTag: no,
  9009. /**
  9010. * Check if an attribute is reserved so that it cannot be used as a component
  9011. * prop. This is platform-dependent and may be overwritten.
  9012. */
  9013. isReservedAttr: no,
  9014. /**
  9015. * Check if a tag is an unknown element.
  9016. * Platform-dependent.
  9017. */
  9018. isUnknownElement: no,
  9019. /**
  9020. * Get the namespace of an element
  9021. */
  9022. getTagNamespace: noop,
  9023. /**
  9024. * Parse the real tag name for the specific platform.
  9025. */
  9026. parsePlatformTagName: identity,
  9027. /**
  9028. * Check if an attribute must be bound using property, e.g. value
  9029. * Platform-dependent.
  9030. */
  9031. mustUseProp: no,
  9032. /**
  9033. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  9034. * This will significantly reduce performance if set to false.
  9035. */
  9036. async: true,
  9037. /**
  9038. * Exposed for legacy reasons
  9039. */
  9040. _lifecycleHooks: LIFECYCLE_HOOKS
  9041. };
  9042. /**
  9043. * unicode letters used for parsing html tags, component names and property paths.
  9044. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  9045. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  9046. */
  9047. var unicodeRegExp = /a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;
  9048. /**
  9049. * Check if a string starts with $ or _
  9050. */
  9051. function isReserved(str) {
  9052. var c = (str + '').charCodeAt(0);
  9053. return c === 0x24 || c === 0x5f;
  9054. }
  9055. /**
  9056. * Define a property.
  9057. */
  9058. function def(obj, key, val, enumerable) {
  9059. Object.defineProperty(obj, key, {
  9060. value: val,
  9061. enumerable: !!enumerable,
  9062. writable: true,
  9063. configurable: true
  9064. });
  9065. }
  9066. /**
  9067. * Parse simple path.
  9068. */
  9069. var bailRE = new RegExp("[^".concat(unicodeRegExp.source, ".$_\\d]"));
  9070. function parsePath(path) {
  9071. if (bailRE.test(path)) {
  9072. return;
  9073. }
  9074. var segments = path.split('.');
  9075. return function (obj) {
  9076. for (var i = 0; i < segments.length; i++) {
  9077. if (!obj)
  9078. return;
  9079. obj = obj[segments[i]];
  9080. }
  9081. return obj;
  9082. };
  9083. }
  9084. // can we use __proto__?
  9085. var hasProto = '__proto__' in {};
  9086. // Browser environment sniffing
  9087. var inBrowser = typeof window !== 'undefined';
  9088. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  9089. var isIE = UA && /msie|trident/.test(UA);
  9090. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  9091. var isEdge = UA && UA.indexOf('edge/') > 0;
  9092. UA && UA.indexOf('android') > 0;
  9093. var isIOS = UA && /iphone|ipad|ipod|ios/.test(UA);
  9094. UA && /chrome\/\d+/.test(UA) && !isEdge;
  9095. UA && /phantomjs/.test(UA);
  9096. var isFF = UA && UA.match(/firefox\/(\d+)/);
  9097. // Firefox has a "watch" function on Object.prototype...
  9098. // @ts-expect-error firebox support
  9099. var nativeWatch = {}.watch;
  9100. var supportsPassive = false;
  9101. if (inBrowser) {
  9102. try {
  9103. var opts = {};
  9104. Object.defineProperty(opts, 'passive', {
  9105. get: function () {
  9106. /* istanbul ignore next */
  9107. supportsPassive = true;
  9108. }
  9109. }); // https://github.com/facebook/flow/issues/285
  9110. window.addEventListener('test-passive', null, opts);
  9111. }
  9112. catch (e) { }
  9113. }
  9114. // this needs to be lazy-evaled because vue may be required before
  9115. // vue-server-renderer can set VUE_ENV
  9116. var _isServer;
  9117. var isServerRendering = function () {
  9118. if (_isServer === undefined) {
  9119. /* istanbul ignore if */
  9120. if (!inBrowser && typeof global !== 'undefined') {
  9121. // detect presence of vue-server-renderer and avoid
  9122. // Webpack shimming the process
  9123. _isServer =
  9124. global['process'] && global['process'].env.VUE_ENV === 'server';
  9125. }
  9126. else {
  9127. _isServer = false;
  9128. }
  9129. }
  9130. return _isServer;
  9131. };
  9132. // detect devtools
  9133. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  9134. /* istanbul ignore next */
  9135. function isNative(Ctor) {
  9136. return typeof Ctor === 'function' && /native code/.test(Ctor.toString());
  9137. }
  9138. var hasSymbol = typeof Symbol !== 'undefined' &&
  9139. isNative(Symbol) &&
  9140. typeof Reflect !== 'undefined' &&
  9141. isNative(Reflect.ownKeys);
  9142. var _Set; // $flow-disable-line
  9143. /* istanbul ignore if */ if (typeof Set !== 'undefined' && isNative(Set)) {
  9144. // use native Set when available.
  9145. _Set = Set;
  9146. }
  9147. else {
  9148. // a non-standard Set polyfill that only works with primitive keys.
  9149. _Set = /** @class */ (function () {
  9150. function Set() {
  9151. this.set = Object.create(null);
  9152. }
  9153. Set.prototype.has = function (key) {
  9154. return this.set[key] === true;
  9155. };
  9156. Set.prototype.add = function (key) {
  9157. this.set[key] = true;
  9158. };
  9159. Set.prototype.clear = function () {
  9160. this.set = Object.create(null);
  9161. };
  9162. return Set;
  9163. }());
  9164. }
  9165. var currentInstance = null;
  9166. /**
  9167. * @internal
  9168. */
  9169. function setCurrentInstance(vm) {
  9170. if (vm === void 0) { vm = null; }
  9171. if (!vm)
  9172. currentInstance && currentInstance._scope.off();
  9173. currentInstance = vm;
  9174. vm && vm._scope.on();
  9175. }
  9176. /**
  9177. * @internal
  9178. */
  9179. var VNode = /** @class */ (function () {
  9180. function VNode(tag, data, children, text, elm, context, componentOptions, asyncFactory) {
  9181. this.tag = tag;
  9182. this.data = data;
  9183. this.children = children;
  9184. this.text = text;
  9185. this.elm = elm;
  9186. this.ns = undefined;
  9187. this.context = context;
  9188. this.fnContext = undefined;
  9189. this.fnOptions = undefined;
  9190. this.fnScopeId = undefined;
  9191. this.key = data && data.key;
  9192. this.componentOptions = componentOptions;
  9193. this.componentInstance = undefined;
  9194. this.parent = undefined;
  9195. this.raw = false;
  9196. this.isStatic = false;
  9197. this.isRootInsert = true;
  9198. this.isComment = false;
  9199. this.isCloned = false;
  9200. this.isOnce = false;
  9201. this.asyncFactory = asyncFactory;
  9202. this.asyncMeta = undefined;
  9203. this.isAsyncPlaceholder = false;
  9204. }
  9205. Object.defineProperty(VNode.prototype, "child", {
  9206. // DEPRECATED: alias for componentInstance for backwards compat.
  9207. /* istanbul ignore next */
  9208. get: function () {
  9209. return this.componentInstance;
  9210. },
  9211. enumerable: false,
  9212. configurable: true
  9213. });
  9214. return VNode;
  9215. }());
  9216. var createEmptyVNode = function (text) {
  9217. if (text === void 0) { text = ''; }
  9218. var node = new VNode();
  9219. node.text = text;
  9220. node.isComment = true;
  9221. return node;
  9222. };
  9223. function createTextVNode(val) {
  9224. return new VNode(undefined, undefined, undefined, String(val));
  9225. }
  9226. // optimized shallow clone
  9227. // used for static nodes and slot nodes because they may be reused across
  9228. // multiple renders, cloning them avoids errors when DOM manipulations rely
  9229. // on their elm reference.
  9230. function cloneVNode(vnode) {
  9231. var cloned = new VNode(vnode.tag, vnode.data,
  9232. // #7975
  9233. // clone children array to avoid mutating original in case of cloning
  9234. // a child.
  9235. vnode.children && vnode.children.slice(), vnode.text, vnode.elm, vnode.context, vnode.componentOptions, vnode.asyncFactory);
  9236. cloned.ns = vnode.ns;
  9237. cloned.isStatic = vnode.isStatic;
  9238. cloned.key = vnode.key;
  9239. cloned.isComment = vnode.isComment;
  9240. cloned.fnContext = vnode.fnContext;
  9241. cloned.fnOptions = vnode.fnOptions;
  9242. cloned.fnScopeId = vnode.fnScopeId;
  9243. cloned.asyncMeta = vnode.asyncMeta;
  9244. cloned.isCloned = true;
  9245. return cloned;
  9246. }
  9247. var uid$2 = 0;
  9248. var pendingCleanupDeps = [];
  9249. var cleanupDeps = function () {
  9250. for (var i = 0; i < pendingCleanupDeps.length; i++) {
  9251. var dep = pendingCleanupDeps[i];
  9252. dep.subs = dep.subs.filter(function (s) { return s; });
  9253. dep._pending = false;
  9254. }
  9255. pendingCleanupDeps.length = 0;
  9256. };
  9257. /**
  9258. * A dep is an observable that can have multiple
  9259. * directives subscribing to it.
  9260. * @internal
  9261. */
  9262. var Dep = /** @class */ (function () {
  9263. function Dep() {
  9264. // pending subs cleanup
  9265. this._pending = false;
  9266. this.id = uid$2++;
  9267. this.subs = [];
  9268. }
  9269. Dep.prototype.addSub = function (sub) {
  9270. this.subs.push(sub);
  9271. };
  9272. Dep.prototype.removeSub = function (sub) {
  9273. // #12696 deps with massive amount of subscribers are extremely slow to
  9274. // clean up in Chromium
  9275. // to workaround this, we unset the sub for now, and clear them on
  9276. // next scheduler flush.
  9277. this.subs[this.subs.indexOf(sub)] = null;
  9278. if (!this._pending) {
  9279. this._pending = true;
  9280. pendingCleanupDeps.push(this);
  9281. }
  9282. };
  9283. Dep.prototype.depend = function (info) {
  9284. if (Dep.target) {
  9285. Dep.target.addDep(this);
  9286. }
  9287. };
  9288. Dep.prototype.notify = function (info) {
  9289. // stabilize the subscriber list first
  9290. var subs = this.subs.filter(function (s) { return s; });
  9291. for (var i = 0, l = subs.length; i < l; i++) {
  9292. var sub = subs[i];
  9293. sub.update();
  9294. }
  9295. };
  9296. return Dep;
  9297. }());
  9298. // The current target watcher being evaluated.
  9299. // This is globally unique because only one watcher
  9300. // can be evaluated at a time.
  9301. Dep.target = null;
  9302. var targetStack = [];
  9303. function pushTarget(target) {
  9304. targetStack.push(target);
  9305. Dep.target = target;
  9306. }
  9307. function popTarget() {
  9308. targetStack.pop();
  9309. Dep.target = targetStack[targetStack.length - 1];
  9310. }
  9311. /*
  9312. * not type checking this file because flow doesn't play well with
  9313. * dynamically accessing methods on Array prototype
  9314. */
  9315. var arrayProto = Array.prototype;
  9316. var arrayMethods = Object.create(arrayProto);
  9317. var methodsToPatch = [
  9318. 'push',
  9319. 'pop',
  9320. 'shift',
  9321. 'unshift',
  9322. 'splice',
  9323. 'sort',
  9324. 'reverse'
  9325. ];
  9326. /**
  9327. * Intercept mutating methods and emit events
  9328. */
  9329. methodsToPatch.forEach(function (method) {
  9330. // cache original method
  9331. var original = arrayProto[method];
  9332. def(arrayMethods, method, function mutator() {
  9333. var args = [];
  9334. for (var _i = 0; _i < arguments.length; _i++) {
  9335. args[_i] = arguments[_i];
  9336. }
  9337. var result = original.apply(this, args);
  9338. var ob = this.__ob__;
  9339. var inserted;
  9340. switch (method) {
  9341. case 'push':
  9342. case 'unshift':
  9343. inserted = args;
  9344. break;
  9345. case 'splice':
  9346. inserted = args.slice(2);
  9347. break;
  9348. }
  9349. if (inserted)
  9350. ob.observeArray(inserted);
  9351. // notify change
  9352. {
  9353. ob.dep.notify();
  9354. }
  9355. return result;
  9356. });
  9357. });
  9358. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  9359. var NO_INIITIAL_VALUE = {};
  9360. /**
  9361. * In some cases we may want to disable observation inside a component's
  9362. * update computation.
  9363. */
  9364. var shouldObserve = true;
  9365. function toggleObserving(value) {
  9366. shouldObserve = value;
  9367. }
  9368. // ssr mock dep
  9369. var mockDep = {
  9370. notify: noop,
  9371. depend: noop,
  9372. addSub: noop,
  9373. removeSub: noop
  9374. };
  9375. /**
  9376. * Observer class that is attached to each observed
  9377. * object. Once attached, the observer converts the target
  9378. * object's property keys into getter/setters that
  9379. * collect dependencies and dispatch updates.
  9380. */
  9381. var Observer = /** @class */ (function () {
  9382. function Observer(value, shallow, mock) {
  9383. if (shallow === void 0) { shallow = false; }
  9384. if (mock === void 0) { mock = false; }
  9385. this.value = value;
  9386. this.shallow = shallow;
  9387. this.mock = mock;
  9388. // this.value = value
  9389. this.dep = mock ? mockDep : new Dep();
  9390. this.vmCount = 0;
  9391. def(value, '__ob__', this);
  9392. if (isArray(value)) {
  9393. if (!mock) {
  9394. if (hasProto) {
  9395. value.__proto__ = arrayMethods;
  9396. /* eslint-enable no-proto */
  9397. }
  9398. else {
  9399. for (var i = 0, l = arrayKeys.length; i < l; i++) {
  9400. var key = arrayKeys[i];
  9401. def(value, key, arrayMethods[key]);
  9402. }
  9403. }
  9404. }
  9405. if (!shallow) {
  9406. this.observeArray(value);
  9407. }
  9408. }
  9409. else {
  9410. /**
  9411. * Walk through all properties and convert them into
  9412. * getter/setters. This method should only be called when
  9413. * value type is Object.
  9414. */
  9415. var keys = Object.keys(value);
  9416. for (var i = 0; i < keys.length; i++) {
  9417. var key = keys[i];
  9418. defineReactive(value, key, NO_INIITIAL_VALUE, undefined, shallow, mock);
  9419. }
  9420. }
  9421. }
  9422. /**
  9423. * Observe a list of Array items.
  9424. */
  9425. Observer.prototype.observeArray = function (value) {
  9426. for (var i = 0, l = value.length; i < l; i++) {
  9427. observe(value[i], false, this.mock);
  9428. }
  9429. };
  9430. return Observer;
  9431. }());
  9432. // helpers
  9433. /**
  9434. * Attempt to create an observer instance for a value,
  9435. * returns the new observer if successfully observed,
  9436. * or the existing observer if the value already has one.
  9437. */
  9438. function observe(value, shallow, ssrMockReactivity) {
  9439. if (value && hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  9440. return value.__ob__;
  9441. }
  9442. if (shouldObserve &&
  9443. (ssrMockReactivity || !isServerRendering()) &&
  9444. (isArray(value) || isPlainObject(value)) &&
  9445. Object.isExtensible(value) &&
  9446. !value.__v_skip /* ReactiveFlags.SKIP */ &&
  9447. !isRef(value) &&
  9448. !(value instanceof VNode)) {
  9449. return new Observer(value, shallow, ssrMockReactivity);
  9450. }
  9451. }
  9452. /**
  9453. * Define a reactive property on an Object.
  9454. */
  9455. function defineReactive(obj, key, val, customSetter, shallow, mock) {
  9456. var dep = new Dep();
  9457. var property = Object.getOwnPropertyDescriptor(obj, key);
  9458. if (property && property.configurable === false) {
  9459. return;
  9460. }
  9461. // cater for pre-defined getter/setters
  9462. var getter = property && property.get;
  9463. var setter = property && property.set;
  9464. if ((!getter || setter) &&
  9465. (val === NO_INIITIAL_VALUE || arguments.length === 2)) {
  9466. val = obj[key];
  9467. }
  9468. var childOb = !shallow && observe(val, false, mock);
  9469. Object.defineProperty(obj, key, {
  9470. enumerable: true,
  9471. configurable: true,
  9472. get: function reactiveGetter() {
  9473. var value = getter ? getter.call(obj) : val;
  9474. if (Dep.target) {
  9475. {
  9476. dep.depend();
  9477. }
  9478. if (childOb) {
  9479. childOb.dep.depend();
  9480. if (isArray(value)) {
  9481. dependArray(value);
  9482. }
  9483. }
  9484. }
  9485. return isRef(value) && !shallow ? value.value : value;
  9486. },
  9487. set: function reactiveSetter(newVal) {
  9488. var value = getter ? getter.call(obj) : val;
  9489. if (!hasChanged(value, newVal)) {
  9490. return;
  9491. }
  9492. if (setter) {
  9493. setter.call(obj, newVal);
  9494. }
  9495. else if (getter) {
  9496. // #7981: for accessor properties without setter
  9497. return;
  9498. }
  9499. else if (!shallow && isRef(value) && !isRef(newVal)) {
  9500. value.value = newVal;
  9501. return;
  9502. }
  9503. else {
  9504. val = newVal;
  9505. }
  9506. childOb = !shallow && observe(newVal, false, mock);
  9507. {
  9508. dep.notify();
  9509. }
  9510. }
  9511. });
  9512. return dep;
  9513. }
  9514. function set(target, key, val) {
  9515. if (isReadonly(target)) {
  9516. return;
  9517. }
  9518. var ob = target.__ob__;
  9519. if (isArray(target) && isValidArrayIndex(key)) {
  9520. target.length = Math.max(target.length, key);
  9521. target.splice(key, 1, val);
  9522. // when mocking for SSR, array methods are not hijacked
  9523. if (ob && !ob.shallow && ob.mock) {
  9524. observe(val, false, true);
  9525. }
  9526. return val;
  9527. }
  9528. if (key in target && !(key in Object.prototype)) {
  9529. target[key] = val;
  9530. return val;
  9531. }
  9532. if (target._isVue || (ob && ob.vmCount)) {
  9533. return val;
  9534. }
  9535. if (!ob) {
  9536. target[key] = val;
  9537. return val;
  9538. }
  9539. defineReactive(ob.value, key, val, undefined, ob.shallow, ob.mock);
  9540. {
  9541. ob.dep.notify();
  9542. }
  9543. return val;
  9544. }
  9545. function del(target, key) {
  9546. if (isArray(target) && isValidArrayIndex(key)) {
  9547. target.splice(key, 1);
  9548. return;
  9549. }
  9550. var ob = target.__ob__;
  9551. if (target._isVue || (ob && ob.vmCount)) {
  9552. return;
  9553. }
  9554. if (isReadonly(target)) {
  9555. return;
  9556. }
  9557. if (!hasOwn(target, key)) {
  9558. return;
  9559. }
  9560. delete target[key];
  9561. if (!ob) {
  9562. return;
  9563. }
  9564. {
  9565. ob.dep.notify();
  9566. }
  9567. }
  9568. /**
  9569. * Collect dependencies on array elements when the array is touched, since
  9570. * we cannot intercept array element access like property getters.
  9571. */
  9572. function dependArray(value) {
  9573. for (var e = void 0, i = 0, l = value.length; i < l; i++) {
  9574. e = value[i];
  9575. if (e && e.__ob__) {
  9576. e.__ob__.dep.depend();
  9577. }
  9578. if (isArray(e)) {
  9579. dependArray(e);
  9580. }
  9581. }
  9582. }
  9583. /**
  9584. * Return a shallowly-reactive copy of the original object, where only the root
  9585. * level properties are reactive. It also does not auto-unwrap refs (even at the
  9586. * root level).
  9587. */
  9588. function shallowReactive(target) {
  9589. makeReactive(target, true);
  9590. def(target, "__v_isShallow" /* ReactiveFlags.IS_SHALLOW */, true);
  9591. return target;
  9592. }
  9593. function makeReactive(target, shallow) {
  9594. // if trying to observe a readonly proxy, return the readonly version.
  9595. if (!isReadonly(target)) {
  9596. observe(target, shallow, isServerRendering() /* ssr mock reactivity */);
  9597. }
  9598. }
  9599. function isReadonly(value) {
  9600. return !!(value && value.__v_isReadonly);
  9601. }
  9602. function isRef(r) {
  9603. return !!(r && r.__v_isRef === true);
  9604. }
  9605. function proxyWithRefUnwrap(target, source, key) {
  9606. Object.defineProperty(target, key, {
  9607. enumerable: true,
  9608. configurable: true,
  9609. get: function () {
  9610. var val = source[key];
  9611. if (isRef(val)) {
  9612. return val.value;
  9613. }
  9614. else {
  9615. var ob = val && val.__ob__;
  9616. if (ob)
  9617. ob.dep.depend();
  9618. return val;
  9619. }
  9620. },
  9621. set: function (value) {
  9622. var oldValue = source[key];
  9623. if (isRef(oldValue) && !isRef(value)) {
  9624. oldValue.value = value;
  9625. }
  9626. else {
  9627. source[key] = value;
  9628. }
  9629. }
  9630. });
  9631. }
  9632. var activeEffectScope;
  9633. var EffectScope = /** @class */ (function () {
  9634. function EffectScope(detached) {
  9635. if (detached === void 0) { detached = false; }
  9636. this.detached = detached;
  9637. /**
  9638. * @internal
  9639. */
  9640. this.active = true;
  9641. /**
  9642. * @internal
  9643. */
  9644. this.effects = [];
  9645. /**
  9646. * @internal
  9647. */
  9648. this.cleanups = [];
  9649. this.parent = activeEffectScope;
  9650. if (!detached && activeEffectScope) {
  9651. this.index =
  9652. (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(this) - 1;
  9653. }
  9654. }
  9655. EffectScope.prototype.run = function (fn) {
  9656. if (this.active) {
  9657. var currentEffectScope = activeEffectScope;
  9658. try {
  9659. activeEffectScope = this;
  9660. return fn();
  9661. }
  9662. finally {
  9663. activeEffectScope = currentEffectScope;
  9664. }
  9665. }
  9666. };
  9667. /**
  9668. * This should only be called on non-detached scopes
  9669. * @internal
  9670. */
  9671. EffectScope.prototype.on = function () {
  9672. activeEffectScope = this;
  9673. };
  9674. /**
  9675. * This should only be called on non-detached scopes
  9676. * @internal
  9677. */
  9678. EffectScope.prototype.off = function () {
  9679. activeEffectScope = this.parent;
  9680. };
  9681. EffectScope.prototype.stop = function (fromParent) {
  9682. if (this.active) {
  9683. var i = void 0, l = void 0;
  9684. for (i = 0, l = this.effects.length; i < l; i++) {
  9685. this.effects[i].teardown();
  9686. }
  9687. for (i = 0, l = this.cleanups.length; i < l; i++) {
  9688. this.cleanups[i]();
  9689. }
  9690. if (this.scopes) {
  9691. for (i = 0, l = this.scopes.length; i < l; i++) {
  9692. this.scopes[i].stop(true);
  9693. }
  9694. }
  9695. // nested scope, dereference from parent to avoid memory leaks
  9696. if (!this.detached && this.parent && !fromParent) {
  9697. // optimized O(1) removal
  9698. var last = this.parent.scopes.pop();
  9699. if (last && last !== this) {
  9700. this.parent.scopes[this.index] = last;
  9701. last.index = this.index;
  9702. }
  9703. }
  9704. this.parent = undefined;
  9705. this.active = false;
  9706. }
  9707. };
  9708. return EffectScope;
  9709. }());
  9710. /**
  9711. * @internal
  9712. */
  9713. function recordEffectScope(effect, scope) {
  9714. if (scope === void 0) { scope = activeEffectScope; }
  9715. if (scope && scope.active) {
  9716. scope.effects.push(effect);
  9717. }
  9718. }
  9719. function resolveProvided(vm) {
  9720. // by default an instance inherits its parent's provides object
  9721. // but when it needs to provide values of its own, it creates its
  9722. // own provides object using parent provides object as prototype.
  9723. // this way in `inject` we can simply look up injections from direct
  9724. // parent and let the prototype chain do the work.
  9725. var existing = vm._provided;
  9726. var parentProvides = vm.$parent && vm.$parent._provided;
  9727. if (parentProvides === existing) {
  9728. return (vm._provided = Object.create(parentProvides));
  9729. }
  9730. else {
  9731. return existing;
  9732. }
  9733. }
  9734. var normalizeEvent = cached(function (name) {
  9735. var passive = name.charAt(0) === '&';
  9736. name = passive ? name.slice(1) : name;
  9737. var once = name.charAt(0) === '~'; // Prefixed last, checked first
  9738. name = once ? name.slice(1) : name;
  9739. var capture = name.charAt(0) === '!';
  9740. name = capture ? name.slice(1) : name;
  9741. return {
  9742. name: name,
  9743. once: once,
  9744. capture: capture,
  9745. passive: passive
  9746. };
  9747. });
  9748. function createFnInvoker(fns, vm) {
  9749. function invoker() {
  9750. var fns = invoker.fns;
  9751. if (isArray(fns)) {
  9752. var cloned = fns.slice();
  9753. for (var i = 0; i < cloned.length; i++) {
  9754. invokeWithErrorHandling(cloned[i], null, arguments, vm, "v-on handler");
  9755. }
  9756. }
  9757. else {
  9758. // return handler return value for single handlers
  9759. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler");
  9760. }
  9761. }
  9762. invoker.fns = fns;
  9763. return invoker;
  9764. }
  9765. function updateListeners(on, oldOn, add, remove, createOnceHandler, vm) {
  9766. var name, cur, old, event;
  9767. for (name in on) {
  9768. cur = on[name];
  9769. old = oldOn[name];
  9770. event = normalizeEvent(name);
  9771. if (isUndef(cur)) ;
  9772. else if (isUndef(old)) {
  9773. if (isUndef(cur.fns)) {
  9774. cur = on[name] = createFnInvoker(cur, vm);
  9775. }
  9776. if (isTrue(event.once)) {
  9777. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  9778. }
  9779. add(event.name, cur, event.capture, event.passive, event.params);
  9780. }
  9781. else if (cur !== old) {
  9782. old.fns = cur;
  9783. on[name] = old;
  9784. }
  9785. }
  9786. for (name in oldOn) {
  9787. if (isUndef(on[name])) {
  9788. event = normalizeEvent(name);
  9789. remove(event.name, oldOn[name], event.capture);
  9790. }
  9791. }
  9792. }
  9793. function mergeVNodeHook(def, hookKey, hook) {
  9794. if (def instanceof VNode) {
  9795. def = def.data.hook || (def.data.hook = {});
  9796. }
  9797. var invoker;
  9798. var oldHook = def[hookKey];
  9799. function wrappedHook() {
  9800. hook.apply(this, arguments);
  9801. // important: remove merged hook to ensure it's called only once
  9802. // and prevent memory leak
  9803. remove$2(invoker.fns, wrappedHook);
  9804. }
  9805. if (isUndef(oldHook)) {
  9806. // no existing hook
  9807. invoker = createFnInvoker([wrappedHook]);
  9808. }
  9809. else {
  9810. /* istanbul ignore if */
  9811. if (isDef(oldHook.fns) && isTrue(oldHook.merged)) {
  9812. // already a merged invoker
  9813. invoker = oldHook;
  9814. invoker.fns.push(wrappedHook);
  9815. }
  9816. else {
  9817. // existing plain hook
  9818. invoker = createFnInvoker([oldHook, wrappedHook]);
  9819. }
  9820. }
  9821. invoker.merged = true;
  9822. def[hookKey] = invoker;
  9823. }
  9824. function extractPropsFromVNodeData(data, Ctor, tag) {
  9825. // we are only extracting raw values here.
  9826. // validation and default values are handled in the child
  9827. // component itself.
  9828. var propOptions = Ctor.options.props;
  9829. if (isUndef(propOptions)) {
  9830. return;
  9831. }
  9832. var res = {};
  9833. var attrs = data.attrs, props = data.props;
  9834. if (isDef(attrs) || isDef(props)) {
  9835. for (var key in propOptions) {
  9836. var altKey = hyphenate(key);
  9837. checkProp(res, props, key, altKey, true) ||
  9838. checkProp(res, attrs, key, altKey, false);
  9839. }
  9840. }
  9841. return res;
  9842. }
  9843. function checkProp(res, hash, key, altKey, preserve) {
  9844. if (isDef(hash)) {
  9845. if (hasOwn(hash, key)) {
  9846. res[key] = hash[key];
  9847. if (!preserve) {
  9848. delete hash[key];
  9849. }
  9850. return true;
  9851. }
  9852. else if (hasOwn(hash, altKey)) {
  9853. res[key] = hash[altKey];
  9854. if (!preserve) {
  9855. delete hash[altKey];
  9856. }
  9857. return true;
  9858. }
  9859. }
  9860. return false;
  9861. }
  9862. // The template compiler attempts to minimize the need for normalization by
  9863. // statically analyzing the template at compile time.
  9864. //
  9865. // For plain HTML markup, normalization can be completely skipped because the
  9866. // generated render function is guaranteed to return Array<VNode>. There are
  9867. // two cases where extra normalization is needed:
  9868. // 1. When the children contains components - because a functional component
  9869. // may return an Array instead of a single root. In this case, just a simple
  9870. // normalization is needed - if any child is an Array, we flatten the whole
  9871. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  9872. // because functional components already normalize their own children.
  9873. function simpleNormalizeChildren(children) {
  9874. for (var i = 0; i < children.length; i++) {
  9875. if (isArray(children[i])) {
  9876. return Array.prototype.concat.apply([], children);
  9877. }
  9878. }
  9879. return children;
  9880. }
  9881. // 2. When the children contains constructs that always generated nested Arrays,
  9882. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  9883. // with hand-written render functions / JSX. In such cases a full normalization
  9884. // is needed to cater to all possible types of children values.
  9885. function normalizeChildren(children) {
  9886. return isPrimitive(children)
  9887. ? [createTextVNode(children)]
  9888. : isArray(children)
  9889. ? normalizeArrayChildren(children)
  9890. : undefined;
  9891. }
  9892. function isTextNode(node) {
  9893. return isDef(node) && isDef(node.text) && isFalse(node.isComment);
  9894. }
  9895. function normalizeArrayChildren(children, nestedIndex) {
  9896. var res = [];
  9897. var i, c, lastIndex, last;
  9898. for (i = 0; i < children.length; i++) {
  9899. c = children[i];
  9900. if (isUndef(c) || typeof c === 'boolean')
  9901. continue;
  9902. lastIndex = res.length - 1;
  9903. last = res[lastIndex];
  9904. // nested
  9905. if (isArray(c)) {
  9906. if (c.length > 0) {
  9907. c = normalizeArrayChildren(c, "".concat(nestedIndex || '', "_").concat(i));
  9908. // merge adjacent text nodes
  9909. if (isTextNode(c[0]) && isTextNode(last)) {
  9910. res[lastIndex] = createTextVNode(last.text + c[0].text);
  9911. c.shift();
  9912. }
  9913. res.push.apply(res, c);
  9914. }
  9915. }
  9916. else if (isPrimitive(c)) {
  9917. if (isTextNode(last)) {
  9918. // merge adjacent text nodes
  9919. // this is necessary for SSR hydration because text nodes are
  9920. // essentially merged when rendered to HTML strings
  9921. res[lastIndex] = createTextVNode(last.text + c);
  9922. }
  9923. else if (c !== '') {
  9924. // convert primitive to vnode
  9925. res.push(createTextVNode(c));
  9926. }
  9927. }
  9928. else {
  9929. if (isTextNode(c) && isTextNode(last)) {
  9930. // merge adjacent text nodes
  9931. res[lastIndex] = createTextVNode(last.text + c.text);
  9932. }
  9933. else {
  9934. // default key for nested array children (likely generated by v-for)
  9935. if (isTrue(children._isVList) &&
  9936. isDef(c.tag) &&
  9937. isUndef(c.key) &&
  9938. isDef(nestedIndex)) {
  9939. c.key = "__vlist".concat(nestedIndex, "_").concat(i, "__");
  9940. }
  9941. res.push(c);
  9942. }
  9943. }
  9944. }
  9945. return res;
  9946. }
  9947. /**
  9948. * Runtime helper for rendering v-for lists.
  9949. */
  9950. function renderList(val, render) {
  9951. var ret = null, i, l, keys, key;
  9952. if (isArray(val) || typeof val === 'string') {
  9953. ret = new Array(val.length);
  9954. for (i = 0, l = val.length; i < l; i++) {
  9955. ret[i] = render(val[i], i);
  9956. }
  9957. }
  9958. else if (typeof val === 'number') {
  9959. ret = new Array(val);
  9960. for (i = 0; i < val; i++) {
  9961. ret[i] = render(i + 1, i);
  9962. }
  9963. }
  9964. else if (isObject(val)) {
  9965. if (hasSymbol && val[Symbol.iterator]) {
  9966. ret = [];
  9967. var iterator = val[Symbol.iterator]();
  9968. var result = iterator.next();
  9969. while (!result.done) {
  9970. ret.push(render(result.value, ret.length));
  9971. result = iterator.next();
  9972. }
  9973. }
  9974. else {
  9975. keys = Object.keys(val);
  9976. ret = new Array(keys.length);
  9977. for (i = 0, l = keys.length; i < l; i++) {
  9978. key = keys[i];
  9979. ret[i] = render(val[key], key, i);
  9980. }
  9981. }
  9982. }
  9983. if (!isDef(ret)) {
  9984. ret = [];
  9985. }
  9986. ret._isVList = true;
  9987. return ret;
  9988. }
  9989. /**
  9990. * Runtime helper for rendering <slot>
  9991. */
  9992. function renderSlot(name, fallbackRender, props, bindObject) {
  9993. var scopedSlotFn = this.$scopedSlots[name];
  9994. var nodes;
  9995. if (scopedSlotFn) {
  9996. // scoped slot
  9997. props = props || {};
  9998. if (bindObject) {
  9999. props = extend(extend({}, bindObject), props);
  10000. }
  10001. nodes =
  10002. scopedSlotFn(props) ||
  10003. (isFunction(fallbackRender) ? fallbackRender() : fallbackRender);
  10004. }
  10005. else {
  10006. nodes =
  10007. this.$slots[name] ||
  10008. (isFunction(fallbackRender) ? fallbackRender() : fallbackRender);
  10009. }
  10010. var target = props && props.slot;
  10011. if (target) {
  10012. return this.$createElement('template', { slot: target }, nodes);
  10013. }
  10014. else {
  10015. return nodes;
  10016. }
  10017. }
  10018. /**
  10019. * Runtime helper for resolving filters
  10020. */
  10021. function resolveFilter(id) {
  10022. return resolveAsset(this.$options, 'filters', id) || identity;
  10023. }
  10024. function isKeyNotMatch(expect, actual) {
  10025. if (isArray(expect)) {
  10026. return expect.indexOf(actual) === -1;
  10027. }
  10028. else {
  10029. return expect !== actual;
  10030. }
  10031. }
  10032. /**
  10033. * Runtime helper for checking keyCodes from config.
  10034. * exposed as Vue.prototype._k
  10035. * passing in eventKeyName as last argument separately for backwards compat
  10036. */
  10037. function checkKeyCodes(eventKeyCode, key, builtInKeyCode, eventKeyName, builtInKeyName) {
  10038. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  10039. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  10040. return isKeyNotMatch(builtInKeyName, eventKeyName);
  10041. }
  10042. else if (mappedKeyCode) {
  10043. return isKeyNotMatch(mappedKeyCode, eventKeyCode);
  10044. }
  10045. else if (eventKeyName) {
  10046. return hyphenate(eventKeyName) !== key;
  10047. }
  10048. return eventKeyCode === undefined;
  10049. }
  10050. /**
  10051. * Runtime helper for merging v-bind="object" into a VNode's data.
  10052. */
  10053. function bindObjectProps(data, tag, value, asProp, isSync) {
  10054. if (value) {
  10055. if (!isObject(value)) ;
  10056. else {
  10057. if (isArray(value)) {
  10058. value = toObject(value);
  10059. }
  10060. var hash = void 0;
  10061. var _loop_1 = function (key) {
  10062. if (key === 'class' || key === 'style' || isReservedAttribute(key)) {
  10063. hash = data;
  10064. }
  10065. else {
  10066. var type = data.attrs && data.attrs.type;
  10067. hash =
  10068. asProp || config.mustUseProp(tag, type, key)
  10069. ? data.domProps || (data.domProps = {})
  10070. : data.attrs || (data.attrs = {});
  10071. }
  10072. var camelizedKey = camelize(key);
  10073. var hyphenatedKey = hyphenate(key);
  10074. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  10075. hash[key] = value[key];
  10076. if (isSync) {
  10077. var on = data.on || (data.on = {});
  10078. on["update:".concat(key)] = function ($event) {
  10079. value[key] = $event;
  10080. };
  10081. }
  10082. }
  10083. };
  10084. for (var key in value) {
  10085. _loop_1(key);
  10086. }
  10087. }
  10088. }
  10089. return data;
  10090. }
  10091. /**
  10092. * Runtime helper for rendering static trees.
  10093. */
  10094. function renderStatic(index, isInFor) {
  10095. var cached = this._staticTrees || (this._staticTrees = []);
  10096. var tree = cached[index];
  10097. // if has already-rendered static tree and not inside v-for,
  10098. // we can reuse the same tree.
  10099. if (tree && !isInFor) {
  10100. return tree;
  10101. }
  10102. // otherwise, render a fresh tree.
  10103. tree = cached[index] = this.$options.staticRenderFns[index].call(this._renderProxy, this._c, this // for render fns generated for functional component templates
  10104. );
  10105. markStatic(tree, "__static__".concat(index), false);
  10106. return tree;
  10107. }
  10108. /**
  10109. * Runtime helper for v-once.
  10110. * Effectively it means marking the node as static with a unique key.
  10111. */
  10112. function markOnce(tree, index, key) {
  10113. markStatic(tree, "__once__".concat(index).concat(key ? "_".concat(key) : ""), true);
  10114. return tree;
  10115. }
  10116. function markStatic(tree, key, isOnce) {
  10117. if (isArray(tree)) {
  10118. for (var i = 0; i < tree.length; i++) {
  10119. if (tree[i] && typeof tree[i] !== 'string') {
  10120. markStaticNode(tree[i], "".concat(key, "_").concat(i), isOnce);
  10121. }
  10122. }
  10123. }
  10124. else {
  10125. markStaticNode(tree, key, isOnce);
  10126. }
  10127. }
  10128. function markStaticNode(node, key, isOnce) {
  10129. node.isStatic = true;
  10130. node.key = key;
  10131. node.isOnce = isOnce;
  10132. }
  10133. function bindObjectListeners(data, value) {
  10134. if (value) {
  10135. if (!isPlainObject(value)) ;
  10136. else {
  10137. var on = (data.on = data.on ? extend({}, data.on) : {});
  10138. for (var key in value) {
  10139. var existing = on[key];
  10140. var ours = value[key];
  10141. on[key] = existing ? [].concat(existing, ours) : ours;
  10142. }
  10143. }
  10144. }
  10145. return data;
  10146. }
  10147. function resolveScopedSlots(fns, res,
  10148. // the following are added in 2.6
  10149. hasDynamicKeys, contentHashKey) {
  10150. res = res || { $stable: !hasDynamicKeys };
  10151. for (var i = 0; i < fns.length; i++) {
  10152. var slot = fns[i];
  10153. if (isArray(slot)) {
  10154. resolveScopedSlots(slot, res, hasDynamicKeys);
  10155. }
  10156. else if (slot) {
  10157. // marker for reverse proxying v-slot without scope on this.$slots
  10158. // @ts-expect-error
  10159. if (slot.proxy) {
  10160. // @ts-expect-error
  10161. slot.fn.proxy = true;
  10162. }
  10163. res[slot.key] = slot.fn;
  10164. }
  10165. }
  10166. if (contentHashKey) {
  10167. res.$key = contentHashKey;
  10168. }
  10169. return res;
  10170. }
  10171. // helper to process dynamic keys for dynamic arguments in v-bind and v-on.
  10172. function bindDynamicKeys(baseObj, values) {
  10173. for (var i = 0; i < values.length; i += 2) {
  10174. var key = values[i];
  10175. if (typeof key === 'string' && key) {
  10176. baseObj[values[i]] = values[i + 1];
  10177. }
  10178. }
  10179. return baseObj;
  10180. }
  10181. // helper to dynamically append modifier runtime markers to event names.
  10182. // ensure only append when value is already string, otherwise it will be cast
  10183. // to string and cause the type check to miss.
  10184. function prependModifier(value, symbol) {
  10185. return typeof value === 'string' ? symbol + value : value;
  10186. }
  10187. function installRenderHelpers(target) {
  10188. target._o = markOnce;
  10189. target._n = toNumber;
  10190. target._s = toString;
  10191. target._l = renderList;
  10192. target._t = renderSlot;
  10193. target._q = looseEqual;
  10194. target._i = looseIndexOf;
  10195. target._m = renderStatic;
  10196. target._f = resolveFilter;
  10197. target._k = checkKeyCodes;
  10198. target._b = bindObjectProps;
  10199. target._v = createTextVNode;
  10200. target._e = createEmptyVNode;
  10201. target._u = resolveScopedSlots;
  10202. target._g = bindObjectListeners;
  10203. target._d = bindDynamicKeys;
  10204. target._p = prependModifier;
  10205. }
  10206. /**
  10207. * Runtime helper for resolving raw children VNodes into a slot object.
  10208. */
  10209. function resolveSlots(children, context) {
  10210. if (!children || !children.length) {
  10211. return {};
  10212. }
  10213. var slots = {};
  10214. for (var i = 0, l = children.length; i < l; i++) {
  10215. var child = children[i];
  10216. var data = child.data;
  10217. // remove slot attribute if the node is resolved as a Vue slot node
  10218. if (data && data.attrs && data.attrs.slot) {
  10219. delete data.attrs.slot;
  10220. }
  10221. // named slots should only be respected if the vnode was rendered in the
  10222. // same context.
  10223. if ((child.context === context || child.fnContext === context) &&
  10224. data &&
  10225. data.slot != null) {
  10226. var name_1 = data.slot;
  10227. var slot = slots[name_1] || (slots[name_1] = []);
  10228. if (child.tag === 'template') {
  10229. slot.push.apply(slot, child.children || []);
  10230. }
  10231. else {
  10232. slot.push(child);
  10233. }
  10234. }
  10235. else {
  10236. (slots.default || (slots.default = [])).push(child);
  10237. }
  10238. }
  10239. // ignore slots that contains only whitespace
  10240. for (var name_2 in slots) {
  10241. if (slots[name_2].every(isWhitespace)) {
  10242. delete slots[name_2];
  10243. }
  10244. }
  10245. return slots;
  10246. }
  10247. function isWhitespace(node) {
  10248. return (node.isComment && !node.asyncFactory) || node.text === ' ';
  10249. }
  10250. function isAsyncPlaceholder(node) {
  10251. // @ts-expect-error not really boolean type
  10252. return node.isComment && node.asyncFactory;
  10253. }
  10254. function normalizeScopedSlots(ownerVm, scopedSlots, normalSlots, prevScopedSlots) {
  10255. var res;
  10256. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  10257. var isStable = scopedSlots ? !!scopedSlots.$stable : !hasNormalSlots;
  10258. var key = scopedSlots && scopedSlots.$key;
  10259. if (!scopedSlots) {
  10260. res = {};
  10261. }
  10262. else if (scopedSlots._normalized) {
  10263. // fast path 1: child component re-render only, parent did not change
  10264. return scopedSlots._normalized;
  10265. }
  10266. else if (isStable &&
  10267. prevScopedSlots &&
  10268. prevScopedSlots !== emptyObject &&
  10269. key === prevScopedSlots.$key &&
  10270. !hasNormalSlots &&
  10271. !prevScopedSlots.$hasNormal) {
  10272. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  10273. // only need to normalize once
  10274. return prevScopedSlots;
  10275. }
  10276. else {
  10277. res = {};
  10278. for (var key_1 in scopedSlots) {
  10279. if (scopedSlots[key_1] && key_1[0] !== '$') {
  10280. res[key_1] = normalizeScopedSlot(ownerVm, normalSlots, key_1, scopedSlots[key_1]);
  10281. }
  10282. }
  10283. }
  10284. // expose normal slots on scopedSlots
  10285. for (var key_2 in normalSlots) {
  10286. if (!(key_2 in res)) {
  10287. res[key_2] = proxyNormalSlot(normalSlots, key_2);
  10288. }
  10289. }
  10290. // avoriaz seems to mock a non-extensible $scopedSlots object
  10291. // and when that is passed down this would cause an error
  10292. if (scopedSlots && Object.isExtensible(scopedSlots)) {
  10293. scopedSlots._normalized = res;
  10294. }
  10295. def(res, '$stable', isStable);
  10296. def(res, '$key', key);
  10297. def(res, '$hasNormal', hasNormalSlots);
  10298. return res;
  10299. }
  10300. function normalizeScopedSlot(vm, normalSlots, key, fn) {
  10301. var normalized = function () {
  10302. var cur = currentInstance;
  10303. setCurrentInstance(vm);
  10304. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  10305. res =
  10306. res && typeof res === 'object' && !isArray(res)
  10307. ? [res] // single vnode
  10308. : normalizeChildren(res);
  10309. var vnode = res && res[0];
  10310. setCurrentInstance(cur);
  10311. return res &&
  10312. (!vnode ||
  10313. (res.length === 1 && vnode.isComment && !isAsyncPlaceholder(vnode))) // #9658, #10391
  10314. ? undefined
  10315. : res;
  10316. };
  10317. // this is a slot using the new v-slot syntax without scope. although it is
  10318. // compiled as a scoped slot, render fn users would expect it to be present
  10319. // on this.$slots because the usage is semantically a normal slot.
  10320. if (fn.proxy) {
  10321. Object.defineProperty(normalSlots, key, {
  10322. get: normalized,
  10323. enumerable: true,
  10324. configurable: true
  10325. });
  10326. }
  10327. return normalized;
  10328. }
  10329. function proxyNormalSlot(slots, key) {
  10330. return function () { return slots[key]; };
  10331. }
  10332. function initSetup(vm) {
  10333. var options = vm.$options;
  10334. var setup = options.setup;
  10335. if (setup) {
  10336. var ctx = (vm._setupContext = createSetupContext(vm));
  10337. setCurrentInstance(vm);
  10338. pushTarget();
  10339. var setupResult = invokeWithErrorHandling(setup, null, [vm._props || shallowReactive({}), ctx], vm, "setup");
  10340. popTarget();
  10341. setCurrentInstance();
  10342. if (isFunction(setupResult)) {
  10343. // render function
  10344. // @ts-ignore
  10345. options.render = setupResult;
  10346. }
  10347. else if (isObject(setupResult)) {
  10348. vm._setupState = setupResult;
  10349. // __sfc indicates compiled bindings from <script setup>
  10350. if (!setupResult.__sfc) {
  10351. for (var key in setupResult) {
  10352. if (!isReserved(key)) {
  10353. proxyWithRefUnwrap(vm, setupResult, key);
  10354. }
  10355. }
  10356. }
  10357. else {
  10358. // exposed for compiled render fn
  10359. var proxy = (vm._setupProxy = {});
  10360. for (var key in setupResult) {
  10361. if (key !== '__sfc') {
  10362. proxyWithRefUnwrap(proxy, setupResult, key);
  10363. }
  10364. }
  10365. }
  10366. }
  10367. else ;
  10368. }
  10369. }
  10370. function createSetupContext(vm) {
  10371. return {
  10372. get attrs() {
  10373. if (!vm._attrsProxy) {
  10374. var proxy = (vm._attrsProxy = {});
  10375. def(proxy, '_v_attr_proxy', true);
  10376. syncSetupProxy(proxy, vm.$attrs, emptyObject, vm, '$attrs');
  10377. }
  10378. return vm._attrsProxy;
  10379. },
  10380. get listeners() {
  10381. if (!vm._listenersProxy) {
  10382. var proxy = (vm._listenersProxy = {});
  10383. syncSetupProxy(proxy, vm.$listeners, emptyObject, vm, '$listeners');
  10384. }
  10385. return vm._listenersProxy;
  10386. },
  10387. get slots() {
  10388. return initSlotsProxy(vm);
  10389. },
  10390. emit: bind(vm.$emit, vm),
  10391. expose: function (exposed) {
  10392. if (exposed) {
  10393. Object.keys(exposed).forEach(function (key) {
  10394. return proxyWithRefUnwrap(vm, exposed, key);
  10395. });
  10396. }
  10397. }
  10398. };
  10399. }
  10400. function syncSetupProxy(to, from, prev, instance, type) {
  10401. var changed = false;
  10402. for (var key in from) {
  10403. if (!(key in to)) {
  10404. changed = true;
  10405. defineProxyAttr(to, key, instance, type);
  10406. }
  10407. else if (from[key] !== prev[key]) {
  10408. changed = true;
  10409. }
  10410. }
  10411. for (var key in to) {
  10412. if (!(key in from)) {
  10413. changed = true;
  10414. delete to[key];
  10415. }
  10416. }
  10417. return changed;
  10418. }
  10419. function defineProxyAttr(proxy, key, instance, type) {
  10420. Object.defineProperty(proxy, key, {
  10421. enumerable: true,
  10422. configurable: true,
  10423. get: function () {
  10424. return instance[type][key];
  10425. }
  10426. });
  10427. }
  10428. function initSlotsProxy(vm) {
  10429. if (!vm._slotsProxy) {
  10430. syncSetupSlots((vm._slotsProxy = {}), vm.$scopedSlots);
  10431. }
  10432. return vm._slotsProxy;
  10433. }
  10434. function syncSetupSlots(to, from) {
  10435. for (var key in from) {
  10436. to[key] = from[key];
  10437. }
  10438. for (var key in to) {
  10439. if (!(key in from)) {
  10440. delete to[key];
  10441. }
  10442. }
  10443. }
  10444. function initRender(vm) {
  10445. vm._vnode = null; // the root of the child tree
  10446. vm._staticTrees = null; // v-once cached trees
  10447. var options = vm.$options;
  10448. var parentVnode = (vm.$vnode = options._parentVnode); // the placeholder node in parent tree
  10449. var renderContext = parentVnode && parentVnode.context;
  10450. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  10451. vm.$scopedSlots = parentVnode
  10452. ? normalizeScopedSlots(vm.$parent, parentVnode.data.scopedSlots, vm.$slots)
  10453. : emptyObject;
  10454. // bind the createElement fn to this instance
  10455. // so that we get proper render context inside it.
  10456. // args order: tag, data, children, normalizationType, alwaysNormalize
  10457. // internal version is used by render functions compiled from templates
  10458. // @ts-expect-error
  10459. vm._c = function (a, b, c, d) { return createElement$1(vm, a, b, c, d, false); };
  10460. // normalization is always applied for the public version, used in
  10461. // user-written render functions.
  10462. // @ts-expect-error
  10463. vm.$createElement = function (a, b, c, d) { return createElement$1(vm, a, b, c, d, true); };
  10464. // $attrs & $listeners are exposed for easier HOC creation.
  10465. // they need to be reactive so that HOCs using them are always updated
  10466. var parentData = parentVnode && parentVnode.data;
  10467. /* istanbul ignore else */
  10468. {
  10469. defineReactive(vm, '$attrs', (parentData && parentData.attrs) || emptyObject, null, true);
  10470. defineReactive(vm, '$listeners', options._parentListeners || emptyObject, null, true);
  10471. }
  10472. }
  10473. var currentRenderingInstance = null;
  10474. function renderMixin(Vue) {
  10475. // install runtime convenience helpers
  10476. installRenderHelpers(Vue.prototype);
  10477. Vue.prototype.$nextTick = function (fn) {
  10478. return nextTick(fn, this);
  10479. };
  10480. Vue.prototype._render = function () {
  10481. var vm = this;
  10482. var _a = vm.$options, render = _a.render, _parentVnode = _a._parentVnode;
  10483. if (_parentVnode && vm._isMounted) {
  10484. vm.$scopedSlots = normalizeScopedSlots(vm.$parent, _parentVnode.data.scopedSlots, vm.$slots, vm.$scopedSlots);
  10485. if (vm._slotsProxy) {
  10486. syncSetupSlots(vm._slotsProxy, vm.$scopedSlots);
  10487. }
  10488. }
  10489. // set parent vnode. this allows render functions to have access
  10490. // to the data on the placeholder node.
  10491. vm.$vnode = _parentVnode;
  10492. // render self
  10493. var vnode;
  10494. try {
  10495. // There's no need to maintain a stack because all render fns are called
  10496. // separately from one another. Nested component's render fns are called
  10497. // when parent component is patched.
  10498. setCurrentInstance(vm);
  10499. currentRenderingInstance = vm;
  10500. vnode = render.call(vm._renderProxy, vm.$createElement);
  10501. }
  10502. catch (e) {
  10503. handleError(e, vm, "render");
  10504. // return error render result,
  10505. // or previous vnode to prevent render error causing blank component
  10506. /* istanbul ignore else */
  10507. {
  10508. vnode = vm._vnode;
  10509. }
  10510. }
  10511. finally {
  10512. currentRenderingInstance = null;
  10513. setCurrentInstance();
  10514. }
  10515. // if the returned array contains only a single node, allow it
  10516. if (isArray(vnode) && vnode.length === 1) {
  10517. vnode = vnode[0];
  10518. }
  10519. // return empty vnode in case the render function errored out
  10520. if (!(vnode instanceof VNode)) {
  10521. vnode = createEmptyVNode();
  10522. }
  10523. // set parent
  10524. vnode.parent = _parentVnode;
  10525. return vnode;
  10526. };
  10527. }
  10528. function ensureCtor(comp, base) {
  10529. if (comp.__esModule || (hasSymbol && comp[Symbol.toStringTag] === 'Module')) {
  10530. comp = comp.default;
  10531. }
  10532. return isObject(comp) ? base.extend(comp) : comp;
  10533. }
  10534. function createAsyncPlaceholder(factory, data, context, children, tag) {
  10535. var node = createEmptyVNode();
  10536. node.asyncFactory = factory;
  10537. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  10538. return node;
  10539. }
  10540. function resolveAsyncComponent(factory, baseCtor) {
  10541. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  10542. return factory.errorComp;
  10543. }
  10544. if (isDef(factory.resolved)) {
  10545. return factory.resolved;
  10546. }
  10547. var owner = currentRenderingInstance;
  10548. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  10549. // already pending
  10550. factory.owners.push(owner);
  10551. }
  10552. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  10553. return factory.loadingComp;
  10554. }
  10555. if (owner && !isDef(factory.owners)) {
  10556. var owners_1 = (factory.owners = [owner]);
  10557. var sync_1 = true;
  10558. var timerLoading_1 = null;
  10559. var timerTimeout_1 = null;
  10560. owner.$on('hook:destroyed', function () { return remove$2(owners_1, owner); });
  10561. var forceRender_1 = function (renderCompleted) {
  10562. for (var i = 0, l = owners_1.length; i < l; i++) {
  10563. owners_1[i].$forceUpdate();
  10564. }
  10565. if (renderCompleted) {
  10566. owners_1.length = 0;
  10567. if (timerLoading_1 !== null) {
  10568. clearTimeout(timerLoading_1);
  10569. timerLoading_1 = null;
  10570. }
  10571. if (timerTimeout_1 !== null) {
  10572. clearTimeout(timerTimeout_1);
  10573. timerTimeout_1 = null;
  10574. }
  10575. }
  10576. };
  10577. var resolve = once(function (res) {
  10578. // cache resolved
  10579. factory.resolved = ensureCtor(res, baseCtor);
  10580. // invoke callbacks only if this is not a synchronous resolve
  10581. // (async resolves are shimmed as synchronous during SSR)
  10582. if (!sync_1) {
  10583. forceRender_1(true);
  10584. }
  10585. else {
  10586. owners_1.length = 0;
  10587. }
  10588. });
  10589. var reject_1 = once(function (reason) {
  10590. if (isDef(factory.errorComp)) {
  10591. factory.error = true;
  10592. forceRender_1(true);
  10593. }
  10594. });
  10595. var res_1 = factory(resolve, reject_1);
  10596. if (isObject(res_1)) {
  10597. if (isPromise(res_1)) {
  10598. // () => Promise
  10599. if (isUndef(factory.resolved)) {
  10600. res_1.then(resolve, reject_1);
  10601. }
  10602. }
  10603. else if (isPromise(res_1.component)) {
  10604. res_1.component.then(resolve, reject_1);
  10605. if (isDef(res_1.error)) {
  10606. factory.errorComp = ensureCtor(res_1.error, baseCtor);
  10607. }
  10608. if (isDef(res_1.loading)) {
  10609. factory.loadingComp = ensureCtor(res_1.loading, baseCtor);
  10610. if (res_1.delay === 0) {
  10611. factory.loading = true;
  10612. }
  10613. else {
  10614. // @ts-expect-error NodeJS timeout type
  10615. timerLoading_1 = setTimeout(function () {
  10616. timerLoading_1 = null;
  10617. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  10618. factory.loading = true;
  10619. forceRender_1(false);
  10620. }
  10621. }, res_1.delay || 200);
  10622. }
  10623. }
  10624. if (isDef(res_1.timeout)) {
  10625. // @ts-expect-error NodeJS timeout type
  10626. timerTimeout_1 = setTimeout(function () {
  10627. timerTimeout_1 = null;
  10628. if (isUndef(factory.resolved)) {
  10629. reject_1(null);
  10630. }
  10631. }, res_1.timeout);
  10632. }
  10633. }
  10634. }
  10635. sync_1 = false;
  10636. // return in case resolved synchronously
  10637. return factory.loading ? factory.loadingComp : factory.resolved;
  10638. }
  10639. }
  10640. function getFirstComponentChild(children) {
  10641. if (isArray(children)) {
  10642. for (var i = 0; i < children.length; i++) {
  10643. var c = children[i];
  10644. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  10645. return c;
  10646. }
  10647. }
  10648. }
  10649. }
  10650. var SIMPLE_NORMALIZE = 1;
  10651. var ALWAYS_NORMALIZE = 2;
  10652. // wrapper function for providing a more flexible interface
  10653. // without getting yelled at by flow
  10654. function createElement$1(context, tag, data, children, normalizationType, alwaysNormalize) {
  10655. if (isArray(data) || isPrimitive(data)) {
  10656. normalizationType = children;
  10657. children = data;
  10658. data = undefined;
  10659. }
  10660. if (isTrue(alwaysNormalize)) {
  10661. normalizationType = ALWAYS_NORMALIZE;
  10662. }
  10663. return _createElement(context, tag, data, children, normalizationType);
  10664. }
  10665. function _createElement(context, tag, data, children, normalizationType) {
  10666. if (isDef(data) && isDef(data.__ob__)) {
  10667. return createEmptyVNode();
  10668. }
  10669. // object syntax in v-bind
  10670. if (isDef(data) && isDef(data.is)) {
  10671. tag = data.is;
  10672. }
  10673. if (!tag) {
  10674. // in case of component :is set to falsy value
  10675. return createEmptyVNode();
  10676. }
  10677. // support single function children as default scoped slot
  10678. if (isArray(children) && isFunction(children[0])) {
  10679. data = data || {};
  10680. data.scopedSlots = { default: children[0] };
  10681. children.length = 0;
  10682. }
  10683. if (normalizationType === ALWAYS_NORMALIZE) {
  10684. children = normalizeChildren(children);
  10685. }
  10686. else if (normalizationType === SIMPLE_NORMALIZE) {
  10687. children = simpleNormalizeChildren(children);
  10688. }
  10689. var vnode, ns;
  10690. if (typeof tag === 'string') {
  10691. var Ctor = void 0;
  10692. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  10693. if (config.isReservedTag(tag)) {
  10694. vnode = new VNode(config.parsePlatformTagName(tag), data, children, undefined, undefined, context);
  10695. }
  10696. else if ((!data || !data.pre) &&
  10697. isDef((Ctor = resolveAsset(context.$options, 'components', tag)))) {
  10698. // component
  10699. vnode = createComponent(Ctor, data, context, children, tag);
  10700. }
  10701. else {
  10702. // unknown or unlisted namespaced elements
  10703. // check at runtime because it may get assigned a namespace when its
  10704. // parent normalizes children
  10705. vnode = new VNode(tag, data, children, undefined, undefined, context);
  10706. }
  10707. }
  10708. else {
  10709. // direct component options / constructor
  10710. vnode = createComponent(tag, data, context, children);
  10711. }
  10712. if (isArray(vnode)) {
  10713. return vnode;
  10714. }
  10715. else if (isDef(vnode)) {
  10716. if (isDef(ns))
  10717. applyNS(vnode, ns);
  10718. if (isDef(data))
  10719. registerDeepBindings(data);
  10720. return vnode;
  10721. }
  10722. else {
  10723. return createEmptyVNode();
  10724. }
  10725. }
  10726. function applyNS(vnode, ns, force) {
  10727. vnode.ns = ns;
  10728. if (vnode.tag === 'foreignObject') {
  10729. // use default namespace inside foreignObject
  10730. ns = undefined;
  10731. force = true;
  10732. }
  10733. if (isDef(vnode.children)) {
  10734. for (var i = 0, l = vnode.children.length; i < l; i++) {
  10735. var child = vnode.children[i];
  10736. if (isDef(child.tag) &&
  10737. (isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  10738. applyNS(child, ns, force);
  10739. }
  10740. }
  10741. }
  10742. }
  10743. // ref #5318
  10744. // necessary to ensure parent re-render when deep bindings like :style and
  10745. // :class are used on slot nodes
  10746. function registerDeepBindings(data) {
  10747. if (isObject(data.style)) {
  10748. traverse(data.style);
  10749. }
  10750. if (isObject(data.class)) {
  10751. traverse(data.class);
  10752. }
  10753. }
  10754. function handleError(err, vm, info) {
  10755. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  10756. // See: https://github.com/vuejs/vuex/issues/1505
  10757. pushTarget();
  10758. try {
  10759. if (vm) {
  10760. var cur = vm;
  10761. while ((cur = cur.$parent)) {
  10762. var hooks = cur.$options.errorCaptured;
  10763. if (hooks) {
  10764. for (var i = 0; i < hooks.length; i++) {
  10765. try {
  10766. var capture = hooks[i].call(cur, err, vm, info) === false;
  10767. if (capture)
  10768. return;
  10769. }
  10770. catch (e) {
  10771. globalHandleError(e, cur, 'errorCaptured hook');
  10772. }
  10773. }
  10774. }
  10775. }
  10776. }
  10777. globalHandleError(err, vm, info);
  10778. }
  10779. finally {
  10780. popTarget();
  10781. }
  10782. }
  10783. function invokeWithErrorHandling(handler, context, args, vm, info) {
  10784. var res;
  10785. try {
  10786. res = args ? handler.apply(context, args) : handler.call(context);
  10787. if (res && !res._isVue && isPromise(res) && !res._handled) {
  10788. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  10789. res._handled = true;
  10790. }
  10791. }
  10792. catch (e) {
  10793. handleError(e, vm, info);
  10794. }
  10795. return res;
  10796. }
  10797. function globalHandleError(err, vm, info) {
  10798. if (config.errorHandler) {
  10799. try {
  10800. return config.errorHandler.call(null, err, vm, info);
  10801. }
  10802. catch (e) {
  10803. // if the user intentionally throws the original error in the handler,
  10804. // do not log it twice
  10805. if (e !== err) {
  10806. logError(e);
  10807. }
  10808. }
  10809. }
  10810. logError(err);
  10811. }
  10812. function logError(err, vm, info) {
  10813. /* istanbul ignore else */
  10814. if (inBrowser && typeof console !== 'undefined') {
  10815. console.error(err);
  10816. }
  10817. else {
  10818. throw err;
  10819. }
  10820. }
  10821. /* globals MutationObserver */
  10822. var isUsingMicroTask = false;
  10823. var callbacks = [];
  10824. var pending = false;
  10825. function flushCallbacks() {
  10826. pending = false;
  10827. var copies = callbacks.slice(0);
  10828. callbacks.length = 0;
  10829. for (var i = 0; i < copies.length; i++) {
  10830. copies[i]();
  10831. }
  10832. }
  10833. // Here we have async deferring wrappers using microtasks.
  10834. // In 2.5 we used (macro) tasks (in combination with microtasks).
  10835. // However, it has subtle problems when state is changed right before repaint
  10836. // (e.g. #6813, out-in transitions).
  10837. // Also, using (macro) tasks in event handler would cause some weird behaviors
  10838. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  10839. // So we now use microtasks everywhere, again.
  10840. // A major drawback of this tradeoff is that there are some scenarios
  10841. // where microtasks have too high a priority and fire in between supposedly
  10842. // sequential events (e.g. #4521, #6690, which have workarounds)
  10843. // or even between bubbling of the same event (#6566).
  10844. var timerFunc;
  10845. // The nextTick behavior leverages the microtask queue, which can be accessed
  10846. // via either native Promise.then or MutationObserver.
  10847. // MutationObserver has wider support, however it is seriously bugged in
  10848. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  10849. // completely stops working after triggering a few times... so, if native
  10850. // Promise is available, we will use it:
  10851. /* istanbul ignore next, $flow-disable-line */
  10852. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  10853. var p_1 = Promise.resolve();
  10854. timerFunc = function () {
  10855. p_1.then(flushCallbacks);
  10856. // In problematic UIWebViews, Promise.then doesn't completely break, but
  10857. // it can get stuck in a weird state where callbacks are pushed into the
  10858. // microtask queue but the queue isn't being flushed, until the browser
  10859. // needs to do some other work, e.g. handle a timer. Therefore we can
  10860. // "force" the microtask queue to be flushed by adding an empty timer.
  10861. if (isIOS)
  10862. setTimeout(noop);
  10863. };
  10864. isUsingMicroTask = true;
  10865. }
  10866. else if (!isIE &&
  10867. typeof MutationObserver !== 'undefined' &&
  10868. (isNative(MutationObserver) ||
  10869. // PhantomJS and iOS 7.x
  10870. MutationObserver.toString() === '[object MutationObserverConstructor]')) {
  10871. // Use MutationObserver where native Promise is not available,
  10872. // e.g. PhantomJS, iOS7, Android 4.4
  10873. // (#6466 MutationObserver is unreliable in IE11)
  10874. var counter_1 = 1;
  10875. var observer = new MutationObserver(flushCallbacks);
  10876. var textNode_1 = document.createTextNode(String(counter_1));
  10877. observer.observe(textNode_1, {
  10878. characterData: true
  10879. });
  10880. timerFunc = function () {
  10881. counter_1 = (counter_1 + 1) % 2;
  10882. textNode_1.data = String(counter_1);
  10883. };
  10884. isUsingMicroTask = true;
  10885. }
  10886. else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  10887. // Fallback to setImmediate.
  10888. // Technically it leverages the (macro) task queue,
  10889. // but it is still a better choice than setTimeout.
  10890. timerFunc = function () {
  10891. setImmediate(flushCallbacks);
  10892. };
  10893. }
  10894. else {
  10895. // Fallback to setTimeout.
  10896. timerFunc = function () {
  10897. setTimeout(flushCallbacks, 0);
  10898. };
  10899. }
  10900. /**
  10901. * @internal
  10902. */
  10903. function nextTick(cb, ctx) {
  10904. var _resolve;
  10905. callbacks.push(function () {
  10906. if (cb) {
  10907. try {
  10908. cb.call(ctx);
  10909. }
  10910. catch (e) {
  10911. handleError(e, ctx, 'nextTick');
  10912. }
  10913. }
  10914. else if (_resolve) {
  10915. _resolve(ctx);
  10916. }
  10917. });
  10918. if (!pending) {
  10919. pending = true;
  10920. timerFunc();
  10921. }
  10922. // $flow-disable-line
  10923. if (!cb && typeof Promise !== 'undefined') {
  10924. return new Promise(function (resolve) {
  10925. _resolve = resolve;
  10926. });
  10927. }
  10928. }
  10929. /**
  10930. * Note: also update dist/vue.runtime.mjs when adding new exports to this file.
  10931. */
  10932. var version = '2.7.14';
  10933. var seenObjects = new _Set();
  10934. /**
  10935. * Recursively traverse an object to evoke all converted
  10936. * getters, so that every nested property inside the object
  10937. * is collected as a "deep" dependency.
  10938. */
  10939. function traverse(val) {
  10940. _traverse(val, seenObjects);
  10941. seenObjects.clear();
  10942. return val;
  10943. }
  10944. function _traverse(val, seen) {
  10945. var i, keys;
  10946. var isA = isArray(val);
  10947. if ((!isA && !isObject(val)) ||
  10948. val.__v_skip /* ReactiveFlags.SKIP */ ||
  10949. Object.isFrozen(val) ||
  10950. val instanceof VNode) {
  10951. return;
  10952. }
  10953. if (val.__ob__) {
  10954. var depId = val.__ob__.dep.id;
  10955. if (seen.has(depId)) {
  10956. return;
  10957. }
  10958. seen.add(depId);
  10959. }
  10960. if (isA) {
  10961. i = val.length;
  10962. while (i--)
  10963. _traverse(val[i], seen);
  10964. }
  10965. else if (isRef(val)) {
  10966. _traverse(val.value, seen);
  10967. }
  10968. else {
  10969. keys = Object.keys(val);
  10970. i = keys.length;
  10971. while (i--)
  10972. _traverse(val[keys[i]], seen);
  10973. }
  10974. }
  10975. var uid$1 = 0;
  10976. /**
  10977. * A watcher parses an expression, collects dependencies,
  10978. * and fires callback when the expression value changes.
  10979. * This is used for both the $watch() api and directives.
  10980. * @internal
  10981. */
  10982. var Watcher = /** @class */ (function () {
  10983. function Watcher(vm, expOrFn, cb, options, isRenderWatcher) {
  10984. recordEffectScope(this,
  10985. // if the active effect scope is manually created (not a component scope),
  10986. // prioritize it
  10987. activeEffectScope && !activeEffectScope._vm
  10988. ? activeEffectScope
  10989. : vm
  10990. ? vm._scope
  10991. : undefined);
  10992. if ((this.vm = vm) && isRenderWatcher) {
  10993. vm._watcher = this;
  10994. }
  10995. // options
  10996. if (options) {
  10997. this.deep = !!options.deep;
  10998. this.user = !!options.user;
  10999. this.lazy = !!options.lazy;
  11000. this.sync = !!options.sync;
  11001. this.before = options.before;
  11002. }
  11003. else {
  11004. this.deep = this.user = this.lazy = this.sync = false;
  11005. }
  11006. this.cb = cb;
  11007. this.id = ++uid$1; // uid for batching
  11008. this.active = true;
  11009. this.post = false;
  11010. this.dirty = this.lazy; // for lazy watchers
  11011. this.deps = [];
  11012. this.newDeps = [];
  11013. this.depIds = new _Set();
  11014. this.newDepIds = new _Set();
  11015. this.expression = '';
  11016. // parse expression for getter
  11017. if (isFunction(expOrFn)) {
  11018. this.getter = expOrFn;
  11019. }
  11020. else {
  11021. this.getter = parsePath(expOrFn);
  11022. if (!this.getter) {
  11023. this.getter = noop;
  11024. }
  11025. }
  11026. this.value = this.lazy ? undefined : this.get();
  11027. }
  11028. /**
  11029. * Evaluate the getter, and re-collect dependencies.
  11030. */
  11031. Watcher.prototype.get = function () {
  11032. pushTarget(this);
  11033. var value;
  11034. var vm = this.vm;
  11035. try {
  11036. value = this.getter.call(vm, vm);
  11037. }
  11038. catch (e) {
  11039. if (this.user) {
  11040. handleError(e, vm, "getter for watcher \"".concat(this.expression, "\""));
  11041. }
  11042. else {
  11043. throw e;
  11044. }
  11045. }
  11046. finally {
  11047. // "touch" every property so they are all tracked as
  11048. // dependencies for deep watching
  11049. if (this.deep) {
  11050. traverse(value);
  11051. }
  11052. popTarget();
  11053. this.cleanupDeps();
  11054. }
  11055. return value;
  11056. };
  11057. /**
  11058. * Add a dependency to this directive.
  11059. */
  11060. Watcher.prototype.addDep = function (dep) {
  11061. var id = dep.id;
  11062. if (!this.newDepIds.has(id)) {
  11063. this.newDepIds.add(id);
  11064. this.newDeps.push(dep);
  11065. if (!this.depIds.has(id)) {
  11066. dep.addSub(this);
  11067. }
  11068. }
  11069. };
  11070. /**
  11071. * Clean up for dependency collection.
  11072. */
  11073. Watcher.prototype.cleanupDeps = function () {
  11074. var i = this.deps.length;
  11075. while (i--) {
  11076. var dep = this.deps[i];
  11077. if (!this.newDepIds.has(dep.id)) {
  11078. dep.removeSub(this);
  11079. }
  11080. }
  11081. var tmp = this.depIds;
  11082. this.depIds = this.newDepIds;
  11083. this.newDepIds = tmp;
  11084. this.newDepIds.clear();
  11085. tmp = this.deps;
  11086. this.deps = this.newDeps;
  11087. this.newDeps = tmp;
  11088. this.newDeps.length = 0;
  11089. };
  11090. /**
  11091. * Subscriber interface.
  11092. * Will be called when a dependency changes.
  11093. */
  11094. Watcher.prototype.update = function () {
  11095. /* istanbul ignore else */
  11096. if (this.lazy) {
  11097. this.dirty = true;
  11098. }
  11099. else if (this.sync) {
  11100. this.run();
  11101. }
  11102. else {
  11103. queueWatcher(this);
  11104. }
  11105. };
  11106. /**
  11107. * Scheduler job interface.
  11108. * Will be called by the scheduler.
  11109. */
  11110. Watcher.prototype.run = function () {
  11111. if (this.active) {
  11112. var value = this.get();
  11113. if (value !== this.value ||
  11114. // Deep watchers and watchers on Object/Arrays should fire even
  11115. // when the value is the same, because the value may
  11116. // have mutated.
  11117. isObject(value) ||
  11118. this.deep) {
  11119. // set new value
  11120. var oldValue = this.value;
  11121. this.value = value;
  11122. if (this.user) {
  11123. var info = "callback for watcher \"".concat(this.expression, "\"");
  11124. invokeWithErrorHandling(this.cb, this.vm, [value, oldValue], this.vm, info);
  11125. }
  11126. else {
  11127. this.cb.call(this.vm, value, oldValue);
  11128. }
  11129. }
  11130. }
  11131. };
  11132. /**
  11133. * Evaluate the value of the watcher.
  11134. * This only gets called for lazy watchers.
  11135. */
  11136. Watcher.prototype.evaluate = function () {
  11137. this.value = this.get();
  11138. this.dirty = false;
  11139. };
  11140. /**
  11141. * Depend on all deps collected by this watcher.
  11142. */
  11143. Watcher.prototype.depend = function () {
  11144. var i = this.deps.length;
  11145. while (i--) {
  11146. this.deps[i].depend();
  11147. }
  11148. };
  11149. /**
  11150. * Remove self from all dependencies' subscriber list.
  11151. */
  11152. Watcher.prototype.teardown = function () {
  11153. if (this.vm && !this.vm._isBeingDestroyed) {
  11154. remove$2(this.vm._scope.effects, this);
  11155. }
  11156. if (this.active) {
  11157. var i = this.deps.length;
  11158. while (i--) {
  11159. this.deps[i].removeSub(this);
  11160. }
  11161. this.active = false;
  11162. if (this.onStop) {
  11163. this.onStop();
  11164. }
  11165. }
  11166. };
  11167. return Watcher;
  11168. }());
  11169. function initEvents(vm) {
  11170. vm._events = Object.create(null);
  11171. vm._hasHookEvent = false;
  11172. // init parent attached events
  11173. var listeners = vm.$options._parentListeners;
  11174. if (listeners) {
  11175. updateComponentListeners(vm, listeners);
  11176. }
  11177. }
  11178. var target$1;
  11179. function add$1(event, fn) {
  11180. target$1.$on(event, fn);
  11181. }
  11182. function remove$1(event, fn) {
  11183. target$1.$off(event, fn);
  11184. }
  11185. function createOnceHandler$1(event, fn) {
  11186. var _target = target$1;
  11187. return function onceHandler() {
  11188. var res = fn.apply(null, arguments);
  11189. if (res !== null) {
  11190. _target.$off(event, onceHandler);
  11191. }
  11192. };
  11193. }
  11194. function updateComponentListeners(vm, listeners, oldListeners) {
  11195. target$1 = vm;
  11196. updateListeners(listeners, oldListeners || {}, add$1, remove$1, createOnceHandler$1, vm);
  11197. target$1 = undefined;
  11198. }
  11199. function eventsMixin(Vue) {
  11200. var hookRE = /^hook:/;
  11201. Vue.prototype.$on = function (event, fn) {
  11202. var vm = this;
  11203. if (isArray(event)) {
  11204. for (var i = 0, l = event.length; i < l; i++) {
  11205. vm.$on(event[i], fn);
  11206. }
  11207. }
  11208. else {
  11209. (vm._events[event] || (vm._events[event] = [])).push(fn);
  11210. // optimize hook:event cost by using a boolean flag marked at registration
  11211. // instead of a hash lookup
  11212. if (hookRE.test(event)) {
  11213. vm._hasHookEvent = true;
  11214. }
  11215. }
  11216. return vm;
  11217. };
  11218. Vue.prototype.$once = function (event, fn) {
  11219. var vm = this;
  11220. function on() {
  11221. vm.$off(event, on);
  11222. fn.apply(vm, arguments);
  11223. }
  11224. on.fn = fn;
  11225. vm.$on(event, on);
  11226. return vm;
  11227. };
  11228. Vue.prototype.$off = function (event, fn) {
  11229. var vm = this;
  11230. // all
  11231. if (!arguments.length) {
  11232. vm._events = Object.create(null);
  11233. return vm;
  11234. }
  11235. // array of events
  11236. if (isArray(event)) {
  11237. for (var i_1 = 0, l = event.length; i_1 < l; i_1++) {
  11238. vm.$off(event[i_1], fn);
  11239. }
  11240. return vm;
  11241. }
  11242. // specific event
  11243. var cbs = vm._events[event];
  11244. if (!cbs) {
  11245. return vm;
  11246. }
  11247. if (!fn) {
  11248. vm._events[event] = null;
  11249. return vm;
  11250. }
  11251. // specific handler
  11252. var cb;
  11253. var i = cbs.length;
  11254. while (i--) {
  11255. cb = cbs[i];
  11256. if (cb === fn || cb.fn === fn) {
  11257. cbs.splice(i, 1);
  11258. break;
  11259. }
  11260. }
  11261. return vm;
  11262. };
  11263. Vue.prototype.$emit = function (event) {
  11264. var vm = this;
  11265. var cbs = vm._events[event];
  11266. if (cbs) {
  11267. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  11268. var args = toArray(arguments, 1);
  11269. var info = "event handler for \"".concat(event, "\"");
  11270. for (var i = 0, l = cbs.length; i < l; i++) {
  11271. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  11272. }
  11273. }
  11274. return vm;
  11275. };
  11276. }
  11277. var activeInstance = null;
  11278. function setActiveInstance(vm) {
  11279. var prevActiveInstance = activeInstance;
  11280. activeInstance = vm;
  11281. return function () {
  11282. activeInstance = prevActiveInstance;
  11283. };
  11284. }
  11285. function initLifecycle(vm) {
  11286. var options = vm.$options;
  11287. // locate first non-abstract parent
  11288. var parent = options.parent;
  11289. if (parent && !options.abstract) {
  11290. while (parent.$options.abstract && parent.$parent) {
  11291. parent = parent.$parent;
  11292. }
  11293. parent.$children.push(vm);
  11294. }
  11295. vm.$parent = parent;
  11296. vm.$root = parent ? parent.$root : vm;
  11297. vm.$children = [];
  11298. vm.$refs = {};
  11299. vm._provided = parent ? parent._provided : Object.create(null);
  11300. vm._watcher = null;
  11301. vm._inactive = null;
  11302. vm._directInactive = false;
  11303. vm._isMounted = false;
  11304. vm._isDestroyed = false;
  11305. vm._isBeingDestroyed = false;
  11306. }
  11307. function lifecycleMixin(Vue) {
  11308. Vue.prototype._update = function (vnode, hydrating) {
  11309. var vm = this;
  11310. var prevEl = vm.$el;
  11311. var prevVnode = vm._vnode;
  11312. var restoreActiveInstance = setActiveInstance(vm);
  11313. vm._vnode = vnode;
  11314. // Vue.prototype.__patch__ is injected in entry points
  11315. // based on the rendering backend used.
  11316. if (!prevVnode) {
  11317. // initial render
  11318. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  11319. }
  11320. else {
  11321. // updates
  11322. vm.$el = vm.__patch__(prevVnode, vnode);
  11323. }
  11324. restoreActiveInstance();
  11325. // update __vue__ reference
  11326. if (prevEl) {
  11327. prevEl.__vue__ = null;
  11328. }
  11329. if (vm.$el) {
  11330. vm.$el.__vue__ = vm;
  11331. }
  11332. // if parent is an HOC, update its $el as well
  11333. var wrapper = vm;
  11334. while (wrapper &&
  11335. wrapper.$vnode &&
  11336. wrapper.$parent &&
  11337. wrapper.$vnode === wrapper.$parent._vnode) {
  11338. wrapper.$parent.$el = wrapper.$el;
  11339. wrapper = wrapper.$parent;
  11340. }
  11341. // updated hook is called by the scheduler to ensure that children are
  11342. // updated in a parent's updated hook.
  11343. };
  11344. Vue.prototype.$forceUpdate = function () {
  11345. var vm = this;
  11346. if (vm._watcher) {
  11347. vm._watcher.update();
  11348. }
  11349. };
  11350. Vue.prototype.$destroy = function () {
  11351. var vm = this;
  11352. if (vm._isBeingDestroyed) {
  11353. return;
  11354. }
  11355. callHook$1(vm, 'beforeDestroy');
  11356. vm._isBeingDestroyed = true;
  11357. // remove self from parent
  11358. var parent = vm.$parent;
  11359. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  11360. remove$2(parent.$children, vm);
  11361. }
  11362. // teardown scope. this includes both the render watcher and other
  11363. // watchers created
  11364. vm._scope.stop();
  11365. // remove reference from data ob
  11366. // frozen object may not have observer.
  11367. if (vm._data.__ob__) {
  11368. vm._data.__ob__.vmCount--;
  11369. }
  11370. // call the last hook...
  11371. vm._isDestroyed = true;
  11372. // invoke destroy hooks on current rendered tree
  11373. vm.__patch__(vm._vnode, null);
  11374. // fire destroyed hook
  11375. callHook$1(vm, 'destroyed');
  11376. // turn off all instance listeners.
  11377. vm.$off();
  11378. // remove __vue__ reference
  11379. if (vm.$el) {
  11380. vm.$el.__vue__ = null;
  11381. }
  11382. // release circular reference (#6759)
  11383. if (vm.$vnode) {
  11384. vm.$vnode.parent = null;
  11385. }
  11386. };
  11387. }
  11388. function mountComponent(vm, el, hydrating) {
  11389. vm.$el = el;
  11390. if (!vm.$options.render) {
  11391. // @ts-expect-error invalid type
  11392. vm.$options.render = createEmptyVNode;
  11393. }
  11394. callHook$1(vm, 'beforeMount');
  11395. var updateComponent;
  11396. /* istanbul ignore if */
  11397. {
  11398. updateComponent = function () {
  11399. vm._update(vm._render(), hydrating);
  11400. };
  11401. }
  11402. var watcherOptions = {
  11403. before: function () {
  11404. if (vm._isMounted && !vm._isDestroyed) {
  11405. callHook$1(vm, 'beforeUpdate');
  11406. }
  11407. }
  11408. };
  11409. // we set this to vm._watcher inside the watcher's constructor
  11410. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  11411. // component's mounted hook), which relies on vm._watcher being already defined
  11412. new Watcher(vm, updateComponent, noop, watcherOptions, true /* isRenderWatcher */);
  11413. hydrating = false;
  11414. // flush buffer for flush: "pre" watchers queued in setup()
  11415. var preWatchers = vm._preWatchers;
  11416. if (preWatchers) {
  11417. for (var i = 0; i < preWatchers.length; i++) {
  11418. preWatchers[i].run();
  11419. }
  11420. }
  11421. // manually mounted instance, call mounted on self
  11422. // mounted is called for render-created child components in its inserted hook
  11423. if (vm.$vnode == null) {
  11424. vm._isMounted = true;
  11425. callHook$1(vm, 'mounted');
  11426. }
  11427. return vm;
  11428. }
  11429. function updateChildComponent(vm, propsData, listeners, parentVnode, renderChildren) {
  11430. // determine whether component has slot children
  11431. // we need to do this before overwriting $options._renderChildren.
  11432. // check if there are dynamic scopedSlots (hand-written or compiled but with
  11433. // dynamic slot names). Static scoped slots compiled from template has the
  11434. // "$stable" marker.
  11435. var newScopedSlots = parentVnode.data.scopedSlots;
  11436. var oldScopedSlots = vm.$scopedSlots;
  11437. var hasDynamicScopedSlot = !!((newScopedSlots && !newScopedSlots.$stable) ||
  11438. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  11439. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key) ||
  11440. (!newScopedSlots && vm.$scopedSlots.$key));
  11441. // Any static slot children from the parent may have changed during parent's
  11442. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  11443. // update is necessary to ensure correctness.
  11444. var needsForceUpdate = !!(renderChildren || // has new static slots
  11445. vm.$options._renderChildren || // has old static slots
  11446. hasDynamicScopedSlot);
  11447. var prevVNode = vm.$vnode;
  11448. vm.$options._parentVnode = parentVnode;
  11449. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  11450. if (vm._vnode) {
  11451. // update child tree's parent
  11452. vm._vnode.parent = parentVnode;
  11453. }
  11454. vm.$options._renderChildren = renderChildren;
  11455. // update $attrs and $listeners hash
  11456. // these are also reactive so they may trigger child update if the child
  11457. // used them during render
  11458. var attrs = parentVnode.data.attrs || emptyObject;
  11459. if (vm._attrsProxy) {
  11460. // force update if attrs are accessed and has changed since it may be
  11461. // passed to a child component.
  11462. if (syncSetupProxy(vm._attrsProxy, attrs, (prevVNode.data && prevVNode.data.attrs) || emptyObject, vm, '$attrs')) {
  11463. needsForceUpdate = true;
  11464. }
  11465. }
  11466. vm.$attrs = attrs;
  11467. // update listeners
  11468. listeners = listeners || emptyObject;
  11469. var prevListeners = vm.$options._parentListeners;
  11470. if (vm._listenersProxy) {
  11471. syncSetupProxy(vm._listenersProxy, listeners, prevListeners || emptyObject, vm, '$listeners');
  11472. }
  11473. vm.$listeners = vm.$options._parentListeners = listeners;
  11474. updateComponentListeners(vm, listeners, prevListeners);
  11475. // update props
  11476. if (propsData && vm.$options.props) {
  11477. toggleObserving(false);
  11478. var props = vm._props;
  11479. var propKeys = vm.$options._propKeys || [];
  11480. for (var i = 0; i < propKeys.length; i++) {
  11481. var key = propKeys[i];
  11482. var propOptions = vm.$options.props; // wtf flow?
  11483. props[key] = validateProp(key, propOptions, propsData, vm);
  11484. }
  11485. toggleObserving(true);
  11486. // keep a copy of raw propsData
  11487. vm.$options.propsData = propsData;
  11488. }
  11489. // resolve slots + force update if has children
  11490. if (needsForceUpdate) {
  11491. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  11492. vm.$forceUpdate();
  11493. }
  11494. }
  11495. function isInInactiveTree(vm) {
  11496. while (vm && (vm = vm.$parent)) {
  11497. if (vm._inactive)
  11498. return true;
  11499. }
  11500. return false;
  11501. }
  11502. function activateChildComponent(vm, direct) {
  11503. if (direct) {
  11504. vm._directInactive = false;
  11505. if (isInInactiveTree(vm)) {
  11506. return;
  11507. }
  11508. }
  11509. else if (vm._directInactive) {
  11510. return;
  11511. }
  11512. if (vm._inactive || vm._inactive === null) {
  11513. vm._inactive = false;
  11514. for (var i = 0; i < vm.$children.length; i++) {
  11515. activateChildComponent(vm.$children[i]);
  11516. }
  11517. callHook$1(vm, 'activated');
  11518. }
  11519. }
  11520. function deactivateChildComponent(vm, direct) {
  11521. if (direct) {
  11522. vm._directInactive = true;
  11523. if (isInInactiveTree(vm)) {
  11524. return;
  11525. }
  11526. }
  11527. if (!vm._inactive) {
  11528. vm._inactive = true;
  11529. for (var i = 0; i < vm.$children.length; i++) {
  11530. deactivateChildComponent(vm.$children[i]);
  11531. }
  11532. callHook$1(vm, 'deactivated');
  11533. }
  11534. }
  11535. function callHook$1(vm, hook, args, setContext) {
  11536. if (setContext === void 0) { setContext = true; }
  11537. // #7573 disable dep collection when invoking lifecycle hooks
  11538. pushTarget();
  11539. var prev = currentInstance;
  11540. setContext && setCurrentInstance(vm);
  11541. var handlers = vm.$options[hook];
  11542. var info = "".concat(hook, " hook");
  11543. if (handlers) {
  11544. for (var i = 0, j = handlers.length; i < j; i++) {
  11545. invokeWithErrorHandling(handlers[i], vm, args || null, vm, info);
  11546. }
  11547. }
  11548. if (vm._hasHookEvent) {
  11549. vm.$emit('hook:' + hook);
  11550. }
  11551. setContext && setCurrentInstance(prev);
  11552. popTarget();
  11553. }
  11554. var queue = [];
  11555. var activatedChildren = [];
  11556. var has = {};
  11557. var waiting = false;
  11558. var flushing = false;
  11559. var index = 0;
  11560. /**
  11561. * Reset the scheduler's state.
  11562. */
  11563. function resetSchedulerState() {
  11564. index = queue.length = activatedChildren.length = 0;
  11565. has = {};
  11566. waiting = flushing = false;
  11567. }
  11568. // Async edge case #6566 requires saving the timestamp when event listeners are
  11569. // attached. However, calling performance.now() has a perf overhead especially
  11570. // if the page has thousands of event listeners. Instead, we take a timestamp
  11571. // every time the scheduler flushes and use that for all event listeners
  11572. // attached during that flush.
  11573. var currentFlushTimestamp = 0;
  11574. // Async edge case fix requires storing an event listener's attach timestamp.
  11575. var getNow = Date.now;
  11576. // Determine what event timestamp the browser is using. Annoyingly, the
  11577. // timestamp can either be hi-res (relative to page load) or low-res
  11578. // (relative to UNIX epoch), so in order to compare time we have to use the
  11579. // same timestamp type when saving the flush timestamp.
  11580. // All IE versions use low-res event timestamps, and have problematic clock
  11581. // implementations (#9632)
  11582. if (inBrowser && !isIE) {
  11583. var performance_1 = window.performance;
  11584. if (performance_1 &&
  11585. typeof performance_1.now === 'function' &&
  11586. getNow() > document.createEvent('Event').timeStamp) {
  11587. // if the event timestamp, although evaluated AFTER the Date.now(), is
  11588. // smaller than it, it means the event is using a hi-res timestamp,
  11589. // and we need to use the hi-res version for event listener timestamps as
  11590. // well.
  11591. getNow = function () { return performance_1.now(); };
  11592. }
  11593. }
  11594. var sortCompareFn = function (a, b) {
  11595. if (a.post) {
  11596. if (!b.post)
  11597. return 1;
  11598. }
  11599. else if (b.post) {
  11600. return -1;
  11601. }
  11602. return a.id - b.id;
  11603. };
  11604. /**
  11605. * Flush both queues and run the watchers.
  11606. */
  11607. function flushSchedulerQueue() {
  11608. currentFlushTimestamp = getNow();
  11609. flushing = true;
  11610. var watcher, id;
  11611. // Sort queue before flush.
  11612. // This ensures that:
  11613. // 1. Components are updated from parent to child. (because parent is always
  11614. // created before the child)
  11615. // 2. A component's user watchers are run before its render watcher (because
  11616. // user watchers are created before the render watcher)
  11617. // 3. If a component is destroyed during a parent component's watcher run,
  11618. // its watchers can be skipped.
  11619. queue.sort(sortCompareFn);
  11620. // do not cache length because more watchers might be pushed
  11621. // as we run existing watchers
  11622. for (index = 0; index < queue.length; index++) {
  11623. watcher = queue[index];
  11624. if (watcher.before) {
  11625. watcher.before();
  11626. }
  11627. id = watcher.id;
  11628. has[id] = null;
  11629. watcher.run();
  11630. }
  11631. // keep copies of post queues before resetting state
  11632. var activatedQueue = activatedChildren.slice();
  11633. var updatedQueue = queue.slice();
  11634. resetSchedulerState();
  11635. // call component updated and activated hooks
  11636. callActivatedHooks(activatedQueue);
  11637. callUpdatedHooks(updatedQueue);
  11638. cleanupDeps();
  11639. // devtool hook
  11640. /* istanbul ignore if */
  11641. if (devtools && config.devtools) {
  11642. devtools.emit('flush');
  11643. }
  11644. }
  11645. function callUpdatedHooks(queue) {
  11646. var i = queue.length;
  11647. while (i--) {
  11648. var watcher = queue[i];
  11649. var vm = watcher.vm;
  11650. if (vm && vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  11651. callHook$1(vm, 'updated');
  11652. }
  11653. }
  11654. }
  11655. /**
  11656. * Queue a kept-alive component that was activated during patch.
  11657. * The queue will be processed after the entire tree has been patched.
  11658. */
  11659. function queueActivatedComponent(vm) {
  11660. // setting _inactive to false here so that a render function can
  11661. // rely on checking whether it's in an inactive tree (e.g. router-view)
  11662. vm._inactive = false;
  11663. activatedChildren.push(vm);
  11664. }
  11665. function callActivatedHooks(queue) {
  11666. for (var i = 0; i < queue.length; i++) {
  11667. queue[i]._inactive = true;
  11668. activateChildComponent(queue[i], true /* true */);
  11669. }
  11670. }
  11671. /**
  11672. * Push a watcher into the watcher queue.
  11673. * Jobs with duplicate IDs will be skipped unless it's
  11674. * pushed when the queue is being flushed.
  11675. */
  11676. function queueWatcher(watcher) {
  11677. var id = watcher.id;
  11678. if (has[id] != null) {
  11679. return;
  11680. }
  11681. if (watcher === Dep.target && watcher.noRecurse) {
  11682. return;
  11683. }
  11684. has[id] = true;
  11685. if (!flushing) {
  11686. queue.push(watcher);
  11687. }
  11688. else {
  11689. // if already flushing, splice the watcher based on its id
  11690. // if already past its id, it will be run next immediately.
  11691. var i = queue.length - 1;
  11692. while (i > index && queue[i].id > watcher.id) {
  11693. i--;
  11694. }
  11695. queue.splice(i + 1, 0, watcher);
  11696. }
  11697. // queue the flush
  11698. if (!waiting) {
  11699. waiting = true;
  11700. nextTick(flushSchedulerQueue);
  11701. }
  11702. }
  11703. function initProvide(vm) {
  11704. var provideOption = vm.$options.provide;
  11705. if (provideOption) {
  11706. var provided = isFunction(provideOption)
  11707. ? provideOption.call(vm)
  11708. : provideOption;
  11709. if (!isObject(provided)) {
  11710. return;
  11711. }
  11712. var source = resolveProvided(vm);
  11713. // IE9 doesn't support Object.getOwnPropertyDescriptors so we have to
  11714. // iterate the keys ourselves.
  11715. var keys = hasSymbol ? Reflect.ownKeys(provided) : Object.keys(provided);
  11716. for (var i = 0; i < keys.length; i++) {
  11717. var key = keys[i];
  11718. Object.defineProperty(source, key, Object.getOwnPropertyDescriptor(provided, key));
  11719. }
  11720. }
  11721. }
  11722. function initInjections(vm) {
  11723. var result = resolveInject(vm.$options.inject, vm);
  11724. if (result) {
  11725. toggleObserving(false);
  11726. Object.keys(result).forEach(function (key) {
  11727. /* istanbul ignore else */
  11728. {
  11729. defineReactive(vm, key, result[key]);
  11730. }
  11731. });
  11732. toggleObserving(true);
  11733. }
  11734. }
  11735. function resolveInject(inject, vm) {
  11736. if (inject) {
  11737. // inject is :any because flow is not smart enough to figure out cached
  11738. var result = Object.create(null);
  11739. var keys = hasSymbol ? Reflect.ownKeys(inject) : Object.keys(inject);
  11740. for (var i = 0; i < keys.length; i++) {
  11741. var key = keys[i];
  11742. // #6574 in case the inject object is observed...
  11743. if (key === '__ob__')
  11744. continue;
  11745. var provideKey = inject[key].from;
  11746. if (provideKey in vm._provided) {
  11747. result[key] = vm._provided[provideKey];
  11748. }
  11749. else if ('default' in inject[key]) {
  11750. var provideDefault = inject[key].default;
  11751. result[key] = isFunction(provideDefault)
  11752. ? provideDefault.call(vm)
  11753. : provideDefault;
  11754. }
  11755. else ;
  11756. }
  11757. return result;
  11758. }
  11759. }
  11760. function FunctionalRenderContext(data, props, children, parent, Ctor) {
  11761. var _this = this;
  11762. var options = Ctor.options;
  11763. // ensure the createElement function in functional components
  11764. // gets a unique context - this is necessary for correct named slot check
  11765. var contextVm;
  11766. if (hasOwn(parent, '_uid')) {
  11767. contextVm = Object.create(parent);
  11768. contextVm._original = parent;
  11769. }
  11770. else {
  11771. // the context vm passed in is a functional context as well.
  11772. // in this case we want to make sure we are able to get a hold to the
  11773. // real context instance.
  11774. contextVm = parent;
  11775. // @ts-ignore
  11776. parent = parent._original;
  11777. }
  11778. var isCompiled = isTrue(options._compiled);
  11779. var needNormalization = !isCompiled;
  11780. this.data = data;
  11781. this.props = props;
  11782. this.children = children;
  11783. this.parent = parent;
  11784. this.listeners = data.on || emptyObject;
  11785. this.injections = resolveInject(options.inject, parent);
  11786. this.slots = function () {
  11787. if (!_this.$slots) {
  11788. normalizeScopedSlots(parent, data.scopedSlots, (_this.$slots = resolveSlots(children, parent)));
  11789. }
  11790. return _this.$slots;
  11791. };
  11792. Object.defineProperty(this, 'scopedSlots', {
  11793. enumerable: true,
  11794. get: function () {
  11795. return normalizeScopedSlots(parent, data.scopedSlots, this.slots());
  11796. }
  11797. });
  11798. // support for compiled functional template
  11799. if (isCompiled) {
  11800. // exposing $options for renderStatic()
  11801. this.$options = options;
  11802. // pre-resolve slots for renderSlot()
  11803. this.$slots = this.slots();
  11804. this.$scopedSlots = normalizeScopedSlots(parent, data.scopedSlots, this.$slots);
  11805. }
  11806. if (options._scopeId) {
  11807. this._c = function (a, b, c, d) {
  11808. var vnode = createElement$1(contextVm, a, b, c, d, needNormalization);
  11809. if (vnode && !isArray(vnode)) {
  11810. vnode.fnScopeId = options._scopeId;
  11811. vnode.fnContext = parent;
  11812. }
  11813. return vnode;
  11814. };
  11815. }
  11816. else {
  11817. this._c = function (a, b, c, d) {
  11818. return createElement$1(contextVm, a, b, c, d, needNormalization);
  11819. };
  11820. }
  11821. }
  11822. installRenderHelpers(FunctionalRenderContext.prototype);
  11823. function createFunctionalComponent(Ctor, propsData, data, contextVm, children) {
  11824. var options = Ctor.options;
  11825. var props = {};
  11826. var propOptions = options.props;
  11827. if (isDef(propOptions)) {
  11828. for (var key in propOptions) {
  11829. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  11830. }
  11831. }
  11832. else {
  11833. if (isDef(data.attrs))
  11834. mergeProps(props, data.attrs);
  11835. if (isDef(data.props))
  11836. mergeProps(props, data.props);
  11837. }
  11838. var renderContext = new FunctionalRenderContext(data, props, children, contextVm, Ctor);
  11839. var vnode = options.render.call(null, renderContext._c, renderContext);
  11840. if (vnode instanceof VNode) {
  11841. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options);
  11842. }
  11843. else if (isArray(vnode)) {
  11844. var vnodes = normalizeChildren(vnode) || [];
  11845. var res = new Array(vnodes.length);
  11846. for (var i = 0; i < vnodes.length; i++) {
  11847. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options);
  11848. }
  11849. return res;
  11850. }
  11851. }
  11852. function cloneAndMarkFunctionalResult(vnode, data, contextVm, options, renderContext) {
  11853. // #7817 clone node before setting fnContext, otherwise if the node is reused
  11854. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  11855. // that should not be matched to match.
  11856. var clone = cloneVNode(vnode);
  11857. clone.fnContext = contextVm;
  11858. clone.fnOptions = options;
  11859. if (data.slot) {
  11860. (clone.data || (clone.data = {})).slot = data.slot;
  11861. }
  11862. return clone;
  11863. }
  11864. function mergeProps(to, from) {
  11865. for (var key in from) {
  11866. to[camelize(key)] = from[key];
  11867. }
  11868. }
  11869. function getComponentName(options) {
  11870. return options.name || options.__name || options._componentTag;
  11871. }
  11872. // inline hooks to be invoked on component VNodes during patch
  11873. var componentVNodeHooks = {
  11874. init: function (vnode, hydrating) {
  11875. if (vnode.componentInstance &&
  11876. !vnode.componentInstance._isDestroyed &&
  11877. vnode.data.keepAlive) {
  11878. // kept-alive components, treat as a patch
  11879. var mountedNode = vnode; // work around flow
  11880. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  11881. }
  11882. else {
  11883. var child = (vnode.componentInstance = createComponentInstanceForVnode(vnode, activeInstance));
  11884. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  11885. }
  11886. },
  11887. prepatch: function (oldVnode, vnode) {
  11888. var options = vnode.componentOptions;
  11889. var child = (vnode.componentInstance = oldVnode.componentInstance);
  11890. updateChildComponent(child, options.propsData, // updated props
  11891. options.listeners, // updated listeners
  11892. vnode, // new parent vnode
  11893. options.children // new children
  11894. );
  11895. },
  11896. insert: function (vnode) {
  11897. var context = vnode.context, componentInstance = vnode.componentInstance;
  11898. if (!componentInstance._isMounted) {
  11899. componentInstance._isMounted = true;
  11900. callHook$1(componentInstance, 'mounted');
  11901. }
  11902. if (vnode.data.keepAlive) {
  11903. if (context._isMounted) {
  11904. // vue-router#1212
  11905. // During updates, a kept-alive component's child components may
  11906. // change, so directly walking the tree here may call activated hooks
  11907. // on incorrect children. Instead we push them into a queue which will
  11908. // be processed after the whole patch process ended.
  11909. queueActivatedComponent(componentInstance);
  11910. }
  11911. else {
  11912. activateChildComponent(componentInstance, true /* direct */);
  11913. }
  11914. }
  11915. },
  11916. destroy: function (vnode) {
  11917. var componentInstance = vnode.componentInstance;
  11918. if (!componentInstance._isDestroyed) {
  11919. if (!vnode.data.keepAlive) {
  11920. componentInstance.$destroy();
  11921. }
  11922. else {
  11923. deactivateChildComponent(componentInstance, true /* direct */);
  11924. }
  11925. }
  11926. }
  11927. };
  11928. var hooksToMerge = Object.keys(componentVNodeHooks);
  11929. function createComponent(Ctor, data, context, children, tag) {
  11930. if (isUndef(Ctor)) {
  11931. return;
  11932. }
  11933. var baseCtor = context.$options._base;
  11934. // plain options object: turn it into a constructor
  11935. if (isObject(Ctor)) {
  11936. Ctor = baseCtor.extend(Ctor);
  11937. }
  11938. // if at this stage it's not a constructor or an async component factory,
  11939. // reject.
  11940. if (typeof Ctor !== 'function') {
  11941. return;
  11942. }
  11943. // async component
  11944. var asyncFactory;
  11945. // @ts-expect-error
  11946. if (isUndef(Ctor.cid)) {
  11947. asyncFactory = Ctor;
  11948. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  11949. if (Ctor === undefined) {
  11950. // return a placeholder node for async component, which is rendered
  11951. // as a comment node but preserves all the raw information for the node.
  11952. // the information will be used for async server-rendering and hydration.
  11953. return createAsyncPlaceholder(asyncFactory, data, context, children, tag);
  11954. }
  11955. }
  11956. data = data || {};
  11957. // resolve constructor options in case global mixins are applied after
  11958. // component constructor creation
  11959. resolveConstructorOptions(Ctor);
  11960. // transform component v-model data into props & events
  11961. if (isDef(data.model)) {
  11962. // @ts-expect-error
  11963. transformModel(Ctor.options, data);
  11964. }
  11965. // extract props
  11966. // @ts-expect-error
  11967. var propsData = extractPropsFromVNodeData(data, Ctor);
  11968. // functional component
  11969. // @ts-expect-error
  11970. if (isTrue(Ctor.options.functional)) {
  11971. return createFunctionalComponent(Ctor, propsData, data, context, children);
  11972. }
  11973. // extract listeners, since these needs to be treated as
  11974. // child component listeners instead of DOM listeners
  11975. var listeners = data.on;
  11976. // replace with listeners with .native modifier
  11977. // so it gets processed during parent component patch.
  11978. data.on = data.nativeOn;
  11979. // @ts-expect-error
  11980. if (isTrue(Ctor.options.abstract)) {
  11981. // abstract components do not keep anything
  11982. // other than props & listeners & slot
  11983. // work around flow
  11984. var slot = data.slot;
  11985. data = {};
  11986. if (slot) {
  11987. data.slot = slot;
  11988. }
  11989. }
  11990. // install component management hooks onto the placeholder node
  11991. installComponentHooks(data);
  11992. // return a placeholder vnode
  11993. // @ts-expect-error
  11994. var name = getComponentName(Ctor.options) || tag;
  11995. var vnode = new VNode(
  11996. // @ts-expect-error
  11997. "vue-component-".concat(Ctor.cid).concat(name ? "-".concat(name) : ''), data, undefined, undefined, undefined, context,
  11998. // @ts-expect-error
  11999. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children }, asyncFactory);
  12000. return vnode;
  12001. }
  12002. function createComponentInstanceForVnode(
  12003. // we know it's MountedComponentVNode but flow doesn't
  12004. vnode,
  12005. // activeInstance in lifecycle state
  12006. parent) {
  12007. var options = {
  12008. _isComponent: true,
  12009. _parentVnode: vnode,
  12010. parent: parent
  12011. };
  12012. // check inline-template render functions
  12013. var inlineTemplate = vnode.data.inlineTemplate;
  12014. if (isDef(inlineTemplate)) {
  12015. options.render = inlineTemplate.render;
  12016. options.staticRenderFns = inlineTemplate.staticRenderFns;
  12017. }
  12018. return new vnode.componentOptions.Ctor(options);
  12019. }
  12020. function installComponentHooks(data) {
  12021. var hooks = data.hook || (data.hook = {});
  12022. for (var i = 0; i < hooksToMerge.length; i++) {
  12023. var key = hooksToMerge[i];
  12024. var existing = hooks[key];
  12025. var toMerge = componentVNodeHooks[key];
  12026. // @ts-expect-error
  12027. if (existing !== toMerge && !(existing && existing._merged)) {
  12028. hooks[key] = existing ? mergeHook(toMerge, existing) : toMerge;
  12029. }
  12030. }
  12031. }
  12032. function mergeHook(f1, f2) {
  12033. var merged = function (a, b) {
  12034. // flow complains about extra args which is why we use any
  12035. f1(a, b);
  12036. f2(a, b);
  12037. };
  12038. merged._merged = true;
  12039. return merged;
  12040. }
  12041. // transform component v-model info (value and callback) into
  12042. // prop and event handler respectively.
  12043. function transformModel(options, data) {
  12044. var prop = (options.model && options.model.prop) || 'value';
  12045. var event = (options.model && options.model.event) || 'input';
  12046. (data.attrs || (data.attrs = {}))[prop] = data.model.value;
  12047. var on = data.on || (data.on = {});
  12048. var existing = on[event];
  12049. var callback = data.model.callback;
  12050. if (isDef(existing)) {
  12051. if (isArray(existing)
  12052. ? existing.indexOf(callback) === -1
  12053. : existing !== callback) {
  12054. on[event] = [callback].concat(existing);
  12055. }
  12056. }
  12057. else {
  12058. on[event] = callback;
  12059. }
  12060. }
  12061. var warn = noop;
  12062. /**
  12063. * Option overwriting strategies are functions that handle
  12064. * how to merge a parent option value and a child option
  12065. * value into the final value.
  12066. */
  12067. var strats = config.optionMergeStrategies;
  12068. /**
  12069. * Helper that recursively merges two data objects together.
  12070. */
  12071. function mergeData(to, from, recursive) {
  12072. if (recursive === void 0) { recursive = true; }
  12073. if (!from)
  12074. return to;
  12075. var key, toVal, fromVal;
  12076. var keys = hasSymbol
  12077. ? Reflect.ownKeys(from)
  12078. : Object.keys(from);
  12079. for (var i = 0; i < keys.length; i++) {
  12080. key = keys[i];
  12081. // in case the object is already observed...
  12082. if (key === '__ob__')
  12083. continue;
  12084. toVal = to[key];
  12085. fromVal = from[key];
  12086. if (!recursive || !hasOwn(to, key)) {
  12087. set(to, key, fromVal);
  12088. }
  12089. else if (toVal !== fromVal &&
  12090. isPlainObject(toVal) &&
  12091. isPlainObject(fromVal)) {
  12092. mergeData(toVal, fromVal);
  12093. }
  12094. }
  12095. return to;
  12096. }
  12097. /**
  12098. * Data
  12099. */
  12100. function mergeDataOrFn(parentVal, childVal, vm) {
  12101. if (!vm) {
  12102. // in a Vue.extend merge, both should be functions
  12103. if (!childVal) {
  12104. return parentVal;
  12105. }
  12106. if (!parentVal) {
  12107. return childVal;
  12108. }
  12109. // when parentVal & childVal are both present,
  12110. // we need to return a function that returns the
  12111. // merged result of both functions... no need to
  12112. // check if parentVal is a function here because
  12113. // it has to be a function to pass previous merges.
  12114. return function mergedDataFn() {
  12115. return mergeData(isFunction(childVal) ? childVal.call(this, this) : childVal, isFunction(parentVal) ? parentVal.call(this, this) : parentVal);
  12116. };
  12117. }
  12118. else {
  12119. return function mergedInstanceDataFn() {
  12120. // instance merge
  12121. var instanceData = isFunction(childVal)
  12122. ? childVal.call(vm, vm)
  12123. : childVal;
  12124. var defaultData = isFunction(parentVal)
  12125. ? parentVal.call(vm, vm)
  12126. : parentVal;
  12127. if (instanceData) {
  12128. return mergeData(instanceData, defaultData);
  12129. }
  12130. else {
  12131. return defaultData;
  12132. }
  12133. };
  12134. }
  12135. }
  12136. strats.data = function (parentVal, childVal, vm) {
  12137. if (!vm) {
  12138. if (childVal && typeof childVal !== 'function') {
  12139. return parentVal;
  12140. }
  12141. return mergeDataOrFn(parentVal, childVal);
  12142. }
  12143. return mergeDataOrFn(parentVal, childVal, vm);
  12144. };
  12145. /**
  12146. * Hooks and props are merged as arrays.
  12147. */
  12148. function mergeLifecycleHook(parentVal, childVal) {
  12149. var res = childVal
  12150. ? parentVal
  12151. ? parentVal.concat(childVal)
  12152. : isArray(childVal)
  12153. ? childVal
  12154. : [childVal]
  12155. : parentVal;
  12156. return res ? dedupeHooks(res) : res;
  12157. }
  12158. function dedupeHooks(hooks) {
  12159. var res = [];
  12160. for (var i = 0; i < hooks.length; i++) {
  12161. if (res.indexOf(hooks[i]) === -1) {
  12162. res.push(hooks[i]);
  12163. }
  12164. }
  12165. return res;
  12166. }
  12167. LIFECYCLE_HOOKS.forEach(function (hook) {
  12168. strats[hook] = mergeLifecycleHook;
  12169. });
  12170. /**
  12171. * Assets
  12172. *
  12173. * When a vm is present (instance creation), we need to do
  12174. * a three-way merge between constructor options, instance
  12175. * options and parent options.
  12176. */
  12177. function mergeAssets(parentVal, childVal, vm, key) {
  12178. var res = Object.create(parentVal || null);
  12179. if (childVal) {
  12180. return extend(res, childVal);
  12181. }
  12182. else {
  12183. return res;
  12184. }
  12185. }
  12186. ASSET_TYPES.forEach(function (type) {
  12187. strats[type + 's'] = mergeAssets;
  12188. });
  12189. /**
  12190. * Watchers.
  12191. *
  12192. * Watchers hashes should not overwrite one
  12193. * another, so we merge them as arrays.
  12194. */
  12195. strats.watch = function (parentVal, childVal, vm, key) {
  12196. // work around Firefox's Object.prototype.watch...
  12197. //@ts-expect-error work around
  12198. if (parentVal === nativeWatch)
  12199. parentVal = undefined;
  12200. //@ts-expect-error work around
  12201. if (childVal === nativeWatch)
  12202. childVal = undefined;
  12203. /* istanbul ignore if */
  12204. if (!childVal)
  12205. return Object.create(parentVal || null);
  12206. if (!parentVal)
  12207. return childVal;
  12208. var ret = {};
  12209. extend(ret, parentVal);
  12210. for (var key_1 in childVal) {
  12211. var parent_1 = ret[key_1];
  12212. var child = childVal[key_1];
  12213. if (parent_1 && !isArray(parent_1)) {
  12214. parent_1 = [parent_1];
  12215. }
  12216. ret[key_1] = parent_1 ? parent_1.concat(child) : isArray(child) ? child : [child];
  12217. }
  12218. return ret;
  12219. };
  12220. /**
  12221. * Other object hashes.
  12222. */
  12223. strats.props =
  12224. strats.methods =
  12225. strats.inject =
  12226. strats.computed =
  12227. function (parentVal, childVal, vm, key) {
  12228. if (childVal && "production" !== 'production') {
  12229. assertObjectType(key, childVal);
  12230. }
  12231. if (!parentVal)
  12232. return childVal;
  12233. var ret = Object.create(null);
  12234. extend(ret, parentVal);
  12235. if (childVal)
  12236. extend(ret, childVal);
  12237. return ret;
  12238. };
  12239. strats.provide = function (parentVal, childVal) {
  12240. if (!parentVal)
  12241. return childVal;
  12242. return function () {
  12243. var ret = Object.create(null);
  12244. mergeData(ret, isFunction(parentVal) ? parentVal.call(this) : parentVal);
  12245. if (childVal) {
  12246. mergeData(ret, isFunction(childVal) ? childVal.call(this) : childVal, false // non-recursive
  12247. );
  12248. }
  12249. return ret;
  12250. };
  12251. };
  12252. /**
  12253. * Default strategy.
  12254. */
  12255. var defaultStrat = function (parentVal, childVal) {
  12256. return childVal === undefined ? parentVal : childVal;
  12257. };
  12258. /**
  12259. * Ensure all props option syntax are normalized into the
  12260. * Object-based format.
  12261. */
  12262. function normalizeProps(options, vm) {
  12263. var props = options.props;
  12264. if (!props)
  12265. return;
  12266. var res = {};
  12267. var i, val, name;
  12268. if (isArray(props)) {
  12269. i = props.length;
  12270. while (i--) {
  12271. val = props[i];
  12272. if (typeof val === 'string') {
  12273. name = camelize(val);
  12274. res[name] = { type: null };
  12275. }
  12276. }
  12277. }
  12278. else if (isPlainObject(props)) {
  12279. for (var key in props) {
  12280. val = props[key];
  12281. name = camelize(key);
  12282. res[name] = isPlainObject(val) ? val : { type: val };
  12283. }
  12284. }
  12285. else ;
  12286. options.props = res;
  12287. }
  12288. /**
  12289. * Normalize all injections into Object-based format
  12290. */
  12291. function normalizeInject(options, vm) {
  12292. var inject = options.inject;
  12293. if (!inject)
  12294. return;
  12295. var normalized = (options.inject = {});
  12296. if (isArray(inject)) {
  12297. for (var i = 0; i < inject.length; i++) {
  12298. normalized[inject[i]] = { from: inject[i] };
  12299. }
  12300. }
  12301. else if (isPlainObject(inject)) {
  12302. for (var key in inject) {
  12303. var val = inject[key];
  12304. normalized[key] = isPlainObject(val)
  12305. ? extend({ from: key }, val)
  12306. : { from: val };
  12307. }
  12308. }
  12309. else ;
  12310. }
  12311. /**
  12312. * Normalize raw function directives into object format.
  12313. */
  12314. function normalizeDirectives$1(options) {
  12315. var dirs = options.directives;
  12316. if (dirs) {
  12317. for (var key in dirs) {
  12318. var def = dirs[key];
  12319. if (isFunction(def)) {
  12320. dirs[key] = { bind: def, update: def };
  12321. }
  12322. }
  12323. }
  12324. }
  12325. function assertObjectType(name, value, vm) {
  12326. if (!isPlainObject(value)) {
  12327. warn("Invalid value for option \"".concat(name, "\": expected an Object, ") +
  12328. "but got ".concat(toRawType(value), "."));
  12329. }
  12330. }
  12331. /**
  12332. * Merge two option objects into a new one.
  12333. * Core utility used in both instantiation and inheritance.
  12334. */
  12335. function mergeOptions(parent, child, vm) {
  12336. if (isFunction(child)) {
  12337. // @ts-expect-error
  12338. child = child.options;
  12339. }
  12340. normalizeProps(child);
  12341. normalizeInject(child);
  12342. normalizeDirectives$1(child);
  12343. // Apply extends and mixins on the child options,
  12344. // but only if it is a raw options object that isn't
  12345. // the result of another mergeOptions call.
  12346. // Only merged options has the _base property.
  12347. if (!child._base) {
  12348. if (child.extends) {
  12349. parent = mergeOptions(parent, child.extends, vm);
  12350. }
  12351. if (child.mixins) {
  12352. for (var i = 0, l = child.mixins.length; i < l; i++) {
  12353. parent = mergeOptions(parent, child.mixins[i], vm);
  12354. }
  12355. }
  12356. }
  12357. var options = {};
  12358. var key;
  12359. for (key in parent) {
  12360. mergeField(key);
  12361. }
  12362. for (key in child) {
  12363. if (!hasOwn(parent, key)) {
  12364. mergeField(key);
  12365. }
  12366. }
  12367. function mergeField(key) {
  12368. var strat = strats[key] || defaultStrat;
  12369. options[key] = strat(parent[key], child[key], vm, key);
  12370. }
  12371. return options;
  12372. }
  12373. /**
  12374. * Resolve an asset.
  12375. * This function is used because child instances need access
  12376. * to assets defined in its ancestor chain.
  12377. */
  12378. function resolveAsset(options, type, id, warnMissing) {
  12379. /* istanbul ignore if */
  12380. if (typeof id !== 'string') {
  12381. return;
  12382. }
  12383. var assets = options[type];
  12384. // check local registration variations first
  12385. if (hasOwn(assets, id))
  12386. return assets[id];
  12387. var camelizedId = camelize(id);
  12388. if (hasOwn(assets, camelizedId))
  12389. return assets[camelizedId];
  12390. var PascalCaseId = capitalize(camelizedId);
  12391. if (hasOwn(assets, PascalCaseId))
  12392. return assets[PascalCaseId];
  12393. // fallback to prototype chain
  12394. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  12395. return res;
  12396. }
  12397. function validateProp(key, propOptions, propsData, vm) {
  12398. var prop = propOptions[key];
  12399. var absent = !hasOwn(propsData, key);
  12400. var value = propsData[key];
  12401. // boolean casting
  12402. var booleanIndex = getTypeIndex(Boolean, prop.type);
  12403. if (booleanIndex > -1) {
  12404. if (absent && !hasOwn(prop, 'default')) {
  12405. value = false;
  12406. }
  12407. else if (value === '' || value === hyphenate(key)) {
  12408. // only cast empty string / same name to boolean if
  12409. // boolean has higher priority
  12410. var stringIndex = getTypeIndex(String, prop.type);
  12411. if (stringIndex < 0 || booleanIndex < stringIndex) {
  12412. value = true;
  12413. }
  12414. }
  12415. }
  12416. // check default value
  12417. if (value === undefined) {
  12418. value = getPropDefaultValue(vm, prop, key);
  12419. // since the default value is a fresh copy,
  12420. // make sure to observe it.
  12421. var prevShouldObserve = shouldObserve;
  12422. toggleObserving(true);
  12423. observe(value);
  12424. toggleObserving(prevShouldObserve);
  12425. }
  12426. return value;
  12427. }
  12428. /**
  12429. * Get the default value of a prop.
  12430. */
  12431. function getPropDefaultValue(vm, prop, key) {
  12432. // no default, return undefined
  12433. if (!hasOwn(prop, 'default')) {
  12434. return undefined;
  12435. }
  12436. var def = prop.default;
  12437. // the raw prop value was also undefined from previous render,
  12438. // return previous default value to avoid unnecessary watcher trigger
  12439. if (vm &&
  12440. vm.$options.propsData &&
  12441. vm.$options.propsData[key] === undefined &&
  12442. vm._props[key] !== undefined) {
  12443. return vm._props[key];
  12444. }
  12445. // call factory function for non-Function types
  12446. // a value is Function if its prototype is function even across different execution context
  12447. return isFunction(def) && getType(prop.type) !== 'Function'
  12448. ? def.call(vm)
  12449. : def;
  12450. }
  12451. var functionTypeCheckRE = /^\s*function (\w+)/;
  12452. /**
  12453. * Use function string name to check built-in types,
  12454. * because a simple equality check will fail when running
  12455. * across different vms / iframes.
  12456. */
  12457. function getType(fn) {
  12458. var match = fn && fn.toString().match(functionTypeCheckRE);
  12459. return match ? match[1] : '';
  12460. }
  12461. function isSameType(a, b) {
  12462. return getType(a) === getType(b);
  12463. }
  12464. function getTypeIndex(type, expectedTypes) {
  12465. if (!isArray(expectedTypes)) {
  12466. return isSameType(expectedTypes, type) ? 0 : -1;
  12467. }
  12468. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  12469. if (isSameType(expectedTypes[i], type)) {
  12470. return i;
  12471. }
  12472. }
  12473. return -1;
  12474. }
  12475. var sharedPropertyDefinition = {
  12476. enumerable: true,
  12477. configurable: true,
  12478. get: noop,
  12479. set: noop
  12480. };
  12481. function proxy(target, sourceKey, key) {
  12482. sharedPropertyDefinition.get = function proxyGetter() {
  12483. return this[sourceKey][key];
  12484. };
  12485. sharedPropertyDefinition.set = function proxySetter(val) {
  12486. this[sourceKey][key] = val;
  12487. };
  12488. Object.defineProperty(target, key, sharedPropertyDefinition);
  12489. }
  12490. function initState(vm) {
  12491. var opts = vm.$options;
  12492. if (opts.props)
  12493. initProps$1(vm, opts.props);
  12494. // Composition API
  12495. initSetup(vm);
  12496. if (opts.methods)
  12497. initMethods(vm, opts.methods);
  12498. if (opts.data) {
  12499. initData(vm);
  12500. }
  12501. else {
  12502. var ob = observe((vm._data = {}));
  12503. ob && ob.vmCount++;
  12504. }
  12505. if (opts.computed)
  12506. initComputed$1(vm, opts.computed);
  12507. if (opts.watch && opts.watch !== nativeWatch) {
  12508. initWatch(vm, opts.watch);
  12509. }
  12510. }
  12511. function initProps$1(vm, propsOptions) {
  12512. var propsData = vm.$options.propsData || {};
  12513. var props = (vm._props = shallowReactive({}));
  12514. // cache prop keys so that future props updates can iterate using Array
  12515. // instead of dynamic object key enumeration.
  12516. var keys = (vm.$options._propKeys = []);
  12517. var isRoot = !vm.$parent;
  12518. // root instance props should be converted
  12519. if (!isRoot) {
  12520. toggleObserving(false);
  12521. }
  12522. var _loop_1 = function (key) {
  12523. keys.push(key);
  12524. var value = validateProp(key, propsOptions, propsData, vm);
  12525. /* istanbul ignore else */
  12526. {
  12527. defineReactive(props, key, value);
  12528. }
  12529. // static props are already proxied on the component's prototype
  12530. // during Vue.extend(). We only need to proxy props defined at
  12531. // instantiation here.
  12532. if (!(key in vm)) {
  12533. proxy(vm, "_props", key);
  12534. }
  12535. };
  12536. for (var key in propsOptions) {
  12537. _loop_1(key);
  12538. }
  12539. toggleObserving(true);
  12540. }
  12541. function initData(vm) {
  12542. var data = vm.$options.data;
  12543. data = vm._data = isFunction(data) ? getData(data, vm) : data || {};
  12544. if (!isPlainObject(data)) {
  12545. data = {};
  12546. }
  12547. // proxy data on instance
  12548. var keys = Object.keys(data);
  12549. var props = vm.$options.props;
  12550. vm.$options.methods;
  12551. var i = keys.length;
  12552. while (i--) {
  12553. var key = keys[i];
  12554. if (props && hasOwn(props, key)) ;
  12555. else if (!isReserved(key)) {
  12556. proxy(vm, "_data", key);
  12557. }
  12558. }
  12559. // observe data
  12560. var ob = observe(data);
  12561. ob && ob.vmCount++;
  12562. }
  12563. function getData(data, vm) {
  12564. // #7573 disable dep collection when invoking data getters
  12565. pushTarget();
  12566. try {
  12567. return data.call(vm, vm);
  12568. }
  12569. catch (e) {
  12570. handleError(e, vm, "data()");
  12571. return {};
  12572. }
  12573. finally {
  12574. popTarget();
  12575. }
  12576. }
  12577. var computedWatcherOptions = { lazy: true };
  12578. function initComputed$1(vm, computed) {
  12579. // $flow-disable-line
  12580. var watchers = (vm._computedWatchers = Object.create(null));
  12581. // computed properties are just getters during SSR
  12582. var isSSR = isServerRendering();
  12583. for (var key in computed) {
  12584. var userDef = computed[key];
  12585. var getter = isFunction(userDef) ? userDef : userDef.get;
  12586. if (!isSSR) {
  12587. // create internal watcher for the computed property.
  12588. watchers[key] = new Watcher(vm, getter || noop, noop, computedWatcherOptions);
  12589. }
  12590. // component-defined computed properties are already defined on the
  12591. // component prototype. We only need to define computed properties defined
  12592. // at instantiation here.
  12593. if (!(key in vm)) {
  12594. defineComputed(vm, key, userDef);
  12595. }
  12596. }
  12597. }
  12598. function defineComputed(target, key, userDef) {
  12599. var shouldCache = !isServerRendering();
  12600. if (isFunction(userDef)) {
  12601. sharedPropertyDefinition.get = shouldCache
  12602. ? createComputedGetter(key)
  12603. : createGetterInvoker(userDef);
  12604. sharedPropertyDefinition.set = noop;
  12605. }
  12606. else {
  12607. sharedPropertyDefinition.get = userDef.get
  12608. ? shouldCache && userDef.cache !== false
  12609. ? createComputedGetter(key)
  12610. : createGetterInvoker(userDef.get)
  12611. : noop;
  12612. sharedPropertyDefinition.set = userDef.set || noop;
  12613. }
  12614. Object.defineProperty(target, key, sharedPropertyDefinition);
  12615. }
  12616. function createComputedGetter(key) {
  12617. return function computedGetter() {
  12618. var watcher = this._computedWatchers && this._computedWatchers[key];
  12619. if (watcher) {
  12620. if (watcher.dirty) {
  12621. watcher.evaluate();
  12622. }
  12623. if (Dep.target) {
  12624. watcher.depend();
  12625. }
  12626. return watcher.value;
  12627. }
  12628. };
  12629. }
  12630. function createGetterInvoker(fn) {
  12631. return function computedGetter() {
  12632. return fn.call(this, this);
  12633. };
  12634. }
  12635. function initMethods(vm, methods) {
  12636. vm.$options.props;
  12637. for (var key in methods) {
  12638. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  12639. }
  12640. }
  12641. function initWatch(vm, watch) {
  12642. for (var key in watch) {
  12643. var handler = watch[key];
  12644. if (isArray(handler)) {
  12645. for (var i = 0; i < handler.length; i++) {
  12646. createWatcher(vm, key, handler[i]);
  12647. }
  12648. }
  12649. else {
  12650. createWatcher(vm, key, handler);
  12651. }
  12652. }
  12653. }
  12654. function createWatcher(vm, expOrFn, handler, options) {
  12655. if (isPlainObject(handler)) {
  12656. options = handler;
  12657. handler = handler.handler;
  12658. }
  12659. if (typeof handler === 'string') {
  12660. handler = vm[handler];
  12661. }
  12662. return vm.$watch(expOrFn, handler, options);
  12663. }
  12664. function stateMixin(Vue) {
  12665. // flow somehow has problems with directly declared definition object
  12666. // when using Object.defineProperty, so we have to procedurally build up
  12667. // the object here.
  12668. var dataDef = {};
  12669. dataDef.get = function () {
  12670. return this._data;
  12671. };
  12672. var propsDef = {};
  12673. propsDef.get = function () {
  12674. return this._props;
  12675. };
  12676. Object.defineProperty(Vue.prototype, '$data', dataDef);
  12677. Object.defineProperty(Vue.prototype, '$props', propsDef);
  12678. Vue.prototype.$set = set;
  12679. Vue.prototype.$delete = del;
  12680. Vue.prototype.$watch = function (expOrFn, cb, options) {
  12681. var vm = this;
  12682. if (isPlainObject(cb)) {
  12683. return createWatcher(vm, expOrFn, cb, options);
  12684. }
  12685. options = options || {};
  12686. options.user = true;
  12687. var watcher = new Watcher(vm, expOrFn, cb, options);
  12688. if (options.immediate) {
  12689. var info = "callback for immediate watcher \"".concat(watcher.expression, "\"");
  12690. pushTarget();
  12691. invokeWithErrorHandling(cb, vm, [watcher.value], vm, info);
  12692. popTarget();
  12693. }
  12694. return function unwatchFn() {
  12695. watcher.teardown();
  12696. };
  12697. };
  12698. }
  12699. var uid = 0;
  12700. function initMixin$1(Vue) {
  12701. Vue.prototype._init = function (options) {
  12702. var vm = this;
  12703. // a uid
  12704. vm._uid = uid++;
  12705. // a flag to mark this as a Vue instance without having to do instanceof
  12706. // check
  12707. vm._isVue = true;
  12708. // avoid instances from being observed
  12709. vm.__v_skip = true;
  12710. // effect scope
  12711. vm._scope = new EffectScope(true /* detached */);
  12712. vm._scope._vm = true;
  12713. // merge options
  12714. if (options && options._isComponent) {
  12715. // optimize internal component instantiation
  12716. // since dynamic options merging is pretty slow, and none of the
  12717. // internal component options needs special treatment.
  12718. initInternalComponent(vm, options);
  12719. }
  12720. else {
  12721. vm.$options = mergeOptions(resolveConstructorOptions(vm.constructor), options || {}, vm);
  12722. }
  12723. /* istanbul ignore else */
  12724. {
  12725. vm._renderProxy = vm;
  12726. }
  12727. // expose real self
  12728. vm._self = vm;
  12729. initLifecycle(vm);
  12730. initEvents(vm);
  12731. initRender(vm);
  12732. callHook$1(vm, 'beforeCreate', undefined, false /* setContext */);
  12733. initInjections(vm); // resolve injections before data/props
  12734. initState(vm);
  12735. initProvide(vm); // resolve provide after data/props
  12736. callHook$1(vm, 'created');
  12737. if (vm.$options.el) {
  12738. vm.$mount(vm.$options.el);
  12739. }
  12740. };
  12741. }
  12742. function initInternalComponent(vm, options) {
  12743. var opts = (vm.$options = Object.create(vm.constructor.options));
  12744. // doing this because it's faster than dynamic enumeration.
  12745. var parentVnode = options._parentVnode;
  12746. opts.parent = options.parent;
  12747. opts._parentVnode = parentVnode;
  12748. var vnodeComponentOptions = parentVnode.componentOptions;
  12749. opts.propsData = vnodeComponentOptions.propsData;
  12750. opts._parentListeners = vnodeComponentOptions.listeners;
  12751. opts._renderChildren = vnodeComponentOptions.children;
  12752. opts._componentTag = vnodeComponentOptions.tag;
  12753. if (options.render) {
  12754. opts.render = options.render;
  12755. opts.staticRenderFns = options.staticRenderFns;
  12756. }
  12757. }
  12758. function resolveConstructorOptions(Ctor) {
  12759. var options = Ctor.options;
  12760. if (Ctor.super) {
  12761. var superOptions = resolveConstructorOptions(Ctor.super);
  12762. var cachedSuperOptions = Ctor.superOptions;
  12763. if (superOptions !== cachedSuperOptions) {
  12764. // super option changed,
  12765. // need to resolve new options.
  12766. Ctor.superOptions = superOptions;
  12767. // check if there are any late-modified/attached options (#4976)
  12768. var modifiedOptions = resolveModifiedOptions(Ctor);
  12769. // update base extend options
  12770. if (modifiedOptions) {
  12771. extend(Ctor.extendOptions, modifiedOptions);
  12772. }
  12773. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  12774. if (options.name) {
  12775. options.components[options.name] = Ctor;
  12776. }
  12777. }
  12778. }
  12779. return options;
  12780. }
  12781. function resolveModifiedOptions(Ctor) {
  12782. var modified;
  12783. var latest = Ctor.options;
  12784. var sealed = Ctor.sealedOptions;
  12785. for (var key in latest) {
  12786. if (latest[key] !== sealed[key]) {
  12787. if (!modified)
  12788. modified = {};
  12789. modified[key] = latest[key];
  12790. }
  12791. }
  12792. return modified;
  12793. }
  12794. function Vue(options) {
  12795. this._init(options);
  12796. }
  12797. //@ts-expect-error Vue has function type
  12798. initMixin$1(Vue);
  12799. //@ts-expect-error Vue has function type
  12800. stateMixin(Vue);
  12801. //@ts-expect-error Vue has function type
  12802. eventsMixin(Vue);
  12803. //@ts-expect-error Vue has function type
  12804. lifecycleMixin(Vue);
  12805. //@ts-expect-error Vue has function type
  12806. renderMixin(Vue);
  12807. function initUse(Vue) {
  12808. Vue.use = function (plugin) {
  12809. var installedPlugins = this._installedPlugins || (this._installedPlugins = []);
  12810. if (installedPlugins.indexOf(plugin) > -1) {
  12811. return this;
  12812. }
  12813. // additional parameters
  12814. var args = toArray(arguments, 1);
  12815. args.unshift(this);
  12816. if (isFunction(plugin.install)) {
  12817. plugin.install.apply(plugin, args);
  12818. }
  12819. else if (isFunction(plugin)) {
  12820. plugin.apply(null, args);
  12821. }
  12822. installedPlugins.push(plugin);
  12823. return this;
  12824. };
  12825. }
  12826. function initMixin(Vue) {
  12827. Vue.mixin = function (mixin) {
  12828. this.options = mergeOptions(this.options, mixin);
  12829. return this;
  12830. };
  12831. }
  12832. function initExtend(Vue) {
  12833. /**
  12834. * Each instance constructor, including Vue, has a unique
  12835. * cid. This enables us to create wrapped "child
  12836. * constructors" for prototypal inheritance and cache them.
  12837. */
  12838. Vue.cid = 0;
  12839. var cid = 1;
  12840. /**
  12841. * Class inheritance
  12842. */
  12843. Vue.extend = function (extendOptions) {
  12844. extendOptions = extendOptions || {};
  12845. var Super = this;
  12846. var SuperId = Super.cid;
  12847. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  12848. if (cachedCtors[SuperId]) {
  12849. return cachedCtors[SuperId];
  12850. }
  12851. var name = getComponentName(extendOptions) || getComponentName(Super.options);
  12852. var Sub = function VueComponent(options) {
  12853. this._init(options);
  12854. };
  12855. Sub.prototype = Object.create(Super.prototype);
  12856. Sub.prototype.constructor = Sub;
  12857. Sub.cid = cid++;
  12858. Sub.options = mergeOptions(Super.options, extendOptions);
  12859. Sub['super'] = Super;
  12860. // For props and computed properties, we define the proxy getters on
  12861. // the Vue instances at extension time, on the extended prototype. This
  12862. // avoids Object.defineProperty calls for each instance created.
  12863. if (Sub.options.props) {
  12864. initProps(Sub);
  12865. }
  12866. if (Sub.options.computed) {
  12867. initComputed(Sub);
  12868. }
  12869. // allow further extension/mixin/plugin usage
  12870. Sub.extend = Super.extend;
  12871. Sub.mixin = Super.mixin;
  12872. Sub.use = Super.use;
  12873. // create asset registers, so extended classes
  12874. // can have their private assets too.
  12875. ASSET_TYPES.forEach(function (type) {
  12876. Sub[type] = Super[type];
  12877. });
  12878. // enable recursive self-lookup
  12879. if (name) {
  12880. Sub.options.components[name] = Sub;
  12881. }
  12882. // keep a reference to the super options at extension time.
  12883. // later at instantiation we can check if Super's options have
  12884. // been updated.
  12885. Sub.superOptions = Super.options;
  12886. Sub.extendOptions = extendOptions;
  12887. Sub.sealedOptions = extend({}, Sub.options);
  12888. // cache constructor
  12889. cachedCtors[SuperId] = Sub;
  12890. return Sub;
  12891. };
  12892. }
  12893. function initProps(Comp) {
  12894. var props = Comp.options.props;
  12895. for (var key in props) {
  12896. proxy(Comp.prototype, "_props", key);
  12897. }
  12898. }
  12899. function initComputed(Comp) {
  12900. var computed = Comp.options.computed;
  12901. for (var key in computed) {
  12902. defineComputed(Comp.prototype, key, computed[key]);
  12903. }
  12904. }
  12905. function initAssetRegisters(Vue) {
  12906. /**
  12907. * Create asset registration methods.
  12908. */
  12909. ASSET_TYPES.forEach(function (type) {
  12910. // @ts-expect-error function is not exact same type
  12911. Vue[type] = function (id, definition) {
  12912. if (!definition) {
  12913. return this.options[type + 's'][id];
  12914. }
  12915. else {
  12916. if (type === 'component' && isPlainObject(definition)) {
  12917. // @ts-expect-error
  12918. definition.name = definition.name || id;
  12919. definition = this.options._base.extend(definition);
  12920. }
  12921. if (type === 'directive' && isFunction(definition)) {
  12922. definition = { bind: definition, update: definition };
  12923. }
  12924. this.options[type + 's'][id] = definition;
  12925. return definition;
  12926. }
  12927. };
  12928. });
  12929. }
  12930. function _getComponentName(opts) {
  12931. return opts && (getComponentName(opts.Ctor.options) || opts.tag);
  12932. }
  12933. function matches(pattern, name) {
  12934. if (isArray(pattern)) {
  12935. return pattern.indexOf(name) > -1;
  12936. }
  12937. else if (typeof pattern === 'string') {
  12938. return pattern.split(',').indexOf(name) > -1;
  12939. }
  12940. else if (isRegExp(pattern)) {
  12941. return pattern.test(name);
  12942. }
  12943. /* istanbul ignore next */
  12944. return false;
  12945. }
  12946. function pruneCache(keepAliveInstance, filter) {
  12947. var cache = keepAliveInstance.cache, keys = keepAliveInstance.keys, _vnode = keepAliveInstance._vnode;
  12948. for (var key in cache) {
  12949. var entry = cache[key];
  12950. if (entry) {
  12951. var name_1 = entry.name;
  12952. if (name_1 && !filter(name_1)) {
  12953. pruneCacheEntry(cache, key, keys, _vnode);
  12954. }
  12955. }
  12956. }
  12957. }
  12958. function pruneCacheEntry(cache, key, keys, current) {
  12959. var entry = cache[key];
  12960. if (entry && (!current || entry.tag !== current.tag)) {
  12961. // @ts-expect-error can be undefined
  12962. entry.componentInstance.$destroy();
  12963. }
  12964. cache[key] = null;
  12965. remove$2(keys, key);
  12966. }
  12967. var patternTypes = [String, RegExp, Array];
  12968. // TODO defineComponent
  12969. var KeepAlive = {
  12970. name: 'keep-alive',
  12971. abstract: true,
  12972. props: {
  12973. include: patternTypes,
  12974. exclude: patternTypes,
  12975. max: [String, Number]
  12976. },
  12977. methods: {
  12978. cacheVNode: function () {
  12979. var _a = this, cache = _a.cache, keys = _a.keys, vnodeToCache = _a.vnodeToCache, keyToCache = _a.keyToCache;
  12980. if (vnodeToCache) {
  12981. var tag = vnodeToCache.tag, componentInstance = vnodeToCache.componentInstance, componentOptions = vnodeToCache.componentOptions;
  12982. cache[keyToCache] = {
  12983. name: _getComponentName(componentOptions),
  12984. tag: tag,
  12985. componentInstance: componentInstance
  12986. };
  12987. keys.push(keyToCache);
  12988. // prune oldest entry
  12989. if (this.max && keys.length > parseInt(this.max)) {
  12990. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  12991. }
  12992. this.vnodeToCache = null;
  12993. }
  12994. }
  12995. },
  12996. created: function () {
  12997. this.cache = Object.create(null);
  12998. this.keys = [];
  12999. },
  13000. destroyed: function () {
  13001. for (var key in this.cache) {
  13002. pruneCacheEntry(this.cache, key, this.keys);
  13003. }
  13004. },
  13005. mounted: function () {
  13006. var _this = this;
  13007. this.cacheVNode();
  13008. this.$watch('include', function (val) {
  13009. pruneCache(_this, function (name) { return matches(val, name); });
  13010. });
  13011. this.$watch('exclude', function (val) {
  13012. pruneCache(_this, function (name) { return !matches(val, name); });
  13013. });
  13014. },
  13015. updated: function () {
  13016. this.cacheVNode();
  13017. },
  13018. render: function () {
  13019. var slot = this.$slots.default;
  13020. var vnode = getFirstComponentChild(slot);
  13021. var componentOptions = vnode && vnode.componentOptions;
  13022. if (componentOptions) {
  13023. // check pattern
  13024. var name_2 = _getComponentName(componentOptions);
  13025. var _a = this, include = _a.include, exclude = _a.exclude;
  13026. if (
  13027. // not included
  13028. (include && (!name_2 || !matches(include, name_2))) ||
  13029. // excluded
  13030. (exclude && name_2 && matches(exclude, name_2))) {
  13031. return vnode;
  13032. }
  13033. var _b = this, cache = _b.cache, keys = _b.keys;
  13034. var key = vnode.key == null
  13035. ? // same constructor may get registered as different local components
  13036. // so cid alone is not enough (#3269)
  13037. componentOptions.Ctor.cid +
  13038. (componentOptions.tag ? "::".concat(componentOptions.tag) : '')
  13039. : vnode.key;
  13040. if (cache[key]) {
  13041. vnode.componentInstance = cache[key].componentInstance;
  13042. // make current key freshest
  13043. remove$2(keys, key);
  13044. keys.push(key);
  13045. }
  13046. else {
  13047. // delay setting the cache until update
  13048. this.vnodeToCache = vnode;
  13049. this.keyToCache = key;
  13050. }
  13051. // @ts-expect-error can vnode.data can be undefined
  13052. vnode.data.keepAlive = true;
  13053. }
  13054. return vnode || (slot && slot[0]);
  13055. }
  13056. };
  13057. var builtInComponents = {
  13058. KeepAlive: KeepAlive
  13059. };
  13060. function initGlobalAPI(Vue) {
  13061. // config
  13062. var configDef = {};
  13063. configDef.get = function () { return config; };
  13064. Object.defineProperty(Vue, 'config', configDef);
  13065. // exposed util methods.
  13066. // NOTE: these are not considered part of the public API - avoid relying on
  13067. // them unless you are aware of the risk.
  13068. Vue.util = {
  13069. warn: warn,
  13070. extend: extend,
  13071. mergeOptions: mergeOptions,
  13072. defineReactive: defineReactive
  13073. };
  13074. Vue.set = set;
  13075. Vue.delete = del;
  13076. Vue.nextTick = nextTick;
  13077. // 2.6 explicit observable API
  13078. Vue.observable = function (obj) {
  13079. observe(obj);
  13080. return obj;
  13081. };
  13082. Vue.options = Object.create(null);
  13083. ASSET_TYPES.forEach(function (type) {
  13084. Vue.options[type + 's'] = Object.create(null);
  13085. });
  13086. // this is used to identify the "base" constructor to extend all plain-object
  13087. // components with in Weex's multi-instance scenarios.
  13088. Vue.options._base = Vue;
  13089. extend(Vue.options.components, builtInComponents);
  13090. initUse(Vue);
  13091. initMixin(Vue);
  13092. initExtend(Vue);
  13093. initAssetRegisters(Vue);
  13094. }
  13095. initGlobalAPI(Vue);
  13096. Object.defineProperty(Vue.prototype, '$isServer', {
  13097. get: isServerRendering
  13098. });
  13099. Object.defineProperty(Vue.prototype, '$ssrContext', {
  13100. get: function () {
  13101. /* istanbul ignore next */
  13102. return this.$vnode && this.$vnode.ssrContext;
  13103. }
  13104. });
  13105. // expose FunctionalRenderContext for ssr runtime helper installation
  13106. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  13107. value: FunctionalRenderContext
  13108. });
  13109. Vue.version = version;
  13110. // these are reserved for web because they are directly compiled away
  13111. // during template compilation
  13112. var isReservedAttr = makeMap('style,class');
  13113. // attributes that should be using props for binding
  13114. var acceptValue = makeMap('input,textarea,option,select,progress');
  13115. var mustUseProp = function (tag, type, attr) {
  13116. return ((attr === 'value' && acceptValue(tag) && type !== 'button') ||
  13117. (attr === 'selected' && tag === 'option') ||
  13118. (attr === 'checked' && tag === 'input') ||
  13119. (attr === 'muted' && tag === 'video'));
  13120. };
  13121. var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck');
  13122. var isValidContentEditableValue = makeMap('events,caret,typing,plaintext-only');
  13123. var convertEnumeratedValue = function (key, value) {
  13124. return isFalsyAttrValue(value) || value === 'false'
  13125. ? 'false'
  13126. : // allow arbitrary string value for contenteditable
  13127. key === 'contenteditable' && isValidContentEditableValue(value)
  13128. ? value
  13129. : 'true';
  13130. };
  13131. var isBooleanAttr = makeMap('allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' +
  13132. 'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +
  13133. 'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +
  13134. 'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +
  13135. 'required,reversed,scoped,seamless,selected,sortable,' +
  13136. 'truespeed,typemustmatch,visible');
  13137. var xlinkNS = 'http://www.w3.org/1999/xlink';
  13138. var isXlink = function (name) {
  13139. return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink';
  13140. };
  13141. var getXlinkProp = function (name) {
  13142. return isXlink(name) ? name.slice(6, name.length) : '';
  13143. };
  13144. var isFalsyAttrValue = function (val) {
  13145. return val == null || val === false;
  13146. };
  13147. function genClassForVnode(vnode) {
  13148. var data = vnode.data;
  13149. var parentNode = vnode;
  13150. var childNode = vnode;
  13151. while (isDef(childNode.componentInstance)) {
  13152. childNode = childNode.componentInstance._vnode;
  13153. if (childNode && childNode.data) {
  13154. data = mergeClassData(childNode.data, data);
  13155. }
  13156. }
  13157. // @ts-expect-error parentNode.parent not VNodeWithData
  13158. while (isDef((parentNode = parentNode.parent))) {
  13159. if (parentNode && parentNode.data) {
  13160. data = mergeClassData(data, parentNode.data);
  13161. }
  13162. }
  13163. return renderClass(data.staticClass, data.class);
  13164. }
  13165. function mergeClassData(child, parent) {
  13166. return {
  13167. staticClass: concat(child.staticClass, parent.staticClass),
  13168. class: isDef(child.class) ? [child.class, parent.class] : parent.class
  13169. };
  13170. }
  13171. function renderClass(staticClass, dynamicClass) {
  13172. if (isDef(staticClass) || isDef(dynamicClass)) {
  13173. return concat(staticClass, stringifyClass(dynamicClass));
  13174. }
  13175. /* istanbul ignore next */
  13176. return '';
  13177. }
  13178. function concat(a, b) {
  13179. return a ? (b ? a + ' ' + b : a) : b || '';
  13180. }
  13181. function stringifyClass(value) {
  13182. if (Array.isArray(value)) {
  13183. return stringifyArray(value);
  13184. }
  13185. if (isObject(value)) {
  13186. return stringifyObject(value);
  13187. }
  13188. if (typeof value === 'string') {
  13189. return value;
  13190. }
  13191. /* istanbul ignore next */
  13192. return '';
  13193. }
  13194. function stringifyArray(value) {
  13195. var res = '';
  13196. var stringified;
  13197. for (var i = 0, l = value.length; i < l; i++) {
  13198. if (isDef((stringified = stringifyClass(value[i]))) && stringified !== '') {
  13199. if (res)
  13200. res += ' ';
  13201. res += stringified;
  13202. }
  13203. }
  13204. return res;
  13205. }
  13206. function stringifyObject(value) {
  13207. var res = '';
  13208. for (var key in value) {
  13209. if (value[key]) {
  13210. if (res)
  13211. res += ' ';
  13212. res += key;
  13213. }
  13214. }
  13215. return res;
  13216. }
  13217. var namespaceMap = {
  13218. svg: 'http://www.w3.org/2000/svg',
  13219. math: 'http://www.w3.org/1998/Math/MathML'
  13220. };
  13221. var isHTMLTag = makeMap('html,body,base,head,link,meta,style,title,' +
  13222. 'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +
  13223. 'div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,' +
  13224. 'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +
  13225. 's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' +
  13226. 'embed,object,param,source,canvas,script,noscript,del,ins,' +
  13227. 'caption,col,colgroup,table,thead,tbody,td,th,tr,' +
  13228. 'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' +
  13229. 'output,progress,select,textarea,' +
  13230. 'details,dialog,menu,menuitem,summary,' +
  13231. 'content,element,shadow,template,blockquote,iframe,tfoot');
  13232. // this map is intentionally selective, only covering SVG elements that may
  13233. // contain child elements.
  13234. var isSVG = makeMap('svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,' +
  13235. 'foreignobject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +
  13236. 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view', true);
  13237. var isReservedTag = function (tag) {
  13238. return isHTMLTag(tag) || isSVG(tag);
  13239. };
  13240. function getTagNamespace(tag) {
  13241. if (isSVG(tag)) {
  13242. return 'svg';
  13243. }
  13244. // basic support for MathML
  13245. // note it doesn't support other MathML elements being component roots
  13246. if (tag === 'math') {
  13247. return 'math';
  13248. }
  13249. }
  13250. var unknownElementCache = Object.create(null);
  13251. function isUnknownElement(tag) {
  13252. /* istanbul ignore if */
  13253. if (!inBrowser) {
  13254. return true;
  13255. }
  13256. if (isReservedTag(tag)) {
  13257. return false;
  13258. }
  13259. tag = tag.toLowerCase();
  13260. /* istanbul ignore if */
  13261. if (unknownElementCache[tag] != null) {
  13262. return unknownElementCache[tag];
  13263. }
  13264. var el = document.createElement(tag);
  13265. if (tag.indexOf('-') > -1) {
  13266. // http://stackoverflow.com/a/28210364/1070244
  13267. return (unknownElementCache[tag] =
  13268. el.constructor === window.HTMLUnknownElement ||
  13269. el.constructor === window.HTMLElement);
  13270. }
  13271. else {
  13272. return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString()));
  13273. }
  13274. }
  13275. var isTextInputType = makeMap('text,number,password,search,email,tel,url');
  13276. /**
  13277. * Query an element selector if it's not an element already.
  13278. */
  13279. function query(el) {
  13280. if (typeof el === 'string') {
  13281. var selected = document.querySelector(el);
  13282. if (!selected) {
  13283. return document.createElement('div');
  13284. }
  13285. return selected;
  13286. }
  13287. else {
  13288. return el;
  13289. }
  13290. }
  13291. function createElement(tagName, vnode) {
  13292. var elm = document.createElement(tagName);
  13293. if (tagName !== 'select') {
  13294. return elm;
  13295. }
  13296. // false or null will remove the attribute but undefined will not
  13297. if (vnode.data &&
  13298. vnode.data.attrs &&
  13299. vnode.data.attrs.multiple !== undefined) {
  13300. elm.setAttribute('multiple', 'multiple');
  13301. }
  13302. return elm;
  13303. }
  13304. function createElementNS(namespace, tagName) {
  13305. return document.createElementNS(namespaceMap[namespace], tagName);
  13306. }
  13307. function createTextNode(text) {
  13308. return document.createTextNode(text);
  13309. }
  13310. function createComment(text) {
  13311. return document.createComment(text);
  13312. }
  13313. function insertBefore(parentNode, newNode, referenceNode) {
  13314. parentNode.insertBefore(newNode, referenceNode);
  13315. }
  13316. function removeChild(node, child) {
  13317. node.removeChild(child);
  13318. }
  13319. function appendChild(node, child) {
  13320. node.appendChild(child);
  13321. }
  13322. function parentNode(node) {
  13323. return node.parentNode;
  13324. }
  13325. function nextSibling(node) {
  13326. return node.nextSibling;
  13327. }
  13328. function tagName(node) {
  13329. return node.tagName;
  13330. }
  13331. function setTextContent(node, text) {
  13332. node.textContent = text;
  13333. }
  13334. function setStyleScope(node, scopeId) {
  13335. node.setAttribute(scopeId, '');
  13336. }
  13337. var nodeOps = /*#__PURE__*/Object.freeze({
  13338. __proto__: null,
  13339. createElement: createElement,
  13340. createElementNS: createElementNS,
  13341. createTextNode: createTextNode,
  13342. createComment: createComment,
  13343. insertBefore: insertBefore,
  13344. removeChild: removeChild,
  13345. appendChild: appendChild,
  13346. parentNode: parentNode,
  13347. nextSibling: nextSibling,
  13348. tagName: tagName,
  13349. setTextContent: setTextContent,
  13350. setStyleScope: setStyleScope
  13351. });
  13352. var ref = {
  13353. create: function (_, vnode) {
  13354. registerRef(vnode);
  13355. },
  13356. update: function (oldVnode, vnode) {
  13357. if (oldVnode.data.ref !== vnode.data.ref) {
  13358. registerRef(oldVnode, true);
  13359. registerRef(vnode);
  13360. }
  13361. },
  13362. destroy: function (vnode) {
  13363. registerRef(vnode, true);
  13364. }
  13365. };
  13366. function registerRef(vnode, isRemoval) {
  13367. var ref = vnode.data.ref;
  13368. if (!isDef(ref))
  13369. return;
  13370. var vm = vnode.context;
  13371. var refValue = vnode.componentInstance || vnode.elm;
  13372. var value = isRemoval ? null : refValue;
  13373. var $refsValue = isRemoval ? undefined : refValue;
  13374. if (isFunction(ref)) {
  13375. invokeWithErrorHandling(ref, vm, [value], vm, "template ref function");
  13376. return;
  13377. }
  13378. var isFor = vnode.data.refInFor;
  13379. var _isString = typeof ref === 'string' || typeof ref === 'number';
  13380. var _isRef = isRef(ref);
  13381. var refs = vm.$refs;
  13382. if (_isString || _isRef) {
  13383. if (isFor) {
  13384. var existing = _isString ? refs[ref] : ref.value;
  13385. if (isRemoval) {
  13386. isArray(existing) && remove$2(existing, refValue);
  13387. }
  13388. else {
  13389. if (!isArray(existing)) {
  13390. if (_isString) {
  13391. refs[ref] = [refValue];
  13392. setSetupRef(vm, ref, refs[ref]);
  13393. }
  13394. else {
  13395. ref.value = [refValue];
  13396. }
  13397. }
  13398. else if (!existing.includes(refValue)) {
  13399. existing.push(refValue);
  13400. }
  13401. }
  13402. }
  13403. else if (_isString) {
  13404. if (isRemoval && refs[ref] !== refValue) {
  13405. return;
  13406. }
  13407. refs[ref] = $refsValue;
  13408. setSetupRef(vm, ref, value);
  13409. }
  13410. else if (_isRef) {
  13411. if (isRemoval && ref.value !== refValue) {
  13412. return;
  13413. }
  13414. ref.value = value;
  13415. }
  13416. else ;
  13417. }
  13418. }
  13419. function setSetupRef(_a, key, val) {
  13420. var _setupState = _a._setupState;
  13421. if (_setupState && hasOwn(_setupState, key)) {
  13422. if (isRef(_setupState[key])) {
  13423. _setupState[key].value = val;
  13424. }
  13425. else {
  13426. _setupState[key] = val;
  13427. }
  13428. }
  13429. }
  13430. /**
  13431. * Virtual DOM patching algorithm based on Snabbdom by
  13432. * Simon Friis Vindum (@paldepind)
  13433. * Licensed under the MIT License
  13434. * https://github.com/paldepind/snabbdom/blob/master/LICENSE
  13435. *
  13436. * modified by Evan You (@yyx990803)
  13437. *
  13438. * Not type-checking this because this file is perf-critical and the cost
  13439. * of making flow understand it is not worth it.
  13440. */
  13441. var emptyNode = new VNode('', {}, []);
  13442. var hooks = ['create', 'activate', 'update', 'remove', 'destroy'];
  13443. function sameVnode(a, b) {
  13444. return (a.key === b.key &&
  13445. a.asyncFactory === b.asyncFactory &&
  13446. ((a.tag === b.tag &&
  13447. a.isComment === b.isComment &&
  13448. isDef(a.data) === isDef(b.data) &&
  13449. sameInputType(a, b)) ||
  13450. (isTrue(a.isAsyncPlaceholder) && isUndef(b.asyncFactory.error))));
  13451. }
  13452. function sameInputType(a, b) {
  13453. if (a.tag !== 'input')
  13454. return true;
  13455. var i;
  13456. var typeA = isDef((i = a.data)) && isDef((i = i.attrs)) && i.type;
  13457. var typeB = isDef((i = b.data)) && isDef((i = i.attrs)) && i.type;
  13458. return typeA === typeB || (isTextInputType(typeA) && isTextInputType(typeB));
  13459. }
  13460. function createKeyToOldIdx(children, beginIdx, endIdx) {
  13461. var i, key;
  13462. var map = {};
  13463. for (i = beginIdx; i <= endIdx; ++i) {
  13464. key = children[i].key;
  13465. if (isDef(key))
  13466. map[key] = i;
  13467. }
  13468. return map;
  13469. }
  13470. function createPatchFunction(backend) {
  13471. var i, j;
  13472. var cbs = {};
  13473. var modules = backend.modules, nodeOps = backend.nodeOps;
  13474. for (i = 0; i < hooks.length; ++i) {
  13475. cbs[hooks[i]] = [];
  13476. for (j = 0; j < modules.length; ++j) {
  13477. if (isDef(modules[j][hooks[i]])) {
  13478. cbs[hooks[i]].push(modules[j][hooks[i]]);
  13479. }
  13480. }
  13481. }
  13482. function emptyNodeAt(elm) {
  13483. return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm);
  13484. }
  13485. function createRmCb(childElm, listeners) {
  13486. function remove() {
  13487. if (--remove.listeners === 0) {
  13488. removeNode(childElm);
  13489. }
  13490. }
  13491. remove.listeners = listeners;
  13492. return remove;
  13493. }
  13494. function removeNode(el) {
  13495. var parent = nodeOps.parentNode(el);
  13496. // element may have already been removed due to v-html / v-text
  13497. if (isDef(parent)) {
  13498. nodeOps.removeChild(parent, el);
  13499. }
  13500. }
  13501. function createElm(vnode, insertedVnodeQueue, parentElm, refElm, nested, ownerArray, index) {
  13502. if (isDef(vnode.elm) && isDef(ownerArray)) {
  13503. // This vnode was used in a previous render!
  13504. // now it's used as a new node, overwriting its elm would cause
  13505. // potential patch errors down the road when it's used as an insertion
  13506. // reference node. Instead, we clone the node on-demand before creating
  13507. // associated DOM element for it.
  13508. vnode = ownerArray[index] = cloneVNode(vnode);
  13509. }
  13510. vnode.isRootInsert = !nested; // for transition enter check
  13511. if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) {
  13512. return;
  13513. }
  13514. var data = vnode.data;
  13515. var children = vnode.children;
  13516. var tag = vnode.tag;
  13517. if (isDef(tag)) {
  13518. vnode.elm = vnode.ns
  13519. ? nodeOps.createElementNS(vnode.ns, tag)
  13520. : nodeOps.createElement(tag, vnode);
  13521. setScope(vnode);
  13522. createChildren(vnode, children, insertedVnodeQueue);
  13523. if (isDef(data)) {
  13524. invokeCreateHooks(vnode, insertedVnodeQueue);
  13525. }
  13526. insert(parentElm, vnode.elm, refElm);
  13527. }
  13528. else if (isTrue(vnode.isComment)) {
  13529. vnode.elm = nodeOps.createComment(vnode.text);
  13530. insert(parentElm, vnode.elm, refElm);
  13531. }
  13532. else {
  13533. vnode.elm = nodeOps.createTextNode(vnode.text);
  13534. insert(parentElm, vnode.elm, refElm);
  13535. }
  13536. }
  13537. function createComponent(vnode, insertedVnodeQueue, parentElm, refElm) {
  13538. var i = vnode.data;
  13539. if (isDef(i)) {
  13540. var isReactivated = isDef(vnode.componentInstance) && i.keepAlive;
  13541. if (isDef((i = i.hook)) && isDef((i = i.init))) {
  13542. i(vnode, false /* hydrating */);
  13543. }
  13544. // after calling the init hook, if the vnode is a child component
  13545. // it should've created a child instance and mounted it. the child
  13546. // component also has set the placeholder vnode's elm.
  13547. // in that case we can just return the element and be done.
  13548. if (isDef(vnode.componentInstance)) {
  13549. initComponent(vnode, insertedVnodeQueue);
  13550. insert(parentElm, vnode.elm, refElm);
  13551. if (isTrue(isReactivated)) {
  13552. reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm);
  13553. }
  13554. return true;
  13555. }
  13556. }
  13557. }
  13558. function initComponent(vnode, insertedVnodeQueue) {
  13559. if (isDef(vnode.data.pendingInsert)) {
  13560. insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert);
  13561. vnode.data.pendingInsert = null;
  13562. }
  13563. vnode.elm = vnode.componentInstance.$el;
  13564. if (isPatchable(vnode)) {
  13565. invokeCreateHooks(vnode, insertedVnodeQueue);
  13566. setScope(vnode);
  13567. }
  13568. else {
  13569. // empty component root.
  13570. // skip all element-related modules except for ref (#3455)
  13571. registerRef(vnode);
  13572. // make sure to invoke the insert hook
  13573. insertedVnodeQueue.push(vnode);
  13574. }
  13575. }
  13576. function reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm) {
  13577. var i;
  13578. // hack for #4339: a reactivated component with inner transition
  13579. // does not trigger because the inner node's created hooks are not called
  13580. // again. It's not ideal to involve module-specific logic in here but
  13581. // there doesn't seem to be a better way to do it.
  13582. var innerNode = vnode;
  13583. while (innerNode.componentInstance) {
  13584. innerNode = innerNode.componentInstance._vnode;
  13585. if (isDef((i = innerNode.data)) && isDef((i = i.transition))) {
  13586. for (i = 0; i < cbs.activate.length; ++i) {
  13587. cbs.activate[i](emptyNode, innerNode);
  13588. }
  13589. insertedVnodeQueue.push(innerNode);
  13590. break;
  13591. }
  13592. }
  13593. // unlike a newly created component,
  13594. // a reactivated keep-alive component doesn't insert itself
  13595. insert(parentElm, vnode.elm, refElm);
  13596. }
  13597. function insert(parent, elm, ref) {
  13598. if (isDef(parent)) {
  13599. if (isDef(ref)) {
  13600. if (nodeOps.parentNode(ref) === parent) {
  13601. nodeOps.insertBefore(parent, elm, ref);
  13602. }
  13603. }
  13604. else {
  13605. nodeOps.appendChild(parent, elm);
  13606. }
  13607. }
  13608. }
  13609. function createChildren(vnode, children, insertedVnodeQueue) {
  13610. if (isArray(children)) {
  13611. for (var i_1 = 0; i_1 < children.length; ++i_1) {
  13612. createElm(children[i_1], insertedVnodeQueue, vnode.elm, null, true, children, i_1);
  13613. }
  13614. }
  13615. else if (isPrimitive(vnode.text)) {
  13616. nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(String(vnode.text)));
  13617. }
  13618. }
  13619. function isPatchable(vnode) {
  13620. while (vnode.componentInstance) {
  13621. vnode = vnode.componentInstance._vnode;
  13622. }
  13623. return isDef(vnode.tag);
  13624. }
  13625. function invokeCreateHooks(vnode, insertedVnodeQueue) {
  13626. for (var i_2 = 0; i_2 < cbs.create.length; ++i_2) {
  13627. cbs.create[i_2](emptyNode, vnode);
  13628. }
  13629. i = vnode.data.hook; // Reuse variable
  13630. if (isDef(i)) {
  13631. if (isDef(i.create))
  13632. i.create(emptyNode, vnode);
  13633. if (isDef(i.insert))
  13634. insertedVnodeQueue.push(vnode);
  13635. }
  13636. }
  13637. // set scope id attribute for scoped CSS.
  13638. // this is implemented as a special case to avoid the overhead
  13639. // of going through the normal attribute patching process.
  13640. function setScope(vnode) {
  13641. var i;
  13642. if (isDef((i = vnode.fnScopeId))) {
  13643. nodeOps.setStyleScope(vnode.elm, i);
  13644. }
  13645. else {
  13646. var ancestor = vnode;
  13647. while (ancestor) {
  13648. if (isDef((i = ancestor.context)) && isDef((i = i.$options._scopeId))) {
  13649. nodeOps.setStyleScope(vnode.elm, i);
  13650. }
  13651. ancestor = ancestor.parent;
  13652. }
  13653. }
  13654. // for slot content they should also get the scopeId from the host instance.
  13655. if (isDef((i = activeInstance)) &&
  13656. i !== vnode.context &&
  13657. i !== vnode.fnContext &&
  13658. isDef((i = i.$options._scopeId))) {
  13659. nodeOps.setStyleScope(vnode.elm, i);
  13660. }
  13661. }
  13662. function addVnodes(parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) {
  13663. for (; startIdx <= endIdx; ++startIdx) {
  13664. createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm, false, vnodes, startIdx);
  13665. }
  13666. }
  13667. function invokeDestroyHook(vnode) {
  13668. var i, j;
  13669. var data = vnode.data;
  13670. if (isDef(data)) {
  13671. if (isDef((i = data.hook)) && isDef((i = i.destroy)))
  13672. i(vnode);
  13673. for (i = 0; i < cbs.destroy.length; ++i)
  13674. cbs.destroy[i](vnode);
  13675. }
  13676. if (isDef((i = vnode.children))) {
  13677. for (j = 0; j < vnode.children.length; ++j) {
  13678. invokeDestroyHook(vnode.children[j]);
  13679. }
  13680. }
  13681. }
  13682. function removeVnodes(vnodes, startIdx, endIdx) {
  13683. for (; startIdx <= endIdx; ++startIdx) {
  13684. var ch = vnodes[startIdx];
  13685. if (isDef(ch)) {
  13686. if (isDef(ch.tag)) {
  13687. removeAndInvokeRemoveHook(ch);
  13688. invokeDestroyHook(ch);
  13689. }
  13690. else {
  13691. // Text node
  13692. removeNode(ch.elm);
  13693. }
  13694. }
  13695. }
  13696. }
  13697. function removeAndInvokeRemoveHook(vnode, rm) {
  13698. if (isDef(rm) || isDef(vnode.data)) {
  13699. var i_3;
  13700. var listeners = cbs.remove.length + 1;
  13701. if (isDef(rm)) {
  13702. // we have a recursively passed down rm callback
  13703. // increase the listeners count
  13704. rm.listeners += listeners;
  13705. }
  13706. else {
  13707. // directly removing
  13708. rm = createRmCb(vnode.elm, listeners);
  13709. }
  13710. // recursively invoke hooks on child component root node
  13711. if (isDef((i_3 = vnode.componentInstance)) &&
  13712. isDef((i_3 = i_3._vnode)) &&
  13713. isDef(i_3.data)) {
  13714. removeAndInvokeRemoveHook(i_3, rm);
  13715. }
  13716. for (i_3 = 0; i_3 < cbs.remove.length; ++i_3) {
  13717. cbs.remove[i_3](vnode, rm);
  13718. }
  13719. if (isDef((i_3 = vnode.data.hook)) && isDef((i_3 = i_3.remove))) {
  13720. i_3(vnode, rm);
  13721. }
  13722. else {
  13723. rm();
  13724. }
  13725. }
  13726. else {
  13727. removeNode(vnode.elm);
  13728. }
  13729. }
  13730. function updateChildren(parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) {
  13731. var oldStartIdx = 0;
  13732. var newStartIdx = 0;
  13733. var oldEndIdx = oldCh.length - 1;
  13734. var oldStartVnode = oldCh[0];
  13735. var oldEndVnode = oldCh[oldEndIdx];
  13736. var newEndIdx = newCh.length - 1;
  13737. var newStartVnode = newCh[0];
  13738. var newEndVnode = newCh[newEndIdx];
  13739. var oldKeyToIdx, idxInOld, vnodeToMove, refElm;
  13740. // removeOnly is a special flag used only by <transition-group>
  13741. // to ensure removed elements stay in correct relative positions
  13742. // during leaving transitions
  13743. var canMove = !removeOnly;
  13744. while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
  13745. if (isUndef(oldStartVnode)) {
  13746. oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left
  13747. }
  13748. else if (isUndef(oldEndVnode)) {
  13749. oldEndVnode = oldCh[--oldEndIdx];
  13750. }
  13751. else if (sameVnode(oldStartVnode, newStartVnode)) {
  13752. patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
  13753. oldStartVnode = oldCh[++oldStartIdx];
  13754. newStartVnode = newCh[++newStartIdx];
  13755. }
  13756. else if (sameVnode(oldEndVnode, newEndVnode)) {
  13757. patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);
  13758. oldEndVnode = oldCh[--oldEndIdx];
  13759. newEndVnode = newCh[--newEndIdx];
  13760. }
  13761. else if (sameVnode(oldStartVnode, newEndVnode)) {
  13762. // Vnode moved right
  13763. patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);
  13764. canMove &&
  13765. nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm));
  13766. oldStartVnode = oldCh[++oldStartIdx];
  13767. newEndVnode = newCh[--newEndIdx];
  13768. }
  13769. else if (sameVnode(oldEndVnode, newStartVnode)) {
  13770. // Vnode moved left
  13771. patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
  13772. canMove &&
  13773. nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);
  13774. oldEndVnode = oldCh[--oldEndIdx];
  13775. newStartVnode = newCh[++newStartIdx];
  13776. }
  13777. else {
  13778. if (isUndef(oldKeyToIdx))
  13779. oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx);
  13780. idxInOld = isDef(newStartVnode.key)
  13781. ? oldKeyToIdx[newStartVnode.key]
  13782. : findIdxInOld(newStartVnode, oldCh, oldStartIdx, oldEndIdx);
  13783. if (isUndef(idxInOld)) {
  13784. // New element
  13785. createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);
  13786. }
  13787. else {
  13788. vnodeToMove = oldCh[idxInOld];
  13789. if (sameVnode(vnodeToMove, newStartVnode)) {
  13790. patchVnode(vnodeToMove, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
  13791. oldCh[idxInOld] = undefined;
  13792. canMove &&
  13793. nodeOps.insertBefore(parentElm, vnodeToMove.elm, oldStartVnode.elm);
  13794. }
  13795. else {
  13796. // same key but different element. treat as new element
  13797. createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);
  13798. }
  13799. }
  13800. newStartVnode = newCh[++newStartIdx];
  13801. }
  13802. }
  13803. if (oldStartIdx > oldEndIdx) {
  13804. refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;
  13805. addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
  13806. }
  13807. else if (newStartIdx > newEndIdx) {
  13808. removeVnodes(oldCh, oldStartIdx, oldEndIdx);
  13809. }
  13810. }
  13811. function findIdxInOld(node, oldCh, start, end) {
  13812. for (var i_5 = start; i_5 < end; i_5++) {
  13813. var c = oldCh[i_5];
  13814. if (isDef(c) && sameVnode(node, c))
  13815. return i_5;
  13816. }
  13817. }
  13818. function patchVnode(oldVnode, vnode, insertedVnodeQueue, ownerArray, index, removeOnly) {
  13819. if (oldVnode === vnode) {
  13820. return;
  13821. }
  13822. if (isDef(vnode.elm) && isDef(ownerArray)) {
  13823. // clone reused vnode
  13824. vnode = ownerArray[index] = cloneVNode(vnode);
  13825. }
  13826. var elm = (vnode.elm = oldVnode.elm);
  13827. if (isTrue(oldVnode.isAsyncPlaceholder)) {
  13828. if (isDef(vnode.asyncFactory.resolved)) {
  13829. hydrate(oldVnode.elm, vnode, insertedVnodeQueue);
  13830. }
  13831. else {
  13832. vnode.isAsyncPlaceholder = true;
  13833. }
  13834. return;
  13835. }
  13836. // reuse element for static trees.
  13837. // note we only do this if the vnode is cloned -
  13838. // if the new node is not cloned it means the render functions have been
  13839. // reset by the hot-reload-api and we need to do a proper re-render.
  13840. if (isTrue(vnode.isStatic) &&
  13841. isTrue(oldVnode.isStatic) &&
  13842. vnode.key === oldVnode.key &&
  13843. (isTrue(vnode.isCloned) || isTrue(vnode.isOnce))) {
  13844. vnode.componentInstance = oldVnode.componentInstance;
  13845. return;
  13846. }
  13847. var i;
  13848. var data = vnode.data;
  13849. if (isDef(data) && isDef((i = data.hook)) && isDef((i = i.prepatch))) {
  13850. i(oldVnode, vnode);
  13851. }
  13852. var oldCh = oldVnode.children;
  13853. var ch = vnode.children;
  13854. if (isDef(data) && isPatchable(vnode)) {
  13855. for (i = 0; i < cbs.update.length; ++i)
  13856. cbs.update[i](oldVnode, vnode);
  13857. if (isDef((i = data.hook)) && isDef((i = i.update)))
  13858. i(oldVnode, vnode);
  13859. }
  13860. if (isUndef(vnode.text)) {
  13861. if (isDef(oldCh) && isDef(ch)) {
  13862. if (oldCh !== ch)
  13863. updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly);
  13864. }
  13865. else if (isDef(ch)) {
  13866. if (isDef(oldVnode.text))
  13867. nodeOps.setTextContent(elm, '');
  13868. addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
  13869. }
  13870. else if (isDef(oldCh)) {
  13871. removeVnodes(oldCh, 0, oldCh.length - 1);
  13872. }
  13873. else if (isDef(oldVnode.text)) {
  13874. nodeOps.setTextContent(elm, '');
  13875. }
  13876. }
  13877. else if (oldVnode.text !== vnode.text) {
  13878. nodeOps.setTextContent(elm, vnode.text);
  13879. }
  13880. if (isDef(data)) {
  13881. if (isDef((i = data.hook)) && isDef((i = i.postpatch)))
  13882. i(oldVnode, vnode);
  13883. }
  13884. }
  13885. function invokeInsertHook(vnode, queue, initial) {
  13886. // delay insert hooks for component root nodes, invoke them after the
  13887. // element is really inserted
  13888. if (isTrue(initial) && isDef(vnode.parent)) {
  13889. vnode.parent.data.pendingInsert = queue;
  13890. }
  13891. else {
  13892. for (var i_6 = 0; i_6 < queue.length; ++i_6) {
  13893. queue[i_6].data.hook.insert(queue[i_6]);
  13894. }
  13895. }
  13896. }
  13897. // list of modules that can skip create hook during hydration because they
  13898. // are already rendered on the client or has no need for initialization
  13899. // Note: style is excluded because it relies on initial clone for future
  13900. // deep updates (#7063).
  13901. var isRenderedModule = makeMap('attrs,class,staticClass,staticStyle,key');
  13902. // Note: this is a browser-only function so we can assume elms are DOM nodes.
  13903. function hydrate(elm, vnode, insertedVnodeQueue, inVPre) {
  13904. var i;
  13905. var tag = vnode.tag, data = vnode.data, children = vnode.children;
  13906. inVPre = inVPre || (data && data.pre);
  13907. vnode.elm = elm;
  13908. if (isTrue(vnode.isComment) && isDef(vnode.asyncFactory)) {
  13909. vnode.isAsyncPlaceholder = true;
  13910. return true;
  13911. }
  13912. if (isDef(data)) {
  13913. if (isDef((i = data.hook)) && isDef((i = i.init)))
  13914. i(vnode, true /* hydrating */);
  13915. if (isDef((i = vnode.componentInstance))) {
  13916. // child component. it should have hydrated its own tree.
  13917. initComponent(vnode, insertedVnodeQueue);
  13918. return true;
  13919. }
  13920. }
  13921. if (isDef(tag)) {
  13922. if (isDef(children)) {
  13923. // empty element, allow client to pick up and populate children
  13924. if (!elm.hasChildNodes()) {
  13925. createChildren(vnode, children, insertedVnodeQueue);
  13926. }
  13927. else {
  13928. // v-html and domProps: innerHTML
  13929. if (isDef((i = data)) &&
  13930. isDef((i = i.domProps)) &&
  13931. isDef((i = i.innerHTML))) {
  13932. if (i !== elm.innerHTML) {
  13933. return false;
  13934. }
  13935. }
  13936. else {
  13937. // iterate and compare children lists
  13938. var childrenMatch = true;
  13939. var childNode = elm.firstChild;
  13940. for (var i_7 = 0; i_7 < children.length; i_7++) {
  13941. if (!childNode ||
  13942. !hydrate(childNode, children[i_7], insertedVnodeQueue, inVPre)) {
  13943. childrenMatch = false;
  13944. break;
  13945. }
  13946. childNode = childNode.nextSibling;
  13947. }
  13948. // if childNode is not null, it means the actual childNodes list is
  13949. // longer than the virtual children list.
  13950. if (!childrenMatch || childNode) {
  13951. return false;
  13952. }
  13953. }
  13954. }
  13955. }
  13956. if (isDef(data)) {
  13957. var fullInvoke = false;
  13958. for (var key in data) {
  13959. if (!isRenderedModule(key)) {
  13960. fullInvoke = true;
  13961. invokeCreateHooks(vnode, insertedVnodeQueue);
  13962. break;
  13963. }
  13964. }
  13965. if (!fullInvoke && data['class']) {
  13966. // ensure collecting deps for deep class bindings for future updates
  13967. traverse(data['class']);
  13968. }
  13969. }
  13970. }
  13971. else if (elm.data !== vnode.text) {
  13972. elm.data = vnode.text;
  13973. }
  13974. return true;
  13975. }
  13976. return function patch(oldVnode, vnode, hydrating, removeOnly) {
  13977. if (isUndef(vnode)) {
  13978. if (isDef(oldVnode))
  13979. invokeDestroyHook(oldVnode);
  13980. return;
  13981. }
  13982. var isInitialPatch = false;
  13983. var insertedVnodeQueue = [];
  13984. if (isUndef(oldVnode)) {
  13985. // empty mount (likely as component), create new root element
  13986. isInitialPatch = true;
  13987. createElm(vnode, insertedVnodeQueue);
  13988. }
  13989. else {
  13990. var isRealElement = isDef(oldVnode.nodeType);
  13991. if (!isRealElement && sameVnode(oldVnode, vnode)) {
  13992. // patch existing root node
  13993. patchVnode(oldVnode, vnode, insertedVnodeQueue, null, null, removeOnly);
  13994. }
  13995. else {
  13996. if (isRealElement) {
  13997. // mounting to a real element
  13998. // check if this is server-rendered content and if we can perform
  13999. // a successful hydration.
  14000. if (oldVnode.nodeType === 1 && oldVnode.hasAttribute(SSR_ATTR)) {
  14001. oldVnode.removeAttribute(SSR_ATTR);
  14002. hydrating = true;
  14003. }
  14004. if (isTrue(hydrating)) {
  14005. if (hydrate(oldVnode, vnode, insertedVnodeQueue)) {
  14006. invokeInsertHook(vnode, insertedVnodeQueue, true);
  14007. return oldVnode;
  14008. }
  14009. }
  14010. // either not server-rendered, or hydration failed.
  14011. // create an empty node and replace it
  14012. oldVnode = emptyNodeAt(oldVnode);
  14013. }
  14014. // replacing existing element
  14015. var oldElm = oldVnode.elm;
  14016. var parentElm = nodeOps.parentNode(oldElm);
  14017. // create new node
  14018. createElm(vnode, insertedVnodeQueue,
  14019. // extremely rare edge case: do not insert if old element is in a
  14020. // leaving transition. Only happens when combining transition +
  14021. // keep-alive + HOCs. (#4590)
  14022. oldElm._leaveCb ? null : parentElm, nodeOps.nextSibling(oldElm));
  14023. // update parent placeholder node element, recursively
  14024. if (isDef(vnode.parent)) {
  14025. var ancestor = vnode.parent;
  14026. var patchable = isPatchable(vnode);
  14027. while (ancestor) {
  14028. for (var i_8 = 0; i_8 < cbs.destroy.length; ++i_8) {
  14029. cbs.destroy[i_8](ancestor);
  14030. }
  14031. ancestor.elm = vnode.elm;
  14032. if (patchable) {
  14033. for (var i_9 = 0; i_9 < cbs.create.length; ++i_9) {
  14034. cbs.create[i_9](emptyNode, ancestor);
  14035. }
  14036. // #6513
  14037. // invoke insert hooks that may have been merged by create hooks.
  14038. // e.g. for directives that uses the "inserted" hook.
  14039. var insert_1 = ancestor.data.hook.insert;
  14040. if (insert_1.merged) {
  14041. // start at index 1 to avoid re-invoking component mounted hook
  14042. for (var i_10 = 1; i_10 < insert_1.fns.length; i_10++) {
  14043. insert_1.fns[i_10]();
  14044. }
  14045. }
  14046. }
  14047. else {
  14048. registerRef(ancestor);
  14049. }
  14050. ancestor = ancestor.parent;
  14051. }
  14052. }
  14053. // destroy old node
  14054. if (isDef(parentElm)) {
  14055. removeVnodes([oldVnode], 0, 0);
  14056. }
  14057. else if (isDef(oldVnode.tag)) {
  14058. invokeDestroyHook(oldVnode);
  14059. }
  14060. }
  14061. }
  14062. invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch);
  14063. return vnode.elm;
  14064. };
  14065. }
  14066. var directives = {
  14067. create: updateDirectives,
  14068. update: updateDirectives,
  14069. destroy: function unbindDirectives(vnode) {
  14070. // @ts-expect-error emptyNode is not VNodeWithData
  14071. updateDirectives(vnode, emptyNode);
  14072. }
  14073. };
  14074. function updateDirectives(oldVnode, vnode) {
  14075. if (oldVnode.data.directives || vnode.data.directives) {
  14076. _update(oldVnode, vnode);
  14077. }
  14078. }
  14079. function _update(oldVnode, vnode) {
  14080. var isCreate = oldVnode === emptyNode;
  14081. var isDestroy = vnode === emptyNode;
  14082. var oldDirs = normalizeDirectives(oldVnode.data.directives, oldVnode.context);
  14083. var newDirs = normalizeDirectives(vnode.data.directives, vnode.context);
  14084. var dirsWithInsert = [];
  14085. var dirsWithPostpatch = [];
  14086. var key, oldDir, dir;
  14087. for (key in newDirs) {
  14088. oldDir = oldDirs[key];
  14089. dir = newDirs[key];
  14090. if (!oldDir) {
  14091. // new directive, bind
  14092. callHook(dir, 'bind', vnode, oldVnode);
  14093. if (dir.def && dir.def.inserted) {
  14094. dirsWithInsert.push(dir);
  14095. }
  14096. }
  14097. else {
  14098. // existing directive, update
  14099. dir.oldValue = oldDir.value;
  14100. dir.oldArg = oldDir.arg;
  14101. callHook(dir, 'update', vnode, oldVnode);
  14102. if (dir.def && dir.def.componentUpdated) {
  14103. dirsWithPostpatch.push(dir);
  14104. }
  14105. }
  14106. }
  14107. if (dirsWithInsert.length) {
  14108. var callInsert = function () {
  14109. for (var i = 0; i < dirsWithInsert.length; i++) {
  14110. callHook(dirsWithInsert[i], 'inserted', vnode, oldVnode);
  14111. }
  14112. };
  14113. if (isCreate) {
  14114. mergeVNodeHook(vnode, 'insert', callInsert);
  14115. }
  14116. else {
  14117. callInsert();
  14118. }
  14119. }
  14120. if (dirsWithPostpatch.length) {
  14121. mergeVNodeHook(vnode, 'postpatch', function () {
  14122. for (var i = 0; i < dirsWithPostpatch.length; i++) {
  14123. callHook(dirsWithPostpatch[i], 'componentUpdated', vnode, oldVnode);
  14124. }
  14125. });
  14126. }
  14127. if (!isCreate) {
  14128. for (key in oldDirs) {
  14129. if (!newDirs[key]) {
  14130. // no longer present, unbind
  14131. callHook(oldDirs[key], 'unbind', oldVnode, oldVnode, isDestroy);
  14132. }
  14133. }
  14134. }
  14135. }
  14136. var emptyModifiers = Object.create(null);
  14137. function normalizeDirectives(dirs, vm) {
  14138. var res = Object.create(null);
  14139. if (!dirs) {
  14140. // $flow-disable-line
  14141. return res;
  14142. }
  14143. var i, dir;
  14144. for (i = 0; i < dirs.length; i++) {
  14145. dir = dirs[i];
  14146. if (!dir.modifiers) {
  14147. // $flow-disable-line
  14148. dir.modifiers = emptyModifiers;
  14149. }
  14150. res[getRawDirName(dir)] = dir;
  14151. if (vm._setupState && vm._setupState.__sfc) {
  14152. var setupDef = dir.def || resolveAsset(vm, '_setupState', 'v-' + dir.name);
  14153. if (typeof setupDef === 'function') {
  14154. dir.def = {
  14155. bind: setupDef,
  14156. update: setupDef,
  14157. };
  14158. }
  14159. else {
  14160. dir.def = setupDef;
  14161. }
  14162. }
  14163. dir.def = dir.def || resolveAsset(vm.$options, 'directives', dir.name);
  14164. }
  14165. // $flow-disable-line
  14166. return res;
  14167. }
  14168. function getRawDirName(dir) {
  14169. return (dir.rawName || "".concat(dir.name, ".").concat(Object.keys(dir.modifiers || {}).join('.')));
  14170. }
  14171. function callHook(dir, hook, vnode, oldVnode, isDestroy) {
  14172. var fn = dir.def && dir.def[hook];
  14173. if (fn) {
  14174. try {
  14175. fn(vnode.elm, dir, vnode, oldVnode, isDestroy);
  14176. }
  14177. catch (e) {
  14178. handleError(e, vnode.context, "directive ".concat(dir.name, " ").concat(hook, " hook"));
  14179. }
  14180. }
  14181. }
  14182. var baseModules = [ref, directives];
  14183. function updateAttrs(oldVnode, vnode) {
  14184. var opts = vnode.componentOptions;
  14185. if (isDef(opts) && opts.Ctor.options.inheritAttrs === false) {
  14186. return;
  14187. }
  14188. if (isUndef(oldVnode.data.attrs) && isUndef(vnode.data.attrs)) {
  14189. return;
  14190. }
  14191. var key, cur, old;
  14192. var elm = vnode.elm;
  14193. var oldAttrs = oldVnode.data.attrs || {};
  14194. var attrs = vnode.data.attrs || {};
  14195. // clone observed objects, as the user probably wants to mutate it
  14196. if (isDef(attrs.__ob__) || isTrue(attrs._v_attr_proxy)) {
  14197. attrs = vnode.data.attrs = extend({}, attrs);
  14198. }
  14199. for (key in attrs) {
  14200. cur = attrs[key];
  14201. old = oldAttrs[key];
  14202. if (old !== cur) {
  14203. setAttr(elm, key, cur, vnode.data.pre);
  14204. }
  14205. }
  14206. // #4391: in IE9, setting type can reset value for input[type=radio]
  14207. // #6666: IE/Edge forces progress value down to 1 before setting a max
  14208. /* istanbul ignore if */
  14209. if ((isIE || isEdge) && attrs.value !== oldAttrs.value) {
  14210. setAttr(elm, 'value', attrs.value);
  14211. }
  14212. for (key in oldAttrs) {
  14213. if (isUndef(attrs[key])) {
  14214. if (isXlink(key)) {
  14215. elm.removeAttributeNS(xlinkNS, getXlinkProp(key));
  14216. }
  14217. else if (!isEnumeratedAttr(key)) {
  14218. elm.removeAttribute(key);
  14219. }
  14220. }
  14221. }
  14222. }
  14223. function setAttr(el, key, value, isInPre) {
  14224. if (isInPre || el.tagName.indexOf('-') > -1) {
  14225. baseSetAttr(el, key, value);
  14226. }
  14227. else if (isBooleanAttr(key)) {
  14228. // set attribute for blank value
  14229. // e.g. <option disabled>Select one</option>
  14230. if (isFalsyAttrValue(value)) {
  14231. el.removeAttribute(key);
  14232. }
  14233. else {
  14234. // technically allowfullscreen is a boolean attribute for <iframe>,
  14235. // but Flash expects a value of "true" when used on <embed> tag
  14236. value = key === 'allowfullscreen' && el.tagName === 'EMBED' ? 'true' : key;
  14237. el.setAttribute(key, value);
  14238. }
  14239. }
  14240. else if (isEnumeratedAttr(key)) {
  14241. el.setAttribute(key, convertEnumeratedValue(key, value));
  14242. }
  14243. else if (isXlink(key)) {
  14244. if (isFalsyAttrValue(value)) {
  14245. el.removeAttributeNS(xlinkNS, getXlinkProp(key));
  14246. }
  14247. else {
  14248. el.setAttributeNS(xlinkNS, key, value);
  14249. }
  14250. }
  14251. else {
  14252. baseSetAttr(el, key, value);
  14253. }
  14254. }
  14255. function baseSetAttr(el, key, value) {
  14256. if (isFalsyAttrValue(value)) {
  14257. el.removeAttribute(key);
  14258. }
  14259. else {
  14260. // #7138: IE10 & 11 fires input event when setting placeholder on
  14261. // <textarea>... block the first input event and remove the blocker
  14262. // immediately.
  14263. /* istanbul ignore if */
  14264. if (isIE &&
  14265. !isIE9 &&
  14266. el.tagName === 'TEXTAREA' &&
  14267. key === 'placeholder' &&
  14268. value !== '' &&
  14269. !el.__ieph) {
  14270. var blocker_1 = function (e) {
  14271. e.stopImmediatePropagation();
  14272. el.removeEventListener('input', blocker_1);
  14273. };
  14274. el.addEventListener('input', blocker_1);
  14275. // $flow-disable-line
  14276. el.__ieph = true; /* IE placeholder patched */
  14277. }
  14278. el.setAttribute(key, value);
  14279. }
  14280. }
  14281. var attrs = {
  14282. create: updateAttrs,
  14283. update: updateAttrs
  14284. };
  14285. function updateClass(oldVnode, vnode) {
  14286. var el = vnode.elm;
  14287. var data = vnode.data;
  14288. var oldData = oldVnode.data;
  14289. if (isUndef(data.staticClass) &&
  14290. isUndef(data.class) &&
  14291. (isUndef(oldData) ||
  14292. (isUndef(oldData.staticClass) && isUndef(oldData.class)))) {
  14293. return;
  14294. }
  14295. var cls = genClassForVnode(vnode);
  14296. // handle transition classes
  14297. var transitionClass = el._transitionClasses;
  14298. if (isDef(transitionClass)) {
  14299. cls = concat(cls, stringifyClass(transitionClass));
  14300. }
  14301. // set the class
  14302. if (cls !== el._prevClass) {
  14303. el.setAttribute('class', cls);
  14304. el._prevClass = cls;
  14305. }
  14306. }
  14307. var klass = {
  14308. create: updateClass,
  14309. update: updateClass
  14310. };
  14311. // in some cases, the event used has to be determined at runtime
  14312. // so we used some reserved tokens during compile.
  14313. var RANGE_TOKEN = '__r';
  14314. var CHECKBOX_RADIO_TOKEN = '__c';
  14315. // normalize v-model event tokens that can only be determined at runtime.
  14316. // it's important to place the event as the first in the array because
  14317. // the whole point is ensuring the v-model callback gets called before
  14318. // user-attached handlers.
  14319. function normalizeEvents(on) {
  14320. /* istanbul ignore if */
  14321. if (isDef(on[RANGE_TOKEN])) {
  14322. // IE input[type=range] only supports `change` event
  14323. var event_1 = isIE ? 'change' : 'input';
  14324. on[event_1] = [].concat(on[RANGE_TOKEN], on[event_1] || []);
  14325. delete on[RANGE_TOKEN];
  14326. }
  14327. // This was originally intended to fix #4521 but no longer necessary
  14328. // after 2.5. Keeping it for backwards compat with generated code from < 2.4
  14329. /* istanbul ignore if */
  14330. if (isDef(on[CHECKBOX_RADIO_TOKEN])) {
  14331. on.change = [].concat(on[CHECKBOX_RADIO_TOKEN], on.change || []);
  14332. delete on[CHECKBOX_RADIO_TOKEN];
  14333. }
  14334. }
  14335. var target;
  14336. function createOnceHandler(event, handler, capture) {
  14337. var _target = target; // save current target element in closure
  14338. return function onceHandler() {
  14339. var res = handler.apply(null, arguments);
  14340. if (res !== null) {
  14341. remove(event, onceHandler, capture, _target);
  14342. }
  14343. };
  14344. }
  14345. // #9446: Firefox <= 53 (in particular, ESR 52) has incorrect Event.timeStamp
  14346. // implementation and does not fire microtasks in between event propagation, so
  14347. // safe to exclude.
  14348. var useMicrotaskFix = isUsingMicroTask && !(isFF && Number(isFF[1]) <= 53);
  14349. function add(name, handler, capture, passive) {
  14350. // async edge case #6566: inner click event triggers patch, event handler
  14351. // attached to outer element during patch, and triggered again. This
  14352. // happens because browsers fire microtask ticks between event propagation.
  14353. // the solution is simple: we save the timestamp when a handler is attached,
  14354. // and the handler would only fire if the event passed to it was fired
  14355. // AFTER it was attached.
  14356. if (useMicrotaskFix) {
  14357. var attachedTimestamp_1 = currentFlushTimestamp;
  14358. var original_1 = handler;
  14359. //@ts-expect-error
  14360. handler = original_1._wrapper = function (e) {
  14361. if (
  14362. // no bubbling, should always fire.
  14363. // this is just a safety net in case event.timeStamp is unreliable in
  14364. // certain weird environments...
  14365. e.target === e.currentTarget ||
  14366. // event is fired after handler attachment
  14367. e.timeStamp >= attachedTimestamp_1 ||
  14368. // bail for environments that have buggy event.timeStamp implementations
  14369. // #9462 iOS 9 bug: event.timeStamp is 0 after history.pushState
  14370. // #9681 QtWebEngine event.timeStamp is negative value
  14371. e.timeStamp <= 0 ||
  14372. // #9448 bail if event is fired in another document in a multi-page
  14373. // electron/nw.js app, since event.timeStamp will be using a different
  14374. // starting reference
  14375. e.target.ownerDocument !== document) {
  14376. return original_1.apply(this, arguments);
  14377. }
  14378. };
  14379. }
  14380. target.addEventListener(name, handler, supportsPassive ? { capture: capture, passive: passive } : capture);
  14381. }
  14382. function remove(name, handler, capture, _target) {
  14383. (_target || target).removeEventListener(name,
  14384. //@ts-expect-error
  14385. handler._wrapper || handler, capture);
  14386. }
  14387. function updateDOMListeners(oldVnode, vnode) {
  14388. if (isUndef(oldVnode.data.on) && isUndef(vnode.data.on)) {
  14389. return;
  14390. }
  14391. var on = vnode.data.on || {};
  14392. var oldOn = oldVnode.data.on || {};
  14393. // vnode is empty when removing all listeners,
  14394. // and use old vnode dom element
  14395. target = vnode.elm || oldVnode.elm;
  14396. normalizeEvents(on);
  14397. updateListeners(on, oldOn, add, remove, createOnceHandler, vnode.context);
  14398. target = undefined;
  14399. }
  14400. var events = {
  14401. create: updateDOMListeners,
  14402. update: updateDOMListeners,
  14403. // @ts-expect-error emptyNode has actually data
  14404. destroy: function (vnode) { return updateDOMListeners(vnode, emptyNode); }
  14405. };
  14406. var svgContainer;
  14407. function updateDOMProps(oldVnode, vnode) {
  14408. if (isUndef(oldVnode.data.domProps) && isUndef(vnode.data.domProps)) {
  14409. return;
  14410. }
  14411. var key, cur;
  14412. var elm = vnode.elm;
  14413. var oldProps = oldVnode.data.domProps || {};
  14414. var props = vnode.data.domProps || {};
  14415. // clone observed objects, as the user probably wants to mutate it
  14416. if (isDef(props.__ob__) || isTrue(props._v_attr_proxy)) {
  14417. props = vnode.data.domProps = extend({}, props);
  14418. }
  14419. for (key in oldProps) {
  14420. if (!(key in props)) {
  14421. elm[key] = '';
  14422. }
  14423. }
  14424. for (key in props) {
  14425. cur = props[key];
  14426. // ignore children if the node has textContent or innerHTML,
  14427. // as these will throw away existing DOM nodes and cause removal errors
  14428. // on subsequent patches (#3360)
  14429. if (key === 'textContent' || key === 'innerHTML') {
  14430. if (vnode.children)
  14431. vnode.children.length = 0;
  14432. if (cur === oldProps[key])
  14433. continue;
  14434. // #6601 work around Chrome version <= 55 bug where single textNode
  14435. // replaced by innerHTML/textContent retains its parentNode property
  14436. if (elm.childNodes.length === 1) {
  14437. elm.removeChild(elm.childNodes[0]);
  14438. }
  14439. }
  14440. if (key === 'value' && elm.tagName !== 'PROGRESS') {
  14441. // store value as _value as well since
  14442. // non-string values will be stringified
  14443. elm._value = cur;
  14444. // avoid resetting cursor position when value is the same
  14445. var strCur = isUndef(cur) ? '' : String(cur);
  14446. if (shouldUpdateValue(elm, strCur)) {
  14447. elm.value = strCur;
  14448. }
  14449. }
  14450. else if (key === 'innerHTML' &&
  14451. isSVG(elm.tagName) &&
  14452. isUndef(elm.innerHTML)) {
  14453. // IE doesn't support innerHTML for SVG elements
  14454. svgContainer = svgContainer || document.createElement('div');
  14455. svgContainer.innerHTML = "<svg>".concat(cur, "</svg>");
  14456. var svg = svgContainer.firstChild;
  14457. while (elm.firstChild) {
  14458. elm.removeChild(elm.firstChild);
  14459. }
  14460. while (svg.firstChild) {
  14461. elm.appendChild(svg.firstChild);
  14462. }
  14463. }
  14464. else if (
  14465. // skip the update if old and new VDOM state is the same.
  14466. // `value` is handled separately because the DOM value may be temporarily
  14467. // out of sync with VDOM state due to focus, composition and modifiers.
  14468. // This #4521 by skipping the unnecessary `checked` update.
  14469. cur !== oldProps[key]) {
  14470. // some property updates can throw
  14471. // e.g. `value` on <progress> w/ non-finite value
  14472. try {
  14473. elm[key] = cur;
  14474. }
  14475. catch (e) { }
  14476. }
  14477. }
  14478. }
  14479. function shouldUpdateValue(elm, checkVal) {
  14480. return (
  14481. //@ts-expect-error
  14482. !elm.composing &&
  14483. (elm.tagName === 'OPTION' ||
  14484. isNotInFocusAndDirty(elm, checkVal) ||
  14485. isDirtyWithModifiers(elm, checkVal)));
  14486. }
  14487. function isNotInFocusAndDirty(elm, checkVal) {
  14488. // return true when textbox (.number and .trim) loses focus and its value is
  14489. // not equal to the updated value
  14490. var notInFocus = true;
  14491. // #6157
  14492. // work around IE bug when accessing document.activeElement in an iframe
  14493. try {
  14494. notInFocus = document.activeElement !== elm;
  14495. }
  14496. catch (e) { }
  14497. return notInFocus && elm.value !== checkVal;
  14498. }
  14499. function isDirtyWithModifiers(elm, newVal) {
  14500. var value = elm.value;
  14501. var modifiers = elm._vModifiers; // injected by v-model runtime
  14502. if (isDef(modifiers)) {
  14503. if (modifiers.number) {
  14504. return toNumber(value) !== toNumber(newVal);
  14505. }
  14506. if (modifiers.trim) {
  14507. return value.trim() !== newVal.trim();
  14508. }
  14509. }
  14510. return value !== newVal;
  14511. }
  14512. var domProps = {
  14513. create: updateDOMProps,
  14514. update: updateDOMProps
  14515. };
  14516. var parseStyleText = cached(function (cssText) {
  14517. var res = {};
  14518. var listDelimiter = /;(?![^(]*\))/g;
  14519. var propertyDelimiter = /:(.+)/;
  14520. cssText.split(listDelimiter).forEach(function (item) {
  14521. if (item) {
  14522. var tmp = item.split(propertyDelimiter);
  14523. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  14524. }
  14525. });
  14526. return res;
  14527. });
  14528. // merge static and dynamic style data on the same vnode
  14529. function normalizeStyleData(data) {
  14530. var style = normalizeStyleBinding(data.style);
  14531. // static style is pre-processed into an object during compilation
  14532. // and is always a fresh object, so it's safe to merge into it
  14533. return data.staticStyle ? extend(data.staticStyle, style) : style;
  14534. }
  14535. // normalize possible array / string values into Object
  14536. function normalizeStyleBinding(bindingStyle) {
  14537. if (Array.isArray(bindingStyle)) {
  14538. return toObject(bindingStyle);
  14539. }
  14540. if (typeof bindingStyle === 'string') {
  14541. return parseStyleText(bindingStyle);
  14542. }
  14543. return bindingStyle;
  14544. }
  14545. /**
  14546. * parent component style should be after child's
  14547. * so that parent component's style could override it
  14548. */
  14549. function getStyle(vnode, checkChild) {
  14550. var res = {};
  14551. var styleData;
  14552. if (checkChild) {
  14553. var childNode = vnode;
  14554. while (childNode.componentInstance) {
  14555. childNode = childNode.componentInstance._vnode;
  14556. if (childNode &&
  14557. childNode.data &&
  14558. (styleData = normalizeStyleData(childNode.data))) {
  14559. extend(res, styleData);
  14560. }
  14561. }
  14562. }
  14563. if ((styleData = normalizeStyleData(vnode.data))) {
  14564. extend(res, styleData);
  14565. }
  14566. var parentNode = vnode;
  14567. // @ts-expect-error parentNode.parent not VNodeWithData
  14568. while ((parentNode = parentNode.parent)) {
  14569. if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {
  14570. extend(res, styleData);
  14571. }
  14572. }
  14573. return res;
  14574. }
  14575. var cssVarRE = /^--/;
  14576. var importantRE = /\s*!important$/;
  14577. var setProp = function (el, name, val) {
  14578. /* istanbul ignore if */
  14579. if (cssVarRE.test(name)) {
  14580. el.style.setProperty(name, val);
  14581. }
  14582. else if (importantRE.test(val)) {
  14583. el.style.setProperty(hyphenate(name), val.replace(importantRE, ''), 'important');
  14584. }
  14585. else {
  14586. var normalizedName = normalize(name);
  14587. if (Array.isArray(val)) {
  14588. // Support values array created by autoprefixer, e.g.
  14589. // {display: ["-webkit-box", "-ms-flexbox", "flex"]}
  14590. // Set them one by one, and the browser will only set those it can recognize
  14591. for (var i = 0, len = val.length; i < len; i++) {
  14592. el.style[normalizedName] = val[i];
  14593. }
  14594. }
  14595. else {
  14596. el.style[normalizedName] = val;
  14597. }
  14598. }
  14599. };
  14600. var vendorNames = ['Webkit', 'Moz', 'ms'];
  14601. var emptyStyle;
  14602. var normalize = cached(function (prop) {
  14603. emptyStyle = emptyStyle || document.createElement('div').style;
  14604. prop = camelize(prop);
  14605. if (prop !== 'filter' && prop in emptyStyle) {
  14606. return prop;
  14607. }
  14608. var capName = prop.charAt(0).toUpperCase() + prop.slice(1);
  14609. for (var i = 0; i < vendorNames.length; i++) {
  14610. var name_1 = vendorNames[i] + capName;
  14611. if (name_1 in emptyStyle) {
  14612. return name_1;
  14613. }
  14614. }
  14615. });
  14616. function updateStyle(oldVnode, vnode) {
  14617. var data = vnode.data;
  14618. var oldData = oldVnode.data;
  14619. if (isUndef(data.staticStyle) &&
  14620. isUndef(data.style) &&
  14621. isUndef(oldData.staticStyle) &&
  14622. isUndef(oldData.style)) {
  14623. return;
  14624. }
  14625. var cur, name;
  14626. var el = vnode.elm;
  14627. var oldStaticStyle = oldData.staticStyle;
  14628. var oldStyleBinding = oldData.normalizedStyle || oldData.style || {};
  14629. // if static style exists, stylebinding already merged into it when doing normalizeStyleData
  14630. var oldStyle = oldStaticStyle || oldStyleBinding;
  14631. var style = normalizeStyleBinding(vnode.data.style) || {};
  14632. // store normalized style under a different key for next diff
  14633. // make sure to clone it if it's reactive, since the user likely wants
  14634. // to mutate it.
  14635. vnode.data.normalizedStyle = isDef(style.__ob__) ? extend({}, style) : style;
  14636. var newStyle = getStyle(vnode, true);
  14637. for (name in oldStyle) {
  14638. if (isUndef(newStyle[name])) {
  14639. setProp(el, name, '');
  14640. }
  14641. }
  14642. for (name in newStyle) {
  14643. cur = newStyle[name];
  14644. if (cur !== oldStyle[name]) {
  14645. // ie9 setting to null has no effect, must use empty string
  14646. setProp(el, name, cur == null ? '' : cur);
  14647. }
  14648. }
  14649. }
  14650. var style = {
  14651. create: updateStyle,
  14652. update: updateStyle
  14653. };
  14654. var whitespaceRE = /\s+/;
  14655. /**
  14656. * Add class with compatibility for SVG since classList is not supported on
  14657. * SVG elements in IE
  14658. */
  14659. function addClass(el, cls) {
  14660. /* istanbul ignore if */
  14661. if (!cls || !(cls = cls.trim())) {
  14662. return;
  14663. }
  14664. /* istanbul ignore else */
  14665. if (el.classList) {
  14666. if (cls.indexOf(' ') > -1) {
  14667. cls.split(whitespaceRE).forEach(function (c) { return el.classList.add(c); });
  14668. }
  14669. else {
  14670. el.classList.add(cls);
  14671. }
  14672. }
  14673. else {
  14674. var cur = " ".concat(el.getAttribute('class') || '', " ");
  14675. if (cur.indexOf(' ' + cls + ' ') < 0) {
  14676. el.setAttribute('class', (cur + cls).trim());
  14677. }
  14678. }
  14679. }
  14680. /**
  14681. * Remove class with compatibility for SVG since classList is not supported on
  14682. * SVG elements in IE
  14683. */
  14684. function removeClass(el, cls) {
  14685. /* istanbul ignore if */
  14686. if (!cls || !(cls = cls.trim())) {
  14687. return;
  14688. }
  14689. /* istanbul ignore else */
  14690. if (el.classList) {
  14691. if (cls.indexOf(' ') > -1) {
  14692. cls.split(whitespaceRE).forEach(function (c) { return el.classList.remove(c); });
  14693. }
  14694. else {
  14695. el.classList.remove(cls);
  14696. }
  14697. if (!el.classList.length) {
  14698. el.removeAttribute('class');
  14699. }
  14700. }
  14701. else {
  14702. var cur = " ".concat(el.getAttribute('class') || '', " ");
  14703. var tar = ' ' + cls + ' ';
  14704. while (cur.indexOf(tar) >= 0) {
  14705. cur = cur.replace(tar, ' ');
  14706. }
  14707. cur = cur.trim();
  14708. if (cur) {
  14709. el.setAttribute('class', cur);
  14710. }
  14711. else {
  14712. el.removeAttribute('class');
  14713. }
  14714. }
  14715. }
  14716. function resolveTransition(def) {
  14717. if (!def) {
  14718. return;
  14719. }
  14720. /* istanbul ignore else */
  14721. if (typeof def === 'object') {
  14722. var res = {};
  14723. if (def.css !== false) {
  14724. extend(res, autoCssTransition(def.name || 'v'));
  14725. }
  14726. extend(res, def);
  14727. return res;
  14728. }
  14729. else if (typeof def === 'string') {
  14730. return autoCssTransition(def);
  14731. }
  14732. }
  14733. var autoCssTransition = cached(function (name) {
  14734. return {
  14735. enterClass: "".concat(name, "-enter"),
  14736. enterToClass: "".concat(name, "-enter-to"),
  14737. enterActiveClass: "".concat(name, "-enter-active"),
  14738. leaveClass: "".concat(name, "-leave"),
  14739. leaveToClass: "".concat(name, "-leave-to"),
  14740. leaveActiveClass: "".concat(name, "-leave-active")
  14741. };
  14742. });
  14743. var hasTransition = inBrowser && !isIE9;
  14744. var TRANSITION = 'transition';
  14745. var ANIMATION = 'animation';
  14746. // Transition property/event sniffing
  14747. var transitionProp = 'transition';
  14748. var transitionEndEvent = 'transitionend';
  14749. var animationProp = 'animation';
  14750. var animationEndEvent = 'animationend';
  14751. if (hasTransition) {
  14752. /* istanbul ignore if */
  14753. if (window.ontransitionend === undefined &&
  14754. window.onwebkittransitionend !== undefined) {
  14755. transitionProp = 'WebkitTransition';
  14756. transitionEndEvent = 'webkitTransitionEnd';
  14757. }
  14758. if (window.onanimationend === undefined &&
  14759. window.onwebkitanimationend !== undefined) {
  14760. animationProp = 'WebkitAnimation';
  14761. animationEndEvent = 'webkitAnimationEnd';
  14762. }
  14763. }
  14764. // binding to window is necessary to make hot reload work in IE in strict mode
  14765. var raf = inBrowser
  14766. ? window.requestAnimationFrame
  14767. ? window.requestAnimationFrame.bind(window)
  14768. : setTimeout
  14769. : /* istanbul ignore next */ function (/* istanbul ignore next */ fn) { return fn(); };
  14770. function nextFrame(fn) {
  14771. raf(function () {
  14772. // @ts-expect-error
  14773. raf(fn);
  14774. });
  14775. }
  14776. function addTransitionClass(el, cls) {
  14777. var transitionClasses = el._transitionClasses || (el._transitionClasses = []);
  14778. if (transitionClasses.indexOf(cls) < 0) {
  14779. transitionClasses.push(cls);
  14780. addClass(el, cls);
  14781. }
  14782. }
  14783. function removeTransitionClass(el, cls) {
  14784. if (el._transitionClasses) {
  14785. remove$2(el._transitionClasses, cls);
  14786. }
  14787. removeClass(el, cls);
  14788. }
  14789. function whenTransitionEnds(el, expectedType, cb) {
  14790. var _a = getTransitionInfo(el, expectedType), type = _a.type, timeout = _a.timeout, propCount = _a.propCount;
  14791. if (!type)
  14792. return cb();
  14793. var event = type === TRANSITION ? transitionEndEvent : animationEndEvent;
  14794. var ended = 0;
  14795. var end = function () {
  14796. el.removeEventListener(event, onEnd);
  14797. cb();
  14798. };
  14799. var onEnd = function (e) {
  14800. if (e.target === el) {
  14801. if (++ended >= propCount) {
  14802. end();
  14803. }
  14804. }
  14805. };
  14806. setTimeout(function () {
  14807. if (ended < propCount) {
  14808. end();
  14809. }
  14810. }, timeout + 1);
  14811. el.addEventListener(event, onEnd);
  14812. }
  14813. var transformRE = /\b(transform|all)(,|$)/;
  14814. function getTransitionInfo(el, expectedType) {
  14815. var styles = window.getComputedStyle(el);
  14816. // JSDOM may return undefined for transition properties
  14817. var transitionDelays = (styles[transitionProp + 'Delay'] || '').split(', ');
  14818. var transitionDurations = (styles[transitionProp + 'Duration'] || '').split(', ');
  14819. var transitionTimeout = getTimeout(transitionDelays, transitionDurations);
  14820. var animationDelays = (styles[animationProp + 'Delay'] || '').split(', ');
  14821. var animationDurations = (styles[animationProp + 'Duration'] || '').split(', ');
  14822. var animationTimeout = getTimeout(animationDelays, animationDurations);
  14823. var type;
  14824. var timeout = 0;
  14825. var propCount = 0;
  14826. /* istanbul ignore if */
  14827. if (expectedType === TRANSITION) {
  14828. if (transitionTimeout > 0) {
  14829. type = TRANSITION;
  14830. timeout = transitionTimeout;
  14831. propCount = transitionDurations.length;
  14832. }
  14833. }
  14834. else if (expectedType === ANIMATION) {
  14835. if (animationTimeout > 0) {
  14836. type = ANIMATION;
  14837. timeout = animationTimeout;
  14838. propCount = animationDurations.length;
  14839. }
  14840. }
  14841. else {
  14842. timeout = Math.max(transitionTimeout, animationTimeout);
  14843. type =
  14844. timeout > 0
  14845. ? transitionTimeout > animationTimeout
  14846. ? TRANSITION
  14847. : ANIMATION
  14848. : null;
  14849. propCount = type
  14850. ? type === TRANSITION
  14851. ? transitionDurations.length
  14852. : animationDurations.length
  14853. : 0;
  14854. }
  14855. var hasTransform = type === TRANSITION && transformRE.test(styles[transitionProp + 'Property']);
  14856. return {
  14857. type: type,
  14858. timeout: timeout,
  14859. propCount: propCount,
  14860. hasTransform: hasTransform
  14861. };
  14862. }
  14863. function getTimeout(delays, durations) {
  14864. /* istanbul ignore next */
  14865. while (delays.length < durations.length) {
  14866. delays = delays.concat(delays);
  14867. }
  14868. return Math.max.apply(null, durations.map(function (d, i) {
  14869. return toMs(d) + toMs(delays[i]);
  14870. }));
  14871. }
  14872. // Old versions of Chromium (below 61.0.3163.100) formats floating pointer numbers
  14873. // in a locale-dependent way, using a comma instead of a dot.
  14874. // If comma is not replaced with a dot, the input will be rounded down (i.e. acting
  14875. // as a floor function) causing unexpected behaviors
  14876. function toMs(s) {
  14877. return Number(s.slice(0, -1).replace(',', '.')) * 1000;
  14878. }
  14879. function enter(vnode, toggleDisplay) {
  14880. var el = vnode.elm;
  14881. // call leave callback now
  14882. if (isDef(el._leaveCb)) {
  14883. el._leaveCb.cancelled = true;
  14884. el._leaveCb();
  14885. }
  14886. var data = resolveTransition(vnode.data.transition);
  14887. if (isUndef(data)) {
  14888. return;
  14889. }
  14890. /* istanbul ignore if */
  14891. if (isDef(el._enterCb) || el.nodeType !== 1) {
  14892. return;
  14893. }
  14894. var css = data.css, type = data.type, enterClass = data.enterClass, enterToClass = data.enterToClass, enterActiveClass = data.enterActiveClass, appearClass = data.appearClass, appearToClass = data.appearToClass, appearActiveClass = data.appearActiveClass, beforeEnter = data.beforeEnter, enter = data.enter, afterEnter = data.afterEnter, enterCancelled = data.enterCancelled, beforeAppear = data.beforeAppear, appear = data.appear, afterAppear = data.afterAppear, appearCancelled = data.appearCancelled, duration = data.duration;
  14895. // activeInstance will always be the <transition> component managing this
  14896. // transition. One edge case to check is when the <transition> is placed
  14897. // as the root node of a child component. In that case we need to check
  14898. // <transition>'s parent for appear check.
  14899. var context = activeInstance;
  14900. var transitionNode = activeInstance.$vnode;
  14901. while (transitionNode && transitionNode.parent) {
  14902. context = transitionNode.context;
  14903. transitionNode = transitionNode.parent;
  14904. }
  14905. var isAppear = !context._isMounted || !vnode.isRootInsert;
  14906. if (isAppear && !appear && appear !== '') {
  14907. return;
  14908. }
  14909. var startClass = isAppear && appearClass ? appearClass : enterClass;
  14910. var activeClass = isAppear && appearActiveClass ? appearActiveClass : enterActiveClass;
  14911. var toClass = isAppear && appearToClass ? appearToClass : enterToClass;
  14912. var beforeEnterHook = isAppear ? beforeAppear || beforeEnter : beforeEnter;
  14913. var enterHook = isAppear ? (isFunction(appear) ? appear : enter) : enter;
  14914. var afterEnterHook = isAppear ? afterAppear || afterEnter : afterEnter;
  14915. var enterCancelledHook = isAppear
  14916. ? appearCancelled || enterCancelled
  14917. : enterCancelled;
  14918. var explicitEnterDuration = toNumber(isObject(duration) ? duration.enter : duration);
  14919. var expectsCSS = css !== false && !isIE9;
  14920. var userWantsControl = getHookArgumentsLength(enterHook);
  14921. var cb = (el._enterCb = once(function () {
  14922. if (expectsCSS) {
  14923. removeTransitionClass(el, toClass);
  14924. removeTransitionClass(el, activeClass);
  14925. }
  14926. // @ts-expect-error
  14927. if (cb.cancelled) {
  14928. if (expectsCSS) {
  14929. removeTransitionClass(el, startClass);
  14930. }
  14931. enterCancelledHook && enterCancelledHook(el);
  14932. }
  14933. else {
  14934. afterEnterHook && afterEnterHook(el);
  14935. }
  14936. el._enterCb = null;
  14937. }));
  14938. if (!vnode.data.show) {
  14939. // remove pending leave element on enter by injecting an insert hook
  14940. mergeVNodeHook(vnode, 'insert', function () {
  14941. var parent = el.parentNode;
  14942. var pendingNode = parent && parent._pending && parent._pending[vnode.key];
  14943. if (pendingNode &&
  14944. pendingNode.tag === vnode.tag &&
  14945. pendingNode.elm._leaveCb) {
  14946. pendingNode.elm._leaveCb();
  14947. }
  14948. enterHook && enterHook(el, cb);
  14949. });
  14950. }
  14951. // start enter transition
  14952. beforeEnterHook && beforeEnterHook(el);
  14953. if (expectsCSS) {
  14954. addTransitionClass(el, startClass);
  14955. addTransitionClass(el, activeClass);
  14956. nextFrame(function () {
  14957. removeTransitionClass(el, startClass);
  14958. // @ts-expect-error
  14959. if (!cb.cancelled) {
  14960. addTransitionClass(el, toClass);
  14961. if (!userWantsControl) {
  14962. if (isValidDuration(explicitEnterDuration)) {
  14963. setTimeout(cb, explicitEnterDuration);
  14964. }
  14965. else {
  14966. whenTransitionEnds(el, type, cb);
  14967. }
  14968. }
  14969. }
  14970. });
  14971. }
  14972. if (vnode.data.show) {
  14973. toggleDisplay && toggleDisplay();
  14974. enterHook && enterHook(el, cb);
  14975. }
  14976. if (!expectsCSS && !userWantsControl) {
  14977. cb();
  14978. }
  14979. }
  14980. function leave(vnode, rm) {
  14981. var el = vnode.elm;
  14982. // call enter callback now
  14983. if (isDef(el._enterCb)) {
  14984. el._enterCb.cancelled = true;
  14985. el._enterCb();
  14986. }
  14987. var data = resolveTransition(vnode.data.transition);
  14988. if (isUndef(data) || el.nodeType !== 1) {
  14989. return rm();
  14990. }
  14991. /* istanbul ignore if */
  14992. if (isDef(el._leaveCb)) {
  14993. return;
  14994. }
  14995. var css = data.css, type = data.type, leaveClass = data.leaveClass, leaveToClass = data.leaveToClass, leaveActiveClass = data.leaveActiveClass, beforeLeave = data.beforeLeave, leave = data.leave, afterLeave = data.afterLeave, leaveCancelled = data.leaveCancelled, delayLeave = data.delayLeave, duration = data.duration;
  14996. var expectsCSS = css !== false && !isIE9;
  14997. var userWantsControl = getHookArgumentsLength(leave);
  14998. var explicitLeaveDuration = toNumber(isObject(duration) ? duration.leave : duration);
  14999. var cb = (el._leaveCb = once(function () {
  15000. if (el.parentNode && el.parentNode._pending) {
  15001. el.parentNode._pending[vnode.key] = null;
  15002. }
  15003. if (expectsCSS) {
  15004. removeTransitionClass(el, leaveToClass);
  15005. removeTransitionClass(el, leaveActiveClass);
  15006. }
  15007. // @ts-expect-error
  15008. if (cb.cancelled) {
  15009. if (expectsCSS) {
  15010. removeTransitionClass(el, leaveClass);
  15011. }
  15012. leaveCancelled && leaveCancelled(el);
  15013. }
  15014. else {
  15015. rm();
  15016. afterLeave && afterLeave(el);
  15017. }
  15018. el._leaveCb = null;
  15019. }));
  15020. if (delayLeave) {
  15021. delayLeave(performLeave);
  15022. }
  15023. else {
  15024. performLeave();
  15025. }
  15026. function performLeave() {
  15027. // the delayed leave may have already been cancelled
  15028. // @ts-expect-error
  15029. if (cb.cancelled) {
  15030. return;
  15031. }
  15032. // record leaving element
  15033. if (!vnode.data.show && el.parentNode) {
  15034. (el.parentNode._pending || (el.parentNode._pending = {}))[vnode.key] =
  15035. vnode;
  15036. }
  15037. beforeLeave && beforeLeave(el);
  15038. if (expectsCSS) {
  15039. addTransitionClass(el, leaveClass);
  15040. addTransitionClass(el, leaveActiveClass);
  15041. nextFrame(function () {
  15042. removeTransitionClass(el, leaveClass);
  15043. // @ts-expect-error
  15044. if (!cb.cancelled) {
  15045. addTransitionClass(el, leaveToClass);
  15046. if (!userWantsControl) {
  15047. if (isValidDuration(explicitLeaveDuration)) {
  15048. setTimeout(cb, explicitLeaveDuration);
  15049. }
  15050. else {
  15051. whenTransitionEnds(el, type, cb);
  15052. }
  15053. }
  15054. }
  15055. });
  15056. }
  15057. leave && leave(el, cb);
  15058. if (!expectsCSS && !userWantsControl) {
  15059. cb();
  15060. }
  15061. }
  15062. }
  15063. function isValidDuration(val) {
  15064. return typeof val === 'number' && !isNaN(val);
  15065. }
  15066. /**
  15067. * Normalize a transition hook's argument length. The hook may be:
  15068. * - a merged hook (invoker) with the original in .fns
  15069. * - a wrapped component method (check ._length)
  15070. * - a plain function (.length)
  15071. */
  15072. function getHookArgumentsLength(fn) {
  15073. if (isUndef(fn)) {
  15074. return false;
  15075. }
  15076. // @ts-expect-error
  15077. var invokerFns = fn.fns;
  15078. if (isDef(invokerFns)) {
  15079. // invoker
  15080. return getHookArgumentsLength(Array.isArray(invokerFns) ? invokerFns[0] : invokerFns);
  15081. }
  15082. else {
  15083. // @ts-expect-error
  15084. return (fn._length || fn.length) > 1;
  15085. }
  15086. }
  15087. function _enter(_, vnode) {
  15088. if (vnode.data.show !== true) {
  15089. enter(vnode);
  15090. }
  15091. }
  15092. var transition = inBrowser
  15093. ? {
  15094. create: _enter,
  15095. activate: _enter,
  15096. remove: function (vnode, rm) {
  15097. /* istanbul ignore else */
  15098. if (vnode.data.show !== true) {
  15099. // @ts-expect-error
  15100. leave(vnode, rm);
  15101. }
  15102. else {
  15103. rm();
  15104. }
  15105. }
  15106. }
  15107. : {};
  15108. var platformModules = [attrs, klass, events, domProps, style, transition];
  15109. // the directive module should be applied last, after all
  15110. // built-in modules have been applied.
  15111. var modules = platformModules.concat(baseModules);
  15112. var patch = createPatchFunction({ nodeOps: nodeOps, modules: modules });
  15113. /**
  15114. * Not type checking this file because flow doesn't like attaching
  15115. * properties to Elements.
  15116. */
  15117. /* istanbul ignore if */
  15118. if (isIE9) {
  15119. // http://www.matts411.com/post/internet-explorer-9-oninput/
  15120. document.addEventListener('selectionchange', function () {
  15121. var el = document.activeElement;
  15122. // @ts-expect-error
  15123. if (el && el.vmodel) {
  15124. trigger(el, 'input');
  15125. }
  15126. });
  15127. }
  15128. var directive = {
  15129. inserted: function (el, binding, vnode, oldVnode) {
  15130. if (vnode.tag === 'select') {
  15131. // #6903
  15132. if (oldVnode.elm && !oldVnode.elm._vOptions) {
  15133. mergeVNodeHook(vnode, 'postpatch', function () {
  15134. directive.componentUpdated(el, binding, vnode);
  15135. });
  15136. }
  15137. else {
  15138. setSelected(el, binding, vnode.context);
  15139. }
  15140. el._vOptions = [].map.call(el.options, getValue);
  15141. }
  15142. else if (vnode.tag === 'textarea' || isTextInputType(el.type)) {
  15143. el._vModifiers = binding.modifiers;
  15144. if (!binding.modifiers.lazy) {
  15145. el.addEventListener('compositionstart', onCompositionStart);
  15146. el.addEventListener('compositionend', onCompositionEnd);
  15147. // Safari < 10.2 & UIWebView doesn't fire compositionend when
  15148. // switching focus before confirming composition choice
  15149. // this also fixes the issue where some browsers e.g. iOS Chrome
  15150. // fires "change" instead of "input" on autocomplete.
  15151. el.addEventListener('change', onCompositionEnd);
  15152. /* istanbul ignore if */
  15153. if (isIE9) {
  15154. el.vmodel = true;
  15155. }
  15156. }
  15157. }
  15158. },
  15159. componentUpdated: function (el, binding, vnode) {
  15160. if (vnode.tag === 'select') {
  15161. setSelected(el, binding, vnode.context);
  15162. // in case the options rendered by v-for have changed,
  15163. // it's possible that the value is out-of-sync with the rendered options.
  15164. // detect such cases and filter out values that no longer has a matching
  15165. // option in the DOM.
  15166. var prevOptions_1 = el._vOptions;
  15167. var curOptions_1 = (el._vOptions = [].map.call(el.options, getValue));
  15168. if (curOptions_1.some(function (o, i) { return !looseEqual(o, prevOptions_1[i]); })) {
  15169. // trigger change event if
  15170. // no matching option found for at least one value
  15171. var needReset = el.multiple
  15172. ? binding.value.some(function (v) { return hasNoMatchingOption(v, curOptions_1); })
  15173. : binding.value !== binding.oldValue &&
  15174. hasNoMatchingOption(binding.value, curOptions_1);
  15175. if (needReset) {
  15176. trigger(el, 'change');
  15177. }
  15178. }
  15179. }
  15180. }
  15181. };
  15182. function setSelected(el, binding, vm) {
  15183. actuallySetSelected(el, binding);
  15184. /* istanbul ignore if */
  15185. if (isIE || isEdge) {
  15186. setTimeout(function () {
  15187. actuallySetSelected(el, binding);
  15188. }, 0);
  15189. }
  15190. }
  15191. function actuallySetSelected(el, binding, vm) {
  15192. var value = binding.value;
  15193. var isMultiple = el.multiple;
  15194. if (isMultiple && !Array.isArray(value)) {
  15195. return;
  15196. }
  15197. var selected, option;
  15198. for (var i = 0, l = el.options.length; i < l; i++) {
  15199. option = el.options[i];
  15200. if (isMultiple) {
  15201. selected = looseIndexOf(value, getValue(option)) > -1;
  15202. if (option.selected !== selected) {
  15203. option.selected = selected;
  15204. }
  15205. }
  15206. else {
  15207. if (looseEqual(getValue(option), value)) {
  15208. if (el.selectedIndex !== i) {
  15209. el.selectedIndex = i;
  15210. }
  15211. return;
  15212. }
  15213. }
  15214. }
  15215. if (!isMultiple) {
  15216. el.selectedIndex = -1;
  15217. }
  15218. }
  15219. function hasNoMatchingOption(value, options) {
  15220. return options.every(function (o) { return !looseEqual(o, value); });
  15221. }
  15222. function getValue(option) {
  15223. return '_value' in option ? option._value : option.value;
  15224. }
  15225. function onCompositionStart(e) {
  15226. e.target.composing = true;
  15227. }
  15228. function onCompositionEnd(e) {
  15229. // prevent triggering an input event for no reason
  15230. if (!e.target.composing)
  15231. return;
  15232. e.target.composing = false;
  15233. trigger(e.target, 'input');
  15234. }
  15235. function trigger(el, type) {
  15236. var e = document.createEvent('HTMLEvents');
  15237. e.initEvent(type, true, true);
  15238. el.dispatchEvent(e);
  15239. }
  15240. // recursively search for possible transition defined inside the component root
  15241. function locateNode(vnode) {
  15242. // @ts-expect-error
  15243. return vnode.componentInstance && (!vnode.data || !vnode.data.transition)
  15244. ? locateNode(vnode.componentInstance._vnode)
  15245. : vnode;
  15246. }
  15247. var show = {
  15248. bind: function (el, _a, vnode) {
  15249. var value = _a.value;
  15250. vnode = locateNode(vnode);
  15251. var transition = vnode.data && vnode.data.transition;
  15252. var originalDisplay = (el.__vOriginalDisplay =
  15253. el.style.display === 'none' ? '' : el.style.display);
  15254. if (value && transition) {
  15255. vnode.data.show = true;
  15256. enter(vnode, function () {
  15257. el.style.display = originalDisplay;
  15258. });
  15259. }
  15260. else {
  15261. el.style.display = value ? originalDisplay : 'none';
  15262. }
  15263. },
  15264. update: function (el, _a, vnode) {
  15265. var value = _a.value, oldValue = _a.oldValue;
  15266. /* istanbul ignore if */
  15267. if (!value === !oldValue)
  15268. return;
  15269. vnode = locateNode(vnode);
  15270. var transition = vnode.data && vnode.data.transition;
  15271. if (transition) {
  15272. vnode.data.show = true;
  15273. if (value) {
  15274. enter(vnode, function () {
  15275. el.style.display = el.__vOriginalDisplay;
  15276. });
  15277. }
  15278. else {
  15279. leave(vnode, function () {
  15280. el.style.display = 'none';
  15281. });
  15282. }
  15283. }
  15284. else {
  15285. el.style.display = value ? el.__vOriginalDisplay : 'none';
  15286. }
  15287. },
  15288. unbind: function (el, binding, vnode, oldVnode, isDestroy) {
  15289. if (!isDestroy) {
  15290. el.style.display = el.__vOriginalDisplay;
  15291. }
  15292. }
  15293. };
  15294. var platformDirectives = {
  15295. model: directive,
  15296. show: show
  15297. };
  15298. // Provides transition support for a single element/component.
  15299. var transitionProps = {
  15300. name: String,
  15301. appear: Boolean,
  15302. css: Boolean,
  15303. mode: String,
  15304. type: String,
  15305. enterClass: String,
  15306. leaveClass: String,
  15307. enterToClass: String,
  15308. leaveToClass: String,
  15309. enterActiveClass: String,
  15310. leaveActiveClass: String,
  15311. appearClass: String,
  15312. appearActiveClass: String,
  15313. appearToClass: String,
  15314. duration: [Number, String, Object]
  15315. };
  15316. // in case the child is also an abstract component, e.g. <keep-alive>
  15317. // we want to recursively retrieve the real component to be rendered
  15318. function getRealChild(vnode) {
  15319. var compOptions = vnode && vnode.componentOptions;
  15320. if (compOptions && compOptions.Ctor.options.abstract) {
  15321. return getRealChild(getFirstComponentChild(compOptions.children));
  15322. }
  15323. else {
  15324. return vnode;
  15325. }
  15326. }
  15327. function extractTransitionData(comp) {
  15328. var data = {};
  15329. var options = comp.$options;
  15330. // props
  15331. for (var key in options.propsData) {
  15332. data[key] = comp[key];
  15333. }
  15334. // events.
  15335. // extract listeners and pass them directly to the transition methods
  15336. var listeners = options._parentListeners;
  15337. for (var key in listeners) {
  15338. data[camelize(key)] = listeners[key];
  15339. }
  15340. return data;
  15341. }
  15342. function placeholder(h, rawChild) {
  15343. // @ts-expect-error
  15344. if (/\d-keep-alive$/.test(rawChild.tag)) {
  15345. return h('keep-alive', {
  15346. props: rawChild.componentOptions.propsData
  15347. });
  15348. }
  15349. }
  15350. function hasParentTransition(vnode) {
  15351. while ((vnode = vnode.parent)) {
  15352. if (vnode.data.transition) {
  15353. return true;
  15354. }
  15355. }
  15356. }
  15357. function isSameChild(child, oldChild) {
  15358. return oldChild.key === child.key && oldChild.tag === child.tag;
  15359. }
  15360. var isNotTextNode = function (c) { return c.tag || isAsyncPlaceholder(c); };
  15361. var isVShowDirective = function (d) { return d.name === 'show'; };
  15362. var Transition = {
  15363. name: 'transition',
  15364. props: transitionProps,
  15365. abstract: true,
  15366. render: function (h) {
  15367. var _this = this;
  15368. var children = this.$slots.default;
  15369. if (!children) {
  15370. return;
  15371. }
  15372. // filter out text nodes (possible whitespaces)
  15373. children = children.filter(isNotTextNode);
  15374. /* istanbul ignore if */
  15375. if (!children.length) {
  15376. return;
  15377. }
  15378. var mode = this.mode;
  15379. var rawChild = children[0];
  15380. // if this is a component root node and the component's
  15381. // parent container node also has transition, skip.
  15382. if (hasParentTransition(this.$vnode)) {
  15383. return rawChild;
  15384. }
  15385. // apply transition data to child
  15386. // use getRealChild() to ignore abstract components e.g. keep-alive
  15387. var child = getRealChild(rawChild);
  15388. /* istanbul ignore if */
  15389. if (!child) {
  15390. return rawChild;
  15391. }
  15392. if (this._leaving) {
  15393. return placeholder(h, rawChild);
  15394. }
  15395. // ensure a key that is unique to the vnode type and to this transition
  15396. // component instance. This key will be used to remove pending leaving nodes
  15397. // during entering.
  15398. var id = "__transition-".concat(this._uid, "-");
  15399. child.key =
  15400. child.key == null
  15401. ? child.isComment
  15402. ? id + 'comment'
  15403. : id + child.tag
  15404. : isPrimitive(child.key)
  15405. ? String(child.key).indexOf(id) === 0
  15406. ? child.key
  15407. : id + child.key
  15408. : child.key;
  15409. var data = ((child.data || (child.data = {})).transition =
  15410. extractTransitionData(this));
  15411. var oldRawChild = this._vnode;
  15412. var oldChild = getRealChild(oldRawChild);
  15413. // mark v-show
  15414. // so that the transition module can hand over the control to the directive
  15415. if (child.data.directives && child.data.directives.some(isVShowDirective)) {
  15416. child.data.show = true;
  15417. }
  15418. if (oldChild &&
  15419. oldChild.data &&
  15420. !isSameChild(child, oldChild) &&
  15421. !isAsyncPlaceholder(oldChild) &&
  15422. // #6687 component root is a comment node
  15423. !(oldChild.componentInstance &&
  15424. oldChild.componentInstance._vnode.isComment)) {
  15425. // replace old child transition data with fresh one
  15426. // important for dynamic transitions!
  15427. var oldData = (oldChild.data.transition = extend({}, data));
  15428. // handle transition mode
  15429. if (mode === 'out-in') {
  15430. // return placeholder node and queue update when leave finishes
  15431. this._leaving = true;
  15432. mergeVNodeHook(oldData, 'afterLeave', function () {
  15433. _this._leaving = false;
  15434. _this.$forceUpdate();
  15435. });
  15436. return placeholder(h, rawChild);
  15437. }
  15438. else if (mode === 'in-out') {
  15439. if (isAsyncPlaceholder(child)) {
  15440. return oldRawChild;
  15441. }
  15442. var delayedLeave_1;
  15443. var performLeave = function () {
  15444. delayedLeave_1();
  15445. };
  15446. mergeVNodeHook(data, 'afterEnter', performLeave);
  15447. mergeVNodeHook(data, 'enterCancelled', performLeave);
  15448. mergeVNodeHook(oldData, 'delayLeave', function (leave) {
  15449. delayedLeave_1 = leave;
  15450. });
  15451. }
  15452. }
  15453. return rawChild;
  15454. }
  15455. };
  15456. // Provides transition support for list items.
  15457. var props = extend({
  15458. tag: String,
  15459. moveClass: String
  15460. }, transitionProps);
  15461. delete props.mode;
  15462. var TransitionGroup = {
  15463. props: props,
  15464. beforeMount: function () {
  15465. var _this = this;
  15466. var update = this._update;
  15467. this._update = function (vnode, hydrating) {
  15468. var restoreActiveInstance = setActiveInstance(_this);
  15469. // force removing pass
  15470. _this.__patch__(_this._vnode, _this.kept, false, // hydrating
  15471. true // removeOnly (!important, avoids unnecessary moves)
  15472. );
  15473. _this._vnode = _this.kept;
  15474. restoreActiveInstance();
  15475. update.call(_this, vnode, hydrating);
  15476. };
  15477. },
  15478. render: function (h) {
  15479. var tag = this.tag || this.$vnode.data.tag || 'span';
  15480. var map = Object.create(null);
  15481. var prevChildren = (this.prevChildren = this.children);
  15482. var rawChildren = this.$slots.default || [];
  15483. var children = (this.children = []);
  15484. var transitionData = extractTransitionData(this);
  15485. for (var i = 0; i < rawChildren.length; i++) {
  15486. var c = rawChildren[i];
  15487. if (c.tag) {
  15488. if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {
  15489. children.push(c);
  15490. map[c.key] = c;
  15491. (c.data || (c.data = {})).transition = transitionData;
  15492. }
  15493. }
  15494. }
  15495. if (prevChildren) {
  15496. var kept = [];
  15497. var removed = [];
  15498. for (var i = 0; i < prevChildren.length; i++) {
  15499. var c = prevChildren[i];
  15500. c.data.transition = transitionData;
  15501. // @ts-expect-error .getBoundingClientRect is not typed in Node
  15502. c.data.pos = c.elm.getBoundingClientRect();
  15503. if (map[c.key]) {
  15504. kept.push(c);
  15505. }
  15506. else {
  15507. removed.push(c);
  15508. }
  15509. }
  15510. this.kept = h(tag, null, kept);
  15511. this.removed = removed;
  15512. }
  15513. return h(tag, null, children);
  15514. },
  15515. updated: function () {
  15516. var children = this.prevChildren;
  15517. var moveClass = this.moveClass || (this.name || 'v') + '-move';
  15518. if (!children.length || !this.hasMove(children[0].elm, moveClass)) {
  15519. return;
  15520. }
  15521. // we divide the work into three loops to avoid mixing DOM reads and writes
  15522. // in each iteration - which helps prevent layout thrashing.
  15523. children.forEach(callPendingCbs);
  15524. children.forEach(recordPosition);
  15525. children.forEach(applyTranslation);
  15526. // force reflow to put everything in position
  15527. // assign to this to avoid being removed in tree-shaking
  15528. // $flow-disable-line
  15529. this._reflow = document.body.offsetHeight;
  15530. children.forEach(function (c) {
  15531. if (c.data.moved) {
  15532. var el_1 = c.elm;
  15533. var s = el_1.style;
  15534. addTransitionClass(el_1, moveClass);
  15535. s.transform = s.WebkitTransform = s.transitionDuration = '';
  15536. el_1.addEventListener(transitionEndEvent, (el_1._moveCb = function cb(e) {
  15537. if (e && e.target !== el_1) {
  15538. return;
  15539. }
  15540. if (!e || /transform$/.test(e.propertyName)) {
  15541. el_1.removeEventListener(transitionEndEvent, cb);
  15542. el_1._moveCb = null;
  15543. removeTransitionClass(el_1, moveClass);
  15544. }
  15545. }));
  15546. }
  15547. });
  15548. },
  15549. methods: {
  15550. hasMove: function (el, moveClass) {
  15551. /* istanbul ignore if */
  15552. if (!hasTransition) {
  15553. return false;
  15554. }
  15555. /* istanbul ignore if */
  15556. if (this._hasMove) {
  15557. return this._hasMove;
  15558. }
  15559. // Detect whether an element with the move class applied has
  15560. // CSS transitions. Since the element may be inside an entering
  15561. // transition at this very moment, we make a clone of it and remove
  15562. // all other transition classes applied to ensure only the move class
  15563. // is applied.
  15564. var clone = el.cloneNode();
  15565. if (el._transitionClasses) {
  15566. el._transitionClasses.forEach(function (cls) {
  15567. removeClass(clone, cls);
  15568. });
  15569. }
  15570. addClass(clone, moveClass);
  15571. clone.style.display = 'none';
  15572. this.$el.appendChild(clone);
  15573. var info = getTransitionInfo(clone);
  15574. this.$el.removeChild(clone);
  15575. return (this._hasMove = info.hasTransform);
  15576. }
  15577. }
  15578. };
  15579. function callPendingCbs(c) {
  15580. /* istanbul ignore if */
  15581. if (c.elm._moveCb) {
  15582. c.elm._moveCb();
  15583. }
  15584. /* istanbul ignore if */
  15585. if (c.elm._enterCb) {
  15586. c.elm._enterCb();
  15587. }
  15588. }
  15589. function recordPosition(c) {
  15590. c.data.newPos = c.elm.getBoundingClientRect();
  15591. }
  15592. function applyTranslation(c) {
  15593. var oldPos = c.data.pos;
  15594. var newPos = c.data.newPos;
  15595. var dx = oldPos.left - newPos.left;
  15596. var dy = oldPos.top - newPos.top;
  15597. if (dx || dy) {
  15598. c.data.moved = true;
  15599. var s = c.elm.style;
  15600. s.transform = s.WebkitTransform = "translate(".concat(dx, "px,").concat(dy, "px)");
  15601. s.transitionDuration = '0s';
  15602. }
  15603. }
  15604. var platformComponents = {
  15605. Transition: Transition,
  15606. TransitionGroup: TransitionGroup
  15607. };
  15608. // install platform specific utils
  15609. Vue.config.mustUseProp = mustUseProp;
  15610. Vue.config.isReservedTag = isReservedTag;
  15611. Vue.config.isReservedAttr = isReservedAttr;
  15612. Vue.config.getTagNamespace = getTagNamespace;
  15613. Vue.config.isUnknownElement = isUnknownElement;
  15614. // install platform runtime directives & components
  15615. extend(Vue.options.directives, platformDirectives);
  15616. extend(Vue.options.components, platformComponents);
  15617. // install platform patch function
  15618. Vue.prototype.__patch__ = inBrowser ? patch : noop;
  15619. // public mount method
  15620. Vue.prototype.$mount = function (el, hydrating) {
  15621. el = el && inBrowser ? query(el) : undefined;
  15622. return mountComponent(this, el, hydrating);
  15623. };
  15624. // devtools global hook
  15625. /* istanbul ignore next */
  15626. if (inBrowser) {
  15627. setTimeout(function () {
  15628. if (config.devtools) {
  15629. if (devtools) {
  15630. devtools.emit('init', Vue);
  15631. }
  15632. }
  15633. }, 0);
  15634. }
  15635. function styleInject(css, ref) {
  15636. if ( ref === void 0 ) ref = {};
  15637. var insertAt = ref.insertAt;
  15638. if (!css || typeof document === 'undefined') { return; }
  15639. var head = document.head || document.getElementsByTagName('head')[0];
  15640. var style = document.createElement('style');
  15641. style.type = 'text/css';
  15642. if (insertAt === 'top') {
  15643. if (head.firstChild) {
  15644. head.insertBefore(style, head.firstChild);
  15645. } else {
  15646. head.appendChild(style);
  15647. }
  15648. } else {
  15649. head.appendChild(style);
  15650. }
  15651. if (style.styleSheet) {
  15652. style.styleSheet.cssText = css;
  15653. } else {
  15654. style.appendChild(document.createTextNode(css));
  15655. }
  15656. }
  15657. var css_248z$1 = "\n\n";
  15658. styleInject(css_248z$1);
  15659. var ToolKit = {
  15660. render: function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{"id":"realcontent"}},[_c('div',{staticStyle:{"width":"10px","height":"10px","position":"absolute","left":"0","top":"0","cursor":"nw-resize"},attrs:{"id":"EasySpiderResizer"}}),_vm._v(" "),_c('span',{attrs:{"id":"closeButtonLeft"}},[_vm._v("✖")]),_vm._v(" "),_c('span',{attrs:{"id":"closeButton"}},[_vm._v("✖")]),_vm._v(" "),(_vm.lang == 'zh')?_c('div',[_c('div',{staticClass:"tooldrag"},[_vm._v("✍操作台(点此拖动,左上角调整大小)")]),_vm._v(" "),_c('div',{staticClass:"realcontent"},[(_vm.page==0)?_c('div',[(_vm.list.nl.length==0)?_c('div',{style:({overflow: 'auto', maxHeight: _vm.winHeight * 0.4 + 'px'})},[(_vm.nextPage==1)?_c('p',{staticStyle:{"color":"darkviolet"}},[_vm._v("\n ● 检测到您添加了采集数据操作,如需设置采集后的翻页操作,请点击下方设置翻页操作选项。")]):_vm._e(),_vm._v(" "),(_vm.list.nl.length==0)?_c('div',{staticClass:"innercontent"},[(_vm.nextPage==1)?_c('div',{staticClass:"nextPage"},[_c('a',{on:{"mousedown":_vm.setNextPage}},[_vm._v("设置翻页操作")]),_c('span',{attrs:{"title":"可根据提示指定翻页按钮"}},[_vm._v("☺")])]):_vm._e(),_vm._v(" "),_c('div',[_c('a',{on:{"mousedown":_vm.getCurrentTitle}},[_vm._v("采集当前页面的标题")]),_c('span',{attrs:{"title":"当前页面标题"}},[_vm._v("☺")])]),_vm._v(" "),_c('div',[_c('a',{on:{"mousedown":_vm.getCurrentURL}},[_vm._v("采集当前页面的网址")]),_c('span',{attrs:{"title":"当前页面URL地址"}},[_vm._v("☺")])])]):_vm._e(),_vm._v(" "),_vm._m(0),_vm._v(" "),_vm._m(1),_vm._v(" "),_vm._m(2),_vm._v(" "),_c('p',{staticStyle:{"color":"black","margin-top":"10px"}},[_vm._v("●\n 如果不小心左键点选了元素导致页面跳转,直接后退或者切换回标签页即可。")]),_vm._v(" "),_vm._m(3),_vm._v(" "),_c('p',{staticStyle:{"color":"black","margin-top":"10px"}},[_vm._v("●\n 如果此操作台把页面元素挡住了,可以点击此操作台左下角或右下角的×按钮键关闭操作台。")]),_vm._v("\n "+_vm._s(_vm.initial())+"\n ")]):_vm._e(),_vm._v(" "),(_vm.list.nl.length==1)?_c('div',[(_vm.tname()!='null')?_c('div',[_vm._v("\n ● 已选中"+_vm._s(_vm.numOfList())+"个"+_vm._s(_vm.tname())+","),(_vm.numOfReady()>0&&_vm.tname()!='下一页元素')?_c('span',[_vm._v("同时发现"+_vm._s(_vm.numOfReady())+"个同类元素(如果不全或不准请继续手动选择其余您认为的同类元素),")]):_vm._e(),_vm._v("您可以:\n "),_c('div',{staticClass:"innercontent"},[(_vm.numOfReady()>0 && !_vm.selectStatus)?_c('div',[_c('a',{on:{"mousedown":_vm.selectAll}},[_vm._v("选中全部")]),_vm._v(" "),_c('span',{attrs:{"title":""}})]):_vm._e(),_vm._v(" "),(_vm.existDescendents()&& !_vm.selectStatus &&(_vm.tname()=='元素' || _vm.tname()=='链接'))?_c('div',[_c('a',{on:{"mousedown":_vm.selectDescendents}},[_vm._v("选中子元素")]),_vm._v(" "),_c('span',{attrs:{"title":"应选尽选模式,如想使用其他模式请先选中全部再选中子元素"}},[_vm._v("☺")])]):_vm._e(),_vm._v(" "),(!_vm.selectedDescendents && !_vm.selectStatus)?_c('div',{attrs:{"id":"Single"}},[(_vm.tname()=='选择框')?_c('div',[_c('a',{on:{"mousedown":_vm.changeSelect}},[_vm._v("切换下拉选项")]),_c('span',{attrs:{"title":""}})]):_vm._e(),_vm._v(" "),(_vm.tname()=='文本框')?_c('div',[_c('a',{on:{"mousedown":function($event){return _vm.setInput(false)}}},[_vm._v("输入文字")]),_c('span',{attrs:{"title":""}})]):_vm._e(),_vm._v(" "),(_vm.tname()=='文本框')?_c('div',[_c('a',{on:{"mousedown":function($event){return _vm.setInput(true)}}},[_vm._v("批量输入文字")]),_c('span',{attrs:{"title":""}})]):_vm._e(),_vm._v(" "),(_vm.tname()!='图片')?_c('div',[_c('a',{on:{"mousedown":_vm.getText}},[_vm._v("采集该"+_vm._s(_vm.tname())+"的文本")]),_c('span',{attrs:{"title":"采集文本"}})]):_vm._e(),_vm._v(" "),(_vm.tname()=='选择框')?_c('div',[_c('a',{on:{"mousedown":_vm.getSelectedValue}},[_vm._v("采集当前选中项的值")]),_c('span',{attrs:{"title":""}})]):_vm._e(),_vm._v(" "),(_vm.tname()=='选择框')?_c('div',[_c('a',{on:{"mousedown":_vm.getSelectedText}},[_vm._v("采集当前选中项的文本")]),_c('span',{attrs:{"title":""}})]):_vm._e(),_vm._v(" "),(_vm.tname()=='链接'||_vm.tname()=='图片')?_c('div',[_c('a',{on:{"mousedown":_vm.getLink}},[_vm._v("采集该"+_vm._s(_vm.tname())+"的地址")]),_c('span',{attrs:{"title":""}})]):_vm._e(),_vm._v(" "),_c('div',[_c('a',{on:{"mousedown":_vm.clickElement}},[_vm._v("点击该"+_vm._s(_vm.tname()))]),_c('span',{attrs:{"title":""}})]),_vm._v(" "),(_vm.tname()!='选择框' && _vm.tname()!='文本框')?_c('div',[_c('a',{on:{"mousedown":_vm.loopClickSingleElement}},[_vm._v("循环点击该"+_vm._s(_vm.tname()))]),_c('span',{attrs:{"title":"常用于循环点击下一页场景"}},[_vm._v("☺")])]):_vm._e(),_vm._v(" "),_c('div',[_c('a',{on:{"mousedown":_vm.getBackgroundPic}},[_vm._v("采集该"+_vm._s(_vm.tname())+"的背景图片地址")]),_c('span',{attrs:{"title":"部分元素的图片是设定为背景图像的"}},[_vm._v("☺")])]),_vm._v(" "),(_vm.tname()=='链接'||_vm.tname()=='元素')?_c('div',[_c('a',{on:{"mousedown":_vm.getInnerHtml}},[_vm._v("采集该"+_vm._s(_vm.tname())+"的Inner\n Html")]),_c('span',{attrs:{"title":"不包括元素自身标签的HTML"}},[_vm._v("☺")])]):_vm._e(),_vm._v(" "),_c('div',[_c('a',{on:{"mousedown":_vm.getOuterHtml}},[_vm._v("采集该"+_vm._s(_vm.tname())+"的Outer Html")]),_c('span',{attrs:{"title":"包括元素自身标签的HTML"}},[_vm._v("☺")])]),_vm._v(" "),_c('div',[_c('a',{attrs:{"href":"#"},on:{"mousedown":_vm.mouseMove}},[_vm._v("鼠标移动到该"+_vm._s(_vm.tname())+"上")]),_c('span',{attrs:{"title":""}})])]):_vm._e(),_vm._v(" "),(_vm.selectedDescendents)?_c('div',{attrs:{"id":"Single"}},[_c('div',[_c('a',{on:{"mousedown":_vm.confirmCollectSingle}},[_vm._v("采集数据")]),_c('span',{attrs:{"title":""}})])]):_vm._e(),_vm._v(" "),(_vm.selectStatus)?_c('div',{attrs:{"id":"Confirm"}},[_c('div',[_c('a',{on:{"mousedown":_vm.confirmCollectSingle}},[_vm._v("确认采集")]),_c('span',{attrs:{"title":""}})])]):_vm._e()])]):_vm._e()]):_vm._e(),_vm._v(" "),(_vm.list.nl.length>1)?_c('div',[(_vm.option==100)?_c('div',[_vm._v("\n ● 已选择了以下元素,您可以:\n "),_c('div',{staticClass:"innercontent"},[_c('div',[_c('a',{on:{"mousedown":_vm.confirmCollectMulti}},[_vm._v("采集数据")]),_c('span',{attrs:{"title":""}})]),_vm._v(" "),_c('div',[_c('a',{on:{"mousedown":_vm.revoke}},[_vm._v("撤销本次选择")]),_c('span',{attrs:{"title":""}})])])]):_vm._e(),_vm._v(" "),(_vm.option!=100)?_c('div',[_vm._v("\n ● 已选择了"+_vm._s(_vm.numOfList())+"个同类元素,"),(_vm.numOfReady()>0)?_c('span',[_vm._v("另外发现"+_vm._s(_vm.numOfReady())+"个同类元素(如果不全或不准请继续手动选择其余您认为的同类元素),")]):_vm._e(),_vm._v("您可以:\n "),_c('div',{staticClass:"innercontent"},[(_vm.numOfReady()>0)?_c('div',[_c('a',{on:{"mousedown":_vm.selectAll}},[_vm._v("选中全部")]),_c('span',{attrs:{"title":""}})]):_vm._e(),_vm._v(" "),(_vm.existDescendents()&&(_vm.tname()=='元素' || _vm.tname()=='链接'))?_c('div',[_c('a',{on:{"mousedown":_vm.selectDescendents}},[_vm._v("选中子元素(应选尽选)")]),_c('span',{attrs:{"title":"每个块的每个子元素都选中进来"}},[_vm._v("☺")])]):_vm._e(),_vm._v(" "),(_vm.existDescendents()&&(_vm.tname()=='元素' || _vm.tname()=='链接'))?_c('div',[_c('a',{on:{"mousedown":function($event){return _vm.selectDescendents(1,1)}}},[_vm._v("选中子元素(相对首选块共同元素)")]),_c('span',{attrs:{"title":"只选中和第一个选中块的子元素共同的子元素"}},[_vm._v("☺")])]):_vm._e(),_vm._v(" "),(_vm.existDescendents()&&(_vm.tname()=='元素' || _vm.tname()=='链接'))?_c('div',[_c('a',{on:{"mousedown":function($event){return _vm.selectDescendents(1,2)}}},[_vm._v("选中子元素(所有块共同元素)")]),_c('span',{attrs:{"title":"只选中所有块都有的子元素"}},[_vm._v("☺")])]):_vm._e(),_vm._v(" "),_c('div',[_c('a',{on:{"mousedown":_vm.confirmCollectMultiAndDescendents}},[_vm._v("采集数据")]),_c('span',{attrs:{"title":""}})]),_vm._v(" "),(_vm.tname()!='选择框' && _vm.tname()!='文本框' && !_vm.selectedDescendents)?_c('div',[_c('a',{on:{"mousedown":_vm.loopClickEveryElement}},[_vm._v("循环点击每个"+_vm._s(_vm.tname()))]),_c('span',{attrs:{"title":"常用于循环点击列表中的链接打开详情页采集场景"}},[_vm._v("☺")])]):_vm._e(),_vm._v(" "),(_vm.tname()!='选择框' && _vm.tname()!='文本框' && !_vm.selectedDescendents)?_c('div',[_c('a',{on:{"mousedown":_vm.loopMouseMove}},[_vm._v("循环移动到每个"+_vm._s(_vm.tname()))]),_c('span',{attrs:{"title":""}})]):_vm._e(),_vm._v(" "),_c('div',[_c('a',{on:{"mousedown":_vm.revoke}},[_vm._v("撤销本次选择")]),_c('span',{attrs:{"title":""}})])])]):_vm._e()]):_vm._e(),_vm._v(" "),(_vm.valTable.length>0)?_c('div',[_c('div',{staticClass:"toolkitcontain"},[_c('table',{staticClass:"toolkittb2",attrs:{"cellSpacing":"0"}},[_c('tbody',[_vm._l((_vm.list.opp),function(i,index){return _c('th',[_c('div',[_vm._v(_vm._s(i["name"]))]),_vm._v(" "),_c('span',{attrs:{"index":index,"title":"删除此字段"},on:{"mousedown":_vm.removeField}},[_vm._v("×")])])}),_vm._v(" "),_c('th',{staticStyle:{"width":"40px"}},[_vm._v("删除")])],2)]),_vm._v(" "),_c('table',{staticClass:"toolkittb4",attrs:{"cellSpacing":"0"}},[_c('tbody',_vm._l((_vm.valTable[0].length),function(i){return _c('tr',[_vm._l((_vm.list.opp.length),function(j){return _c('td',[_vm._v(_vm._s(_vm.valTable[j - 1][i - 1]))])}),_vm._v(" "),_c('td',{staticStyle:{"font-size":"22px!important","width":"40px","cursor":"pointer"},attrs:{"index":i-1},on:{"mousedown":_vm.deleteSingleLine}},[_vm._v("×\n ")])],2)}),0)])])]):_vm._e(),_vm._v(" "),(_vm.list.nl.length>0)?_c('div',{staticStyle:{"bottom":"12px","position":"absolute","color":"black!important","left":"17px","font-size":"13px"}},[_c('div',{staticStyle:{"margin-bottom":"5px"}},[_c('button',{on:{"mousedown":_vm.cancel}},[_vm._v("取消选择")]),_vm._v(" "),(!_vm.selectStatus)?_c('button',{on:{"mousedown":_vm.enlarge}},[_vm._v("扩大选区")]):_vm._e()]),_vm._v(" "),_c('p',{staticStyle:{"margin-left":"16px","margin-bottom":"0px"}},[_vm._v(_vm._s(_vm.lastElementXPath()))])]):_vm._e()]):(_vm.page==1)?_c('div',[_vm._v("\n ● 请输入文字:\n "),_c('input',{directives:[{name:"model",rawName:"v-model",value:(_vm.text),expression:"text"}],attrs:{"id":"WTextBox","autoFocus":"autofocus","type":"text"},domProps:{"value":(_vm.text)},on:{"input":function($event){if($event.target.composing){ return; }_vm.text=$event.target.value;}}}),_vm._v(" "),_c('button',{staticStyle:{"margin-left":"0px!important"},on:{"click":_vm.getInput}},[_vm._v("确定")]),_vm._v(" "),_c('button',{staticStyle:{"margin-left":"0px!important"},on:{"click":_vm.cancelInput}},[_vm._v("取消")]),_vm._v(" "),_c('div',{staticStyle:{"text-align":"justify","margin-top":"15px","padding-right":"15px","margin-left":"4px"}},[_vm._v("\n 输入<enter>或<ENTER>表示输入完成后模拟按下回车键,适用于只能通过回车键获得数据的情况。\n ")])]):(_vm.page==2)?_c('div',[_c('span',{staticStyle:{"font-size":"15px"}},[_vm._v(" ● 切换模式 ")]),_vm._v(" "),_c('select',{directives:[{name:"model",rawName:"v-model",value:(_vm.optionMode),expression:"optionMode"}],on:{"change":[function($event){var $$selectedVal = Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = "_value" in o ? o._value : o.value;return val}); _vm.optionMode=$event.target.multiple ? $$selectedVal : $$selectedVal[0];},_vm.handleSelectChange]}},[_c('option',{attrs:{"value":"0"}},[_vm._v("切换到下一个选项")]),_vm._v(" "),_c('option',{attrs:{"value":"1"}},[_vm._v("按索引值切换选项")]),_vm._v(" "),_c('option',{attrs:{"value":"2"}},[_vm._v("按选项值切换选项")]),_vm._v(" "),_c('option',{attrs:{"value":"3"}},[_vm._v("按选项文本切换选项")])]),_vm._v(" "),(_vm.optionMode == 3)?_c('span',{staticStyle:{"font-size":"15px"}},[_vm._v(" ● 选项文本")]):_vm._e(),_vm._v(" "),(_vm.optionMode == 1)?_c('span',{staticStyle:{"font-size":"15px"}},[_vm._v(" ● 索引值")]):_vm._e(),_vm._v(" "),(_vm.optionMode == 2)?_c('span',{staticStyle:{"font-size":"15px"}},[_vm._v(" ● 选项值")]):_vm._e(),_vm._v(" "),(_vm.optionMode != 0)?_c('input',{directives:[{name:"model",rawName:"v-model",value:(_vm.optionValue),expression:"optionValue"}],attrs:{"id":"selectValue","autoFocus":"autofocus","type":"text"},domProps:{"value":(_vm.optionValue)},on:{"input":function($event){if($event.target.composing){ return; }_vm.optionValue=$event.target.value;}}}):_vm._e(),_vm._v(" "),_c('div',[_c('button',{staticStyle:{"margin-left":"0px!important"},on:{"click":_vm.sendChangeSelect}},[_vm._v("确定")]),_vm._v(" "),_c('button',{staticStyle:{"margin-left":"0px!important"},on:{"click":_vm.cancelInput}},[_vm._v("取消")])])]):(_vm.page==3)?_c('div',[_c('span',{staticStyle:{"font-size":"15px"}},[_vm._v(" ● 请在页面上右键选择要点击的下一页按钮/链接,如要取消设置翻页操作,请点击下方取消选项。")]),_vm._v(" "),(_vm.list.nl.length==1)?_c('div',{staticStyle:{"font-size":"15px"}},[_vm._v("\n ● 已选中一个元素:"),_c('span',{staticStyle:{"color":"darkviolet"}},[_vm._v(_vm._s(_vm.getSelectedInnerText()))]),_vm._v(",您可以点击下方选项确认设置翻页操作。\n ")]):(_vm.list.nl.length>1)?_c('div',{staticStyle:{"font-size":"15px","color":"#c82333"}},[_vm._v("\n ● 翻页操作只能设置一个元素,请点击下方取消翻页操作选项并重新选择。\n ")]):_vm._e(),_vm._v(" "),_c('div',{staticClass:"innercontent"},[_c('div',[(_vm.list.nl.length==1)?_c('a',{staticStyle:{"margin-bottom":"5px"},attrs:{"href":"#"},on:{"mousedown":_vm.confirmNextPage}},[_vm._v("确认设置翻页操作")]):_vm._e()]),_vm._v(" "),_c('div',[_c('a',{attrs:{"href":"#"},on:{"mousedown":_vm.cancelNextPage}},[_vm._v("取消设置翻页操作")])])])]):_vm._e()])]):(_vm.lang=='en')?_c('div',[_c('div',{staticClass:"tooldrag"},[_vm._v("✍Toolbox (Can drag, resize at left corner)")]),_vm._v(" "),_c('div',{staticClass:"realcontent"},[(_vm.page==0)?_c('div',[(_vm.list.nl.length==0)?_c('div',{style:({overflow: 'auto', maxHeight: _vm.winHeight * 0.4 + 'px'})},[(_vm.nextPage==1)?_c('p',{staticStyle:{"color":"darkviolet"}},[_vm._v("\n ● A data collection operation has just been detected. If you need to configure pagination after data collection, please click\n the option below to set up pagination.")]):_vm._e(),_vm._v(" "),(_vm.list.nl.length==0)?_c('div',{staticClass:"innercontent"},[(_vm.nextPage==1)?_c('div',{staticClass:"nextPage"},[_c('a',{on:{"mousedown":_vm.setNextPage}},[_vm._v("Set up pagination")]),_c('span',{attrs:{"title":"Follow the prompt to specify the paging button"}},[_vm._v("☺")])]):_vm._e(),_vm._v(" "),_c('div',[_c('a',{on:{"mousedown":_vm.getCurrentTitle}},[_vm._v("Collect Title of current page")]),_c('span',{attrs:{"title":"Title of this page"}},[_vm._v("☺")])]),_vm._v(" "),_c('div',[_c('a',{on:{"mousedown":_vm.getCurrentURL}},[_vm._v("Collect URL of current page")]),_c('span',{attrs:{"title":"URL of this page"}},[_vm._v("☺")])])]):_vm._e(),_vm._v(" "),_vm._m(4),_vm._v(" "),_vm._m(5),_vm._v(" "),_vm._m(6),_vm._v(" "),_c('p',{staticStyle:{"color":"black","margin-top":"10px"}},[_vm._v("● If you accidentally left-click on an element and cause the page\n to jump, simply go back or switch back to the tab.")]),_vm._v(" "),_vm._m(7),_vm._v(" "),_c('p',{staticStyle:{"color":"black","margin-top":"10px"}},[_vm._v("● If this toolbox blocks the page element, you can click the ×\n button in the\n lower left/right corner of this toolbox to close it.")]),_vm._v("\n "+_vm._s(_vm.initial())+"\n ")]):_vm._e(),_vm._v(" "),(_vm.list.nl.length==1)?_c('div',[(_vm.tname()!='null')?_c('div',[_vm._v("\n ● Already selected "+_vm._s(_vm.numOfList())+" "+_vm._s(_vm._f("toEng")(_vm.tname()))+", "),(_vm.numOfReady()>0&&_vm.tname()!='下一页元素')?_c('span',[_vm._v(" meanwhile we find "+_vm._s(_vm.numOfReady())+" element with the same type (If unsatisfied with auto-detected similar elements, you can continue to manually select the rest of the elements that you think are similar), ")]):_vm._e(),_vm._v("you\n can:\n "),_c('div',{staticClass:"innercontent"},[(_vm.numOfReady()>0 && !_vm.selectStatus)?_c('div',[_c('a',{on:{"mousedown":_vm.selectAll}},[_vm._v("Select All")]),_c('span',{attrs:{"title":""}})]):_vm._e(),_vm._v(" "),(_vm.existDescendents()&& !_vm.selectStatus &&(_vm.tname()=='元素' || _vm.tname()=='链接'))?_c('div',[_c('a',{on:{"mousedown":_vm.selectDescendents}},[_vm._v("Select child elements")]),_vm._v(" "),_c('span',{attrs:{"title":"Greedy Mode, if you want to use other modes, please select 'Select All' option first"}},[_vm._v("☺")])]):_vm._e(),_vm._v(" "),(!_vm.selectedDescendents && !_vm.selectStatus)?_c('div',{attrs:{"id":"Single"}},[(_vm.tname()=='选择框')?_c('div',[_c('a',{on:{"mousedown":_vm.changeSelect}},[_vm._v("Change selection option")]),_c('span',{attrs:{"title":""}})]):_vm._e(),_vm._v(" "),(_vm.tname()=='文本框')?_c('div',[_c('a',{on:{"mousedown":function($event){return _vm.setInput(false)}}},[_vm._v("Input Text")]),_c('span',{attrs:{"title":""}})]):_vm._e(),_vm._v(" "),(_vm.tname()=='文本框')?_c('div',[_c('a',{on:{"mousedown":function($event){return _vm.setInput(true)}}},[_vm._v("Input Text (Batch)")]),_c('span',{attrs:{"title":""}})]):_vm._e(),_vm._v(" "),(_vm.tname()!='图片')?_c('div',[_c('a',{on:{"mousedown":_vm.getText}},[_vm._v("Extract "+_vm._s(_vm._f("toEng")(_vm.tname()))+"'s\n text")]),_c('span',{attrs:{"title":"collect text"}})]):_vm._e(),_vm._v(" "),(_vm.tname()=='选择框')?_c('div',[_c('a',{on:{"mousedown":_vm.getSelectedValue}},[_vm._v("Collect selected option\n value")]),_c('span',{attrs:{"title":""}})]):_vm._e(),_vm._v(" "),(_vm.tname()=='选择框')?_c('div',[_c('a',{on:{"mousedown":_vm.getSelectedText}},[_vm._v("Collect selected option\n text")]),_c('span',{attrs:{"title":""}})]):_vm._e(),_vm._v(" "),(_vm.tname()=='链接'||_vm.tname()=='图片')?_c('div',[_c('a',{on:{"mousedown":_vm.getLink}},[_vm._v("Collect address of this\n "+_vm._s(_vm._f("toEng")(_vm.tname())))]),_c('span',{attrs:{"title":""}})]):_vm._e(),_vm._v(" "),_c('div',[_c('a',{on:{"mousedown":_vm.clickElement}},[_vm._v("Click\n this "+_vm._s(_vm._f("toEng")(_vm.tname())))]),_c('span',{attrs:{"title":""}})]),_vm._v(" "),(_vm.tname()!='选择框' && _vm.tname()!='文本框')?_c('div',[_c('a',{on:{"mousedown":_vm.loopClickSingleElement}},[_vm._v("Loop-click this "+_vm._s(_vm._f("toEng")(_vm.tname())))]),_c('span',{attrs:{"title":"Usually used to loop-click the next-page button"}},[_vm._v("☺")])]):_vm._e(),_vm._v(" "),_c('div',[_c('a',{on:{"mousedown":_vm.getBackgroundPic}},[_vm._v("Collect background image URL")]),_c('span',{attrs:{"title":"Some elements have background images"}},[_vm._v("☺")])]),_vm._v(" "),(_vm.tname()=='链接'||_vm.tname()=='元素')?_c('div',[_c('a',{on:{"mousedown":_vm.getInnerHtml}},[_vm._v("Collect Inner Html of\n this "+_vm._s(_vm._f("toEng")(_vm.tname())))]),_c('span',{attrs:{"title":"HTML not including the tag of this selected element"}},[_vm._v("☺")])]):_vm._e(),_vm._v(" "),_c('div',[_c('a',{on:{"mousedown":_vm.getOuterHtml}},[_vm._v("Collect Outer Html of this element")]),_c('span',{attrs:{"title":"HTML including the tag of this selected element"}},[_vm._v("☺")])]),_vm._v(" "),_c('div',[_c('a',{attrs:{"href":"#"},on:{"mousedown":_vm.mouseMove}},[_vm._v("Move mouse to this element")]),_c('span',{attrs:{"title":""}})])]):_vm._e(),_vm._v(" "),(_vm.selectedDescendents)?_c('div',{attrs:{"id":"Single"}},[_c('div',[_c('a',{on:{"mousedown":_vm.confirmCollectSingle}},[_vm._v("Collect Data")]),_c('span',{attrs:{"title":""}})])]):_vm._e(),_vm._v(" "),(_vm.selectStatus)?_c('div',{attrs:{"id":"Confirm"}},[_c('div',[_c('a',{on:{"mousedown":_vm.confirmCollectSingle}},[_vm._v("Confirm Collect")]),_c('span',{attrs:{"title":""}})])]):_vm._e()])]):_vm._e()]):_vm._e(),_vm._v(" "),(_vm.list.nl.length>1)?_c('div',[(_vm.option==100)?_c('div',[_vm._v("\n ● Already selected the following element, you can:\n "),_c('div',{staticClass:"innercontent"},[_c('div',[_c('a',{on:{"mousedown":_vm.confirmCollectMulti}},[_vm._v("Collect Data")]),_c('span',{attrs:{"title":""}})]),_vm._v(" "),_c('div',[_c('a',{on:{"mousedown":_vm.revoke}},[_vm._v("Revoke selection")]),_c('span',{attrs:{"title":""}})])])]):_vm._e(),_vm._v(" "),(_vm.option!=100)?_c('div',[_vm._v("\n ● Already selected "+_vm._s(_vm.numOfList())+" similar elements, "),(_vm.numOfReady()>0)?_c('span',[_vm._v("and we find other"+_vm._s(_vm.numOfReady())+" similar elements (If unsatisfied with auto-detected similar elements, you can continue to manually select the rest of the elements that you think are similar), ")]):_vm._e(),_vm._v("you\n can:\n "),_c('div',{staticClass:"innercontent"},[(_vm.numOfReady()>0)?_c('div',[_c('a',{on:{"mousedown":_vm.selectAll}},[_vm._v("Select All")]),_c('span',{attrs:{"title":""}})]):_vm._e(),_vm._v(" "),(_vm.existDescendents()&&(_vm.tname()=='元素' || _vm.tname()=='链接'))?_c('div',[_c('a',{on:{"mousedown":_vm.selectDescendents}},[_vm._v("Select child elements (Greedy)")]),_c('span',{attrs:{"title":"Select All child elements for all blocks"}},[_vm._v("☺")])]):_vm._e(),_vm._v(" "),(_vm.existDescendents()&&(_vm.tname()=='元素' || _vm.tname()=='链接'))?_c('div',[_c('a',{on:{"mousedown":function($event){return _vm.selectDescendents(1,1)}}},[_vm._v("Select child elements (RFSE)")]),_c('span',{attrs:{"title":"Relative to First Selected Element, will only select the common child elements between the first selected block and the rest of the blocks"}},[_vm._v("☺")])]):_vm._e(),_vm._v(" "),(_vm.existDescendents()&&(_vm.tname()=='元素' || _vm.tname()=='链接'))?_c('div',[_c('a',{on:{"mousedown":function($event){return _vm.selectDescendents(1,2)}}},[_vm._v("Select child elements (RASE)")]),_c('span',{attrs:{"title":"Relative to All Selected Elements, will select only the common child elements that exist in all blocks"}},[_vm._v("☺")])]):_vm._e(),_vm._v(" "),_c('div',[_c('a',{on:{"mousedown":_vm.confirmCollectMultiAndDescendents}},[_vm._v("Collect Data")]),_c('span',{attrs:{"title":""}})]),_vm._v(" "),(_vm.tname()!='选择框' && _vm.tname()!='文本框' && !_vm.selectedDescendents)?_c('div',[_c('a',{on:{"mousedown":_vm.loopClickEveryElement}},[_vm._v("Loop-click every "+_vm._s(_vm._f("toEng")(_vm.tname())))]),_c('span',{attrs:{"title":"Usually used to click every link in a list to open detail page to collect data"}},[_vm._v("☺")])]):_vm._e(),_vm._v(" "),(_vm.tname()!='选择框' && _vm.tname()!='文本框' && !_vm.selectedDescendents)?_c('div',[_c('a',{on:{"mousedown":_vm.loopMouseMove}},[_vm._v("Loop-mouse-move to every "+_vm._s(_vm._f("toEng")(_vm.tname())))]),_c('span',{attrs:{"title":""}})]):_vm._e(),_vm._v(" "),_c('div',[_c('a',{on:{"mousedown":_vm.revoke}},[_vm._v("Revoke selection")]),_c('span',{attrs:{"title":""}})])])]):_vm._e()]):_vm._e(),_vm._v(" "),(_vm.valTable.length>0)?_c('div',[_c('div',{staticClass:"toolkitcontain"},[_c('table',{staticClass:"toolkittb2",attrs:{"cellspacing":"0"}},[_c('tbody',[_vm._l((_vm.list.opp),function(i,index){return _c('th',[_c('div',[_vm._v(_vm._s(i["name"]))]),_vm._v(" "),_c('span',{attrs:{"index":index,"title":"Remove this field"},on:{"mousedown":_vm.removeField}},[_vm._v("×")])])}),_vm._v(" "),_c('th',{staticStyle:{"width":"40px"}},[_vm._v("Delete")])],2)]),_vm._v(" "),_c('table',{staticClass:"toolkittb4",attrs:{"cellspacing":"0"}},[_c('tbody',_vm._l((_vm.valTable[0].length),function(i){return _c('tr',[_vm._l((_vm.list.opp.length),function(j){return _c('td',[_vm._v(_vm._s(_vm.valTable[j - 1][i - 1]))])}),_vm._v(" "),_c('td',{staticStyle:{"font-size":"22px!important","width":"40px","cursor":"pointer"},attrs:{"index":i-1},on:{"mousedown":_vm.deleteSingleLine}},[_vm._v("×\n ")])],2)}),0)])])]):_vm._e(),_vm._v(" "),(_vm.valTable.length==0&&_vm.tname()!='下一页元素')?_c('div'):_vm._e(),_vm._v(" "),(_vm.list.nl.length>0)?_c('div',{staticStyle:{"bottom":"12px","position":"absolute","color":"black!important","left":"17px","font-size":"13px"}},[_c('div',{staticStyle:{"margin-bottom":"5px"}},[_c('button',{on:{"mousedown":_vm.cancel}},[_vm._v("Deselect")]),_vm._v(" "),(!_vm.selectStatus)?_c('button',{on:{"mousedown":_vm.enlarge}},[_vm._v("Expand Path")]):_vm._e()]),_vm._v(" "),_c('p',{staticStyle:{"margin-left":"16px","margin-bottom":"0px"}},[_vm._v(_vm._s(_vm.lastElementXPath()))])]):_vm._e()]):(_vm.page==1)?_c('div',[_vm._v("\n ● Please input text:\n "),_c('input',{directives:[{name:"model",rawName:"v-model",value:(_vm.text),expression:"text"}],attrs:{"id":"WTextBox","autofocus":"autofocus","type":"text"},domProps:{"value":(_vm.text)},on:{"input":function($event){if($event.target.composing){ return; }_vm.text=$event.target.value;}}}),_vm._v(" "),_c('button',{staticStyle:{"margin-left":"0px!important"},on:{"click":_vm.getInput}},[_vm._v("Confirm")]),_vm._v(" "),_c('button',{staticStyle:{"margin-left":"0px!important"},on:{"click":_vm.cancelInput}},[_vm._v("Cancel")]),_vm._v(" "),_c('div',{staticStyle:{"text-align":"justify","margin-top":"15px","padding-right":"15px","margin-left":"4px"}},[_vm._v("\n Inputting <enter> or <ENTER> represents the simulation of pressing the Enter key after input\n is complete, which is applicable in situations where data can only be obtained through pressing the Enter\n key.\n ")])]):(_vm.page==2)?_c('div',[_c('span',{staticStyle:{"font-size":"15px"}},[_vm._v(" ● Change Mode ")]),_vm._v(" "),_c('select',{directives:[{name:"model",rawName:"v-model",value:(_vm.optionMode),expression:"optionMode"}],on:{"change":[function($event){var $$selectedVal = Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = "_value" in o ? o._value : o.value;return val}); _vm.optionMode=$event.target.multiple ? $$selectedVal : $$selectedVal[0];},_vm.handleSelectChange]}},[_c('option',{attrs:{"value":"0"}},[_vm._v("Change to next option")]),_vm._v(" "),_c('option',{attrs:{"value":"1"}},[_vm._v("Change option by index")]),_vm._v(" "),_c('option',{attrs:{"value":"2"}},[_vm._v("Change option by value")]),_vm._v(" "),_c('option',{attrs:{"value":"3"}},[_vm._v("Change option by text")])]),_vm._v(" "),(_vm.optionMode == 3)?_c('span',{staticStyle:{"font-size":"15px"}},[_vm._v(" ● Option Text")]):_vm._e(),_vm._v(" "),(_vm.optionMode == 1)?_c('span',{staticStyle:{"font-size":"15px"}},[_vm._v(" ● Option Index")]):_vm._e(),_vm._v(" "),(_vm.optionMode == 2)?_c('span',{staticStyle:{"font-size":"15px"}},[_vm._v(" ● Option Value")]):_vm._e(),_vm._v(" "),(_vm.optionMode != 0)?_c('input',{directives:[{name:"model",rawName:"v-model",value:(_vm.optionValue),expression:"optionValue"}],attrs:{"id":"selectValue","autoFocus":"autofocus","type":"text"},domProps:{"value":(_vm.optionValue)},on:{"input":function($event){if($event.target.composing){ return; }_vm.optionValue=$event.target.value;}}}):_vm._e(),_vm._v(" "),_c('div',[_c('button',{staticStyle:{"margin-left":"0px!important"},on:{"click":_vm.sendChangeSelect}},[_vm._v("Confirm")]),_vm._v(" "),_c('button',{staticStyle:{"margin-left":"0px!important"},on:{"click":_vm.cancelInput}},[_vm._v("Cancel")])])]):(_vm.page==3)?_c('div',[_c('span',{staticStyle:{"font-size":"15px"}},[_vm._v(" ● Please right-click on the page and select the next page button/link. To cancel the pagination setup, click the option below.")]),_vm._v(" "),(_vm.list.nl.length==1)?_c('div',{staticStyle:{"font-size":"15px"}},[_vm._v("\n ● A single element has been selected: "),_c('span',{staticStyle:{"color":"darkviolet"}},[_vm._v(_vm._s(_vm.getSelectedInnerText()))]),_vm._v(", you can click the option below to confirm the pagination setup.\n ")]):(_vm.list.nl.length>1)?_c('div',{staticStyle:{"font-size":"15px","color":"#c82333"}},[_vm._v("\n ● The page-turning operation can only be set for one element. Please click the option below to cancel the\n page-turning operation and reselect.\n ")]):_vm._e(),_vm._v(" "),_c('div',{staticClass:"innercontent"},[_c('div',[(_vm.list.nl.length==1)?_c('a',{staticStyle:{"margin-bottom":"5px"},attrs:{"href":"#"},on:{"mousedown":_vm.confirmNextPage}},[_vm._v("Confirm\n Pagination Setup")]):_vm._e()]),_vm._v(" "),_c('div',[_c('a',{attrs:{"href":"#"},on:{"mousedown":_vm.cancelNextPage}},[_vm._v("Cancel Pagination Setup")])])])]):_vm._e()])]):_vm._e()])},
  15661. staticRenderFns: [function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('p',{staticStyle:{"color":"black","margin-top":"10px"}},[_vm._v("● 鼠标移动到笑脸"),_c('span',{staticStyle:{"font-size":"20px"}},[_vm._v("☺")]),_vm._v("查看操作提示。")])},function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('p',{staticStyle:{"color":"black","margin-top":"10px"}},[_vm._v("●\n 鼠标移动到元素上后,请"),_c('strong',[_vm._v("右键")]),_vm._v("点击或者按"),_c('strong',[_vm._v("F2")]),_vm._v("键选中页面元素。\n ")])},function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('p',{staticStyle:{"color":"black","margin-top":"10px"}},[_vm._v("●\n 通过鼠标左键进行点击时,页面也会有反应,但左键点击发生的操作不会被记录在任务流程中;同理,如果想输入文本框但并不想将动作记录,可以鼠标移动到文本框,并按键盘的"),_c('strong',[_vm._v("F9")]),_vm._v("进行输入。\n ")])},function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('p',{staticStyle:{"color":"black","margin-top":"10px"}},[_vm._v("● 操作完成后,如点击”确认采集“后任务流程图内没有”提取数据“操作被添加,"),_c('strong',[_vm._v("重试一次")]),_vm._v("即可。\n ")])},function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('p',{staticStyle:{"color":"black","margin-top":"10px"}},[_vm._v("● Mouse move to smiling face "),_c('span',{staticStyle:{"font-size":"20px"}},[_vm._v("☺")]),_vm._v(" to see operation help.")])},function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('p',{staticStyle:{"color":"black","margin-top":"10px"}},[_vm._v("● When your mouse moves to the element, please\n "),_c('strong',[_vm._v("right-click")]),_vm._v(" your\n mouse button or press "),_c('strong',[_vm._v("F2")]),_vm._v(" on the keyboard to select it.")])},function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('p',{staticStyle:{"color":"black","margin-top":"10px"}},[_vm._v("● When clicked with the left mouse button, the page will also\n respond, but this click operation will not be recorded in the task flow. Similarly, if you want to input\n in a text box but do not want the action to be recorded , you can move the mouse to the text box and\n press\n "),_c('strong',[_vm._v("F9")]),_vm._v(" on the keyboard to input.")])},function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('p',{staticStyle:{"color":"black","margin-top":"10px"}},[_vm._v("● After the operation is completed, such as if no \"Collect Data\"\n operation is added in the task flowchart after clicking \"Confirm Collect\", just "),_c('strong',[_vm._v(" retry ")]),_vm._v("\n again.")])}],
  15662. el: '#realcontent',
  15663. data: {
  15664. lang: global$1.lang,
  15665. batch: false, //是否为批量输入模式
  15666. option: 0,
  15667. list: {nl: global$1.nodeList, opp: global$1.outputParameters},
  15668. valTable: [], // 用来存储转换后的参数列表
  15669. special: false, //是否为特殊选择模式
  15670. selectedDescendents: false, // 标记是否选中了子元素
  15671. selectStatus: false, //标记单个元素是否点击了采集
  15672. page: 0, //默认页面,1为输入文字页面
  15673. text: "", // 记录输入的文字
  15674. tNodeName: "", // 记录临时节点列表
  15675. nowPath: "", //现在元素的xpath
  15676. nowAllPaths: [], //现在元素的所有xpath
  15677. winHeight: window.outerHeight,
  15678. optionMode: 0,
  15679. optionValue: "",
  15680. mode: 0, //记录删除字段模式
  15681. nextPage: 0, //是否设置翻页操作
  15682. lastAction: "collectData", //记录上一次的操作
  15683. global: global$1,
  15684. },
  15685. mounted() {
  15686. this.$nextTick(() => {
  15687. window.addEventListener('resize', this.onResize);
  15688. });
  15689. if (isInIframe()) {
  15690. global$1.iframe = true;
  15691. }
  15692. // 获取页面上所有的iframe
  15693. let iframes = document.getElementsByTagName('iframe');
  15694. // 循环遍历所有的iframe
  15695. for (let i = 0; i < iframes.length; i++) {
  15696. let iframe = iframes[i];
  15697. // 获取iframe的当前高度
  15698. let currentHeight = iframe.offsetHeight;
  15699. console.log("IFRAME: ", getElementXPaths(iframe), readXPath(iframe));
  15700. console.log("IFrame Height: ", currentHeight, "px");
  15701. // 如果当前高度小于600px,那么将其设置为600px
  15702. if (currentHeight < 600) {
  15703. iframe.style.height = '600px!important';
  15704. iframe.height = '600';
  15705. }
  15706. let currentWidth = iframe.offsetWidth;
  15707. console.log("IFrame Width: ", currentWidth, "px");
  15708. // 如果当前高度小于600px,那么将其设置为600px
  15709. if (currentWidth < 600) {
  15710. iframe.style.width = '600px!important';
  15711. iframe.width = '600';
  15712. }
  15713. }
  15714. },
  15715. beforeDestroy() {
  15716. window.removeEventListener('resize', this.onResize);
  15717. },
  15718. watch: {
  15719. nowPath: { //变量发生变化的时候进行一些操作
  15720. handler: function (newVal, oldVal) {
  15721. console.log("xpath:", newVal);
  15722. }
  15723. }
  15724. },
  15725. filters: {
  15726. toEng: function (value) {
  15727. if (value == "下一页元素") {
  15728. return "elements in next page";
  15729. } else if (value == "链接") {
  15730. return "link";
  15731. } else if (value == "图片") {
  15732. return "image";
  15733. } else if (value == "按钮") {
  15734. return "button";
  15735. } else if (value == "文本框") {
  15736. return "text box";
  15737. } else if (value == "选择框") {
  15738. return "selection box";
  15739. } else {
  15740. return "element";
  15741. }
  15742. }
  15743. },
  15744. methods: {
  15745. onResize() {
  15746. this.winHeight = window.outerHeight;
  15747. },
  15748. initial: function () { //每当元素是0的时候,执行值的初始化操作
  15749. this.selectedDescendents = false;
  15750. this.selectStatus = false;
  15751. this.nowPath = "";
  15752. console.log("initialized");
  15753. },
  15754. confirmCollectSingle: function () { //单元素确认采集
  15755. collectSingle();
  15756. clearEl();
  15757. this.nextPage = 1;
  15758. this.lastAction = "collectData";
  15759. },
  15760. confirmCollectMulti: function () { //无规律多元素确认采集
  15761. collectMultiNoPattern();
  15762. clearEl();
  15763. this.nextPage = 1;
  15764. this.lastAction = "collectData";
  15765. },
  15766. confirmCollectMultiAndDescendents: function () { //有规律多元素确认采集
  15767. collectMultiWithPattern();
  15768. clearEl();
  15769. this.nextPage = 1;
  15770. this.lastAction = "collectDataWithLoop";
  15771. },
  15772. setNextPage: function () { //设置下一页元素
  15773. this.page = 3;
  15774. },
  15775. confirmNextPage: function () { //确认下一页元素
  15776. this.loopClickSingleElement("nextPageFromIndexPage");
  15777. },
  15778. cancelNextPage: function () { //取消下一页元素
  15779. this.cancel();
  15780. this.nextPage = 1; //保留下一页元素设置
  15781. },
  15782. deleteSingleLine: function (event) { //删除单行元素
  15783. let at = new Date().getTime();
  15784. //流程图送元素的时候,默认的使用不固定循环列表,但是一旦有删除元素的操作发生,则按照固定元素列表采集元素
  15785. let index = event.target.getAttribute("index");
  15786. let tnode = global$1.nodeList.splice(index, 1)[0]; //删掉当前元素
  15787. tnode["node"].style.backgroundColor = tnode["bgColor"];
  15788. tnode["node"].style.boxShadow = tnode["boxShadow"];
  15789. if (global$1.nodeList.length > 1) { // 如果删到没有就没有其他的操作了
  15790. handleElement();
  15791. if (this.selectedDescendents) {
  15792. handleDescendents(this.mode); //如果之前有选中子元素,新加入的节点又则这里也需要重新选择子元素
  15793. }
  15794. } else {
  15795. this.valTable = [];
  15796. this.selectStatus = false;
  15797. clearParameters(); //直接撤销重选
  15798. }
  15799. let at2 = parseInt(new Date().getTime());
  15800. console.log("delete:", at2, at, at2 - at);
  15801. },
  15802. removeField: function (event) {
  15803. let index = event.target.getAttribute("index");
  15804. let tParameter = global$1.outputParameters.splice(index, 1)[0];
  15805. if (global$1.outputParameters.length == 0) {
  15806. this.valTable = [];
  15807. clearEl();
  15808. } else { //删除对应的列
  15809. console.log("remove:", tParameter, global$1);
  15810. this.valTable.splice(index, 1);
  15811. for (let i = global$1.outputParameterNodes.length - 1; i >= 0; i--) {
  15812. let node = global$1.outputParameterNodes[i];
  15813. if (node["unique_index"] == tParameter["unique_index"]) {
  15814. node["node"].style.backgroundColor = "";
  15815. node["node"].style.boxShadow = "";
  15816. global$1.outputParameterNodes.splice(i, 1);
  15817. }
  15818. }
  15819. }
  15820. },
  15821. clickElement: async function () { //点击元素操作
  15822. sendSingleClick();
  15823. //先发送数据
  15824. global$1.nodeList[0]["node"].focus(); //获得元素焦点
  15825. await new Promise(resolve => setTimeout(resolve, 500)); //因为nodejs点击后又会把当前元素加入到列表中,所以这里需要等待一下再清空
  15826. // global.nodeList[0]["node"].click(); //点击元素
  15827. clearEl();
  15828. this.nextPage = 0;
  15829. this.lastAction = "clickElement";
  15830. },
  15831. changeSelect: function () {
  15832. this.page = 2;
  15833. this.optionMode = 0;
  15834. this.optionValue = global$1.nodeList[0]["node"].options[global$1.nodeList[0]["node"].selectedIndex + 1].text;
  15835. },
  15836. sendChangeSelect: function () {
  15837. sendChangeOption(this.optionMode, this.optionValue);
  15838. //先发送数据
  15839. try {
  15840. if (this.optionMode == 0) {
  15841. global$1.nodeList[0]["node"].options[global$1.nodeList[0]["node"].selectedIndex + 1].selected = true;
  15842. } else if (this.optionMode == 1) {
  15843. global$1.nodeList[0]["node"].selectedIndex = this.optionValue;
  15844. } else if (this.optionMode == 2) {
  15845. global$1.nodeList[0]["node"].value = this.optionValue;
  15846. } else if (this.optionMode == 3) {
  15847. global$1.nodeList[0]["node"].options[global$1.nodeList[0]["node"].selectedIndex].selected = true;
  15848. for (let i = 0; i < global$1.nodeList[0]["node"].options.length; i++) {
  15849. const option = global$1.nodeList[0]["node"].options[i];
  15850. if (option.text === this.optionValue) {
  15851. global$1.nodeList[0]["node"].value = option.value; // 将目标选项的值设置为<select>元素的值
  15852. break; // 找到目标选项后跳出循环
  15853. }
  15854. }
  15855. }
  15856. } catch (e) {
  15857. if (this.lang == "zh") {
  15858. alert("切换失败,实际执行时可能失败,请注意。");
  15859. } else {
  15860. alert("Switch failed, may fail when actually executed, please note.");
  15861. }
  15862. }
  15863. clearEl();
  15864. this.nextPage = 0;
  15865. this.lastAction = "changeSelect";
  15866. },
  15867. handleSelectChange: function () {
  15868. console.log(this.optionMode, this.optionValue);
  15869. if (this.optionMode == 0) {
  15870. this.optionValue = global$1.nodeList[0]["node"].options[global$1.nodeList[0]["node"].selectedIndex + 1].text;
  15871. } else if (this.optionMode == 1) {
  15872. this.optionValue = global$1.nodeList[0]["node"].selectedIndex;
  15873. } else if (this.optionMode == 2) {
  15874. this.optionValue = global$1.nodeList[0]["node"].value;
  15875. } else if (this.optionMode == 3) {
  15876. this.optionValue = global$1.nodeList[0]["node"].options[global$1.nodeList[0]["node"].selectedIndex].text;
  15877. }
  15878. },
  15879. mouseMove: function () {
  15880. sendMouseMove();
  15881. clearEl();
  15882. this.nextPage = 0;
  15883. this.lastAction = "mouseMove";
  15884. },
  15885. loopMouseMove: function () {
  15886. sendLoopMouseMove();
  15887. clearEl();
  15888. this.nextPage = 0;
  15889. this.lastAction = "loopMouseMove";
  15890. },
  15891. loopClickSingleElement: async function (type = "") { //循环点击单个元素
  15892. let name = this.tname();
  15893. if (type == "nextPageFromIndexPage") {
  15894. name = "nextPageFromIndexPage";
  15895. }
  15896. sendLoopClickSingle(name); //识别下一页,循环点击单个元素和点击多个元素
  15897. // if (this.tname() != "下一页元素") { //下一页元素不进行点击操作
  15898. global$1.nodeList[0]["node"].focus(); //获得元素焦点
  15899. await new Promise(resolve => setTimeout(resolve, 500)); //因为nodejs点击后又会把当前元素加入到列表中,所以这里需要等待一下再清空
  15900. // global.nodeList[0]["node"].click(); //点击元素
  15901. // }
  15902. clearEl();
  15903. this.nextPage = 0;
  15904. this.lastAction = "clickElementWithLoop";
  15905. },
  15906. loopClickEveryElement: async function () { //循环点击每个元素
  15907. sendLoopClickEvery(); //识别下一页,循环点击单个元素和点击多个元素
  15908. global$1.nodeList[0]["node"].focus(); //获得元素焦点
  15909. await new Promise(resolve => setTimeout(resolve, 500)); //因为nodejs点击后又会把当前元素加入到列表中,所以这里需要等待一下再清空
  15910. // global.nodeList[0]["node"].click(); //点击元素
  15911. clearEl();
  15912. this.nextPage = 0;
  15913. this.lastAction = "clickEveryElementWithLoop";
  15914. },
  15915. setInput: function (batch = false) { //输入文字
  15916. this.batch = batch;
  15917. this.page = 1;
  15918. this.$nextTick(function () { //下一时刻获得焦点
  15919. document.getElementById("WTextBox").focus();
  15920. });
  15921. },
  15922. getInput: function () { //得到输入的文字
  15923. global$1.nodeList[0]["node"].focus(); //获得文字焦点
  15924. // if (getOS() == "Mac") {
  15925. // global.nodeList[0]["node"].setAttribute("value", this.text); // 设置输入 box内容
  15926. // } else{
  15927. // global.nodeList[0]["node"].setAttribute("value", ""); // 先设置为空,再设置输入 box内容
  15928. // }
  15929. input(this.text, this.batch); // 设置输入
  15930. this.text = "";
  15931. clearEl();
  15932. },
  15933. cancelInput: function () {
  15934. this.page = 0;
  15935. },
  15936. setWidth: function (width) { //根据是否出现表格调整最外框宽度
  15937. jquery(".tooltips").css("width", width);
  15938. return "";
  15939. },
  15940. getCurrentURL: function () { //获取当前页面的URL
  15941. addEl(); // 添加当前选择元素,只是为了占位
  15942. generateParameters(5, true, false);
  15943. this.selectStatus = true;
  15944. clearReady();
  15945. },
  15946. getCurrentTitle: function () {
  15947. //获取当前页面的Title
  15948. // 获取文档中所有元素
  15949. // const elements = document.querySelectorAll('*');
  15950. // global.nodeList.push(elements[0]); //将页面第一个元素放入列表中
  15951. addEl(); // 添加当前选择元素,只是为了占位
  15952. generateParameters(6, true, false);
  15953. this.selectStatus = true;
  15954. clearReady();
  15955. },
  15956. getText: function () { //采集文字
  15957. generateParameters(0, true, false);
  15958. this.selectStatus = true;
  15959. clearReady();
  15960. },
  15961. getSelectedValue: function () { //采集选中文字
  15962. generateParameters(10, true, false);
  15963. this.selectStatus = true;
  15964. clearReady();
  15965. },
  15966. getSelectedInnerText: function () { //提示文字
  15967. let l = 10;
  15968. return global$1.nodeList[0]["node"].innerText.trim().length > l ? global$1.nodeList[0]["node"].innerText.trim().substring(0, l) + "..." : global$1.nodeList[0]["node"].innerText.trim();
  15969. },
  15970. getSelectedText: function () { //采集选中文字
  15971. generateParameters(11, true, false);
  15972. this.selectStatus = true;
  15973. clearReady();
  15974. },
  15975. getLink: function () { //采集链接地址
  15976. generateParameters(0, false, true);
  15977. this.selectStatus = true;
  15978. clearReady();
  15979. },
  15980. getOuterHtml: function () { //采集OuterHtml
  15981. generateParameters(3, true, false);
  15982. this.selectStatus = true;
  15983. clearReady();
  15984. },
  15985. getInnerHtml: function () { //采集InnerHtml
  15986. generateParameters(2, true, false);
  15987. this.selectStatus = true;
  15988. clearReady();
  15989. },
  15990. getBackgroundPic: function () { //采集背景图片
  15991. generateParameters(4, true, false);
  15992. this.selectStatus = true;
  15993. clearReady();
  15994. },
  15995. tname: function () {
  15996. let tag = global$1.nodeList.length == 0 ? "" : global$1.nodeList[0]["node"].tagName;
  15997. let inputType = global$1.nodeList.length == 0 ? "" : global$1.nodeList[0]["node"].getAttribute("type");
  15998. if (inputType != null) { //如果没有type属性,则默认为text
  15999. inputType = inputType.toLowerCase();
  16000. } else {
  16001. inputType = "text";
  16002. }
  16003. if (tag == "") {
  16004. return "null";
  16005. } else if (jquery(global$1.nodeList[0]["node"]).contents().filter(function () {
  16006. return this.nodeType === 3;
  16007. }).text().indexOf("下一页") >= 0) {
  16008. // this.setWidth("280px");
  16009. return "下一页元素";
  16010. } else if (tag == "A") {
  16011. return "链接";
  16012. } else if (tag == "IMG") {
  16013. return "图片";
  16014. } else if (tag == "BUTTON" || (tag == "INPUT" && (inputType == "button" || inputType == "submit"))) {
  16015. return "按钮";
  16016. } else if (tag == "TEXTAREA" || (tag == "INPUT" && (inputType != "checkbox" || inputType != "ratio"))) { //普通输入框
  16017. return "文本框";
  16018. } else if (tag == "SELECT") {
  16019. return "选择框";
  16020. } else {
  16021. return "元素";
  16022. }
  16023. },
  16024. existDescendents: function () { //检测选中的元素是否存在子元素,已经选中了子元素也不要再出现了
  16025. return global$1.nodeList.length > 0 && global$1.nodeList[0]["node"].children.length > 0 && !this.selectedDescendents;
  16026. },
  16027. numOfReady: function () {
  16028. return global$1.readyList.length;
  16029. },
  16030. numOfList: function () {
  16031. return global$1.nodeList.length;
  16032. },
  16033. lastElementXPath: function () { //用来显示元素的最大最后5个xpath路劲元素
  16034. let path = global$1.nodeList[global$1.nodeList.length - 1]["xpath"];
  16035. path = path.split("/");
  16036. let tp = "";
  16037. if (path.length > 5) { //只保留最后五个元素
  16038. path = path.splice(path.length - 5, 5);
  16039. tp = ".../";
  16040. }
  16041. for (let i = 0; i < path.length; i++) {
  16042. path[i] = path[i].split("[")[0];
  16043. }
  16044. path = path.join("/");
  16045. path = "Path: " + tp + path;
  16046. return path;
  16047. },
  16048. cancel: function () {
  16049. clearEl();
  16050. },
  16051. specialSelect: function () { //特殊选择模式
  16052. // if (mousemovebind) {
  16053. // global.tdiv.style.pointerEvents = "none";
  16054. // this.special = false;
  16055. // } else {
  16056. // this.special = true;
  16057. // }
  16058. // mousemovebind = !mousemovebind;
  16059. },
  16060. enlarge: function () { // 扩大选区功能,总是扩大最后一个选中的元素的选区
  16061. if (global$1.nodeList[global$1.nodeList.length - 1]["node"].tagName != "BODY") {
  16062. global$1.nodeList[global$1.nodeList.length - 1]["node"].style.backgroundColor = global$1.nodeList[global$1.nodeList.length - 1]["bgColor"]; //之前元素恢复原来的背景颜色
  16063. global$1.nodeList[global$1.nodeList.length - 1]["node"].style.boxShadow = global$1.nodeList[global$1.nodeList.length - 1]["boxShadow"]; //之前元素恢复原来的背景颜色
  16064. let tNode = global$1.nodeList[global$1.nodeList.length - 1]["node"].parentNode; //向上走一层
  16065. let sty;
  16066. if (tNode != global$1.NowNode) { //扩大选区之后背景颜色的判断,当前正好选中的颜色应该是不同的
  16067. sty = tNode.style.backgroundColor;
  16068. } else {
  16069. sty = global$1.style;
  16070. }
  16071. global$1.nodeList[global$1.nodeList.length - 1]["node"] = tNode;
  16072. global$1.nodeList[global$1.nodeList.length - 1]["bgColor"] = sty;
  16073. global$1.nodeList[global$1.nodeList.length - 1]["xpath"] = readXPath(tNode, 1);
  16074. global$1.nodeList[global$1.nodeList.length - 1]["allXPaths"] = getElementXPaths(tNode);
  16075. //显示框
  16076. var pos = tNode.getBoundingClientRect();
  16077. global$1.div.style.display = "block";
  16078. global$1.div.style.height = tNode.offsetHeight + "px";
  16079. global$1.div.style.width = tNode.offsetWidth + "px";
  16080. global$1.div.style.left = pos.left + "px";
  16081. global$1.div.style.top = pos.top + "px";
  16082. global$1.div.style.zIndex = 2147483645;
  16083. global$1.div.style.pointerEvents = "none";
  16084. handleElement(); //每次数组元素有变动,都需要重新处理下
  16085. global$1.oe = tNode;
  16086. tNode.style.backgroundColor = "rgba(0,191,255,0.5)";
  16087. this.selectedDescendents = false;
  16088. }
  16089. },
  16090. selectAll: function () { //选中全部元素
  16091. selectAllElements(this);
  16092. },
  16093. revoke: function () { //撤销选择当前节点
  16094. let tstep = global$1.step;
  16095. global$1.step--; //步数-1
  16096. console.log(global$1.step, global$1.nodeList);
  16097. while (tstep == global$1.nodeList[global$1.nodeList.length - 1]["step"]) //删掉所有当前步数的元素节点
  16098. {
  16099. let node = global$1.nodeList.splice(global$1.nodeList.length - 1, 1)[0]; //删除数组最后一项
  16100. node["node"].style.backgroundColor = node["bgColor"]; //还原原始属性和边框
  16101. node["node"].style.boxShadow = node["boxShadow"];
  16102. if (global$1.NowNode == node["node"]) {
  16103. global$1.style = node["bgColor"];
  16104. }
  16105. //处理已经有选中子元素的情况
  16106. // if (this.selectedDescendents) {
  16107. clearParameters(); //直接撤销重选
  16108. // }
  16109. }
  16110. handleElement(); //每次数组元素有变动,都需要重新处理下
  16111. },
  16112. selectDescendents: function (e, mode = 0) { //选择所有子元素操作
  16113. handleDescendents(mode);
  16114. this.mode = mode;
  16115. }
  16116. },
  16117. };
  16118. var css_248z = "\n#wrapperToolkitIframe{\n position: absolute;\n top:0;\n}\n.toolcannotdrag{\n background-color: navy;\n width: 100%;\n text-align: center;\n font-size: 13px;\n height: 26px !important;\n padding-top: 8px !important;\n color: white;\n}\n";
  16119. styleInject(css_248z);
  16120. ({
  16121. render: function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{"id":"realcontent"}},[(_vm.lang == 'zh')?_c('div',[_c('div',{staticClass:"toolcannotdrag"},[_vm._v("提示 "),_c('a',{staticStyle:{"cursor":"pointer","text-decoration":"underline","color":"white"},on:{"click":_vm.close}},[_vm._v("关闭此提示")])]),_vm._v(" "),_c('div',{staticClass:"realcontent"},[_c('p',{staticStyle:{"font-size":"15px"}},[_vm._v("检测到此页面在iframe中,如想提取此页面数据,请重新设计任务,将网页URL改为下面显示的此iframe的URL地址:")]),_vm._v(" "),_c('textarea',{staticStyle:{"font-size":"15px","width":"100%"}},[_vm._v(_vm._s(_vm.url))])])]):(_vm.lang=='en')?_c('div',[_c('div',{staticClass:"toolcannotdrag"},[_vm._v("Hint "),_c('a',{staticStyle:{"cursor":"pointer","text-decoration":"underline","color":"white"},attrs:{"href":"#"},on:{"click":_vm.close}},[_vm._v("Close this hint")])]),_vm._v(" "),_c('div',{staticClass:"realcontent"},[_c('p',{staticStyle:{"font-size":"15px"}},[_vm._v("Detected that this page is in an iframe. If you want to extract data from this page, please redesign the task and change the URL of the webpage to the URL address of this iframe displayed below:")]),_vm._v(" "),_c('textarea',{staticStyle:{"font-size":"15px","width":"100%"}},[_vm._v(_vm._s(_vm.url))])])]):_vm._e()])},
  16122. staticRenderFns: [],
  16123. el: '#realcontent',
  16124. data: {
  16125. url: window.location.href,
  16126. lang: global$1.lang,
  16127. },
  16128. methods: {
  16129. close() {
  16130. document.getElementById('wrapperToolkitIframe').style.display = 'none';
  16131. }
  16132. },
  16133. });
  16134. //表现逻辑层的处理
  16135. if (window.location.href.indexOf("backEndAddressServiceWrapper") >= 0) {
  16136. chrome.storage.local.set({ "parameterNum": 1 }); //重置参数索引值
  16137. throw "serviceGrid"; //如果是服务器网页页面,则不执行工具
  16138. }
  16139. //创造div作为选中元素后的样式存在
  16140. global$1.div = document.createElement('div');
  16141. global$1.div.style.zIndex = "-2147483647";
  16142. global$1.div.setAttribute("id", "wrapperDiv");
  16143. global$1.div.style.position = "fixed";
  16144. global$1.div.style.boxSizing = "border-box";
  16145. global$1.div.style.border = "dotted";
  16146. global$1.tdiv = document.createElement('div');
  16147. global$1.tdiv.style.zIndex = "2147483647";
  16148. global$1.tdiv.style.position = "fixed";
  16149. global$1.tdiv.setAttribute("id", "wrapperTdiv");
  16150. // @ts-ignore
  16151. global$1.tdiv.classList = "tdiv";
  16152. global$1.tdiv.style.top = "0px";
  16153. global$1.tdiv.style.width = "3000px";
  16154. global$1.tdiv.style.height = "3000px";
  16155. global$1.tdiv.style.pointerEvents = "none";
  16156. let toolkit = document.createElement("div");
  16157. toolkit.classList = "tooltips"; //添加样式
  16158. // @ts-ignore
  16159. // if(isInIframe()){
  16160. // toolkit.setAttribute("id", "wrapperToolkitIframe");
  16161. // } else {
  16162. toolkit.setAttribute("id", "wrapperToolkit");
  16163. // }
  16164. let tooltips = false; //标记鼠标是否在提示框上
  16165. //右键菜单屏蔽
  16166. document.oncontextmenu = () => false;
  16167. document.addEventListener("mousemove", function() {
  16168. //如果鼠标在元素框内则点击和选中失效
  16169. let x = event.clientX;
  16170. let y = event.clientY;
  16171. let divx1 = toolkit.offsetLeft;
  16172. let divy1 = toolkit.offsetTop;
  16173. let divx2 = toolkit.offsetLeft + toolkit.offsetWidth;
  16174. let divy2 = toolkit.offsetTop + toolkit.offsetHeight;
  16175. if (x >= divx1 && x <= divx2 && y >= divy1 && y <= divy2) {
  16176. tooltips = true;
  16177. return;
  16178. }
  16179. //如果鼠标在ID为notification_of_easyspider内则点击和选中失效
  16180. try {
  16181. let notification_of_easyspider = document.getElementsByClassName("notification_of_easyspider")[0];
  16182. let x = event.clientX;
  16183. let y = event.clientY;
  16184. let divx1 = notification_of_easyspider.offsetLeft;
  16185. let divy1 = notification_of_easyspider.offsetTop;
  16186. let divx2 = notification_of_easyspider.offsetLeft + notification_of_easyspider.offsetWidth;
  16187. let divy2 = notification_of_easyspider.offsetTop + notification_of_easyspider.offsetHeight;
  16188. if (y >= divy1 - 100 && y <= divy2 + 100) {
  16189. tooltips = true;
  16190. // console.log("notification_of_easyspider");
  16191. return;
  16192. }
  16193. } catch (e) {
  16194. }
  16195. global$1.oe = document.elementFromPoint(event.x, event.y);
  16196. if (global$1.oe == global$1.tdiv) {
  16197. return;
  16198. }
  16199. tooltips = false;
  16200. global$1.NowNode = global$1.oe;
  16201. let exist = 0;
  16202. let exist2 = 0;
  16203. for (let o of global$1.nodeList) {
  16204. if (o["node"] == global$1.oe) {
  16205. exist = 1;
  16206. break;
  16207. }
  16208. }
  16209. for (let o of global$1.nodeList) {
  16210. if (o["node"] == global$1.xnode) {
  16211. exist2 = 1;
  16212. break;
  16213. }
  16214. }
  16215. // console.log(oe);
  16216. if (global$1.xnode == null) {
  16217. global$1.xnode = global$1.oe;
  16218. }
  16219. if (global$1.xnode != global$1.oe) {
  16220. if (exist2 == 0) { //如果上个元素不在数组里,改回上个元素的初始颜色
  16221. try {
  16222. global$1.xnode.style.backgroundColor = global$1.style; //上个元素改回原来元素的背景颜色
  16223. } catch {
  16224. global$1.xnode.style.backgroundColor = ""; //上个元素改回原来元素的背景颜色
  16225. }
  16226. }
  16227. try {
  16228. global$1.xnode = global$1.oe.style.backgroundColor;
  16229. } catch {
  16230. global$1.xnode = "";
  16231. }
  16232. if (exist == 1) ; else {
  16233. try {
  16234. global$1.oe.style.backgroundColor = global$1.defaultbgColor; //设置新元素的背景元素
  16235. } catch {
  16236. }
  16237. }
  16238. global$1.xnode = global$1.oe;
  16239. global$1.div.style.display = "none";
  16240. }
  16241. });
  16242. // window.addEventListener("beforeunload", function(event) {
  16243. // event.preventDefault();
  16244. // let message = {
  16245. // type: 10,
  16246. // message: {
  16247. // id: global.id, //socket id
  16248. // }
  16249. // };
  16250. // global.ws.send(JSON.stringify(message));
  16251. // // Remove the confirmation message
  16252. // event.returnValue = '';
  16253. // });
  16254. window.addEventListener('DOMContentLoaded', () => {
  16255. // Remove any existing beforeunload events
  16256. window.onbeforeunload = null;
  16257. // Override the beforeunload event with a custom function
  16258. window.addEventListener('beforeunload', (event) => {
  16259. // Prevent the event's default action
  16260. event.preventDefault();
  16261. // Remove the confirmation message
  16262. event.returnValue = '';
  16263. });
  16264. });
  16265. //点击没反应时候的替代方案
  16266. document.onkeydown = function(event) {
  16267. // console.log("keydown");
  16268. var e = event || window.event || arguments.callee.caller.arguments[0];
  16269. if (e && e.keyCode == 113) { // 按 F2
  16270. addEl();
  16271. } else if (e && e.keyCode == 119) { //按F8
  16272. clearEl();
  16273. } else if (e && e.keyCode == 120) { //按F9
  16274. global$1.NowNode.focus();
  16275. global$1.NowNode.click();
  16276. // console.log("click",global.NowNode);
  16277. } else {
  16278. return event.keyCode;
  16279. }
  16280. };
  16281. document.addEventListener("mousedown", addEl);
  16282. toolkit.addEventListener("mousedown", function(e) { e.stopPropagation(); }); //重新定义toolkit里的点击事件
  16283. document.body.append(global$1.div); //默认如果toolkit不存在则div和tdiv也不存在
  16284. document.body.append(global$1.tdiv);
  16285. document.body.append(toolkit);
  16286. //生成Toolkit
  16287. function generateToolkit() {
  16288. jquery(".tooltips").html(`
  16289. <div id="realcontent"></div>
  16290. `);
  16291. // if(isInIframe()){
  16292. // global.app = new Vue(iframe);
  16293. // } else{
  16294. global$1.app = new Vue(ToolKit);
  16295. // }
  16296. let h = jquery(".tooldrag").height();
  16297. let difference = 26 - h; //获得高度值差
  16298. if (difference > 0) {
  16299. jquery(".tooldrag").css("cssText", "height:" + (26 + difference) + "px!important");
  16300. }
  16301. //实现提示框拖拽功能
  16302. jquery('.tooldrag').mousedown(function(e) {
  16303. // e.pageX
  16304. var positionDiv = jquery(this).offset();
  16305. var distanceX = e.pageX - positionDiv.left;
  16306. var distanceY = e.pageY - positionDiv.top;
  16307. //alert(distanceX)
  16308. // alert(positionDiv.left);
  16309. jquery(document).mousemove(function(e) {
  16310. var x = e.clientX - distanceX;
  16311. var y = e.clientY - distanceY;
  16312. if (x < 0) {
  16313. x = 0;
  16314. } else if (x > window.innerWidth - jquery('.tooldrag').outerWidth(true)) {
  16315. x = window.innerWidth - jquery('.tooldrag').outerWidth(true);
  16316. }
  16317. if (y < 0) {
  16318. y = 0;
  16319. } else if (y > window.innerHeight - jquery('.tooldrag').outerHeight(true)) {
  16320. y = window.innerHeight - jquery('.tooldrag').outerHeight(true);
  16321. }
  16322. jquery('.tooltips').css({
  16323. 'right': window.innerWidth - x - jquery('.tooltips').outerWidth(true) + 'px',
  16324. 'bottom': window.innerHeight - y - jquery('.tooltips').outerHeight(true) + 'px',
  16325. });
  16326. });
  16327. jquery(document).mouseup(function() {
  16328. jquery(document).off('mousemove');
  16329. });
  16330. });
  16331. // 拖拽右下角改变大小
  16332. const wrapperToolkit = document.getElementById('wrapperToolkit');
  16333. const EasySpiderResizer = document.getElementById('EasySpiderResizer');
  16334. let mousedown = false;
  16335. let startX, startY, startWidth, startHeight;
  16336. EasySpiderResizer.addEventListener('mousedown', e => {
  16337. mousedown = true;
  16338. startX = e.clientX;
  16339. startY = e.clientY;
  16340. startWidth = wrapperToolkit.offsetWidth;
  16341. startHeight = wrapperToolkit.offsetHeight;
  16342. e.preventDefault();
  16343. });
  16344. window.addEventListener('mousemove', e => {
  16345. // if the mouse is not pressed, do nothing
  16346. if (!mousedown) return;
  16347. let newX = e.clientX;
  16348. let newY = e.clientY;
  16349. // Update the width: Original width - (current mouse X position - original mouse X position)
  16350. let newWidth = startWidth - (newX - startX);
  16351. // Update the height: Original height - (current mouse Y position - original mouse Y position)
  16352. let newHeight = startHeight - (newY - startY);
  16353. // Set the new width, height and left, top of the wrapperToolkit
  16354. // wrapperToolkit.style.left = `${newX}px`;
  16355. // wrapperToolkit.style.top = `${newY}px`;
  16356. if (newWidth > 300 && newWidth < 1200) {
  16357. wrapperToolkit.style.width = `${newWidth}px`;
  16358. // set the new width of the wrapperToolkit
  16359. }
  16360. if (newHeight > 420 && newHeight < 800) {
  16361. wrapperToolkit.style.height = `${newHeight}px`;
  16362. // console.log(newHeight)
  16363. try{
  16364. let toolkitcontain = document.getElementsByClassName('toolkitcontain')[0];
  16365. toolkitcontain.style.height = `${newHeight-330}px`;
  16366. } catch(e){
  16367. }
  16368. // set the new width of the wrapperToolkit
  16369. }
  16370. });
  16371. window.addEventListener('mouseup', e => {
  16372. // when the mouse is released, stop resizing
  16373. mousedown = false;
  16374. });
  16375. setInterval(function() { //时刻监测相应元素是否存在(防止出现如百度一样元素消失重写body的情况),如果不存在,添加进来
  16376. if (document.body != null && document.getElementsByClassName("tooltips").length == 0) {
  16377. this.clearInterval(); //先取消原来的计时器,再设置新的计时器
  16378. document.body.append(global$1.div); //默认如果toolkit不存在则div和tdiv也不存在
  16379. document.body.append(global$1.tdiv);
  16380. document.body.append(toolkit);
  16381. generateToolkit();
  16382. }
  16383. }, 3000);
  16384. }
  16385. //Vue元素
  16386. generateToolkit();
  16387. function closeToolkit() {
  16388. toolkit.style.display = "none"; // 隐藏元素
  16389. createNotification(LANG("EasySpider操作控制台已隐藏,可点击浏览器右上角扩展程序区域的EasySpider图标重新显示。", "EasySpider Toolkit is hidden. Click the EasySpider icon in the extension list (upper right corner) of the browser to reopen."));
  16390. }
  16391. let closeButton = document.getElementById("closeButton");
  16392. closeButton.addEventListener("click", function() {
  16393. closeToolkit();
  16394. });
  16395. let closeButtonLeft = document.getElementById("closeButtonLeft");
  16396. closeButtonLeft.addEventListener("click", function() {
  16397. closeToolkit();
  16398. });