bundle.js 1.4 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194
  1. /******/ (function(modules) { // webpackBootstrap
  2. /******/ // The module cache
  3. /******/ var installedModules = {};
  4. /******/ // The require function
  5. /******/ function __webpack_require__(moduleId) {
  6. /******/ // Check if module is in cache
  7. /******/ if(installedModules[moduleId])
  8. /******/ return installedModules[moduleId].exports;
  9. /******/ // Create a new module (and put it into the cache)
  10. /******/ var module = installedModules[moduleId] = {
  11. /******/ i: moduleId,
  12. /******/ l: false,
  13. /******/ exports: {}
  14. /******/ };
  15. /******/ // Execute the module function
  16. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  17. /******/ // Flag the module as loaded
  18. /******/ module.l = true;
  19. /******/ // Return the exports of the module
  20. /******/ return module.exports;
  21. /******/ }
  22. /******/ // expose the modules object (__webpack_modules__)
  23. /******/ __webpack_require__.m = modules;
  24. /******/ // expose the module cache
  25. /******/ __webpack_require__.c = installedModules;
  26. /******/ // identity function for calling harmony imports with the correct context
  27. /******/ __webpack_require__.i = function(value) { return value; };
  28. /******/ // define getter function for harmony exports
  29. /******/ __webpack_require__.d = function(exports, name, getter) {
  30. /******/ if(!__webpack_require__.o(exports, name)) {
  31. /******/ Object.defineProperty(exports, name, {
  32. /******/ configurable: false,
  33. /******/ enumerable: true,
  34. /******/ get: getter
  35. /******/ });
  36. /******/ }
  37. /******/ };
  38. /******/ // getDefaultExport function for compatibility with non-harmony modules
  39. /******/ __webpack_require__.n = function(module) {
  40. /******/ var getter = module && module.__esModule ?
  41. /******/ function getDefault() { return module['default']; } :
  42. /******/ function getModuleExports() { return module; };
  43. /******/ __webpack_require__.d(getter, 'a', getter);
  44. /******/ return getter;
  45. /******/ };
  46. /******/ // Object.prototype.hasOwnProperty.call
  47. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  48. /******/ // __webpack_public_path__
  49. /******/ __webpack_require__.p = "";
  50. /******/ // Load entry module and return exports
  51. /******/ return __webpack_require__(__webpack_require__.s = 192);
  52. /******/ })
  53. /************************************************************************/
  54. /******/ ([
  55. /* 0 */
  56. /***/ (function(module, exports, __webpack_require__) {
  57. /* WEBPACK VAR INJECTION */(function(module) {//! moment.js
  58. //! version : 2.17.1
  59. //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
  60. //! license : MIT
  61. //! momentjs.com
  62. ;(function (global, factory) {
  63. true ? module.exports = factory() :
  64. typeof define === 'function' && define.amd ? define(factory) :
  65. global.moment = factory()
  66. }(this, (function () { 'use strict';
  67. var hookCallback;
  68. function hooks () {
  69. return hookCallback.apply(null, arguments);
  70. }
  71. // This is done to register the method called with moment()
  72. // without creating circular dependencies.
  73. function setHookCallback (callback) {
  74. hookCallback = callback;
  75. }
  76. function isArray(input) {
  77. return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]';
  78. }
  79. function isObject(input) {
  80. // IE8 will treat undefined and null as object if it wasn't for
  81. // input != null
  82. return input != null && Object.prototype.toString.call(input) === '[object Object]';
  83. }
  84. function isObjectEmpty(obj) {
  85. var k;
  86. for (k in obj) {
  87. // even if its not own property I'd still call it non-empty
  88. return false;
  89. }
  90. return true;
  91. }
  92. function isNumber(input) {
  93. return typeof input === 'number' || Object.prototype.toString.call(input) === '[object Number]';
  94. }
  95. function isDate(input) {
  96. return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]';
  97. }
  98. function map(arr, fn) {
  99. var res = [], i;
  100. for (i = 0; i < arr.length; ++i) {
  101. res.push(fn(arr[i], i));
  102. }
  103. return res;
  104. }
  105. function hasOwnProp(a, b) {
  106. return Object.prototype.hasOwnProperty.call(a, b);
  107. }
  108. function extend(a, b) {
  109. for (var i in b) {
  110. if (hasOwnProp(b, i)) {
  111. a[i] = b[i];
  112. }
  113. }
  114. if (hasOwnProp(b, 'toString')) {
  115. a.toString = b.toString;
  116. }
  117. if (hasOwnProp(b, 'valueOf')) {
  118. a.valueOf = b.valueOf;
  119. }
  120. return a;
  121. }
  122. function createUTC (input, format, locale, strict) {
  123. return createLocalOrUTC(input, format, locale, strict, true).utc();
  124. }
  125. function defaultParsingFlags() {
  126. // We need to deep clone this object.
  127. return {
  128. empty : false,
  129. unusedTokens : [],
  130. unusedInput : [],
  131. overflow : -2,
  132. charsLeftOver : 0,
  133. nullInput : false,
  134. invalidMonth : null,
  135. invalidFormat : false,
  136. userInvalidated : false,
  137. iso : false,
  138. parsedDateParts : [],
  139. meridiem : null
  140. };
  141. }
  142. function getParsingFlags(m) {
  143. if (m._pf == null) {
  144. m._pf = defaultParsingFlags();
  145. }
  146. return m._pf;
  147. }
  148. var some;
  149. if (Array.prototype.some) {
  150. some = Array.prototype.some;
  151. } else {
  152. some = function (fun) {
  153. var t = Object(this);
  154. var len = t.length >>> 0;
  155. for (var i = 0; i < len; i++) {
  156. if (i in t && fun.call(this, t[i], i, t)) {
  157. return true;
  158. }
  159. }
  160. return false;
  161. };
  162. }
  163. var some$1 = some;
  164. function isValid(m) {
  165. if (m._isValid == null) {
  166. var flags = getParsingFlags(m);
  167. var parsedParts = some$1.call(flags.parsedDateParts, function (i) {
  168. return i != null;
  169. });
  170. var isNowValid = !isNaN(m._d.getTime()) &&
  171. flags.overflow < 0 &&
  172. !flags.empty &&
  173. !flags.invalidMonth &&
  174. !flags.invalidWeekday &&
  175. !flags.nullInput &&
  176. !flags.invalidFormat &&
  177. !flags.userInvalidated &&
  178. (!flags.meridiem || (flags.meridiem && parsedParts));
  179. if (m._strict) {
  180. isNowValid = isNowValid &&
  181. flags.charsLeftOver === 0 &&
  182. flags.unusedTokens.length === 0 &&
  183. flags.bigHour === undefined;
  184. }
  185. if (Object.isFrozen == null || !Object.isFrozen(m)) {
  186. m._isValid = isNowValid;
  187. }
  188. else {
  189. return isNowValid;
  190. }
  191. }
  192. return m._isValid;
  193. }
  194. function createInvalid (flags) {
  195. var m = createUTC(NaN);
  196. if (flags != null) {
  197. extend(getParsingFlags(m), flags);
  198. }
  199. else {
  200. getParsingFlags(m).userInvalidated = true;
  201. }
  202. return m;
  203. }
  204. function isUndefined(input) {
  205. return input === void 0;
  206. }
  207. // Plugins that add properties should also add the key here (null value),
  208. // so we can properly clone ourselves.
  209. var momentProperties = hooks.momentProperties = [];
  210. function copyConfig(to, from) {
  211. var i, prop, val;
  212. if (!isUndefined(from._isAMomentObject)) {
  213. to._isAMomentObject = from._isAMomentObject;
  214. }
  215. if (!isUndefined(from._i)) {
  216. to._i = from._i;
  217. }
  218. if (!isUndefined(from._f)) {
  219. to._f = from._f;
  220. }
  221. if (!isUndefined(from._l)) {
  222. to._l = from._l;
  223. }
  224. if (!isUndefined(from._strict)) {
  225. to._strict = from._strict;
  226. }
  227. if (!isUndefined(from._tzm)) {
  228. to._tzm = from._tzm;
  229. }
  230. if (!isUndefined(from._isUTC)) {
  231. to._isUTC = from._isUTC;
  232. }
  233. if (!isUndefined(from._offset)) {
  234. to._offset = from._offset;
  235. }
  236. if (!isUndefined(from._pf)) {
  237. to._pf = getParsingFlags(from);
  238. }
  239. if (!isUndefined(from._locale)) {
  240. to._locale = from._locale;
  241. }
  242. if (momentProperties.length > 0) {
  243. for (i in momentProperties) {
  244. prop = momentProperties[i];
  245. val = from[prop];
  246. if (!isUndefined(val)) {
  247. to[prop] = val;
  248. }
  249. }
  250. }
  251. return to;
  252. }
  253. var updateInProgress = false;
  254. // Moment prototype object
  255. function Moment(config) {
  256. copyConfig(this, config);
  257. this._d = new Date(config._d != null ? config._d.getTime() : NaN);
  258. if (!this.isValid()) {
  259. this._d = new Date(NaN);
  260. }
  261. // Prevent infinite loop in case updateOffset creates new moment
  262. // objects.
  263. if (updateInProgress === false) {
  264. updateInProgress = true;
  265. hooks.updateOffset(this);
  266. updateInProgress = false;
  267. }
  268. }
  269. function isMoment (obj) {
  270. return obj instanceof Moment || (obj != null && obj._isAMomentObject != null);
  271. }
  272. function absFloor (number) {
  273. if (number < 0) {
  274. // -0 -> 0
  275. return Math.ceil(number) || 0;
  276. } else {
  277. return Math.floor(number);
  278. }
  279. }
  280. function toInt(argumentForCoercion) {
  281. var coercedNumber = +argumentForCoercion,
  282. value = 0;
  283. if (coercedNumber !== 0 && isFinite(coercedNumber)) {
  284. value = absFloor(coercedNumber);
  285. }
  286. return value;
  287. }
  288. // compare two arrays, return the number of differences
  289. function compareArrays(array1, array2, dontConvert) {
  290. var len = Math.min(array1.length, array2.length),
  291. lengthDiff = Math.abs(array1.length - array2.length),
  292. diffs = 0,
  293. i;
  294. for (i = 0; i < len; i++) {
  295. if ((dontConvert && array1[i] !== array2[i]) ||
  296. (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {
  297. diffs++;
  298. }
  299. }
  300. return diffs + lengthDiff;
  301. }
  302. function warn(msg) {
  303. if (hooks.suppressDeprecationWarnings === false &&
  304. (typeof console !== 'undefined') && console.warn) {
  305. console.warn('Deprecation warning: ' + msg);
  306. }
  307. }
  308. function deprecate(msg, fn) {
  309. var firstTime = true;
  310. return extend(function () {
  311. if (hooks.deprecationHandler != null) {
  312. hooks.deprecationHandler(null, msg);
  313. }
  314. if (firstTime) {
  315. var args = [];
  316. var arg;
  317. for (var i = 0; i < arguments.length; i++) {
  318. arg = '';
  319. if (typeof arguments[i] === 'object') {
  320. arg += '\n[' + i + '] ';
  321. for (var key in arguments[0]) {
  322. arg += key + ': ' + arguments[0][key] + ', ';
  323. }
  324. arg = arg.slice(0, -2); // Remove trailing comma and space
  325. } else {
  326. arg = arguments[i];
  327. }
  328. args.push(arg);
  329. }
  330. warn(msg + '\nArguments: ' + Array.prototype.slice.call(args).join('') + '\n' + (new Error()).stack);
  331. firstTime = false;
  332. }
  333. return fn.apply(this, arguments);
  334. }, fn);
  335. }
  336. var deprecations = {};
  337. function deprecateSimple(name, msg) {
  338. if (hooks.deprecationHandler != null) {
  339. hooks.deprecationHandler(name, msg);
  340. }
  341. if (!deprecations[name]) {
  342. warn(msg);
  343. deprecations[name] = true;
  344. }
  345. }
  346. hooks.suppressDeprecationWarnings = false;
  347. hooks.deprecationHandler = null;
  348. function isFunction(input) {
  349. return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]';
  350. }
  351. function set (config) {
  352. var prop, i;
  353. for (i in config) {
  354. prop = config[i];
  355. if (isFunction(prop)) {
  356. this[i] = prop;
  357. } else {
  358. this['_' + i] = prop;
  359. }
  360. }
  361. this._config = config;
  362. // Lenient ordinal parsing accepts just a number in addition to
  363. // number + (possibly) stuff coming from _ordinalParseLenient.
  364. this._ordinalParseLenient = new RegExp(this._ordinalParse.source + '|' + (/\d{1,2}/).source);
  365. }
  366. function mergeConfigs(parentConfig, childConfig) {
  367. var res = extend({}, parentConfig), prop;
  368. for (prop in childConfig) {
  369. if (hasOwnProp(childConfig, prop)) {
  370. if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {
  371. res[prop] = {};
  372. extend(res[prop], parentConfig[prop]);
  373. extend(res[prop], childConfig[prop]);
  374. } else if (childConfig[prop] != null) {
  375. res[prop] = childConfig[prop];
  376. } else {
  377. delete res[prop];
  378. }
  379. }
  380. }
  381. for (prop in parentConfig) {
  382. if (hasOwnProp(parentConfig, prop) &&
  383. !hasOwnProp(childConfig, prop) &&
  384. isObject(parentConfig[prop])) {
  385. // make sure changes to properties don't modify parent config
  386. res[prop] = extend({}, res[prop]);
  387. }
  388. }
  389. return res;
  390. }
  391. function Locale(config) {
  392. if (config != null) {
  393. this.set(config);
  394. }
  395. }
  396. var keys;
  397. if (Object.keys) {
  398. keys = Object.keys;
  399. } else {
  400. keys = function (obj) {
  401. var i, res = [];
  402. for (i in obj) {
  403. if (hasOwnProp(obj, i)) {
  404. res.push(i);
  405. }
  406. }
  407. return res;
  408. };
  409. }
  410. var keys$1 = keys;
  411. var defaultCalendar = {
  412. sameDay : '[Today at] LT',
  413. nextDay : '[Tomorrow at] LT',
  414. nextWeek : 'dddd [at] LT',
  415. lastDay : '[Yesterday at] LT',
  416. lastWeek : '[Last] dddd [at] LT',
  417. sameElse : 'L'
  418. };
  419. function calendar (key, mom, now) {
  420. var output = this._calendar[key] || this._calendar['sameElse'];
  421. return isFunction(output) ? output.call(mom, now) : output;
  422. }
  423. var defaultLongDateFormat = {
  424. LTS : 'h:mm:ss A',
  425. LT : 'h:mm A',
  426. L : 'MM/DD/YYYY',
  427. LL : 'MMMM D, YYYY',
  428. LLL : 'MMMM D, YYYY h:mm A',
  429. LLLL : 'dddd, MMMM D, YYYY h:mm A'
  430. };
  431. function longDateFormat (key) {
  432. var format = this._longDateFormat[key],
  433. formatUpper = this._longDateFormat[key.toUpperCase()];
  434. if (format || !formatUpper) {
  435. return format;
  436. }
  437. this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) {
  438. return val.slice(1);
  439. });
  440. return this._longDateFormat[key];
  441. }
  442. var defaultInvalidDate = 'Invalid date';
  443. function invalidDate () {
  444. return this._invalidDate;
  445. }
  446. var defaultOrdinal = '%d';
  447. var defaultOrdinalParse = /\d{1,2}/;
  448. function ordinal (number) {
  449. return this._ordinal.replace('%d', number);
  450. }
  451. var defaultRelativeTime = {
  452. future : 'in %s',
  453. past : '%s ago',
  454. s : 'a few seconds',
  455. m : 'a minute',
  456. mm : '%d minutes',
  457. h : 'an hour',
  458. hh : '%d hours',
  459. d : 'a day',
  460. dd : '%d days',
  461. M : 'a month',
  462. MM : '%d months',
  463. y : 'a year',
  464. yy : '%d years'
  465. };
  466. function relativeTime (number, withoutSuffix, string, isFuture) {
  467. var output = this._relativeTime[string];
  468. return (isFunction(output)) ?
  469. output(number, withoutSuffix, string, isFuture) :
  470. output.replace(/%d/i, number);
  471. }
  472. function pastFuture (diff, output) {
  473. var format = this._relativeTime[diff > 0 ? 'future' : 'past'];
  474. return isFunction(format) ? format(output) : format.replace(/%s/i, output);
  475. }
  476. var aliases = {};
  477. function addUnitAlias (unit, shorthand) {
  478. var lowerCase = unit.toLowerCase();
  479. aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;
  480. }
  481. function normalizeUnits(units) {
  482. return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined;
  483. }
  484. function normalizeObjectUnits(inputObject) {
  485. var normalizedInput = {},
  486. normalizedProp,
  487. prop;
  488. for (prop in inputObject) {
  489. if (hasOwnProp(inputObject, prop)) {
  490. normalizedProp = normalizeUnits(prop);
  491. if (normalizedProp) {
  492. normalizedInput[normalizedProp] = inputObject[prop];
  493. }
  494. }
  495. }
  496. return normalizedInput;
  497. }
  498. var priorities = {};
  499. function addUnitPriority(unit, priority) {
  500. priorities[unit] = priority;
  501. }
  502. function getPrioritizedUnits(unitsObj) {
  503. var units = [];
  504. for (var u in unitsObj) {
  505. units.push({unit: u, priority: priorities[u]});
  506. }
  507. units.sort(function (a, b) {
  508. return a.priority - b.priority;
  509. });
  510. return units;
  511. }
  512. function makeGetSet (unit, keepTime) {
  513. return function (value) {
  514. if (value != null) {
  515. set$1(this, unit, value);
  516. hooks.updateOffset(this, keepTime);
  517. return this;
  518. } else {
  519. return get(this, unit);
  520. }
  521. };
  522. }
  523. function get (mom, unit) {
  524. return mom.isValid() ?
  525. mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN;
  526. }
  527. function set$1 (mom, unit, value) {
  528. if (mom.isValid()) {
  529. mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);
  530. }
  531. }
  532. // MOMENTS
  533. function stringGet (units) {
  534. units = normalizeUnits(units);
  535. if (isFunction(this[units])) {
  536. return this[units]();
  537. }
  538. return this;
  539. }
  540. function stringSet (units, value) {
  541. if (typeof units === 'object') {
  542. units = normalizeObjectUnits(units);
  543. var prioritized = getPrioritizedUnits(units);
  544. for (var i = 0; i < prioritized.length; i++) {
  545. this[prioritized[i].unit](units[prioritized[i].unit]);
  546. }
  547. } else {
  548. units = normalizeUnits(units);
  549. if (isFunction(this[units])) {
  550. return this[units](value);
  551. }
  552. }
  553. return this;
  554. }
  555. function zeroFill(number, targetLength, forceSign) {
  556. var absNumber = '' + Math.abs(number),
  557. zerosToFill = targetLength - absNumber.length,
  558. sign = number >= 0;
  559. return (sign ? (forceSign ? '+' : '') : '-') +
  560. Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;
  561. }
  562. var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;
  563. var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g;
  564. var formatFunctions = {};
  565. var formatTokenFunctions = {};
  566. // token: 'M'
  567. // padded: ['MM', 2]
  568. // ordinal: 'Mo'
  569. // callback: function () { this.month() + 1 }
  570. function addFormatToken (token, padded, ordinal, callback) {
  571. var func = callback;
  572. if (typeof callback === 'string') {
  573. func = function () {
  574. return this[callback]();
  575. };
  576. }
  577. if (token) {
  578. formatTokenFunctions[token] = func;
  579. }
  580. if (padded) {
  581. formatTokenFunctions[padded[0]] = function () {
  582. return zeroFill(func.apply(this, arguments), padded[1], padded[2]);
  583. };
  584. }
  585. if (ordinal) {
  586. formatTokenFunctions[ordinal] = function () {
  587. return this.localeData().ordinal(func.apply(this, arguments), token);
  588. };
  589. }
  590. }
  591. function removeFormattingTokens(input) {
  592. if (input.match(/\[[\s\S]/)) {
  593. return input.replace(/^\[|\]$/g, '');
  594. }
  595. return input.replace(/\\/g, '');
  596. }
  597. function makeFormatFunction(format) {
  598. var array = format.match(formattingTokens), i, length;
  599. for (i = 0, length = array.length; i < length; i++) {
  600. if (formatTokenFunctions[array[i]]) {
  601. array[i] = formatTokenFunctions[array[i]];
  602. } else {
  603. array[i] = removeFormattingTokens(array[i]);
  604. }
  605. }
  606. return function (mom) {
  607. var output = '', i;
  608. for (i = 0; i < length; i++) {
  609. output += array[i] instanceof Function ? array[i].call(mom, format) : array[i];
  610. }
  611. return output;
  612. };
  613. }
  614. // format date using native date object
  615. function formatMoment(m, format) {
  616. if (!m.isValid()) {
  617. return m.localeData().invalidDate();
  618. }
  619. format = expandFormat(format, m.localeData());
  620. formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format);
  621. return formatFunctions[format](m);
  622. }
  623. function expandFormat(format, locale) {
  624. var i = 5;
  625. function replaceLongDateFormatTokens(input) {
  626. return locale.longDateFormat(input) || input;
  627. }
  628. localFormattingTokens.lastIndex = 0;
  629. while (i >= 0 && localFormattingTokens.test(format)) {
  630. format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);
  631. localFormattingTokens.lastIndex = 0;
  632. i -= 1;
  633. }
  634. return format;
  635. }
  636. var match1 = /\d/; // 0 - 9
  637. var match2 = /\d\d/; // 00 - 99
  638. var match3 = /\d{3}/; // 000 - 999
  639. var match4 = /\d{4}/; // 0000 - 9999
  640. var match6 = /[+-]?\d{6}/; // -999999 - 999999
  641. var match1to2 = /\d\d?/; // 0 - 99
  642. var match3to4 = /\d\d\d\d?/; // 999 - 9999
  643. var match5to6 = /\d\d\d\d\d\d?/; // 99999 - 999999
  644. var match1to3 = /\d{1,3}/; // 0 - 999
  645. var match1to4 = /\d{1,4}/; // 0 - 9999
  646. var match1to6 = /[+-]?\d{1,6}/; // -999999 - 999999
  647. var matchUnsigned = /\d+/; // 0 - inf
  648. var matchSigned = /[+-]?\d+/; // -inf - inf
  649. var matchOffset = /Z|[+-]\d\d:?\d\d/gi; // +00:00 -00:00 +0000 -0000 or Z
  650. var matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z
  651. var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123
  652. // any word (or two) characters or numbers including two/three word month in arabic.
  653. // includes scottish gaelic two word and hyphenated months
  654. var matchWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i;
  655. var regexes = {};
  656. function addRegexToken (token, regex, strictRegex) {
  657. regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) {
  658. return (isStrict && strictRegex) ? strictRegex : regex;
  659. };
  660. }
  661. function getParseRegexForToken (token, config) {
  662. if (!hasOwnProp(regexes, token)) {
  663. return new RegExp(unescapeFormat(token));
  664. }
  665. return regexes[token](config._strict, config._locale);
  666. }
  667. // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript
  668. function unescapeFormat(s) {
  669. return regexEscape(s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) {
  670. return p1 || p2 || p3 || p4;
  671. }));
  672. }
  673. function regexEscape(s) {
  674. return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
  675. }
  676. var tokens = {};
  677. function addParseToken (token, callback) {
  678. var i, func = callback;
  679. if (typeof token === 'string') {
  680. token = [token];
  681. }
  682. if (isNumber(callback)) {
  683. func = function (input, array) {
  684. array[callback] = toInt(input);
  685. };
  686. }
  687. for (i = 0; i < token.length; i++) {
  688. tokens[token[i]] = func;
  689. }
  690. }
  691. function addWeekParseToken (token, callback) {
  692. addParseToken(token, function (input, array, config, token) {
  693. config._w = config._w || {};
  694. callback(input, config._w, config, token);
  695. });
  696. }
  697. function addTimeToArrayFromToken(token, input, config) {
  698. if (input != null && hasOwnProp(tokens, token)) {
  699. tokens[token](input, config._a, config, token);
  700. }
  701. }
  702. var YEAR = 0;
  703. var MONTH = 1;
  704. var DATE = 2;
  705. var HOUR = 3;
  706. var MINUTE = 4;
  707. var SECOND = 5;
  708. var MILLISECOND = 6;
  709. var WEEK = 7;
  710. var WEEKDAY = 8;
  711. var indexOf;
  712. if (Array.prototype.indexOf) {
  713. indexOf = Array.prototype.indexOf;
  714. } else {
  715. indexOf = function (o) {
  716. // I know
  717. var i;
  718. for (i = 0; i < this.length; ++i) {
  719. if (this[i] === o) {
  720. return i;
  721. }
  722. }
  723. return -1;
  724. };
  725. }
  726. var indexOf$1 = indexOf;
  727. function daysInMonth(year, month) {
  728. return new Date(Date.UTC(year, month + 1, 0)).getUTCDate();
  729. }
  730. // FORMATTING
  731. addFormatToken('M', ['MM', 2], 'Mo', function () {
  732. return this.month() + 1;
  733. });
  734. addFormatToken('MMM', 0, 0, function (format) {
  735. return this.localeData().monthsShort(this, format);
  736. });
  737. addFormatToken('MMMM', 0, 0, function (format) {
  738. return this.localeData().months(this, format);
  739. });
  740. // ALIASES
  741. addUnitAlias('month', 'M');
  742. // PRIORITY
  743. addUnitPriority('month', 8);
  744. // PARSING
  745. addRegexToken('M', match1to2);
  746. addRegexToken('MM', match1to2, match2);
  747. addRegexToken('MMM', function (isStrict, locale) {
  748. return locale.monthsShortRegex(isStrict);
  749. });
  750. addRegexToken('MMMM', function (isStrict, locale) {
  751. return locale.monthsRegex(isStrict);
  752. });
  753. addParseToken(['M', 'MM'], function (input, array) {
  754. array[MONTH] = toInt(input) - 1;
  755. });
  756. addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {
  757. var month = config._locale.monthsParse(input, token, config._strict);
  758. // if we didn't find a month name, mark the date as invalid.
  759. if (month != null) {
  760. array[MONTH] = month;
  761. } else {
  762. getParsingFlags(config).invalidMonth = input;
  763. }
  764. });
  765. // LOCALES
  766. var MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/;
  767. var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_');
  768. function localeMonths (m, format) {
  769. if (!m) {
  770. return this._months;
  771. }
  772. return isArray(this._months) ? this._months[m.month()] :
  773. this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format) ? 'format' : 'standalone'][m.month()];
  774. }
  775. var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_');
  776. function localeMonthsShort (m, format) {
  777. if (!m) {
  778. return this._monthsShort;
  779. }
  780. return isArray(this._monthsShort) ? this._monthsShort[m.month()] :
  781. this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()];
  782. }
  783. function handleStrictParse(monthName, format, strict) {
  784. var i, ii, mom, llc = monthName.toLocaleLowerCase();
  785. if (!this._monthsParse) {
  786. // this is not used
  787. this._monthsParse = [];
  788. this._longMonthsParse = [];
  789. this._shortMonthsParse = [];
  790. for (i = 0; i < 12; ++i) {
  791. mom = createUTC([2000, i]);
  792. this._shortMonthsParse[i] = this.monthsShort(mom, '').toLocaleLowerCase();
  793. this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();
  794. }
  795. }
  796. if (strict) {
  797. if (format === 'MMM') {
  798. ii = indexOf$1.call(this._shortMonthsParse, llc);
  799. return ii !== -1 ? ii : null;
  800. } else {
  801. ii = indexOf$1.call(this._longMonthsParse, llc);
  802. return ii !== -1 ? ii : null;
  803. }
  804. } else {
  805. if (format === 'MMM') {
  806. ii = indexOf$1.call(this._shortMonthsParse, llc);
  807. if (ii !== -1) {
  808. return ii;
  809. }
  810. ii = indexOf$1.call(this._longMonthsParse, llc);
  811. return ii !== -1 ? ii : null;
  812. } else {
  813. ii = indexOf$1.call(this._longMonthsParse, llc);
  814. if (ii !== -1) {
  815. return ii;
  816. }
  817. ii = indexOf$1.call(this._shortMonthsParse, llc);
  818. return ii !== -1 ? ii : null;
  819. }
  820. }
  821. }
  822. function localeMonthsParse (monthName, format, strict) {
  823. var i, mom, regex;
  824. if (this._monthsParseExact) {
  825. return handleStrictParse.call(this, monthName, format, strict);
  826. }
  827. if (!this._monthsParse) {
  828. this._monthsParse = [];
  829. this._longMonthsParse = [];
  830. this._shortMonthsParse = [];
  831. }
  832. // TODO: add sorting
  833. // Sorting makes sure if one month (or abbr) is a prefix of another
  834. // see sorting in computeMonthsParse
  835. for (i = 0; i < 12; i++) {
  836. // make the regex if we don't have it already
  837. mom = createUTC([2000, i]);
  838. if (strict && !this._longMonthsParse[i]) {
  839. this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i');
  840. this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i');
  841. }
  842. if (!strict && !this._monthsParse[i]) {
  843. regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');
  844. this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');
  845. }
  846. // test the regex
  847. if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) {
  848. return i;
  849. } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) {
  850. return i;
  851. } else if (!strict && this._monthsParse[i].test(monthName)) {
  852. return i;
  853. }
  854. }
  855. }
  856. // MOMENTS
  857. function setMonth (mom, value) {
  858. var dayOfMonth;
  859. if (!mom.isValid()) {
  860. // No op
  861. return mom;
  862. }
  863. if (typeof value === 'string') {
  864. if (/^\d+$/.test(value)) {
  865. value = toInt(value);
  866. } else {
  867. value = mom.localeData().monthsParse(value);
  868. // TODO: Another silent failure?
  869. if (!isNumber(value)) {
  870. return mom;
  871. }
  872. }
  873. }
  874. dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));
  875. mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);
  876. return mom;
  877. }
  878. function getSetMonth (value) {
  879. if (value != null) {
  880. setMonth(this, value);
  881. hooks.updateOffset(this, true);
  882. return this;
  883. } else {
  884. return get(this, 'Month');
  885. }
  886. }
  887. function getDaysInMonth () {
  888. return daysInMonth(this.year(), this.month());
  889. }
  890. var defaultMonthsShortRegex = matchWord;
  891. function monthsShortRegex (isStrict) {
  892. if (this._monthsParseExact) {
  893. if (!hasOwnProp(this, '_monthsRegex')) {
  894. computeMonthsParse.call(this);
  895. }
  896. if (isStrict) {
  897. return this._monthsShortStrictRegex;
  898. } else {
  899. return this._monthsShortRegex;
  900. }
  901. } else {
  902. if (!hasOwnProp(this, '_monthsShortRegex')) {
  903. this._monthsShortRegex = defaultMonthsShortRegex;
  904. }
  905. return this._monthsShortStrictRegex && isStrict ?
  906. this._monthsShortStrictRegex : this._monthsShortRegex;
  907. }
  908. }
  909. var defaultMonthsRegex = matchWord;
  910. function monthsRegex (isStrict) {
  911. if (this._monthsParseExact) {
  912. if (!hasOwnProp(this, '_monthsRegex')) {
  913. computeMonthsParse.call(this);
  914. }
  915. if (isStrict) {
  916. return this._monthsStrictRegex;
  917. } else {
  918. return this._monthsRegex;
  919. }
  920. } else {
  921. if (!hasOwnProp(this, '_monthsRegex')) {
  922. this._monthsRegex = defaultMonthsRegex;
  923. }
  924. return this._monthsStrictRegex && isStrict ?
  925. this._monthsStrictRegex : this._monthsRegex;
  926. }
  927. }
  928. function computeMonthsParse () {
  929. function cmpLenRev(a, b) {
  930. return b.length - a.length;
  931. }
  932. var shortPieces = [], longPieces = [], mixedPieces = [],
  933. i, mom;
  934. for (i = 0; i < 12; i++) {
  935. // make the regex if we don't have it already
  936. mom = createUTC([2000, i]);
  937. shortPieces.push(this.monthsShort(mom, ''));
  938. longPieces.push(this.months(mom, ''));
  939. mixedPieces.push(this.months(mom, ''));
  940. mixedPieces.push(this.monthsShort(mom, ''));
  941. }
  942. // Sorting makes sure if one month (or abbr) is a prefix of another it
  943. // will match the longer piece.
  944. shortPieces.sort(cmpLenRev);
  945. longPieces.sort(cmpLenRev);
  946. mixedPieces.sort(cmpLenRev);
  947. for (i = 0; i < 12; i++) {
  948. shortPieces[i] = regexEscape(shortPieces[i]);
  949. longPieces[i] = regexEscape(longPieces[i]);
  950. }
  951. for (i = 0; i < 24; i++) {
  952. mixedPieces[i] = regexEscape(mixedPieces[i]);
  953. }
  954. this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
  955. this._monthsShortRegex = this._monthsRegex;
  956. this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');
  957. this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');
  958. }
  959. // FORMATTING
  960. addFormatToken('Y', 0, 0, function () {
  961. var y = this.year();
  962. return y <= 9999 ? '' + y : '+' + y;
  963. });
  964. addFormatToken(0, ['YY', 2], 0, function () {
  965. return this.year() % 100;
  966. });
  967. addFormatToken(0, ['YYYY', 4], 0, 'year');
  968. addFormatToken(0, ['YYYYY', 5], 0, 'year');
  969. addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
  970. // ALIASES
  971. addUnitAlias('year', 'y');
  972. // PRIORITIES
  973. addUnitPriority('year', 1);
  974. // PARSING
  975. addRegexToken('Y', matchSigned);
  976. addRegexToken('YY', match1to2, match2);
  977. addRegexToken('YYYY', match1to4, match4);
  978. addRegexToken('YYYYY', match1to6, match6);
  979. addRegexToken('YYYYYY', match1to6, match6);
  980. addParseToken(['YYYYY', 'YYYYYY'], YEAR);
  981. addParseToken('YYYY', function (input, array) {
  982. array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
  983. });
  984. addParseToken('YY', function (input, array) {
  985. array[YEAR] = hooks.parseTwoDigitYear(input);
  986. });
  987. addParseToken('Y', function (input, array) {
  988. array[YEAR] = parseInt(input, 10);
  989. });
  990. // HELPERS
  991. function daysInYear(year) {
  992. return isLeapYear(year) ? 366 : 365;
  993. }
  994. function isLeapYear(year) {
  995. return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
  996. }
  997. // HOOKS
  998. hooks.parseTwoDigitYear = function (input) {
  999. return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
  1000. };
  1001. // MOMENTS
  1002. var getSetYear = makeGetSet('FullYear', true);
  1003. function getIsLeapYear () {
  1004. return isLeapYear(this.year());
  1005. }
  1006. function createDate (y, m, d, h, M, s, ms) {
  1007. //can't just apply() to create a date:
  1008. //http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply
  1009. var date = new Date(y, m, d, h, M, s, ms);
  1010. //the date constructor remaps years 0-99 to 1900-1999
  1011. if (y < 100 && y >= 0 && isFinite(date.getFullYear())) {
  1012. date.setFullYear(y);
  1013. }
  1014. return date;
  1015. }
  1016. function createUTCDate (y) {
  1017. var date = new Date(Date.UTC.apply(null, arguments));
  1018. //the Date.UTC function remaps years 0-99 to 1900-1999
  1019. if (y < 100 && y >= 0 && isFinite(date.getUTCFullYear())) {
  1020. date.setUTCFullYear(y);
  1021. }
  1022. return date;
  1023. }
  1024. // start-of-first-week - start-of-year
  1025. function firstWeekOffset(year, dow, doy) {
  1026. var // first-week day -- which january is always in the first week (4 for iso, 1 for other)
  1027. fwd = 7 + dow - doy,
  1028. // first-week day local weekday -- which local weekday is fwd
  1029. fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;
  1030. return -fwdlw + fwd - 1;
  1031. }
  1032. //http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday
  1033. function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
  1034. var localWeekday = (7 + weekday - dow) % 7,
  1035. weekOffset = firstWeekOffset(year, dow, doy),
  1036. dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,
  1037. resYear, resDayOfYear;
  1038. if (dayOfYear <= 0) {
  1039. resYear = year - 1;
  1040. resDayOfYear = daysInYear(resYear) + dayOfYear;
  1041. } else if (dayOfYear > daysInYear(year)) {
  1042. resYear = year + 1;
  1043. resDayOfYear = dayOfYear - daysInYear(year);
  1044. } else {
  1045. resYear = year;
  1046. resDayOfYear = dayOfYear;
  1047. }
  1048. return {
  1049. year: resYear,
  1050. dayOfYear: resDayOfYear
  1051. };
  1052. }
  1053. function weekOfYear(mom, dow, doy) {
  1054. var weekOffset = firstWeekOffset(mom.year(), dow, doy),
  1055. week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,
  1056. resWeek, resYear;
  1057. if (week < 1) {
  1058. resYear = mom.year() - 1;
  1059. resWeek = week + weeksInYear(resYear, dow, doy);
  1060. } else if (week > weeksInYear(mom.year(), dow, doy)) {
  1061. resWeek = week - weeksInYear(mom.year(), dow, doy);
  1062. resYear = mom.year() + 1;
  1063. } else {
  1064. resYear = mom.year();
  1065. resWeek = week;
  1066. }
  1067. return {
  1068. week: resWeek,
  1069. year: resYear
  1070. };
  1071. }
  1072. function weeksInYear(year, dow, doy) {
  1073. var weekOffset = firstWeekOffset(year, dow, doy),
  1074. weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
  1075. return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;
  1076. }
  1077. // FORMATTING
  1078. addFormatToken('w', ['ww', 2], 'wo', 'week');
  1079. addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');
  1080. // ALIASES
  1081. addUnitAlias('week', 'w');
  1082. addUnitAlias('isoWeek', 'W');
  1083. // PRIORITIES
  1084. addUnitPriority('week', 5);
  1085. addUnitPriority('isoWeek', 5);
  1086. // PARSING
  1087. addRegexToken('w', match1to2);
  1088. addRegexToken('ww', match1to2, match2);
  1089. addRegexToken('W', match1to2);
  1090. addRegexToken('WW', match1to2, match2);
  1091. addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) {
  1092. week[token.substr(0, 1)] = toInt(input);
  1093. });
  1094. // HELPERS
  1095. // LOCALES
  1096. function localeWeek (mom) {
  1097. return weekOfYear(mom, this._week.dow, this._week.doy).week;
  1098. }
  1099. var defaultLocaleWeek = {
  1100. dow : 0, // Sunday is the first day of the week.
  1101. doy : 6 // The week that contains Jan 1st is the first week of the year.
  1102. };
  1103. function localeFirstDayOfWeek () {
  1104. return this._week.dow;
  1105. }
  1106. function localeFirstDayOfYear () {
  1107. return this._week.doy;
  1108. }
  1109. // MOMENTS
  1110. function getSetWeek (input) {
  1111. var week = this.localeData().week(this);
  1112. return input == null ? week : this.add((input - week) * 7, 'd');
  1113. }
  1114. function getSetISOWeek (input) {
  1115. var week = weekOfYear(this, 1, 4).week;
  1116. return input == null ? week : this.add((input - week) * 7, 'd');
  1117. }
  1118. // FORMATTING
  1119. addFormatToken('d', 0, 'do', 'day');
  1120. addFormatToken('dd', 0, 0, function (format) {
  1121. return this.localeData().weekdaysMin(this, format);
  1122. });
  1123. addFormatToken('ddd', 0, 0, function (format) {
  1124. return this.localeData().weekdaysShort(this, format);
  1125. });
  1126. addFormatToken('dddd', 0, 0, function (format) {
  1127. return this.localeData().weekdays(this, format);
  1128. });
  1129. addFormatToken('e', 0, 0, 'weekday');
  1130. addFormatToken('E', 0, 0, 'isoWeekday');
  1131. // ALIASES
  1132. addUnitAlias('day', 'd');
  1133. addUnitAlias('weekday', 'e');
  1134. addUnitAlias('isoWeekday', 'E');
  1135. // PRIORITY
  1136. addUnitPriority('day', 11);
  1137. addUnitPriority('weekday', 11);
  1138. addUnitPriority('isoWeekday', 11);
  1139. // PARSING
  1140. addRegexToken('d', match1to2);
  1141. addRegexToken('e', match1to2);
  1142. addRegexToken('E', match1to2);
  1143. addRegexToken('dd', function (isStrict, locale) {
  1144. return locale.weekdaysMinRegex(isStrict);
  1145. });
  1146. addRegexToken('ddd', function (isStrict, locale) {
  1147. return locale.weekdaysShortRegex(isStrict);
  1148. });
  1149. addRegexToken('dddd', function (isStrict, locale) {
  1150. return locale.weekdaysRegex(isStrict);
  1151. });
  1152. addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {
  1153. var weekday = config._locale.weekdaysParse(input, token, config._strict);
  1154. // if we didn't get a weekday name, mark the date as invalid
  1155. if (weekday != null) {
  1156. week.d = weekday;
  1157. } else {
  1158. getParsingFlags(config).invalidWeekday = input;
  1159. }
  1160. });
  1161. addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {
  1162. week[token] = toInt(input);
  1163. });
  1164. // HELPERS
  1165. function parseWeekday(input, locale) {
  1166. if (typeof input !== 'string') {
  1167. return input;
  1168. }
  1169. if (!isNaN(input)) {
  1170. return parseInt(input, 10);
  1171. }
  1172. input = locale.weekdaysParse(input);
  1173. if (typeof input === 'number') {
  1174. return input;
  1175. }
  1176. return null;
  1177. }
  1178. function parseIsoWeekday(input, locale) {
  1179. if (typeof input === 'string') {
  1180. return locale.weekdaysParse(input) % 7 || 7;
  1181. }
  1182. return isNaN(input) ? null : input;
  1183. }
  1184. // LOCALES
  1185. var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_');
  1186. function localeWeekdays (m, format) {
  1187. if (!m) {
  1188. return this._weekdays;
  1189. }
  1190. return isArray(this._weekdays) ? this._weekdays[m.day()] :
  1191. this._weekdays[this._weekdays.isFormat.test(format) ? 'format' : 'standalone'][m.day()];
  1192. }
  1193. var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_');
  1194. function localeWeekdaysShort (m) {
  1195. return (m) ? this._weekdaysShort[m.day()] : this._weekdaysShort;
  1196. }
  1197. var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_');
  1198. function localeWeekdaysMin (m) {
  1199. return (m) ? this._weekdaysMin[m.day()] : this._weekdaysMin;
  1200. }
  1201. function handleStrictParse$1(weekdayName, format, strict) {
  1202. var i, ii, mom, llc = weekdayName.toLocaleLowerCase();
  1203. if (!this._weekdaysParse) {
  1204. this._weekdaysParse = [];
  1205. this._shortWeekdaysParse = [];
  1206. this._minWeekdaysParse = [];
  1207. for (i = 0; i < 7; ++i) {
  1208. mom = createUTC([2000, 1]).day(i);
  1209. this._minWeekdaysParse[i] = this.weekdaysMin(mom, '').toLocaleLowerCase();
  1210. this._shortWeekdaysParse[i] = this.weekdaysShort(mom, '').toLocaleLowerCase();
  1211. this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();
  1212. }
  1213. }
  1214. if (strict) {
  1215. if (format === 'dddd') {
  1216. ii = indexOf$1.call(this._weekdaysParse, llc);
  1217. return ii !== -1 ? ii : null;
  1218. } else if (format === 'ddd') {
  1219. ii = indexOf$1.call(this._shortWeekdaysParse, llc);
  1220. return ii !== -1 ? ii : null;
  1221. } else {
  1222. ii = indexOf$1.call(this._minWeekdaysParse, llc);
  1223. return ii !== -1 ? ii : null;
  1224. }
  1225. } else {
  1226. if (format === 'dddd') {
  1227. ii = indexOf$1.call(this._weekdaysParse, llc);
  1228. if (ii !== -1) {
  1229. return ii;
  1230. }
  1231. ii = indexOf$1.call(this._shortWeekdaysParse, llc);
  1232. if (ii !== -1) {
  1233. return ii;
  1234. }
  1235. ii = indexOf$1.call(this._minWeekdaysParse, llc);
  1236. return ii !== -1 ? ii : null;
  1237. } else if (format === 'ddd') {
  1238. ii = indexOf$1.call(this._shortWeekdaysParse, llc);
  1239. if (ii !== -1) {
  1240. return ii;
  1241. }
  1242. ii = indexOf$1.call(this._weekdaysParse, llc);
  1243. if (ii !== -1) {
  1244. return ii;
  1245. }
  1246. ii = indexOf$1.call(this._minWeekdaysParse, llc);
  1247. return ii !== -1 ? ii : null;
  1248. } else {
  1249. ii = indexOf$1.call(this._minWeekdaysParse, llc);
  1250. if (ii !== -1) {
  1251. return ii;
  1252. }
  1253. ii = indexOf$1.call(this._weekdaysParse, llc);
  1254. if (ii !== -1) {
  1255. return ii;
  1256. }
  1257. ii = indexOf$1.call(this._shortWeekdaysParse, llc);
  1258. return ii !== -1 ? ii : null;
  1259. }
  1260. }
  1261. }
  1262. function localeWeekdaysParse (weekdayName, format, strict) {
  1263. var i, mom, regex;
  1264. if (this._weekdaysParseExact) {
  1265. return handleStrictParse$1.call(this, weekdayName, format, strict);
  1266. }
  1267. if (!this._weekdaysParse) {
  1268. this._weekdaysParse = [];
  1269. this._minWeekdaysParse = [];
  1270. this._shortWeekdaysParse = [];
  1271. this._fullWeekdaysParse = [];
  1272. }
  1273. for (i = 0; i < 7; i++) {
  1274. // make the regex if we don't have it already
  1275. mom = createUTC([2000, 1]).day(i);
  1276. if (strict && !this._fullWeekdaysParse[i]) {
  1277. this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\.?') + '$', 'i');
  1278. this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\.?') + '$', 'i');
  1279. this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\.?') + '$', 'i');
  1280. }
  1281. if (!this._weekdaysParse[i]) {
  1282. regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, '');
  1283. this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');
  1284. }
  1285. // test the regex
  1286. if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) {
  1287. return i;
  1288. } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) {
  1289. return i;
  1290. } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) {
  1291. return i;
  1292. } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {
  1293. return i;
  1294. }
  1295. }
  1296. }
  1297. // MOMENTS
  1298. function getSetDayOfWeek (input) {
  1299. if (!this.isValid()) {
  1300. return input != null ? this : NaN;
  1301. }
  1302. var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
  1303. if (input != null) {
  1304. input = parseWeekday(input, this.localeData());
  1305. return this.add(input - day, 'd');
  1306. } else {
  1307. return day;
  1308. }
  1309. }
  1310. function getSetLocaleDayOfWeek (input) {
  1311. if (!this.isValid()) {
  1312. return input != null ? this : NaN;
  1313. }
  1314. var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
  1315. return input == null ? weekday : this.add(input - weekday, 'd');
  1316. }
  1317. function getSetISODayOfWeek (input) {
  1318. if (!this.isValid()) {
  1319. return input != null ? this : NaN;
  1320. }
  1321. // behaves the same as moment#day except
  1322. // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)
  1323. // as a setter, sunday should belong to the previous week.
  1324. if (input != null) {
  1325. var weekday = parseIsoWeekday(input, this.localeData());
  1326. return this.day(this.day() % 7 ? weekday : weekday - 7);
  1327. } else {
  1328. return this.day() || 7;
  1329. }
  1330. }
  1331. var defaultWeekdaysRegex = matchWord;
  1332. function weekdaysRegex (isStrict) {
  1333. if (this._weekdaysParseExact) {
  1334. if (!hasOwnProp(this, '_weekdaysRegex')) {
  1335. computeWeekdaysParse.call(this);
  1336. }
  1337. if (isStrict) {
  1338. return this._weekdaysStrictRegex;
  1339. } else {
  1340. return this._weekdaysRegex;
  1341. }
  1342. } else {
  1343. if (!hasOwnProp(this, '_weekdaysRegex')) {
  1344. this._weekdaysRegex = defaultWeekdaysRegex;
  1345. }
  1346. return this._weekdaysStrictRegex && isStrict ?
  1347. this._weekdaysStrictRegex : this._weekdaysRegex;
  1348. }
  1349. }
  1350. var defaultWeekdaysShortRegex = matchWord;
  1351. function weekdaysShortRegex (isStrict) {
  1352. if (this._weekdaysParseExact) {
  1353. if (!hasOwnProp(this, '_weekdaysRegex')) {
  1354. computeWeekdaysParse.call(this);
  1355. }
  1356. if (isStrict) {
  1357. return this._weekdaysShortStrictRegex;
  1358. } else {
  1359. return this._weekdaysShortRegex;
  1360. }
  1361. } else {
  1362. if (!hasOwnProp(this, '_weekdaysShortRegex')) {
  1363. this._weekdaysShortRegex = defaultWeekdaysShortRegex;
  1364. }
  1365. return this._weekdaysShortStrictRegex && isStrict ?
  1366. this._weekdaysShortStrictRegex : this._weekdaysShortRegex;
  1367. }
  1368. }
  1369. var defaultWeekdaysMinRegex = matchWord;
  1370. function weekdaysMinRegex (isStrict) {
  1371. if (this._weekdaysParseExact) {
  1372. if (!hasOwnProp(this, '_weekdaysRegex')) {
  1373. computeWeekdaysParse.call(this);
  1374. }
  1375. if (isStrict) {
  1376. return this._weekdaysMinStrictRegex;
  1377. } else {
  1378. return this._weekdaysMinRegex;
  1379. }
  1380. } else {
  1381. if (!hasOwnProp(this, '_weekdaysMinRegex')) {
  1382. this._weekdaysMinRegex = defaultWeekdaysMinRegex;
  1383. }
  1384. return this._weekdaysMinStrictRegex && isStrict ?
  1385. this._weekdaysMinStrictRegex : this._weekdaysMinRegex;
  1386. }
  1387. }
  1388. function computeWeekdaysParse () {
  1389. function cmpLenRev(a, b) {
  1390. return b.length - a.length;
  1391. }
  1392. var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [],
  1393. i, mom, minp, shortp, longp;
  1394. for (i = 0; i < 7; i++) {
  1395. // make the regex if we don't have it already
  1396. mom = createUTC([2000, 1]).day(i);
  1397. minp = this.weekdaysMin(mom, '');
  1398. shortp = this.weekdaysShort(mom, '');
  1399. longp = this.weekdays(mom, '');
  1400. minPieces.push(minp);
  1401. shortPieces.push(shortp);
  1402. longPieces.push(longp);
  1403. mixedPieces.push(minp);
  1404. mixedPieces.push(shortp);
  1405. mixedPieces.push(longp);
  1406. }
  1407. // Sorting makes sure if one weekday (or abbr) is a prefix of another it
  1408. // will match the longer piece.
  1409. minPieces.sort(cmpLenRev);
  1410. shortPieces.sort(cmpLenRev);
  1411. longPieces.sort(cmpLenRev);
  1412. mixedPieces.sort(cmpLenRev);
  1413. for (i = 0; i < 7; i++) {
  1414. shortPieces[i] = regexEscape(shortPieces[i]);
  1415. longPieces[i] = regexEscape(longPieces[i]);
  1416. mixedPieces[i] = regexEscape(mixedPieces[i]);
  1417. }
  1418. this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
  1419. this._weekdaysShortRegex = this._weekdaysRegex;
  1420. this._weekdaysMinRegex = this._weekdaysRegex;
  1421. this._weekdaysStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');
  1422. this._weekdaysShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');
  1423. this._weekdaysMinStrictRegex = new RegExp('^(' + minPieces.join('|') + ')', 'i');
  1424. }
  1425. // FORMATTING
  1426. function hFormat() {
  1427. return this.hours() % 12 || 12;
  1428. }
  1429. function kFormat() {
  1430. return this.hours() || 24;
  1431. }
  1432. addFormatToken('H', ['HH', 2], 0, 'hour');
  1433. addFormatToken('h', ['hh', 2], 0, hFormat);
  1434. addFormatToken('k', ['kk', 2], 0, kFormat);
  1435. addFormatToken('hmm', 0, 0, function () {
  1436. return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);
  1437. });
  1438. addFormatToken('hmmss', 0, 0, function () {
  1439. return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) +
  1440. zeroFill(this.seconds(), 2);
  1441. });
  1442. addFormatToken('Hmm', 0, 0, function () {
  1443. return '' + this.hours() + zeroFill(this.minutes(), 2);
  1444. });
  1445. addFormatToken('Hmmss', 0, 0, function () {
  1446. return '' + this.hours() + zeroFill(this.minutes(), 2) +
  1447. zeroFill(this.seconds(), 2);
  1448. });
  1449. function meridiem (token, lowercase) {
  1450. addFormatToken(token, 0, 0, function () {
  1451. return this.localeData().meridiem(this.hours(), this.minutes(), lowercase);
  1452. });
  1453. }
  1454. meridiem('a', true);
  1455. meridiem('A', false);
  1456. // ALIASES
  1457. addUnitAlias('hour', 'h');
  1458. // PRIORITY
  1459. addUnitPriority('hour', 13);
  1460. // PARSING
  1461. function matchMeridiem (isStrict, locale) {
  1462. return locale._meridiemParse;
  1463. }
  1464. addRegexToken('a', matchMeridiem);
  1465. addRegexToken('A', matchMeridiem);
  1466. addRegexToken('H', match1to2);
  1467. addRegexToken('h', match1to2);
  1468. addRegexToken('HH', match1to2, match2);
  1469. addRegexToken('hh', match1to2, match2);
  1470. addRegexToken('hmm', match3to4);
  1471. addRegexToken('hmmss', match5to6);
  1472. addRegexToken('Hmm', match3to4);
  1473. addRegexToken('Hmmss', match5to6);
  1474. addParseToken(['H', 'HH'], HOUR);
  1475. addParseToken(['a', 'A'], function (input, array, config) {
  1476. config._isPm = config._locale.isPM(input);
  1477. config._meridiem = input;
  1478. });
  1479. addParseToken(['h', 'hh'], function (input, array, config) {
  1480. array[HOUR] = toInt(input);
  1481. getParsingFlags(config).bigHour = true;
  1482. });
  1483. addParseToken('hmm', function (input, array, config) {
  1484. var pos = input.length - 2;
  1485. array[HOUR] = toInt(input.substr(0, pos));
  1486. array[MINUTE] = toInt(input.substr(pos));
  1487. getParsingFlags(config).bigHour = true;
  1488. });
  1489. addParseToken('hmmss', function (input, array, config) {
  1490. var pos1 = input.length - 4;
  1491. var pos2 = input.length - 2;
  1492. array[HOUR] = toInt(input.substr(0, pos1));
  1493. array[MINUTE] = toInt(input.substr(pos1, 2));
  1494. array[SECOND] = toInt(input.substr(pos2));
  1495. getParsingFlags(config).bigHour = true;
  1496. });
  1497. addParseToken('Hmm', function (input, array, config) {
  1498. var pos = input.length - 2;
  1499. array[HOUR] = toInt(input.substr(0, pos));
  1500. array[MINUTE] = toInt(input.substr(pos));
  1501. });
  1502. addParseToken('Hmmss', function (input, array, config) {
  1503. var pos1 = input.length - 4;
  1504. var pos2 = input.length - 2;
  1505. array[HOUR] = toInt(input.substr(0, pos1));
  1506. array[MINUTE] = toInt(input.substr(pos1, 2));
  1507. array[SECOND] = toInt(input.substr(pos2));
  1508. });
  1509. // LOCALES
  1510. function localeIsPM (input) {
  1511. // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays
  1512. // Using charAt should be more compatible.
  1513. return ((input + '').toLowerCase().charAt(0) === 'p');
  1514. }
  1515. var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i;
  1516. function localeMeridiem (hours, minutes, isLower) {
  1517. if (hours > 11) {
  1518. return isLower ? 'pm' : 'PM';
  1519. } else {
  1520. return isLower ? 'am' : 'AM';
  1521. }
  1522. }
  1523. // MOMENTS
  1524. // Setting the hour should keep the time, because the user explicitly
  1525. // specified which hour he wants. So trying to maintain the same hour (in
  1526. // a new timezone) makes sense. Adding/subtracting hours does not follow
  1527. // this rule.
  1528. var getSetHour = makeGetSet('Hours', true);
  1529. // months
  1530. // week
  1531. // weekdays
  1532. // meridiem
  1533. var baseConfig = {
  1534. calendar: defaultCalendar,
  1535. longDateFormat: defaultLongDateFormat,
  1536. invalidDate: defaultInvalidDate,
  1537. ordinal: defaultOrdinal,
  1538. ordinalParse: defaultOrdinalParse,
  1539. relativeTime: defaultRelativeTime,
  1540. months: defaultLocaleMonths,
  1541. monthsShort: defaultLocaleMonthsShort,
  1542. week: defaultLocaleWeek,
  1543. weekdays: defaultLocaleWeekdays,
  1544. weekdaysMin: defaultLocaleWeekdaysMin,
  1545. weekdaysShort: defaultLocaleWeekdaysShort,
  1546. meridiemParse: defaultLocaleMeridiemParse
  1547. };
  1548. // internal storage for locale config files
  1549. var locales = {};
  1550. var localeFamilies = {};
  1551. var globalLocale;
  1552. function normalizeLocale(key) {
  1553. return key ? key.toLowerCase().replace('_', '-') : key;
  1554. }
  1555. // pick the locale from the array
  1556. // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each
  1557. // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root
  1558. function chooseLocale(names) {
  1559. var i = 0, j, next, locale, split;
  1560. while (i < names.length) {
  1561. split = normalizeLocale(names[i]).split('-');
  1562. j = split.length;
  1563. next = normalizeLocale(names[i + 1]);
  1564. next = next ? next.split('-') : null;
  1565. while (j > 0) {
  1566. locale = loadLocale(split.slice(0, j).join('-'));
  1567. if (locale) {
  1568. return locale;
  1569. }
  1570. if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {
  1571. //the next array item is better than a shallower substring of this one
  1572. break;
  1573. }
  1574. j--;
  1575. }
  1576. i++;
  1577. }
  1578. return null;
  1579. }
  1580. function loadLocale(name) {
  1581. var oldLocale = null;
  1582. // TODO: Find a better way to register and load all the locales in Node
  1583. if (!locales[name] && (typeof module !== 'undefined') &&
  1584. module && module.exports) {
  1585. try {
  1586. oldLocale = globalLocale._abbr;
  1587. __webpack_require__(174)("./" + name);
  1588. // because defineLocale currently also sets the global locale, we
  1589. // want to undo that for lazy loaded locales
  1590. getSetGlobalLocale(oldLocale);
  1591. } catch (e) { }
  1592. }
  1593. return locales[name];
  1594. }
  1595. // This function will load locale and then set the global locale. If
  1596. // no arguments are passed in, it will simply return the current global
  1597. // locale key.
  1598. function getSetGlobalLocale (key, values) {
  1599. var data;
  1600. if (key) {
  1601. if (isUndefined(values)) {
  1602. data = getLocale(key);
  1603. }
  1604. else {
  1605. data = defineLocale(key, values);
  1606. }
  1607. if (data) {
  1608. // moment.duration._locale = moment._locale = data;
  1609. globalLocale = data;
  1610. }
  1611. }
  1612. return globalLocale._abbr;
  1613. }
  1614. function defineLocale (name, config) {
  1615. if (config !== null) {
  1616. var parentConfig = baseConfig;
  1617. config.abbr = name;
  1618. if (locales[name] != null) {
  1619. deprecateSimple('defineLocaleOverride',
  1620. 'use moment.updateLocale(localeName, config) to change ' +
  1621. 'an existing locale. moment.defineLocale(localeName, ' +
  1622. 'config) should only be used for creating a new locale ' +
  1623. 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.');
  1624. parentConfig = locales[name]._config;
  1625. } else if (config.parentLocale != null) {
  1626. if (locales[config.parentLocale] != null) {
  1627. parentConfig = locales[config.parentLocale]._config;
  1628. } else {
  1629. if (!localeFamilies[config.parentLocale]) {
  1630. localeFamilies[config.parentLocale] = [];
  1631. }
  1632. localeFamilies[config.parentLocale].push({
  1633. name: name,
  1634. config: config
  1635. });
  1636. return null;
  1637. }
  1638. }
  1639. locales[name] = new Locale(mergeConfigs(parentConfig, config));
  1640. if (localeFamilies[name]) {
  1641. localeFamilies[name].forEach(function (x) {
  1642. defineLocale(x.name, x.config);
  1643. });
  1644. }
  1645. // backwards compat for now: also set the locale
  1646. // make sure we set the locale AFTER all child locales have been
  1647. // created, so we won't end up with the child locale set.
  1648. getSetGlobalLocale(name);
  1649. return locales[name];
  1650. } else {
  1651. // useful for testing
  1652. delete locales[name];
  1653. return null;
  1654. }
  1655. }
  1656. function updateLocale(name, config) {
  1657. if (config != null) {
  1658. var locale, parentConfig = baseConfig;
  1659. // MERGE
  1660. if (locales[name] != null) {
  1661. parentConfig = locales[name]._config;
  1662. }
  1663. config = mergeConfigs(parentConfig, config);
  1664. locale = new Locale(config);
  1665. locale.parentLocale = locales[name];
  1666. locales[name] = locale;
  1667. // backwards compat for now: also set the locale
  1668. getSetGlobalLocale(name);
  1669. } else {
  1670. // pass null for config to unupdate, useful for tests
  1671. if (locales[name] != null) {
  1672. if (locales[name].parentLocale != null) {
  1673. locales[name] = locales[name].parentLocale;
  1674. } else if (locales[name] != null) {
  1675. delete locales[name];
  1676. }
  1677. }
  1678. }
  1679. return locales[name];
  1680. }
  1681. // returns locale data
  1682. function getLocale (key) {
  1683. var locale;
  1684. if (key && key._locale && key._locale._abbr) {
  1685. key = key._locale._abbr;
  1686. }
  1687. if (!key) {
  1688. return globalLocale;
  1689. }
  1690. if (!isArray(key)) {
  1691. //short-circuit everything else
  1692. locale = loadLocale(key);
  1693. if (locale) {
  1694. return locale;
  1695. }
  1696. key = [key];
  1697. }
  1698. return chooseLocale(key);
  1699. }
  1700. function listLocales() {
  1701. return keys$1(locales);
  1702. }
  1703. function checkOverflow (m) {
  1704. var overflow;
  1705. var a = m._a;
  1706. if (a && getParsingFlags(m).overflow === -2) {
  1707. overflow =
  1708. a[MONTH] < 0 || a[MONTH] > 11 ? MONTH :
  1709. a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE :
  1710. a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR :
  1711. a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE :
  1712. a[SECOND] < 0 || a[SECOND] > 59 ? SECOND :
  1713. a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND :
  1714. -1;
  1715. if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {
  1716. overflow = DATE;
  1717. }
  1718. if (getParsingFlags(m)._overflowWeeks && overflow === -1) {
  1719. overflow = WEEK;
  1720. }
  1721. if (getParsingFlags(m)._overflowWeekday && overflow === -1) {
  1722. overflow = WEEKDAY;
  1723. }
  1724. getParsingFlags(m).overflow = overflow;
  1725. }
  1726. return m;
  1727. }
  1728. // iso 8601 regex
  1729. // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)
  1730. var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/;
  1731. var basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/;
  1732. var tzRegex = /Z|[+-]\d\d(?::?\d\d)?/;
  1733. var isoDates = [
  1734. ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/],
  1735. ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/],
  1736. ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/],
  1737. ['GGGG-[W]WW', /\d{4}-W\d\d/, false],
  1738. ['YYYY-DDD', /\d{4}-\d{3}/],
  1739. ['YYYY-MM', /\d{4}-\d\d/, false],
  1740. ['YYYYYYMMDD', /[+-]\d{10}/],
  1741. ['YYYYMMDD', /\d{8}/],
  1742. // YYYYMM is NOT allowed by the standard
  1743. ['GGGG[W]WWE', /\d{4}W\d{3}/],
  1744. ['GGGG[W]WW', /\d{4}W\d{2}/, false],
  1745. ['YYYYDDD', /\d{7}/]
  1746. ];
  1747. // iso time formats and regexes
  1748. var isoTimes = [
  1749. ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/],
  1750. ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/],
  1751. ['HH:mm:ss', /\d\d:\d\d:\d\d/],
  1752. ['HH:mm', /\d\d:\d\d/],
  1753. ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/],
  1754. ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/],
  1755. ['HHmmss', /\d\d\d\d\d\d/],
  1756. ['HHmm', /\d\d\d\d/],
  1757. ['HH', /\d\d/]
  1758. ];
  1759. var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i;
  1760. // date from iso format
  1761. function configFromISO(config) {
  1762. var i, l,
  1763. string = config._i,
  1764. match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),
  1765. allowTime, dateFormat, timeFormat, tzFormat;
  1766. if (match) {
  1767. getParsingFlags(config).iso = true;
  1768. for (i = 0, l = isoDates.length; i < l; i++) {
  1769. if (isoDates[i][1].exec(match[1])) {
  1770. dateFormat = isoDates[i][0];
  1771. allowTime = isoDates[i][2] !== false;
  1772. break;
  1773. }
  1774. }
  1775. if (dateFormat == null) {
  1776. config._isValid = false;
  1777. return;
  1778. }
  1779. if (match[3]) {
  1780. for (i = 0, l = isoTimes.length; i < l; i++) {
  1781. if (isoTimes[i][1].exec(match[3])) {
  1782. // match[2] should be 'T' or space
  1783. timeFormat = (match[2] || ' ') + isoTimes[i][0];
  1784. break;
  1785. }
  1786. }
  1787. if (timeFormat == null) {
  1788. config._isValid = false;
  1789. return;
  1790. }
  1791. }
  1792. if (!allowTime && timeFormat != null) {
  1793. config._isValid = false;
  1794. return;
  1795. }
  1796. if (match[4]) {
  1797. if (tzRegex.exec(match[4])) {
  1798. tzFormat = 'Z';
  1799. } else {
  1800. config._isValid = false;
  1801. return;
  1802. }
  1803. }
  1804. config._f = dateFormat + (timeFormat || '') + (tzFormat || '');
  1805. configFromStringAndFormat(config);
  1806. } else {
  1807. config._isValid = false;
  1808. }
  1809. }
  1810. // date from iso format or fallback
  1811. function configFromString(config) {
  1812. var matched = aspNetJsonRegex.exec(config._i);
  1813. if (matched !== null) {
  1814. config._d = new Date(+matched[1]);
  1815. return;
  1816. }
  1817. configFromISO(config);
  1818. if (config._isValid === false) {
  1819. delete config._isValid;
  1820. hooks.createFromInputFallback(config);
  1821. }
  1822. }
  1823. hooks.createFromInputFallback = deprecate(
  1824. 'value provided is not in a recognized ISO format. moment construction falls back to js Date(), ' +
  1825. 'which is not reliable across all browsers and versions. Non ISO date formats are ' +
  1826. 'discouraged and will be removed in an upcoming major release. Please refer to ' +
  1827. 'http://momentjs.com/guides/#/warnings/js-date/ for more info.',
  1828. function (config) {
  1829. config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));
  1830. }
  1831. );
  1832. // Pick the first defined of two or three arguments.
  1833. function defaults(a, b, c) {
  1834. if (a != null) {
  1835. return a;
  1836. }
  1837. if (b != null) {
  1838. return b;
  1839. }
  1840. return c;
  1841. }
  1842. function currentDateArray(config) {
  1843. // hooks is actually the exported moment object
  1844. var nowValue = new Date(hooks.now());
  1845. if (config._useUTC) {
  1846. return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()];
  1847. }
  1848. return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];
  1849. }
  1850. // convert an array to a date.
  1851. // the array should mirror the parameters below
  1852. // note: all values past the year are optional and will default to the lowest possible value.
  1853. // [year, month, day , hour, minute, second, millisecond]
  1854. function configFromArray (config) {
  1855. var i, date, input = [], currentDate, yearToUse;
  1856. if (config._d) {
  1857. return;
  1858. }
  1859. currentDate = currentDateArray(config);
  1860. //compute day of the year from weeks and weekdays
  1861. if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
  1862. dayOfYearFromWeekInfo(config);
  1863. }
  1864. //if the day of the year is set, figure out what it is
  1865. if (config._dayOfYear) {
  1866. yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);
  1867. if (config._dayOfYear > daysInYear(yearToUse)) {
  1868. getParsingFlags(config)._overflowDayOfYear = true;
  1869. }
  1870. date = createUTCDate(yearToUse, 0, config._dayOfYear);
  1871. config._a[MONTH] = date.getUTCMonth();
  1872. config._a[DATE] = date.getUTCDate();
  1873. }
  1874. // Default to current date.
  1875. // * if no year, month, day of month are given, default to today
  1876. // * if day of month is given, default month and year
  1877. // * if month is given, default only year
  1878. // * if year is given, don't default anything
  1879. for (i = 0; i < 3 && config._a[i] == null; ++i) {
  1880. config._a[i] = input[i] = currentDate[i];
  1881. }
  1882. // Zero out whatever was not defaulted, including time
  1883. for (; i < 7; i++) {
  1884. config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];
  1885. }
  1886. // Check for 24:00:00.000
  1887. if (config._a[HOUR] === 24 &&
  1888. config._a[MINUTE] === 0 &&
  1889. config._a[SECOND] === 0 &&
  1890. config._a[MILLISECOND] === 0) {
  1891. config._nextDay = true;
  1892. config._a[HOUR] = 0;
  1893. }
  1894. config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);
  1895. // Apply timezone offset from input. The actual utcOffset can be changed
  1896. // with parseZone.
  1897. if (config._tzm != null) {
  1898. config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
  1899. }
  1900. if (config._nextDay) {
  1901. config._a[HOUR] = 24;
  1902. }
  1903. }
  1904. function dayOfYearFromWeekInfo(config) {
  1905. var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow;
  1906. w = config._w;
  1907. if (w.GG != null || w.W != null || w.E != null) {
  1908. dow = 1;
  1909. doy = 4;
  1910. // TODO: We need to take the current isoWeekYear, but that depends on
  1911. // how we interpret now (local, utc, fixed offset). So create
  1912. // a now version of current config (take local/utc/offset flags, and
  1913. // create now).
  1914. weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(createLocal(), 1, 4).year);
  1915. week = defaults(w.W, 1);
  1916. weekday = defaults(w.E, 1);
  1917. if (weekday < 1 || weekday > 7) {
  1918. weekdayOverflow = true;
  1919. }
  1920. } else {
  1921. dow = config._locale._week.dow;
  1922. doy = config._locale._week.doy;
  1923. var curWeek = weekOfYear(createLocal(), dow, doy);
  1924. weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);
  1925. // Default to current week.
  1926. week = defaults(w.w, curWeek.week);
  1927. if (w.d != null) {
  1928. // weekday -- low day numbers are considered next week
  1929. weekday = w.d;
  1930. if (weekday < 0 || weekday > 6) {
  1931. weekdayOverflow = true;
  1932. }
  1933. } else if (w.e != null) {
  1934. // local weekday -- counting starts from begining of week
  1935. weekday = w.e + dow;
  1936. if (w.e < 0 || w.e > 6) {
  1937. weekdayOverflow = true;
  1938. }
  1939. } else {
  1940. // default to begining of week
  1941. weekday = dow;
  1942. }
  1943. }
  1944. if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {
  1945. getParsingFlags(config)._overflowWeeks = true;
  1946. } else if (weekdayOverflow != null) {
  1947. getParsingFlags(config)._overflowWeekday = true;
  1948. } else {
  1949. temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);
  1950. config._a[YEAR] = temp.year;
  1951. config._dayOfYear = temp.dayOfYear;
  1952. }
  1953. }
  1954. // constant that refers to the ISO standard
  1955. hooks.ISO_8601 = function () {};
  1956. // date from string and format string
  1957. function configFromStringAndFormat(config) {
  1958. // TODO: Move this to another part of the creation flow to prevent circular deps
  1959. if (config._f === hooks.ISO_8601) {
  1960. configFromISO(config);
  1961. return;
  1962. }
  1963. config._a = [];
  1964. getParsingFlags(config).empty = true;
  1965. // This array is used to make a Date, either with `new Date` or `Date.UTC`
  1966. var string = '' + config._i,
  1967. i, parsedInput, tokens, token, skipped,
  1968. stringLength = string.length,
  1969. totalParsedInputLength = 0;
  1970. tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];
  1971. for (i = 0; i < tokens.length; i++) {
  1972. token = tokens[i];
  1973. parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];
  1974. // console.log('token', token, 'parsedInput', parsedInput,
  1975. // 'regex', getParseRegexForToken(token, config));
  1976. if (parsedInput) {
  1977. skipped = string.substr(0, string.indexOf(parsedInput));
  1978. if (skipped.length > 0) {
  1979. getParsingFlags(config).unusedInput.push(skipped);
  1980. }
  1981. string = string.slice(string.indexOf(parsedInput) + parsedInput.length);
  1982. totalParsedInputLength += parsedInput.length;
  1983. }
  1984. // don't parse if it's not a known token
  1985. if (formatTokenFunctions[token]) {
  1986. if (parsedInput) {
  1987. getParsingFlags(config).empty = false;
  1988. }
  1989. else {
  1990. getParsingFlags(config).unusedTokens.push(token);
  1991. }
  1992. addTimeToArrayFromToken(token, parsedInput, config);
  1993. }
  1994. else if (config._strict && !parsedInput) {
  1995. getParsingFlags(config).unusedTokens.push(token);
  1996. }
  1997. }
  1998. // add remaining unparsed input length to the string
  1999. getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;
  2000. if (string.length > 0) {
  2001. getParsingFlags(config).unusedInput.push(string);
  2002. }
  2003. // clear _12h flag if hour is <= 12
  2004. if (config._a[HOUR] <= 12 &&
  2005. getParsingFlags(config).bigHour === true &&
  2006. config._a[HOUR] > 0) {
  2007. getParsingFlags(config).bigHour = undefined;
  2008. }
  2009. getParsingFlags(config).parsedDateParts = config._a.slice(0);
  2010. getParsingFlags(config).meridiem = config._meridiem;
  2011. // handle meridiem
  2012. config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);
  2013. configFromArray(config);
  2014. checkOverflow(config);
  2015. }
  2016. function meridiemFixWrap (locale, hour, meridiem) {
  2017. var isPm;
  2018. if (meridiem == null) {
  2019. // nothing to do
  2020. return hour;
  2021. }
  2022. if (locale.meridiemHour != null) {
  2023. return locale.meridiemHour(hour, meridiem);
  2024. } else if (locale.isPM != null) {
  2025. // Fallback
  2026. isPm = locale.isPM(meridiem);
  2027. if (isPm && hour < 12) {
  2028. hour += 12;
  2029. }
  2030. if (!isPm && hour === 12) {
  2031. hour = 0;
  2032. }
  2033. return hour;
  2034. } else {
  2035. // this is not supposed to happen
  2036. return hour;
  2037. }
  2038. }
  2039. // date from string and array of format strings
  2040. function configFromStringAndArray(config) {
  2041. var tempConfig,
  2042. bestMoment,
  2043. scoreToBeat,
  2044. i,
  2045. currentScore;
  2046. if (config._f.length === 0) {
  2047. getParsingFlags(config).invalidFormat = true;
  2048. config._d = new Date(NaN);
  2049. return;
  2050. }
  2051. for (i = 0; i < config._f.length; i++) {
  2052. currentScore = 0;
  2053. tempConfig = copyConfig({}, config);
  2054. if (config._useUTC != null) {
  2055. tempConfig._useUTC = config._useUTC;
  2056. }
  2057. tempConfig._f = config._f[i];
  2058. configFromStringAndFormat(tempConfig);
  2059. if (!isValid(tempConfig)) {
  2060. continue;
  2061. }
  2062. // if there is any input that was not parsed add a penalty for that format
  2063. currentScore += getParsingFlags(tempConfig).charsLeftOver;
  2064. //or tokens
  2065. currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;
  2066. getParsingFlags(tempConfig).score = currentScore;
  2067. if (scoreToBeat == null || currentScore < scoreToBeat) {
  2068. scoreToBeat = currentScore;
  2069. bestMoment = tempConfig;
  2070. }
  2071. }
  2072. extend(config, bestMoment || tempConfig);
  2073. }
  2074. function configFromObject(config) {
  2075. if (config._d) {
  2076. return;
  2077. }
  2078. var i = normalizeObjectUnits(config._i);
  2079. config._a = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function (obj) {
  2080. return obj && parseInt(obj, 10);
  2081. });
  2082. configFromArray(config);
  2083. }
  2084. function createFromConfig (config) {
  2085. var res = new Moment(checkOverflow(prepareConfig(config)));
  2086. if (res._nextDay) {
  2087. // Adding is smart enough around DST
  2088. res.add(1, 'd');
  2089. res._nextDay = undefined;
  2090. }
  2091. return res;
  2092. }
  2093. function prepareConfig (config) {
  2094. var input = config._i,
  2095. format = config._f;
  2096. config._locale = config._locale || getLocale(config._l);
  2097. if (input === null || (format === undefined && input === '')) {
  2098. return createInvalid({nullInput: true});
  2099. }
  2100. if (typeof input === 'string') {
  2101. config._i = input = config._locale.preparse(input);
  2102. }
  2103. if (isMoment(input)) {
  2104. return new Moment(checkOverflow(input));
  2105. } else if (isDate(input)) {
  2106. config._d = input;
  2107. } else if (isArray(format)) {
  2108. configFromStringAndArray(config);
  2109. } else if (format) {
  2110. configFromStringAndFormat(config);
  2111. } else {
  2112. configFromInput(config);
  2113. }
  2114. if (!isValid(config)) {
  2115. config._d = null;
  2116. }
  2117. return config;
  2118. }
  2119. function configFromInput(config) {
  2120. var input = config._i;
  2121. if (input === undefined) {
  2122. config._d = new Date(hooks.now());
  2123. } else if (isDate(input)) {
  2124. config._d = new Date(input.valueOf());
  2125. } else if (typeof input === 'string') {
  2126. configFromString(config);
  2127. } else if (isArray(input)) {
  2128. config._a = map(input.slice(0), function (obj) {
  2129. return parseInt(obj, 10);
  2130. });
  2131. configFromArray(config);
  2132. } else if (typeof(input) === 'object') {
  2133. configFromObject(config);
  2134. } else if (isNumber(input)) {
  2135. // from milliseconds
  2136. config._d = new Date(input);
  2137. } else {
  2138. hooks.createFromInputFallback(config);
  2139. }
  2140. }
  2141. function createLocalOrUTC (input, format, locale, strict, isUTC) {
  2142. var c = {};
  2143. if (locale === true || locale === false) {
  2144. strict = locale;
  2145. locale = undefined;
  2146. }
  2147. if ((isObject(input) && isObjectEmpty(input)) ||
  2148. (isArray(input) && input.length === 0)) {
  2149. input = undefined;
  2150. }
  2151. // object construction must be done this way.
  2152. // https://github.com/moment/moment/issues/1423
  2153. c._isAMomentObject = true;
  2154. c._useUTC = c._isUTC = isUTC;
  2155. c._l = locale;
  2156. c._i = input;
  2157. c._f = format;
  2158. c._strict = strict;
  2159. return createFromConfig(c);
  2160. }
  2161. function createLocal (input, format, locale, strict) {
  2162. return createLocalOrUTC(input, format, locale, strict, false);
  2163. }
  2164. var prototypeMin = deprecate(
  2165. 'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/',
  2166. function () {
  2167. var other = createLocal.apply(null, arguments);
  2168. if (this.isValid() && other.isValid()) {
  2169. return other < this ? this : other;
  2170. } else {
  2171. return createInvalid();
  2172. }
  2173. }
  2174. );
  2175. var prototypeMax = deprecate(
  2176. 'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/',
  2177. function () {
  2178. var other = createLocal.apply(null, arguments);
  2179. if (this.isValid() && other.isValid()) {
  2180. return other > this ? this : other;
  2181. } else {
  2182. return createInvalid();
  2183. }
  2184. }
  2185. );
  2186. // Pick a moment m from moments so that m[fn](other) is true for all
  2187. // other. This relies on the function fn to be transitive.
  2188. //
  2189. // moments should either be an array of moment objects or an array, whose
  2190. // first element is an array of moment objects.
  2191. function pickBy(fn, moments) {
  2192. var res, i;
  2193. if (moments.length === 1 && isArray(moments[0])) {
  2194. moments = moments[0];
  2195. }
  2196. if (!moments.length) {
  2197. return createLocal();
  2198. }
  2199. res = moments[0];
  2200. for (i = 1; i < moments.length; ++i) {
  2201. if (!moments[i].isValid() || moments[i][fn](res)) {
  2202. res = moments[i];
  2203. }
  2204. }
  2205. return res;
  2206. }
  2207. // TODO: Use [].sort instead?
  2208. function min () {
  2209. var args = [].slice.call(arguments, 0);
  2210. return pickBy('isBefore', args);
  2211. }
  2212. function max () {
  2213. var args = [].slice.call(arguments, 0);
  2214. return pickBy('isAfter', args);
  2215. }
  2216. var now = function () {
  2217. return Date.now ? Date.now() : +(new Date());
  2218. };
  2219. function Duration (duration) {
  2220. var normalizedInput = normalizeObjectUnits(duration),
  2221. years = normalizedInput.year || 0,
  2222. quarters = normalizedInput.quarter || 0,
  2223. months = normalizedInput.month || 0,
  2224. weeks = normalizedInput.week || 0,
  2225. days = normalizedInput.day || 0,
  2226. hours = normalizedInput.hour || 0,
  2227. minutes = normalizedInput.minute || 0,
  2228. seconds = normalizedInput.second || 0,
  2229. milliseconds = normalizedInput.millisecond || 0;
  2230. // representation for dateAddRemove
  2231. this._milliseconds = +milliseconds +
  2232. seconds * 1e3 + // 1000
  2233. minutes * 6e4 + // 1000 * 60
  2234. hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978
  2235. // Because of dateAddRemove treats 24 hours as different from a
  2236. // day when working around DST, we need to store them separately
  2237. this._days = +days +
  2238. weeks * 7;
  2239. // It is impossible translate months into days without knowing
  2240. // which months you are are talking about, so we have to store
  2241. // it separately.
  2242. this._months = +months +
  2243. quarters * 3 +
  2244. years * 12;
  2245. this._data = {};
  2246. this._locale = getLocale();
  2247. this._bubble();
  2248. }
  2249. function isDuration (obj) {
  2250. return obj instanceof Duration;
  2251. }
  2252. function absRound (number) {
  2253. if (number < 0) {
  2254. return Math.round(-1 * number) * -1;
  2255. } else {
  2256. return Math.round(number);
  2257. }
  2258. }
  2259. // FORMATTING
  2260. function offset (token, separator) {
  2261. addFormatToken(token, 0, 0, function () {
  2262. var offset = this.utcOffset();
  2263. var sign = '+';
  2264. if (offset < 0) {
  2265. offset = -offset;
  2266. sign = '-';
  2267. }
  2268. return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2);
  2269. });
  2270. }
  2271. offset('Z', ':');
  2272. offset('ZZ', '');
  2273. // PARSING
  2274. addRegexToken('Z', matchShortOffset);
  2275. addRegexToken('ZZ', matchShortOffset);
  2276. addParseToken(['Z', 'ZZ'], function (input, array, config) {
  2277. config._useUTC = true;
  2278. config._tzm = offsetFromString(matchShortOffset, input);
  2279. });
  2280. // HELPERS
  2281. // timezone chunker
  2282. // '+10:00' > ['10', '00']
  2283. // '-1530' > ['-15', '30']
  2284. var chunkOffset = /([\+\-]|\d\d)/gi;
  2285. function offsetFromString(matcher, string) {
  2286. var matches = (string || '').match(matcher);
  2287. if (matches === null) {
  2288. return null;
  2289. }
  2290. var chunk = matches[matches.length - 1] || [];
  2291. var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];
  2292. var minutes = +(parts[1] * 60) + toInt(parts[2]);
  2293. return minutes === 0 ?
  2294. 0 :
  2295. parts[0] === '+' ? minutes : -minutes;
  2296. }
  2297. // Return a moment from input, that is local/utc/zone equivalent to model.
  2298. function cloneWithOffset(input, model) {
  2299. var res, diff;
  2300. if (model._isUTC) {
  2301. res = model.clone();
  2302. diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf();
  2303. // Use low-level api, because this fn is low-level api.
  2304. res._d.setTime(res._d.valueOf() + diff);
  2305. hooks.updateOffset(res, false);
  2306. return res;
  2307. } else {
  2308. return createLocal(input).local();
  2309. }
  2310. }
  2311. function getDateOffset (m) {
  2312. // On Firefox.24 Date#getTimezoneOffset returns a floating point.
  2313. // https://github.com/moment/moment/pull/1871
  2314. return -Math.round(m._d.getTimezoneOffset() / 15) * 15;
  2315. }
  2316. // HOOKS
  2317. // This function will be called whenever a moment is mutated.
  2318. // It is intended to keep the offset in sync with the timezone.
  2319. hooks.updateOffset = function () {};
  2320. // MOMENTS
  2321. // keepLocalTime = true means only change the timezone, without
  2322. // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->
  2323. // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset
  2324. // +0200, so we adjust the time as needed, to be valid.
  2325. //
  2326. // Keeping the time actually adds/subtracts (one hour)
  2327. // from the actual represented time. That is why we call updateOffset
  2328. // a second time. In case it wants us to change the offset again
  2329. // _changeInProgress == true case, then we have to adjust, because
  2330. // there is no such time in the given timezone.
  2331. function getSetOffset (input, keepLocalTime) {
  2332. var offset = this._offset || 0,
  2333. localAdjust;
  2334. if (!this.isValid()) {
  2335. return input != null ? this : NaN;
  2336. }
  2337. if (input != null) {
  2338. if (typeof input === 'string') {
  2339. input = offsetFromString(matchShortOffset, input);
  2340. if (input === null) {
  2341. return this;
  2342. }
  2343. } else if (Math.abs(input) < 16) {
  2344. input = input * 60;
  2345. }
  2346. if (!this._isUTC && keepLocalTime) {
  2347. localAdjust = getDateOffset(this);
  2348. }
  2349. this._offset = input;
  2350. this._isUTC = true;
  2351. if (localAdjust != null) {
  2352. this.add(localAdjust, 'm');
  2353. }
  2354. if (offset !== input) {
  2355. if (!keepLocalTime || this._changeInProgress) {
  2356. addSubtract(this, createDuration(input - offset, 'm'), 1, false);
  2357. } else if (!this._changeInProgress) {
  2358. this._changeInProgress = true;
  2359. hooks.updateOffset(this, true);
  2360. this._changeInProgress = null;
  2361. }
  2362. }
  2363. return this;
  2364. } else {
  2365. return this._isUTC ? offset : getDateOffset(this);
  2366. }
  2367. }
  2368. function getSetZone (input, keepLocalTime) {
  2369. if (input != null) {
  2370. if (typeof input !== 'string') {
  2371. input = -input;
  2372. }
  2373. this.utcOffset(input, keepLocalTime);
  2374. return this;
  2375. } else {
  2376. return -this.utcOffset();
  2377. }
  2378. }
  2379. function setOffsetToUTC (keepLocalTime) {
  2380. return this.utcOffset(0, keepLocalTime);
  2381. }
  2382. function setOffsetToLocal (keepLocalTime) {
  2383. if (this._isUTC) {
  2384. this.utcOffset(0, keepLocalTime);
  2385. this._isUTC = false;
  2386. if (keepLocalTime) {
  2387. this.subtract(getDateOffset(this), 'm');
  2388. }
  2389. }
  2390. return this;
  2391. }
  2392. function setOffsetToParsedOffset () {
  2393. if (this._tzm != null) {
  2394. this.utcOffset(this._tzm);
  2395. } else if (typeof this._i === 'string') {
  2396. var tZone = offsetFromString(matchOffset, this._i);
  2397. if (tZone != null) {
  2398. this.utcOffset(tZone);
  2399. }
  2400. else {
  2401. this.utcOffset(0, true);
  2402. }
  2403. }
  2404. return this;
  2405. }
  2406. function hasAlignedHourOffset (input) {
  2407. if (!this.isValid()) {
  2408. return false;
  2409. }
  2410. input = input ? createLocal(input).utcOffset() : 0;
  2411. return (this.utcOffset() - input) % 60 === 0;
  2412. }
  2413. function isDaylightSavingTime () {
  2414. return (
  2415. this.utcOffset() > this.clone().month(0).utcOffset() ||
  2416. this.utcOffset() > this.clone().month(5).utcOffset()
  2417. );
  2418. }
  2419. function isDaylightSavingTimeShifted () {
  2420. if (!isUndefined(this._isDSTShifted)) {
  2421. return this._isDSTShifted;
  2422. }
  2423. var c = {};
  2424. copyConfig(c, this);
  2425. c = prepareConfig(c);
  2426. if (c._a) {
  2427. var other = c._isUTC ? createUTC(c._a) : createLocal(c._a);
  2428. this._isDSTShifted = this.isValid() &&
  2429. compareArrays(c._a, other.toArray()) > 0;
  2430. } else {
  2431. this._isDSTShifted = false;
  2432. }
  2433. return this._isDSTShifted;
  2434. }
  2435. function isLocal () {
  2436. return this.isValid() ? !this._isUTC : false;
  2437. }
  2438. function isUtcOffset () {
  2439. return this.isValid() ? this._isUTC : false;
  2440. }
  2441. function isUtc () {
  2442. return this.isValid() ? this._isUTC && this._offset === 0 : false;
  2443. }
  2444. // ASP.NET json date format regex
  2445. var aspNetRegex = /^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/;
  2446. // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
  2447. // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
  2448. // and further modified to allow for strings containing both week and day
  2449. var isoRegex = /^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;
  2450. function createDuration (input, key) {
  2451. var duration = input,
  2452. // matching against regexp is expensive, do it on demand
  2453. match = null,
  2454. sign,
  2455. ret,
  2456. diffRes;
  2457. if (isDuration(input)) {
  2458. duration = {
  2459. ms : input._milliseconds,
  2460. d : input._days,
  2461. M : input._months
  2462. };
  2463. } else if (isNumber(input)) {
  2464. duration = {};
  2465. if (key) {
  2466. duration[key] = input;
  2467. } else {
  2468. duration.milliseconds = input;
  2469. }
  2470. } else if (!!(match = aspNetRegex.exec(input))) {
  2471. sign = (match[1] === '-') ? -1 : 1;
  2472. duration = {
  2473. y : 0,
  2474. d : toInt(match[DATE]) * sign,
  2475. h : toInt(match[HOUR]) * sign,
  2476. m : toInt(match[MINUTE]) * sign,
  2477. s : toInt(match[SECOND]) * sign,
  2478. ms : toInt(absRound(match[MILLISECOND] * 1000)) * sign // the millisecond decimal point is included in the match
  2479. };
  2480. } else if (!!(match = isoRegex.exec(input))) {
  2481. sign = (match[1] === '-') ? -1 : 1;
  2482. duration = {
  2483. y : parseIso(match[2], sign),
  2484. M : parseIso(match[3], sign),
  2485. w : parseIso(match[4], sign),
  2486. d : parseIso(match[5], sign),
  2487. h : parseIso(match[6], sign),
  2488. m : parseIso(match[7], sign),
  2489. s : parseIso(match[8], sign)
  2490. };
  2491. } else if (duration == null) {// checks for null or undefined
  2492. duration = {};
  2493. } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) {
  2494. diffRes = momentsDifference(createLocal(duration.from), createLocal(duration.to));
  2495. duration = {};
  2496. duration.ms = diffRes.milliseconds;
  2497. duration.M = diffRes.months;
  2498. }
  2499. ret = new Duration(duration);
  2500. if (isDuration(input) && hasOwnProp(input, '_locale')) {
  2501. ret._locale = input._locale;
  2502. }
  2503. return ret;
  2504. }
  2505. createDuration.fn = Duration.prototype;
  2506. function parseIso (inp, sign) {
  2507. // We'd normally use ~~inp for this, but unfortunately it also
  2508. // converts floats to ints.
  2509. // inp may be undefined, so careful calling replace on it.
  2510. var res = inp && parseFloat(inp.replace(',', '.'));
  2511. // apply sign while we're at it
  2512. return (isNaN(res) ? 0 : res) * sign;
  2513. }
  2514. function positiveMomentsDifference(base, other) {
  2515. var res = {milliseconds: 0, months: 0};
  2516. res.months = other.month() - base.month() +
  2517. (other.year() - base.year()) * 12;
  2518. if (base.clone().add(res.months, 'M').isAfter(other)) {
  2519. --res.months;
  2520. }
  2521. res.milliseconds = +other - +(base.clone().add(res.months, 'M'));
  2522. return res;
  2523. }
  2524. function momentsDifference(base, other) {
  2525. var res;
  2526. if (!(base.isValid() && other.isValid())) {
  2527. return {milliseconds: 0, months: 0};
  2528. }
  2529. other = cloneWithOffset(other, base);
  2530. if (base.isBefore(other)) {
  2531. res = positiveMomentsDifference(base, other);
  2532. } else {
  2533. res = positiveMomentsDifference(other, base);
  2534. res.milliseconds = -res.milliseconds;
  2535. res.months = -res.months;
  2536. }
  2537. return res;
  2538. }
  2539. // TODO: remove 'name' arg after deprecation is removed
  2540. function createAdder(direction, name) {
  2541. return function (val, period) {
  2542. var dur, tmp;
  2543. //invert the arguments, but complain about it
  2544. if (period !== null && !isNaN(+period)) {
  2545. deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +
  2546. 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');
  2547. tmp = val; val = period; period = tmp;
  2548. }
  2549. val = typeof val === 'string' ? +val : val;
  2550. dur = createDuration(val, period);
  2551. addSubtract(this, dur, direction);
  2552. return this;
  2553. };
  2554. }
  2555. function addSubtract (mom, duration, isAdding, updateOffset) {
  2556. var milliseconds = duration._milliseconds,
  2557. days = absRound(duration._days),
  2558. months = absRound(duration._months);
  2559. if (!mom.isValid()) {
  2560. // No op
  2561. return;
  2562. }
  2563. updateOffset = updateOffset == null ? true : updateOffset;
  2564. if (milliseconds) {
  2565. mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);
  2566. }
  2567. if (days) {
  2568. set$1(mom, 'Date', get(mom, 'Date') + days * isAdding);
  2569. }
  2570. if (months) {
  2571. setMonth(mom, get(mom, 'Month') + months * isAdding);
  2572. }
  2573. if (updateOffset) {
  2574. hooks.updateOffset(mom, days || months);
  2575. }
  2576. }
  2577. var add = createAdder(1, 'add');
  2578. var subtract = createAdder(-1, 'subtract');
  2579. function getCalendarFormat(myMoment, now) {
  2580. var diff = myMoment.diff(now, 'days', true);
  2581. return diff < -6 ? 'sameElse' :
  2582. diff < -1 ? 'lastWeek' :
  2583. diff < 0 ? 'lastDay' :
  2584. diff < 1 ? 'sameDay' :
  2585. diff < 2 ? 'nextDay' :
  2586. diff < 7 ? 'nextWeek' : 'sameElse';
  2587. }
  2588. function calendar$1 (time, formats) {
  2589. // We want to compare the start of today, vs this.
  2590. // Getting start-of-today depends on whether we're local/utc/offset or not.
  2591. var now = time || createLocal(),
  2592. sod = cloneWithOffset(now, this).startOf('day'),
  2593. format = hooks.calendarFormat(this, sod) || 'sameElse';
  2594. var output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]);
  2595. return this.format(output || this.localeData().calendar(format, this, createLocal(now)));
  2596. }
  2597. function clone () {
  2598. return new Moment(this);
  2599. }
  2600. function isAfter (input, units) {
  2601. var localInput = isMoment(input) ? input : createLocal(input);
  2602. if (!(this.isValid() && localInput.isValid())) {
  2603. return false;
  2604. }
  2605. units = normalizeUnits(!isUndefined(units) ? units : 'millisecond');
  2606. if (units === 'millisecond') {
  2607. return this.valueOf() > localInput.valueOf();
  2608. } else {
  2609. return localInput.valueOf() < this.clone().startOf(units).valueOf();
  2610. }
  2611. }
  2612. function isBefore (input, units) {
  2613. var localInput = isMoment(input) ? input : createLocal(input);
  2614. if (!(this.isValid() && localInput.isValid())) {
  2615. return false;
  2616. }
  2617. units = normalizeUnits(!isUndefined(units) ? units : 'millisecond');
  2618. if (units === 'millisecond') {
  2619. return this.valueOf() < localInput.valueOf();
  2620. } else {
  2621. return this.clone().endOf(units).valueOf() < localInput.valueOf();
  2622. }
  2623. }
  2624. function isBetween (from, to, units, inclusivity) {
  2625. inclusivity = inclusivity || '()';
  2626. return (inclusivity[0] === '(' ? this.isAfter(from, units) : !this.isBefore(from, units)) &&
  2627. (inclusivity[1] === ')' ? this.isBefore(to, units) : !this.isAfter(to, units));
  2628. }
  2629. function isSame (input, units) {
  2630. var localInput = isMoment(input) ? input : createLocal(input),
  2631. inputMs;
  2632. if (!(this.isValid() && localInput.isValid())) {
  2633. return false;
  2634. }
  2635. units = normalizeUnits(units || 'millisecond');
  2636. if (units === 'millisecond') {
  2637. return this.valueOf() === localInput.valueOf();
  2638. } else {
  2639. inputMs = localInput.valueOf();
  2640. return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf();
  2641. }
  2642. }
  2643. function isSameOrAfter (input, units) {
  2644. return this.isSame(input, units) || this.isAfter(input,units);
  2645. }
  2646. function isSameOrBefore (input, units) {
  2647. return this.isSame(input, units) || this.isBefore(input,units);
  2648. }
  2649. function diff (input, units, asFloat) {
  2650. var that,
  2651. zoneDelta,
  2652. delta, output;
  2653. if (!this.isValid()) {
  2654. return NaN;
  2655. }
  2656. that = cloneWithOffset(input, this);
  2657. if (!that.isValid()) {
  2658. return NaN;
  2659. }
  2660. zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;
  2661. units = normalizeUnits(units);
  2662. if (units === 'year' || units === 'month' || units === 'quarter') {
  2663. output = monthDiff(this, that);
  2664. if (units === 'quarter') {
  2665. output = output / 3;
  2666. } else if (units === 'year') {
  2667. output = output / 12;
  2668. }
  2669. } else {
  2670. delta = this - that;
  2671. output = units === 'second' ? delta / 1e3 : // 1000
  2672. units === 'minute' ? delta / 6e4 : // 1000 * 60
  2673. units === 'hour' ? delta / 36e5 : // 1000 * 60 * 60
  2674. units === 'day' ? (delta - zoneDelta) / 864e5 : // 1000 * 60 * 60 * 24, negate dst
  2675. units === 'week' ? (delta - zoneDelta) / 6048e5 : // 1000 * 60 * 60 * 24 * 7, negate dst
  2676. delta;
  2677. }
  2678. return asFloat ? output : absFloor(output);
  2679. }
  2680. function monthDiff (a, b) {
  2681. // difference in months
  2682. var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()),
  2683. // b is in (anchor - 1 month, anchor + 1 month)
  2684. anchor = a.clone().add(wholeMonthDiff, 'months'),
  2685. anchor2, adjust;
  2686. if (b - anchor < 0) {
  2687. anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');
  2688. // linear across the month
  2689. adjust = (b - anchor) / (anchor - anchor2);
  2690. } else {
  2691. anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');
  2692. // linear across the month
  2693. adjust = (b - anchor) / (anchor2 - anchor);
  2694. }
  2695. //check for negative zero, return zero if negative zero
  2696. return -(wholeMonthDiff + adjust) || 0;
  2697. }
  2698. hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';
  2699. hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';
  2700. function toString () {
  2701. return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');
  2702. }
  2703. function toISOString () {
  2704. var m = this.clone().utc();
  2705. if (0 < m.year() && m.year() <= 9999) {
  2706. if (isFunction(Date.prototype.toISOString)) {
  2707. // native implementation is ~50x faster, use it when we can
  2708. return this.toDate().toISOString();
  2709. } else {
  2710. return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
  2711. }
  2712. } else {
  2713. return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
  2714. }
  2715. }
  2716. /**
  2717. * Return a human readable representation of a moment that can
  2718. * also be evaluated to get a new moment which is the same
  2719. *
  2720. * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
  2721. */
  2722. function inspect () {
  2723. if (!this.isValid()) {
  2724. return 'moment.invalid(/* ' + this._i + ' */)';
  2725. }
  2726. var func = 'moment';
  2727. var zone = '';
  2728. if (!this.isLocal()) {
  2729. func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';
  2730. zone = 'Z';
  2731. }
  2732. var prefix = '[' + func + '("]';
  2733. var year = (0 < this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';
  2734. var datetime = '-MM-DD[T]HH:mm:ss.SSS';
  2735. var suffix = zone + '[")]';
  2736. return this.format(prefix + year + datetime + suffix);
  2737. }
  2738. function format (inputString) {
  2739. if (!inputString) {
  2740. inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat;
  2741. }
  2742. var output = formatMoment(this, inputString);
  2743. return this.localeData().postformat(output);
  2744. }
  2745. function from (time, withoutSuffix) {
  2746. if (this.isValid() &&
  2747. ((isMoment(time) && time.isValid()) ||
  2748. createLocal(time).isValid())) {
  2749. return createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix);
  2750. } else {
  2751. return this.localeData().invalidDate();
  2752. }
  2753. }
  2754. function fromNow (withoutSuffix) {
  2755. return this.from(createLocal(), withoutSuffix);
  2756. }
  2757. function to (time, withoutSuffix) {
  2758. if (this.isValid() &&
  2759. ((isMoment(time) && time.isValid()) ||
  2760. createLocal(time).isValid())) {
  2761. return createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix);
  2762. } else {
  2763. return this.localeData().invalidDate();
  2764. }
  2765. }
  2766. function toNow (withoutSuffix) {
  2767. return this.to(createLocal(), withoutSuffix);
  2768. }
  2769. // If passed a locale key, it will set the locale for this
  2770. // instance. Otherwise, it will return the locale configuration
  2771. // variables for this instance.
  2772. function locale (key) {
  2773. var newLocaleData;
  2774. if (key === undefined) {
  2775. return this._locale._abbr;
  2776. } else {
  2777. newLocaleData = getLocale(key);
  2778. if (newLocaleData != null) {
  2779. this._locale = newLocaleData;
  2780. }
  2781. return this;
  2782. }
  2783. }
  2784. var lang = deprecate(
  2785. 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',
  2786. function (key) {
  2787. if (key === undefined) {
  2788. return this.localeData();
  2789. } else {
  2790. return this.locale(key);
  2791. }
  2792. }
  2793. );
  2794. function localeData () {
  2795. return this._locale;
  2796. }
  2797. function startOf (units) {
  2798. units = normalizeUnits(units);
  2799. // the following switch intentionally omits break keywords
  2800. // to utilize falling through the cases.
  2801. switch (units) {
  2802. case 'year':
  2803. this.month(0);
  2804. /* falls through */
  2805. case 'quarter':
  2806. case 'month':
  2807. this.date(1);
  2808. /* falls through */
  2809. case 'week':
  2810. case 'isoWeek':
  2811. case 'day':
  2812. case 'date':
  2813. this.hours(0);
  2814. /* falls through */
  2815. case 'hour':
  2816. this.minutes(0);
  2817. /* falls through */
  2818. case 'minute':
  2819. this.seconds(0);
  2820. /* falls through */
  2821. case 'second':
  2822. this.milliseconds(0);
  2823. }
  2824. // weeks are a special case
  2825. if (units === 'week') {
  2826. this.weekday(0);
  2827. }
  2828. if (units === 'isoWeek') {
  2829. this.isoWeekday(1);
  2830. }
  2831. // quarters are also special
  2832. if (units === 'quarter') {
  2833. this.month(Math.floor(this.month() / 3) * 3);
  2834. }
  2835. return this;
  2836. }
  2837. function endOf (units) {
  2838. units = normalizeUnits(units);
  2839. if (units === undefined || units === 'millisecond') {
  2840. return this;
  2841. }
  2842. // 'date' is an alias for 'day', so it should be considered as such.
  2843. if (units === 'date') {
  2844. units = 'day';
  2845. }
  2846. return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms');
  2847. }
  2848. function valueOf () {
  2849. return this._d.valueOf() - ((this._offset || 0) * 60000);
  2850. }
  2851. function unix () {
  2852. return Math.floor(this.valueOf() / 1000);
  2853. }
  2854. function toDate () {
  2855. return new Date(this.valueOf());
  2856. }
  2857. function toArray () {
  2858. var m = this;
  2859. return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()];
  2860. }
  2861. function toObject () {
  2862. var m = this;
  2863. return {
  2864. years: m.year(),
  2865. months: m.month(),
  2866. date: m.date(),
  2867. hours: m.hours(),
  2868. minutes: m.minutes(),
  2869. seconds: m.seconds(),
  2870. milliseconds: m.milliseconds()
  2871. };
  2872. }
  2873. function toJSON () {
  2874. // new Date(NaN).toJSON() === null
  2875. return this.isValid() ? this.toISOString() : null;
  2876. }
  2877. function isValid$1 () {
  2878. return isValid(this);
  2879. }
  2880. function parsingFlags () {
  2881. return extend({}, getParsingFlags(this));
  2882. }
  2883. function invalidAt () {
  2884. return getParsingFlags(this).overflow;
  2885. }
  2886. function creationData() {
  2887. return {
  2888. input: this._i,
  2889. format: this._f,
  2890. locale: this._locale,
  2891. isUTC: this._isUTC,
  2892. strict: this._strict
  2893. };
  2894. }
  2895. // FORMATTING
  2896. addFormatToken(0, ['gg', 2], 0, function () {
  2897. return this.weekYear() % 100;
  2898. });
  2899. addFormatToken(0, ['GG', 2], 0, function () {
  2900. return this.isoWeekYear() % 100;
  2901. });
  2902. function addWeekYearFormatToken (token, getter) {
  2903. addFormatToken(0, [token, token.length], 0, getter);
  2904. }
  2905. addWeekYearFormatToken('gggg', 'weekYear');
  2906. addWeekYearFormatToken('ggggg', 'weekYear');
  2907. addWeekYearFormatToken('GGGG', 'isoWeekYear');
  2908. addWeekYearFormatToken('GGGGG', 'isoWeekYear');
  2909. // ALIASES
  2910. addUnitAlias('weekYear', 'gg');
  2911. addUnitAlias('isoWeekYear', 'GG');
  2912. // PRIORITY
  2913. addUnitPriority('weekYear', 1);
  2914. addUnitPriority('isoWeekYear', 1);
  2915. // PARSING
  2916. addRegexToken('G', matchSigned);
  2917. addRegexToken('g', matchSigned);
  2918. addRegexToken('GG', match1to2, match2);
  2919. addRegexToken('gg', match1to2, match2);
  2920. addRegexToken('GGGG', match1to4, match4);
  2921. addRegexToken('gggg', match1to4, match4);
  2922. addRegexToken('GGGGG', match1to6, match6);
  2923. addRegexToken('ggggg', match1to6, match6);
  2924. addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) {
  2925. week[token.substr(0, 2)] = toInt(input);
  2926. });
  2927. addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
  2928. week[token] = hooks.parseTwoDigitYear(input);
  2929. });
  2930. // MOMENTS
  2931. function getSetWeekYear (input) {
  2932. return getSetWeekYearHelper.call(this,
  2933. input,
  2934. this.week(),
  2935. this.weekday(),
  2936. this.localeData()._week.dow,
  2937. this.localeData()._week.doy);
  2938. }
  2939. function getSetISOWeekYear (input) {
  2940. return getSetWeekYearHelper.call(this,
  2941. input, this.isoWeek(), this.isoWeekday(), 1, 4);
  2942. }
  2943. function getISOWeeksInYear () {
  2944. return weeksInYear(this.year(), 1, 4);
  2945. }
  2946. function getWeeksInYear () {
  2947. var weekInfo = this.localeData()._week;
  2948. return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
  2949. }
  2950. function getSetWeekYearHelper(input, week, weekday, dow, doy) {
  2951. var weeksTarget;
  2952. if (input == null) {
  2953. return weekOfYear(this, dow, doy).year;
  2954. } else {
  2955. weeksTarget = weeksInYear(input, dow, doy);
  2956. if (week > weeksTarget) {
  2957. week = weeksTarget;
  2958. }
  2959. return setWeekAll.call(this, input, week, weekday, dow, doy);
  2960. }
  2961. }
  2962. function setWeekAll(weekYear, week, weekday, dow, doy) {
  2963. var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),
  2964. date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);
  2965. this.year(date.getUTCFullYear());
  2966. this.month(date.getUTCMonth());
  2967. this.date(date.getUTCDate());
  2968. return this;
  2969. }
  2970. // FORMATTING
  2971. addFormatToken('Q', 0, 'Qo', 'quarter');
  2972. // ALIASES
  2973. addUnitAlias('quarter', 'Q');
  2974. // PRIORITY
  2975. addUnitPriority('quarter', 7);
  2976. // PARSING
  2977. addRegexToken('Q', match1);
  2978. addParseToken('Q', function (input, array) {
  2979. array[MONTH] = (toInt(input) - 1) * 3;
  2980. });
  2981. // MOMENTS
  2982. function getSetQuarter (input) {
  2983. return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);
  2984. }
  2985. // FORMATTING
  2986. addFormatToken('D', ['DD', 2], 'Do', 'date');
  2987. // ALIASES
  2988. addUnitAlias('date', 'D');
  2989. // PRIOROITY
  2990. addUnitPriority('date', 9);
  2991. // PARSING
  2992. addRegexToken('D', match1to2);
  2993. addRegexToken('DD', match1to2, match2);
  2994. addRegexToken('Do', function (isStrict, locale) {
  2995. return isStrict ? locale._ordinalParse : locale._ordinalParseLenient;
  2996. });
  2997. addParseToken(['D', 'DD'], DATE);
  2998. addParseToken('Do', function (input, array) {
  2999. array[DATE] = toInt(input.match(match1to2)[0], 10);
  3000. });
  3001. // MOMENTS
  3002. var getSetDayOfMonth = makeGetSet('Date', true);
  3003. // FORMATTING
  3004. addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');
  3005. // ALIASES
  3006. addUnitAlias('dayOfYear', 'DDD');
  3007. // PRIORITY
  3008. addUnitPriority('dayOfYear', 4);
  3009. // PARSING
  3010. addRegexToken('DDD', match1to3);
  3011. addRegexToken('DDDD', match3);
  3012. addParseToken(['DDD', 'DDDD'], function (input, array, config) {
  3013. config._dayOfYear = toInt(input);
  3014. });
  3015. // HELPERS
  3016. // MOMENTS
  3017. function getSetDayOfYear (input) {
  3018. var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1;
  3019. return input == null ? dayOfYear : this.add((input - dayOfYear), 'd');
  3020. }
  3021. // FORMATTING
  3022. addFormatToken('m', ['mm', 2], 0, 'minute');
  3023. // ALIASES
  3024. addUnitAlias('minute', 'm');
  3025. // PRIORITY
  3026. addUnitPriority('minute', 14);
  3027. // PARSING
  3028. addRegexToken('m', match1to2);
  3029. addRegexToken('mm', match1to2, match2);
  3030. addParseToken(['m', 'mm'], MINUTE);
  3031. // MOMENTS
  3032. var getSetMinute = makeGetSet('Minutes', false);
  3033. // FORMATTING
  3034. addFormatToken('s', ['ss', 2], 0, 'second');
  3035. // ALIASES
  3036. addUnitAlias('second', 's');
  3037. // PRIORITY
  3038. addUnitPriority('second', 15);
  3039. // PARSING
  3040. addRegexToken('s', match1to2);
  3041. addRegexToken('ss', match1to2, match2);
  3042. addParseToken(['s', 'ss'], SECOND);
  3043. // MOMENTS
  3044. var getSetSecond = makeGetSet('Seconds', false);
  3045. // FORMATTING
  3046. addFormatToken('S', 0, 0, function () {
  3047. return ~~(this.millisecond() / 100);
  3048. });
  3049. addFormatToken(0, ['SS', 2], 0, function () {
  3050. return ~~(this.millisecond() / 10);
  3051. });
  3052. addFormatToken(0, ['SSS', 3], 0, 'millisecond');
  3053. addFormatToken(0, ['SSSS', 4], 0, function () {
  3054. return this.millisecond() * 10;
  3055. });
  3056. addFormatToken(0, ['SSSSS', 5], 0, function () {
  3057. return this.millisecond() * 100;
  3058. });
  3059. addFormatToken(0, ['SSSSSS', 6], 0, function () {
  3060. return this.millisecond() * 1000;
  3061. });
  3062. addFormatToken(0, ['SSSSSSS', 7], 0, function () {
  3063. return this.millisecond() * 10000;
  3064. });
  3065. addFormatToken(0, ['SSSSSSSS', 8], 0, function () {
  3066. return this.millisecond() * 100000;
  3067. });
  3068. addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {
  3069. return this.millisecond() * 1000000;
  3070. });
  3071. // ALIASES
  3072. addUnitAlias('millisecond', 'ms');
  3073. // PRIORITY
  3074. addUnitPriority('millisecond', 16);
  3075. // PARSING
  3076. addRegexToken('S', match1to3, match1);
  3077. addRegexToken('SS', match1to3, match2);
  3078. addRegexToken('SSS', match1to3, match3);
  3079. var token;
  3080. for (token = 'SSSS'; token.length <= 9; token += 'S') {
  3081. addRegexToken(token, matchUnsigned);
  3082. }
  3083. function parseMs(input, array) {
  3084. array[MILLISECOND] = toInt(('0.' + input) * 1000);
  3085. }
  3086. for (token = 'S'; token.length <= 9; token += 'S') {
  3087. addParseToken(token, parseMs);
  3088. }
  3089. // MOMENTS
  3090. var getSetMillisecond = makeGetSet('Milliseconds', false);
  3091. // FORMATTING
  3092. addFormatToken('z', 0, 0, 'zoneAbbr');
  3093. addFormatToken('zz', 0, 0, 'zoneName');
  3094. // MOMENTS
  3095. function getZoneAbbr () {
  3096. return this._isUTC ? 'UTC' : '';
  3097. }
  3098. function getZoneName () {
  3099. return this._isUTC ? 'Coordinated Universal Time' : '';
  3100. }
  3101. var proto = Moment.prototype;
  3102. proto.add = add;
  3103. proto.calendar = calendar$1;
  3104. proto.clone = clone;
  3105. proto.diff = diff;
  3106. proto.endOf = endOf;
  3107. proto.format = format;
  3108. proto.from = from;
  3109. proto.fromNow = fromNow;
  3110. proto.to = to;
  3111. proto.toNow = toNow;
  3112. proto.get = stringGet;
  3113. proto.invalidAt = invalidAt;
  3114. proto.isAfter = isAfter;
  3115. proto.isBefore = isBefore;
  3116. proto.isBetween = isBetween;
  3117. proto.isSame = isSame;
  3118. proto.isSameOrAfter = isSameOrAfter;
  3119. proto.isSameOrBefore = isSameOrBefore;
  3120. proto.isValid = isValid$1;
  3121. proto.lang = lang;
  3122. proto.locale = locale;
  3123. proto.localeData = localeData;
  3124. proto.max = prototypeMax;
  3125. proto.min = prototypeMin;
  3126. proto.parsingFlags = parsingFlags;
  3127. proto.set = stringSet;
  3128. proto.startOf = startOf;
  3129. proto.subtract = subtract;
  3130. proto.toArray = toArray;
  3131. proto.toObject = toObject;
  3132. proto.toDate = toDate;
  3133. proto.toISOString = toISOString;
  3134. proto.inspect = inspect;
  3135. proto.toJSON = toJSON;
  3136. proto.toString = toString;
  3137. proto.unix = unix;
  3138. proto.valueOf = valueOf;
  3139. proto.creationData = creationData;
  3140. // Year
  3141. proto.year = getSetYear;
  3142. proto.isLeapYear = getIsLeapYear;
  3143. // Week Year
  3144. proto.weekYear = getSetWeekYear;
  3145. proto.isoWeekYear = getSetISOWeekYear;
  3146. // Quarter
  3147. proto.quarter = proto.quarters = getSetQuarter;
  3148. // Month
  3149. proto.month = getSetMonth;
  3150. proto.daysInMonth = getDaysInMonth;
  3151. // Week
  3152. proto.week = proto.weeks = getSetWeek;
  3153. proto.isoWeek = proto.isoWeeks = getSetISOWeek;
  3154. proto.weeksInYear = getWeeksInYear;
  3155. proto.isoWeeksInYear = getISOWeeksInYear;
  3156. // Day
  3157. proto.date = getSetDayOfMonth;
  3158. proto.day = proto.days = getSetDayOfWeek;
  3159. proto.weekday = getSetLocaleDayOfWeek;
  3160. proto.isoWeekday = getSetISODayOfWeek;
  3161. proto.dayOfYear = getSetDayOfYear;
  3162. // Hour
  3163. proto.hour = proto.hours = getSetHour;
  3164. // Minute
  3165. proto.minute = proto.minutes = getSetMinute;
  3166. // Second
  3167. proto.second = proto.seconds = getSetSecond;
  3168. // Millisecond
  3169. proto.millisecond = proto.milliseconds = getSetMillisecond;
  3170. // Offset
  3171. proto.utcOffset = getSetOffset;
  3172. proto.utc = setOffsetToUTC;
  3173. proto.local = setOffsetToLocal;
  3174. proto.parseZone = setOffsetToParsedOffset;
  3175. proto.hasAlignedHourOffset = hasAlignedHourOffset;
  3176. proto.isDST = isDaylightSavingTime;
  3177. proto.isLocal = isLocal;
  3178. proto.isUtcOffset = isUtcOffset;
  3179. proto.isUtc = isUtc;
  3180. proto.isUTC = isUtc;
  3181. // Timezone
  3182. proto.zoneAbbr = getZoneAbbr;
  3183. proto.zoneName = getZoneName;
  3184. // Deprecations
  3185. proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth);
  3186. proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth);
  3187. proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear);
  3188. proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', getSetZone);
  3189. proto.isDSTShifted = deprecate('isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', isDaylightSavingTimeShifted);
  3190. function createUnix (input) {
  3191. return createLocal(input * 1000);
  3192. }
  3193. function createInZone () {
  3194. return createLocal.apply(null, arguments).parseZone();
  3195. }
  3196. function preParsePostFormat (string) {
  3197. return string;
  3198. }
  3199. var proto$1 = Locale.prototype;
  3200. proto$1.calendar = calendar;
  3201. proto$1.longDateFormat = longDateFormat;
  3202. proto$1.invalidDate = invalidDate;
  3203. proto$1.ordinal = ordinal;
  3204. proto$1.preparse = preParsePostFormat;
  3205. proto$1.postformat = preParsePostFormat;
  3206. proto$1.relativeTime = relativeTime;
  3207. proto$1.pastFuture = pastFuture;
  3208. proto$1.set = set;
  3209. // Month
  3210. proto$1.months = localeMonths;
  3211. proto$1.monthsShort = localeMonthsShort;
  3212. proto$1.monthsParse = localeMonthsParse;
  3213. proto$1.monthsRegex = monthsRegex;
  3214. proto$1.monthsShortRegex = monthsShortRegex;
  3215. // Week
  3216. proto$1.week = localeWeek;
  3217. proto$1.firstDayOfYear = localeFirstDayOfYear;
  3218. proto$1.firstDayOfWeek = localeFirstDayOfWeek;
  3219. // Day of Week
  3220. proto$1.weekdays = localeWeekdays;
  3221. proto$1.weekdaysMin = localeWeekdaysMin;
  3222. proto$1.weekdaysShort = localeWeekdaysShort;
  3223. proto$1.weekdaysParse = localeWeekdaysParse;
  3224. proto$1.weekdaysRegex = weekdaysRegex;
  3225. proto$1.weekdaysShortRegex = weekdaysShortRegex;
  3226. proto$1.weekdaysMinRegex = weekdaysMinRegex;
  3227. // Hours
  3228. proto$1.isPM = localeIsPM;
  3229. proto$1.meridiem = localeMeridiem;
  3230. function get$1 (format, index, field, setter) {
  3231. var locale = getLocale();
  3232. var utc = createUTC().set(setter, index);
  3233. return locale[field](utc, format);
  3234. }
  3235. function listMonthsImpl (format, index, field) {
  3236. if (isNumber(format)) {
  3237. index = format;
  3238. format = undefined;
  3239. }
  3240. format = format || '';
  3241. if (index != null) {
  3242. return get$1(format, index, field, 'month');
  3243. }
  3244. var i;
  3245. var out = [];
  3246. for (i = 0; i < 12; i++) {
  3247. out[i] = get$1(format, i, field, 'month');
  3248. }
  3249. return out;
  3250. }
  3251. // ()
  3252. // (5)
  3253. // (fmt, 5)
  3254. // (fmt)
  3255. // (true)
  3256. // (true, 5)
  3257. // (true, fmt, 5)
  3258. // (true, fmt)
  3259. function listWeekdaysImpl (localeSorted, format, index, field) {
  3260. if (typeof localeSorted === 'boolean') {
  3261. if (isNumber(format)) {
  3262. index = format;
  3263. format = undefined;
  3264. }
  3265. format = format || '';
  3266. } else {
  3267. format = localeSorted;
  3268. index = format;
  3269. localeSorted = false;
  3270. if (isNumber(format)) {
  3271. index = format;
  3272. format = undefined;
  3273. }
  3274. format = format || '';
  3275. }
  3276. var locale = getLocale(),
  3277. shift = localeSorted ? locale._week.dow : 0;
  3278. if (index != null) {
  3279. return get$1(format, (index + shift) % 7, field, 'day');
  3280. }
  3281. var i;
  3282. var out = [];
  3283. for (i = 0; i < 7; i++) {
  3284. out[i] = get$1(format, (i + shift) % 7, field, 'day');
  3285. }
  3286. return out;
  3287. }
  3288. function listMonths (format, index) {
  3289. return listMonthsImpl(format, index, 'months');
  3290. }
  3291. function listMonthsShort (format, index) {
  3292. return listMonthsImpl(format, index, 'monthsShort');
  3293. }
  3294. function listWeekdays (localeSorted, format, index) {
  3295. return listWeekdaysImpl(localeSorted, format, index, 'weekdays');
  3296. }
  3297. function listWeekdaysShort (localeSorted, format, index) {
  3298. return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');
  3299. }
  3300. function listWeekdaysMin (localeSorted, format, index) {
  3301. return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');
  3302. }
  3303. getSetGlobalLocale('en', {
  3304. ordinalParse: /\d{1,2}(th|st|nd|rd)/,
  3305. ordinal : function (number) {
  3306. var b = number % 10,
  3307. output = (toInt(number % 100 / 10) === 1) ? 'th' :
  3308. (b === 1) ? 'st' :
  3309. (b === 2) ? 'nd' :
  3310. (b === 3) ? 'rd' : 'th';
  3311. return number + output;
  3312. }
  3313. });
  3314. // Side effect imports
  3315. hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', getSetGlobalLocale);
  3316. hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', getLocale);
  3317. var mathAbs = Math.abs;
  3318. function abs () {
  3319. var data = this._data;
  3320. this._milliseconds = mathAbs(this._milliseconds);
  3321. this._days = mathAbs(this._days);
  3322. this._months = mathAbs(this._months);
  3323. data.milliseconds = mathAbs(data.milliseconds);
  3324. data.seconds = mathAbs(data.seconds);
  3325. data.minutes = mathAbs(data.minutes);
  3326. data.hours = mathAbs(data.hours);
  3327. data.months = mathAbs(data.months);
  3328. data.years = mathAbs(data.years);
  3329. return this;
  3330. }
  3331. function addSubtract$1 (duration, input, value, direction) {
  3332. var other = createDuration(input, value);
  3333. duration._milliseconds += direction * other._milliseconds;
  3334. duration._days += direction * other._days;
  3335. duration._months += direction * other._months;
  3336. return duration._bubble();
  3337. }
  3338. // supports only 2.0-style add(1, 's') or add(duration)
  3339. function add$1 (input, value) {
  3340. return addSubtract$1(this, input, value, 1);
  3341. }
  3342. // supports only 2.0-style subtract(1, 's') or subtract(duration)
  3343. function subtract$1 (input, value) {
  3344. return addSubtract$1(this, input, value, -1);
  3345. }
  3346. function absCeil (number) {
  3347. if (number < 0) {
  3348. return Math.floor(number);
  3349. } else {
  3350. return Math.ceil(number);
  3351. }
  3352. }
  3353. function bubble () {
  3354. var milliseconds = this._milliseconds;
  3355. var days = this._days;
  3356. var months = this._months;
  3357. var data = this._data;
  3358. var seconds, minutes, hours, years, monthsFromDays;
  3359. // if we have a mix of positive and negative values, bubble down first
  3360. // check: https://github.com/moment/moment/issues/2166
  3361. if (!((milliseconds >= 0 && days >= 0 && months >= 0) ||
  3362. (milliseconds <= 0 && days <= 0 && months <= 0))) {
  3363. milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
  3364. days = 0;
  3365. months = 0;
  3366. }
  3367. // The following code bubbles up values, see the tests for
  3368. // examples of what that means.
  3369. data.milliseconds = milliseconds % 1000;
  3370. seconds = absFloor(milliseconds / 1000);
  3371. data.seconds = seconds % 60;
  3372. minutes = absFloor(seconds / 60);
  3373. data.minutes = minutes % 60;
  3374. hours = absFloor(minutes / 60);
  3375. data.hours = hours % 24;
  3376. days += absFloor(hours / 24);
  3377. // convert days to months
  3378. monthsFromDays = absFloor(daysToMonths(days));
  3379. months += monthsFromDays;
  3380. days -= absCeil(monthsToDays(monthsFromDays));
  3381. // 12 months -> 1 year
  3382. years = absFloor(months / 12);
  3383. months %= 12;
  3384. data.days = days;
  3385. data.months = months;
  3386. data.years = years;
  3387. return this;
  3388. }
  3389. function daysToMonths (days) {
  3390. // 400 years have 146097 days (taking into account leap year rules)
  3391. // 400 years have 12 months === 4800
  3392. return days * 4800 / 146097;
  3393. }
  3394. function monthsToDays (months) {
  3395. // the reverse of daysToMonths
  3396. return months * 146097 / 4800;
  3397. }
  3398. function as (units) {
  3399. var days;
  3400. var months;
  3401. var milliseconds = this._milliseconds;
  3402. units = normalizeUnits(units);
  3403. if (units === 'month' || units === 'year') {
  3404. days = this._days + milliseconds / 864e5;
  3405. months = this._months + daysToMonths(days);
  3406. return units === 'month' ? months : months / 12;
  3407. } else {
  3408. // handle milliseconds separately because of floating point math errors (issue #1867)
  3409. days = this._days + Math.round(monthsToDays(this._months));
  3410. switch (units) {
  3411. case 'week' : return days / 7 + milliseconds / 6048e5;
  3412. case 'day' : return days + milliseconds / 864e5;
  3413. case 'hour' : return days * 24 + milliseconds / 36e5;
  3414. case 'minute' : return days * 1440 + milliseconds / 6e4;
  3415. case 'second' : return days * 86400 + milliseconds / 1000;
  3416. // Math.floor prevents floating point math errors here
  3417. case 'millisecond': return Math.floor(days * 864e5) + milliseconds;
  3418. default: throw new Error('Unknown unit ' + units);
  3419. }
  3420. }
  3421. }
  3422. // TODO: Use this.as('ms')?
  3423. function valueOf$1 () {
  3424. return (
  3425. this._milliseconds +
  3426. this._days * 864e5 +
  3427. (this._months % 12) * 2592e6 +
  3428. toInt(this._months / 12) * 31536e6
  3429. );
  3430. }
  3431. function makeAs (alias) {
  3432. return function () {
  3433. return this.as(alias);
  3434. };
  3435. }
  3436. var asMilliseconds = makeAs('ms');
  3437. var asSeconds = makeAs('s');
  3438. var asMinutes = makeAs('m');
  3439. var asHours = makeAs('h');
  3440. var asDays = makeAs('d');
  3441. var asWeeks = makeAs('w');
  3442. var asMonths = makeAs('M');
  3443. var asYears = makeAs('y');
  3444. function get$2 (units) {
  3445. units = normalizeUnits(units);
  3446. return this[units + 's']();
  3447. }
  3448. function makeGetter(name) {
  3449. return function () {
  3450. return this._data[name];
  3451. };
  3452. }
  3453. var milliseconds = makeGetter('milliseconds');
  3454. var seconds = makeGetter('seconds');
  3455. var minutes = makeGetter('minutes');
  3456. var hours = makeGetter('hours');
  3457. var days = makeGetter('days');
  3458. var months = makeGetter('months');
  3459. var years = makeGetter('years');
  3460. function weeks () {
  3461. return absFloor(this.days() / 7);
  3462. }
  3463. var round = Math.round;
  3464. var thresholds = {
  3465. s: 45, // seconds to minute
  3466. m: 45, // minutes to hour
  3467. h: 22, // hours to day
  3468. d: 26, // days to month
  3469. M: 11 // months to year
  3470. };
  3471. // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
  3472. function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
  3473. return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
  3474. }
  3475. function relativeTime$1 (posNegDuration, withoutSuffix, locale) {
  3476. var duration = createDuration(posNegDuration).abs();
  3477. var seconds = round(duration.as('s'));
  3478. var minutes = round(duration.as('m'));
  3479. var hours = round(duration.as('h'));
  3480. var days = round(duration.as('d'));
  3481. var months = round(duration.as('M'));
  3482. var years = round(duration.as('y'));
  3483. var a = seconds < thresholds.s && ['s', seconds] ||
  3484. minutes <= 1 && ['m'] ||
  3485. minutes < thresholds.m && ['mm', minutes] ||
  3486. hours <= 1 && ['h'] ||
  3487. hours < thresholds.h && ['hh', hours] ||
  3488. days <= 1 && ['d'] ||
  3489. days < thresholds.d && ['dd', days] ||
  3490. months <= 1 && ['M'] ||
  3491. months < thresholds.M && ['MM', months] ||
  3492. years <= 1 && ['y'] || ['yy', years];
  3493. a[2] = withoutSuffix;
  3494. a[3] = +posNegDuration > 0;
  3495. a[4] = locale;
  3496. return substituteTimeAgo.apply(null, a);
  3497. }
  3498. // This function allows you to set the rounding function for relative time strings
  3499. function getSetRelativeTimeRounding (roundingFunction) {
  3500. if (roundingFunction === undefined) {
  3501. return round;
  3502. }
  3503. if (typeof(roundingFunction) === 'function') {
  3504. round = roundingFunction;
  3505. return true;
  3506. }
  3507. return false;
  3508. }
  3509. // This function allows you to set a threshold for relative time strings
  3510. function getSetRelativeTimeThreshold (threshold, limit) {
  3511. if (thresholds[threshold] === undefined) {
  3512. return false;
  3513. }
  3514. if (limit === undefined) {
  3515. return thresholds[threshold];
  3516. }
  3517. thresholds[threshold] = limit;
  3518. return true;
  3519. }
  3520. function humanize (withSuffix) {
  3521. var locale = this.localeData();
  3522. var output = relativeTime$1(this, !withSuffix, locale);
  3523. if (withSuffix) {
  3524. output = locale.pastFuture(+this, output);
  3525. }
  3526. return locale.postformat(output);
  3527. }
  3528. var abs$1 = Math.abs;
  3529. function toISOString$1() {
  3530. // for ISO strings we do not use the normal bubbling rules:
  3531. // * milliseconds bubble up until they become hours
  3532. // * days do not bubble at all
  3533. // * months bubble up until they become years
  3534. // This is because there is no context-free conversion between hours and days
  3535. // (think of clock changes)
  3536. // and also not between days and months (28-31 days per month)
  3537. var seconds = abs$1(this._milliseconds) / 1000;
  3538. var days = abs$1(this._days);
  3539. var months = abs$1(this._months);
  3540. var minutes, hours, years;
  3541. // 3600 seconds -> 60 minutes -> 1 hour
  3542. minutes = absFloor(seconds / 60);
  3543. hours = absFloor(minutes / 60);
  3544. seconds %= 60;
  3545. minutes %= 60;
  3546. // 12 months -> 1 year
  3547. years = absFloor(months / 12);
  3548. months %= 12;
  3549. // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js
  3550. var Y = years;
  3551. var M = months;
  3552. var D = days;
  3553. var h = hours;
  3554. var m = minutes;
  3555. var s = seconds;
  3556. var total = this.asSeconds();
  3557. if (!total) {
  3558. // this is the same as C#'s (Noda) and python (isodate)...
  3559. // but not other JS (goog.date)
  3560. return 'P0D';
  3561. }
  3562. return (total < 0 ? '-' : '') +
  3563. 'P' +
  3564. (Y ? Y + 'Y' : '') +
  3565. (M ? M + 'M' : '') +
  3566. (D ? D + 'D' : '') +
  3567. ((h || m || s) ? 'T' : '') +
  3568. (h ? h + 'H' : '') +
  3569. (m ? m + 'M' : '') +
  3570. (s ? s + 'S' : '');
  3571. }
  3572. var proto$2 = Duration.prototype;
  3573. proto$2.abs = abs;
  3574. proto$2.add = add$1;
  3575. proto$2.subtract = subtract$1;
  3576. proto$2.as = as;
  3577. proto$2.asMilliseconds = asMilliseconds;
  3578. proto$2.asSeconds = asSeconds;
  3579. proto$2.asMinutes = asMinutes;
  3580. proto$2.asHours = asHours;
  3581. proto$2.asDays = asDays;
  3582. proto$2.asWeeks = asWeeks;
  3583. proto$2.asMonths = asMonths;
  3584. proto$2.asYears = asYears;
  3585. proto$2.valueOf = valueOf$1;
  3586. proto$2._bubble = bubble;
  3587. proto$2.get = get$2;
  3588. proto$2.milliseconds = milliseconds;
  3589. proto$2.seconds = seconds;
  3590. proto$2.minutes = minutes;
  3591. proto$2.hours = hours;
  3592. proto$2.days = days;
  3593. proto$2.weeks = weeks;
  3594. proto$2.months = months;
  3595. proto$2.years = years;
  3596. proto$2.humanize = humanize;
  3597. proto$2.toISOString = toISOString$1;
  3598. proto$2.toString = toISOString$1;
  3599. proto$2.toJSON = toISOString$1;
  3600. proto$2.locale = locale;
  3601. proto$2.localeData = localeData;
  3602. // Deprecations
  3603. proto$2.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', toISOString$1);
  3604. proto$2.lang = lang;
  3605. // Side effect imports
  3606. // FORMATTING
  3607. addFormatToken('X', 0, 0, 'unix');
  3608. addFormatToken('x', 0, 0, 'valueOf');
  3609. // PARSING
  3610. addRegexToken('x', matchSigned);
  3611. addRegexToken('X', matchTimestamp);
  3612. addParseToken('X', function (input, array, config) {
  3613. config._d = new Date(parseFloat(input, 10) * 1000);
  3614. });
  3615. addParseToken('x', function (input, array, config) {
  3616. config._d = new Date(toInt(input));
  3617. });
  3618. // Side effect imports
  3619. hooks.version = '2.17.1';
  3620. setHookCallback(createLocal);
  3621. hooks.fn = proto;
  3622. hooks.min = min;
  3623. hooks.max = max;
  3624. hooks.now = now;
  3625. hooks.utc = createUTC;
  3626. hooks.unix = createUnix;
  3627. hooks.months = listMonths;
  3628. hooks.isDate = isDate;
  3629. hooks.locale = getSetGlobalLocale;
  3630. hooks.invalid = createInvalid;
  3631. hooks.duration = createDuration;
  3632. hooks.isMoment = isMoment;
  3633. hooks.weekdays = listWeekdays;
  3634. hooks.parseZone = createInZone;
  3635. hooks.localeData = getLocale;
  3636. hooks.isDuration = isDuration;
  3637. hooks.monthsShort = listMonthsShort;
  3638. hooks.weekdaysMin = listWeekdaysMin;
  3639. hooks.defineLocale = defineLocale;
  3640. hooks.updateLocale = updateLocale;
  3641. hooks.locales = listLocales;
  3642. hooks.weekdaysShort = listWeekdaysShort;
  3643. hooks.normalizeUnits = normalizeUnits;
  3644. hooks.relativeTimeRounding = getSetRelativeTimeRounding;
  3645. hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;
  3646. hooks.calendarFormat = getCalendarFormat;
  3647. hooks.prototype = proto;
  3648. return hooks;
  3649. })));
  3650. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(191)(module)))
  3651. /***/ }),
  3652. /* 1 */
  3653. /***/ (function(module, exports) {
  3654. module.exports = function normalizeComponent (
  3655. rawScriptExports,
  3656. compiledTemplate,
  3657. scopeId,
  3658. cssModules
  3659. ) {
  3660. var esModule
  3661. var scriptExports = rawScriptExports = rawScriptExports || {}
  3662. // ES6 modules interop
  3663. var type = typeof rawScriptExports.default
  3664. if (type === 'object' || type === 'function') {
  3665. esModule = rawScriptExports
  3666. scriptExports = rawScriptExports.default
  3667. }
  3668. // Vue.extend constructor export interop
  3669. var options = typeof scriptExports === 'function'
  3670. ? scriptExports.options
  3671. : scriptExports
  3672. // render functions
  3673. if (compiledTemplate) {
  3674. options.render = compiledTemplate.render
  3675. options.staticRenderFns = compiledTemplate.staticRenderFns
  3676. }
  3677. // scopedId
  3678. if (scopeId) {
  3679. options._scopeId = scopeId
  3680. }
  3681. // inject cssModules
  3682. if (cssModules) {
  3683. var computed = options.computed || (options.computed = {})
  3684. Object.keys(cssModules).forEach(function (key) {
  3685. var module = cssModules[key]
  3686. computed[key] = function () { return module }
  3687. })
  3688. }
  3689. return {
  3690. esModule: esModule,
  3691. exports: scriptExports,
  3692. options: options
  3693. }
  3694. }
  3695. /***/ }),
  3696. /* 2 */
  3697. /***/ (function(module, exports, __webpack_require__) {
  3698. var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
  3699. * jQuery JavaScript Library v3.1.1
  3700. * https://jquery.com/
  3701. *
  3702. * Includes Sizzle.js
  3703. * https://sizzlejs.com/
  3704. *
  3705. * Copyright jQuery Foundation and other contributors
  3706. * Released under the MIT license
  3707. * https://jquery.org/license
  3708. *
  3709. * Date: 2016-09-22T22:30Z
  3710. */
  3711. ( function( global, factory ) {
  3712. "use strict";
  3713. if ( typeof module === "object" && typeof module.exports === "object" ) {
  3714. // For CommonJS and CommonJS-like environments where a proper `window`
  3715. // is present, execute the factory and get jQuery.
  3716. // For environments that do not have a `window` with a `document`
  3717. // (such as Node.js), expose a factory as module.exports.
  3718. // This accentuates the need for the creation of a real `window`.
  3719. // e.g. var jQuery = require("jquery")(window);
  3720. // See ticket #14549 for more info.
  3721. module.exports = global.document ?
  3722. factory( global, true ) :
  3723. function( w ) {
  3724. if ( !w.document ) {
  3725. throw new Error( "jQuery requires a window with a document" );
  3726. }
  3727. return factory( w );
  3728. };
  3729. } else {
  3730. factory( global );
  3731. }
  3732. // Pass this if window is not defined yet
  3733. } )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
  3734. // Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1
  3735. // throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode
  3736. // arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common
  3737. // enough that all such attempts are guarded in a try block.
  3738. "use strict";
  3739. var arr = [];
  3740. var document = window.document;
  3741. var getProto = Object.getPrototypeOf;
  3742. var slice = arr.slice;
  3743. var concat = arr.concat;
  3744. var push = arr.push;
  3745. var indexOf = arr.indexOf;
  3746. var class2type = {};
  3747. var toString = class2type.toString;
  3748. var hasOwn = class2type.hasOwnProperty;
  3749. var fnToString = hasOwn.toString;
  3750. var ObjectFunctionString = fnToString.call( Object );
  3751. var support = {};
  3752. function DOMEval( code, doc ) {
  3753. doc = doc || document;
  3754. var script = doc.createElement( "script" );
  3755. script.text = code;
  3756. doc.head.appendChild( script ).parentNode.removeChild( script );
  3757. }
  3758. /* global Symbol */
  3759. // Defining this global in .eslintrc.json would create a danger of using the global
  3760. // unguarded in another place, it seems safer to define global only for this module
  3761. var
  3762. version = "3.1.1",
  3763. // Define a local copy of jQuery
  3764. jQuery = function( selector, context ) {
  3765. // The jQuery object is actually just the init constructor 'enhanced'
  3766. // Need init if jQuery is called (just allow error to be thrown if not included)
  3767. return new jQuery.fn.init( selector, context );
  3768. },
  3769. // Support: Android <=4.0 only
  3770. // Make sure we trim BOM and NBSP
  3771. rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
  3772. // Matches dashed string for camelizing
  3773. rmsPrefix = /^-ms-/,
  3774. rdashAlpha = /-([a-z])/g,
  3775. // Used by jQuery.camelCase as callback to replace()
  3776. fcamelCase = function( all, letter ) {
  3777. return letter.toUpperCase();
  3778. };
  3779. jQuery.fn = jQuery.prototype = {
  3780. // The current version of jQuery being used
  3781. jquery: version,
  3782. constructor: jQuery,
  3783. // The default length of a jQuery object is 0
  3784. length: 0,
  3785. toArray: function() {
  3786. return slice.call( this );
  3787. },
  3788. // Get the Nth element in the matched element set OR
  3789. // Get the whole matched element set as a clean array
  3790. get: function( num ) {
  3791. // Return all the elements in a clean array
  3792. if ( num == null ) {
  3793. return slice.call( this );
  3794. }
  3795. // Return just the one element from the set
  3796. return num < 0 ? this[ num + this.length ] : this[ num ];
  3797. },
  3798. // Take an array of elements and push it onto the stack
  3799. // (returning the new matched element set)
  3800. pushStack: function( elems ) {
  3801. // Build a new jQuery matched element set
  3802. var ret = jQuery.merge( this.constructor(), elems );
  3803. // Add the old object onto the stack (as a reference)
  3804. ret.prevObject = this;
  3805. // Return the newly-formed element set
  3806. return ret;
  3807. },
  3808. // Execute a callback for every element in the matched set.
  3809. each: function( callback ) {
  3810. return jQuery.each( this, callback );
  3811. },
  3812. map: function( callback ) {
  3813. return this.pushStack( jQuery.map( this, function( elem, i ) {
  3814. return callback.call( elem, i, elem );
  3815. } ) );
  3816. },
  3817. slice: function() {
  3818. return this.pushStack( slice.apply( this, arguments ) );
  3819. },
  3820. first: function() {
  3821. return this.eq( 0 );
  3822. },
  3823. last: function() {
  3824. return this.eq( -1 );
  3825. },
  3826. eq: function( i ) {
  3827. var len = this.length,
  3828. j = +i + ( i < 0 ? len : 0 );
  3829. return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
  3830. },
  3831. end: function() {
  3832. return this.prevObject || this.constructor();
  3833. },
  3834. // For internal use only.
  3835. // Behaves like an Array's method, not like a jQuery method.
  3836. push: push,
  3837. sort: arr.sort,
  3838. splice: arr.splice
  3839. };
  3840. jQuery.extend = jQuery.fn.extend = function() {
  3841. var options, name, src, copy, copyIsArray, clone,
  3842. target = arguments[ 0 ] || {},
  3843. i = 1,
  3844. length = arguments.length,
  3845. deep = false;
  3846. // Handle a deep copy situation
  3847. if ( typeof target === "boolean" ) {
  3848. deep = target;
  3849. // Skip the boolean and the target
  3850. target = arguments[ i ] || {};
  3851. i++;
  3852. }
  3853. // Handle case when target is a string or something (possible in deep copy)
  3854. if ( typeof target !== "object" && !jQuery.isFunction( target ) ) {
  3855. target = {};
  3856. }
  3857. // Extend jQuery itself if only one argument is passed
  3858. if ( i === length ) {
  3859. target = this;
  3860. i--;
  3861. }
  3862. for ( ; i < length; i++ ) {
  3863. // Only deal with non-null/undefined values
  3864. if ( ( options = arguments[ i ] ) != null ) {
  3865. // Extend the base object
  3866. for ( name in options ) {
  3867. src = target[ name ];
  3868. copy = options[ name ];
  3869. // Prevent never-ending loop
  3870. if ( target === copy ) {
  3871. continue;
  3872. }
  3873. // Recurse if we're merging plain objects or arrays
  3874. if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
  3875. ( copyIsArray = jQuery.isArray( copy ) ) ) ) {
  3876. if ( copyIsArray ) {
  3877. copyIsArray = false;
  3878. clone = src && jQuery.isArray( src ) ? src : [];
  3879. } else {
  3880. clone = src && jQuery.isPlainObject( src ) ? src : {};
  3881. }
  3882. // Never move original objects, clone them
  3883. target[ name ] = jQuery.extend( deep, clone, copy );
  3884. // Don't bring in undefined values
  3885. } else if ( copy !== undefined ) {
  3886. target[ name ] = copy;
  3887. }
  3888. }
  3889. }
  3890. }
  3891. // Return the modified object
  3892. return target;
  3893. };
  3894. jQuery.extend( {
  3895. // Unique for each copy of jQuery on the page
  3896. expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
  3897. // Assume jQuery is ready without the ready module
  3898. isReady: true,
  3899. error: function( msg ) {
  3900. throw new Error( msg );
  3901. },
  3902. noop: function() {},
  3903. isFunction: function( obj ) {
  3904. return jQuery.type( obj ) === "function";
  3905. },
  3906. isArray: Array.isArray,
  3907. isWindow: function( obj ) {
  3908. return obj != null && obj === obj.window;
  3909. },
  3910. isNumeric: function( obj ) {
  3911. // As of jQuery 3.0, isNumeric is limited to
  3912. // strings and numbers (primitives or objects)
  3913. // that can be coerced to finite numbers (gh-2662)
  3914. var type = jQuery.type( obj );
  3915. return ( type === "number" || type === "string" ) &&
  3916. // parseFloat NaNs numeric-cast false positives ("")
  3917. // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
  3918. // subtraction forces infinities to NaN
  3919. !isNaN( obj - parseFloat( obj ) );
  3920. },
  3921. isPlainObject: function( obj ) {
  3922. var proto, Ctor;
  3923. // Detect obvious negatives
  3924. // Use toString instead of jQuery.type to catch host objects
  3925. if ( !obj || toString.call( obj ) !== "[object Object]" ) {
  3926. return false;
  3927. }
  3928. proto = getProto( obj );
  3929. // Objects with no prototype (e.g., `Object.create( null )`) are plain
  3930. if ( !proto ) {
  3931. return true;
  3932. }
  3933. // Objects with prototype are plain iff they were constructed by a global Object function
  3934. Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor;
  3935. return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString;
  3936. },
  3937. isEmptyObject: function( obj ) {
  3938. /* eslint-disable no-unused-vars */
  3939. // See https://github.com/eslint/eslint/issues/6125
  3940. var name;
  3941. for ( name in obj ) {
  3942. return false;
  3943. }
  3944. return true;
  3945. },
  3946. type: function( obj ) {
  3947. if ( obj == null ) {
  3948. return obj + "";
  3949. }
  3950. // Support: Android <=2.3 only (functionish RegExp)
  3951. return typeof obj === "object" || typeof obj === "function" ?
  3952. class2type[ toString.call( obj ) ] || "object" :
  3953. typeof obj;
  3954. },
  3955. // Evaluates a script in a global context
  3956. globalEval: function( code ) {
  3957. DOMEval( code );
  3958. },
  3959. // Convert dashed to camelCase; used by the css and data modules
  3960. // Support: IE <=9 - 11, Edge 12 - 13
  3961. // Microsoft forgot to hump their vendor prefix (#9572)
  3962. camelCase: function( string ) {
  3963. return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
  3964. },
  3965. nodeName: function( elem, name ) {
  3966. return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
  3967. },
  3968. each: function( obj, callback ) {
  3969. var length, i = 0;
  3970. if ( isArrayLike( obj ) ) {
  3971. length = obj.length;
  3972. for ( ; i < length; i++ ) {
  3973. if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
  3974. break;
  3975. }
  3976. }
  3977. } else {
  3978. for ( i in obj ) {
  3979. if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
  3980. break;
  3981. }
  3982. }
  3983. }
  3984. return obj;
  3985. },
  3986. // Support: Android <=4.0 only
  3987. trim: function( text ) {
  3988. return text == null ?
  3989. "" :
  3990. ( text + "" ).replace( rtrim, "" );
  3991. },
  3992. // results is for internal usage only
  3993. makeArray: function( arr, results ) {
  3994. var ret = results || [];
  3995. if ( arr != null ) {
  3996. if ( isArrayLike( Object( arr ) ) ) {
  3997. jQuery.merge( ret,
  3998. typeof arr === "string" ?
  3999. [ arr ] : arr
  4000. );
  4001. } else {
  4002. push.call( ret, arr );
  4003. }
  4004. }
  4005. return ret;
  4006. },
  4007. inArray: function( elem, arr, i ) {
  4008. return arr == null ? -1 : indexOf.call( arr, elem, i );
  4009. },
  4010. // Support: Android <=4.0 only, PhantomJS 1 only
  4011. // push.apply(_, arraylike) throws on ancient WebKit
  4012. merge: function( first, second ) {
  4013. var len = +second.length,
  4014. j = 0,
  4015. i = first.length;
  4016. for ( ; j < len; j++ ) {
  4017. first[ i++ ] = second[ j ];
  4018. }
  4019. first.length = i;
  4020. return first;
  4021. },
  4022. grep: function( elems, callback, invert ) {
  4023. var callbackInverse,
  4024. matches = [],
  4025. i = 0,
  4026. length = elems.length,
  4027. callbackExpect = !invert;
  4028. // Go through the array, only saving the items
  4029. // that pass the validator function
  4030. for ( ; i < length; i++ ) {
  4031. callbackInverse = !callback( elems[ i ], i );
  4032. if ( callbackInverse !== callbackExpect ) {
  4033. matches.push( elems[ i ] );
  4034. }
  4035. }
  4036. return matches;
  4037. },
  4038. // arg is for internal usage only
  4039. map: function( elems, callback, arg ) {
  4040. var length, value,
  4041. i = 0,
  4042. ret = [];
  4043. // Go through the array, translating each of the items to their new values
  4044. if ( isArrayLike( elems ) ) {
  4045. length = elems.length;
  4046. for ( ; i < length; i++ ) {
  4047. value = callback( elems[ i ], i, arg );
  4048. if ( value != null ) {
  4049. ret.push( value );
  4050. }
  4051. }
  4052. // Go through every key on the object,
  4053. } else {
  4054. for ( i in elems ) {
  4055. value = callback( elems[ i ], i, arg );
  4056. if ( value != null ) {
  4057. ret.push( value );
  4058. }
  4059. }
  4060. }
  4061. // Flatten any nested arrays
  4062. return concat.apply( [], ret );
  4063. },
  4064. // A global GUID counter for objects
  4065. guid: 1,
  4066. // Bind a function to a context, optionally partially applying any
  4067. // arguments.
  4068. proxy: function( fn, context ) {
  4069. var tmp, args, proxy;
  4070. if ( typeof context === "string" ) {
  4071. tmp = fn[ context ];
  4072. context = fn;
  4073. fn = tmp;
  4074. }
  4075. // Quick check to determine if target is callable, in the spec
  4076. // this throws a TypeError, but we will just return undefined.
  4077. if ( !jQuery.isFunction( fn ) ) {
  4078. return undefined;
  4079. }
  4080. // Simulated bind
  4081. args = slice.call( arguments, 2 );
  4082. proxy = function() {
  4083. return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
  4084. };
  4085. // Set the guid of unique handler to the same of original handler, so it can be removed
  4086. proxy.guid = fn.guid = fn.guid || jQuery.guid++;
  4087. return proxy;
  4088. },
  4089. now: Date.now,
  4090. // jQuery.support is not used in Core but other projects attach their
  4091. // properties to it so it needs to exist.
  4092. support: support
  4093. } );
  4094. if ( typeof Symbol === "function" ) {
  4095. jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
  4096. }
  4097. // Populate the class2type map
  4098. jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
  4099. function( i, name ) {
  4100. class2type[ "[object " + name + "]" ] = name.toLowerCase();
  4101. } );
  4102. function isArrayLike( obj ) {
  4103. // Support: real iOS 8.2 only (not reproducible in simulator)
  4104. // `in` check used to prevent JIT error (gh-2145)
  4105. // hasOwn isn't used here due to false negatives
  4106. // regarding Nodelist length in IE
  4107. var length = !!obj && "length" in obj && obj.length,
  4108. type = jQuery.type( obj );
  4109. if ( type === "function" || jQuery.isWindow( obj ) ) {
  4110. return false;
  4111. }
  4112. return type === "array" || length === 0 ||
  4113. typeof length === "number" && length > 0 && ( length - 1 ) in obj;
  4114. }
  4115. var Sizzle =
  4116. /*!
  4117. * Sizzle CSS Selector Engine v2.3.3
  4118. * https://sizzlejs.com/
  4119. *
  4120. * Copyright jQuery Foundation and other contributors
  4121. * Released under the MIT license
  4122. * http://jquery.org/license
  4123. *
  4124. * Date: 2016-08-08
  4125. */
  4126. (function( window ) {
  4127. var i,
  4128. support,
  4129. Expr,
  4130. getText,
  4131. isXML,
  4132. tokenize,
  4133. compile,
  4134. select,
  4135. outermostContext,
  4136. sortInput,
  4137. hasDuplicate,
  4138. // Local document vars
  4139. setDocument,
  4140. document,
  4141. docElem,
  4142. documentIsHTML,
  4143. rbuggyQSA,
  4144. rbuggyMatches,
  4145. matches,
  4146. contains,
  4147. // Instance-specific data
  4148. expando = "sizzle" + 1 * new Date(),
  4149. preferredDoc = window.document,
  4150. dirruns = 0,
  4151. done = 0,
  4152. classCache = createCache(),
  4153. tokenCache = createCache(),
  4154. compilerCache = createCache(),
  4155. sortOrder = function( a, b ) {
  4156. if ( a === b ) {
  4157. hasDuplicate = true;
  4158. }
  4159. return 0;
  4160. },
  4161. // Instance methods
  4162. hasOwn = ({}).hasOwnProperty,
  4163. arr = [],
  4164. pop = arr.pop,
  4165. push_native = arr.push,
  4166. push = arr.push,
  4167. slice = arr.slice,
  4168. // Use a stripped-down indexOf as it's faster than native
  4169. // https://jsperf.com/thor-indexof-vs-for/5
  4170. indexOf = function( list, elem ) {
  4171. var i = 0,
  4172. len = list.length;
  4173. for ( ; i < len; i++ ) {
  4174. if ( list[i] === elem ) {
  4175. return i;
  4176. }
  4177. }
  4178. return -1;
  4179. },
  4180. booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
  4181. // Regular expressions
  4182. // http://www.w3.org/TR/css3-selectors/#whitespace
  4183. whitespace = "[\\x20\\t\\r\\n\\f]",
  4184. // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
  4185. identifier = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+",
  4186. // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
  4187. attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
  4188. // Operator (capture 2)
  4189. "*([*^$|!~]?=)" + whitespace +
  4190. // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
  4191. "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
  4192. "*\\]",
  4193. pseudos = ":(" + identifier + ")(?:\\((" +
  4194. // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
  4195. // 1. quoted (capture 3; capture 4 or capture 5)
  4196. "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
  4197. // 2. simple (capture 6)
  4198. "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
  4199. // 3. anything else (capture 2)
  4200. ".*" +
  4201. ")\\)|)",
  4202. // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
  4203. rwhitespace = new RegExp( whitespace + "+", "g" ),
  4204. rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
  4205. rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
  4206. rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
  4207. rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
  4208. rpseudo = new RegExp( pseudos ),
  4209. ridentifier = new RegExp( "^" + identifier + "$" ),
  4210. matchExpr = {
  4211. "ID": new RegExp( "^#(" + identifier + ")" ),
  4212. "CLASS": new RegExp( "^\\.(" + identifier + ")" ),
  4213. "TAG": new RegExp( "^(" + identifier + "|[*])" ),
  4214. "ATTR": new RegExp( "^" + attributes ),
  4215. "PSEUDO": new RegExp( "^" + pseudos ),
  4216. "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
  4217. "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
  4218. "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
  4219. "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
  4220. // For use in libraries implementing .is()
  4221. // We use this for POS matching in `select`
  4222. "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
  4223. whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
  4224. },
  4225. rinputs = /^(?:input|select|textarea|button)$/i,
  4226. rheader = /^h\d$/i,
  4227. rnative = /^[^{]+\{\s*\[native \w/,
  4228. // Easily-parseable/retrievable ID or TAG or CLASS selectors
  4229. rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
  4230. rsibling = /[+~]/,
  4231. // CSS escapes
  4232. // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
  4233. runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
  4234. funescape = function( _, escaped, escapedWhitespace ) {
  4235. var high = "0x" + escaped - 0x10000;
  4236. // NaN means non-codepoint
  4237. // Support: Firefox<24
  4238. // Workaround erroneous numeric interpretation of +"0x"
  4239. return high !== high || escapedWhitespace ?
  4240. escaped :
  4241. high < 0 ?
  4242. // BMP codepoint
  4243. String.fromCharCode( high + 0x10000 ) :
  4244. // Supplemental Plane codepoint (surrogate pair)
  4245. String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
  4246. },
  4247. // CSS string/identifier serialization
  4248. // https://drafts.csswg.org/cssom/#common-serializing-idioms
  4249. rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,
  4250. fcssescape = function( ch, asCodePoint ) {
  4251. if ( asCodePoint ) {
  4252. // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
  4253. if ( ch === "\0" ) {
  4254. return "\uFFFD";
  4255. }
  4256. // Control characters and (dependent upon position) numbers get escaped as code points
  4257. return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
  4258. }
  4259. // Other potentially-special ASCII characters get backslash-escaped
  4260. return "\\" + ch;
  4261. },
  4262. // Used for iframes
  4263. // See setDocument()
  4264. // Removing the function wrapper causes a "Permission Denied"
  4265. // error in IE
  4266. unloadHandler = function() {
  4267. setDocument();
  4268. },
  4269. disabledAncestor = addCombinator(
  4270. function( elem ) {
  4271. return elem.disabled === true && ("form" in elem || "label" in elem);
  4272. },
  4273. { dir: "parentNode", next: "legend" }
  4274. );
  4275. // Optimize for push.apply( _, NodeList )
  4276. try {
  4277. push.apply(
  4278. (arr = slice.call( preferredDoc.childNodes )),
  4279. preferredDoc.childNodes
  4280. );
  4281. // Support: Android<4.0
  4282. // Detect silently failing push.apply
  4283. arr[ preferredDoc.childNodes.length ].nodeType;
  4284. } catch ( e ) {
  4285. push = { apply: arr.length ?
  4286. // Leverage slice if possible
  4287. function( target, els ) {
  4288. push_native.apply( target, slice.call(els) );
  4289. } :
  4290. // Support: IE<9
  4291. // Otherwise append directly
  4292. function( target, els ) {
  4293. var j = target.length,
  4294. i = 0;
  4295. // Can't trust NodeList.length
  4296. while ( (target[j++] = els[i++]) ) {}
  4297. target.length = j - 1;
  4298. }
  4299. };
  4300. }
  4301. function Sizzle( selector, context, results, seed ) {
  4302. var m, i, elem, nid, match, groups, newSelector,
  4303. newContext = context && context.ownerDocument,
  4304. // nodeType defaults to 9, since context defaults to document
  4305. nodeType = context ? context.nodeType : 9;
  4306. results = results || [];
  4307. // Return early from calls with invalid selector or context
  4308. if ( typeof selector !== "string" || !selector ||
  4309. nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
  4310. return results;
  4311. }
  4312. // Try to shortcut find operations (as opposed to filters) in HTML documents
  4313. if ( !seed ) {
  4314. if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
  4315. setDocument( context );
  4316. }
  4317. context = context || document;
  4318. if ( documentIsHTML ) {
  4319. // If the selector is sufficiently simple, try using a "get*By*" DOM method
  4320. // (excepting DocumentFragment context, where the methods don't exist)
  4321. if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
  4322. // ID selector
  4323. if ( (m = match[1]) ) {
  4324. // Document context
  4325. if ( nodeType === 9 ) {
  4326. if ( (elem = context.getElementById( m )) ) {
  4327. // Support: IE, Opera, Webkit
  4328. // TODO: identify versions
  4329. // getElementById can match elements by name instead of ID
  4330. if ( elem.id === m ) {
  4331. results.push( elem );
  4332. return results;
  4333. }
  4334. } else {
  4335. return results;
  4336. }
  4337. // Element context
  4338. } else {
  4339. // Support: IE, Opera, Webkit
  4340. // TODO: identify versions
  4341. // getElementById can match elements by name instead of ID
  4342. if ( newContext && (elem = newContext.getElementById( m )) &&
  4343. contains( context, elem ) &&
  4344. elem.id === m ) {
  4345. results.push( elem );
  4346. return results;
  4347. }
  4348. }
  4349. // Type selector
  4350. } else if ( match[2] ) {
  4351. push.apply( results, context.getElementsByTagName( selector ) );
  4352. return results;
  4353. // Class selector
  4354. } else if ( (m = match[3]) && support.getElementsByClassName &&
  4355. context.getElementsByClassName ) {
  4356. push.apply( results, context.getElementsByClassName( m ) );
  4357. return results;
  4358. }
  4359. }
  4360. // Take advantage of querySelectorAll
  4361. if ( support.qsa &&
  4362. !compilerCache[ selector + " " ] &&
  4363. (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
  4364. if ( nodeType !== 1 ) {
  4365. newContext = context;
  4366. newSelector = selector;
  4367. // qSA looks outside Element context, which is not what we want
  4368. // Thanks to Andrew Dupont for this workaround technique
  4369. // Support: IE <=8
  4370. // Exclude object elements
  4371. } else if ( context.nodeName.toLowerCase() !== "object" ) {
  4372. // Capture the context ID, setting it first if necessary
  4373. if ( (nid = context.getAttribute( "id" )) ) {
  4374. nid = nid.replace( rcssescape, fcssescape );
  4375. } else {
  4376. context.setAttribute( "id", (nid = expando) );
  4377. }
  4378. // Prefix every selector in the list
  4379. groups = tokenize( selector );
  4380. i = groups.length;
  4381. while ( i-- ) {
  4382. groups[i] = "#" + nid + " " + toSelector( groups[i] );
  4383. }
  4384. newSelector = groups.join( "," );
  4385. // Expand context for sibling selectors
  4386. newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
  4387. context;
  4388. }
  4389. if ( newSelector ) {
  4390. try {
  4391. push.apply( results,
  4392. newContext.querySelectorAll( newSelector )
  4393. );
  4394. return results;
  4395. } catch ( qsaError ) {
  4396. } finally {
  4397. if ( nid === expando ) {
  4398. context.removeAttribute( "id" );
  4399. }
  4400. }
  4401. }
  4402. }
  4403. }
  4404. }
  4405. // All others
  4406. return select( selector.replace( rtrim, "$1" ), context, results, seed );
  4407. }
  4408. /**
  4409. * Create key-value caches of limited size
  4410. * @returns {function(string, object)} Returns the Object data after storing it on itself with
  4411. * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
  4412. * deleting the oldest entry
  4413. */
  4414. function createCache() {
  4415. var keys = [];
  4416. function cache( key, value ) {
  4417. // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
  4418. if ( keys.push( key + " " ) > Expr.cacheLength ) {
  4419. // Only keep the most recent entries
  4420. delete cache[ keys.shift() ];
  4421. }
  4422. return (cache[ key + " " ] = value);
  4423. }
  4424. return cache;
  4425. }
  4426. /**
  4427. * Mark a function for special use by Sizzle
  4428. * @param {Function} fn The function to mark
  4429. */
  4430. function markFunction( fn ) {
  4431. fn[ expando ] = true;
  4432. return fn;
  4433. }
  4434. /**
  4435. * Support testing using an element
  4436. * @param {Function} fn Passed the created element and returns a boolean result
  4437. */
  4438. function assert( fn ) {
  4439. var el = document.createElement("fieldset");
  4440. try {
  4441. return !!fn( el );
  4442. } catch (e) {
  4443. return false;
  4444. } finally {
  4445. // Remove from its parent by default
  4446. if ( el.parentNode ) {
  4447. el.parentNode.removeChild( el );
  4448. }
  4449. // release memory in IE
  4450. el = null;
  4451. }
  4452. }
  4453. /**
  4454. * Adds the same handler for all of the specified attrs
  4455. * @param {String} attrs Pipe-separated list of attributes
  4456. * @param {Function} handler The method that will be applied
  4457. */
  4458. function addHandle( attrs, handler ) {
  4459. var arr = attrs.split("|"),
  4460. i = arr.length;
  4461. while ( i-- ) {
  4462. Expr.attrHandle[ arr[i] ] = handler;
  4463. }
  4464. }
  4465. /**
  4466. * Checks document order of two siblings
  4467. * @param {Element} a
  4468. * @param {Element} b
  4469. * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
  4470. */
  4471. function siblingCheck( a, b ) {
  4472. var cur = b && a,
  4473. diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
  4474. a.sourceIndex - b.sourceIndex;
  4475. // Use IE sourceIndex if available on both nodes
  4476. if ( diff ) {
  4477. return diff;
  4478. }
  4479. // Check if b follows a
  4480. if ( cur ) {
  4481. while ( (cur = cur.nextSibling) ) {
  4482. if ( cur === b ) {
  4483. return -1;
  4484. }
  4485. }
  4486. }
  4487. return a ? 1 : -1;
  4488. }
  4489. /**
  4490. * Returns a function to use in pseudos for input types
  4491. * @param {String} type
  4492. */
  4493. function createInputPseudo( type ) {
  4494. return function( elem ) {
  4495. var name = elem.nodeName.toLowerCase();
  4496. return name === "input" && elem.type === type;
  4497. };
  4498. }
  4499. /**
  4500. * Returns a function to use in pseudos for buttons
  4501. * @param {String} type
  4502. */
  4503. function createButtonPseudo( type ) {
  4504. return function( elem ) {
  4505. var name = elem.nodeName.toLowerCase();
  4506. return (name === "input" || name === "button") && elem.type === type;
  4507. };
  4508. }
  4509. /**
  4510. * Returns a function to use in pseudos for :enabled/:disabled
  4511. * @param {Boolean} disabled true for :disabled; false for :enabled
  4512. */
  4513. function createDisabledPseudo( disabled ) {
  4514. // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable
  4515. return function( elem ) {
  4516. // Only certain elements can match :enabled or :disabled
  4517. // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled
  4518. // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled
  4519. if ( "form" in elem ) {
  4520. // Check for inherited disabledness on relevant non-disabled elements:
  4521. // * listed form-associated elements in a disabled fieldset
  4522. // https://html.spec.whatwg.org/multipage/forms.html#category-listed
  4523. // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled
  4524. // * option elements in a disabled optgroup
  4525. // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled
  4526. // All such elements have a "form" property.
  4527. if ( elem.parentNode && elem.disabled === false ) {
  4528. // Option elements defer to a parent optgroup if present
  4529. if ( "label" in elem ) {
  4530. if ( "label" in elem.parentNode ) {
  4531. return elem.parentNode.disabled === disabled;
  4532. } else {
  4533. return elem.disabled === disabled;
  4534. }
  4535. }
  4536. // Support: IE 6 - 11
  4537. // Use the isDisabled shortcut property to check for disabled fieldset ancestors
  4538. return elem.isDisabled === disabled ||
  4539. // Where there is no isDisabled, check manually
  4540. /* jshint -W018 */
  4541. elem.isDisabled !== !disabled &&
  4542. disabledAncestor( elem ) === disabled;
  4543. }
  4544. return elem.disabled === disabled;
  4545. // Try to winnow out elements that can't be disabled before trusting the disabled property.
  4546. // Some victims get caught in our net (label, legend, menu, track), but it shouldn't
  4547. // even exist on them, let alone have a boolean value.
  4548. } else if ( "label" in elem ) {
  4549. return elem.disabled === disabled;
  4550. }
  4551. // Remaining elements are neither :enabled nor :disabled
  4552. return false;
  4553. };
  4554. }
  4555. /**
  4556. * Returns a function to use in pseudos for positionals
  4557. * @param {Function} fn
  4558. */
  4559. function createPositionalPseudo( fn ) {
  4560. return markFunction(function( argument ) {
  4561. argument = +argument;
  4562. return markFunction(function( seed, matches ) {
  4563. var j,
  4564. matchIndexes = fn( [], seed.length, argument ),
  4565. i = matchIndexes.length;
  4566. // Match elements found at the specified indexes
  4567. while ( i-- ) {
  4568. if ( seed[ (j = matchIndexes[i]) ] ) {
  4569. seed[j] = !(matches[j] = seed[j]);
  4570. }
  4571. }
  4572. });
  4573. });
  4574. }
  4575. /**
  4576. * Checks a node for validity as a Sizzle context
  4577. * @param {Element|Object=} context
  4578. * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
  4579. */
  4580. function testContext( context ) {
  4581. return context && typeof context.getElementsByTagName !== "undefined" && context;
  4582. }
  4583. // Expose support vars for convenience
  4584. support = Sizzle.support = {};
  4585. /**
  4586. * Detects XML nodes
  4587. * @param {Element|Object} elem An element or a document
  4588. * @returns {Boolean} True iff elem is a non-HTML XML node
  4589. */
  4590. isXML = Sizzle.isXML = function( elem ) {
  4591. // documentElement is verified for cases where it doesn't yet exist
  4592. // (such as loading iframes in IE - #4833)
  4593. var documentElement = elem && (elem.ownerDocument || elem).documentElement;
  4594. return documentElement ? documentElement.nodeName !== "HTML" : false;
  4595. };
  4596. /**
  4597. * Sets document-related variables once based on the current document
  4598. * @param {Element|Object} [doc] An element or document object to use to set the document
  4599. * @returns {Object} Returns the current document
  4600. */
  4601. setDocument = Sizzle.setDocument = function( node ) {
  4602. var hasCompare, subWindow,
  4603. doc = node ? node.ownerDocument || node : preferredDoc;
  4604. // Return early if doc is invalid or already selected
  4605. if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
  4606. return document;
  4607. }
  4608. // Update global variables
  4609. document = doc;
  4610. docElem = document.documentElement;
  4611. documentIsHTML = !isXML( document );
  4612. // Support: IE 9-11, Edge
  4613. // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
  4614. if ( preferredDoc !== document &&
  4615. (subWindow = document.defaultView) && subWindow.top !== subWindow ) {
  4616. // Support: IE 11, Edge
  4617. if ( subWindow.addEventListener ) {
  4618. subWindow.addEventListener( "unload", unloadHandler, false );
  4619. // Support: IE 9 - 10 only
  4620. } else if ( subWindow.attachEvent ) {
  4621. subWindow.attachEvent( "onunload", unloadHandler );
  4622. }
  4623. }
  4624. /* Attributes
  4625. ---------------------------------------------------------------------- */
  4626. // Support: IE<8
  4627. // Verify that getAttribute really returns attributes and not properties
  4628. // (excepting IE8 booleans)
  4629. support.attributes = assert(function( el ) {
  4630. el.className = "i";
  4631. return !el.getAttribute("className");
  4632. });
  4633. /* getElement(s)By*
  4634. ---------------------------------------------------------------------- */
  4635. // Check if getElementsByTagName("*") returns only elements
  4636. support.getElementsByTagName = assert(function( el ) {
  4637. el.appendChild( document.createComment("") );
  4638. return !el.getElementsByTagName("*").length;
  4639. });
  4640. // Support: IE<9
  4641. support.getElementsByClassName = rnative.test( document.getElementsByClassName );
  4642. // Support: IE<10
  4643. // Check if getElementById returns elements by name
  4644. // The broken getElementById methods don't pick up programmatically-set names,
  4645. // so use a roundabout getElementsByName test
  4646. support.getById = assert(function( el ) {
  4647. docElem.appendChild( el ).id = expando;
  4648. return !document.getElementsByName || !document.getElementsByName( expando ).length;
  4649. });
  4650. // ID filter and find
  4651. if ( support.getById ) {
  4652. Expr.filter["ID"] = function( id ) {
  4653. var attrId = id.replace( runescape, funescape );
  4654. return function( elem ) {
  4655. return elem.getAttribute("id") === attrId;
  4656. };
  4657. };
  4658. Expr.find["ID"] = function( id, context ) {
  4659. if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
  4660. var elem = context.getElementById( id );
  4661. return elem ? [ elem ] : [];
  4662. }
  4663. };
  4664. } else {
  4665. Expr.filter["ID"] = function( id ) {
  4666. var attrId = id.replace( runescape, funescape );
  4667. return function( elem ) {
  4668. var node = typeof elem.getAttributeNode !== "undefined" &&
  4669. elem.getAttributeNode("id");
  4670. return node && node.value === attrId;
  4671. };
  4672. };
  4673. // Support: IE 6 - 7 only
  4674. // getElementById is not reliable as a find shortcut
  4675. Expr.find["ID"] = function( id, context ) {
  4676. if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
  4677. var node, i, elems,
  4678. elem = context.getElementById( id );
  4679. if ( elem ) {
  4680. // Verify the id attribute
  4681. node = elem.getAttributeNode("id");
  4682. if ( node && node.value === id ) {
  4683. return [ elem ];
  4684. }
  4685. // Fall back on getElementsByName
  4686. elems = context.getElementsByName( id );
  4687. i = 0;
  4688. while ( (elem = elems[i++]) ) {
  4689. node = elem.getAttributeNode("id");
  4690. if ( node && node.value === id ) {
  4691. return [ elem ];
  4692. }
  4693. }
  4694. }
  4695. return [];
  4696. }
  4697. };
  4698. }
  4699. // Tag
  4700. Expr.find["TAG"] = support.getElementsByTagName ?
  4701. function( tag, context ) {
  4702. if ( typeof context.getElementsByTagName !== "undefined" ) {
  4703. return context.getElementsByTagName( tag );
  4704. // DocumentFragment nodes don't have gEBTN
  4705. } else if ( support.qsa ) {
  4706. return context.querySelectorAll( tag );
  4707. }
  4708. } :
  4709. function( tag, context ) {
  4710. var elem,
  4711. tmp = [],
  4712. i = 0,
  4713. // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
  4714. results = context.getElementsByTagName( tag );
  4715. // Filter out possible comments
  4716. if ( tag === "*" ) {
  4717. while ( (elem = results[i++]) ) {
  4718. if ( elem.nodeType === 1 ) {
  4719. tmp.push( elem );
  4720. }
  4721. }
  4722. return tmp;
  4723. }
  4724. return results;
  4725. };
  4726. // Class
  4727. Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
  4728. if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
  4729. return context.getElementsByClassName( className );
  4730. }
  4731. };
  4732. /* QSA/matchesSelector
  4733. ---------------------------------------------------------------------- */
  4734. // QSA and matchesSelector support
  4735. // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
  4736. rbuggyMatches = [];
  4737. // qSa(:focus) reports false when true (Chrome 21)
  4738. // We allow this because of a bug in IE8/9 that throws an error
  4739. // whenever `document.activeElement` is accessed on an iframe
  4740. // So, we allow :focus to pass through QSA all the time to avoid the IE error
  4741. // See https://bugs.jquery.com/ticket/13378
  4742. rbuggyQSA = [];
  4743. if ( (support.qsa = rnative.test( document.querySelectorAll )) ) {
  4744. // Build QSA regex
  4745. // Regex strategy adopted from Diego Perini
  4746. assert(function( el ) {
  4747. // Select is set to empty string on purpose
  4748. // This is to test IE's treatment of not explicitly
  4749. // setting a boolean content attribute,
  4750. // since its presence should be enough
  4751. // https://bugs.jquery.com/ticket/12359
  4752. docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" +
  4753. "<select id='" + expando + "-\r\\' msallowcapture=''>" +
  4754. "<option selected=''></option></select>";
  4755. // Support: IE8, Opera 11-12.16
  4756. // Nothing should be selected when empty strings follow ^= or $= or *=
  4757. // The test attribute must be unknown in Opera but "safe" for WinRT
  4758. // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
  4759. if ( el.querySelectorAll("[msallowcapture^='']").length ) {
  4760. rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
  4761. }
  4762. // Support: IE8
  4763. // Boolean attributes and "value" are not treated correctly
  4764. if ( !el.querySelectorAll("[selected]").length ) {
  4765. rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
  4766. }
  4767. // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+
  4768. if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
  4769. rbuggyQSA.push("~=");
  4770. }
  4771. // Webkit/Opera - :checked should return selected option elements
  4772. // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
  4773. // IE8 throws error here and will not see later tests
  4774. if ( !el.querySelectorAll(":checked").length ) {
  4775. rbuggyQSA.push(":checked");
  4776. }
  4777. // Support: Safari 8+, iOS 8+
  4778. // https://bugs.webkit.org/show_bug.cgi?id=136851
  4779. // In-page `selector#id sibling-combinator selector` fails
  4780. if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {
  4781. rbuggyQSA.push(".#.+[+~]");
  4782. }
  4783. });
  4784. assert(function( el ) {
  4785. el.innerHTML = "<a href='' disabled='disabled'></a>" +
  4786. "<select disabled='disabled'><option/></select>";
  4787. // Support: Windows 8 Native Apps
  4788. // The type and name attributes are restricted during .innerHTML assignment
  4789. var input = document.createElement("input");
  4790. input.setAttribute( "type", "hidden" );
  4791. el.appendChild( input ).setAttribute( "name", "D" );
  4792. // Support: IE8
  4793. // Enforce case-sensitivity of name attribute
  4794. if ( el.querySelectorAll("[name=d]").length ) {
  4795. rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
  4796. }
  4797. // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
  4798. // IE8 throws error here and will not see later tests
  4799. if ( el.querySelectorAll(":enabled").length !== 2 ) {
  4800. rbuggyQSA.push( ":enabled", ":disabled" );
  4801. }
  4802. // Support: IE9-11+
  4803. // IE's :disabled selector does not pick up the children of disabled fieldsets
  4804. docElem.appendChild( el ).disabled = true;
  4805. if ( el.querySelectorAll(":disabled").length !== 2 ) {
  4806. rbuggyQSA.push( ":enabled", ":disabled" );
  4807. }
  4808. // Opera 10-11 does not throw on post-comma invalid pseudos
  4809. el.querySelectorAll("*,:x");
  4810. rbuggyQSA.push(",.*:");
  4811. });
  4812. }
  4813. if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
  4814. docElem.webkitMatchesSelector ||
  4815. docElem.mozMatchesSelector ||
  4816. docElem.oMatchesSelector ||
  4817. docElem.msMatchesSelector) )) ) {
  4818. assert(function( el ) {
  4819. // Check to see if it's possible to do matchesSelector
  4820. // on a disconnected node (IE 9)
  4821. support.disconnectedMatch = matches.call( el, "*" );
  4822. // This should fail with an exception
  4823. // Gecko does not error, returns false instead
  4824. matches.call( el, "[s!='']:x" );
  4825. rbuggyMatches.push( "!=", pseudos );
  4826. });
  4827. }
  4828. rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
  4829. rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
  4830. /* Contains
  4831. ---------------------------------------------------------------------- */
  4832. hasCompare = rnative.test( docElem.compareDocumentPosition );
  4833. // Element contains another
  4834. // Purposefully self-exclusive
  4835. // As in, an element does not contain itself
  4836. contains = hasCompare || rnative.test( docElem.contains ) ?
  4837. function( a, b ) {
  4838. var adown = a.nodeType === 9 ? a.documentElement : a,
  4839. bup = b && b.parentNode;
  4840. return a === bup || !!( bup && bup.nodeType === 1 && (
  4841. adown.contains ?
  4842. adown.contains( bup ) :
  4843. a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
  4844. ));
  4845. } :
  4846. function( a, b ) {
  4847. if ( b ) {
  4848. while ( (b = b.parentNode) ) {
  4849. if ( b === a ) {
  4850. return true;
  4851. }
  4852. }
  4853. }
  4854. return false;
  4855. };
  4856. /* Sorting
  4857. ---------------------------------------------------------------------- */
  4858. // Document order sorting
  4859. sortOrder = hasCompare ?
  4860. function( a, b ) {
  4861. // Flag for duplicate removal
  4862. if ( a === b ) {
  4863. hasDuplicate = true;
  4864. return 0;
  4865. }
  4866. // Sort on method existence if only one input has compareDocumentPosition
  4867. var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
  4868. if ( compare ) {
  4869. return compare;
  4870. }
  4871. // Calculate position if both inputs belong to the same document
  4872. compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
  4873. a.compareDocumentPosition( b ) :
  4874. // Otherwise we know they are disconnected
  4875. 1;
  4876. // Disconnected nodes
  4877. if ( compare & 1 ||
  4878. (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
  4879. // Choose the first element that is related to our preferred document
  4880. if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
  4881. return -1;
  4882. }
  4883. if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
  4884. return 1;
  4885. }
  4886. // Maintain original order
  4887. return sortInput ?
  4888. ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
  4889. 0;
  4890. }
  4891. return compare & 4 ? -1 : 1;
  4892. } :
  4893. function( a, b ) {
  4894. // Exit early if the nodes are identical
  4895. if ( a === b ) {
  4896. hasDuplicate = true;
  4897. return 0;
  4898. }
  4899. var cur,
  4900. i = 0,
  4901. aup = a.parentNode,
  4902. bup = b.parentNode,
  4903. ap = [ a ],
  4904. bp = [ b ];
  4905. // Parentless nodes are either documents or disconnected
  4906. if ( !aup || !bup ) {
  4907. return a === document ? -1 :
  4908. b === document ? 1 :
  4909. aup ? -1 :
  4910. bup ? 1 :
  4911. sortInput ?
  4912. ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
  4913. 0;
  4914. // If the nodes are siblings, we can do a quick check
  4915. } else if ( aup === bup ) {
  4916. return siblingCheck( a, b );
  4917. }
  4918. // Otherwise we need full lists of their ancestors for comparison
  4919. cur = a;
  4920. while ( (cur = cur.parentNode) ) {
  4921. ap.unshift( cur );
  4922. }
  4923. cur = b;
  4924. while ( (cur = cur.parentNode) ) {
  4925. bp.unshift( cur );
  4926. }
  4927. // Walk down the tree looking for a discrepancy
  4928. while ( ap[i] === bp[i] ) {
  4929. i++;
  4930. }
  4931. return i ?
  4932. // Do a sibling check if the nodes have a common ancestor
  4933. siblingCheck( ap[i], bp[i] ) :
  4934. // Otherwise nodes in our document sort first
  4935. ap[i] === preferredDoc ? -1 :
  4936. bp[i] === preferredDoc ? 1 :
  4937. 0;
  4938. };
  4939. return document;
  4940. };
  4941. Sizzle.matches = function( expr, elements ) {
  4942. return Sizzle( expr, null, null, elements );
  4943. };
  4944. Sizzle.matchesSelector = function( elem, expr ) {
  4945. // Set document vars if needed
  4946. if ( ( elem.ownerDocument || elem ) !== document ) {
  4947. setDocument( elem );
  4948. }
  4949. // Make sure that attribute selectors are quoted
  4950. expr = expr.replace( rattributeQuotes, "='$1']" );
  4951. if ( support.matchesSelector && documentIsHTML &&
  4952. !compilerCache[ expr + " " ] &&
  4953. ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
  4954. ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
  4955. try {
  4956. var ret = matches.call( elem, expr );
  4957. // IE 9's matchesSelector returns false on disconnected nodes
  4958. if ( ret || support.disconnectedMatch ||
  4959. // As well, disconnected nodes are said to be in a document
  4960. // fragment in IE 9
  4961. elem.document && elem.document.nodeType !== 11 ) {
  4962. return ret;
  4963. }
  4964. } catch (e) {}
  4965. }
  4966. return Sizzle( expr, document, null, [ elem ] ).length > 0;
  4967. };
  4968. Sizzle.contains = function( context, elem ) {
  4969. // Set document vars if needed
  4970. if ( ( context.ownerDocument || context ) !== document ) {
  4971. setDocument( context );
  4972. }
  4973. return contains( context, elem );
  4974. };
  4975. Sizzle.attr = function( elem, name ) {
  4976. // Set document vars if needed
  4977. if ( ( elem.ownerDocument || elem ) !== document ) {
  4978. setDocument( elem );
  4979. }
  4980. var fn = Expr.attrHandle[ name.toLowerCase() ],
  4981. // Don't get fooled by Object.prototype properties (jQuery #13807)
  4982. val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
  4983. fn( elem, name, !documentIsHTML ) :
  4984. undefined;
  4985. return val !== undefined ?
  4986. val :
  4987. support.attributes || !documentIsHTML ?
  4988. elem.getAttribute( name ) :
  4989. (val = elem.getAttributeNode(name)) && val.specified ?
  4990. val.value :
  4991. null;
  4992. };
  4993. Sizzle.escape = function( sel ) {
  4994. return (sel + "").replace( rcssescape, fcssescape );
  4995. };
  4996. Sizzle.error = function( msg ) {
  4997. throw new Error( "Syntax error, unrecognized expression: " + msg );
  4998. };
  4999. /**
  5000. * Document sorting and removing duplicates
  5001. * @param {ArrayLike} results
  5002. */
  5003. Sizzle.uniqueSort = function( results ) {
  5004. var elem,
  5005. duplicates = [],
  5006. j = 0,
  5007. i = 0;
  5008. // Unless we *know* we can detect duplicates, assume their presence
  5009. hasDuplicate = !support.detectDuplicates;
  5010. sortInput = !support.sortStable && results.slice( 0 );
  5011. results.sort( sortOrder );
  5012. if ( hasDuplicate ) {
  5013. while ( (elem = results[i++]) ) {
  5014. if ( elem === results[ i ] ) {
  5015. j = duplicates.push( i );
  5016. }
  5017. }
  5018. while ( j-- ) {
  5019. results.splice( duplicates[ j ], 1 );
  5020. }
  5021. }
  5022. // Clear input after sorting to release objects
  5023. // See https://github.com/jquery/sizzle/pull/225
  5024. sortInput = null;
  5025. return results;
  5026. };
  5027. /**
  5028. * Utility function for retrieving the text value of an array of DOM nodes
  5029. * @param {Array|Element} elem
  5030. */
  5031. getText = Sizzle.getText = function( elem ) {
  5032. var node,
  5033. ret = "",
  5034. i = 0,
  5035. nodeType = elem.nodeType;
  5036. if ( !nodeType ) {
  5037. // If no nodeType, this is expected to be an array
  5038. while ( (node = elem[i++]) ) {
  5039. // Do not traverse comment nodes
  5040. ret += getText( node );
  5041. }
  5042. } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
  5043. // Use textContent for elements
  5044. // innerText usage removed for consistency of new lines (jQuery #11153)
  5045. if ( typeof elem.textContent === "string" ) {
  5046. return elem.textContent;
  5047. } else {
  5048. // Traverse its children
  5049. for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
  5050. ret += getText( elem );
  5051. }
  5052. }
  5053. } else if ( nodeType === 3 || nodeType === 4 ) {
  5054. return elem.nodeValue;
  5055. }
  5056. // Do not include comment or processing instruction nodes
  5057. return ret;
  5058. };
  5059. Expr = Sizzle.selectors = {
  5060. // Can be adjusted by the user
  5061. cacheLength: 50,
  5062. createPseudo: markFunction,
  5063. match: matchExpr,
  5064. attrHandle: {},
  5065. find: {},
  5066. relative: {
  5067. ">": { dir: "parentNode", first: true },
  5068. " ": { dir: "parentNode" },
  5069. "+": { dir: "previousSibling", first: true },
  5070. "~": { dir: "previousSibling" }
  5071. },
  5072. preFilter: {
  5073. "ATTR": function( match ) {
  5074. match[1] = match[1].replace( runescape, funescape );
  5075. // Move the given value to match[3] whether quoted or unquoted
  5076. match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
  5077. if ( match[2] === "~=" ) {
  5078. match[3] = " " + match[3] + " ";
  5079. }
  5080. return match.slice( 0, 4 );
  5081. },
  5082. "CHILD": function( match ) {
  5083. /* matches from matchExpr["CHILD"]
  5084. 1 type (only|nth|...)
  5085. 2 what (child|of-type)
  5086. 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
  5087. 4 xn-component of xn+y argument ([+-]?\d*n|)
  5088. 5 sign of xn-component
  5089. 6 x of xn-component
  5090. 7 sign of y-component
  5091. 8 y of y-component
  5092. */
  5093. match[1] = match[1].toLowerCase();
  5094. if ( match[1].slice( 0, 3 ) === "nth" ) {
  5095. // nth-* requires argument
  5096. if ( !match[3] ) {
  5097. Sizzle.error( match[0] );
  5098. }
  5099. // numeric x and y parameters for Expr.filter.CHILD
  5100. // remember that false/true cast respectively to 0/1
  5101. match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
  5102. match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
  5103. // other types prohibit arguments
  5104. } else if ( match[3] ) {
  5105. Sizzle.error( match[0] );
  5106. }
  5107. return match;
  5108. },
  5109. "PSEUDO": function( match ) {
  5110. var excess,
  5111. unquoted = !match[6] && match[2];
  5112. if ( matchExpr["CHILD"].test( match[0] ) ) {
  5113. return null;
  5114. }
  5115. // Accept quoted arguments as-is
  5116. if ( match[3] ) {
  5117. match[2] = match[4] || match[5] || "";
  5118. // Strip excess characters from unquoted arguments
  5119. } else if ( unquoted && rpseudo.test( unquoted ) &&
  5120. // Get excess from tokenize (recursively)
  5121. (excess = tokenize( unquoted, true )) &&
  5122. // advance to the next closing parenthesis
  5123. (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
  5124. // excess is a negative index
  5125. match[0] = match[0].slice( 0, excess );
  5126. match[2] = unquoted.slice( 0, excess );
  5127. }
  5128. // Return only captures needed by the pseudo filter method (type and argument)
  5129. return match.slice( 0, 3 );
  5130. }
  5131. },
  5132. filter: {
  5133. "TAG": function( nodeNameSelector ) {
  5134. var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
  5135. return nodeNameSelector === "*" ?
  5136. function() { return true; } :
  5137. function( elem ) {
  5138. return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
  5139. };
  5140. },
  5141. "CLASS": function( className ) {
  5142. var pattern = classCache[ className + " " ];
  5143. return pattern ||
  5144. (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
  5145. classCache( className, function( elem ) {
  5146. return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );
  5147. });
  5148. },
  5149. "ATTR": function( name, operator, check ) {
  5150. return function( elem ) {
  5151. var result = Sizzle.attr( elem, name );
  5152. if ( result == null ) {
  5153. return operator === "!=";
  5154. }
  5155. if ( !operator ) {
  5156. return true;
  5157. }
  5158. result += "";
  5159. return operator === "=" ? result === check :
  5160. operator === "!=" ? result !== check :
  5161. operator === "^=" ? check && result.indexOf( check ) === 0 :
  5162. operator === "*=" ? check && result.indexOf( check ) > -1 :
  5163. operator === "$=" ? check && result.slice( -check.length ) === check :
  5164. operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
  5165. operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
  5166. false;
  5167. };
  5168. },
  5169. "CHILD": function( type, what, argument, first, last ) {
  5170. var simple = type.slice( 0, 3 ) !== "nth",
  5171. forward = type.slice( -4 ) !== "last",
  5172. ofType = what === "of-type";
  5173. return first === 1 && last === 0 ?
  5174. // Shortcut for :nth-*(n)
  5175. function( elem ) {
  5176. return !!elem.parentNode;
  5177. } :
  5178. function( elem, context, xml ) {
  5179. var cache, uniqueCache, outerCache, node, nodeIndex, start,
  5180. dir = simple !== forward ? "nextSibling" : "previousSibling",
  5181. parent = elem.parentNode,
  5182. name = ofType && elem.nodeName.toLowerCase(),
  5183. useCache = !xml && !ofType,
  5184. diff = false;
  5185. if ( parent ) {
  5186. // :(first|last|only)-(child|of-type)
  5187. if ( simple ) {
  5188. while ( dir ) {
  5189. node = elem;
  5190. while ( (node = node[ dir ]) ) {
  5191. if ( ofType ?
  5192. node.nodeName.toLowerCase() === name :
  5193. node.nodeType === 1 ) {
  5194. return false;
  5195. }
  5196. }
  5197. // Reverse direction for :only-* (if we haven't yet done so)
  5198. start = dir = type === "only" && !start && "nextSibling";
  5199. }
  5200. return true;
  5201. }
  5202. start = [ forward ? parent.firstChild : parent.lastChild ];
  5203. // non-xml :nth-child(...) stores cache data on `parent`
  5204. if ( forward && useCache ) {
  5205. // Seek `elem` from a previously-cached index
  5206. // ...in a gzip-friendly way
  5207. node = parent;
  5208. outerCache = node[ expando ] || (node[ expando ] = {});
  5209. // Support: IE <9 only
  5210. // Defend against cloned attroperties (jQuery gh-1709)
  5211. uniqueCache = outerCache[ node.uniqueID ] ||
  5212. (outerCache[ node.uniqueID ] = {});
  5213. cache = uniqueCache[ type ] || [];
  5214. nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
  5215. diff = nodeIndex && cache[ 2 ];
  5216. node = nodeIndex && parent.childNodes[ nodeIndex ];
  5217. while ( (node = ++nodeIndex && node && node[ dir ] ||
  5218. // Fallback to seeking `elem` from the start
  5219. (diff = nodeIndex = 0) || start.pop()) ) {
  5220. // When found, cache indexes on `parent` and break
  5221. if ( node.nodeType === 1 && ++diff && node === elem ) {
  5222. uniqueCache[ type ] = [ dirruns, nodeIndex, diff ];
  5223. break;
  5224. }
  5225. }
  5226. } else {
  5227. // Use previously-cached element index if available
  5228. if ( useCache ) {
  5229. // ...in a gzip-friendly way
  5230. node = elem;
  5231. outerCache = node[ expando ] || (node[ expando ] = {});
  5232. // Support: IE <9 only
  5233. // Defend against cloned attroperties (jQuery gh-1709)
  5234. uniqueCache = outerCache[ node.uniqueID ] ||
  5235. (outerCache[ node.uniqueID ] = {});
  5236. cache = uniqueCache[ type ] || [];
  5237. nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
  5238. diff = nodeIndex;
  5239. }
  5240. // xml :nth-child(...)
  5241. // or :nth-last-child(...) or :nth(-last)?-of-type(...)
  5242. if ( diff === false ) {
  5243. // Use the same loop as above to seek `elem` from the start
  5244. while ( (node = ++nodeIndex && node && node[ dir ] ||
  5245. (diff = nodeIndex = 0) || start.pop()) ) {
  5246. if ( ( ofType ?
  5247. node.nodeName.toLowerCase() === name :
  5248. node.nodeType === 1 ) &&
  5249. ++diff ) {
  5250. // Cache the index of each encountered element
  5251. if ( useCache ) {
  5252. outerCache = node[ expando ] || (node[ expando ] = {});
  5253. // Support: IE <9 only
  5254. // Defend against cloned attroperties (jQuery gh-1709)
  5255. uniqueCache = outerCache[ node.uniqueID ] ||
  5256. (outerCache[ node.uniqueID ] = {});
  5257. uniqueCache[ type ] = [ dirruns, diff ];
  5258. }
  5259. if ( node === elem ) {
  5260. break;
  5261. }
  5262. }
  5263. }
  5264. }
  5265. }
  5266. // Incorporate the offset, then check against cycle size
  5267. diff -= last;
  5268. return diff === first || ( diff % first === 0 && diff / first >= 0 );
  5269. }
  5270. };
  5271. },
  5272. "PSEUDO": function( pseudo, argument ) {
  5273. // pseudo-class names are case-insensitive
  5274. // http://www.w3.org/TR/selectors/#pseudo-classes
  5275. // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
  5276. // Remember that setFilters inherits from pseudos
  5277. var args,
  5278. fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
  5279. Sizzle.error( "unsupported pseudo: " + pseudo );
  5280. // The user may use createPseudo to indicate that
  5281. // arguments are needed to create the filter function
  5282. // just as Sizzle does
  5283. if ( fn[ expando ] ) {
  5284. return fn( argument );
  5285. }
  5286. // But maintain support for old signatures
  5287. if ( fn.length > 1 ) {
  5288. args = [ pseudo, pseudo, "", argument ];
  5289. return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
  5290. markFunction(function( seed, matches ) {
  5291. var idx,
  5292. matched = fn( seed, argument ),
  5293. i = matched.length;
  5294. while ( i-- ) {
  5295. idx = indexOf( seed, matched[i] );
  5296. seed[ idx ] = !( matches[ idx ] = matched[i] );
  5297. }
  5298. }) :
  5299. function( elem ) {
  5300. return fn( elem, 0, args );
  5301. };
  5302. }
  5303. return fn;
  5304. }
  5305. },
  5306. pseudos: {
  5307. // Potentially complex pseudos
  5308. "not": markFunction(function( selector ) {
  5309. // Trim the selector passed to compile
  5310. // to avoid treating leading and trailing
  5311. // spaces as combinators
  5312. var input = [],
  5313. results = [],
  5314. matcher = compile( selector.replace( rtrim, "$1" ) );
  5315. return matcher[ expando ] ?
  5316. markFunction(function( seed, matches, context, xml ) {
  5317. var elem,
  5318. unmatched = matcher( seed, null, xml, [] ),
  5319. i = seed.length;
  5320. // Match elements unmatched by `matcher`
  5321. while ( i-- ) {
  5322. if ( (elem = unmatched[i]) ) {
  5323. seed[i] = !(matches[i] = elem);
  5324. }
  5325. }
  5326. }) :
  5327. function( elem, context, xml ) {
  5328. input[0] = elem;
  5329. matcher( input, null, xml, results );
  5330. // Don't keep the element (issue #299)
  5331. input[0] = null;
  5332. return !results.pop();
  5333. };
  5334. }),
  5335. "has": markFunction(function( selector ) {
  5336. return function( elem ) {
  5337. return Sizzle( selector, elem ).length > 0;
  5338. };
  5339. }),
  5340. "contains": markFunction(function( text ) {
  5341. text = text.replace( runescape, funescape );
  5342. return function( elem ) {
  5343. return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
  5344. };
  5345. }),
  5346. // "Whether an element is represented by a :lang() selector
  5347. // is based solely on the element's language value
  5348. // being equal to the identifier C,
  5349. // or beginning with the identifier C immediately followed by "-".
  5350. // The matching of C against the element's language value is performed case-insensitively.
  5351. // The identifier C does not have to be a valid language name."
  5352. // http://www.w3.org/TR/selectors/#lang-pseudo
  5353. "lang": markFunction( function( lang ) {
  5354. // lang value must be a valid identifier
  5355. if ( !ridentifier.test(lang || "") ) {
  5356. Sizzle.error( "unsupported lang: " + lang );
  5357. }
  5358. lang = lang.replace( runescape, funescape ).toLowerCase();
  5359. return function( elem ) {
  5360. var elemLang;
  5361. do {
  5362. if ( (elemLang = documentIsHTML ?
  5363. elem.lang :
  5364. elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
  5365. elemLang = elemLang.toLowerCase();
  5366. return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
  5367. }
  5368. } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
  5369. return false;
  5370. };
  5371. }),
  5372. // Miscellaneous
  5373. "target": function( elem ) {
  5374. var hash = window.location && window.location.hash;
  5375. return hash && hash.slice( 1 ) === elem.id;
  5376. },
  5377. "root": function( elem ) {
  5378. return elem === docElem;
  5379. },
  5380. "focus": function( elem ) {
  5381. return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
  5382. },
  5383. // Boolean properties
  5384. "enabled": createDisabledPseudo( false ),
  5385. "disabled": createDisabledPseudo( true ),
  5386. "checked": function( elem ) {
  5387. // In CSS3, :checked should return both checked and selected elements
  5388. // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
  5389. var nodeName = elem.nodeName.toLowerCase();
  5390. return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
  5391. },
  5392. "selected": function( elem ) {
  5393. // Accessing this property makes selected-by-default
  5394. // options in Safari work properly
  5395. if ( elem.parentNode ) {
  5396. elem.parentNode.selectedIndex;
  5397. }
  5398. return elem.selected === true;
  5399. },
  5400. // Contents
  5401. "empty": function( elem ) {
  5402. // http://www.w3.org/TR/selectors/#empty-pseudo
  5403. // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
  5404. // but not by others (comment: 8; processing instruction: 7; etc.)
  5405. // nodeType < 6 works because attributes (2) do not appear as children
  5406. for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
  5407. if ( elem.nodeType < 6 ) {
  5408. return false;
  5409. }
  5410. }
  5411. return true;
  5412. },
  5413. "parent": function( elem ) {
  5414. return !Expr.pseudos["empty"]( elem );
  5415. },
  5416. // Element/input types
  5417. "header": function( elem ) {
  5418. return rheader.test( elem.nodeName );
  5419. },
  5420. "input": function( elem ) {
  5421. return rinputs.test( elem.nodeName );
  5422. },
  5423. "button": function( elem ) {
  5424. var name = elem.nodeName.toLowerCase();
  5425. return name === "input" && elem.type === "button" || name === "button";
  5426. },
  5427. "text": function( elem ) {
  5428. var attr;
  5429. return elem.nodeName.toLowerCase() === "input" &&
  5430. elem.type === "text" &&
  5431. // Support: IE<8
  5432. // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
  5433. ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
  5434. },
  5435. // Position-in-collection
  5436. "first": createPositionalPseudo(function() {
  5437. return [ 0 ];
  5438. }),
  5439. "last": createPositionalPseudo(function( matchIndexes, length ) {
  5440. return [ length - 1 ];
  5441. }),
  5442. "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
  5443. return [ argument < 0 ? argument + length : argument ];
  5444. }),
  5445. "even": createPositionalPseudo(function( matchIndexes, length ) {
  5446. var i = 0;
  5447. for ( ; i < length; i += 2 ) {
  5448. matchIndexes.push( i );
  5449. }
  5450. return matchIndexes;
  5451. }),
  5452. "odd": createPositionalPseudo(function( matchIndexes, length ) {
  5453. var i = 1;
  5454. for ( ; i < length; i += 2 ) {
  5455. matchIndexes.push( i );
  5456. }
  5457. return matchIndexes;
  5458. }),
  5459. "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
  5460. var i = argument < 0 ? argument + length : argument;
  5461. for ( ; --i >= 0; ) {
  5462. matchIndexes.push( i );
  5463. }
  5464. return matchIndexes;
  5465. }),
  5466. "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
  5467. var i = argument < 0 ? argument + length : argument;
  5468. for ( ; ++i < length; ) {
  5469. matchIndexes.push( i );
  5470. }
  5471. return matchIndexes;
  5472. })
  5473. }
  5474. };
  5475. Expr.pseudos["nth"] = Expr.pseudos["eq"];
  5476. // Add button/input type pseudos
  5477. for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
  5478. Expr.pseudos[ i ] = createInputPseudo( i );
  5479. }
  5480. for ( i in { submit: true, reset: true } ) {
  5481. Expr.pseudos[ i ] = createButtonPseudo( i );
  5482. }
  5483. // Easy API for creating new setFilters
  5484. function setFilters() {}
  5485. setFilters.prototype = Expr.filters = Expr.pseudos;
  5486. Expr.setFilters = new setFilters();
  5487. tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
  5488. var matched, match, tokens, type,
  5489. soFar, groups, preFilters,
  5490. cached = tokenCache[ selector + " " ];
  5491. if ( cached ) {
  5492. return parseOnly ? 0 : cached.slice( 0 );
  5493. }
  5494. soFar = selector;
  5495. groups = [];
  5496. preFilters = Expr.preFilter;
  5497. while ( soFar ) {
  5498. // Comma and first run
  5499. if ( !matched || (match = rcomma.exec( soFar )) ) {
  5500. if ( match ) {
  5501. // Don't consume trailing commas as valid
  5502. soFar = soFar.slice( match[0].length ) || soFar;
  5503. }
  5504. groups.push( (tokens = []) );
  5505. }
  5506. matched = false;
  5507. // Combinators
  5508. if ( (match = rcombinators.exec( soFar )) ) {
  5509. matched = match.shift();
  5510. tokens.push({
  5511. value: matched,
  5512. // Cast descendant combinators to space
  5513. type: match[0].replace( rtrim, " " )
  5514. });
  5515. soFar = soFar.slice( matched.length );
  5516. }
  5517. // Filters
  5518. for ( type in Expr.filter ) {
  5519. if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
  5520. (match = preFilters[ type ]( match ))) ) {
  5521. matched = match.shift();
  5522. tokens.push({
  5523. value: matched,
  5524. type: type,
  5525. matches: match
  5526. });
  5527. soFar = soFar.slice( matched.length );
  5528. }
  5529. }
  5530. if ( !matched ) {
  5531. break;
  5532. }
  5533. }
  5534. // Return the length of the invalid excess
  5535. // if we're just parsing
  5536. // Otherwise, throw an error or return tokens
  5537. return parseOnly ?
  5538. soFar.length :
  5539. soFar ?
  5540. Sizzle.error( selector ) :
  5541. // Cache the tokens
  5542. tokenCache( selector, groups ).slice( 0 );
  5543. };
  5544. function toSelector( tokens ) {
  5545. var i = 0,
  5546. len = tokens.length,
  5547. selector = "";
  5548. for ( ; i < len; i++ ) {
  5549. selector += tokens[i].value;
  5550. }
  5551. return selector;
  5552. }
  5553. function addCombinator( matcher, combinator, base ) {
  5554. var dir = combinator.dir,
  5555. skip = combinator.next,
  5556. key = skip || dir,
  5557. checkNonElements = base && key === "parentNode",
  5558. doneName = done++;
  5559. return combinator.first ?
  5560. // Check against closest ancestor/preceding element
  5561. function( elem, context, xml ) {
  5562. while ( (elem = elem[ dir ]) ) {
  5563. if ( elem.nodeType === 1 || checkNonElements ) {
  5564. return matcher( elem, context, xml );
  5565. }
  5566. }
  5567. return false;
  5568. } :
  5569. // Check against all ancestor/preceding elements
  5570. function( elem, context, xml ) {
  5571. var oldCache, uniqueCache, outerCache,
  5572. newCache = [ dirruns, doneName ];
  5573. // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
  5574. if ( xml ) {
  5575. while ( (elem = elem[ dir ]) ) {
  5576. if ( elem.nodeType === 1 || checkNonElements ) {
  5577. if ( matcher( elem, context, xml ) ) {
  5578. return true;
  5579. }
  5580. }
  5581. }
  5582. } else {
  5583. while ( (elem = elem[ dir ]) ) {
  5584. if ( elem.nodeType === 1 || checkNonElements ) {
  5585. outerCache = elem[ expando ] || (elem[ expando ] = {});
  5586. // Support: IE <9 only
  5587. // Defend against cloned attroperties (jQuery gh-1709)
  5588. uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {});
  5589. if ( skip && skip === elem.nodeName.toLowerCase() ) {
  5590. elem = elem[ dir ] || elem;
  5591. } else if ( (oldCache = uniqueCache[ key ]) &&
  5592. oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
  5593. // Assign to newCache so results back-propagate to previous elements
  5594. return (newCache[ 2 ] = oldCache[ 2 ]);
  5595. } else {
  5596. // Reuse newcache so results back-propagate to previous elements
  5597. uniqueCache[ key ] = newCache;
  5598. // A match means we're done; a fail means we have to keep checking
  5599. if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
  5600. return true;
  5601. }
  5602. }
  5603. }
  5604. }
  5605. }
  5606. return false;
  5607. };
  5608. }
  5609. function elementMatcher( matchers ) {
  5610. return matchers.length > 1 ?
  5611. function( elem, context, xml ) {
  5612. var i = matchers.length;
  5613. while ( i-- ) {
  5614. if ( !matchers[i]( elem, context, xml ) ) {
  5615. return false;
  5616. }
  5617. }
  5618. return true;
  5619. } :
  5620. matchers[0];
  5621. }
  5622. function multipleContexts( selector, contexts, results ) {
  5623. var i = 0,
  5624. len = contexts.length;
  5625. for ( ; i < len; i++ ) {
  5626. Sizzle( selector, contexts[i], results );
  5627. }
  5628. return results;
  5629. }
  5630. function condense( unmatched, map, filter, context, xml ) {
  5631. var elem,
  5632. newUnmatched = [],
  5633. i = 0,
  5634. len = unmatched.length,
  5635. mapped = map != null;
  5636. for ( ; i < len; i++ ) {
  5637. if ( (elem = unmatched[i]) ) {
  5638. if ( !filter || filter( elem, context, xml ) ) {
  5639. newUnmatched.push( elem );
  5640. if ( mapped ) {
  5641. map.push( i );
  5642. }
  5643. }
  5644. }
  5645. }
  5646. return newUnmatched;
  5647. }
  5648. function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
  5649. if ( postFilter && !postFilter[ expando ] ) {
  5650. postFilter = setMatcher( postFilter );
  5651. }
  5652. if ( postFinder && !postFinder[ expando ] ) {
  5653. postFinder = setMatcher( postFinder, postSelector );
  5654. }
  5655. return markFunction(function( seed, results, context, xml ) {
  5656. var temp, i, elem,
  5657. preMap = [],
  5658. postMap = [],
  5659. preexisting = results.length,
  5660. // Get initial elements from seed or context
  5661. elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
  5662. // Prefilter to get matcher input, preserving a map for seed-results synchronization
  5663. matcherIn = preFilter && ( seed || !selector ) ?
  5664. condense( elems, preMap, preFilter, context, xml ) :
  5665. elems,
  5666. matcherOut = matcher ?
  5667. // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
  5668. postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
  5669. // ...intermediate processing is necessary
  5670. [] :
  5671. // ...otherwise use results directly
  5672. results :
  5673. matcherIn;
  5674. // Find primary matches
  5675. if ( matcher ) {
  5676. matcher( matcherIn, matcherOut, context, xml );
  5677. }
  5678. // Apply postFilter
  5679. if ( postFilter ) {
  5680. temp = condense( matcherOut, postMap );
  5681. postFilter( temp, [], context, xml );
  5682. // Un-match failing elements by moving them back to matcherIn
  5683. i = temp.length;
  5684. while ( i-- ) {
  5685. if ( (elem = temp[i]) ) {
  5686. matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
  5687. }
  5688. }
  5689. }
  5690. if ( seed ) {
  5691. if ( postFinder || preFilter ) {
  5692. if ( postFinder ) {
  5693. // Get the final matcherOut by condensing this intermediate into postFinder contexts
  5694. temp = [];
  5695. i = matcherOut.length;
  5696. while ( i-- ) {
  5697. if ( (elem = matcherOut[i]) ) {
  5698. // Restore matcherIn since elem is not yet a final match
  5699. temp.push( (matcherIn[i] = elem) );
  5700. }
  5701. }
  5702. postFinder( null, (matcherOut = []), temp, xml );
  5703. }
  5704. // Move matched elements from seed to results to keep them synchronized
  5705. i = matcherOut.length;
  5706. while ( i-- ) {
  5707. if ( (elem = matcherOut[i]) &&
  5708. (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
  5709. seed[temp] = !(results[temp] = elem);
  5710. }
  5711. }
  5712. }
  5713. // Add elements to results, through postFinder if defined
  5714. } else {
  5715. matcherOut = condense(
  5716. matcherOut === results ?
  5717. matcherOut.splice( preexisting, matcherOut.length ) :
  5718. matcherOut
  5719. );
  5720. if ( postFinder ) {
  5721. postFinder( null, results, matcherOut, xml );
  5722. } else {
  5723. push.apply( results, matcherOut );
  5724. }
  5725. }
  5726. });
  5727. }
  5728. function matcherFromTokens( tokens ) {
  5729. var checkContext, matcher, j,
  5730. len = tokens.length,
  5731. leadingRelative = Expr.relative[ tokens[0].type ],
  5732. implicitRelative = leadingRelative || Expr.relative[" "],
  5733. i = leadingRelative ? 1 : 0,
  5734. // The foundational matcher ensures that elements are reachable from top-level context(s)
  5735. matchContext = addCombinator( function( elem ) {
  5736. return elem === checkContext;
  5737. }, implicitRelative, true ),
  5738. matchAnyContext = addCombinator( function( elem ) {
  5739. return indexOf( checkContext, elem ) > -1;
  5740. }, implicitRelative, true ),
  5741. matchers = [ function( elem, context, xml ) {
  5742. var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
  5743. (checkContext = context).nodeType ?
  5744. matchContext( elem, context, xml ) :
  5745. matchAnyContext( elem, context, xml ) );
  5746. // Avoid hanging onto element (issue #299)
  5747. checkContext = null;
  5748. return ret;
  5749. } ];
  5750. for ( ; i < len; i++ ) {
  5751. if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
  5752. matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
  5753. } else {
  5754. matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
  5755. // Return special upon seeing a positional matcher
  5756. if ( matcher[ expando ] ) {
  5757. // Find the next relative operator (if any) for proper handling
  5758. j = ++i;
  5759. for ( ; j < len; j++ ) {
  5760. if ( Expr.relative[ tokens[j].type ] ) {
  5761. break;
  5762. }
  5763. }
  5764. return setMatcher(
  5765. i > 1 && elementMatcher( matchers ),
  5766. i > 1 && toSelector(
  5767. // If the preceding token was a descendant combinator, insert an implicit any-element `*`
  5768. tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
  5769. ).replace( rtrim, "$1" ),
  5770. matcher,
  5771. i < j && matcherFromTokens( tokens.slice( i, j ) ),
  5772. j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
  5773. j < len && toSelector( tokens )
  5774. );
  5775. }
  5776. matchers.push( matcher );
  5777. }
  5778. }
  5779. return elementMatcher( matchers );
  5780. }
  5781. function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
  5782. var bySet = setMatchers.length > 0,
  5783. byElement = elementMatchers.length > 0,
  5784. superMatcher = function( seed, context, xml, results, outermost ) {
  5785. var elem, j, matcher,
  5786. matchedCount = 0,
  5787. i = "0",
  5788. unmatched = seed && [],
  5789. setMatched = [],
  5790. contextBackup = outermostContext,
  5791. // We must always have either seed elements or outermost context
  5792. elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
  5793. // Use integer dirruns iff this is the outermost matcher
  5794. dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
  5795. len = elems.length;
  5796. if ( outermost ) {
  5797. outermostContext = context === document || context || outermost;
  5798. }
  5799. // Add elements passing elementMatchers directly to results
  5800. // Support: IE<9, Safari
  5801. // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
  5802. for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
  5803. if ( byElement && elem ) {
  5804. j = 0;
  5805. if ( !context && elem.ownerDocument !== document ) {
  5806. setDocument( elem );
  5807. xml = !documentIsHTML;
  5808. }
  5809. while ( (matcher = elementMatchers[j++]) ) {
  5810. if ( matcher( elem, context || document, xml) ) {
  5811. results.push( elem );
  5812. break;
  5813. }
  5814. }
  5815. if ( outermost ) {
  5816. dirruns = dirrunsUnique;
  5817. }
  5818. }
  5819. // Track unmatched elements for set filters
  5820. if ( bySet ) {
  5821. // They will have gone through all possible matchers
  5822. if ( (elem = !matcher && elem) ) {
  5823. matchedCount--;
  5824. }
  5825. // Lengthen the array for every element, matched or not
  5826. if ( seed ) {
  5827. unmatched.push( elem );
  5828. }
  5829. }
  5830. }
  5831. // `i` is now the count of elements visited above, and adding it to `matchedCount`
  5832. // makes the latter nonnegative.
  5833. matchedCount += i;
  5834. // Apply set filters to unmatched elements
  5835. // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`
  5836. // equals `i`), unless we didn't visit _any_ elements in the above loop because we have
  5837. // no element matchers and no seed.
  5838. // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that
  5839. // case, which will result in a "00" `matchedCount` that differs from `i` but is also
  5840. // numerically zero.
  5841. if ( bySet && i !== matchedCount ) {
  5842. j = 0;
  5843. while ( (matcher = setMatchers[j++]) ) {
  5844. matcher( unmatched, setMatched, context, xml );
  5845. }
  5846. if ( seed ) {
  5847. // Reintegrate element matches to eliminate the need for sorting
  5848. if ( matchedCount > 0 ) {
  5849. while ( i-- ) {
  5850. if ( !(unmatched[i] || setMatched[i]) ) {
  5851. setMatched[i] = pop.call( results );
  5852. }
  5853. }
  5854. }
  5855. // Discard index placeholder values to get only actual matches
  5856. setMatched = condense( setMatched );
  5857. }
  5858. // Add matches to results
  5859. push.apply( results, setMatched );
  5860. // Seedless set matches succeeding multiple successful matchers stipulate sorting
  5861. if ( outermost && !seed && setMatched.length > 0 &&
  5862. ( matchedCount + setMatchers.length ) > 1 ) {
  5863. Sizzle.uniqueSort( results );
  5864. }
  5865. }
  5866. // Override manipulation of globals by nested matchers
  5867. if ( outermost ) {
  5868. dirruns = dirrunsUnique;
  5869. outermostContext = contextBackup;
  5870. }
  5871. return unmatched;
  5872. };
  5873. return bySet ?
  5874. markFunction( superMatcher ) :
  5875. superMatcher;
  5876. }
  5877. compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
  5878. var i,
  5879. setMatchers = [],
  5880. elementMatchers = [],
  5881. cached = compilerCache[ selector + " " ];
  5882. if ( !cached ) {
  5883. // Generate a function of recursive functions that can be used to check each element
  5884. if ( !match ) {
  5885. match = tokenize( selector );
  5886. }
  5887. i = match.length;
  5888. while ( i-- ) {
  5889. cached = matcherFromTokens( match[i] );
  5890. if ( cached[ expando ] ) {
  5891. setMatchers.push( cached );
  5892. } else {
  5893. elementMatchers.push( cached );
  5894. }
  5895. }
  5896. // Cache the compiled function
  5897. cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
  5898. // Save selector and tokenization
  5899. cached.selector = selector;
  5900. }
  5901. return cached;
  5902. };
  5903. /**
  5904. * A low-level selection function that works with Sizzle's compiled
  5905. * selector functions
  5906. * @param {String|Function} selector A selector or a pre-compiled
  5907. * selector function built with Sizzle.compile
  5908. * @param {Element} context
  5909. * @param {Array} [results]
  5910. * @param {Array} [seed] A set of elements to match against
  5911. */
  5912. select = Sizzle.select = function( selector, context, results, seed ) {
  5913. var i, tokens, token, type, find,
  5914. compiled = typeof selector === "function" && selector,
  5915. match = !seed && tokenize( (selector = compiled.selector || selector) );
  5916. results = results || [];
  5917. // Try to minimize operations if there is only one selector in the list and no seed
  5918. // (the latter of which guarantees us context)
  5919. if ( match.length === 1 ) {
  5920. // Reduce context if the leading compound selector is an ID
  5921. tokens = match[0] = match[0].slice( 0 );
  5922. if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
  5923. context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) {
  5924. context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
  5925. if ( !context ) {
  5926. return results;
  5927. // Precompiled matchers will still verify ancestry, so step up a level
  5928. } else if ( compiled ) {
  5929. context = context.parentNode;
  5930. }
  5931. selector = selector.slice( tokens.shift().value.length );
  5932. }
  5933. // Fetch a seed set for right-to-left matching
  5934. i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
  5935. while ( i-- ) {
  5936. token = tokens[i];
  5937. // Abort if we hit a combinator
  5938. if ( Expr.relative[ (type = token.type) ] ) {
  5939. break;
  5940. }
  5941. if ( (find = Expr.find[ type ]) ) {
  5942. // Search, expanding context for leading sibling combinators
  5943. if ( (seed = find(
  5944. token.matches[0].replace( runescape, funescape ),
  5945. rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
  5946. )) ) {
  5947. // If seed is empty or no tokens remain, we can return early
  5948. tokens.splice( i, 1 );
  5949. selector = seed.length && toSelector( tokens );
  5950. if ( !selector ) {
  5951. push.apply( results, seed );
  5952. return results;
  5953. }
  5954. break;
  5955. }
  5956. }
  5957. }
  5958. }
  5959. // Compile and execute a filtering function if one is not provided
  5960. // Provide `match` to avoid retokenization if we modified the selector above
  5961. ( compiled || compile( selector, match ) )(
  5962. seed,
  5963. context,
  5964. !documentIsHTML,
  5965. results,
  5966. !context || rsibling.test( selector ) && testContext( context.parentNode ) || context
  5967. );
  5968. return results;
  5969. };
  5970. // One-time assignments
  5971. // Sort stability
  5972. support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
  5973. // Support: Chrome 14-35+
  5974. // Always assume duplicates if they aren't passed to the comparison function
  5975. support.detectDuplicates = !!hasDuplicate;
  5976. // Initialize against the default document
  5977. setDocument();
  5978. // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
  5979. // Detached nodes confoundingly follow *each other*
  5980. support.sortDetached = assert(function( el ) {
  5981. // Should return 1, but returns 4 (following)
  5982. return el.compareDocumentPosition( document.createElement("fieldset") ) & 1;
  5983. });
  5984. // Support: IE<8
  5985. // Prevent attribute/property "interpolation"
  5986. // https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
  5987. if ( !assert(function( el ) {
  5988. el.innerHTML = "<a href='#'></a>";
  5989. return el.firstChild.getAttribute("href") === "#" ;
  5990. }) ) {
  5991. addHandle( "type|href|height|width", function( elem, name, isXML ) {
  5992. if ( !isXML ) {
  5993. return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
  5994. }
  5995. });
  5996. }
  5997. // Support: IE<9
  5998. // Use defaultValue in place of getAttribute("value")
  5999. if ( !support.attributes || !assert(function( el ) {
  6000. el.innerHTML = "<input/>";
  6001. el.firstChild.setAttribute( "value", "" );
  6002. return el.firstChild.getAttribute( "value" ) === "";
  6003. }) ) {
  6004. addHandle( "value", function( elem, name, isXML ) {
  6005. if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
  6006. return elem.defaultValue;
  6007. }
  6008. });
  6009. }
  6010. // Support: IE<9
  6011. // Use getAttributeNode to fetch booleans when getAttribute lies
  6012. if ( !assert(function( el ) {
  6013. return el.getAttribute("disabled") == null;
  6014. }) ) {
  6015. addHandle( booleans, function( elem, name, isXML ) {
  6016. var val;
  6017. if ( !isXML ) {
  6018. return elem[ name ] === true ? name.toLowerCase() :
  6019. (val = elem.getAttributeNode( name )) && val.specified ?
  6020. val.value :
  6021. null;
  6022. }
  6023. });
  6024. }
  6025. return Sizzle;
  6026. })( window );
  6027. jQuery.find = Sizzle;
  6028. jQuery.expr = Sizzle.selectors;
  6029. // Deprecated
  6030. jQuery.expr[ ":" ] = jQuery.expr.pseudos;
  6031. jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;
  6032. jQuery.text = Sizzle.getText;
  6033. jQuery.isXMLDoc = Sizzle.isXML;
  6034. jQuery.contains = Sizzle.contains;
  6035. jQuery.escapeSelector = Sizzle.escape;
  6036. var dir = function( elem, dir, until ) {
  6037. var matched = [],
  6038. truncate = until !== undefined;
  6039. while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {
  6040. if ( elem.nodeType === 1 ) {
  6041. if ( truncate && jQuery( elem ).is( until ) ) {
  6042. break;
  6043. }
  6044. matched.push( elem );
  6045. }
  6046. }
  6047. return matched;
  6048. };
  6049. var siblings = function( n, elem ) {
  6050. var matched = [];
  6051. for ( ; n; n = n.nextSibling ) {
  6052. if ( n.nodeType === 1 && n !== elem ) {
  6053. matched.push( n );
  6054. }
  6055. }
  6056. return matched;
  6057. };
  6058. var rneedsContext = jQuery.expr.match.needsContext;
  6059. var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i );
  6060. var risSimple = /^.[^:#\[\.,]*$/;
  6061. // Implement the identical functionality for filter and not
  6062. function winnow( elements, qualifier, not ) {
  6063. if ( jQuery.isFunction( qualifier ) ) {
  6064. return jQuery.grep( elements, function( elem, i ) {
  6065. return !!qualifier.call( elem, i, elem ) !== not;
  6066. } );
  6067. }
  6068. // Single element
  6069. if ( qualifier.nodeType ) {
  6070. return jQuery.grep( elements, function( elem ) {
  6071. return ( elem === qualifier ) !== not;
  6072. } );
  6073. }
  6074. // Arraylike of elements (jQuery, arguments, Array)
  6075. if ( typeof qualifier !== "string" ) {
  6076. return jQuery.grep( elements, function( elem ) {
  6077. return ( indexOf.call( qualifier, elem ) > -1 ) !== not;
  6078. } );
  6079. }
  6080. // Simple selector that can be filtered directly, removing non-Elements
  6081. if ( risSimple.test( qualifier ) ) {
  6082. return jQuery.filter( qualifier, elements, not );
  6083. }
  6084. // Complex selector, compare the two sets, removing non-Elements
  6085. qualifier = jQuery.filter( qualifier, elements );
  6086. return jQuery.grep( elements, function( elem ) {
  6087. return ( indexOf.call( qualifier, elem ) > -1 ) !== not && elem.nodeType === 1;
  6088. } );
  6089. }
  6090. jQuery.filter = function( expr, elems, not ) {
  6091. var elem = elems[ 0 ];
  6092. if ( not ) {
  6093. expr = ":not(" + expr + ")";
  6094. }
  6095. if ( elems.length === 1 && elem.nodeType === 1 ) {
  6096. return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];
  6097. }
  6098. return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
  6099. return elem.nodeType === 1;
  6100. } ) );
  6101. };
  6102. jQuery.fn.extend( {
  6103. find: function( selector ) {
  6104. var i, ret,
  6105. len = this.length,
  6106. self = this;
  6107. if ( typeof selector !== "string" ) {
  6108. return this.pushStack( jQuery( selector ).filter( function() {
  6109. for ( i = 0; i < len; i++ ) {
  6110. if ( jQuery.contains( self[ i ], this ) ) {
  6111. return true;
  6112. }
  6113. }
  6114. } ) );
  6115. }
  6116. ret = this.pushStack( [] );
  6117. for ( i = 0; i < len; i++ ) {
  6118. jQuery.find( selector, self[ i ], ret );
  6119. }
  6120. return len > 1 ? jQuery.uniqueSort( ret ) : ret;
  6121. },
  6122. filter: function( selector ) {
  6123. return this.pushStack( winnow( this, selector || [], false ) );
  6124. },
  6125. not: function( selector ) {
  6126. return this.pushStack( winnow( this, selector || [], true ) );
  6127. },
  6128. is: function( selector ) {
  6129. return !!winnow(
  6130. this,
  6131. // If this is a positional/relative selector, check membership in the returned set
  6132. // so $("p:first").is("p:last") won't return true for a doc with two "p".
  6133. typeof selector === "string" && rneedsContext.test( selector ) ?
  6134. jQuery( selector ) :
  6135. selector || [],
  6136. false
  6137. ).length;
  6138. }
  6139. } );
  6140. // Initialize a jQuery object
  6141. // A central reference to the root jQuery(document)
  6142. var rootjQuery,
  6143. // A simple way to check for HTML strings
  6144. // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
  6145. // Strict HTML recognition (#11290: must start with <)
  6146. // Shortcut simple #id case for speed
  6147. rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
  6148. init = jQuery.fn.init = function( selector, context, root ) {
  6149. var match, elem;
  6150. // HANDLE: $(""), $(null), $(undefined), $(false)
  6151. if ( !selector ) {
  6152. return this;
  6153. }
  6154. // Method init() accepts an alternate rootjQuery
  6155. // so migrate can support jQuery.sub (gh-2101)
  6156. root = root || rootjQuery;
  6157. // Handle HTML strings
  6158. if ( typeof selector === "string" ) {
  6159. if ( selector[ 0 ] === "<" &&
  6160. selector[ selector.length - 1 ] === ">" &&
  6161. selector.length >= 3 ) {
  6162. // Assume that strings that start and end with <> are HTML and skip the regex check
  6163. match = [ null, selector, null ];
  6164. } else {
  6165. match = rquickExpr.exec( selector );
  6166. }
  6167. // Match html or make sure no context is specified for #id
  6168. if ( match && ( match[ 1 ] || !context ) ) {
  6169. // HANDLE: $(html) -> $(array)
  6170. if ( match[ 1 ] ) {
  6171. context = context instanceof jQuery ? context[ 0 ] : context;
  6172. // Option to run scripts is true for back-compat
  6173. // Intentionally let the error be thrown if parseHTML is not present
  6174. jQuery.merge( this, jQuery.parseHTML(
  6175. match[ 1 ],
  6176. context && context.nodeType ? context.ownerDocument || context : document,
  6177. true
  6178. ) );
  6179. // HANDLE: $(html, props)
  6180. if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {
  6181. for ( match in context ) {
  6182. // Properties of context are called as methods if possible
  6183. if ( jQuery.isFunction( this[ match ] ) ) {
  6184. this[ match ]( context[ match ] );
  6185. // ...and otherwise set as attributes
  6186. } else {
  6187. this.attr( match, context[ match ] );
  6188. }
  6189. }
  6190. }
  6191. return this;
  6192. // HANDLE: $(#id)
  6193. } else {
  6194. elem = document.getElementById( match[ 2 ] );
  6195. if ( elem ) {
  6196. // Inject the element directly into the jQuery object
  6197. this[ 0 ] = elem;
  6198. this.length = 1;
  6199. }
  6200. return this;
  6201. }
  6202. // HANDLE: $(expr, $(...))
  6203. } else if ( !context || context.jquery ) {
  6204. return ( context || root ).find( selector );
  6205. // HANDLE: $(expr, context)
  6206. // (which is just equivalent to: $(context).find(expr)
  6207. } else {
  6208. return this.constructor( context ).find( selector );
  6209. }
  6210. // HANDLE: $(DOMElement)
  6211. } else if ( selector.nodeType ) {
  6212. this[ 0 ] = selector;
  6213. this.length = 1;
  6214. return this;
  6215. // HANDLE: $(function)
  6216. // Shortcut for document ready
  6217. } else if ( jQuery.isFunction( selector ) ) {
  6218. return root.ready !== undefined ?
  6219. root.ready( selector ) :
  6220. // Execute immediately if ready is not present
  6221. selector( jQuery );
  6222. }
  6223. return jQuery.makeArray( selector, this );
  6224. };
  6225. // Give the init function the jQuery prototype for later instantiation
  6226. init.prototype = jQuery.fn;
  6227. // Initialize central reference
  6228. rootjQuery = jQuery( document );
  6229. var rparentsprev = /^(?:parents|prev(?:Until|All))/,
  6230. // Methods guaranteed to produce a unique set when starting from a unique set
  6231. guaranteedUnique = {
  6232. children: true,
  6233. contents: true,
  6234. next: true,
  6235. prev: true
  6236. };
  6237. jQuery.fn.extend( {
  6238. has: function( target ) {
  6239. var targets = jQuery( target, this ),
  6240. l = targets.length;
  6241. return this.filter( function() {
  6242. var i = 0;
  6243. for ( ; i < l; i++ ) {
  6244. if ( jQuery.contains( this, targets[ i ] ) ) {
  6245. return true;
  6246. }
  6247. }
  6248. } );
  6249. },
  6250. closest: function( selectors, context ) {
  6251. var cur,
  6252. i = 0,
  6253. l = this.length,
  6254. matched = [],
  6255. targets = typeof selectors !== "string" && jQuery( selectors );
  6256. // Positional selectors never match, since there's no _selection_ context
  6257. if ( !rneedsContext.test( selectors ) ) {
  6258. for ( ; i < l; i++ ) {
  6259. for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {
  6260. // Always skip document fragments
  6261. if ( cur.nodeType < 11 && ( targets ?
  6262. targets.index( cur ) > -1 :
  6263. // Don't pass non-elements to Sizzle
  6264. cur.nodeType === 1 &&
  6265. jQuery.find.matchesSelector( cur, selectors ) ) ) {
  6266. matched.push( cur );
  6267. break;
  6268. }
  6269. }
  6270. }
  6271. }
  6272. return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );
  6273. },
  6274. // Determine the position of an element within the set
  6275. index: function( elem ) {
  6276. // No argument, return index in parent
  6277. if ( !elem ) {
  6278. return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
  6279. }
  6280. // Index in selector
  6281. if ( typeof elem === "string" ) {
  6282. return indexOf.call( jQuery( elem ), this[ 0 ] );
  6283. }
  6284. // Locate the position of the desired element
  6285. return indexOf.call( this,
  6286. // If it receives a jQuery object, the first element is used
  6287. elem.jquery ? elem[ 0 ] : elem
  6288. );
  6289. },
  6290. add: function( selector, context ) {
  6291. return this.pushStack(
  6292. jQuery.uniqueSort(
  6293. jQuery.merge( this.get(), jQuery( selector, context ) )
  6294. )
  6295. );
  6296. },
  6297. addBack: function( selector ) {
  6298. return this.add( selector == null ?
  6299. this.prevObject : this.prevObject.filter( selector )
  6300. );
  6301. }
  6302. } );
  6303. function sibling( cur, dir ) {
  6304. while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}
  6305. return cur;
  6306. }
  6307. jQuery.each( {
  6308. parent: function( elem ) {
  6309. var parent = elem.parentNode;
  6310. return parent && parent.nodeType !== 11 ? parent : null;
  6311. },
  6312. parents: function( elem ) {
  6313. return dir( elem, "parentNode" );
  6314. },
  6315. parentsUntil: function( elem, i, until ) {
  6316. return dir( elem, "parentNode", until );
  6317. },
  6318. next: function( elem ) {
  6319. return sibling( elem, "nextSibling" );
  6320. },
  6321. prev: function( elem ) {
  6322. return sibling( elem, "previousSibling" );
  6323. },
  6324. nextAll: function( elem ) {
  6325. return dir( elem, "nextSibling" );
  6326. },
  6327. prevAll: function( elem ) {
  6328. return dir( elem, "previousSibling" );
  6329. },
  6330. nextUntil: function( elem, i, until ) {
  6331. return dir( elem, "nextSibling", until );
  6332. },
  6333. prevUntil: function( elem, i, until ) {
  6334. return dir( elem, "previousSibling", until );
  6335. },
  6336. siblings: function( elem ) {
  6337. return siblings( ( elem.parentNode || {} ).firstChild, elem );
  6338. },
  6339. children: function( elem ) {
  6340. return siblings( elem.firstChild );
  6341. },
  6342. contents: function( elem ) {
  6343. return elem.contentDocument || jQuery.merge( [], elem.childNodes );
  6344. }
  6345. }, function( name, fn ) {
  6346. jQuery.fn[ name ] = function( until, selector ) {
  6347. var matched = jQuery.map( this, fn, until );
  6348. if ( name.slice( -5 ) !== "Until" ) {
  6349. selector = until;
  6350. }
  6351. if ( selector && typeof selector === "string" ) {
  6352. matched = jQuery.filter( selector, matched );
  6353. }
  6354. if ( this.length > 1 ) {
  6355. // Remove duplicates
  6356. if ( !guaranteedUnique[ name ] ) {
  6357. jQuery.uniqueSort( matched );
  6358. }
  6359. // Reverse order for parents* and prev-derivatives
  6360. if ( rparentsprev.test( name ) ) {
  6361. matched.reverse();
  6362. }
  6363. }
  6364. return this.pushStack( matched );
  6365. };
  6366. } );
  6367. var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g );
  6368. // Convert String-formatted options into Object-formatted ones
  6369. function createOptions( options ) {
  6370. var object = {};
  6371. jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {
  6372. object[ flag ] = true;
  6373. } );
  6374. return object;
  6375. }
  6376. /*
  6377. * Create a callback list using the following parameters:
  6378. *
  6379. * options: an optional list of space-separated options that will change how
  6380. * the callback list behaves or a more traditional option object
  6381. *
  6382. * By default a callback list will act like an event callback list and can be
  6383. * "fired" multiple times.
  6384. *
  6385. * Possible options:
  6386. *
  6387. * once: will ensure the callback list can only be fired once (like a Deferred)
  6388. *
  6389. * memory: will keep track of previous values and will call any callback added
  6390. * after the list has been fired right away with the latest "memorized"
  6391. * values (like a Deferred)
  6392. *
  6393. * unique: will ensure a callback can only be added once (no duplicate in the list)
  6394. *
  6395. * stopOnFalse: interrupt callings when a callback returns false
  6396. *
  6397. */
  6398. jQuery.Callbacks = function( options ) {
  6399. // Convert options from String-formatted to Object-formatted if needed
  6400. // (we check in cache first)
  6401. options = typeof options === "string" ?
  6402. createOptions( options ) :
  6403. jQuery.extend( {}, options );
  6404. var // Flag to know if list is currently firing
  6405. firing,
  6406. // Last fire value for non-forgettable lists
  6407. memory,
  6408. // Flag to know if list was already fired
  6409. fired,
  6410. // Flag to prevent firing
  6411. locked,
  6412. // Actual callback list
  6413. list = [],
  6414. // Queue of execution data for repeatable lists
  6415. queue = [],
  6416. // Index of currently firing callback (modified by add/remove as needed)
  6417. firingIndex = -1,
  6418. // Fire callbacks
  6419. fire = function() {
  6420. // Enforce single-firing
  6421. locked = options.once;
  6422. // Execute callbacks for all pending executions,
  6423. // respecting firingIndex overrides and runtime changes
  6424. fired = firing = true;
  6425. for ( ; queue.length; firingIndex = -1 ) {
  6426. memory = queue.shift();
  6427. while ( ++firingIndex < list.length ) {
  6428. // Run callback and check for early termination
  6429. if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&
  6430. options.stopOnFalse ) {
  6431. // Jump to end and forget the data so .add doesn't re-fire
  6432. firingIndex = list.length;
  6433. memory = false;
  6434. }
  6435. }
  6436. }
  6437. // Forget the data if we're done with it
  6438. if ( !options.memory ) {
  6439. memory = false;
  6440. }
  6441. firing = false;
  6442. // Clean up if we're done firing for good
  6443. if ( locked ) {
  6444. // Keep an empty list if we have data for future add calls
  6445. if ( memory ) {
  6446. list = [];
  6447. // Otherwise, this object is spent
  6448. } else {
  6449. list = "";
  6450. }
  6451. }
  6452. },
  6453. // Actual Callbacks object
  6454. self = {
  6455. // Add a callback or a collection of callbacks to the list
  6456. add: function() {
  6457. if ( list ) {
  6458. // If we have memory from a past run, we should fire after adding
  6459. if ( memory && !firing ) {
  6460. firingIndex = list.length - 1;
  6461. queue.push( memory );
  6462. }
  6463. ( function add( args ) {
  6464. jQuery.each( args, function( _, arg ) {
  6465. if ( jQuery.isFunction( arg ) ) {
  6466. if ( !options.unique || !self.has( arg ) ) {
  6467. list.push( arg );
  6468. }
  6469. } else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) {
  6470. // Inspect recursively
  6471. add( arg );
  6472. }
  6473. } );
  6474. } )( arguments );
  6475. if ( memory && !firing ) {
  6476. fire();
  6477. }
  6478. }
  6479. return this;
  6480. },
  6481. // Remove a callback from the list
  6482. remove: function() {
  6483. jQuery.each( arguments, function( _, arg ) {
  6484. var index;
  6485. while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
  6486. list.splice( index, 1 );
  6487. // Handle firing indexes
  6488. if ( index <= firingIndex ) {
  6489. firingIndex--;
  6490. }
  6491. }
  6492. } );
  6493. return this;
  6494. },
  6495. // Check if a given callback is in the list.
  6496. // If no argument is given, return whether or not list has callbacks attached.
  6497. has: function( fn ) {
  6498. return fn ?
  6499. jQuery.inArray( fn, list ) > -1 :
  6500. list.length > 0;
  6501. },
  6502. // Remove all callbacks from the list
  6503. empty: function() {
  6504. if ( list ) {
  6505. list = [];
  6506. }
  6507. return this;
  6508. },
  6509. // Disable .fire and .add
  6510. // Abort any current/pending executions
  6511. // Clear all callbacks and values
  6512. disable: function() {
  6513. locked = queue = [];
  6514. list = memory = "";
  6515. return this;
  6516. },
  6517. disabled: function() {
  6518. return !list;
  6519. },
  6520. // Disable .fire
  6521. // Also disable .add unless we have memory (since it would have no effect)
  6522. // Abort any pending executions
  6523. lock: function() {
  6524. locked = queue = [];
  6525. if ( !memory && !firing ) {
  6526. list = memory = "";
  6527. }
  6528. return this;
  6529. },
  6530. locked: function() {
  6531. return !!locked;
  6532. },
  6533. // Call all callbacks with the given context and arguments
  6534. fireWith: function( context, args ) {
  6535. if ( !locked ) {
  6536. args = args || [];
  6537. args = [ context, args.slice ? args.slice() : args ];
  6538. queue.push( args );
  6539. if ( !firing ) {
  6540. fire();
  6541. }
  6542. }
  6543. return this;
  6544. },
  6545. // Call all the callbacks with the given arguments
  6546. fire: function() {
  6547. self.fireWith( this, arguments );
  6548. return this;
  6549. },
  6550. // To know if the callbacks have already been called at least once
  6551. fired: function() {
  6552. return !!fired;
  6553. }
  6554. };
  6555. return self;
  6556. };
  6557. function Identity( v ) {
  6558. return v;
  6559. }
  6560. function Thrower( ex ) {
  6561. throw ex;
  6562. }
  6563. function adoptValue( value, resolve, reject ) {
  6564. var method;
  6565. try {
  6566. // Check for promise aspect first to privilege synchronous behavior
  6567. if ( value && jQuery.isFunction( ( method = value.promise ) ) ) {
  6568. method.call( value ).done( resolve ).fail( reject );
  6569. // Other thenables
  6570. } else if ( value && jQuery.isFunction( ( method = value.then ) ) ) {
  6571. method.call( value, resolve, reject );
  6572. // Other non-thenables
  6573. } else {
  6574. // Support: Android 4.0 only
  6575. // Strict mode functions invoked without .call/.apply get global-object context
  6576. resolve.call( undefined, value );
  6577. }
  6578. // For Promises/A+, convert exceptions into rejections
  6579. // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in
  6580. // Deferred#then to conditionally suppress rejection.
  6581. } catch ( value ) {
  6582. // Support: Android 4.0 only
  6583. // Strict mode functions invoked without .call/.apply get global-object context
  6584. reject.call( undefined, value );
  6585. }
  6586. }
  6587. jQuery.extend( {
  6588. Deferred: function( func ) {
  6589. var tuples = [
  6590. // action, add listener, callbacks,
  6591. // ... .then handlers, argument index, [final state]
  6592. [ "notify", "progress", jQuery.Callbacks( "memory" ),
  6593. jQuery.Callbacks( "memory" ), 2 ],
  6594. [ "resolve", "done", jQuery.Callbacks( "once memory" ),
  6595. jQuery.Callbacks( "once memory" ), 0, "resolved" ],
  6596. [ "reject", "fail", jQuery.Callbacks( "once memory" ),
  6597. jQuery.Callbacks( "once memory" ), 1, "rejected" ]
  6598. ],
  6599. state = "pending",
  6600. promise = {
  6601. state: function() {
  6602. return state;
  6603. },
  6604. always: function() {
  6605. deferred.done( arguments ).fail( arguments );
  6606. return this;
  6607. },
  6608. "catch": function( fn ) {
  6609. return promise.then( null, fn );
  6610. },
  6611. // Keep pipe for back-compat
  6612. pipe: function( /* fnDone, fnFail, fnProgress */ ) {
  6613. var fns = arguments;
  6614. return jQuery.Deferred( function( newDefer ) {
  6615. jQuery.each( tuples, function( i, tuple ) {
  6616. // Map tuples (progress, done, fail) to arguments (done, fail, progress)
  6617. var fn = jQuery.isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];
  6618. // deferred.progress(function() { bind to newDefer or newDefer.notify })
  6619. // deferred.done(function() { bind to newDefer or newDefer.resolve })
  6620. // deferred.fail(function() { bind to newDefer or newDefer.reject })
  6621. deferred[ tuple[ 1 ] ]( function() {
  6622. var returned = fn && fn.apply( this, arguments );
  6623. if ( returned && jQuery.isFunction( returned.promise ) ) {
  6624. returned.promise()
  6625. .progress( newDefer.notify )
  6626. .done( newDefer.resolve )
  6627. .fail( newDefer.reject );
  6628. } else {
  6629. newDefer[ tuple[ 0 ] + "With" ](
  6630. this,
  6631. fn ? [ returned ] : arguments
  6632. );
  6633. }
  6634. } );
  6635. } );
  6636. fns = null;
  6637. } ).promise();
  6638. },
  6639. then: function( onFulfilled, onRejected, onProgress ) {
  6640. var maxDepth = 0;
  6641. function resolve( depth, deferred, handler, special ) {
  6642. return function() {
  6643. var that = this,
  6644. args = arguments,
  6645. mightThrow = function() {
  6646. var returned, then;
  6647. // Support: Promises/A+ section 2.3.3.3.3
  6648. // https://promisesaplus.com/#point-59
  6649. // Ignore double-resolution attempts
  6650. if ( depth < maxDepth ) {
  6651. return;
  6652. }
  6653. returned = handler.apply( that, args );
  6654. // Support: Promises/A+ section 2.3.1
  6655. // https://promisesaplus.com/#point-48
  6656. if ( returned === deferred.promise() ) {
  6657. throw new TypeError( "Thenable self-resolution" );
  6658. }
  6659. // Support: Promises/A+ sections 2.3.3.1, 3.5
  6660. // https://promisesaplus.com/#point-54
  6661. // https://promisesaplus.com/#point-75
  6662. // Retrieve `then` only once
  6663. then = returned &&
  6664. // Support: Promises/A+ section 2.3.4
  6665. // https://promisesaplus.com/#point-64
  6666. // Only check objects and functions for thenability
  6667. ( typeof returned === "object" ||
  6668. typeof returned === "function" ) &&
  6669. returned.then;
  6670. // Handle a returned thenable
  6671. if ( jQuery.isFunction( then ) ) {
  6672. // Special processors (notify) just wait for resolution
  6673. if ( special ) {
  6674. then.call(
  6675. returned,
  6676. resolve( maxDepth, deferred, Identity, special ),
  6677. resolve( maxDepth, deferred, Thrower, special )
  6678. );
  6679. // Normal processors (resolve) also hook into progress
  6680. } else {
  6681. // ...and disregard older resolution values
  6682. maxDepth++;
  6683. then.call(
  6684. returned,
  6685. resolve( maxDepth, deferred, Identity, special ),
  6686. resolve( maxDepth, deferred, Thrower, special ),
  6687. resolve( maxDepth, deferred, Identity,
  6688. deferred.notifyWith )
  6689. );
  6690. }
  6691. // Handle all other returned values
  6692. } else {
  6693. // Only substitute handlers pass on context
  6694. // and multiple values (non-spec behavior)
  6695. if ( handler !== Identity ) {
  6696. that = undefined;
  6697. args = [ returned ];
  6698. }
  6699. // Process the value(s)
  6700. // Default process is resolve
  6701. ( special || deferred.resolveWith )( that, args );
  6702. }
  6703. },
  6704. // Only normal processors (resolve) catch and reject exceptions
  6705. process = special ?
  6706. mightThrow :
  6707. function() {
  6708. try {
  6709. mightThrow();
  6710. } catch ( e ) {
  6711. if ( jQuery.Deferred.exceptionHook ) {
  6712. jQuery.Deferred.exceptionHook( e,
  6713. process.stackTrace );
  6714. }
  6715. // Support: Promises/A+ section 2.3.3.3.4.1
  6716. // https://promisesaplus.com/#point-61
  6717. // Ignore post-resolution exceptions
  6718. if ( depth + 1 >= maxDepth ) {
  6719. // Only substitute handlers pass on context
  6720. // and multiple values (non-spec behavior)
  6721. if ( handler !== Thrower ) {
  6722. that = undefined;
  6723. args = [ e ];
  6724. }
  6725. deferred.rejectWith( that, args );
  6726. }
  6727. }
  6728. };
  6729. // Support: Promises/A+ section 2.3.3.3.1
  6730. // https://promisesaplus.com/#point-57
  6731. // Re-resolve promises immediately to dodge false rejection from
  6732. // subsequent errors
  6733. if ( depth ) {
  6734. process();
  6735. } else {
  6736. // Call an optional hook to record the stack, in case of exception
  6737. // since it's otherwise lost when execution goes async
  6738. if ( jQuery.Deferred.getStackHook ) {
  6739. process.stackTrace = jQuery.Deferred.getStackHook();
  6740. }
  6741. window.setTimeout( process );
  6742. }
  6743. };
  6744. }
  6745. return jQuery.Deferred( function( newDefer ) {
  6746. // progress_handlers.add( ... )
  6747. tuples[ 0 ][ 3 ].add(
  6748. resolve(
  6749. 0,
  6750. newDefer,
  6751. jQuery.isFunction( onProgress ) ?
  6752. onProgress :
  6753. Identity,
  6754. newDefer.notifyWith
  6755. )
  6756. );
  6757. // fulfilled_handlers.add( ... )
  6758. tuples[ 1 ][ 3 ].add(
  6759. resolve(
  6760. 0,
  6761. newDefer,
  6762. jQuery.isFunction( onFulfilled ) ?
  6763. onFulfilled :
  6764. Identity
  6765. )
  6766. );
  6767. // rejected_handlers.add( ... )
  6768. tuples[ 2 ][ 3 ].add(
  6769. resolve(
  6770. 0,
  6771. newDefer,
  6772. jQuery.isFunction( onRejected ) ?
  6773. onRejected :
  6774. Thrower
  6775. )
  6776. );
  6777. } ).promise();
  6778. },
  6779. // Get a promise for this deferred
  6780. // If obj is provided, the promise aspect is added to the object
  6781. promise: function( obj ) {
  6782. return obj != null ? jQuery.extend( obj, promise ) : promise;
  6783. }
  6784. },
  6785. deferred = {};
  6786. // Add list-specific methods
  6787. jQuery.each( tuples, function( i, tuple ) {
  6788. var list = tuple[ 2 ],
  6789. stateString = tuple[ 5 ];
  6790. // promise.progress = list.add
  6791. // promise.done = list.add
  6792. // promise.fail = list.add
  6793. promise[ tuple[ 1 ] ] = list.add;
  6794. // Handle state
  6795. if ( stateString ) {
  6796. list.add(
  6797. function() {
  6798. // state = "resolved" (i.e., fulfilled)
  6799. // state = "rejected"
  6800. state = stateString;
  6801. },
  6802. // rejected_callbacks.disable
  6803. // fulfilled_callbacks.disable
  6804. tuples[ 3 - i ][ 2 ].disable,
  6805. // progress_callbacks.lock
  6806. tuples[ 0 ][ 2 ].lock
  6807. );
  6808. }
  6809. // progress_handlers.fire
  6810. // fulfilled_handlers.fire
  6811. // rejected_handlers.fire
  6812. list.add( tuple[ 3 ].fire );
  6813. // deferred.notify = function() { deferred.notifyWith(...) }
  6814. // deferred.resolve = function() { deferred.resolveWith(...) }
  6815. // deferred.reject = function() { deferred.rejectWith(...) }
  6816. deferred[ tuple[ 0 ] ] = function() {
  6817. deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments );
  6818. return this;
  6819. };
  6820. // deferred.notifyWith = list.fireWith
  6821. // deferred.resolveWith = list.fireWith
  6822. // deferred.rejectWith = list.fireWith
  6823. deferred[ tuple[ 0 ] + "With" ] = list.fireWith;
  6824. } );
  6825. // Make the deferred a promise
  6826. promise.promise( deferred );
  6827. // Call given func if any
  6828. if ( func ) {
  6829. func.call( deferred, deferred );
  6830. }
  6831. // All done!
  6832. return deferred;
  6833. },
  6834. // Deferred helper
  6835. when: function( singleValue ) {
  6836. var
  6837. // count of uncompleted subordinates
  6838. remaining = arguments.length,
  6839. // count of unprocessed arguments
  6840. i = remaining,
  6841. // subordinate fulfillment data
  6842. resolveContexts = Array( i ),
  6843. resolveValues = slice.call( arguments ),
  6844. // the master Deferred
  6845. master = jQuery.Deferred(),
  6846. // subordinate callback factory
  6847. updateFunc = function( i ) {
  6848. return function( value ) {
  6849. resolveContexts[ i ] = this;
  6850. resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
  6851. if ( !( --remaining ) ) {
  6852. master.resolveWith( resolveContexts, resolveValues );
  6853. }
  6854. };
  6855. };
  6856. // Single- and empty arguments are adopted like Promise.resolve
  6857. if ( remaining <= 1 ) {
  6858. adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject );
  6859. // Use .then() to unwrap secondary thenables (cf. gh-3000)
  6860. if ( master.state() === "pending" ||
  6861. jQuery.isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {
  6862. return master.then();
  6863. }
  6864. }
  6865. // Multiple arguments are aggregated like Promise.all array elements
  6866. while ( i-- ) {
  6867. adoptValue( resolveValues[ i ], updateFunc( i ), master.reject );
  6868. }
  6869. return master.promise();
  6870. }
  6871. } );
  6872. // These usually indicate a programmer mistake during development,
  6873. // warn about them ASAP rather than swallowing them by default.
  6874. var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
  6875. jQuery.Deferred.exceptionHook = function( error, stack ) {
  6876. // Support: IE 8 - 9 only
  6877. // Console exists when dev tools are open, which can happen at any time
  6878. if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {
  6879. window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack );
  6880. }
  6881. };
  6882. jQuery.readyException = function( error ) {
  6883. window.setTimeout( function() {
  6884. throw error;
  6885. } );
  6886. };
  6887. // The deferred used on DOM ready
  6888. var readyList = jQuery.Deferred();
  6889. jQuery.fn.ready = function( fn ) {
  6890. readyList
  6891. .then( fn )
  6892. // Wrap jQuery.readyException in a function so that the lookup
  6893. // happens at the time of error handling instead of callback
  6894. // registration.
  6895. .catch( function( error ) {
  6896. jQuery.readyException( error );
  6897. } );
  6898. return this;
  6899. };
  6900. jQuery.extend( {
  6901. // Is the DOM ready to be used? Set to true once it occurs.
  6902. isReady: false,
  6903. // A counter to track how many items to wait for before
  6904. // the ready event fires. See #6781
  6905. readyWait: 1,
  6906. // Hold (or release) the ready event
  6907. holdReady: function( hold ) {
  6908. if ( hold ) {
  6909. jQuery.readyWait++;
  6910. } else {
  6911. jQuery.ready( true );
  6912. }
  6913. },
  6914. // Handle when the DOM is ready
  6915. ready: function( wait ) {
  6916. // Abort if there are pending holds or we're already ready
  6917. if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
  6918. return;
  6919. }
  6920. // Remember that the DOM is ready
  6921. jQuery.isReady = true;
  6922. // If a normal DOM Ready event fired, decrement, and wait if need be
  6923. if ( wait !== true && --jQuery.readyWait > 0 ) {
  6924. return;
  6925. }
  6926. // If there are functions bound, to execute
  6927. readyList.resolveWith( document, [ jQuery ] );
  6928. }
  6929. } );
  6930. jQuery.ready.then = readyList.then;
  6931. // The ready event handler and self cleanup method
  6932. function completed() {
  6933. document.removeEventListener( "DOMContentLoaded", completed );
  6934. window.removeEventListener( "load", completed );
  6935. jQuery.ready();
  6936. }
  6937. // Catch cases where $(document).ready() is called
  6938. // after the browser event has already occurred.
  6939. // Support: IE <=9 - 10 only
  6940. // Older IE sometimes signals "interactive" too soon
  6941. if ( document.readyState === "complete" ||
  6942. ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {
  6943. // Handle it asynchronously to allow scripts the opportunity to delay ready
  6944. window.setTimeout( jQuery.ready );
  6945. } else {
  6946. // Use the handy event callback
  6947. document.addEventListener( "DOMContentLoaded", completed );
  6948. // A fallback to window.onload, that will always work
  6949. window.addEventListener( "load", completed );
  6950. }
  6951. // Multifunctional method to get and set values of a collection
  6952. // The value/s can optionally be executed if it's a function
  6953. var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
  6954. var i = 0,
  6955. len = elems.length,
  6956. bulk = key == null;
  6957. // Sets many values
  6958. if ( jQuery.type( key ) === "object" ) {
  6959. chainable = true;
  6960. for ( i in key ) {
  6961. access( elems, fn, i, key[ i ], true, emptyGet, raw );
  6962. }
  6963. // Sets one value
  6964. } else if ( value !== undefined ) {
  6965. chainable = true;
  6966. if ( !jQuery.isFunction( value ) ) {
  6967. raw = true;
  6968. }
  6969. if ( bulk ) {
  6970. // Bulk operations run against the entire set
  6971. if ( raw ) {
  6972. fn.call( elems, value );
  6973. fn = null;
  6974. // ...except when executing function values
  6975. } else {
  6976. bulk = fn;
  6977. fn = function( elem, key, value ) {
  6978. return bulk.call( jQuery( elem ), value );
  6979. };
  6980. }
  6981. }
  6982. if ( fn ) {
  6983. for ( ; i < len; i++ ) {
  6984. fn(
  6985. elems[ i ], key, raw ?
  6986. value :
  6987. value.call( elems[ i ], i, fn( elems[ i ], key ) )
  6988. );
  6989. }
  6990. }
  6991. }
  6992. if ( chainable ) {
  6993. return elems;
  6994. }
  6995. // Gets
  6996. if ( bulk ) {
  6997. return fn.call( elems );
  6998. }
  6999. return len ? fn( elems[ 0 ], key ) : emptyGet;
  7000. };
  7001. var acceptData = function( owner ) {
  7002. // Accepts only:
  7003. // - Node
  7004. // - Node.ELEMENT_NODE
  7005. // - Node.DOCUMENT_NODE
  7006. // - Object
  7007. // - Any
  7008. return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
  7009. };
  7010. function Data() {
  7011. this.expando = jQuery.expando + Data.uid++;
  7012. }
  7013. Data.uid = 1;
  7014. Data.prototype = {
  7015. cache: function( owner ) {
  7016. // Check if the owner object already has a cache
  7017. var value = owner[ this.expando ];
  7018. // If not, create one
  7019. if ( !value ) {
  7020. value = {};
  7021. // We can accept data for non-element nodes in modern browsers,
  7022. // but we should not, see #8335.
  7023. // Always return an empty object.
  7024. if ( acceptData( owner ) ) {
  7025. // If it is a node unlikely to be stringify-ed or looped over
  7026. // use plain assignment
  7027. if ( owner.nodeType ) {
  7028. owner[ this.expando ] = value;
  7029. // Otherwise secure it in a non-enumerable property
  7030. // configurable must be true to allow the property to be
  7031. // deleted when data is removed
  7032. } else {
  7033. Object.defineProperty( owner, this.expando, {
  7034. value: value,
  7035. configurable: true
  7036. } );
  7037. }
  7038. }
  7039. }
  7040. return value;
  7041. },
  7042. set: function( owner, data, value ) {
  7043. var prop,
  7044. cache = this.cache( owner );
  7045. // Handle: [ owner, key, value ] args
  7046. // Always use camelCase key (gh-2257)
  7047. if ( typeof data === "string" ) {
  7048. cache[ jQuery.camelCase( data ) ] = value;
  7049. // Handle: [ owner, { properties } ] args
  7050. } else {
  7051. // Copy the properties one-by-one to the cache object
  7052. for ( prop in data ) {
  7053. cache[ jQuery.camelCase( prop ) ] = data[ prop ];
  7054. }
  7055. }
  7056. return cache;
  7057. },
  7058. get: function( owner, key ) {
  7059. return key === undefined ?
  7060. this.cache( owner ) :
  7061. // Always use camelCase key (gh-2257)
  7062. owner[ this.expando ] && owner[ this.expando ][ jQuery.camelCase( key ) ];
  7063. },
  7064. access: function( owner, key, value ) {
  7065. // In cases where either:
  7066. //
  7067. // 1. No key was specified
  7068. // 2. A string key was specified, but no value provided
  7069. //
  7070. // Take the "read" path and allow the get method to determine
  7071. // which value to return, respectively either:
  7072. //
  7073. // 1. The entire cache object
  7074. // 2. The data stored at the key
  7075. //
  7076. if ( key === undefined ||
  7077. ( ( key && typeof key === "string" ) && value === undefined ) ) {
  7078. return this.get( owner, key );
  7079. }
  7080. // When the key is not a string, or both a key and value
  7081. // are specified, set or extend (existing objects) with either:
  7082. //
  7083. // 1. An object of properties
  7084. // 2. A key and value
  7085. //
  7086. this.set( owner, key, value );
  7087. // Since the "set" path can have two possible entry points
  7088. // return the expected data based on which path was taken[*]
  7089. return value !== undefined ? value : key;
  7090. },
  7091. remove: function( owner, key ) {
  7092. var i,
  7093. cache = owner[ this.expando ];
  7094. if ( cache === undefined ) {
  7095. return;
  7096. }
  7097. if ( key !== undefined ) {
  7098. // Support array or space separated string of keys
  7099. if ( jQuery.isArray( key ) ) {
  7100. // If key is an array of keys...
  7101. // We always set camelCase keys, so remove that.
  7102. key = key.map( jQuery.camelCase );
  7103. } else {
  7104. key = jQuery.camelCase( key );
  7105. // If a key with the spaces exists, use it.
  7106. // Otherwise, create an array by matching non-whitespace
  7107. key = key in cache ?
  7108. [ key ] :
  7109. ( key.match( rnothtmlwhite ) || [] );
  7110. }
  7111. i = key.length;
  7112. while ( i-- ) {
  7113. delete cache[ key[ i ] ];
  7114. }
  7115. }
  7116. // Remove the expando if there's no more data
  7117. if ( key === undefined || jQuery.isEmptyObject( cache ) ) {
  7118. // Support: Chrome <=35 - 45
  7119. // Webkit & Blink performance suffers when deleting properties
  7120. // from DOM nodes, so set to undefined instead
  7121. // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)
  7122. if ( owner.nodeType ) {
  7123. owner[ this.expando ] = undefined;
  7124. } else {
  7125. delete owner[ this.expando ];
  7126. }
  7127. }
  7128. },
  7129. hasData: function( owner ) {
  7130. var cache = owner[ this.expando ];
  7131. return cache !== undefined && !jQuery.isEmptyObject( cache );
  7132. }
  7133. };
  7134. var dataPriv = new Data();
  7135. var dataUser = new Data();
  7136. // Implementation Summary
  7137. //
  7138. // 1. Enforce API surface and semantic compatibility with 1.9.x branch
  7139. // 2. Improve the module's maintainability by reducing the storage
  7140. // paths to a single mechanism.
  7141. // 3. Use the same single mechanism to support "private" and "user" data.
  7142. // 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
  7143. // 5. Avoid exposing implementation details on user objects (eg. expando properties)
  7144. // 6. Provide a clear path for implementation upgrade to WeakMap in 2014
  7145. var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
  7146. rmultiDash = /[A-Z]/g;
  7147. function getData( data ) {
  7148. if ( data === "true" ) {
  7149. return true;
  7150. }
  7151. if ( data === "false" ) {
  7152. return false;
  7153. }
  7154. if ( data === "null" ) {
  7155. return null;
  7156. }
  7157. // Only convert to a number if it doesn't change the string
  7158. if ( data === +data + "" ) {
  7159. return +data;
  7160. }
  7161. if ( rbrace.test( data ) ) {
  7162. return JSON.parse( data );
  7163. }
  7164. return data;
  7165. }
  7166. function dataAttr( elem, key, data ) {
  7167. var name;
  7168. // If nothing was found internally, try to fetch any
  7169. // data from the HTML5 data-* attribute
  7170. if ( data === undefined && elem.nodeType === 1 ) {
  7171. name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase();
  7172. data = elem.getAttribute( name );
  7173. if ( typeof data === "string" ) {
  7174. try {
  7175. data = getData( data );
  7176. } catch ( e ) {}
  7177. // Make sure we set the data so it isn't changed later
  7178. dataUser.set( elem, key, data );
  7179. } else {
  7180. data = undefined;
  7181. }
  7182. }
  7183. return data;
  7184. }
  7185. jQuery.extend( {
  7186. hasData: function( elem ) {
  7187. return dataUser.hasData( elem ) || dataPriv.hasData( elem );
  7188. },
  7189. data: function( elem, name, data ) {
  7190. return dataUser.access( elem, name, data );
  7191. },
  7192. removeData: function( elem, name ) {
  7193. dataUser.remove( elem, name );
  7194. },
  7195. // TODO: Now that all calls to _data and _removeData have been replaced
  7196. // with direct calls to dataPriv methods, these can be deprecated.
  7197. _data: function( elem, name, data ) {
  7198. return dataPriv.access( elem, name, data );
  7199. },
  7200. _removeData: function( elem, name ) {
  7201. dataPriv.remove( elem, name );
  7202. }
  7203. } );
  7204. jQuery.fn.extend( {
  7205. data: function( key, value ) {
  7206. var i, name, data,
  7207. elem = this[ 0 ],
  7208. attrs = elem && elem.attributes;
  7209. // Gets all values
  7210. if ( key === undefined ) {
  7211. if ( this.length ) {
  7212. data = dataUser.get( elem );
  7213. if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) {
  7214. i = attrs.length;
  7215. while ( i-- ) {
  7216. // Support: IE 11 only
  7217. // The attrs elements can be null (#14894)
  7218. if ( attrs[ i ] ) {
  7219. name = attrs[ i ].name;
  7220. if ( name.indexOf( "data-" ) === 0 ) {
  7221. name = jQuery.camelCase( name.slice( 5 ) );
  7222. dataAttr( elem, name, data[ name ] );
  7223. }
  7224. }
  7225. }
  7226. dataPriv.set( elem, "hasDataAttrs", true );
  7227. }
  7228. }
  7229. return data;
  7230. }
  7231. // Sets multiple values
  7232. if ( typeof key === "object" ) {
  7233. return this.each( function() {
  7234. dataUser.set( this, key );
  7235. } );
  7236. }
  7237. return access( this, function( value ) {
  7238. var data;
  7239. // The calling jQuery object (element matches) is not empty
  7240. // (and therefore has an element appears at this[ 0 ]) and the
  7241. // `value` parameter was not undefined. An empty jQuery object
  7242. // will result in `undefined` for elem = this[ 0 ] which will
  7243. // throw an exception if an attempt to read a data cache is made.
  7244. if ( elem && value === undefined ) {
  7245. // Attempt to get data from the cache
  7246. // The key will always be camelCased in Data
  7247. data = dataUser.get( elem, key );
  7248. if ( data !== undefined ) {
  7249. return data;
  7250. }
  7251. // Attempt to "discover" the data in
  7252. // HTML5 custom data-* attrs
  7253. data = dataAttr( elem, key );
  7254. if ( data !== undefined ) {
  7255. return data;
  7256. }
  7257. // We tried really hard, but the data doesn't exist.
  7258. return;
  7259. }
  7260. // Set the data...
  7261. this.each( function() {
  7262. // We always store the camelCased key
  7263. dataUser.set( this, key, value );
  7264. } );
  7265. }, null, value, arguments.length > 1, null, true );
  7266. },
  7267. removeData: function( key ) {
  7268. return this.each( function() {
  7269. dataUser.remove( this, key );
  7270. } );
  7271. }
  7272. } );
  7273. jQuery.extend( {
  7274. queue: function( elem, type, data ) {
  7275. var queue;
  7276. if ( elem ) {
  7277. type = ( type || "fx" ) + "queue";
  7278. queue = dataPriv.get( elem, type );
  7279. // Speed up dequeue by getting out quickly if this is just a lookup
  7280. if ( data ) {
  7281. if ( !queue || jQuery.isArray( data ) ) {
  7282. queue = dataPriv.access( elem, type, jQuery.makeArray( data ) );
  7283. } else {
  7284. queue.push( data );
  7285. }
  7286. }
  7287. return queue || [];
  7288. }
  7289. },
  7290. dequeue: function( elem, type ) {
  7291. type = type || "fx";
  7292. var queue = jQuery.queue( elem, type ),
  7293. startLength = queue.length,
  7294. fn = queue.shift(),
  7295. hooks = jQuery._queueHooks( elem, type ),
  7296. next = function() {
  7297. jQuery.dequeue( elem, type );
  7298. };
  7299. // If the fx queue is dequeued, always remove the progress sentinel
  7300. if ( fn === "inprogress" ) {
  7301. fn = queue.shift();
  7302. startLength--;
  7303. }
  7304. if ( fn ) {
  7305. // Add a progress sentinel to prevent the fx queue from being
  7306. // automatically dequeued
  7307. if ( type === "fx" ) {
  7308. queue.unshift( "inprogress" );
  7309. }
  7310. // Clear up the last queue stop function
  7311. delete hooks.stop;
  7312. fn.call( elem, next, hooks );
  7313. }
  7314. if ( !startLength && hooks ) {
  7315. hooks.empty.fire();
  7316. }
  7317. },
  7318. // Not public - generate a queueHooks object, or return the current one
  7319. _queueHooks: function( elem, type ) {
  7320. var key = type + "queueHooks";
  7321. return dataPriv.get( elem, key ) || dataPriv.access( elem, key, {
  7322. empty: jQuery.Callbacks( "once memory" ).add( function() {
  7323. dataPriv.remove( elem, [ type + "queue", key ] );
  7324. } )
  7325. } );
  7326. }
  7327. } );
  7328. jQuery.fn.extend( {
  7329. queue: function( type, data ) {
  7330. var setter = 2;
  7331. if ( typeof type !== "string" ) {
  7332. data = type;
  7333. type = "fx";
  7334. setter--;
  7335. }
  7336. if ( arguments.length < setter ) {
  7337. return jQuery.queue( this[ 0 ], type );
  7338. }
  7339. return data === undefined ?
  7340. this :
  7341. this.each( function() {
  7342. var queue = jQuery.queue( this, type, data );
  7343. // Ensure a hooks for this queue
  7344. jQuery._queueHooks( this, type );
  7345. if ( type === "fx" && queue[ 0 ] !== "inprogress" ) {
  7346. jQuery.dequeue( this, type );
  7347. }
  7348. } );
  7349. },
  7350. dequeue: function( type ) {
  7351. return this.each( function() {
  7352. jQuery.dequeue( this, type );
  7353. } );
  7354. },
  7355. clearQueue: function( type ) {
  7356. return this.queue( type || "fx", [] );
  7357. },
  7358. // Get a promise resolved when queues of a certain type
  7359. // are emptied (fx is the type by default)
  7360. promise: function( type, obj ) {
  7361. var tmp,
  7362. count = 1,
  7363. defer = jQuery.Deferred(),
  7364. elements = this,
  7365. i = this.length,
  7366. resolve = function() {
  7367. if ( !( --count ) ) {
  7368. defer.resolveWith( elements, [ elements ] );
  7369. }
  7370. };
  7371. if ( typeof type !== "string" ) {
  7372. obj = type;
  7373. type = undefined;
  7374. }
  7375. type = type || "fx";
  7376. while ( i-- ) {
  7377. tmp = dataPriv.get( elements[ i ], type + "queueHooks" );
  7378. if ( tmp && tmp.empty ) {
  7379. count++;
  7380. tmp.empty.add( resolve );
  7381. }
  7382. }
  7383. resolve();
  7384. return defer.promise( obj );
  7385. }
  7386. } );
  7387. var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;
  7388. var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );
  7389. var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
  7390. var isHiddenWithinTree = function( elem, el ) {
  7391. // isHiddenWithinTree might be called from jQuery#filter function;
  7392. // in that case, element will be second argument
  7393. elem = el || elem;
  7394. // Inline style trumps all
  7395. return elem.style.display === "none" ||
  7396. elem.style.display === "" &&
  7397. // Otherwise, check computed style
  7398. // Support: Firefox <=43 - 45
  7399. // Disconnected elements can have computed display: none, so first confirm that elem is
  7400. // in the document.
  7401. jQuery.contains( elem.ownerDocument, elem ) &&
  7402. jQuery.css( elem, "display" ) === "none";
  7403. };
  7404. var swap = function( elem, options, callback, args ) {
  7405. var ret, name,
  7406. old = {};
  7407. // Remember the old values, and insert the new ones
  7408. for ( name in options ) {
  7409. old[ name ] = elem.style[ name ];
  7410. elem.style[ name ] = options[ name ];
  7411. }
  7412. ret = callback.apply( elem, args || [] );
  7413. // Revert the old values
  7414. for ( name in options ) {
  7415. elem.style[ name ] = old[ name ];
  7416. }
  7417. return ret;
  7418. };
  7419. function adjustCSS( elem, prop, valueParts, tween ) {
  7420. var adjusted,
  7421. scale = 1,
  7422. maxIterations = 20,
  7423. currentValue = tween ?
  7424. function() {
  7425. return tween.cur();
  7426. } :
  7427. function() {
  7428. return jQuery.css( elem, prop, "" );
  7429. },
  7430. initial = currentValue(),
  7431. unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
  7432. // Starting value computation is required for potential unit mismatches
  7433. initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
  7434. rcssNum.exec( jQuery.css( elem, prop ) );
  7435. if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
  7436. // Trust units reported by jQuery.css
  7437. unit = unit || initialInUnit[ 3 ];
  7438. // Make sure we update the tween properties later on
  7439. valueParts = valueParts || [];
  7440. // Iteratively approximate from a nonzero starting point
  7441. initialInUnit = +initial || 1;
  7442. do {
  7443. // If previous iteration zeroed out, double until we get *something*.
  7444. // Use string for doubling so we don't accidentally see scale as unchanged below
  7445. scale = scale || ".5";
  7446. // Adjust and apply
  7447. initialInUnit = initialInUnit / scale;
  7448. jQuery.style( elem, prop, initialInUnit + unit );
  7449. // Update scale, tolerating zero or NaN from tween.cur()
  7450. // Break the loop if scale is unchanged or perfect, or if we've just had enough.
  7451. } while (
  7452. scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations
  7453. );
  7454. }
  7455. if ( valueParts ) {
  7456. initialInUnit = +initialInUnit || +initial || 0;
  7457. // Apply relative offset (+=/-=) if specified
  7458. adjusted = valueParts[ 1 ] ?
  7459. initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :
  7460. +valueParts[ 2 ];
  7461. if ( tween ) {
  7462. tween.unit = unit;
  7463. tween.start = initialInUnit;
  7464. tween.end = adjusted;
  7465. }
  7466. }
  7467. return adjusted;
  7468. }
  7469. var defaultDisplayMap = {};
  7470. function getDefaultDisplay( elem ) {
  7471. var temp,
  7472. doc = elem.ownerDocument,
  7473. nodeName = elem.nodeName,
  7474. display = defaultDisplayMap[ nodeName ];
  7475. if ( display ) {
  7476. return display;
  7477. }
  7478. temp = doc.body.appendChild( doc.createElement( nodeName ) );
  7479. display = jQuery.css( temp, "display" );
  7480. temp.parentNode.removeChild( temp );
  7481. if ( display === "none" ) {
  7482. display = "block";
  7483. }
  7484. defaultDisplayMap[ nodeName ] = display;
  7485. return display;
  7486. }
  7487. function showHide( elements, show ) {
  7488. var display, elem,
  7489. values = [],
  7490. index = 0,
  7491. length = elements.length;
  7492. // Determine new display value for elements that need to change
  7493. for ( ; index < length; index++ ) {
  7494. elem = elements[ index ];
  7495. if ( !elem.style ) {
  7496. continue;
  7497. }
  7498. display = elem.style.display;
  7499. if ( show ) {
  7500. // Since we force visibility upon cascade-hidden elements, an immediate (and slow)
  7501. // check is required in this first loop unless we have a nonempty display value (either
  7502. // inline or about-to-be-restored)
  7503. if ( display === "none" ) {
  7504. values[ index ] = dataPriv.get( elem, "display" ) || null;
  7505. if ( !values[ index ] ) {
  7506. elem.style.display = "";
  7507. }
  7508. }
  7509. if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) {
  7510. values[ index ] = getDefaultDisplay( elem );
  7511. }
  7512. } else {
  7513. if ( display !== "none" ) {
  7514. values[ index ] = "none";
  7515. // Remember what we're overwriting
  7516. dataPriv.set( elem, "display", display );
  7517. }
  7518. }
  7519. }
  7520. // Set the display of the elements in a second loop to avoid constant reflow
  7521. for ( index = 0; index < length; index++ ) {
  7522. if ( values[ index ] != null ) {
  7523. elements[ index ].style.display = values[ index ];
  7524. }
  7525. }
  7526. return elements;
  7527. }
  7528. jQuery.fn.extend( {
  7529. show: function() {
  7530. return showHide( this, true );
  7531. },
  7532. hide: function() {
  7533. return showHide( this );
  7534. },
  7535. toggle: function( state ) {
  7536. if ( typeof state === "boolean" ) {
  7537. return state ? this.show() : this.hide();
  7538. }
  7539. return this.each( function() {
  7540. if ( isHiddenWithinTree( this ) ) {
  7541. jQuery( this ).show();
  7542. } else {
  7543. jQuery( this ).hide();
  7544. }
  7545. } );
  7546. }
  7547. } );
  7548. var rcheckableType = ( /^(?:checkbox|radio)$/i );
  7549. var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]+)/i );
  7550. var rscriptType = ( /^$|\/(?:java|ecma)script/i );
  7551. // We have to close these tags to support XHTML (#13200)
  7552. var wrapMap = {
  7553. // Support: IE <=9 only
  7554. option: [ 1, "<select multiple='multiple'>", "</select>" ],
  7555. // XHTML parsers do not magically insert elements in the
  7556. // same way that tag soup parsers do. So we cannot shorten
  7557. // this by omitting <tbody> or other required elements.
  7558. thead: [ 1, "<table>", "</table>" ],
  7559. col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
  7560. tr: [ 2, "<table><tbody>", "</tbody></table>" ],
  7561. td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
  7562. _default: [ 0, "", "" ]
  7563. };
  7564. // Support: IE <=9 only
  7565. wrapMap.optgroup = wrapMap.option;
  7566. wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
  7567. wrapMap.th = wrapMap.td;
  7568. function getAll( context, tag ) {
  7569. // Support: IE <=9 - 11 only
  7570. // Use typeof to avoid zero-argument method invocation on host objects (#15151)
  7571. var ret;
  7572. if ( typeof context.getElementsByTagName !== "undefined" ) {
  7573. ret = context.getElementsByTagName( tag || "*" );
  7574. } else if ( typeof context.querySelectorAll !== "undefined" ) {
  7575. ret = context.querySelectorAll( tag || "*" );
  7576. } else {
  7577. ret = [];
  7578. }
  7579. if ( tag === undefined || tag && jQuery.nodeName( context, tag ) ) {
  7580. return jQuery.merge( [ context ], ret );
  7581. }
  7582. return ret;
  7583. }
  7584. // Mark scripts as having already been evaluated
  7585. function setGlobalEval( elems, refElements ) {
  7586. var i = 0,
  7587. l = elems.length;
  7588. for ( ; i < l; i++ ) {
  7589. dataPriv.set(
  7590. elems[ i ],
  7591. "globalEval",
  7592. !refElements || dataPriv.get( refElements[ i ], "globalEval" )
  7593. );
  7594. }
  7595. }
  7596. var rhtml = /<|&#?\w+;/;
  7597. function buildFragment( elems, context, scripts, selection, ignored ) {
  7598. var elem, tmp, tag, wrap, contains, j,
  7599. fragment = context.createDocumentFragment(),
  7600. nodes = [],
  7601. i = 0,
  7602. l = elems.length;
  7603. for ( ; i < l; i++ ) {
  7604. elem = elems[ i ];
  7605. if ( elem || elem === 0 ) {
  7606. // Add nodes directly
  7607. if ( jQuery.type( elem ) === "object" ) {
  7608. // Support: Android <=4.0 only, PhantomJS 1 only
  7609. // push.apply(_, arraylike) throws on ancient WebKit
  7610. jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
  7611. // Convert non-html into a text node
  7612. } else if ( !rhtml.test( elem ) ) {
  7613. nodes.push( context.createTextNode( elem ) );
  7614. // Convert html into DOM nodes
  7615. } else {
  7616. tmp = tmp || fragment.appendChild( context.createElement( "div" ) );
  7617. // Deserialize a standard representation
  7618. tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
  7619. wrap = wrapMap[ tag ] || wrapMap._default;
  7620. tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];
  7621. // Descend through wrappers to the right content
  7622. j = wrap[ 0 ];
  7623. while ( j-- ) {
  7624. tmp = tmp.lastChild;
  7625. }
  7626. // Support: Android <=4.0 only, PhantomJS 1 only
  7627. // push.apply(_, arraylike) throws on ancient WebKit
  7628. jQuery.merge( nodes, tmp.childNodes );
  7629. // Remember the top-level container
  7630. tmp = fragment.firstChild;
  7631. // Ensure the created nodes are orphaned (#12392)
  7632. tmp.textContent = "";
  7633. }
  7634. }
  7635. }
  7636. // Remove wrapper from fragment
  7637. fragment.textContent = "";
  7638. i = 0;
  7639. while ( ( elem = nodes[ i++ ] ) ) {
  7640. // Skip elements already in the context collection (trac-4087)
  7641. if ( selection && jQuery.inArray( elem, selection ) > -1 ) {
  7642. if ( ignored ) {
  7643. ignored.push( elem );
  7644. }
  7645. continue;
  7646. }
  7647. contains = jQuery.contains( elem.ownerDocument, elem );
  7648. // Append to fragment
  7649. tmp = getAll( fragment.appendChild( elem ), "script" );
  7650. // Preserve script evaluation history
  7651. if ( contains ) {
  7652. setGlobalEval( tmp );
  7653. }
  7654. // Capture executables
  7655. if ( scripts ) {
  7656. j = 0;
  7657. while ( ( elem = tmp[ j++ ] ) ) {
  7658. if ( rscriptType.test( elem.type || "" ) ) {
  7659. scripts.push( elem );
  7660. }
  7661. }
  7662. }
  7663. }
  7664. return fragment;
  7665. }
  7666. ( function() {
  7667. var fragment = document.createDocumentFragment(),
  7668. div = fragment.appendChild( document.createElement( "div" ) ),
  7669. input = document.createElement( "input" );
  7670. // Support: Android 4.0 - 4.3 only
  7671. // Check state lost if the name is set (#11217)
  7672. // Support: Windows Web Apps (WWA)
  7673. // `name` and `type` must use .setAttribute for WWA (#14901)
  7674. input.setAttribute( "type", "radio" );
  7675. input.setAttribute( "checked", "checked" );
  7676. input.setAttribute( "name", "t" );
  7677. div.appendChild( input );
  7678. // Support: Android <=4.1 only
  7679. // Older WebKit doesn't clone checked state correctly in fragments
  7680. support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
  7681. // Support: IE <=11 only
  7682. // Make sure textarea (and checkbox) defaultValue is properly cloned
  7683. div.innerHTML = "<textarea>x</textarea>";
  7684. support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
  7685. } )();
  7686. var documentElement = document.documentElement;
  7687. var
  7688. rkeyEvent = /^key/,
  7689. rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
  7690. rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
  7691. function returnTrue() {
  7692. return true;
  7693. }
  7694. function returnFalse() {
  7695. return false;
  7696. }
  7697. // Support: IE <=9 only
  7698. // See #13393 for more info
  7699. function safeActiveElement() {
  7700. try {
  7701. return document.activeElement;
  7702. } catch ( err ) { }
  7703. }
  7704. function on( elem, types, selector, data, fn, one ) {
  7705. var origFn, type;
  7706. // Types can be a map of types/handlers
  7707. if ( typeof types === "object" ) {
  7708. // ( types-Object, selector, data )
  7709. if ( typeof selector !== "string" ) {
  7710. // ( types-Object, data )
  7711. data = data || selector;
  7712. selector = undefined;
  7713. }
  7714. for ( type in types ) {
  7715. on( elem, type, selector, data, types[ type ], one );
  7716. }
  7717. return elem;
  7718. }
  7719. if ( data == null && fn == null ) {
  7720. // ( types, fn )
  7721. fn = selector;
  7722. data = selector = undefined;
  7723. } else if ( fn == null ) {
  7724. if ( typeof selector === "string" ) {
  7725. // ( types, selector, fn )
  7726. fn = data;
  7727. data = undefined;
  7728. } else {
  7729. // ( types, data, fn )
  7730. fn = data;
  7731. data = selector;
  7732. selector = undefined;
  7733. }
  7734. }
  7735. if ( fn === false ) {
  7736. fn = returnFalse;
  7737. } else if ( !fn ) {
  7738. return elem;
  7739. }
  7740. if ( one === 1 ) {
  7741. origFn = fn;
  7742. fn = function( event ) {
  7743. // Can use an empty set, since event contains the info
  7744. jQuery().off( event );
  7745. return origFn.apply( this, arguments );
  7746. };
  7747. // Use same guid so caller can remove using origFn
  7748. fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
  7749. }
  7750. return elem.each( function() {
  7751. jQuery.event.add( this, types, fn, data, selector );
  7752. } );
  7753. }
  7754. /*
  7755. * Helper functions for managing events -- not part of the public interface.
  7756. * Props to Dean Edwards' addEvent library for many of the ideas.
  7757. */
  7758. jQuery.event = {
  7759. global: {},
  7760. add: function( elem, types, handler, data, selector ) {
  7761. var handleObjIn, eventHandle, tmp,
  7762. events, t, handleObj,
  7763. special, handlers, type, namespaces, origType,
  7764. elemData = dataPriv.get( elem );
  7765. // Don't attach events to noData or text/comment nodes (but allow plain objects)
  7766. if ( !elemData ) {
  7767. return;
  7768. }
  7769. // Caller can pass in an object of custom data in lieu of the handler
  7770. if ( handler.handler ) {
  7771. handleObjIn = handler;
  7772. handler = handleObjIn.handler;
  7773. selector = handleObjIn.selector;
  7774. }
  7775. // Ensure that invalid selectors throw exceptions at attach time
  7776. // Evaluate against documentElement in case elem is a non-element node (e.g., document)
  7777. if ( selector ) {
  7778. jQuery.find.matchesSelector( documentElement, selector );
  7779. }
  7780. // Make sure that the handler has a unique ID, used to find/remove it later
  7781. if ( !handler.guid ) {
  7782. handler.guid = jQuery.guid++;
  7783. }
  7784. // Init the element's event structure and main handler, if this is the first
  7785. if ( !( events = elemData.events ) ) {
  7786. events = elemData.events = {};
  7787. }
  7788. if ( !( eventHandle = elemData.handle ) ) {
  7789. eventHandle = elemData.handle = function( e ) {
  7790. // Discard the second event of a jQuery.event.trigger() and
  7791. // when an event is called after a page has unloaded
  7792. return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ?
  7793. jQuery.event.dispatch.apply( elem, arguments ) : undefined;
  7794. };
  7795. }
  7796. // Handle multiple events separated by a space
  7797. types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
  7798. t = types.length;
  7799. while ( t-- ) {
  7800. tmp = rtypenamespace.exec( types[ t ] ) || [];
  7801. type = origType = tmp[ 1 ];
  7802. namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
  7803. // There *must* be a type, no attaching namespace-only handlers
  7804. if ( !type ) {
  7805. continue;
  7806. }
  7807. // If event changes its type, use the special event handlers for the changed type
  7808. special = jQuery.event.special[ type ] || {};
  7809. // If selector defined, determine special event api type, otherwise given type
  7810. type = ( selector ? special.delegateType : special.bindType ) || type;
  7811. // Update special based on newly reset type
  7812. special = jQuery.event.special[ type ] || {};
  7813. // handleObj is passed to all event handlers
  7814. handleObj = jQuery.extend( {
  7815. type: type,
  7816. origType: origType,
  7817. data: data,
  7818. handler: handler,
  7819. guid: handler.guid,
  7820. selector: selector,
  7821. needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
  7822. namespace: namespaces.join( "." )
  7823. }, handleObjIn );
  7824. // Init the event handler queue if we're the first
  7825. if ( !( handlers = events[ type ] ) ) {
  7826. handlers = events[ type ] = [];
  7827. handlers.delegateCount = 0;
  7828. // Only use addEventListener if the special events handler returns false
  7829. if ( !special.setup ||
  7830. special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
  7831. if ( elem.addEventListener ) {
  7832. elem.addEventListener( type, eventHandle );
  7833. }
  7834. }
  7835. }
  7836. if ( special.add ) {
  7837. special.add.call( elem, handleObj );
  7838. if ( !handleObj.handler.guid ) {
  7839. handleObj.handler.guid = handler.guid;
  7840. }
  7841. }
  7842. // Add to the element's handler list, delegates in front
  7843. if ( selector ) {
  7844. handlers.splice( handlers.delegateCount++, 0, handleObj );
  7845. } else {
  7846. handlers.push( handleObj );
  7847. }
  7848. // Keep track of which events have ever been used, for event optimization
  7849. jQuery.event.global[ type ] = true;
  7850. }
  7851. },
  7852. // Detach an event or set of events from an element
  7853. remove: function( elem, types, handler, selector, mappedTypes ) {
  7854. var j, origCount, tmp,
  7855. events, t, handleObj,
  7856. special, handlers, type, namespaces, origType,
  7857. elemData = dataPriv.hasData( elem ) && dataPriv.get( elem );
  7858. if ( !elemData || !( events = elemData.events ) ) {
  7859. return;
  7860. }
  7861. // Once for each type.namespace in types; type may be omitted
  7862. types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
  7863. t = types.length;
  7864. while ( t-- ) {
  7865. tmp = rtypenamespace.exec( types[ t ] ) || [];
  7866. type = origType = tmp[ 1 ];
  7867. namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
  7868. // Unbind all events (on this namespace, if provided) for the element
  7869. if ( !type ) {
  7870. for ( type in events ) {
  7871. jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
  7872. }
  7873. continue;
  7874. }
  7875. special = jQuery.event.special[ type ] || {};
  7876. type = ( selector ? special.delegateType : special.bindType ) || type;
  7877. handlers = events[ type ] || [];
  7878. tmp = tmp[ 2 ] &&
  7879. new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" );
  7880. // Remove matching events
  7881. origCount = j = handlers.length;
  7882. while ( j-- ) {
  7883. handleObj = handlers[ j ];
  7884. if ( ( mappedTypes || origType === handleObj.origType ) &&
  7885. ( !handler || handler.guid === handleObj.guid ) &&
  7886. ( !tmp || tmp.test( handleObj.namespace ) ) &&
  7887. ( !selector || selector === handleObj.selector ||
  7888. selector === "**" && handleObj.selector ) ) {
  7889. handlers.splice( j, 1 );
  7890. if ( handleObj.selector ) {
  7891. handlers.delegateCount--;
  7892. }
  7893. if ( special.remove ) {
  7894. special.remove.call( elem, handleObj );
  7895. }
  7896. }
  7897. }
  7898. // Remove generic event handler if we removed something and no more handlers exist
  7899. // (avoids potential for endless recursion during removal of special event handlers)
  7900. if ( origCount && !handlers.length ) {
  7901. if ( !special.teardown ||
  7902. special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
  7903. jQuery.removeEvent( elem, type, elemData.handle );
  7904. }
  7905. delete events[ type ];
  7906. }
  7907. }
  7908. // Remove data and the expando if it's no longer used
  7909. if ( jQuery.isEmptyObject( events ) ) {
  7910. dataPriv.remove( elem, "handle events" );
  7911. }
  7912. },
  7913. dispatch: function( nativeEvent ) {
  7914. // Make a writable jQuery.Event from the native event object
  7915. var event = jQuery.event.fix( nativeEvent );
  7916. var i, j, ret, matched, handleObj, handlerQueue,
  7917. args = new Array( arguments.length ),
  7918. handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [],
  7919. special = jQuery.event.special[ event.type ] || {};
  7920. // Use the fix-ed jQuery.Event rather than the (read-only) native event
  7921. args[ 0 ] = event;
  7922. for ( i = 1; i < arguments.length; i++ ) {
  7923. args[ i ] = arguments[ i ];
  7924. }
  7925. event.delegateTarget = this;
  7926. // Call the preDispatch hook for the mapped type, and let it bail if desired
  7927. if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
  7928. return;
  7929. }
  7930. // Determine handlers
  7931. handlerQueue = jQuery.event.handlers.call( this, event, handlers );
  7932. // Run delegates first; they may want to stop propagation beneath us
  7933. i = 0;
  7934. while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {
  7935. event.currentTarget = matched.elem;
  7936. j = 0;
  7937. while ( ( handleObj = matched.handlers[ j++ ] ) &&
  7938. !event.isImmediatePropagationStopped() ) {
  7939. // Triggered event must either 1) have no namespace, or 2) have namespace(s)
  7940. // a subset or equal to those in the bound event (both can have no namespace).
  7941. if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) {
  7942. event.handleObj = handleObj;
  7943. event.data = handleObj.data;
  7944. ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||
  7945. handleObj.handler ).apply( matched.elem, args );
  7946. if ( ret !== undefined ) {
  7947. if ( ( event.result = ret ) === false ) {
  7948. event.preventDefault();
  7949. event.stopPropagation();
  7950. }
  7951. }
  7952. }
  7953. }
  7954. }
  7955. // Call the postDispatch hook for the mapped type
  7956. if ( special.postDispatch ) {
  7957. special.postDispatch.call( this, event );
  7958. }
  7959. return event.result;
  7960. },
  7961. handlers: function( event, handlers ) {
  7962. var i, handleObj, sel, matchedHandlers, matchedSelectors,
  7963. handlerQueue = [],
  7964. delegateCount = handlers.delegateCount,
  7965. cur = event.target;
  7966. // Find delegate handlers
  7967. if ( delegateCount &&
  7968. // Support: IE <=9
  7969. // Black-hole SVG <use> instance trees (trac-13180)
  7970. cur.nodeType &&
  7971. // Support: Firefox <=42
  7972. // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)
  7973. // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click
  7974. // Support: IE 11 only
  7975. // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343)
  7976. !( event.type === "click" && event.button >= 1 ) ) {
  7977. for ( ; cur !== this; cur = cur.parentNode || this ) {
  7978. // Don't check non-elements (#13208)
  7979. // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
  7980. if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) {
  7981. matchedHandlers = [];
  7982. matchedSelectors = {};
  7983. for ( i = 0; i < delegateCount; i++ ) {
  7984. handleObj = handlers[ i ];
  7985. // Don't conflict with Object.prototype properties (#13203)
  7986. sel = handleObj.selector + " ";
  7987. if ( matchedSelectors[ sel ] === undefined ) {
  7988. matchedSelectors[ sel ] = handleObj.needsContext ?
  7989. jQuery( sel, this ).index( cur ) > -1 :
  7990. jQuery.find( sel, this, null, [ cur ] ).length;
  7991. }
  7992. if ( matchedSelectors[ sel ] ) {
  7993. matchedHandlers.push( handleObj );
  7994. }
  7995. }
  7996. if ( matchedHandlers.length ) {
  7997. handlerQueue.push( { elem: cur, handlers: matchedHandlers } );
  7998. }
  7999. }
  8000. }
  8001. }
  8002. // Add the remaining (directly-bound) handlers
  8003. cur = this;
  8004. if ( delegateCount < handlers.length ) {
  8005. handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );
  8006. }
  8007. return handlerQueue;
  8008. },
  8009. addProp: function( name, hook ) {
  8010. Object.defineProperty( jQuery.Event.prototype, name, {
  8011. enumerable: true,
  8012. configurable: true,
  8013. get: jQuery.isFunction( hook ) ?
  8014. function() {
  8015. if ( this.originalEvent ) {
  8016. return hook( this.originalEvent );
  8017. }
  8018. } :
  8019. function() {
  8020. if ( this.originalEvent ) {
  8021. return this.originalEvent[ name ];
  8022. }
  8023. },
  8024. set: function( value ) {
  8025. Object.defineProperty( this, name, {
  8026. enumerable: true,
  8027. configurable: true,
  8028. writable: true,
  8029. value: value
  8030. } );
  8031. }
  8032. } );
  8033. },
  8034. fix: function( originalEvent ) {
  8035. return originalEvent[ jQuery.expando ] ?
  8036. originalEvent :
  8037. new jQuery.Event( originalEvent );
  8038. },
  8039. special: {
  8040. load: {
  8041. // Prevent triggered image.load events from bubbling to window.load
  8042. noBubble: true
  8043. },
  8044. focus: {
  8045. // Fire native event if possible so blur/focus sequence is correct
  8046. trigger: function() {
  8047. if ( this !== safeActiveElement() && this.focus ) {
  8048. this.focus();
  8049. return false;
  8050. }
  8051. },
  8052. delegateType: "focusin"
  8053. },
  8054. blur: {
  8055. trigger: function() {
  8056. if ( this === safeActiveElement() && this.blur ) {
  8057. this.blur();
  8058. return false;
  8059. }
  8060. },
  8061. delegateType: "focusout"
  8062. },
  8063. click: {
  8064. // For checkbox, fire native event so checked state will be right
  8065. trigger: function() {
  8066. if ( this.type === "checkbox" && this.click && jQuery.nodeName( this, "input" ) ) {
  8067. this.click();
  8068. return false;
  8069. }
  8070. },
  8071. // For cross-browser consistency, don't fire native .click() on links
  8072. _default: function( event ) {
  8073. return jQuery.nodeName( event.target, "a" );
  8074. }
  8075. },
  8076. beforeunload: {
  8077. postDispatch: function( event ) {
  8078. // Support: Firefox 20+
  8079. // Firefox doesn't alert if the returnValue field is not set.
  8080. if ( event.result !== undefined && event.originalEvent ) {
  8081. event.originalEvent.returnValue = event.result;
  8082. }
  8083. }
  8084. }
  8085. }
  8086. };
  8087. jQuery.removeEvent = function( elem, type, handle ) {
  8088. // This "if" is needed for plain objects
  8089. if ( elem.removeEventListener ) {
  8090. elem.removeEventListener( type, handle );
  8091. }
  8092. };
  8093. jQuery.Event = function( src, props ) {
  8094. // Allow instantiation without the 'new' keyword
  8095. if ( !( this instanceof jQuery.Event ) ) {
  8096. return new jQuery.Event( src, props );
  8097. }
  8098. // Event object
  8099. if ( src && src.type ) {
  8100. this.originalEvent = src;
  8101. this.type = src.type;
  8102. // Events bubbling up the document may have been marked as prevented
  8103. // by a handler lower down the tree; reflect the correct value.
  8104. this.isDefaultPrevented = src.defaultPrevented ||
  8105. src.defaultPrevented === undefined &&
  8106. // Support: Android <=2.3 only
  8107. src.returnValue === false ?
  8108. returnTrue :
  8109. returnFalse;
  8110. // Create target properties
  8111. // Support: Safari <=6 - 7 only
  8112. // Target should not be a text node (#504, #13143)
  8113. this.target = ( src.target && src.target.nodeType === 3 ) ?
  8114. src.target.parentNode :
  8115. src.target;
  8116. this.currentTarget = src.currentTarget;
  8117. this.relatedTarget = src.relatedTarget;
  8118. // Event type
  8119. } else {
  8120. this.type = src;
  8121. }
  8122. // Put explicitly provided properties onto the event object
  8123. if ( props ) {
  8124. jQuery.extend( this, props );
  8125. }
  8126. // Create a timestamp if incoming event doesn't have one
  8127. this.timeStamp = src && src.timeStamp || jQuery.now();
  8128. // Mark it as fixed
  8129. this[ jQuery.expando ] = true;
  8130. };
  8131. // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
  8132. // https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
  8133. jQuery.Event.prototype = {
  8134. constructor: jQuery.Event,
  8135. isDefaultPrevented: returnFalse,
  8136. isPropagationStopped: returnFalse,
  8137. isImmediatePropagationStopped: returnFalse,
  8138. isSimulated: false,
  8139. preventDefault: function() {
  8140. var e = this.originalEvent;
  8141. this.isDefaultPrevented = returnTrue;
  8142. if ( e && !this.isSimulated ) {
  8143. e.preventDefault();
  8144. }
  8145. },
  8146. stopPropagation: function() {
  8147. var e = this.originalEvent;
  8148. this.isPropagationStopped = returnTrue;
  8149. if ( e && !this.isSimulated ) {
  8150. e.stopPropagation();
  8151. }
  8152. },
  8153. stopImmediatePropagation: function() {
  8154. var e = this.originalEvent;
  8155. this.isImmediatePropagationStopped = returnTrue;
  8156. if ( e && !this.isSimulated ) {
  8157. e.stopImmediatePropagation();
  8158. }
  8159. this.stopPropagation();
  8160. }
  8161. };
  8162. // Includes all common event props including KeyEvent and MouseEvent specific props
  8163. jQuery.each( {
  8164. altKey: true,
  8165. bubbles: true,
  8166. cancelable: true,
  8167. changedTouches: true,
  8168. ctrlKey: true,
  8169. detail: true,
  8170. eventPhase: true,
  8171. metaKey: true,
  8172. pageX: true,
  8173. pageY: true,
  8174. shiftKey: true,
  8175. view: true,
  8176. "char": true,
  8177. charCode: true,
  8178. key: true,
  8179. keyCode: true,
  8180. button: true,
  8181. buttons: true,
  8182. clientX: true,
  8183. clientY: true,
  8184. offsetX: true,
  8185. offsetY: true,
  8186. pointerId: true,
  8187. pointerType: true,
  8188. screenX: true,
  8189. screenY: true,
  8190. targetTouches: true,
  8191. toElement: true,
  8192. touches: true,
  8193. which: function( event ) {
  8194. var button = event.button;
  8195. // Add which for key events
  8196. if ( event.which == null && rkeyEvent.test( event.type ) ) {
  8197. return event.charCode != null ? event.charCode : event.keyCode;
  8198. }
  8199. // Add which for click: 1 === left; 2 === middle; 3 === right
  8200. if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) {
  8201. if ( button & 1 ) {
  8202. return 1;
  8203. }
  8204. if ( button & 2 ) {
  8205. return 3;
  8206. }
  8207. if ( button & 4 ) {
  8208. return 2;
  8209. }
  8210. return 0;
  8211. }
  8212. return event.which;
  8213. }
  8214. }, jQuery.event.addProp );
  8215. // Create mouseenter/leave events using mouseover/out and event-time checks
  8216. // so that event delegation works in jQuery.
  8217. // Do the same for pointerenter/pointerleave and pointerover/pointerout
  8218. //
  8219. // Support: Safari 7 only
  8220. // Safari sends mouseenter too often; see:
  8221. // https://bugs.chromium.org/p/chromium/issues/detail?id=470258
  8222. // for the description of the bug (it existed in older Chrome versions as well).
  8223. jQuery.each( {
  8224. mouseenter: "mouseover",
  8225. mouseleave: "mouseout",
  8226. pointerenter: "pointerover",
  8227. pointerleave: "pointerout"
  8228. }, function( orig, fix ) {
  8229. jQuery.event.special[ orig ] = {
  8230. delegateType: fix,
  8231. bindType: fix,
  8232. handle: function( event ) {
  8233. var ret,
  8234. target = this,
  8235. related = event.relatedTarget,
  8236. handleObj = event.handleObj;
  8237. // For mouseenter/leave call the handler if related is outside the target.
  8238. // NB: No relatedTarget if the mouse left/entered the browser window
  8239. if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {
  8240. event.type = handleObj.origType;
  8241. ret = handleObj.handler.apply( this, arguments );
  8242. event.type = fix;
  8243. }
  8244. return ret;
  8245. }
  8246. };
  8247. } );
  8248. jQuery.fn.extend( {
  8249. on: function( types, selector, data, fn ) {
  8250. return on( this, types, selector, data, fn );
  8251. },
  8252. one: function( types, selector, data, fn ) {
  8253. return on( this, types, selector, data, fn, 1 );
  8254. },
  8255. off: function( types, selector, fn ) {
  8256. var handleObj, type;
  8257. if ( types && types.preventDefault && types.handleObj ) {
  8258. // ( event ) dispatched jQuery.Event
  8259. handleObj = types.handleObj;
  8260. jQuery( types.delegateTarget ).off(
  8261. handleObj.namespace ?
  8262. handleObj.origType + "." + handleObj.namespace :
  8263. handleObj.origType,
  8264. handleObj.selector,
  8265. handleObj.handler
  8266. );
  8267. return this;
  8268. }
  8269. if ( typeof types === "object" ) {
  8270. // ( types-object [, selector] )
  8271. for ( type in types ) {
  8272. this.off( type, selector, types[ type ] );
  8273. }
  8274. return this;
  8275. }
  8276. if ( selector === false || typeof selector === "function" ) {
  8277. // ( types [, fn] )
  8278. fn = selector;
  8279. selector = undefined;
  8280. }
  8281. if ( fn === false ) {
  8282. fn = returnFalse;
  8283. }
  8284. return this.each( function() {
  8285. jQuery.event.remove( this, types, fn, selector );
  8286. } );
  8287. }
  8288. } );
  8289. var
  8290. /* eslint-disable max-len */
  8291. // See https://github.com/eslint/eslint/issues/3229
  8292. rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,
  8293. /* eslint-enable */
  8294. // Support: IE <=10 - 11, Edge 12 - 13
  8295. // In IE/Edge using regex groups here causes severe slowdowns.
  8296. // See https://connect.microsoft.com/IE/feedback/details/1736512/
  8297. rnoInnerhtml = /<script|<style|<link/i,
  8298. // checked="checked" or checked
  8299. rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
  8300. rscriptTypeMasked = /^true\/(.*)/,
  8301. rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
  8302. function manipulationTarget( elem, content ) {
  8303. if ( jQuery.nodeName( elem, "table" ) &&
  8304. jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) {
  8305. return elem.getElementsByTagName( "tbody" )[ 0 ] || elem;
  8306. }
  8307. return elem;
  8308. }
  8309. // Replace/restore the type attribute of script elements for safe DOM manipulation
  8310. function disableScript( elem ) {
  8311. elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type;
  8312. return elem;
  8313. }
  8314. function restoreScript( elem ) {
  8315. var match = rscriptTypeMasked.exec( elem.type );
  8316. if ( match ) {
  8317. elem.type = match[ 1 ];
  8318. } else {
  8319. elem.removeAttribute( "type" );
  8320. }
  8321. return elem;
  8322. }
  8323. function cloneCopyEvent( src, dest ) {
  8324. var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;
  8325. if ( dest.nodeType !== 1 ) {
  8326. return;
  8327. }
  8328. // 1. Copy private data: events, handlers, etc.
  8329. if ( dataPriv.hasData( src ) ) {
  8330. pdataOld = dataPriv.access( src );
  8331. pdataCur = dataPriv.set( dest, pdataOld );
  8332. events = pdataOld.events;
  8333. if ( events ) {
  8334. delete pdataCur.handle;
  8335. pdataCur.events = {};
  8336. for ( type in events ) {
  8337. for ( i = 0, l = events[ type ].length; i < l; i++ ) {
  8338. jQuery.event.add( dest, type, events[ type ][ i ] );
  8339. }
  8340. }
  8341. }
  8342. }
  8343. // 2. Copy user data
  8344. if ( dataUser.hasData( src ) ) {
  8345. udataOld = dataUser.access( src );
  8346. udataCur = jQuery.extend( {}, udataOld );
  8347. dataUser.set( dest, udataCur );
  8348. }
  8349. }
  8350. // Fix IE bugs, see support tests
  8351. function fixInput( src, dest ) {
  8352. var nodeName = dest.nodeName.toLowerCase();
  8353. // Fails to persist the checked state of a cloned checkbox or radio button.
  8354. if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
  8355. dest.checked = src.checked;
  8356. // Fails to return the selected option to the default selected state when cloning options
  8357. } else if ( nodeName === "input" || nodeName === "textarea" ) {
  8358. dest.defaultValue = src.defaultValue;
  8359. }
  8360. }
  8361. function domManip( collection, args, callback, ignored ) {
  8362. // Flatten any nested arrays
  8363. args = concat.apply( [], args );
  8364. var fragment, first, scripts, hasScripts, node, doc,
  8365. i = 0,
  8366. l = collection.length,
  8367. iNoClone = l - 1,
  8368. value = args[ 0 ],
  8369. isFunction = jQuery.isFunction( value );
  8370. // We can't cloneNode fragments that contain checked, in WebKit
  8371. if ( isFunction ||
  8372. ( l > 1 && typeof value === "string" &&
  8373. !support.checkClone && rchecked.test( value ) ) ) {
  8374. return collection.each( function( index ) {
  8375. var self = collection.eq( index );
  8376. if ( isFunction ) {
  8377. args[ 0 ] = value.call( this, index, self.html() );
  8378. }
  8379. domManip( self, args, callback, ignored );
  8380. } );
  8381. }
  8382. if ( l ) {
  8383. fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );
  8384. first = fragment.firstChild;
  8385. if ( fragment.childNodes.length === 1 ) {
  8386. fragment = first;
  8387. }
  8388. // Require either new content or an interest in ignored elements to invoke the callback
  8389. if ( first || ignored ) {
  8390. scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
  8391. hasScripts = scripts.length;
  8392. // Use the original fragment for the last item
  8393. // instead of the first because it can end up
  8394. // being emptied incorrectly in certain situations (#8070).
  8395. for ( ; i < l; i++ ) {
  8396. node = fragment;
  8397. if ( i !== iNoClone ) {
  8398. node = jQuery.clone( node, true, true );
  8399. // Keep references to cloned scripts for later restoration
  8400. if ( hasScripts ) {
  8401. // Support: Android <=4.0 only, PhantomJS 1 only
  8402. // push.apply(_, arraylike) throws on ancient WebKit
  8403. jQuery.merge( scripts, getAll( node, "script" ) );
  8404. }
  8405. }
  8406. callback.call( collection[ i ], node, i );
  8407. }
  8408. if ( hasScripts ) {
  8409. doc = scripts[ scripts.length - 1 ].ownerDocument;
  8410. // Reenable scripts
  8411. jQuery.map( scripts, restoreScript );
  8412. // Evaluate executable scripts on first document insertion
  8413. for ( i = 0; i < hasScripts; i++ ) {
  8414. node = scripts[ i ];
  8415. if ( rscriptType.test( node.type || "" ) &&
  8416. !dataPriv.access( node, "globalEval" ) &&
  8417. jQuery.contains( doc, node ) ) {
  8418. if ( node.src ) {
  8419. // Optional AJAX dependency, bu