app.js 2.0 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005350063500735008350093501035011350123501335014350153501635017350183501935020350213502235023350243502535026350273502835029350303503135032350333503435035350363503735038350393504035041350423504335044350453504635047350483504935050350513505235053350543505535056350573505835059350603506135062350633506435065350663506735068350693507035071350723507335074350753507635077350783507935080350813508235083350843508535086350873508835089350903509135092350933509435095350963509735098350993510035101351023510335104351053510635107351083510935110351113511235113351143511535116351173511835119351203512135122351233512435125351263512735128351293513035131351323513335134351353513635137351383513935140351413514235143351443514535146351473514835149351503515135152351533515435155351563515735158351593516035161351623516335164351653516635167351683516935170351713517235173351743517535176351773517835179351803518135182351833518435185351863518735188351893519035191351923519335194351953519635197351983519935200352013520235203352043520535206352073520835209352103521135212352133521435215352163521735218352193522035221352223522335224352253522635227352283522935230352313523235233352343523535236352373523835239352403524135242352433524435245352463524735248352493525035251352523525335254352553525635257352583525935260352613526235263352643526535266352673526835269352703527135272352733527435275352763527735278352793528035281352823528335284352853528635287352883528935290352913529235293352943529535296352973529835299353003530135302353033530435305353063530735308353093531035311353123531335314353153531635317353183531935320353213532235323353243532535326353273532835329353303533135332353333533435335353363533735338353393534035341353423534335344353453534635347353483534935350353513535235353353543535535356353573535835359353603536135362353633536435365353663536735368353693537035371353723537335374353753537635377353783537935380353813538235383353843538535386353873538835389353903539135392353933539435395353963539735398353993540035401354023540335404354053540635407354083540935410354113541235413354143541535416354173541835419354203542135422354233542435425354263542735428354293543035431354323543335434354353543635437354383543935440354413544235443354443544535446354473544835449354503545135452354533545435455354563545735458354593546035461354623546335464354653546635467354683546935470354713547235473354743547535476354773547835479354803548135482354833548435485354863548735488354893549035491354923549335494354953549635497354983549935500355013550235503355043550535506355073550835509355103551135512355133551435515355163551735518355193552035521355223552335524355253552635527355283552935530355313553235533355343553535536355373553835539355403554135542355433554435545355463554735548355493555035551355523555335554355553555635557355583555935560355613556235563355643556535566355673556835569355703557135572355733557435575355763557735578355793558035581355823558335584355853558635587355883558935590355913559235593355943559535596355973559835599356003560135602356033560435605356063560735608356093561035611356123561335614356153561635617356183561935620356213562235623356243562535626356273562835629356303563135632356333563435635356363563735638356393564035641356423564335644356453564635647356483564935650356513565235653356543565535656356573565835659356603566135662356633566435665356663566735668356693567035671356723567335674356753567635677356783567935680356813568235683356843568535686356873568835689356903569135692356933569435695356963569735698356993570035701357023570335704357053570635707357083570935710357113571235713357143571535716357173571835719357203572135722357233572435725357263572735728357293573035731357323573335734357353573635737357383573935740357413574235743357443574535746357473574835749357503575135752357533575435755357563575735758357593576035761357623576335764357653576635767357683576935770357713577235773357743577535776357773577835779357803578135782357833578435785357863578735788357893579035791357923579335794357953579635797357983579935800358013580235803358043580535806358073580835809358103581135812358133581435815358163581735818358193582035821358223582335824358253582635827358283582935830358313583235833358343583535836358373583835839358403584135842358433584435845358463584735848358493585035851358523585335854358553585635857358583585935860358613586235863358643586535866358673586835869358703587135872358733587435875358763587735878358793588035881358823588335884358853588635887358883588935890358913589235893358943589535896358973589835899359003590135902359033590435905359063590735908359093591035911359123591335914359153591635917359183591935920359213592235923359243592535926359273592835929359303593135932359333593435935359363593735938359393594035941359423594335944359453594635947359483594935950359513595235953359543595535956359573595835959359603596135962359633596435965359663596735968359693597035971359723597335974359753597635977359783597935980359813598235983359843598535986359873598835989359903599135992359933599435995359963599735998359993600036001360023600336004360053600636007360083600936010360113601236013360143601536016360173601836019360203602136022360233602436025360263602736028360293603036031360323603336034360353603636037360383603936040360413604236043360443604536046360473604836049360503605136052360533605436055360563605736058360593606036061360623606336064360653606636067360683606936070360713607236073360743607536076360773607836079360803608136082360833608436085360863608736088360893609036091360923609336094360953609636097360983609936100361013610236103361043610536106361073610836109361103611136112361133611436115361163611736118361193612036121361223612336124361253612636127361283612936130361313613236133361343613536136361373613836139361403614136142361433614436145361463614736148361493615036151361523615336154361553615636157361583615936160361613616236163361643616536166361673616836169361703617136172361733617436175361763617736178361793618036181361823618336184361853618636187361883618936190361913619236193361943619536196361973619836199362003620136202362033620436205362063620736208362093621036211362123621336214362153621636217362183621936220362213622236223362243622536226362273622836229362303623136232362333623436235362363623736238362393624036241362423624336244362453624636247362483624936250362513625236253362543625536256362573625836259362603626136262362633626436265362663626736268362693627036271362723627336274362753627636277362783627936280362813628236283362843628536286362873628836289362903629136292362933629436295362963629736298362993630036301363023630336304363053630636307363083630936310363113631236313363143631536316363173631836319363203632136322363233632436325363263632736328363293633036331363323633336334363353633636337363383633936340363413634236343363443634536346363473634836349363503635136352363533635436355363563635736358363593636036361363623636336364363653636636367363683636936370363713637236373363743637536376363773637836379363803638136382363833638436385363863638736388363893639036391363923639336394363953639636397363983639936400364013640236403364043640536406364073640836409364103641136412364133641436415364163641736418364193642036421364223642336424364253642636427364283642936430364313643236433364343643536436364373643836439364403644136442364433644436445364463644736448364493645036451364523645336454364553645636457364583645936460364613646236463364643646536466364673646836469364703647136472364733647436475364763647736478364793648036481364823648336484364853648636487364883648936490364913649236493364943649536496364973649836499365003650136502365033650436505365063650736508365093651036511365123651336514365153651636517365183651936520365213652236523365243652536526365273652836529365303653136532365333653436535365363653736538365393654036541365423654336544365453654636547365483654936550365513655236553365543655536556365573655836559365603656136562365633656436565365663656736568365693657036571365723657336574365753657636577365783657936580365813658236583365843658536586365873658836589365903659136592365933659436595365963659736598365993660036601366023660336604366053660636607366083660936610366113661236613366143661536616366173661836619366203662136622366233662436625366263662736628366293663036631366323663336634366353663636637366383663936640366413664236643366443664536646366473664836649366503665136652366533665436655366563665736658366593666036661366623666336664366653666636667366683666936670366713667236673366743667536676366773667836679366803668136682366833668436685366863668736688366893669036691366923669336694366953669636697366983669936700367013670236703367043670536706367073670836709367103671136712367133671436715367163671736718367193672036721367223672336724367253672636727367283672936730367313673236733367343673536736367373673836739367403674136742367433674436745367463674736748367493675036751367523675336754367553675636757367583675936760367613676236763367643676536766367673676836769367703677136772367733677436775367763677736778367793678036781367823678336784367853678636787367883678936790367913679236793367943679536796367973679836799368003680136802368033680436805368063680736808368093681036811368123681336814368153681636817368183681936820368213682236823368243682536826368273682836829368303683136832368333683436835368363683736838368393684036841368423684336844368453684636847368483684936850368513685236853368543685536856368573685836859368603686136862368633686436865368663686736868368693687036871368723687336874368753687636877368783687936880368813688236883368843688536886368873688836889368903689136892368933689436895368963689736898368993690036901369023690336904369053690636907369083690936910369113691236913369143691536916369173691836919369203692136922369233692436925369263692736928369293693036931369323693336934369353693636937369383693936940369413694236943369443694536946369473694836949369503695136952369533695436955369563695736958369593696036961369623696336964369653696636967369683696936970369713697236973369743697536976369773697836979369803698136982369833698436985369863698736988369893699036991369923699336994369953699636997369983699937000370013700237003370043700537006370073700837009370103701137012370133701437015370163701737018370193702037021370223702337024370253702637027370283702937030370313703237033370343703537036370373703837039370403704137042370433704437045370463704737048370493705037051370523705337054370553705637057370583705937060370613706237063370643706537066370673706837069370703707137072370733707437075370763707737078370793708037081370823708337084370853708637087370883708937090370913709237093370943709537096370973709837099371003710137102371033710437105371063710737108371093711037111371123711337114371153711637117371183711937120371213712237123371243712537126371273712837129371303713137132371333713437135371363713737138371393714037141371423714337144371453714637147371483714937150371513715237153371543715537156371573715837159371603716137162371633716437165371663716737168371693717037171371723717337174371753717637177371783717937180371813718237183371843718537186371873718837189371903719137192371933719437195371963719737198371993720037201372023720337204372053720637207372083720937210372113721237213372143721537216372173721837219372203722137222372233722437225372263722737228372293723037231372323723337234372353723637237372383723937240372413724237243372443724537246372473724837249372503725137252372533725437255372563725737258372593726037261372623726337264372653726637267372683726937270372713727237273372743727537276372773727837279372803728137282372833728437285372863728737288372893729037291372923729337294372953729637297372983729937300373013730237303373043730537306373073730837309373103731137312373133731437315373163731737318373193732037321373223732337324373253732637327373283732937330373313733237333373343733537336373373733837339373403734137342373433734437345373463734737348373493735037351373523735337354373553735637357373583735937360373613736237363373643736537366373673736837369373703737137372373733737437375373763737737378373793738037381373823738337384373853738637387373883738937390373913739237393373943739537396373973739837399374003740137402374033740437405374063740737408374093741037411374123741337414374153741637417374183741937420374213742237423374243742537426374273742837429374303743137432374333743437435374363743737438374393744037441374423744337444374453744637447374483744937450374513745237453374543745537456374573745837459374603746137462374633746437465374663746737468374693747037471374723747337474374753747637477374783747937480374813748237483374843748537486374873748837489374903749137492374933749437495374963749737498374993750037501375023750337504375053750637507375083750937510375113751237513375143751537516375173751837519375203752137522375233752437525375263752737528375293753037531375323753337534375353753637537375383753937540375413754237543375443754537546375473754837549375503755137552375533755437555375563755737558375593756037561375623756337564375653756637567375683756937570375713757237573375743757537576375773757837579375803758137582375833758437585375863758737588375893759037591375923759337594375953759637597375983759937600376013760237603376043760537606376073760837609376103761137612376133761437615376163761737618376193762037621376223762337624376253762637627376283762937630376313763237633376343763537636376373763837639376403764137642376433764437645376463764737648376493765037651376523765337654376553765637657376583765937660376613766237663376643766537666376673766837669376703767137672376733767437675376763767737678376793768037681376823768337684376853768637687376883768937690376913769237693376943769537696376973769837699377003770137702377033770437705377063770737708377093771037711377123771337714377153771637717377183771937720377213772237723377243772537726377273772837729377303773137732377333773437735377363773737738377393774037741377423774337744377453774637747377483774937750377513775237753377543775537756377573775837759377603776137762377633776437765377663776737768377693777037771377723777337774377753777637777377783777937780377813778237783377843778537786377873778837789377903779137792377933779437795377963779737798377993780037801378023780337804378053780637807378083780937810378113781237813378143781537816378173781837819378203782137822378233782437825378263782737828378293783037831378323783337834378353783637837378383783937840378413784237843378443784537846378473784837849378503785137852378533785437855378563785737858378593786037861378623786337864378653786637867378683786937870378713787237873378743787537876378773787837879378803788137882378833788437885378863788737888378893789037891378923789337894378953789637897378983789937900379013790237903379043790537906379073790837909379103791137912379133791437915379163791737918379193792037921379223792337924379253792637927379283792937930379313793237933379343793537936379373793837939379403794137942379433794437945379463794737948379493795037951379523795337954379553795637957379583795937960379613796237963379643796537966379673796837969379703797137972379733797437975379763797737978379793798037981379823798337984379853798637987379883798937990379913799237993379943799537996379973799837999380003800138002380033800438005380063800738008380093801038011380123801338014380153801638017380183801938020380213802238023380243802538026380273802838029380303803138032380333803438035380363803738038380393804038041380423804338044380453804638047380483804938050380513805238053380543805538056380573805838059380603806138062380633806438065380663806738068380693807038071380723807338074380753807638077380783807938080380813808238083380843808538086380873808838089380903809138092380933809438095380963809738098380993810038101381023810338104381053810638107381083810938110381113811238113381143811538116381173811838119381203812138122381233812438125381263812738128381293813038131381323813338134381353813638137381383813938140381413814238143381443814538146381473814838149381503815138152381533815438155381563815738158381593816038161381623816338164381653816638167381683816938170381713817238173381743817538176381773817838179381803818138182381833818438185381863818738188381893819038191381923819338194381953819638197381983819938200382013820238203382043820538206382073820838209382103821138212382133821438215382163821738218382193822038221382223822338224382253822638227382283822938230382313823238233382343823538236382373823838239382403824138242382433824438245382463824738248382493825038251382523825338254382553825638257382583825938260382613826238263382643826538266382673826838269382703827138272382733827438275382763827738278382793828038281382823828338284382853828638287382883828938290382913829238293382943829538296382973829838299383003830138302383033830438305383063830738308383093831038311383123831338314383153831638317383183831938320383213832238323383243832538326383273832838329383303833138332383333833438335383363833738338383393834038341383423834338344383453834638347383483834938350383513835238353383543835538356383573835838359383603836138362383633836438365383663836738368383693837038371383723837338374383753837638377383783837938380383813838238383383843838538386383873838838389383903839138392383933839438395383963839738398383993840038401384023840338404384053840638407384083840938410384113841238413384143841538416384173841838419384203842138422384233842438425384263842738428384293843038431384323843338434384353843638437384383843938440384413844238443384443844538446384473844838449384503845138452384533845438455384563845738458384593846038461384623846338464384653846638467384683846938470384713847238473384743847538476384773847838479384803848138482384833848438485384863848738488384893849038491384923849338494384953849638497384983849938500385013850238503385043850538506385073850838509385103851138512385133851438515385163851738518385193852038521385223852338524385253852638527385283852938530385313853238533385343853538536385373853838539385403854138542385433854438545385463854738548385493855038551385523855338554385553855638557385583855938560385613856238563385643856538566385673856838569385703857138572385733857438575385763857738578385793858038581385823858338584385853858638587385883858938590385913859238593385943859538596385973859838599386003860138602386033860438605386063860738608386093861038611386123861338614386153861638617386183861938620386213862238623386243862538626386273862838629386303863138632386333863438635386363863738638386393864038641386423864338644386453864638647386483864938650386513865238653386543865538656386573865838659386603866138662386633866438665386663866738668386693867038671386723867338674386753867638677386783867938680386813868238683386843868538686386873868838689386903869138692386933869438695386963869738698386993870038701387023870338704387053870638707387083870938710387113871238713387143871538716387173871838719387203872138722387233872438725387263872738728387293873038731387323873338734387353873638737387383873938740387413874238743387443874538746387473874838749387503875138752387533875438755387563875738758387593876038761387623876338764387653876638767387683876938770387713877238773387743877538776387773877838779387803878138782387833878438785387863878738788387893879038791387923879338794387953879638797387983879938800388013880238803388043880538806388073880838809388103881138812388133881438815388163881738818388193882038821388223882338824388253882638827388283882938830388313883238833388343883538836388373883838839388403884138842388433884438845388463884738848388493885038851388523885338854388553885638857388583885938860388613886238863388643886538866388673886838869388703887138872388733887438875388763887738878388793888038881388823888338884388853888638887388883888938890388913889238893388943889538896388973889838899389003890138902389033890438905389063890738908389093891038911389123891338914389153891638917389183891938920389213892238923389243892538926389273892838929389303893138932389333893438935389363893738938389393894038941389423894338944389453894638947389483894938950389513895238953389543895538956389573895838959389603896138962389633896438965389663896738968389693897038971389723897338974389753897638977389783897938980389813898238983389843898538986389873898838989389903899138992389933899438995389963899738998389993900039001390023900339004390053900639007390083900939010390113901239013390143901539016390173901839019390203902139022390233902439025390263902739028390293903039031390323903339034390353903639037390383903939040390413904239043390443904539046390473904839049390503905139052390533905439055390563905739058390593906039061390623906339064390653906639067390683906939070390713907239073390743907539076390773907839079390803908139082390833908439085390863908739088390893909039091390923909339094390953909639097390983909939100391013910239103391043910539106391073910839109391103911139112391133911439115391163911739118391193912039121391223912339124391253912639127391283912939130391313913239133391343913539136391373913839139391403914139142391433914439145391463914739148391493915039151391523915339154391553915639157391583915939160391613916239163391643916539166391673916839169391703917139172391733917439175391763917739178391793918039181391823918339184391853918639187391883918939190391913919239193391943919539196391973919839199392003920139202392033920439205392063920739208392093921039211392123921339214392153921639217392183921939220392213922239223392243922539226392273922839229392303923139232392333923439235392363923739238392393924039241392423924339244392453924639247392483924939250392513925239253392543925539256392573925839259392603926139262392633926439265392663926739268392693927039271392723927339274392753927639277392783927939280392813928239283392843928539286392873928839289392903929139292392933929439295392963929739298392993930039301393023930339304393053930639307393083930939310393113931239313393143931539316393173931839319393203932139322393233932439325393263932739328393293933039331393323933339334393353933639337393383933939340393413934239343393443934539346393473934839349393503935139352393533935439355393563935739358393593936039361393623936339364393653936639367393683936939370393713937239373393743937539376393773937839379393803938139382393833938439385393863938739388393893939039391393923939339394393953939639397393983939939400394013940239403394043940539406394073940839409394103941139412394133941439415394163941739418394193942039421394223942339424394253942639427394283942939430394313943239433394343943539436394373943839439394403944139442394433944439445394463944739448394493945039451394523945339454394553945639457394583945939460394613946239463394643946539466394673946839469394703947139472394733947439475394763947739478394793948039481394823948339484394853948639487394883948939490394913949239493394943949539496394973949839499395003950139502395033950439505395063950739508395093951039511395123951339514395153951639517395183951939520395213952239523395243952539526395273952839529395303953139532395333953439535395363953739538395393954039541395423954339544395453954639547395483954939550395513955239553395543955539556395573955839559395603956139562395633956439565395663956739568395693957039571395723957339574395753957639577395783957939580395813958239583395843958539586395873958839589395903959139592395933959439595395963959739598395993960039601396023960339604396053960639607396083960939610396113961239613396143961539616396173961839619396203962139622396233962439625396263962739628396293963039631396323963339634396353963639637396383963939640396413964239643396443964539646396473964839649396503965139652396533965439655396563965739658396593966039661396623966339664396653966639667396683966939670396713967239673396743967539676396773967839679396803968139682396833968439685396863968739688396893969039691396923969339694396953969639697396983969939700397013970239703397043970539706397073970839709397103971139712397133971439715397163971739718397193972039721397223972339724397253972639727397283972939730397313973239733397343973539736397373973839739397403974139742397433974439745397463974739748397493975039751397523975339754397553975639757397583975939760397613976239763397643976539766397673976839769397703977139772397733977439775397763977739778397793978039781397823978339784397853978639787397883978939790397913979239793397943979539796397973979839799398003980139802398033980439805398063980739808398093981039811398123981339814398153981639817398183981939820398213982239823398243982539826398273982839829398303983139832398333983439835398363983739838398393984039841398423984339844398453984639847398483984939850398513985239853398543985539856398573985839859398603986139862398633986439865398663986739868398693987039871398723987339874398753987639877398783987939880398813988239883398843988539886398873988839889398903989139892398933989439895398963989739898398993990039901399023990339904399053990639907399083990939910399113991239913399143991539916399173991839919399203992139922399233992439925399263992739928399293993039931399323993339934399353993639937399383993939940399413994239943399443994539946399473994839949399503995139952399533995439955399563995739958399593996039961399623996339964399653996639967399683996939970399713997239973399743997539976399773997839979399803998139982399833998439985399863998739988399893999039991399923999339994399953999639997399983999940000400014000240003400044000540006400074000840009400104001140012400134001440015400164001740018400194002040021400224002340024400254002640027400284002940030400314003240033400344003540036400374003840039400404004140042400434004440045400464004740048400494005040051400524005340054400554005640057400584005940060400614006240063400644006540066400674006840069400704007140072400734007440075400764007740078400794008040081400824008340084400854008640087400884008940090400914009240093400944009540096400974009840099401004010140102401034010440105401064010740108401094011040111401124011340114401154011640117401184011940120401214012240123401244012540126401274012840129401304013140132401334013440135401364013740138401394014040141401424014340144401454014640147401484014940150401514015240153401544015540156401574015840159401604016140162401634016440165401664016740168401694017040171401724017340174401754017640177401784017940180401814018240183401844018540186401874018840189401904019140192401934019440195401964019740198401994020040201402024020340204402054020640207402084020940210402114021240213402144021540216402174021840219402204022140222402234022440225402264022740228402294023040231402324023340234402354023640237402384023940240402414024240243402444024540246402474024840249402504025140252402534025440255402564025740258402594026040261402624026340264402654026640267402684026940270402714027240273402744027540276402774027840279402804028140282402834028440285402864028740288402894029040291402924029340294402954029640297402984029940300403014030240303403044030540306403074030840309403104031140312403134031440315403164031740318403194032040321403224032340324403254032640327403284032940330403314033240333403344033540336403374033840339403404034140342403434034440345403464034740348403494035040351403524035340354403554035640357403584035940360403614036240363403644036540366403674036840369403704037140372403734037440375403764037740378403794038040381403824038340384403854038640387403884038940390403914039240393403944039540396403974039840399404004040140402404034040440405404064040740408404094041040411404124041340414404154041640417404184041940420404214042240423404244042540426404274042840429404304043140432404334043440435404364043740438404394044040441404424044340444404454044640447404484044940450404514045240453404544045540456404574045840459404604046140462404634046440465404664046740468404694047040471404724047340474404754047640477404784047940480404814048240483404844048540486404874048840489404904049140492404934049440495404964049740498404994050040501405024050340504405054050640507405084050940510405114051240513405144051540516405174051840519405204052140522405234052440525405264052740528405294053040531405324053340534405354053640537405384053940540405414054240543405444054540546405474054840549405504055140552405534055440555405564055740558405594056040561405624056340564405654056640567405684056940570405714057240573405744057540576405774057840579405804058140582405834058440585405864058740588405894059040591405924059340594405954059640597405984059940600406014060240603406044060540606406074060840609406104061140612406134061440615406164061740618406194062040621406224062340624406254062640627406284062940630406314063240633406344063540636406374063840639406404064140642406434064440645406464064740648406494065040651406524065340654406554065640657406584065940660406614066240663406644066540666406674066840669406704067140672406734067440675406764067740678406794068040681406824068340684406854068640687406884068940690406914069240693406944069540696406974069840699407004070140702407034070440705407064070740708407094071040711407124071340714407154071640717407184071940720407214072240723407244072540726407274072840729407304073140732407334073440735407364073740738407394074040741407424074340744407454074640747407484074940750407514075240753407544075540756407574075840759407604076140762407634076440765407664076740768407694077040771407724077340774407754077640777407784077940780407814078240783407844078540786407874078840789407904079140792407934079440795407964079740798407994080040801408024080340804408054080640807408084080940810408114081240813408144081540816408174081840819408204082140822408234082440825408264082740828408294083040831408324083340834408354083640837408384083940840408414084240843408444084540846408474084840849408504085140852408534085440855408564085740858408594086040861408624086340864408654086640867408684086940870408714087240873408744087540876408774087840879408804088140882408834088440885408864088740888408894089040891408924089340894408954089640897408984089940900409014090240903409044090540906409074090840909409104091140912409134091440915409164091740918409194092040921409224092340924409254092640927409284092940930409314093240933409344093540936409374093840939409404094140942409434094440945409464094740948409494095040951409524095340954409554095640957409584095940960409614096240963409644096540966409674096840969409704097140972409734097440975409764097740978409794098040981409824098340984409854098640987409884098940990409914099240993409944099540996409974099840999410004100141002410034100441005410064100741008410094101041011410124101341014410154101641017410184101941020410214102241023410244102541026410274102841029410304103141032410334103441035410364103741038410394104041041410424104341044410454104641047410484104941050410514105241053410544105541056410574105841059410604106141062410634106441065410664106741068410694107041071410724107341074410754107641077410784107941080410814108241083410844108541086410874108841089410904109141092410934109441095410964109741098410994110041101411024110341104411054110641107411084110941110411114111241113411144111541116411174111841119411204112141122411234112441125411264112741128411294113041131411324113341134411354113641137411384113941140411414114241143411444114541146411474114841149411504115141152411534115441155411564115741158411594116041161411624116341164411654116641167411684116941170411714117241173411744117541176411774117841179411804118141182411834118441185411864118741188411894119041191411924119341194411954119641197411984119941200412014120241203412044120541206412074120841209412104121141212412134121441215412164121741218412194122041221412224122341224412254122641227412284122941230412314123241233412344123541236412374123841239412404124141242412434124441245412464124741248412494125041251412524125341254412554125641257412584125941260412614126241263412644126541266412674126841269412704127141272412734127441275412764127741278412794128041281412824128341284412854128641287412884128941290412914129241293412944129541296412974129841299413004130141302413034130441305413064130741308413094131041311413124131341314413154131641317413184131941320413214132241323413244132541326413274132841329413304133141332413334133441335413364133741338413394134041341413424134341344413454134641347413484134941350413514135241353413544135541356413574135841359413604136141362413634136441365413664136741368413694137041371413724137341374413754137641377413784137941380413814138241383413844138541386413874138841389413904139141392413934139441395413964139741398413994140041401414024140341404414054140641407414084140941410414114141241413414144141541416414174141841419414204142141422414234142441425414264142741428414294143041431414324143341434414354143641437414384143941440414414144241443414444144541446414474144841449414504145141452414534145441455414564145741458414594146041461414624146341464414654146641467414684146941470414714147241473414744147541476414774147841479414804148141482414834148441485414864148741488414894149041491414924149341494414954149641497414984149941500415014150241503415044150541506415074150841509415104151141512415134151441515415164151741518415194152041521415224152341524415254152641527415284152941530415314153241533415344153541536415374153841539415404154141542415434154441545415464154741548415494155041551415524155341554415554155641557415584155941560415614156241563415644156541566415674156841569415704157141572415734157441575415764157741578415794158041581415824158341584415854158641587415884158941590415914159241593415944159541596415974159841599416004160141602416034160441605416064160741608416094161041611416124161341614416154161641617416184161941620416214162241623416244162541626416274162841629416304163141632416334163441635416364163741638416394164041641416424164341644416454164641647416484164941650416514165241653416544165541656416574165841659416604166141662416634166441665416664166741668416694167041671416724167341674416754167641677416784167941680416814168241683416844168541686416874168841689416904169141692416934169441695416964169741698416994170041701417024170341704417054170641707417084170941710417114171241713417144171541716417174171841719417204172141722417234172441725417264172741728417294173041731417324173341734417354173641737417384173941740417414174241743417444174541746417474174841749417504175141752417534175441755417564175741758417594176041761417624176341764417654176641767417684176941770417714177241773417744177541776417774177841779417804178141782417834178441785417864178741788417894179041791417924179341794417954179641797417984179941800418014180241803418044180541806418074180841809418104181141812418134181441815418164181741818418194182041821418224182341824418254182641827418284182941830418314183241833418344183541836418374183841839418404184141842418434184441845418464184741848418494185041851418524185341854418554185641857418584185941860418614186241863418644186541866418674186841869418704187141872418734187441875418764187741878418794188041881418824188341884418854188641887418884188941890418914189241893418944189541896418974189841899419004190141902419034190441905419064190741908419094191041911419124191341914419154191641917419184191941920419214192241923419244192541926419274192841929419304193141932419334193441935419364193741938419394194041941419424194341944419454194641947419484194941950419514195241953419544195541956419574195841959419604196141962419634196441965419664196741968419694197041971419724197341974419754197641977419784197941980419814198241983419844198541986419874198841989419904199141992419934199441995419964199741998419994200042001420024200342004420054200642007420084200942010420114201242013420144201542016420174201842019420204202142022420234202442025420264202742028420294203042031420324203342034420354203642037420384203942040420414204242043420444204542046420474204842049420504205142052420534205442055420564205742058420594206042061420624206342064420654206642067420684206942070420714207242073420744207542076420774207842079420804208142082420834208442085420864208742088420894209042091420924209342094420954209642097420984209942100421014210242103421044210542106421074210842109421104211142112421134211442115421164211742118421194212042121421224212342124421254212642127421284212942130421314213242133421344213542136421374213842139421404214142142421434214442145421464214742148421494215042151421524215342154421554215642157421584215942160421614216242163421644216542166421674216842169421704217142172421734217442175421764217742178421794218042181421824218342184421854218642187421884218942190421914219242193421944219542196421974219842199422004220142202422034220442205422064220742208422094221042211422124221342214422154221642217422184221942220422214222242223422244222542226422274222842229422304223142232422334223442235422364223742238422394224042241422424224342244422454224642247422484224942250422514225242253422544225542256422574225842259422604226142262422634226442265422664226742268422694227042271422724227342274422754227642277422784227942280422814228242283422844228542286422874228842289422904229142292422934229442295422964229742298422994230042301423024230342304423054230642307423084230942310423114231242313423144231542316423174231842319423204232142322423234232442325423264232742328423294233042331423324233342334423354233642337423384233942340423414234242343423444234542346423474234842349423504235142352423534235442355423564235742358423594236042361423624236342364423654236642367423684236942370423714237242373423744237542376423774237842379423804238142382423834238442385423864238742388423894239042391423924239342394423954239642397423984239942400424014240242403424044240542406424074240842409424104241142412424134241442415424164241742418424194242042421424224242342424424254242642427424284242942430424314243242433424344243542436424374243842439424404244142442424434244442445424464244742448424494245042451424524245342454424554245642457424584245942460424614246242463424644246542466424674246842469424704247142472424734247442475424764247742478424794248042481424824248342484424854248642487424884248942490424914249242493424944249542496424974249842499425004250142502425034250442505425064250742508425094251042511425124251342514425154251642517425184251942520425214252242523425244252542526425274252842529425304253142532425334253442535425364253742538425394254042541425424254342544425454254642547425484254942550425514255242553425544255542556425574255842559425604256142562425634256442565425664256742568425694257042571425724257342574425754257642577425784257942580425814258242583425844258542586425874258842589425904259142592425934259442595425964259742598425994260042601426024260342604426054260642607426084260942610426114261242613426144261542616426174261842619426204262142622426234262442625426264262742628426294263042631426324263342634426354263642637426384263942640426414264242643426444264542646426474264842649426504265142652426534265442655426564265742658426594266042661426624266342664426654266642667426684266942670426714267242673426744267542676426774267842679426804268142682426834268442685426864268742688426894269042691426924269342694426954269642697426984269942700427014270242703427044270542706427074270842709427104271142712427134271442715427164271742718427194272042721427224272342724427254272642727427284272942730427314273242733427344273542736427374273842739427404274142742427434274442745427464274742748427494275042751427524275342754427554275642757427584275942760427614276242763427644276542766427674276842769427704277142772427734277442775427764277742778427794278042781427824278342784427854278642787427884278942790427914279242793427944279542796427974279842799428004280142802428034280442805428064280742808428094281042811428124281342814428154281642817428184281942820428214282242823428244282542826428274282842829428304283142832428334283442835428364283742838428394284042841428424284342844428454284642847428484284942850428514285242853428544285542856428574285842859428604286142862428634286442865428664286742868428694287042871428724287342874428754287642877428784287942880428814288242883428844288542886428874288842889428904289142892428934289442895428964289742898428994290042901429024290342904429054290642907429084290942910429114291242913429144291542916429174291842919429204292142922429234292442925429264292742928429294293042931429324293342934429354293642937429384293942940429414294242943429444294542946429474294842949429504295142952429534295442955429564295742958429594296042961429624296342964429654296642967429684296942970429714297242973429744297542976429774297842979429804298142982429834298442985429864298742988429894299042991429924299342994429954299642997429984299943000430014300243003430044300543006430074300843009430104301143012430134301443015430164301743018430194302043021430224302343024430254302643027430284302943030430314303243033430344303543036430374303843039430404304143042430434304443045430464304743048430494305043051430524305343054430554305643057430584305943060430614306243063430644306543066430674306843069430704307143072430734307443075430764307743078430794308043081430824308343084430854308643087430884308943090430914309243093430944309543096430974309843099431004310143102431034310443105431064310743108431094311043111431124311343114431154311643117431184311943120431214312243123431244312543126431274312843129431304313143132431334313443135431364313743138431394314043141431424314343144431454314643147431484314943150431514315243153431544315543156431574315843159431604316143162431634316443165431664316743168431694317043171431724317343174431754317643177431784317943180431814318243183431844318543186431874318843189431904319143192431934319443195431964319743198431994320043201432024320343204432054320643207432084320943210432114321243213432144321543216432174321843219432204322143222432234322443225432264322743228432294323043231432324323343234432354323643237432384323943240432414324243243432444324543246432474324843249432504325143252432534325443255432564325743258432594326043261432624326343264432654326643267432684326943270432714327243273432744327543276432774327843279432804328143282432834328443285432864328743288432894329043291432924329343294432954329643297432984329943300433014330243303433044330543306433074330843309433104331143312433134331443315433164331743318433194332043321433224332343324433254332643327433284332943330433314333243333433344333543336433374333843339433404334143342433434334443345433464334743348433494335043351433524335343354433554335643357433584335943360433614336243363433644336543366433674336843369433704337143372433734337443375433764337743378433794338043381433824338343384433854338643387433884338943390433914339243393433944339543396433974339843399434004340143402434034340443405434064340743408434094341043411434124341343414434154341643417434184341943420434214342243423434244342543426434274342843429434304343143432434334343443435434364343743438434394344043441434424344343444434454344643447434484344943450434514345243453434544345543456434574345843459434604346143462434634346443465434664346743468434694347043471434724347343474434754347643477434784347943480434814348243483434844348543486434874348843489434904349143492434934349443495434964349743498434994350043501435024350343504435054350643507435084350943510435114351243513435144351543516435174351843519435204352143522435234352443525435264352743528435294353043531435324353343534435354353643537435384353943540435414354243543435444354543546435474354843549435504355143552435534355443555435564355743558435594356043561435624356343564435654356643567435684356943570435714357243573435744357543576435774357843579435804358143582435834358443585435864358743588435894359043591435924359343594435954359643597435984359943600436014360243603436044360543606436074360843609436104361143612436134361443615436164361743618436194362043621436224362343624436254362643627436284362943630436314363243633436344363543636436374363843639436404364143642436434364443645436464364743648436494365043651436524365343654436554365643657436584365943660436614366243663436644366543666436674366843669436704367143672436734367443675436764367743678436794368043681436824368343684436854368643687436884368943690436914369243693436944369543696436974369843699437004370143702437034370443705437064370743708437094371043711437124371343714437154371643717437184371943720437214372243723437244372543726437274372843729437304373143732437334373443735437364373743738437394374043741437424374343744437454374643747437484374943750437514375243753437544375543756437574375843759437604376143762437634376443765437664376743768437694377043771437724377343774437754377643777437784377943780437814378243783437844378543786437874378843789437904379143792437934379443795437964379743798437994380043801438024380343804438054380643807438084380943810438114381243813438144381543816438174381843819438204382143822438234382443825438264382743828438294383043831438324383343834438354383643837438384383943840438414384243843438444384543846438474384843849438504385143852438534385443855438564385743858438594386043861438624386343864438654386643867438684386943870438714387243873438744387543876438774387843879438804388143882438834388443885438864388743888438894389043891438924389343894438954389643897438984389943900439014390243903439044390543906439074390843909439104391143912439134391443915439164391743918439194392043921439224392343924439254392643927439284392943930439314393243933439344393543936439374393843939439404394143942439434394443945439464394743948439494395043951439524395343954439554395643957439584395943960439614396243963439644396543966439674396843969439704397143972439734397443975439764397743978439794398043981439824398343984439854398643987439884398943990439914399243993439944399543996439974399843999440004400144002440034400444005440064400744008440094401044011440124401344014440154401644017440184401944020440214402244023440244402544026440274402844029440304403144032440334403444035440364403744038440394404044041440424404344044440454404644047440484404944050440514405244053440544405544056440574405844059440604406144062440634406444065440664406744068440694407044071440724407344074440754407644077440784407944080440814408244083440844408544086440874408844089440904409144092440934409444095440964409744098440994410044101441024410344104441054410644107441084410944110441114411244113441144411544116441174411844119441204412144122441234412444125441264412744128441294413044131441324413344134441354413644137441384413944140441414414244143441444414544146441474414844149441504415144152441534415444155441564415744158441594416044161441624416344164441654416644167441684416944170441714417244173441744417544176441774417844179441804418144182441834418444185441864418744188441894419044191441924419344194441954419644197441984419944200442014420244203442044420544206442074420844209442104421144212442134421444215442164421744218442194422044221442224422344224442254422644227442284422944230442314423244233442344423544236442374423844239442404424144242442434424444245442464424744248442494425044251442524425344254442554425644257442584425944260442614426244263442644426544266442674426844269442704427144272442734427444275442764427744278442794428044281442824428344284442854428644287442884428944290442914429244293442944429544296442974429844299443004430144302443034430444305443064430744308443094431044311443124431344314443154431644317443184431944320443214432244323443244432544326443274432844329443304433144332443334433444335443364433744338443394434044341443424434344344443454434644347443484434944350443514435244353443544435544356443574435844359443604436144362443634436444365443664436744368443694437044371443724437344374443754437644377443784437944380443814438244383443844438544386443874438844389443904439144392443934439444395443964439744398443994440044401444024440344404444054440644407444084440944410444114441244413444144441544416444174441844419444204442144422444234442444425444264442744428444294443044431444324443344434444354443644437444384443944440444414444244443444444444544446444474444844449444504445144452444534445444455444564445744458444594446044461444624446344464444654446644467444684446944470444714447244473444744447544476444774447844479444804448144482444834448444485444864448744488444894449044491444924449344494444954449644497444984449944500445014450244503445044450544506445074450844509445104451144512445134451444515445164451744518445194452044521445224452344524445254452644527445284452944530445314453244533445344453544536445374453844539445404454144542445434454444545445464454744548445494455044551445524455344554445554455644557445584455944560445614456244563445644456544566445674456844569445704457144572445734457444575445764457744578445794458044581445824458344584445854458644587445884458944590445914459244593445944459544596445974459844599446004460144602446034460444605446064460744608446094461044611446124461344614446154461644617446184461944620446214462244623446244462544626446274462844629446304463144632446334463444635446364463744638446394464044641446424464344644446454464644647446484464944650446514465244653446544465544656446574465844659446604466144662446634466444665446664466744668446694467044671446724467344674446754467644677446784467944680446814468244683446844468544686446874468844689446904469144692446934469444695446964469744698446994470044701447024470344704447054470644707447084470944710447114471244713447144471544716447174471844719447204472144722447234472444725447264472744728447294473044731447324473344734447354473644737447384473944740447414474244743447444474544746447474474844749447504475144752447534475444755447564475744758447594476044761447624476344764447654476644767447684476944770447714477244773447744477544776447774477844779447804478144782447834478444785447864478744788447894479044791447924479344794447954479644797447984479944800448014480244803448044480544806448074480844809448104481144812448134481444815448164481744818448194482044821448224482344824448254482644827448284482944830448314483244833448344483544836448374483844839448404484144842448434484444845448464484744848448494485044851448524485344854448554485644857448584485944860448614486244863448644486544866448674486844869448704487144872448734487444875448764487744878448794488044881448824488344884448854488644887448884488944890448914489244893448944489544896448974489844899449004490144902449034490444905449064490744908449094491044911449124491344914449154491644917449184491944920449214492244923449244492544926449274492844929449304493144932449334493444935449364493744938449394494044941449424494344944449454494644947449484494944950449514495244953449544495544956449574495844959449604496144962449634496444965449664496744968449694497044971449724497344974449754497644977449784497944980449814498244983449844498544986449874498844989449904499144992449934499444995449964499744998449994500045001450024500345004450054500645007450084500945010450114501245013450144501545016450174501845019450204502145022450234502445025450264502745028450294503045031450324503345034450354503645037450384503945040450414504245043450444504545046450474504845049450504505145052450534505445055450564505745058450594506045061450624506345064450654506645067450684506945070450714507245073450744507545076450774507845079450804508145082450834508445085450864508745088450894509045091450924509345094450954509645097450984509945100451014510245103451044510545106451074510845109451104511145112451134511445115451164511745118451194512045121451224512345124451254512645127451284512945130451314513245133451344513545136451374513845139451404514145142451434514445145451464514745148451494515045151451524515345154451554515645157451584515945160451614516245163451644516545166451674516845169451704517145172451734517445175451764517745178451794518045181451824518345184451854518645187451884518945190451914519245193451944519545196451974519845199452004520145202452034520445205452064520745208452094521045211452124521345214452154521645217452184521945220452214522245223452244522545226452274522845229452304523145232452334523445235452364523745238452394524045241452424524345244452454524645247452484524945250452514525245253452544525545256452574525845259452604526145262452634526445265452664526745268452694527045271452724527345274452754527645277452784527945280452814528245283452844528545286452874528845289452904529145292452934529445295452964529745298452994530045301453024530345304453054530645307453084530945310453114531245313453144531545316453174531845319453204532145322453234532445325453264532745328453294533045331453324533345334453354533645337453384533945340453414534245343453444534545346453474534845349453504535145352453534535445355453564535745358453594536045361453624536345364453654536645367453684536945370453714537245373453744537545376453774537845379453804538145382453834538445385453864538745388453894539045391453924539345394453954539645397453984539945400454014540245403454044540545406454074540845409454104541145412454134541445415454164541745418454194542045421454224542345424454254542645427454284542945430454314543245433454344543545436454374543845439454404544145442454434544445445454464544745448454494545045451454524545345454454554545645457454584545945460454614546245463454644546545466454674546845469454704547145472454734547445475454764547745478454794548045481454824548345484454854548645487454884548945490454914549245493454944549545496454974549845499455004550145502455034550445505455064550745508455094551045511455124551345514455154551645517455184551945520455214552245523455244552545526455274552845529455304553145532455334553445535455364553745538455394554045541455424554345544455454554645547455484554945550455514555245553455544555545556455574555845559455604556145562455634556445565455664556745568455694557045571455724557345574455754557645577455784557945580455814558245583455844558545586455874558845589455904559145592455934559445595455964559745598455994560045601456024560345604456054560645607456084560945610456114561245613456144561545616456174561845619456204562145622456234562445625456264562745628456294563045631456324563345634456354563645637456384563945640456414564245643456444564545646456474564845649456504565145652456534565445655456564565745658456594566045661456624566345664456654566645667456684566945670456714567245673456744567545676456774567845679456804568145682456834568445685456864568745688456894569045691456924569345694456954569645697456984569945700457014570245703457044570545706457074570845709457104571145712457134571445715457164571745718457194572045721457224572345724457254572645727457284572945730457314573245733457344573545736457374573845739457404574145742457434574445745457464574745748457494575045751457524575345754457554575645757457584575945760457614576245763457644576545766457674576845769457704577145772457734577445775457764577745778457794578045781457824578345784457854578645787457884578945790457914579245793457944579545796457974579845799458004580145802458034580445805458064580745808458094581045811458124581345814458154581645817458184581945820458214582245823458244582545826458274582845829458304583145832458334583445835458364583745838458394584045841458424584345844458454584645847458484584945850458514585245853458544585545856458574585845859458604586145862458634586445865458664586745868458694587045871458724587345874458754587645877458784587945880458814588245883458844588545886458874588845889458904589145892458934589445895458964589745898458994590045901459024590345904459054590645907459084590945910459114591245913459144591545916459174591845919459204592145922459234592445925459264592745928459294593045931459324593345934459354593645937459384593945940459414594245943459444594545946459474594845949459504595145952459534595445955459564595745958459594596045961459624596345964459654596645967459684596945970459714597245973459744597545976459774597845979459804598145982459834598445985459864598745988459894599045991459924599345994459954599645997459984599946000460014600246003460044600546006460074600846009460104601146012460134601446015460164601746018460194602046021460224602346024460254602646027460284602946030460314603246033460344603546036460374603846039460404604146042460434604446045460464604746048460494605046051460524605346054460554605646057460584605946060460614606246063460644606546066460674606846069460704607146072460734607446075460764607746078460794608046081460824608346084460854608646087460884608946090460914609246093460944609546096460974609846099461004610146102461034610446105461064610746108461094611046111461124611346114461154611646117461184611946120461214612246123461244612546126461274612846129461304613146132461334613446135461364613746138461394614046141461424614346144461454614646147461484614946150461514615246153461544615546156461574615846159461604616146162461634616446165461664616746168461694617046171461724617346174461754617646177461784617946180461814618246183461844618546186461874618846189461904619146192461934619446195461964619746198461994620046201462024620346204462054620646207462084620946210462114621246213462144621546216462174621846219462204622146222462234622446225462264622746228462294623046231462324623346234462354623646237462384623946240462414624246243462444624546246462474624846249462504625146252462534625446255462564625746258462594626046261462624626346264462654626646267462684626946270462714627246273462744627546276462774627846279462804628146282462834628446285462864628746288462894629046291462924629346294462954629646297462984629946300463014630246303463044630546306463074630846309463104631146312463134631446315463164631746318463194632046321463224632346324463254632646327463284632946330463314633246333463344633546336463374633846339463404634146342463434634446345463464634746348463494635046351463524635346354463554635646357463584635946360463614636246363463644636546366463674636846369463704637146372463734637446375463764637746378463794638046381463824638346384463854638646387463884638946390463914639246393463944639546396463974639846399464004640146402464034640446405464064640746408464094641046411464124641346414464154641646417464184641946420464214642246423464244642546426464274642846429464304643146432464334643446435464364643746438464394644046441464424644346444464454644646447464484644946450464514645246453464544645546456464574645846459464604646146462464634646446465464664646746468464694647046471464724647346474464754647646477464784647946480464814648246483464844648546486464874648846489464904649146492464934649446495464964649746498464994650046501465024650346504465054650646507465084650946510465114651246513465144651546516465174651846519465204652146522465234652446525465264652746528465294653046531465324653346534465354653646537465384653946540465414654246543465444654546546465474654846549465504655146552465534655446555465564655746558465594656046561465624656346564465654656646567465684656946570465714657246573465744657546576465774657846579465804658146582465834658446585465864658746588465894659046591465924659346594465954659646597465984659946600466014660246603466044660546606466074660846609466104661146612466134661446615466164661746618466194662046621466224662346624466254662646627466284662946630466314663246633466344663546636466374663846639466404664146642466434664446645466464664746648466494665046651466524665346654466554665646657466584665946660466614666246663466644666546666466674666846669466704667146672466734667446675466764667746678466794668046681466824668346684466854668646687466884668946690466914669246693466944669546696466974669846699467004670146702467034670446705467064670746708467094671046711467124671346714467154671646717467184671946720467214672246723467244672546726467274672846729467304673146732467334673446735467364673746738467394674046741467424674346744467454674646747467484674946750467514675246753467544675546756467574675846759467604676146762467634676446765467664676746768467694677046771467724677346774467754677646777467784677946780467814678246783467844678546786467874678846789467904679146792467934679446795467964679746798467994680046801468024680346804468054680646807468084680946810468114681246813468144681546816468174681846819468204682146822468234682446825468264682746828468294683046831468324683346834468354683646837468384683946840468414684246843468444684546846468474684846849468504685146852468534685446855468564685746858468594686046861468624686346864468654686646867468684686946870468714687246873468744687546876468774687846879468804688146882468834688446885468864688746888468894689046891468924689346894468954689646897468984689946900469014690246903469044690546906469074690846909469104691146912469134691446915469164691746918469194692046921469224692346924469254692646927469284692946930469314693246933469344693546936469374693846939469404694146942469434694446945469464694746948469494695046951469524695346954469554695646957469584695946960469614696246963469644696546966469674696846969469704697146972469734697446975469764697746978469794698046981469824698346984469854698646987469884698946990469914699246993469944699546996469974699846999470004700147002470034700447005470064700747008470094701047011470124701347014470154701647017470184701947020470214702247023470244702547026470274702847029470304703147032470334703447035470364703747038470394704047041470424704347044470454704647047470484704947050470514705247053470544705547056470574705847059470604706147062470634706447065470664706747068470694707047071470724707347074470754707647077470784707947080470814708247083470844708547086470874708847089470904709147092470934709447095470964709747098470994710047101471024710347104471054710647107471084710947110471114711247113471144711547116471174711847119471204712147122471234712447125471264712747128471294713047131471324713347134471354713647137471384713947140471414714247143471444714547146471474714847149471504715147152471534715447155471564715747158471594716047161471624716347164471654716647167471684716947170471714717247173471744717547176471774717847179471804718147182471834718447185471864718747188471894719047191471924719347194471954719647197471984719947200472014720247203472044720547206472074720847209472104721147212472134721447215472164721747218472194722047221472224722347224472254722647227472284722947230472314723247233472344723547236472374723847239472404724147242472434724447245472464724747248472494725047251472524725347254472554725647257472584725947260472614726247263472644726547266472674726847269472704727147272472734727447275472764727747278472794728047281472824728347284472854728647287472884728947290472914729247293472944729547296472974729847299473004730147302473034730447305473064730747308473094731047311473124731347314473154731647317473184731947320473214732247323473244732547326473274732847329473304733147332473334733447335473364733747338473394734047341473424734347344473454734647347473484734947350473514735247353473544735547356473574735847359473604736147362473634736447365473664736747368473694737047371473724737347374473754737647377473784737947380473814738247383473844738547386473874738847389473904739147392473934739447395473964739747398473994740047401474024740347404474054740647407474084740947410474114741247413474144741547416474174741847419474204742147422474234742447425474264742747428474294743047431474324743347434474354743647437474384743947440474414744247443474444744547446474474744847449474504745147452474534745447455474564745747458474594746047461474624746347464474654746647467474684746947470474714747247473474744747547476474774747847479474804748147482474834748447485474864748747488474894749047491474924749347494474954749647497474984749947500475014750247503475044750547506475074750847509475104751147512475134751447515475164751747518475194752047521475224752347524475254752647527475284752947530475314753247533475344753547536475374753847539475404754147542475434754447545475464754747548475494755047551475524755347554475554755647557475584755947560475614756247563475644756547566475674756847569475704757147572475734757447575475764757747578475794758047581475824758347584475854758647587475884758947590475914759247593475944759547596475974759847599476004760147602476034760447605476064760747608476094761047611476124761347614476154761647617476184761947620476214762247623476244762547626476274762847629476304763147632476334763447635476364763747638476394764047641476424764347644476454764647647476484764947650476514765247653476544765547656476574765847659476604766147662476634766447665476664766747668476694767047671476724767347674476754767647677476784767947680476814768247683476844768547686476874768847689476904769147692476934769447695476964769747698476994770047701477024770347704477054770647707477084770947710477114771247713477144771547716477174771847719477204772147722477234772447725477264772747728477294773047731477324773347734477354773647737477384773947740477414774247743477444774547746477474774847749477504775147752477534775447755477564775747758477594776047761477624776347764477654776647767477684776947770477714777247773477744777547776477774777847779477804778147782477834778447785477864778747788477894779047791477924779347794477954779647797477984779947800478014780247803478044780547806478074780847809478104781147812478134781447815478164781747818478194782047821478224782347824478254782647827478284782947830478314783247833478344783547836478374783847839478404784147842478434784447845478464784747848478494785047851478524785347854478554785647857478584785947860478614786247863478644786547866478674786847869478704787147872478734787447875478764787747878478794788047881478824788347884478854788647887478884788947890478914789247893478944789547896478974789847899479004790147902479034790447905479064790747908479094791047911479124791347914479154791647917479184791947920479214792247923479244792547926479274792847929479304793147932479334793447935479364793747938479394794047941479424794347944479454794647947479484794947950479514795247953479544795547956479574795847959479604796147962479634796447965479664796747968479694797047971479724797347974479754797647977479784797947980479814798247983479844798547986479874798847989479904799147992479934799447995479964799747998479994800048001480024800348004480054800648007480084800948010480114801248013480144801548016480174801848019480204802148022480234802448025480264802748028480294803048031480324803348034480354803648037480384803948040480414804248043480444804548046480474804848049480504805148052480534805448055480564805748058480594806048061480624806348064480654806648067480684806948070480714807248073480744807548076480774807848079480804808148082480834808448085480864808748088480894809048091480924809348094480954809648097480984809948100481014810248103481044810548106481074810848109481104811148112481134811448115481164811748118481194812048121481224812348124481254812648127481284812948130481314813248133481344813548136481374813848139481404814148142481434814448145481464814748148481494815048151481524815348154481554815648157481584815948160481614816248163481644816548166481674816848169481704817148172481734817448175481764817748178481794818048181481824818348184481854818648187481884818948190481914819248193481944819548196481974819848199482004820148202482034820448205482064820748208482094821048211482124821348214482154821648217482184821948220482214822248223482244822548226482274822848229482304823148232482334823448235482364823748238482394824048241482424824348244482454824648247482484824948250482514825248253482544825548256482574825848259482604826148262482634826448265482664826748268482694827048271482724827348274482754827648277482784827948280482814828248283482844828548286482874828848289482904829148292482934829448295482964829748298482994830048301483024830348304483054830648307483084830948310483114831248313483144831548316483174831848319483204832148322483234832448325483264832748328483294833048331483324833348334483354833648337483384833948340483414834248343483444834548346483474834848349483504835148352483534835448355483564835748358483594836048361483624836348364483654836648367483684836948370483714837248373483744837548376483774837848379483804838148382483834838448385483864838748388483894839048391483924839348394483954839648397483984839948400484014840248403484044840548406484074840848409484104841148412484134841448415484164841748418484194842048421484224842348424484254842648427484284842948430484314843248433484344843548436484374843848439484404844148442484434844448445484464844748448484494845048451484524845348454484554845648457484584845948460484614846248463484644846548466484674846848469484704847148472484734847448475484764847748478484794848048481484824848348484484854848648487484884848948490484914849248493484944849548496484974849848499485004850148502485034850448505485064850748508485094851048511485124851348514485154851648517485184851948520485214852248523485244852548526485274852848529485304853148532485334853448535485364853748538485394854048541485424854348544485454854648547485484854948550485514855248553485544855548556485574855848559485604856148562485634856448565485664856748568485694857048571485724857348574485754857648577485784857948580485814858248583485844858548586485874858848589485904859148592485934859448595485964859748598485994860048601486024860348604486054860648607486084860948610486114861248613486144861548616486174861848619486204862148622486234862448625486264862748628486294863048631486324863348634486354863648637486384863948640486414864248643486444864548646486474864848649486504865148652486534865448655486564865748658486594866048661486624866348664486654866648667486684866948670486714867248673486744867548676486774867848679486804868148682486834868448685486864868748688486894869048691486924869348694486954869648697486984869948700487014870248703487044870548706487074870848709487104871148712487134871448715487164871748718487194872048721487224872348724487254872648727487284872948730487314873248733487344873548736487374873848739487404874148742487434874448745487464874748748487494875048751487524875348754487554875648757487584875948760487614876248763487644876548766487674876848769487704877148772487734877448775487764877748778487794878048781487824878348784487854878648787487884878948790487914879248793487944879548796487974879848799488004880148802488034880448805488064880748808488094881048811488124881348814488154881648817488184881948820488214882248823488244882548826488274882848829488304883148832488334883448835488364883748838488394884048841488424884348844488454884648847488484884948850488514885248853488544885548856488574885848859488604886148862488634886448865488664886748868488694887048871488724887348874488754887648877488784887948880488814888248883488844888548886488874888848889488904889148892488934889448895488964889748898488994890048901489024890348904489054890648907489084890948910489114891248913489144891548916489174891848919489204892148922489234892448925489264892748928489294893048931489324893348934489354893648937489384893948940489414894248943489444894548946489474894848949489504895148952489534895448955489564895748958489594896048961489624896348964489654896648967489684896948970489714897248973489744897548976489774897848979489804898148982489834898448985489864898748988489894899048991489924899348994489954899648997489984899949000490014900249003490044900549006490074900849009490104901149012490134901449015490164901749018490194902049021490224902349024490254902649027490284902949030490314903249033490344903549036490374903849039490404904149042490434904449045490464904749048490494905049051490524905349054490554905649057490584905949060490614906249063490644906549066490674906849069490704907149072490734907449075490764907749078490794908049081490824908349084490854908649087490884908949090490914909249093490944909549096490974909849099491004910149102491034910449105491064910749108491094911049111491124911349114491154911649117491184911949120491214912249123491244912549126491274912849129491304913149132491334913449135491364913749138491394914049141491424914349144491454914649147491484914949150491514915249153491544915549156491574915849159491604916149162491634916449165491664916749168491694917049171491724917349174491754917649177491784917949180491814918249183491844918549186491874918849189491904919149192491934919449195491964919749198491994920049201492024920349204492054920649207492084920949210492114921249213492144921549216492174921849219492204922149222492234922449225492264922749228492294923049231492324923349234492354923649237492384923949240492414924249243492444924549246492474924849249492504925149252492534925449255492564925749258492594926049261492624926349264492654926649267492684926949270492714927249273492744927549276492774927849279492804928149282492834928449285492864928749288492894929049291492924929349294492954929649297492984929949300493014930249303493044930549306493074930849309493104931149312493134931449315493164931749318493194932049321493224932349324493254932649327493284932949330493314933249333493344933549336493374933849339493404934149342493434934449345493464934749348493494935049351493524935349354493554935649357493584935949360493614936249363493644936549366493674936849369493704937149372493734937449375493764937749378493794938049381493824938349384493854938649387493884938949390493914939249393493944939549396493974939849399494004940149402494034940449405494064940749408494094941049411494124941349414494154941649417494184941949420494214942249423494244942549426494274942849429494304943149432494334943449435494364943749438494394944049441494424944349444494454944649447494484944949450494514945249453494544945549456494574945849459494604946149462494634946449465494664946749468494694947049471494724947349474494754947649477494784947949480494814948249483494844948549486494874948849489494904949149492494934949449495494964949749498494994950049501495024950349504495054950649507495084950949510495114951249513495144951549516495174951849519495204952149522495234952449525495264952749528495294953049531495324953349534495354953649537495384953949540495414954249543495444954549546495474954849549495504955149552495534955449555495564955749558495594956049561495624956349564495654956649567495684956949570495714957249573495744957549576495774957849579495804958149582495834958449585495864958749588495894959049591495924959349594495954959649597495984959949600496014960249603496044960549606496074960849609496104961149612496134961449615496164961749618496194962049621496224962349624496254962649627496284962949630496314963249633496344963549636496374963849639496404964149642496434964449645496464964749648496494965049651496524965349654496554965649657496584965949660496614966249663496644966549666496674966849669496704967149672496734967449675496764967749678496794968049681496824968349684496854968649687496884968949690496914969249693496944969549696496974969849699497004970149702497034970449705497064970749708497094971049711497124971349714497154971649717497184971949720497214972249723497244972549726497274972849729497304973149732497334973449735497364973749738497394974049741497424974349744497454974649747497484974949750497514975249753497544975549756497574975849759497604976149762497634976449765497664976749768497694977049771497724977349774497754977649777497784977949780497814978249783497844978549786497874978849789497904979149792497934979449795497964979749798497994980049801498024980349804498054980649807498084980949810498114981249813498144981549816498174981849819498204982149822498234982449825498264982749828498294983049831498324983349834498354983649837498384983949840498414984249843498444984549846498474984849849498504985149852498534985449855498564985749858498594986049861498624986349864498654986649867498684986949870498714987249873498744987549876498774987849879498804988149882498834988449885498864988749888498894989049891498924989349894498954989649897498984989949900499014990249903499044990549906499074990849909499104991149912499134991449915499164991749918499194992049921499224992349924499254992649927499284992949930499314993249933499344993549936499374993849939499404994149942499434994449945499464994749948499494995049951499524995349954499554995649957499584995949960499614996249963499644996549966499674996849969499704997149972499734997449975499764997749978499794998049981499824998349984499854998649987499884998949990499914999249993499944999549996499974999849999500005000150002500035000450005500065000750008500095001050011500125001350014500155001650017500185001950020500215002250023500245002550026500275002850029500305003150032500335003450035500365003750038500395004050041500425004350044500455004650047500485004950050500515005250053500545005550056500575005850059500605006150062500635006450065500665006750068500695007050071500725007350074500755007650077500785007950080500815008250083500845008550086500875008850089500905009150092500935009450095500965009750098500995010050101501025010350104501055010650107501085010950110501115011250113501145011550116501175011850119501205012150122501235012450125501265012750128501295013050131501325013350134501355013650137501385013950140501415014250143501445014550146501475014850149501505015150152501535015450155501565015750158501595016050161501625016350164501655016650167501685016950170501715017250173501745017550176501775017850179501805018150182501835018450185501865018750188501895019050191501925019350194501955019650197501985019950200502015020250203502045020550206502075020850209502105021150212502135021450215502165021750218502195022050221502225022350224502255022650227502285022950230502315023250233502345023550236502375023850239502405024150242502435024450245502465024750248502495025050251502525025350254502555025650257502585025950260502615026250263502645026550266502675026850269502705027150272502735027450275502765027750278502795028050281502825028350284502855028650287502885028950290502915029250293502945029550296502975029850299503005030150302503035030450305503065030750308503095031050311503125031350314503155031650317503185031950320503215032250323503245032550326503275032850329503305033150332503335033450335503365033750338503395034050341503425034350344503455034650347503485034950350503515035250353503545035550356503575035850359503605036150362503635036450365503665036750368503695037050371503725037350374503755037650377503785037950380503815038250383503845038550386503875038850389503905039150392503935039450395503965039750398503995040050401504025040350404504055040650407504085040950410504115041250413504145041550416504175041850419504205042150422504235042450425504265042750428504295043050431504325043350434504355043650437504385043950440504415044250443504445044550446504475044850449504505045150452504535045450455504565045750458504595046050461504625046350464504655046650467504685046950470504715047250473504745047550476504775047850479504805048150482504835048450485504865048750488504895049050491504925049350494504955049650497504985049950500505015050250503505045050550506505075050850509505105051150512505135051450515505165051750518505195052050521505225052350524505255052650527505285052950530505315053250533505345053550536505375053850539505405054150542505435054450545505465054750548505495055050551505525055350554505555055650557505585055950560505615056250563505645056550566505675056850569505705057150572505735057450575505765057750578505795058050581505825058350584505855058650587505885058950590505915059250593505945059550596505975059850599506005060150602506035060450605506065060750608506095061050611506125061350614506155061650617506185061950620506215062250623506245062550626506275062850629506305063150632506335063450635506365063750638506395064050641506425064350644506455064650647506485064950650506515065250653506545065550656506575065850659506605066150662506635066450665506665066750668506695067050671506725067350674506755067650677506785067950680506815068250683506845068550686506875068850689506905069150692506935069450695506965069750698506995070050701507025070350704507055070650707507085070950710507115071250713507145071550716507175071850719507205072150722507235072450725507265072750728507295073050731507325073350734507355073650737507385073950740507415074250743507445074550746507475074850749507505075150752507535075450755507565075750758507595076050761507625076350764507655076650767507685076950770507715077250773507745077550776507775077850779507805078150782507835078450785507865078750788507895079050791507925079350794507955079650797507985079950800508015080250803508045080550806508075080850809508105081150812508135081450815508165081750818508195082050821508225082350824508255082650827508285082950830508315083250833508345083550836508375083850839508405084150842508435084450845508465084750848508495085050851508525085350854508555085650857508585085950860508615086250863508645086550866508675086850869508705087150872508735087450875508765087750878508795088050881508825088350884508855088650887508885088950890508915089250893508945089550896508975089850899509005090150902509035090450905509065090750908509095091050911509125091350914509155091650917509185091950920509215092250923509245092550926509275092850929509305093150932509335093450935509365093750938509395094050941509425094350944509455094650947509485094950950509515095250953509545095550956509575095850959509605096150962509635096450965509665096750968509695097050971509725097350974509755097650977509785097950980509815098250983509845098550986509875098850989509905099150992509935099450995509965099750998509995100051001510025100351004510055100651007510085100951010510115101251013510145101551016510175101851019510205102151022510235102451025510265102751028510295103051031510325103351034510355103651037510385103951040510415104251043510445104551046510475104851049510505105151052510535105451055510565105751058510595106051061510625106351064510655106651067510685106951070510715107251073510745107551076510775107851079510805108151082510835108451085510865108751088510895109051091510925109351094510955109651097510985109951100511015110251103511045110551106511075110851109511105111151112511135111451115511165111751118511195112051121511225112351124511255112651127511285112951130511315113251133511345113551136511375113851139511405114151142511435114451145511465114751148511495115051151511525115351154511555115651157511585115951160511615116251163511645116551166511675116851169511705117151172511735117451175511765117751178511795118051181511825118351184511855118651187511885118951190511915119251193511945119551196511975119851199512005120151202512035120451205512065120751208512095121051211512125121351214512155121651217512185121951220512215122251223512245122551226512275122851229512305123151232512335123451235512365123751238512395124051241512425124351244512455124651247512485124951250512515125251253512545125551256512575125851259512605126151262512635126451265512665126751268512695127051271512725127351274512755127651277512785127951280512815128251283512845128551286512875128851289512905129151292512935129451295512965129751298512995130051301513025130351304513055130651307513085130951310513115131251313513145131551316513175131851319513205132151322513235132451325513265132751328513295133051331513325133351334513355133651337513385133951340513415134251343513445134551346513475134851349513505135151352513535135451355513565135751358513595136051361513625136351364513655136651367513685136951370513715137251373513745137551376513775137851379513805138151382513835138451385513865138751388513895139051391513925139351394513955139651397513985139951400514015140251403514045140551406514075140851409514105141151412514135141451415514165141751418514195142051421514225142351424514255142651427514285142951430514315143251433514345143551436514375143851439514405144151442514435144451445514465144751448514495145051451514525145351454514555145651457514585145951460514615146251463514645146551466514675146851469514705147151472514735147451475514765147751478514795148051481514825148351484514855148651487514885148951490514915149251493514945149551496514975149851499515005150151502515035150451505515065150751508515095151051511515125151351514515155151651517515185151951520515215152251523515245152551526515275152851529515305153151532515335153451535515365153751538515395154051541515425154351544515455154651547515485154951550515515155251553515545155551556515575155851559515605156151562515635156451565515665156751568515695157051571515725157351574515755157651577515785157951580515815158251583515845158551586515875158851589515905159151592515935159451595515965159751598515995160051601516025160351604516055160651607516085160951610516115161251613516145161551616516175161851619516205162151622516235162451625516265162751628516295163051631516325163351634516355163651637516385163951640516415164251643516445164551646516475164851649516505165151652516535165451655516565165751658516595166051661516625166351664516655166651667516685166951670516715167251673516745167551676516775167851679516805168151682516835168451685516865168751688516895169051691516925169351694516955169651697516985169951700517015170251703517045170551706517075170851709517105171151712517135171451715517165171751718517195172051721517225172351724517255172651727517285172951730517315173251733517345173551736517375173851739517405174151742517435174451745517465174751748517495175051751517525175351754517555175651757517585175951760517615176251763517645176551766517675176851769517705177151772517735177451775517765177751778517795178051781517825178351784517855178651787517885178951790517915179251793517945179551796517975179851799518005180151802518035180451805518065180751808518095181051811518125181351814518155181651817518185181951820518215182251823518245182551826518275182851829518305183151832518335183451835518365183751838518395184051841518425184351844518455184651847518485184951850518515185251853518545185551856518575185851859518605186151862518635186451865518665186751868518695187051871518725187351874518755187651877518785187951880518815188251883518845188551886518875188851889518905189151892518935189451895518965189751898518995190051901519025190351904519055190651907519085190951910519115191251913519145191551916519175191851919519205192151922519235192451925519265192751928519295193051931519325193351934519355193651937519385193951940519415194251943519445194551946519475194851949519505195151952519535195451955519565195751958519595196051961519625196351964519655196651967519685196951970519715197251973519745197551976519775197851979519805198151982519835198451985519865198751988519895199051991519925199351994519955199651997519985199952000520015200252003520045200552006520075200852009520105201152012520135201452015520165201752018520195202052021520225202352024520255202652027520285202952030520315203252033520345203552036520375203852039520405204152042520435204452045520465204752048520495205052051520525205352054520555205652057520585205952060520615206252063520645206552066520675206852069520705207152072520735207452075520765207752078520795208052081520825208352084520855208652087520885208952090520915209252093520945209552096520975209852099521005210152102521035210452105521065210752108521095211052111521125211352114521155211652117521185211952120521215212252123521245212552126521275212852129521305213152132521335213452135521365213752138521395214052141521425214352144521455214652147521485214952150521515215252153521545215552156521575215852159521605216152162521635216452165521665216752168521695217052171521725217352174521755217652177521785217952180521815218252183521845218552186521875218852189521905219152192521935219452195521965219752198521995220052201522025220352204522055220652207522085220952210522115221252213522145221552216522175221852219522205222152222522235222452225522265222752228522295223052231522325223352234522355223652237522385223952240522415224252243522445224552246522475224852249522505225152252522535225452255522565225752258522595226052261522625226352264522655226652267522685226952270522715227252273522745227552276522775227852279522805228152282522835228452285522865228752288522895229052291522925229352294522955229652297522985229952300523015230252303523045230552306523075230852309523105231152312523135231452315523165231752318523195232052321523225232352324523255232652327523285232952330523315233252333523345233552336523375233852339523405234152342523435234452345523465234752348523495235052351523525235352354523555235652357523585235952360523615236252363523645236552366523675236852369523705237152372523735237452375523765237752378523795238052381523825238352384523855238652387523885238952390523915239252393523945239552396523975239852399524005240152402524035240452405524065240752408524095241052411524125241352414524155241652417524185241952420524215242252423524245242552426524275242852429524305243152432524335243452435524365243752438524395244052441524425244352444524455244652447524485244952450524515245252453524545245552456524575245852459524605246152462524635246452465524665246752468524695247052471524725247352474524755247652477524785247952480524815248252483524845248552486524875248852489524905249152492524935249452495524965249752498524995250052501525025250352504525055250652507525085250952510525115251252513525145251552516525175251852519525205252152522525235252452525525265252752528525295253052531525325253352534525355253652537525385253952540525415254252543525445254552546525475254852549525505255152552525535255452555525565255752558525595256052561525625256352564525655256652567525685256952570525715257252573525745257552576525775257852579525805258152582525835258452585525865258752588525895259052591525925259352594525955259652597525985259952600526015260252603526045260552606526075260852609526105261152612526135261452615526165261752618526195262052621526225262352624526255262652627526285262952630526315263252633526345263552636526375263852639526405264152642526435264452645526465264752648526495265052651526525265352654526555265652657526585265952660526615266252663526645266552666526675266852669526705267152672526735267452675526765267752678526795268052681526825268352684526855268652687526885268952690526915269252693526945269552696526975269852699527005270152702527035270452705527065270752708527095271052711527125271352714527155271652717527185271952720527215272252723527245272552726527275272852729527305273152732527335273452735527365273752738527395274052741527425274352744527455274652747527485274952750527515275252753527545275552756527575275852759527605276152762527635276452765527665276752768527695277052771527725277352774527755277652777527785277952780527815278252783527845278552786527875278852789527905279152792527935279452795527965279752798527995280052801528025280352804528055280652807528085280952810528115281252813528145281552816528175281852819528205282152822528235282452825528265282752828528295283052831528325283352834528355283652837528385283952840528415284252843528445284552846528475284852849528505285152852528535285452855528565285752858528595286052861528625286352864528655286652867528685286952870528715287252873528745287552876528775287852879528805288152882528835288452885528865288752888528895289052891528925289352894528955289652897528985289952900529015290252903529045290552906529075290852909529105291152912529135291452915529165291752918529195292052921529225292352924529255292652927529285292952930529315293252933529345293552936529375293852939529405294152942529435294452945529465294752948529495295052951529525295352954529555295652957529585295952960529615296252963529645296552966529675296852969529705297152972529735297452975529765297752978529795298052981529825298352984529855298652987529885298952990529915299252993529945299552996529975299852999530005300153002530035300453005530065300753008530095301053011530125301353014530155301653017530185301953020530215302253023530245302553026530275302853029530305303153032530335303453035530365303753038530395304053041530425304353044530455304653047530485304953050530515305253053530545305553056530575305853059530605306153062530635306453065530665306753068530695307053071530725307353074530755307653077530785307953080530815308253083530845308553086530875308853089530905309153092530935309453095530965309753098530995310053101531025310353104531055310653107531085310953110531115311253113531145311553116531175311853119531205312153122531235312453125531265312753128531295313053131531325313353134531355313653137531385313953140531415314253143531445314553146531475314853149531505315153152531535315453155531565315753158531595316053161531625316353164531655316653167531685316953170531715317253173531745317553176531775317853179531805318153182531835318453185531865318753188531895319053191531925319353194531955319653197531985319953200532015320253203532045320553206532075320853209532105321153212532135321453215532165321753218532195322053221532225322353224532255322653227532285322953230532315323253233532345323553236532375323853239532405324153242532435324453245532465324753248532495325053251532525325353254532555325653257532585325953260532615326253263532645326553266532675326853269532705327153272532735327453275532765327753278532795328053281532825328353284532855328653287532885328953290532915329253293532945329553296532975329853299533005330153302533035330453305533065330753308533095331053311533125331353314533155331653317533185331953320533215332253323533245332553326533275332853329533305333153332533335333453335533365333753338533395334053341533425334353344533455334653347533485334953350533515335253353533545335553356533575335853359533605336153362533635336453365533665336753368533695337053371533725337353374533755337653377533785337953380533815338253383533845338553386533875338853389533905339153392533935339453395533965339753398533995340053401534025340353404534055340653407534085340953410534115341253413534145341553416534175341853419534205342153422534235342453425534265342753428534295343053431534325343353434534355343653437534385343953440534415344253443534445344553446534475344853449534505345153452534535345453455534565345753458534595346053461534625346353464534655346653467534685346953470534715347253473534745347553476534775347853479534805348153482534835348453485534865348753488534895349053491534925349353494534955349653497534985349953500535015350253503535045350553506535075350853509535105351153512535135351453515535165351753518535195352053521535225352353524535255352653527535285352953530535315353253533535345353553536535375353853539535405354153542535435354453545535465354753548535495355053551535525355353554535555355653557535585355953560535615356253563535645356553566535675356853569535705357153572535735357453575535765357753578535795358053581535825358353584535855358653587535885358953590535915359253593535945359553596535975359853599536005360153602536035360453605536065360753608536095361053611536125361353614536155361653617536185361953620536215362253623536245362553626536275362853629536305363153632536335363453635536365363753638536395364053641536425364353644536455364653647536485364953650536515365253653536545365553656536575365853659536605366153662536635366453665536665366753668536695367053671536725367353674536755367653677536785367953680536815368253683536845368553686536875368853689536905369153692536935369453695536965369753698536995370053701537025370353704537055370653707537085370953710537115371253713537145371553716537175371853719537205372153722537235372453725537265372753728537295373053731537325373353734537355373653737537385373953740537415374253743537445374553746537475374853749537505375153752537535375453755537565375753758537595376053761537625376353764537655376653767537685376953770537715377253773537745377553776537775377853779537805378153782537835378453785537865378753788537895379053791537925379353794537955379653797537985379953800538015380253803538045380553806538075380853809538105381153812538135381453815538165381753818538195382053821538225382353824538255382653827538285382953830538315383253833538345383553836538375383853839538405384153842538435384453845538465384753848538495385053851538525385353854538555385653857538585385953860538615386253863538645386553866538675386853869538705387153872538735387453875538765387753878538795388053881538825388353884538855388653887538885388953890538915389253893538945389553896538975389853899539005390153902539035390453905539065390753908539095391053911539125391353914539155391653917539185391953920539215392253923539245392553926539275392853929539305393153932539335393453935539365393753938539395394053941539425394353944539455394653947539485394953950539515395253953539545395553956539575395853959539605396153962539635396453965539665396753968539695397053971539725397353974539755397653977539785397953980539815398253983539845398553986539875398853989539905399153992539935399453995539965399753998539995400054001540025400354004540055400654007540085400954010540115401254013540145401554016540175401854019540205402154022540235402454025540265402754028540295403054031540325403354034540355403654037540385403954040540415404254043540445404554046540475404854049540505405154052540535405454055540565405754058540595406054061540625406354064540655406654067540685406954070540715407254073540745407554076540775407854079540805408154082540835408454085540865408754088540895409054091540925409354094540955409654097540985409954100541015410254103541045410554106541075410854109541105411154112541135411454115541165411754118541195412054121541225412354124541255412654127541285412954130541315413254133541345413554136541375413854139541405414154142541435414454145541465414754148541495415054151541525415354154541555415654157541585415954160541615416254163541645416554166541675416854169541705417154172541735417454175541765417754178541795418054181541825418354184541855418654187541885418954190541915419254193541945419554196541975419854199542005420154202542035420454205542065420754208542095421054211542125421354214542155421654217542185421954220542215422254223542245422554226542275422854229542305423154232542335423454235542365423754238542395424054241542425424354244542455424654247542485424954250542515425254253542545425554256542575425854259542605426154262542635426454265542665426754268542695427054271542725427354274542755427654277542785427954280542815428254283542845428554286542875428854289542905429154292542935429454295542965429754298542995430054301543025430354304543055430654307543085430954310543115431254313543145431554316543175431854319543205432154322543235432454325543265432754328543295433054331543325433354334543355433654337543385433954340543415434254343543445434554346543475434854349543505435154352543535435454355543565435754358543595436054361543625436354364543655436654367543685436954370543715437254373543745437554376543775437854379543805438154382543835438454385543865438754388543895439054391543925439354394543955439654397543985439954400544015440254403544045440554406544075440854409544105441154412544135441454415544165441754418544195442054421544225442354424544255442654427544285442954430544315443254433544345443554436544375443854439544405444154442544435444454445544465444754448544495445054451544525445354454544555445654457544585445954460544615446254463544645446554466544675446854469544705447154472544735447454475544765447754478544795448054481544825448354484544855448654487544885448954490544915449254493544945449554496544975449854499545005450154502545035450454505545065450754508545095451054511545125451354514545155451654517545185451954520545215452254523545245452554526545275452854529545305453154532545335453454535545365453754538545395454054541545425454354544545455454654547545485454954550545515455254553545545455554556545575455854559545605456154562545635456454565545665456754568545695457054571545725457354574545755457654577545785457954580545815458254583545845458554586545875458854589545905459154592545935459454595545965459754598545995460054601546025460354604546055460654607546085460954610546115461254613546145461554616546175461854619546205462154622546235462454625546265462754628546295463054631546325463354634546355463654637546385463954640546415464254643546445464554646546475464854649546505465154652546535465454655546565465754658546595466054661546625466354664546655466654667546685466954670546715467254673546745467554676546775467854679546805468154682546835468454685546865468754688546895469054691546925469354694546955469654697546985469954700547015470254703547045470554706547075470854709547105471154712547135471454715547165471754718547195472054721547225472354724547255472654727547285472954730547315473254733547345473554736547375473854739547405474154742547435474454745547465474754748547495475054751547525475354754547555475654757547585475954760547615476254763547645476554766547675476854769547705477154772547735477454775547765477754778547795478054781547825478354784547855478654787547885478954790547915479254793547945479554796547975479854799548005480154802548035480454805548065480754808548095481054811548125481354814548155481654817548185481954820548215482254823548245482554826548275482854829548305483154832548335483454835548365483754838548395484054841548425484354844548455484654847548485484954850548515485254853548545485554856548575485854859548605486154862548635486454865548665486754868548695487054871548725487354874548755487654877548785487954880548815488254883548845488554886548875488854889548905489154892548935489454895548965489754898548995490054901549025490354904549055490654907549085490954910549115491254913549145491554916549175491854919549205492154922549235492454925549265492754928549295493054931549325493354934549355493654937549385493954940549415494254943549445494554946549475494854949549505495154952549535495454955549565495754958549595496054961549625496354964549655496654967549685496954970549715497254973549745497554976549775497854979549805498154982549835498454985549865498754988549895499054991549925499354994549955499654997549985499955000550015500255003550045500555006550075500855009550105501155012550135501455015550165501755018550195502055021550225502355024550255502655027550285502955030550315503255033550345503555036550375503855039550405504155042550435504455045550465504755048550495505055051550525505355054550555505655057550585505955060550615506255063550645506555066550675506855069550705507155072550735507455075550765507755078550795508055081550825508355084550855508655087550885508955090550915509255093550945509555096550975509855099551005510155102551035510455105551065510755108551095511055111551125511355114551155511655117551185511955120551215512255123551245512555126551275512855129551305513155132551335513455135551365513755138551395514055141551425514355144551455514655147551485514955150551515515255153551545515555156551575515855159551605516155162551635516455165551665516755168551695517055171551725517355174551755517655177551785517955180551815518255183551845518555186551875518855189551905519155192551935519455195551965519755198551995520055201552025520355204552055520655207552085520955210552115521255213552145521555216552175521855219552205522155222552235522455225552265522755228552295523055231552325523355234552355523655237552385523955240552415524255243552445524555246552475524855249552505525155252552535525455255552565525755258552595526055261552625526355264552655526655267552685526955270552715527255273552745527555276552775527855279552805528155282552835528455285552865528755288552895529055291552925529355294552955529655297552985529955300553015530255303553045530555306553075530855309553105531155312553135531455315553165531755318553195532055321553225532355324553255532655327553285532955330553315533255333553345533555336553375533855339553405534155342553435534455345553465534755348553495535055351553525535355354553555535655357553585535955360553615536255363553645536555366553675536855369553705537155372553735537455375553765537755378553795538055381553825538355384553855538655387553885538955390553915539255393553945539555396553975539855399554005540155402554035540455405554065540755408554095541055411554125541355414554155541655417554185541955420554215542255423554245542555426554275542855429554305543155432554335543455435554365543755438554395544055441554425544355444554455544655447554485544955450554515545255453554545545555456554575545855459554605546155462554635546455465554665546755468554695547055471554725547355474554755547655477554785547955480554815548255483554845548555486554875548855489554905549155492554935549455495554965549755498554995550055501555025550355504555055550655507555085550955510555115551255513555145551555516555175551855519555205552155522555235552455525555265552755528555295553055531555325553355534555355553655537555385553955540555415554255543555445554555546555475554855549555505555155552555535555455555555565555755558555595556055561555625556355564555655556655567555685556955570555715557255573555745557555576555775557855579555805558155582555835558455585555865558755588555895559055591555925559355594555955559655597555985559955600556015560255603556045560555606556075560855609556105561155612556135561455615556165561755618556195562055621556225562355624556255562655627556285562955630556315563255633556345563555636556375563855639556405564155642556435564455645556465564755648556495565055651556525565355654556555565655657556585565955660556615566255663556645566555666556675566855669556705567155672556735567455675556765567755678556795568055681556825568355684556855568655687556885568955690556915569255693556945569555696556975569855699557005570155702557035570455705557065570755708557095571055711557125571355714557155571655717557185571955720557215572255723557245572555726557275572855729557305573155732557335573455735557365573755738557395574055741557425574355744557455574655747557485574955750557515575255753557545575555756557575575855759557605576155762557635576455765557665576755768557695577055771557725577355774557755577655777557785577955780557815578255783557845578555786557875578855789557905579155792557935579455795557965579755798557995580055801558025580355804558055580655807558085580955810558115581255813558145581555816558175581855819558205582155822558235582455825558265582755828558295583055831558325583355834558355583655837558385583955840558415584255843558445584555846558475584855849558505585155852558535585455855558565585755858558595586055861558625586355864558655586655867558685586955870558715587255873558745587555876558775587855879558805588155882558835588455885558865588755888558895589055891558925589355894558955589655897558985589955900559015590255903559045590555906559075590855909559105591155912559135591455915559165591755918559195592055921559225592355924559255592655927559285592955930559315593255933559345593555936559375593855939559405594155942559435594455945559465594755948559495595055951559525595355954559555595655957559585595955960559615596255963559645596555966559675596855969559705597155972559735597455975559765597755978559795598055981559825598355984559855598655987559885598955990559915599255993559945599555996559975599855999560005600156002560035600456005560065600756008560095601056011560125601356014560155601656017560185601956020560215602256023560245602556026560275602856029560305603156032560335603456035560365603756038560395604056041560425604356044560455604656047560485604956050560515605256053560545605556056560575605856059560605606156062560635606456065560665606756068560695607056071560725607356074560755607656077560785607956080560815608256083560845608556086560875608856089560905609156092560935609456095560965609756098560995610056101561025610356104561055610656107561085610956110561115611256113561145611556116561175611856119561205612156122561235612456125561265612756128561295613056131561325613356134561355613656137561385613956140561415614256143561445614556146561475614856149561505615156152561535615456155561565615756158561595616056161561625616356164561655616656167561685616956170561715617256173561745617556176561775617856179561805618156182561835618456185561865618756188561895619056191561925619356194561955619656197561985619956200562015620256203562045620556206562075620856209562105621156212562135621456215562165621756218562195622056221562225622356224562255622656227562285622956230562315623256233562345623556236562375623856239562405624156242562435624456245562465624756248562495625056251562525625356254562555625656257562585625956260562615626256263562645626556266562675626856269562705627156272562735627456275562765627756278562795628056281562825628356284562855628656287562885628956290562915629256293562945629556296562975629856299563005630156302563035630456305563065630756308563095631056311563125631356314563155631656317563185631956320563215632256323563245632556326563275632856329563305633156332563335633456335563365633756338563395634056341563425634356344563455634656347563485634956350563515635256353563545635556356563575635856359563605636156362563635636456365563665636756368563695637056371563725637356374563755637656377563785637956380563815638256383563845638556386563875638856389563905639156392563935639456395563965639756398563995640056401564025640356404564055640656407564085640956410564115641256413564145641556416564175641856419564205642156422564235642456425564265642756428564295643056431564325643356434564355643656437564385643956440564415644256443564445644556446564475644856449564505645156452564535645456455564565645756458564595646056461564625646356464564655646656467564685646956470564715647256473564745647556476564775647856479564805648156482564835648456485564865648756488564895649056491564925649356494564955649656497564985649956500565015650256503565045650556506565075650856509565105651156512565135651456515565165651756518565195652056521565225652356524565255652656527565285652956530565315653256533565345653556536565375653856539565405654156542565435654456545565465654756548565495655056551565525655356554565555655656557565585655956560565615656256563565645656556566565675656856569565705657156572565735657456575565765657756578565795658056581565825658356584565855658656587565885658956590565915659256593565945659556596565975659856599566005660156602566035660456605566065660756608566095661056611566125661356614566155661656617566185661956620566215662256623566245662556626566275662856629566305663156632566335663456635566365663756638566395664056641566425664356644566455664656647566485664956650566515665256653566545665556656566575665856659566605666156662566635666456665566665666756668566695667056671566725667356674566755667656677566785667956680566815668256683566845668556686566875668856689566905669156692566935669456695566965669756698566995670056701567025670356704567055670656707567085670956710567115671256713567145671556716567175671856719567205672156722567235672456725567265672756728567295673056731567325673356734567355673656737567385673956740567415674256743567445674556746567475674856749567505675156752567535675456755567565675756758567595676056761567625676356764567655676656767567685676956770567715677256773567745677556776567775677856779567805678156782567835678456785567865678756788567895679056791567925679356794567955679656797567985679956800568015680256803568045680556806568075680856809568105681156812568135681456815568165681756818568195682056821568225682356824568255682656827568285682956830568315683256833568345683556836568375683856839568405684156842568435684456845568465684756848568495685056851568525685356854568555685656857568585685956860568615686256863568645686556866568675686856869568705687156872568735687456875568765687756878568795688056881568825688356884568855688656887568885688956890568915689256893568945689556896568975689856899569005690156902569035690456905569065690756908569095691056911569125691356914569155691656917569185691956920569215692256923569245692556926569275692856929569305693156932569335693456935569365693756938569395694056941569425694356944569455694656947569485694956950569515695256953569545695556956569575695856959569605696156962569635696456965569665696756968569695697056971569725697356974569755697656977569785697956980569815698256983569845698556986569875698856989569905699156992569935699456995569965699756998569995700057001570025700357004570055700657007570085700957010570115701257013570145701557016570175701857019570205702157022570235702457025570265702757028570295703057031570325703357034570355703657037570385703957040570415704257043570445704557046570475704857049570505705157052570535705457055570565705757058570595706057061570625706357064570655706657067570685706957070570715707257073570745707557076570775707857079570805708157082570835708457085570865708757088570895709057091570925709357094570955709657097570985709957100571015710257103571045710557106571075710857109571105711157112571135711457115571165711757118571195712057121571225712357124571255712657127571285712957130571315713257133571345713557136571375713857139571405714157142571435714457145571465714757148571495715057151571525715357154571555715657157571585715957160571615716257163571645716557166571675716857169571705717157172571735717457175571765717757178571795718057181571825718357184571855718657187571885718957190571915719257193571945719557196571975719857199572005720157202572035720457205572065720757208572095721057211572125721357214572155721657217572185721957220572215722257223572245722557226572275722857229572305723157232572335723457235572365723757238572395724057241572425724357244572455724657247572485724957250572515725257253572545725557256572575725857259572605726157262572635726457265572665726757268572695727057271572725727357274572755727657277572785727957280572815728257283572845728557286572875728857289572905729157292572935729457295572965729757298572995730057301573025730357304573055730657307573085730957310573115731257313573145731557316573175731857319573205732157322573235732457325573265732757328573295733057331573325733357334573355733657337573385733957340573415734257343573445734557346573475734857349573505735157352573535735457355573565735757358573595736057361573625736357364573655736657367573685736957370573715737257373573745737557376573775737857379573805738157382573835738457385573865738757388573895739057391573925739357394573955739657397573985739957400574015740257403574045740557406574075740857409574105741157412574135741457415574165741757418574195742057421574225742357424574255742657427574285742957430574315743257433574345743557436574375743857439574405744157442574435744457445574465744757448574495745057451574525745357454574555745657457574585745957460574615746257463574645746557466574675746857469574705747157472574735747457475574765747757478574795748057481574825748357484574855748657487574885748957490574915749257493574945749557496574975749857499575005750157502575035750457505575065750757508575095751057511575125751357514575155751657517575185751957520575215752257523575245752557526575275752857529575305753157532575335753457535575365753757538575395754057541575425754357544575455754657547575485754957550575515755257553575545755557556575575755857559575605756157562575635756457565575665756757568575695757057571575725757357574575755757657577575785757957580575815758257583575845758557586575875758857589575905759157592575935759457595575965759757598575995760057601576025760357604576055760657607576085760957610576115761257613576145761557616576175761857619576205762157622576235762457625576265762757628576295763057631576325763357634576355763657637576385763957640576415764257643576445764557646576475764857649576505765157652576535765457655576565765757658576595766057661576625766357664576655766657667576685766957670576715767257673576745767557676576775767857679576805768157682576835768457685576865768757688576895769057691576925769357694576955769657697576985769957700577015770257703577045770557706577075770857709577105771157712577135771457715577165771757718577195772057721577225772357724577255772657727577285772957730577315773257733577345773557736577375773857739577405774157742577435774457745577465774757748577495775057751577525775357754577555775657757577585775957760577615776257763577645776557766577675776857769577705777157772577735777457775577765777757778577795778057781577825778357784577855778657787577885778957790577915779257793577945779557796577975779857799578005780157802578035780457805578065780757808578095781057811578125781357814578155781657817578185781957820578215782257823578245782557826578275782857829578305783157832578335783457835578365783757838578395784057841578425784357844578455784657847578485784957850578515785257853578545785557856578575785857859578605786157862578635786457865578665786757868578695787057871578725787357874578755787657877578785787957880578815788257883578845788557886578875788857889578905789157892578935789457895578965789757898578995790057901579025790357904579055790657907579085790957910579115791257913579145791557916579175791857919579205792157922579235792457925579265792757928579295793057931579325793357934579355793657937579385793957940579415794257943579445794557946579475794857949579505795157952579535795457955579565795757958579595796057961579625796357964579655796657967579685796957970579715797257973579745797557976579775797857979579805798157982579835798457985579865798757988579895799057991579925799357994579955799657997579985799958000580015800258003580045800558006580075800858009580105801158012580135801458015580165801758018580195802058021580225802358024580255802658027580285802958030580315803258033580345803558036580375803858039580405804158042580435804458045580465804758048580495805058051580525805358054580555805658057580585805958060580615806258063580645806558066580675806858069580705807158072580735807458075580765807758078580795808058081580825808358084580855808658087580885808958090580915809258093580945809558096580975809858099581005810158102581035810458105581065810758108581095811058111581125811358114581155811658117581185811958120581215812258123581245812558126581275812858129581305813158132581335813458135581365813758138581395814058141581425814358144581455814658147581485814958150581515815258153581545815558156581575815858159581605816158162581635816458165581665816758168581695817058171581725817358174581755817658177581785817958180581815818258183581845818558186581875818858189581905819158192581935819458195581965819758198581995820058201582025820358204582055820658207582085820958210582115821258213582145821558216582175821858219582205822158222582235822458225582265822758228582295823058231582325823358234582355823658237582385823958240582415824258243582445824558246582475824858249582505825158252582535825458255582565825758258582595826058261582625826358264582655826658267582685826958270582715827258273582745827558276582775827858279582805828158282582835828458285582865828758288582895829058291582925829358294582955829658297582985829958300583015830258303583045830558306583075830858309583105831158312583135831458315583165831758318583195832058321583225832358324583255832658327583285832958330583315833258333583345833558336583375833858339583405834158342583435834458345583465834758348583495835058351583525835358354583555835658357583585835958360583615836258363583645836558366583675836858369583705837158372583735837458375583765837758378583795838058381583825838358384583855838658387583885838958390583915839258393583945839558396583975839858399584005840158402584035840458405584065840758408584095841058411584125841358414584155841658417584185841958420584215842258423584245842558426584275842858429584305843158432584335843458435584365843758438584395844058441584425844358444584455844658447584485844958450584515845258453584545845558456584575845858459584605846158462584635846458465584665846758468584695847058471584725847358474584755847658477584785847958480584815848258483584845848558486584875848858489584905849158492584935849458495584965849758498584995850058501585025850358504585055850658507585085850958510585115851258513585145851558516585175851858519585205852158522585235852458525585265852758528585295853058531585325853358534585355853658537585385853958540585415854258543585445854558546585475854858549585505855158552585535855458555585565855758558585595856058561585625856358564585655856658567585685856958570585715857258573585745857558576585775857858579585805858158582585835858458585585865858758588585895859058591585925859358594585955859658597585985859958600586015860258603586045860558606586075860858609586105861158612586135861458615586165861758618586195862058621586225862358624586255862658627586285862958630586315863258633586345863558636586375863858639586405864158642586435864458645586465864758648586495865058651586525865358654586555865658657586585865958660586615866258663586645866558666586675866858669586705867158672586735867458675586765867758678586795868058681586825868358684586855868658687586885868958690586915869258693586945869558696586975869858699587005870158702587035870458705587065870758708587095871058711587125871358714587155871658717587185871958720587215872258723587245872558726587275872858729587305873158732587335873458735587365873758738587395874058741587425874358744587455874658747587485874958750587515875258753587545875558756587575875858759587605876158762587635876458765587665876758768587695877058771587725877358774587755877658777587785877958780587815878258783587845878558786587875878858789587905879158792587935879458795587965879758798587995880058801588025880358804588055880658807588085880958810588115881258813588145881558816588175881858819588205882158822588235882458825588265882758828588295883058831588325883358834588355883658837588385883958840588415884258843588445884558846588475884858849588505885158852588535885458855588565885758858588595886058861588625886358864588655886658867588685886958870588715887258873588745887558876588775887858879588805888158882588835888458885588865888758888588895889058891588925889358894588955889658897588985889958900589015890258903589045890558906589075890858909589105891158912589135891458915589165891758918589195892058921589225892358924589255892658927589285892958930589315893258933589345893558936589375893858939589405894158942589435894458945589465894758948589495895058951589525895358954589555895658957589585895958960589615896258963589645896558966589675896858969589705897158972589735897458975589765897758978589795898058981589825898358984589855898658987589885898958990589915899258993589945899558996589975899858999590005900159002590035900459005590065900759008590095901059011590125901359014590155901659017590185901959020590215902259023590245902559026590275902859029590305903159032590335903459035590365903759038590395904059041590425904359044590455904659047590485904959050590515905259053590545905559056590575905859059590605906159062590635906459065590665906759068590695907059071590725907359074590755907659077590785907959080590815908259083590845908559086590875908859089590905909159092590935909459095590965909759098590995910059101591025910359104591055910659107591085910959110591115911259113591145911559116591175911859119591205912159122591235912459125591265912759128591295913059131591325913359134591355913659137591385913959140591415914259143591445914559146591475914859149591505915159152591535915459155591565915759158591595916059161591625916359164591655916659167591685916959170591715917259173591745917559176591775917859179591805918159182591835918459185591865918759188591895919059191591925919359194591955919659197591985919959200592015920259203592045920559206592075920859209592105921159212592135921459215592165921759218592195922059221592225922359224592255922659227592285922959230592315923259233592345923559236592375923859239592405924159242592435924459245592465924759248592495925059251592525925359254592555925659257592585925959260592615926259263592645926559266592675926859269592705927159272592735927459275592765927759278592795928059281592825928359284592855928659287592885928959290592915929259293592945929559296592975929859299593005930159302593035930459305593065930759308593095931059311593125931359314593155931659317593185931959320593215932259323593245932559326593275932859329593305933159332593335933459335593365933759338593395934059341593425934359344593455934659347593485934959350593515935259353593545935559356593575935859359593605936159362593635936459365593665936759368593695937059371593725937359374593755937659377593785937959380593815938259383593845938559386593875938859389593905939159392593935939459395593965939759398593995940059401594025940359404594055940659407594085940959410594115941259413594145941559416594175941859419594205942159422594235942459425594265942759428594295943059431594325943359434594355943659437594385943959440594415944259443594445944559446594475944859449594505945159452594535945459455594565945759458594595946059461594625946359464594655946659467594685946959470594715947259473594745947559476594775947859479594805948159482594835948459485594865948759488594895949059491594925949359494594955949659497594985949959500595015950259503595045950559506595075950859509595105951159512595135951459515595165951759518595195952059521595225952359524595255952659527595285952959530595315953259533595345953559536595375953859539595405954159542595435954459545595465954759548595495955059551595525955359554595555955659557595585955959560595615956259563595645956559566595675956859569595705957159572595735957459575595765957759578595795958059581595825958359584595855958659587595885958959590595915959259593595945959559596595975959859599596005960159602596035960459605596065960759608596095961059611596125961359614596155961659617596185961959620596215962259623596245962559626596275962859629596305963159632596335963459635596365963759638596395964059641596425964359644596455964659647596485964959650596515965259653596545965559656596575965859659596605966159662596635966459665596665966759668596695967059671596725967359674596755967659677596785967959680596815968259683596845968559686596875968859689596905969159692596935969459695596965969759698596995970059701597025970359704597055970659707597085970959710597115971259713597145971559716597175971859719597205972159722597235972459725597265972759728597295973059731597325973359734597355973659737597385973959740597415974259743597445974559746597475974859749597505975159752597535975459755597565975759758597595976059761597625976359764597655976659767597685976959770597715977259773597745977559776597775977859779597805978159782597835978459785597865978759788597895979059791597925979359794597955979659797597985979959800598015980259803598045980559806598075980859809598105981159812598135981459815598165981759818598195982059821598225982359824598255982659827598285982959830598315983259833598345983559836598375983859839598405984159842598435984459845598465984759848598495985059851598525985359854598555985659857598585985959860598615986259863598645986559866598675986859869598705987159872598735987459875598765987759878598795988059881598825988359884598855988659887598885988959890598915989259893598945989559896598975989859899599005990159902599035990459905599065990759908599095991059911599125991359914599155991659917599185991959920599215992259923599245992559926599275992859929599305993159932599335993459935599365993759938599395994059941599425994359944599455994659947599485994959950599515995259953599545995559956599575995859959599605996159962599635996459965599665996759968599695997059971599725997359974599755997659977599785997959980599815998259983599845998559986599875998859989599905999159992599935999459995599965999759998599996000060001600026000360004600056000660007600086000960010600116001260013600146001560016600176001860019600206002160022600236002460025600266002760028600296003060031600326003360034600356003660037600386003960040600416004260043600446004560046600476004860049600506005160052600536005460055600566005760058600596006060061600626006360064600656006660067600686006960070600716007260073600746007560076600776007860079600806008160082600836008460085600866008760088600896009060091600926009360094600956009660097600986009960100601016010260103601046010560106601076010860109601106011160112601136011460115601166011760118601196012060121601226012360124601256012660127601286012960130601316013260133601346013560136601376013860139601406014160142601436014460145601466014760148601496015060151601526015360154601556015660157601586015960160601616016260163601646016560166601676016860169601706017160172601736017460175601766017760178601796018060181601826018360184601856018660187601886018960190601916019260193601946019560196601976019860199602006020160202602036020460205602066020760208602096021060211602126021360214602156021660217602186021960220602216022260223602246022560226602276022860229602306023160232602336023460235602366023760238602396024060241602426024360244602456024660247602486024960250602516025260253602546025560256602576025860259602606026160262602636026460265602666026760268602696027060271602726027360274602756027660277602786027960280602816028260283602846028560286602876028860289602906029160292602936029460295602966029760298602996030060301603026030360304603056030660307603086030960310603116031260313603146031560316603176031860319603206032160322603236032460325603266032760328603296033060331603326033360334603356033660337603386033960340603416034260343603446034560346603476034860349603506035160352603536035460355603566035760358603596036060361603626036360364603656036660367603686036960370603716037260373603746037560376603776037860379603806038160382603836038460385603866038760388603896039060391603926039360394603956039660397603986039960400604016040260403604046040560406604076040860409604106041160412604136041460415604166041760418604196042060421604226042360424604256042660427604286042960430604316043260433604346043560436604376043860439604406044160442604436044460445604466044760448604496045060451604526045360454604556045660457604586045960460604616046260463604646046560466604676046860469604706047160472604736047460475604766047760478604796048060481604826048360484604856048660487604886048960490604916049260493604946049560496604976049860499605006050160502605036050460505605066050760508605096051060511605126051360514605156051660517605186051960520605216052260523605246052560526605276052860529605306053160532605336053460535605366053760538605396054060541605426054360544605456054660547605486054960550605516055260553605546055560556605576055860559605606056160562605636056460565605666056760568605696057060571605726057360574605756057660577605786057960580605816058260583605846058560586605876058860589605906059160592605936059460595605966059760598605996060060601606026060360604606056060660607606086060960610606116061260613606146061560616606176061860619606206062160622606236062460625606266062760628606296063060631606326063360634606356063660637606386063960640606416064260643606446064560646606476064860649606506065160652606536065460655606566065760658606596066060661606626066360664606656066660667606686066960670606716067260673606746067560676606776067860679606806068160682606836068460685606866068760688606896069060691606926069360694606956069660697606986069960700607016070260703607046070560706607076070860709607106071160712607136071460715607166071760718607196072060721607226072360724607256072660727607286072960730607316073260733607346073560736607376073860739607406074160742607436074460745607466074760748607496075060751607526075360754607556075660757607586075960760607616076260763607646076560766607676076860769607706077160772607736077460775607766077760778607796078060781607826078360784607856078660787607886078960790607916079260793607946079560796607976079860799608006080160802608036080460805608066080760808608096081060811608126081360814608156081660817608186081960820608216082260823608246082560826608276082860829608306083160832608336083460835608366083760838608396084060841608426084360844608456084660847608486084960850608516085260853608546085560856608576085860859608606086160862608636086460865608666086760868608696087060871608726087360874608756087660877608786087960880608816088260883608846088560886608876088860889608906089160892608936089460895608966089760898608996090060901609026090360904609056090660907609086090960910609116091260913609146091560916609176091860919609206092160922609236092460925609266092760928609296093060931609326093360934609356093660937609386093960940609416094260943609446094560946609476094860949609506095160952609536095460955609566095760958609596096060961609626096360964609656096660967609686096960970609716097260973609746097560976609776097860979609806098160982609836098460985609866098760988609896099060991609926099360994609956099660997609986099961000610016100261003610046100561006610076100861009610106101161012610136101461015610166101761018610196102061021610226102361024610256102661027610286102961030610316103261033610346103561036610376103861039610406104161042610436104461045610466104761048610496105061051610526105361054610556105661057610586105961060610616106261063610646106561066610676106861069610706107161072610736107461075610766107761078610796108061081610826108361084610856108661087610886108961090610916109261093610946109561096610976109861099611006110161102611036110461105611066110761108611096111061111611126111361114611156111661117611186111961120611216112261123611246112561126611276112861129611306113161132611336113461135611366113761138611396114061141611426114361144611456114661147611486114961150611516115261153611546115561156611576115861159611606116161162611636116461165611666116761168611696117061171611726117361174611756117661177611786117961180611816118261183611846118561186611876118861189611906119161192611936119461195611966119761198611996120061201612026120361204612056120661207612086120961210612116121261213612146121561216612176121861219612206122161222612236122461225612266122761228612296123061231612326123361234612356123661237612386123961240612416124261243612446124561246612476124861249612506125161252612536125461255612566125761258612596126061261612626126361264612656126661267612686126961270612716127261273612746127561276612776127861279612806128161282612836128461285612866128761288612896129061291612926129361294612956129661297612986129961300613016130261303613046130561306613076130861309613106131161312613136131461315613166131761318613196132061321613226132361324613256132661327613286132961330613316133261333613346133561336613376133861339613406134161342613436134461345613466134761348613496135061351613526135361354613556135661357613586135961360613616136261363613646136561366613676136861369613706137161372613736137461375613766137761378613796138061381613826138361384613856138661387613886138961390613916139261393613946139561396613976139861399614006140161402614036140461405614066140761408614096141061411614126141361414614156141661417614186141961420614216142261423614246142561426614276142861429614306143161432614336143461435614366143761438614396144061441614426144361444614456144661447614486144961450614516145261453614546145561456614576145861459614606146161462614636146461465614666146761468614696147061471614726147361474614756147661477614786147961480614816148261483614846148561486614876148861489614906149161492614936149461495614966149761498614996150061501615026150361504615056150661507615086150961510615116151261513615146151561516615176151861519615206152161522615236152461525615266152761528615296153061531615326153361534615356153661537615386153961540615416154261543615446154561546615476154861549615506155161552615536155461555615566155761558615596156061561615626156361564615656156661567615686156961570615716157261573615746157561576615776157861579615806158161582615836158461585615866158761588615896159061591615926159361594615956159661597615986159961600616016160261603616046160561606616076160861609616106161161612616136161461615616166161761618616196162061621616226162361624616256162661627616286162961630616316163261633616346163561636616376163861639616406164161642616436164461645616466164761648616496165061651616526165361654616556165661657616586165961660616616166261663616646166561666616676166861669616706167161672616736167461675616766167761678616796168061681616826168361684616856168661687616886168961690616916169261693616946169561696616976169861699617006170161702617036170461705617066170761708617096171061711617126171361714617156171661717617186171961720617216172261723617246172561726617276172861729617306173161732617336173461735617366173761738617396174061741617426174361744617456174661747617486174961750617516175261753617546175561756617576175861759617606176161762617636176461765617666176761768617696177061771617726177361774617756177661777617786177961780617816178261783617846178561786617876178861789617906179161792617936179461795617966179761798617996180061801618026180361804618056180661807618086180961810618116181261813618146181561816618176181861819618206182161822618236182461825618266182761828618296183061831618326183361834618356183661837618386183961840618416184261843618446184561846618476184861849618506185161852618536185461855618566185761858618596186061861618626186361864618656186661867618686186961870618716187261873618746187561876618776187861879618806188161882618836188461885618866188761888618896189061891618926189361894618956189661897618986189961900619016190261903619046190561906619076190861909619106191161912619136191461915619166191761918619196192061921619226192361924619256192661927619286192961930619316193261933619346193561936619376193861939619406194161942619436194461945619466194761948619496195061951619526195361954619556195661957619586195961960619616196261963619646196561966619676196861969619706197161972619736197461975619766197761978619796198061981619826198361984619856198661987619886198961990619916199261993619946199561996619976199861999620006200162002620036200462005620066200762008620096201062011620126201362014620156201662017620186201962020620216202262023620246202562026620276202862029620306203162032620336203462035620366203762038620396204062041620426204362044620456204662047620486204962050620516205262053620546205562056620576205862059620606206162062620636206462065620666206762068620696207062071620726207362074620756207662077620786207962080620816208262083620846208562086620876208862089620906209162092620936209462095620966209762098620996210062101621026210362104621056210662107621086210962110621116211262113621146211562116621176211862119621206212162122621236212462125621266212762128621296213062131621326213362134621356213662137621386213962140621416214262143621446214562146621476214862149621506215162152621536215462155621566215762158621596216062161621626216362164621656216662167621686216962170621716217262173621746217562176621776217862179621806218162182621836218462185621866218762188621896219062191621926219362194621956219662197621986219962200622016220262203622046220562206622076220862209622106221162212622136221462215622166221762218622196222062221622226222362224622256222662227622286222962230622316223262233622346223562236622376223862239622406224162242622436224462245622466224762248622496225062251622526225362254622556225662257622586225962260622616226262263622646226562266622676226862269622706227162272622736227462275622766227762278622796228062281622826228362284622856228662287622886228962290622916229262293622946229562296622976229862299623006230162302623036230462305623066230762308623096231062311623126231362314623156231662317623186231962320623216232262323623246232562326623276232862329623306233162332623336233462335623366233762338623396234062341623426234362344623456234662347623486234962350623516235262353623546235562356623576235862359623606236162362623636236462365623666236762368623696237062371623726237362374623756237662377623786237962380623816238262383623846238562386623876238862389623906239162392623936239462395623966239762398623996240062401624026240362404624056240662407624086240962410624116241262413624146241562416624176241862419624206242162422624236242462425624266242762428624296243062431624326243362434624356243662437624386243962440624416244262443624446244562446624476244862449624506245162452624536245462455624566245762458624596246062461624626246362464624656246662467624686246962470624716247262473624746247562476624776247862479624806248162482624836248462485624866248762488624896249062491624926249362494624956249662497624986249962500625016250262503625046250562506625076250862509625106251162512625136251462515625166251762518625196252062521625226252362524625256252662527625286252962530625316253262533625346253562536625376253862539625406254162542625436254462545625466254762548625496255062551625526255362554625556255662557625586255962560625616256262563625646256562566625676256862569625706257162572625736257462575625766257762578625796258062581625826258362584625856258662587625886258962590625916259262593625946259562596625976259862599626006260162602626036260462605626066260762608626096261062611626126261362614626156261662617626186261962620626216262262623626246262562626626276262862629626306263162632626336263462635626366263762638626396264062641626426264362644626456264662647626486264962650626516265262653626546265562656626576265862659626606266162662626636266462665626666266762668626696267062671626726267362674626756267662677626786267962680626816268262683626846268562686626876268862689626906269162692626936269462695626966269762698626996270062701627026270362704627056270662707627086270962710627116271262713627146271562716627176271862719627206272162722627236272462725627266272762728627296273062731627326273362734627356273662737627386273962740627416274262743627446274562746627476274862749627506275162752627536275462755627566275762758627596276062761627626276362764627656276662767627686276962770627716277262773627746277562776627776277862779627806278162782627836278462785627866278762788627896279062791627926279362794627956279662797627986279962800628016280262803628046280562806628076280862809628106281162812628136281462815628166281762818628196282062821628226282362824628256282662827628286282962830628316283262833628346283562836628376283862839628406284162842628436284462845628466284762848628496285062851628526285362854628556285662857628586285962860628616286262863628646286562866628676286862869628706287162872628736287462875628766287762878628796288062881628826288362884628856288662887628886288962890628916289262893628946289562896628976289862899629006290162902629036290462905629066290762908629096291062911629126291362914629156291662917629186291962920629216292262923629246292562926629276292862929629306293162932629336293462935629366293762938629396294062941629426294362944629456294662947629486294962950629516295262953629546295562956629576295862959629606296162962629636296462965629666296762968629696297062971629726297362974629756297662977629786297962980629816298262983629846298562986629876298862989629906299162992629936299462995629966299762998629996300063001630026300363004630056300663007630086300963010630116301263013630146301563016630176301863019630206302163022630236302463025630266302763028630296303063031630326303363034630356303663037630386303963040630416304263043630446304563046630476304863049630506305163052630536305463055630566305763058630596306063061630626306363064630656306663067630686306963070630716307263073630746307563076630776307863079630806308163082630836308463085630866308763088630896309063091630926309363094630956309663097630986309963100631016310263103631046310563106631076310863109631106311163112631136311463115631166311763118631196312063121631226312363124631256312663127631286312963130631316313263133631346313563136631376313863139631406314163142631436314463145631466314763148631496315063151631526315363154631556315663157631586315963160631616316263163631646316563166631676316863169631706317163172631736317463175631766317763178631796318063181631826318363184631856318663187631886318963190631916319263193631946319563196631976319863199632006320163202632036320463205632066320763208632096321063211632126321363214632156321663217632186321963220632216322263223632246322563226632276322863229632306323163232632336323463235632366323763238632396324063241632426324363244632456324663247632486324963250632516325263253632546325563256632576325863259632606326163262632636326463265632666326763268632696327063271632726327363274632756327663277632786327963280632816328263283632846328563286632876328863289632906329163292632936329463295632966329763298632996330063301633026330363304633056330663307633086330963310633116331263313633146331563316633176331863319633206332163322633236332463325633266332763328633296333063331633326333363334633356333663337633386333963340633416334263343633446334563346633476334863349633506335163352633536335463355633566335763358633596336063361633626336363364633656336663367633686336963370633716337263373633746337563376633776337863379633806338163382633836338463385633866338763388633896339063391633926339363394633956339663397633986339963400634016340263403634046340563406634076340863409634106341163412634136341463415634166341763418634196342063421634226342363424634256342663427634286342963430634316343263433634346343563436634376343863439634406344163442634436344463445634466344763448634496345063451634526345363454634556345663457634586345963460634616346263463634646346563466634676346863469634706347163472634736347463475634766347763478634796348063481634826348363484634856348663487634886348963490634916349263493634946349563496634976349863499635006350163502635036350463505635066350763508635096351063511635126351363514635156351663517635186351963520635216352263523635246352563526635276352863529635306353163532635336353463535635366353763538635396354063541635426354363544635456354663547635486354963550635516355263553635546355563556635576355863559635606356163562635636356463565635666356763568635696357063571635726357363574635756357663577635786357963580635816358263583635846358563586635876358863589635906359163592635936359463595635966359763598635996360063601636026360363604636056360663607636086360963610636116361263613636146361563616636176361863619636206362163622636236362463625636266362763628636296363063631636326363363634636356363663637636386363963640636416364263643636446364563646636476364863649636506365163652636536365463655636566365763658636596366063661636626366363664636656366663667636686366963670636716367263673636746367563676636776367863679636806368163682636836368463685636866368763688636896369063691636926369363694636956369663697636986369963700637016370263703637046370563706637076370863709637106371163712637136371463715637166371763718637196372063721637226372363724637256372663727637286372963730637316373263733637346373563736637376373863739637406374163742637436374463745637466374763748637496375063751637526375363754637556375663757637586375963760637616376263763637646376563766637676376863769637706377163772637736377463775637766377763778637796378063781637826378363784637856378663787637886378963790637916379263793637946379563796637976379863799638006380163802638036380463805638066380763808638096381063811638126381363814638156381663817638186381963820638216382263823638246382563826638276382863829638306383163832638336383463835638366383763838638396384063841638426384363844638456384663847638486384963850638516385263853638546385563856638576385863859638606386163862638636386463865638666386763868638696387063871638726387363874638756387663877638786387963880638816388263883638846388563886638876388863889638906389163892638936389463895638966389763898638996390063901639026390363904639056390663907639086390963910639116391263913639146391563916639176391863919639206392163922639236392463925639266392763928639296393063931639326393363934639356393663937639386393963940639416394263943639446394563946639476394863949639506395163952639536395463955639566395763958639596396063961639626396363964639656396663967639686396963970639716397263973639746397563976639776397863979639806398163982639836398463985639866398763988639896399063991639926399363994639956399663997639986399964000640016400264003640046400564006640076400864009640106401164012640136401464015640166401764018640196402064021640226402364024640256402664027640286402964030640316403264033640346403564036640376403864039640406404164042640436404464045640466404764048640496405064051640526405364054640556405664057640586405964060640616406264063640646406564066640676406864069640706407164072640736407464075640766407764078640796408064081640826408364084640856408664087640886408964090640916409264093640946409564096640976409864099641006410164102641036410464105641066410764108641096411064111641126411364114641156411664117641186411964120641216412264123641246412564126641276412864129641306413164132641336413464135641366413764138641396414064141641426414364144641456414664147641486414964150641516415264153641546415564156641576415864159641606416164162641636416464165641666416764168641696417064171641726417364174641756417664177641786417964180641816418264183641846418564186641876418864189641906419164192641936419464195641966419764198641996420064201642026420364204642056420664207642086420964210642116421264213642146421564216642176421864219642206422164222642236422464225642266422764228642296423064231642326423364234642356423664237642386423964240642416424264243642446424564246642476424864249642506425164252642536425464255642566425764258642596426064261642626426364264642656426664267642686426964270642716427264273642746427564276642776427864279642806428164282642836428464285642866428764288642896429064291642926429364294642956429664297642986429964300643016430264303643046430564306643076430864309643106431164312643136431464315643166431764318643196432064321643226432364324643256432664327643286432964330643316433264333643346433564336643376433864339643406434164342643436434464345643466434764348643496435064351643526435364354643556435664357643586435964360643616436264363643646436564366643676436864369643706437164372643736437464375643766437764378643796438064381643826438364384643856438664387643886438964390643916439264393643946439564396643976439864399644006440164402644036440464405644066440764408644096441064411644126441364414644156441664417644186441964420644216442264423644246442564426644276442864429644306443164432644336443464435644366443764438644396444064441644426444364444644456444664447644486444964450644516445264453644546445564456644576445864459644606446164462644636446464465644666446764468644696447064471644726447364474644756447664477644786447964480644816448264483644846448564486644876448864489644906449164492644936449464495644966449764498644996450064501645026450364504645056450664507645086450964510645116451264513645146451564516645176451864519645206452164522645236452464525645266452764528645296453064531645326453364534645356453664537645386453964540645416454264543645446454564546645476454864549645506455164552645536455464555645566455764558645596456064561645626456364564645656456664567645686456964570645716457264573645746457564576645776457864579645806458164582645836458464585645866458764588645896459064591645926459364594645956459664597645986459964600646016460264603646046460564606646076460864609646106461164612646136461464615646166461764618646196462064621646226462364624646256462664627646286462964630646316463264633646346463564636646376463864639646406464164642646436464464645646466464764648646496465064651646526465364654646556465664657646586465964660646616466264663646646466564666646676466864669646706467164672646736467464675646766467764678646796468064681646826468364684646856468664687646886468964690646916469264693646946469564696646976469864699647006470164702647036470464705647066470764708647096471064711647126471364714647156471664717647186471964720647216472264723647246472564726647276472864729647306473164732647336473464735647366473764738647396474064741647426474364744647456474664747647486474964750647516475264753647546475564756647576475864759647606476164762647636476464765647666476764768647696477064771647726477364774647756477664777647786477964780647816478264783647846478564786647876478864789647906479164792647936479464795647966479764798647996480064801648026480364804648056480664807648086480964810648116481264813648146481564816648176481864819648206482164822648236482464825648266482764828648296483064831648326483364834648356483664837648386483964840648416484264843648446484564846648476484864849648506485164852648536485464855648566485764858648596486064861648626486364864648656486664867648686486964870648716487264873648746487564876648776487864879648806488164882648836488464885648866488764888648896489064891648926489364894648956489664897648986489964900649016490264903649046490564906649076490864909649106491164912649136491464915649166491764918649196492064921649226492364924649256492664927649286492964930649316493264933649346493564936649376493864939649406494164942649436494464945649466494764948649496495064951649526495364954649556495664957649586495964960649616496264963649646496564966649676496864969649706497164972649736497464975649766497764978649796498064981649826498364984649856498664987649886498964990649916499264993649946499564996649976499864999650006500165002650036500465005650066500765008650096501065011650126501365014650156501665017650186501965020650216502265023650246502565026650276502865029650306503165032650336503465035650366503765038650396504065041650426504365044650456504665047650486504965050650516505265053650546505565056650576505865059650606506165062650636506465065650666506765068650696507065071650726507365074650756507665077650786507965080650816508265083650846508565086650876508865089650906509165092650936509465095650966509765098650996510065101651026510365104651056510665107651086510965110651116511265113651146511565116651176511865119651206512165122651236512465125651266512765128651296513065131651326513365134651356513665137651386513965140651416514265143651446514565146651476514865149651506515165152651536515465155651566515765158651596516065161651626516365164651656516665167651686516965170651716517265173651746517565176651776517865179651806518165182651836518465185651866518765188651896519065191651926519365194651956519665197651986519965200652016520265203652046520565206652076520865209652106521165212652136521465215652166521765218652196522065221652226522365224652256522665227652286522965230652316523265233652346523565236652376523865239652406524165242652436524465245652466524765248652496525065251652526525365254652556525665257652586525965260652616526265263652646526565266652676526865269652706527165272652736527465275652766527765278652796528065281652826528365284652856528665287652886528965290652916529265293652946529565296652976529865299653006530165302653036530465305653066530765308653096531065311653126531365314653156531665317653186531965320653216532265323653246532565326653276532865329653306533165332653336533465335653366533765338653396534065341653426534365344653456534665347653486534965350653516535265353653546535565356653576535865359653606536165362653636536465365653666536765368653696537065371653726537365374653756537665377653786537965380653816538265383653846538565386653876538865389653906539165392653936539465395653966539765398653996540065401654026540365404654056540665407654086540965410654116541265413654146541565416654176541865419654206542165422654236542465425654266542765428654296543065431654326543365434654356543665437654386543965440654416544265443654446544565446654476544865449654506545165452654536545465455654566545765458654596546065461654626546365464654656546665467654686546965470654716547265473654746547565476654776547865479654806548165482654836548465485654866548765488654896549065491654926549365494654956549665497654986549965500655016550265503655046550565506655076550865509655106551165512655136551465515655166551765518655196552065521655226552365524655256552665527655286552965530655316553265533655346553565536655376553865539655406554165542655436554465545655466554765548655496555065551655526555365554655556555665557655586555965560655616556265563655646556565566655676556865569655706557165572655736557465575655766557765578655796558065581655826558365584655856558665587655886558965590655916559265593655946559565596655976559865599656006560165602656036560465605656066560765608656096561065611656126561365614656156561665617656186561965620656216562265623656246562565626656276562865629656306563165632656336563465635656366563765638656396564065641656426564365644656456564665647656486564965650656516565265653656546565565656656576565865659656606566165662656636566465665656666566765668656696567065671656726567365674656756567665677656786567965680656816568265683656846568565686656876568865689656906569165692656936569465695656966569765698656996570065701657026570365704657056570665707657086570965710657116571265713657146571565716657176571865719657206572165722657236572465725657266572765728657296573065731657326573365734657356573665737657386573965740657416574265743657446574565746657476574865749657506575165752657536575465755657566575765758657596576065761657626576365764657656576665767657686576965770657716577265773657746577565776657776577865779657806578165782657836578465785657866578765788657896579065791657926579365794657956579665797657986579965800658016580265803658046580565806658076580865809658106581165812658136581465815658166581765818658196582065821658226582365824658256582665827658286582965830658316583265833658346583565836658376583865839658406584165842658436584465845658466584765848658496585065851658526585365854658556585665857658586585965860658616586265863658646586565866658676586865869658706587165872658736587465875658766587765878658796588065881658826588365884658856588665887658886588965890658916589265893658946589565896658976589865899659006590165902659036590465905659066590765908659096591065911659126591365914659156591665917659186591965920659216592265923659246592565926659276592865929659306593165932659336593465935659366593765938659396594065941659426594365944659456594665947659486594965950659516595265953659546595565956659576595865959659606596165962659636596465965659666596765968659696597065971659726597365974659756597665977659786597965980659816598265983659846598565986659876598865989659906599165992659936599465995659966599765998659996600066001660026600366004660056600666007660086600966010660116601266013660146601566016660176601866019660206602166022660236602466025660266602766028660296603066031660326603366034660356603666037660386603966040660416604266043660446604566046660476604866049660506605166052660536605466055660566605766058660596606066061660626606366064660656606666067660686606966070660716607266073660746607566076660776607866079660806608166082660836608466085660866608766088660896609066091660926609366094660956609666097660986609966100661016610266103661046610566106661076610866109661106611166112661136611466115661166611766118661196612066121661226612366124661256612666127661286612966130661316613266133661346613566136661376613866139661406614166142661436614466145661466614766148661496615066151661526615366154661556615666157661586615966160661616616266163661646616566166661676616866169661706617166172661736617466175661766617766178661796618066181661826618366184661856618666187661886618966190661916619266193661946619566196661976619866199662006620166202662036620466205662066620766208662096621066211662126621366214662156621666217662186621966220662216622266223662246622566226662276622866229662306623166232662336623466235662366623766238662396624066241662426624366244662456624666247662486624966250662516625266253662546625566256662576625866259662606626166262662636626466265662666626766268662696627066271662726627366274662756627666277662786627966280662816628266283662846628566286662876628866289662906629166292662936629466295662966629766298662996630066301663026630366304663056630666307663086630966310663116631266313663146631566316663176631866319663206632166322663236632466325663266632766328663296633066331663326633366334663356633666337663386633966340663416634266343663446634566346663476634866349663506635166352663536635466355663566635766358663596636066361663626636366364663656636666367663686636966370663716637266373663746637566376663776637866379663806638166382663836638466385663866638766388663896639066391663926639366394663956639666397663986639966400664016640266403664046640566406664076640866409664106641166412664136641466415664166641766418664196642066421664226642366424664256642666427664286642966430664316643266433664346643566436664376643866439664406644166442664436644466445664466644766448664496645066451664526645366454664556645666457664586645966460664616646266463664646646566466664676646866469664706647166472664736647466475664766647766478664796648066481664826648366484664856648666487664886648966490664916649266493664946649566496664976649866499665006650166502665036650466505665066650766508665096651066511665126651366514665156651666517665186651966520665216652266523665246652566526665276652866529665306653166532665336653466535665366653766538665396654066541665426654366544665456654666547665486654966550665516655266553665546655566556665576655866559665606656166562665636656466565665666656766568665696657066571665726657366574665756657666577665786657966580665816658266583665846658566586665876658866589665906659166592665936659466595665966659766598665996660066601666026660366604666056660666607666086660966610666116661266613666146661566616666176661866619666206662166622666236662466625666266662766628666296663066631666326663366634666356663666637666386663966640666416664266643666446664566646666476664866649666506665166652666536665466655666566665766658666596666066661666626666366664666656666666667666686666966670666716667266673666746667566676666776667866679666806668166682666836668466685666866668766688666896669066691666926669366694666956669666697666986669966700667016670266703667046670566706667076670866709667106671166712667136671466715667166671766718667196672066721667226672366724667256672666727667286672966730667316673266733667346673566736667376673866739667406674166742667436674466745667466674766748667496675066751667526675366754667556675666757667586675966760667616676266763667646676566766667676676866769667706677166772667736677466775667766677766778667796678066781667826678366784667856678666787667886678966790667916679266793667946679566796667976679866799668006680166802668036680466805668066680766808668096681066811668126681366814668156681666817668186681966820668216682266823668246682566826668276682866829668306683166832668336683466835668366683766838668396684066841668426684366844668456684666847668486684966850668516685266853668546685566856668576685866859668606686166862668636686466865668666686766868668696687066871668726687366874668756687666877668786687966880668816688266883668846688566886668876688866889668906689166892668936689466895668966689766898668996690066901669026690366904669056690666907669086690966910669116691266913669146691566916669176691866919669206692166922669236692466925669266692766928669296693066931669326693366934669356693666937669386693966940669416694266943669446694566946669476694866949669506695166952669536695466955669566695766958669596696066961669626696366964669656696666967669686696966970669716697266973669746697566976669776697866979669806698166982669836698466985669866698766988669896699066991669926699366994669956699666997669986699967000670016700267003670046700567006670076700867009670106701167012670136701467015670166701767018670196702067021670226702367024670256702667027670286702967030670316703267033670346703567036670376703867039670406704167042670436704467045670466704767048670496705067051670526705367054670556705667057670586705967060670616706267063670646706567066670676706867069670706707167072670736707467075670766707767078670796708067081670826708367084670856708667087670886708967090670916709267093670946709567096670976709867099671006710167102671036710467105671066710767108671096711067111671126711367114671156711667117671186711967120671216712267123671246712567126671276712867129671306713167132671336713467135671366713767138671396714067141671426714367144671456714667147671486714967150671516715267153671546715567156671576715867159671606716167162671636716467165671666716767168671696717067171671726717367174671756717667177671786717967180671816718267183671846718567186671876718867189671906719167192671936719467195671966719767198671996720067201672026720367204672056720667207672086720967210672116721267213672146721567216672176721867219672206722167222672236722467225672266722767228672296723067231672326723367234672356723667237672386723967240672416724267243672446724567246672476724867249672506725167252672536725467255672566725767258672596726067261672626726367264672656726667267672686726967270672716727267273672746727567276672776727867279672806728167282672836728467285672866728767288672896729067291672926729367294672956729667297672986729967300673016730267303673046730567306673076730867309673106731167312673136731467315673166731767318673196732067321673226732367324673256732667327673286732967330673316733267333673346733567336673376733867339673406734167342673436734467345673466734767348673496735067351673526735367354673556735667357673586735967360673616736267363673646736567366673676736867369673706737167372673736737467375673766737767378673796738067381673826738367384673856738667387673886738967390673916739267393673946739567396673976739867399674006740167402674036740467405674066740767408674096741067411674126741367414674156741667417674186741967420674216742267423674246742567426674276742867429674306743167432674336743467435674366743767438674396744067441674426744367444674456744667447674486744967450674516745267453674546745567456674576745867459674606746167462674636746467465674666746767468674696747067471674726747367474674756747667477674786747967480674816748267483674846748567486674876748867489674906749167492674936749467495674966749767498674996750067501675026750367504675056750667507675086750967510675116751267513675146751567516675176751867519675206752167522675236752467525675266752767528675296753067531675326753367534675356753667537675386753967540675416754267543675446754567546675476754867549675506755167552675536755467555675566755767558675596756067561675626756367564675656756667567675686756967570675716757267573675746757567576675776757867579675806758167582675836758467585675866758767588675896759067591675926759367594675956759667597675986759967600676016760267603676046760567606676076760867609676106761167612676136761467615676166761767618676196762067621676226762367624676256762667627676286762967630676316763267633676346763567636676376763867639676406764167642676436764467645676466764767648676496765067651676526765367654676556765667657676586765967660676616766267663676646766567666676676766867669676706767167672676736767467675676766767767678676796768067681676826768367684676856768667687676886768967690676916769267693676946769567696676976769867699677006770167702677036770467705677066770767708677096771067711677126771367714677156771667717677186771967720677216772267723677246772567726677276772867729677306773167732677336773467735677366773767738677396774067741677426774367744677456774667747677486774967750677516775267753677546775567756677576775867759677606776167762677636776467765677666776767768677696777067771677726777367774677756777667777677786777967780677816778267783677846778567786677876778867789677906779167792677936779467795677966779767798677996780067801678026780367804678056780667807678086780967810678116781267813678146781567816678176781867819678206782167822678236782467825678266782767828678296783067831678326783367834678356783667837678386783967840678416784267843678446784567846678476784867849678506785167852678536785467855678566785767858678596786067861678626786367864678656786667867678686786967870678716787267873678746787567876678776787867879678806788167882678836788467885678866788767888678896789067891678926789367894678956789667897678986789967900679016790267903679046790567906679076790867909679106791167912679136791467915679166791767918679196792067921679226792367924679256792667927679286792967930679316793267933679346793567936679376793867939679406794167942679436794467945679466794767948679496795067951679526795367954679556795667957679586795967960679616796267963679646796567966679676796867969679706797167972679736797467975679766797767978679796798067981679826798367984679856798667987679886798967990679916799267993679946799567996679976799867999680006800168002680036800468005680066800768008680096801068011680126801368014680156801668017680186801968020680216802268023680246802568026680276802868029680306803168032680336803468035680366803768038680396804068041680426804368044680456804668047680486804968050680516805268053680546805568056680576805868059680606806168062680636806468065680666806768068680696807068071680726807368074680756807668077680786807968080680816808268083680846808568086680876808868089680906809168092680936809468095680966809768098680996810068101681026810368104681056810668107681086810968110681116811268113681146811568116681176811868119681206812168122681236812468125681266812768128681296813068131681326813368134681356813668137681386813968140681416814268143681446814568146681476814868149681506815168152681536815468155681566815768158681596816068161681626816368164681656816668167681686816968170681716817268173681746817568176681776817868179681806818168182681836818468185681866818768188681896819068191681926819368194681956819668197681986819968200682016820268203682046820568206682076820868209682106821168212682136821468215682166821768218682196822068221682226822368224682256822668227682286822968230682316823268233682346823568236682376823868239682406824168242682436824468245682466824768248682496825068251682526825368254682556825668257682586825968260682616826268263682646826568266682676826868269682706827168272682736827468275682766827768278682796828068281682826828368284682856828668287682886828968290682916829268293682946829568296682976829868299683006830168302683036830468305683066830768308683096831068311683126831368314683156831668317683186831968320683216832268323683246832568326683276832868329683306833168332683336833468335683366833768338683396834068341683426834368344683456834668347683486834968350683516835268353683546835568356683576835868359683606836168362683636836468365683666836768368683696837068371683726837368374683756837668377683786837968380683816838268383683846838568386683876838868389683906839168392683936839468395683966839768398683996840068401684026840368404684056840668407684086840968410684116841268413684146841568416684176841868419684206842168422684236842468425684266842768428684296843068431684326843368434684356843668437684386843968440684416844268443684446844568446684476844868449684506845168452684536845468455684566845768458684596846068461684626846368464684656846668467684686846968470684716847268473684746847568476684776847868479684806848168482684836848468485684866848768488684896849068491684926849368494684956849668497684986849968500685016850268503685046850568506685076850868509685106851168512685136851468515685166851768518685196852068521685226852368524685256852668527685286852968530685316853268533685346853568536685376853868539685406854168542685436854468545685466854768548685496855068551685526855368554685556855668557685586855968560685616856268563685646856568566685676856868569685706857168572685736857468575685766857768578685796858068581685826858368584685856858668587685886858968590685916859268593685946859568596685976859868599686006860168602686036860468605686066860768608686096861068611686126861368614686156861668617686186861968620686216862268623686246862568626686276862868629686306863168632686336863468635686366863768638686396864068641686426864368644686456864668647686486864968650686516865268653686546865568656686576865868659686606866168662686636866468665686666866768668686696867068671686726867368674686756867668677686786867968680686816868268683686846868568686686876868868689686906869168692686936869468695686966869768698686996870068701687026870368704687056870668707687086870968710687116871268713687146871568716687176871868719687206872168722687236872468725687266872768728687296873068731687326873368734687356873668737687386873968740687416874268743687446874568746687476874868749687506875168752687536875468755687566875768758687596876068761687626876368764687656876668767687686876968770687716877268773687746877568776687776877868779687806878168782687836878468785687866878768788687896879068791687926879368794687956879668797687986879968800688016880268803688046880568806688076880868809688106881168812688136881468815688166881768818688196882068821688226882368824688256882668827688286882968830688316883268833688346883568836688376883868839688406884168842688436884468845688466884768848688496885068851688526885368854688556885668857688586885968860688616886268863688646886568866688676886868869688706887168872688736887468875688766887768878688796888068881688826888368884688856888668887688886888968890688916889268893688946889568896688976889868899689006890168902689036890468905689066890768908689096891068911689126891368914689156891668917689186891968920689216892268923689246892568926689276892868929689306893168932689336893468935689366893768938689396894068941689426894368944689456894668947689486894968950689516895268953689546895568956689576895868959689606896168962689636896468965689666896768968689696897068971689726897368974689756897668977689786897968980689816898268983689846898568986689876898868989689906899168992689936899468995689966899768998689996900069001690026900369004690056900669007690086900969010690116901269013690146901569016690176901869019690206902169022690236902469025690266902769028690296903069031690326903369034690356903669037690386903969040690416904269043690446904569046690476904869049690506905169052690536905469055690566905769058690596906069061690626906369064690656906669067690686906969070690716907269073690746907569076690776907869079690806908169082690836908469085690866908769088690896909069091690926909369094690956909669097690986909969100691016910269103691046910569106691076910869109691106911169112691136911469115691166911769118691196912069121691226912369124691256912669127691286912969130691316913269133691346913569136691376913869139691406914169142691436914469145691466914769148691496915069151691526915369154691556915669157691586915969160691616916269163691646916569166691676916869169691706917169172691736917469175691766917769178691796918069181691826918369184691856918669187691886918969190691916919269193691946919569196691976919869199692006920169202692036920469205692066920769208692096921069211692126921369214692156921669217692186921969220692216922269223692246922569226692276922869229692306923169232692336923469235692366923769238692396924069241692426924369244692456924669247692486924969250692516925269253692546925569256692576925869259692606926169262692636926469265692666926769268692696927069271692726927369274692756927669277692786927969280692816928269283692846928569286692876928869289692906929169292692936929469295692966929769298692996930069301693026930369304693056930669307693086930969310693116931269313693146931569316693176931869319693206932169322693236932469325693266932769328693296933069331693326933369334693356933669337693386933969340693416934269343693446934569346693476934869349693506935169352693536935469355693566935769358693596936069361693626936369364693656936669367693686936969370693716937269373693746937569376693776937869379693806938169382693836938469385693866938769388693896939069391693926939369394693956939669397693986939969400694016940269403694046940569406694076940869409694106941169412694136941469415694166941769418694196942069421694226942369424694256942669427694286942969430694316943269433694346943569436694376943869439694406944169442694436944469445694466944769448694496945069451694526945369454694556945669457694586945969460694616946269463694646946569466694676946869469694706947169472694736947469475694766947769478694796948069481694826948369484694856948669487694886948969490694916949269493694946949569496694976949869499695006950169502695036950469505695066950769508695096951069511695126951369514695156951669517695186951969520695216952269523695246952569526695276952869529695306953169532695336953469535695366953769538695396954069541695426954369544695456954669547695486954969550695516955269553695546955569556695576955869559695606956169562695636956469565695666956769568695696957069571695726957369574695756957669577695786957969580695816958269583695846958569586695876958869589695906959169592695936959469595695966959769598695996960069601696026960369604696056960669607696086960969610696116961269613696146961569616696176961869619696206962169622696236962469625696266962769628696296963069631696326963369634696356963669637696386963969640696416964269643696446964569646696476964869649696506965169652696536965469655696566965769658696596966069661696626966369664696656966669667696686966969670696716967269673696746967569676696776967869679696806968169682696836968469685696866968769688696896969069691696926969369694
  1. /******/ (function(modules) { // webpackBootstrap
  2. /******/ // The module cache
  3. /******/ var installedModules = {};
  4. /******/
  5. /******/ // The require function
  6. /******/ function __webpack_require__(moduleId) {
  7. /******/
  8. /******/ // Check if module is in cache
  9. /******/ if(installedModules[moduleId]) {
  10. /******/ return installedModules[moduleId].exports;
  11. /******/ }
  12. /******/ // Create a new module (and put it into the cache)
  13. /******/ var module = installedModules[moduleId] = {
  14. /******/ i: moduleId,
  15. /******/ l: false,
  16. /******/ exports: {}
  17. /******/ };
  18. /******/
  19. /******/ // Execute the module function
  20. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  21. /******/
  22. /******/ // Flag the module as loaded
  23. /******/ module.l = true;
  24. /******/
  25. /******/ // Return the exports of the module
  26. /******/ return module.exports;
  27. /******/ }
  28. /******/
  29. /******/
  30. /******/ // expose the modules object (__webpack_modules__)
  31. /******/ __webpack_require__.m = modules;
  32. /******/
  33. /******/ // expose the module cache
  34. /******/ __webpack_require__.c = installedModules;
  35. /******/
  36. /******/ // define getter function for harmony exports
  37. /******/ __webpack_require__.d = function(exports, name, getter) {
  38. /******/ if(!__webpack_require__.o(exports, name)) {
  39. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  40. /******/ }
  41. /******/ };
  42. /******/
  43. /******/ // define __esModule on exports
  44. /******/ __webpack_require__.r = function(exports) {
  45. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  46. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  47. /******/ }
  48. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  49. /******/ };
  50. /******/
  51. /******/ // create a fake namespace object
  52. /******/ // mode & 1: value is a module id, require it
  53. /******/ // mode & 2: merge all properties of value into the ns
  54. /******/ // mode & 4: return value when already ns object
  55. /******/ // mode & 8|1: behave like require
  56. /******/ __webpack_require__.t = function(value, mode) {
  57. /******/ if(mode & 1) value = __webpack_require__(value);
  58. /******/ if(mode & 8) return value;
  59. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  60. /******/ var ns = Object.create(null);
  61. /******/ __webpack_require__.r(ns);
  62. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  63. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  64. /******/ return ns;
  65. /******/ };
  66. /******/
  67. /******/ // getDefaultExport function for compatibility with non-harmony modules
  68. /******/ __webpack_require__.n = function(module) {
  69. /******/ var getter = module && module.__esModule ?
  70. /******/ function getDefault() { return module['default']; } :
  71. /******/ function getModuleExports() { return module; };
  72. /******/ __webpack_require__.d(getter, 'a', getter);
  73. /******/ return getter;
  74. /******/ };
  75. /******/
  76. /******/ // Object.prototype.hasOwnProperty.call
  77. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  78. /******/
  79. /******/ // __webpack_public_path__
  80. /******/ __webpack_require__.p = "/";
  81. /******/
  82. /******/
  83. /******/ // Load entry module and return exports
  84. /******/ return __webpack_require__(__webpack_require__.s = 0);
  85. /******/ })
  86. /************************************************************************/
  87. /******/ ({
  88. /***/ "./node_modules/axios/index.js":
  89. /*!*************************************!*\
  90. !*** ./node_modules/axios/index.js ***!
  91. \*************************************/
  92. /*! no static exports found */
  93. /***/ (function(module, exports, __webpack_require__) {
  94. module.exports = __webpack_require__(/*! ./lib/axios */ "./node_modules/axios/lib/axios.js");
  95. /***/ }),
  96. /***/ "./node_modules/axios/lib/adapters/xhr.js":
  97. /*!************************************************!*\
  98. !*** ./node_modules/axios/lib/adapters/xhr.js ***!
  99. \************************************************/
  100. /*! no static exports found */
  101. /***/ (function(module, exports, __webpack_require__) {
  102. "use strict";
  103. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  104. var settle = __webpack_require__(/*! ./../core/settle */ "./node_modules/axios/lib/core/settle.js");
  105. var buildURL = __webpack_require__(/*! ./../helpers/buildURL */ "./node_modules/axios/lib/helpers/buildURL.js");
  106. var buildFullPath = __webpack_require__(/*! ../core/buildFullPath */ "./node_modules/axios/lib/core/buildFullPath.js");
  107. var parseHeaders = __webpack_require__(/*! ./../helpers/parseHeaders */ "./node_modules/axios/lib/helpers/parseHeaders.js");
  108. var isURLSameOrigin = __webpack_require__(/*! ./../helpers/isURLSameOrigin */ "./node_modules/axios/lib/helpers/isURLSameOrigin.js");
  109. var createError = __webpack_require__(/*! ../core/createError */ "./node_modules/axios/lib/core/createError.js");
  110. module.exports = function xhrAdapter(config) {
  111. return new Promise(function dispatchXhrRequest(resolve, reject) {
  112. var requestData = config.data;
  113. var requestHeaders = config.headers;
  114. if (utils.isFormData(requestData)) {
  115. delete requestHeaders['Content-Type']; // Let the browser set it
  116. }
  117. var request = new XMLHttpRequest();
  118. // HTTP basic authentication
  119. if (config.auth) {
  120. var username = config.auth.username || '';
  121. var password = config.auth.password || '';
  122. requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
  123. }
  124. var fullPath = buildFullPath(config.baseURL, config.url);
  125. request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
  126. // Set the request timeout in MS
  127. request.timeout = config.timeout;
  128. // Listen for ready state
  129. request.onreadystatechange = function handleLoad() {
  130. if (!request || request.readyState !== 4) {
  131. return;
  132. }
  133. // The request errored out and we didn't get a response, this will be
  134. // handled by onerror instead
  135. // With one exception: request that using file: protocol, most browsers
  136. // will return status as 0 even though it's a successful request
  137. if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
  138. return;
  139. }
  140. // Prepare the response
  141. var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;
  142. var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;
  143. var response = {
  144. data: responseData,
  145. status: request.status,
  146. statusText: request.statusText,
  147. headers: responseHeaders,
  148. config: config,
  149. request: request
  150. };
  151. settle(resolve, reject, response);
  152. // Clean up request
  153. request = null;
  154. };
  155. // Handle browser request cancellation (as opposed to a manual cancellation)
  156. request.onabort = function handleAbort() {
  157. if (!request) {
  158. return;
  159. }
  160. reject(createError('Request aborted', config, 'ECONNABORTED', request));
  161. // Clean up request
  162. request = null;
  163. };
  164. // Handle low level network errors
  165. request.onerror = function handleError() {
  166. // Real errors are hidden from us by the browser
  167. // onerror should only fire if it's a network error
  168. reject(createError('Network Error', config, null, request));
  169. // Clean up request
  170. request = null;
  171. };
  172. // Handle timeout
  173. request.ontimeout = function handleTimeout() {
  174. var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';
  175. if (config.timeoutErrorMessage) {
  176. timeoutErrorMessage = config.timeoutErrorMessage;
  177. }
  178. reject(createError(timeoutErrorMessage, config, 'ECONNABORTED',
  179. request));
  180. // Clean up request
  181. request = null;
  182. };
  183. // Add xsrf header
  184. // This is only done if running in a standard browser environment.
  185. // Specifically not if we're in a web worker, or react-native.
  186. if (utils.isStandardBrowserEnv()) {
  187. var cookies = __webpack_require__(/*! ./../helpers/cookies */ "./node_modules/axios/lib/helpers/cookies.js");
  188. // Add xsrf header
  189. var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?
  190. cookies.read(config.xsrfCookieName) :
  191. undefined;
  192. if (xsrfValue) {
  193. requestHeaders[config.xsrfHeaderName] = xsrfValue;
  194. }
  195. }
  196. // Add headers to the request
  197. if ('setRequestHeader' in request) {
  198. utils.forEach(requestHeaders, function setRequestHeader(val, key) {
  199. if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {
  200. // Remove Content-Type if data is undefined
  201. delete requestHeaders[key];
  202. } else {
  203. // Otherwise add header to the request
  204. request.setRequestHeader(key, val);
  205. }
  206. });
  207. }
  208. // Add withCredentials to request if needed
  209. if (!utils.isUndefined(config.withCredentials)) {
  210. request.withCredentials = !!config.withCredentials;
  211. }
  212. // Add responseType to request if needed
  213. if (config.responseType) {
  214. try {
  215. request.responseType = config.responseType;
  216. } catch (e) {
  217. // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.
  218. // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.
  219. if (config.responseType !== 'json') {
  220. throw e;
  221. }
  222. }
  223. }
  224. // Handle progress if needed
  225. if (typeof config.onDownloadProgress === 'function') {
  226. request.addEventListener('progress', config.onDownloadProgress);
  227. }
  228. // Not all browsers support upload events
  229. if (typeof config.onUploadProgress === 'function' && request.upload) {
  230. request.upload.addEventListener('progress', config.onUploadProgress);
  231. }
  232. if (config.cancelToken) {
  233. // Handle cancellation
  234. config.cancelToken.promise.then(function onCanceled(cancel) {
  235. if (!request) {
  236. return;
  237. }
  238. request.abort();
  239. reject(cancel);
  240. // Clean up request
  241. request = null;
  242. });
  243. }
  244. if (requestData === undefined) {
  245. requestData = null;
  246. }
  247. // Send the request
  248. request.send(requestData);
  249. });
  250. };
  251. /***/ }),
  252. /***/ "./node_modules/axios/lib/axios.js":
  253. /*!*****************************************!*\
  254. !*** ./node_modules/axios/lib/axios.js ***!
  255. \*****************************************/
  256. /*! no static exports found */
  257. /***/ (function(module, exports, __webpack_require__) {
  258. "use strict";
  259. var utils = __webpack_require__(/*! ./utils */ "./node_modules/axios/lib/utils.js");
  260. var bind = __webpack_require__(/*! ./helpers/bind */ "./node_modules/axios/lib/helpers/bind.js");
  261. var Axios = __webpack_require__(/*! ./core/Axios */ "./node_modules/axios/lib/core/Axios.js");
  262. var mergeConfig = __webpack_require__(/*! ./core/mergeConfig */ "./node_modules/axios/lib/core/mergeConfig.js");
  263. var defaults = __webpack_require__(/*! ./defaults */ "./node_modules/axios/lib/defaults.js");
  264. /**
  265. * Create an instance of Axios
  266. *
  267. * @param {Object} defaultConfig The default config for the instance
  268. * @return {Axios} A new instance of Axios
  269. */
  270. function createInstance(defaultConfig) {
  271. var context = new Axios(defaultConfig);
  272. var instance = bind(Axios.prototype.request, context);
  273. // Copy axios.prototype to instance
  274. utils.extend(instance, Axios.prototype, context);
  275. // Copy context to instance
  276. utils.extend(instance, context);
  277. return instance;
  278. }
  279. // Create the default instance to be exported
  280. var axios = createInstance(defaults);
  281. // Expose Axios class to allow class inheritance
  282. axios.Axios = Axios;
  283. // Factory for creating new instances
  284. axios.create = function create(instanceConfig) {
  285. return createInstance(mergeConfig(axios.defaults, instanceConfig));
  286. };
  287. // Expose Cancel & CancelToken
  288. axios.Cancel = __webpack_require__(/*! ./cancel/Cancel */ "./node_modules/axios/lib/cancel/Cancel.js");
  289. axios.CancelToken = __webpack_require__(/*! ./cancel/CancelToken */ "./node_modules/axios/lib/cancel/CancelToken.js");
  290. axios.isCancel = __webpack_require__(/*! ./cancel/isCancel */ "./node_modules/axios/lib/cancel/isCancel.js");
  291. // Expose all/spread
  292. axios.all = function all(promises) {
  293. return Promise.all(promises);
  294. };
  295. axios.spread = __webpack_require__(/*! ./helpers/spread */ "./node_modules/axios/lib/helpers/spread.js");
  296. module.exports = axios;
  297. // Allow use of default import syntax in TypeScript
  298. module.exports.default = axios;
  299. /***/ }),
  300. /***/ "./node_modules/axios/lib/cancel/Cancel.js":
  301. /*!*************************************************!*\
  302. !*** ./node_modules/axios/lib/cancel/Cancel.js ***!
  303. \*************************************************/
  304. /*! no static exports found */
  305. /***/ (function(module, exports, __webpack_require__) {
  306. "use strict";
  307. /**
  308. * A `Cancel` is an object that is thrown when an operation is canceled.
  309. *
  310. * @class
  311. * @param {string=} message The message.
  312. */
  313. function Cancel(message) {
  314. this.message = message;
  315. }
  316. Cancel.prototype.toString = function toString() {
  317. return 'Cancel' + (this.message ? ': ' + this.message : '');
  318. };
  319. Cancel.prototype.__CANCEL__ = true;
  320. module.exports = Cancel;
  321. /***/ }),
  322. /***/ "./node_modules/axios/lib/cancel/CancelToken.js":
  323. /*!******************************************************!*\
  324. !*** ./node_modules/axios/lib/cancel/CancelToken.js ***!
  325. \******************************************************/
  326. /*! no static exports found */
  327. /***/ (function(module, exports, __webpack_require__) {
  328. "use strict";
  329. var Cancel = __webpack_require__(/*! ./Cancel */ "./node_modules/axios/lib/cancel/Cancel.js");
  330. /**
  331. * A `CancelToken` is an object that can be used to request cancellation of an operation.
  332. *
  333. * @class
  334. * @param {Function} executor The executor function.
  335. */
  336. function CancelToken(executor) {
  337. if (typeof executor !== 'function') {
  338. throw new TypeError('executor must be a function.');
  339. }
  340. var resolvePromise;
  341. this.promise = new Promise(function promiseExecutor(resolve) {
  342. resolvePromise = resolve;
  343. });
  344. var token = this;
  345. executor(function cancel(message) {
  346. if (token.reason) {
  347. // Cancellation has already been requested
  348. return;
  349. }
  350. token.reason = new Cancel(message);
  351. resolvePromise(token.reason);
  352. });
  353. }
  354. /**
  355. * Throws a `Cancel` if cancellation has been requested.
  356. */
  357. CancelToken.prototype.throwIfRequested = function throwIfRequested() {
  358. if (this.reason) {
  359. throw this.reason;
  360. }
  361. };
  362. /**
  363. * Returns an object that contains a new `CancelToken` and a function that, when called,
  364. * cancels the `CancelToken`.
  365. */
  366. CancelToken.source = function source() {
  367. var cancel;
  368. var token = new CancelToken(function executor(c) {
  369. cancel = c;
  370. });
  371. return {
  372. token: token,
  373. cancel: cancel
  374. };
  375. };
  376. module.exports = CancelToken;
  377. /***/ }),
  378. /***/ "./node_modules/axios/lib/cancel/isCancel.js":
  379. /*!***************************************************!*\
  380. !*** ./node_modules/axios/lib/cancel/isCancel.js ***!
  381. \***************************************************/
  382. /*! no static exports found */
  383. /***/ (function(module, exports, __webpack_require__) {
  384. "use strict";
  385. module.exports = function isCancel(value) {
  386. return !!(value && value.__CANCEL__);
  387. };
  388. /***/ }),
  389. /***/ "./node_modules/axios/lib/core/Axios.js":
  390. /*!**********************************************!*\
  391. !*** ./node_modules/axios/lib/core/Axios.js ***!
  392. \**********************************************/
  393. /*! no static exports found */
  394. /***/ (function(module, exports, __webpack_require__) {
  395. "use strict";
  396. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  397. var buildURL = __webpack_require__(/*! ../helpers/buildURL */ "./node_modules/axios/lib/helpers/buildURL.js");
  398. var InterceptorManager = __webpack_require__(/*! ./InterceptorManager */ "./node_modules/axios/lib/core/InterceptorManager.js");
  399. var dispatchRequest = __webpack_require__(/*! ./dispatchRequest */ "./node_modules/axios/lib/core/dispatchRequest.js");
  400. var mergeConfig = __webpack_require__(/*! ./mergeConfig */ "./node_modules/axios/lib/core/mergeConfig.js");
  401. /**
  402. * Create a new instance of Axios
  403. *
  404. * @param {Object} instanceConfig The default config for the instance
  405. */
  406. function Axios(instanceConfig) {
  407. this.defaults = instanceConfig;
  408. this.interceptors = {
  409. request: new InterceptorManager(),
  410. response: new InterceptorManager()
  411. };
  412. }
  413. /**
  414. * Dispatch a request
  415. *
  416. * @param {Object} config The config specific for this request (merged with this.defaults)
  417. */
  418. Axios.prototype.request = function request(config) {
  419. /*eslint no-param-reassign:0*/
  420. // Allow for axios('example/url'[, config]) a la fetch API
  421. if (typeof config === 'string') {
  422. config = arguments[1] || {};
  423. config.url = arguments[0];
  424. } else {
  425. config = config || {};
  426. }
  427. config = mergeConfig(this.defaults, config);
  428. // Set config.method
  429. if (config.method) {
  430. config.method = config.method.toLowerCase();
  431. } else if (this.defaults.method) {
  432. config.method = this.defaults.method.toLowerCase();
  433. } else {
  434. config.method = 'get';
  435. }
  436. // Hook up interceptors middleware
  437. var chain = [dispatchRequest, undefined];
  438. var promise = Promise.resolve(config);
  439. this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
  440. chain.unshift(interceptor.fulfilled, interceptor.rejected);
  441. });
  442. this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
  443. chain.push(interceptor.fulfilled, interceptor.rejected);
  444. });
  445. while (chain.length) {
  446. promise = promise.then(chain.shift(), chain.shift());
  447. }
  448. return promise;
  449. };
  450. Axios.prototype.getUri = function getUri(config) {
  451. config = mergeConfig(this.defaults, config);
  452. return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, '');
  453. };
  454. // Provide aliases for supported request methods
  455. utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
  456. /*eslint func-names:0*/
  457. Axios.prototype[method] = function(url, config) {
  458. return this.request(utils.merge(config || {}, {
  459. method: method,
  460. url: url
  461. }));
  462. };
  463. });
  464. utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
  465. /*eslint func-names:0*/
  466. Axios.prototype[method] = function(url, data, config) {
  467. return this.request(utils.merge(config || {}, {
  468. method: method,
  469. url: url,
  470. data: data
  471. }));
  472. };
  473. });
  474. module.exports = Axios;
  475. /***/ }),
  476. /***/ "./node_modules/axios/lib/core/InterceptorManager.js":
  477. /*!***********************************************************!*\
  478. !*** ./node_modules/axios/lib/core/InterceptorManager.js ***!
  479. \***********************************************************/
  480. /*! no static exports found */
  481. /***/ (function(module, exports, __webpack_require__) {
  482. "use strict";
  483. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  484. function InterceptorManager() {
  485. this.handlers = [];
  486. }
  487. /**
  488. * Add a new interceptor to the stack
  489. *
  490. * @param {Function} fulfilled The function to handle `then` for a `Promise`
  491. * @param {Function} rejected The function to handle `reject` for a `Promise`
  492. *
  493. * @return {Number} An ID used to remove interceptor later
  494. */
  495. InterceptorManager.prototype.use = function use(fulfilled, rejected) {
  496. this.handlers.push({
  497. fulfilled: fulfilled,
  498. rejected: rejected
  499. });
  500. return this.handlers.length - 1;
  501. };
  502. /**
  503. * Remove an interceptor from the stack
  504. *
  505. * @param {Number} id The ID that was returned by `use`
  506. */
  507. InterceptorManager.prototype.eject = function eject(id) {
  508. if (this.handlers[id]) {
  509. this.handlers[id] = null;
  510. }
  511. };
  512. /**
  513. * Iterate over all the registered interceptors
  514. *
  515. * This method is particularly useful for skipping over any
  516. * interceptors that may have become `null` calling `eject`.
  517. *
  518. * @param {Function} fn The function to call for each interceptor
  519. */
  520. InterceptorManager.prototype.forEach = function forEach(fn) {
  521. utils.forEach(this.handlers, function forEachHandler(h) {
  522. if (h !== null) {
  523. fn(h);
  524. }
  525. });
  526. };
  527. module.exports = InterceptorManager;
  528. /***/ }),
  529. /***/ "./node_modules/axios/lib/core/buildFullPath.js":
  530. /*!******************************************************!*\
  531. !*** ./node_modules/axios/lib/core/buildFullPath.js ***!
  532. \******************************************************/
  533. /*! no static exports found */
  534. /***/ (function(module, exports, __webpack_require__) {
  535. "use strict";
  536. var isAbsoluteURL = __webpack_require__(/*! ../helpers/isAbsoluteURL */ "./node_modules/axios/lib/helpers/isAbsoluteURL.js");
  537. var combineURLs = __webpack_require__(/*! ../helpers/combineURLs */ "./node_modules/axios/lib/helpers/combineURLs.js");
  538. /**
  539. * Creates a new URL by combining the baseURL with the requestedURL,
  540. * only when the requestedURL is not already an absolute URL.
  541. * If the requestURL is absolute, this function returns the requestedURL untouched.
  542. *
  543. * @param {string} baseURL The base URL
  544. * @param {string} requestedURL Absolute or relative URL to combine
  545. * @returns {string} The combined full path
  546. */
  547. module.exports = function buildFullPath(baseURL, requestedURL) {
  548. if (baseURL && !isAbsoluteURL(requestedURL)) {
  549. return combineURLs(baseURL, requestedURL);
  550. }
  551. return requestedURL;
  552. };
  553. /***/ }),
  554. /***/ "./node_modules/axios/lib/core/createError.js":
  555. /*!****************************************************!*\
  556. !*** ./node_modules/axios/lib/core/createError.js ***!
  557. \****************************************************/
  558. /*! no static exports found */
  559. /***/ (function(module, exports, __webpack_require__) {
  560. "use strict";
  561. var enhanceError = __webpack_require__(/*! ./enhanceError */ "./node_modules/axios/lib/core/enhanceError.js");
  562. /**
  563. * Create an Error with the specified message, config, error code, request and response.
  564. *
  565. * @param {string} message The error message.
  566. * @param {Object} config The config.
  567. * @param {string} [code] The error code (for example, 'ECONNABORTED').
  568. * @param {Object} [request] The request.
  569. * @param {Object} [response] The response.
  570. * @returns {Error} The created error.
  571. */
  572. module.exports = function createError(message, config, code, request, response) {
  573. var error = new Error(message);
  574. return enhanceError(error, config, code, request, response);
  575. };
  576. /***/ }),
  577. /***/ "./node_modules/axios/lib/core/dispatchRequest.js":
  578. /*!********************************************************!*\
  579. !*** ./node_modules/axios/lib/core/dispatchRequest.js ***!
  580. \********************************************************/
  581. /*! no static exports found */
  582. /***/ (function(module, exports, __webpack_require__) {
  583. "use strict";
  584. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  585. var transformData = __webpack_require__(/*! ./transformData */ "./node_modules/axios/lib/core/transformData.js");
  586. var isCancel = __webpack_require__(/*! ../cancel/isCancel */ "./node_modules/axios/lib/cancel/isCancel.js");
  587. var defaults = __webpack_require__(/*! ../defaults */ "./node_modules/axios/lib/defaults.js");
  588. /**
  589. * Throws a `Cancel` if cancellation has been requested.
  590. */
  591. function throwIfCancellationRequested(config) {
  592. if (config.cancelToken) {
  593. config.cancelToken.throwIfRequested();
  594. }
  595. }
  596. /**
  597. * Dispatch a request to the server using the configured adapter.
  598. *
  599. * @param {object} config The config that is to be used for the request
  600. * @returns {Promise} The Promise to be fulfilled
  601. */
  602. module.exports = function dispatchRequest(config) {
  603. throwIfCancellationRequested(config);
  604. // Ensure headers exist
  605. config.headers = config.headers || {};
  606. // Transform request data
  607. config.data = transformData(
  608. config.data,
  609. config.headers,
  610. config.transformRequest
  611. );
  612. // Flatten headers
  613. config.headers = utils.merge(
  614. config.headers.common || {},
  615. config.headers[config.method] || {},
  616. config.headers
  617. );
  618. utils.forEach(
  619. ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
  620. function cleanHeaderConfig(method) {
  621. delete config.headers[method];
  622. }
  623. );
  624. var adapter = config.adapter || defaults.adapter;
  625. return adapter(config).then(function onAdapterResolution(response) {
  626. throwIfCancellationRequested(config);
  627. // Transform response data
  628. response.data = transformData(
  629. response.data,
  630. response.headers,
  631. config.transformResponse
  632. );
  633. return response;
  634. }, function onAdapterRejection(reason) {
  635. if (!isCancel(reason)) {
  636. throwIfCancellationRequested(config);
  637. // Transform response data
  638. if (reason && reason.response) {
  639. reason.response.data = transformData(
  640. reason.response.data,
  641. reason.response.headers,
  642. config.transformResponse
  643. );
  644. }
  645. }
  646. return Promise.reject(reason);
  647. });
  648. };
  649. /***/ }),
  650. /***/ "./node_modules/axios/lib/core/enhanceError.js":
  651. /*!*****************************************************!*\
  652. !*** ./node_modules/axios/lib/core/enhanceError.js ***!
  653. \*****************************************************/
  654. /*! no static exports found */
  655. /***/ (function(module, exports, __webpack_require__) {
  656. "use strict";
  657. /**
  658. * Update an Error with the specified config, error code, and response.
  659. *
  660. * @param {Error} error The error to update.
  661. * @param {Object} config The config.
  662. * @param {string} [code] The error code (for example, 'ECONNABORTED').
  663. * @param {Object} [request] The request.
  664. * @param {Object} [response] The response.
  665. * @returns {Error} The error.
  666. */
  667. module.exports = function enhanceError(error, config, code, request, response) {
  668. error.config = config;
  669. if (code) {
  670. error.code = code;
  671. }
  672. error.request = request;
  673. error.response = response;
  674. error.isAxiosError = true;
  675. error.toJSON = function() {
  676. return {
  677. // Standard
  678. message: this.message,
  679. name: this.name,
  680. // Microsoft
  681. description: this.description,
  682. number: this.number,
  683. // Mozilla
  684. fileName: this.fileName,
  685. lineNumber: this.lineNumber,
  686. columnNumber: this.columnNumber,
  687. stack: this.stack,
  688. // Axios
  689. config: this.config,
  690. code: this.code
  691. };
  692. };
  693. return error;
  694. };
  695. /***/ }),
  696. /***/ "./node_modules/axios/lib/core/mergeConfig.js":
  697. /*!****************************************************!*\
  698. !*** ./node_modules/axios/lib/core/mergeConfig.js ***!
  699. \****************************************************/
  700. /*! no static exports found */
  701. /***/ (function(module, exports, __webpack_require__) {
  702. "use strict";
  703. var utils = __webpack_require__(/*! ../utils */ "./node_modules/axios/lib/utils.js");
  704. /**
  705. * Config-specific merge-function which creates a new config-object
  706. * by merging two configuration objects together.
  707. *
  708. * @param {Object} config1
  709. * @param {Object} config2
  710. * @returns {Object} New object resulting from merging config2 to config1
  711. */
  712. module.exports = function mergeConfig(config1, config2) {
  713. // eslint-disable-next-line no-param-reassign
  714. config2 = config2 || {};
  715. var config = {};
  716. var valueFromConfig2Keys = ['url', 'method', 'params', 'data'];
  717. var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy'];
  718. var defaultToConfig2Keys = [
  719. 'baseURL', 'url', 'transformRequest', 'transformResponse', 'paramsSerializer',
  720. 'timeout', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',
  721. 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress',
  722. 'maxContentLength', 'validateStatus', 'maxRedirects', 'httpAgent',
  723. 'httpsAgent', 'cancelToken', 'socketPath'
  724. ];
  725. utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {
  726. if (typeof config2[prop] !== 'undefined') {
  727. config[prop] = config2[prop];
  728. }
  729. });
  730. utils.forEach(mergeDeepPropertiesKeys, function mergeDeepProperties(prop) {
  731. if (utils.isObject(config2[prop])) {
  732. config[prop] = utils.deepMerge(config1[prop], config2[prop]);
  733. } else if (typeof config2[prop] !== 'undefined') {
  734. config[prop] = config2[prop];
  735. } else if (utils.isObject(config1[prop])) {
  736. config[prop] = utils.deepMerge(config1[prop]);
  737. } else if (typeof config1[prop] !== 'undefined') {
  738. config[prop] = config1[prop];
  739. }
  740. });
  741. utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {
  742. if (typeof config2[prop] !== 'undefined') {
  743. config[prop] = config2[prop];
  744. } else if (typeof config1[prop] !== 'undefined') {
  745. config[prop] = config1[prop];
  746. }
  747. });
  748. var axiosKeys = valueFromConfig2Keys
  749. .concat(mergeDeepPropertiesKeys)
  750. .concat(defaultToConfig2Keys);
  751. var otherKeys = Object
  752. .keys(config2)
  753. .filter(function filterAxiosKeys(key) {
  754. return axiosKeys.indexOf(key) === -1;
  755. });
  756. utils.forEach(otherKeys, function otherKeysDefaultToConfig2(prop) {
  757. if (typeof config2[prop] !== 'undefined') {
  758. config[prop] = config2[prop];
  759. } else if (typeof config1[prop] !== 'undefined') {
  760. config[prop] = config1[prop];
  761. }
  762. });
  763. return config;
  764. };
  765. /***/ }),
  766. /***/ "./node_modules/axios/lib/core/settle.js":
  767. /*!***********************************************!*\
  768. !*** ./node_modules/axios/lib/core/settle.js ***!
  769. \***********************************************/
  770. /*! no static exports found */
  771. /***/ (function(module, exports, __webpack_require__) {
  772. "use strict";
  773. var createError = __webpack_require__(/*! ./createError */ "./node_modules/axios/lib/core/createError.js");
  774. /**
  775. * Resolve or reject a Promise based on response status.
  776. *
  777. * @param {Function} resolve A function that resolves the promise.
  778. * @param {Function} reject A function that rejects the promise.
  779. * @param {object} response The response.
  780. */
  781. module.exports = function settle(resolve, reject, response) {
  782. var validateStatus = response.config.validateStatus;
  783. if (!validateStatus || validateStatus(response.status)) {
  784. resolve(response);
  785. } else {
  786. reject(createError(
  787. 'Request failed with status code ' + response.status,
  788. response.config,
  789. null,
  790. response.request,
  791. response
  792. ));
  793. }
  794. };
  795. /***/ }),
  796. /***/ "./node_modules/axios/lib/core/transformData.js":
  797. /*!******************************************************!*\
  798. !*** ./node_modules/axios/lib/core/transformData.js ***!
  799. \******************************************************/
  800. /*! no static exports found */
  801. /***/ (function(module, exports, __webpack_require__) {
  802. "use strict";
  803. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  804. /**
  805. * Transform the data for a request or a response
  806. *
  807. * @param {Object|String} data The data to be transformed
  808. * @param {Array} headers The headers for the request or response
  809. * @param {Array|Function} fns A single function or Array of functions
  810. * @returns {*} The resulting transformed data
  811. */
  812. module.exports = function transformData(data, headers, fns) {
  813. /*eslint no-param-reassign:0*/
  814. utils.forEach(fns, function transform(fn) {
  815. data = fn(data, headers);
  816. });
  817. return data;
  818. };
  819. /***/ }),
  820. /***/ "./node_modules/axios/lib/defaults.js":
  821. /*!********************************************!*\
  822. !*** ./node_modules/axios/lib/defaults.js ***!
  823. \********************************************/
  824. /*! no static exports found */
  825. /***/ (function(module, exports, __webpack_require__) {
  826. "use strict";
  827. /* WEBPACK VAR INJECTION */(function(process) {
  828. var utils = __webpack_require__(/*! ./utils */ "./node_modules/axios/lib/utils.js");
  829. var normalizeHeaderName = __webpack_require__(/*! ./helpers/normalizeHeaderName */ "./node_modules/axios/lib/helpers/normalizeHeaderName.js");
  830. var DEFAULT_CONTENT_TYPE = {
  831. 'Content-Type': 'application/x-www-form-urlencoded'
  832. };
  833. function setContentTypeIfUnset(headers, value) {
  834. if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {
  835. headers['Content-Type'] = value;
  836. }
  837. }
  838. function getDefaultAdapter() {
  839. var adapter;
  840. if (typeof XMLHttpRequest !== 'undefined') {
  841. // For browsers use XHR adapter
  842. adapter = __webpack_require__(/*! ./adapters/xhr */ "./node_modules/axios/lib/adapters/xhr.js");
  843. } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {
  844. // For node use HTTP adapter
  845. adapter = __webpack_require__(/*! ./adapters/http */ "./node_modules/axios/lib/adapters/xhr.js");
  846. }
  847. return adapter;
  848. }
  849. var defaults = {
  850. adapter: getDefaultAdapter(),
  851. transformRequest: [function transformRequest(data, headers) {
  852. normalizeHeaderName(headers, 'Accept');
  853. normalizeHeaderName(headers, 'Content-Type');
  854. if (utils.isFormData(data) ||
  855. utils.isArrayBuffer(data) ||
  856. utils.isBuffer(data) ||
  857. utils.isStream(data) ||
  858. utils.isFile(data) ||
  859. utils.isBlob(data)
  860. ) {
  861. return data;
  862. }
  863. if (utils.isArrayBufferView(data)) {
  864. return data.buffer;
  865. }
  866. if (utils.isURLSearchParams(data)) {
  867. setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
  868. return data.toString();
  869. }
  870. if (utils.isObject(data)) {
  871. setContentTypeIfUnset(headers, 'application/json;charset=utf-8');
  872. return JSON.stringify(data);
  873. }
  874. return data;
  875. }],
  876. transformResponse: [function transformResponse(data) {
  877. /*eslint no-param-reassign:0*/
  878. if (typeof data === 'string') {
  879. try {
  880. data = JSON.parse(data);
  881. } catch (e) { /* Ignore */ }
  882. }
  883. return data;
  884. }],
  885. /**
  886. * A timeout in milliseconds to abort a request. If set to 0 (default) a
  887. * timeout is not created.
  888. */
  889. timeout: 0,
  890. xsrfCookieName: 'XSRF-TOKEN',
  891. xsrfHeaderName: 'X-XSRF-TOKEN',
  892. maxContentLength: -1,
  893. validateStatus: function validateStatus(status) {
  894. return status >= 200 && status < 300;
  895. }
  896. };
  897. defaults.headers = {
  898. common: {
  899. 'Accept': 'application/json, text/plain, */*'
  900. }
  901. };
  902. utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
  903. defaults.headers[method] = {};
  904. });
  905. utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
  906. defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
  907. });
  908. module.exports = defaults;
  909. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ "./node_modules/process/browser.js")))
  910. /***/ }),
  911. /***/ "./node_modules/axios/lib/helpers/bind.js":
  912. /*!************************************************!*\
  913. !*** ./node_modules/axios/lib/helpers/bind.js ***!
  914. \************************************************/
  915. /*! no static exports found */
  916. /***/ (function(module, exports, __webpack_require__) {
  917. "use strict";
  918. module.exports = function bind(fn, thisArg) {
  919. return function wrap() {
  920. var args = new Array(arguments.length);
  921. for (var i = 0; i < args.length; i++) {
  922. args[i] = arguments[i];
  923. }
  924. return fn.apply(thisArg, args);
  925. };
  926. };
  927. /***/ }),
  928. /***/ "./node_modules/axios/lib/helpers/buildURL.js":
  929. /*!****************************************************!*\
  930. !*** ./node_modules/axios/lib/helpers/buildURL.js ***!
  931. \****************************************************/
  932. /*! no static exports found */
  933. /***/ (function(module, exports, __webpack_require__) {
  934. "use strict";
  935. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  936. function encode(val) {
  937. return encodeURIComponent(val).
  938. replace(/%40/gi, '@').
  939. replace(/%3A/gi, ':').
  940. replace(/%24/g, '$').
  941. replace(/%2C/gi, ',').
  942. replace(/%20/g, '+').
  943. replace(/%5B/gi, '[').
  944. replace(/%5D/gi, ']');
  945. }
  946. /**
  947. * Build a URL by appending params to the end
  948. *
  949. * @param {string} url The base of the url (e.g., http://www.google.com)
  950. * @param {object} [params] The params to be appended
  951. * @returns {string} The formatted url
  952. */
  953. module.exports = function buildURL(url, params, paramsSerializer) {
  954. /*eslint no-param-reassign:0*/
  955. if (!params) {
  956. return url;
  957. }
  958. var serializedParams;
  959. if (paramsSerializer) {
  960. serializedParams = paramsSerializer(params);
  961. } else if (utils.isURLSearchParams(params)) {
  962. serializedParams = params.toString();
  963. } else {
  964. var parts = [];
  965. utils.forEach(params, function serialize(val, key) {
  966. if (val === null || typeof val === 'undefined') {
  967. return;
  968. }
  969. if (utils.isArray(val)) {
  970. key = key + '[]';
  971. } else {
  972. val = [val];
  973. }
  974. utils.forEach(val, function parseValue(v) {
  975. if (utils.isDate(v)) {
  976. v = v.toISOString();
  977. } else if (utils.isObject(v)) {
  978. v = JSON.stringify(v);
  979. }
  980. parts.push(encode(key) + '=' + encode(v));
  981. });
  982. });
  983. serializedParams = parts.join('&');
  984. }
  985. if (serializedParams) {
  986. var hashmarkIndex = url.indexOf('#');
  987. if (hashmarkIndex !== -1) {
  988. url = url.slice(0, hashmarkIndex);
  989. }
  990. url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
  991. }
  992. return url;
  993. };
  994. /***/ }),
  995. /***/ "./node_modules/axios/lib/helpers/combineURLs.js":
  996. /*!*******************************************************!*\
  997. !*** ./node_modules/axios/lib/helpers/combineURLs.js ***!
  998. \*******************************************************/
  999. /*! no static exports found */
  1000. /***/ (function(module, exports, __webpack_require__) {
  1001. "use strict";
  1002. /**
  1003. * Creates a new URL by combining the specified URLs
  1004. *
  1005. * @param {string} baseURL The base URL
  1006. * @param {string} relativeURL The relative URL
  1007. * @returns {string} The combined URL
  1008. */
  1009. module.exports = function combineURLs(baseURL, relativeURL) {
  1010. return relativeURL
  1011. ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
  1012. : baseURL;
  1013. };
  1014. /***/ }),
  1015. /***/ "./node_modules/axios/lib/helpers/cookies.js":
  1016. /*!***************************************************!*\
  1017. !*** ./node_modules/axios/lib/helpers/cookies.js ***!
  1018. \***************************************************/
  1019. /*! no static exports found */
  1020. /***/ (function(module, exports, __webpack_require__) {
  1021. "use strict";
  1022. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  1023. module.exports = (
  1024. utils.isStandardBrowserEnv() ?
  1025. // Standard browser envs support document.cookie
  1026. (function standardBrowserEnv() {
  1027. return {
  1028. write: function write(name, value, expires, path, domain, secure) {
  1029. var cookie = [];
  1030. cookie.push(name + '=' + encodeURIComponent(value));
  1031. if (utils.isNumber(expires)) {
  1032. cookie.push('expires=' + new Date(expires).toGMTString());
  1033. }
  1034. if (utils.isString(path)) {
  1035. cookie.push('path=' + path);
  1036. }
  1037. if (utils.isString(domain)) {
  1038. cookie.push('domain=' + domain);
  1039. }
  1040. if (secure === true) {
  1041. cookie.push('secure');
  1042. }
  1043. document.cookie = cookie.join('; ');
  1044. },
  1045. read: function read(name) {
  1046. var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
  1047. return (match ? decodeURIComponent(match[3]) : null);
  1048. },
  1049. remove: function remove(name) {
  1050. this.write(name, '', Date.now() - 86400000);
  1051. }
  1052. };
  1053. })() :
  1054. // Non standard browser env (web workers, react-native) lack needed support.
  1055. (function nonStandardBrowserEnv() {
  1056. return {
  1057. write: function write() {},
  1058. read: function read() { return null; },
  1059. remove: function remove() {}
  1060. };
  1061. })()
  1062. );
  1063. /***/ }),
  1064. /***/ "./node_modules/axios/lib/helpers/isAbsoluteURL.js":
  1065. /*!*********************************************************!*\
  1066. !*** ./node_modules/axios/lib/helpers/isAbsoluteURL.js ***!
  1067. \*********************************************************/
  1068. /*! no static exports found */
  1069. /***/ (function(module, exports, __webpack_require__) {
  1070. "use strict";
  1071. /**
  1072. * Determines whether the specified URL is absolute
  1073. *
  1074. * @param {string} url The URL to test
  1075. * @returns {boolean} True if the specified URL is absolute, otherwise false
  1076. */
  1077. module.exports = function isAbsoluteURL(url) {
  1078. // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
  1079. // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
  1080. // by any combination of letters, digits, plus, period, or hyphen.
  1081. return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
  1082. };
  1083. /***/ }),
  1084. /***/ "./node_modules/axios/lib/helpers/isURLSameOrigin.js":
  1085. /*!***********************************************************!*\
  1086. !*** ./node_modules/axios/lib/helpers/isURLSameOrigin.js ***!
  1087. \***********************************************************/
  1088. /*! no static exports found */
  1089. /***/ (function(module, exports, __webpack_require__) {
  1090. "use strict";
  1091. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  1092. module.exports = (
  1093. utils.isStandardBrowserEnv() ?
  1094. // Standard browser envs have full support of the APIs needed to test
  1095. // whether the request URL is of the same origin as current location.
  1096. (function standardBrowserEnv() {
  1097. var msie = /(msie|trident)/i.test(navigator.userAgent);
  1098. var urlParsingNode = document.createElement('a');
  1099. var originURL;
  1100. /**
  1101. * Parse a URL to discover it's components
  1102. *
  1103. * @param {String} url The URL to be parsed
  1104. * @returns {Object}
  1105. */
  1106. function resolveURL(url) {
  1107. var href = url;
  1108. if (msie) {
  1109. // IE needs attribute set twice to normalize properties
  1110. urlParsingNode.setAttribute('href', href);
  1111. href = urlParsingNode.href;
  1112. }
  1113. urlParsingNode.setAttribute('href', href);
  1114. // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
  1115. return {
  1116. href: urlParsingNode.href,
  1117. protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
  1118. host: urlParsingNode.host,
  1119. search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
  1120. hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
  1121. hostname: urlParsingNode.hostname,
  1122. port: urlParsingNode.port,
  1123. pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
  1124. urlParsingNode.pathname :
  1125. '/' + urlParsingNode.pathname
  1126. };
  1127. }
  1128. originURL = resolveURL(window.location.href);
  1129. /**
  1130. * Determine if a URL shares the same origin as the current location
  1131. *
  1132. * @param {String} requestURL The URL to test
  1133. * @returns {boolean} True if URL shares the same origin, otherwise false
  1134. */
  1135. return function isURLSameOrigin(requestURL) {
  1136. var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
  1137. return (parsed.protocol === originURL.protocol &&
  1138. parsed.host === originURL.host);
  1139. };
  1140. })() :
  1141. // Non standard browser envs (web workers, react-native) lack needed support.
  1142. (function nonStandardBrowserEnv() {
  1143. return function isURLSameOrigin() {
  1144. return true;
  1145. };
  1146. })()
  1147. );
  1148. /***/ }),
  1149. /***/ "./node_modules/axios/lib/helpers/normalizeHeaderName.js":
  1150. /*!***************************************************************!*\
  1151. !*** ./node_modules/axios/lib/helpers/normalizeHeaderName.js ***!
  1152. \***************************************************************/
  1153. /*! no static exports found */
  1154. /***/ (function(module, exports, __webpack_require__) {
  1155. "use strict";
  1156. var utils = __webpack_require__(/*! ../utils */ "./node_modules/axios/lib/utils.js");
  1157. module.exports = function normalizeHeaderName(headers, normalizedName) {
  1158. utils.forEach(headers, function processHeader(value, name) {
  1159. if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
  1160. headers[normalizedName] = value;
  1161. delete headers[name];
  1162. }
  1163. });
  1164. };
  1165. /***/ }),
  1166. /***/ "./node_modules/axios/lib/helpers/parseHeaders.js":
  1167. /*!********************************************************!*\
  1168. !*** ./node_modules/axios/lib/helpers/parseHeaders.js ***!
  1169. \********************************************************/
  1170. /*! no static exports found */
  1171. /***/ (function(module, exports, __webpack_require__) {
  1172. "use strict";
  1173. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  1174. // Headers whose duplicates are ignored by node
  1175. // c.f. https://nodejs.org/api/http.html#http_message_headers
  1176. var ignoreDuplicateOf = [
  1177. 'age', 'authorization', 'content-length', 'content-type', 'etag',
  1178. 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
  1179. 'last-modified', 'location', 'max-forwards', 'proxy-authorization',
  1180. 'referer', 'retry-after', 'user-agent'
  1181. ];
  1182. /**
  1183. * Parse headers into an object
  1184. *
  1185. * ```
  1186. * Date: Wed, 27 Aug 2014 08:58:49 GMT
  1187. * Content-Type: application/json
  1188. * Connection: keep-alive
  1189. * Transfer-Encoding: chunked
  1190. * ```
  1191. *
  1192. * @param {String} headers Headers needing to be parsed
  1193. * @returns {Object} Headers parsed into an object
  1194. */
  1195. module.exports = function parseHeaders(headers) {
  1196. var parsed = {};
  1197. var key;
  1198. var val;
  1199. var i;
  1200. if (!headers) { return parsed; }
  1201. utils.forEach(headers.split('\n'), function parser(line) {
  1202. i = line.indexOf(':');
  1203. key = utils.trim(line.substr(0, i)).toLowerCase();
  1204. val = utils.trim(line.substr(i + 1));
  1205. if (key) {
  1206. if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
  1207. return;
  1208. }
  1209. if (key === 'set-cookie') {
  1210. parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
  1211. } else {
  1212. parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
  1213. }
  1214. }
  1215. });
  1216. return parsed;
  1217. };
  1218. /***/ }),
  1219. /***/ "./node_modules/axios/lib/helpers/spread.js":
  1220. /*!**************************************************!*\
  1221. !*** ./node_modules/axios/lib/helpers/spread.js ***!
  1222. \**************************************************/
  1223. /*! no static exports found */
  1224. /***/ (function(module, exports, __webpack_require__) {
  1225. "use strict";
  1226. /**
  1227. * Syntactic sugar for invoking a function and expanding an array for arguments.
  1228. *
  1229. * Common use case would be to use `Function.prototype.apply`.
  1230. *
  1231. * ```js
  1232. * function f(x, y, z) {}
  1233. * var args = [1, 2, 3];
  1234. * f.apply(null, args);
  1235. * ```
  1236. *
  1237. * With `spread` this example can be re-written.
  1238. *
  1239. * ```js
  1240. * spread(function(x, y, z) {})([1, 2, 3]);
  1241. * ```
  1242. *
  1243. * @param {Function} callback
  1244. * @returns {Function}
  1245. */
  1246. module.exports = function spread(callback) {
  1247. return function wrap(arr) {
  1248. return callback.apply(null, arr);
  1249. };
  1250. };
  1251. /***/ }),
  1252. /***/ "./node_modules/axios/lib/utils.js":
  1253. /*!*****************************************!*\
  1254. !*** ./node_modules/axios/lib/utils.js ***!
  1255. \*****************************************/
  1256. /*! no static exports found */
  1257. /***/ (function(module, exports, __webpack_require__) {
  1258. "use strict";
  1259. var bind = __webpack_require__(/*! ./helpers/bind */ "./node_modules/axios/lib/helpers/bind.js");
  1260. /*global toString:true*/
  1261. // utils is a library of generic helper functions non-specific to axios
  1262. var toString = Object.prototype.toString;
  1263. /**
  1264. * Determine if a value is an Array
  1265. *
  1266. * @param {Object} val The value to test
  1267. * @returns {boolean} True if value is an Array, otherwise false
  1268. */
  1269. function isArray(val) {
  1270. return toString.call(val) === '[object Array]';
  1271. }
  1272. /**
  1273. * Determine if a value is undefined
  1274. *
  1275. * @param {Object} val The value to test
  1276. * @returns {boolean} True if the value is undefined, otherwise false
  1277. */
  1278. function isUndefined(val) {
  1279. return typeof val === 'undefined';
  1280. }
  1281. /**
  1282. * Determine if a value is a Buffer
  1283. *
  1284. * @param {Object} val The value to test
  1285. * @returns {boolean} True if value is a Buffer, otherwise false
  1286. */
  1287. function isBuffer(val) {
  1288. return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
  1289. && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);
  1290. }
  1291. /**
  1292. * Determine if a value is an ArrayBuffer
  1293. *
  1294. * @param {Object} val The value to test
  1295. * @returns {boolean} True if value is an ArrayBuffer, otherwise false
  1296. */
  1297. function isArrayBuffer(val) {
  1298. return toString.call(val) === '[object ArrayBuffer]';
  1299. }
  1300. /**
  1301. * Determine if a value is a FormData
  1302. *
  1303. * @param {Object} val The value to test
  1304. * @returns {boolean} True if value is an FormData, otherwise false
  1305. */
  1306. function isFormData(val) {
  1307. return (typeof FormData !== 'undefined') && (val instanceof FormData);
  1308. }
  1309. /**
  1310. * Determine if a value is a view on an ArrayBuffer
  1311. *
  1312. * @param {Object} val The value to test
  1313. * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
  1314. */
  1315. function isArrayBufferView(val) {
  1316. var result;
  1317. if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
  1318. result = ArrayBuffer.isView(val);
  1319. } else {
  1320. result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);
  1321. }
  1322. return result;
  1323. }
  1324. /**
  1325. * Determine if a value is a String
  1326. *
  1327. * @param {Object} val The value to test
  1328. * @returns {boolean} True if value is a String, otherwise false
  1329. */
  1330. function isString(val) {
  1331. return typeof val === 'string';
  1332. }
  1333. /**
  1334. * Determine if a value is a Number
  1335. *
  1336. * @param {Object} val The value to test
  1337. * @returns {boolean} True if value is a Number, otherwise false
  1338. */
  1339. function isNumber(val) {
  1340. return typeof val === 'number';
  1341. }
  1342. /**
  1343. * Determine if a value is an Object
  1344. *
  1345. * @param {Object} val The value to test
  1346. * @returns {boolean} True if value is an Object, otherwise false
  1347. */
  1348. function isObject(val) {
  1349. return val !== null && typeof val === 'object';
  1350. }
  1351. /**
  1352. * Determine if a value is a Date
  1353. *
  1354. * @param {Object} val The value to test
  1355. * @returns {boolean} True if value is a Date, otherwise false
  1356. */
  1357. function isDate(val) {
  1358. return toString.call(val) === '[object Date]';
  1359. }
  1360. /**
  1361. * Determine if a value is a File
  1362. *
  1363. * @param {Object} val The value to test
  1364. * @returns {boolean} True if value is a File, otherwise false
  1365. */
  1366. function isFile(val) {
  1367. return toString.call(val) === '[object File]';
  1368. }
  1369. /**
  1370. * Determine if a value is a Blob
  1371. *
  1372. * @param {Object} val The value to test
  1373. * @returns {boolean} True if value is a Blob, otherwise false
  1374. */
  1375. function isBlob(val) {
  1376. return toString.call(val) === '[object Blob]';
  1377. }
  1378. /**
  1379. * Determine if a value is a Function
  1380. *
  1381. * @param {Object} val The value to test
  1382. * @returns {boolean} True if value is a Function, otherwise false
  1383. */
  1384. function isFunction(val) {
  1385. return toString.call(val) === '[object Function]';
  1386. }
  1387. /**
  1388. * Determine if a value is a Stream
  1389. *
  1390. * @param {Object} val The value to test
  1391. * @returns {boolean} True if value is a Stream, otherwise false
  1392. */
  1393. function isStream(val) {
  1394. return isObject(val) && isFunction(val.pipe);
  1395. }
  1396. /**
  1397. * Determine if a value is a URLSearchParams object
  1398. *
  1399. * @param {Object} val The value to test
  1400. * @returns {boolean} True if value is a URLSearchParams object, otherwise false
  1401. */
  1402. function isURLSearchParams(val) {
  1403. return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;
  1404. }
  1405. /**
  1406. * Trim excess whitespace off the beginning and end of a string
  1407. *
  1408. * @param {String} str The String to trim
  1409. * @returns {String} The String freed of excess whitespace
  1410. */
  1411. function trim(str) {
  1412. return str.replace(/^\s*/, '').replace(/\s*$/, '');
  1413. }
  1414. /**
  1415. * Determine if we're running in a standard browser environment
  1416. *
  1417. * This allows axios to run in a web worker, and react-native.
  1418. * Both environments support XMLHttpRequest, but not fully standard globals.
  1419. *
  1420. * web workers:
  1421. * typeof window -> undefined
  1422. * typeof document -> undefined
  1423. *
  1424. * react-native:
  1425. * navigator.product -> 'ReactNative'
  1426. * nativescript
  1427. * navigator.product -> 'NativeScript' or 'NS'
  1428. */
  1429. function isStandardBrowserEnv() {
  1430. if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||
  1431. navigator.product === 'NativeScript' ||
  1432. navigator.product === 'NS')) {
  1433. return false;
  1434. }
  1435. return (
  1436. typeof window !== 'undefined' &&
  1437. typeof document !== 'undefined'
  1438. );
  1439. }
  1440. /**
  1441. * Iterate over an Array or an Object invoking a function for each item.
  1442. *
  1443. * If `obj` is an Array callback will be called passing
  1444. * the value, index, and complete array for each item.
  1445. *
  1446. * If 'obj' is an Object callback will be called passing
  1447. * the value, key, and complete object for each property.
  1448. *
  1449. * @param {Object|Array} obj The object to iterate
  1450. * @param {Function} fn The callback to invoke for each item
  1451. */
  1452. function forEach(obj, fn) {
  1453. // Don't bother if no value provided
  1454. if (obj === null || typeof obj === 'undefined') {
  1455. return;
  1456. }
  1457. // Force an array if not already something iterable
  1458. if (typeof obj !== 'object') {
  1459. /*eslint no-param-reassign:0*/
  1460. obj = [obj];
  1461. }
  1462. if (isArray(obj)) {
  1463. // Iterate over array values
  1464. for (var i = 0, l = obj.length; i < l; i++) {
  1465. fn.call(null, obj[i], i, obj);
  1466. }
  1467. } else {
  1468. // Iterate over object keys
  1469. for (var key in obj) {
  1470. if (Object.prototype.hasOwnProperty.call(obj, key)) {
  1471. fn.call(null, obj[key], key, obj);
  1472. }
  1473. }
  1474. }
  1475. }
  1476. /**
  1477. * Accepts varargs expecting each argument to be an object, then
  1478. * immutably merges the properties of each object and returns result.
  1479. *
  1480. * When multiple objects contain the same key the later object in
  1481. * the arguments list will take precedence.
  1482. *
  1483. * Example:
  1484. *
  1485. * ```js
  1486. * var result = merge({foo: 123}, {foo: 456});
  1487. * console.log(result.foo); // outputs 456
  1488. * ```
  1489. *
  1490. * @param {Object} obj1 Object to merge
  1491. * @returns {Object} Result of all merge properties
  1492. */
  1493. function merge(/* obj1, obj2, obj3, ... */) {
  1494. var result = {};
  1495. function assignValue(val, key) {
  1496. if (typeof result[key] === 'object' && typeof val === 'object') {
  1497. result[key] = merge(result[key], val);
  1498. } else {
  1499. result[key] = val;
  1500. }
  1501. }
  1502. for (var i = 0, l = arguments.length; i < l; i++) {
  1503. forEach(arguments[i], assignValue);
  1504. }
  1505. return result;
  1506. }
  1507. /**
  1508. * Function equal to merge with the difference being that no reference
  1509. * to original objects is kept.
  1510. *
  1511. * @see merge
  1512. * @param {Object} obj1 Object to merge
  1513. * @returns {Object} Result of all merge properties
  1514. */
  1515. function deepMerge(/* obj1, obj2, obj3, ... */) {
  1516. var result = {};
  1517. function assignValue(val, key) {
  1518. if (typeof result[key] === 'object' && typeof val === 'object') {
  1519. result[key] = deepMerge(result[key], val);
  1520. } else if (typeof val === 'object') {
  1521. result[key] = deepMerge({}, val);
  1522. } else {
  1523. result[key] = val;
  1524. }
  1525. }
  1526. for (var i = 0, l = arguments.length; i < l; i++) {
  1527. forEach(arguments[i], assignValue);
  1528. }
  1529. return result;
  1530. }
  1531. /**
  1532. * Extends object a by mutably adding to it the properties of object b.
  1533. *
  1534. * @param {Object} a The object to be extended
  1535. * @param {Object} b The object to copy properties from
  1536. * @param {Object} thisArg The object to bind function to
  1537. * @return {Object} The resulting value of object a
  1538. */
  1539. function extend(a, b, thisArg) {
  1540. forEach(b, function assignValue(val, key) {
  1541. if (thisArg && typeof val === 'function') {
  1542. a[key] = bind(val, thisArg);
  1543. } else {
  1544. a[key] = val;
  1545. }
  1546. });
  1547. return a;
  1548. }
  1549. module.exports = {
  1550. isArray: isArray,
  1551. isArrayBuffer: isArrayBuffer,
  1552. isBuffer: isBuffer,
  1553. isFormData: isFormData,
  1554. isArrayBufferView: isArrayBufferView,
  1555. isString: isString,
  1556. isNumber: isNumber,
  1557. isObject: isObject,
  1558. isUndefined: isUndefined,
  1559. isDate: isDate,
  1560. isFile: isFile,
  1561. isBlob: isBlob,
  1562. isFunction: isFunction,
  1563. isStream: isStream,
  1564. isURLSearchParams: isURLSearchParams,
  1565. isStandardBrowserEnv: isStandardBrowserEnv,
  1566. forEach: forEach,
  1567. merge: merge,
  1568. deepMerge: deepMerge,
  1569. extend: extend,
  1570. trim: trim
  1571. };
  1572. /***/ }),
  1573. /***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/AssetInfo.vue?vue&type=script&lang=js&":
  1574. /*!********************************************************************************************************************************************************************!*\
  1575. !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/AssetInfo.vue?vue&type=script&lang=js& ***!
  1576. \********************************************************************************************************************************************************************/
  1577. /*! exports provided: default */
  1578. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1579. "use strict";
  1580. __webpack_require__.r(__webpack_exports__);
  1581. /* harmony import */ var _components_AssetInfoEditModal_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../components/AssetInfoEditModal.vue */ "./resources/js/components/AssetInfoEditModal.vue");
  1582. //
  1583. //
  1584. //
  1585. //
  1586. //
  1587. //
  1588. //
  1589. //
  1590. //
  1591. //
  1592. //
  1593. //
  1594. //
  1595. /* harmony default export */ __webpack_exports__["default"] = ({
  1596. components: {
  1597. AssetInfoEditModal: _components_AssetInfoEditModal_vue__WEBPACK_IMPORTED_MODULE_0__["default"]
  1598. },
  1599. props: {
  1600. asset: {
  1601. type: Object,
  1602. required: true
  1603. }
  1604. },
  1605. mounted: function mounted() {
  1606. var _this = this;
  1607. Echo.channel('asset.' + this.asset.pcid).listen('AssetUpdated', function (e) {
  1608. _this.asset = e.data;
  1609. });
  1610. }
  1611. });
  1612. /***/ }),
  1613. /***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/AssetInfoEditModal.vue?vue&type=script&lang=js&":
  1614. /*!*****************************************************************************************************************************************************************************!*\
  1615. !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/AssetInfoEditModal.vue?vue&type=script&lang=js& ***!
  1616. \*****************************************************************************************************************************************************************************/
  1617. /*! exports provided: default */
  1618. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1619. "use strict";
  1620. __webpack_require__.r(__webpack_exports__);
  1621. /* harmony import */ var _components_Modal_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../components/Modal.vue */ "./resources/js/components/Modal.vue");
  1622. /* harmony import */ var _components_CircleSpinner_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/CircleSpinner.vue */ "./resources/js/components/CircleSpinner.vue");
  1623. //
  1624. //
  1625. //
  1626. //
  1627. //
  1628. //
  1629. //
  1630. //
  1631. //
  1632. //
  1633. //
  1634. //
  1635. //
  1636. //
  1637. //
  1638. //
  1639. //
  1640. //
  1641. //
  1642. //
  1643. //
  1644. //
  1645. //
  1646. //
  1647. //
  1648. //
  1649. //
  1650. //
  1651. //
  1652. //
  1653. //
  1654. //
  1655. //
  1656. //
  1657. //
  1658. //
  1659. //
  1660. //
  1661. //
  1662. //
  1663. //
  1664. //
  1665. //
  1666. //
  1667. //
  1668. //
  1669. //
  1670. //
  1671. //
  1672. /* harmony default export */ __webpack_exports__["default"] = ({
  1673. components: {
  1674. Modal: _components_Modal_vue__WEBPACK_IMPORTED_MODULE_0__["default"],
  1675. CircleSpinner: _components_CircleSpinner_vue__WEBPACK_IMPORTED_MODULE_1__["default"]
  1676. },
  1677. props: {
  1678. populateWith: {
  1679. type: Object,
  1680. required: true
  1681. },
  1682. modalId: {
  1683. type: String,
  1684. required: true
  1685. }
  1686. },
  1687. data: function data() {
  1688. return {
  1689. // Essentially makes a copy of the object. Otherwise
  1690. // We would have a reference to the exising object causing
  1691. // unwanted mutations in the parent component.
  1692. asset: JSON.parse(JSON.stringify(this.populateWith)),
  1693. assetSaving: false
  1694. };
  1695. },
  1696. methods: {
  1697. updateAsset: function updateAsset() {
  1698. var _this = this;
  1699. this.assetSaving = true;
  1700. axios.put("/api/assets/".concat(this.asset.pcid), this.asset).then(function (response) {
  1701. _this.assetSaving = false;
  1702. $("#".concat(_this.modalId)).modal('hide');
  1703. })["catch"](function (error) {
  1704. _this.assetSaving = false;
  1705. });
  1706. }
  1707. }
  1708. });
  1709. /***/ }),
  1710. /***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/AutocompleteCustomDropdown.vue?vue&type=script&lang=js&":
  1711. /*!*************************************************************************************************************************************************************************************!*\
  1712. !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/AutocompleteCustomDropdown.vue?vue&type=script&lang=js& ***!
  1713. \*************************************************************************************************************************************************************************************/
  1714. /*! exports provided: default */
  1715. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1716. "use strict";
  1717. __webpack_require__.r(__webpack_exports__);
  1718. //
  1719. //
  1720. //
  1721. //
  1722. //
  1723. //
  1724. //
  1725. //
  1726. //
  1727. //
  1728. //
  1729. //
  1730. //
  1731. //
  1732. //
  1733. //
  1734. //
  1735. //
  1736. //
  1737. //
  1738. //
  1739. /* harmony default export */ __webpack_exports__["default"] = ({
  1740. props: {
  1741. value: null,
  1742. // An object with the following format
  1743. // {
  1744. // key: value,
  1745. // key: value,
  1746. // }
  1747. options: {
  1748. type: Object,
  1749. required: true
  1750. },
  1751. allowCustom: {
  1752. type: Boolean,
  1753. "default": false
  1754. }
  1755. },
  1756. data: function data() {
  1757. return {
  1758. searchText: '',
  1759. selectedOption: null,
  1760. open: false,
  1761. // allows for checking whether button was clicked or text was typed.
  1762. // If button was clicked, we show all options without having to clear
  1763. // out any searchText that was autofilled when page loaded.
  1764. isSearching: false
  1765. };
  1766. },
  1767. computed: {
  1768. matches: function matches() {
  1769. var _this = this;
  1770. // If button was clicked, show all options, if typing, filter
  1771. // options based on searchText
  1772. return Object.entries(this.options).filter(function (option) {
  1773. var optionText = option[1].toUpperCase();
  1774. if (_this.isSearching) {
  1775. return optionText.match(_this.searchText.toUpperCase());
  1776. } else {
  1777. return optionText.match('');
  1778. }
  1779. });
  1780. }
  1781. },
  1782. methods: {
  1783. // if button is clicked, show all options
  1784. setOpen: function setOpen(isOpen) {
  1785. this.open = isOpen;
  1786. this.isSearching = false;
  1787. },
  1788. // if typing in the box, start filtering options
  1789. searchChanged: function searchChanged() {
  1790. if (!this.open) {
  1791. this.open = true;
  1792. }
  1793. if (!this.isSearching) {
  1794. this.isSearching = true;
  1795. } // If custom values are allowed, emits {id: 'custom', name: searchtext}
  1796. if (this.allowCustom) {
  1797. this.$emit('input', {
  1798. 'id': 'custom',
  1799. 'name': this.searchText
  1800. });
  1801. }
  1802. },
  1803. // emits { id: suggestion_id, name: suggestion_name} to v-model when
  1804. // a suggestion is selected
  1805. suggestionSelected: function suggestionSelected(suggestion) {
  1806. this.open = false;
  1807. this.searchText = suggestion[1];
  1808. this.$emit('input', {
  1809. 'id': suggestion[0],
  1810. 'name': suggestion[1]
  1811. });
  1812. },
  1813. updateComponentWithValue: function updateComponentWithValue(newValue) {
  1814. if (this.allowCustom) {
  1815. this.searchText = this.value.name;
  1816. } else {
  1817. if (newValue.id > -1) {
  1818. // Find the matching text for the supplied option value
  1819. for (var id in this.options) {
  1820. if (this.options.hasOwnProperty(id)) {
  1821. if (this.options[id] === this.options[newValue.id]) {
  1822. this.searchText = this.options[id];
  1823. }
  1824. }
  1825. }
  1826. }
  1827. }
  1828. }
  1829. },
  1830. mounted: function mounted() {
  1831. this.updateComponentWithValue(this.value);
  1832. },
  1833. watch: {
  1834. value: function value(newValue) {
  1835. this.updateComponentWithValue(newValue);
  1836. }
  1837. }
  1838. });
  1839. /***/ }),
  1840. /***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/CircleSpinner.vue?vue&type=script&lang=js&":
  1841. /*!************************************************************************************************************************************************************************!*\
  1842. !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/CircleSpinner.vue?vue&type=script&lang=js& ***!
  1843. \************************************************************************************************************************************************************************/
  1844. /*! exports provided: default */
  1845. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1846. "use strict";
  1847. __webpack_require__.r(__webpack_exports__);
  1848. //
  1849. //
  1850. //
  1851. //
  1852. /* harmony default export */ __webpack_exports__["default"] = ({
  1853. name: 'IntersectingCirclesSpinner',
  1854. props: {
  1855. color: {
  1856. type: String,
  1857. "default": '#fff'
  1858. },
  1859. size: {
  1860. type: String,
  1861. "default": '10'
  1862. }
  1863. }
  1864. });
  1865. /***/ }),
  1866. /***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/Credential.vue?vue&type=script&lang=js&":
  1867. /*!*********************************************************************************************************************************************************************!*\
  1868. !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/Credential.vue?vue&type=script&lang=js& ***!
  1869. \*********************************************************************************************************************************************************************/
  1870. /*! exports provided: default */
  1871. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1872. "use strict";
  1873. __webpack_require__.r(__webpack_exports__);
  1874. /* harmony import */ var _components_CredentialFormModal_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../components/CredentialFormModal.vue */ "./resources/js/components/CredentialFormModal.vue");
  1875. /* harmony import */ var _components_Modal_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/Modal.vue */ "./resources/js/components/Modal.vue");
  1876. //
  1877. //
  1878. //
  1879. //
  1880. //
  1881. //
  1882. //
  1883. //
  1884. //
  1885. //
  1886. //
  1887. //
  1888. //
  1889. //
  1890. //
  1891. //
  1892. //
  1893. //
  1894. //
  1895. //
  1896. //
  1897. //
  1898. //
  1899. //
  1900. //
  1901. //
  1902. //
  1903. //
  1904. //
  1905. //
  1906. //
  1907. //
  1908. //
  1909. //
  1910. //
  1911. //
  1912. //
  1913. //
  1914. //
  1915. //
  1916. //
  1917. //
  1918. //
  1919. /* harmony default export */ __webpack_exports__["default"] = ({
  1920. components: {
  1921. CredentialFormModal: _components_CredentialFormModal_vue__WEBPACK_IMPORTED_MODULE_0__["default"],
  1922. Modal: _components_Modal_vue__WEBPACK_IMPORTED_MODULE_1__["default"]
  1923. },
  1924. props: {
  1925. credential: {
  1926. type: Object,
  1927. required: true
  1928. },
  1929. descriptions: {
  1930. type: Object,
  1931. required: true
  1932. }
  1933. },
  1934. data: function data() {
  1935. return {
  1936. data: this.credential,
  1937. creddescList: this.descriptions
  1938. };
  1939. },
  1940. mounted: function mounted() {
  1941. var _this = this;
  1942. Echo.channel('credential.' + this.data.credid).listen('CredentialUpdated', function (e) {
  1943. _this.data = e.credential;
  1944. });
  1945. },
  1946. methods: {
  1947. deleteCredential: function deleteCredential() {
  1948. var _this2 = this;
  1949. axios["delete"]('/api/credentials/' + this.data.credid, this.data).then(function (response) {
  1950. $('#credential' + _this2.data.credid + 'deleteModal').modal('hide');
  1951. })["catch"](function (error) {
  1952. console.error(error);
  1953. });
  1954. }
  1955. }
  1956. });
  1957. /***/ }),
  1958. /***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/CredentialFormModal.vue?vue&type=script&lang=js&":
  1959. /*!******************************************************************************************************************************************************************************!*\
  1960. !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/CredentialFormModal.vue?vue&type=script&lang=js& ***!
  1961. \******************************************************************************************************************************************************************************/
  1962. /*! exports provided: default */
  1963. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1964. "use strict";
  1965. __webpack_require__.r(__webpack_exports__);
  1966. /* harmony import */ var _components_Modal_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../components/Modal.vue */ "./resources/js/components/Modal.vue");
  1967. /* harmony import */ var _components_AutocompleteCustomDropdown_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/AutocompleteCustomDropdown.vue */ "./resources/js/components/AutocompleteCustomDropdown.vue");
  1968. //
  1969. //
  1970. //
  1971. //
  1972. //
  1973. //
  1974. //
  1975. //
  1976. //
  1977. //
  1978. //
  1979. //
  1980. //
  1981. //
  1982. //
  1983. //
  1984. //
  1985. //
  1986. //
  1987. //
  1988. //
  1989. //
  1990. //
  1991. //
  1992. //
  1993. //
  1994. /* harmony default export */ __webpack_exports__["default"] = ({
  1995. components: {
  1996. AutocompleteCustomDropdown: _components_AutocompleteCustomDropdown_vue__WEBPACK_IMPORTED_MODULE_1__["default"],
  1997. Modal: _components_Modal_vue__WEBPACK_IMPORTED_MODULE_0__["default"]
  1998. },
  1999. props: {
  2000. populateWith: {
  2001. type: Object,
  2002. "default": function _default() {
  2003. return {
  2004. creddesc: null,
  2005. creduser: null,
  2006. credpass: null,
  2007. groupid: null,
  2008. pcid: null,
  2009. credtype: null
  2010. };
  2011. }
  2012. },
  2013. modalId: {
  2014. type: String,
  2015. required: true
  2016. },
  2017. descriptions: {
  2018. type: Object,
  2019. required: true
  2020. },
  2021. create: {
  2022. type: Boolean
  2023. },
  2024. pcid: {
  2025. type: Number
  2026. },
  2027. groupid: {
  2028. type: Number
  2029. }
  2030. },
  2031. data: function data() {
  2032. return {
  2033. data: JSON.parse(JSON.stringify(this.populateWith)),
  2034. creddesc: {},
  2035. id: this.modalId,
  2036. errors: []
  2037. };
  2038. },
  2039. mounted: function mounted() {
  2040. this.creddesc = {
  2041. 'id': this.data.credtype,
  2042. 'name': this.data.creddesc
  2043. };
  2044. },
  2045. methods: {
  2046. rndStr: function rndStr(len) {
  2047. var text = "";
  2048. var chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#$%";
  2049. for (var i = 0; i < len; i++) {
  2050. text += chars.charAt(Math.floor(Math.random() * chars.length));
  2051. }
  2052. return text;
  2053. },
  2054. getRandomPassword: function getRandomPassword(id) {
  2055. this.data.credpass = this.rndStr(16);
  2056. },
  2057. updateCredential: function updateCredential() {
  2058. var _this = this;
  2059. if (this.creddesc.id === "custom") {
  2060. this.data.credtype = 1;
  2061. this.data.creddesc = this.creddesc.name;
  2062. } else {
  2063. this.data.credtype = this.creddesc.id;
  2064. this.data.creddesc = this.creddesc.name;
  2065. }
  2066. if (this.create) {
  2067. if (this.pcid) {
  2068. this.data.pcid = this.pcid;
  2069. }
  2070. if (this.groupid) {
  2071. this.data.groupid = this.groupid;
  2072. }
  2073. axios.post('/api/credentials/', this.data).then(function (response) {
  2074. $('#' + _this.id).modal('hide');
  2075. });
  2076. } else {
  2077. axios.put('/api/credentials/' + this.data.credid, this.data).then(function (response) {
  2078. $('#' + _this.id).modal('hide');
  2079. })["catch"](function (error) {
  2080. console.error(error);
  2081. });
  2082. }
  2083. }
  2084. }
  2085. });
  2086. /***/ }),
  2087. /***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/CredentialList.vue?vue&type=script&lang=js&":
  2088. /*!*************************************************************************************************************************************************************************!*\
  2089. !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/CredentialList.vue?vue&type=script&lang=js& ***!
  2090. \*************************************************************************************************************************************************************************/
  2091. /*! exports provided: default */
  2092. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2093. "use strict";
  2094. __webpack_require__.r(__webpack_exports__);
  2095. /* harmony import */ var _components_Credential_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../components/Credential.vue */ "./resources/js/components/Credential.vue");
  2096. /* harmony import */ var _components_CredentialFormModal_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/CredentialFormModal.vue */ "./resources/js/components/CredentialFormModal.vue");
  2097. //
  2098. //
  2099. //
  2100. //
  2101. //
  2102. //
  2103. //
  2104. //
  2105. //
  2106. /* harmony default export */ __webpack_exports__["default"] = ({
  2107. components: {
  2108. Credential: _components_Credential_vue__WEBPACK_IMPORTED_MODULE_0__["default"],
  2109. CredentialFormModal: _components_CredentialFormModal_vue__WEBPACK_IMPORTED_MODULE_1__["default"]
  2110. },
  2111. props: {
  2112. credentials: {
  2113. type: Array,
  2114. required: true
  2115. },
  2116. descriptions: {
  2117. type: Array,
  2118. required: true
  2119. },
  2120. pcid: {
  2121. type: Number
  2122. },
  2123. groupid: {
  2124. type: Number
  2125. }
  2126. },
  2127. computed: {
  2128. creddescList: function creddescList() {
  2129. var list = {};
  2130. this.descriptions.map(function (val) {
  2131. list[val.creddescid] = val.credtitle;
  2132. });
  2133. return list;
  2134. }
  2135. },
  2136. methods: {
  2137. deleteCred: function deleteCred(index) {
  2138. this.credentials.splice(index, 1);
  2139. }
  2140. },
  2141. mounted: function mounted() {
  2142. var _this = this;
  2143. if (this.pcid) {
  2144. Echo.channel('credlist.pcid.' + this.pcid).listen('CredentialDeleted', function (e) {
  2145. var deletedCred = e.credential;
  2146. var index = _this.credentials.findIndex(function (credential) {
  2147. return credential.credid === deletedCred['credid'];
  2148. });
  2149. $('#credential' + deletedCred['credid'] + 'deleteModal').modal('hide');
  2150. _this.deleteCred(index);
  2151. }).listen('CredentialAdded', function (e) {
  2152. _this.credentials.unshift(e.credential);
  2153. });
  2154. }
  2155. if (this.groupid) {
  2156. Echo.channel('credlist.groupid.' + this.groupid).listen('CredentialDeleted', function (e) {
  2157. var deletedCred = e.credential;
  2158. var index = _this.credentials.findIndex(function (credential) {
  2159. return credential.groupid === deletedCred['groupid'];
  2160. });
  2161. $('#credential' + deletedCred['credid'] + 'deleteModal').modal('hide');
  2162. _this.deleteCred(index);
  2163. }).listen('CredentialAdded', function (e) {
  2164. _this.credentials.unshift(e.credential);
  2165. });
  2166. }
  2167. }
  2168. });
  2169. /***/ }),
  2170. /***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/ErrorList.vue?vue&type=script&lang=js&":
  2171. /*!********************************************************************************************************************************************************************!*\
  2172. !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/ErrorList.vue?vue&type=script&lang=js& ***!
  2173. \********************************************************************************************************************************************************************/
  2174. /*! exports provided: default */
  2175. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2176. "use strict";
  2177. __webpack_require__.r(__webpack_exports__);
  2178. //
  2179. //
  2180. //
  2181. //
  2182. //
  2183. /* harmony default export */ __webpack_exports__["default"] = ({
  2184. props: ['errors'],
  2185. data: function data() {
  2186. return {
  2187. errorList: this.errors
  2188. };
  2189. },
  2190. watch: {
  2191. errors: function errors(newErrors) {
  2192. this.errorList = newErrors;
  2193. }
  2194. }
  2195. });
  2196. /***/ }),
  2197. /***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/NoteFormModal.vue?vue&type=script&lang=js&":
  2198. /*!************************************************************************************************************************************************************************!*\
  2199. !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/NoteFormModal.vue?vue&type=script&lang=js& ***!
  2200. \************************************************************************************************************************************************************************/
  2201. /*! exports provided: default */
  2202. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2203. "use strict";
  2204. __webpack_require__.r(__webpack_exports__);
  2205. /* harmony import */ var _components_Modal_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../components/Modal.vue */ "./resources/js/components/Modal.vue");
  2206. //
  2207. //
  2208. //
  2209. //
  2210. //
  2211. //
  2212. //
  2213. //
  2214. //
  2215. //
  2216. //
  2217. //
  2218. //
  2219. //
  2220. //
  2221. //
  2222. //
  2223. /* harmony default export */ __webpack_exports__["default"] = ({
  2224. components: {
  2225. Modal: _components_Modal_vue__WEBPACK_IMPORTED_MODULE_0__["default"]
  2226. },
  2227. props: {
  2228. populateWith: {
  2229. type: Object,
  2230. require: true
  2231. },
  2232. modalId: {
  2233. type: String,
  2234. require: true
  2235. },
  2236. noteType: {
  2237. type: Number
  2238. },
  2239. noteUser: {
  2240. type: String
  2241. },
  2242. woid: {
  2243. type: Number
  2244. }
  2245. },
  2246. data: function data() {
  2247. return {
  2248. note: JSON.parse(JSON.stringify(this.populateWith))
  2249. };
  2250. },
  2251. methods: {
  2252. updateNote: function updateNote(note) {
  2253. var _this = this;
  2254. axios.put('/api/workorders/notes/' + note.noteid, note).then(function (response) {
  2255. _this.hideModal();
  2256. });
  2257. },
  2258. hideModal: function hideModal() {
  2259. $('#' + this.modalId).modal('hide');
  2260. }
  2261. }
  2262. });
  2263. /***/ }),
  2264. /***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/Notes.vue?vue&type=script&lang=js&":
  2265. /*!****************************************************************************************************************************************************************!*\
  2266. !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/Notes.vue?vue&type=script&lang=js& ***!
  2267. \****************************************************************************************************************************************************************/
  2268. /*! exports provided: default */
  2269. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2270. "use strict";
  2271. __webpack_require__.r(__webpack_exports__);
  2272. /* harmony import */ var _mixins_dateMixin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../mixins/dateMixin */ "./resources/js/mixins/dateMixin.js");
  2273. /* harmony import */ var _components_NoteFormModal_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/NoteFormModal.vue */ "./resources/js/components/NoteFormModal.vue");
  2274. //
  2275. //
  2276. //
  2277. //
  2278. //
  2279. //
  2280. //
  2281. //
  2282. //
  2283. //
  2284. //
  2285. //
  2286. //
  2287. //
  2288. //
  2289. //
  2290. //
  2291. //
  2292. //
  2293. //
  2294. //
  2295. //
  2296. //
  2297. //
  2298. //
  2299. //
  2300. //
  2301. //
  2302. //
  2303. //
  2304. //
  2305. //
  2306. //
  2307. //
  2308. //
  2309. //
  2310. //
  2311. //
  2312. /* harmony default export */ __webpack_exports__["default"] = ({
  2313. components: {
  2314. NoteFormModal: _components_NoteFormModal_vue__WEBPACK_IMPORTED_MODULE_1__["default"]
  2315. },
  2316. mixins: [_mixins_dateMixin__WEBPACK_IMPORTED_MODULE_0__["default"]],
  2317. props: {
  2318. notes: {
  2319. type: Array,
  2320. "default": []
  2321. },
  2322. authusername: {
  2323. type: String,
  2324. required: true
  2325. },
  2326. noteType: {
  2327. type: Number,
  2328. required: true
  2329. },
  2330. woid: {
  2331. type: String,
  2332. required: true
  2333. }
  2334. },
  2335. data: function data() {
  2336. return {
  2337. newNote: {
  2338. notetype: this.noteType,
  2339. thenote: '',
  2340. noteuser: this.authusername,
  2341. woid: this.woid
  2342. }
  2343. };
  2344. },
  2345. computed: {
  2346. noteOrders: function noteOrders() {
  2347. return this.getNoteOrders(this.notes);
  2348. }
  2349. },
  2350. methods: {
  2351. createNote: function createNote() {
  2352. var _this = this;
  2353. axios.post('/api/workorders/notes', this.newNote).then(function (response) {
  2354. $('#note' + _this.noteType + 'add').collapse('hide');
  2355. _this.newNote.thenote = '';
  2356. });
  2357. },
  2358. getNoteOrders: function getNoteOrders(notes) {
  2359. var noteOrders = [];
  2360. notes.forEach(function (note, index) {
  2361. if (index === 0) {
  2362. noteOrders[index] = 'order-first';
  2363. } else if (note.noteuser !== notes[index - 1].noteuser) {
  2364. if (noteOrders[index - 1] === 'order-first') {
  2365. noteOrders[index] = 'order-last';
  2366. } else {
  2367. noteOrders[index] = 'order-first';
  2368. }
  2369. } else {
  2370. noteOrders[index] = noteOrders[index - 1];
  2371. }
  2372. });
  2373. return noteOrders;
  2374. }
  2375. }
  2376. });
  2377. /***/ }),
  2378. /***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/WoInfoEditModal.vue?vue&type=script&lang=js&":
  2379. /*!**************************************************************************************************************************************************************************!*\
  2380. !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/WoInfoEditModal.vue?vue&type=script&lang=js& ***!
  2381. \**************************************************************************************************************************************************************************/
  2382. /*! exports provided: default */
  2383. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2384. "use strict";
  2385. __webpack_require__.r(__webpack_exports__);
  2386. /* harmony import */ var _components_Modal_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../components/Modal.vue */ "./resources/js/components/Modal.vue");
  2387. /* harmony import */ var _components_AutocompleteCustomDropdown_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/AutocompleteCustomDropdown.vue */ "./resources/js/components/AutocompleteCustomDropdown.vue");
  2388. /* harmony import */ var _components_ErrorList_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../components/ErrorList.vue */ "./resources/js/components/ErrorList.vue");
  2389. //
  2390. //
  2391. //
  2392. //
  2393. //
  2394. //
  2395. //
  2396. //
  2397. //
  2398. //
  2399. //
  2400. //
  2401. //
  2402. //
  2403. //
  2404. //
  2405. //
  2406. //
  2407. //
  2408. //
  2409. //
  2410. //
  2411. //
  2412. //
  2413. //
  2414. //
  2415. //
  2416. //
  2417. //
  2418. //
  2419. //
  2420. //
  2421. //
  2422. //
  2423. //
  2424. //
  2425. /* harmony default export */ __webpack_exports__["default"] = ({
  2426. components: {
  2427. Modal: _components_Modal_vue__WEBPACK_IMPORTED_MODULE_0__["default"],
  2428. AutocompleteCustomDropdown: _components_AutocompleteCustomDropdown_vue__WEBPACK_IMPORTED_MODULE_1__["default"],
  2429. ErrorList: _components_ErrorList_vue__WEBPACK_IMPORTED_MODULE_2__["default"]
  2430. },
  2431. props: {
  2432. populateWith: {
  2433. type: Object,
  2434. required: true
  2435. },
  2436. storeList: {
  2437. type: Object,
  2438. required: true
  2439. },
  2440. modalId: {
  2441. type: String,
  2442. required: true
  2443. }
  2444. },
  2445. data: function data() {
  2446. return {
  2447. // Copies object from prop, so it doesn't mutate the object
  2448. // from the parent component. Parent component will be updated via
  2449. // Websocket if updateWorkOrder is successful.
  2450. data: JSON.parse(JSON.stringify(this.populateWith)),
  2451. id: this.modalId,
  2452. store: {},
  2453. errors: [],
  2454. woInfoSaving: false
  2455. };
  2456. },
  2457. methods: {
  2458. updateWorkOrder: function updateWorkOrder() {
  2459. var _this = this;
  2460. woInfoSaving: true;
  2461. this.data.storeid = this.store.id;
  2462. axios.put('/api/workorders/' + this.data.woid, this.data).then(function (response) {
  2463. _this.woInfoSaving = false;
  2464. $('#workordereditModal').modal('hide');
  2465. })["catch"](function (error) {
  2466. _this.woInfoSaving = false;
  2467. _this.errors = JSON.parse(error.response.request.response).errors;
  2468. });
  2469. }
  2470. },
  2471. mounted: function mounted() {
  2472. this.store = {
  2473. 'id': this.data.storeid,
  2474. 'name': this.storeList[this.data.storeid]
  2475. };
  2476. },
  2477. // This was originally here because the populateWith info would originally
  2478. // not necessarily be loaded when this component was mounted. That is no
  2479. // longer the case as I now don't render the parent component until the
  2480. // ajax request is finised. The watch statements are still here to cover
  2481. // the case where someone else updates the populateWith values while
  2482. // someone is editing, although it probably should be edited so it doesn't
  2483. // immediately overwrite the unsaved edits of the current user.
  2484. watch: {
  2485. populateWith: function populateWith(value) {
  2486. this.data = JSON.parse(JSON.stringify(this.populateWith));
  2487. this.store = {
  2488. 'id': this.data.storeid,
  2489. 'name': this.storeList[this.data.storeid]
  2490. };
  2491. },
  2492. storeList: function storeList(value) {
  2493. this.store = {
  2494. 'id': this.data.storeid,
  2495. 'name': this.storeList[this.data.storeid]
  2496. };
  2497. }
  2498. }
  2499. });
  2500. /***/ }),
  2501. /***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/WorkOrderInfo.vue?vue&type=script&lang=js&":
  2502. /*!************************************************************************************************************************************************************************!*\
  2503. !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/WorkOrderInfo.vue?vue&type=script&lang=js& ***!
  2504. \************************************************************************************************************************************************************************/
  2505. /*! exports provided: default */
  2506. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2507. "use strict";
  2508. __webpack_require__.r(__webpack_exports__);
  2509. /* harmony import */ var _mixins_dateMixin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../mixins/dateMixin */ "./resources/js/mixins/dateMixin.js");
  2510. /* harmony import */ var _components_WoInfoEditModal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/WoInfoEditModal */ "./resources/js/components/WoInfoEditModal.vue");
  2511. //
  2512. //
  2513. //
  2514. //
  2515. //
  2516. //
  2517. //
  2518. //
  2519. //
  2520. //
  2521. //
  2522. //
  2523. //
  2524. //
  2525. //
  2526. //
  2527. //
  2528. //
  2529. //
  2530. //
  2531. /* harmony default export */ __webpack_exports__["default"] = ({
  2532. components: {
  2533. WoInfoEditModal: _components_WoInfoEditModal__WEBPACK_IMPORTED_MODULE_1__["default"]
  2534. },
  2535. mixins: [_mixins_dateMixin__WEBPACK_IMPORTED_MODULE_0__["default"]],
  2536. props: ['workOrder', 'stores'],
  2537. computed: {
  2538. storeList: function storeList() {
  2539. var list = {};
  2540. Object.values(this.stores).map(function (val) {
  2541. list[val.storeid] = val.storesname;
  2542. });
  2543. return list;
  2544. }
  2545. }
  2546. });
  2547. /***/ }),
  2548. /***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/views/App.vue?vue&type=script&lang=js&":
  2549. /*!*********************************************************************************************************************************************************!*\
  2550. !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/views/App.vue?vue&type=script&lang=js& ***!
  2551. \*********************************************************************************************************************************************************/
  2552. /*! exports provided: default */
  2553. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2554. "use strict";
  2555. __webpack_require__.r(__webpack_exports__);
  2556. //
  2557. //
  2558. //
  2559. //
  2560. //
  2561. //
  2562. //
  2563. //
  2564. //
  2565. //
  2566. //
  2567. //
  2568. //
  2569. //
  2570. //
  2571. //
  2572. //
  2573. //
  2574. //
  2575. //
  2576. //
  2577. //
  2578. //
  2579. //
  2580. //
  2581. //
  2582. //
  2583. //
  2584. //
  2585. //
  2586. //
  2587. //
  2588. //
  2589. //
  2590. //
  2591. //
  2592. //
  2593. //
  2594. //
  2595. //
  2596. //
  2597. //
  2598. //
  2599. //
  2600. //
  2601. //
  2602. //
  2603. //
  2604. //
  2605. //
  2606. //
  2607. //
  2608. //
  2609. //
  2610. //
  2611. //
  2612. //
  2613. //
  2614. //
  2615. //
  2616. //
  2617. //
  2618. //
  2619. //
  2620. //
  2621. //
  2622. //
  2623. //
  2624. //
  2625. //
  2626. //
  2627. /* harmony default export */ __webpack_exports__["default"] = ({
  2628. data: function data() {
  2629. return {
  2630. isLoggedIn: null,
  2631. username: null
  2632. };
  2633. },
  2634. mounted: function mounted() {
  2635. this.isLoggedIn = localStorage.getItem('jwt');
  2636. this.username = localStorage.getItem('user');
  2637. }
  2638. });
  2639. /***/ }),
  2640. /***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/views/Dashboard.vue?vue&type=script&lang=js&":
  2641. /*!***************************************************************************************************************************************************************!*\
  2642. !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/views/Dashboard.vue?vue&type=script&lang=js& ***!
  2643. \***************************************************************************************************************************************************************/
  2644. /*! exports provided: default */
  2645. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2646. "use strict";
  2647. __webpack_require__.r(__webpack_exports__);
  2648. /* harmony import */ var _components_CircleSpinner_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../components/CircleSpinner.vue */ "./resources/js/components/CircleSpinner.vue");
  2649. //
  2650. //
  2651. //
  2652. //
  2653. //
  2654. //
  2655. //
  2656. //
  2657. //
  2658. //
  2659. //
  2660. //
  2661. //
  2662. //
  2663. //
  2664. //
  2665. //
  2666. //
  2667. //
  2668. //
  2669. //
  2670. //
  2671. //
  2672. //
  2673. //
  2674. //
  2675. /* harmony default export */ __webpack_exports__["default"] = ({
  2676. components: {
  2677. CircleSpinner: _components_CircleSpinner_vue__WEBPACK_IMPORTED_MODULE_0__["default"]
  2678. },
  2679. data: function data() {
  2680. return {
  2681. workOrders: [],
  2682. isLoading: true
  2683. };
  2684. },
  2685. mounted: function mounted() {
  2686. var _this = this;
  2687. var token = localStorage.getItem('jwt');
  2688. var user = localStorage.getItem('user');
  2689. axios.defaults.headers.common['Content-Type'] = 'application/json';
  2690. axios.defaults.headers.common['Authorization'] = 'Bearer ' + token;
  2691. axios.get('api/users/' + user + '/workorders').then(function (response) {
  2692. _this.workOrders = response.data;
  2693. _this.isLoading = false;
  2694. })["catch"](function (error) {
  2695. console.log(error);
  2696. });
  2697. },
  2698. beforeRouteEnter: function beforeRouteEnter(to, from, next) {
  2699. if (!localStorage.getItem('jwt')) {
  2700. return next('login');
  2701. }
  2702. next();
  2703. }
  2704. });
  2705. /***/ }),
  2706. /***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/views/Login.vue?vue&type=script&lang=js&":
  2707. /*!***********************************************************************************************************************************************************!*\
  2708. !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/views/Login.vue?vue&type=script&lang=js& ***!
  2709. \***********************************************************************************************************************************************************/
  2710. /*! exports provided: default */
  2711. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2712. "use strict";
  2713. __webpack_require__.r(__webpack_exports__);
  2714. //
  2715. //
  2716. //
  2717. //
  2718. //
  2719. //
  2720. //
  2721. //
  2722. //
  2723. //
  2724. //
  2725. //
  2726. //
  2727. //
  2728. //
  2729. //
  2730. //
  2731. //
  2732. //
  2733. //
  2734. //
  2735. //
  2736. //
  2737. //
  2738. //
  2739. //
  2740. //
  2741. //
  2742. //
  2743. //
  2744. //
  2745. //
  2746. //
  2747. //
  2748. //
  2749. //
  2750. //
  2751. //
  2752. //
  2753. /* harmony default export */ __webpack_exports__["default"] = ({
  2754. data: function data() {
  2755. return {
  2756. username: "",
  2757. password: ""
  2758. };
  2759. },
  2760. methods: {
  2761. handleSubmit: function handleSubmit(e) {
  2762. var _this = this;
  2763. e.preventDefault();
  2764. if (this.password.length > 0) {
  2765. axios.post('api/login', {
  2766. username: this.username,
  2767. password: this.password
  2768. }).then(function (response) {
  2769. localStorage.setItem('user', response.data.success.username);
  2770. localStorage.setItem('jwt', response.data.success.token);
  2771. if (localStorage.getItem('jwt') != null) {
  2772. _this.$router.go('/dashboard');
  2773. }
  2774. })["catch"](function (error) {
  2775. console.error(error);
  2776. });
  2777. }
  2778. }
  2779. },
  2780. beforeRouteEnter: function beforeRouteEnter(to, from, next) {
  2781. if (localStorage.getItem('jwt')) {
  2782. return next('dashboard');
  2783. }
  2784. next();
  2785. }
  2786. });
  2787. /***/ }),
  2788. /***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/views/Welcome.vue?vue&type=script&lang=js&":
  2789. /*!*************************************************************************************************************************************************************!*\
  2790. !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/views/Welcome.vue?vue&type=script&lang=js& ***!
  2791. \*************************************************************************************************************************************************************/
  2792. /*! exports provided: default */
  2793. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2794. "use strict";
  2795. __webpack_require__.r(__webpack_exports__);
  2796. //
  2797. //
  2798. //
  2799. //
  2800. //
  2801. //
  2802. //
  2803. //
  2804. //
  2805. //
  2806. //
  2807. //
  2808. //
  2809. //
  2810. //
  2811. //
  2812. //
  2813. //
  2814. //
  2815. //
  2816. //
  2817. //
  2818. //
  2819. //
  2820. //
  2821. //
  2822. //
  2823. //
  2824. //
  2825. //
  2826. //
  2827. //
  2828. //
  2829. //
  2830. //
  2831. //
  2832. //
  2833. //
  2834. //
  2835. //
  2836. //
  2837. //
  2838. //
  2839. //
  2840. //
  2841. //
  2842. //
  2843. //
  2844. //
  2845. //
  2846. //
  2847. /* harmony default export */ __webpack_exports__["default"] = ({});
  2848. /***/ }),
  2849. /***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/views/WorkOrder.vue?vue&type=script&lang=js&":
  2850. /*!***************************************************************************************************************************************************************!*\
  2851. !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/views/WorkOrder.vue?vue&type=script&lang=js& ***!
  2852. \***************************************************************************************************************************************************************/
  2853. /*! exports provided: default */
  2854. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2855. "use strict";
  2856. __webpack_require__.r(__webpack_exports__);
  2857. /* harmony import */ var _components_WorkOrderInfo_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../components/WorkOrderInfo.vue */ "./resources/js/components/WorkOrderInfo.vue");
  2858. /* harmony import */ var _components_AssetInfo_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/AssetInfo.vue */ "./resources/js/components/AssetInfo.vue");
  2859. /* harmony import */ var _components_CircleSpinner_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../components/CircleSpinner.vue */ "./resources/js/components/CircleSpinner.vue");
  2860. /* harmony import */ var _components_CredentialList_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../components/CredentialList.vue */ "./resources/js/components/CredentialList.vue");
  2861. /* harmony import */ var _components_Notes_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../components/Notes.vue */ "./resources/js/components/Notes.vue");
  2862. //
  2863. //
  2864. //
  2865. //
  2866. //
  2867. //
  2868. //
  2869. //
  2870. //
  2871. //
  2872. //
  2873. //
  2874. //
  2875. //
  2876. //
  2877. //
  2878. //
  2879. //
  2880. //
  2881. //
  2882. //
  2883. //
  2884. //
  2885. //
  2886. //
  2887. //
  2888. //
  2889. //
  2890. //
  2891. //
  2892. //
  2893. //
  2894. //
  2895. //
  2896. //
  2897. //
  2898. //
  2899. //
  2900. //
  2901. //
  2902. //
  2903. //
  2904. //
  2905. //
  2906. //
  2907. //
  2908. //
  2909. //
  2910. //
  2911. //
  2912. //
  2913. //
  2914. //
  2915. //
  2916. //
  2917. //
  2918. //
  2919. //
  2920. //
  2921. //
  2922. //
  2923. //
  2924. //
  2925. //
  2926. //
  2927. //
  2928. //
  2929. //
  2930. //
  2931. //
  2932. //
  2933. //
  2934. //
  2935. //
  2936. //
  2937. //
  2938. //
  2939. //
  2940. //
  2941. //
  2942. //
  2943. //
  2944. //
  2945. //
  2946. //
  2947. //
  2948. //
  2949. //
  2950. //
  2951. //
  2952. //
  2953. //
  2954. //
  2955. //
  2956. //
  2957. //
  2958. //
  2959. //
  2960. //
  2961. //
  2962. //
  2963. /* harmony default export */ __webpack_exports__["default"] = ({
  2964. components: {
  2965. WorkOrderInfo: _components_WorkOrderInfo_vue__WEBPACK_IMPORTED_MODULE_0__["default"],
  2966. AssetInfo: _components_AssetInfo_vue__WEBPACK_IMPORTED_MODULE_1__["default"],
  2967. CircleSpinner: _components_CircleSpinner_vue__WEBPACK_IMPORTED_MODULE_2__["default"],
  2968. CredentialList: _components_CredentialList_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  2969. Notes: _components_Notes_vue__WEBPACK_IMPORTED_MODULE_4__["default"]
  2970. },
  2971. props: {
  2972. id: {
  2973. type: String,
  2974. required: true
  2975. }
  2976. },
  2977. data: function data() {
  2978. return {
  2979. workOrder: {},
  2980. asset: {},
  2981. stores: {},
  2982. credentials: {},
  2983. credentialDescriptions: {},
  2984. workOrderNotes: [],
  2985. woLoading: true,
  2986. assetLoading: true,
  2987. storesLoading: true,
  2988. credentialsLoading: true,
  2989. credentialDescriptionsLoading: true,
  2990. workOrderNotesLoading: true,
  2991. authUser: localStorage.getItem('user')
  2992. };
  2993. },
  2994. computed: {
  2995. publicNotes: function publicNotes() {
  2996. var notes = [];
  2997. notes = this.workOrderNotes.filter(function (note) {
  2998. return note.notetype === 0;
  2999. });
  3000. return notes;
  3001. },
  3002. privateNotes: function privateNotes() {
  3003. var notes = [];
  3004. notes = this.workOrderNotes.filter(function (note) {
  3005. return note.notetype === 1;
  3006. });
  3007. return notes;
  3008. }
  3009. },
  3010. mounted: function mounted() {
  3011. var _this = this;
  3012. // Get authentication info from current user from local storage
  3013. var token = localStorage.getItem('jwt');
  3014. var user = localStorage.getItem('user'); // Set some axios config options for Content-Type and Authentication.
  3015. axios.defaults.headers.common['Content-Type'] = 'application/json';
  3016. axios.defaults.headers.common['Authorization'] = 'Bearer ' + token; // Get WorkOrder from API
  3017. axios.get('/api/workorders/' + this.id).then(function (response) {
  3018. _this.workOrder = response.data;
  3019. _this.woLoading = false;
  3020. })["catch"](function (error) {
  3021. console.log(error);
  3022. }); // Get list of stores from API
  3023. axios.get('/api/stores/').then(function (response) {
  3024. _this.stores = response.data;
  3025. _this.storesLoading = false;
  3026. })["catch"](function (error) {
  3027. console.log(error);
  3028. }); // Get Asset from API (will most likely be replaced with list of assets
  3029. // in the future. Current each WO can only have one but that is likely
  3030. // to change)
  3031. axios.get("/api/workorders/".concat(this.id, "/asset")).then(function (response) {
  3032. _this.asset = response.data;
  3033. _this.assetLoading = false; // Get Credentials for this asset. May be relocated to be part of asset
  3034. // Component when WOs can have more than one asset.
  3035. axios.get("/api/assets/".concat(_this.asset.pcid, "/credentials")).then(function (response) {
  3036. _this.credentials = response.data;
  3037. _this.credentialsLoading = false;
  3038. })["catch"](function (error) {
  3039. console.log(error);
  3040. }); // Get default list of Credential Descriptions. May be relocated along with
  3041. // the above.
  3042. axios.get('/api/credentials/descriptions').then(function (response) {
  3043. _this.credentialDescriptions = response.data;
  3044. _this.credentialDescriptionsLoading = false;
  3045. })["catch"](function (error) {
  3046. console.log(error);
  3047. });
  3048. })["catch"](function (error) {
  3049. console.log(error);
  3050. });
  3051. axios.get("/api/workorders/".concat(this.id, "/notes")).then(function (response) {
  3052. _this.workOrderNotes = response.data;
  3053. _this.workOrderNotesLoading = false;
  3054. })["catch"](function (error) {
  3055. console.log(error);
  3056. });
  3057. Echo.channel('work-order.' + this.id).listen('WorkOrderUpdated', function (e) {
  3058. _this.workOrder = e.data;
  3059. });
  3060. Echo.channel('wonotes.' + this.id).listen('WorkOrderNoteAdded', function (e) {
  3061. _this.workOrderNotes.push(e.note);
  3062. }).listen('WorkOrderNoteUpdated', function (e) {
  3063. var index = _this.workOrderNotes.findIndex(function (note) {
  3064. return note.noteid === e.note.noteid;
  3065. }); // Note has to be edited this way, or else Vue cannot
  3066. // see it to recompute the computed values.
  3067. _this.workOrderNotes.splice(index, 1, e.note);
  3068. }).listen('WorkOrderNoteDeleted', function (e) {
  3069. var index = _this.notes.findIndex(function (note) {
  3070. return note.noteid === e.noteid;
  3071. });
  3072. _this.notes.splice(index, 1);
  3073. });
  3074. }
  3075. });
  3076. /***/ }),
  3077. /***/ "./node_modules/base64-js/index.js":
  3078. /*!*****************************************!*\
  3079. !*** ./node_modules/base64-js/index.js ***!
  3080. \*****************************************/
  3081. /*! no static exports found */
  3082. /***/ (function(module, exports, __webpack_require__) {
  3083. "use strict";
  3084. exports.byteLength = byteLength
  3085. exports.toByteArray = toByteArray
  3086. exports.fromByteArray = fromByteArray
  3087. var lookup = []
  3088. var revLookup = []
  3089. var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
  3090. var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
  3091. for (var i = 0, len = code.length; i < len; ++i) {
  3092. lookup[i] = code[i]
  3093. revLookup[code.charCodeAt(i)] = i
  3094. }
  3095. // Support decoding URL-safe base64 strings, as Node.js does.
  3096. // See: https://en.wikipedia.org/wiki/Base64#URL_applications
  3097. revLookup['-'.charCodeAt(0)] = 62
  3098. revLookup['_'.charCodeAt(0)] = 63
  3099. function getLens (b64) {
  3100. var len = b64.length
  3101. if (len % 4 > 0) {
  3102. throw new Error('Invalid string. Length must be a multiple of 4')
  3103. }
  3104. // Trim off extra bytes after placeholder bytes are found
  3105. // See: https://github.com/beatgammit/base64-js/issues/42
  3106. var validLen = b64.indexOf('=')
  3107. if (validLen === -1) validLen = len
  3108. var placeHoldersLen = validLen === len
  3109. ? 0
  3110. : 4 - (validLen % 4)
  3111. return [validLen, placeHoldersLen]
  3112. }
  3113. // base64 is 4/3 + up to two characters of the original data
  3114. function byteLength (b64) {
  3115. var lens = getLens(b64)
  3116. var validLen = lens[0]
  3117. var placeHoldersLen = lens[1]
  3118. return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
  3119. }
  3120. function _byteLength (b64, validLen, placeHoldersLen) {
  3121. return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
  3122. }
  3123. function toByteArray (b64) {
  3124. var tmp
  3125. var lens = getLens(b64)
  3126. var validLen = lens[0]
  3127. var placeHoldersLen = lens[1]
  3128. var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
  3129. var curByte = 0
  3130. // if there are placeholders, only get up to the last complete 4 chars
  3131. var len = placeHoldersLen > 0
  3132. ? validLen - 4
  3133. : validLen
  3134. var i
  3135. for (i = 0; i < len; i += 4) {
  3136. tmp =
  3137. (revLookup[b64.charCodeAt(i)] << 18) |
  3138. (revLookup[b64.charCodeAt(i + 1)] << 12) |
  3139. (revLookup[b64.charCodeAt(i + 2)] << 6) |
  3140. revLookup[b64.charCodeAt(i + 3)]
  3141. arr[curByte++] = (tmp >> 16) & 0xFF
  3142. arr[curByte++] = (tmp >> 8) & 0xFF
  3143. arr[curByte++] = tmp & 0xFF
  3144. }
  3145. if (placeHoldersLen === 2) {
  3146. tmp =
  3147. (revLookup[b64.charCodeAt(i)] << 2) |
  3148. (revLookup[b64.charCodeAt(i + 1)] >> 4)
  3149. arr[curByte++] = tmp & 0xFF
  3150. }
  3151. if (placeHoldersLen === 1) {
  3152. tmp =
  3153. (revLookup[b64.charCodeAt(i)] << 10) |
  3154. (revLookup[b64.charCodeAt(i + 1)] << 4) |
  3155. (revLookup[b64.charCodeAt(i + 2)] >> 2)
  3156. arr[curByte++] = (tmp >> 8) & 0xFF
  3157. arr[curByte++] = tmp & 0xFF
  3158. }
  3159. return arr
  3160. }
  3161. function tripletToBase64 (num) {
  3162. return lookup[num >> 18 & 0x3F] +
  3163. lookup[num >> 12 & 0x3F] +
  3164. lookup[num >> 6 & 0x3F] +
  3165. lookup[num & 0x3F]
  3166. }
  3167. function encodeChunk (uint8, start, end) {
  3168. var tmp
  3169. var output = []
  3170. for (var i = start; i < end; i += 3) {
  3171. tmp =
  3172. ((uint8[i] << 16) & 0xFF0000) +
  3173. ((uint8[i + 1] << 8) & 0xFF00) +
  3174. (uint8[i + 2] & 0xFF)
  3175. output.push(tripletToBase64(tmp))
  3176. }
  3177. return output.join('')
  3178. }
  3179. function fromByteArray (uint8) {
  3180. var tmp
  3181. var len = uint8.length
  3182. var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
  3183. var parts = []
  3184. var maxChunkLength = 16383 // must be multiple of 3
  3185. // go through the array every three bytes, we'll deal with trailing stuff later
  3186. for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
  3187. parts.push(encodeChunk(
  3188. uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)
  3189. ))
  3190. }
  3191. // pad the end with zeros, but make sure to not forget the extra bytes
  3192. if (extraBytes === 1) {
  3193. tmp = uint8[len - 1]
  3194. parts.push(
  3195. lookup[tmp >> 2] +
  3196. lookup[(tmp << 4) & 0x3F] +
  3197. '=='
  3198. )
  3199. } else if (extraBytes === 2) {
  3200. tmp = (uint8[len - 2] << 8) + uint8[len - 1]
  3201. parts.push(
  3202. lookup[tmp >> 10] +
  3203. lookup[(tmp >> 4) & 0x3F] +
  3204. lookup[(tmp << 2) & 0x3F] +
  3205. '='
  3206. )
  3207. }
  3208. return parts.join('')
  3209. }
  3210. /***/ }),
  3211. /***/ "./node_modules/bootstrap/dist/js/bootstrap.js":
  3212. /*!*****************************************************!*\
  3213. !*** ./node_modules/bootstrap/dist/js/bootstrap.js ***!
  3214. \*****************************************************/
  3215. /*! no static exports found */
  3216. /***/ (function(module, exports, __webpack_require__) {
  3217. /*!
  3218. * Bootstrap v4.4.1 (https://getbootstrap.com/)
  3219. * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
  3220. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  3221. */
  3222. (function (global, factory) {
  3223. true ? factory(exports, __webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js"), __webpack_require__(/*! popper.js */ "./node_modules/popper.js/dist/esm/popper.js")) :
  3224. undefined;
  3225. }(this, (function (exports, $, Popper) { 'use strict';
  3226. $ = $ && $.hasOwnProperty('default') ? $['default'] : $;
  3227. Popper = Popper && Popper.hasOwnProperty('default') ? Popper['default'] : Popper;
  3228. function _defineProperties(target, props) {
  3229. for (var i = 0; i < props.length; i++) {
  3230. var descriptor = props[i];
  3231. descriptor.enumerable = descriptor.enumerable || false;
  3232. descriptor.configurable = true;
  3233. if ("value" in descriptor) descriptor.writable = true;
  3234. Object.defineProperty(target, descriptor.key, descriptor);
  3235. }
  3236. }
  3237. function _createClass(Constructor, protoProps, staticProps) {
  3238. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  3239. if (staticProps) _defineProperties(Constructor, staticProps);
  3240. return Constructor;
  3241. }
  3242. function _defineProperty(obj, key, value) {
  3243. if (key in obj) {
  3244. Object.defineProperty(obj, key, {
  3245. value: value,
  3246. enumerable: true,
  3247. configurable: true,
  3248. writable: true
  3249. });
  3250. } else {
  3251. obj[key] = value;
  3252. }
  3253. return obj;
  3254. }
  3255. function ownKeys(object, enumerableOnly) {
  3256. var keys = Object.keys(object);
  3257. if (Object.getOwnPropertySymbols) {
  3258. var symbols = Object.getOwnPropertySymbols(object);
  3259. if (enumerableOnly) symbols = symbols.filter(function (sym) {
  3260. return Object.getOwnPropertyDescriptor(object, sym).enumerable;
  3261. });
  3262. keys.push.apply(keys, symbols);
  3263. }
  3264. return keys;
  3265. }
  3266. function _objectSpread2(target) {
  3267. for (var i = 1; i < arguments.length; i++) {
  3268. var source = arguments[i] != null ? arguments[i] : {};
  3269. if (i % 2) {
  3270. ownKeys(Object(source), true).forEach(function (key) {
  3271. _defineProperty(target, key, source[key]);
  3272. });
  3273. } else if (Object.getOwnPropertyDescriptors) {
  3274. Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
  3275. } else {
  3276. ownKeys(Object(source)).forEach(function (key) {
  3277. Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
  3278. });
  3279. }
  3280. }
  3281. return target;
  3282. }
  3283. function _inheritsLoose(subClass, superClass) {
  3284. subClass.prototype = Object.create(superClass.prototype);
  3285. subClass.prototype.constructor = subClass;
  3286. subClass.__proto__ = superClass;
  3287. }
  3288. /**
  3289. * --------------------------------------------------------------------------
  3290. * Bootstrap (v4.4.1): util.js
  3291. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  3292. * --------------------------------------------------------------------------
  3293. */
  3294. /**
  3295. * ------------------------------------------------------------------------
  3296. * Private TransitionEnd Helpers
  3297. * ------------------------------------------------------------------------
  3298. */
  3299. var TRANSITION_END = 'transitionend';
  3300. var MAX_UID = 1000000;
  3301. var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
  3302. function toType(obj) {
  3303. return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
  3304. }
  3305. function getSpecialTransitionEndEvent() {
  3306. return {
  3307. bindType: TRANSITION_END,
  3308. delegateType: TRANSITION_END,
  3309. handle: function handle(event) {
  3310. if ($(event.target).is(this)) {
  3311. return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params
  3312. }
  3313. return undefined; // eslint-disable-line no-undefined
  3314. }
  3315. };
  3316. }
  3317. function transitionEndEmulator(duration) {
  3318. var _this = this;
  3319. var called = false;
  3320. $(this).one(Util.TRANSITION_END, function () {
  3321. called = true;
  3322. });
  3323. setTimeout(function () {
  3324. if (!called) {
  3325. Util.triggerTransitionEnd(_this);
  3326. }
  3327. }, duration);
  3328. return this;
  3329. }
  3330. function setTransitionEndSupport() {
  3331. $.fn.emulateTransitionEnd = transitionEndEmulator;
  3332. $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();
  3333. }
  3334. /**
  3335. * --------------------------------------------------------------------------
  3336. * Public Util Api
  3337. * --------------------------------------------------------------------------
  3338. */
  3339. var Util = {
  3340. TRANSITION_END: 'bsTransitionEnd',
  3341. getUID: function getUID(prefix) {
  3342. do {
  3343. // eslint-disable-next-line no-bitwise
  3344. prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here
  3345. } while (document.getElementById(prefix));
  3346. return prefix;
  3347. },
  3348. getSelectorFromElement: function getSelectorFromElement(element) {
  3349. var selector = element.getAttribute('data-target');
  3350. if (!selector || selector === '#') {
  3351. var hrefAttr = element.getAttribute('href');
  3352. selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : '';
  3353. }
  3354. try {
  3355. return document.querySelector(selector) ? selector : null;
  3356. } catch (err) {
  3357. return null;
  3358. }
  3359. },
  3360. getTransitionDurationFromElement: function getTransitionDurationFromElement(element) {
  3361. if (!element) {
  3362. return 0;
  3363. } // Get transition-duration of the element
  3364. var transitionDuration = $(element).css('transition-duration');
  3365. var transitionDelay = $(element).css('transition-delay');
  3366. var floatTransitionDuration = parseFloat(transitionDuration);
  3367. var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
  3368. if (!floatTransitionDuration && !floatTransitionDelay) {
  3369. return 0;
  3370. } // If multiple durations are defined, take the first
  3371. transitionDuration = transitionDuration.split(',')[0];
  3372. transitionDelay = transitionDelay.split(',')[0];
  3373. return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
  3374. },
  3375. reflow: function reflow(element) {
  3376. return element.offsetHeight;
  3377. },
  3378. triggerTransitionEnd: function triggerTransitionEnd(element) {
  3379. $(element).trigger(TRANSITION_END);
  3380. },
  3381. // TODO: Remove in v5
  3382. supportsTransitionEnd: function supportsTransitionEnd() {
  3383. return Boolean(TRANSITION_END);
  3384. },
  3385. isElement: function isElement(obj) {
  3386. return (obj[0] || obj).nodeType;
  3387. },
  3388. typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) {
  3389. for (var property in configTypes) {
  3390. if (Object.prototype.hasOwnProperty.call(configTypes, property)) {
  3391. var expectedTypes = configTypes[property];
  3392. var value = config[property];
  3393. var valueType = value && Util.isElement(value) ? 'element' : toType(value);
  3394. if (!new RegExp(expectedTypes).test(valueType)) {
  3395. throw new Error(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\"."));
  3396. }
  3397. }
  3398. }
  3399. },
  3400. findShadowRoot: function findShadowRoot(element) {
  3401. if (!document.documentElement.attachShadow) {
  3402. return null;
  3403. } // Can find the shadow root otherwise it'll return the document
  3404. if (typeof element.getRootNode === 'function') {
  3405. var root = element.getRootNode();
  3406. return root instanceof ShadowRoot ? root : null;
  3407. }
  3408. if (element instanceof ShadowRoot) {
  3409. return element;
  3410. } // when we don't find a shadow root
  3411. if (!element.parentNode) {
  3412. return null;
  3413. }
  3414. return Util.findShadowRoot(element.parentNode);
  3415. },
  3416. jQueryDetection: function jQueryDetection() {
  3417. if (typeof $ === 'undefined') {
  3418. throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.');
  3419. }
  3420. var version = $.fn.jquery.split(' ')[0].split('.');
  3421. var minMajor = 1;
  3422. var ltMajor = 2;
  3423. var minMinor = 9;
  3424. var minPatch = 1;
  3425. var maxMajor = 4;
  3426. if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) {
  3427. throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0');
  3428. }
  3429. }
  3430. };
  3431. Util.jQueryDetection();
  3432. setTransitionEndSupport();
  3433. /**
  3434. * ------------------------------------------------------------------------
  3435. * Constants
  3436. * ------------------------------------------------------------------------
  3437. */
  3438. var NAME = 'alert';
  3439. var VERSION = '4.4.1';
  3440. var DATA_KEY = 'bs.alert';
  3441. var EVENT_KEY = "." + DATA_KEY;
  3442. var DATA_API_KEY = '.data-api';
  3443. var JQUERY_NO_CONFLICT = $.fn[NAME];
  3444. var Selector = {
  3445. DISMISS: '[data-dismiss="alert"]'
  3446. };
  3447. var Event = {
  3448. CLOSE: "close" + EVENT_KEY,
  3449. CLOSED: "closed" + EVENT_KEY,
  3450. CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
  3451. };
  3452. var ClassName = {
  3453. ALERT: 'alert',
  3454. FADE: 'fade',
  3455. SHOW: 'show'
  3456. };
  3457. /**
  3458. * ------------------------------------------------------------------------
  3459. * Class Definition
  3460. * ------------------------------------------------------------------------
  3461. */
  3462. var Alert =
  3463. /*#__PURE__*/
  3464. function () {
  3465. function Alert(element) {
  3466. this._element = element;
  3467. } // Getters
  3468. var _proto = Alert.prototype;
  3469. // Public
  3470. _proto.close = function close(element) {
  3471. var rootElement = this._element;
  3472. if (element) {
  3473. rootElement = this._getRootElement(element);
  3474. }
  3475. var customEvent = this._triggerCloseEvent(rootElement);
  3476. if (customEvent.isDefaultPrevented()) {
  3477. return;
  3478. }
  3479. this._removeElement(rootElement);
  3480. };
  3481. _proto.dispose = function dispose() {
  3482. $.removeData(this._element, DATA_KEY);
  3483. this._element = null;
  3484. } // Private
  3485. ;
  3486. _proto._getRootElement = function _getRootElement(element) {
  3487. var selector = Util.getSelectorFromElement(element);
  3488. var parent = false;
  3489. if (selector) {
  3490. parent = document.querySelector(selector);
  3491. }
  3492. if (!parent) {
  3493. parent = $(element).closest("." + ClassName.ALERT)[0];
  3494. }
  3495. return parent;
  3496. };
  3497. _proto._triggerCloseEvent = function _triggerCloseEvent(element) {
  3498. var closeEvent = $.Event(Event.CLOSE);
  3499. $(element).trigger(closeEvent);
  3500. return closeEvent;
  3501. };
  3502. _proto._removeElement = function _removeElement(element) {
  3503. var _this = this;
  3504. $(element).removeClass(ClassName.SHOW);
  3505. if (!$(element).hasClass(ClassName.FADE)) {
  3506. this._destroyElement(element);
  3507. return;
  3508. }
  3509. var transitionDuration = Util.getTransitionDurationFromElement(element);
  3510. $(element).one(Util.TRANSITION_END, function (event) {
  3511. return _this._destroyElement(element, event);
  3512. }).emulateTransitionEnd(transitionDuration);
  3513. };
  3514. _proto._destroyElement = function _destroyElement(element) {
  3515. $(element).detach().trigger(Event.CLOSED).remove();
  3516. } // Static
  3517. ;
  3518. Alert._jQueryInterface = function _jQueryInterface(config) {
  3519. return this.each(function () {
  3520. var $element = $(this);
  3521. var data = $element.data(DATA_KEY);
  3522. if (!data) {
  3523. data = new Alert(this);
  3524. $element.data(DATA_KEY, data);
  3525. }
  3526. if (config === 'close') {
  3527. data[config](this);
  3528. }
  3529. });
  3530. };
  3531. Alert._handleDismiss = function _handleDismiss(alertInstance) {
  3532. return function (event) {
  3533. if (event) {
  3534. event.preventDefault();
  3535. }
  3536. alertInstance.close(this);
  3537. };
  3538. };
  3539. _createClass(Alert, null, [{
  3540. key: "VERSION",
  3541. get: function get() {
  3542. return VERSION;
  3543. }
  3544. }]);
  3545. return Alert;
  3546. }();
  3547. /**
  3548. * ------------------------------------------------------------------------
  3549. * Data Api implementation
  3550. * ------------------------------------------------------------------------
  3551. */
  3552. $(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert()));
  3553. /**
  3554. * ------------------------------------------------------------------------
  3555. * jQuery
  3556. * ------------------------------------------------------------------------
  3557. */
  3558. $.fn[NAME] = Alert._jQueryInterface;
  3559. $.fn[NAME].Constructor = Alert;
  3560. $.fn[NAME].noConflict = function () {
  3561. $.fn[NAME] = JQUERY_NO_CONFLICT;
  3562. return Alert._jQueryInterface;
  3563. };
  3564. /**
  3565. * ------------------------------------------------------------------------
  3566. * Constants
  3567. * ------------------------------------------------------------------------
  3568. */
  3569. var NAME$1 = 'button';
  3570. var VERSION$1 = '4.4.1';
  3571. var DATA_KEY$1 = 'bs.button';
  3572. var EVENT_KEY$1 = "." + DATA_KEY$1;
  3573. var DATA_API_KEY$1 = '.data-api';
  3574. var JQUERY_NO_CONFLICT$1 = $.fn[NAME$1];
  3575. var ClassName$1 = {
  3576. ACTIVE: 'active',
  3577. BUTTON: 'btn',
  3578. FOCUS: 'focus'
  3579. };
  3580. var Selector$1 = {
  3581. DATA_TOGGLE_CARROT: '[data-toggle^="button"]',
  3582. DATA_TOGGLES: '[data-toggle="buttons"]',
  3583. DATA_TOGGLE: '[data-toggle="button"]',
  3584. DATA_TOGGLES_BUTTONS: '[data-toggle="buttons"] .btn',
  3585. INPUT: 'input:not([type="hidden"])',
  3586. ACTIVE: '.active',
  3587. BUTTON: '.btn'
  3588. };
  3589. var Event$1 = {
  3590. CLICK_DATA_API: "click" + EVENT_KEY$1 + DATA_API_KEY$1,
  3591. FOCUS_BLUR_DATA_API: "focus" + EVENT_KEY$1 + DATA_API_KEY$1 + " " + ("blur" + EVENT_KEY$1 + DATA_API_KEY$1),
  3592. LOAD_DATA_API: "load" + EVENT_KEY$1 + DATA_API_KEY$1
  3593. };
  3594. /**
  3595. * ------------------------------------------------------------------------
  3596. * Class Definition
  3597. * ------------------------------------------------------------------------
  3598. */
  3599. var Button =
  3600. /*#__PURE__*/
  3601. function () {
  3602. function Button(element) {
  3603. this._element = element;
  3604. } // Getters
  3605. var _proto = Button.prototype;
  3606. // Public
  3607. _proto.toggle = function toggle() {
  3608. var triggerChangeEvent = true;
  3609. var addAriaPressed = true;
  3610. var rootElement = $(this._element).closest(Selector$1.DATA_TOGGLES)[0];
  3611. if (rootElement) {
  3612. var input = this._element.querySelector(Selector$1.INPUT);
  3613. if (input) {
  3614. if (input.type === 'radio') {
  3615. if (input.checked && this._element.classList.contains(ClassName$1.ACTIVE)) {
  3616. triggerChangeEvent = false;
  3617. } else {
  3618. var activeElement = rootElement.querySelector(Selector$1.ACTIVE);
  3619. if (activeElement) {
  3620. $(activeElement).removeClass(ClassName$1.ACTIVE);
  3621. }
  3622. }
  3623. } else if (input.type === 'checkbox') {
  3624. if (this._element.tagName === 'LABEL' && input.checked === this._element.classList.contains(ClassName$1.ACTIVE)) {
  3625. triggerChangeEvent = false;
  3626. }
  3627. } else {
  3628. // if it's not a radio button or checkbox don't add a pointless/invalid checked property to the input
  3629. triggerChangeEvent = false;
  3630. }
  3631. if (triggerChangeEvent) {
  3632. input.checked = !this._element.classList.contains(ClassName$1.ACTIVE);
  3633. $(input).trigger('change');
  3634. }
  3635. input.focus();
  3636. addAriaPressed = false;
  3637. }
  3638. }
  3639. if (!(this._element.hasAttribute('disabled') || this._element.classList.contains('disabled'))) {
  3640. if (addAriaPressed) {
  3641. this._element.setAttribute('aria-pressed', !this._element.classList.contains(ClassName$1.ACTIVE));
  3642. }
  3643. if (triggerChangeEvent) {
  3644. $(this._element).toggleClass(ClassName$1.ACTIVE);
  3645. }
  3646. }
  3647. };
  3648. _proto.dispose = function dispose() {
  3649. $.removeData(this._element, DATA_KEY$1);
  3650. this._element = null;
  3651. } // Static
  3652. ;
  3653. Button._jQueryInterface = function _jQueryInterface(config) {
  3654. return this.each(function () {
  3655. var data = $(this).data(DATA_KEY$1);
  3656. if (!data) {
  3657. data = new Button(this);
  3658. $(this).data(DATA_KEY$1, data);
  3659. }
  3660. if (config === 'toggle') {
  3661. data[config]();
  3662. }
  3663. });
  3664. };
  3665. _createClass(Button, null, [{
  3666. key: "VERSION",
  3667. get: function get() {
  3668. return VERSION$1;
  3669. }
  3670. }]);
  3671. return Button;
  3672. }();
  3673. /**
  3674. * ------------------------------------------------------------------------
  3675. * Data Api implementation
  3676. * ------------------------------------------------------------------------
  3677. */
  3678. $(document).on(Event$1.CLICK_DATA_API, Selector$1.DATA_TOGGLE_CARROT, function (event) {
  3679. var button = event.target;
  3680. if (!$(button).hasClass(ClassName$1.BUTTON)) {
  3681. button = $(button).closest(Selector$1.BUTTON)[0];
  3682. }
  3683. if (!button || button.hasAttribute('disabled') || button.classList.contains('disabled')) {
  3684. event.preventDefault(); // work around Firefox bug #1540995
  3685. } else {
  3686. var inputBtn = button.querySelector(Selector$1.INPUT);
  3687. if (inputBtn && (inputBtn.hasAttribute('disabled') || inputBtn.classList.contains('disabled'))) {
  3688. event.preventDefault(); // work around Firefox bug #1540995
  3689. return;
  3690. }
  3691. Button._jQueryInterface.call($(button), 'toggle');
  3692. }
  3693. }).on(Event$1.FOCUS_BLUR_DATA_API, Selector$1.DATA_TOGGLE_CARROT, function (event) {
  3694. var button = $(event.target).closest(Selector$1.BUTTON)[0];
  3695. $(button).toggleClass(ClassName$1.FOCUS, /^focus(in)?$/.test(event.type));
  3696. });
  3697. $(window).on(Event$1.LOAD_DATA_API, function () {
  3698. // ensure correct active class is set to match the controls' actual values/states
  3699. // find all checkboxes/readio buttons inside data-toggle groups
  3700. var buttons = [].slice.call(document.querySelectorAll(Selector$1.DATA_TOGGLES_BUTTONS));
  3701. for (var i = 0, len = buttons.length; i < len; i++) {
  3702. var button = buttons[i];
  3703. var input = button.querySelector(Selector$1.INPUT);
  3704. if (input.checked || input.hasAttribute('checked')) {
  3705. button.classList.add(ClassName$1.ACTIVE);
  3706. } else {
  3707. button.classList.remove(ClassName$1.ACTIVE);
  3708. }
  3709. } // find all button toggles
  3710. buttons = [].slice.call(document.querySelectorAll(Selector$1.DATA_TOGGLE));
  3711. for (var _i = 0, _len = buttons.length; _i < _len; _i++) {
  3712. var _button = buttons[_i];
  3713. if (_button.getAttribute('aria-pressed') === 'true') {
  3714. _button.classList.add(ClassName$1.ACTIVE);
  3715. } else {
  3716. _button.classList.remove(ClassName$1.ACTIVE);
  3717. }
  3718. }
  3719. });
  3720. /**
  3721. * ------------------------------------------------------------------------
  3722. * jQuery
  3723. * ------------------------------------------------------------------------
  3724. */
  3725. $.fn[NAME$1] = Button._jQueryInterface;
  3726. $.fn[NAME$1].Constructor = Button;
  3727. $.fn[NAME$1].noConflict = function () {
  3728. $.fn[NAME$1] = JQUERY_NO_CONFLICT$1;
  3729. return Button._jQueryInterface;
  3730. };
  3731. /**
  3732. * ------------------------------------------------------------------------
  3733. * Constants
  3734. * ------------------------------------------------------------------------
  3735. */
  3736. var NAME$2 = 'carousel';
  3737. var VERSION$2 = '4.4.1';
  3738. var DATA_KEY$2 = 'bs.carousel';
  3739. var EVENT_KEY$2 = "." + DATA_KEY$2;
  3740. var DATA_API_KEY$2 = '.data-api';
  3741. var JQUERY_NO_CONFLICT$2 = $.fn[NAME$2];
  3742. var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key
  3743. var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key
  3744. var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch
  3745. var SWIPE_THRESHOLD = 40;
  3746. var Default = {
  3747. interval: 5000,
  3748. keyboard: true,
  3749. slide: false,
  3750. pause: 'hover',
  3751. wrap: true,
  3752. touch: true
  3753. };
  3754. var DefaultType = {
  3755. interval: '(number|boolean)',
  3756. keyboard: 'boolean',
  3757. slide: '(boolean|string)',
  3758. pause: '(string|boolean)',
  3759. wrap: 'boolean',
  3760. touch: 'boolean'
  3761. };
  3762. var Direction = {
  3763. NEXT: 'next',
  3764. PREV: 'prev',
  3765. LEFT: 'left',
  3766. RIGHT: 'right'
  3767. };
  3768. var Event$2 = {
  3769. SLIDE: "slide" + EVENT_KEY$2,
  3770. SLID: "slid" + EVENT_KEY$2,
  3771. KEYDOWN: "keydown" + EVENT_KEY$2,
  3772. MOUSEENTER: "mouseenter" + EVENT_KEY$2,
  3773. MOUSELEAVE: "mouseleave" + EVENT_KEY$2,
  3774. TOUCHSTART: "touchstart" + EVENT_KEY$2,
  3775. TOUCHMOVE: "touchmove" + EVENT_KEY$2,
  3776. TOUCHEND: "touchend" + EVENT_KEY$2,
  3777. POINTERDOWN: "pointerdown" + EVENT_KEY$2,
  3778. POINTERUP: "pointerup" + EVENT_KEY$2,
  3779. DRAG_START: "dragstart" + EVENT_KEY$2,
  3780. LOAD_DATA_API: "load" + EVENT_KEY$2 + DATA_API_KEY$2,
  3781. CLICK_DATA_API: "click" + EVENT_KEY$2 + DATA_API_KEY$2
  3782. };
  3783. var ClassName$2 = {
  3784. CAROUSEL: 'carousel',
  3785. ACTIVE: 'active',
  3786. SLIDE: 'slide',
  3787. RIGHT: 'carousel-item-right',
  3788. LEFT: 'carousel-item-left',
  3789. NEXT: 'carousel-item-next',
  3790. PREV: 'carousel-item-prev',
  3791. ITEM: 'carousel-item',
  3792. POINTER_EVENT: 'pointer-event'
  3793. };
  3794. var Selector$2 = {
  3795. ACTIVE: '.active',
  3796. ACTIVE_ITEM: '.active.carousel-item',
  3797. ITEM: '.carousel-item',
  3798. ITEM_IMG: '.carousel-item img',
  3799. NEXT_PREV: '.carousel-item-next, .carousel-item-prev',
  3800. INDICATORS: '.carousel-indicators',
  3801. DATA_SLIDE: '[data-slide], [data-slide-to]',
  3802. DATA_RIDE: '[data-ride="carousel"]'
  3803. };
  3804. var PointerType = {
  3805. TOUCH: 'touch',
  3806. PEN: 'pen'
  3807. };
  3808. /**
  3809. * ------------------------------------------------------------------------
  3810. * Class Definition
  3811. * ------------------------------------------------------------------------
  3812. */
  3813. var Carousel =
  3814. /*#__PURE__*/
  3815. function () {
  3816. function Carousel(element, config) {
  3817. this._items = null;
  3818. this._interval = null;
  3819. this._activeElement = null;
  3820. this._isPaused = false;
  3821. this._isSliding = false;
  3822. this.touchTimeout = null;
  3823. this.touchStartX = 0;
  3824. this.touchDeltaX = 0;
  3825. this._config = this._getConfig(config);
  3826. this._element = element;
  3827. this._indicatorsElement = this._element.querySelector(Selector$2.INDICATORS);
  3828. this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0;
  3829. this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent);
  3830. this._addEventListeners();
  3831. } // Getters
  3832. var _proto = Carousel.prototype;
  3833. // Public
  3834. _proto.next = function next() {
  3835. if (!this._isSliding) {
  3836. this._slide(Direction.NEXT);
  3837. }
  3838. };
  3839. _proto.nextWhenVisible = function nextWhenVisible() {
  3840. // Don't call next when the page isn't visible
  3841. // or the carousel or its parent isn't visible
  3842. if (!document.hidden && $(this._element).is(':visible') && $(this._element).css('visibility') !== 'hidden') {
  3843. this.next();
  3844. }
  3845. };
  3846. _proto.prev = function prev() {
  3847. if (!this._isSliding) {
  3848. this._slide(Direction.PREV);
  3849. }
  3850. };
  3851. _proto.pause = function pause(event) {
  3852. if (!event) {
  3853. this._isPaused = true;
  3854. }
  3855. if (this._element.querySelector(Selector$2.NEXT_PREV)) {
  3856. Util.triggerTransitionEnd(this._element);
  3857. this.cycle(true);
  3858. }
  3859. clearInterval(this._interval);
  3860. this._interval = null;
  3861. };
  3862. _proto.cycle = function cycle(event) {
  3863. if (!event) {
  3864. this._isPaused = false;
  3865. }
  3866. if (this._interval) {
  3867. clearInterval(this._interval);
  3868. this._interval = null;
  3869. }
  3870. if (this._config.interval && !this._isPaused) {
  3871. this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval);
  3872. }
  3873. };
  3874. _proto.to = function to(index) {
  3875. var _this = this;
  3876. this._activeElement = this._element.querySelector(Selector$2.ACTIVE_ITEM);
  3877. var activeIndex = this._getItemIndex(this._activeElement);
  3878. if (index > this._items.length - 1 || index < 0) {
  3879. return;
  3880. }
  3881. if (this._isSliding) {
  3882. $(this._element).one(Event$2.SLID, function () {
  3883. return _this.to(index);
  3884. });
  3885. return;
  3886. }
  3887. if (activeIndex === index) {
  3888. this.pause();
  3889. this.cycle();
  3890. return;
  3891. }
  3892. var direction = index > activeIndex ? Direction.NEXT : Direction.PREV;
  3893. this._slide(direction, this._items[index]);
  3894. };
  3895. _proto.dispose = function dispose() {
  3896. $(this._element).off(EVENT_KEY$2);
  3897. $.removeData(this._element, DATA_KEY$2);
  3898. this._items = null;
  3899. this._config = null;
  3900. this._element = null;
  3901. this._interval = null;
  3902. this._isPaused = null;
  3903. this._isSliding = null;
  3904. this._activeElement = null;
  3905. this._indicatorsElement = null;
  3906. } // Private
  3907. ;
  3908. _proto._getConfig = function _getConfig(config) {
  3909. config = _objectSpread2({}, Default, {}, config);
  3910. Util.typeCheckConfig(NAME$2, config, DefaultType);
  3911. return config;
  3912. };
  3913. _proto._handleSwipe = function _handleSwipe() {
  3914. var absDeltax = Math.abs(this.touchDeltaX);
  3915. if (absDeltax <= SWIPE_THRESHOLD) {
  3916. return;
  3917. }
  3918. var direction = absDeltax / this.touchDeltaX;
  3919. this.touchDeltaX = 0; // swipe left
  3920. if (direction > 0) {
  3921. this.prev();
  3922. } // swipe right
  3923. if (direction < 0) {
  3924. this.next();
  3925. }
  3926. };
  3927. _proto._addEventListeners = function _addEventListeners() {
  3928. var _this2 = this;
  3929. if (this._config.keyboard) {
  3930. $(this._element).on(Event$2.KEYDOWN, function (event) {
  3931. return _this2._keydown(event);
  3932. });
  3933. }
  3934. if (this._config.pause === 'hover') {
  3935. $(this._element).on(Event$2.MOUSEENTER, function (event) {
  3936. return _this2.pause(event);
  3937. }).on(Event$2.MOUSELEAVE, function (event) {
  3938. return _this2.cycle(event);
  3939. });
  3940. }
  3941. if (this._config.touch) {
  3942. this._addTouchEventListeners();
  3943. }
  3944. };
  3945. _proto._addTouchEventListeners = function _addTouchEventListeners() {
  3946. var _this3 = this;
  3947. if (!this._touchSupported) {
  3948. return;
  3949. }
  3950. var start = function start(event) {
  3951. if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {
  3952. _this3.touchStartX = event.originalEvent.clientX;
  3953. } else if (!_this3._pointerEvent) {
  3954. _this3.touchStartX = event.originalEvent.touches[0].clientX;
  3955. }
  3956. };
  3957. var move = function move(event) {
  3958. // ensure swiping with one touch and not pinching
  3959. if (event.originalEvent.touches && event.originalEvent.touches.length > 1) {
  3960. _this3.touchDeltaX = 0;
  3961. } else {
  3962. _this3.touchDeltaX = event.originalEvent.touches[0].clientX - _this3.touchStartX;
  3963. }
  3964. };
  3965. var end = function end(event) {
  3966. if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {
  3967. _this3.touchDeltaX = event.originalEvent.clientX - _this3.touchStartX;
  3968. }
  3969. _this3._handleSwipe();
  3970. if (_this3._config.pause === 'hover') {
  3971. // If it's a touch-enabled device, mouseenter/leave are fired as
  3972. // part of the mouse compatibility events on first tap - the carousel
  3973. // would stop cycling until user tapped out of it;
  3974. // here, we listen for touchend, explicitly pause the carousel
  3975. // (as if it's the second time we tap on it, mouseenter compat event
  3976. // is NOT fired) and after a timeout (to allow for mouse compatibility
  3977. // events to fire) we explicitly restart cycling
  3978. _this3.pause();
  3979. if (_this3.touchTimeout) {
  3980. clearTimeout(_this3.touchTimeout);
  3981. }
  3982. _this3.touchTimeout = setTimeout(function (event) {
  3983. return _this3.cycle(event);
  3984. }, TOUCHEVENT_COMPAT_WAIT + _this3._config.interval);
  3985. }
  3986. };
  3987. $(this._element.querySelectorAll(Selector$2.ITEM_IMG)).on(Event$2.DRAG_START, function (e) {
  3988. return e.preventDefault();
  3989. });
  3990. if (this._pointerEvent) {
  3991. $(this._element).on(Event$2.POINTERDOWN, function (event) {
  3992. return start(event);
  3993. });
  3994. $(this._element).on(Event$2.POINTERUP, function (event) {
  3995. return end(event);
  3996. });
  3997. this._element.classList.add(ClassName$2.POINTER_EVENT);
  3998. } else {
  3999. $(this._element).on(Event$2.TOUCHSTART, function (event) {
  4000. return start(event);
  4001. });
  4002. $(this._element).on(Event$2.TOUCHMOVE, function (event) {
  4003. return move(event);
  4004. });
  4005. $(this._element).on(Event$2.TOUCHEND, function (event) {
  4006. return end(event);
  4007. });
  4008. }
  4009. };
  4010. _proto._keydown = function _keydown(event) {
  4011. if (/input|textarea/i.test(event.target.tagName)) {
  4012. return;
  4013. }
  4014. switch (event.which) {
  4015. case ARROW_LEFT_KEYCODE:
  4016. event.preventDefault();
  4017. this.prev();
  4018. break;
  4019. case ARROW_RIGHT_KEYCODE:
  4020. event.preventDefault();
  4021. this.next();
  4022. break;
  4023. }
  4024. };
  4025. _proto._getItemIndex = function _getItemIndex(element) {
  4026. this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(Selector$2.ITEM)) : [];
  4027. return this._items.indexOf(element);
  4028. };
  4029. _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) {
  4030. var isNextDirection = direction === Direction.NEXT;
  4031. var isPrevDirection = direction === Direction.PREV;
  4032. var activeIndex = this._getItemIndex(activeElement);
  4033. var lastItemIndex = this._items.length - 1;
  4034. var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex;
  4035. if (isGoingToWrap && !this._config.wrap) {
  4036. return activeElement;
  4037. }
  4038. var delta = direction === Direction.PREV ? -1 : 1;
  4039. var itemIndex = (activeIndex + delta) % this._items.length;
  4040. return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];
  4041. };
  4042. _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) {
  4043. var targetIndex = this._getItemIndex(relatedTarget);
  4044. var fromIndex = this._getItemIndex(this._element.querySelector(Selector$2.ACTIVE_ITEM));
  4045. var slideEvent = $.Event(Event$2.SLIDE, {
  4046. relatedTarget: relatedTarget,
  4047. direction: eventDirectionName,
  4048. from: fromIndex,
  4049. to: targetIndex
  4050. });
  4051. $(this._element).trigger(slideEvent);
  4052. return slideEvent;
  4053. };
  4054. _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) {
  4055. if (this._indicatorsElement) {
  4056. var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(Selector$2.ACTIVE));
  4057. $(indicators).removeClass(ClassName$2.ACTIVE);
  4058. var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)];
  4059. if (nextIndicator) {
  4060. $(nextIndicator).addClass(ClassName$2.ACTIVE);
  4061. }
  4062. }
  4063. };
  4064. _proto._slide = function _slide(direction, element) {
  4065. var _this4 = this;
  4066. var activeElement = this._element.querySelector(Selector$2.ACTIVE_ITEM);
  4067. var activeElementIndex = this._getItemIndex(activeElement);
  4068. var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement);
  4069. var nextElementIndex = this._getItemIndex(nextElement);
  4070. var isCycling = Boolean(this._interval);
  4071. var directionalClassName;
  4072. var orderClassName;
  4073. var eventDirectionName;
  4074. if (direction === Direction.NEXT) {
  4075. directionalClassName = ClassName$2.LEFT;
  4076. orderClassName = ClassName$2.NEXT;
  4077. eventDirectionName = Direction.LEFT;
  4078. } else {
  4079. directionalClassName = ClassName$2.RIGHT;
  4080. orderClassName = ClassName$2.PREV;
  4081. eventDirectionName = Direction.RIGHT;
  4082. }
  4083. if (nextElement && $(nextElement).hasClass(ClassName$2.ACTIVE)) {
  4084. this._isSliding = false;
  4085. return;
  4086. }
  4087. var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName);
  4088. if (slideEvent.isDefaultPrevented()) {
  4089. return;
  4090. }
  4091. if (!activeElement || !nextElement) {
  4092. // Some weirdness is happening, so we bail
  4093. return;
  4094. }
  4095. this._isSliding = true;
  4096. if (isCycling) {
  4097. this.pause();
  4098. }
  4099. this._setActiveIndicatorElement(nextElement);
  4100. var slidEvent = $.Event(Event$2.SLID, {
  4101. relatedTarget: nextElement,
  4102. direction: eventDirectionName,
  4103. from: activeElementIndex,
  4104. to: nextElementIndex
  4105. });
  4106. if ($(this._element).hasClass(ClassName$2.SLIDE)) {
  4107. $(nextElement).addClass(orderClassName);
  4108. Util.reflow(nextElement);
  4109. $(activeElement).addClass(directionalClassName);
  4110. $(nextElement).addClass(directionalClassName);
  4111. var nextElementInterval = parseInt(nextElement.getAttribute('data-interval'), 10);
  4112. if (nextElementInterval) {
  4113. this._config.defaultInterval = this._config.defaultInterval || this._config.interval;
  4114. this._config.interval = nextElementInterval;
  4115. } else {
  4116. this._config.interval = this._config.defaultInterval || this._config.interval;
  4117. }
  4118. var transitionDuration = Util.getTransitionDurationFromElement(activeElement);
  4119. $(activeElement).one(Util.TRANSITION_END, function () {
  4120. $(nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(ClassName$2.ACTIVE);
  4121. $(activeElement).removeClass(ClassName$2.ACTIVE + " " + orderClassName + " " + directionalClassName);
  4122. _this4._isSliding = false;
  4123. setTimeout(function () {
  4124. return $(_this4._element).trigger(slidEvent);
  4125. }, 0);
  4126. }).emulateTransitionEnd(transitionDuration);
  4127. } else {
  4128. $(activeElement).removeClass(ClassName$2.ACTIVE);
  4129. $(nextElement).addClass(ClassName$2.ACTIVE);
  4130. this._isSliding = false;
  4131. $(this._element).trigger(slidEvent);
  4132. }
  4133. if (isCycling) {
  4134. this.cycle();
  4135. }
  4136. } // Static
  4137. ;
  4138. Carousel._jQueryInterface = function _jQueryInterface(config) {
  4139. return this.each(function () {
  4140. var data = $(this).data(DATA_KEY$2);
  4141. var _config = _objectSpread2({}, Default, {}, $(this).data());
  4142. if (typeof config === 'object') {
  4143. _config = _objectSpread2({}, _config, {}, config);
  4144. }
  4145. var action = typeof config === 'string' ? config : _config.slide;
  4146. if (!data) {
  4147. data = new Carousel(this, _config);
  4148. $(this).data(DATA_KEY$2, data);
  4149. }
  4150. if (typeof config === 'number') {
  4151. data.to(config);
  4152. } else if (typeof action === 'string') {
  4153. if (typeof data[action] === 'undefined') {
  4154. throw new TypeError("No method named \"" + action + "\"");
  4155. }
  4156. data[action]();
  4157. } else if (_config.interval && _config.ride) {
  4158. data.pause();
  4159. data.cycle();
  4160. }
  4161. });
  4162. };
  4163. Carousel._dataApiClickHandler = function _dataApiClickHandler(event) {
  4164. var selector = Util.getSelectorFromElement(this);
  4165. if (!selector) {
  4166. return;
  4167. }
  4168. var target = $(selector)[0];
  4169. if (!target || !$(target).hasClass(ClassName$2.CAROUSEL)) {
  4170. return;
  4171. }
  4172. var config = _objectSpread2({}, $(target).data(), {}, $(this).data());
  4173. var slideIndex = this.getAttribute('data-slide-to');
  4174. if (slideIndex) {
  4175. config.interval = false;
  4176. }
  4177. Carousel._jQueryInterface.call($(target), config);
  4178. if (slideIndex) {
  4179. $(target).data(DATA_KEY$2).to(slideIndex);
  4180. }
  4181. event.preventDefault();
  4182. };
  4183. _createClass(Carousel, null, [{
  4184. key: "VERSION",
  4185. get: function get() {
  4186. return VERSION$2;
  4187. }
  4188. }, {
  4189. key: "Default",
  4190. get: function get() {
  4191. return Default;
  4192. }
  4193. }]);
  4194. return Carousel;
  4195. }();
  4196. /**
  4197. * ------------------------------------------------------------------------
  4198. * Data Api implementation
  4199. * ------------------------------------------------------------------------
  4200. */
  4201. $(document).on(Event$2.CLICK_DATA_API, Selector$2.DATA_SLIDE, Carousel._dataApiClickHandler);
  4202. $(window).on(Event$2.LOAD_DATA_API, function () {
  4203. var carousels = [].slice.call(document.querySelectorAll(Selector$2.DATA_RIDE));
  4204. for (var i = 0, len = carousels.length; i < len; i++) {
  4205. var $carousel = $(carousels[i]);
  4206. Carousel._jQueryInterface.call($carousel, $carousel.data());
  4207. }
  4208. });
  4209. /**
  4210. * ------------------------------------------------------------------------
  4211. * jQuery
  4212. * ------------------------------------------------------------------------
  4213. */
  4214. $.fn[NAME$2] = Carousel._jQueryInterface;
  4215. $.fn[NAME$2].Constructor = Carousel;
  4216. $.fn[NAME$2].noConflict = function () {
  4217. $.fn[NAME$2] = JQUERY_NO_CONFLICT$2;
  4218. return Carousel._jQueryInterface;
  4219. };
  4220. /**
  4221. * ------------------------------------------------------------------------
  4222. * Constants
  4223. * ------------------------------------------------------------------------
  4224. */
  4225. var NAME$3 = 'collapse';
  4226. var VERSION$3 = '4.4.1';
  4227. var DATA_KEY$3 = 'bs.collapse';
  4228. var EVENT_KEY$3 = "." + DATA_KEY$3;
  4229. var DATA_API_KEY$3 = '.data-api';
  4230. var JQUERY_NO_CONFLICT$3 = $.fn[NAME$3];
  4231. var Default$1 = {
  4232. toggle: true,
  4233. parent: ''
  4234. };
  4235. var DefaultType$1 = {
  4236. toggle: 'boolean',
  4237. parent: '(string|element)'
  4238. };
  4239. var Event$3 = {
  4240. SHOW: "show" + EVENT_KEY$3,
  4241. SHOWN: "shown" + EVENT_KEY$3,
  4242. HIDE: "hide" + EVENT_KEY$3,
  4243. HIDDEN: "hidden" + EVENT_KEY$3,
  4244. CLICK_DATA_API: "click" + EVENT_KEY$3 + DATA_API_KEY$3
  4245. };
  4246. var ClassName$3 = {
  4247. SHOW: 'show',
  4248. COLLAPSE: 'collapse',
  4249. COLLAPSING: 'collapsing',
  4250. COLLAPSED: 'collapsed'
  4251. };
  4252. var Dimension = {
  4253. WIDTH: 'width',
  4254. HEIGHT: 'height'
  4255. };
  4256. var Selector$3 = {
  4257. ACTIVES: '.show, .collapsing',
  4258. DATA_TOGGLE: '[data-toggle="collapse"]'
  4259. };
  4260. /**
  4261. * ------------------------------------------------------------------------
  4262. * Class Definition
  4263. * ------------------------------------------------------------------------
  4264. */
  4265. var Collapse =
  4266. /*#__PURE__*/
  4267. function () {
  4268. function Collapse(element, config) {
  4269. this._isTransitioning = false;
  4270. this._element = element;
  4271. this._config = this._getConfig(config);
  4272. this._triggerArray = [].slice.call(document.querySelectorAll("[data-toggle=\"collapse\"][href=\"#" + element.id + "\"]," + ("[data-toggle=\"collapse\"][data-target=\"#" + element.id + "\"]")));
  4273. var toggleList = [].slice.call(document.querySelectorAll(Selector$3.DATA_TOGGLE));
  4274. for (var i = 0, len = toggleList.length; i < len; i++) {
  4275. var elem = toggleList[i];
  4276. var selector = Util.getSelectorFromElement(elem);
  4277. var filterElement = [].slice.call(document.querySelectorAll(selector)).filter(function (foundElem) {
  4278. return foundElem === element;
  4279. });
  4280. if (selector !== null && filterElement.length > 0) {
  4281. this._selector = selector;
  4282. this._triggerArray.push(elem);
  4283. }
  4284. }
  4285. this._parent = this._config.parent ? this._getParent() : null;
  4286. if (!this._config.parent) {
  4287. this._addAriaAndCollapsedClass(this._element, this._triggerArray);
  4288. }
  4289. if (this._config.toggle) {
  4290. this.toggle();
  4291. }
  4292. } // Getters
  4293. var _proto = Collapse.prototype;
  4294. // Public
  4295. _proto.toggle = function toggle() {
  4296. if ($(this._element).hasClass(ClassName$3.SHOW)) {
  4297. this.hide();
  4298. } else {
  4299. this.show();
  4300. }
  4301. };
  4302. _proto.show = function show() {
  4303. var _this = this;
  4304. if (this._isTransitioning || $(this._element).hasClass(ClassName$3.SHOW)) {
  4305. return;
  4306. }
  4307. var actives;
  4308. var activesData;
  4309. if (this._parent) {
  4310. actives = [].slice.call(this._parent.querySelectorAll(Selector$3.ACTIVES)).filter(function (elem) {
  4311. if (typeof _this._config.parent === 'string') {
  4312. return elem.getAttribute('data-parent') === _this._config.parent;
  4313. }
  4314. return elem.classList.contains(ClassName$3.COLLAPSE);
  4315. });
  4316. if (actives.length === 0) {
  4317. actives = null;
  4318. }
  4319. }
  4320. if (actives) {
  4321. activesData = $(actives).not(this._selector).data(DATA_KEY$3);
  4322. if (activesData && activesData._isTransitioning) {
  4323. return;
  4324. }
  4325. }
  4326. var startEvent = $.Event(Event$3.SHOW);
  4327. $(this._element).trigger(startEvent);
  4328. if (startEvent.isDefaultPrevented()) {
  4329. return;
  4330. }
  4331. if (actives) {
  4332. Collapse._jQueryInterface.call($(actives).not(this._selector), 'hide');
  4333. if (!activesData) {
  4334. $(actives).data(DATA_KEY$3, null);
  4335. }
  4336. }
  4337. var dimension = this._getDimension();
  4338. $(this._element).removeClass(ClassName$3.COLLAPSE).addClass(ClassName$3.COLLAPSING);
  4339. this._element.style[dimension] = 0;
  4340. if (this._triggerArray.length) {
  4341. $(this._triggerArray).removeClass(ClassName$3.COLLAPSED).attr('aria-expanded', true);
  4342. }
  4343. this.setTransitioning(true);
  4344. var complete = function complete() {
  4345. $(_this._element).removeClass(ClassName$3.COLLAPSING).addClass(ClassName$3.COLLAPSE).addClass(ClassName$3.SHOW);
  4346. _this._element.style[dimension] = '';
  4347. _this.setTransitioning(false);
  4348. $(_this._element).trigger(Event$3.SHOWN);
  4349. };
  4350. var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
  4351. var scrollSize = "scroll" + capitalizedDimension;
  4352. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  4353. $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  4354. this._element.style[dimension] = this._element[scrollSize] + "px";
  4355. };
  4356. _proto.hide = function hide() {
  4357. var _this2 = this;
  4358. if (this._isTransitioning || !$(this._element).hasClass(ClassName$3.SHOW)) {
  4359. return;
  4360. }
  4361. var startEvent = $.Event(Event$3.HIDE);
  4362. $(this._element).trigger(startEvent);
  4363. if (startEvent.isDefaultPrevented()) {
  4364. return;
  4365. }
  4366. var dimension = this._getDimension();
  4367. this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px";
  4368. Util.reflow(this._element);
  4369. $(this._element).addClass(ClassName$3.COLLAPSING).removeClass(ClassName$3.COLLAPSE).removeClass(ClassName$3.SHOW);
  4370. var triggerArrayLength = this._triggerArray.length;
  4371. if (triggerArrayLength > 0) {
  4372. for (var i = 0; i < triggerArrayLength; i++) {
  4373. var trigger = this._triggerArray[i];
  4374. var selector = Util.getSelectorFromElement(trigger);
  4375. if (selector !== null) {
  4376. var $elem = $([].slice.call(document.querySelectorAll(selector)));
  4377. if (!$elem.hasClass(ClassName$3.SHOW)) {
  4378. $(trigger).addClass(ClassName$3.COLLAPSED).attr('aria-expanded', false);
  4379. }
  4380. }
  4381. }
  4382. }
  4383. this.setTransitioning(true);
  4384. var complete = function complete() {
  4385. _this2.setTransitioning(false);
  4386. $(_this2._element).removeClass(ClassName$3.COLLAPSING).addClass(ClassName$3.COLLAPSE).trigger(Event$3.HIDDEN);
  4387. };
  4388. this._element.style[dimension] = '';
  4389. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  4390. $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  4391. };
  4392. _proto.setTransitioning = function setTransitioning(isTransitioning) {
  4393. this._isTransitioning = isTransitioning;
  4394. };
  4395. _proto.dispose = function dispose() {
  4396. $.removeData(this._element, DATA_KEY$3);
  4397. this._config = null;
  4398. this._parent = null;
  4399. this._element = null;
  4400. this._triggerArray = null;
  4401. this._isTransitioning = null;
  4402. } // Private
  4403. ;
  4404. _proto._getConfig = function _getConfig(config) {
  4405. config = _objectSpread2({}, Default$1, {}, config);
  4406. config.toggle = Boolean(config.toggle); // Coerce string values
  4407. Util.typeCheckConfig(NAME$3, config, DefaultType$1);
  4408. return config;
  4409. };
  4410. _proto._getDimension = function _getDimension() {
  4411. var hasWidth = $(this._element).hasClass(Dimension.WIDTH);
  4412. return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT;
  4413. };
  4414. _proto._getParent = function _getParent() {
  4415. var _this3 = this;
  4416. var parent;
  4417. if (Util.isElement(this._config.parent)) {
  4418. parent = this._config.parent; // It's a jQuery object
  4419. if (typeof this._config.parent.jquery !== 'undefined') {
  4420. parent = this._config.parent[0];
  4421. }
  4422. } else {
  4423. parent = document.querySelector(this._config.parent);
  4424. }
  4425. var selector = "[data-toggle=\"collapse\"][data-parent=\"" + this._config.parent + "\"]";
  4426. var children = [].slice.call(parent.querySelectorAll(selector));
  4427. $(children).each(function (i, element) {
  4428. _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]);
  4429. });
  4430. return parent;
  4431. };
  4432. _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {
  4433. var isOpen = $(element).hasClass(ClassName$3.SHOW);
  4434. if (triggerArray.length) {
  4435. $(triggerArray).toggleClass(ClassName$3.COLLAPSED, !isOpen).attr('aria-expanded', isOpen);
  4436. }
  4437. } // Static
  4438. ;
  4439. Collapse._getTargetFromElement = function _getTargetFromElement(element) {
  4440. var selector = Util.getSelectorFromElement(element);
  4441. return selector ? document.querySelector(selector) : null;
  4442. };
  4443. Collapse._jQueryInterface = function _jQueryInterface(config) {
  4444. return this.each(function () {
  4445. var $this = $(this);
  4446. var data = $this.data(DATA_KEY$3);
  4447. var _config = _objectSpread2({}, Default$1, {}, $this.data(), {}, typeof config === 'object' && config ? config : {});
  4448. if (!data && _config.toggle && /show|hide/.test(config)) {
  4449. _config.toggle = false;
  4450. }
  4451. if (!data) {
  4452. data = new Collapse(this, _config);
  4453. $this.data(DATA_KEY$3, data);
  4454. }
  4455. if (typeof config === 'string') {
  4456. if (typeof data[config] === 'undefined') {
  4457. throw new TypeError("No method named \"" + config + "\"");
  4458. }
  4459. data[config]();
  4460. }
  4461. });
  4462. };
  4463. _createClass(Collapse, null, [{
  4464. key: "VERSION",
  4465. get: function get() {
  4466. return VERSION$3;
  4467. }
  4468. }, {
  4469. key: "Default",
  4470. get: function get() {
  4471. return Default$1;
  4472. }
  4473. }]);
  4474. return Collapse;
  4475. }();
  4476. /**
  4477. * ------------------------------------------------------------------------
  4478. * Data Api implementation
  4479. * ------------------------------------------------------------------------
  4480. */
  4481. $(document).on(Event$3.CLICK_DATA_API, Selector$3.DATA_TOGGLE, function (event) {
  4482. // preventDefault only for <a> elements (which change the URL) not inside the collapsible element
  4483. if (event.currentTarget.tagName === 'A') {
  4484. event.preventDefault();
  4485. }
  4486. var $trigger = $(this);
  4487. var selector = Util.getSelectorFromElement(this);
  4488. var selectors = [].slice.call(document.querySelectorAll(selector));
  4489. $(selectors).each(function () {
  4490. var $target = $(this);
  4491. var data = $target.data(DATA_KEY$3);
  4492. var config = data ? 'toggle' : $trigger.data();
  4493. Collapse._jQueryInterface.call($target, config);
  4494. });
  4495. });
  4496. /**
  4497. * ------------------------------------------------------------------------
  4498. * jQuery
  4499. * ------------------------------------------------------------------------
  4500. */
  4501. $.fn[NAME$3] = Collapse._jQueryInterface;
  4502. $.fn[NAME$3].Constructor = Collapse;
  4503. $.fn[NAME$3].noConflict = function () {
  4504. $.fn[NAME$3] = JQUERY_NO_CONFLICT$3;
  4505. return Collapse._jQueryInterface;
  4506. };
  4507. /**
  4508. * ------------------------------------------------------------------------
  4509. * Constants
  4510. * ------------------------------------------------------------------------
  4511. */
  4512. var NAME$4 = 'dropdown';
  4513. var VERSION$4 = '4.4.1';
  4514. var DATA_KEY$4 = 'bs.dropdown';
  4515. var EVENT_KEY$4 = "." + DATA_KEY$4;
  4516. var DATA_API_KEY$4 = '.data-api';
  4517. var JQUERY_NO_CONFLICT$4 = $.fn[NAME$4];
  4518. var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
  4519. var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key
  4520. var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key
  4521. var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key
  4522. var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key
  4523. var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse)
  4524. var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + "|" + ARROW_DOWN_KEYCODE + "|" + ESCAPE_KEYCODE);
  4525. var Event$4 = {
  4526. HIDE: "hide" + EVENT_KEY$4,
  4527. HIDDEN: "hidden" + EVENT_KEY$4,
  4528. SHOW: "show" + EVENT_KEY$4,
  4529. SHOWN: "shown" + EVENT_KEY$4,
  4530. CLICK: "click" + EVENT_KEY$4,
  4531. CLICK_DATA_API: "click" + EVENT_KEY$4 + DATA_API_KEY$4,
  4532. KEYDOWN_DATA_API: "keydown" + EVENT_KEY$4 + DATA_API_KEY$4,
  4533. KEYUP_DATA_API: "keyup" + EVENT_KEY$4 + DATA_API_KEY$4
  4534. };
  4535. var ClassName$4 = {
  4536. DISABLED: 'disabled',
  4537. SHOW: 'show',
  4538. DROPUP: 'dropup',
  4539. DROPRIGHT: 'dropright',
  4540. DROPLEFT: 'dropleft',
  4541. MENURIGHT: 'dropdown-menu-right',
  4542. MENULEFT: 'dropdown-menu-left',
  4543. POSITION_STATIC: 'position-static'
  4544. };
  4545. var Selector$4 = {
  4546. DATA_TOGGLE: '[data-toggle="dropdown"]',
  4547. FORM_CHILD: '.dropdown form',
  4548. MENU: '.dropdown-menu',
  4549. NAVBAR_NAV: '.navbar-nav',
  4550. VISIBLE_ITEMS: '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'
  4551. };
  4552. var AttachmentMap = {
  4553. TOP: 'top-start',
  4554. TOPEND: 'top-end',
  4555. BOTTOM: 'bottom-start',
  4556. BOTTOMEND: 'bottom-end',
  4557. RIGHT: 'right-start',
  4558. RIGHTEND: 'right-end',
  4559. LEFT: 'left-start',
  4560. LEFTEND: 'left-end'
  4561. };
  4562. var Default$2 = {
  4563. offset: 0,
  4564. flip: true,
  4565. boundary: 'scrollParent',
  4566. reference: 'toggle',
  4567. display: 'dynamic',
  4568. popperConfig: null
  4569. };
  4570. var DefaultType$2 = {
  4571. offset: '(number|string|function)',
  4572. flip: 'boolean',
  4573. boundary: '(string|element)',
  4574. reference: '(string|element)',
  4575. display: 'string',
  4576. popperConfig: '(null|object)'
  4577. };
  4578. /**
  4579. * ------------------------------------------------------------------------
  4580. * Class Definition
  4581. * ------------------------------------------------------------------------
  4582. */
  4583. var Dropdown =
  4584. /*#__PURE__*/
  4585. function () {
  4586. function Dropdown(element, config) {
  4587. this._element = element;
  4588. this._popper = null;
  4589. this._config = this._getConfig(config);
  4590. this._menu = this._getMenuElement();
  4591. this._inNavbar = this._detectNavbar();
  4592. this._addEventListeners();
  4593. } // Getters
  4594. var _proto = Dropdown.prototype;
  4595. // Public
  4596. _proto.toggle = function toggle() {
  4597. if (this._element.disabled || $(this._element).hasClass(ClassName$4.DISABLED)) {
  4598. return;
  4599. }
  4600. var isActive = $(this._menu).hasClass(ClassName$4.SHOW);
  4601. Dropdown._clearMenus();
  4602. if (isActive) {
  4603. return;
  4604. }
  4605. this.show(true);
  4606. };
  4607. _proto.show = function show(usePopper) {
  4608. if (usePopper === void 0) {
  4609. usePopper = false;
  4610. }
  4611. if (this._element.disabled || $(this._element).hasClass(ClassName$4.DISABLED) || $(this._menu).hasClass(ClassName$4.SHOW)) {
  4612. return;
  4613. }
  4614. var relatedTarget = {
  4615. relatedTarget: this._element
  4616. };
  4617. var showEvent = $.Event(Event$4.SHOW, relatedTarget);
  4618. var parent = Dropdown._getParentFromElement(this._element);
  4619. $(parent).trigger(showEvent);
  4620. if (showEvent.isDefaultPrevented()) {
  4621. return;
  4622. } // Disable totally Popper.js for Dropdown in Navbar
  4623. if (!this._inNavbar && usePopper) {
  4624. /**
  4625. * Check for Popper dependency
  4626. * Popper - https://popper.js.org
  4627. */
  4628. if (typeof Popper === 'undefined') {
  4629. throw new TypeError('Bootstrap\'s dropdowns require Popper.js (https://popper.js.org/)');
  4630. }
  4631. var referenceElement = this._element;
  4632. if (this._config.reference === 'parent') {
  4633. referenceElement = parent;
  4634. } else if (Util.isElement(this._config.reference)) {
  4635. referenceElement = this._config.reference; // Check if it's jQuery element
  4636. if (typeof this._config.reference.jquery !== 'undefined') {
  4637. referenceElement = this._config.reference[0];
  4638. }
  4639. } // If boundary is not `scrollParent`, then set position to `static`
  4640. // to allow the menu to "escape" the scroll parent's boundaries
  4641. // https://github.com/twbs/bootstrap/issues/24251
  4642. if (this._config.boundary !== 'scrollParent') {
  4643. $(parent).addClass(ClassName$4.POSITION_STATIC);
  4644. }
  4645. this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig());
  4646. } // If this is a touch-enabled device we add extra
  4647. // empty mouseover listeners to the body's immediate children;
  4648. // only needed because of broken event delegation on iOS
  4649. // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
  4650. if ('ontouchstart' in document.documentElement && $(parent).closest(Selector$4.NAVBAR_NAV).length === 0) {
  4651. $(document.body).children().on('mouseover', null, $.noop);
  4652. }
  4653. this._element.focus();
  4654. this._element.setAttribute('aria-expanded', true);
  4655. $(this._menu).toggleClass(ClassName$4.SHOW);
  4656. $(parent).toggleClass(ClassName$4.SHOW).trigger($.Event(Event$4.SHOWN, relatedTarget));
  4657. };
  4658. _proto.hide = function hide() {
  4659. if (this._element.disabled || $(this._element).hasClass(ClassName$4.DISABLED) || !$(this._menu).hasClass(ClassName$4.SHOW)) {
  4660. return;
  4661. }
  4662. var relatedTarget = {
  4663. relatedTarget: this._element
  4664. };
  4665. var hideEvent = $.Event(Event$4.HIDE, relatedTarget);
  4666. var parent = Dropdown._getParentFromElement(this._element);
  4667. $(parent).trigger(hideEvent);
  4668. if (hideEvent.isDefaultPrevented()) {
  4669. return;
  4670. }
  4671. if (this._popper) {
  4672. this._popper.destroy();
  4673. }
  4674. $(this._menu).toggleClass(ClassName$4.SHOW);
  4675. $(parent).toggleClass(ClassName$4.SHOW).trigger($.Event(Event$4.HIDDEN, relatedTarget));
  4676. };
  4677. _proto.dispose = function dispose() {
  4678. $.removeData(this._element, DATA_KEY$4);
  4679. $(this._element).off(EVENT_KEY$4);
  4680. this._element = null;
  4681. this._menu = null;
  4682. if (this._popper !== null) {
  4683. this._popper.destroy();
  4684. this._popper = null;
  4685. }
  4686. };
  4687. _proto.update = function update() {
  4688. this._inNavbar = this._detectNavbar();
  4689. if (this._popper !== null) {
  4690. this._popper.scheduleUpdate();
  4691. }
  4692. } // Private
  4693. ;
  4694. _proto._addEventListeners = function _addEventListeners() {
  4695. var _this = this;
  4696. $(this._element).on(Event$4.CLICK, function (event) {
  4697. event.preventDefault();
  4698. event.stopPropagation();
  4699. _this.toggle();
  4700. });
  4701. };
  4702. _proto._getConfig = function _getConfig(config) {
  4703. config = _objectSpread2({}, this.constructor.Default, {}, $(this._element).data(), {}, config);
  4704. Util.typeCheckConfig(NAME$4, config, this.constructor.DefaultType);
  4705. return config;
  4706. };
  4707. _proto._getMenuElement = function _getMenuElement() {
  4708. if (!this._menu) {
  4709. var parent = Dropdown._getParentFromElement(this._element);
  4710. if (parent) {
  4711. this._menu = parent.querySelector(Selector$4.MENU);
  4712. }
  4713. }
  4714. return this._menu;
  4715. };
  4716. _proto._getPlacement = function _getPlacement() {
  4717. var $parentDropdown = $(this._element.parentNode);
  4718. var placement = AttachmentMap.BOTTOM; // Handle dropup
  4719. if ($parentDropdown.hasClass(ClassName$4.DROPUP)) {
  4720. placement = AttachmentMap.TOP;
  4721. if ($(this._menu).hasClass(ClassName$4.MENURIGHT)) {
  4722. placement = AttachmentMap.TOPEND;
  4723. }
  4724. } else if ($parentDropdown.hasClass(ClassName$4.DROPRIGHT)) {
  4725. placement = AttachmentMap.RIGHT;
  4726. } else if ($parentDropdown.hasClass(ClassName$4.DROPLEFT)) {
  4727. placement = AttachmentMap.LEFT;
  4728. } else if ($(this._menu).hasClass(ClassName$4.MENURIGHT)) {
  4729. placement = AttachmentMap.BOTTOMEND;
  4730. }
  4731. return placement;
  4732. };
  4733. _proto._detectNavbar = function _detectNavbar() {
  4734. return $(this._element).closest('.navbar').length > 0;
  4735. };
  4736. _proto._getOffset = function _getOffset() {
  4737. var _this2 = this;
  4738. var offset = {};
  4739. if (typeof this._config.offset === 'function') {
  4740. offset.fn = function (data) {
  4741. data.offsets = _objectSpread2({}, data.offsets, {}, _this2._config.offset(data.offsets, _this2._element) || {});
  4742. return data;
  4743. };
  4744. } else {
  4745. offset.offset = this._config.offset;
  4746. }
  4747. return offset;
  4748. };
  4749. _proto._getPopperConfig = function _getPopperConfig() {
  4750. var popperConfig = {
  4751. placement: this._getPlacement(),
  4752. modifiers: {
  4753. offset: this._getOffset(),
  4754. flip: {
  4755. enabled: this._config.flip
  4756. },
  4757. preventOverflow: {
  4758. boundariesElement: this._config.boundary
  4759. }
  4760. }
  4761. }; // Disable Popper.js if we have a static display
  4762. if (this._config.display === 'static') {
  4763. popperConfig.modifiers.applyStyle = {
  4764. enabled: false
  4765. };
  4766. }
  4767. return _objectSpread2({}, popperConfig, {}, this._config.popperConfig);
  4768. } // Static
  4769. ;
  4770. Dropdown._jQueryInterface = function _jQueryInterface(config) {
  4771. return this.each(function () {
  4772. var data = $(this).data(DATA_KEY$4);
  4773. var _config = typeof config === 'object' ? config : null;
  4774. if (!data) {
  4775. data = new Dropdown(this, _config);
  4776. $(this).data(DATA_KEY$4, data);
  4777. }
  4778. if (typeof config === 'string') {
  4779. if (typeof data[config] === 'undefined') {
  4780. throw new TypeError("No method named \"" + config + "\"");
  4781. }
  4782. data[config]();
  4783. }
  4784. });
  4785. };
  4786. Dropdown._clearMenus = function _clearMenus(event) {
  4787. if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) {
  4788. return;
  4789. }
  4790. var toggles = [].slice.call(document.querySelectorAll(Selector$4.DATA_TOGGLE));
  4791. for (var i = 0, len = toggles.length; i < len; i++) {
  4792. var parent = Dropdown._getParentFromElement(toggles[i]);
  4793. var context = $(toggles[i]).data(DATA_KEY$4);
  4794. var relatedTarget = {
  4795. relatedTarget: toggles[i]
  4796. };
  4797. if (event && event.type === 'click') {
  4798. relatedTarget.clickEvent = event;
  4799. }
  4800. if (!context) {
  4801. continue;
  4802. }
  4803. var dropdownMenu = context._menu;
  4804. if (!$(parent).hasClass(ClassName$4.SHOW)) {
  4805. continue;
  4806. }
  4807. if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $.contains(parent, event.target)) {
  4808. continue;
  4809. }
  4810. var hideEvent = $.Event(Event$4.HIDE, relatedTarget);
  4811. $(parent).trigger(hideEvent);
  4812. if (hideEvent.isDefaultPrevented()) {
  4813. continue;
  4814. } // If this is a touch-enabled device we remove the extra
  4815. // empty mouseover listeners we added for iOS support
  4816. if ('ontouchstart' in document.documentElement) {
  4817. $(document.body).children().off('mouseover', null, $.noop);
  4818. }
  4819. toggles[i].setAttribute('aria-expanded', 'false');
  4820. if (context._popper) {
  4821. context._popper.destroy();
  4822. }
  4823. $(dropdownMenu).removeClass(ClassName$4.SHOW);
  4824. $(parent).removeClass(ClassName$4.SHOW).trigger($.Event(Event$4.HIDDEN, relatedTarget));
  4825. }
  4826. };
  4827. Dropdown._getParentFromElement = function _getParentFromElement(element) {
  4828. var parent;
  4829. var selector = Util.getSelectorFromElement(element);
  4830. if (selector) {
  4831. parent = document.querySelector(selector);
  4832. }
  4833. return parent || element.parentNode;
  4834. } // eslint-disable-next-line complexity
  4835. ;
  4836. Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) {
  4837. // If not input/textarea:
  4838. // - And not a key in REGEXP_KEYDOWN => not a dropdown command
  4839. // If input/textarea:
  4840. // - If space key => not a dropdown command
  4841. // - If key is other than escape
  4842. // - If key is not up or down => not a dropdown command
  4843. // - If trigger inside the menu => not a dropdown command
  4844. if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || $(event.target).closest(Selector$4.MENU).length) : !REGEXP_KEYDOWN.test(event.which)) {
  4845. return;
  4846. }
  4847. event.preventDefault();
  4848. event.stopPropagation();
  4849. if (this.disabled || $(this).hasClass(ClassName$4.DISABLED)) {
  4850. return;
  4851. }
  4852. var parent = Dropdown._getParentFromElement(this);
  4853. var isActive = $(parent).hasClass(ClassName$4.SHOW);
  4854. if (!isActive && event.which === ESCAPE_KEYCODE) {
  4855. return;
  4856. }
  4857. if (!isActive || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {
  4858. if (event.which === ESCAPE_KEYCODE) {
  4859. var toggle = parent.querySelector(Selector$4.DATA_TOGGLE);
  4860. $(toggle).trigger('focus');
  4861. }
  4862. $(this).trigger('click');
  4863. return;
  4864. }
  4865. var items = [].slice.call(parent.querySelectorAll(Selector$4.VISIBLE_ITEMS)).filter(function (item) {
  4866. return $(item).is(':visible');
  4867. });
  4868. if (items.length === 0) {
  4869. return;
  4870. }
  4871. var index = items.indexOf(event.target);
  4872. if (event.which === ARROW_UP_KEYCODE && index > 0) {
  4873. // Up
  4874. index--;
  4875. }
  4876. if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) {
  4877. // Down
  4878. index++;
  4879. }
  4880. if (index < 0) {
  4881. index = 0;
  4882. }
  4883. items[index].focus();
  4884. };
  4885. _createClass(Dropdown, null, [{
  4886. key: "VERSION",
  4887. get: function get() {
  4888. return VERSION$4;
  4889. }
  4890. }, {
  4891. key: "Default",
  4892. get: function get() {
  4893. return Default$2;
  4894. }
  4895. }, {
  4896. key: "DefaultType",
  4897. get: function get() {
  4898. return DefaultType$2;
  4899. }
  4900. }]);
  4901. return Dropdown;
  4902. }();
  4903. /**
  4904. * ------------------------------------------------------------------------
  4905. * Data Api implementation
  4906. * ------------------------------------------------------------------------
  4907. */
  4908. $(document).on(Event$4.KEYDOWN_DATA_API, Selector$4.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event$4.KEYDOWN_DATA_API, Selector$4.MENU, Dropdown._dataApiKeydownHandler).on(Event$4.CLICK_DATA_API + " " + Event$4.KEYUP_DATA_API, Dropdown._clearMenus).on(Event$4.CLICK_DATA_API, Selector$4.DATA_TOGGLE, function (event) {
  4909. event.preventDefault();
  4910. event.stopPropagation();
  4911. Dropdown._jQueryInterface.call($(this), 'toggle');
  4912. }).on(Event$4.CLICK_DATA_API, Selector$4.FORM_CHILD, function (e) {
  4913. e.stopPropagation();
  4914. });
  4915. /**
  4916. * ------------------------------------------------------------------------
  4917. * jQuery
  4918. * ------------------------------------------------------------------------
  4919. */
  4920. $.fn[NAME$4] = Dropdown._jQueryInterface;
  4921. $.fn[NAME$4].Constructor = Dropdown;
  4922. $.fn[NAME$4].noConflict = function () {
  4923. $.fn[NAME$4] = JQUERY_NO_CONFLICT$4;
  4924. return Dropdown._jQueryInterface;
  4925. };
  4926. /**
  4927. * ------------------------------------------------------------------------
  4928. * Constants
  4929. * ------------------------------------------------------------------------
  4930. */
  4931. var NAME$5 = 'modal';
  4932. var VERSION$5 = '4.4.1';
  4933. var DATA_KEY$5 = 'bs.modal';
  4934. var EVENT_KEY$5 = "." + DATA_KEY$5;
  4935. var DATA_API_KEY$5 = '.data-api';
  4936. var JQUERY_NO_CONFLICT$5 = $.fn[NAME$5];
  4937. var ESCAPE_KEYCODE$1 = 27; // KeyboardEvent.which value for Escape (Esc) key
  4938. var Default$3 = {
  4939. backdrop: true,
  4940. keyboard: true,
  4941. focus: true,
  4942. show: true
  4943. };
  4944. var DefaultType$3 = {
  4945. backdrop: '(boolean|string)',
  4946. keyboard: 'boolean',
  4947. focus: 'boolean',
  4948. show: 'boolean'
  4949. };
  4950. var Event$5 = {
  4951. HIDE: "hide" + EVENT_KEY$5,
  4952. HIDE_PREVENTED: "hidePrevented" + EVENT_KEY$5,
  4953. HIDDEN: "hidden" + EVENT_KEY$5,
  4954. SHOW: "show" + EVENT_KEY$5,
  4955. SHOWN: "shown" + EVENT_KEY$5,
  4956. FOCUSIN: "focusin" + EVENT_KEY$5,
  4957. RESIZE: "resize" + EVENT_KEY$5,
  4958. CLICK_DISMISS: "click.dismiss" + EVENT_KEY$5,
  4959. KEYDOWN_DISMISS: "keydown.dismiss" + EVENT_KEY$5,
  4960. MOUSEUP_DISMISS: "mouseup.dismiss" + EVENT_KEY$5,
  4961. MOUSEDOWN_DISMISS: "mousedown.dismiss" + EVENT_KEY$5,
  4962. CLICK_DATA_API: "click" + EVENT_KEY$5 + DATA_API_KEY$5
  4963. };
  4964. var ClassName$5 = {
  4965. SCROLLABLE: 'modal-dialog-scrollable',
  4966. SCROLLBAR_MEASURER: 'modal-scrollbar-measure',
  4967. BACKDROP: 'modal-backdrop',
  4968. OPEN: 'modal-open',
  4969. FADE: 'fade',
  4970. SHOW: 'show',
  4971. STATIC: 'modal-static'
  4972. };
  4973. var Selector$5 = {
  4974. DIALOG: '.modal-dialog',
  4975. MODAL_BODY: '.modal-body',
  4976. DATA_TOGGLE: '[data-toggle="modal"]',
  4977. DATA_DISMISS: '[data-dismiss="modal"]',
  4978. FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top',
  4979. STICKY_CONTENT: '.sticky-top'
  4980. };
  4981. /**
  4982. * ------------------------------------------------------------------------
  4983. * Class Definition
  4984. * ------------------------------------------------------------------------
  4985. */
  4986. var Modal =
  4987. /*#__PURE__*/
  4988. function () {
  4989. function Modal(element, config) {
  4990. this._config = this._getConfig(config);
  4991. this._element = element;
  4992. this._dialog = element.querySelector(Selector$5.DIALOG);
  4993. this._backdrop = null;
  4994. this._isShown = false;
  4995. this._isBodyOverflowing = false;
  4996. this._ignoreBackdropClick = false;
  4997. this._isTransitioning = false;
  4998. this._scrollbarWidth = 0;
  4999. } // Getters
  5000. var _proto = Modal.prototype;
  5001. // Public
  5002. _proto.toggle = function toggle(relatedTarget) {
  5003. return this._isShown ? this.hide() : this.show(relatedTarget);
  5004. };
  5005. _proto.show = function show(relatedTarget) {
  5006. var _this = this;
  5007. if (this._isShown || this._isTransitioning) {
  5008. return;
  5009. }
  5010. if ($(this._element).hasClass(ClassName$5.FADE)) {
  5011. this._isTransitioning = true;
  5012. }
  5013. var showEvent = $.Event(Event$5.SHOW, {
  5014. relatedTarget: relatedTarget
  5015. });
  5016. $(this._element).trigger(showEvent);
  5017. if (this._isShown || showEvent.isDefaultPrevented()) {
  5018. return;
  5019. }
  5020. this._isShown = true;
  5021. this._checkScrollbar();
  5022. this._setScrollbar();
  5023. this._adjustDialog();
  5024. this._setEscapeEvent();
  5025. this._setResizeEvent();
  5026. $(this._element).on(Event$5.CLICK_DISMISS, Selector$5.DATA_DISMISS, function (event) {
  5027. return _this.hide(event);
  5028. });
  5029. $(this._dialog).on(Event$5.MOUSEDOWN_DISMISS, function () {
  5030. $(_this._element).one(Event$5.MOUSEUP_DISMISS, function (event) {
  5031. if ($(event.target).is(_this._element)) {
  5032. _this._ignoreBackdropClick = true;
  5033. }
  5034. });
  5035. });
  5036. this._showBackdrop(function () {
  5037. return _this._showElement(relatedTarget);
  5038. });
  5039. };
  5040. _proto.hide = function hide(event) {
  5041. var _this2 = this;
  5042. if (event) {
  5043. event.preventDefault();
  5044. }
  5045. if (!this._isShown || this._isTransitioning) {
  5046. return;
  5047. }
  5048. var hideEvent = $.Event(Event$5.HIDE);
  5049. $(this._element).trigger(hideEvent);
  5050. if (!this._isShown || hideEvent.isDefaultPrevented()) {
  5051. return;
  5052. }
  5053. this._isShown = false;
  5054. var transition = $(this._element).hasClass(ClassName$5.FADE);
  5055. if (transition) {
  5056. this._isTransitioning = true;
  5057. }
  5058. this._setEscapeEvent();
  5059. this._setResizeEvent();
  5060. $(document).off(Event$5.FOCUSIN);
  5061. $(this._element).removeClass(ClassName$5.SHOW);
  5062. $(this._element).off(Event$5.CLICK_DISMISS);
  5063. $(this._dialog).off(Event$5.MOUSEDOWN_DISMISS);
  5064. if (transition) {
  5065. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  5066. $(this._element).one(Util.TRANSITION_END, function (event) {
  5067. return _this2._hideModal(event);
  5068. }).emulateTransitionEnd(transitionDuration);
  5069. } else {
  5070. this._hideModal();
  5071. }
  5072. };
  5073. _proto.dispose = function dispose() {
  5074. [window, this._element, this._dialog].forEach(function (htmlElement) {
  5075. return $(htmlElement).off(EVENT_KEY$5);
  5076. });
  5077. /**
  5078. * `document` has 2 events `Event.FOCUSIN` and `Event.CLICK_DATA_API`
  5079. * Do not move `document` in `htmlElements` array
  5080. * It will remove `Event.CLICK_DATA_API` event that should remain
  5081. */
  5082. $(document).off(Event$5.FOCUSIN);
  5083. $.removeData(this._element, DATA_KEY$5);
  5084. this._config = null;
  5085. this._element = null;
  5086. this._dialog = null;
  5087. this._backdrop = null;
  5088. this._isShown = null;
  5089. this._isBodyOverflowing = null;
  5090. this._ignoreBackdropClick = null;
  5091. this._isTransitioning = null;
  5092. this._scrollbarWidth = null;
  5093. };
  5094. _proto.handleUpdate = function handleUpdate() {
  5095. this._adjustDialog();
  5096. } // Private
  5097. ;
  5098. _proto._getConfig = function _getConfig(config) {
  5099. config = _objectSpread2({}, Default$3, {}, config);
  5100. Util.typeCheckConfig(NAME$5, config, DefaultType$3);
  5101. return config;
  5102. };
  5103. _proto._triggerBackdropTransition = function _triggerBackdropTransition() {
  5104. var _this3 = this;
  5105. if (this._config.backdrop === 'static') {
  5106. var hideEventPrevented = $.Event(Event$5.HIDE_PREVENTED);
  5107. $(this._element).trigger(hideEventPrevented);
  5108. if (hideEventPrevented.defaultPrevented) {
  5109. return;
  5110. }
  5111. this._element.classList.add(ClassName$5.STATIC);
  5112. var modalTransitionDuration = Util.getTransitionDurationFromElement(this._element);
  5113. $(this._element).one(Util.TRANSITION_END, function () {
  5114. _this3._element.classList.remove(ClassName$5.STATIC);
  5115. }).emulateTransitionEnd(modalTransitionDuration);
  5116. this._element.focus();
  5117. } else {
  5118. this.hide();
  5119. }
  5120. };
  5121. _proto._showElement = function _showElement(relatedTarget) {
  5122. var _this4 = this;
  5123. var transition = $(this._element).hasClass(ClassName$5.FADE);
  5124. var modalBody = this._dialog ? this._dialog.querySelector(Selector$5.MODAL_BODY) : null;
  5125. if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
  5126. // Don't move modal's DOM position
  5127. document.body.appendChild(this._element);
  5128. }
  5129. this._element.style.display = 'block';
  5130. this._element.removeAttribute('aria-hidden');
  5131. this._element.setAttribute('aria-modal', true);
  5132. if ($(this._dialog).hasClass(ClassName$5.SCROLLABLE) && modalBody) {
  5133. modalBody.scrollTop = 0;
  5134. } else {
  5135. this._element.scrollTop = 0;
  5136. }
  5137. if (transition) {
  5138. Util.reflow(this._element);
  5139. }
  5140. $(this._element).addClass(ClassName$5.SHOW);
  5141. if (this._config.focus) {
  5142. this._enforceFocus();
  5143. }
  5144. var shownEvent = $.Event(Event$5.SHOWN, {
  5145. relatedTarget: relatedTarget
  5146. });
  5147. var transitionComplete = function transitionComplete() {
  5148. if (_this4._config.focus) {
  5149. _this4._element.focus();
  5150. }
  5151. _this4._isTransitioning = false;
  5152. $(_this4._element).trigger(shownEvent);
  5153. };
  5154. if (transition) {
  5155. var transitionDuration = Util.getTransitionDurationFromElement(this._dialog);
  5156. $(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration);
  5157. } else {
  5158. transitionComplete();
  5159. }
  5160. };
  5161. _proto._enforceFocus = function _enforceFocus() {
  5162. var _this5 = this;
  5163. $(document).off(Event$5.FOCUSIN) // Guard against infinite focus loop
  5164. .on(Event$5.FOCUSIN, function (event) {
  5165. if (document !== event.target && _this5._element !== event.target && $(_this5._element).has(event.target).length === 0) {
  5166. _this5._element.focus();
  5167. }
  5168. });
  5169. };
  5170. _proto._setEscapeEvent = function _setEscapeEvent() {
  5171. var _this6 = this;
  5172. if (this._isShown && this._config.keyboard) {
  5173. $(this._element).on(Event$5.KEYDOWN_DISMISS, function (event) {
  5174. if (event.which === ESCAPE_KEYCODE$1) {
  5175. _this6._triggerBackdropTransition();
  5176. }
  5177. });
  5178. } else if (!this._isShown) {
  5179. $(this._element).off(Event$5.KEYDOWN_DISMISS);
  5180. }
  5181. };
  5182. _proto._setResizeEvent = function _setResizeEvent() {
  5183. var _this7 = this;
  5184. if (this._isShown) {
  5185. $(window).on(Event$5.RESIZE, function (event) {
  5186. return _this7.handleUpdate(event);
  5187. });
  5188. } else {
  5189. $(window).off(Event$5.RESIZE);
  5190. }
  5191. };
  5192. _proto._hideModal = function _hideModal() {
  5193. var _this8 = this;
  5194. this._element.style.display = 'none';
  5195. this._element.setAttribute('aria-hidden', true);
  5196. this._element.removeAttribute('aria-modal');
  5197. this._isTransitioning = false;
  5198. this._showBackdrop(function () {
  5199. $(document.body).removeClass(ClassName$5.OPEN);
  5200. _this8._resetAdjustments();
  5201. _this8._resetScrollbar();
  5202. $(_this8._element).trigger(Event$5.HIDDEN);
  5203. });
  5204. };
  5205. _proto._removeBackdrop = function _removeBackdrop() {
  5206. if (this._backdrop) {
  5207. $(this._backdrop).remove();
  5208. this._backdrop = null;
  5209. }
  5210. };
  5211. _proto._showBackdrop = function _showBackdrop(callback) {
  5212. var _this9 = this;
  5213. var animate = $(this._element).hasClass(ClassName$5.FADE) ? ClassName$5.FADE : '';
  5214. if (this._isShown && this._config.backdrop) {
  5215. this._backdrop = document.createElement('div');
  5216. this._backdrop.className = ClassName$5.BACKDROP;
  5217. if (animate) {
  5218. this._backdrop.classList.add(animate);
  5219. }
  5220. $(this._backdrop).appendTo(document.body);
  5221. $(this._element).on(Event$5.CLICK_DISMISS, function (event) {
  5222. if (_this9._ignoreBackdropClick) {
  5223. _this9._ignoreBackdropClick = false;
  5224. return;
  5225. }
  5226. if (event.target !== event.currentTarget) {
  5227. return;
  5228. }
  5229. _this9._triggerBackdropTransition();
  5230. });
  5231. if (animate) {
  5232. Util.reflow(this._backdrop);
  5233. }
  5234. $(this._backdrop).addClass(ClassName$5.SHOW);
  5235. if (!callback) {
  5236. return;
  5237. }
  5238. if (!animate) {
  5239. callback();
  5240. return;
  5241. }
  5242. var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
  5243. $(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration);
  5244. } else if (!this._isShown && this._backdrop) {
  5245. $(this._backdrop).removeClass(ClassName$5.SHOW);
  5246. var callbackRemove = function callbackRemove() {
  5247. _this9._removeBackdrop();
  5248. if (callback) {
  5249. callback();
  5250. }
  5251. };
  5252. if ($(this._element).hasClass(ClassName$5.FADE)) {
  5253. var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
  5254. $(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration);
  5255. } else {
  5256. callbackRemove();
  5257. }
  5258. } else if (callback) {
  5259. callback();
  5260. }
  5261. } // ----------------------------------------------------------------------
  5262. // the following methods are used to handle overflowing modals
  5263. // todo (fat): these should probably be refactored out of modal.js
  5264. // ----------------------------------------------------------------------
  5265. ;
  5266. _proto._adjustDialog = function _adjustDialog() {
  5267. var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
  5268. if (!this._isBodyOverflowing && isModalOverflowing) {
  5269. this._element.style.paddingLeft = this._scrollbarWidth + "px";
  5270. }
  5271. if (this._isBodyOverflowing && !isModalOverflowing) {
  5272. this._element.style.paddingRight = this._scrollbarWidth + "px";
  5273. }
  5274. };
  5275. _proto._resetAdjustments = function _resetAdjustments() {
  5276. this._element.style.paddingLeft = '';
  5277. this._element.style.paddingRight = '';
  5278. };
  5279. _proto._checkScrollbar = function _checkScrollbar() {
  5280. var rect = document.body.getBoundingClientRect();
  5281. this._isBodyOverflowing = rect.left + rect.right < window.innerWidth;
  5282. this._scrollbarWidth = this._getScrollbarWidth();
  5283. };
  5284. _proto._setScrollbar = function _setScrollbar() {
  5285. var _this10 = this;
  5286. if (this._isBodyOverflowing) {
  5287. // Note: DOMNode.style.paddingRight returns the actual value or '' if not set
  5288. // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set
  5289. var fixedContent = [].slice.call(document.querySelectorAll(Selector$5.FIXED_CONTENT));
  5290. var stickyContent = [].slice.call(document.querySelectorAll(Selector$5.STICKY_CONTENT)); // Adjust fixed content padding
  5291. $(fixedContent).each(function (index, element) {
  5292. var actualPadding = element.style.paddingRight;
  5293. var calculatedPadding = $(element).css('padding-right');
  5294. $(element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this10._scrollbarWidth + "px");
  5295. }); // Adjust sticky content margin
  5296. $(stickyContent).each(function (index, element) {
  5297. var actualMargin = element.style.marginRight;
  5298. var calculatedMargin = $(element).css('margin-right');
  5299. $(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this10._scrollbarWidth + "px");
  5300. }); // Adjust body padding
  5301. var actualPadding = document.body.style.paddingRight;
  5302. var calculatedPadding = $(document.body).css('padding-right');
  5303. $(document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + "px");
  5304. }
  5305. $(document.body).addClass(ClassName$5.OPEN);
  5306. };
  5307. _proto._resetScrollbar = function _resetScrollbar() {
  5308. // Restore fixed content padding
  5309. var fixedContent = [].slice.call(document.querySelectorAll(Selector$5.FIXED_CONTENT));
  5310. $(fixedContent).each(function (index, element) {
  5311. var padding = $(element).data('padding-right');
  5312. $(element).removeData('padding-right');
  5313. element.style.paddingRight = padding ? padding : '';
  5314. }); // Restore sticky content
  5315. var elements = [].slice.call(document.querySelectorAll("" + Selector$5.STICKY_CONTENT));
  5316. $(elements).each(function (index, element) {
  5317. var margin = $(element).data('margin-right');
  5318. if (typeof margin !== 'undefined') {
  5319. $(element).css('margin-right', margin).removeData('margin-right');
  5320. }
  5321. }); // Restore body padding
  5322. var padding = $(document.body).data('padding-right');
  5323. $(document.body).removeData('padding-right');
  5324. document.body.style.paddingRight = padding ? padding : '';
  5325. };
  5326. _proto._getScrollbarWidth = function _getScrollbarWidth() {
  5327. // thx d.walsh
  5328. var scrollDiv = document.createElement('div');
  5329. scrollDiv.className = ClassName$5.SCROLLBAR_MEASURER;
  5330. document.body.appendChild(scrollDiv);
  5331. var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth;
  5332. document.body.removeChild(scrollDiv);
  5333. return scrollbarWidth;
  5334. } // Static
  5335. ;
  5336. Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) {
  5337. return this.each(function () {
  5338. var data = $(this).data(DATA_KEY$5);
  5339. var _config = _objectSpread2({}, Default$3, {}, $(this).data(), {}, typeof config === 'object' && config ? config : {});
  5340. if (!data) {
  5341. data = new Modal(this, _config);
  5342. $(this).data(DATA_KEY$5, data);
  5343. }
  5344. if (typeof config === 'string') {
  5345. if (typeof data[config] === 'undefined') {
  5346. throw new TypeError("No method named \"" + config + "\"");
  5347. }
  5348. data[config](relatedTarget);
  5349. } else if (_config.show) {
  5350. data.show(relatedTarget);
  5351. }
  5352. });
  5353. };
  5354. _createClass(Modal, null, [{
  5355. key: "VERSION",
  5356. get: function get() {
  5357. return VERSION$5;
  5358. }
  5359. }, {
  5360. key: "Default",
  5361. get: function get() {
  5362. return Default$3;
  5363. }
  5364. }]);
  5365. return Modal;
  5366. }();
  5367. /**
  5368. * ------------------------------------------------------------------------
  5369. * Data Api implementation
  5370. * ------------------------------------------------------------------------
  5371. */
  5372. $(document).on(Event$5.CLICK_DATA_API, Selector$5.DATA_TOGGLE, function (event) {
  5373. var _this11 = this;
  5374. var target;
  5375. var selector = Util.getSelectorFromElement(this);
  5376. if (selector) {
  5377. target = document.querySelector(selector);
  5378. }
  5379. var config = $(target).data(DATA_KEY$5) ? 'toggle' : _objectSpread2({}, $(target).data(), {}, $(this).data());
  5380. if (this.tagName === 'A' || this.tagName === 'AREA') {
  5381. event.preventDefault();
  5382. }
  5383. var $target = $(target).one(Event$5.SHOW, function (showEvent) {
  5384. if (showEvent.isDefaultPrevented()) {
  5385. // Only register focus restorer if modal will actually get shown
  5386. return;
  5387. }
  5388. $target.one(Event$5.HIDDEN, function () {
  5389. if ($(_this11).is(':visible')) {
  5390. _this11.focus();
  5391. }
  5392. });
  5393. });
  5394. Modal._jQueryInterface.call($(target), config, this);
  5395. });
  5396. /**
  5397. * ------------------------------------------------------------------------
  5398. * jQuery
  5399. * ------------------------------------------------------------------------
  5400. */
  5401. $.fn[NAME$5] = Modal._jQueryInterface;
  5402. $.fn[NAME$5].Constructor = Modal;
  5403. $.fn[NAME$5].noConflict = function () {
  5404. $.fn[NAME$5] = JQUERY_NO_CONFLICT$5;
  5405. return Modal._jQueryInterface;
  5406. };
  5407. /**
  5408. * --------------------------------------------------------------------------
  5409. * Bootstrap (v4.4.1): tools/sanitizer.js
  5410. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  5411. * --------------------------------------------------------------------------
  5412. */
  5413. var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href'];
  5414. var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
  5415. var DefaultWhitelist = {
  5416. // Global attributes allowed on any supplied element below.
  5417. '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
  5418. a: ['target', 'href', 'title', 'rel'],
  5419. area: [],
  5420. b: [],
  5421. br: [],
  5422. col: [],
  5423. code: [],
  5424. div: [],
  5425. em: [],
  5426. hr: [],
  5427. h1: [],
  5428. h2: [],
  5429. h3: [],
  5430. h4: [],
  5431. h5: [],
  5432. h6: [],
  5433. i: [],
  5434. img: ['src', 'alt', 'title', 'width', 'height'],
  5435. li: [],
  5436. ol: [],
  5437. p: [],
  5438. pre: [],
  5439. s: [],
  5440. small: [],
  5441. span: [],
  5442. sub: [],
  5443. sup: [],
  5444. strong: [],
  5445. u: [],
  5446. ul: []
  5447. };
  5448. /**
  5449. * A pattern that recognizes a commonly useful subset of URLs that are safe.
  5450. *
  5451. * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
  5452. */
  5453. var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi;
  5454. /**
  5455. * A pattern that matches safe data URLs. Only matches image, video and audio types.
  5456. *
  5457. * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
  5458. */
  5459. var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;
  5460. function allowedAttribute(attr, allowedAttributeList) {
  5461. var attrName = attr.nodeName.toLowerCase();
  5462. if (allowedAttributeList.indexOf(attrName) !== -1) {
  5463. if (uriAttrs.indexOf(attrName) !== -1) {
  5464. return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN));
  5465. }
  5466. return true;
  5467. }
  5468. var regExp = allowedAttributeList.filter(function (attrRegex) {
  5469. return attrRegex instanceof RegExp;
  5470. }); // Check if a regular expression validates the attribute.
  5471. for (var i = 0, l = regExp.length; i < l; i++) {
  5472. if (attrName.match(regExp[i])) {
  5473. return true;
  5474. }
  5475. }
  5476. return false;
  5477. }
  5478. function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
  5479. if (unsafeHtml.length === 0) {
  5480. return unsafeHtml;
  5481. }
  5482. if (sanitizeFn && typeof sanitizeFn === 'function') {
  5483. return sanitizeFn(unsafeHtml);
  5484. }
  5485. var domParser = new window.DOMParser();
  5486. var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
  5487. var whitelistKeys = Object.keys(whiteList);
  5488. var elements = [].slice.call(createdDocument.body.querySelectorAll('*'));
  5489. var _loop = function _loop(i, len) {
  5490. var el = elements[i];
  5491. var elName = el.nodeName.toLowerCase();
  5492. if (whitelistKeys.indexOf(el.nodeName.toLowerCase()) === -1) {
  5493. el.parentNode.removeChild(el);
  5494. return "continue";
  5495. }
  5496. var attributeList = [].slice.call(el.attributes);
  5497. var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []);
  5498. attributeList.forEach(function (attr) {
  5499. if (!allowedAttribute(attr, whitelistedAttributes)) {
  5500. el.removeAttribute(attr.nodeName);
  5501. }
  5502. });
  5503. };
  5504. for (var i = 0, len = elements.length; i < len; i++) {
  5505. var _ret = _loop(i);
  5506. if (_ret === "continue") continue;
  5507. }
  5508. return createdDocument.body.innerHTML;
  5509. }
  5510. /**
  5511. * ------------------------------------------------------------------------
  5512. * Constants
  5513. * ------------------------------------------------------------------------
  5514. */
  5515. var NAME$6 = 'tooltip';
  5516. var VERSION$6 = '4.4.1';
  5517. var DATA_KEY$6 = 'bs.tooltip';
  5518. var EVENT_KEY$6 = "." + DATA_KEY$6;
  5519. var JQUERY_NO_CONFLICT$6 = $.fn[NAME$6];
  5520. var CLASS_PREFIX = 'bs-tooltip';
  5521. var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
  5522. var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn'];
  5523. var DefaultType$4 = {
  5524. animation: 'boolean',
  5525. template: 'string',
  5526. title: '(string|element|function)',
  5527. trigger: 'string',
  5528. delay: '(number|object)',
  5529. html: 'boolean',
  5530. selector: '(string|boolean)',
  5531. placement: '(string|function)',
  5532. offset: '(number|string|function)',
  5533. container: '(string|element|boolean)',
  5534. fallbackPlacement: '(string|array)',
  5535. boundary: '(string|element)',
  5536. sanitize: 'boolean',
  5537. sanitizeFn: '(null|function)',
  5538. whiteList: 'object',
  5539. popperConfig: '(null|object)'
  5540. };
  5541. var AttachmentMap$1 = {
  5542. AUTO: 'auto',
  5543. TOP: 'top',
  5544. RIGHT: 'right',
  5545. BOTTOM: 'bottom',
  5546. LEFT: 'left'
  5547. };
  5548. var Default$4 = {
  5549. animation: true,
  5550. template: '<div class="tooltip" role="tooltip">' + '<div class="arrow"></div>' + '<div class="tooltip-inner"></div></div>',
  5551. trigger: 'hover focus',
  5552. title: '',
  5553. delay: 0,
  5554. html: false,
  5555. selector: false,
  5556. placement: 'top',
  5557. offset: 0,
  5558. container: false,
  5559. fallbackPlacement: 'flip',
  5560. boundary: 'scrollParent',
  5561. sanitize: true,
  5562. sanitizeFn: null,
  5563. whiteList: DefaultWhitelist,
  5564. popperConfig: null
  5565. };
  5566. var HoverState = {
  5567. SHOW: 'show',
  5568. OUT: 'out'
  5569. };
  5570. var Event$6 = {
  5571. HIDE: "hide" + EVENT_KEY$6,
  5572. HIDDEN: "hidden" + EVENT_KEY$6,
  5573. SHOW: "show" + EVENT_KEY$6,
  5574. SHOWN: "shown" + EVENT_KEY$6,
  5575. INSERTED: "inserted" + EVENT_KEY$6,
  5576. CLICK: "click" + EVENT_KEY$6,
  5577. FOCUSIN: "focusin" + EVENT_KEY$6,
  5578. FOCUSOUT: "focusout" + EVENT_KEY$6,
  5579. MOUSEENTER: "mouseenter" + EVENT_KEY$6,
  5580. MOUSELEAVE: "mouseleave" + EVENT_KEY$6
  5581. };
  5582. var ClassName$6 = {
  5583. FADE: 'fade',
  5584. SHOW: 'show'
  5585. };
  5586. var Selector$6 = {
  5587. TOOLTIP: '.tooltip',
  5588. TOOLTIP_INNER: '.tooltip-inner',
  5589. ARROW: '.arrow'
  5590. };
  5591. var Trigger = {
  5592. HOVER: 'hover',
  5593. FOCUS: 'focus',
  5594. CLICK: 'click',
  5595. MANUAL: 'manual'
  5596. };
  5597. /**
  5598. * ------------------------------------------------------------------------
  5599. * Class Definition
  5600. * ------------------------------------------------------------------------
  5601. */
  5602. var Tooltip =
  5603. /*#__PURE__*/
  5604. function () {
  5605. function Tooltip(element, config) {
  5606. if (typeof Popper === 'undefined') {
  5607. throw new TypeError('Bootstrap\'s tooltips require Popper.js (https://popper.js.org/)');
  5608. } // private
  5609. this._isEnabled = true;
  5610. this._timeout = 0;
  5611. this._hoverState = '';
  5612. this._activeTrigger = {};
  5613. this._popper = null; // Protected
  5614. this.element = element;
  5615. this.config = this._getConfig(config);
  5616. this.tip = null;
  5617. this._setListeners();
  5618. } // Getters
  5619. var _proto = Tooltip.prototype;
  5620. // Public
  5621. _proto.enable = function enable() {
  5622. this._isEnabled = true;
  5623. };
  5624. _proto.disable = function disable() {
  5625. this._isEnabled = false;
  5626. };
  5627. _proto.toggleEnabled = function toggleEnabled() {
  5628. this._isEnabled = !this._isEnabled;
  5629. };
  5630. _proto.toggle = function toggle(event) {
  5631. if (!this._isEnabled) {
  5632. return;
  5633. }
  5634. if (event) {
  5635. var dataKey = this.constructor.DATA_KEY;
  5636. var context = $(event.currentTarget).data(dataKey);
  5637. if (!context) {
  5638. context = new this.constructor(event.currentTarget, this._getDelegateConfig());
  5639. $(event.currentTarget).data(dataKey, context);
  5640. }
  5641. context._activeTrigger.click = !context._activeTrigger.click;
  5642. if (context._isWithActiveTrigger()) {
  5643. context._enter(null, context);
  5644. } else {
  5645. context._leave(null, context);
  5646. }
  5647. } else {
  5648. if ($(this.getTipElement()).hasClass(ClassName$6.SHOW)) {
  5649. this._leave(null, this);
  5650. return;
  5651. }
  5652. this._enter(null, this);
  5653. }
  5654. };
  5655. _proto.dispose = function dispose() {
  5656. clearTimeout(this._timeout);
  5657. $.removeData(this.element, this.constructor.DATA_KEY);
  5658. $(this.element).off(this.constructor.EVENT_KEY);
  5659. $(this.element).closest('.modal').off('hide.bs.modal', this._hideModalHandler);
  5660. if (this.tip) {
  5661. $(this.tip).remove();
  5662. }
  5663. this._isEnabled = null;
  5664. this._timeout = null;
  5665. this._hoverState = null;
  5666. this._activeTrigger = null;
  5667. if (this._popper) {
  5668. this._popper.destroy();
  5669. }
  5670. this._popper = null;
  5671. this.element = null;
  5672. this.config = null;
  5673. this.tip = null;
  5674. };
  5675. _proto.show = function show() {
  5676. var _this = this;
  5677. if ($(this.element).css('display') === 'none') {
  5678. throw new Error('Please use show on visible elements');
  5679. }
  5680. var showEvent = $.Event(this.constructor.Event.SHOW);
  5681. if (this.isWithContent() && this._isEnabled) {
  5682. $(this.element).trigger(showEvent);
  5683. var shadowRoot = Util.findShadowRoot(this.element);
  5684. var isInTheDom = $.contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element);
  5685. if (showEvent.isDefaultPrevented() || !isInTheDom) {
  5686. return;
  5687. }
  5688. var tip = this.getTipElement();
  5689. var tipId = Util.getUID(this.constructor.NAME);
  5690. tip.setAttribute('id', tipId);
  5691. this.element.setAttribute('aria-describedby', tipId);
  5692. this.setContent();
  5693. if (this.config.animation) {
  5694. $(tip).addClass(ClassName$6.FADE);
  5695. }
  5696. var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
  5697. var attachment = this._getAttachment(placement);
  5698. this.addAttachmentClass(attachment);
  5699. var container = this._getContainer();
  5700. $(tip).data(this.constructor.DATA_KEY, this);
  5701. if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) {
  5702. $(tip).appendTo(container);
  5703. }
  5704. $(this.element).trigger(this.constructor.Event.INSERTED);
  5705. this._popper = new Popper(this.element, tip, this._getPopperConfig(attachment));
  5706. $(tip).addClass(ClassName$6.SHOW); // If this is a touch-enabled device we add extra
  5707. // empty mouseover listeners to the body's immediate children;
  5708. // only needed because of broken event delegation on iOS
  5709. // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
  5710. if ('ontouchstart' in document.documentElement) {
  5711. $(document.body).children().on('mouseover', null, $.noop);
  5712. }
  5713. var complete = function complete() {
  5714. if (_this.config.animation) {
  5715. _this._fixTransition();
  5716. }
  5717. var prevHoverState = _this._hoverState;
  5718. _this._hoverState = null;
  5719. $(_this.element).trigger(_this.constructor.Event.SHOWN);
  5720. if (prevHoverState === HoverState.OUT) {
  5721. _this._leave(null, _this);
  5722. }
  5723. };
  5724. if ($(this.tip).hasClass(ClassName$6.FADE)) {
  5725. var transitionDuration = Util.getTransitionDurationFromElement(this.tip);
  5726. $(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  5727. } else {
  5728. complete();
  5729. }
  5730. }
  5731. };
  5732. _proto.hide = function hide(callback) {
  5733. var _this2 = this;
  5734. var tip = this.getTipElement();
  5735. var hideEvent = $.Event(this.constructor.Event.HIDE);
  5736. var complete = function complete() {
  5737. if (_this2._hoverState !== HoverState.SHOW && tip.parentNode) {
  5738. tip.parentNode.removeChild(tip);
  5739. }
  5740. _this2._cleanTipClass();
  5741. _this2.element.removeAttribute('aria-describedby');
  5742. $(_this2.element).trigger(_this2.constructor.Event.HIDDEN);
  5743. if (_this2._popper !== null) {
  5744. _this2._popper.destroy();
  5745. }
  5746. if (callback) {
  5747. callback();
  5748. }
  5749. };
  5750. $(this.element).trigger(hideEvent);
  5751. if (hideEvent.isDefaultPrevented()) {
  5752. return;
  5753. }
  5754. $(tip).removeClass(ClassName$6.SHOW); // If this is a touch-enabled device we remove the extra
  5755. // empty mouseover listeners we added for iOS support
  5756. if ('ontouchstart' in document.documentElement) {
  5757. $(document.body).children().off('mouseover', null, $.noop);
  5758. }
  5759. this._activeTrigger[Trigger.CLICK] = false;
  5760. this._activeTrigger[Trigger.FOCUS] = false;
  5761. this._activeTrigger[Trigger.HOVER] = false;
  5762. if ($(this.tip).hasClass(ClassName$6.FADE)) {
  5763. var transitionDuration = Util.getTransitionDurationFromElement(tip);
  5764. $(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  5765. } else {
  5766. complete();
  5767. }
  5768. this._hoverState = '';
  5769. };
  5770. _proto.update = function update() {
  5771. if (this._popper !== null) {
  5772. this._popper.scheduleUpdate();
  5773. }
  5774. } // Protected
  5775. ;
  5776. _proto.isWithContent = function isWithContent() {
  5777. return Boolean(this.getTitle());
  5778. };
  5779. _proto.addAttachmentClass = function addAttachmentClass(attachment) {
  5780. $(this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
  5781. };
  5782. _proto.getTipElement = function getTipElement() {
  5783. this.tip = this.tip || $(this.config.template)[0];
  5784. return this.tip;
  5785. };
  5786. _proto.setContent = function setContent() {
  5787. var tip = this.getTipElement();
  5788. this.setElementContent($(tip.querySelectorAll(Selector$6.TOOLTIP_INNER)), this.getTitle());
  5789. $(tip).removeClass(ClassName$6.FADE + " " + ClassName$6.SHOW);
  5790. };
  5791. _proto.setElementContent = function setElementContent($element, content) {
  5792. if (typeof content === 'object' && (content.nodeType || content.jquery)) {
  5793. // Content is a DOM node or a jQuery
  5794. if (this.config.html) {
  5795. if (!$(content).parent().is($element)) {
  5796. $element.empty().append(content);
  5797. }
  5798. } else {
  5799. $element.text($(content).text());
  5800. }
  5801. return;
  5802. }
  5803. if (this.config.html) {
  5804. if (this.config.sanitize) {
  5805. content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn);
  5806. }
  5807. $element.html(content);
  5808. } else {
  5809. $element.text(content);
  5810. }
  5811. };
  5812. _proto.getTitle = function getTitle() {
  5813. var title = this.element.getAttribute('data-original-title');
  5814. if (!title) {
  5815. title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;
  5816. }
  5817. return title;
  5818. } // Private
  5819. ;
  5820. _proto._getPopperConfig = function _getPopperConfig(attachment) {
  5821. var _this3 = this;
  5822. var defaultBsConfig = {
  5823. placement: attachment,
  5824. modifiers: {
  5825. offset: this._getOffset(),
  5826. flip: {
  5827. behavior: this.config.fallbackPlacement
  5828. },
  5829. arrow: {
  5830. element: Selector$6.ARROW
  5831. },
  5832. preventOverflow: {
  5833. boundariesElement: this.config.boundary
  5834. }
  5835. },
  5836. onCreate: function onCreate(data) {
  5837. if (data.originalPlacement !== data.placement) {
  5838. _this3._handlePopperPlacementChange(data);
  5839. }
  5840. },
  5841. onUpdate: function onUpdate(data) {
  5842. return _this3._handlePopperPlacementChange(data);
  5843. }
  5844. };
  5845. return _objectSpread2({}, defaultBsConfig, {}, this.config.popperConfig);
  5846. };
  5847. _proto._getOffset = function _getOffset() {
  5848. var _this4 = this;
  5849. var offset = {};
  5850. if (typeof this.config.offset === 'function') {
  5851. offset.fn = function (data) {
  5852. data.offsets = _objectSpread2({}, data.offsets, {}, _this4.config.offset(data.offsets, _this4.element) || {});
  5853. return data;
  5854. };
  5855. } else {
  5856. offset.offset = this.config.offset;
  5857. }
  5858. return offset;
  5859. };
  5860. _proto._getContainer = function _getContainer() {
  5861. if (this.config.container === false) {
  5862. return document.body;
  5863. }
  5864. if (Util.isElement(this.config.container)) {
  5865. return $(this.config.container);
  5866. }
  5867. return $(document).find(this.config.container);
  5868. };
  5869. _proto._getAttachment = function _getAttachment(placement) {
  5870. return AttachmentMap$1[placement.toUpperCase()];
  5871. };
  5872. _proto._setListeners = function _setListeners() {
  5873. var _this5 = this;
  5874. var triggers = this.config.trigger.split(' ');
  5875. triggers.forEach(function (trigger) {
  5876. if (trigger === 'click') {
  5877. $(_this5.element).on(_this5.constructor.Event.CLICK, _this5.config.selector, function (event) {
  5878. return _this5.toggle(event);
  5879. });
  5880. } else if (trigger !== Trigger.MANUAL) {
  5881. var eventIn = trigger === Trigger.HOVER ? _this5.constructor.Event.MOUSEENTER : _this5.constructor.Event.FOCUSIN;
  5882. var eventOut = trigger === Trigger.HOVER ? _this5.constructor.Event.MOUSELEAVE : _this5.constructor.Event.FOCUSOUT;
  5883. $(_this5.element).on(eventIn, _this5.config.selector, function (event) {
  5884. return _this5._enter(event);
  5885. }).on(eventOut, _this5.config.selector, function (event) {
  5886. return _this5._leave(event);
  5887. });
  5888. }
  5889. });
  5890. this._hideModalHandler = function () {
  5891. if (_this5.element) {
  5892. _this5.hide();
  5893. }
  5894. };
  5895. $(this.element).closest('.modal').on('hide.bs.modal', this._hideModalHandler);
  5896. if (this.config.selector) {
  5897. this.config = _objectSpread2({}, this.config, {
  5898. trigger: 'manual',
  5899. selector: ''
  5900. });
  5901. } else {
  5902. this._fixTitle();
  5903. }
  5904. };
  5905. _proto._fixTitle = function _fixTitle() {
  5906. var titleType = typeof this.element.getAttribute('data-original-title');
  5907. if (this.element.getAttribute('title') || titleType !== 'string') {
  5908. this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');
  5909. this.element.setAttribute('title', '');
  5910. }
  5911. };
  5912. _proto._enter = function _enter(event, context) {
  5913. var dataKey = this.constructor.DATA_KEY;
  5914. context = context || $(event.currentTarget).data(dataKey);
  5915. if (!context) {
  5916. context = new this.constructor(event.currentTarget, this._getDelegateConfig());
  5917. $(event.currentTarget).data(dataKey, context);
  5918. }
  5919. if (event) {
  5920. context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true;
  5921. }
  5922. if ($(context.getTipElement()).hasClass(ClassName$6.SHOW) || context._hoverState === HoverState.SHOW) {
  5923. context._hoverState = HoverState.SHOW;
  5924. return;
  5925. }
  5926. clearTimeout(context._timeout);
  5927. context._hoverState = HoverState.SHOW;
  5928. if (!context.config.delay || !context.config.delay.show) {
  5929. context.show();
  5930. return;
  5931. }
  5932. context._timeout = setTimeout(function () {
  5933. if (context._hoverState === HoverState.SHOW) {
  5934. context.show();
  5935. }
  5936. }, context.config.delay.show);
  5937. };
  5938. _proto._leave = function _leave(event, context) {
  5939. var dataKey = this.constructor.DATA_KEY;
  5940. context = context || $(event.currentTarget).data(dataKey);
  5941. if (!context) {
  5942. context = new this.constructor(event.currentTarget, this._getDelegateConfig());
  5943. $(event.currentTarget).data(dataKey, context);
  5944. }
  5945. if (event) {
  5946. context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false;
  5947. }
  5948. if (context._isWithActiveTrigger()) {
  5949. return;
  5950. }
  5951. clearTimeout(context._timeout);
  5952. context._hoverState = HoverState.OUT;
  5953. if (!context.config.delay || !context.config.delay.hide) {
  5954. context.hide();
  5955. return;
  5956. }
  5957. context._timeout = setTimeout(function () {
  5958. if (context._hoverState === HoverState.OUT) {
  5959. context.hide();
  5960. }
  5961. }, context.config.delay.hide);
  5962. };
  5963. _proto._isWithActiveTrigger = function _isWithActiveTrigger() {
  5964. for (var trigger in this._activeTrigger) {
  5965. if (this._activeTrigger[trigger]) {
  5966. return true;
  5967. }
  5968. }
  5969. return false;
  5970. };
  5971. _proto._getConfig = function _getConfig(config) {
  5972. var dataAttributes = $(this.element).data();
  5973. Object.keys(dataAttributes).forEach(function (dataAttr) {
  5974. if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) {
  5975. delete dataAttributes[dataAttr];
  5976. }
  5977. });
  5978. config = _objectSpread2({}, this.constructor.Default, {}, dataAttributes, {}, typeof config === 'object' && config ? config : {});
  5979. if (typeof config.delay === 'number') {
  5980. config.delay = {
  5981. show: config.delay,
  5982. hide: config.delay
  5983. };
  5984. }
  5985. if (typeof config.title === 'number') {
  5986. config.title = config.title.toString();
  5987. }
  5988. if (typeof config.content === 'number') {
  5989. config.content = config.content.toString();
  5990. }
  5991. Util.typeCheckConfig(NAME$6, config, this.constructor.DefaultType);
  5992. if (config.sanitize) {
  5993. config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn);
  5994. }
  5995. return config;
  5996. };
  5997. _proto._getDelegateConfig = function _getDelegateConfig() {
  5998. var config = {};
  5999. if (this.config) {
  6000. for (var key in this.config) {
  6001. if (this.constructor.Default[key] !== this.config[key]) {
  6002. config[key] = this.config[key];
  6003. }
  6004. }
  6005. }
  6006. return config;
  6007. };
  6008. _proto._cleanTipClass = function _cleanTipClass() {
  6009. var $tip = $(this.getTipElement());
  6010. var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
  6011. if (tabClass !== null && tabClass.length) {
  6012. $tip.removeClass(tabClass.join(''));
  6013. }
  6014. };
  6015. _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
  6016. var popperInstance = popperData.instance;
  6017. this.tip = popperInstance.popper;
  6018. this._cleanTipClass();
  6019. this.addAttachmentClass(this._getAttachment(popperData.placement));
  6020. };
  6021. _proto._fixTransition = function _fixTransition() {
  6022. var tip = this.getTipElement();
  6023. var initConfigAnimation = this.config.animation;
  6024. if (tip.getAttribute('x-placement') !== null) {
  6025. return;
  6026. }
  6027. $(tip).removeClass(ClassName$6.FADE);
  6028. this.config.animation = false;
  6029. this.hide();
  6030. this.show();
  6031. this.config.animation = initConfigAnimation;
  6032. } // Static
  6033. ;
  6034. Tooltip._jQueryInterface = function _jQueryInterface(config) {
  6035. return this.each(function () {
  6036. var data = $(this).data(DATA_KEY$6);
  6037. var _config = typeof config === 'object' && config;
  6038. if (!data && /dispose|hide/.test(config)) {
  6039. return;
  6040. }
  6041. if (!data) {
  6042. data = new Tooltip(this, _config);
  6043. $(this).data(DATA_KEY$6, data);
  6044. }
  6045. if (typeof config === 'string') {
  6046. if (typeof data[config] === 'undefined') {
  6047. throw new TypeError("No method named \"" + config + "\"");
  6048. }
  6049. data[config]();
  6050. }
  6051. });
  6052. };
  6053. _createClass(Tooltip, null, [{
  6054. key: "VERSION",
  6055. get: function get() {
  6056. return VERSION$6;
  6057. }
  6058. }, {
  6059. key: "Default",
  6060. get: function get() {
  6061. return Default$4;
  6062. }
  6063. }, {
  6064. key: "NAME",
  6065. get: function get() {
  6066. return NAME$6;
  6067. }
  6068. }, {
  6069. key: "DATA_KEY",
  6070. get: function get() {
  6071. return DATA_KEY$6;
  6072. }
  6073. }, {
  6074. key: "Event",
  6075. get: function get() {
  6076. return Event$6;
  6077. }
  6078. }, {
  6079. key: "EVENT_KEY",
  6080. get: function get() {
  6081. return EVENT_KEY$6;
  6082. }
  6083. }, {
  6084. key: "DefaultType",
  6085. get: function get() {
  6086. return DefaultType$4;
  6087. }
  6088. }]);
  6089. return Tooltip;
  6090. }();
  6091. /**
  6092. * ------------------------------------------------------------------------
  6093. * jQuery
  6094. * ------------------------------------------------------------------------
  6095. */
  6096. $.fn[NAME$6] = Tooltip._jQueryInterface;
  6097. $.fn[NAME$6].Constructor = Tooltip;
  6098. $.fn[NAME$6].noConflict = function () {
  6099. $.fn[NAME$6] = JQUERY_NO_CONFLICT$6;
  6100. return Tooltip._jQueryInterface;
  6101. };
  6102. /**
  6103. * ------------------------------------------------------------------------
  6104. * Constants
  6105. * ------------------------------------------------------------------------
  6106. */
  6107. var NAME$7 = 'popover';
  6108. var VERSION$7 = '4.4.1';
  6109. var DATA_KEY$7 = 'bs.popover';
  6110. var EVENT_KEY$7 = "." + DATA_KEY$7;
  6111. var JQUERY_NO_CONFLICT$7 = $.fn[NAME$7];
  6112. var CLASS_PREFIX$1 = 'bs-popover';
  6113. var BSCLS_PREFIX_REGEX$1 = new RegExp("(^|\\s)" + CLASS_PREFIX$1 + "\\S+", 'g');
  6114. var Default$5 = _objectSpread2({}, Tooltip.Default, {
  6115. placement: 'right',
  6116. trigger: 'click',
  6117. content: '',
  6118. template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>'
  6119. });
  6120. var DefaultType$5 = _objectSpread2({}, Tooltip.DefaultType, {
  6121. content: '(string|element|function)'
  6122. });
  6123. var ClassName$7 = {
  6124. FADE: 'fade',
  6125. SHOW: 'show'
  6126. };
  6127. var Selector$7 = {
  6128. TITLE: '.popover-header',
  6129. CONTENT: '.popover-body'
  6130. };
  6131. var Event$7 = {
  6132. HIDE: "hide" + EVENT_KEY$7,
  6133. HIDDEN: "hidden" + EVENT_KEY$7,
  6134. SHOW: "show" + EVENT_KEY$7,
  6135. SHOWN: "shown" + EVENT_KEY$7,
  6136. INSERTED: "inserted" + EVENT_KEY$7,
  6137. CLICK: "click" + EVENT_KEY$7,
  6138. FOCUSIN: "focusin" + EVENT_KEY$7,
  6139. FOCUSOUT: "focusout" + EVENT_KEY$7,
  6140. MOUSEENTER: "mouseenter" + EVENT_KEY$7,
  6141. MOUSELEAVE: "mouseleave" + EVENT_KEY$7
  6142. };
  6143. /**
  6144. * ------------------------------------------------------------------------
  6145. * Class Definition
  6146. * ------------------------------------------------------------------------
  6147. */
  6148. var Popover =
  6149. /*#__PURE__*/
  6150. function (_Tooltip) {
  6151. _inheritsLoose(Popover, _Tooltip);
  6152. function Popover() {
  6153. return _Tooltip.apply(this, arguments) || this;
  6154. }
  6155. var _proto = Popover.prototype;
  6156. // Overrides
  6157. _proto.isWithContent = function isWithContent() {
  6158. return this.getTitle() || this._getContent();
  6159. };
  6160. _proto.addAttachmentClass = function addAttachmentClass(attachment) {
  6161. $(this.getTipElement()).addClass(CLASS_PREFIX$1 + "-" + attachment);
  6162. };
  6163. _proto.getTipElement = function getTipElement() {
  6164. this.tip = this.tip || $(this.config.template)[0];
  6165. return this.tip;
  6166. };
  6167. _proto.setContent = function setContent() {
  6168. var $tip = $(this.getTipElement()); // We use append for html objects to maintain js events
  6169. this.setElementContent($tip.find(Selector$7.TITLE), this.getTitle());
  6170. var content = this._getContent();
  6171. if (typeof content === 'function') {
  6172. content = content.call(this.element);
  6173. }
  6174. this.setElementContent($tip.find(Selector$7.CONTENT), content);
  6175. $tip.removeClass(ClassName$7.FADE + " " + ClassName$7.SHOW);
  6176. } // Private
  6177. ;
  6178. _proto._getContent = function _getContent() {
  6179. return this.element.getAttribute('data-content') || this.config.content;
  6180. };
  6181. _proto._cleanTipClass = function _cleanTipClass() {
  6182. var $tip = $(this.getTipElement());
  6183. var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX$1);
  6184. if (tabClass !== null && tabClass.length > 0) {
  6185. $tip.removeClass(tabClass.join(''));
  6186. }
  6187. } // Static
  6188. ;
  6189. Popover._jQueryInterface = function _jQueryInterface(config) {
  6190. return this.each(function () {
  6191. var data = $(this).data(DATA_KEY$7);
  6192. var _config = typeof config === 'object' ? config : null;
  6193. if (!data && /dispose|hide/.test(config)) {
  6194. return;
  6195. }
  6196. if (!data) {
  6197. data = new Popover(this, _config);
  6198. $(this).data(DATA_KEY$7, data);
  6199. }
  6200. if (typeof config === 'string') {
  6201. if (typeof data[config] === 'undefined') {
  6202. throw new TypeError("No method named \"" + config + "\"");
  6203. }
  6204. data[config]();
  6205. }
  6206. });
  6207. };
  6208. _createClass(Popover, null, [{
  6209. key: "VERSION",
  6210. // Getters
  6211. get: function get() {
  6212. return VERSION$7;
  6213. }
  6214. }, {
  6215. key: "Default",
  6216. get: function get() {
  6217. return Default$5;
  6218. }
  6219. }, {
  6220. key: "NAME",
  6221. get: function get() {
  6222. return NAME$7;
  6223. }
  6224. }, {
  6225. key: "DATA_KEY",
  6226. get: function get() {
  6227. return DATA_KEY$7;
  6228. }
  6229. }, {
  6230. key: "Event",
  6231. get: function get() {
  6232. return Event$7;
  6233. }
  6234. }, {
  6235. key: "EVENT_KEY",
  6236. get: function get() {
  6237. return EVENT_KEY$7;
  6238. }
  6239. }, {
  6240. key: "DefaultType",
  6241. get: function get() {
  6242. return DefaultType$5;
  6243. }
  6244. }]);
  6245. return Popover;
  6246. }(Tooltip);
  6247. /**
  6248. * ------------------------------------------------------------------------
  6249. * jQuery
  6250. * ------------------------------------------------------------------------
  6251. */
  6252. $.fn[NAME$7] = Popover._jQueryInterface;
  6253. $.fn[NAME$7].Constructor = Popover;
  6254. $.fn[NAME$7].noConflict = function () {
  6255. $.fn[NAME$7] = JQUERY_NO_CONFLICT$7;
  6256. return Popover._jQueryInterface;
  6257. };
  6258. /**
  6259. * ------------------------------------------------------------------------
  6260. * Constants
  6261. * ------------------------------------------------------------------------
  6262. */
  6263. var NAME$8 = 'scrollspy';
  6264. var VERSION$8 = '4.4.1';
  6265. var DATA_KEY$8 = 'bs.scrollspy';
  6266. var EVENT_KEY$8 = "." + DATA_KEY$8;
  6267. var DATA_API_KEY$6 = '.data-api';
  6268. var JQUERY_NO_CONFLICT$8 = $.fn[NAME$8];
  6269. var Default$6 = {
  6270. offset: 10,
  6271. method: 'auto',
  6272. target: ''
  6273. };
  6274. var DefaultType$6 = {
  6275. offset: 'number',
  6276. method: 'string',
  6277. target: '(string|element)'
  6278. };
  6279. var Event$8 = {
  6280. ACTIVATE: "activate" + EVENT_KEY$8,
  6281. SCROLL: "scroll" + EVENT_KEY$8,
  6282. LOAD_DATA_API: "load" + EVENT_KEY$8 + DATA_API_KEY$6
  6283. };
  6284. var ClassName$8 = {
  6285. DROPDOWN_ITEM: 'dropdown-item',
  6286. DROPDOWN_MENU: 'dropdown-menu',
  6287. ACTIVE: 'active'
  6288. };
  6289. var Selector$8 = {
  6290. DATA_SPY: '[data-spy="scroll"]',
  6291. ACTIVE: '.active',
  6292. NAV_LIST_GROUP: '.nav, .list-group',
  6293. NAV_LINKS: '.nav-link',
  6294. NAV_ITEMS: '.nav-item',
  6295. LIST_ITEMS: '.list-group-item',
  6296. DROPDOWN: '.dropdown',
  6297. DROPDOWN_ITEMS: '.dropdown-item',
  6298. DROPDOWN_TOGGLE: '.dropdown-toggle'
  6299. };
  6300. var OffsetMethod = {
  6301. OFFSET: 'offset',
  6302. POSITION: 'position'
  6303. };
  6304. /**
  6305. * ------------------------------------------------------------------------
  6306. * Class Definition
  6307. * ------------------------------------------------------------------------
  6308. */
  6309. var ScrollSpy =
  6310. /*#__PURE__*/
  6311. function () {
  6312. function ScrollSpy(element, config) {
  6313. var _this = this;
  6314. this._element = element;
  6315. this._scrollElement = element.tagName === 'BODY' ? window : element;
  6316. this._config = this._getConfig(config);
  6317. this._selector = this._config.target + " " + Selector$8.NAV_LINKS + "," + (this._config.target + " " + Selector$8.LIST_ITEMS + ",") + (this._config.target + " " + Selector$8.DROPDOWN_ITEMS);
  6318. this._offsets = [];
  6319. this._targets = [];
  6320. this._activeTarget = null;
  6321. this._scrollHeight = 0;
  6322. $(this._scrollElement).on(Event$8.SCROLL, function (event) {
  6323. return _this._process(event);
  6324. });
  6325. this.refresh();
  6326. this._process();
  6327. } // Getters
  6328. var _proto = ScrollSpy.prototype;
  6329. // Public
  6330. _proto.refresh = function refresh() {
  6331. var _this2 = this;
  6332. var autoMethod = this._scrollElement === this._scrollElement.window ? OffsetMethod.OFFSET : OffsetMethod.POSITION;
  6333. var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;
  6334. var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0;
  6335. this._offsets = [];
  6336. this._targets = [];
  6337. this._scrollHeight = this._getScrollHeight();
  6338. var targets = [].slice.call(document.querySelectorAll(this._selector));
  6339. targets.map(function (element) {
  6340. var target;
  6341. var targetSelector = Util.getSelectorFromElement(element);
  6342. if (targetSelector) {
  6343. target = document.querySelector(targetSelector);
  6344. }
  6345. if (target) {
  6346. var targetBCR = target.getBoundingClientRect();
  6347. if (targetBCR.width || targetBCR.height) {
  6348. // TODO (fat): remove sketch reliance on jQuery position/offset
  6349. return [$(target)[offsetMethod]().top + offsetBase, targetSelector];
  6350. }
  6351. }
  6352. return null;
  6353. }).filter(function (item) {
  6354. return item;
  6355. }).sort(function (a, b) {
  6356. return a[0] - b[0];
  6357. }).forEach(function (item) {
  6358. _this2._offsets.push(item[0]);
  6359. _this2._targets.push(item[1]);
  6360. });
  6361. };
  6362. _proto.dispose = function dispose() {
  6363. $.removeData(this._element, DATA_KEY$8);
  6364. $(this._scrollElement).off(EVENT_KEY$8);
  6365. this._element = null;
  6366. this._scrollElement = null;
  6367. this._config = null;
  6368. this._selector = null;
  6369. this._offsets = null;
  6370. this._targets = null;
  6371. this._activeTarget = null;
  6372. this._scrollHeight = null;
  6373. } // Private
  6374. ;
  6375. _proto._getConfig = function _getConfig(config) {
  6376. config = _objectSpread2({}, Default$6, {}, typeof config === 'object' && config ? config : {});
  6377. if (typeof config.target !== 'string') {
  6378. var id = $(config.target).attr('id');
  6379. if (!id) {
  6380. id = Util.getUID(NAME$8);
  6381. $(config.target).attr('id', id);
  6382. }
  6383. config.target = "#" + id;
  6384. }
  6385. Util.typeCheckConfig(NAME$8, config, DefaultType$6);
  6386. return config;
  6387. };
  6388. _proto._getScrollTop = function _getScrollTop() {
  6389. return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop;
  6390. };
  6391. _proto._getScrollHeight = function _getScrollHeight() {
  6392. return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
  6393. };
  6394. _proto._getOffsetHeight = function _getOffsetHeight() {
  6395. return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height;
  6396. };
  6397. _proto._process = function _process() {
  6398. var scrollTop = this._getScrollTop() + this._config.offset;
  6399. var scrollHeight = this._getScrollHeight();
  6400. var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();
  6401. if (this._scrollHeight !== scrollHeight) {
  6402. this.refresh();
  6403. }
  6404. if (scrollTop >= maxScroll) {
  6405. var target = this._targets[this._targets.length - 1];
  6406. if (this._activeTarget !== target) {
  6407. this._activate(target);
  6408. }
  6409. return;
  6410. }
  6411. if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {
  6412. this._activeTarget = null;
  6413. this._clear();
  6414. return;
  6415. }
  6416. var offsetLength = this._offsets.length;
  6417. for (var i = offsetLength; i--;) {
  6418. var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]);
  6419. if (isActiveTarget) {
  6420. this._activate(this._targets[i]);
  6421. }
  6422. }
  6423. };
  6424. _proto._activate = function _activate(target) {
  6425. this._activeTarget = target;
  6426. this._clear();
  6427. var queries = this._selector.split(',').map(function (selector) {
  6428. return selector + "[data-target=\"" + target + "\"]," + selector + "[href=\"" + target + "\"]";
  6429. });
  6430. var $link = $([].slice.call(document.querySelectorAll(queries.join(','))));
  6431. if ($link.hasClass(ClassName$8.DROPDOWN_ITEM)) {
  6432. $link.closest(Selector$8.DROPDOWN).find(Selector$8.DROPDOWN_TOGGLE).addClass(ClassName$8.ACTIVE);
  6433. $link.addClass(ClassName$8.ACTIVE);
  6434. } else {
  6435. // Set triggered link as active
  6436. $link.addClass(ClassName$8.ACTIVE); // Set triggered links parents as active
  6437. // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor
  6438. $link.parents(Selector$8.NAV_LIST_GROUP).prev(Selector$8.NAV_LINKS + ", " + Selector$8.LIST_ITEMS).addClass(ClassName$8.ACTIVE); // Handle special case when .nav-link is inside .nav-item
  6439. $link.parents(Selector$8.NAV_LIST_GROUP).prev(Selector$8.NAV_ITEMS).children(Selector$8.NAV_LINKS).addClass(ClassName$8.ACTIVE);
  6440. }
  6441. $(this._scrollElement).trigger(Event$8.ACTIVATE, {
  6442. relatedTarget: target
  6443. });
  6444. };
  6445. _proto._clear = function _clear() {
  6446. [].slice.call(document.querySelectorAll(this._selector)).filter(function (node) {
  6447. return node.classList.contains(ClassName$8.ACTIVE);
  6448. }).forEach(function (node) {
  6449. return node.classList.remove(ClassName$8.ACTIVE);
  6450. });
  6451. } // Static
  6452. ;
  6453. ScrollSpy._jQueryInterface = function _jQueryInterface(config) {
  6454. return this.each(function () {
  6455. var data = $(this).data(DATA_KEY$8);
  6456. var _config = typeof config === 'object' && config;
  6457. if (!data) {
  6458. data = new ScrollSpy(this, _config);
  6459. $(this).data(DATA_KEY$8, data);
  6460. }
  6461. if (typeof config === 'string') {
  6462. if (typeof data[config] === 'undefined') {
  6463. throw new TypeError("No method named \"" + config + "\"");
  6464. }
  6465. data[config]();
  6466. }
  6467. });
  6468. };
  6469. _createClass(ScrollSpy, null, [{
  6470. key: "VERSION",
  6471. get: function get() {
  6472. return VERSION$8;
  6473. }
  6474. }, {
  6475. key: "Default",
  6476. get: function get() {
  6477. return Default$6;
  6478. }
  6479. }]);
  6480. return ScrollSpy;
  6481. }();
  6482. /**
  6483. * ------------------------------------------------------------------------
  6484. * Data Api implementation
  6485. * ------------------------------------------------------------------------
  6486. */
  6487. $(window).on(Event$8.LOAD_DATA_API, function () {
  6488. var scrollSpys = [].slice.call(document.querySelectorAll(Selector$8.DATA_SPY));
  6489. var scrollSpysLength = scrollSpys.length;
  6490. for (var i = scrollSpysLength; i--;) {
  6491. var $spy = $(scrollSpys[i]);
  6492. ScrollSpy._jQueryInterface.call($spy, $spy.data());
  6493. }
  6494. });
  6495. /**
  6496. * ------------------------------------------------------------------------
  6497. * jQuery
  6498. * ------------------------------------------------------------------------
  6499. */
  6500. $.fn[NAME$8] = ScrollSpy._jQueryInterface;
  6501. $.fn[NAME$8].Constructor = ScrollSpy;
  6502. $.fn[NAME$8].noConflict = function () {
  6503. $.fn[NAME$8] = JQUERY_NO_CONFLICT$8;
  6504. return ScrollSpy._jQueryInterface;
  6505. };
  6506. /**
  6507. * ------------------------------------------------------------------------
  6508. * Constants
  6509. * ------------------------------------------------------------------------
  6510. */
  6511. var NAME$9 = 'tab';
  6512. var VERSION$9 = '4.4.1';
  6513. var DATA_KEY$9 = 'bs.tab';
  6514. var EVENT_KEY$9 = "." + DATA_KEY$9;
  6515. var DATA_API_KEY$7 = '.data-api';
  6516. var JQUERY_NO_CONFLICT$9 = $.fn[NAME$9];
  6517. var Event$9 = {
  6518. HIDE: "hide" + EVENT_KEY$9,
  6519. HIDDEN: "hidden" + EVENT_KEY$9,
  6520. SHOW: "show" + EVENT_KEY$9,
  6521. SHOWN: "shown" + EVENT_KEY$9,
  6522. CLICK_DATA_API: "click" + EVENT_KEY$9 + DATA_API_KEY$7
  6523. };
  6524. var ClassName$9 = {
  6525. DROPDOWN_MENU: 'dropdown-menu',
  6526. ACTIVE: 'active',
  6527. DISABLED: 'disabled',
  6528. FADE: 'fade',
  6529. SHOW: 'show'
  6530. };
  6531. var Selector$9 = {
  6532. DROPDOWN: '.dropdown',
  6533. NAV_LIST_GROUP: '.nav, .list-group',
  6534. ACTIVE: '.active',
  6535. ACTIVE_UL: '> li > .active',
  6536. DATA_TOGGLE: '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',
  6537. DROPDOWN_TOGGLE: '.dropdown-toggle',
  6538. DROPDOWN_ACTIVE_CHILD: '> .dropdown-menu .active'
  6539. };
  6540. /**
  6541. * ------------------------------------------------------------------------
  6542. * Class Definition
  6543. * ------------------------------------------------------------------------
  6544. */
  6545. var Tab =
  6546. /*#__PURE__*/
  6547. function () {
  6548. function Tab(element) {
  6549. this._element = element;
  6550. } // Getters
  6551. var _proto = Tab.prototype;
  6552. // Public
  6553. _proto.show = function show() {
  6554. var _this = this;
  6555. if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $(this._element).hasClass(ClassName$9.ACTIVE) || $(this._element).hasClass(ClassName$9.DISABLED)) {
  6556. return;
  6557. }
  6558. var target;
  6559. var previous;
  6560. var listElement = $(this._element).closest(Selector$9.NAV_LIST_GROUP)[0];
  6561. var selector = Util.getSelectorFromElement(this._element);
  6562. if (listElement) {
  6563. var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? Selector$9.ACTIVE_UL : Selector$9.ACTIVE;
  6564. previous = $.makeArray($(listElement).find(itemSelector));
  6565. previous = previous[previous.length - 1];
  6566. }
  6567. var hideEvent = $.Event(Event$9.HIDE, {
  6568. relatedTarget: this._element
  6569. });
  6570. var showEvent = $.Event(Event$9.SHOW, {
  6571. relatedTarget: previous
  6572. });
  6573. if (previous) {
  6574. $(previous).trigger(hideEvent);
  6575. }
  6576. $(this._element).trigger(showEvent);
  6577. if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) {
  6578. return;
  6579. }
  6580. if (selector) {
  6581. target = document.querySelector(selector);
  6582. }
  6583. this._activate(this._element, listElement);
  6584. var complete = function complete() {
  6585. var hiddenEvent = $.Event(Event$9.HIDDEN, {
  6586. relatedTarget: _this._element
  6587. });
  6588. var shownEvent = $.Event(Event$9.SHOWN, {
  6589. relatedTarget: previous
  6590. });
  6591. $(previous).trigger(hiddenEvent);
  6592. $(_this._element).trigger(shownEvent);
  6593. };
  6594. if (target) {
  6595. this._activate(target, target.parentNode, complete);
  6596. } else {
  6597. complete();
  6598. }
  6599. };
  6600. _proto.dispose = function dispose() {
  6601. $.removeData(this._element, DATA_KEY$9);
  6602. this._element = null;
  6603. } // Private
  6604. ;
  6605. _proto._activate = function _activate(element, container, callback) {
  6606. var _this2 = this;
  6607. var activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? $(container).find(Selector$9.ACTIVE_UL) : $(container).children(Selector$9.ACTIVE);
  6608. var active = activeElements[0];
  6609. var isTransitioning = callback && active && $(active).hasClass(ClassName$9.FADE);
  6610. var complete = function complete() {
  6611. return _this2._transitionComplete(element, active, callback);
  6612. };
  6613. if (active && isTransitioning) {
  6614. var transitionDuration = Util.getTransitionDurationFromElement(active);
  6615. $(active).removeClass(ClassName$9.SHOW).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  6616. } else {
  6617. complete();
  6618. }
  6619. };
  6620. _proto._transitionComplete = function _transitionComplete(element, active, callback) {
  6621. if (active) {
  6622. $(active).removeClass(ClassName$9.ACTIVE);
  6623. var dropdownChild = $(active.parentNode).find(Selector$9.DROPDOWN_ACTIVE_CHILD)[0];
  6624. if (dropdownChild) {
  6625. $(dropdownChild).removeClass(ClassName$9.ACTIVE);
  6626. }
  6627. if (active.getAttribute('role') === 'tab') {
  6628. active.setAttribute('aria-selected', false);
  6629. }
  6630. }
  6631. $(element).addClass(ClassName$9.ACTIVE);
  6632. if (element.getAttribute('role') === 'tab') {
  6633. element.setAttribute('aria-selected', true);
  6634. }
  6635. Util.reflow(element);
  6636. if (element.classList.contains(ClassName$9.FADE)) {
  6637. element.classList.add(ClassName$9.SHOW);
  6638. }
  6639. if (element.parentNode && $(element.parentNode).hasClass(ClassName$9.DROPDOWN_MENU)) {
  6640. var dropdownElement = $(element).closest(Selector$9.DROPDOWN)[0];
  6641. if (dropdownElement) {
  6642. var dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(Selector$9.DROPDOWN_TOGGLE));
  6643. $(dropdownToggleList).addClass(ClassName$9.ACTIVE);
  6644. }
  6645. element.setAttribute('aria-expanded', true);
  6646. }
  6647. if (callback) {
  6648. callback();
  6649. }
  6650. } // Static
  6651. ;
  6652. Tab._jQueryInterface = function _jQueryInterface(config) {
  6653. return this.each(function () {
  6654. var $this = $(this);
  6655. var data = $this.data(DATA_KEY$9);
  6656. if (!data) {
  6657. data = new Tab(this);
  6658. $this.data(DATA_KEY$9, data);
  6659. }
  6660. if (typeof config === 'string') {
  6661. if (typeof data[config] === 'undefined') {
  6662. throw new TypeError("No method named \"" + config + "\"");
  6663. }
  6664. data[config]();
  6665. }
  6666. });
  6667. };
  6668. _createClass(Tab, null, [{
  6669. key: "VERSION",
  6670. get: function get() {
  6671. return VERSION$9;
  6672. }
  6673. }]);
  6674. return Tab;
  6675. }();
  6676. /**
  6677. * ------------------------------------------------------------------------
  6678. * Data Api implementation
  6679. * ------------------------------------------------------------------------
  6680. */
  6681. $(document).on(Event$9.CLICK_DATA_API, Selector$9.DATA_TOGGLE, function (event) {
  6682. event.preventDefault();
  6683. Tab._jQueryInterface.call($(this), 'show');
  6684. });
  6685. /**
  6686. * ------------------------------------------------------------------------
  6687. * jQuery
  6688. * ------------------------------------------------------------------------
  6689. */
  6690. $.fn[NAME$9] = Tab._jQueryInterface;
  6691. $.fn[NAME$9].Constructor = Tab;
  6692. $.fn[NAME$9].noConflict = function () {
  6693. $.fn[NAME$9] = JQUERY_NO_CONFLICT$9;
  6694. return Tab._jQueryInterface;
  6695. };
  6696. /**
  6697. * ------------------------------------------------------------------------
  6698. * Constants
  6699. * ------------------------------------------------------------------------
  6700. */
  6701. var NAME$a = 'toast';
  6702. var VERSION$a = '4.4.1';
  6703. var DATA_KEY$a = 'bs.toast';
  6704. var EVENT_KEY$a = "." + DATA_KEY$a;
  6705. var JQUERY_NO_CONFLICT$a = $.fn[NAME$a];
  6706. var Event$a = {
  6707. CLICK_DISMISS: "click.dismiss" + EVENT_KEY$a,
  6708. HIDE: "hide" + EVENT_KEY$a,
  6709. HIDDEN: "hidden" + EVENT_KEY$a,
  6710. SHOW: "show" + EVENT_KEY$a,
  6711. SHOWN: "shown" + EVENT_KEY$a
  6712. };
  6713. var ClassName$a = {
  6714. FADE: 'fade',
  6715. HIDE: 'hide',
  6716. SHOW: 'show',
  6717. SHOWING: 'showing'
  6718. };
  6719. var DefaultType$7 = {
  6720. animation: 'boolean',
  6721. autohide: 'boolean',
  6722. delay: 'number'
  6723. };
  6724. var Default$7 = {
  6725. animation: true,
  6726. autohide: true,
  6727. delay: 500
  6728. };
  6729. var Selector$a = {
  6730. DATA_DISMISS: '[data-dismiss="toast"]'
  6731. };
  6732. /**
  6733. * ------------------------------------------------------------------------
  6734. * Class Definition
  6735. * ------------------------------------------------------------------------
  6736. */
  6737. var Toast =
  6738. /*#__PURE__*/
  6739. function () {
  6740. function Toast(element, config) {
  6741. this._element = element;
  6742. this._config = this._getConfig(config);
  6743. this._timeout = null;
  6744. this._setListeners();
  6745. } // Getters
  6746. var _proto = Toast.prototype;
  6747. // Public
  6748. _proto.show = function show() {
  6749. var _this = this;
  6750. var showEvent = $.Event(Event$a.SHOW);
  6751. $(this._element).trigger(showEvent);
  6752. if (showEvent.isDefaultPrevented()) {
  6753. return;
  6754. }
  6755. if (this._config.animation) {
  6756. this._element.classList.add(ClassName$a.FADE);
  6757. }
  6758. var complete = function complete() {
  6759. _this._element.classList.remove(ClassName$a.SHOWING);
  6760. _this._element.classList.add(ClassName$a.SHOW);
  6761. $(_this._element).trigger(Event$a.SHOWN);
  6762. if (_this._config.autohide) {
  6763. _this._timeout = setTimeout(function () {
  6764. _this.hide();
  6765. }, _this._config.delay);
  6766. }
  6767. };
  6768. this._element.classList.remove(ClassName$a.HIDE);
  6769. Util.reflow(this._element);
  6770. this._element.classList.add(ClassName$a.SHOWING);
  6771. if (this._config.animation) {
  6772. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  6773. $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  6774. } else {
  6775. complete();
  6776. }
  6777. };
  6778. _proto.hide = function hide() {
  6779. if (!this._element.classList.contains(ClassName$a.SHOW)) {
  6780. return;
  6781. }
  6782. var hideEvent = $.Event(Event$a.HIDE);
  6783. $(this._element).trigger(hideEvent);
  6784. if (hideEvent.isDefaultPrevented()) {
  6785. return;
  6786. }
  6787. this._close();
  6788. };
  6789. _proto.dispose = function dispose() {
  6790. clearTimeout(this._timeout);
  6791. this._timeout = null;
  6792. if (this._element.classList.contains(ClassName$a.SHOW)) {
  6793. this._element.classList.remove(ClassName$a.SHOW);
  6794. }
  6795. $(this._element).off(Event$a.CLICK_DISMISS);
  6796. $.removeData(this._element, DATA_KEY$a);
  6797. this._element = null;
  6798. this._config = null;
  6799. } // Private
  6800. ;
  6801. _proto._getConfig = function _getConfig(config) {
  6802. config = _objectSpread2({}, Default$7, {}, $(this._element).data(), {}, typeof config === 'object' && config ? config : {});
  6803. Util.typeCheckConfig(NAME$a, config, this.constructor.DefaultType);
  6804. return config;
  6805. };
  6806. _proto._setListeners = function _setListeners() {
  6807. var _this2 = this;
  6808. $(this._element).on(Event$a.CLICK_DISMISS, Selector$a.DATA_DISMISS, function () {
  6809. return _this2.hide();
  6810. });
  6811. };
  6812. _proto._close = function _close() {
  6813. var _this3 = this;
  6814. var complete = function complete() {
  6815. _this3._element.classList.add(ClassName$a.HIDE);
  6816. $(_this3._element).trigger(Event$a.HIDDEN);
  6817. };
  6818. this._element.classList.remove(ClassName$a.SHOW);
  6819. if (this._config.animation) {
  6820. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  6821. $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  6822. } else {
  6823. complete();
  6824. }
  6825. } // Static
  6826. ;
  6827. Toast._jQueryInterface = function _jQueryInterface(config) {
  6828. return this.each(function () {
  6829. var $element = $(this);
  6830. var data = $element.data(DATA_KEY$a);
  6831. var _config = typeof config === 'object' && config;
  6832. if (!data) {
  6833. data = new Toast(this, _config);
  6834. $element.data(DATA_KEY$a, data);
  6835. }
  6836. if (typeof config === 'string') {
  6837. if (typeof data[config] === 'undefined') {
  6838. throw new TypeError("No method named \"" + config + "\"");
  6839. }
  6840. data[config](this);
  6841. }
  6842. });
  6843. };
  6844. _createClass(Toast, null, [{
  6845. key: "VERSION",
  6846. get: function get() {
  6847. return VERSION$a;
  6848. }
  6849. }, {
  6850. key: "DefaultType",
  6851. get: function get() {
  6852. return DefaultType$7;
  6853. }
  6854. }, {
  6855. key: "Default",
  6856. get: function get() {
  6857. return Default$7;
  6858. }
  6859. }]);
  6860. return Toast;
  6861. }();
  6862. /**
  6863. * ------------------------------------------------------------------------
  6864. * jQuery
  6865. * ------------------------------------------------------------------------
  6866. */
  6867. $.fn[NAME$a] = Toast._jQueryInterface;
  6868. $.fn[NAME$a].Constructor = Toast;
  6869. $.fn[NAME$a].noConflict = function () {
  6870. $.fn[NAME$a] = JQUERY_NO_CONFLICT$a;
  6871. return Toast._jQueryInterface;
  6872. };
  6873. exports.Alert = Alert;
  6874. exports.Button = Button;
  6875. exports.Carousel = Carousel;
  6876. exports.Collapse = Collapse;
  6877. exports.Dropdown = Dropdown;
  6878. exports.Modal = Modal;
  6879. exports.Popover = Popover;
  6880. exports.Scrollspy = ScrollSpy;
  6881. exports.Tab = Tab;
  6882. exports.Toast = Toast;
  6883. exports.Tooltip = Tooltip;
  6884. exports.Util = Util;
  6885. Object.defineProperty(exports, '__esModule', { value: true });
  6886. })));
  6887. //# sourceMappingURL=bootstrap.js.map
  6888. /***/ }),
  6889. /***/ "./node_modules/buffer/index.js":
  6890. /*!**************************************!*\
  6891. !*** ./node_modules/buffer/index.js ***!
  6892. \**************************************/
  6893. /*! no static exports found */
  6894. /***/ (function(module, exports, __webpack_require__) {
  6895. "use strict";
  6896. /* WEBPACK VAR INJECTION */(function(global) {/*!
  6897. * The buffer module from node.js, for the browser.
  6898. *
  6899. * @author Feross Aboukhadijeh <http://feross.org>
  6900. * @license MIT
  6901. */
  6902. /* eslint-disable no-proto */
  6903. var base64 = __webpack_require__(/*! base64-js */ "./node_modules/base64-js/index.js")
  6904. var ieee754 = __webpack_require__(/*! ieee754 */ "./node_modules/ieee754/index.js")
  6905. var isArray = __webpack_require__(/*! isarray */ "./node_modules/isarray/index.js")
  6906. exports.Buffer = Buffer
  6907. exports.SlowBuffer = SlowBuffer
  6908. exports.INSPECT_MAX_BYTES = 50
  6909. /**
  6910. * If `Buffer.TYPED_ARRAY_SUPPORT`:
  6911. * === true Use Uint8Array implementation (fastest)
  6912. * === false Use Object implementation (most compatible, even IE6)
  6913. *
  6914. * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
  6915. * Opera 11.6+, iOS 4.2+.
  6916. *
  6917. * Due to various browser bugs, sometimes the Object implementation will be used even
  6918. * when the browser supports typed arrays.
  6919. *
  6920. * Note:
  6921. *
  6922. * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
  6923. * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
  6924. *
  6925. * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
  6926. *
  6927. * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
  6928. * incorrect length in some situations.
  6929. * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
  6930. * get the Object implementation, which is slower but behaves correctly.
  6931. */
  6932. Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined
  6933. ? global.TYPED_ARRAY_SUPPORT
  6934. : typedArraySupport()
  6935. /*
  6936. * Export kMaxLength after typed array support is determined.
  6937. */
  6938. exports.kMaxLength = kMaxLength()
  6939. function typedArraySupport () {
  6940. try {
  6941. var arr = new Uint8Array(1)
  6942. arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
  6943. return arr.foo() === 42 && // typed array instances can be augmented
  6944. typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
  6945. arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
  6946. } catch (e) {
  6947. return false
  6948. }
  6949. }
  6950. function kMaxLength () {
  6951. return Buffer.TYPED_ARRAY_SUPPORT
  6952. ? 0x7fffffff
  6953. : 0x3fffffff
  6954. }
  6955. function createBuffer (that, length) {
  6956. if (kMaxLength() < length) {
  6957. throw new RangeError('Invalid typed array length')
  6958. }
  6959. if (Buffer.TYPED_ARRAY_SUPPORT) {
  6960. // Return an augmented `Uint8Array` instance, for best performance
  6961. that = new Uint8Array(length)
  6962. that.__proto__ = Buffer.prototype
  6963. } else {
  6964. // Fallback: Return an object instance of the Buffer class
  6965. if (that === null) {
  6966. that = new Buffer(length)
  6967. }
  6968. that.length = length
  6969. }
  6970. return that
  6971. }
  6972. /**
  6973. * The Buffer constructor returns instances of `Uint8Array` that have their
  6974. * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
  6975. * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
  6976. * and the `Uint8Array` methods. Square bracket notation works as expected -- it
  6977. * returns a single octet.
  6978. *
  6979. * The `Uint8Array` prototype remains unmodified.
  6980. */
  6981. function Buffer (arg, encodingOrOffset, length) {
  6982. if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
  6983. return new Buffer(arg, encodingOrOffset, length)
  6984. }
  6985. // Common case.
  6986. if (typeof arg === 'number') {
  6987. if (typeof encodingOrOffset === 'string') {
  6988. throw new Error(
  6989. 'If encoding is specified then the first argument must be a string'
  6990. )
  6991. }
  6992. return allocUnsafe(this, arg)
  6993. }
  6994. return from(this, arg, encodingOrOffset, length)
  6995. }
  6996. Buffer.poolSize = 8192 // not used by this implementation
  6997. // TODO: Legacy, not needed anymore. Remove in next major version.
  6998. Buffer._augment = function (arr) {
  6999. arr.__proto__ = Buffer.prototype
  7000. return arr
  7001. }
  7002. function from (that, value, encodingOrOffset, length) {
  7003. if (typeof value === 'number') {
  7004. throw new TypeError('"value" argument must not be a number')
  7005. }
  7006. if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
  7007. return fromArrayBuffer(that, value, encodingOrOffset, length)
  7008. }
  7009. if (typeof value === 'string') {
  7010. return fromString(that, value, encodingOrOffset)
  7011. }
  7012. return fromObject(that, value)
  7013. }
  7014. /**
  7015. * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
  7016. * if value is a number.
  7017. * Buffer.from(str[, encoding])
  7018. * Buffer.from(array)
  7019. * Buffer.from(buffer)
  7020. * Buffer.from(arrayBuffer[, byteOffset[, length]])
  7021. **/
  7022. Buffer.from = function (value, encodingOrOffset, length) {
  7023. return from(null, value, encodingOrOffset, length)
  7024. }
  7025. if (Buffer.TYPED_ARRAY_SUPPORT) {
  7026. Buffer.prototype.__proto__ = Uint8Array.prototype
  7027. Buffer.__proto__ = Uint8Array
  7028. if (typeof Symbol !== 'undefined' && Symbol.species &&
  7029. Buffer[Symbol.species] === Buffer) {
  7030. // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
  7031. Object.defineProperty(Buffer, Symbol.species, {
  7032. value: null,
  7033. configurable: true
  7034. })
  7035. }
  7036. }
  7037. function assertSize (size) {
  7038. if (typeof size !== 'number') {
  7039. throw new TypeError('"size" argument must be a number')
  7040. } else if (size < 0) {
  7041. throw new RangeError('"size" argument must not be negative')
  7042. }
  7043. }
  7044. function alloc (that, size, fill, encoding) {
  7045. assertSize(size)
  7046. if (size <= 0) {
  7047. return createBuffer(that, size)
  7048. }
  7049. if (fill !== undefined) {
  7050. // Only pay attention to encoding if it's a string. This
  7051. // prevents accidentally sending in a number that would
  7052. // be interpretted as a start offset.
  7053. return typeof encoding === 'string'
  7054. ? createBuffer(that, size).fill(fill, encoding)
  7055. : createBuffer(that, size).fill(fill)
  7056. }
  7057. return createBuffer(that, size)
  7058. }
  7059. /**
  7060. * Creates a new filled Buffer instance.
  7061. * alloc(size[, fill[, encoding]])
  7062. **/
  7063. Buffer.alloc = function (size, fill, encoding) {
  7064. return alloc(null, size, fill, encoding)
  7065. }
  7066. function allocUnsafe (that, size) {
  7067. assertSize(size)
  7068. that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)
  7069. if (!Buffer.TYPED_ARRAY_SUPPORT) {
  7070. for (var i = 0; i < size; ++i) {
  7071. that[i] = 0
  7072. }
  7073. }
  7074. return that
  7075. }
  7076. /**
  7077. * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
  7078. * */
  7079. Buffer.allocUnsafe = function (size) {
  7080. return allocUnsafe(null, size)
  7081. }
  7082. /**
  7083. * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
  7084. */
  7085. Buffer.allocUnsafeSlow = function (size) {
  7086. return allocUnsafe(null, size)
  7087. }
  7088. function fromString (that, string, encoding) {
  7089. if (typeof encoding !== 'string' || encoding === '') {
  7090. encoding = 'utf8'
  7091. }
  7092. if (!Buffer.isEncoding(encoding)) {
  7093. throw new TypeError('"encoding" must be a valid string encoding')
  7094. }
  7095. var length = byteLength(string, encoding) | 0
  7096. that = createBuffer(that, length)
  7097. var actual = that.write(string, encoding)
  7098. if (actual !== length) {
  7099. // Writing a hex string, for example, that contains invalid characters will
  7100. // cause everything after the first invalid character to be ignored. (e.g.
  7101. // 'abxxcd' will be treated as 'ab')
  7102. that = that.slice(0, actual)
  7103. }
  7104. return that
  7105. }
  7106. function fromArrayLike (that, array) {
  7107. var length = array.length < 0 ? 0 : checked(array.length) | 0
  7108. that = createBuffer(that, length)
  7109. for (var i = 0; i < length; i += 1) {
  7110. that[i] = array[i] & 255
  7111. }
  7112. return that
  7113. }
  7114. function fromArrayBuffer (that, array, byteOffset, length) {
  7115. array.byteLength // this throws if `array` is not a valid ArrayBuffer
  7116. if (byteOffset < 0 || array.byteLength < byteOffset) {
  7117. throw new RangeError('\'offset\' is out of bounds')
  7118. }
  7119. if (array.byteLength < byteOffset + (length || 0)) {
  7120. throw new RangeError('\'length\' is out of bounds')
  7121. }
  7122. if (byteOffset === undefined && length === undefined) {
  7123. array = new Uint8Array(array)
  7124. } else if (length === undefined) {
  7125. array = new Uint8Array(array, byteOffset)
  7126. } else {
  7127. array = new Uint8Array(array, byteOffset, length)
  7128. }
  7129. if (Buffer.TYPED_ARRAY_SUPPORT) {
  7130. // Return an augmented `Uint8Array` instance, for best performance
  7131. that = array
  7132. that.__proto__ = Buffer.prototype
  7133. } else {
  7134. // Fallback: Return an object instance of the Buffer class
  7135. that = fromArrayLike(that, array)
  7136. }
  7137. return that
  7138. }
  7139. function fromObject (that, obj) {
  7140. if (Buffer.isBuffer(obj)) {
  7141. var len = checked(obj.length) | 0
  7142. that = createBuffer(that, len)
  7143. if (that.length === 0) {
  7144. return that
  7145. }
  7146. obj.copy(that, 0, 0, len)
  7147. return that
  7148. }
  7149. if (obj) {
  7150. if ((typeof ArrayBuffer !== 'undefined' &&
  7151. obj.buffer instanceof ArrayBuffer) || 'length' in obj) {
  7152. if (typeof obj.length !== 'number' || isnan(obj.length)) {
  7153. return createBuffer(that, 0)
  7154. }
  7155. return fromArrayLike(that, obj)
  7156. }
  7157. if (obj.type === 'Buffer' && isArray(obj.data)) {
  7158. return fromArrayLike(that, obj.data)
  7159. }
  7160. }
  7161. throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
  7162. }
  7163. function checked (length) {
  7164. // Note: cannot use `length < kMaxLength()` here because that fails when
  7165. // length is NaN (which is otherwise coerced to zero.)
  7166. if (length >= kMaxLength()) {
  7167. throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
  7168. 'size: 0x' + kMaxLength().toString(16) + ' bytes')
  7169. }
  7170. return length | 0
  7171. }
  7172. function SlowBuffer (length) {
  7173. if (+length != length) { // eslint-disable-line eqeqeq
  7174. length = 0
  7175. }
  7176. return Buffer.alloc(+length)
  7177. }
  7178. Buffer.isBuffer = function isBuffer (b) {
  7179. return !!(b != null && b._isBuffer)
  7180. }
  7181. Buffer.compare = function compare (a, b) {
  7182. if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
  7183. throw new TypeError('Arguments must be Buffers')
  7184. }
  7185. if (a === b) return 0
  7186. var x = a.length
  7187. var y = b.length
  7188. for (var i = 0, len = Math.min(x, y); i < len; ++i) {
  7189. if (a[i] !== b[i]) {
  7190. x = a[i]
  7191. y = b[i]
  7192. break
  7193. }
  7194. }
  7195. if (x < y) return -1
  7196. if (y < x) return 1
  7197. return 0
  7198. }
  7199. Buffer.isEncoding = function isEncoding (encoding) {
  7200. switch (String(encoding).toLowerCase()) {
  7201. case 'hex':
  7202. case 'utf8':
  7203. case 'utf-8':
  7204. case 'ascii':
  7205. case 'latin1':
  7206. case 'binary':
  7207. case 'base64':
  7208. case 'ucs2':
  7209. case 'ucs-2':
  7210. case 'utf16le':
  7211. case 'utf-16le':
  7212. return true
  7213. default:
  7214. return false
  7215. }
  7216. }
  7217. Buffer.concat = function concat (list, length) {
  7218. if (!isArray(list)) {
  7219. throw new TypeError('"list" argument must be an Array of Buffers')
  7220. }
  7221. if (list.length === 0) {
  7222. return Buffer.alloc(0)
  7223. }
  7224. var i
  7225. if (length === undefined) {
  7226. length = 0
  7227. for (i = 0; i < list.length; ++i) {
  7228. length += list[i].length
  7229. }
  7230. }
  7231. var buffer = Buffer.allocUnsafe(length)
  7232. var pos = 0
  7233. for (i = 0; i < list.length; ++i) {
  7234. var buf = list[i]
  7235. if (!Buffer.isBuffer(buf)) {
  7236. throw new TypeError('"list" argument must be an Array of Buffers')
  7237. }
  7238. buf.copy(buffer, pos)
  7239. pos += buf.length
  7240. }
  7241. return buffer
  7242. }
  7243. function byteLength (string, encoding) {
  7244. if (Buffer.isBuffer(string)) {
  7245. return string.length
  7246. }
  7247. if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&
  7248. (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
  7249. return string.byteLength
  7250. }
  7251. if (typeof string !== 'string') {
  7252. string = '' + string
  7253. }
  7254. var len = string.length
  7255. if (len === 0) return 0
  7256. // Use a for loop to avoid recursion
  7257. var loweredCase = false
  7258. for (;;) {
  7259. switch (encoding) {
  7260. case 'ascii':
  7261. case 'latin1':
  7262. case 'binary':
  7263. return len
  7264. case 'utf8':
  7265. case 'utf-8':
  7266. case undefined:
  7267. return utf8ToBytes(string).length
  7268. case 'ucs2':
  7269. case 'ucs-2':
  7270. case 'utf16le':
  7271. case 'utf-16le':
  7272. return len * 2
  7273. case 'hex':
  7274. return len >>> 1
  7275. case 'base64':
  7276. return base64ToBytes(string).length
  7277. default:
  7278. if (loweredCase) return utf8ToBytes(string).length // assume utf8
  7279. encoding = ('' + encoding).toLowerCase()
  7280. loweredCase = true
  7281. }
  7282. }
  7283. }
  7284. Buffer.byteLength = byteLength
  7285. function slowToString (encoding, start, end) {
  7286. var loweredCase = false
  7287. // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
  7288. // property of a typed array.
  7289. // This behaves neither like String nor Uint8Array in that we set start/end
  7290. // to their upper/lower bounds if the value passed is out of range.
  7291. // undefined is handled specially as per ECMA-262 6th Edition,
  7292. // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
  7293. if (start === undefined || start < 0) {
  7294. start = 0
  7295. }
  7296. // Return early if start > this.length. Done here to prevent potential uint32
  7297. // coercion fail below.
  7298. if (start > this.length) {
  7299. return ''
  7300. }
  7301. if (end === undefined || end > this.length) {
  7302. end = this.length
  7303. }
  7304. if (end <= 0) {
  7305. return ''
  7306. }
  7307. // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
  7308. end >>>= 0
  7309. start >>>= 0
  7310. if (end <= start) {
  7311. return ''
  7312. }
  7313. if (!encoding) encoding = 'utf8'
  7314. while (true) {
  7315. switch (encoding) {
  7316. case 'hex':
  7317. return hexSlice(this, start, end)
  7318. case 'utf8':
  7319. case 'utf-8':
  7320. return utf8Slice(this, start, end)
  7321. case 'ascii':
  7322. return asciiSlice(this, start, end)
  7323. case 'latin1':
  7324. case 'binary':
  7325. return latin1Slice(this, start, end)
  7326. case 'base64':
  7327. return base64Slice(this, start, end)
  7328. case 'ucs2':
  7329. case 'ucs-2':
  7330. case 'utf16le':
  7331. case 'utf-16le':
  7332. return utf16leSlice(this, start, end)
  7333. default:
  7334. if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
  7335. encoding = (encoding + '').toLowerCase()
  7336. loweredCase = true
  7337. }
  7338. }
  7339. }
  7340. // The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
  7341. // Buffer instances.
  7342. Buffer.prototype._isBuffer = true
  7343. function swap (b, n, m) {
  7344. var i = b[n]
  7345. b[n] = b[m]
  7346. b[m] = i
  7347. }
  7348. Buffer.prototype.swap16 = function swap16 () {
  7349. var len = this.length
  7350. if (len % 2 !== 0) {
  7351. throw new RangeError('Buffer size must be a multiple of 16-bits')
  7352. }
  7353. for (var i = 0; i < len; i += 2) {
  7354. swap(this, i, i + 1)
  7355. }
  7356. return this
  7357. }
  7358. Buffer.prototype.swap32 = function swap32 () {
  7359. var len = this.length
  7360. if (len % 4 !== 0) {
  7361. throw new RangeError('Buffer size must be a multiple of 32-bits')
  7362. }
  7363. for (var i = 0; i < len; i += 4) {
  7364. swap(this, i, i + 3)
  7365. swap(this, i + 1, i + 2)
  7366. }
  7367. return this
  7368. }
  7369. Buffer.prototype.swap64 = function swap64 () {
  7370. var len = this.length
  7371. if (len % 8 !== 0) {
  7372. throw new RangeError('Buffer size must be a multiple of 64-bits')
  7373. }
  7374. for (var i = 0; i < len; i += 8) {
  7375. swap(this, i, i + 7)
  7376. swap(this, i + 1, i + 6)
  7377. swap(this, i + 2, i + 5)
  7378. swap(this, i + 3, i + 4)
  7379. }
  7380. return this
  7381. }
  7382. Buffer.prototype.toString = function toString () {
  7383. var length = this.length | 0
  7384. if (length === 0) return ''
  7385. if (arguments.length === 0) return utf8Slice(this, 0, length)
  7386. return slowToString.apply(this, arguments)
  7387. }
  7388. Buffer.prototype.equals = function equals (b) {
  7389. if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
  7390. if (this === b) return true
  7391. return Buffer.compare(this, b) === 0
  7392. }
  7393. Buffer.prototype.inspect = function inspect () {
  7394. var str = ''
  7395. var max = exports.INSPECT_MAX_BYTES
  7396. if (this.length > 0) {
  7397. str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
  7398. if (this.length > max) str += ' ... '
  7399. }
  7400. return '<Buffer ' + str + '>'
  7401. }
  7402. Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
  7403. if (!Buffer.isBuffer(target)) {
  7404. throw new TypeError('Argument must be a Buffer')
  7405. }
  7406. if (start === undefined) {
  7407. start = 0
  7408. }
  7409. if (end === undefined) {
  7410. end = target ? target.length : 0
  7411. }
  7412. if (thisStart === undefined) {
  7413. thisStart = 0
  7414. }
  7415. if (thisEnd === undefined) {
  7416. thisEnd = this.length
  7417. }
  7418. if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
  7419. throw new RangeError('out of range index')
  7420. }
  7421. if (thisStart >= thisEnd && start >= end) {
  7422. return 0
  7423. }
  7424. if (thisStart >= thisEnd) {
  7425. return -1
  7426. }
  7427. if (start >= end) {
  7428. return 1
  7429. }
  7430. start >>>= 0
  7431. end >>>= 0
  7432. thisStart >>>= 0
  7433. thisEnd >>>= 0
  7434. if (this === target) return 0
  7435. var x = thisEnd - thisStart
  7436. var y = end - start
  7437. var len = Math.min(x, y)
  7438. var thisCopy = this.slice(thisStart, thisEnd)
  7439. var targetCopy = target.slice(start, end)
  7440. for (var i = 0; i < len; ++i) {
  7441. if (thisCopy[i] !== targetCopy[i]) {
  7442. x = thisCopy[i]
  7443. y = targetCopy[i]
  7444. break
  7445. }
  7446. }
  7447. if (x < y) return -1
  7448. if (y < x) return 1
  7449. return 0
  7450. }
  7451. // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
  7452. // OR the last index of `val` in `buffer` at offset <= `byteOffset`.
  7453. //
  7454. // Arguments:
  7455. // - buffer - a Buffer to search
  7456. // - val - a string, Buffer, or number
  7457. // - byteOffset - an index into `buffer`; will be clamped to an int32
  7458. // - encoding - an optional encoding, relevant is val is a string
  7459. // - dir - true for indexOf, false for lastIndexOf
  7460. function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
  7461. // Empty buffer means no match
  7462. if (buffer.length === 0) return -1
  7463. // Normalize byteOffset
  7464. if (typeof byteOffset === 'string') {
  7465. encoding = byteOffset
  7466. byteOffset = 0
  7467. } else if (byteOffset > 0x7fffffff) {
  7468. byteOffset = 0x7fffffff
  7469. } else if (byteOffset < -0x80000000) {
  7470. byteOffset = -0x80000000
  7471. }
  7472. byteOffset = +byteOffset // Coerce to Number.
  7473. if (isNaN(byteOffset)) {
  7474. // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
  7475. byteOffset = dir ? 0 : (buffer.length - 1)
  7476. }
  7477. // Normalize byteOffset: negative offsets start from the end of the buffer
  7478. if (byteOffset < 0) byteOffset = buffer.length + byteOffset
  7479. if (byteOffset >= buffer.length) {
  7480. if (dir) return -1
  7481. else byteOffset = buffer.length - 1
  7482. } else if (byteOffset < 0) {
  7483. if (dir) byteOffset = 0
  7484. else return -1
  7485. }
  7486. // Normalize val
  7487. if (typeof val === 'string') {
  7488. val = Buffer.from(val, encoding)
  7489. }
  7490. // Finally, search either indexOf (if dir is true) or lastIndexOf
  7491. if (Buffer.isBuffer(val)) {
  7492. // Special case: looking for empty string/buffer always fails
  7493. if (val.length === 0) {
  7494. return -1
  7495. }
  7496. return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
  7497. } else if (typeof val === 'number') {
  7498. val = val & 0xFF // Search for a byte value [0-255]
  7499. if (Buffer.TYPED_ARRAY_SUPPORT &&
  7500. typeof Uint8Array.prototype.indexOf === 'function') {
  7501. if (dir) {
  7502. return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
  7503. } else {
  7504. return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
  7505. }
  7506. }
  7507. return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
  7508. }
  7509. throw new TypeError('val must be string, number or Buffer')
  7510. }
  7511. function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
  7512. var indexSize = 1
  7513. var arrLength = arr.length
  7514. var valLength = val.length
  7515. if (encoding !== undefined) {
  7516. encoding = String(encoding).toLowerCase()
  7517. if (encoding === 'ucs2' || encoding === 'ucs-2' ||
  7518. encoding === 'utf16le' || encoding === 'utf-16le') {
  7519. if (arr.length < 2 || val.length < 2) {
  7520. return -1
  7521. }
  7522. indexSize = 2
  7523. arrLength /= 2
  7524. valLength /= 2
  7525. byteOffset /= 2
  7526. }
  7527. }
  7528. function read (buf, i) {
  7529. if (indexSize === 1) {
  7530. return buf[i]
  7531. } else {
  7532. return buf.readUInt16BE(i * indexSize)
  7533. }
  7534. }
  7535. var i
  7536. if (dir) {
  7537. var foundIndex = -1
  7538. for (i = byteOffset; i < arrLength; i++) {
  7539. if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
  7540. if (foundIndex === -1) foundIndex = i
  7541. if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
  7542. } else {
  7543. if (foundIndex !== -1) i -= i - foundIndex
  7544. foundIndex = -1
  7545. }
  7546. }
  7547. } else {
  7548. if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
  7549. for (i = byteOffset; i >= 0; i--) {
  7550. var found = true
  7551. for (var j = 0; j < valLength; j++) {
  7552. if (read(arr, i + j) !== read(val, j)) {
  7553. found = false
  7554. break
  7555. }
  7556. }
  7557. if (found) return i
  7558. }
  7559. }
  7560. return -1
  7561. }
  7562. Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
  7563. return this.indexOf(val, byteOffset, encoding) !== -1
  7564. }
  7565. Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
  7566. return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
  7567. }
  7568. Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
  7569. return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
  7570. }
  7571. function hexWrite (buf, string, offset, length) {
  7572. offset = Number(offset) || 0
  7573. var remaining = buf.length - offset
  7574. if (!length) {
  7575. length = remaining
  7576. } else {
  7577. length = Number(length)
  7578. if (length > remaining) {
  7579. length = remaining
  7580. }
  7581. }
  7582. // must be an even number of digits
  7583. var strLen = string.length
  7584. if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
  7585. if (length > strLen / 2) {
  7586. length = strLen / 2
  7587. }
  7588. for (var i = 0; i < length; ++i) {
  7589. var parsed = parseInt(string.substr(i * 2, 2), 16)
  7590. if (isNaN(parsed)) return i
  7591. buf[offset + i] = parsed
  7592. }
  7593. return i
  7594. }
  7595. function utf8Write (buf, string, offset, length) {
  7596. return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
  7597. }
  7598. function asciiWrite (buf, string, offset, length) {
  7599. return blitBuffer(asciiToBytes(string), buf, offset, length)
  7600. }
  7601. function latin1Write (buf, string, offset, length) {
  7602. return asciiWrite(buf, string, offset, length)
  7603. }
  7604. function base64Write (buf, string, offset, length) {
  7605. return blitBuffer(base64ToBytes(string), buf, offset, length)
  7606. }
  7607. function ucs2Write (buf, string, offset, length) {
  7608. return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
  7609. }
  7610. Buffer.prototype.write = function write (string, offset, length, encoding) {
  7611. // Buffer#write(string)
  7612. if (offset === undefined) {
  7613. encoding = 'utf8'
  7614. length = this.length
  7615. offset = 0
  7616. // Buffer#write(string, encoding)
  7617. } else if (length === undefined && typeof offset === 'string') {
  7618. encoding = offset
  7619. length = this.length
  7620. offset = 0
  7621. // Buffer#write(string, offset[, length][, encoding])
  7622. } else if (isFinite(offset)) {
  7623. offset = offset | 0
  7624. if (isFinite(length)) {
  7625. length = length | 0
  7626. if (encoding === undefined) encoding = 'utf8'
  7627. } else {
  7628. encoding = length
  7629. length = undefined
  7630. }
  7631. // legacy write(string, encoding, offset, length) - remove in v0.13
  7632. } else {
  7633. throw new Error(
  7634. 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
  7635. )
  7636. }
  7637. var remaining = this.length - offset
  7638. if (length === undefined || length > remaining) length = remaining
  7639. if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
  7640. throw new RangeError('Attempt to write outside buffer bounds')
  7641. }
  7642. if (!encoding) encoding = 'utf8'
  7643. var loweredCase = false
  7644. for (;;) {
  7645. switch (encoding) {
  7646. case 'hex':
  7647. return hexWrite(this, string, offset, length)
  7648. case 'utf8':
  7649. case 'utf-8':
  7650. return utf8Write(this, string, offset, length)
  7651. case 'ascii':
  7652. return asciiWrite(this, string, offset, length)
  7653. case 'latin1':
  7654. case 'binary':
  7655. return latin1Write(this, string, offset, length)
  7656. case 'base64':
  7657. // Warning: maxLength not taken into account in base64Write
  7658. return base64Write(this, string, offset, length)
  7659. case 'ucs2':
  7660. case 'ucs-2':
  7661. case 'utf16le':
  7662. case 'utf-16le':
  7663. return ucs2Write(this, string, offset, length)
  7664. default:
  7665. if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
  7666. encoding = ('' + encoding).toLowerCase()
  7667. loweredCase = true
  7668. }
  7669. }
  7670. }
  7671. Buffer.prototype.toJSON = function toJSON () {
  7672. return {
  7673. type: 'Buffer',
  7674. data: Array.prototype.slice.call(this._arr || this, 0)
  7675. }
  7676. }
  7677. function base64Slice (buf, start, end) {
  7678. if (start === 0 && end === buf.length) {
  7679. return base64.fromByteArray(buf)
  7680. } else {
  7681. return base64.fromByteArray(buf.slice(start, end))
  7682. }
  7683. }
  7684. function utf8Slice (buf, start, end) {
  7685. end = Math.min(buf.length, end)
  7686. var res = []
  7687. var i = start
  7688. while (i < end) {
  7689. var firstByte = buf[i]
  7690. var codePoint = null
  7691. var bytesPerSequence = (firstByte > 0xEF) ? 4
  7692. : (firstByte > 0xDF) ? 3
  7693. : (firstByte > 0xBF) ? 2
  7694. : 1
  7695. if (i + bytesPerSequence <= end) {
  7696. var secondByte, thirdByte, fourthByte, tempCodePoint
  7697. switch (bytesPerSequence) {
  7698. case 1:
  7699. if (firstByte < 0x80) {
  7700. codePoint = firstByte
  7701. }
  7702. break
  7703. case 2:
  7704. secondByte = buf[i + 1]
  7705. if ((secondByte & 0xC0) === 0x80) {
  7706. tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
  7707. if (tempCodePoint > 0x7F) {
  7708. codePoint = tempCodePoint
  7709. }
  7710. }
  7711. break
  7712. case 3:
  7713. secondByte = buf[i + 1]
  7714. thirdByte = buf[i + 2]
  7715. if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
  7716. tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
  7717. if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
  7718. codePoint = tempCodePoint
  7719. }
  7720. }
  7721. break
  7722. case 4:
  7723. secondByte = buf[i + 1]
  7724. thirdByte = buf[i + 2]
  7725. fourthByte = buf[i + 3]
  7726. if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
  7727. tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
  7728. if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
  7729. codePoint = tempCodePoint
  7730. }
  7731. }
  7732. }
  7733. }
  7734. if (codePoint === null) {
  7735. // we did not generate a valid codePoint so insert a
  7736. // replacement char (U+FFFD) and advance only 1 byte
  7737. codePoint = 0xFFFD
  7738. bytesPerSequence = 1
  7739. } else if (codePoint > 0xFFFF) {
  7740. // encode to utf16 (surrogate pair dance)
  7741. codePoint -= 0x10000
  7742. res.push(codePoint >>> 10 & 0x3FF | 0xD800)
  7743. codePoint = 0xDC00 | codePoint & 0x3FF
  7744. }
  7745. res.push(codePoint)
  7746. i += bytesPerSequence
  7747. }
  7748. return decodeCodePointsArray(res)
  7749. }
  7750. // Based on http://stackoverflow.com/a/22747272/680742, the browser with
  7751. // the lowest limit is Chrome, with 0x10000 args.
  7752. // We go 1 magnitude less, for safety
  7753. var MAX_ARGUMENTS_LENGTH = 0x1000
  7754. function decodeCodePointsArray (codePoints) {
  7755. var len = codePoints.length
  7756. if (len <= MAX_ARGUMENTS_LENGTH) {
  7757. return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
  7758. }
  7759. // Decode in chunks to avoid "call stack size exceeded".
  7760. var res = ''
  7761. var i = 0
  7762. while (i < len) {
  7763. res += String.fromCharCode.apply(
  7764. String,
  7765. codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
  7766. )
  7767. }
  7768. return res
  7769. }
  7770. function asciiSlice (buf, start, end) {
  7771. var ret = ''
  7772. end = Math.min(buf.length, end)
  7773. for (var i = start; i < end; ++i) {
  7774. ret += String.fromCharCode(buf[i] & 0x7F)
  7775. }
  7776. return ret
  7777. }
  7778. function latin1Slice (buf, start, end) {
  7779. var ret = ''
  7780. end = Math.min(buf.length, end)
  7781. for (var i = start; i < end; ++i) {
  7782. ret += String.fromCharCode(buf[i])
  7783. }
  7784. return ret
  7785. }
  7786. function hexSlice (buf, start, end) {
  7787. var len = buf.length
  7788. if (!start || start < 0) start = 0
  7789. if (!end || end < 0 || end > len) end = len
  7790. var out = ''
  7791. for (var i = start; i < end; ++i) {
  7792. out += toHex(buf[i])
  7793. }
  7794. return out
  7795. }
  7796. function utf16leSlice (buf, start, end) {
  7797. var bytes = buf.slice(start, end)
  7798. var res = ''
  7799. for (var i = 0; i < bytes.length; i += 2) {
  7800. res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
  7801. }
  7802. return res
  7803. }
  7804. Buffer.prototype.slice = function slice (start, end) {
  7805. var len = this.length
  7806. start = ~~start
  7807. end = end === undefined ? len : ~~end
  7808. if (start < 0) {
  7809. start += len
  7810. if (start < 0) start = 0
  7811. } else if (start > len) {
  7812. start = len
  7813. }
  7814. if (end < 0) {
  7815. end += len
  7816. if (end < 0) end = 0
  7817. } else if (end > len) {
  7818. end = len
  7819. }
  7820. if (end < start) end = start
  7821. var newBuf
  7822. if (Buffer.TYPED_ARRAY_SUPPORT) {
  7823. newBuf = this.subarray(start, end)
  7824. newBuf.__proto__ = Buffer.prototype
  7825. } else {
  7826. var sliceLen = end - start
  7827. newBuf = new Buffer(sliceLen, undefined)
  7828. for (var i = 0; i < sliceLen; ++i) {
  7829. newBuf[i] = this[i + start]
  7830. }
  7831. }
  7832. return newBuf
  7833. }
  7834. /*
  7835. * Need to make sure that buffer isn't trying to write out of bounds.
  7836. */
  7837. function checkOffset (offset, ext, length) {
  7838. if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
  7839. if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
  7840. }
  7841. Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
  7842. offset = offset | 0
  7843. byteLength = byteLength | 0
  7844. if (!noAssert) checkOffset(offset, byteLength, this.length)
  7845. var val = this[offset]
  7846. var mul = 1
  7847. var i = 0
  7848. while (++i < byteLength && (mul *= 0x100)) {
  7849. val += this[offset + i] * mul
  7850. }
  7851. return val
  7852. }
  7853. Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
  7854. offset = offset | 0
  7855. byteLength = byteLength | 0
  7856. if (!noAssert) {
  7857. checkOffset(offset, byteLength, this.length)
  7858. }
  7859. var val = this[offset + --byteLength]
  7860. var mul = 1
  7861. while (byteLength > 0 && (mul *= 0x100)) {
  7862. val += this[offset + --byteLength] * mul
  7863. }
  7864. return val
  7865. }
  7866. Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
  7867. if (!noAssert) checkOffset(offset, 1, this.length)
  7868. return this[offset]
  7869. }
  7870. Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
  7871. if (!noAssert) checkOffset(offset, 2, this.length)
  7872. return this[offset] | (this[offset + 1] << 8)
  7873. }
  7874. Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
  7875. if (!noAssert) checkOffset(offset, 2, this.length)
  7876. return (this[offset] << 8) | this[offset + 1]
  7877. }
  7878. Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
  7879. if (!noAssert) checkOffset(offset, 4, this.length)
  7880. return ((this[offset]) |
  7881. (this[offset + 1] << 8) |
  7882. (this[offset + 2] << 16)) +
  7883. (this[offset + 3] * 0x1000000)
  7884. }
  7885. Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
  7886. if (!noAssert) checkOffset(offset, 4, this.length)
  7887. return (this[offset] * 0x1000000) +
  7888. ((this[offset + 1] << 16) |
  7889. (this[offset + 2] << 8) |
  7890. this[offset + 3])
  7891. }
  7892. Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
  7893. offset = offset | 0
  7894. byteLength = byteLength | 0
  7895. if (!noAssert) checkOffset(offset, byteLength, this.length)
  7896. var val = this[offset]
  7897. var mul = 1
  7898. var i = 0
  7899. while (++i < byteLength && (mul *= 0x100)) {
  7900. val += this[offset + i] * mul
  7901. }
  7902. mul *= 0x80
  7903. if (val >= mul) val -= Math.pow(2, 8 * byteLength)
  7904. return val
  7905. }
  7906. Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
  7907. offset = offset | 0
  7908. byteLength = byteLength | 0
  7909. if (!noAssert) checkOffset(offset, byteLength, this.length)
  7910. var i = byteLength
  7911. var mul = 1
  7912. var val = this[offset + --i]
  7913. while (i > 0 && (mul *= 0x100)) {
  7914. val += this[offset + --i] * mul
  7915. }
  7916. mul *= 0x80
  7917. if (val >= mul) val -= Math.pow(2, 8 * byteLength)
  7918. return val
  7919. }
  7920. Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
  7921. if (!noAssert) checkOffset(offset, 1, this.length)
  7922. if (!(this[offset] & 0x80)) return (this[offset])
  7923. return ((0xff - this[offset] + 1) * -1)
  7924. }
  7925. Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
  7926. if (!noAssert) checkOffset(offset, 2, this.length)
  7927. var val = this[offset] | (this[offset + 1] << 8)
  7928. return (val & 0x8000) ? val | 0xFFFF0000 : val
  7929. }
  7930. Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
  7931. if (!noAssert) checkOffset(offset, 2, this.length)
  7932. var val = this[offset + 1] | (this[offset] << 8)
  7933. return (val & 0x8000) ? val | 0xFFFF0000 : val
  7934. }
  7935. Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
  7936. if (!noAssert) checkOffset(offset, 4, this.length)
  7937. return (this[offset]) |
  7938. (this[offset + 1] << 8) |
  7939. (this[offset + 2] << 16) |
  7940. (this[offset + 3] << 24)
  7941. }
  7942. Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
  7943. if (!noAssert) checkOffset(offset, 4, this.length)
  7944. return (this[offset] << 24) |
  7945. (this[offset + 1] << 16) |
  7946. (this[offset + 2] << 8) |
  7947. (this[offset + 3])
  7948. }
  7949. Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
  7950. if (!noAssert) checkOffset(offset, 4, this.length)
  7951. return ieee754.read(this, offset, true, 23, 4)
  7952. }
  7953. Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
  7954. if (!noAssert) checkOffset(offset, 4, this.length)
  7955. return ieee754.read(this, offset, false, 23, 4)
  7956. }
  7957. Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
  7958. if (!noAssert) checkOffset(offset, 8, this.length)
  7959. return ieee754.read(this, offset, true, 52, 8)
  7960. }
  7961. Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
  7962. if (!noAssert) checkOffset(offset, 8, this.length)
  7963. return ieee754.read(this, offset, false, 52, 8)
  7964. }
  7965. function checkInt (buf, value, offset, ext, max, min) {
  7966. if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
  7967. if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
  7968. if (offset + ext > buf.length) throw new RangeError('Index out of range')
  7969. }
  7970. Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
  7971. value = +value
  7972. offset = offset | 0
  7973. byteLength = byteLength | 0
  7974. if (!noAssert) {
  7975. var maxBytes = Math.pow(2, 8 * byteLength) - 1
  7976. checkInt(this, value, offset, byteLength, maxBytes, 0)
  7977. }
  7978. var mul = 1
  7979. var i = 0
  7980. this[offset] = value & 0xFF
  7981. while (++i < byteLength && (mul *= 0x100)) {
  7982. this[offset + i] = (value / mul) & 0xFF
  7983. }
  7984. return offset + byteLength
  7985. }
  7986. Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
  7987. value = +value
  7988. offset = offset | 0
  7989. byteLength = byteLength | 0
  7990. if (!noAssert) {
  7991. var maxBytes = Math.pow(2, 8 * byteLength) - 1
  7992. checkInt(this, value, offset, byteLength, maxBytes, 0)
  7993. }
  7994. var i = byteLength - 1
  7995. var mul = 1
  7996. this[offset + i] = value & 0xFF
  7997. while (--i >= 0 && (mul *= 0x100)) {
  7998. this[offset + i] = (value / mul) & 0xFF
  7999. }
  8000. return offset + byteLength
  8001. }
  8002. Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
  8003. value = +value
  8004. offset = offset | 0
  8005. if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
  8006. if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
  8007. this[offset] = (value & 0xff)
  8008. return offset + 1
  8009. }
  8010. function objectWriteUInt16 (buf, value, offset, littleEndian) {
  8011. if (value < 0) value = 0xffff + value + 1
  8012. for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
  8013. buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
  8014. (littleEndian ? i : 1 - i) * 8
  8015. }
  8016. }
  8017. Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
  8018. value = +value
  8019. offset = offset | 0
  8020. if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  8021. if (Buffer.TYPED_ARRAY_SUPPORT) {
  8022. this[offset] = (value & 0xff)
  8023. this[offset + 1] = (value >>> 8)
  8024. } else {
  8025. objectWriteUInt16(this, value, offset, true)
  8026. }
  8027. return offset + 2
  8028. }
  8029. Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
  8030. value = +value
  8031. offset = offset | 0
  8032. if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  8033. if (Buffer.TYPED_ARRAY_SUPPORT) {
  8034. this[offset] = (value >>> 8)
  8035. this[offset + 1] = (value & 0xff)
  8036. } else {
  8037. objectWriteUInt16(this, value, offset, false)
  8038. }
  8039. return offset + 2
  8040. }
  8041. function objectWriteUInt32 (buf, value, offset, littleEndian) {
  8042. if (value < 0) value = 0xffffffff + value + 1
  8043. for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
  8044. buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
  8045. }
  8046. }
  8047. Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
  8048. value = +value
  8049. offset = offset | 0
  8050. if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  8051. if (Buffer.TYPED_ARRAY_SUPPORT) {
  8052. this[offset + 3] = (value >>> 24)
  8053. this[offset + 2] = (value >>> 16)
  8054. this[offset + 1] = (value >>> 8)
  8055. this[offset] = (value & 0xff)
  8056. } else {
  8057. objectWriteUInt32(this, value, offset, true)
  8058. }
  8059. return offset + 4
  8060. }
  8061. Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
  8062. value = +value
  8063. offset = offset | 0
  8064. if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  8065. if (Buffer.TYPED_ARRAY_SUPPORT) {
  8066. this[offset] = (value >>> 24)
  8067. this[offset + 1] = (value >>> 16)
  8068. this[offset + 2] = (value >>> 8)
  8069. this[offset + 3] = (value & 0xff)
  8070. } else {
  8071. objectWriteUInt32(this, value, offset, false)
  8072. }
  8073. return offset + 4
  8074. }
  8075. Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
  8076. value = +value
  8077. offset = offset | 0
  8078. if (!noAssert) {
  8079. var limit = Math.pow(2, 8 * byteLength - 1)
  8080. checkInt(this, value, offset, byteLength, limit - 1, -limit)
  8081. }
  8082. var i = 0
  8083. var mul = 1
  8084. var sub = 0
  8085. this[offset] = value & 0xFF
  8086. while (++i < byteLength && (mul *= 0x100)) {
  8087. if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
  8088. sub = 1
  8089. }
  8090. this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  8091. }
  8092. return offset + byteLength
  8093. }
  8094. Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
  8095. value = +value
  8096. offset = offset | 0
  8097. if (!noAssert) {
  8098. var limit = Math.pow(2, 8 * byteLength - 1)
  8099. checkInt(this, value, offset, byteLength, limit - 1, -limit)
  8100. }
  8101. var i = byteLength - 1
  8102. var mul = 1
  8103. var sub = 0
  8104. this[offset + i] = value & 0xFF
  8105. while (--i >= 0 && (mul *= 0x100)) {
  8106. if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
  8107. sub = 1
  8108. }
  8109. this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  8110. }
  8111. return offset + byteLength
  8112. }
  8113. Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
  8114. value = +value
  8115. offset = offset | 0
  8116. if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
  8117. if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
  8118. if (value < 0) value = 0xff + value + 1
  8119. this[offset] = (value & 0xff)
  8120. return offset + 1
  8121. }
  8122. Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
  8123. value = +value
  8124. offset = offset | 0
  8125. if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  8126. if (Buffer.TYPED_ARRAY_SUPPORT) {
  8127. this[offset] = (value & 0xff)
  8128. this[offset + 1] = (value >>> 8)
  8129. } else {
  8130. objectWriteUInt16(this, value, offset, true)
  8131. }
  8132. return offset + 2
  8133. }
  8134. Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
  8135. value = +value
  8136. offset = offset | 0
  8137. if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  8138. if (Buffer.TYPED_ARRAY_SUPPORT) {
  8139. this[offset] = (value >>> 8)
  8140. this[offset + 1] = (value & 0xff)
  8141. } else {
  8142. objectWriteUInt16(this, value, offset, false)
  8143. }
  8144. return offset + 2
  8145. }
  8146. Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
  8147. value = +value
  8148. offset = offset | 0
  8149. if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  8150. if (Buffer.TYPED_ARRAY_SUPPORT) {
  8151. this[offset] = (value & 0xff)
  8152. this[offset + 1] = (value >>> 8)
  8153. this[offset + 2] = (value >>> 16)
  8154. this[offset + 3] = (value >>> 24)
  8155. } else {
  8156. objectWriteUInt32(this, value, offset, true)
  8157. }
  8158. return offset + 4
  8159. }
  8160. Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
  8161. value = +value
  8162. offset = offset | 0
  8163. if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  8164. if (value < 0) value = 0xffffffff + value + 1
  8165. if (Buffer.TYPED_ARRAY_SUPPORT) {
  8166. this[offset] = (value >>> 24)
  8167. this[offset + 1] = (value >>> 16)
  8168. this[offset + 2] = (value >>> 8)
  8169. this[offset + 3] = (value & 0xff)
  8170. } else {
  8171. objectWriteUInt32(this, value, offset, false)
  8172. }
  8173. return offset + 4
  8174. }
  8175. function checkIEEE754 (buf, value, offset, ext, max, min) {
  8176. if (offset + ext > buf.length) throw new RangeError('Index out of range')
  8177. if (offset < 0) throw new RangeError('Index out of range')
  8178. }
  8179. function writeFloat (buf, value, offset, littleEndian, noAssert) {
  8180. if (!noAssert) {
  8181. checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
  8182. }
  8183. ieee754.write(buf, value, offset, littleEndian, 23, 4)
  8184. return offset + 4
  8185. }
  8186. Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
  8187. return writeFloat(this, value, offset, true, noAssert)
  8188. }
  8189. Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
  8190. return writeFloat(this, value, offset, false, noAssert)
  8191. }
  8192. function writeDouble (buf, value, offset, littleEndian, noAssert) {
  8193. if (!noAssert) {
  8194. checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
  8195. }
  8196. ieee754.write(buf, value, offset, littleEndian, 52, 8)
  8197. return offset + 8
  8198. }
  8199. Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
  8200. return writeDouble(this, value, offset, true, noAssert)
  8201. }
  8202. Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
  8203. return writeDouble(this, value, offset, false, noAssert)
  8204. }
  8205. // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
  8206. Buffer.prototype.copy = function copy (target, targetStart, start, end) {
  8207. if (!start) start = 0
  8208. if (!end && end !== 0) end = this.length
  8209. if (targetStart >= target.length) targetStart = target.length
  8210. if (!targetStart) targetStart = 0
  8211. if (end > 0 && end < start) end = start
  8212. // Copy 0 bytes; we're done
  8213. if (end === start) return 0
  8214. if (target.length === 0 || this.length === 0) return 0
  8215. // Fatal error conditions
  8216. if (targetStart < 0) {
  8217. throw new RangeError('targetStart out of bounds')
  8218. }
  8219. if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
  8220. if (end < 0) throw new RangeError('sourceEnd out of bounds')
  8221. // Are we oob?
  8222. if (end > this.length) end = this.length
  8223. if (target.length - targetStart < end - start) {
  8224. end = target.length - targetStart + start
  8225. }
  8226. var len = end - start
  8227. var i
  8228. if (this === target && start < targetStart && targetStart < end) {
  8229. // descending copy from end
  8230. for (i = len - 1; i >= 0; --i) {
  8231. target[i + targetStart] = this[i + start]
  8232. }
  8233. } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
  8234. // ascending copy from start
  8235. for (i = 0; i < len; ++i) {
  8236. target[i + targetStart] = this[i + start]
  8237. }
  8238. } else {
  8239. Uint8Array.prototype.set.call(
  8240. target,
  8241. this.subarray(start, start + len),
  8242. targetStart
  8243. )
  8244. }
  8245. return len
  8246. }
  8247. // Usage:
  8248. // buffer.fill(number[, offset[, end]])
  8249. // buffer.fill(buffer[, offset[, end]])
  8250. // buffer.fill(string[, offset[, end]][, encoding])
  8251. Buffer.prototype.fill = function fill (val, start, end, encoding) {
  8252. // Handle string cases:
  8253. if (typeof val === 'string') {
  8254. if (typeof start === 'string') {
  8255. encoding = start
  8256. start = 0
  8257. end = this.length
  8258. } else if (typeof end === 'string') {
  8259. encoding = end
  8260. end = this.length
  8261. }
  8262. if (val.length === 1) {
  8263. var code = val.charCodeAt(0)
  8264. if (code < 256) {
  8265. val = code
  8266. }
  8267. }
  8268. if (encoding !== undefined && typeof encoding !== 'string') {
  8269. throw new TypeError('encoding must be a string')
  8270. }
  8271. if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
  8272. throw new TypeError('Unknown encoding: ' + encoding)
  8273. }
  8274. } else if (typeof val === 'number') {
  8275. val = val & 255
  8276. }
  8277. // Invalid ranges are not set to a default, so can range check early.
  8278. if (start < 0 || this.length < start || this.length < end) {
  8279. throw new RangeError('Out of range index')
  8280. }
  8281. if (end <= start) {
  8282. return this
  8283. }
  8284. start = start >>> 0
  8285. end = end === undefined ? this.length : end >>> 0
  8286. if (!val) val = 0
  8287. var i
  8288. if (typeof val === 'number') {
  8289. for (i = start; i < end; ++i) {
  8290. this[i] = val
  8291. }
  8292. } else {
  8293. var bytes = Buffer.isBuffer(val)
  8294. ? val
  8295. : utf8ToBytes(new Buffer(val, encoding).toString())
  8296. var len = bytes.length
  8297. for (i = 0; i < end - start; ++i) {
  8298. this[i + start] = bytes[i % len]
  8299. }
  8300. }
  8301. return this
  8302. }
  8303. // HELPER FUNCTIONS
  8304. // ================
  8305. var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g
  8306. function base64clean (str) {
  8307. // Node strips out invalid characters like \n and \t from the string, base64-js does not
  8308. str = stringtrim(str).replace(INVALID_BASE64_RE, '')
  8309. // Node converts strings with length < 2 to ''
  8310. if (str.length < 2) return ''
  8311. // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
  8312. while (str.length % 4 !== 0) {
  8313. str = str + '='
  8314. }
  8315. return str
  8316. }
  8317. function stringtrim (str) {
  8318. if (str.trim) return str.trim()
  8319. return str.replace(/^\s+|\s+$/g, '')
  8320. }
  8321. function toHex (n) {
  8322. if (n < 16) return '0' + n.toString(16)
  8323. return n.toString(16)
  8324. }
  8325. function utf8ToBytes (string, units) {
  8326. units = units || Infinity
  8327. var codePoint
  8328. var length = string.length
  8329. var leadSurrogate = null
  8330. var bytes = []
  8331. for (var i = 0; i < length; ++i) {
  8332. codePoint = string.charCodeAt(i)
  8333. // is surrogate component
  8334. if (codePoint > 0xD7FF && codePoint < 0xE000) {
  8335. // last char was a lead
  8336. if (!leadSurrogate) {
  8337. // no lead yet
  8338. if (codePoint > 0xDBFF) {
  8339. // unexpected trail
  8340. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  8341. continue
  8342. } else if (i + 1 === length) {
  8343. // unpaired lead
  8344. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  8345. continue
  8346. }
  8347. // valid lead
  8348. leadSurrogate = codePoint
  8349. continue
  8350. }
  8351. // 2 leads in a row
  8352. if (codePoint < 0xDC00) {
  8353. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  8354. leadSurrogate = codePoint
  8355. continue
  8356. }
  8357. // valid surrogate pair
  8358. codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
  8359. } else if (leadSurrogate) {
  8360. // valid bmp char, but last char was a lead
  8361. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  8362. }
  8363. leadSurrogate = null
  8364. // encode utf8
  8365. if (codePoint < 0x80) {
  8366. if ((units -= 1) < 0) break
  8367. bytes.push(codePoint)
  8368. } else if (codePoint < 0x800) {
  8369. if ((units -= 2) < 0) break
  8370. bytes.push(
  8371. codePoint >> 0x6 | 0xC0,
  8372. codePoint & 0x3F | 0x80
  8373. )
  8374. } else if (codePoint < 0x10000) {
  8375. if ((units -= 3) < 0) break
  8376. bytes.push(
  8377. codePoint >> 0xC | 0xE0,
  8378. codePoint >> 0x6 & 0x3F | 0x80,
  8379. codePoint & 0x3F | 0x80
  8380. )
  8381. } else if (codePoint < 0x110000) {
  8382. if ((units -= 4) < 0) break
  8383. bytes.push(
  8384. codePoint >> 0x12 | 0xF0,
  8385. codePoint >> 0xC & 0x3F | 0x80,
  8386. codePoint >> 0x6 & 0x3F | 0x80,
  8387. codePoint & 0x3F | 0x80
  8388. )
  8389. } else {
  8390. throw new Error('Invalid code point')
  8391. }
  8392. }
  8393. return bytes
  8394. }
  8395. function asciiToBytes (str) {
  8396. var byteArray = []
  8397. for (var i = 0; i < str.length; ++i) {
  8398. // Node's code seems to be doing this and not & 0x7F..
  8399. byteArray.push(str.charCodeAt(i) & 0xFF)
  8400. }
  8401. return byteArray
  8402. }
  8403. function utf16leToBytes (str, units) {
  8404. var c, hi, lo
  8405. var byteArray = []
  8406. for (var i = 0; i < str.length; ++i) {
  8407. if ((units -= 2) < 0) break
  8408. c = str.charCodeAt(i)
  8409. hi = c >> 8
  8410. lo = c % 256
  8411. byteArray.push(lo)
  8412. byteArray.push(hi)
  8413. }
  8414. return byteArray
  8415. }
  8416. function base64ToBytes (str) {
  8417. return base64.toByteArray(base64clean(str))
  8418. }
  8419. function blitBuffer (src, dst, offset, length) {
  8420. for (var i = 0; i < length; ++i) {
  8421. if ((i + offset >= dst.length) || (i >= src.length)) break
  8422. dst[i + offset] = src[i]
  8423. }
  8424. return i
  8425. }
  8426. function isnan (val) {
  8427. return val !== val // eslint-disable-line no-self-compare
  8428. }
  8429. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  8430. /***/ }),
  8431. /***/ "./node_modules/clipboard/dist/clipboard.js":
  8432. /*!**************************************************!*\
  8433. !*** ./node_modules/clipboard/dist/clipboard.js ***!
  8434. \**************************************************/
  8435. /*! no static exports found */
  8436. /***/ (function(module, exports, __webpack_require__) {
  8437. /*!
  8438. * clipboard.js v2.0.4
  8439. * https://zenorocha.github.io/clipboard.js
  8440. *
  8441. * Licensed MIT © Zeno Rocha
  8442. */
  8443. (function webpackUniversalModuleDefinition(root, factory) {
  8444. if(true)
  8445. module.exports = factory();
  8446. else {}
  8447. })(this, function() {
  8448. return /******/ (function(modules) { // webpackBootstrap
  8449. /******/ // The module cache
  8450. /******/ var installedModules = {};
  8451. /******/
  8452. /******/ // The require function
  8453. /******/ function __webpack_require__(moduleId) {
  8454. /******/
  8455. /******/ // Check if module is in cache
  8456. /******/ if(installedModules[moduleId]) {
  8457. /******/ return installedModules[moduleId].exports;
  8458. /******/ }
  8459. /******/ // Create a new module (and put it into the cache)
  8460. /******/ var module = installedModules[moduleId] = {
  8461. /******/ i: moduleId,
  8462. /******/ l: false,
  8463. /******/ exports: {}
  8464. /******/ };
  8465. /******/
  8466. /******/ // Execute the module function
  8467. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  8468. /******/
  8469. /******/ // Flag the module as loaded
  8470. /******/ module.l = true;
  8471. /******/
  8472. /******/ // Return the exports of the module
  8473. /******/ return module.exports;
  8474. /******/ }
  8475. /******/
  8476. /******/
  8477. /******/ // expose the modules object (__webpack_modules__)
  8478. /******/ __webpack_require__.m = modules;
  8479. /******/
  8480. /******/ // expose the module cache
  8481. /******/ __webpack_require__.c = installedModules;
  8482. /******/
  8483. /******/ // define getter function for harmony exports
  8484. /******/ __webpack_require__.d = function(exports, name, getter) {
  8485. /******/ if(!__webpack_require__.o(exports, name)) {
  8486. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  8487. /******/ }
  8488. /******/ };
  8489. /******/
  8490. /******/ // define __esModule on exports
  8491. /******/ __webpack_require__.r = function(exports) {
  8492. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  8493. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  8494. /******/ }
  8495. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  8496. /******/ };
  8497. /******/
  8498. /******/ // create a fake namespace object
  8499. /******/ // mode & 1: value is a module id, require it
  8500. /******/ // mode & 2: merge all properties of value into the ns
  8501. /******/ // mode & 4: return value when already ns object
  8502. /******/ // mode & 8|1: behave like require
  8503. /******/ __webpack_require__.t = function(value, mode) {
  8504. /******/ if(mode & 1) value = __webpack_require__(value);
  8505. /******/ if(mode & 8) return value;
  8506. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  8507. /******/ var ns = Object.create(null);
  8508. /******/ __webpack_require__.r(ns);
  8509. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  8510. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  8511. /******/ return ns;
  8512. /******/ };
  8513. /******/
  8514. /******/ // getDefaultExport function for compatibility with non-harmony modules
  8515. /******/ __webpack_require__.n = function(module) {
  8516. /******/ var getter = module && module.__esModule ?
  8517. /******/ function getDefault() { return module['default']; } :
  8518. /******/ function getModuleExports() { return module; };
  8519. /******/ __webpack_require__.d(getter, 'a', getter);
  8520. /******/ return getter;
  8521. /******/ };
  8522. /******/
  8523. /******/ // Object.prototype.hasOwnProperty.call
  8524. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  8525. /******/
  8526. /******/ // __webpack_public_path__
  8527. /******/ __webpack_require__.p = "";
  8528. /******/
  8529. /******/
  8530. /******/ // Load entry module and return exports
  8531. /******/ return __webpack_require__(__webpack_require__.s = 0);
  8532. /******/ })
  8533. /************************************************************************/
  8534. /******/ ([
  8535. /* 0 */
  8536. /***/ (function(module, exports, __webpack_require__) {
  8537. "use strict";
  8538. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  8539. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  8540. var _clipboardAction = __webpack_require__(1);
  8541. var _clipboardAction2 = _interopRequireDefault(_clipboardAction);
  8542. var _tinyEmitter = __webpack_require__(3);
  8543. var _tinyEmitter2 = _interopRequireDefault(_tinyEmitter);
  8544. var _goodListener = __webpack_require__(4);
  8545. var _goodListener2 = _interopRequireDefault(_goodListener);
  8546. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  8547. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8548. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  8549. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  8550. /**
  8551. * Base class which takes one or more elements, adds event listeners to them,
  8552. * and instantiates a new `ClipboardAction` on each click.
  8553. */
  8554. var Clipboard = function (_Emitter) {
  8555. _inherits(Clipboard, _Emitter);
  8556. /**
  8557. * @param {String|HTMLElement|HTMLCollection|NodeList} trigger
  8558. * @param {Object} options
  8559. */
  8560. function Clipboard(trigger, options) {
  8561. _classCallCheck(this, Clipboard);
  8562. var _this = _possibleConstructorReturn(this, (Clipboard.__proto__ || Object.getPrototypeOf(Clipboard)).call(this));
  8563. _this.resolveOptions(options);
  8564. _this.listenClick(trigger);
  8565. return _this;
  8566. }
  8567. /**
  8568. * Defines if attributes would be resolved using internal setter functions
  8569. * or custom functions that were passed in the constructor.
  8570. * @param {Object} options
  8571. */
  8572. _createClass(Clipboard, [{
  8573. key: 'resolveOptions',
  8574. value: function resolveOptions() {
  8575. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  8576. this.action = typeof options.action === 'function' ? options.action : this.defaultAction;
  8577. this.target = typeof options.target === 'function' ? options.target : this.defaultTarget;
  8578. this.text = typeof options.text === 'function' ? options.text : this.defaultText;
  8579. this.container = _typeof(options.container) === 'object' ? options.container : document.body;
  8580. }
  8581. /**
  8582. * Adds a click event listener to the passed trigger.
  8583. * @param {String|HTMLElement|HTMLCollection|NodeList} trigger
  8584. */
  8585. }, {
  8586. key: 'listenClick',
  8587. value: function listenClick(trigger) {
  8588. var _this2 = this;
  8589. this.listener = (0, _goodListener2.default)(trigger, 'click', function (e) {
  8590. return _this2.onClick(e);
  8591. });
  8592. }
  8593. /**
  8594. * Defines a new `ClipboardAction` on each click event.
  8595. * @param {Event} e
  8596. */
  8597. }, {
  8598. key: 'onClick',
  8599. value: function onClick(e) {
  8600. var trigger = e.delegateTarget || e.currentTarget;
  8601. if (this.clipboardAction) {
  8602. this.clipboardAction = null;
  8603. }
  8604. this.clipboardAction = new _clipboardAction2.default({
  8605. action: this.action(trigger),
  8606. target: this.target(trigger),
  8607. text: this.text(trigger),
  8608. container: this.container,
  8609. trigger: trigger,
  8610. emitter: this
  8611. });
  8612. }
  8613. /**
  8614. * Default `action` lookup function.
  8615. * @param {Element} trigger
  8616. */
  8617. }, {
  8618. key: 'defaultAction',
  8619. value: function defaultAction(trigger) {
  8620. return getAttributeValue('action', trigger);
  8621. }
  8622. /**
  8623. * Default `target` lookup function.
  8624. * @param {Element} trigger
  8625. */
  8626. }, {
  8627. key: 'defaultTarget',
  8628. value: function defaultTarget(trigger) {
  8629. var selector = getAttributeValue('target', trigger);
  8630. if (selector) {
  8631. return document.querySelector(selector);
  8632. }
  8633. }
  8634. /**
  8635. * Returns the support of the given action, or all actions if no action is
  8636. * given.
  8637. * @param {String} [action]
  8638. */
  8639. }, {
  8640. key: 'defaultText',
  8641. /**
  8642. * Default `text` lookup function.
  8643. * @param {Element} trigger
  8644. */
  8645. value: function defaultText(trigger) {
  8646. return getAttributeValue('text', trigger);
  8647. }
  8648. /**
  8649. * Destroy lifecycle.
  8650. */
  8651. }, {
  8652. key: 'destroy',
  8653. value: function destroy() {
  8654. this.listener.destroy();
  8655. if (this.clipboardAction) {
  8656. this.clipboardAction.destroy();
  8657. this.clipboardAction = null;
  8658. }
  8659. }
  8660. }], [{
  8661. key: 'isSupported',
  8662. value: function isSupported() {
  8663. var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['copy', 'cut'];
  8664. var actions = typeof action === 'string' ? [action] : action;
  8665. var support = !!document.queryCommandSupported;
  8666. actions.forEach(function (action) {
  8667. support = support && !!document.queryCommandSupported(action);
  8668. });
  8669. return support;
  8670. }
  8671. }]);
  8672. return Clipboard;
  8673. }(_tinyEmitter2.default);
  8674. /**
  8675. * Helper function to retrieve attribute value.
  8676. * @param {String} suffix
  8677. * @param {Element} element
  8678. */
  8679. function getAttributeValue(suffix, element) {
  8680. var attribute = 'data-clipboard-' + suffix;
  8681. if (!element.hasAttribute(attribute)) {
  8682. return;
  8683. }
  8684. return element.getAttribute(attribute);
  8685. }
  8686. module.exports = Clipboard;
  8687. /***/ }),
  8688. /* 1 */
  8689. /***/ (function(module, exports, __webpack_require__) {
  8690. "use strict";
  8691. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  8692. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  8693. var _select = __webpack_require__(2);
  8694. var _select2 = _interopRequireDefault(_select);
  8695. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  8696. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8697. /**
  8698. * Inner class which performs selection from either `text` or `target`
  8699. * properties and then executes copy or cut operations.
  8700. */
  8701. var ClipboardAction = function () {
  8702. /**
  8703. * @param {Object} options
  8704. */
  8705. function ClipboardAction(options) {
  8706. _classCallCheck(this, ClipboardAction);
  8707. this.resolveOptions(options);
  8708. this.initSelection();
  8709. }
  8710. /**
  8711. * Defines base properties passed from constructor.
  8712. * @param {Object} options
  8713. */
  8714. _createClass(ClipboardAction, [{
  8715. key: 'resolveOptions',
  8716. value: function resolveOptions() {
  8717. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  8718. this.action = options.action;
  8719. this.container = options.container;
  8720. this.emitter = options.emitter;
  8721. this.target = options.target;
  8722. this.text = options.text;
  8723. this.trigger = options.trigger;
  8724. this.selectedText = '';
  8725. }
  8726. /**
  8727. * Decides which selection strategy is going to be applied based
  8728. * on the existence of `text` and `target` properties.
  8729. */
  8730. }, {
  8731. key: 'initSelection',
  8732. value: function initSelection() {
  8733. if (this.text) {
  8734. this.selectFake();
  8735. } else if (this.target) {
  8736. this.selectTarget();
  8737. }
  8738. }
  8739. /**
  8740. * Creates a fake textarea element, sets its value from `text` property,
  8741. * and makes a selection on it.
  8742. */
  8743. }, {
  8744. key: 'selectFake',
  8745. value: function selectFake() {
  8746. var _this = this;
  8747. var isRTL = document.documentElement.getAttribute('dir') == 'rtl';
  8748. this.removeFake();
  8749. this.fakeHandlerCallback = function () {
  8750. return _this.removeFake();
  8751. };
  8752. this.fakeHandler = this.container.addEventListener('click', this.fakeHandlerCallback) || true;
  8753. this.fakeElem = document.createElement('textarea');
  8754. // Prevent zooming on iOS
  8755. this.fakeElem.style.fontSize = '12pt';
  8756. // Reset box model
  8757. this.fakeElem.style.border = '0';
  8758. this.fakeElem.style.padding = '0';
  8759. this.fakeElem.style.margin = '0';
  8760. // Move element out of screen horizontally
  8761. this.fakeElem.style.position = 'absolute';
  8762. this.fakeElem.style[isRTL ? 'right' : 'left'] = '-9999px';
  8763. // Move element to the same position vertically
  8764. var yPosition = window.pageYOffset || document.documentElement.scrollTop;
  8765. this.fakeElem.style.top = yPosition + 'px';
  8766. this.fakeElem.setAttribute('readonly', '');
  8767. this.fakeElem.value = this.text;
  8768. this.container.appendChild(this.fakeElem);
  8769. this.selectedText = (0, _select2.default)(this.fakeElem);
  8770. this.copyText();
  8771. }
  8772. /**
  8773. * Only removes the fake element after another click event, that way
  8774. * a user can hit `Ctrl+C` to copy because selection still exists.
  8775. */
  8776. }, {
  8777. key: 'removeFake',
  8778. value: function removeFake() {
  8779. if (this.fakeHandler) {
  8780. this.container.removeEventListener('click', this.fakeHandlerCallback);
  8781. this.fakeHandler = null;
  8782. this.fakeHandlerCallback = null;
  8783. }
  8784. if (this.fakeElem) {
  8785. this.container.removeChild(this.fakeElem);
  8786. this.fakeElem = null;
  8787. }
  8788. }
  8789. /**
  8790. * Selects the content from element passed on `target` property.
  8791. */
  8792. }, {
  8793. key: 'selectTarget',
  8794. value: function selectTarget() {
  8795. this.selectedText = (0, _select2.default)(this.target);
  8796. this.copyText();
  8797. }
  8798. /**
  8799. * Executes the copy operation based on the current selection.
  8800. */
  8801. }, {
  8802. key: 'copyText',
  8803. value: function copyText() {
  8804. var succeeded = void 0;
  8805. try {
  8806. succeeded = document.execCommand(this.action);
  8807. } catch (err) {
  8808. succeeded = false;
  8809. }
  8810. this.handleResult(succeeded);
  8811. }
  8812. /**
  8813. * Fires an event based on the copy operation result.
  8814. * @param {Boolean} succeeded
  8815. */
  8816. }, {
  8817. key: 'handleResult',
  8818. value: function handleResult(succeeded) {
  8819. this.emitter.emit(succeeded ? 'success' : 'error', {
  8820. action: this.action,
  8821. text: this.selectedText,
  8822. trigger: this.trigger,
  8823. clearSelection: this.clearSelection.bind(this)
  8824. });
  8825. }
  8826. /**
  8827. * Moves focus away from `target` and back to the trigger, removes current selection.
  8828. */
  8829. }, {
  8830. key: 'clearSelection',
  8831. value: function clearSelection() {
  8832. if (this.trigger) {
  8833. this.trigger.focus();
  8834. }
  8835. window.getSelection().removeAllRanges();
  8836. }
  8837. /**
  8838. * Sets the `action` to be performed which can be either 'copy' or 'cut'.
  8839. * @param {String} action
  8840. */
  8841. }, {
  8842. key: 'destroy',
  8843. /**
  8844. * Destroy lifecycle.
  8845. */
  8846. value: function destroy() {
  8847. this.removeFake();
  8848. }
  8849. }, {
  8850. key: 'action',
  8851. set: function set() {
  8852. var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'copy';
  8853. this._action = action;
  8854. if (this._action !== 'copy' && this._action !== 'cut') {
  8855. throw new Error('Invalid "action" value, use either "copy" or "cut"');
  8856. }
  8857. }
  8858. /**
  8859. * Gets the `action` property.
  8860. * @return {String}
  8861. */
  8862. ,
  8863. get: function get() {
  8864. return this._action;
  8865. }
  8866. /**
  8867. * Sets the `target` property using an element
  8868. * that will be have its content copied.
  8869. * @param {Element} target
  8870. */
  8871. }, {
  8872. key: 'target',
  8873. set: function set(target) {
  8874. if (target !== undefined) {
  8875. if (target && (typeof target === 'undefined' ? 'undefined' : _typeof(target)) === 'object' && target.nodeType === 1) {
  8876. if (this.action === 'copy' && target.hasAttribute('disabled')) {
  8877. throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');
  8878. }
  8879. if (this.action === 'cut' && (target.hasAttribute('readonly') || target.hasAttribute('disabled'))) {
  8880. throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');
  8881. }
  8882. this._target = target;
  8883. } else {
  8884. throw new Error('Invalid "target" value, use a valid Element');
  8885. }
  8886. }
  8887. }
  8888. /**
  8889. * Gets the `target` property.
  8890. * @return {String|HTMLElement}
  8891. */
  8892. ,
  8893. get: function get() {
  8894. return this._target;
  8895. }
  8896. }]);
  8897. return ClipboardAction;
  8898. }();
  8899. module.exports = ClipboardAction;
  8900. /***/ }),
  8901. /* 2 */
  8902. /***/ (function(module, exports) {
  8903. function select(element) {
  8904. var selectedText;
  8905. if (element.nodeName === 'SELECT') {
  8906. element.focus();
  8907. selectedText = element.value;
  8908. }
  8909. else if (element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA') {
  8910. var isReadOnly = element.hasAttribute('readonly');
  8911. if (!isReadOnly) {
  8912. element.setAttribute('readonly', '');
  8913. }
  8914. element.select();
  8915. element.setSelectionRange(0, element.value.length);
  8916. if (!isReadOnly) {
  8917. element.removeAttribute('readonly');
  8918. }
  8919. selectedText = element.value;
  8920. }
  8921. else {
  8922. if (element.hasAttribute('contenteditable')) {
  8923. element.focus();
  8924. }
  8925. var selection = window.getSelection();
  8926. var range = document.createRange();
  8927. range.selectNodeContents(element);
  8928. selection.removeAllRanges();
  8929. selection.addRange(range);
  8930. selectedText = selection.toString();
  8931. }
  8932. return selectedText;
  8933. }
  8934. module.exports = select;
  8935. /***/ }),
  8936. /* 3 */
  8937. /***/ (function(module, exports) {
  8938. function E () {
  8939. // Keep this empty so it's easier to inherit from
  8940. // (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
  8941. }
  8942. E.prototype = {
  8943. on: function (name, callback, ctx) {
  8944. var e = this.e || (this.e = {});
  8945. (e[name] || (e[name] = [])).push({
  8946. fn: callback,
  8947. ctx: ctx
  8948. });
  8949. return this;
  8950. },
  8951. once: function (name, callback, ctx) {
  8952. var self = this;
  8953. function listener () {
  8954. self.off(name, listener);
  8955. callback.apply(ctx, arguments);
  8956. };
  8957. listener._ = callback
  8958. return this.on(name, listener, ctx);
  8959. },
  8960. emit: function (name) {
  8961. var data = [].slice.call(arguments, 1);
  8962. var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
  8963. var i = 0;
  8964. var len = evtArr.length;
  8965. for (i; i < len; i++) {
  8966. evtArr[i].fn.apply(evtArr[i].ctx, data);
  8967. }
  8968. return this;
  8969. },
  8970. off: function (name, callback) {
  8971. var e = this.e || (this.e = {});
  8972. var evts = e[name];
  8973. var liveEvents = [];
  8974. if (evts && callback) {
  8975. for (var i = 0, len = evts.length; i < len; i++) {
  8976. if (evts[i].fn !== callback && evts[i].fn._ !== callback)
  8977. liveEvents.push(evts[i]);
  8978. }
  8979. }
  8980. // Remove event from queue to prevent memory leak
  8981. // Suggested by https://github.com/lazd
  8982. // Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
  8983. (liveEvents.length)
  8984. ? e[name] = liveEvents
  8985. : delete e[name];
  8986. return this;
  8987. }
  8988. };
  8989. module.exports = E;
  8990. /***/ }),
  8991. /* 4 */
  8992. /***/ (function(module, exports, __webpack_require__) {
  8993. var is = __webpack_require__(5);
  8994. var delegate = __webpack_require__(6);
  8995. /**
  8996. * Validates all params and calls the right
  8997. * listener function based on its target type.
  8998. *
  8999. * @param {String|HTMLElement|HTMLCollection|NodeList} target
  9000. * @param {String} type
  9001. * @param {Function} callback
  9002. * @return {Object}
  9003. */
  9004. function listen(target, type, callback) {
  9005. if (!target && !type && !callback) {
  9006. throw new Error('Missing required arguments');
  9007. }
  9008. if (!is.string(type)) {
  9009. throw new TypeError('Second argument must be a String');
  9010. }
  9011. if (!is.fn(callback)) {
  9012. throw new TypeError('Third argument must be a Function');
  9013. }
  9014. if (is.node(target)) {
  9015. return listenNode(target, type, callback);
  9016. }
  9017. else if (is.nodeList(target)) {
  9018. return listenNodeList(target, type, callback);
  9019. }
  9020. else if (is.string(target)) {
  9021. return listenSelector(target, type, callback);
  9022. }
  9023. else {
  9024. throw new TypeError('First argument must be a String, HTMLElement, HTMLCollection, or NodeList');
  9025. }
  9026. }
  9027. /**
  9028. * Adds an event listener to a HTML element
  9029. * and returns a remove listener function.
  9030. *
  9031. * @param {HTMLElement} node
  9032. * @param {String} type
  9033. * @param {Function} callback
  9034. * @return {Object}
  9035. */
  9036. function listenNode(node, type, callback) {
  9037. node.addEventListener(type, callback);
  9038. return {
  9039. destroy: function() {
  9040. node.removeEventListener(type, callback);
  9041. }
  9042. }
  9043. }
  9044. /**
  9045. * Add an event listener to a list of HTML elements
  9046. * and returns a remove listener function.
  9047. *
  9048. * @param {NodeList|HTMLCollection} nodeList
  9049. * @param {String} type
  9050. * @param {Function} callback
  9051. * @return {Object}
  9052. */
  9053. function listenNodeList(nodeList, type, callback) {
  9054. Array.prototype.forEach.call(nodeList, function(node) {
  9055. node.addEventListener(type, callback);
  9056. });
  9057. return {
  9058. destroy: function() {
  9059. Array.prototype.forEach.call(nodeList, function(node) {
  9060. node.removeEventListener(type, callback);
  9061. });
  9062. }
  9063. }
  9064. }
  9065. /**
  9066. * Add an event listener to a selector
  9067. * and returns a remove listener function.
  9068. *
  9069. * @param {String} selector
  9070. * @param {String} type
  9071. * @param {Function} callback
  9072. * @return {Object}
  9073. */
  9074. function listenSelector(selector, type, callback) {
  9075. return delegate(document.body, selector, type, callback);
  9076. }
  9077. module.exports = listen;
  9078. /***/ }),
  9079. /* 5 */
  9080. /***/ (function(module, exports) {
  9081. /**
  9082. * Check if argument is a HTML element.
  9083. *
  9084. * @param {Object} value
  9085. * @return {Boolean}
  9086. */
  9087. exports.node = function(value) {
  9088. return value !== undefined
  9089. && value instanceof HTMLElement
  9090. && value.nodeType === 1;
  9091. };
  9092. /**
  9093. * Check if argument is a list of HTML elements.
  9094. *
  9095. * @param {Object} value
  9096. * @return {Boolean}
  9097. */
  9098. exports.nodeList = function(value) {
  9099. var type = Object.prototype.toString.call(value);
  9100. return value !== undefined
  9101. && (type === '[object NodeList]' || type === '[object HTMLCollection]')
  9102. && ('length' in value)
  9103. && (value.length === 0 || exports.node(value[0]));
  9104. };
  9105. /**
  9106. * Check if argument is a string.
  9107. *
  9108. * @param {Object} value
  9109. * @return {Boolean}
  9110. */
  9111. exports.string = function(value) {
  9112. return typeof value === 'string'
  9113. || value instanceof String;
  9114. };
  9115. /**
  9116. * Check if argument is a function.
  9117. *
  9118. * @param {Object} value
  9119. * @return {Boolean}
  9120. */
  9121. exports.fn = function(value) {
  9122. var type = Object.prototype.toString.call(value);
  9123. return type === '[object Function]';
  9124. };
  9125. /***/ }),
  9126. /* 6 */
  9127. /***/ (function(module, exports, __webpack_require__) {
  9128. var closest = __webpack_require__(7);
  9129. /**
  9130. * Delegates event to a selector.
  9131. *
  9132. * @param {Element} element
  9133. * @param {String} selector
  9134. * @param {String} type
  9135. * @param {Function} callback
  9136. * @param {Boolean} useCapture
  9137. * @return {Object}
  9138. */
  9139. function _delegate(element, selector, type, callback, useCapture) {
  9140. var listenerFn = listener.apply(this, arguments);
  9141. element.addEventListener(type, listenerFn, useCapture);
  9142. return {
  9143. destroy: function() {
  9144. element.removeEventListener(type, listenerFn, useCapture);
  9145. }
  9146. }
  9147. }
  9148. /**
  9149. * Delegates event to a selector.
  9150. *
  9151. * @param {Element|String|Array} [elements]
  9152. * @param {String} selector
  9153. * @param {String} type
  9154. * @param {Function} callback
  9155. * @param {Boolean} useCapture
  9156. * @return {Object}
  9157. */
  9158. function delegate(elements, selector, type, callback, useCapture) {
  9159. // Handle the regular Element usage
  9160. if (typeof elements.addEventListener === 'function') {
  9161. return _delegate.apply(null, arguments);
  9162. }
  9163. // Handle Element-less usage, it defaults to global delegation
  9164. if (typeof type === 'function') {
  9165. // Use `document` as the first parameter, then apply arguments
  9166. // This is a short way to .unshift `arguments` without running into deoptimizations
  9167. return _delegate.bind(null, document).apply(null, arguments);
  9168. }
  9169. // Handle Selector-based usage
  9170. if (typeof elements === 'string') {
  9171. elements = document.querySelectorAll(elements);
  9172. }
  9173. // Handle Array-like based usage
  9174. return Array.prototype.map.call(elements, function (element) {
  9175. return _delegate(element, selector, type, callback, useCapture);
  9176. });
  9177. }
  9178. /**
  9179. * Finds closest match and invokes callback.
  9180. *
  9181. * @param {Element} element
  9182. * @param {String} selector
  9183. * @param {String} type
  9184. * @param {Function} callback
  9185. * @return {Function}
  9186. */
  9187. function listener(element, selector, type, callback) {
  9188. return function(e) {
  9189. e.delegateTarget = closest(e.target, selector);
  9190. if (e.delegateTarget) {
  9191. callback.call(element, e);
  9192. }
  9193. }
  9194. }
  9195. module.exports = delegate;
  9196. /***/ }),
  9197. /* 7 */
  9198. /***/ (function(module, exports) {
  9199. var DOCUMENT_NODE_TYPE = 9;
  9200. /**
  9201. * A polyfill for Element.matches()
  9202. */
  9203. if (typeof Element !== 'undefined' && !Element.prototype.matches) {
  9204. var proto = Element.prototype;
  9205. proto.matches = proto.matchesSelector ||
  9206. proto.mozMatchesSelector ||
  9207. proto.msMatchesSelector ||
  9208. proto.oMatchesSelector ||
  9209. proto.webkitMatchesSelector;
  9210. }
  9211. /**
  9212. * Finds the closest parent that matches a selector.
  9213. *
  9214. * @param {Element} element
  9215. * @param {String} selector
  9216. * @return {Function}
  9217. */
  9218. function closest (element, selector) {
  9219. while (element && element.nodeType !== DOCUMENT_NODE_TYPE) {
  9220. if (typeof element.matches === 'function' &&
  9221. element.matches(selector)) {
  9222. return element;
  9223. }
  9224. element = element.parentNode;
  9225. }
  9226. }
  9227. module.exports = closest;
  9228. /***/ })
  9229. /******/ ]);
  9230. });
  9231. /***/ }),
  9232. /***/ "./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/CircleSpinner.vue?vue&type=style&index=0&id=9a543b64&scoped=true&lang=css&":
  9233. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************!*\
  9234. !*** ./node_modules/css-loader??ref--6-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--6-2!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/CircleSpinner.vue?vue&type=style&index=0&id=9a543b64&scoped=true&lang=css& ***!
  9235. \*******************************************************************************************************************************************************************************************************************************************************************************************************/
  9236. /*! no static exports found */
  9237. /***/ (function(module, exports, __webpack_require__) {
  9238. exports = module.exports = __webpack_require__(/*! ../../../node_modules/css-loader/lib/css-base.js */ "./node_modules/css-loader/lib/css-base.js")(false);
  9239. // imports
  9240. // module
  9241. exports.push([module.i, "\n.loader[data-v-9a543b64],\n.loader[data-v-9a543b64]:after {\n border-radius: 50%;\n width: 10em;\n height: 10em;\n}\n.loader[data-v-9a543b64] {\n margin: 0px auto;\n position: relative;\n text-indent: -9999em;\n border-top: 1.1em solid rgba(255, 255, 255, 0.2);\n border-right: 1.1em solid rgba(255, 255, 255, 0.2);\n border-bottom: 1.1em solid rgba(255, 255, 255, 0.2);\n transform: translateZ(0);\n -webkit-animation: load8-data-v-9a543b64 1.1s infinite linear;\n animation: load8-data-v-9a543b64 1.1s infinite linear;\n overflow: hidden;\n}\n@-webkit-keyframes load8-data-v-9a543b64 {\n0% {\n transform: rotate(0deg);\n}\n100% {\n transform: rotate(360deg);\n}\n}\n@keyframes load8-data-v-9a543b64 {\n0% {\n transform: rotate(0deg);\n}\n100% {\n transform: rotate(360deg);\n}\n}\n", ""]);
  9242. // exports
  9243. /***/ }),
  9244. /***/ "./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/views/Welcome.vue?vue&type=style&index=0&id=1ae8ae93&scoped=true&lang=css&":
  9245. /*!********************************************************************************************************************************************************************************************************************************************************************************************!*\
  9246. !*** ./node_modules/css-loader??ref--6-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--6-2!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/views/Welcome.vue?vue&type=style&index=0&id=1ae8ae93&scoped=true&lang=css& ***!
  9247. \********************************************************************************************************************************************************************************************************************************************************************************************/
  9248. /*! no static exports found */
  9249. /***/ (function(module, exports, __webpack_require__) {
  9250. exports = module.exports = __webpack_require__(/*! ../../../node_modules/css-loader/lib/css-base.js */ "./node_modules/css-loader/lib/css-base.js")(false);
  9251. // imports
  9252. // module
  9253. exports.push([module.i, "\n.full-height[data-v-1ae8ae93] {\n height: 100vh;\n}\n.flex-center[data-v-1ae8ae93] {\n align-items: center;\n display: flex;\n justify-content: center;\n}\n.position-ref[data-v-1ae8ae93] {\n position: relative;\n}\n.top-right[data-v-1ae8ae93] {\n position: absolute;\n right: 10px;\n top: 18px;\n}\n.content[data-v-1ae8ae93] {\n text-align: center;\n}\n.title[data-v-1ae8ae93] {\n font-size: 60px;\n}\n.links > a[data-v-1ae8ae93] {\n color: #636b6f;\n padding: 0 25px;\n font-size: 12px;\n font-weight: 600;\n letter-spacing: .1rem;\n text-decoration: none;\n text-transform: uppercase;\n}\n.m-b-md[data-v-1ae8ae93] {\n margin-bottom: 30px;\n color: #000000;\n}\n", ""]);
  9254. // exports
  9255. /***/ }),
  9256. /***/ "./node_modules/css-loader/lib/css-base.js":
  9257. /*!*************************************************!*\
  9258. !*** ./node_modules/css-loader/lib/css-base.js ***!
  9259. \*************************************************/
  9260. /*! no static exports found */
  9261. /***/ (function(module, exports) {
  9262. /*
  9263. MIT License http://www.opensource.org/licenses/mit-license.php
  9264. Author Tobias Koppers @sokra
  9265. */
  9266. // css base code, injected by the css-loader
  9267. module.exports = function(useSourceMap) {
  9268. var list = [];
  9269. // return the list of modules as css string
  9270. list.toString = function toString() {
  9271. return this.map(function (item) {
  9272. var content = cssWithMappingToString(item, useSourceMap);
  9273. if(item[2]) {
  9274. return "@media " + item[2] + "{" + content + "}";
  9275. } else {
  9276. return content;
  9277. }
  9278. }).join("");
  9279. };
  9280. // import a list of modules into the list
  9281. list.i = function(modules, mediaQuery) {
  9282. if(typeof modules === "string")
  9283. modules = [[null, modules, ""]];
  9284. var alreadyImportedModules = {};
  9285. for(var i = 0; i < this.length; i++) {
  9286. var id = this[i][0];
  9287. if(typeof id === "number")
  9288. alreadyImportedModules[id] = true;
  9289. }
  9290. for(i = 0; i < modules.length; i++) {
  9291. var item = modules[i];
  9292. // skip already imported module
  9293. // this implementation is not 100% perfect for weird media query combinations
  9294. // when a module is imported multiple times with different media queries.
  9295. // I hope this will never occur (Hey this way we have smaller bundles)
  9296. if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) {
  9297. if(mediaQuery && !item[2]) {
  9298. item[2] = mediaQuery;
  9299. } else if(mediaQuery) {
  9300. item[2] = "(" + item[2] + ") and (" + mediaQuery + ")";
  9301. }
  9302. list.push(item);
  9303. }
  9304. }
  9305. };
  9306. return list;
  9307. };
  9308. function cssWithMappingToString(item, useSourceMap) {
  9309. var content = item[1] || '';
  9310. var cssMapping = item[3];
  9311. if (!cssMapping) {
  9312. return content;
  9313. }
  9314. if (useSourceMap && typeof btoa === 'function') {
  9315. var sourceMapping = toComment(cssMapping);
  9316. var sourceURLs = cssMapping.sources.map(function (source) {
  9317. return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'
  9318. });
  9319. return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
  9320. }
  9321. return [content].join('\n');
  9322. }
  9323. // Adapted from convert-source-map (MIT)
  9324. function toComment(sourceMap) {
  9325. // eslint-disable-next-line no-undef
  9326. var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
  9327. var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;
  9328. return '/*# ' + data + ' */';
  9329. }
  9330. /***/ }),
  9331. /***/ "./node_modules/ieee754/index.js":
  9332. /*!***************************************!*\
  9333. !*** ./node_modules/ieee754/index.js ***!
  9334. \***************************************/
  9335. /*! no static exports found */
  9336. /***/ (function(module, exports) {
  9337. exports.read = function (buffer, offset, isLE, mLen, nBytes) {
  9338. var e, m
  9339. var eLen = (nBytes * 8) - mLen - 1
  9340. var eMax = (1 << eLen) - 1
  9341. var eBias = eMax >> 1
  9342. var nBits = -7
  9343. var i = isLE ? (nBytes - 1) : 0
  9344. var d = isLE ? -1 : 1
  9345. var s = buffer[offset + i]
  9346. i += d
  9347. e = s & ((1 << (-nBits)) - 1)
  9348. s >>= (-nBits)
  9349. nBits += eLen
  9350. for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}
  9351. m = e & ((1 << (-nBits)) - 1)
  9352. e >>= (-nBits)
  9353. nBits += mLen
  9354. for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}
  9355. if (e === 0) {
  9356. e = 1 - eBias
  9357. } else if (e === eMax) {
  9358. return m ? NaN : ((s ? -1 : 1) * Infinity)
  9359. } else {
  9360. m = m + Math.pow(2, mLen)
  9361. e = e - eBias
  9362. }
  9363. return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
  9364. }
  9365. exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
  9366. var e, m, c
  9367. var eLen = (nBytes * 8) - mLen - 1
  9368. var eMax = (1 << eLen) - 1
  9369. var eBias = eMax >> 1
  9370. var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
  9371. var i = isLE ? 0 : (nBytes - 1)
  9372. var d = isLE ? 1 : -1
  9373. var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
  9374. value = Math.abs(value)
  9375. if (isNaN(value) || value === Infinity) {
  9376. m = isNaN(value) ? 1 : 0
  9377. e = eMax
  9378. } else {
  9379. e = Math.floor(Math.log(value) / Math.LN2)
  9380. if (value * (c = Math.pow(2, -e)) < 1) {
  9381. e--
  9382. c *= 2
  9383. }
  9384. if (e + eBias >= 1) {
  9385. value += rt / c
  9386. } else {
  9387. value += rt * Math.pow(2, 1 - eBias)
  9388. }
  9389. if (value * c >= 2) {
  9390. e++
  9391. c /= 2
  9392. }
  9393. if (e + eBias >= eMax) {
  9394. m = 0
  9395. e = eMax
  9396. } else if (e + eBias >= 1) {
  9397. m = ((value * c) - 1) * Math.pow(2, mLen)
  9398. e = e + eBias
  9399. } else {
  9400. m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
  9401. e = 0
  9402. }
  9403. }
  9404. for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
  9405. e = (e << mLen) | m
  9406. eLen += mLen
  9407. for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
  9408. buffer[offset + i - d] |= s * 128
  9409. }
  9410. /***/ }),
  9411. /***/ "./node_modules/isarray/index.js":
  9412. /*!***************************************!*\
  9413. !*** ./node_modules/isarray/index.js ***!
  9414. \***************************************/
  9415. /*! no static exports found */
  9416. /***/ (function(module, exports) {
  9417. var toString = {}.toString;
  9418. module.exports = Array.isArray || function (arr) {
  9419. return toString.call(arr) == '[object Array]';
  9420. };
  9421. /***/ }),
  9422. /***/ "./node_modules/jquery/dist/jquery.js":
  9423. /*!********************************************!*\
  9424. !*** ./node_modules/jquery/dist/jquery.js ***!
  9425. \********************************************/
  9426. /*! no static exports found */
  9427. /***/ (function(module, exports, __webpack_require__) {
  9428. var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
  9429. * jQuery JavaScript Library v3.4.1
  9430. * https://jquery.com/
  9431. *
  9432. * Includes Sizzle.js
  9433. * https://sizzlejs.com/
  9434. *
  9435. * Copyright JS Foundation and other contributors
  9436. * Released under the MIT license
  9437. * https://jquery.org/license
  9438. *
  9439. * Date: 2019-05-01T21:04Z
  9440. */
  9441. ( function( global, factory ) {
  9442. "use strict";
  9443. if ( true && typeof module.exports === "object" ) {
  9444. // For CommonJS and CommonJS-like environments where a proper `window`
  9445. // is present, execute the factory and get jQuery.
  9446. // For environments that do not have a `window` with a `document`
  9447. // (such as Node.js), expose a factory as module.exports.
  9448. // This accentuates the need for the creation of a real `window`.
  9449. // e.g. var jQuery = require("jquery")(window);
  9450. // See ticket #14549 for more info.
  9451. module.exports = global.document ?
  9452. factory( global, true ) :
  9453. function( w ) {
  9454. if ( !w.document ) {
  9455. throw new Error( "jQuery requires a window with a document" );
  9456. }
  9457. return factory( w );
  9458. };
  9459. } else {
  9460. factory( global );
  9461. }
  9462. // Pass this if window is not defined yet
  9463. } )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
  9464. // Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1
  9465. // throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode
  9466. // arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common
  9467. // enough that all such attempts are guarded in a try block.
  9468. "use strict";
  9469. var arr = [];
  9470. var document = window.document;
  9471. var getProto = Object.getPrototypeOf;
  9472. var slice = arr.slice;
  9473. var concat = arr.concat;
  9474. var push = arr.push;
  9475. var indexOf = arr.indexOf;
  9476. var class2type = {};
  9477. var toString = class2type.toString;
  9478. var hasOwn = class2type.hasOwnProperty;
  9479. var fnToString = hasOwn.toString;
  9480. var ObjectFunctionString = fnToString.call( Object );
  9481. var support = {};
  9482. var isFunction = function isFunction( obj ) {
  9483. // Support: Chrome <=57, Firefox <=52
  9484. // In some browsers, typeof returns "function" for HTML <object> elements
  9485. // (i.e., `typeof document.createElement( "object" ) === "function"`).
  9486. // We don't want to classify *any* DOM node as a function.
  9487. return typeof obj === "function" && typeof obj.nodeType !== "number";
  9488. };
  9489. var isWindow = function isWindow( obj ) {
  9490. return obj != null && obj === obj.window;
  9491. };
  9492. var preservedScriptAttributes = {
  9493. type: true,
  9494. src: true,
  9495. nonce: true,
  9496. noModule: true
  9497. };
  9498. function DOMEval( code, node, doc ) {
  9499. doc = doc || document;
  9500. var i, val,
  9501. script = doc.createElement( "script" );
  9502. script.text = code;
  9503. if ( node ) {
  9504. for ( i in preservedScriptAttributes ) {
  9505. // Support: Firefox 64+, Edge 18+
  9506. // Some browsers don't support the "nonce" property on scripts.
  9507. // On the other hand, just using `getAttribute` is not enough as
  9508. // the `nonce` attribute is reset to an empty string whenever it
  9509. // becomes browsing-context connected.
  9510. // See https://github.com/whatwg/html/issues/2369
  9511. // See https://html.spec.whatwg.org/#nonce-attributes
  9512. // The `node.getAttribute` check was added for the sake of
  9513. // `jQuery.globalEval` so that it can fake a nonce-containing node
  9514. // via an object.
  9515. val = node[ i ] || node.getAttribute && node.getAttribute( i );
  9516. if ( val ) {
  9517. script.setAttribute( i, val );
  9518. }
  9519. }
  9520. }
  9521. doc.head.appendChild( script ).parentNode.removeChild( script );
  9522. }
  9523. function toType( obj ) {
  9524. if ( obj == null ) {
  9525. return obj + "";
  9526. }
  9527. // Support: Android <=2.3 only (functionish RegExp)
  9528. return typeof obj === "object" || typeof obj === "function" ?
  9529. class2type[ toString.call( obj ) ] || "object" :
  9530. typeof obj;
  9531. }
  9532. /* global Symbol */
  9533. // Defining this global in .eslintrc.json would create a danger of using the global
  9534. // unguarded in another place, it seems safer to define global only for this module
  9535. var
  9536. version = "3.4.1",
  9537. // Define a local copy of jQuery
  9538. jQuery = function( selector, context ) {
  9539. // The jQuery object is actually just the init constructor 'enhanced'
  9540. // Need init if jQuery is called (just allow error to be thrown if not included)
  9541. return new jQuery.fn.init( selector, context );
  9542. },
  9543. // Support: Android <=4.0 only
  9544. // Make sure we trim BOM and NBSP
  9545. rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
  9546. jQuery.fn = jQuery.prototype = {
  9547. // The current version of jQuery being used
  9548. jquery: version,
  9549. constructor: jQuery,
  9550. // The default length of a jQuery object is 0
  9551. length: 0,
  9552. toArray: function() {
  9553. return slice.call( this );
  9554. },
  9555. // Get the Nth element in the matched element set OR
  9556. // Get the whole matched element set as a clean array
  9557. get: function( num ) {
  9558. // Return all the elements in a clean array
  9559. if ( num == null ) {
  9560. return slice.call( this );
  9561. }
  9562. // Return just the one element from the set
  9563. return num < 0 ? this[ num + this.length ] : this[ num ];
  9564. },
  9565. // Take an array of elements and push it onto the stack
  9566. // (returning the new matched element set)
  9567. pushStack: function( elems ) {
  9568. // Build a new jQuery matched element set
  9569. var ret = jQuery.merge( this.constructor(), elems );
  9570. // Add the old object onto the stack (as a reference)
  9571. ret.prevObject = this;
  9572. // Return the newly-formed element set
  9573. return ret;
  9574. },
  9575. // Execute a callback for every element in the matched set.
  9576. each: function( callback ) {
  9577. return jQuery.each( this, callback );
  9578. },
  9579. map: function( callback ) {
  9580. return this.pushStack( jQuery.map( this, function( elem, i ) {
  9581. return callback.call( elem, i, elem );
  9582. } ) );
  9583. },
  9584. slice: function() {
  9585. return this.pushStack( slice.apply( this, arguments ) );
  9586. },
  9587. first: function() {
  9588. return this.eq( 0 );
  9589. },
  9590. last: function() {
  9591. return this.eq( -1 );
  9592. },
  9593. eq: function( i ) {
  9594. var len = this.length,
  9595. j = +i + ( i < 0 ? len : 0 );
  9596. return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
  9597. },
  9598. end: function() {
  9599. return this.prevObject || this.constructor();
  9600. },
  9601. // For internal use only.
  9602. // Behaves like an Array's method, not like a jQuery method.
  9603. push: push,
  9604. sort: arr.sort,
  9605. splice: arr.splice
  9606. };
  9607. jQuery.extend = jQuery.fn.extend = function() {
  9608. var options, name, src, copy, copyIsArray, clone,
  9609. target = arguments[ 0 ] || {},
  9610. i = 1,
  9611. length = arguments.length,
  9612. deep = false;
  9613. // Handle a deep copy situation
  9614. if ( typeof target === "boolean" ) {
  9615. deep = target;
  9616. // Skip the boolean and the target
  9617. target = arguments[ i ] || {};
  9618. i++;
  9619. }
  9620. // Handle case when target is a string or something (possible in deep copy)
  9621. if ( typeof target !== "object" && !isFunction( target ) ) {
  9622. target = {};
  9623. }
  9624. // Extend jQuery itself if only one argument is passed
  9625. if ( i === length ) {
  9626. target = this;
  9627. i--;
  9628. }
  9629. for ( ; i < length; i++ ) {
  9630. // Only deal with non-null/undefined values
  9631. if ( ( options = arguments[ i ] ) != null ) {
  9632. // Extend the base object
  9633. for ( name in options ) {
  9634. copy = options[ name ];
  9635. // Prevent Object.prototype pollution
  9636. // Prevent never-ending loop
  9637. if ( name === "__proto__" || target === copy ) {
  9638. continue;
  9639. }
  9640. // Recurse if we're merging plain objects or arrays
  9641. if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
  9642. ( copyIsArray = Array.isArray( copy ) ) ) ) {
  9643. src = target[ name ];
  9644. // Ensure proper type for the source value
  9645. if ( copyIsArray && !Array.isArray( src ) ) {
  9646. clone = [];
  9647. } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) {
  9648. clone = {};
  9649. } else {
  9650. clone = src;
  9651. }
  9652. copyIsArray = false;
  9653. // Never move original objects, clone them
  9654. target[ name ] = jQuery.extend( deep, clone, copy );
  9655. // Don't bring in undefined values
  9656. } else if ( copy !== undefined ) {
  9657. target[ name ] = copy;
  9658. }
  9659. }
  9660. }
  9661. }
  9662. // Return the modified object
  9663. return target;
  9664. };
  9665. jQuery.extend( {
  9666. // Unique for each copy of jQuery on the page
  9667. expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
  9668. // Assume jQuery is ready without the ready module
  9669. isReady: true,
  9670. error: function( msg ) {
  9671. throw new Error( msg );
  9672. },
  9673. noop: function() {},
  9674. isPlainObject: function( obj ) {
  9675. var proto, Ctor;
  9676. // Detect obvious negatives
  9677. // Use toString instead of jQuery.type to catch host objects
  9678. if ( !obj || toString.call( obj ) !== "[object Object]" ) {
  9679. return false;
  9680. }
  9681. proto = getProto( obj );
  9682. // Objects with no prototype (e.g., `Object.create( null )`) are plain
  9683. if ( !proto ) {
  9684. return true;
  9685. }
  9686. // Objects with prototype are plain iff they were constructed by a global Object function
  9687. Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor;
  9688. return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString;
  9689. },
  9690. isEmptyObject: function( obj ) {
  9691. var name;
  9692. for ( name in obj ) {
  9693. return false;
  9694. }
  9695. return true;
  9696. },
  9697. // Evaluates a script in a global context
  9698. globalEval: function( code, options ) {
  9699. DOMEval( code, { nonce: options && options.nonce } );
  9700. },
  9701. each: function( obj, callback ) {
  9702. var length, i = 0;
  9703. if ( isArrayLike( obj ) ) {
  9704. length = obj.length;
  9705. for ( ; i < length; i++ ) {
  9706. if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
  9707. break;
  9708. }
  9709. }
  9710. } else {
  9711. for ( i in obj ) {
  9712. if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
  9713. break;
  9714. }
  9715. }
  9716. }
  9717. return obj;
  9718. },
  9719. // Support: Android <=4.0 only
  9720. trim: function( text ) {
  9721. return text == null ?
  9722. "" :
  9723. ( text + "" ).replace( rtrim, "" );
  9724. },
  9725. // results is for internal usage only
  9726. makeArray: function( arr, results ) {
  9727. var ret = results || [];
  9728. if ( arr != null ) {
  9729. if ( isArrayLike( Object( arr ) ) ) {
  9730. jQuery.merge( ret,
  9731. typeof arr === "string" ?
  9732. [ arr ] : arr
  9733. );
  9734. } else {
  9735. push.call( ret, arr );
  9736. }
  9737. }
  9738. return ret;
  9739. },
  9740. inArray: function( elem, arr, i ) {
  9741. return arr == null ? -1 : indexOf.call( arr, elem, i );
  9742. },
  9743. // Support: Android <=4.0 only, PhantomJS 1 only
  9744. // push.apply(_, arraylike) throws on ancient WebKit
  9745. merge: function( first, second ) {
  9746. var len = +second.length,
  9747. j = 0,
  9748. i = first.length;
  9749. for ( ; j < len; j++ ) {
  9750. first[ i++ ] = second[ j ];
  9751. }
  9752. first.length = i;
  9753. return first;
  9754. },
  9755. grep: function( elems, callback, invert ) {
  9756. var callbackInverse,
  9757. matches = [],
  9758. i = 0,
  9759. length = elems.length,
  9760. callbackExpect = !invert;
  9761. // Go through the array, only saving the items
  9762. // that pass the validator function
  9763. for ( ; i < length; i++ ) {
  9764. callbackInverse = !callback( elems[ i ], i );
  9765. if ( callbackInverse !== callbackExpect ) {
  9766. matches.push( elems[ i ] );
  9767. }
  9768. }
  9769. return matches;
  9770. },
  9771. // arg is for internal usage only
  9772. map: function( elems, callback, arg ) {
  9773. var length, value,
  9774. i = 0,
  9775. ret = [];
  9776. // Go through the array, translating each of the items to their new values
  9777. if ( isArrayLike( elems ) ) {
  9778. length = elems.length;
  9779. for ( ; i < length; i++ ) {
  9780. value = callback( elems[ i ], i, arg );
  9781. if ( value != null ) {
  9782. ret.push( value );
  9783. }
  9784. }
  9785. // Go through every key on the object,
  9786. } else {
  9787. for ( i in elems ) {
  9788. value = callback( elems[ i ], i, arg );
  9789. if ( value != null ) {
  9790. ret.push( value );
  9791. }
  9792. }
  9793. }
  9794. // Flatten any nested arrays
  9795. return concat.apply( [], ret );
  9796. },
  9797. // A global GUID counter for objects
  9798. guid: 1,
  9799. // jQuery.support is not used in Core but other projects attach their
  9800. // properties to it so it needs to exist.
  9801. support: support
  9802. } );
  9803. if ( typeof Symbol === "function" ) {
  9804. jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
  9805. }
  9806. // Populate the class2type map
  9807. jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
  9808. function( i, name ) {
  9809. class2type[ "[object " + name + "]" ] = name.toLowerCase();
  9810. } );
  9811. function isArrayLike( obj ) {
  9812. // Support: real iOS 8.2 only (not reproducible in simulator)
  9813. // `in` check used to prevent JIT error (gh-2145)
  9814. // hasOwn isn't used here due to false negatives
  9815. // regarding Nodelist length in IE
  9816. var length = !!obj && "length" in obj && obj.length,
  9817. type = toType( obj );
  9818. if ( isFunction( obj ) || isWindow( obj ) ) {
  9819. return false;
  9820. }
  9821. return type === "array" || length === 0 ||
  9822. typeof length === "number" && length > 0 && ( length - 1 ) in obj;
  9823. }
  9824. var Sizzle =
  9825. /*!
  9826. * Sizzle CSS Selector Engine v2.3.4
  9827. * https://sizzlejs.com/
  9828. *
  9829. * Copyright JS Foundation and other contributors
  9830. * Released under the MIT license
  9831. * https://js.foundation/
  9832. *
  9833. * Date: 2019-04-08
  9834. */
  9835. (function( window ) {
  9836. var i,
  9837. support,
  9838. Expr,
  9839. getText,
  9840. isXML,
  9841. tokenize,
  9842. compile,
  9843. select,
  9844. outermostContext,
  9845. sortInput,
  9846. hasDuplicate,
  9847. // Local document vars
  9848. setDocument,
  9849. document,
  9850. docElem,
  9851. documentIsHTML,
  9852. rbuggyQSA,
  9853. rbuggyMatches,
  9854. matches,
  9855. contains,
  9856. // Instance-specific data
  9857. expando = "sizzle" + 1 * new Date(),
  9858. preferredDoc = window.document,
  9859. dirruns = 0,
  9860. done = 0,
  9861. classCache = createCache(),
  9862. tokenCache = createCache(),
  9863. compilerCache = createCache(),
  9864. nonnativeSelectorCache = createCache(),
  9865. sortOrder = function( a, b ) {
  9866. if ( a === b ) {
  9867. hasDuplicate = true;
  9868. }
  9869. return 0;
  9870. },
  9871. // Instance methods
  9872. hasOwn = ({}).hasOwnProperty,
  9873. arr = [],
  9874. pop = arr.pop,
  9875. push_native = arr.push,
  9876. push = arr.push,
  9877. slice = arr.slice,
  9878. // Use a stripped-down indexOf as it's faster than native
  9879. // https://jsperf.com/thor-indexof-vs-for/5
  9880. indexOf = function( list, elem ) {
  9881. var i = 0,
  9882. len = list.length;
  9883. for ( ; i < len; i++ ) {
  9884. if ( list[i] === elem ) {
  9885. return i;
  9886. }
  9887. }
  9888. return -1;
  9889. },
  9890. booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
  9891. // Regular expressions
  9892. // http://www.w3.org/TR/css3-selectors/#whitespace
  9893. whitespace = "[\\x20\\t\\r\\n\\f]",
  9894. // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
  9895. identifier = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+",
  9896. // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
  9897. attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
  9898. // Operator (capture 2)
  9899. "*([*^$|!~]?=)" + whitespace +
  9900. // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
  9901. "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
  9902. "*\\]",
  9903. pseudos = ":(" + identifier + ")(?:\\((" +
  9904. // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
  9905. // 1. quoted (capture 3; capture 4 or capture 5)
  9906. "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
  9907. // 2. simple (capture 6)
  9908. "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
  9909. // 3. anything else (capture 2)
  9910. ".*" +
  9911. ")\\)|)",
  9912. // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
  9913. rwhitespace = new RegExp( whitespace + "+", "g" ),
  9914. rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
  9915. rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
  9916. rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
  9917. rdescend = new RegExp( whitespace + "|>" ),
  9918. rpseudo = new RegExp( pseudos ),
  9919. ridentifier = new RegExp( "^" + identifier + "$" ),
  9920. matchExpr = {
  9921. "ID": new RegExp( "^#(" + identifier + ")" ),
  9922. "CLASS": new RegExp( "^\\.(" + identifier + ")" ),
  9923. "TAG": new RegExp( "^(" + identifier + "|[*])" ),
  9924. "ATTR": new RegExp( "^" + attributes ),
  9925. "PSEUDO": new RegExp( "^" + pseudos ),
  9926. "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
  9927. "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
  9928. "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
  9929. "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
  9930. // For use in libraries implementing .is()
  9931. // We use this for POS matching in `select`
  9932. "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
  9933. whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
  9934. },
  9935. rhtml = /HTML$/i,
  9936. rinputs = /^(?:input|select|textarea|button)$/i,
  9937. rheader = /^h\d$/i,
  9938. rnative = /^[^{]+\{\s*\[native \w/,
  9939. // Easily-parseable/retrievable ID or TAG or CLASS selectors
  9940. rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
  9941. rsibling = /[+~]/,
  9942. // CSS escapes
  9943. // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
  9944. runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
  9945. funescape = function( _, escaped, escapedWhitespace ) {
  9946. var high = "0x" + escaped - 0x10000;
  9947. // NaN means non-codepoint
  9948. // Support: Firefox<24
  9949. // Workaround erroneous numeric interpretation of +"0x"
  9950. return high !== high || escapedWhitespace ?
  9951. escaped :
  9952. high < 0 ?
  9953. // BMP codepoint
  9954. String.fromCharCode( high + 0x10000 ) :
  9955. // Supplemental Plane codepoint (surrogate pair)
  9956. String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
  9957. },
  9958. // CSS string/identifier serialization
  9959. // https://drafts.csswg.org/cssom/#common-serializing-idioms
  9960. rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,
  9961. fcssescape = function( ch, asCodePoint ) {
  9962. if ( asCodePoint ) {
  9963. // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
  9964. if ( ch === "\0" ) {
  9965. return "\uFFFD";
  9966. }
  9967. // Control characters and (dependent upon position) numbers get escaped as code points
  9968. return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
  9969. }
  9970. // Other potentially-special ASCII characters get backslash-escaped
  9971. return "\\" + ch;
  9972. },
  9973. // Used for iframes
  9974. // See setDocument()
  9975. // Removing the function wrapper causes a "Permission Denied"
  9976. // error in IE
  9977. unloadHandler = function() {
  9978. setDocument();
  9979. },
  9980. inDisabledFieldset = addCombinator(
  9981. function( elem ) {
  9982. return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset";
  9983. },
  9984. { dir: "parentNode", next: "legend" }
  9985. );
  9986. // Optimize for push.apply( _, NodeList )
  9987. try {
  9988. push.apply(
  9989. (arr = slice.call( preferredDoc.childNodes )),
  9990. preferredDoc.childNodes
  9991. );
  9992. // Support: Android<4.0
  9993. // Detect silently failing push.apply
  9994. arr[ preferredDoc.childNodes.length ].nodeType;
  9995. } catch ( e ) {
  9996. push = { apply: arr.length ?
  9997. // Leverage slice if possible
  9998. function( target, els ) {
  9999. push_native.apply( target, slice.call(els) );
  10000. } :
  10001. // Support: IE<9
  10002. // Otherwise append directly
  10003. function( target, els ) {
  10004. var j = target.length,
  10005. i = 0;
  10006. // Can't trust NodeList.length
  10007. while ( (target[j++] = els[i++]) ) {}
  10008. target.length = j - 1;
  10009. }
  10010. };
  10011. }
  10012. function Sizzle( selector, context, results, seed ) {
  10013. var m, i, elem, nid, match, groups, newSelector,
  10014. newContext = context && context.ownerDocument,
  10015. // nodeType defaults to 9, since context defaults to document
  10016. nodeType = context ? context.nodeType : 9;
  10017. results = results || [];
  10018. // Return early from calls with invalid selector or context
  10019. if ( typeof selector !== "string" || !selector ||
  10020. nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
  10021. return results;
  10022. }
  10023. // Try to shortcut find operations (as opposed to filters) in HTML documents
  10024. if ( !seed ) {
  10025. if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
  10026. setDocument( context );
  10027. }
  10028. context = context || document;
  10029. if ( documentIsHTML ) {
  10030. // If the selector is sufficiently simple, try using a "get*By*" DOM method
  10031. // (excepting DocumentFragment context, where the methods don't exist)
  10032. if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
  10033. // ID selector
  10034. if ( (m = match[1]) ) {
  10035. // Document context
  10036. if ( nodeType === 9 ) {
  10037. if ( (elem = context.getElementById( m )) ) {
  10038. // Support: IE, Opera, Webkit
  10039. // TODO: identify versions
  10040. // getElementById can match elements by name instead of ID
  10041. if ( elem.id === m ) {
  10042. results.push( elem );
  10043. return results;
  10044. }
  10045. } else {
  10046. return results;
  10047. }
  10048. // Element context
  10049. } else {
  10050. // Support: IE, Opera, Webkit
  10051. // TODO: identify versions
  10052. // getElementById can match elements by name instead of ID
  10053. if ( newContext && (elem = newContext.getElementById( m )) &&
  10054. contains( context, elem ) &&
  10055. elem.id === m ) {
  10056. results.push( elem );
  10057. return results;
  10058. }
  10059. }
  10060. // Type selector
  10061. } else if ( match[2] ) {
  10062. push.apply( results, context.getElementsByTagName( selector ) );
  10063. return results;
  10064. // Class selector
  10065. } else if ( (m = match[3]) && support.getElementsByClassName &&
  10066. context.getElementsByClassName ) {
  10067. push.apply( results, context.getElementsByClassName( m ) );
  10068. return results;
  10069. }
  10070. }
  10071. // Take advantage of querySelectorAll
  10072. if ( support.qsa &&
  10073. !nonnativeSelectorCache[ selector + " " ] &&
  10074. (!rbuggyQSA || !rbuggyQSA.test( selector )) &&
  10075. // Support: IE 8 only
  10076. // Exclude object elements
  10077. (nodeType !== 1 || context.nodeName.toLowerCase() !== "object") ) {
  10078. newSelector = selector;
  10079. newContext = context;
  10080. // qSA considers elements outside a scoping root when evaluating child or
  10081. // descendant combinators, which is not what we want.
  10082. // In such cases, we work around the behavior by prefixing every selector in the
  10083. // list with an ID selector referencing the scope context.
  10084. // Thanks to Andrew Dupont for this technique.
  10085. if ( nodeType === 1 && rdescend.test( selector ) ) {
  10086. // Capture the context ID, setting it first if necessary
  10087. if ( (nid = context.getAttribute( "id" )) ) {
  10088. nid = nid.replace( rcssescape, fcssescape );
  10089. } else {
  10090. context.setAttribute( "id", (nid = expando) );
  10091. }
  10092. // Prefix every selector in the list
  10093. groups = tokenize( selector );
  10094. i = groups.length;
  10095. while ( i-- ) {
  10096. groups[i] = "#" + nid + " " + toSelector( groups[i] );
  10097. }
  10098. newSelector = groups.join( "," );
  10099. // Expand context for sibling selectors
  10100. newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
  10101. context;
  10102. }
  10103. try {
  10104. push.apply( results,
  10105. newContext.querySelectorAll( newSelector )
  10106. );
  10107. return results;
  10108. } catch ( qsaError ) {
  10109. nonnativeSelectorCache( selector, true );
  10110. } finally {
  10111. if ( nid === expando ) {
  10112. context.removeAttribute( "id" );
  10113. }
  10114. }
  10115. }
  10116. }
  10117. }
  10118. // All others
  10119. return select( selector.replace( rtrim, "$1" ), context, results, seed );
  10120. }
  10121. /**
  10122. * Create key-value caches of limited size
  10123. * @returns {function(string, object)} Returns the Object data after storing it on itself with
  10124. * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
  10125. * deleting the oldest entry
  10126. */
  10127. function createCache() {
  10128. var keys = [];
  10129. function cache( key, value ) {
  10130. // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
  10131. if ( keys.push( key + " " ) > Expr.cacheLength ) {
  10132. // Only keep the most recent entries
  10133. delete cache[ keys.shift() ];
  10134. }
  10135. return (cache[ key + " " ] = value);
  10136. }
  10137. return cache;
  10138. }
  10139. /**
  10140. * Mark a function for special use by Sizzle
  10141. * @param {Function} fn The function to mark
  10142. */
  10143. function markFunction( fn ) {
  10144. fn[ expando ] = true;
  10145. return fn;
  10146. }
  10147. /**
  10148. * Support testing using an element
  10149. * @param {Function} fn Passed the created element and returns a boolean result
  10150. */
  10151. function assert( fn ) {
  10152. var el = document.createElement("fieldset");
  10153. try {
  10154. return !!fn( el );
  10155. } catch (e) {
  10156. return false;
  10157. } finally {
  10158. // Remove from its parent by default
  10159. if ( el.parentNode ) {
  10160. el.parentNode.removeChild( el );
  10161. }
  10162. // release memory in IE
  10163. el = null;
  10164. }
  10165. }
  10166. /**
  10167. * Adds the same handler for all of the specified attrs
  10168. * @param {String} attrs Pipe-separated list of attributes
  10169. * @param {Function} handler The method that will be applied
  10170. */
  10171. function addHandle( attrs, handler ) {
  10172. var arr = attrs.split("|"),
  10173. i = arr.length;
  10174. while ( i-- ) {
  10175. Expr.attrHandle[ arr[i] ] = handler;
  10176. }
  10177. }
  10178. /**
  10179. * Checks document order of two siblings
  10180. * @param {Element} a
  10181. * @param {Element} b
  10182. * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
  10183. */
  10184. function siblingCheck( a, b ) {
  10185. var cur = b && a,
  10186. diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
  10187. a.sourceIndex - b.sourceIndex;
  10188. // Use IE sourceIndex if available on both nodes
  10189. if ( diff ) {
  10190. return diff;
  10191. }
  10192. // Check if b follows a
  10193. if ( cur ) {
  10194. while ( (cur = cur.nextSibling) ) {
  10195. if ( cur === b ) {
  10196. return -1;
  10197. }
  10198. }
  10199. }
  10200. return a ? 1 : -1;
  10201. }
  10202. /**
  10203. * Returns a function to use in pseudos for input types
  10204. * @param {String} type
  10205. */
  10206. function createInputPseudo( type ) {
  10207. return function( elem ) {
  10208. var name = elem.nodeName.toLowerCase();
  10209. return name === "input" && elem.type === type;
  10210. };
  10211. }
  10212. /**
  10213. * Returns a function to use in pseudos for buttons
  10214. * @param {String} type
  10215. */
  10216. function createButtonPseudo( type ) {
  10217. return function( elem ) {
  10218. var name = elem.nodeName.toLowerCase();
  10219. return (name === "input" || name === "button") && elem.type === type;
  10220. };
  10221. }
  10222. /**
  10223. * Returns a function to use in pseudos for :enabled/:disabled
  10224. * @param {Boolean} disabled true for :disabled; false for :enabled
  10225. */
  10226. function createDisabledPseudo( disabled ) {
  10227. // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable
  10228. return function( elem ) {
  10229. // Only certain elements can match :enabled or :disabled
  10230. // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled
  10231. // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled
  10232. if ( "form" in elem ) {
  10233. // Check for inherited disabledness on relevant non-disabled elements:
  10234. // * listed form-associated elements in a disabled fieldset
  10235. // https://html.spec.whatwg.org/multipage/forms.html#category-listed
  10236. // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled
  10237. // * option elements in a disabled optgroup
  10238. // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled
  10239. // All such elements have a "form" property.
  10240. if ( elem.parentNode && elem.disabled === false ) {
  10241. // Option elements defer to a parent optgroup if present
  10242. if ( "label" in elem ) {
  10243. if ( "label" in elem.parentNode ) {
  10244. return elem.parentNode.disabled === disabled;
  10245. } else {
  10246. return elem.disabled === disabled;
  10247. }
  10248. }
  10249. // Support: IE 6 - 11
  10250. // Use the isDisabled shortcut property to check for disabled fieldset ancestors
  10251. return elem.isDisabled === disabled ||
  10252. // Where there is no isDisabled, check manually
  10253. /* jshint -W018 */
  10254. elem.isDisabled !== !disabled &&
  10255. inDisabledFieldset( elem ) === disabled;
  10256. }
  10257. return elem.disabled === disabled;
  10258. // Try to winnow out elements that can't be disabled before trusting the disabled property.
  10259. // Some victims get caught in our net (label, legend, menu, track), but it shouldn't
  10260. // even exist on them, let alone have a boolean value.
  10261. } else if ( "label" in elem ) {
  10262. return elem.disabled === disabled;
  10263. }
  10264. // Remaining elements are neither :enabled nor :disabled
  10265. return false;
  10266. };
  10267. }
  10268. /**
  10269. * Returns a function to use in pseudos for positionals
  10270. * @param {Function} fn
  10271. */
  10272. function createPositionalPseudo( fn ) {
  10273. return markFunction(function( argument ) {
  10274. argument = +argument;
  10275. return markFunction(function( seed, matches ) {
  10276. var j,
  10277. matchIndexes = fn( [], seed.length, argument ),
  10278. i = matchIndexes.length;
  10279. // Match elements found at the specified indexes
  10280. while ( i-- ) {
  10281. if ( seed[ (j = matchIndexes[i]) ] ) {
  10282. seed[j] = !(matches[j] = seed[j]);
  10283. }
  10284. }
  10285. });
  10286. });
  10287. }
  10288. /**
  10289. * Checks a node for validity as a Sizzle context
  10290. * @param {Element|Object=} context
  10291. * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
  10292. */
  10293. function testContext( context ) {
  10294. return context && typeof context.getElementsByTagName !== "undefined" && context;
  10295. }
  10296. // Expose support vars for convenience
  10297. support = Sizzle.support = {};
  10298. /**
  10299. * Detects XML nodes
  10300. * @param {Element|Object} elem An element or a document
  10301. * @returns {Boolean} True iff elem is a non-HTML XML node
  10302. */
  10303. isXML = Sizzle.isXML = function( elem ) {
  10304. var namespace = elem.namespaceURI,
  10305. docElem = (elem.ownerDocument || elem).documentElement;
  10306. // Support: IE <=8
  10307. // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes
  10308. // https://bugs.jquery.com/ticket/4833
  10309. return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" );
  10310. };
  10311. /**
  10312. * Sets document-related variables once based on the current document
  10313. * @param {Element|Object} [doc] An element or document object to use to set the document
  10314. * @returns {Object} Returns the current document
  10315. */
  10316. setDocument = Sizzle.setDocument = function( node ) {
  10317. var hasCompare, subWindow,
  10318. doc = node ? node.ownerDocument || node : preferredDoc;
  10319. // Return early if doc is invalid or already selected
  10320. if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
  10321. return document;
  10322. }
  10323. // Update global variables
  10324. document = doc;
  10325. docElem = document.documentElement;
  10326. documentIsHTML = !isXML( document );
  10327. // Support: IE 9-11, Edge
  10328. // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
  10329. if ( preferredDoc !== document &&
  10330. (subWindow = document.defaultView) && subWindow.top !== subWindow ) {
  10331. // Support: IE 11, Edge
  10332. if ( subWindow.addEventListener ) {
  10333. subWindow.addEventListener( "unload", unloadHandler, false );
  10334. // Support: IE 9 - 10 only
  10335. } else if ( subWindow.attachEvent ) {
  10336. subWindow.attachEvent( "onunload", unloadHandler );
  10337. }
  10338. }
  10339. /* Attributes
  10340. ---------------------------------------------------------------------- */
  10341. // Support: IE<8
  10342. // Verify that getAttribute really returns attributes and not properties
  10343. // (excepting IE8 booleans)
  10344. support.attributes = assert(function( el ) {
  10345. el.className = "i";
  10346. return !el.getAttribute("className");
  10347. });
  10348. /* getElement(s)By*
  10349. ---------------------------------------------------------------------- */
  10350. // Check if getElementsByTagName("*") returns only elements
  10351. support.getElementsByTagName = assert(function( el ) {
  10352. el.appendChild( document.createComment("") );
  10353. return !el.getElementsByTagName("*").length;
  10354. });
  10355. // Support: IE<9
  10356. support.getElementsByClassName = rnative.test( document.getElementsByClassName );
  10357. // Support: IE<10
  10358. // Check if getElementById returns elements by name
  10359. // The broken getElementById methods don't pick up programmatically-set names,
  10360. // so use a roundabout getElementsByName test
  10361. support.getById = assert(function( el ) {
  10362. docElem.appendChild( el ).id = expando;
  10363. return !document.getElementsByName || !document.getElementsByName( expando ).length;
  10364. });
  10365. // ID filter and find
  10366. if ( support.getById ) {
  10367. Expr.filter["ID"] = function( id ) {
  10368. var attrId = id.replace( runescape, funescape );
  10369. return function( elem ) {
  10370. return elem.getAttribute("id") === attrId;
  10371. };
  10372. };
  10373. Expr.find["ID"] = function( id, context ) {
  10374. if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
  10375. var elem = context.getElementById( id );
  10376. return elem ? [ elem ] : [];
  10377. }
  10378. };
  10379. } else {
  10380. Expr.filter["ID"] = function( id ) {
  10381. var attrId = id.replace( runescape, funescape );
  10382. return function( elem ) {
  10383. var node = typeof elem.getAttributeNode !== "undefined" &&
  10384. elem.getAttributeNode("id");
  10385. return node && node.value === attrId;
  10386. };
  10387. };
  10388. // Support: IE 6 - 7 only
  10389. // getElementById is not reliable as a find shortcut
  10390. Expr.find["ID"] = function( id, context ) {
  10391. if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
  10392. var node, i, elems,
  10393. elem = context.getElementById( id );
  10394. if ( elem ) {
  10395. // Verify the id attribute
  10396. node = elem.getAttributeNode("id");
  10397. if ( node && node.value === id ) {
  10398. return [ elem ];
  10399. }
  10400. // Fall back on getElementsByName
  10401. elems = context.getElementsByName( id );
  10402. i = 0;
  10403. while ( (elem = elems[i++]) ) {
  10404. node = elem.getAttributeNode("id");
  10405. if ( node && node.value === id ) {
  10406. return [ elem ];
  10407. }
  10408. }
  10409. }
  10410. return [];
  10411. }
  10412. };
  10413. }
  10414. // Tag
  10415. Expr.find["TAG"] = support.getElementsByTagName ?
  10416. function( tag, context ) {
  10417. if ( typeof context.getElementsByTagName !== "undefined" ) {
  10418. return context.getElementsByTagName( tag );
  10419. // DocumentFragment nodes don't have gEBTN
  10420. } else if ( support.qsa ) {
  10421. return context.querySelectorAll( tag );
  10422. }
  10423. } :
  10424. function( tag, context ) {
  10425. var elem,
  10426. tmp = [],
  10427. i = 0,
  10428. // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
  10429. results = context.getElementsByTagName( tag );
  10430. // Filter out possible comments
  10431. if ( tag === "*" ) {
  10432. while ( (elem = results[i++]) ) {
  10433. if ( elem.nodeType === 1 ) {
  10434. tmp.push( elem );
  10435. }
  10436. }
  10437. return tmp;
  10438. }
  10439. return results;
  10440. };
  10441. // Class
  10442. Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
  10443. if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
  10444. return context.getElementsByClassName( className );
  10445. }
  10446. };
  10447. /* QSA/matchesSelector
  10448. ---------------------------------------------------------------------- */
  10449. // QSA and matchesSelector support
  10450. // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
  10451. rbuggyMatches = [];
  10452. // qSa(:focus) reports false when true (Chrome 21)
  10453. // We allow this because of a bug in IE8/9 that throws an error
  10454. // whenever `document.activeElement` is accessed on an iframe
  10455. // So, we allow :focus to pass through QSA all the time to avoid the IE error
  10456. // See https://bugs.jquery.com/ticket/13378
  10457. rbuggyQSA = [];
  10458. if ( (support.qsa = rnative.test( document.querySelectorAll )) ) {
  10459. // Build QSA regex
  10460. // Regex strategy adopted from Diego Perini
  10461. assert(function( el ) {
  10462. // Select is set to empty string on purpose
  10463. // This is to test IE's treatment of not explicitly
  10464. // setting a boolean content attribute,
  10465. // since its presence should be enough
  10466. // https://bugs.jquery.com/ticket/12359
  10467. docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" +
  10468. "<select id='" + expando + "-\r\\' msallowcapture=''>" +
  10469. "<option selected=''></option></select>";
  10470. // Support: IE8, Opera 11-12.16
  10471. // Nothing should be selected when empty strings follow ^= or $= or *=
  10472. // The test attribute must be unknown in Opera but "safe" for WinRT
  10473. // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
  10474. if ( el.querySelectorAll("[msallowcapture^='']").length ) {
  10475. rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
  10476. }
  10477. // Support: IE8
  10478. // Boolean attributes and "value" are not treated correctly
  10479. if ( !el.querySelectorAll("[selected]").length ) {
  10480. rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
  10481. }
  10482. // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+
  10483. if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
  10484. rbuggyQSA.push("~=");
  10485. }
  10486. // Webkit/Opera - :checked should return selected option elements
  10487. // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
  10488. // IE8 throws error here and will not see later tests
  10489. if ( !el.querySelectorAll(":checked").length ) {
  10490. rbuggyQSA.push(":checked");
  10491. }
  10492. // Support: Safari 8+, iOS 8+
  10493. // https://bugs.webkit.org/show_bug.cgi?id=136851
  10494. // In-page `selector#id sibling-combinator selector` fails
  10495. if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {
  10496. rbuggyQSA.push(".#.+[+~]");
  10497. }
  10498. });
  10499. assert(function( el ) {
  10500. el.innerHTML = "<a href='' disabled='disabled'></a>" +
  10501. "<select disabled='disabled'><option/></select>";
  10502. // Support: Windows 8 Native Apps
  10503. // The type and name attributes are restricted during .innerHTML assignment
  10504. var input = document.createElement("input");
  10505. input.setAttribute( "type", "hidden" );
  10506. el.appendChild( input ).setAttribute( "name", "D" );
  10507. // Support: IE8
  10508. // Enforce case-sensitivity of name attribute
  10509. if ( el.querySelectorAll("[name=d]").length ) {
  10510. rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
  10511. }
  10512. // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
  10513. // IE8 throws error here and will not see later tests
  10514. if ( el.querySelectorAll(":enabled").length !== 2 ) {
  10515. rbuggyQSA.push( ":enabled", ":disabled" );
  10516. }
  10517. // Support: IE9-11+
  10518. // IE's :disabled selector does not pick up the children of disabled fieldsets
  10519. docElem.appendChild( el ).disabled = true;
  10520. if ( el.querySelectorAll(":disabled").length !== 2 ) {
  10521. rbuggyQSA.push( ":enabled", ":disabled" );
  10522. }
  10523. // Opera 10-11 does not throw on post-comma invalid pseudos
  10524. el.querySelectorAll("*,:x");
  10525. rbuggyQSA.push(",.*:");
  10526. });
  10527. }
  10528. if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
  10529. docElem.webkitMatchesSelector ||
  10530. docElem.mozMatchesSelector ||
  10531. docElem.oMatchesSelector ||
  10532. docElem.msMatchesSelector) )) ) {
  10533. assert(function( el ) {
  10534. // Check to see if it's possible to do matchesSelector
  10535. // on a disconnected node (IE 9)
  10536. support.disconnectedMatch = matches.call( el, "*" );
  10537. // This should fail with an exception
  10538. // Gecko does not error, returns false instead
  10539. matches.call( el, "[s!='']:x" );
  10540. rbuggyMatches.push( "!=", pseudos );
  10541. });
  10542. }
  10543. rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
  10544. rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
  10545. /* Contains
  10546. ---------------------------------------------------------------------- */
  10547. hasCompare = rnative.test( docElem.compareDocumentPosition );
  10548. // Element contains another
  10549. // Purposefully self-exclusive
  10550. // As in, an element does not contain itself
  10551. contains = hasCompare || rnative.test( docElem.contains ) ?
  10552. function( a, b ) {
  10553. var adown = a.nodeType === 9 ? a.documentElement : a,
  10554. bup = b && b.parentNode;
  10555. return a === bup || !!( bup && bup.nodeType === 1 && (
  10556. adown.contains ?
  10557. adown.contains( bup ) :
  10558. a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
  10559. ));
  10560. } :
  10561. function( a, b ) {
  10562. if ( b ) {
  10563. while ( (b = b.parentNode) ) {
  10564. if ( b === a ) {
  10565. return true;
  10566. }
  10567. }
  10568. }
  10569. return false;
  10570. };
  10571. /* Sorting
  10572. ---------------------------------------------------------------------- */
  10573. // Document order sorting
  10574. sortOrder = hasCompare ?
  10575. function( a, b ) {
  10576. // Flag for duplicate removal
  10577. if ( a === b ) {
  10578. hasDuplicate = true;
  10579. return 0;
  10580. }
  10581. // Sort on method existence if only one input has compareDocumentPosition
  10582. var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
  10583. if ( compare ) {
  10584. return compare;
  10585. }
  10586. // Calculate position if both inputs belong to the same document
  10587. compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
  10588. a.compareDocumentPosition( b ) :
  10589. // Otherwise we know they are disconnected
  10590. 1;
  10591. // Disconnected nodes
  10592. if ( compare & 1 ||
  10593. (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
  10594. // Choose the first element that is related to our preferred document
  10595. if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
  10596. return -1;
  10597. }
  10598. if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
  10599. return 1;
  10600. }
  10601. // Maintain original order
  10602. return sortInput ?
  10603. ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
  10604. 0;
  10605. }
  10606. return compare & 4 ? -1 : 1;
  10607. } :
  10608. function( a, b ) {
  10609. // Exit early if the nodes are identical
  10610. if ( a === b ) {
  10611. hasDuplicate = true;
  10612. return 0;
  10613. }
  10614. var cur,
  10615. i = 0,
  10616. aup = a.parentNode,
  10617. bup = b.parentNode,
  10618. ap = [ a ],
  10619. bp = [ b ];
  10620. // Parentless nodes are either documents or disconnected
  10621. if ( !aup || !bup ) {
  10622. return a === document ? -1 :
  10623. b === document ? 1 :
  10624. aup ? -1 :
  10625. bup ? 1 :
  10626. sortInput ?
  10627. ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
  10628. 0;
  10629. // If the nodes are siblings, we can do a quick check
  10630. } else if ( aup === bup ) {
  10631. return siblingCheck( a, b );
  10632. }
  10633. // Otherwise we need full lists of their ancestors for comparison
  10634. cur = a;
  10635. while ( (cur = cur.parentNode) ) {
  10636. ap.unshift( cur );
  10637. }
  10638. cur = b;
  10639. while ( (cur = cur.parentNode) ) {
  10640. bp.unshift( cur );
  10641. }
  10642. // Walk down the tree looking for a discrepancy
  10643. while ( ap[i] === bp[i] ) {
  10644. i++;
  10645. }
  10646. return i ?
  10647. // Do a sibling check if the nodes have a common ancestor
  10648. siblingCheck( ap[i], bp[i] ) :
  10649. // Otherwise nodes in our document sort first
  10650. ap[i] === preferredDoc ? -1 :
  10651. bp[i] === preferredDoc ? 1 :
  10652. 0;
  10653. };
  10654. return document;
  10655. };
  10656. Sizzle.matches = function( expr, elements ) {
  10657. return Sizzle( expr, null, null, elements );
  10658. };
  10659. Sizzle.matchesSelector = function( elem, expr ) {
  10660. // Set document vars if needed
  10661. if ( ( elem.ownerDocument || elem ) !== document ) {
  10662. setDocument( elem );
  10663. }
  10664. if ( support.matchesSelector && documentIsHTML &&
  10665. !nonnativeSelectorCache[ expr + " " ] &&
  10666. ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
  10667. ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
  10668. try {
  10669. var ret = matches.call( elem, expr );
  10670. // IE 9's matchesSelector returns false on disconnected nodes
  10671. if ( ret || support.disconnectedMatch ||
  10672. // As well, disconnected nodes are said to be in a document
  10673. // fragment in IE 9
  10674. elem.document && elem.document.nodeType !== 11 ) {
  10675. return ret;
  10676. }
  10677. } catch (e) {
  10678. nonnativeSelectorCache( expr, true );
  10679. }
  10680. }
  10681. return Sizzle( expr, document, null, [ elem ] ).length > 0;
  10682. };
  10683. Sizzle.contains = function( context, elem ) {
  10684. // Set document vars if needed
  10685. if ( ( context.ownerDocument || context ) !== document ) {
  10686. setDocument( context );
  10687. }
  10688. return contains( context, elem );
  10689. };
  10690. Sizzle.attr = function( elem, name ) {
  10691. // Set document vars if needed
  10692. if ( ( elem.ownerDocument || elem ) !== document ) {
  10693. setDocument( elem );
  10694. }
  10695. var fn = Expr.attrHandle[ name.toLowerCase() ],
  10696. // Don't get fooled by Object.prototype properties (jQuery #13807)
  10697. val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
  10698. fn( elem, name, !documentIsHTML ) :
  10699. undefined;
  10700. return val !== undefined ?
  10701. val :
  10702. support.attributes || !documentIsHTML ?
  10703. elem.getAttribute( name ) :
  10704. (val = elem.getAttributeNode(name)) && val.specified ?
  10705. val.value :
  10706. null;
  10707. };
  10708. Sizzle.escape = function( sel ) {
  10709. return (sel + "").replace( rcssescape, fcssescape );
  10710. };
  10711. Sizzle.error = function( msg ) {
  10712. throw new Error( "Syntax error, unrecognized expression: " + msg );
  10713. };
  10714. /**
  10715. * Document sorting and removing duplicates
  10716. * @param {ArrayLike} results
  10717. */
  10718. Sizzle.uniqueSort = function( results ) {
  10719. var elem,
  10720. duplicates = [],
  10721. j = 0,
  10722. i = 0;
  10723. // Unless we *know* we can detect duplicates, assume their presence
  10724. hasDuplicate = !support.detectDuplicates;
  10725. sortInput = !support.sortStable && results.slice( 0 );
  10726. results.sort( sortOrder );
  10727. if ( hasDuplicate ) {
  10728. while ( (elem = results[i++]) ) {
  10729. if ( elem === results[ i ] ) {
  10730. j = duplicates.push( i );
  10731. }
  10732. }
  10733. while ( j-- ) {
  10734. results.splice( duplicates[ j ], 1 );
  10735. }
  10736. }
  10737. // Clear input after sorting to release objects
  10738. // See https://github.com/jquery/sizzle/pull/225
  10739. sortInput = null;
  10740. return results;
  10741. };
  10742. /**
  10743. * Utility function for retrieving the text value of an array of DOM nodes
  10744. * @param {Array|Element} elem
  10745. */
  10746. getText = Sizzle.getText = function( elem ) {
  10747. var node,
  10748. ret = "",
  10749. i = 0,
  10750. nodeType = elem.nodeType;
  10751. if ( !nodeType ) {
  10752. // If no nodeType, this is expected to be an array
  10753. while ( (node = elem[i++]) ) {
  10754. // Do not traverse comment nodes
  10755. ret += getText( node );
  10756. }
  10757. } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
  10758. // Use textContent for elements
  10759. // innerText usage removed for consistency of new lines (jQuery #11153)
  10760. if ( typeof elem.textContent === "string" ) {
  10761. return elem.textContent;
  10762. } else {
  10763. // Traverse its children
  10764. for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
  10765. ret += getText( elem );
  10766. }
  10767. }
  10768. } else if ( nodeType === 3 || nodeType === 4 ) {
  10769. return elem.nodeValue;
  10770. }
  10771. // Do not include comment or processing instruction nodes
  10772. return ret;
  10773. };
  10774. Expr = Sizzle.selectors = {
  10775. // Can be adjusted by the user
  10776. cacheLength: 50,
  10777. createPseudo: markFunction,
  10778. match: matchExpr,
  10779. attrHandle: {},
  10780. find: {},
  10781. relative: {
  10782. ">": { dir: "parentNode", first: true },
  10783. " ": { dir: "parentNode" },
  10784. "+": { dir: "previousSibling", first: true },
  10785. "~": { dir: "previousSibling" }
  10786. },
  10787. preFilter: {
  10788. "ATTR": function( match ) {
  10789. match[1] = match[1].replace( runescape, funescape );
  10790. // Move the given value to match[3] whether quoted or unquoted
  10791. match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
  10792. if ( match[2] === "~=" ) {
  10793. match[3] = " " + match[3] + " ";
  10794. }
  10795. return match.slice( 0, 4 );
  10796. },
  10797. "CHILD": function( match ) {
  10798. /* matches from matchExpr["CHILD"]
  10799. 1 type (only|nth|...)
  10800. 2 what (child|of-type)
  10801. 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
  10802. 4 xn-component of xn+y argument ([+-]?\d*n|)
  10803. 5 sign of xn-component
  10804. 6 x of xn-component
  10805. 7 sign of y-component
  10806. 8 y of y-component
  10807. */
  10808. match[1] = match[1].toLowerCase();
  10809. if ( match[1].slice( 0, 3 ) === "nth" ) {
  10810. // nth-* requires argument
  10811. if ( !match[3] ) {
  10812. Sizzle.error( match[0] );
  10813. }
  10814. // numeric x and y parameters for Expr.filter.CHILD
  10815. // remember that false/true cast respectively to 0/1
  10816. match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
  10817. match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
  10818. // other types prohibit arguments
  10819. } else if ( match[3] ) {
  10820. Sizzle.error( match[0] );
  10821. }
  10822. return match;
  10823. },
  10824. "PSEUDO": function( match ) {
  10825. var excess,
  10826. unquoted = !match[6] && match[2];
  10827. if ( matchExpr["CHILD"].test( match[0] ) ) {
  10828. return null;
  10829. }
  10830. // Accept quoted arguments as-is
  10831. if ( match[3] ) {
  10832. match[2] = match[4] || match[5] || "";
  10833. // Strip excess characters from unquoted arguments
  10834. } else if ( unquoted && rpseudo.test( unquoted ) &&
  10835. // Get excess from tokenize (recursively)
  10836. (excess = tokenize( unquoted, true )) &&
  10837. // advance to the next closing parenthesis
  10838. (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
  10839. // excess is a negative index
  10840. match[0] = match[0].slice( 0, excess );
  10841. match[2] = unquoted.slice( 0, excess );
  10842. }
  10843. // Return only captures needed by the pseudo filter method (type and argument)
  10844. return match.slice( 0, 3 );
  10845. }
  10846. },
  10847. filter: {
  10848. "TAG": function( nodeNameSelector ) {
  10849. var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
  10850. return nodeNameSelector === "*" ?
  10851. function() { return true; } :
  10852. function( elem ) {
  10853. return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
  10854. };
  10855. },
  10856. "CLASS": function( className ) {
  10857. var pattern = classCache[ className + " " ];
  10858. return pattern ||
  10859. (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
  10860. classCache( className, function( elem ) {
  10861. return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );
  10862. });
  10863. },
  10864. "ATTR": function( name, operator, check ) {
  10865. return function( elem ) {
  10866. var result = Sizzle.attr( elem, name );
  10867. if ( result == null ) {
  10868. return operator === "!=";
  10869. }
  10870. if ( !operator ) {
  10871. return true;
  10872. }
  10873. result += "";
  10874. return operator === "=" ? result === check :
  10875. operator === "!=" ? result !== check :
  10876. operator === "^=" ? check && result.indexOf( check ) === 0 :
  10877. operator === "*=" ? check && result.indexOf( check ) > -1 :
  10878. operator === "$=" ? check && result.slice( -check.length ) === check :
  10879. operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
  10880. operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
  10881. false;
  10882. };
  10883. },
  10884. "CHILD": function( type, what, argument, first, last ) {
  10885. var simple = type.slice( 0, 3 ) !== "nth",
  10886. forward = type.slice( -4 ) !== "last",
  10887. ofType = what === "of-type";
  10888. return first === 1 && last === 0 ?
  10889. // Shortcut for :nth-*(n)
  10890. function( elem ) {
  10891. return !!elem.parentNode;
  10892. } :
  10893. function( elem, context, xml ) {
  10894. var cache, uniqueCache, outerCache, node, nodeIndex, start,
  10895. dir = simple !== forward ? "nextSibling" : "previousSibling",
  10896. parent = elem.parentNode,
  10897. name = ofType && elem.nodeName.toLowerCase(),
  10898. useCache = !xml && !ofType,
  10899. diff = false;
  10900. if ( parent ) {
  10901. // :(first|last|only)-(child|of-type)
  10902. if ( simple ) {
  10903. while ( dir ) {
  10904. node = elem;
  10905. while ( (node = node[ dir ]) ) {
  10906. if ( ofType ?
  10907. node.nodeName.toLowerCase() === name :
  10908. node.nodeType === 1 ) {
  10909. return false;
  10910. }
  10911. }
  10912. // Reverse direction for :only-* (if we haven't yet done so)
  10913. start = dir = type === "only" && !start && "nextSibling";
  10914. }
  10915. return true;
  10916. }
  10917. start = [ forward ? parent.firstChild : parent.lastChild ];
  10918. // non-xml :nth-child(...) stores cache data on `parent`
  10919. if ( forward && useCache ) {
  10920. // Seek `elem` from a previously-cached index
  10921. // ...in a gzip-friendly way
  10922. node = parent;
  10923. outerCache = node[ expando ] || (node[ expando ] = {});
  10924. // Support: IE <9 only
  10925. // Defend against cloned attroperties (jQuery gh-1709)
  10926. uniqueCache = outerCache[ node.uniqueID ] ||
  10927. (outerCache[ node.uniqueID ] = {});
  10928. cache = uniqueCache[ type ] || [];
  10929. nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
  10930. diff = nodeIndex && cache[ 2 ];
  10931. node = nodeIndex && parent.childNodes[ nodeIndex ];
  10932. while ( (node = ++nodeIndex && node && node[ dir ] ||
  10933. // Fallback to seeking `elem` from the start
  10934. (diff = nodeIndex = 0) || start.pop()) ) {
  10935. // When found, cache indexes on `parent` and break
  10936. if ( node.nodeType === 1 && ++diff && node === elem ) {
  10937. uniqueCache[ type ] = [ dirruns, nodeIndex, diff ];
  10938. break;
  10939. }
  10940. }
  10941. } else {
  10942. // Use previously-cached element index if available
  10943. if ( useCache ) {
  10944. // ...in a gzip-friendly way
  10945. node = elem;
  10946. outerCache = node[ expando ] || (node[ expando ] = {});
  10947. // Support: IE <9 only
  10948. // Defend against cloned attroperties (jQuery gh-1709)
  10949. uniqueCache = outerCache[ node.uniqueID ] ||
  10950. (outerCache[ node.uniqueID ] = {});
  10951. cache = uniqueCache[ type ] || [];
  10952. nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
  10953. diff = nodeIndex;
  10954. }
  10955. // xml :nth-child(...)
  10956. // or :nth-last-child(...) or :nth(-last)?-of-type(...)
  10957. if ( diff === false ) {
  10958. // Use the same loop as above to seek `elem` from the start
  10959. while ( (node = ++nodeIndex && node && node[ dir ] ||
  10960. (diff = nodeIndex = 0) || start.pop()) ) {
  10961. if ( ( ofType ?
  10962. node.nodeName.toLowerCase() === name :
  10963. node.nodeType === 1 ) &&
  10964. ++diff ) {
  10965. // Cache the index of each encountered element
  10966. if ( useCache ) {
  10967. outerCache = node[ expando ] || (node[ expando ] = {});
  10968. // Support: IE <9 only
  10969. // Defend against cloned attroperties (jQuery gh-1709)
  10970. uniqueCache = outerCache[ node.uniqueID ] ||
  10971. (outerCache[ node.uniqueID ] = {});
  10972. uniqueCache[ type ] = [ dirruns, diff ];
  10973. }
  10974. if ( node === elem ) {
  10975. break;
  10976. }
  10977. }
  10978. }
  10979. }
  10980. }
  10981. // Incorporate the offset, then check against cycle size
  10982. diff -= last;
  10983. return diff === first || ( diff % first === 0 && diff / first >= 0 );
  10984. }
  10985. };
  10986. },
  10987. "PSEUDO": function( pseudo, argument ) {
  10988. // pseudo-class names are case-insensitive
  10989. // http://www.w3.org/TR/selectors/#pseudo-classes
  10990. // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
  10991. // Remember that setFilters inherits from pseudos
  10992. var args,
  10993. fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
  10994. Sizzle.error( "unsupported pseudo: " + pseudo );
  10995. // The user may use createPseudo to indicate that
  10996. // arguments are needed to create the filter function
  10997. // just as Sizzle does
  10998. if ( fn[ expando ] ) {
  10999. return fn( argument );
  11000. }
  11001. // But maintain support for old signatures
  11002. if ( fn.length > 1 ) {
  11003. args = [ pseudo, pseudo, "", argument ];
  11004. return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
  11005. markFunction(function( seed, matches ) {
  11006. var idx,
  11007. matched = fn( seed, argument ),
  11008. i = matched.length;
  11009. while ( i-- ) {
  11010. idx = indexOf( seed, matched[i] );
  11011. seed[ idx ] = !( matches[ idx ] = matched[i] );
  11012. }
  11013. }) :
  11014. function( elem ) {
  11015. return fn( elem, 0, args );
  11016. };
  11017. }
  11018. return fn;
  11019. }
  11020. },
  11021. pseudos: {
  11022. // Potentially complex pseudos
  11023. "not": markFunction(function( selector ) {
  11024. // Trim the selector passed to compile
  11025. // to avoid treating leading and trailing
  11026. // spaces as combinators
  11027. var input = [],
  11028. results = [],
  11029. matcher = compile( selector.replace( rtrim, "$1" ) );
  11030. return matcher[ expando ] ?
  11031. markFunction(function( seed, matches, context, xml ) {
  11032. var elem,
  11033. unmatched = matcher( seed, null, xml, [] ),
  11034. i = seed.length;
  11035. // Match elements unmatched by `matcher`
  11036. while ( i-- ) {
  11037. if ( (elem = unmatched[i]) ) {
  11038. seed[i] = !(matches[i] = elem);
  11039. }
  11040. }
  11041. }) :
  11042. function( elem, context, xml ) {
  11043. input[0] = elem;
  11044. matcher( input, null, xml, results );
  11045. // Don't keep the element (issue #299)
  11046. input[0] = null;
  11047. return !results.pop();
  11048. };
  11049. }),
  11050. "has": markFunction(function( selector ) {
  11051. return function( elem ) {
  11052. return Sizzle( selector, elem ).length > 0;
  11053. };
  11054. }),
  11055. "contains": markFunction(function( text ) {
  11056. text = text.replace( runescape, funescape );
  11057. return function( elem ) {
  11058. return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1;
  11059. };
  11060. }),
  11061. // "Whether an element is represented by a :lang() selector
  11062. // is based solely on the element's language value
  11063. // being equal to the identifier C,
  11064. // or beginning with the identifier C immediately followed by "-".
  11065. // The matching of C against the element's language value is performed case-insensitively.
  11066. // The identifier C does not have to be a valid language name."
  11067. // http://www.w3.org/TR/selectors/#lang-pseudo
  11068. "lang": markFunction( function( lang ) {
  11069. // lang value must be a valid identifier
  11070. if ( !ridentifier.test(lang || "") ) {
  11071. Sizzle.error( "unsupported lang: " + lang );
  11072. }
  11073. lang = lang.replace( runescape, funescape ).toLowerCase();
  11074. return function( elem ) {
  11075. var elemLang;
  11076. do {
  11077. if ( (elemLang = documentIsHTML ?
  11078. elem.lang :
  11079. elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
  11080. elemLang = elemLang.toLowerCase();
  11081. return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
  11082. }
  11083. } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
  11084. return false;
  11085. };
  11086. }),
  11087. // Miscellaneous
  11088. "target": function( elem ) {
  11089. var hash = window.location && window.location.hash;
  11090. return hash && hash.slice( 1 ) === elem.id;
  11091. },
  11092. "root": function( elem ) {
  11093. return elem === docElem;
  11094. },
  11095. "focus": function( elem ) {
  11096. return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
  11097. },
  11098. // Boolean properties
  11099. "enabled": createDisabledPseudo( false ),
  11100. "disabled": createDisabledPseudo( true ),
  11101. "checked": function( elem ) {
  11102. // In CSS3, :checked should return both checked and selected elements
  11103. // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
  11104. var nodeName = elem.nodeName.toLowerCase();
  11105. return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
  11106. },
  11107. "selected": function( elem ) {
  11108. // Accessing this property makes selected-by-default
  11109. // options in Safari work properly
  11110. if ( elem.parentNode ) {
  11111. elem.parentNode.selectedIndex;
  11112. }
  11113. return elem.selected === true;
  11114. },
  11115. // Contents
  11116. "empty": function( elem ) {
  11117. // http://www.w3.org/TR/selectors/#empty-pseudo
  11118. // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
  11119. // but not by others (comment: 8; processing instruction: 7; etc.)
  11120. // nodeType < 6 works because attributes (2) do not appear as children
  11121. for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
  11122. if ( elem.nodeType < 6 ) {
  11123. return false;
  11124. }
  11125. }
  11126. return true;
  11127. },
  11128. "parent": function( elem ) {
  11129. return !Expr.pseudos["empty"]( elem );
  11130. },
  11131. // Element/input types
  11132. "header": function( elem ) {
  11133. return rheader.test( elem.nodeName );
  11134. },
  11135. "input": function( elem ) {
  11136. return rinputs.test( elem.nodeName );
  11137. },
  11138. "button": function( elem ) {
  11139. var name = elem.nodeName.toLowerCase();
  11140. return name === "input" && elem.type === "button" || name === "button";
  11141. },
  11142. "text": function( elem ) {
  11143. var attr;
  11144. return elem.nodeName.toLowerCase() === "input" &&
  11145. elem.type === "text" &&
  11146. // Support: IE<8
  11147. // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
  11148. ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
  11149. },
  11150. // Position-in-collection
  11151. "first": createPositionalPseudo(function() {
  11152. return [ 0 ];
  11153. }),
  11154. "last": createPositionalPseudo(function( matchIndexes, length ) {
  11155. return [ length - 1 ];
  11156. }),
  11157. "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
  11158. return [ argument < 0 ? argument + length : argument ];
  11159. }),
  11160. "even": createPositionalPseudo(function( matchIndexes, length ) {
  11161. var i = 0;
  11162. for ( ; i < length; i += 2 ) {
  11163. matchIndexes.push( i );
  11164. }
  11165. return matchIndexes;
  11166. }),
  11167. "odd": createPositionalPseudo(function( matchIndexes, length ) {
  11168. var i = 1;
  11169. for ( ; i < length; i += 2 ) {
  11170. matchIndexes.push( i );
  11171. }
  11172. return matchIndexes;
  11173. }),
  11174. "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
  11175. var i = argument < 0 ?
  11176. argument + length :
  11177. argument > length ?
  11178. length :
  11179. argument;
  11180. for ( ; --i >= 0; ) {
  11181. matchIndexes.push( i );
  11182. }
  11183. return matchIndexes;
  11184. }),
  11185. "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
  11186. var i = argument < 0 ? argument + length : argument;
  11187. for ( ; ++i < length; ) {
  11188. matchIndexes.push( i );
  11189. }
  11190. return matchIndexes;
  11191. })
  11192. }
  11193. };
  11194. Expr.pseudos["nth"] = Expr.pseudos["eq"];
  11195. // Add button/input type pseudos
  11196. for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
  11197. Expr.pseudos[ i ] = createInputPseudo( i );
  11198. }
  11199. for ( i in { submit: true, reset: true } ) {
  11200. Expr.pseudos[ i ] = createButtonPseudo( i );
  11201. }
  11202. // Easy API for creating new setFilters
  11203. function setFilters() {}
  11204. setFilters.prototype = Expr.filters = Expr.pseudos;
  11205. Expr.setFilters = new setFilters();
  11206. tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
  11207. var matched, match, tokens, type,
  11208. soFar, groups, preFilters,
  11209. cached = tokenCache[ selector + " " ];
  11210. if ( cached ) {
  11211. return parseOnly ? 0 : cached.slice( 0 );
  11212. }
  11213. soFar = selector;
  11214. groups = [];
  11215. preFilters = Expr.preFilter;
  11216. while ( soFar ) {
  11217. // Comma and first run
  11218. if ( !matched || (match = rcomma.exec( soFar )) ) {
  11219. if ( match ) {
  11220. // Don't consume trailing commas as valid
  11221. soFar = soFar.slice( match[0].length ) || soFar;
  11222. }
  11223. groups.push( (tokens = []) );
  11224. }
  11225. matched = false;
  11226. // Combinators
  11227. if ( (match = rcombinators.exec( soFar )) ) {
  11228. matched = match.shift();
  11229. tokens.push({
  11230. value: matched,
  11231. // Cast descendant combinators to space
  11232. type: match[0].replace( rtrim, " " )
  11233. });
  11234. soFar = soFar.slice( matched.length );
  11235. }
  11236. // Filters
  11237. for ( type in Expr.filter ) {
  11238. if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
  11239. (match = preFilters[ type ]( match ))) ) {
  11240. matched = match.shift();
  11241. tokens.push({
  11242. value: matched,
  11243. type: type,
  11244. matches: match
  11245. });
  11246. soFar = soFar.slice( matched.length );
  11247. }
  11248. }
  11249. if ( !matched ) {
  11250. break;
  11251. }
  11252. }
  11253. // Return the length of the invalid excess
  11254. // if we're just parsing
  11255. // Otherwise, throw an error or return tokens
  11256. return parseOnly ?
  11257. soFar.length :
  11258. soFar ?
  11259. Sizzle.error( selector ) :
  11260. // Cache the tokens
  11261. tokenCache( selector, groups ).slice( 0 );
  11262. };
  11263. function toSelector( tokens ) {
  11264. var i = 0,
  11265. len = tokens.length,
  11266. selector = "";
  11267. for ( ; i < len; i++ ) {
  11268. selector += tokens[i].value;
  11269. }
  11270. return selector;
  11271. }
  11272. function addCombinator( matcher, combinator, base ) {
  11273. var dir = combinator.dir,
  11274. skip = combinator.next,
  11275. key = skip || dir,
  11276. checkNonElements = base && key === "parentNode",
  11277. doneName = done++;
  11278. return combinator.first ?
  11279. // Check against closest ancestor/preceding element
  11280. function( elem, context, xml ) {
  11281. while ( (elem = elem[ dir ]) ) {
  11282. if ( elem.nodeType === 1 || checkNonElements ) {
  11283. return matcher( elem, context, xml );
  11284. }
  11285. }
  11286. return false;
  11287. } :
  11288. // Check against all ancestor/preceding elements
  11289. function( elem, context, xml ) {
  11290. var oldCache, uniqueCache, outerCache,
  11291. newCache = [ dirruns, doneName ];
  11292. // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
  11293. if ( xml ) {
  11294. while ( (elem = elem[ dir ]) ) {
  11295. if ( elem.nodeType === 1 || checkNonElements ) {
  11296. if ( matcher( elem, context, xml ) ) {
  11297. return true;
  11298. }
  11299. }
  11300. }
  11301. } else {
  11302. while ( (elem = elem[ dir ]) ) {
  11303. if ( elem.nodeType === 1 || checkNonElements ) {
  11304. outerCache = elem[ expando ] || (elem[ expando ] = {});
  11305. // Support: IE <9 only
  11306. // Defend against cloned attroperties (jQuery gh-1709)
  11307. uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {});
  11308. if ( skip && skip === elem.nodeName.toLowerCase() ) {
  11309. elem = elem[ dir ] || elem;
  11310. } else if ( (oldCache = uniqueCache[ key ]) &&
  11311. oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
  11312. // Assign to newCache so results back-propagate to previous elements
  11313. return (newCache[ 2 ] = oldCache[ 2 ]);
  11314. } else {
  11315. // Reuse newcache so results back-propagate to previous elements
  11316. uniqueCache[ key ] = newCache;
  11317. // A match means we're done; a fail means we have to keep checking
  11318. if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
  11319. return true;
  11320. }
  11321. }
  11322. }
  11323. }
  11324. }
  11325. return false;
  11326. };
  11327. }
  11328. function elementMatcher( matchers ) {
  11329. return matchers.length > 1 ?
  11330. function( elem, context, xml ) {
  11331. var i = matchers.length;
  11332. while ( i-- ) {
  11333. if ( !matchers[i]( elem, context, xml ) ) {
  11334. return false;
  11335. }
  11336. }
  11337. return true;
  11338. } :
  11339. matchers[0];
  11340. }
  11341. function multipleContexts( selector, contexts, results ) {
  11342. var i = 0,
  11343. len = contexts.length;
  11344. for ( ; i < len; i++ ) {
  11345. Sizzle( selector, contexts[i], results );
  11346. }
  11347. return results;
  11348. }
  11349. function condense( unmatched, map, filter, context, xml ) {
  11350. var elem,
  11351. newUnmatched = [],
  11352. i = 0,
  11353. len = unmatched.length,
  11354. mapped = map != null;
  11355. for ( ; i < len; i++ ) {
  11356. if ( (elem = unmatched[i]) ) {
  11357. if ( !filter || filter( elem, context, xml ) ) {
  11358. newUnmatched.push( elem );
  11359. if ( mapped ) {
  11360. map.push( i );
  11361. }
  11362. }
  11363. }
  11364. }
  11365. return newUnmatched;
  11366. }
  11367. function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
  11368. if ( postFilter && !postFilter[ expando ] ) {
  11369. postFilter = setMatcher( postFilter );
  11370. }
  11371. if ( postFinder && !postFinder[ expando ] ) {
  11372. postFinder = setMatcher( postFinder, postSelector );
  11373. }
  11374. return markFunction(function( seed, results, context, xml ) {
  11375. var temp, i, elem,
  11376. preMap = [],
  11377. postMap = [],
  11378. preexisting = results.length,
  11379. // Get initial elements from seed or context
  11380. elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
  11381. // Prefilter to get matcher input, preserving a map for seed-results synchronization
  11382. matcherIn = preFilter && ( seed || !selector ) ?
  11383. condense( elems, preMap, preFilter, context, xml ) :
  11384. elems,
  11385. matcherOut = matcher ?
  11386. // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
  11387. postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
  11388. // ...intermediate processing is necessary
  11389. [] :
  11390. // ...otherwise use results directly
  11391. results :
  11392. matcherIn;
  11393. // Find primary matches
  11394. if ( matcher ) {
  11395. matcher( matcherIn, matcherOut, context, xml );
  11396. }
  11397. // Apply postFilter
  11398. if ( postFilter ) {
  11399. temp = condense( matcherOut, postMap );
  11400. postFilter( temp, [], context, xml );
  11401. // Un-match failing elements by moving them back to matcherIn
  11402. i = temp.length;
  11403. while ( i-- ) {
  11404. if ( (elem = temp[i]) ) {
  11405. matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
  11406. }
  11407. }
  11408. }
  11409. if ( seed ) {
  11410. if ( postFinder || preFilter ) {
  11411. if ( postFinder ) {
  11412. // Get the final matcherOut by condensing this intermediate into postFinder contexts
  11413. temp = [];
  11414. i = matcherOut.length;
  11415. while ( i-- ) {
  11416. if ( (elem = matcherOut[i]) ) {
  11417. // Restore matcherIn since elem is not yet a final match
  11418. temp.push( (matcherIn[i] = elem) );
  11419. }
  11420. }
  11421. postFinder( null, (matcherOut = []), temp, xml );
  11422. }
  11423. // Move matched elements from seed to results to keep them synchronized
  11424. i = matcherOut.length;
  11425. while ( i-- ) {
  11426. if ( (elem = matcherOut[i]) &&
  11427. (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
  11428. seed[temp] = !(results[temp] = elem);
  11429. }
  11430. }
  11431. }
  11432. // Add elements to results, through postFinder if defined
  11433. } else {
  11434. matcherOut = condense(
  11435. matcherOut === results ?
  11436. matcherOut.splice( preexisting, matcherOut.length ) :
  11437. matcherOut
  11438. );
  11439. if ( postFinder ) {
  11440. postFinder( null, results, matcherOut, xml );
  11441. } else {
  11442. push.apply( results, matcherOut );
  11443. }
  11444. }
  11445. });
  11446. }
  11447. function matcherFromTokens( tokens ) {
  11448. var checkContext, matcher, j,
  11449. len = tokens.length,
  11450. leadingRelative = Expr.relative[ tokens[0].type ],
  11451. implicitRelative = leadingRelative || Expr.relative[" "],
  11452. i = leadingRelative ? 1 : 0,
  11453. // The foundational matcher ensures that elements are reachable from top-level context(s)
  11454. matchContext = addCombinator( function( elem ) {
  11455. return elem === checkContext;
  11456. }, implicitRelative, true ),
  11457. matchAnyContext = addCombinator( function( elem ) {
  11458. return indexOf( checkContext, elem ) > -1;
  11459. }, implicitRelative, true ),
  11460. matchers = [ function( elem, context, xml ) {
  11461. var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
  11462. (checkContext = context).nodeType ?
  11463. matchContext( elem, context, xml ) :
  11464. matchAnyContext( elem, context, xml ) );
  11465. // Avoid hanging onto element (issue #299)
  11466. checkContext = null;
  11467. return ret;
  11468. } ];
  11469. for ( ; i < len; i++ ) {
  11470. if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
  11471. matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
  11472. } else {
  11473. matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
  11474. // Return special upon seeing a positional matcher
  11475. if ( matcher[ expando ] ) {
  11476. // Find the next relative operator (if any) for proper handling
  11477. j = ++i;
  11478. for ( ; j < len; j++ ) {
  11479. if ( Expr.relative[ tokens[j].type ] ) {
  11480. break;
  11481. }
  11482. }
  11483. return setMatcher(
  11484. i > 1 && elementMatcher( matchers ),
  11485. i > 1 && toSelector(
  11486. // If the preceding token was a descendant combinator, insert an implicit any-element `*`
  11487. tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
  11488. ).replace( rtrim, "$1" ),
  11489. matcher,
  11490. i < j && matcherFromTokens( tokens.slice( i, j ) ),
  11491. j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
  11492. j < len && toSelector( tokens )
  11493. );
  11494. }
  11495. matchers.push( matcher );
  11496. }
  11497. }
  11498. return elementMatcher( matchers );
  11499. }
  11500. function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
  11501. var bySet = setMatchers.length > 0,
  11502. byElement = elementMatchers.length > 0,
  11503. superMatcher = function( seed, context, xml, results, outermost ) {
  11504. var elem, j, matcher,
  11505. matchedCount = 0,
  11506. i = "0",
  11507. unmatched = seed && [],
  11508. setMatched = [],
  11509. contextBackup = outermostContext,
  11510. // We must always have either seed elements or outermost context
  11511. elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
  11512. // Use integer dirruns iff this is the outermost matcher
  11513. dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
  11514. len = elems.length;
  11515. if ( outermost ) {
  11516. outermostContext = context === document || context || outermost;
  11517. }
  11518. // Add elements passing elementMatchers directly to results
  11519. // Support: IE<9, Safari
  11520. // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
  11521. for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
  11522. if ( byElement && elem ) {
  11523. j = 0;
  11524. if ( !context && elem.ownerDocument !== document ) {
  11525. setDocument( elem );
  11526. xml = !documentIsHTML;
  11527. }
  11528. while ( (matcher = elementMatchers[j++]) ) {
  11529. if ( matcher( elem, context || document, xml) ) {
  11530. results.push( elem );
  11531. break;
  11532. }
  11533. }
  11534. if ( outermost ) {
  11535. dirruns = dirrunsUnique;
  11536. }
  11537. }
  11538. // Track unmatched elements for set filters
  11539. if ( bySet ) {
  11540. // They will have gone through all possible matchers
  11541. if ( (elem = !matcher && elem) ) {
  11542. matchedCount--;
  11543. }
  11544. // Lengthen the array for every element, matched or not
  11545. if ( seed ) {
  11546. unmatched.push( elem );
  11547. }
  11548. }
  11549. }
  11550. // `i` is now the count of elements visited above, and adding it to `matchedCount`
  11551. // makes the latter nonnegative.
  11552. matchedCount += i;
  11553. // Apply set filters to unmatched elements
  11554. // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`
  11555. // equals `i`), unless we didn't visit _any_ elements in the above loop because we have
  11556. // no element matchers and no seed.
  11557. // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that
  11558. // case, which will result in a "00" `matchedCount` that differs from `i` but is also
  11559. // numerically zero.
  11560. if ( bySet && i !== matchedCount ) {
  11561. j = 0;
  11562. while ( (matcher = setMatchers[j++]) ) {
  11563. matcher( unmatched, setMatched, context, xml );
  11564. }
  11565. if ( seed ) {
  11566. // Reintegrate element matches to eliminate the need for sorting
  11567. if ( matchedCount > 0 ) {
  11568. while ( i-- ) {
  11569. if ( !(unmatched[i] || setMatched[i]) ) {
  11570. setMatched[i] = pop.call( results );
  11571. }
  11572. }
  11573. }
  11574. // Discard index placeholder values to get only actual matches
  11575. setMatched = condense( setMatched );
  11576. }
  11577. // Add matches to results
  11578. push.apply( results, setMatched );
  11579. // Seedless set matches succeeding multiple successful matchers stipulate sorting
  11580. if ( outermost && !seed && setMatched.length > 0 &&
  11581. ( matchedCount + setMatchers.length ) > 1 ) {
  11582. Sizzle.uniqueSort( results );
  11583. }
  11584. }
  11585. // Override manipulation of globals by nested matchers
  11586. if ( outermost ) {
  11587. dirruns = dirrunsUnique;
  11588. outermostContext = contextBackup;
  11589. }
  11590. return unmatched;
  11591. };
  11592. return bySet ?
  11593. markFunction( superMatcher ) :
  11594. superMatcher;
  11595. }
  11596. compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
  11597. var i,
  11598. setMatchers = [],
  11599. elementMatchers = [],
  11600. cached = compilerCache[ selector + " " ];
  11601. if ( !cached ) {
  11602. // Generate a function of recursive functions that can be used to check each element
  11603. if ( !match ) {
  11604. match = tokenize( selector );
  11605. }
  11606. i = match.length;
  11607. while ( i-- ) {
  11608. cached = matcherFromTokens( match[i] );
  11609. if ( cached[ expando ] ) {
  11610. setMatchers.push( cached );
  11611. } else {
  11612. elementMatchers.push( cached );
  11613. }
  11614. }
  11615. // Cache the compiled function
  11616. cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
  11617. // Save selector and tokenization
  11618. cached.selector = selector;
  11619. }
  11620. return cached;
  11621. };
  11622. /**
  11623. * A low-level selection function that works with Sizzle's compiled
  11624. * selector functions
  11625. * @param {String|Function} selector A selector or a pre-compiled
  11626. * selector function built with Sizzle.compile
  11627. * @param {Element} context
  11628. * @param {Array} [results]
  11629. * @param {Array} [seed] A set of elements to match against
  11630. */
  11631. select = Sizzle.select = function( selector, context, results, seed ) {
  11632. var i, tokens, token, type, find,
  11633. compiled = typeof selector === "function" && selector,
  11634. match = !seed && tokenize( (selector = compiled.selector || selector) );
  11635. results = results || [];
  11636. // Try to minimize operations if there is only one selector in the list and no seed
  11637. // (the latter of which guarantees us context)
  11638. if ( match.length === 1 ) {
  11639. // Reduce context if the leading compound selector is an ID
  11640. tokens = match[0] = match[0].slice( 0 );
  11641. if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
  11642. context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) {
  11643. context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
  11644. if ( !context ) {
  11645. return results;
  11646. // Precompiled matchers will still verify ancestry, so step up a level
  11647. } else if ( compiled ) {
  11648. context = context.parentNode;
  11649. }
  11650. selector = selector.slice( tokens.shift().value.length );
  11651. }
  11652. // Fetch a seed set for right-to-left matching
  11653. i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
  11654. while ( i-- ) {
  11655. token = tokens[i];
  11656. // Abort if we hit a combinator
  11657. if ( Expr.relative[ (type = token.type) ] ) {
  11658. break;
  11659. }
  11660. if ( (find = Expr.find[ type ]) ) {
  11661. // Search, expanding context for leading sibling combinators
  11662. if ( (seed = find(
  11663. token.matches[0].replace( runescape, funescape ),
  11664. rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
  11665. )) ) {
  11666. // If seed is empty or no tokens remain, we can return early
  11667. tokens.splice( i, 1 );
  11668. selector = seed.length && toSelector( tokens );
  11669. if ( !selector ) {
  11670. push.apply( results, seed );
  11671. return results;
  11672. }
  11673. break;
  11674. }
  11675. }
  11676. }
  11677. }
  11678. // Compile and execute a filtering function if one is not provided
  11679. // Provide `match` to avoid retokenization if we modified the selector above
  11680. ( compiled || compile( selector, match ) )(
  11681. seed,
  11682. context,
  11683. !documentIsHTML,
  11684. results,
  11685. !context || rsibling.test( selector ) && testContext( context.parentNode ) || context
  11686. );
  11687. return results;
  11688. };
  11689. // One-time assignments
  11690. // Sort stability
  11691. support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
  11692. // Support: Chrome 14-35+
  11693. // Always assume duplicates if they aren't passed to the comparison function
  11694. support.detectDuplicates = !!hasDuplicate;
  11695. // Initialize against the default document
  11696. setDocument();
  11697. // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
  11698. // Detached nodes confoundingly follow *each other*
  11699. support.sortDetached = assert(function( el ) {
  11700. // Should return 1, but returns 4 (following)
  11701. return el.compareDocumentPosition( document.createElement("fieldset") ) & 1;
  11702. });
  11703. // Support: IE<8
  11704. // Prevent attribute/property "interpolation"
  11705. // https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
  11706. if ( !assert(function( el ) {
  11707. el.innerHTML = "<a href='#'></a>";
  11708. return el.firstChild.getAttribute("href") === "#" ;
  11709. }) ) {
  11710. addHandle( "type|href|height|width", function( elem, name, isXML ) {
  11711. if ( !isXML ) {
  11712. return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
  11713. }
  11714. });
  11715. }
  11716. // Support: IE<9
  11717. // Use defaultValue in place of getAttribute("value")
  11718. if ( !support.attributes || !assert(function( el ) {
  11719. el.innerHTML = "<input/>";
  11720. el.firstChild.setAttribute( "value", "" );
  11721. return el.firstChild.getAttribute( "value" ) === "";
  11722. }) ) {
  11723. addHandle( "value", function( elem, name, isXML ) {
  11724. if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
  11725. return elem.defaultValue;
  11726. }
  11727. });
  11728. }
  11729. // Support: IE<9
  11730. // Use getAttributeNode to fetch booleans when getAttribute lies
  11731. if ( !assert(function( el ) {
  11732. return el.getAttribute("disabled") == null;
  11733. }) ) {
  11734. addHandle( booleans, function( elem, name, isXML ) {
  11735. var val;
  11736. if ( !isXML ) {
  11737. return elem[ name ] === true ? name.toLowerCase() :
  11738. (val = elem.getAttributeNode( name )) && val.specified ?
  11739. val.value :
  11740. null;
  11741. }
  11742. });
  11743. }
  11744. return Sizzle;
  11745. })( window );
  11746. jQuery.find = Sizzle;
  11747. jQuery.expr = Sizzle.selectors;
  11748. // Deprecated
  11749. jQuery.expr[ ":" ] = jQuery.expr.pseudos;
  11750. jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;
  11751. jQuery.text = Sizzle.getText;
  11752. jQuery.isXMLDoc = Sizzle.isXML;
  11753. jQuery.contains = Sizzle.contains;
  11754. jQuery.escapeSelector = Sizzle.escape;
  11755. var dir = function( elem, dir, until ) {
  11756. var matched = [],
  11757. truncate = until !== undefined;
  11758. while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {
  11759. if ( elem.nodeType === 1 ) {
  11760. if ( truncate && jQuery( elem ).is( until ) ) {
  11761. break;
  11762. }
  11763. matched.push( elem );
  11764. }
  11765. }
  11766. return matched;
  11767. };
  11768. var siblings = function( n, elem ) {
  11769. var matched = [];
  11770. for ( ; n; n = n.nextSibling ) {
  11771. if ( n.nodeType === 1 && n !== elem ) {
  11772. matched.push( n );
  11773. }
  11774. }
  11775. return matched;
  11776. };
  11777. var rneedsContext = jQuery.expr.match.needsContext;
  11778. function nodeName( elem, name ) {
  11779. return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
  11780. };
  11781. var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i );
  11782. // Implement the identical functionality for filter and not
  11783. function winnow( elements, qualifier, not ) {
  11784. if ( isFunction( qualifier ) ) {
  11785. return jQuery.grep( elements, function( elem, i ) {
  11786. return !!qualifier.call( elem, i, elem ) !== not;
  11787. } );
  11788. }
  11789. // Single element
  11790. if ( qualifier.nodeType ) {
  11791. return jQuery.grep( elements, function( elem ) {
  11792. return ( elem === qualifier ) !== not;
  11793. } );
  11794. }
  11795. // Arraylike of elements (jQuery, arguments, Array)
  11796. if ( typeof qualifier !== "string" ) {
  11797. return jQuery.grep( elements, function( elem ) {
  11798. return ( indexOf.call( qualifier, elem ) > -1 ) !== not;
  11799. } );
  11800. }
  11801. // Filtered directly for both simple and complex selectors
  11802. return jQuery.filter( qualifier, elements, not );
  11803. }
  11804. jQuery.filter = function( expr, elems, not ) {
  11805. var elem = elems[ 0 ];
  11806. if ( not ) {
  11807. expr = ":not(" + expr + ")";
  11808. }
  11809. if ( elems.length === 1 && elem.nodeType === 1 ) {
  11810. return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];
  11811. }
  11812. return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
  11813. return elem.nodeType === 1;
  11814. } ) );
  11815. };
  11816. jQuery.fn.extend( {
  11817. find: function( selector ) {
  11818. var i, ret,
  11819. len = this.length,
  11820. self = this;
  11821. if ( typeof selector !== "string" ) {
  11822. return this.pushStack( jQuery( selector ).filter( function() {
  11823. for ( i = 0; i < len; i++ ) {
  11824. if ( jQuery.contains( self[ i ], this ) ) {
  11825. return true;
  11826. }
  11827. }
  11828. } ) );
  11829. }
  11830. ret = this.pushStack( [] );
  11831. for ( i = 0; i < len; i++ ) {
  11832. jQuery.find( selector, self[ i ], ret );
  11833. }
  11834. return len > 1 ? jQuery.uniqueSort( ret ) : ret;
  11835. },
  11836. filter: function( selector ) {
  11837. return this.pushStack( winnow( this, selector || [], false ) );
  11838. },
  11839. not: function( selector ) {
  11840. return this.pushStack( winnow( this, selector || [], true ) );
  11841. },
  11842. is: function( selector ) {
  11843. return !!winnow(
  11844. this,
  11845. // If this is a positional/relative selector, check membership in the returned set
  11846. // so $("p:first").is("p:last") won't return true for a doc with two "p".
  11847. typeof selector === "string" && rneedsContext.test( selector ) ?
  11848. jQuery( selector ) :
  11849. selector || [],
  11850. false
  11851. ).length;
  11852. }
  11853. } );
  11854. // Initialize a jQuery object
  11855. // A central reference to the root jQuery(document)
  11856. var rootjQuery,
  11857. // A simple way to check for HTML strings
  11858. // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
  11859. // Strict HTML recognition (#11290: must start with <)
  11860. // Shortcut simple #id case for speed
  11861. rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
  11862. init = jQuery.fn.init = function( selector, context, root ) {
  11863. var match, elem;
  11864. // HANDLE: $(""), $(null), $(undefined), $(false)
  11865. if ( !selector ) {
  11866. return this;
  11867. }
  11868. // Method init() accepts an alternate rootjQuery
  11869. // so migrate can support jQuery.sub (gh-2101)
  11870. root = root || rootjQuery;
  11871. // Handle HTML strings
  11872. if ( typeof selector === "string" ) {
  11873. if ( selector[ 0 ] === "<" &&
  11874. selector[ selector.length - 1 ] === ">" &&
  11875. selector.length >= 3 ) {
  11876. // Assume that strings that start and end with <> are HTML and skip the regex check
  11877. match = [ null, selector, null ];
  11878. } else {
  11879. match = rquickExpr.exec( selector );
  11880. }
  11881. // Match html or make sure no context is specified for #id
  11882. if ( match && ( match[ 1 ] || !context ) ) {
  11883. // HANDLE: $(html) -> $(array)
  11884. if ( match[ 1 ] ) {
  11885. context = context instanceof jQuery ? context[ 0 ] : context;
  11886. // Option to run scripts is true for back-compat
  11887. // Intentionally let the error be thrown if parseHTML is not present
  11888. jQuery.merge( this, jQuery.parseHTML(
  11889. match[ 1 ],
  11890. context && context.nodeType ? context.ownerDocument || context : document,
  11891. true
  11892. ) );
  11893. // HANDLE: $(html, props)
  11894. if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {
  11895. for ( match in context ) {
  11896. // Properties of context are called as methods if possible
  11897. if ( isFunction( this[ match ] ) ) {
  11898. this[ match ]( context[ match ] );
  11899. // ...and otherwise set as attributes
  11900. } else {
  11901. this.attr( match, context[ match ] );
  11902. }
  11903. }
  11904. }
  11905. return this;
  11906. // HANDLE: $(#id)
  11907. } else {
  11908. elem = document.getElementById( match[ 2 ] );
  11909. if ( elem ) {
  11910. // Inject the element directly into the jQuery object
  11911. this[ 0 ] = elem;
  11912. this.length = 1;
  11913. }
  11914. return this;
  11915. }
  11916. // HANDLE: $(expr, $(...))
  11917. } else if ( !context || context.jquery ) {
  11918. return ( context || root ).find( selector );
  11919. // HANDLE: $(expr, context)
  11920. // (which is just equivalent to: $(context).find(expr)
  11921. } else {
  11922. return this.constructor( context ).find( selector );
  11923. }
  11924. // HANDLE: $(DOMElement)
  11925. } else if ( selector.nodeType ) {
  11926. this[ 0 ] = selector;
  11927. this.length = 1;
  11928. return this;
  11929. // HANDLE: $(function)
  11930. // Shortcut for document ready
  11931. } else if ( isFunction( selector ) ) {
  11932. return root.ready !== undefined ?
  11933. root.ready( selector ) :
  11934. // Execute immediately if ready is not present
  11935. selector( jQuery );
  11936. }
  11937. return jQuery.makeArray( selector, this );
  11938. };
  11939. // Give the init function the jQuery prototype for later instantiation
  11940. init.prototype = jQuery.fn;
  11941. // Initialize central reference
  11942. rootjQuery = jQuery( document );
  11943. var rparentsprev = /^(?:parents|prev(?:Until|All))/,
  11944. // Methods guaranteed to produce a unique set when starting from a unique set
  11945. guaranteedUnique = {
  11946. children: true,
  11947. contents: true,
  11948. next: true,
  11949. prev: true
  11950. };
  11951. jQuery.fn.extend( {
  11952. has: function( target ) {
  11953. var targets = jQuery( target, this ),
  11954. l = targets.length;
  11955. return this.filter( function() {
  11956. var i = 0;
  11957. for ( ; i < l; i++ ) {
  11958. if ( jQuery.contains( this, targets[ i ] ) ) {
  11959. return true;
  11960. }
  11961. }
  11962. } );
  11963. },
  11964. closest: function( selectors, context ) {
  11965. var cur,
  11966. i = 0,
  11967. l = this.length,
  11968. matched = [],
  11969. targets = typeof selectors !== "string" && jQuery( selectors );
  11970. // Positional selectors never match, since there's no _selection_ context
  11971. if ( !rneedsContext.test( selectors ) ) {
  11972. for ( ; i < l; i++ ) {
  11973. for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {
  11974. // Always skip document fragments
  11975. if ( cur.nodeType < 11 && ( targets ?
  11976. targets.index( cur ) > -1 :
  11977. // Don't pass non-elements to Sizzle
  11978. cur.nodeType === 1 &&
  11979. jQuery.find.matchesSelector( cur, selectors ) ) ) {
  11980. matched.push( cur );
  11981. break;
  11982. }
  11983. }
  11984. }
  11985. }
  11986. return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );
  11987. },
  11988. // Determine the position of an element within the set
  11989. index: function( elem ) {
  11990. // No argument, return index in parent
  11991. if ( !elem ) {
  11992. return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
  11993. }
  11994. // Index in selector
  11995. if ( typeof elem === "string" ) {
  11996. return indexOf.call( jQuery( elem ), this[ 0 ] );
  11997. }
  11998. // Locate the position of the desired element
  11999. return indexOf.call( this,
  12000. // If it receives a jQuery object, the first element is used
  12001. elem.jquery ? elem[ 0 ] : elem
  12002. );
  12003. },
  12004. add: function( selector, context ) {
  12005. return this.pushStack(
  12006. jQuery.uniqueSort(
  12007. jQuery.merge( this.get(), jQuery( selector, context ) )
  12008. )
  12009. );
  12010. },
  12011. addBack: function( selector ) {
  12012. return this.add( selector == null ?
  12013. this.prevObject : this.prevObject.filter( selector )
  12014. );
  12015. }
  12016. } );
  12017. function sibling( cur, dir ) {
  12018. while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}
  12019. return cur;
  12020. }
  12021. jQuery.each( {
  12022. parent: function( elem ) {
  12023. var parent = elem.parentNode;
  12024. return parent && parent.nodeType !== 11 ? parent : null;
  12025. },
  12026. parents: function( elem ) {
  12027. return dir( elem, "parentNode" );
  12028. },
  12029. parentsUntil: function( elem, i, until ) {
  12030. return dir( elem, "parentNode", until );
  12031. },
  12032. next: function( elem ) {
  12033. return sibling( elem, "nextSibling" );
  12034. },
  12035. prev: function( elem ) {
  12036. return sibling( elem, "previousSibling" );
  12037. },
  12038. nextAll: function( elem ) {
  12039. return dir( elem, "nextSibling" );
  12040. },
  12041. prevAll: function( elem ) {
  12042. return dir( elem, "previousSibling" );
  12043. },
  12044. nextUntil: function( elem, i, until ) {
  12045. return dir( elem, "nextSibling", until );
  12046. },
  12047. prevUntil: function( elem, i, until ) {
  12048. return dir( elem, "previousSibling", until );
  12049. },
  12050. siblings: function( elem ) {
  12051. return siblings( ( elem.parentNode || {} ).firstChild, elem );
  12052. },
  12053. children: function( elem ) {
  12054. return siblings( elem.firstChild );
  12055. },
  12056. contents: function( elem ) {
  12057. if ( typeof elem.contentDocument !== "undefined" ) {
  12058. return elem.contentDocument;
  12059. }
  12060. // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only
  12061. // Treat the template element as a regular one in browsers that
  12062. // don't support it.
  12063. if ( nodeName( elem, "template" ) ) {
  12064. elem = elem.content || elem;
  12065. }
  12066. return jQuery.merge( [], elem.childNodes );
  12067. }
  12068. }, function( name, fn ) {
  12069. jQuery.fn[ name ] = function( until, selector ) {
  12070. var matched = jQuery.map( this, fn, until );
  12071. if ( name.slice( -5 ) !== "Until" ) {
  12072. selector = until;
  12073. }
  12074. if ( selector && typeof selector === "string" ) {
  12075. matched = jQuery.filter( selector, matched );
  12076. }
  12077. if ( this.length > 1 ) {
  12078. // Remove duplicates
  12079. if ( !guaranteedUnique[ name ] ) {
  12080. jQuery.uniqueSort( matched );
  12081. }
  12082. // Reverse order for parents* and prev-derivatives
  12083. if ( rparentsprev.test( name ) ) {
  12084. matched.reverse();
  12085. }
  12086. }
  12087. return this.pushStack( matched );
  12088. };
  12089. } );
  12090. var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g );
  12091. // Convert String-formatted options into Object-formatted ones
  12092. function createOptions( options ) {
  12093. var object = {};
  12094. jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {
  12095. object[ flag ] = true;
  12096. } );
  12097. return object;
  12098. }
  12099. /*
  12100. * Create a callback list using the following parameters:
  12101. *
  12102. * options: an optional list of space-separated options that will change how
  12103. * the callback list behaves or a more traditional option object
  12104. *
  12105. * By default a callback list will act like an event callback list and can be
  12106. * "fired" multiple times.
  12107. *
  12108. * Possible options:
  12109. *
  12110. * once: will ensure the callback list can only be fired once (like a Deferred)
  12111. *
  12112. * memory: will keep track of previous values and will call any callback added
  12113. * after the list has been fired right away with the latest "memorized"
  12114. * values (like a Deferred)
  12115. *
  12116. * unique: will ensure a callback can only be added once (no duplicate in the list)
  12117. *
  12118. * stopOnFalse: interrupt callings when a callback returns false
  12119. *
  12120. */
  12121. jQuery.Callbacks = function( options ) {
  12122. // Convert options from String-formatted to Object-formatted if needed
  12123. // (we check in cache first)
  12124. options = typeof options === "string" ?
  12125. createOptions( options ) :
  12126. jQuery.extend( {}, options );
  12127. var // Flag to know if list is currently firing
  12128. firing,
  12129. // Last fire value for non-forgettable lists
  12130. memory,
  12131. // Flag to know if list was already fired
  12132. fired,
  12133. // Flag to prevent firing
  12134. locked,
  12135. // Actual callback list
  12136. list = [],
  12137. // Queue of execution data for repeatable lists
  12138. queue = [],
  12139. // Index of currently firing callback (modified by add/remove as needed)
  12140. firingIndex = -1,
  12141. // Fire callbacks
  12142. fire = function() {
  12143. // Enforce single-firing
  12144. locked = locked || options.once;
  12145. // Execute callbacks for all pending executions,
  12146. // respecting firingIndex overrides and runtime changes
  12147. fired = firing = true;
  12148. for ( ; queue.length; firingIndex = -1 ) {
  12149. memory = queue.shift();
  12150. while ( ++firingIndex < list.length ) {
  12151. // Run callback and check for early termination
  12152. if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&
  12153. options.stopOnFalse ) {
  12154. // Jump to end and forget the data so .add doesn't re-fire
  12155. firingIndex = list.length;
  12156. memory = false;
  12157. }
  12158. }
  12159. }
  12160. // Forget the data if we're done with it
  12161. if ( !options.memory ) {
  12162. memory = false;
  12163. }
  12164. firing = false;
  12165. // Clean up if we're done firing for good
  12166. if ( locked ) {
  12167. // Keep an empty list if we have data for future add calls
  12168. if ( memory ) {
  12169. list = [];
  12170. // Otherwise, this object is spent
  12171. } else {
  12172. list = "";
  12173. }
  12174. }
  12175. },
  12176. // Actual Callbacks object
  12177. self = {
  12178. // Add a callback or a collection of callbacks to the list
  12179. add: function() {
  12180. if ( list ) {
  12181. // If we have memory from a past run, we should fire after adding
  12182. if ( memory && !firing ) {
  12183. firingIndex = list.length - 1;
  12184. queue.push( memory );
  12185. }
  12186. ( function add( args ) {
  12187. jQuery.each( args, function( _, arg ) {
  12188. if ( isFunction( arg ) ) {
  12189. if ( !options.unique || !self.has( arg ) ) {
  12190. list.push( arg );
  12191. }
  12192. } else if ( arg && arg.length && toType( arg ) !== "string" ) {
  12193. // Inspect recursively
  12194. add( arg );
  12195. }
  12196. } );
  12197. } )( arguments );
  12198. if ( memory && !firing ) {
  12199. fire();
  12200. }
  12201. }
  12202. return this;
  12203. },
  12204. // Remove a callback from the list
  12205. remove: function() {
  12206. jQuery.each( arguments, function( _, arg ) {
  12207. var index;
  12208. while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
  12209. list.splice( index, 1 );
  12210. // Handle firing indexes
  12211. if ( index <= firingIndex ) {
  12212. firingIndex--;
  12213. }
  12214. }
  12215. } );
  12216. return this;
  12217. },
  12218. // Check if a given callback is in the list.
  12219. // If no argument is given, return whether or not list has callbacks attached.
  12220. has: function( fn ) {
  12221. return fn ?
  12222. jQuery.inArray( fn, list ) > -1 :
  12223. list.length > 0;
  12224. },
  12225. // Remove all callbacks from the list
  12226. empty: function() {
  12227. if ( list ) {
  12228. list = [];
  12229. }
  12230. return this;
  12231. },
  12232. // Disable .fire and .add
  12233. // Abort any current/pending executions
  12234. // Clear all callbacks and values
  12235. disable: function() {
  12236. locked = queue = [];
  12237. list = memory = "";
  12238. return this;
  12239. },
  12240. disabled: function() {
  12241. return !list;
  12242. },
  12243. // Disable .fire
  12244. // Also disable .add unless we have memory (since it would have no effect)
  12245. // Abort any pending executions
  12246. lock: function() {
  12247. locked = queue = [];
  12248. if ( !memory && !firing ) {
  12249. list = memory = "";
  12250. }
  12251. return this;
  12252. },
  12253. locked: function() {
  12254. return !!locked;
  12255. },
  12256. // Call all callbacks with the given context and arguments
  12257. fireWith: function( context, args ) {
  12258. if ( !locked ) {
  12259. args = args || [];
  12260. args = [ context, args.slice ? args.slice() : args ];
  12261. queue.push( args );
  12262. if ( !firing ) {
  12263. fire();
  12264. }
  12265. }
  12266. return this;
  12267. },
  12268. // Call all the callbacks with the given arguments
  12269. fire: function() {
  12270. self.fireWith( this, arguments );
  12271. return this;
  12272. },
  12273. // To know if the callbacks have already been called at least once
  12274. fired: function() {
  12275. return !!fired;
  12276. }
  12277. };
  12278. return self;
  12279. };
  12280. function Identity( v ) {
  12281. return v;
  12282. }
  12283. function Thrower( ex ) {
  12284. throw ex;
  12285. }
  12286. function adoptValue( value, resolve, reject, noValue ) {
  12287. var method;
  12288. try {
  12289. // Check for promise aspect first to privilege synchronous behavior
  12290. if ( value && isFunction( ( method = value.promise ) ) ) {
  12291. method.call( value ).done( resolve ).fail( reject );
  12292. // Other thenables
  12293. } else if ( value && isFunction( ( method = value.then ) ) ) {
  12294. method.call( value, resolve, reject );
  12295. // Other non-thenables
  12296. } else {
  12297. // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer:
  12298. // * false: [ value ].slice( 0 ) => resolve( value )
  12299. // * true: [ value ].slice( 1 ) => resolve()
  12300. resolve.apply( undefined, [ value ].slice( noValue ) );
  12301. }
  12302. // For Promises/A+, convert exceptions into rejections
  12303. // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in
  12304. // Deferred#then to conditionally suppress rejection.
  12305. } catch ( value ) {
  12306. // Support: Android 4.0 only
  12307. // Strict mode functions invoked without .call/.apply get global-object context
  12308. reject.apply( undefined, [ value ] );
  12309. }
  12310. }
  12311. jQuery.extend( {
  12312. Deferred: function( func ) {
  12313. var tuples = [
  12314. // action, add listener, callbacks,
  12315. // ... .then handlers, argument index, [final state]
  12316. [ "notify", "progress", jQuery.Callbacks( "memory" ),
  12317. jQuery.Callbacks( "memory" ), 2 ],
  12318. [ "resolve", "done", jQuery.Callbacks( "once memory" ),
  12319. jQuery.Callbacks( "once memory" ), 0, "resolved" ],
  12320. [ "reject", "fail", jQuery.Callbacks( "once memory" ),
  12321. jQuery.Callbacks( "once memory" ), 1, "rejected" ]
  12322. ],
  12323. state = "pending",
  12324. promise = {
  12325. state: function() {
  12326. return state;
  12327. },
  12328. always: function() {
  12329. deferred.done( arguments ).fail( arguments );
  12330. return this;
  12331. },
  12332. "catch": function( fn ) {
  12333. return promise.then( null, fn );
  12334. },
  12335. // Keep pipe for back-compat
  12336. pipe: function( /* fnDone, fnFail, fnProgress */ ) {
  12337. var fns = arguments;
  12338. return jQuery.Deferred( function( newDefer ) {
  12339. jQuery.each( tuples, function( i, tuple ) {
  12340. // Map tuples (progress, done, fail) to arguments (done, fail, progress)
  12341. var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];
  12342. // deferred.progress(function() { bind to newDefer or newDefer.notify })
  12343. // deferred.done(function() { bind to newDefer or newDefer.resolve })
  12344. // deferred.fail(function() { bind to newDefer or newDefer.reject })
  12345. deferred[ tuple[ 1 ] ]( function() {
  12346. var returned = fn && fn.apply( this, arguments );
  12347. if ( returned && isFunction( returned.promise ) ) {
  12348. returned.promise()
  12349. .progress( newDefer.notify )
  12350. .done( newDefer.resolve )
  12351. .fail( newDefer.reject );
  12352. } else {
  12353. newDefer[ tuple[ 0 ] + "With" ](
  12354. this,
  12355. fn ? [ returned ] : arguments
  12356. );
  12357. }
  12358. } );
  12359. } );
  12360. fns = null;
  12361. } ).promise();
  12362. },
  12363. then: function( onFulfilled, onRejected, onProgress ) {
  12364. var maxDepth = 0;
  12365. function resolve( depth, deferred, handler, special ) {
  12366. return function() {
  12367. var that = this,
  12368. args = arguments,
  12369. mightThrow = function() {
  12370. var returned, then;
  12371. // Support: Promises/A+ section 2.3.3.3.3
  12372. // https://promisesaplus.com/#point-59
  12373. // Ignore double-resolution attempts
  12374. if ( depth < maxDepth ) {
  12375. return;
  12376. }
  12377. returned = handler.apply( that, args );
  12378. // Support: Promises/A+ section 2.3.1
  12379. // https://promisesaplus.com/#point-48
  12380. if ( returned === deferred.promise() ) {
  12381. throw new TypeError( "Thenable self-resolution" );
  12382. }
  12383. // Support: Promises/A+ sections 2.3.3.1, 3.5
  12384. // https://promisesaplus.com/#point-54
  12385. // https://promisesaplus.com/#point-75
  12386. // Retrieve `then` only once
  12387. then = returned &&
  12388. // Support: Promises/A+ section 2.3.4
  12389. // https://promisesaplus.com/#point-64
  12390. // Only check objects and functions for thenability
  12391. ( typeof returned === "object" ||
  12392. typeof returned === "function" ) &&
  12393. returned.then;
  12394. // Handle a returned thenable
  12395. if ( isFunction( then ) ) {
  12396. // Special processors (notify) just wait for resolution
  12397. if ( special ) {
  12398. then.call(
  12399. returned,
  12400. resolve( maxDepth, deferred, Identity, special ),
  12401. resolve( maxDepth, deferred, Thrower, special )
  12402. );
  12403. // Normal processors (resolve) also hook into progress
  12404. } else {
  12405. // ...and disregard older resolution values
  12406. maxDepth++;
  12407. then.call(
  12408. returned,
  12409. resolve( maxDepth, deferred, Identity, special ),
  12410. resolve( maxDepth, deferred, Thrower, special ),
  12411. resolve( maxDepth, deferred, Identity,
  12412. deferred.notifyWith )
  12413. );
  12414. }
  12415. // Handle all other returned values
  12416. } else {
  12417. // Only substitute handlers pass on context
  12418. // and multiple values (non-spec behavior)
  12419. if ( handler !== Identity ) {
  12420. that = undefined;
  12421. args = [ returned ];
  12422. }
  12423. // Process the value(s)
  12424. // Default process is resolve
  12425. ( special || deferred.resolveWith )( that, args );
  12426. }
  12427. },
  12428. // Only normal processors (resolve) catch and reject exceptions
  12429. process = special ?
  12430. mightThrow :
  12431. function() {
  12432. try {
  12433. mightThrow();
  12434. } catch ( e ) {
  12435. if ( jQuery.Deferred.exceptionHook ) {
  12436. jQuery.Deferred.exceptionHook( e,
  12437. process.stackTrace );
  12438. }
  12439. // Support: Promises/A+ section 2.3.3.3.4.1
  12440. // https://promisesaplus.com/#point-61
  12441. // Ignore post-resolution exceptions
  12442. if ( depth + 1 >= maxDepth ) {
  12443. // Only substitute handlers pass on context
  12444. // and multiple values (non-spec behavior)
  12445. if ( handler !== Thrower ) {
  12446. that = undefined;
  12447. args = [ e ];
  12448. }
  12449. deferred.rejectWith( that, args );
  12450. }
  12451. }
  12452. };
  12453. // Support: Promises/A+ section 2.3.3.3.1
  12454. // https://promisesaplus.com/#point-57
  12455. // Re-resolve promises immediately to dodge false rejection from
  12456. // subsequent errors
  12457. if ( depth ) {
  12458. process();
  12459. } else {
  12460. // Call an optional hook to record the stack, in case of exception
  12461. // since it's otherwise lost when execution goes async
  12462. if ( jQuery.Deferred.getStackHook ) {
  12463. process.stackTrace = jQuery.Deferred.getStackHook();
  12464. }
  12465. window.setTimeout( process );
  12466. }
  12467. };
  12468. }
  12469. return jQuery.Deferred( function( newDefer ) {
  12470. // progress_handlers.add( ... )
  12471. tuples[ 0 ][ 3 ].add(
  12472. resolve(
  12473. 0,
  12474. newDefer,
  12475. isFunction( onProgress ) ?
  12476. onProgress :
  12477. Identity,
  12478. newDefer.notifyWith
  12479. )
  12480. );
  12481. // fulfilled_handlers.add( ... )
  12482. tuples[ 1 ][ 3 ].add(
  12483. resolve(
  12484. 0,
  12485. newDefer,
  12486. isFunction( onFulfilled ) ?
  12487. onFulfilled :
  12488. Identity
  12489. )
  12490. );
  12491. // rejected_handlers.add( ... )
  12492. tuples[ 2 ][ 3 ].add(
  12493. resolve(
  12494. 0,
  12495. newDefer,
  12496. isFunction( onRejected ) ?
  12497. onRejected :
  12498. Thrower
  12499. )
  12500. );
  12501. } ).promise();
  12502. },
  12503. // Get a promise for this deferred
  12504. // If obj is provided, the promise aspect is added to the object
  12505. promise: function( obj ) {
  12506. return obj != null ? jQuery.extend( obj, promise ) : promise;
  12507. }
  12508. },
  12509. deferred = {};
  12510. // Add list-specific methods
  12511. jQuery.each( tuples, function( i, tuple ) {
  12512. var list = tuple[ 2 ],
  12513. stateString = tuple[ 5 ];
  12514. // promise.progress = list.add
  12515. // promise.done = list.add
  12516. // promise.fail = list.add
  12517. promise[ tuple[ 1 ] ] = list.add;
  12518. // Handle state
  12519. if ( stateString ) {
  12520. list.add(
  12521. function() {
  12522. // state = "resolved" (i.e., fulfilled)
  12523. // state = "rejected"
  12524. state = stateString;
  12525. },
  12526. // rejected_callbacks.disable
  12527. // fulfilled_callbacks.disable
  12528. tuples[ 3 - i ][ 2 ].disable,
  12529. // rejected_handlers.disable
  12530. // fulfilled_handlers.disable
  12531. tuples[ 3 - i ][ 3 ].disable,
  12532. // progress_callbacks.lock
  12533. tuples[ 0 ][ 2 ].lock,
  12534. // progress_handlers.lock
  12535. tuples[ 0 ][ 3 ].lock
  12536. );
  12537. }
  12538. // progress_handlers.fire
  12539. // fulfilled_handlers.fire
  12540. // rejected_handlers.fire
  12541. list.add( tuple[ 3 ].fire );
  12542. // deferred.notify = function() { deferred.notifyWith(...) }
  12543. // deferred.resolve = function() { deferred.resolveWith(...) }
  12544. // deferred.reject = function() { deferred.rejectWith(...) }
  12545. deferred[ tuple[ 0 ] ] = function() {
  12546. deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments );
  12547. return this;
  12548. };
  12549. // deferred.notifyWith = list.fireWith
  12550. // deferred.resolveWith = list.fireWith
  12551. // deferred.rejectWith = list.fireWith
  12552. deferred[ tuple[ 0 ] + "With" ] = list.fireWith;
  12553. } );
  12554. // Make the deferred a promise
  12555. promise.promise( deferred );
  12556. // Call given func if any
  12557. if ( func ) {
  12558. func.call( deferred, deferred );
  12559. }
  12560. // All done!
  12561. return deferred;
  12562. },
  12563. // Deferred helper
  12564. when: function( singleValue ) {
  12565. var
  12566. // count of uncompleted subordinates
  12567. remaining = arguments.length,
  12568. // count of unprocessed arguments
  12569. i = remaining,
  12570. // subordinate fulfillment data
  12571. resolveContexts = Array( i ),
  12572. resolveValues = slice.call( arguments ),
  12573. // the master Deferred
  12574. master = jQuery.Deferred(),
  12575. // subordinate callback factory
  12576. updateFunc = function( i ) {
  12577. return function( value ) {
  12578. resolveContexts[ i ] = this;
  12579. resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
  12580. if ( !( --remaining ) ) {
  12581. master.resolveWith( resolveContexts, resolveValues );
  12582. }
  12583. };
  12584. };
  12585. // Single- and empty arguments are adopted like Promise.resolve
  12586. if ( remaining <= 1 ) {
  12587. adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject,
  12588. !remaining );
  12589. // Use .then() to unwrap secondary thenables (cf. gh-3000)
  12590. if ( master.state() === "pending" ||
  12591. isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {
  12592. return master.then();
  12593. }
  12594. }
  12595. // Multiple arguments are aggregated like Promise.all array elements
  12596. while ( i-- ) {
  12597. adoptValue( resolveValues[ i ], updateFunc( i ), master.reject );
  12598. }
  12599. return master.promise();
  12600. }
  12601. } );
  12602. // These usually indicate a programmer mistake during development,
  12603. // warn about them ASAP rather than swallowing them by default.
  12604. var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
  12605. jQuery.Deferred.exceptionHook = function( error, stack ) {
  12606. // Support: IE 8 - 9 only
  12607. // Console exists when dev tools are open, which can happen at any time
  12608. if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {
  12609. window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack );
  12610. }
  12611. };
  12612. jQuery.readyException = function( error ) {
  12613. window.setTimeout( function() {
  12614. throw error;
  12615. } );
  12616. };
  12617. // The deferred used on DOM ready
  12618. var readyList = jQuery.Deferred();
  12619. jQuery.fn.ready = function( fn ) {
  12620. readyList
  12621. .then( fn )
  12622. // Wrap jQuery.readyException in a function so that the lookup
  12623. // happens at the time of error handling instead of callback
  12624. // registration.
  12625. .catch( function( error ) {
  12626. jQuery.readyException( error );
  12627. } );
  12628. return this;
  12629. };
  12630. jQuery.extend( {
  12631. // Is the DOM ready to be used? Set to true once it occurs.
  12632. isReady: false,
  12633. // A counter to track how many items to wait for before
  12634. // the ready event fires. See #6781
  12635. readyWait: 1,
  12636. // Handle when the DOM is ready
  12637. ready: function( wait ) {
  12638. // Abort if there are pending holds or we're already ready
  12639. if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
  12640. return;
  12641. }
  12642. // Remember that the DOM is ready
  12643. jQuery.isReady = true;
  12644. // If a normal DOM Ready event fired, decrement, and wait if need be
  12645. if ( wait !== true && --jQuery.readyWait > 0 ) {
  12646. return;
  12647. }
  12648. // If there are functions bound, to execute
  12649. readyList.resolveWith( document, [ jQuery ] );
  12650. }
  12651. } );
  12652. jQuery.ready.then = readyList.then;
  12653. // The ready event handler and self cleanup method
  12654. function completed() {
  12655. document.removeEventListener( "DOMContentLoaded", completed );
  12656. window.removeEventListener( "load", completed );
  12657. jQuery.ready();
  12658. }
  12659. // Catch cases where $(document).ready() is called
  12660. // after the browser event has already occurred.
  12661. // Support: IE <=9 - 10 only
  12662. // Older IE sometimes signals "interactive" too soon
  12663. if ( document.readyState === "complete" ||
  12664. ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {
  12665. // Handle it asynchronously to allow scripts the opportunity to delay ready
  12666. window.setTimeout( jQuery.ready );
  12667. } else {
  12668. // Use the handy event callback
  12669. document.addEventListener( "DOMContentLoaded", completed );
  12670. // A fallback to window.onload, that will always work
  12671. window.addEventListener( "load", completed );
  12672. }
  12673. // Multifunctional method to get and set values of a collection
  12674. // The value/s can optionally be executed if it's a function
  12675. var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
  12676. var i = 0,
  12677. len = elems.length,
  12678. bulk = key == null;
  12679. // Sets many values
  12680. if ( toType( key ) === "object" ) {
  12681. chainable = true;
  12682. for ( i in key ) {
  12683. access( elems, fn, i, key[ i ], true, emptyGet, raw );
  12684. }
  12685. // Sets one value
  12686. } else if ( value !== undefined ) {
  12687. chainable = true;
  12688. if ( !isFunction( value ) ) {
  12689. raw = true;
  12690. }
  12691. if ( bulk ) {
  12692. // Bulk operations run against the entire set
  12693. if ( raw ) {
  12694. fn.call( elems, value );
  12695. fn = null;
  12696. // ...except when executing function values
  12697. } else {
  12698. bulk = fn;
  12699. fn = function( elem, key, value ) {
  12700. return bulk.call( jQuery( elem ), value );
  12701. };
  12702. }
  12703. }
  12704. if ( fn ) {
  12705. for ( ; i < len; i++ ) {
  12706. fn(
  12707. elems[ i ], key, raw ?
  12708. value :
  12709. value.call( elems[ i ], i, fn( elems[ i ], key ) )
  12710. );
  12711. }
  12712. }
  12713. }
  12714. if ( chainable ) {
  12715. return elems;
  12716. }
  12717. // Gets
  12718. if ( bulk ) {
  12719. return fn.call( elems );
  12720. }
  12721. return len ? fn( elems[ 0 ], key ) : emptyGet;
  12722. };
  12723. // Matches dashed string for camelizing
  12724. var rmsPrefix = /^-ms-/,
  12725. rdashAlpha = /-([a-z])/g;
  12726. // Used by camelCase as callback to replace()
  12727. function fcamelCase( all, letter ) {
  12728. return letter.toUpperCase();
  12729. }
  12730. // Convert dashed to camelCase; used by the css and data modules
  12731. // Support: IE <=9 - 11, Edge 12 - 15
  12732. // Microsoft forgot to hump their vendor prefix (#9572)
  12733. function camelCase( string ) {
  12734. return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
  12735. }
  12736. var acceptData = function( owner ) {
  12737. // Accepts only:
  12738. // - Node
  12739. // - Node.ELEMENT_NODE
  12740. // - Node.DOCUMENT_NODE
  12741. // - Object
  12742. // - Any
  12743. return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
  12744. };
  12745. function Data() {
  12746. this.expando = jQuery.expando + Data.uid++;
  12747. }
  12748. Data.uid = 1;
  12749. Data.prototype = {
  12750. cache: function( owner ) {
  12751. // Check if the owner object already has a cache
  12752. var value = owner[ this.expando ];
  12753. // If not, create one
  12754. if ( !value ) {
  12755. value = {};
  12756. // We can accept data for non-element nodes in modern browsers,
  12757. // but we should not, see #8335.
  12758. // Always return an empty object.
  12759. if ( acceptData( owner ) ) {
  12760. // If it is a node unlikely to be stringify-ed or looped over
  12761. // use plain assignment
  12762. if ( owner.nodeType ) {
  12763. owner[ this.expando ] = value;
  12764. // Otherwise secure it in a non-enumerable property
  12765. // configurable must be true to allow the property to be
  12766. // deleted when data is removed
  12767. } else {
  12768. Object.defineProperty( owner, this.expando, {
  12769. value: value,
  12770. configurable: true
  12771. } );
  12772. }
  12773. }
  12774. }
  12775. return value;
  12776. },
  12777. set: function( owner, data, value ) {
  12778. var prop,
  12779. cache = this.cache( owner );
  12780. // Handle: [ owner, key, value ] args
  12781. // Always use camelCase key (gh-2257)
  12782. if ( typeof data === "string" ) {
  12783. cache[ camelCase( data ) ] = value;
  12784. // Handle: [ owner, { properties } ] args
  12785. } else {
  12786. // Copy the properties one-by-one to the cache object
  12787. for ( prop in data ) {
  12788. cache[ camelCase( prop ) ] = data[ prop ];
  12789. }
  12790. }
  12791. return cache;
  12792. },
  12793. get: function( owner, key ) {
  12794. return key === undefined ?
  12795. this.cache( owner ) :
  12796. // Always use camelCase key (gh-2257)
  12797. owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ];
  12798. },
  12799. access: function( owner, key, value ) {
  12800. // In cases where either:
  12801. //
  12802. // 1. No key was specified
  12803. // 2. A string key was specified, but no value provided
  12804. //
  12805. // Take the "read" path and allow the get method to determine
  12806. // which value to return, respectively either:
  12807. //
  12808. // 1. The entire cache object
  12809. // 2. The data stored at the key
  12810. //
  12811. if ( key === undefined ||
  12812. ( ( key && typeof key === "string" ) && value === undefined ) ) {
  12813. return this.get( owner, key );
  12814. }
  12815. // When the key is not a string, or both a key and value
  12816. // are specified, set or extend (existing objects) with either:
  12817. //
  12818. // 1. An object of properties
  12819. // 2. A key and value
  12820. //
  12821. this.set( owner, key, value );
  12822. // Since the "set" path can have two possible entry points
  12823. // return the expected data based on which path was taken[*]
  12824. return value !== undefined ? value : key;
  12825. },
  12826. remove: function( owner, key ) {
  12827. var i,
  12828. cache = owner[ this.expando ];
  12829. if ( cache === undefined ) {
  12830. return;
  12831. }
  12832. if ( key !== undefined ) {
  12833. // Support array or space separated string of keys
  12834. if ( Array.isArray( key ) ) {
  12835. // If key is an array of keys...
  12836. // We always set camelCase keys, so remove that.
  12837. key = key.map( camelCase );
  12838. } else {
  12839. key = camelCase( key );
  12840. // If a key with the spaces exists, use it.
  12841. // Otherwise, create an array by matching non-whitespace
  12842. key = key in cache ?
  12843. [ key ] :
  12844. ( key.match( rnothtmlwhite ) || [] );
  12845. }
  12846. i = key.length;
  12847. while ( i-- ) {
  12848. delete cache[ key[ i ] ];
  12849. }
  12850. }
  12851. // Remove the expando if there's no more data
  12852. if ( key === undefined || jQuery.isEmptyObject( cache ) ) {
  12853. // Support: Chrome <=35 - 45
  12854. // Webkit & Blink performance suffers when deleting properties
  12855. // from DOM nodes, so set to undefined instead
  12856. // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)
  12857. if ( owner.nodeType ) {
  12858. owner[ this.expando ] = undefined;
  12859. } else {
  12860. delete owner[ this.expando ];
  12861. }
  12862. }
  12863. },
  12864. hasData: function( owner ) {
  12865. var cache = owner[ this.expando ];
  12866. return cache !== undefined && !jQuery.isEmptyObject( cache );
  12867. }
  12868. };
  12869. var dataPriv = new Data();
  12870. var dataUser = new Data();
  12871. // Implementation Summary
  12872. //
  12873. // 1. Enforce API surface and semantic compatibility with 1.9.x branch
  12874. // 2. Improve the module's maintainability by reducing the storage
  12875. // paths to a single mechanism.
  12876. // 3. Use the same single mechanism to support "private" and "user" data.
  12877. // 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
  12878. // 5. Avoid exposing implementation details on user objects (eg. expando properties)
  12879. // 6. Provide a clear path for implementation upgrade to WeakMap in 2014
  12880. var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
  12881. rmultiDash = /[A-Z]/g;
  12882. function getData( data ) {
  12883. if ( data === "true" ) {
  12884. return true;
  12885. }
  12886. if ( data === "false" ) {
  12887. return false;
  12888. }
  12889. if ( data === "null" ) {
  12890. return null;
  12891. }
  12892. // Only convert to a number if it doesn't change the string
  12893. if ( data === +data + "" ) {
  12894. return +data;
  12895. }
  12896. if ( rbrace.test( data ) ) {
  12897. return JSON.parse( data );
  12898. }
  12899. return data;
  12900. }
  12901. function dataAttr( elem, key, data ) {
  12902. var name;
  12903. // If nothing was found internally, try to fetch any
  12904. // data from the HTML5 data-* attribute
  12905. if ( data === undefined && elem.nodeType === 1 ) {
  12906. name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase();
  12907. data = elem.getAttribute( name );
  12908. if ( typeof data === "string" ) {
  12909. try {
  12910. data = getData( data );
  12911. } catch ( e ) {}
  12912. // Make sure we set the data so it isn't changed later
  12913. dataUser.set( elem, key, data );
  12914. } else {
  12915. data = undefined;
  12916. }
  12917. }
  12918. return data;
  12919. }
  12920. jQuery.extend( {
  12921. hasData: function( elem ) {
  12922. return dataUser.hasData( elem ) || dataPriv.hasData( elem );
  12923. },
  12924. data: function( elem, name, data ) {
  12925. return dataUser.access( elem, name, data );
  12926. },
  12927. removeData: function( elem, name ) {
  12928. dataUser.remove( elem, name );
  12929. },
  12930. // TODO: Now that all calls to _data and _removeData have been replaced
  12931. // with direct calls to dataPriv methods, these can be deprecated.
  12932. _data: function( elem, name, data ) {
  12933. return dataPriv.access( elem, name, data );
  12934. },
  12935. _removeData: function( elem, name ) {
  12936. dataPriv.remove( elem, name );
  12937. }
  12938. } );
  12939. jQuery.fn.extend( {
  12940. data: function( key, value ) {
  12941. var i, name, data,
  12942. elem = this[ 0 ],
  12943. attrs = elem && elem.attributes;
  12944. // Gets all values
  12945. if ( key === undefined ) {
  12946. if ( this.length ) {
  12947. data = dataUser.get( elem );
  12948. if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) {
  12949. i = attrs.length;
  12950. while ( i-- ) {
  12951. // Support: IE 11 only
  12952. // The attrs elements can be null (#14894)
  12953. if ( attrs[ i ] ) {
  12954. name = attrs[ i ].name;
  12955. if ( name.indexOf( "data-" ) === 0 ) {
  12956. name = camelCase( name.slice( 5 ) );
  12957. dataAttr( elem, name, data[ name ] );
  12958. }
  12959. }
  12960. }
  12961. dataPriv.set( elem, "hasDataAttrs", true );
  12962. }
  12963. }
  12964. return data;
  12965. }
  12966. // Sets multiple values
  12967. if ( typeof key === "object" ) {
  12968. return this.each( function() {
  12969. dataUser.set( this, key );
  12970. } );
  12971. }
  12972. return access( this, function( value ) {
  12973. var data;
  12974. // The calling jQuery object (element matches) is not empty
  12975. // (and therefore has an element appears at this[ 0 ]) and the
  12976. // `value` parameter was not undefined. An empty jQuery object
  12977. // will result in `undefined` for elem = this[ 0 ] which will
  12978. // throw an exception if an attempt to read a data cache is made.
  12979. if ( elem && value === undefined ) {
  12980. // Attempt to get data from the cache
  12981. // The key will always be camelCased in Data
  12982. data = dataUser.get( elem, key );
  12983. if ( data !== undefined ) {
  12984. return data;
  12985. }
  12986. // Attempt to "discover" the data in
  12987. // HTML5 custom data-* attrs
  12988. data = dataAttr( elem, key );
  12989. if ( data !== undefined ) {
  12990. return data;
  12991. }
  12992. // We tried really hard, but the data doesn't exist.
  12993. return;
  12994. }
  12995. // Set the data...
  12996. this.each( function() {
  12997. // We always store the camelCased key
  12998. dataUser.set( this, key, value );
  12999. } );
  13000. }, null, value, arguments.length > 1, null, true );
  13001. },
  13002. removeData: function( key ) {
  13003. return this.each( function() {
  13004. dataUser.remove( this, key );
  13005. } );
  13006. }
  13007. } );
  13008. jQuery.extend( {
  13009. queue: function( elem, type, data ) {
  13010. var queue;
  13011. if ( elem ) {
  13012. type = ( type || "fx" ) + "queue";
  13013. queue = dataPriv.get( elem, type );
  13014. // Speed up dequeue by getting out quickly if this is just a lookup
  13015. if ( data ) {
  13016. if ( !queue || Array.isArray( data ) ) {
  13017. queue = dataPriv.access( elem, type, jQuery.makeArray( data ) );
  13018. } else {
  13019. queue.push( data );
  13020. }
  13021. }
  13022. return queue || [];
  13023. }
  13024. },
  13025. dequeue: function( elem, type ) {
  13026. type = type || "fx";
  13027. var queue = jQuery.queue( elem, type ),
  13028. startLength = queue.length,
  13029. fn = queue.shift(),
  13030. hooks = jQuery._queueHooks( elem, type ),
  13031. next = function() {
  13032. jQuery.dequeue( elem, type );
  13033. };
  13034. // If the fx queue is dequeued, always remove the progress sentinel
  13035. if ( fn === "inprogress" ) {
  13036. fn = queue.shift();
  13037. startLength--;
  13038. }
  13039. if ( fn ) {
  13040. // Add a progress sentinel to prevent the fx queue from being
  13041. // automatically dequeued
  13042. if ( type === "fx" ) {
  13043. queue.unshift( "inprogress" );
  13044. }
  13045. // Clear up the last queue stop function
  13046. delete hooks.stop;
  13047. fn.call( elem, next, hooks );
  13048. }
  13049. if ( !startLength && hooks ) {
  13050. hooks.empty.fire();
  13051. }
  13052. },
  13053. // Not public - generate a queueHooks object, or return the current one
  13054. _queueHooks: function( elem, type ) {
  13055. var key = type + "queueHooks";
  13056. return dataPriv.get( elem, key ) || dataPriv.access( elem, key, {
  13057. empty: jQuery.Callbacks( "once memory" ).add( function() {
  13058. dataPriv.remove( elem, [ type + "queue", key ] );
  13059. } )
  13060. } );
  13061. }
  13062. } );
  13063. jQuery.fn.extend( {
  13064. queue: function( type, data ) {
  13065. var setter = 2;
  13066. if ( typeof type !== "string" ) {
  13067. data = type;
  13068. type = "fx";
  13069. setter--;
  13070. }
  13071. if ( arguments.length < setter ) {
  13072. return jQuery.queue( this[ 0 ], type );
  13073. }
  13074. return data === undefined ?
  13075. this :
  13076. this.each( function() {
  13077. var queue = jQuery.queue( this, type, data );
  13078. // Ensure a hooks for this queue
  13079. jQuery._queueHooks( this, type );
  13080. if ( type === "fx" && queue[ 0 ] !== "inprogress" ) {
  13081. jQuery.dequeue( this, type );
  13082. }
  13083. } );
  13084. },
  13085. dequeue: function( type ) {
  13086. return this.each( function() {
  13087. jQuery.dequeue( this, type );
  13088. } );
  13089. },
  13090. clearQueue: function( type ) {
  13091. return this.queue( type || "fx", [] );
  13092. },
  13093. // Get a promise resolved when queues of a certain type
  13094. // are emptied (fx is the type by default)
  13095. promise: function( type, obj ) {
  13096. var tmp,
  13097. count = 1,
  13098. defer = jQuery.Deferred(),
  13099. elements = this,
  13100. i = this.length,
  13101. resolve = function() {
  13102. if ( !( --count ) ) {
  13103. defer.resolveWith( elements, [ elements ] );
  13104. }
  13105. };
  13106. if ( typeof type !== "string" ) {
  13107. obj = type;
  13108. type = undefined;
  13109. }
  13110. type = type || "fx";
  13111. while ( i-- ) {
  13112. tmp = dataPriv.get( elements[ i ], type + "queueHooks" );
  13113. if ( tmp && tmp.empty ) {
  13114. count++;
  13115. tmp.empty.add( resolve );
  13116. }
  13117. }
  13118. resolve();
  13119. return defer.promise( obj );
  13120. }
  13121. } );
  13122. var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;
  13123. var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );
  13124. var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
  13125. var documentElement = document.documentElement;
  13126. var isAttached = function( elem ) {
  13127. return jQuery.contains( elem.ownerDocument, elem );
  13128. },
  13129. composed = { composed: true };
  13130. // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only
  13131. // Check attachment across shadow DOM boundaries when possible (gh-3504)
  13132. // Support: iOS 10.0-10.2 only
  13133. // Early iOS 10 versions support `attachShadow` but not `getRootNode`,
  13134. // leading to errors. We need to check for `getRootNode`.
  13135. if ( documentElement.getRootNode ) {
  13136. isAttached = function( elem ) {
  13137. return jQuery.contains( elem.ownerDocument, elem ) ||
  13138. elem.getRootNode( composed ) === elem.ownerDocument;
  13139. };
  13140. }
  13141. var isHiddenWithinTree = function( elem, el ) {
  13142. // isHiddenWithinTree might be called from jQuery#filter function;
  13143. // in that case, element will be second argument
  13144. elem = el || elem;
  13145. // Inline style trumps all
  13146. return elem.style.display === "none" ||
  13147. elem.style.display === "" &&
  13148. // Otherwise, check computed style
  13149. // Support: Firefox <=43 - 45
  13150. // Disconnected elements can have computed display: none, so first confirm that elem is
  13151. // in the document.
  13152. isAttached( elem ) &&
  13153. jQuery.css( elem, "display" ) === "none";
  13154. };
  13155. var swap = function( elem, options, callback, args ) {
  13156. var ret, name,
  13157. old = {};
  13158. // Remember the old values, and insert the new ones
  13159. for ( name in options ) {
  13160. old[ name ] = elem.style[ name ];
  13161. elem.style[ name ] = options[ name ];
  13162. }
  13163. ret = callback.apply( elem, args || [] );
  13164. // Revert the old values
  13165. for ( name in options ) {
  13166. elem.style[ name ] = old[ name ];
  13167. }
  13168. return ret;
  13169. };
  13170. function adjustCSS( elem, prop, valueParts, tween ) {
  13171. var adjusted, scale,
  13172. maxIterations = 20,
  13173. currentValue = tween ?
  13174. function() {
  13175. return tween.cur();
  13176. } :
  13177. function() {
  13178. return jQuery.css( elem, prop, "" );
  13179. },
  13180. initial = currentValue(),
  13181. unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
  13182. // Starting value computation is required for potential unit mismatches
  13183. initialInUnit = elem.nodeType &&
  13184. ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
  13185. rcssNum.exec( jQuery.css( elem, prop ) );
  13186. if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
  13187. // Support: Firefox <=54
  13188. // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144)
  13189. initial = initial / 2;
  13190. // Trust units reported by jQuery.css
  13191. unit = unit || initialInUnit[ 3 ];
  13192. // Iteratively approximate from a nonzero starting point
  13193. initialInUnit = +initial || 1;
  13194. while ( maxIterations-- ) {
  13195. // Evaluate and update our best guess (doubling guesses that zero out).
  13196. // Finish if the scale equals or crosses 1 (making the old*new product non-positive).
  13197. jQuery.style( elem, prop, initialInUnit + unit );
  13198. if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) {
  13199. maxIterations = 0;
  13200. }
  13201. initialInUnit = initialInUnit / scale;
  13202. }
  13203. initialInUnit = initialInUnit * 2;
  13204. jQuery.style( elem, prop, initialInUnit + unit );
  13205. // Make sure we update the tween properties later on
  13206. valueParts = valueParts || [];
  13207. }
  13208. if ( valueParts ) {
  13209. initialInUnit = +initialInUnit || +initial || 0;
  13210. // Apply relative offset (+=/-=) if specified
  13211. adjusted = valueParts[ 1 ] ?
  13212. initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :
  13213. +valueParts[ 2 ];
  13214. if ( tween ) {
  13215. tween.unit = unit;
  13216. tween.start = initialInUnit;
  13217. tween.end = adjusted;
  13218. }
  13219. }
  13220. return adjusted;
  13221. }
  13222. var defaultDisplayMap = {};
  13223. function getDefaultDisplay( elem ) {
  13224. var temp,
  13225. doc = elem.ownerDocument,
  13226. nodeName = elem.nodeName,
  13227. display = defaultDisplayMap[ nodeName ];
  13228. if ( display ) {
  13229. return display;
  13230. }
  13231. temp = doc.body.appendChild( doc.createElement( nodeName ) );
  13232. display = jQuery.css( temp, "display" );
  13233. temp.parentNode.removeChild( temp );
  13234. if ( display === "none" ) {
  13235. display = "block";
  13236. }
  13237. defaultDisplayMap[ nodeName ] = display;
  13238. return display;
  13239. }
  13240. function showHide( elements, show ) {
  13241. var display, elem,
  13242. values = [],
  13243. index = 0,
  13244. length = elements.length;
  13245. // Determine new display value for elements that need to change
  13246. for ( ; index < length; index++ ) {
  13247. elem = elements[ index ];
  13248. if ( !elem.style ) {
  13249. continue;
  13250. }
  13251. display = elem.style.display;
  13252. if ( show ) {
  13253. // Since we force visibility upon cascade-hidden elements, an immediate (and slow)
  13254. // check is required in this first loop unless we have a nonempty display value (either
  13255. // inline or about-to-be-restored)
  13256. if ( display === "none" ) {
  13257. values[ index ] = dataPriv.get( elem, "display" ) || null;
  13258. if ( !values[ index ] ) {
  13259. elem.style.display = "";
  13260. }
  13261. }
  13262. if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) {
  13263. values[ index ] = getDefaultDisplay( elem );
  13264. }
  13265. } else {
  13266. if ( display !== "none" ) {
  13267. values[ index ] = "none";
  13268. // Remember what we're overwriting
  13269. dataPriv.set( elem, "display", display );
  13270. }
  13271. }
  13272. }
  13273. // Set the display of the elements in a second loop to avoid constant reflow
  13274. for ( index = 0; index < length; index++ ) {
  13275. if ( values[ index ] != null ) {
  13276. elements[ index ].style.display = values[ index ];
  13277. }
  13278. }
  13279. return elements;
  13280. }
  13281. jQuery.fn.extend( {
  13282. show: function() {
  13283. return showHide( this, true );
  13284. },
  13285. hide: function() {
  13286. return showHide( this );
  13287. },
  13288. toggle: function( state ) {
  13289. if ( typeof state === "boolean" ) {
  13290. return state ? this.show() : this.hide();
  13291. }
  13292. return this.each( function() {
  13293. if ( isHiddenWithinTree( this ) ) {
  13294. jQuery( this ).show();
  13295. } else {
  13296. jQuery( this ).hide();
  13297. }
  13298. } );
  13299. }
  13300. } );
  13301. var rcheckableType = ( /^(?:checkbox|radio)$/i );
  13302. var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i );
  13303. var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i );
  13304. // We have to close these tags to support XHTML (#13200)
  13305. var wrapMap = {
  13306. // Support: IE <=9 only
  13307. option: [ 1, "<select multiple='multiple'>", "</select>" ],
  13308. // XHTML parsers do not magically insert elements in the
  13309. // same way that tag soup parsers do. So we cannot shorten
  13310. // this by omitting <tbody> or other required elements.
  13311. thead: [ 1, "<table>", "</table>" ],
  13312. col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
  13313. tr: [ 2, "<table><tbody>", "</tbody></table>" ],
  13314. td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
  13315. _default: [ 0, "", "" ]
  13316. };
  13317. // Support: IE <=9 only
  13318. wrapMap.optgroup = wrapMap.option;
  13319. wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
  13320. wrapMap.th = wrapMap.td;
  13321. function getAll( context, tag ) {
  13322. // Support: IE <=9 - 11 only
  13323. // Use typeof to avoid zero-argument method invocation on host objects (#15151)
  13324. var ret;
  13325. if ( typeof context.getElementsByTagName !== "undefined" ) {
  13326. ret = context.getElementsByTagName( tag || "*" );
  13327. } else if ( typeof context.querySelectorAll !== "undefined" ) {
  13328. ret = context.querySelectorAll( tag || "*" );
  13329. } else {
  13330. ret = [];
  13331. }
  13332. if ( tag === undefined || tag && nodeName( context, tag ) ) {
  13333. return jQuery.merge( [ context ], ret );
  13334. }
  13335. return ret;
  13336. }
  13337. // Mark scripts as having already been evaluated
  13338. function setGlobalEval( elems, refElements ) {
  13339. var i = 0,
  13340. l = elems.length;
  13341. for ( ; i < l; i++ ) {
  13342. dataPriv.set(
  13343. elems[ i ],
  13344. "globalEval",
  13345. !refElements || dataPriv.get( refElements[ i ], "globalEval" )
  13346. );
  13347. }
  13348. }
  13349. var rhtml = /<|&#?\w+;/;
  13350. function buildFragment( elems, context, scripts, selection, ignored ) {
  13351. var elem, tmp, tag, wrap, attached, j,
  13352. fragment = context.createDocumentFragment(),
  13353. nodes = [],
  13354. i = 0,
  13355. l = elems.length;
  13356. for ( ; i < l; i++ ) {
  13357. elem = elems[ i ];
  13358. if ( elem || elem === 0 ) {
  13359. // Add nodes directly
  13360. if ( toType( elem ) === "object" ) {
  13361. // Support: Android <=4.0 only, PhantomJS 1 only
  13362. // push.apply(_, arraylike) throws on ancient WebKit
  13363. jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
  13364. // Convert non-html into a text node
  13365. } else if ( !rhtml.test( elem ) ) {
  13366. nodes.push( context.createTextNode( elem ) );
  13367. // Convert html into DOM nodes
  13368. } else {
  13369. tmp = tmp || fragment.appendChild( context.createElement( "div" ) );
  13370. // Deserialize a standard representation
  13371. tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
  13372. wrap = wrapMap[ tag ] || wrapMap._default;
  13373. tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];
  13374. // Descend through wrappers to the right content
  13375. j = wrap[ 0 ];
  13376. while ( j-- ) {
  13377. tmp = tmp.lastChild;
  13378. }
  13379. // Support: Android <=4.0 only, PhantomJS 1 only
  13380. // push.apply(_, arraylike) throws on ancient WebKit
  13381. jQuery.merge( nodes, tmp.childNodes );
  13382. // Remember the top-level container
  13383. tmp = fragment.firstChild;
  13384. // Ensure the created nodes are orphaned (#12392)
  13385. tmp.textContent = "";
  13386. }
  13387. }
  13388. }
  13389. // Remove wrapper from fragment
  13390. fragment.textContent = "";
  13391. i = 0;
  13392. while ( ( elem = nodes[ i++ ] ) ) {
  13393. // Skip elements already in the context collection (trac-4087)
  13394. if ( selection && jQuery.inArray( elem, selection ) > -1 ) {
  13395. if ( ignored ) {
  13396. ignored.push( elem );
  13397. }
  13398. continue;
  13399. }
  13400. attached = isAttached( elem );
  13401. // Append to fragment
  13402. tmp = getAll( fragment.appendChild( elem ), "script" );
  13403. // Preserve script evaluation history
  13404. if ( attached ) {
  13405. setGlobalEval( tmp );
  13406. }
  13407. // Capture executables
  13408. if ( scripts ) {
  13409. j = 0;
  13410. while ( ( elem = tmp[ j++ ] ) ) {
  13411. if ( rscriptType.test( elem.type || "" ) ) {
  13412. scripts.push( elem );
  13413. }
  13414. }
  13415. }
  13416. }
  13417. return fragment;
  13418. }
  13419. ( function() {
  13420. var fragment = document.createDocumentFragment(),
  13421. div = fragment.appendChild( document.createElement( "div" ) ),
  13422. input = document.createElement( "input" );
  13423. // Support: Android 4.0 - 4.3 only
  13424. // Check state lost if the name is set (#11217)
  13425. // Support: Windows Web Apps (WWA)
  13426. // `name` and `type` must use .setAttribute for WWA (#14901)
  13427. input.setAttribute( "type", "radio" );
  13428. input.setAttribute( "checked", "checked" );
  13429. input.setAttribute( "name", "t" );
  13430. div.appendChild( input );
  13431. // Support: Android <=4.1 only
  13432. // Older WebKit doesn't clone checked state correctly in fragments
  13433. support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
  13434. // Support: IE <=11 only
  13435. // Make sure textarea (and checkbox) defaultValue is properly cloned
  13436. div.innerHTML = "<textarea>x</textarea>";
  13437. support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
  13438. } )();
  13439. var
  13440. rkeyEvent = /^key/,
  13441. rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
  13442. rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
  13443. function returnTrue() {
  13444. return true;
  13445. }
  13446. function returnFalse() {
  13447. return false;
  13448. }
  13449. // Support: IE <=9 - 11+
  13450. // focus() and blur() are asynchronous, except when they are no-op.
  13451. // So expect focus to be synchronous when the element is already active,
  13452. // and blur to be synchronous when the element is not already active.
  13453. // (focus and blur are always synchronous in other supported browsers,
  13454. // this just defines when we can count on it).
  13455. function expectSync( elem, type ) {
  13456. return ( elem === safeActiveElement() ) === ( type === "focus" );
  13457. }
  13458. // Support: IE <=9 only
  13459. // Accessing document.activeElement can throw unexpectedly
  13460. // https://bugs.jquery.com/ticket/13393
  13461. function safeActiveElement() {
  13462. try {
  13463. return document.activeElement;
  13464. } catch ( err ) { }
  13465. }
  13466. function on( elem, types, selector, data, fn, one ) {
  13467. var origFn, type;
  13468. // Types can be a map of types/handlers
  13469. if ( typeof types === "object" ) {
  13470. // ( types-Object, selector, data )
  13471. if ( typeof selector !== "string" ) {
  13472. // ( types-Object, data )
  13473. data = data || selector;
  13474. selector = undefined;
  13475. }
  13476. for ( type in types ) {
  13477. on( elem, type, selector, data, types[ type ], one );
  13478. }
  13479. return elem;
  13480. }
  13481. if ( data == null && fn == null ) {
  13482. // ( types, fn )
  13483. fn = selector;
  13484. data = selector = undefined;
  13485. } else if ( fn == null ) {
  13486. if ( typeof selector === "string" ) {
  13487. // ( types, selector, fn )
  13488. fn = data;
  13489. data = undefined;
  13490. } else {
  13491. // ( types, data, fn )
  13492. fn = data;
  13493. data = selector;
  13494. selector = undefined;
  13495. }
  13496. }
  13497. if ( fn === false ) {
  13498. fn = returnFalse;
  13499. } else if ( !fn ) {
  13500. return elem;
  13501. }
  13502. if ( one === 1 ) {
  13503. origFn = fn;
  13504. fn = function( event ) {
  13505. // Can use an empty set, since event contains the info
  13506. jQuery().off( event );
  13507. return origFn.apply( this, arguments );
  13508. };
  13509. // Use same guid so caller can remove using origFn
  13510. fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
  13511. }
  13512. return elem.each( function() {
  13513. jQuery.event.add( this, types, fn, data, selector );
  13514. } );
  13515. }
  13516. /*
  13517. * Helper functions for managing events -- not part of the public interface.
  13518. * Props to Dean Edwards' addEvent library for many of the ideas.
  13519. */
  13520. jQuery.event = {
  13521. global: {},
  13522. add: function( elem, types, handler, data, selector ) {
  13523. var handleObjIn, eventHandle, tmp,
  13524. events, t, handleObj,
  13525. special, handlers, type, namespaces, origType,
  13526. elemData = dataPriv.get( elem );
  13527. // Don't attach events to noData or text/comment nodes (but allow plain objects)
  13528. if ( !elemData ) {
  13529. return;
  13530. }
  13531. // Caller can pass in an object of custom data in lieu of the handler
  13532. if ( handler.handler ) {
  13533. handleObjIn = handler;
  13534. handler = handleObjIn.handler;
  13535. selector = handleObjIn.selector;
  13536. }
  13537. // Ensure that invalid selectors throw exceptions at attach time
  13538. // Evaluate against documentElement in case elem is a non-element node (e.g., document)
  13539. if ( selector ) {
  13540. jQuery.find.matchesSelector( documentElement, selector );
  13541. }
  13542. // Make sure that the handler has a unique ID, used to find/remove it later
  13543. if ( !handler.guid ) {
  13544. handler.guid = jQuery.guid++;
  13545. }
  13546. // Init the element's event structure and main handler, if this is the first
  13547. if ( !( events = elemData.events ) ) {
  13548. events = elemData.events = {};
  13549. }
  13550. if ( !( eventHandle = elemData.handle ) ) {
  13551. eventHandle = elemData.handle = function( e ) {
  13552. // Discard the second event of a jQuery.event.trigger() and
  13553. // when an event is called after a page has unloaded
  13554. return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ?
  13555. jQuery.event.dispatch.apply( elem, arguments ) : undefined;
  13556. };
  13557. }
  13558. // Handle multiple events separated by a space
  13559. types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
  13560. t = types.length;
  13561. while ( t-- ) {
  13562. tmp = rtypenamespace.exec( types[ t ] ) || [];
  13563. type = origType = tmp[ 1 ];
  13564. namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
  13565. // There *must* be a type, no attaching namespace-only handlers
  13566. if ( !type ) {
  13567. continue;
  13568. }
  13569. // If event changes its type, use the special event handlers for the changed type
  13570. special = jQuery.event.special[ type ] || {};
  13571. // If selector defined, determine special event api type, otherwise given type
  13572. type = ( selector ? special.delegateType : special.bindType ) || type;
  13573. // Update special based on newly reset type
  13574. special = jQuery.event.special[ type ] || {};
  13575. // handleObj is passed to all event handlers
  13576. handleObj = jQuery.extend( {
  13577. type: type,
  13578. origType: origType,
  13579. data: data,
  13580. handler: handler,
  13581. guid: handler.guid,
  13582. selector: selector,
  13583. needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
  13584. namespace: namespaces.join( "." )
  13585. }, handleObjIn );
  13586. // Init the event handler queue if we're the first
  13587. if ( !( handlers = events[ type ] ) ) {
  13588. handlers = events[ type ] = [];
  13589. handlers.delegateCount = 0;
  13590. // Only use addEventListener if the special events handler returns false
  13591. if ( !special.setup ||
  13592. special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
  13593. if ( elem.addEventListener ) {
  13594. elem.addEventListener( type, eventHandle );
  13595. }
  13596. }
  13597. }
  13598. if ( special.add ) {
  13599. special.add.call( elem, handleObj );
  13600. if ( !handleObj.handler.guid ) {
  13601. handleObj.handler.guid = handler.guid;
  13602. }
  13603. }
  13604. // Add to the element's handler list, delegates in front
  13605. if ( selector ) {
  13606. handlers.splice( handlers.delegateCount++, 0, handleObj );
  13607. } else {
  13608. handlers.push( handleObj );
  13609. }
  13610. // Keep track of which events have ever been used, for event optimization
  13611. jQuery.event.global[ type ] = true;
  13612. }
  13613. },
  13614. // Detach an event or set of events from an element
  13615. remove: function( elem, types, handler, selector, mappedTypes ) {
  13616. var j, origCount, tmp,
  13617. events, t, handleObj,
  13618. special, handlers, type, namespaces, origType,
  13619. elemData = dataPriv.hasData( elem ) && dataPriv.get( elem );
  13620. if ( !elemData || !( events = elemData.events ) ) {
  13621. return;
  13622. }
  13623. // Once for each type.namespace in types; type may be omitted
  13624. types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
  13625. t = types.length;
  13626. while ( t-- ) {
  13627. tmp = rtypenamespace.exec( types[ t ] ) || [];
  13628. type = origType = tmp[ 1 ];
  13629. namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
  13630. // Unbind all events (on this namespace, if provided) for the element
  13631. if ( !type ) {
  13632. for ( type in events ) {
  13633. jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
  13634. }
  13635. continue;
  13636. }
  13637. special = jQuery.event.special[ type ] || {};
  13638. type = ( selector ? special.delegateType : special.bindType ) || type;
  13639. handlers = events[ type ] || [];
  13640. tmp = tmp[ 2 ] &&
  13641. new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" );
  13642. // Remove matching events
  13643. origCount = j = handlers.length;
  13644. while ( j-- ) {
  13645. handleObj = handlers[ j ];
  13646. if ( ( mappedTypes || origType === handleObj.origType ) &&
  13647. ( !handler || handler.guid === handleObj.guid ) &&
  13648. ( !tmp || tmp.test( handleObj.namespace ) ) &&
  13649. ( !selector || selector === handleObj.selector ||
  13650. selector === "**" && handleObj.selector ) ) {
  13651. handlers.splice( j, 1 );
  13652. if ( handleObj.selector ) {
  13653. handlers.delegateCount--;
  13654. }
  13655. if ( special.remove ) {
  13656. special.remove.call( elem, handleObj );
  13657. }
  13658. }
  13659. }
  13660. // Remove generic event handler if we removed something and no more handlers exist
  13661. // (avoids potential for endless recursion during removal of special event handlers)
  13662. if ( origCount && !handlers.length ) {
  13663. if ( !special.teardown ||
  13664. special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
  13665. jQuery.removeEvent( elem, type, elemData.handle );
  13666. }
  13667. delete events[ type ];
  13668. }
  13669. }
  13670. // Remove data and the expando if it's no longer used
  13671. if ( jQuery.isEmptyObject( events ) ) {
  13672. dataPriv.remove( elem, "handle events" );
  13673. }
  13674. },
  13675. dispatch: function( nativeEvent ) {
  13676. // Make a writable jQuery.Event from the native event object
  13677. var event = jQuery.event.fix( nativeEvent );
  13678. var i, j, ret, matched, handleObj, handlerQueue,
  13679. args = new Array( arguments.length ),
  13680. handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [],
  13681. special = jQuery.event.special[ event.type ] || {};
  13682. // Use the fix-ed jQuery.Event rather than the (read-only) native event
  13683. args[ 0 ] = event;
  13684. for ( i = 1; i < arguments.length; i++ ) {
  13685. args[ i ] = arguments[ i ];
  13686. }
  13687. event.delegateTarget = this;
  13688. // Call the preDispatch hook for the mapped type, and let it bail if desired
  13689. if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
  13690. return;
  13691. }
  13692. // Determine handlers
  13693. handlerQueue = jQuery.event.handlers.call( this, event, handlers );
  13694. // Run delegates first; they may want to stop propagation beneath us
  13695. i = 0;
  13696. while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {
  13697. event.currentTarget = matched.elem;
  13698. j = 0;
  13699. while ( ( handleObj = matched.handlers[ j++ ] ) &&
  13700. !event.isImmediatePropagationStopped() ) {
  13701. // If the event is namespaced, then each handler is only invoked if it is
  13702. // specially universal or its namespaces are a superset of the event's.
  13703. if ( !event.rnamespace || handleObj.namespace === false ||
  13704. event.rnamespace.test( handleObj.namespace ) ) {
  13705. event.handleObj = handleObj;
  13706. event.data = handleObj.data;
  13707. ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||
  13708. handleObj.handler ).apply( matched.elem, args );
  13709. if ( ret !== undefined ) {
  13710. if ( ( event.result = ret ) === false ) {
  13711. event.preventDefault();
  13712. event.stopPropagation();
  13713. }
  13714. }
  13715. }
  13716. }
  13717. }
  13718. // Call the postDispatch hook for the mapped type
  13719. if ( special.postDispatch ) {
  13720. special.postDispatch.call( this, event );
  13721. }
  13722. return event.result;
  13723. },
  13724. handlers: function( event, handlers ) {
  13725. var i, handleObj, sel, matchedHandlers, matchedSelectors,
  13726. handlerQueue = [],
  13727. delegateCount = handlers.delegateCount,
  13728. cur = event.target;
  13729. // Find delegate handlers
  13730. if ( delegateCount &&
  13731. // Support: IE <=9
  13732. // Black-hole SVG <use> instance trees (trac-13180)
  13733. cur.nodeType &&
  13734. // Support: Firefox <=42
  13735. // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)
  13736. // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click
  13737. // Support: IE 11 only
  13738. // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343)
  13739. !( event.type === "click" && event.button >= 1 ) ) {
  13740. for ( ; cur !== this; cur = cur.parentNode || this ) {
  13741. // Don't check non-elements (#13208)
  13742. // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
  13743. if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) {
  13744. matchedHandlers = [];
  13745. matchedSelectors = {};
  13746. for ( i = 0; i < delegateCount; i++ ) {
  13747. handleObj = handlers[ i ];
  13748. // Don't conflict with Object.prototype properties (#13203)
  13749. sel = handleObj.selector + " ";
  13750. if ( matchedSelectors[ sel ] === undefined ) {
  13751. matchedSelectors[ sel ] = handleObj.needsContext ?
  13752. jQuery( sel, this ).index( cur ) > -1 :
  13753. jQuery.find( sel, this, null, [ cur ] ).length;
  13754. }
  13755. if ( matchedSelectors[ sel ] ) {
  13756. matchedHandlers.push( handleObj );
  13757. }
  13758. }
  13759. if ( matchedHandlers.length ) {
  13760. handlerQueue.push( { elem: cur, handlers: matchedHandlers } );
  13761. }
  13762. }
  13763. }
  13764. }
  13765. // Add the remaining (directly-bound) handlers
  13766. cur = this;
  13767. if ( delegateCount < handlers.length ) {
  13768. handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );
  13769. }
  13770. return handlerQueue;
  13771. },
  13772. addProp: function( name, hook ) {
  13773. Object.defineProperty( jQuery.Event.prototype, name, {
  13774. enumerable: true,
  13775. configurable: true,
  13776. get: isFunction( hook ) ?
  13777. function() {
  13778. if ( this.originalEvent ) {
  13779. return hook( this.originalEvent );
  13780. }
  13781. } :
  13782. function() {
  13783. if ( this.originalEvent ) {
  13784. return this.originalEvent[ name ];
  13785. }
  13786. },
  13787. set: function( value ) {
  13788. Object.defineProperty( this, name, {
  13789. enumerable: true,
  13790. configurable: true,
  13791. writable: true,
  13792. value: value
  13793. } );
  13794. }
  13795. } );
  13796. },
  13797. fix: function( originalEvent ) {
  13798. return originalEvent[ jQuery.expando ] ?
  13799. originalEvent :
  13800. new jQuery.Event( originalEvent );
  13801. },
  13802. special: {
  13803. load: {
  13804. // Prevent triggered image.load events from bubbling to window.load
  13805. noBubble: true
  13806. },
  13807. click: {
  13808. // Utilize native event to ensure correct state for checkable inputs
  13809. setup: function( data ) {
  13810. // For mutual compressibility with _default, replace `this` access with a local var.
  13811. // `|| data` is dead code meant only to preserve the variable through minification.
  13812. var el = this || data;
  13813. // Claim the first handler
  13814. if ( rcheckableType.test( el.type ) &&
  13815. el.click && nodeName( el, "input" ) ) {
  13816. // dataPriv.set( el, "click", ... )
  13817. leverageNative( el, "click", returnTrue );
  13818. }
  13819. // Return false to allow normal processing in the caller
  13820. return false;
  13821. },
  13822. trigger: function( data ) {
  13823. // For mutual compressibility with _default, replace `this` access with a local var.
  13824. // `|| data` is dead code meant only to preserve the variable through minification.
  13825. var el = this || data;
  13826. // Force setup before triggering a click
  13827. if ( rcheckableType.test( el.type ) &&
  13828. el.click && nodeName( el, "input" ) ) {
  13829. leverageNative( el, "click" );
  13830. }
  13831. // Return non-false to allow normal event-path propagation
  13832. return true;
  13833. },
  13834. // For cross-browser consistency, suppress native .click() on links
  13835. // Also prevent it if we're currently inside a leveraged native-event stack
  13836. _default: function( event ) {
  13837. var target = event.target;
  13838. return rcheckableType.test( target.type ) &&
  13839. target.click && nodeName( target, "input" ) &&
  13840. dataPriv.get( target, "click" ) ||
  13841. nodeName( target, "a" );
  13842. }
  13843. },
  13844. beforeunload: {
  13845. postDispatch: function( event ) {
  13846. // Support: Firefox 20+
  13847. // Firefox doesn't alert if the returnValue field is not set.
  13848. if ( event.result !== undefined && event.originalEvent ) {
  13849. event.originalEvent.returnValue = event.result;
  13850. }
  13851. }
  13852. }
  13853. }
  13854. };
  13855. // Ensure the presence of an event listener that handles manually-triggered
  13856. // synthetic events by interrupting progress until reinvoked in response to
  13857. // *native* events that it fires directly, ensuring that state changes have
  13858. // already occurred before other listeners are invoked.
  13859. function leverageNative( el, type, expectSync ) {
  13860. // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add
  13861. if ( !expectSync ) {
  13862. if ( dataPriv.get( el, type ) === undefined ) {
  13863. jQuery.event.add( el, type, returnTrue );
  13864. }
  13865. return;
  13866. }
  13867. // Register the controller as a special universal handler for all event namespaces
  13868. dataPriv.set( el, type, false );
  13869. jQuery.event.add( el, type, {
  13870. namespace: false,
  13871. handler: function( event ) {
  13872. var notAsync, result,
  13873. saved = dataPriv.get( this, type );
  13874. if ( ( event.isTrigger & 1 ) && this[ type ] ) {
  13875. // Interrupt processing of the outer synthetic .trigger()ed event
  13876. // Saved data should be false in such cases, but might be a leftover capture object
  13877. // from an async native handler (gh-4350)
  13878. if ( !saved.length ) {
  13879. // Store arguments for use when handling the inner native event
  13880. // There will always be at least one argument (an event object), so this array
  13881. // will not be confused with a leftover capture object.
  13882. saved = slice.call( arguments );
  13883. dataPriv.set( this, type, saved );
  13884. // Trigger the native event and capture its result
  13885. // Support: IE <=9 - 11+
  13886. // focus() and blur() are asynchronous
  13887. notAsync = expectSync( this, type );
  13888. this[ type ]();
  13889. result = dataPriv.get( this, type );
  13890. if ( saved !== result || notAsync ) {
  13891. dataPriv.set( this, type, false );
  13892. } else {
  13893. result = {};
  13894. }
  13895. if ( saved !== result ) {
  13896. // Cancel the outer synthetic event
  13897. event.stopImmediatePropagation();
  13898. event.preventDefault();
  13899. return result.value;
  13900. }
  13901. // If this is an inner synthetic event for an event with a bubbling surrogate
  13902. // (focus or blur), assume that the surrogate already propagated from triggering the
  13903. // native event and prevent that from happening again here.
  13904. // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the
  13905. // bubbling surrogate propagates *after* the non-bubbling base), but that seems
  13906. // less bad than duplication.
  13907. } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) {
  13908. event.stopPropagation();
  13909. }
  13910. // If this is a native event triggered above, everything is now in order
  13911. // Fire an inner synthetic event with the original arguments
  13912. } else if ( saved.length ) {
  13913. // ...and capture the result
  13914. dataPriv.set( this, type, {
  13915. value: jQuery.event.trigger(
  13916. // Support: IE <=9 - 11+
  13917. // Extend with the prototype to reset the above stopImmediatePropagation()
  13918. jQuery.extend( saved[ 0 ], jQuery.Event.prototype ),
  13919. saved.slice( 1 ),
  13920. this
  13921. )
  13922. } );
  13923. // Abort handling of the native event
  13924. event.stopImmediatePropagation();
  13925. }
  13926. }
  13927. } );
  13928. }
  13929. jQuery.removeEvent = function( elem, type, handle ) {
  13930. // This "if" is needed for plain objects
  13931. if ( elem.removeEventListener ) {
  13932. elem.removeEventListener( type, handle );
  13933. }
  13934. };
  13935. jQuery.Event = function( src, props ) {
  13936. // Allow instantiation without the 'new' keyword
  13937. if ( !( this instanceof jQuery.Event ) ) {
  13938. return new jQuery.Event( src, props );
  13939. }
  13940. // Event object
  13941. if ( src && src.type ) {
  13942. this.originalEvent = src;
  13943. this.type = src.type;
  13944. // Events bubbling up the document may have been marked as prevented
  13945. // by a handler lower down the tree; reflect the correct value.
  13946. this.isDefaultPrevented = src.defaultPrevented ||
  13947. src.defaultPrevented === undefined &&
  13948. // Support: Android <=2.3 only
  13949. src.returnValue === false ?
  13950. returnTrue :
  13951. returnFalse;
  13952. // Create target properties
  13953. // Support: Safari <=6 - 7 only
  13954. // Target should not be a text node (#504, #13143)
  13955. this.target = ( src.target && src.target.nodeType === 3 ) ?
  13956. src.target.parentNode :
  13957. src.target;
  13958. this.currentTarget = src.currentTarget;
  13959. this.relatedTarget = src.relatedTarget;
  13960. // Event type
  13961. } else {
  13962. this.type = src;
  13963. }
  13964. // Put explicitly provided properties onto the event object
  13965. if ( props ) {
  13966. jQuery.extend( this, props );
  13967. }
  13968. // Create a timestamp if incoming event doesn't have one
  13969. this.timeStamp = src && src.timeStamp || Date.now();
  13970. // Mark it as fixed
  13971. this[ jQuery.expando ] = true;
  13972. };
  13973. // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
  13974. // https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
  13975. jQuery.Event.prototype = {
  13976. constructor: jQuery.Event,
  13977. isDefaultPrevented: returnFalse,
  13978. isPropagationStopped: returnFalse,
  13979. isImmediatePropagationStopped: returnFalse,
  13980. isSimulated: false,
  13981. preventDefault: function() {
  13982. var e = this.originalEvent;
  13983. this.isDefaultPrevented = returnTrue;
  13984. if ( e && !this.isSimulated ) {
  13985. e.preventDefault();
  13986. }
  13987. },
  13988. stopPropagation: function() {
  13989. var e = this.originalEvent;
  13990. this.isPropagationStopped = returnTrue;
  13991. if ( e && !this.isSimulated ) {
  13992. e.stopPropagation();
  13993. }
  13994. },
  13995. stopImmediatePropagation: function() {
  13996. var e = this.originalEvent;
  13997. this.isImmediatePropagationStopped = returnTrue;
  13998. if ( e && !this.isSimulated ) {
  13999. e.stopImmediatePropagation();
  14000. }
  14001. this.stopPropagation();
  14002. }
  14003. };
  14004. // Includes all common event props including KeyEvent and MouseEvent specific props
  14005. jQuery.each( {
  14006. altKey: true,
  14007. bubbles: true,
  14008. cancelable: true,
  14009. changedTouches: true,
  14010. ctrlKey: true,
  14011. detail: true,
  14012. eventPhase: true,
  14013. metaKey: true,
  14014. pageX: true,
  14015. pageY: true,
  14016. shiftKey: true,
  14017. view: true,
  14018. "char": true,
  14019. code: true,
  14020. charCode: true,
  14021. key: true,
  14022. keyCode: true,
  14023. button: true,
  14024. buttons: true,
  14025. clientX: true,
  14026. clientY: true,
  14027. offsetX: true,
  14028. offsetY: true,
  14029. pointerId: true,
  14030. pointerType: true,
  14031. screenX: true,
  14032. screenY: true,
  14033. targetTouches: true,
  14034. toElement: true,
  14035. touches: true,
  14036. which: function( event ) {
  14037. var button = event.button;
  14038. // Add which for key events
  14039. if ( event.which == null && rkeyEvent.test( event.type ) ) {
  14040. return event.charCode != null ? event.charCode : event.keyCode;
  14041. }
  14042. // Add which for click: 1 === left; 2 === middle; 3 === right
  14043. if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) {
  14044. if ( button & 1 ) {
  14045. return 1;
  14046. }
  14047. if ( button & 2 ) {
  14048. return 3;
  14049. }
  14050. if ( button & 4 ) {
  14051. return 2;
  14052. }
  14053. return 0;
  14054. }
  14055. return event.which;
  14056. }
  14057. }, jQuery.event.addProp );
  14058. jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) {
  14059. jQuery.event.special[ type ] = {
  14060. // Utilize native event if possible so blur/focus sequence is correct
  14061. setup: function() {
  14062. // Claim the first handler
  14063. // dataPriv.set( this, "focus", ... )
  14064. // dataPriv.set( this, "blur", ... )
  14065. leverageNative( this, type, expectSync );
  14066. // Return false to allow normal processing in the caller
  14067. return false;
  14068. },
  14069. trigger: function() {
  14070. // Force setup before trigger
  14071. leverageNative( this, type );
  14072. // Return non-false to allow normal event-path propagation
  14073. return true;
  14074. },
  14075. delegateType: delegateType
  14076. };
  14077. } );
  14078. // Create mouseenter/leave events using mouseover/out and event-time checks
  14079. // so that event delegation works in jQuery.
  14080. // Do the same for pointerenter/pointerleave and pointerover/pointerout
  14081. //
  14082. // Support: Safari 7 only
  14083. // Safari sends mouseenter too often; see:
  14084. // https://bugs.chromium.org/p/chromium/issues/detail?id=470258
  14085. // for the description of the bug (it existed in older Chrome versions as well).
  14086. jQuery.each( {
  14087. mouseenter: "mouseover",
  14088. mouseleave: "mouseout",
  14089. pointerenter: "pointerover",
  14090. pointerleave: "pointerout"
  14091. }, function( orig, fix ) {
  14092. jQuery.event.special[ orig ] = {
  14093. delegateType: fix,
  14094. bindType: fix,
  14095. handle: function( event ) {
  14096. var ret,
  14097. target = this,
  14098. related = event.relatedTarget,
  14099. handleObj = event.handleObj;
  14100. // For mouseenter/leave call the handler if related is outside the target.
  14101. // NB: No relatedTarget if the mouse left/entered the browser window
  14102. if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {
  14103. event.type = handleObj.origType;
  14104. ret = handleObj.handler.apply( this, arguments );
  14105. event.type = fix;
  14106. }
  14107. return ret;
  14108. }
  14109. };
  14110. } );
  14111. jQuery.fn.extend( {
  14112. on: function( types, selector, data, fn ) {
  14113. return on( this, types, selector, data, fn );
  14114. },
  14115. one: function( types, selector, data, fn ) {
  14116. return on( this, types, selector, data, fn, 1 );
  14117. },
  14118. off: function( types, selector, fn ) {
  14119. var handleObj, type;
  14120. if ( types && types.preventDefault && types.handleObj ) {
  14121. // ( event ) dispatched jQuery.Event
  14122. handleObj = types.handleObj;
  14123. jQuery( types.delegateTarget ).off(
  14124. handleObj.namespace ?
  14125. handleObj.origType + "." + handleObj.namespace :
  14126. handleObj.origType,
  14127. handleObj.selector,
  14128. handleObj.handler
  14129. );
  14130. return this;
  14131. }
  14132. if ( typeof types === "object" ) {
  14133. // ( types-object [, selector] )
  14134. for ( type in types ) {
  14135. this.off( type, selector, types[ type ] );
  14136. }
  14137. return this;
  14138. }
  14139. if ( selector === false || typeof selector === "function" ) {
  14140. // ( types [, fn] )
  14141. fn = selector;
  14142. selector = undefined;
  14143. }
  14144. if ( fn === false ) {
  14145. fn = returnFalse;
  14146. }
  14147. return this.each( function() {
  14148. jQuery.event.remove( this, types, fn, selector );
  14149. } );
  14150. }
  14151. } );
  14152. var
  14153. /* eslint-disable max-len */
  14154. // See https://github.com/eslint/eslint/issues/3229
  14155. rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,
  14156. /* eslint-enable */
  14157. // Support: IE <=10 - 11, Edge 12 - 13 only
  14158. // In IE/Edge using regex groups here causes severe slowdowns.
  14159. // See https://connect.microsoft.com/IE/feedback/details/1736512/
  14160. rnoInnerhtml = /<script|<style|<link/i,
  14161. // checked="checked" or checked
  14162. rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
  14163. rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
  14164. // Prefer a tbody over its parent table for containing new rows
  14165. function manipulationTarget( elem, content ) {
  14166. if ( nodeName( elem, "table" ) &&
  14167. nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) {
  14168. return jQuery( elem ).children( "tbody" )[ 0 ] || elem;
  14169. }
  14170. return elem;
  14171. }
  14172. // Replace/restore the type attribute of script elements for safe DOM manipulation
  14173. function disableScript( elem ) {
  14174. elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type;
  14175. return elem;
  14176. }
  14177. function restoreScript( elem ) {
  14178. if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) {
  14179. elem.type = elem.type.slice( 5 );
  14180. } else {
  14181. elem.removeAttribute( "type" );
  14182. }
  14183. return elem;
  14184. }
  14185. function cloneCopyEvent( src, dest ) {
  14186. var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;
  14187. if ( dest.nodeType !== 1 ) {
  14188. return;
  14189. }
  14190. // 1. Copy private data: events, handlers, etc.
  14191. if ( dataPriv.hasData( src ) ) {
  14192. pdataOld = dataPriv.access( src );
  14193. pdataCur = dataPriv.set( dest, pdataOld );
  14194. events = pdataOld.events;
  14195. if ( events ) {
  14196. delete pdataCur.handle;
  14197. pdataCur.events = {};
  14198. for ( type in events ) {
  14199. for ( i = 0, l = events[ type ].length; i < l; i++ ) {
  14200. jQuery.event.add( dest, type, events[ type ][ i ] );
  14201. }
  14202. }
  14203. }
  14204. }
  14205. // 2. Copy user data
  14206. if ( dataUser.hasData( src ) ) {
  14207. udataOld = dataUser.access( src );
  14208. udataCur = jQuery.extend( {}, udataOld );
  14209. dataUser.set( dest, udataCur );
  14210. }
  14211. }
  14212. // Fix IE bugs, see support tests
  14213. function fixInput( src, dest ) {
  14214. var nodeName = dest.nodeName.toLowerCase();
  14215. // Fails to persist the checked state of a cloned checkbox or radio button.
  14216. if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
  14217. dest.checked = src.checked;
  14218. // Fails to return the selected option to the default selected state when cloning options
  14219. } else if ( nodeName === "input" || nodeName === "textarea" ) {
  14220. dest.defaultValue = src.defaultValue;
  14221. }
  14222. }
  14223. function domManip( collection, args, callback, ignored ) {
  14224. // Flatten any nested arrays
  14225. args = concat.apply( [], args );
  14226. var fragment, first, scripts, hasScripts, node, doc,
  14227. i = 0,
  14228. l = collection.length,
  14229. iNoClone = l - 1,
  14230. value = args[ 0 ],
  14231. valueIsFunction = isFunction( value );
  14232. // We can't cloneNode fragments that contain checked, in WebKit
  14233. if ( valueIsFunction ||
  14234. ( l > 1 && typeof value === "string" &&
  14235. !support.checkClone && rchecked.test( value ) ) ) {
  14236. return collection.each( function( index ) {
  14237. var self = collection.eq( index );
  14238. if ( valueIsFunction ) {
  14239. args[ 0 ] = value.call( this, index, self.html() );
  14240. }
  14241. domManip( self, args, callback, ignored );
  14242. } );
  14243. }
  14244. if ( l ) {
  14245. fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );
  14246. first = fragment.firstChild;
  14247. if ( fragment.childNodes.length === 1 ) {
  14248. fragment = first;
  14249. }
  14250. // Require either new content or an interest in ignored elements to invoke the callback
  14251. if ( first || ignored ) {
  14252. scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
  14253. hasScripts = scripts.length;
  14254. // Use the original fragment for the last item
  14255. // instead of the first because it can end up
  14256. // being emptied incorrectly in certain situations (#8070).
  14257. for ( ; i < l; i++ ) {
  14258. node = fragment;
  14259. if ( i !== iNoClone ) {
  14260. node = jQuery.clone( node, true, true );
  14261. // Keep references to cloned scripts for later restoration
  14262. if ( hasScripts ) {
  14263. // Support: Android <=4.0 only, PhantomJS 1 only
  14264. // push.apply(_, arraylike) throws on ancient WebKit
  14265. jQuery.merge( scripts, getAll( node, "script" ) );
  14266. }
  14267. }
  14268. callback.call( collection[ i ], node, i );
  14269. }
  14270. if ( hasScripts ) {
  14271. doc = scripts[ scripts.length - 1 ].ownerDocument;
  14272. // Reenable scripts
  14273. jQuery.map( scripts, restoreScript );
  14274. // Evaluate executable scripts on first document insertion
  14275. for ( i = 0; i < hasScripts; i++ ) {
  14276. node = scripts[ i ];
  14277. if ( rscriptType.test( node.type || "" ) &&
  14278. !dataPriv.access( node, "globalEval" ) &&
  14279. jQuery.contains( doc, node ) ) {
  14280. if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) {
  14281. // Optional AJAX dependency, but won't run scripts if not present
  14282. if ( jQuery._evalUrl && !node.noModule ) {
  14283. jQuery._evalUrl( node.src, {
  14284. nonce: node.nonce || node.getAttribute( "nonce" )
  14285. } );
  14286. }
  14287. } else {
  14288. DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc );
  14289. }
  14290. }
  14291. }
  14292. }
  14293. }
  14294. }
  14295. return collection;
  14296. }
  14297. function remove( elem, selector, keepData ) {
  14298. var node,
  14299. nodes = selector ? jQuery.filter( selector, elem ) : elem,
  14300. i = 0;
  14301. for ( ; ( node = nodes[ i ] ) != null; i++ ) {
  14302. if ( !keepData && node.nodeType === 1 ) {
  14303. jQuery.cleanData( getAll( node ) );
  14304. }
  14305. if ( node.parentNode ) {
  14306. if ( keepData && isAttached( node ) ) {
  14307. setGlobalEval( getAll( node, "script" ) );
  14308. }
  14309. node.parentNode.removeChild( node );
  14310. }
  14311. }
  14312. return elem;
  14313. }
  14314. jQuery.extend( {
  14315. htmlPrefilter: function( html ) {
  14316. return html.replace( rxhtmlTag, "<$1></$2>" );
  14317. },
  14318. clone: function( elem, dataAndEvents, deepDataAndEvents ) {
  14319. var i, l, srcElements, destElements,
  14320. clone = elem.cloneNode( true ),
  14321. inPage = isAttached( elem );
  14322. // Fix IE cloning issues
  14323. if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
  14324. !jQuery.isXMLDoc( elem ) ) {
  14325. // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2
  14326. destElements = getAll( clone );
  14327. srcElements = getAll( elem );
  14328. for ( i = 0, l = srcElements.length; i < l; i++ ) {
  14329. fixInput( srcElements[ i ], destElements[ i ] );
  14330. }
  14331. }
  14332. // Copy the events from the original to the clone
  14333. if ( dataAndEvents ) {
  14334. if ( deepDataAndEvents ) {
  14335. srcElements = srcElements || getAll( elem );
  14336. destElements = destElements || getAll( clone );
  14337. for ( i = 0, l = srcElements.length; i < l; i++ ) {
  14338. cloneCopyEvent( srcElements[ i ], destElements[ i ] );
  14339. }
  14340. } else {
  14341. cloneCopyEvent( elem, clone );
  14342. }
  14343. }
  14344. // Preserve script evaluation history
  14345. destElements = getAll( clone, "script" );
  14346. if ( destElements.length > 0 ) {
  14347. setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
  14348. }
  14349. // Return the cloned set
  14350. return clone;
  14351. },
  14352. cleanData: function( elems ) {
  14353. var data, elem, type,
  14354. special = jQuery.event.special,
  14355. i = 0;
  14356. for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {
  14357. if ( acceptData( elem ) ) {
  14358. if ( ( data = elem[ dataPriv.expando ] ) ) {
  14359. if ( data.events ) {
  14360. for ( type in data.events ) {
  14361. if ( special[ type ] ) {
  14362. jQuery.event.remove( elem, type );
  14363. // This is a shortcut to avoid jQuery.event.remove's overhead
  14364. } else {
  14365. jQuery.removeEvent( elem, type, data.handle );
  14366. }
  14367. }
  14368. }
  14369. // Support: Chrome <=35 - 45+
  14370. // Assign undefined instead of using delete, see Data#remove
  14371. elem[ dataPriv.expando ] = undefined;
  14372. }
  14373. if ( elem[ dataUser.expando ] ) {
  14374. // Support: Chrome <=35 - 45+
  14375. // Assign undefined instead of using delete, see Data#remove
  14376. elem[ dataUser.expando ] = undefined;
  14377. }
  14378. }
  14379. }
  14380. }
  14381. } );
  14382. jQuery.fn.extend( {
  14383. detach: function( selector ) {
  14384. return remove( this, selector, true );
  14385. },
  14386. remove: function( selector ) {
  14387. return remove( this, selector );
  14388. },
  14389. text: function( value ) {
  14390. return access( this, function( value ) {
  14391. return value === undefined ?
  14392. jQuery.text( this ) :
  14393. this.empty().each( function() {
  14394. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  14395. this.textContent = value;
  14396. }
  14397. } );
  14398. }, null, value, arguments.length );
  14399. },
  14400. append: function() {
  14401. return domManip( this, arguments, function( elem ) {
  14402. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  14403. var target = manipulationTarget( this, elem );
  14404. target.appendChild( elem );
  14405. }
  14406. } );
  14407. },
  14408. prepend: function() {
  14409. return domManip( this, arguments, function( elem ) {
  14410. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  14411. var target = manipulationTarget( this, elem );
  14412. target.insertBefore( elem, target.firstChild );
  14413. }
  14414. } );
  14415. },
  14416. before: function() {
  14417. return domManip( this, arguments, function( elem ) {
  14418. if ( this.parentNode ) {
  14419. this.parentNode.insertBefore( elem, this );
  14420. }
  14421. } );
  14422. },
  14423. after: function() {
  14424. return domManip( this, arguments, function( elem ) {
  14425. if ( this.parentNode ) {
  14426. this.parentNode.insertBefore( elem, this.nextSibling );
  14427. }
  14428. } );
  14429. },
  14430. empty: function() {
  14431. var elem,
  14432. i = 0;
  14433. for ( ; ( elem = this[ i ] ) != null; i++ ) {
  14434. if ( elem.nodeType === 1 ) {
  14435. // Prevent memory leaks
  14436. jQuery.cleanData( getAll( elem, false ) );
  14437. // Remove any remaining nodes
  14438. elem.textContent = "";
  14439. }
  14440. }
  14441. return this;
  14442. },
  14443. clone: function( dataAndEvents, deepDataAndEvents ) {
  14444. dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
  14445. deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
  14446. return this.map( function() {
  14447. return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
  14448. } );
  14449. },
  14450. html: function( value ) {
  14451. return access( this, function( value ) {
  14452. var elem = this[ 0 ] || {},
  14453. i = 0,
  14454. l = this.length;
  14455. if ( value === undefined && elem.nodeType === 1 ) {
  14456. return elem.innerHTML;
  14457. }
  14458. // See if we can take a shortcut and just use innerHTML
  14459. if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
  14460. !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
  14461. value = jQuery.htmlPrefilter( value );
  14462. try {
  14463. for ( ; i < l; i++ ) {
  14464. elem = this[ i ] || {};
  14465. // Remove element nodes and prevent memory leaks
  14466. if ( elem.nodeType === 1 ) {
  14467. jQuery.cleanData( getAll( elem, false ) );
  14468. elem.innerHTML = value;
  14469. }
  14470. }
  14471. elem = 0;
  14472. // If using innerHTML throws an exception, use the fallback method
  14473. } catch ( e ) {}
  14474. }
  14475. if ( elem ) {
  14476. this.empty().append( value );
  14477. }
  14478. }, null, value, arguments.length );
  14479. },
  14480. replaceWith: function() {
  14481. var ignored = [];
  14482. // Make the changes, replacing each non-ignored context element with the new content
  14483. return domManip( this, arguments, function( elem ) {
  14484. var parent = this.parentNode;
  14485. if ( jQuery.inArray( this, ignored ) < 0 ) {
  14486. jQuery.cleanData( getAll( this ) );
  14487. if ( parent ) {
  14488. parent.replaceChild( elem, this );
  14489. }
  14490. }
  14491. // Force callback invocation
  14492. }, ignored );
  14493. }
  14494. } );
  14495. jQuery.each( {
  14496. appendTo: "append",
  14497. prependTo: "prepend",
  14498. insertBefore: "before",
  14499. insertAfter: "after",
  14500. replaceAll: "replaceWith"
  14501. }, function( name, original ) {
  14502. jQuery.fn[ name ] = function( selector ) {
  14503. var elems,
  14504. ret = [],
  14505. insert = jQuery( selector ),
  14506. last = insert.length - 1,
  14507. i = 0;
  14508. for ( ; i <= last; i++ ) {
  14509. elems = i === last ? this : this.clone( true );
  14510. jQuery( insert[ i ] )[ original ]( elems );
  14511. // Support: Android <=4.0 only, PhantomJS 1 only
  14512. // .get() because push.apply(_, arraylike) throws on ancient WebKit
  14513. push.apply( ret, elems.get() );
  14514. }
  14515. return this.pushStack( ret );
  14516. };
  14517. } );
  14518. var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
  14519. var getStyles = function( elem ) {
  14520. // Support: IE <=11 only, Firefox <=30 (#15098, #14150)
  14521. // IE throws on elements created in popups
  14522. // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
  14523. var view = elem.ownerDocument.defaultView;
  14524. if ( !view || !view.opener ) {
  14525. view = window;
  14526. }
  14527. return view.getComputedStyle( elem );
  14528. };
  14529. var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
  14530. ( function() {
  14531. // Executing both pixelPosition & boxSizingReliable tests require only one layout
  14532. // so they're executed at the same time to save the second computation.
  14533. function computeStyleTests() {
  14534. // This is a singleton, we need to execute it only once
  14535. if ( !div ) {
  14536. return;
  14537. }
  14538. container.style.cssText = "position:absolute;left:-11111px;width:60px;" +
  14539. "margin-top:1px;padding:0;border:0";
  14540. div.style.cssText =
  14541. "position:relative;display:block;box-sizing:border-box;overflow:scroll;" +
  14542. "margin:auto;border:1px;padding:1px;" +
  14543. "width:60%;top:1%";
  14544. documentElement.appendChild( container ).appendChild( div );
  14545. var divStyle = window.getComputedStyle( div );
  14546. pixelPositionVal = divStyle.top !== "1%";
  14547. // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44
  14548. reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;
  14549. // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3
  14550. // Some styles come back with percentage values, even though they shouldn't
  14551. div.style.right = "60%";
  14552. pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;
  14553. // Support: IE 9 - 11 only
  14554. // Detect misreporting of content dimensions for box-sizing:border-box elements
  14555. boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;
  14556. // Support: IE 9 only
  14557. // Detect overflow:scroll screwiness (gh-3699)
  14558. // Support: Chrome <=64
  14559. // Don't get tricked when zoom affects offsetWidth (gh-4029)
  14560. div.style.position = "absolute";
  14561. scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;
  14562. documentElement.removeChild( container );
  14563. // Nullify the div so it wouldn't be stored in the memory and
  14564. // it will also be a sign that checks already performed
  14565. div = null;
  14566. }
  14567. function roundPixelMeasures( measure ) {
  14568. return Math.round( parseFloat( measure ) );
  14569. }
  14570. var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal,
  14571. reliableMarginLeftVal,
  14572. container = document.createElement( "div" ),
  14573. div = document.createElement( "div" );
  14574. // Finish early in limited (non-browser) environments
  14575. if ( !div.style ) {
  14576. return;
  14577. }
  14578. // Support: IE <=9 - 11 only
  14579. // Style of cloned element affects source element cloned (#8908)
  14580. div.style.backgroundClip = "content-box";
  14581. div.cloneNode( true ).style.backgroundClip = "";
  14582. support.clearCloneStyle = div.style.backgroundClip === "content-box";
  14583. jQuery.extend( support, {
  14584. boxSizingReliable: function() {
  14585. computeStyleTests();
  14586. return boxSizingReliableVal;
  14587. },
  14588. pixelBoxStyles: function() {
  14589. computeStyleTests();
  14590. return pixelBoxStylesVal;
  14591. },
  14592. pixelPosition: function() {
  14593. computeStyleTests();
  14594. return pixelPositionVal;
  14595. },
  14596. reliableMarginLeft: function() {
  14597. computeStyleTests();
  14598. return reliableMarginLeftVal;
  14599. },
  14600. scrollboxSize: function() {
  14601. computeStyleTests();
  14602. return scrollboxSizeVal;
  14603. }
  14604. } );
  14605. } )();
  14606. function curCSS( elem, name, computed ) {
  14607. var width, minWidth, maxWidth, ret,
  14608. // Support: Firefox 51+
  14609. // Retrieving style before computed somehow
  14610. // fixes an issue with getting wrong values
  14611. // on detached elements
  14612. style = elem.style;
  14613. computed = computed || getStyles( elem );
  14614. // getPropertyValue is needed for:
  14615. // .css('filter') (IE 9 only, #12537)
  14616. // .css('--customProperty) (#3144)
  14617. if ( computed ) {
  14618. ret = computed.getPropertyValue( name ) || computed[ name ];
  14619. if ( ret === "" && !isAttached( elem ) ) {
  14620. ret = jQuery.style( elem, name );
  14621. }
  14622. // A tribute to the "awesome hack by Dean Edwards"
  14623. // Android Browser returns percentage for some values,
  14624. // but width seems to be reliably pixels.
  14625. // This is against the CSSOM draft spec:
  14626. // https://drafts.csswg.org/cssom/#resolved-values
  14627. if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) {
  14628. // Remember the original values
  14629. width = style.width;
  14630. minWidth = style.minWidth;
  14631. maxWidth = style.maxWidth;
  14632. // Put in the new values to get a computed value out
  14633. style.minWidth = style.maxWidth = style.width = ret;
  14634. ret = computed.width;
  14635. // Revert the changed values
  14636. style.width = width;
  14637. style.minWidth = minWidth;
  14638. style.maxWidth = maxWidth;
  14639. }
  14640. }
  14641. return ret !== undefined ?
  14642. // Support: IE <=9 - 11 only
  14643. // IE returns zIndex value as an integer.
  14644. ret + "" :
  14645. ret;
  14646. }
  14647. function addGetHookIf( conditionFn, hookFn ) {
  14648. // Define the hook, we'll check on the first run if it's really needed.
  14649. return {
  14650. get: function() {
  14651. if ( conditionFn() ) {
  14652. // Hook not needed (or it's not possible to use it due
  14653. // to missing dependency), remove it.
  14654. delete this.get;
  14655. return;
  14656. }
  14657. // Hook needed; redefine it so that the support test is not executed again.
  14658. return ( this.get = hookFn ).apply( this, arguments );
  14659. }
  14660. };
  14661. }
  14662. var cssPrefixes = [ "Webkit", "Moz", "ms" ],
  14663. emptyStyle = document.createElement( "div" ).style,
  14664. vendorProps = {};
  14665. // Return a vendor-prefixed property or undefined
  14666. function vendorPropName( name ) {
  14667. // Check for vendor prefixed names
  14668. var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),
  14669. i = cssPrefixes.length;
  14670. while ( i-- ) {
  14671. name = cssPrefixes[ i ] + capName;
  14672. if ( name in emptyStyle ) {
  14673. return name;
  14674. }
  14675. }
  14676. }
  14677. // Return a potentially-mapped jQuery.cssProps or vendor prefixed property
  14678. function finalPropName( name ) {
  14679. var final = jQuery.cssProps[ name ] || vendorProps[ name ];
  14680. if ( final ) {
  14681. return final;
  14682. }
  14683. if ( name in emptyStyle ) {
  14684. return name;
  14685. }
  14686. return vendorProps[ name ] = vendorPropName( name ) || name;
  14687. }
  14688. var
  14689. // Swappable if display is none or starts with table
  14690. // except "table", "table-cell", or "table-caption"
  14691. // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
  14692. rdisplayswap = /^(none|table(?!-c[ea]).+)/,
  14693. rcustomProp = /^--/,
  14694. cssShow = { position: "absolute", visibility: "hidden", display: "block" },
  14695. cssNormalTransform = {
  14696. letterSpacing: "0",
  14697. fontWeight: "400"
  14698. };
  14699. function setPositiveNumber( elem, value, subtract ) {
  14700. // Any relative (+/-) values have already been
  14701. // normalized at this point
  14702. var matches = rcssNum.exec( value );
  14703. return matches ?
  14704. // Guard against undefined "subtract", e.g., when used as in cssHooks
  14705. Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) :
  14706. value;
  14707. }
  14708. function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) {
  14709. var i = dimension === "width" ? 1 : 0,
  14710. extra = 0,
  14711. delta = 0;
  14712. // Adjustment may not be necessary
  14713. if ( box === ( isBorderBox ? "border" : "content" ) ) {
  14714. return 0;
  14715. }
  14716. for ( ; i < 4; i += 2 ) {
  14717. // Both box models exclude margin
  14718. if ( box === "margin" ) {
  14719. delta += jQuery.css( elem, box + cssExpand[ i ], true, styles );
  14720. }
  14721. // If we get here with a content-box, we're seeking "padding" or "border" or "margin"
  14722. if ( !isBorderBox ) {
  14723. // Add padding
  14724. delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
  14725. // For "border" or "margin", add border
  14726. if ( box !== "padding" ) {
  14727. delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  14728. // But still keep track of it otherwise
  14729. } else {
  14730. extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  14731. }
  14732. // If we get here with a border-box (content + padding + border), we're seeking "content" or
  14733. // "padding" or "margin"
  14734. } else {
  14735. // For "content", subtract padding
  14736. if ( box === "content" ) {
  14737. delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
  14738. }
  14739. // For "content" or "padding", subtract border
  14740. if ( box !== "margin" ) {
  14741. delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  14742. }
  14743. }
  14744. }
  14745. // Account for positive content-box scroll gutter when requested by providing computedVal
  14746. if ( !isBorderBox && computedVal >= 0 ) {
  14747. // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border
  14748. // Assuming integer scroll gutter, subtract the rest and round down
  14749. delta += Math.max( 0, Math.ceil(
  14750. elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -
  14751. computedVal -
  14752. delta -
  14753. extra -
  14754. 0.5
  14755. // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter
  14756. // Use an explicit zero to avoid NaN (gh-3964)
  14757. ) ) || 0;
  14758. }
  14759. return delta;
  14760. }
  14761. function getWidthOrHeight( elem, dimension, extra ) {
  14762. // Start with computed style
  14763. var styles = getStyles( elem ),
  14764. // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322).
  14765. // Fake content-box until we know it's needed to know the true value.
  14766. boxSizingNeeded = !support.boxSizingReliable() || extra,
  14767. isBorderBox = boxSizingNeeded &&
  14768. jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
  14769. valueIsBorderBox = isBorderBox,
  14770. val = curCSS( elem, dimension, styles ),
  14771. offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 );
  14772. // Support: Firefox <=54
  14773. // Return a confounding non-pixel value or feign ignorance, as appropriate.
  14774. if ( rnumnonpx.test( val ) ) {
  14775. if ( !extra ) {
  14776. return val;
  14777. }
  14778. val = "auto";
  14779. }
  14780. // Fall back to offsetWidth/offsetHeight when value is "auto"
  14781. // This happens for inline elements with no explicit setting (gh-3571)
  14782. // Support: Android <=4.1 - 4.3 only
  14783. // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602)
  14784. // Support: IE 9-11 only
  14785. // Also use offsetWidth/offsetHeight for when box sizing is unreliable
  14786. // We use getClientRects() to check for hidden/disconnected.
  14787. // In those cases, the computed value can be trusted to be border-box
  14788. if ( ( !support.boxSizingReliable() && isBorderBox ||
  14789. val === "auto" ||
  14790. !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) &&
  14791. elem.getClientRects().length ) {
  14792. isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
  14793. // Where available, offsetWidth/offsetHeight approximate border box dimensions.
  14794. // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the
  14795. // retrieved value as a content box dimension.
  14796. valueIsBorderBox = offsetProp in elem;
  14797. if ( valueIsBorderBox ) {
  14798. val = elem[ offsetProp ];
  14799. }
  14800. }
  14801. // Normalize "" and auto
  14802. val = parseFloat( val ) || 0;
  14803. // Adjust for the element's box model
  14804. return ( val +
  14805. boxModelAdjustment(
  14806. elem,
  14807. dimension,
  14808. extra || ( isBorderBox ? "border" : "content" ),
  14809. valueIsBorderBox,
  14810. styles,
  14811. // Provide the current computed size to request scroll gutter calculation (gh-3589)
  14812. val
  14813. )
  14814. ) + "px";
  14815. }
  14816. jQuery.extend( {
  14817. // Add in style property hooks for overriding the default
  14818. // behavior of getting and setting a style property
  14819. cssHooks: {
  14820. opacity: {
  14821. get: function( elem, computed ) {
  14822. if ( computed ) {
  14823. // We should always get a number back from opacity
  14824. var ret = curCSS( elem, "opacity" );
  14825. return ret === "" ? "1" : ret;
  14826. }
  14827. }
  14828. }
  14829. },
  14830. // Don't automatically add "px" to these possibly-unitless properties
  14831. cssNumber: {
  14832. "animationIterationCount": true,
  14833. "columnCount": true,
  14834. "fillOpacity": true,
  14835. "flexGrow": true,
  14836. "flexShrink": true,
  14837. "fontWeight": true,
  14838. "gridArea": true,
  14839. "gridColumn": true,
  14840. "gridColumnEnd": true,
  14841. "gridColumnStart": true,
  14842. "gridRow": true,
  14843. "gridRowEnd": true,
  14844. "gridRowStart": true,
  14845. "lineHeight": true,
  14846. "opacity": true,
  14847. "order": true,
  14848. "orphans": true,
  14849. "widows": true,
  14850. "zIndex": true,
  14851. "zoom": true
  14852. },
  14853. // Add in properties whose names you wish to fix before
  14854. // setting or getting the value
  14855. cssProps: {},
  14856. // Get and set the style property on a DOM Node
  14857. style: function( elem, name, value, extra ) {
  14858. // Don't set styles on text and comment nodes
  14859. if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
  14860. return;
  14861. }
  14862. // Make sure that we're working with the right name
  14863. var ret, type, hooks,
  14864. origName = camelCase( name ),
  14865. isCustomProp = rcustomProp.test( name ),
  14866. style = elem.style;
  14867. // Make sure that we're working with the right name. We don't
  14868. // want to query the value if it is a CSS custom property
  14869. // since they are user-defined.
  14870. if ( !isCustomProp ) {
  14871. name = finalPropName( origName );
  14872. }
  14873. // Gets hook for the prefixed version, then unprefixed version
  14874. hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
  14875. // Check if we're setting a value
  14876. if ( value !== undefined ) {
  14877. type = typeof value;
  14878. // Convert "+=" or "-=" to relative numbers (#7345)
  14879. if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {
  14880. value = adjustCSS( elem, name, ret );
  14881. // Fixes bug #9237
  14882. type = "number";
  14883. }
  14884. // Make sure that null and NaN values aren't set (#7116)
  14885. if ( value == null || value !== value ) {
  14886. return;
  14887. }
  14888. // If a number was passed in, add the unit (except for certain CSS properties)
  14889. // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append
  14890. // "px" to a few hardcoded values.
  14891. if ( type === "number" && !isCustomProp ) {
  14892. value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" );
  14893. }
  14894. // background-* props affect original clone's values
  14895. if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
  14896. style[ name ] = "inherit";
  14897. }
  14898. // If a hook was provided, use that value, otherwise just set the specified value
  14899. if ( !hooks || !( "set" in hooks ) ||
  14900. ( value = hooks.set( elem, value, extra ) ) !== undefined ) {
  14901. if ( isCustomProp ) {
  14902. style.setProperty( name, value );
  14903. } else {
  14904. style[ name ] = value;
  14905. }
  14906. }
  14907. } else {
  14908. // If a hook was provided get the non-computed value from there
  14909. if ( hooks && "get" in hooks &&
  14910. ( ret = hooks.get( elem, false, extra ) ) !== undefined ) {
  14911. return ret;
  14912. }
  14913. // Otherwise just get the value from the style object
  14914. return style[ name ];
  14915. }
  14916. },
  14917. css: function( elem, name, extra, styles ) {
  14918. var val, num, hooks,
  14919. origName = camelCase( name ),
  14920. isCustomProp = rcustomProp.test( name );
  14921. // Make sure that we're working with the right name. We don't
  14922. // want to modify the value if it is a CSS custom property
  14923. // since they are user-defined.
  14924. if ( !isCustomProp ) {
  14925. name = finalPropName( origName );
  14926. }
  14927. // Try prefixed name followed by the unprefixed name
  14928. hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
  14929. // If a hook was provided get the computed value from there
  14930. if ( hooks && "get" in hooks ) {
  14931. val = hooks.get( elem, true, extra );
  14932. }
  14933. // Otherwise, if a way to get the computed value exists, use that
  14934. if ( val === undefined ) {
  14935. val = curCSS( elem, name, styles );
  14936. }
  14937. // Convert "normal" to computed value
  14938. if ( val === "normal" && name in cssNormalTransform ) {
  14939. val = cssNormalTransform[ name ];
  14940. }
  14941. // Make numeric if forced or a qualifier was provided and val looks numeric
  14942. if ( extra === "" || extra ) {
  14943. num = parseFloat( val );
  14944. return extra === true || isFinite( num ) ? num || 0 : val;
  14945. }
  14946. return val;
  14947. }
  14948. } );
  14949. jQuery.each( [ "height", "width" ], function( i, dimension ) {
  14950. jQuery.cssHooks[ dimension ] = {
  14951. get: function( elem, computed, extra ) {
  14952. if ( computed ) {
  14953. // Certain elements can have dimension info if we invisibly show them
  14954. // but it must have a current display style that would benefit
  14955. return rdisplayswap.test( jQuery.css( elem, "display" ) ) &&
  14956. // Support: Safari 8+
  14957. // Table columns in Safari have non-zero offsetWidth & zero
  14958. // getBoundingClientRect().width unless display is changed.
  14959. // Support: IE <=11 only
  14960. // Running getBoundingClientRect on a disconnected node
  14961. // in IE throws an error.
  14962. ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?
  14963. swap( elem, cssShow, function() {
  14964. return getWidthOrHeight( elem, dimension, extra );
  14965. } ) :
  14966. getWidthOrHeight( elem, dimension, extra );
  14967. }
  14968. },
  14969. set: function( elem, value, extra ) {
  14970. var matches,
  14971. styles = getStyles( elem ),
  14972. // Only read styles.position if the test has a chance to fail
  14973. // to avoid forcing a reflow.
  14974. scrollboxSizeBuggy = !support.scrollboxSize() &&
  14975. styles.position === "absolute",
  14976. // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991)
  14977. boxSizingNeeded = scrollboxSizeBuggy || extra,
  14978. isBorderBox = boxSizingNeeded &&
  14979. jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
  14980. subtract = extra ?
  14981. boxModelAdjustment(
  14982. elem,
  14983. dimension,
  14984. extra,
  14985. isBorderBox,
  14986. styles
  14987. ) :
  14988. 0;
  14989. // Account for unreliable border-box dimensions by comparing offset* to computed and
  14990. // faking a content-box to get border and padding (gh-3699)
  14991. if ( isBorderBox && scrollboxSizeBuggy ) {
  14992. subtract -= Math.ceil(
  14993. elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -
  14994. parseFloat( styles[ dimension ] ) -
  14995. boxModelAdjustment( elem, dimension, "border", false, styles ) -
  14996. 0.5
  14997. );
  14998. }
  14999. // Convert to pixels if value adjustment is needed
  15000. if ( subtract && ( matches = rcssNum.exec( value ) ) &&
  15001. ( matches[ 3 ] || "px" ) !== "px" ) {
  15002. elem.style[ dimension ] = value;
  15003. value = jQuery.css( elem, dimension );
  15004. }
  15005. return setPositiveNumber( elem, value, subtract );
  15006. }
  15007. };
  15008. } );
  15009. jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,
  15010. function( elem, computed ) {
  15011. if ( computed ) {
  15012. return ( parseFloat( curCSS( elem, "marginLeft" ) ) ||
  15013. elem.getBoundingClientRect().left -
  15014. swap( elem, { marginLeft: 0 }, function() {
  15015. return elem.getBoundingClientRect().left;
  15016. } )
  15017. ) + "px";
  15018. }
  15019. }
  15020. );
  15021. // These hooks are used by animate to expand properties
  15022. jQuery.each( {
  15023. margin: "",
  15024. padding: "",
  15025. border: "Width"
  15026. }, function( prefix, suffix ) {
  15027. jQuery.cssHooks[ prefix + suffix ] = {
  15028. expand: function( value ) {
  15029. var i = 0,
  15030. expanded = {},
  15031. // Assumes a single number if not a string
  15032. parts = typeof value === "string" ? value.split( " " ) : [ value ];
  15033. for ( ; i < 4; i++ ) {
  15034. expanded[ prefix + cssExpand[ i ] + suffix ] =
  15035. parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
  15036. }
  15037. return expanded;
  15038. }
  15039. };
  15040. if ( prefix !== "margin" ) {
  15041. jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
  15042. }
  15043. } );
  15044. jQuery.fn.extend( {
  15045. css: function( name, value ) {
  15046. return access( this, function( elem, name, value ) {
  15047. var styles, len,
  15048. map = {},
  15049. i = 0;
  15050. if ( Array.isArray( name ) ) {
  15051. styles = getStyles( elem );
  15052. len = name.length;
  15053. for ( ; i < len; i++ ) {
  15054. map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
  15055. }
  15056. return map;
  15057. }
  15058. return value !== undefined ?
  15059. jQuery.style( elem, name, value ) :
  15060. jQuery.css( elem, name );
  15061. }, name, value, arguments.length > 1 );
  15062. }
  15063. } );
  15064. function Tween( elem, options, prop, end, easing ) {
  15065. return new Tween.prototype.init( elem, options, prop, end, easing );
  15066. }
  15067. jQuery.Tween = Tween;
  15068. Tween.prototype = {
  15069. constructor: Tween,
  15070. init: function( elem, options, prop, end, easing, unit ) {
  15071. this.elem = elem;
  15072. this.prop = prop;
  15073. this.easing = easing || jQuery.easing._default;
  15074. this.options = options;
  15075. this.start = this.now = this.cur();
  15076. this.end = end;
  15077. this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
  15078. },
  15079. cur: function() {
  15080. var hooks = Tween.propHooks[ this.prop ];
  15081. return hooks && hooks.get ?
  15082. hooks.get( this ) :
  15083. Tween.propHooks._default.get( this );
  15084. },
  15085. run: function( percent ) {
  15086. var eased,
  15087. hooks = Tween.propHooks[ this.prop ];
  15088. if ( this.options.duration ) {
  15089. this.pos = eased = jQuery.easing[ this.easing ](
  15090. percent, this.options.duration * percent, 0, 1, this.options.duration
  15091. );
  15092. } else {
  15093. this.pos = eased = percent;
  15094. }
  15095. this.now = ( this.end - this.start ) * eased + this.start;
  15096. if ( this.options.step ) {
  15097. this.options.step.call( this.elem, this.now, this );
  15098. }
  15099. if ( hooks && hooks.set ) {
  15100. hooks.set( this );
  15101. } else {
  15102. Tween.propHooks._default.set( this );
  15103. }
  15104. return this;
  15105. }
  15106. };
  15107. Tween.prototype.init.prototype = Tween.prototype;
  15108. Tween.propHooks = {
  15109. _default: {
  15110. get: function( tween ) {
  15111. var result;
  15112. // Use a property on the element directly when it is not a DOM element,
  15113. // or when there is no matching style property that exists.
  15114. if ( tween.elem.nodeType !== 1 ||
  15115. tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {
  15116. return tween.elem[ tween.prop ];
  15117. }
  15118. // Passing an empty string as a 3rd parameter to .css will automatically
  15119. // attempt a parseFloat and fallback to a string if the parse fails.
  15120. // Simple values such as "10px" are parsed to Float;
  15121. // complex values such as "rotate(1rad)" are returned as-is.
  15122. result = jQuery.css( tween.elem, tween.prop, "" );
  15123. // Empty strings, null, undefined and "auto" are converted to 0.
  15124. return !result || result === "auto" ? 0 : result;
  15125. },
  15126. set: function( tween ) {
  15127. // Use step hook for back compat.
  15128. // Use cssHook if its there.
  15129. // Use .style if available and use plain properties where available.
  15130. if ( jQuery.fx.step[ tween.prop ] ) {
  15131. jQuery.fx.step[ tween.prop ]( tween );
  15132. } else if ( tween.elem.nodeType === 1 && (
  15133. jQuery.cssHooks[ tween.prop ] ||
  15134. tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) {
  15135. jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
  15136. } else {
  15137. tween.elem[ tween.prop ] = tween.now;
  15138. }
  15139. }
  15140. }
  15141. };
  15142. // Support: IE <=9 only
  15143. // Panic based approach to setting things on disconnected nodes
  15144. Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
  15145. set: function( tween ) {
  15146. if ( tween.elem.nodeType && tween.elem.parentNode ) {
  15147. tween.elem[ tween.prop ] = tween.now;
  15148. }
  15149. }
  15150. };
  15151. jQuery.easing = {
  15152. linear: function( p ) {
  15153. return p;
  15154. },
  15155. swing: function( p ) {
  15156. return 0.5 - Math.cos( p * Math.PI ) / 2;
  15157. },
  15158. _default: "swing"
  15159. };
  15160. jQuery.fx = Tween.prototype.init;
  15161. // Back compat <1.8 extension point
  15162. jQuery.fx.step = {};
  15163. var
  15164. fxNow, inProgress,
  15165. rfxtypes = /^(?:toggle|show|hide)$/,
  15166. rrun = /queueHooks$/;
  15167. function schedule() {
  15168. if ( inProgress ) {
  15169. if ( document.hidden === false && window.requestAnimationFrame ) {
  15170. window.requestAnimationFrame( schedule );
  15171. } else {
  15172. window.setTimeout( schedule, jQuery.fx.interval );
  15173. }
  15174. jQuery.fx.tick();
  15175. }
  15176. }
  15177. // Animations created synchronously will run synchronously
  15178. function createFxNow() {
  15179. window.setTimeout( function() {
  15180. fxNow = undefined;
  15181. } );
  15182. return ( fxNow = Date.now() );
  15183. }
  15184. // Generate parameters to create a standard animation
  15185. function genFx( type, includeWidth ) {
  15186. var which,
  15187. i = 0,
  15188. attrs = { height: type };
  15189. // If we include width, step value is 1 to do all cssExpand values,
  15190. // otherwise step value is 2 to skip over Left and Right
  15191. includeWidth = includeWidth ? 1 : 0;
  15192. for ( ; i < 4; i += 2 - includeWidth ) {
  15193. which = cssExpand[ i ];
  15194. attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
  15195. }
  15196. if ( includeWidth ) {
  15197. attrs.opacity = attrs.width = type;
  15198. }
  15199. return attrs;
  15200. }
  15201. function createTween( value, prop, animation ) {
  15202. var tween,
  15203. collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ),
  15204. index = 0,
  15205. length = collection.length;
  15206. for ( ; index < length; index++ ) {
  15207. if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {
  15208. // We're done with this property
  15209. return tween;
  15210. }
  15211. }
  15212. }
  15213. function defaultPrefilter( elem, props, opts ) {
  15214. var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,
  15215. isBox = "width" in props || "height" in props,
  15216. anim = this,
  15217. orig = {},
  15218. style = elem.style,
  15219. hidden = elem.nodeType && isHiddenWithinTree( elem ),
  15220. dataShow = dataPriv.get( elem, "fxshow" );
  15221. // Queue-skipping animations hijack the fx hooks
  15222. if ( !opts.queue ) {
  15223. hooks = jQuery._queueHooks( elem, "fx" );
  15224. if ( hooks.unqueued == null ) {
  15225. hooks.unqueued = 0;
  15226. oldfire = hooks.empty.fire;
  15227. hooks.empty.fire = function() {
  15228. if ( !hooks.unqueued ) {
  15229. oldfire();
  15230. }
  15231. };
  15232. }
  15233. hooks.unqueued++;
  15234. anim.always( function() {
  15235. // Ensure the complete handler is called before this completes
  15236. anim.always( function() {
  15237. hooks.unqueued--;
  15238. if ( !jQuery.queue( elem, "fx" ).length ) {
  15239. hooks.empty.fire();
  15240. }
  15241. } );
  15242. } );
  15243. }
  15244. // Detect show/hide animations
  15245. for ( prop in props ) {
  15246. value = props[ prop ];
  15247. if ( rfxtypes.test( value ) ) {
  15248. delete props[ prop ];
  15249. toggle = toggle || value === "toggle";
  15250. if ( value === ( hidden ? "hide" : "show" ) ) {
  15251. // Pretend to be hidden if this is a "show" and
  15252. // there is still data from a stopped show/hide
  15253. if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
  15254. hidden = true;
  15255. // Ignore all other no-op show/hide data
  15256. } else {
  15257. continue;
  15258. }
  15259. }
  15260. orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
  15261. }
  15262. }
  15263. // Bail out if this is a no-op like .hide().hide()
  15264. propTween = !jQuery.isEmptyObject( props );
  15265. if ( !propTween && jQuery.isEmptyObject( orig ) ) {
  15266. return;
  15267. }
  15268. // Restrict "overflow" and "display" styles during box animations
  15269. if ( isBox && elem.nodeType === 1 ) {
  15270. // Support: IE <=9 - 11, Edge 12 - 15
  15271. // Record all 3 overflow attributes because IE does not infer the shorthand
  15272. // from identically-valued overflowX and overflowY and Edge just mirrors
  15273. // the overflowX value there.
  15274. opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
  15275. // Identify a display type, preferring old show/hide data over the CSS cascade
  15276. restoreDisplay = dataShow && dataShow.display;
  15277. if ( restoreDisplay == null ) {
  15278. restoreDisplay = dataPriv.get( elem, "display" );
  15279. }
  15280. display = jQuery.css( elem, "display" );
  15281. if ( display === "none" ) {
  15282. if ( restoreDisplay ) {
  15283. display = restoreDisplay;
  15284. } else {
  15285. // Get nonempty value(s) by temporarily forcing visibility
  15286. showHide( [ elem ], true );
  15287. restoreDisplay = elem.style.display || restoreDisplay;
  15288. display = jQuery.css( elem, "display" );
  15289. showHide( [ elem ] );
  15290. }
  15291. }
  15292. // Animate inline elements as inline-block
  15293. if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) {
  15294. if ( jQuery.css( elem, "float" ) === "none" ) {
  15295. // Restore the original display value at the end of pure show/hide animations
  15296. if ( !propTween ) {
  15297. anim.done( function() {
  15298. style.display = restoreDisplay;
  15299. } );
  15300. if ( restoreDisplay == null ) {
  15301. display = style.display;
  15302. restoreDisplay = display === "none" ? "" : display;
  15303. }
  15304. }
  15305. style.display = "inline-block";
  15306. }
  15307. }
  15308. }
  15309. if ( opts.overflow ) {
  15310. style.overflow = "hidden";
  15311. anim.always( function() {
  15312. style.overflow = opts.overflow[ 0 ];
  15313. style.overflowX = opts.overflow[ 1 ];
  15314. style.overflowY = opts.overflow[ 2 ];
  15315. } );
  15316. }
  15317. // Implement show/hide animations
  15318. propTween = false;
  15319. for ( prop in orig ) {
  15320. // General show/hide setup for this element animation
  15321. if ( !propTween ) {
  15322. if ( dataShow ) {
  15323. if ( "hidden" in dataShow ) {
  15324. hidden = dataShow.hidden;
  15325. }
  15326. } else {
  15327. dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } );
  15328. }
  15329. // Store hidden/visible for toggle so `.stop().toggle()` "reverses"
  15330. if ( toggle ) {
  15331. dataShow.hidden = !hidden;
  15332. }
  15333. // Show elements before animating them
  15334. if ( hidden ) {
  15335. showHide( [ elem ], true );
  15336. }
  15337. /* eslint-disable no-loop-func */
  15338. anim.done( function() {
  15339. /* eslint-enable no-loop-func */
  15340. // The final step of a "hide" animation is actually hiding the element
  15341. if ( !hidden ) {
  15342. showHide( [ elem ] );
  15343. }
  15344. dataPriv.remove( elem, "fxshow" );
  15345. for ( prop in orig ) {
  15346. jQuery.style( elem, prop, orig[ prop ] );
  15347. }
  15348. } );
  15349. }
  15350. // Per-property setup
  15351. propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
  15352. if ( !( prop in dataShow ) ) {
  15353. dataShow[ prop ] = propTween.start;
  15354. if ( hidden ) {
  15355. propTween.end = propTween.start;
  15356. propTween.start = 0;
  15357. }
  15358. }
  15359. }
  15360. }
  15361. function propFilter( props, specialEasing ) {
  15362. var index, name, easing, value, hooks;
  15363. // camelCase, specialEasing and expand cssHook pass
  15364. for ( index in props ) {
  15365. name = camelCase( index );
  15366. easing = specialEasing[ name ];
  15367. value = props[ index ];
  15368. if ( Array.isArray( value ) ) {
  15369. easing = value[ 1 ];
  15370. value = props[ index ] = value[ 0 ];
  15371. }
  15372. if ( index !== name ) {
  15373. props[ name ] = value;
  15374. delete props[ index ];
  15375. }
  15376. hooks = jQuery.cssHooks[ name ];
  15377. if ( hooks && "expand" in hooks ) {
  15378. value = hooks.expand( value );
  15379. delete props[ name ];
  15380. // Not quite $.extend, this won't overwrite existing keys.
  15381. // Reusing 'index' because we have the correct "name"
  15382. for ( index in value ) {
  15383. if ( !( index in props ) ) {
  15384. props[ index ] = value[ index ];
  15385. specialEasing[ index ] = easing;
  15386. }
  15387. }
  15388. } else {
  15389. specialEasing[ name ] = easing;
  15390. }
  15391. }
  15392. }
  15393. function Animation( elem, properties, options ) {
  15394. var result,
  15395. stopped,
  15396. index = 0,
  15397. length = Animation.prefilters.length,
  15398. deferred = jQuery.Deferred().always( function() {
  15399. // Don't match elem in the :animated selector
  15400. delete tick.elem;
  15401. } ),
  15402. tick = function() {
  15403. if ( stopped ) {
  15404. return false;
  15405. }
  15406. var currentTime = fxNow || createFxNow(),
  15407. remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
  15408. // Support: Android 2.3 only
  15409. // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
  15410. temp = remaining / animation.duration || 0,
  15411. percent = 1 - temp,
  15412. index = 0,
  15413. length = animation.tweens.length;
  15414. for ( ; index < length; index++ ) {
  15415. animation.tweens[ index ].run( percent );
  15416. }
  15417. deferred.notifyWith( elem, [ animation, percent, remaining ] );
  15418. // If there's more to do, yield
  15419. if ( percent < 1 && length ) {
  15420. return remaining;
  15421. }
  15422. // If this was an empty animation, synthesize a final progress notification
  15423. if ( !length ) {
  15424. deferred.notifyWith( elem, [ animation, 1, 0 ] );
  15425. }
  15426. // Resolve the animation and report its conclusion
  15427. deferred.resolveWith( elem, [ animation ] );
  15428. return false;
  15429. },
  15430. animation = deferred.promise( {
  15431. elem: elem,
  15432. props: jQuery.extend( {}, properties ),
  15433. opts: jQuery.extend( true, {
  15434. specialEasing: {},
  15435. easing: jQuery.easing._default
  15436. }, options ),
  15437. originalProperties: properties,
  15438. originalOptions: options,
  15439. startTime: fxNow || createFxNow(),
  15440. duration: options.duration,
  15441. tweens: [],
  15442. createTween: function( prop, end ) {
  15443. var tween = jQuery.Tween( elem, animation.opts, prop, end,
  15444. animation.opts.specialEasing[ prop ] || animation.opts.easing );
  15445. animation.tweens.push( tween );
  15446. return tween;
  15447. },
  15448. stop: function( gotoEnd ) {
  15449. var index = 0,
  15450. // If we are going to the end, we want to run all the tweens
  15451. // otherwise we skip this part
  15452. length = gotoEnd ? animation.tweens.length : 0;
  15453. if ( stopped ) {
  15454. return this;
  15455. }
  15456. stopped = true;
  15457. for ( ; index < length; index++ ) {
  15458. animation.tweens[ index ].run( 1 );
  15459. }
  15460. // Resolve when we played the last frame; otherwise, reject
  15461. if ( gotoEnd ) {
  15462. deferred.notifyWith( elem, [ animation, 1, 0 ] );
  15463. deferred.resolveWith( elem, [ animation, gotoEnd ] );
  15464. } else {
  15465. deferred.rejectWith( elem, [ animation, gotoEnd ] );
  15466. }
  15467. return this;
  15468. }
  15469. } ),
  15470. props = animation.props;
  15471. propFilter( props, animation.opts.specialEasing );
  15472. for ( ; index < length; index++ ) {
  15473. result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );
  15474. if ( result ) {
  15475. if ( isFunction( result.stop ) ) {
  15476. jQuery._queueHooks( animation.elem, animation.opts.queue ).stop =
  15477. result.stop.bind( result );
  15478. }
  15479. return result;
  15480. }
  15481. }
  15482. jQuery.map( props, createTween, animation );
  15483. if ( isFunction( animation.opts.start ) ) {
  15484. animation.opts.start.call( elem, animation );
  15485. }
  15486. // Attach callbacks from options
  15487. animation
  15488. .progress( animation.opts.progress )
  15489. .done( animation.opts.done, animation.opts.complete )
  15490. .fail( animation.opts.fail )
  15491. .always( animation.opts.always );
  15492. jQuery.fx.timer(
  15493. jQuery.extend( tick, {
  15494. elem: elem,
  15495. anim: animation,
  15496. queue: animation.opts.queue
  15497. } )
  15498. );
  15499. return animation;
  15500. }
  15501. jQuery.Animation = jQuery.extend( Animation, {
  15502. tweeners: {
  15503. "*": [ function( prop, value ) {
  15504. var tween = this.createTween( prop, value );
  15505. adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );
  15506. return tween;
  15507. } ]
  15508. },
  15509. tweener: function( props, callback ) {
  15510. if ( isFunction( props ) ) {
  15511. callback = props;
  15512. props = [ "*" ];
  15513. } else {
  15514. props = props.match( rnothtmlwhite );
  15515. }
  15516. var prop,
  15517. index = 0,
  15518. length = props.length;
  15519. for ( ; index < length; index++ ) {
  15520. prop = props[ index ];
  15521. Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];
  15522. Animation.tweeners[ prop ].unshift( callback );
  15523. }
  15524. },
  15525. prefilters: [ defaultPrefilter ],
  15526. prefilter: function( callback, prepend ) {
  15527. if ( prepend ) {
  15528. Animation.prefilters.unshift( callback );
  15529. } else {
  15530. Animation.prefilters.push( callback );
  15531. }
  15532. }
  15533. } );
  15534. jQuery.speed = function( speed, easing, fn ) {
  15535. var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
  15536. complete: fn || !fn && easing ||
  15537. isFunction( speed ) && speed,
  15538. duration: speed,
  15539. easing: fn && easing || easing && !isFunction( easing ) && easing
  15540. };
  15541. // Go to the end state if fx are off
  15542. if ( jQuery.fx.off ) {
  15543. opt.duration = 0;
  15544. } else {
  15545. if ( typeof opt.duration !== "number" ) {
  15546. if ( opt.duration in jQuery.fx.speeds ) {
  15547. opt.duration = jQuery.fx.speeds[ opt.duration ];
  15548. } else {
  15549. opt.duration = jQuery.fx.speeds._default;
  15550. }
  15551. }
  15552. }
  15553. // Normalize opt.queue - true/undefined/null -> "fx"
  15554. if ( opt.queue == null || opt.queue === true ) {
  15555. opt.queue = "fx";
  15556. }
  15557. // Queueing
  15558. opt.old = opt.complete;
  15559. opt.complete = function() {
  15560. if ( isFunction( opt.old ) ) {
  15561. opt.old.call( this );
  15562. }
  15563. if ( opt.queue ) {
  15564. jQuery.dequeue( this, opt.queue );
  15565. }
  15566. };
  15567. return opt;
  15568. };
  15569. jQuery.fn.extend( {
  15570. fadeTo: function( speed, to, easing, callback ) {
  15571. // Show any hidden elements after setting opacity to 0
  15572. return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show()
  15573. // Animate to the value specified
  15574. .end().animate( { opacity: to }, speed, easing, callback );
  15575. },
  15576. animate: function( prop, speed, easing, callback ) {
  15577. var empty = jQuery.isEmptyObject( prop ),
  15578. optall = jQuery.speed( speed, easing, callback ),
  15579. doAnimation = function() {
  15580. // Operate on a copy of prop so per-property easing won't be lost
  15581. var anim = Animation( this, jQuery.extend( {}, prop ), optall );
  15582. // Empty animations, or finishing resolves immediately
  15583. if ( empty || dataPriv.get( this, "finish" ) ) {
  15584. anim.stop( true );
  15585. }
  15586. };
  15587. doAnimation.finish = doAnimation;
  15588. return empty || optall.queue === false ?
  15589. this.each( doAnimation ) :
  15590. this.queue( optall.queue, doAnimation );
  15591. },
  15592. stop: function( type, clearQueue, gotoEnd ) {
  15593. var stopQueue = function( hooks ) {
  15594. var stop = hooks.stop;
  15595. delete hooks.stop;
  15596. stop( gotoEnd );
  15597. };
  15598. if ( typeof type !== "string" ) {
  15599. gotoEnd = clearQueue;
  15600. clearQueue = type;
  15601. type = undefined;
  15602. }
  15603. if ( clearQueue && type !== false ) {
  15604. this.queue( type || "fx", [] );
  15605. }
  15606. return this.each( function() {
  15607. var dequeue = true,
  15608. index = type != null && type + "queueHooks",
  15609. timers = jQuery.timers,
  15610. data = dataPriv.get( this );
  15611. if ( index ) {
  15612. if ( data[ index ] && data[ index ].stop ) {
  15613. stopQueue( data[ index ] );
  15614. }
  15615. } else {
  15616. for ( index in data ) {
  15617. if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
  15618. stopQueue( data[ index ] );
  15619. }
  15620. }
  15621. }
  15622. for ( index = timers.length; index--; ) {
  15623. if ( timers[ index ].elem === this &&
  15624. ( type == null || timers[ index ].queue === type ) ) {
  15625. timers[ index ].anim.stop( gotoEnd );
  15626. dequeue = false;
  15627. timers.splice( index, 1 );
  15628. }
  15629. }
  15630. // Start the next in the queue if the last step wasn't forced.
  15631. // Timers currently will call their complete callbacks, which
  15632. // will dequeue but only if they were gotoEnd.
  15633. if ( dequeue || !gotoEnd ) {
  15634. jQuery.dequeue( this, type );
  15635. }
  15636. } );
  15637. },
  15638. finish: function( type ) {
  15639. if ( type !== false ) {
  15640. type = type || "fx";
  15641. }
  15642. return this.each( function() {
  15643. var index,
  15644. data = dataPriv.get( this ),
  15645. queue = data[ type + "queue" ],
  15646. hooks = data[ type + "queueHooks" ],
  15647. timers = jQuery.timers,
  15648. length = queue ? queue.length : 0;
  15649. // Enable finishing flag on private data
  15650. data.finish = true;
  15651. // Empty the queue first
  15652. jQuery.queue( this, type, [] );
  15653. if ( hooks && hooks.stop ) {
  15654. hooks.stop.call( this, true );
  15655. }
  15656. // Look for any active animations, and finish them
  15657. for ( index = timers.length; index--; ) {
  15658. if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
  15659. timers[ index ].anim.stop( true );
  15660. timers.splice( index, 1 );
  15661. }
  15662. }
  15663. // Look for any animations in the old queue and finish them
  15664. for ( index = 0; index < length; index++ ) {
  15665. if ( queue[ index ] && queue[ index ].finish ) {
  15666. queue[ index ].finish.call( this );
  15667. }
  15668. }
  15669. // Turn off finishing flag
  15670. delete data.finish;
  15671. } );
  15672. }
  15673. } );
  15674. jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) {
  15675. var cssFn = jQuery.fn[ name ];
  15676. jQuery.fn[ name ] = function( speed, easing, callback ) {
  15677. return speed == null || typeof speed === "boolean" ?
  15678. cssFn.apply( this, arguments ) :
  15679. this.animate( genFx( name, true ), speed, easing, callback );
  15680. };
  15681. } );
  15682. // Generate shortcuts for custom animations
  15683. jQuery.each( {
  15684. slideDown: genFx( "show" ),
  15685. slideUp: genFx( "hide" ),
  15686. slideToggle: genFx( "toggle" ),
  15687. fadeIn: { opacity: "show" },
  15688. fadeOut: { opacity: "hide" },
  15689. fadeToggle: { opacity: "toggle" }
  15690. }, function( name, props ) {
  15691. jQuery.fn[ name ] = function( speed, easing, callback ) {
  15692. return this.animate( props, speed, easing, callback );
  15693. };
  15694. } );
  15695. jQuery.timers = [];
  15696. jQuery.fx.tick = function() {
  15697. var timer,
  15698. i = 0,
  15699. timers = jQuery.timers;
  15700. fxNow = Date.now();
  15701. for ( ; i < timers.length; i++ ) {
  15702. timer = timers[ i ];
  15703. // Run the timer and safely remove it when done (allowing for external removal)
  15704. if ( !timer() && timers[ i ] === timer ) {
  15705. timers.splice( i--, 1 );
  15706. }
  15707. }
  15708. if ( !timers.length ) {
  15709. jQuery.fx.stop();
  15710. }
  15711. fxNow = undefined;
  15712. };
  15713. jQuery.fx.timer = function( timer ) {
  15714. jQuery.timers.push( timer );
  15715. jQuery.fx.start();
  15716. };
  15717. jQuery.fx.interval = 13;
  15718. jQuery.fx.start = function() {
  15719. if ( inProgress ) {
  15720. return;
  15721. }
  15722. inProgress = true;
  15723. schedule();
  15724. };
  15725. jQuery.fx.stop = function() {
  15726. inProgress = null;
  15727. };
  15728. jQuery.fx.speeds = {
  15729. slow: 600,
  15730. fast: 200,
  15731. // Default speed
  15732. _default: 400
  15733. };
  15734. // Based off of the plugin by Clint Helfers, with permission.
  15735. // https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/
  15736. jQuery.fn.delay = function( time, type ) {
  15737. time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
  15738. type = type || "fx";
  15739. return this.queue( type, function( next, hooks ) {
  15740. var timeout = window.setTimeout( next, time );
  15741. hooks.stop = function() {
  15742. window.clearTimeout( timeout );
  15743. };
  15744. } );
  15745. };
  15746. ( function() {
  15747. var input = document.createElement( "input" ),
  15748. select = document.createElement( "select" ),
  15749. opt = select.appendChild( document.createElement( "option" ) );
  15750. input.type = "checkbox";
  15751. // Support: Android <=4.3 only
  15752. // Default value for a checkbox should be "on"
  15753. support.checkOn = input.value !== "";
  15754. // Support: IE <=11 only
  15755. // Must access selectedIndex to make default options select
  15756. support.optSelected = opt.selected;
  15757. // Support: IE <=11 only
  15758. // An input loses its value after becoming a radio
  15759. input = document.createElement( "input" );
  15760. input.value = "t";
  15761. input.type = "radio";
  15762. support.radioValue = input.value === "t";
  15763. } )();
  15764. var boolHook,
  15765. attrHandle = jQuery.expr.attrHandle;
  15766. jQuery.fn.extend( {
  15767. attr: function( name, value ) {
  15768. return access( this, jQuery.attr, name, value, arguments.length > 1 );
  15769. },
  15770. removeAttr: function( name ) {
  15771. return this.each( function() {
  15772. jQuery.removeAttr( this, name );
  15773. } );
  15774. }
  15775. } );
  15776. jQuery.extend( {
  15777. attr: function( elem, name, value ) {
  15778. var ret, hooks,
  15779. nType = elem.nodeType;
  15780. // Don't get/set attributes on text, comment and attribute nodes
  15781. if ( nType === 3 || nType === 8 || nType === 2 ) {
  15782. return;
  15783. }
  15784. // Fallback to prop when attributes are not supported
  15785. if ( typeof elem.getAttribute === "undefined" ) {
  15786. return jQuery.prop( elem, name, value );
  15787. }
  15788. // Attribute hooks are determined by the lowercase version
  15789. // Grab necessary hook if one is defined
  15790. if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
  15791. hooks = jQuery.attrHooks[ name.toLowerCase() ] ||
  15792. ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );
  15793. }
  15794. if ( value !== undefined ) {
  15795. if ( value === null ) {
  15796. jQuery.removeAttr( elem, name );
  15797. return;
  15798. }
  15799. if ( hooks && "set" in hooks &&
  15800. ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
  15801. return ret;
  15802. }
  15803. elem.setAttribute( name, value + "" );
  15804. return value;
  15805. }
  15806. if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
  15807. return ret;
  15808. }
  15809. ret = jQuery.find.attr( elem, name );
  15810. // Non-existent attributes return null, we normalize to undefined
  15811. return ret == null ? undefined : ret;
  15812. },
  15813. attrHooks: {
  15814. type: {
  15815. set: function( elem, value ) {
  15816. if ( !support.radioValue && value === "radio" &&
  15817. nodeName( elem, "input" ) ) {
  15818. var val = elem.value;
  15819. elem.setAttribute( "type", value );
  15820. if ( val ) {
  15821. elem.value = val;
  15822. }
  15823. return value;
  15824. }
  15825. }
  15826. }
  15827. },
  15828. removeAttr: function( elem, value ) {
  15829. var name,
  15830. i = 0,
  15831. // Attribute names can contain non-HTML whitespace characters
  15832. // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
  15833. attrNames = value && value.match( rnothtmlwhite );
  15834. if ( attrNames && elem.nodeType === 1 ) {
  15835. while ( ( name = attrNames[ i++ ] ) ) {
  15836. elem.removeAttribute( name );
  15837. }
  15838. }
  15839. }
  15840. } );
  15841. // Hooks for boolean attributes
  15842. boolHook = {
  15843. set: function( elem, value, name ) {
  15844. if ( value === false ) {
  15845. // Remove boolean attributes when set to false
  15846. jQuery.removeAttr( elem, name );
  15847. } else {
  15848. elem.setAttribute( name, name );
  15849. }
  15850. return name;
  15851. }
  15852. };
  15853. jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
  15854. var getter = attrHandle[ name ] || jQuery.find.attr;
  15855. attrHandle[ name ] = function( elem, name, isXML ) {
  15856. var ret, handle,
  15857. lowercaseName = name.toLowerCase();
  15858. if ( !isXML ) {
  15859. // Avoid an infinite loop by temporarily removing this function from the getter
  15860. handle = attrHandle[ lowercaseName ];
  15861. attrHandle[ lowercaseName ] = ret;
  15862. ret = getter( elem, name, isXML ) != null ?
  15863. lowercaseName :
  15864. null;
  15865. attrHandle[ lowercaseName ] = handle;
  15866. }
  15867. return ret;
  15868. };
  15869. } );
  15870. var rfocusable = /^(?:input|select|textarea|button)$/i,
  15871. rclickable = /^(?:a|area)$/i;
  15872. jQuery.fn.extend( {
  15873. prop: function( name, value ) {
  15874. return access( this, jQuery.prop, name, value, arguments.length > 1 );
  15875. },
  15876. removeProp: function( name ) {
  15877. return this.each( function() {
  15878. delete this[ jQuery.propFix[ name ] || name ];
  15879. } );
  15880. }
  15881. } );
  15882. jQuery.extend( {
  15883. prop: function( elem, name, value ) {
  15884. var ret, hooks,
  15885. nType = elem.nodeType;
  15886. // Don't get/set properties on text, comment and attribute nodes
  15887. if ( nType === 3 || nType === 8 || nType === 2 ) {
  15888. return;
  15889. }
  15890. if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
  15891. // Fix name and attach hooks
  15892. name = jQuery.propFix[ name ] || name;
  15893. hooks = jQuery.propHooks[ name ];
  15894. }
  15895. if ( value !== undefined ) {
  15896. if ( hooks && "set" in hooks &&
  15897. ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
  15898. return ret;
  15899. }
  15900. return ( elem[ name ] = value );
  15901. }
  15902. if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
  15903. return ret;
  15904. }
  15905. return elem[ name ];
  15906. },
  15907. propHooks: {
  15908. tabIndex: {
  15909. get: function( elem ) {
  15910. // Support: IE <=9 - 11 only
  15911. // elem.tabIndex doesn't always return the
  15912. // correct value when it hasn't been explicitly set
  15913. // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
  15914. // Use proper attribute retrieval(#12072)
  15915. var tabindex = jQuery.find.attr( elem, "tabindex" );
  15916. if ( tabindex ) {
  15917. return parseInt( tabindex, 10 );
  15918. }
  15919. if (
  15920. rfocusable.test( elem.nodeName ) ||
  15921. rclickable.test( elem.nodeName ) &&
  15922. elem.href
  15923. ) {
  15924. return 0;
  15925. }
  15926. return -1;
  15927. }
  15928. }
  15929. },
  15930. propFix: {
  15931. "for": "htmlFor",
  15932. "class": "className"
  15933. }
  15934. } );
  15935. // Support: IE <=11 only
  15936. // Accessing the selectedIndex property
  15937. // forces the browser to respect setting selected
  15938. // on the option
  15939. // The getter ensures a default option is selected
  15940. // when in an optgroup
  15941. // eslint rule "no-unused-expressions" is disabled for this code
  15942. // since it considers such accessions noop
  15943. if ( !support.optSelected ) {
  15944. jQuery.propHooks.selected = {
  15945. get: function( elem ) {
  15946. /* eslint no-unused-expressions: "off" */
  15947. var parent = elem.parentNode;
  15948. if ( parent && parent.parentNode ) {
  15949. parent.parentNode.selectedIndex;
  15950. }
  15951. return null;
  15952. },
  15953. set: function( elem ) {
  15954. /* eslint no-unused-expressions: "off" */
  15955. var parent = elem.parentNode;
  15956. if ( parent ) {
  15957. parent.selectedIndex;
  15958. if ( parent.parentNode ) {
  15959. parent.parentNode.selectedIndex;
  15960. }
  15961. }
  15962. }
  15963. };
  15964. }
  15965. jQuery.each( [
  15966. "tabIndex",
  15967. "readOnly",
  15968. "maxLength",
  15969. "cellSpacing",
  15970. "cellPadding",
  15971. "rowSpan",
  15972. "colSpan",
  15973. "useMap",
  15974. "frameBorder",
  15975. "contentEditable"
  15976. ], function() {
  15977. jQuery.propFix[ this.toLowerCase() ] = this;
  15978. } );
  15979. // Strip and collapse whitespace according to HTML spec
  15980. // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace
  15981. function stripAndCollapse( value ) {
  15982. var tokens = value.match( rnothtmlwhite ) || [];
  15983. return tokens.join( " " );
  15984. }
  15985. function getClass( elem ) {
  15986. return elem.getAttribute && elem.getAttribute( "class" ) || "";
  15987. }
  15988. function classesToArray( value ) {
  15989. if ( Array.isArray( value ) ) {
  15990. return value;
  15991. }
  15992. if ( typeof value === "string" ) {
  15993. return value.match( rnothtmlwhite ) || [];
  15994. }
  15995. return [];
  15996. }
  15997. jQuery.fn.extend( {
  15998. addClass: function( value ) {
  15999. var classes, elem, cur, curValue, clazz, j, finalValue,
  16000. i = 0;
  16001. if ( isFunction( value ) ) {
  16002. return this.each( function( j ) {
  16003. jQuery( this ).addClass( value.call( this, j, getClass( this ) ) );
  16004. } );
  16005. }
  16006. classes = classesToArray( value );
  16007. if ( classes.length ) {
  16008. while ( ( elem = this[ i++ ] ) ) {
  16009. curValue = getClass( elem );
  16010. cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
  16011. if ( cur ) {
  16012. j = 0;
  16013. while ( ( clazz = classes[ j++ ] ) ) {
  16014. if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
  16015. cur += clazz + " ";
  16016. }
  16017. }
  16018. // Only assign if different to avoid unneeded rendering.
  16019. finalValue = stripAndCollapse( cur );
  16020. if ( curValue !== finalValue ) {
  16021. elem.setAttribute( "class", finalValue );
  16022. }
  16023. }
  16024. }
  16025. }
  16026. return this;
  16027. },
  16028. removeClass: function( value ) {
  16029. var classes, elem, cur, curValue, clazz, j, finalValue,
  16030. i = 0;
  16031. if ( isFunction( value ) ) {
  16032. return this.each( function( j ) {
  16033. jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );
  16034. } );
  16035. }
  16036. if ( !arguments.length ) {
  16037. return this.attr( "class", "" );
  16038. }
  16039. classes = classesToArray( value );
  16040. if ( classes.length ) {
  16041. while ( ( elem = this[ i++ ] ) ) {
  16042. curValue = getClass( elem );
  16043. // This expression is here for better compressibility (see addClass)
  16044. cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
  16045. if ( cur ) {
  16046. j = 0;
  16047. while ( ( clazz = classes[ j++ ] ) ) {
  16048. // Remove *all* instances
  16049. while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
  16050. cur = cur.replace( " " + clazz + " ", " " );
  16051. }
  16052. }
  16053. // Only assign if different to avoid unneeded rendering.
  16054. finalValue = stripAndCollapse( cur );
  16055. if ( curValue !== finalValue ) {
  16056. elem.setAttribute( "class", finalValue );
  16057. }
  16058. }
  16059. }
  16060. }
  16061. return this;
  16062. },
  16063. toggleClass: function( value, stateVal ) {
  16064. var type = typeof value,
  16065. isValidValue = type === "string" || Array.isArray( value );
  16066. if ( typeof stateVal === "boolean" && isValidValue ) {
  16067. return stateVal ? this.addClass( value ) : this.removeClass( value );
  16068. }
  16069. if ( isFunction( value ) ) {
  16070. return this.each( function( i ) {
  16071. jQuery( this ).toggleClass(
  16072. value.call( this, i, getClass( this ), stateVal ),
  16073. stateVal
  16074. );
  16075. } );
  16076. }
  16077. return this.each( function() {
  16078. var className, i, self, classNames;
  16079. if ( isValidValue ) {
  16080. // Toggle individual class names
  16081. i = 0;
  16082. self = jQuery( this );
  16083. classNames = classesToArray( value );
  16084. while ( ( className = classNames[ i++ ] ) ) {
  16085. // Check each className given, space separated list
  16086. if ( self.hasClass( className ) ) {
  16087. self.removeClass( className );
  16088. } else {
  16089. self.addClass( className );
  16090. }
  16091. }
  16092. // Toggle whole class name
  16093. } else if ( value === undefined || type === "boolean" ) {
  16094. className = getClass( this );
  16095. if ( className ) {
  16096. // Store className if set
  16097. dataPriv.set( this, "__className__", className );
  16098. }
  16099. // If the element has a class name or if we're passed `false`,
  16100. // then remove the whole classname (if there was one, the above saved it).
  16101. // Otherwise bring back whatever was previously saved (if anything),
  16102. // falling back to the empty string if nothing was stored.
  16103. if ( this.setAttribute ) {
  16104. this.setAttribute( "class",
  16105. className || value === false ?
  16106. "" :
  16107. dataPriv.get( this, "__className__" ) || ""
  16108. );
  16109. }
  16110. }
  16111. } );
  16112. },
  16113. hasClass: function( selector ) {
  16114. var className, elem,
  16115. i = 0;
  16116. className = " " + selector + " ";
  16117. while ( ( elem = this[ i++ ] ) ) {
  16118. if ( elem.nodeType === 1 &&
  16119. ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) {
  16120. return true;
  16121. }
  16122. }
  16123. return false;
  16124. }
  16125. } );
  16126. var rreturn = /\r/g;
  16127. jQuery.fn.extend( {
  16128. val: function( value ) {
  16129. var hooks, ret, valueIsFunction,
  16130. elem = this[ 0 ];
  16131. if ( !arguments.length ) {
  16132. if ( elem ) {
  16133. hooks = jQuery.valHooks[ elem.type ] ||
  16134. jQuery.valHooks[ elem.nodeName.toLowerCase() ];
  16135. if ( hooks &&
  16136. "get" in hooks &&
  16137. ( ret = hooks.get( elem, "value" ) ) !== undefined
  16138. ) {
  16139. return ret;
  16140. }
  16141. ret = elem.value;
  16142. // Handle most common string cases
  16143. if ( typeof ret === "string" ) {
  16144. return ret.replace( rreturn, "" );
  16145. }
  16146. // Handle cases where value is null/undef or number
  16147. return ret == null ? "" : ret;
  16148. }
  16149. return;
  16150. }
  16151. valueIsFunction = isFunction( value );
  16152. return this.each( function( i ) {
  16153. var val;
  16154. if ( this.nodeType !== 1 ) {
  16155. return;
  16156. }
  16157. if ( valueIsFunction ) {
  16158. val = value.call( this, i, jQuery( this ).val() );
  16159. } else {
  16160. val = value;
  16161. }
  16162. // Treat null/undefined as ""; convert numbers to string
  16163. if ( val == null ) {
  16164. val = "";
  16165. } else if ( typeof val === "number" ) {
  16166. val += "";
  16167. } else if ( Array.isArray( val ) ) {
  16168. val = jQuery.map( val, function( value ) {
  16169. return value == null ? "" : value + "";
  16170. } );
  16171. }
  16172. hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
  16173. // If set returns undefined, fall back to normal setting
  16174. if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) {
  16175. this.value = val;
  16176. }
  16177. } );
  16178. }
  16179. } );
  16180. jQuery.extend( {
  16181. valHooks: {
  16182. option: {
  16183. get: function( elem ) {
  16184. var val = jQuery.find.attr( elem, "value" );
  16185. return val != null ?
  16186. val :
  16187. // Support: IE <=10 - 11 only
  16188. // option.text throws exceptions (#14686, #14858)
  16189. // Strip and collapse whitespace
  16190. // https://html.spec.whatwg.org/#strip-and-collapse-whitespace
  16191. stripAndCollapse( jQuery.text( elem ) );
  16192. }
  16193. },
  16194. select: {
  16195. get: function( elem ) {
  16196. var value, option, i,
  16197. options = elem.options,
  16198. index = elem.selectedIndex,
  16199. one = elem.type === "select-one",
  16200. values = one ? null : [],
  16201. max = one ? index + 1 : options.length;
  16202. if ( index < 0 ) {
  16203. i = max;
  16204. } else {
  16205. i = one ? index : 0;
  16206. }
  16207. // Loop through all the selected options
  16208. for ( ; i < max; i++ ) {
  16209. option = options[ i ];
  16210. // Support: IE <=9 only
  16211. // IE8-9 doesn't update selected after form reset (#2551)
  16212. if ( ( option.selected || i === index ) &&
  16213. // Don't return options that are disabled or in a disabled optgroup
  16214. !option.disabled &&
  16215. ( !option.parentNode.disabled ||
  16216. !nodeName( option.parentNode, "optgroup" ) ) ) {
  16217. // Get the specific value for the option
  16218. value = jQuery( option ).val();
  16219. // We don't need an array for one selects
  16220. if ( one ) {
  16221. return value;
  16222. }
  16223. // Multi-Selects return an array
  16224. values.push( value );
  16225. }
  16226. }
  16227. return values;
  16228. },
  16229. set: function( elem, value ) {
  16230. var optionSet, option,
  16231. options = elem.options,
  16232. values = jQuery.makeArray( value ),
  16233. i = options.length;
  16234. while ( i-- ) {
  16235. option = options[ i ];
  16236. /* eslint-disable no-cond-assign */
  16237. if ( option.selected =
  16238. jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1
  16239. ) {
  16240. optionSet = true;
  16241. }
  16242. /* eslint-enable no-cond-assign */
  16243. }
  16244. // Force browsers to behave consistently when non-matching value is set
  16245. if ( !optionSet ) {
  16246. elem.selectedIndex = -1;
  16247. }
  16248. return values;
  16249. }
  16250. }
  16251. }
  16252. } );
  16253. // Radios and checkboxes getter/setter
  16254. jQuery.each( [ "radio", "checkbox" ], function() {
  16255. jQuery.valHooks[ this ] = {
  16256. set: function( elem, value ) {
  16257. if ( Array.isArray( value ) ) {
  16258. return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );
  16259. }
  16260. }
  16261. };
  16262. if ( !support.checkOn ) {
  16263. jQuery.valHooks[ this ].get = function( elem ) {
  16264. return elem.getAttribute( "value" ) === null ? "on" : elem.value;
  16265. };
  16266. }
  16267. } );
  16268. // Return jQuery for attributes-only inclusion
  16269. support.focusin = "onfocusin" in window;
  16270. var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
  16271. stopPropagationCallback = function( e ) {
  16272. e.stopPropagation();
  16273. };
  16274. jQuery.extend( jQuery.event, {
  16275. trigger: function( event, data, elem, onlyHandlers ) {
  16276. var i, cur, tmp, bubbleType, ontype, handle, special, lastElement,
  16277. eventPath = [ elem || document ],
  16278. type = hasOwn.call( event, "type" ) ? event.type : event,
  16279. namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : [];
  16280. cur = lastElement = tmp = elem = elem || document;
  16281. // Don't do events on text and comment nodes
  16282. if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
  16283. return;
  16284. }
  16285. // focus/blur morphs to focusin/out; ensure we're not firing them right now
  16286. if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
  16287. return;
  16288. }
  16289. if ( type.indexOf( "." ) > -1 ) {
  16290. // Namespaced trigger; create a regexp to match event type in handle()
  16291. namespaces = type.split( "." );
  16292. type = namespaces.shift();
  16293. namespaces.sort();
  16294. }
  16295. ontype = type.indexOf( ":" ) < 0 && "on" + type;
  16296. // Caller can pass in a jQuery.Event object, Object, or just an event type string
  16297. event = event[ jQuery.expando ] ?
  16298. event :
  16299. new jQuery.Event( type, typeof event === "object" && event );
  16300. // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
  16301. event.isTrigger = onlyHandlers ? 2 : 3;
  16302. event.namespace = namespaces.join( "." );
  16303. event.rnamespace = event.namespace ?
  16304. new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) :
  16305. null;
  16306. // Clean up the event in case it is being reused
  16307. event.result = undefined;
  16308. if ( !event.target ) {
  16309. event.target = elem;
  16310. }
  16311. // Clone any incoming data and prepend the event, creating the handler arg list
  16312. data = data == null ?
  16313. [ event ] :
  16314. jQuery.makeArray( data, [ event ] );
  16315. // Allow special events to draw outside the lines
  16316. special = jQuery.event.special[ type ] || {};
  16317. if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
  16318. return;
  16319. }
  16320. // Determine event propagation path in advance, per W3C events spec (#9951)
  16321. // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
  16322. if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) {
  16323. bubbleType = special.delegateType || type;
  16324. if ( !rfocusMorph.test( bubbleType + type ) ) {
  16325. cur = cur.parentNode;
  16326. }
  16327. for ( ; cur; cur = cur.parentNode ) {
  16328. eventPath.push( cur );
  16329. tmp = cur;
  16330. }
  16331. // Only add window if we got to document (e.g., not plain obj or detached DOM)
  16332. if ( tmp === ( elem.ownerDocument || document ) ) {
  16333. eventPath.push( tmp.defaultView || tmp.parentWindow || window );
  16334. }
  16335. }
  16336. // Fire handlers on the event path
  16337. i = 0;
  16338. while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {
  16339. lastElement = cur;
  16340. event.type = i > 1 ?
  16341. bubbleType :
  16342. special.bindType || type;
  16343. // jQuery handler
  16344. handle = ( dataPriv.get( cur, "events" ) || {} )[ event.type ] &&
  16345. dataPriv.get( cur, "handle" );
  16346. if ( handle ) {
  16347. handle.apply( cur, data );
  16348. }
  16349. // Native handler
  16350. handle = ontype && cur[ ontype ];
  16351. if ( handle && handle.apply && acceptData( cur ) ) {
  16352. event.result = handle.apply( cur, data );
  16353. if ( event.result === false ) {
  16354. event.preventDefault();
  16355. }
  16356. }
  16357. }
  16358. event.type = type;
  16359. // If nobody prevented the default action, do it now
  16360. if ( !onlyHandlers && !event.isDefaultPrevented() ) {
  16361. if ( ( !special._default ||
  16362. special._default.apply( eventPath.pop(), data ) === false ) &&
  16363. acceptData( elem ) ) {
  16364. // Call a native DOM method on the target with the same name as the event.
  16365. // Don't do default actions on window, that's where global variables be (#6170)
  16366. if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) {
  16367. // Don't re-trigger an onFOO event when we call its FOO() method
  16368. tmp = elem[ ontype ];
  16369. if ( tmp ) {
  16370. elem[ ontype ] = null;
  16371. }
  16372. // Prevent re-triggering of the same event, since we already bubbled it above
  16373. jQuery.event.triggered = type;
  16374. if ( event.isPropagationStopped() ) {
  16375. lastElement.addEventListener( type, stopPropagationCallback );
  16376. }
  16377. elem[ type ]();
  16378. if ( event.isPropagationStopped() ) {
  16379. lastElement.removeEventListener( type, stopPropagationCallback );
  16380. }
  16381. jQuery.event.triggered = undefined;
  16382. if ( tmp ) {
  16383. elem[ ontype ] = tmp;
  16384. }
  16385. }
  16386. }
  16387. }
  16388. return event.result;
  16389. },
  16390. // Piggyback on a donor event to simulate a different one
  16391. // Used only for `focus(in | out)` events
  16392. simulate: function( type, elem, event ) {
  16393. var e = jQuery.extend(
  16394. new jQuery.Event(),
  16395. event,
  16396. {
  16397. type: type,
  16398. isSimulated: true
  16399. }
  16400. );
  16401. jQuery.event.trigger( e, null, elem );
  16402. }
  16403. } );
  16404. jQuery.fn.extend( {
  16405. trigger: function( type, data ) {
  16406. return this.each( function() {
  16407. jQuery.event.trigger( type, data, this );
  16408. } );
  16409. },
  16410. triggerHandler: function( type, data ) {
  16411. var elem = this[ 0 ];
  16412. if ( elem ) {
  16413. return jQuery.event.trigger( type, data, elem, true );
  16414. }
  16415. }
  16416. } );
  16417. // Support: Firefox <=44
  16418. // Firefox doesn't have focus(in | out) events
  16419. // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
  16420. //
  16421. // Support: Chrome <=48 - 49, Safari <=9.0 - 9.1
  16422. // focus(in | out) events fire after focus & blur events,
  16423. // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
  16424. // Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857
  16425. if ( !support.focusin ) {
  16426. jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) {
  16427. // Attach a single capturing handler on the document while someone wants focusin/focusout
  16428. var handler = function( event ) {
  16429. jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );
  16430. };
  16431. jQuery.event.special[ fix ] = {
  16432. setup: function() {
  16433. var doc = this.ownerDocument || this,
  16434. attaches = dataPriv.access( doc, fix );
  16435. if ( !attaches ) {
  16436. doc.addEventListener( orig, handler, true );
  16437. }
  16438. dataPriv.access( doc, fix, ( attaches || 0 ) + 1 );
  16439. },
  16440. teardown: function() {
  16441. var doc = this.ownerDocument || this,
  16442. attaches = dataPriv.access( doc, fix ) - 1;
  16443. if ( !attaches ) {
  16444. doc.removeEventListener( orig, handler, true );
  16445. dataPriv.remove( doc, fix );
  16446. } else {
  16447. dataPriv.access( doc, fix, attaches );
  16448. }
  16449. }
  16450. };
  16451. } );
  16452. }
  16453. var location = window.location;
  16454. var nonce = Date.now();
  16455. var rquery = ( /\?/ );
  16456. // Cross-browser xml parsing
  16457. jQuery.parseXML = function( data ) {
  16458. var xml;
  16459. if ( !data || typeof data !== "string" ) {
  16460. return null;
  16461. }
  16462. // Support: IE 9 - 11 only
  16463. // IE throws on parseFromString with invalid input.
  16464. try {
  16465. xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
  16466. } catch ( e ) {
  16467. xml = undefined;
  16468. }
  16469. if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
  16470. jQuery.error( "Invalid XML: " + data );
  16471. }
  16472. return xml;
  16473. };
  16474. var
  16475. rbracket = /\[\]$/,
  16476. rCRLF = /\r?\n/g,
  16477. rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
  16478. rsubmittable = /^(?:input|select|textarea|keygen)/i;
  16479. function buildParams( prefix, obj, traditional, add ) {
  16480. var name;
  16481. if ( Array.isArray( obj ) ) {
  16482. // Serialize array item.
  16483. jQuery.each( obj, function( i, v ) {
  16484. if ( traditional || rbracket.test( prefix ) ) {
  16485. // Treat each array item as a scalar.
  16486. add( prefix, v );
  16487. } else {
  16488. // Item is non-scalar (array or object), encode its numeric index.
  16489. buildParams(
  16490. prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]",
  16491. v,
  16492. traditional,
  16493. add
  16494. );
  16495. }
  16496. } );
  16497. } else if ( !traditional && toType( obj ) === "object" ) {
  16498. // Serialize object item.
  16499. for ( name in obj ) {
  16500. buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
  16501. }
  16502. } else {
  16503. // Serialize scalar item.
  16504. add( prefix, obj );
  16505. }
  16506. }
  16507. // Serialize an array of form elements or a set of
  16508. // key/values into a query string
  16509. jQuery.param = function( a, traditional ) {
  16510. var prefix,
  16511. s = [],
  16512. add = function( key, valueOrFunction ) {
  16513. // If value is a function, invoke it and use its return value
  16514. var value = isFunction( valueOrFunction ) ?
  16515. valueOrFunction() :
  16516. valueOrFunction;
  16517. s[ s.length ] = encodeURIComponent( key ) + "=" +
  16518. encodeURIComponent( value == null ? "" : value );
  16519. };
  16520. if ( a == null ) {
  16521. return "";
  16522. }
  16523. // If an array was passed in, assume that it is an array of form elements.
  16524. if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
  16525. // Serialize the form elements
  16526. jQuery.each( a, function() {
  16527. add( this.name, this.value );
  16528. } );
  16529. } else {
  16530. // If traditional, encode the "old" way (the way 1.3.2 or older
  16531. // did it), otherwise encode params recursively.
  16532. for ( prefix in a ) {
  16533. buildParams( prefix, a[ prefix ], traditional, add );
  16534. }
  16535. }
  16536. // Return the resulting serialization
  16537. return s.join( "&" );
  16538. };
  16539. jQuery.fn.extend( {
  16540. serialize: function() {
  16541. return jQuery.param( this.serializeArray() );
  16542. },
  16543. serializeArray: function() {
  16544. return this.map( function() {
  16545. // Can add propHook for "elements" to filter or add form elements
  16546. var elements = jQuery.prop( this, "elements" );
  16547. return elements ? jQuery.makeArray( elements ) : this;
  16548. } )
  16549. .filter( function() {
  16550. var type = this.type;
  16551. // Use .is( ":disabled" ) so that fieldset[disabled] works
  16552. return this.name && !jQuery( this ).is( ":disabled" ) &&
  16553. rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
  16554. ( this.checked || !rcheckableType.test( type ) );
  16555. } )
  16556. .map( function( i, elem ) {
  16557. var val = jQuery( this ).val();
  16558. if ( val == null ) {
  16559. return null;
  16560. }
  16561. if ( Array.isArray( val ) ) {
  16562. return jQuery.map( val, function( val ) {
  16563. return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  16564. } );
  16565. }
  16566. return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  16567. } ).get();
  16568. }
  16569. } );
  16570. var
  16571. r20 = /%20/g,
  16572. rhash = /#.*$/,
  16573. rantiCache = /([?&])_=[^&]*/,
  16574. rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
  16575. // #7653, #8125, #8152: local protocol detection
  16576. rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
  16577. rnoContent = /^(?:GET|HEAD)$/,
  16578. rprotocol = /^\/\//,
  16579. /* Prefilters
  16580. * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
  16581. * 2) These are called:
  16582. * - BEFORE asking for a transport
  16583. * - AFTER param serialization (s.data is a string if s.processData is true)
  16584. * 3) key is the dataType
  16585. * 4) the catchall symbol "*" can be used
  16586. * 5) execution will start with transport dataType and THEN continue down to "*" if needed
  16587. */
  16588. prefilters = {},
  16589. /* Transports bindings
  16590. * 1) key is the dataType
  16591. * 2) the catchall symbol "*" can be used
  16592. * 3) selection will start with transport dataType and THEN go to "*" if needed
  16593. */
  16594. transports = {},
  16595. // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
  16596. allTypes = "*/".concat( "*" ),
  16597. // Anchor tag for parsing the document origin
  16598. originAnchor = document.createElement( "a" );
  16599. originAnchor.href = location.href;
  16600. // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
  16601. function addToPrefiltersOrTransports( structure ) {
  16602. // dataTypeExpression is optional and defaults to "*"
  16603. return function( dataTypeExpression, func ) {
  16604. if ( typeof dataTypeExpression !== "string" ) {
  16605. func = dataTypeExpression;
  16606. dataTypeExpression = "*";
  16607. }
  16608. var dataType,
  16609. i = 0,
  16610. dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || [];
  16611. if ( isFunction( func ) ) {
  16612. // For each dataType in the dataTypeExpression
  16613. while ( ( dataType = dataTypes[ i++ ] ) ) {
  16614. // Prepend if requested
  16615. if ( dataType[ 0 ] === "+" ) {
  16616. dataType = dataType.slice( 1 ) || "*";
  16617. ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );
  16618. // Otherwise append
  16619. } else {
  16620. ( structure[ dataType ] = structure[ dataType ] || [] ).push( func );
  16621. }
  16622. }
  16623. }
  16624. };
  16625. }
  16626. // Base inspection function for prefilters and transports
  16627. function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
  16628. var inspected = {},
  16629. seekingTransport = ( structure === transports );
  16630. function inspect( dataType ) {
  16631. var selected;
  16632. inspected[ dataType ] = true;
  16633. jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
  16634. var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
  16635. if ( typeof dataTypeOrTransport === "string" &&
  16636. !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
  16637. options.dataTypes.unshift( dataTypeOrTransport );
  16638. inspect( dataTypeOrTransport );
  16639. return false;
  16640. } else if ( seekingTransport ) {
  16641. return !( selected = dataTypeOrTransport );
  16642. }
  16643. } );
  16644. return selected;
  16645. }
  16646. return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
  16647. }
  16648. // A special extend for ajax options
  16649. // that takes "flat" options (not to be deep extended)
  16650. // Fixes #9887
  16651. function ajaxExtend( target, src ) {
  16652. var key, deep,
  16653. flatOptions = jQuery.ajaxSettings.flatOptions || {};
  16654. for ( key in src ) {
  16655. if ( src[ key ] !== undefined ) {
  16656. ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
  16657. }
  16658. }
  16659. if ( deep ) {
  16660. jQuery.extend( true, target, deep );
  16661. }
  16662. return target;
  16663. }
  16664. /* Handles responses to an ajax request:
  16665. * - finds the right dataType (mediates between content-type and expected dataType)
  16666. * - returns the corresponding response
  16667. */
  16668. function ajaxHandleResponses( s, jqXHR, responses ) {
  16669. var ct, type, finalDataType, firstDataType,
  16670. contents = s.contents,
  16671. dataTypes = s.dataTypes;
  16672. // Remove auto dataType and get content-type in the process
  16673. while ( dataTypes[ 0 ] === "*" ) {
  16674. dataTypes.shift();
  16675. if ( ct === undefined ) {
  16676. ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" );
  16677. }
  16678. }
  16679. // Check if we're dealing with a known content-type
  16680. if ( ct ) {
  16681. for ( type in contents ) {
  16682. if ( contents[ type ] && contents[ type ].test( ct ) ) {
  16683. dataTypes.unshift( type );
  16684. break;
  16685. }
  16686. }
  16687. }
  16688. // Check to see if we have a response for the expected dataType
  16689. if ( dataTypes[ 0 ] in responses ) {
  16690. finalDataType = dataTypes[ 0 ];
  16691. } else {
  16692. // Try convertible dataTypes
  16693. for ( type in responses ) {
  16694. if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) {
  16695. finalDataType = type;
  16696. break;
  16697. }
  16698. if ( !firstDataType ) {
  16699. firstDataType = type;
  16700. }
  16701. }
  16702. // Or just use first one
  16703. finalDataType = finalDataType || firstDataType;
  16704. }
  16705. // If we found a dataType
  16706. // We add the dataType to the list if needed
  16707. // and return the corresponding response
  16708. if ( finalDataType ) {
  16709. if ( finalDataType !== dataTypes[ 0 ] ) {
  16710. dataTypes.unshift( finalDataType );
  16711. }
  16712. return responses[ finalDataType ];
  16713. }
  16714. }
  16715. /* Chain conversions given the request and the original response
  16716. * Also sets the responseXXX fields on the jqXHR instance
  16717. */
  16718. function ajaxConvert( s, response, jqXHR, isSuccess ) {
  16719. var conv2, current, conv, tmp, prev,
  16720. converters = {},
  16721. // Work with a copy of dataTypes in case we need to modify it for conversion
  16722. dataTypes = s.dataTypes.slice();
  16723. // Create converters map with lowercased keys
  16724. if ( dataTypes[ 1 ] ) {
  16725. for ( conv in s.converters ) {
  16726. converters[ conv.toLowerCase() ] = s.converters[ conv ];
  16727. }
  16728. }
  16729. current = dataTypes.shift();
  16730. // Convert to each sequential dataType
  16731. while ( current ) {
  16732. if ( s.responseFields[ current ] ) {
  16733. jqXHR[ s.responseFields[ current ] ] = response;
  16734. }
  16735. // Apply the dataFilter if provided
  16736. if ( !prev && isSuccess && s.dataFilter ) {
  16737. response = s.dataFilter( response, s.dataType );
  16738. }
  16739. prev = current;
  16740. current = dataTypes.shift();
  16741. if ( current ) {
  16742. // There's only work to do if current dataType is non-auto
  16743. if ( current === "*" ) {
  16744. current = prev;
  16745. // Convert response if prev dataType is non-auto and differs from current
  16746. } else if ( prev !== "*" && prev !== current ) {
  16747. // Seek a direct converter
  16748. conv = converters[ prev + " " + current ] || converters[ "* " + current ];
  16749. // If none found, seek a pair
  16750. if ( !conv ) {
  16751. for ( conv2 in converters ) {
  16752. // If conv2 outputs current
  16753. tmp = conv2.split( " " );
  16754. if ( tmp[ 1 ] === current ) {
  16755. // If prev can be converted to accepted input
  16756. conv = converters[ prev + " " + tmp[ 0 ] ] ||
  16757. converters[ "* " + tmp[ 0 ] ];
  16758. if ( conv ) {
  16759. // Condense equivalence converters
  16760. if ( conv === true ) {
  16761. conv = converters[ conv2 ];
  16762. // Otherwise, insert the intermediate dataType
  16763. } else if ( converters[ conv2 ] !== true ) {
  16764. current = tmp[ 0 ];
  16765. dataTypes.unshift( tmp[ 1 ] );
  16766. }
  16767. break;
  16768. }
  16769. }
  16770. }
  16771. }
  16772. // Apply converter (if not an equivalence)
  16773. if ( conv !== true ) {
  16774. // Unless errors are allowed to bubble, catch and return them
  16775. if ( conv && s.throws ) {
  16776. response = conv( response );
  16777. } else {
  16778. try {
  16779. response = conv( response );
  16780. } catch ( e ) {
  16781. return {
  16782. state: "parsererror",
  16783. error: conv ? e : "No conversion from " + prev + " to " + current
  16784. };
  16785. }
  16786. }
  16787. }
  16788. }
  16789. }
  16790. }
  16791. return { state: "success", data: response };
  16792. }
  16793. jQuery.extend( {
  16794. // Counter for holding the number of active queries
  16795. active: 0,
  16796. // Last-Modified header cache for next request
  16797. lastModified: {},
  16798. etag: {},
  16799. ajaxSettings: {
  16800. url: location.href,
  16801. type: "GET",
  16802. isLocal: rlocalProtocol.test( location.protocol ),
  16803. global: true,
  16804. processData: true,
  16805. async: true,
  16806. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  16807. /*
  16808. timeout: 0,
  16809. data: null,
  16810. dataType: null,
  16811. username: null,
  16812. password: null,
  16813. cache: null,
  16814. throws: false,
  16815. traditional: false,
  16816. headers: {},
  16817. */
  16818. accepts: {
  16819. "*": allTypes,
  16820. text: "text/plain",
  16821. html: "text/html",
  16822. xml: "application/xml, text/xml",
  16823. json: "application/json, text/javascript"
  16824. },
  16825. contents: {
  16826. xml: /\bxml\b/,
  16827. html: /\bhtml/,
  16828. json: /\bjson\b/
  16829. },
  16830. responseFields: {
  16831. xml: "responseXML",
  16832. text: "responseText",
  16833. json: "responseJSON"
  16834. },
  16835. // Data converters
  16836. // Keys separate source (or catchall "*") and destination types with a single space
  16837. converters: {
  16838. // Convert anything to text
  16839. "* text": String,
  16840. // Text to html (true = no transformation)
  16841. "text html": true,
  16842. // Evaluate text as a json expression
  16843. "text json": JSON.parse,
  16844. // Parse text as xml
  16845. "text xml": jQuery.parseXML
  16846. },
  16847. // For options that shouldn't be deep extended:
  16848. // you can add your own custom options here if
  16849. // and when you create one that shouldn't be
  16850. // deep extended (see ajaxExtend)
  16851. flatOptions: {
  16852. url: true,
  16853. context: true
  16854. }
  16855. },
  16856. // Creates a full fledged settings object into target
  16857. // with both ajaxSettings and settings fields.
  16858. // If target is omitted, writes into ajaxSettings.
  16859. ajaxSetup: function( target, settings ) {
  16860. return settings ?
  16861. // Building a settings object
  16862. ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
  16863. // Extending ajaxSettings
  16864. ajaxExtend( jQuery.ajaxSettings, target );
  16865. },
  16866. ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
  16867. ajaxTransport: addToPrefiltersOrTransports( transports ),
  16868. // Main method
  16869. ajax: function( url, options ) {
  16870. // If url is an object, simulate pre-1.5 signature
  16871. if ( typeof url === "object" ) {
  16872. options = url;
  16873. url = undefined;
  16874. }
  16875. // Force options to be an object
  16876. options = options || {};
  16877. var transport,
  16878. // URL without anti-cache param
  16879. cacheURL,
  16880. // Response headers
  16881. responseHeadersString,
  16882. responseHeaders,
  16883. // timeout handle
  16884. timeoutTimer,
  16885. // Url cleanup var
  16886. urlAnchor,
  16887. // Request state (becomes false upon send and true upon completion)
  16888. completed,
  16889. // To know if global events are to be dispatched
  16890. fireGlobals,
  16891. // Loop variable
  16892. i,
  16893. // uncached part of the url
  16894. uncached,
  16895. // Create the final options object
  16896. s = jQuery.ajaxSetup( {}, options ),
  16897. // Callbacks context
  16898. callbackContext = s.context || s,
  16899. // Context for global events is callbackContext if it is a DOM node or jQuery collection
  16900. globalEventContext = s.context &&
  16901. ( callbackContext.nodeType || callbackContext.jquery ) ?
  16902. jQuery( callbackContext ) :
  16903. jQuery.event,
  16904. // Deferreds
  16905. deferred = jQuery.Deferred(),
  16906. completeDeferred = jQuery.Callbacks( "once memory" ),
  16907. // Status-dependent callbacks
  16908. statusCode = s.statusCode || {},
  16909. // Headers (they are sent all at once)
  16910. requestHeaders = {},
  16911. requestHeadersNames = {},
  16912. // Default abort message
  16913. strAbort = "canceled",
  16914. // Fake xhr
  16915. jqXHR = {
  16916. readyState: 0,
  16917. // Builds headers hashtable if needed
  16918. getResponseHeader: function( key ) {
  16919. var match;
  16920. if ( completed ) {
  16921. if ( !responseHeaders ) {
  16922. responseHeaders = {};
  16923. while ( ( match = rheaders.exec( responseHeadersString ) ) ) {
  16924. responseHeaders[ match[ 1 ].toLowerCase() + " " ] =
  16925. ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] )
  16926. .concat( match[ 2 ] );
  16927. }
  16928. }
  16929. match = responseHeaders[ key.toLowerCase() + " " ];
  16930. }
  16931. return match == null ? null : match.join( ", " );
  16932. },
  16933. // Raw string
  16934. getAllResponseHeaders: function() {
  16935. return completed ? responseHeadersString : null;
  16936. },
  16937. // Caches the header
  16938. setRequestHeader: function( name, value ) {
  16939. if ( completed == null ) {
  16940. name = requestHeadersNames[ name.toLowerCase() ] =
  16941. requestHeadersNames[ name.toLowerCase() ] || name;
  16942. requestHeaders[ name ] = value;
  16943. }
  16944. return this;
  16945. },
  16946. // Overrides response content-type header
  16947. overrideMimeType: function( type ) {
  16948. if ( completed == null ) {
  16949. s.mimeType = type;
  16950. }
  16951. return this;
  16952. },
  16953. // Status-dependent callbacks
  16954. statusCode: function( map ) {
  16955. var code;
  16956. if ( map ) {
  16957. if ( completed ) {
  16958. // Execute the appropriate callbacks
  16959. jqXHR.always( map[ jqXHR.status ] );
  16960. } else {
  16961. // Lazy-add the new callbacks in a way that preserves old ones
  16962. for ( code in map ) {
  16963. statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
  16964. }
  16965. }
  16966. }
  16967. return this;
  16968. },
  16969. // Cancel the request
  16970. abort: function( statusText ) {
  16971. var finalText = statusText || strAbort;
  16972. if ( transport ) {
  16973. transport.abort( finalText );
  16974. }
  16975. done( 0, finalText );
  16976. return this;
  16977. }
  16978. };
  16979. // Attach deferreds
  16980. deferred.promise( jqXHR );
  16981. // Add protocol if not provided (prefilters might expect it)
  16982. // Handle falsy url in the settings object (#10093: consistency with old signature)
  16983. // We also use the url parameter if available
  16984. s.url = ( ( url || s.url || location.href ) + "" )
  16985. .replace( rprotocol, location.protocol + "//" );
  16986. // Alias method option to type as per ticket #12004
  16987. s.type = options.method || options.type || s.method || s.type;
  16988. // Extract dataTypes list
  16989. s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ];
  16990. // A cross-domain request is in order when the origin doesn't match the current origin.
  16991. if ( s.crossDomain == null ) {
  16992. urlAnchor = document.createElement( "a" );
  16993. // Support: IE <=8 - 11, Edge 12 - 15
  16994. // IE throws exception on accessing the href property if url is malformed,
  16995. // e.g. http://example.com:80x/
  16996. try {
  16997. urlAnchor.href = s.url;
  16998. // Support: IE <=8 - 11 only
  16999. // Anchor's host property isn't correctly set when s.url is relative
  17000. urlAnchor.href = urlAnchor.href;
  17001. s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !==
  17002. urlAnchor.protocol + "//" + urlAnchor.host;
  17003. } catch ( e ) {
  17004. // If there is an error parsing the URL, assume it is crossDomain,
  17005. // it can be rejected by the transport if it is invalid
  17006. s.crossDomain = true;
  17007. }
  17008. }
  17009. // Convert data if not already a string
  17010. if ( s.data && s.processData && typeof s.data !== "string" ) {
  17011. s.data = jQuery.param( s.data, s.traditional );
  17012. }
  17013. // Apply prefilters
  17014. inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
  17015. // If request was aborted inside a prefilter, stop there
  17016. if ( completed ) {
  17017. return jqXHR;
  17018. }
  17019. // We can fire global events as of now if asked to
  17020. // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
  17021. fireGlobals = jQuery.event && s.global;
  17022. // Watch for a new set of requests
  17023. if ( fireGlobals && jQuery.active++ === 0 ) {
  17024. jQuery.event.trigger( "ajaxStart" );
  17025. }
  17026. // Uppercase the type
  17027. s.type = s.type.toUpperCase();
  17028. // Determine if request has content
  17029. s.hasContent = !rnoContent.test( s.type );
  17030. // Save the URL in case we're toying with the If-Modified-Since
  17031. // and/or If-None-Match header later on
  17032. // Remove hash to simplify url manipulation
  17033. cacheURL = s.url.replace( rhash, "" );
  17034. // More options handling for requests with no content
  17035. if ( !s.hasContent ) {
  17036. // Remember the hash so we can put it back
  17037. uncached = s.url.slice( cacheURL.length );
  17038. // If data is available and should be processed, append data to url
  17039. if ( s.data && ( s.processData || typeof s.data === "string" ) ) {
  17040. cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data;
  17041. // #9682: remove data so that it's not used in an eventual retry
  17042. delete s.data;
  17043. }
  17044. // Add or update anti-cache param if needed
  17045. if ( s.cache === false ) {
  17046. cacheURL = cacheURL.replace( rantiCache, "$1" );
  17047. uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce++ ) + uncached;
  17048. }
  17049. // Put hash and anti-cache on the URL that will be requested (gh-1732)
  17050. s.url = cacheURL + uncached;
  17051. // Change '%20' to '+' if this is encoded form body content (gh-2658)
  17052. } else if ( s.data && s.processData &&
  17053. ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) {
  17054. s.data = s.data.replace( r20, "+" );
  17055. }
  17056. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  17057. if ( s.ifModified ) {
  17058. if ( jQuery.lastModified[ cacheURL ] ) {
  17059. jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
  17060. }
  17061. if ( jQuery.etag[ cacheURL ] ) {
  17062. jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
  17063. }
  17064. }
  17065. // Set the correct header, if data is being sent
  17066. if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
  17067. jqXHR.setRequestHeader( "Content-Type", s.contentType );
  17068. }
  17069. // Set the Accepts header for the server, depending on the dataType
  17070. jqXHR.setRequestHeader(
  17071. "Accept",
  17072. s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?
  17073. s.accepts[ s.dataTypes[ 0 ] ] +
  17074. ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
  17075. s.accepts[ "*" ]
  17076. );
  17077. // Check for headers option
  17078. for ( i in s.headers ) {
  17079. jqXHR.setRequestHeader( i, s.headers[ i ] );
  17080. }
  17081. // Allow custom headers/mimetypes and early abort
  17082. if ( s.beforeSend &&
  17083. ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) {
  17084. // Abort if not done already and return
  17085. return jqXHR.abort();
  17086. }
  17087. // Aborting is no longer a cancellation
  17088. strAbort = "abort";
  17089. // Install callbacks on deferreds
  17090. completeDeferred.add( s.complete );
  17091. jqXHR.done( s.success );
  17092. jqXHR.fail( s.error );
  17093. // Get transport
  17094. transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
  17095. // If no transport, we auto-abort
  17096. if ( !transport ) {
  17097. done( -1, "No Transport" );
  17098. } else {
  17099. jqXHR.readyState = 1;
  17100. // Send global event
  17101. if ( fireGlobals ) {
  17102. globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
  17103. }
  17104. // If request was aborted inside ajaxSend, stop there
  17105. if ( completed ) {
  17106. return jqXHR;
  17107. }
  17108. // Timeout
  17109. if ( s.async && s.timeout > 0 ) {
  17110. timeoutTimer = window.setTimeout( function() {
  17111. jqXHR.abort( "timeout" );
  17112. }, s.timeout );
  17113. }
  17114. try {
  17115. completed = false;
  17116. transport.send( requestHeaders, done );
  17117. } catch ( e ) {
  17118. // Rethrow post-completion exceptions
  17119. if ( completed ) {
  17120. throw e;
  17121. }
  17122. // Propagate others as results
  17123. done( -1, e );
  17124. }
  17125. }
  17126. // Callback for when everything is done
  17127. function done( status, nativeStatusText, responses, headers ) {
  17128. var isSuccess, success, error, response, modified,
  17129. statusText = nativeStatusText;
  17130. // Ignore repeat invocations
  17131. if ( completed ) {
  17132. return;
  17133. }
  17134. completed = true;
  17135. // Clear timeout if it exists
  17136. if ( timeoutTimer ) {
  17137. window.clearTimeout( timeoutTimer );
  17138. }
  17139. // Dereference transport for early garbage collection
  17140. // (no matter how long the jqXHR object will be used)
  17141. transport = undefined;
  17142. // Cache response headers
  17143. responseHeadersString = headers || "";
  17144. // Set readyState
  17145. jqXHR.readyState = status > 0 ? 4 : 0;
  17146. // Determine if successful
  17147. isSuccess = status >= 200 && status < 300 || status === 304;
  17148. // Get response data
  17149. if ( responses ) {
  17150. response = ajaxHandleResponses( s, jqXHR, responses );
  17151. }
  17152. // Convert no matter what (that way responseXXX fields are always set)
  17153. response = ajaxConvert( s, response, jqXHR, isSuccess );
  17154. // If successful, handle type chaining
  17155. if ( isSuccess ) {
  17156. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  17157. if ( s.ifModified ) {
  17158. modified = jqXHR.getResponseHeader( "Last-Modified" );
  17159. if ( modified ) {
  17160. jQuery.lastModified[ cacheURL ] = modified;
  17161. }
  17162. modified = jqXHR.getResponseHeader( "etag" );
  17163. if ( modified ) {
  17164. jQuery.etag[ cacheURL ] = modified;
  17165. }
  17166. }
  17167. // if no content
  17168. if ( status === 204 || s.type === "HEAD" ) {
  17169. statusText = "nocontent";
  17170. // if not modified
  17171. } else if ( status === 304 ) {
  17172. statusText = "notmodified";
  17173. // If we have data, let's convert it
  17174. } else {
  17175. statusText = response.state;
  17176. success = response.data;
  17177. error = response.error;
  17178. isSuccess = !error;
  17179. }
  17180. } else {
  17181. // Extract error from statusText and normalize for non-aborts
  17182. error = statusText;
  17183. if ( status || !statusText ) {
  17184. statusText = "error";
  17185. if ( status < 0 ) {
  17186. status = 0;
  17187. }
  17188. }
  17189. }
  17190. // Set data for the fake xhr object
  17191. jqXHR.status = status;
  17192. jqXHR.statusText = ( nativeStatusText || statusText ) + "";
  17193. // Success/Error
  17194. if ( isSuccess ) {
  17195. deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
  17196. } else {
  17197. deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
  17198. }
  17199. // Status-dependent callbacks
  17200. jqXHR.statusCode( statusCode );
  17201. statusCode = undefined;
  17202. if ( fireGlobals ) {
  17203. globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
  17204. [ jqXHR, s, isSuccess ? success : error ] );
  17205. }
  17206. // Complete
  17207. completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
  17208. if ( fireGlobals ) {
  17209. globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
  17210. // Handle the global AJAX counter
  17211. if ( !( --jQuery.active ) ) {
  17212. jQuery.event.trigger( "ajaxStop" );
  17213. }
  17214. }
  17215. }
  17216. return jqXHR;
  17217. },
  17218. getJSON: function( url, data, callback ) {
  17219. return jQuery.get( url, data, callback, "json" );
  17220. },
  17221. getScript: function( url, callback ) {
  17222. return jQuery.get( url, undefined, callback, "script" );
  17223. }
  17224. } );
  17225. jQuery.each( [ "get", "post" ], function( i, method ) {
  17226. jQuery[ method ] = function( url, data, callback, type ) {
  17227. // Shift arguments if data argument was omitted
  17228. if ( isFunction( data ) ) {
  17229. type = type || callback;
  17230. callback = data;
  17231. data = undefined;
  17232. }
  17233. // The url can be an options object (which then must have .url)
  17234. return jQuery.ajax( jQuery.extend( {
  17235. url: url,
  17236. type: method,
  17237. dataType: type,
  17238. data: data,
  17239. success: callback
  17240. }, jQuery.isPlainObject( url ) && url ) );
  17241. };
  17242. } );
  17243. jQuery._evalUrl = function( url, options ) {
  17244. return jQuery.ajax( {
  17245. url: url,
  17246. // Make this explicit, since user can override this through ajaxSetup (#11264)
  17247. type: "GET",
  17248. dataType: "script",
  17249. cache: true,
  17250. async: false,
  17251. global: false,
  17252. // Only evaluate the response if it is successful (gh-4126)
  17253. // dataFilter is not invoked for failure responses, so using it instead
  17254. // of the default converter is kludgy but it works.
  17255. converters: {
  17256. "text script": function() {}
  17257. },
  17258. dataFilter: function( response ) {
  17259. jQuery.globalEval( response, options );
  17260. }
  17261. } );
  17262. };
  17263. jQuery.fn.extend( {
  17264. wrapAll: function( html ) {
  17265. var wrap;
  17266. if ( this[ 0 ] ) {
  17267. if ( isFunction( html ) ) {
  17268. html = html.call( this[ 0 ] );
  17269. }
  17270. // The elements to wrap the target around
  17271. wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
  17272. if ( this[ 0 ].parentNode ) {
  17273. wrap.insertBefore( this[ 0 ] );
  17274. }
  17275. wrap.map( function() {
  17276. var elem = this;
  17277. while ( elem.firstElementChild ) {
  17278. elem = elem.firstElementChild;
  17279. }
  17280. return elem;
  17281. } ).append( this );
  17282. }
  17283. return this;
  17284. },
  17285. wrapInner: function( html ) {
  17286. if ( isFunction( html ) ) {
  17287. return this.each( function( i ) {
  17288. jQuery( this ).wrapInner( html.call( this, i ) );
  17289. } );
  17290. }
  17291. return this.each( function() {
  17292. var self = jQuery( this ),
  17293. contents = self.contents();
  17294. if ( contents.length ) {
  17295. contents.wrapAll( html );
  17296. } else {
  17297. self.append( html );
  17298. }
  17299. } );
  17300. },
  17301. wrap: function( html ) {
  17302. var htmlIsFunction = isFunction( html );
  17303. return this.each( function( i ) {
  17304. jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html );
  17305. } );
  17306. },
  17307. unwrap: function( selector ) {
  17308. this.parent( selector ).not( "body" ).each( function() {
  17309. jQuery( this ).replaceWith( this.childNodes );
  17310. } );
  17311. return this;
  17312. }
  17313. } );
  17314. jQuery.expr.pseudos.hidden = function( elem ) {
  17315. return !jQuery.expr.pseudos.visible( elem );
  17316. };
  17317. jQuery.expr.pseudos.visible = function( elem ) {
  17318. return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );
  17319. };
  17320. jQuery.ajaxSettings.xhr = function() {
  17321. try {
  17322. return new window.XMLHttpRequest();
  17323. } catch ( e ) {}
  17324. };
  17325. var xhrSuccessStatus = {
  17326. // File protocol always yields status code 0, assume 200
  17327. 0: 200,
  17328. // Support: IE <=9 only
  17329. // #1450: sometimes IE returns 1223 when it should be 204
  17330. 1223: 204
  17331. },
  17332. xhrSupported = jQuery.ajaxSettings.xhr();
  17333. support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
  17334. support.ajax = xhrSupported = !!xhrSupported;
  17335. jQuery.ajaxTransport( function( options ) {
  17336. var callback, errorCallback;
  17337. // Cross domain only allowed if supported through XMLHttpRequest
  17338. if ( support.cors || xhrSupported && !options.crossDomain ) {
  17339. return {
  17340. send: function( headers, complete ) {
  17341. var i,
  17342. xhr = options.xhr();
  17343. xhr.open(
  17344. options.type,
  17345. options.url,
  17346. options.async,
  17347. options.username,
  17348. options.password
  17349. );
  17350. // Apply custom fields if provided
  17351. if ( options.xhrFields ) {
  17352. for ( i in options.xhrFields ) {
  17353. xhr[ i ] = options.xhrFields[ i ];
  17354. }
  17355. }
  17356. // Override mime type if needed
  17357. if ( options.mimeType && xhr.overrideMimeType ) {
  17358. xhr.overrideMimeType( options.mimeType );
  17359. }
  17360. // X-Requested-With header
  17361. // For cross-domain requests, seeing as conditions for a preflight are
  17362. // akin to a jigsaw puzzle, we simply never set it to be sure.
  17363. // (it can always be set on a per-request basis or even using ajaxSetup)
  17364. // For same-domain requests, won't change header if already provided.
  17365. if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) {
  17366. headers[ "X-Requested-With" ] = "XMLHttpRequest";
  17367. }
  17368. // Set headers
  17369. for ( i in headers ) {
  17370. xhr.setRequestHeader( i, headers[ i ] );
  17371. }
  17372. // Callback
  17373. callback = function( type ) {
  17374. return function() {
  17375. if ( callback ) {
  17376. callback = errorCallback = xhr.onload =
  17377. xhr.onerror = xhr.onabort = xhr.ontimeout =
  17378. xhr.onreadystatechange = null;
  17379. if ( type === "abort" ) {
  17380. xhr.abort();
  17381. } else if ( type === "error" ) {
  17382. // Support: IE <=9 only
  17383. // On a manual native abort, IE9 throws
  17384. // errors on any property access that is not readyState
  17385. if ( typeof xhr.status !== "number" ) {
  17386. complete( 0, "error" );
  17387. } else {
  17388. complete(
  17389. // File: protocol always yields status 0; see #8605, #14207
  17390. xhr.status,
  17391. xhr.statusText
  17392. );
  17393. }
  17394. } else {
  17395. complete(
  17396. xhrSuccessStatus[ xhr.status ] || xhr.status,
  17397. xhr.statusText,
  17398. // Support: IE <=9 only
  17399. // IE9 has no XHR2 but throws on binary (trac-11426)
  17400. // For XHR2 non-text, let the caller handle it (gh-2498)
  17401. ( xhr.responseType || "text" ) !== "text" ||
  17402. typeof xhr.responseText !== "string" ?
  17403. { binary: xhr.response } :
  17404. { text: xhr.responseText },
  17405. xhr.getAllResponseHeaders()
  17406. );
  17407. }
  17408. }
  17409. };
  17410. };
  17411. // Listen to events
  17412. xhr.onload = callback();
  17413. errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" );
  17414. // Support: IE 9 only
  17415. // Use onreadystatechange to replace onabort
  17416. // to handle uncaught aborts
  17417. if ( xhr.onabort !== undefined ) {
  17418. xhr.onabort = errorCallback;
  17419. } else {
  17420. xhr.onreadystatechange = function() {
  17421. // Check readyState before timeout as it changes
  17422. if ( xhr.readyState === 4 ) {
  17423. // Allow onerror to be called first,
  17424. // but that will not handle a native abort
  17425. // Also, save errorCallback to a variable
  17426. // as xhr.onerror cannot be accessed
  17427. window.setTimeout( function() {
  17428. if ( callback ) {
  17429. errorCallback();
  17430. }
  17431. } );
  17432. }
  17433. };
  17434. }
  17435. // Create the abort callback
  17436. callback = callback( "abort" );
  17437. try {
  17438. // Do send the request (this may raise an exception)
  17439. xhr.send( options.hasContent && options.data || null );
  17440. } catch ( e ) {
  17441. // #14683: Only rethrow if this hasn't been notified as an error yet
  17442. if ( callback ) {
  17443. throw e;
  17444. }
  17445. }
  17446. },
  17447. abort: function() {
  17448. if ( callback ) {
  17449. callback();
  17450. }
  17451. }
  17452. };
  17453. }
  17454. } );
  17455. // Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)
  17456. jQuery.ajaxPrefilter( function( s ) {
  17457. if ( s.crossDomain ) {
  17458. s.contents.script = false;
  17459. }
  17460. } );
  17461. // Install script dataType
  17462. jQuery.ajaxSetup( {
  17463. accepts: {
  17464. script: "text/javascript, application/javascript, " +
  17465. "application/ecmascript, application/x-ecmascript"
  17466. },
  17467. contents: {
  17468. script: /\b(?:java|ecma)script\b/
  17469. },
  17470. converters: {
  17471. "text script": function( text ) {
  17472. jQuery.globalEval( text );
  17473. return text;
  17474. }
  17475. }
  17476. } );
  17477. // Handle cache's special case and crossDomain
  17478. jQuery.ajaxPrefilter( "script", function( s ) {
  17479. if ( s.cache === undefined ) {
  17480. s.cache = false;
  17481. }
  17482. if ( s.crossDomain ) {
  17483. s.type = "GET";
  17484. }
  17485. } );
  17486. // Bind script tag hack transport
  17487. jQuery.ajaxTransport( "script", function( s ) {
  17488. // This transport only deals with cross domain or forced-by-attrs requests
  17489. if ( s.crossDomain || s.scriptAttrs ) {
  17490. var script, callback;
  17491. return {
  17492. send: function( _, complete ) {
  17493. script = jQuery( "<script>" )
  17494. .attr( s.scriptAttrs || {} )
  17495. .prop( { charset: s.scriptCharset, src: s.url } )
  17496. .on( "load error", callback = function( evt ) {
  17497. script.remove();
  17498. callback = null;
  17499. if ( evt ) {
  17500. complete( evt.type === "error" ? 404 : 200, evt.type );
  17501. }
  17502. } );
  17503. // Use native DOM manipulation to avoid our domManip AJAX trickery
  17504. document.head.appendChild( script[ 0 ] );
  17505. },
  17506. abort: function() {
  17507. if ( callback ) {
  17508. callback();
  17509. }
  17510. }
  17511. };
  17512. }
  17513. } );
  17514. var oldCallbacks = [],
  17515. rjsonp = /(=)\?(?=&|$)|\?\?/;
  17516. // Default jsonp settings
  17517. jQuery.ajaxSetup( {
  17518. jsonp: "callback",
  17519. jsonpCallback: function() {
  17520. var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
  17521. this[ callback ] = true;
  17522. return callback;
  17523. }
  17524. } );
  17525. // Detect, normalize options and install callbacks for jsonp requests
  17526. jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
  17527. var callbackName, overwritten, responseContainer,
  17528. jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
  17529. "url" :
  17530. typeof s.data === "string" &&
  17531. ( s.contentType || "" )
  17532. .indexOf( "application/x-www-form-urlencoded" ) === 0 &&
  17533. rjsonp.test( s.data ) && "data"
  17534. );
  17535. // Handle iff the expected data type is "jsonp" or we have a parameter to set
  17536. if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
  17537. // Get callback name, remembering preexisting value associated with it
  17538. callbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ?
  17539. s.jsonpCallback() :
  17540. s.jsonpCallback;
  17541. // Insert callback into url or form data
  17542. if ( jsonProp ) {
  17543. s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
  17544. } else if ( s.jsonp !== false ) {
  17545. s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
  17546. }
  17547. // Use data converter to retrieve json after script execution
  17548. s.converters[ "script json" ] = function() {
  17549. if ( !responseContainer ) {
  17550. jQuery.error( callbackName + " was not called" );
  17551. }
  17552. return responseContainer[ 0 ];
  17553. };
  17554. // Force json dataType
  17555. s.dataTypes[ 0 ] = "json";
  17556. // Install callback
  17557. overwritten = window[ callbackName ];
  17558. window[ callbackName ] = function() {
  17559. responseContainer = arguments;
  17560. };
  17561. // Clean-up function (fires after converters)
  17562. jqXHR.always( function() {
  17563. // If previous value didn't exist - remove it
  17564. if ( overwritten === undefined ) {
  17565. jQuery( window ).removeProp( callbackName );
  17566. // Otherwise restore preexisting value
  17567. } else {
  17568. window[ callbackName ] = overwritten;
  17569. }
  17570. // Save back as free
  17571. if ( s[ callbackName ] ) {
  17572. // Make sure that re-using the options doesn't screw things around
  17573. s.jsonpCallback = originalSettings.jsonpCallback;
  17574. // Save the callback name for future use
  17575. oldCallbacks.push( callbackName );
  17576. }
  17577. // Call if it was a function and we have a response
  17578. if ( responseContainer && isFunction( overwritten ) ) {
  17579. overwritten( responseContainer[ 0 ] );
  17580. }
  17581. responseContainer = overwritten = undefined;
  17582. } );
  17583. // Delegate to script
  17584. return "script";
  17585. }
  17586. } );
  17587. // Support: Safari 8 only
  17588. // In Safari 8 documents created via document.implementation.createHTMLDocument
  17589. // collapse sibling forms: the second one becomes a child of the first one.
  17590. // Because of that, this security measure has to be disabled in Safari 8.
  17591. // https://bugs.webkit.org/show_bug.cgi?id=137337
  17592. support.createHTMLDocument = ( function() {
  17593. var body = document.implementation.createHTMLDocument( "" ).body;
  17594. body.innerHTML = "<form></form><form></form>";
  17595. return body.childNodes.length === 2;
  17596. } )();
  17597. // Argument "data" should be string of html
  17598. // context (optional): If specified, the fragment will be created in this context,
  17599. // defaults to document
  17600. // keepScripts (optional): If true, will include scripts passed in the html string
  17601. jQuery.parseHTML = function( data, context, keepScripts ) {
  17602. if ( typeof data !== "string" ) {
  17603. return [];
  17604. }
  17605. if ( typeof context === "boolean" ) {
  17606. keepScripts = context;
  17607. context = false;
  17608. }
  17609. var base, parsed, scripts;
  17610. if ( !context ) {
  17611. // Stop scripts or inline event handlers from being executed immediately
  17612. // by using document.implementation
  17613. if ( support.createHTMLDocument ) {
  17614. context = document.implementation.createHTMLDocument( "" );
  17615. // Set the base href for the created document
  17616. // so any parsed elements with URLs
  17617. // are based on the document's URL (gh-2965)
  17618. base = context.createElement( "base" );
  17619. base.href = document.location.href;
  17620. context.head.appendChild( base );
  17621. } else {
  17622. context = document;
  17623. }
  17624. }
  17625. parsed = rsingleTag.exec( data );
  17626. scripts = !keepScripts && [];
  17627. // Single tag
  17628. if ( parsed ) {
  17629. return [ context.createElement( parsed[ 1 ] ) ];
  17630. }
  17631. parsed = buildFragment( [ data ], context, scripts );
  17632. if ( scripts && scripts.length ) {
  17633. jQuery( scripts ).remove();
  17634. }
  17635. return jQuery.merge( [], parsed.childNodes );
  17636. };
  17637. /**
  17638. * Load a url into a page
  17639. */
  17640. jQuery.fn.load = function( url, params, callback ) {
  17641. var selector, type, response,
  17642. self = this,
  17643. off = url.indexOf( " " );
  17644. if ( off > -1 ) {
  17645. selector = stripAndCollapse( url.slice( off ) );
  17646. url = url.slice( 0, off );
  17647. }
  17648. // If it's a function
  17649. if ( isFunction( params ) ) {
  17650. // We assume that it's the callback
  17651. callback = params;
  17652. params = undefined;
  17653. // Otherwise, build a param string
  17654. } else if ( params && typeof params === "object" ) {
  17655. type = "POST";
  17656. }
  17657. // If we have elements to modify, make the request
  17658. if ( self.length > 0 ) {
  17659. jQuery.ajax( {
  17660. url: url,
  17661. // If "type" variable is undefined, then "GET" method will be used.
  17662. // Make value of this field explicit since
  17663. // user can override it through ajaxSetup method
  17664. type: type || "GET",
  17665. dataType: "html",
  17666. data: params
  17667. } ).done( function( responseText ) {
  17668. // Save response for use in complete callback
  17669. response = arguments;
  17670. self.html( selector ?
  17671. // If a selector was specified, locate the right elements in a dummy div
  17672. // Exclude scripts to avoid IE 'Permission Denied' errors
  17673. jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :
  17674. // Otherwise use the full result
  17675. responseText );
  17676. // If the request succeeds, this function gets "data", "status", "jqXHR"
  17677. // but they are ignored because response was set above.
  17678. // If it fails, this function gets "jqXHR", "status", "error"
  17679. } ).always( callback && function( jqXHR, status ) {
  17680. self.each( function() {
  17681. callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );
  17682. } );
  17683. } );
  17684. }
  17685. return this;
  17686. };
  17687. // Attach a bunch of functions for handling common AJAX events
  17688. jQuery.each( [
  17689. "ajaxStart",
  17690. "ajaxStop",
  17691. "ajaxComplete",
  17692. "ajaxError",
  17693. "ajaxSuccess",
  17694. "ajaxSend"
  17695. ], function( i, type ) {
  17696. jQuery.fn[ type ] = function( fn ) {
  17697. return this.on( type, fn );
  17698. };
  17699. } );
  17700. jQuery.expr.pseudos.animated = function( elem ) {
  17701. return jQuery.grep( jQuery.timers, function( fn ) {
  17702. return elem === fn.elem;
  17703. } ).length;
  17704. };
  17705. jQuery.offset = {
  17706. setOffset: function( elem, options, i ) {
  17707. var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
  17708. position = jQuery.css( elem, "position" ),
  17709. curElem = jQuery( elem ),
  17710. props = {};
  17711. // Set position first, in-case top/left are set even on static elem
  17712. if ( position === "static" ) {
  17713. elem.style.position = "relative";
  17714. }
  17715. curOffset = curElem.offset();
  17716. curCSSTop = jQuery.css( elem, "top" );
  17717. curCSSLeft = jQuery.css( elem, "left" );
  17718. calculatePosition = ( position === "absolute" || position === "fixed" ) &&
  17719. ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1;
  17720. // Need to be able to calculate position if either
  17721. // top or left is auto and position is either absolute or fixed
  17722. if ( calculatePosition ) {
  17723. curPosition = curElem.position();
  17724. curTop = curPosition.top;
  17725. curLeft = curPosition.left;
  17726. } else {
  17727. curTop = parseFloat( curCSSTop ) || 0;
  17728. curLeft = parseFloat( curCSSLeft ) || 0;
  17729. }
  17730. if ( isFunction( options ) ) {
  17731. // Use jQuery.extend here to allow modification of coordinates argument (gh-1848)
  17732. options = options.call( elem, i, jQuery.extend( {}, curOffset ) );
  17733. }
  17734. if ( options.top != null ) {
  17735. props.top = ( options.top - curOffset.top ) + curTop;
  17736. }
  17737. if ( options.left != null ) {
  17738. props.left = ( options.left - curOffset.left ) + curLeft;
  17739. }
  17740. if ( "using" in options ) {
  17741. options.using.call( elem, props );
  17742. } else {
  17743. curElem.css( props );
  17744. }
  17745. }
  17746. };
  17747. jQuery.fn.extend( {
  17748. // offset() relates an element's border box to the document origin
  17749. offset: function( options ) {
  17750. // Preserve chaining for setter
  17751. if ( arguments.length ) {
  17752. return options === undefined ?
  17753. this :
  17754. this.each( function( i ) {
  17755. jQuery.offset.setOffset( this, options, i );
  17756. } );
  17757. }
  17758. var rect, win,
  17759. elem = this[ 0 ];
  17760. if ( !elem ) {
  17761. return;
  17762. }
  17763. // Return zeros for disconnected and hidden (display: none) elements (gh-2310)
  17764. // Support: IE <=11 only
  17765. // Running getBoundingClientRect on a
  17766. // disconnected node in IE throws an error
  17767. if ( !elem.getClientRects().length ) {
  17768. return { top: 0, left: 0 };
  17769. }
  17770. // Get document-relative position by adding viewport scroll to viewport-relative gBCR
  17771. rect = elem.getBoundingClientRect();
  17772. win = elem.ownerDocument.defaultView;
  17773. return {
  17774. top: rect.top + win.pageYOffset,
  17775. left: rect.left + win.pageXOffset
  17776. };
  17777. },
  17778. // position() relates an element's margin box to its offset parent's padding box
  17779. // This corresponds to the behavior of CSS absolute positioning
  17780. position: function() {
  17781. if ( !this[ 0 ] ) {
  17782. return;
  17783. }
  17784. var offsetParent, offset, doc,
  17785. elem = this[ 0 ],
  17786. parentOffset = { top: 0, left: 0 };
  17787. // position:fixed elements are offset from the viewport, which itself always has zero offset
  17788. if ( jQuery.css( elem, "position" ) === "fixed" ) {
  17789. // Assume position:fixed implies availability of getBoundingClientRect
  17790. offset = elem.getBoundingClientRect();
  17791. } else {
  17792. offset = this.offset();
  17793. // Account for the *real* offset parent, which can be the document or its root element
  17794. // when a statically positioned element is identified
  17795. doc = elem.ownerDocument;
  17796. offsetParent = elem.offsetParent || doc.documentElement;
  17797. while ( offsetParent &&
  17798. ( offsetParent === doc.body || offsetParent === doc.documentElement ) &&
  17799. jQuery.css( offsetParent, "position" ) === "static" ) {
  17800. offsetParent = offsetParent.parentNode;
  17801. }
  17802. if ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) {
  17803. // Incorporate borders into its offset, since they are outside its content origin
  17804. parentOffset = jQuery( offsetParent ).offset();
  17805. parentOffset.top += jQuery.css( offsetParent, "borderTopWidth", true );
  17806. parentOffset.left += jQuery.css( offsetParent, "borderLeftWidth", true );
  17807. }
  17808. }
  17809. // Subtract parent offsets and element margins
  17810. return {
  17811. top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
  17812. left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
  17813. };
  17814. },
  17815. // This method will return documentElement in the following cases:
  17816. // 1) For the element inside the iframe without offsetParent, this method will return
  17817. // documentElement of the parent window
  17818. // 2) For the hidden or detached element
  17819. // 3) For body or html element, i.e. in case of the html node - it will return itself
  17820. //
  17821. // but those exceptions were never presented as a real life use-cases
  17822. // and might be considered as more preferable results.
  17823. //
  17824. // This logic, however, is not guaranteed and can change at any point in the future
  17825. offsetParent: function() {
  17826. return this.map( function() {
  17827. var offsetParent = this.offsetParent;
  17828. while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) {
  17829. offsetParent = offsetParent.offsetParent;
  17830. }
  17831. return offsetParent || documentElement;
  17832. } );
  17833. }
  17834. } );
  17835. // Create scrollLeft and scrollTop methods
  17836. jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
  17837. var top = "pageYOffset" === prop;
  17838. jQuery.fn[ method ] = function( val ) {
  17839. return access( this, function( elem, method, val ) {
  17840. // Coalesce documents and windows
  17841. var win;
  17842. if ( isWindow( elem ) ) {
  17843. win = elem;
  17844. } else if ( elem.nodeType === 9 ) {
  17845. win = elem.defaultView;
  17846. }
  17847. if ( val === undefined ) {
  17848. return win ? win[ prop ] : elem[ method ];
  17849. }
  17850. if ( win ) {
  17851. win.scrollTo(
  17852. !top ? val : win.pageXOffset,
  17853. top ? val : win.pageYOffset
  17854. );
  17855. } else {
  17856. elem[ method ] = val;
  17857. }
  17858. }, method, val, arguments.length );
  17859. };
  17860. } );
  17861. // Support: Safari <=7 - 9.1, Chrome <=37 - 49
  17862. // Add the top/left cssHooks using jQuery.fn.position
  17863. // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
  17864. // Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347
  17865. // getComputedStyle returns percent when specified for top/left/bottom/right;
  17866. // rather than make the css module depend on the offset module, just check for it here
  17867. jQuery.each( [ "top", "left" ], function( i, prop ) {
  17868. jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
  17869. function( elem, computed ) {
  17870. if ( computed ) {
  17871. computed = curCSS( elem, prop );
  17872. // If curCSS returns percentage, fallback to offset
  17873. return rnumnonpx.test( computed ) ?
  17874. jQuery( elem ).position()[ prop ] + "px" :
  17875. computed;
  17876. }
  17877. }
  17878. );
  17879. } );
  17880. // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
  17881. jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
  17882. jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name },
  17883. function( defaultExtra, funcName ) {
  17884. // Margin is only for outerHeight, outerWidth
  17885. jQuery.fn[ funcName ] = function( margin, value ) {
  17886. var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
  17887. extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
  17888. return access( this, function( elem, type, value ) {
  17889. var doc;
  17890. if ( isWindow( elem ) ) {
  17891. // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)
  17892. return funcName.indexOf( "outer" ) === 0 ?
  17893. elem[ "inner" + name ] :
  17894. elem.document.documentElement[ "client" + name ];
  17895. }
  17896. // Get document width or height
  17897. if ( elem.nodeType === 9 ) {
  17898. doc = elem.documentElement;
  17899. // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
  17900. // whichever is greatest
  17901. return Math.max(
  17902. elem.body[ "scroll" + name ], doc[ "scroll" + name ],
  17903. elem.body[ "offset" + name ], doc[ "offset" + name ],
  17904. doc[ "client" + name ]
  17905. );
  17906. }
  17907. return value === undefined ?
  17908. // Get width or height on the element, requesting but not forcing parseFloat
  17909. jQuery.css( elem, type, extra ) :
  17910. // Set width or height on the element
  17911. jQuery.style( elem, type, value, extra );
  17912. }, type, chainable ? margin : undefined, chainable );
  17913. };
  17914. } );
  17915. } );
  17916. jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " +
  17917. "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
  17918. "change select submit keydown keypress keyup contextmenu" ).split( " " ),
  17919. function( i, name ) {
  17920. // Handle event binding
  17921. jQuery.fn[ name ] = function( data, fn ) {
  17922. return arguments.length > 0 ?
  17923. this.on( name, null, data, fn ) :
  17924. this.trigger( name );
  17925. };
  17926. } );
  17927. jQuery.fn.extend( {
  17928. hover: function( fnOver, fnOut ) {
  17929. return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
  17930. }
  17931. } );
  17932. jQuery.fn.extend( {
  17933. bind: function( types, data, fn ) {
  17934. return this.on( types, null, data, fn );
  17935. },
  17936. unbind: function( types, fn ) {
  17937. return this.off( types, null, fn );
  17938. },
  17939. delegate: function( selector, types, data, fn ) {
  17940. return this.on( types, selector, data, fn );
  17941. },
  17942. undelegate: function( selector, types, fn ) {
  17943. // ( namespace ) or ( selector, types [, fn] )
  17944. return arguments.length === 1 ?
  17945. this.off( selector, "**" ) :
  17946. this.off( types, selector || "**", fn );
  17947. }
  17948. } );
  17949. // Bind a function to a context, optionally partially applying any
  17950. // arguments.
  17951. // jQuery.proxy is deprecated to promote standards (specifically Function#bind)
  17952. // However, it is not slated for removal any time soon
  17953. jQuery.proxy = function( fn, context ) {
  17954. var tmp, args, proxy;
  17955. if ( typeof context === "string" ) {
  17956. tmp = fn[ context ];
  17957. context = fn;
  17958. fn = tmp;
  17959. }
  17960. // Quick check to determine if target is callable, in the spec
  17961. // this throws a TypeError, but we will just return undefined.
  17962. if ( !isFunction( fn ) ) {
  17963. return undefined;
  17964. }
  17965. // Simulated bind
  17966. args = slice.call( arguments, 2 );
  17967. proxy = function() {
  17968. return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
  17969. };
  17970. // Set the guid of unique handler to the same of original handler, so it can be removed
  17971. proxy.guid = fn.guid = fn.guid || jQuery.guid++;
  17972. return proxy;
  17973. };
  17974. jQuery.holdReady = function( hold ) {
  17975. if ( hold ) {
  17976. jQuery.readyWait++;
  17977. } else {
  17978. jQuery.ready( true );
  17979. }
  17980. };
  17981. jQuery.isArray = Array.isArray;
  17982. jQuery.parseJSON = JSON.parse;
  17983. jQuery.nodeName = nodeName;
  17984. jQuery.isFunction = isFunction;
  17985. jQuery.isWindow = isWindow;
  17986. jQuery.camelCase = camelCase;
  17987. jQuery.type = toType;
  17988. jQuery.now = Date.now;
  17989. jQuery.isNumeric = function( obj ) {
  17990. // As of jQuery 3.0, isNumeric is limited to
  17991. // strings and numbers (primitives or objects)
  17992. // that can be coerced to finite numbers (gh-2662)
  17993. var type = jQuery.type( obj );
  17994. return ( type === "number" || type === "string" ) &&
  17995. // parseFloat NaNs numeric-cast false positives ("")
  17996. // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
  17997. // subtraction forces infinities to NaN
  17998. !isNaN( obj - parseFloat( obj ) );
  17999. };
  18000. // Register as a named AMD module, since jQuery can be concatenated with other
  18001. // files that may use define, but not via a proper concatenation script that
  18002. // understands anonymous AMD modules. A named AMD is safest and most robust
  18003. // way to register. Lowercase jquery is used because AMD module names are
  18004. // derived from file names, and jQuery is normally delivered in a lowercase
  18005. // file name. Do this after creating the global so that if an AMD module wants
  18006. // to call noConflict to hide this version of jQuery, it will work.
  18007. // Note that for maximum portability, libraries that are not jQuery should
  18008. // declare themselves as anonymous modules, and avoid setting a global if an
  18009. // AMD loader is present. jQuery is a special case. For more information, see
  18010. // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
  18011. if ( true ) {
  18012. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  18013. return jQuery;
  18014. }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
  18015. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  18016. }
  18017. var
  18018. // Map over jQuery in case of overwrite
  18019. _jQuery = window.jQuery,
  18020. // Map over the $ in case of overwrite
  18021. _$ = window.$;
  18022. jQuery.noConflict = function( deep ) {
  18023. if ( window.$ === jQuery ) {
  18024. window.$ = _$;
  18025. }
  18026. if ( deep && window.jQuery === jQuery ) {
  18027. window.jQuery = _jQuery;
  18028. }
  18029. return jQuery;
  18030. };
  18031. // Expose jQuery and $ identifiers, even in AMD
  18032. // (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
  18033. // and CommonJS for browser emulators (#13566)
  18034. if ( !noGlobal ) {
  18035. window.jQuery = window.$ = jQuery;
  18036. }
  18037. return jQuery;
  18038. } );
  18039. /***/ }),
  18040. /***/ "./node_modules/laravel-echo/dist/echo.js":
  18041. /*!************************************************!*\
  18042. !*** ./node_modules/laravel-echo/dist/echo.js ***!
  18043. \************************************************/
  18044. /*! exports provided: default */
  18045. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18046. "use strict";
  18047. __webpack_require__.r(__webpack_exports__);
  18048. var classCallCheck = function (instance, Constructor) {
  18049. if (!(instance instanceof Constructor)) {
  18050. throw new TypeError("Cannot call a class as a function");
  18051. }
  18052. };
  18053. var createClass = function () {
  18054. function defineProperties(target, props) {
  18055. for (var i = 0; i < props.length; i++) {
  18056. var descriptor = props[i];
  18057. descriptor.enumerable = descriptor.enumerable || false;
  18058. descriptor.configurable = true;
  18059. if ("value" in descriptor) descriptor.writable = true;
  18060. Object.defineProperty(target, descriptor.key, descriptor);
  18061. }
  18062. }
  18063. return function (Constructor, protoProps, staticProps) {
  18064. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  18065. if (staticProps) defineProperties(Constructor, staticProps);
  18066. return Constructor;
  18067. };
  18068. }();
  18069. var _extends = Object.assign || function (target) {
  18070. for (var i = 1; i < arguments.length; i++) {
  18071. var source = arguments[i];
  18072. for (var key in source) {
  18073. if (Object.prototype.hasOwnProperty.call(source, key)) {
  18074. target[key] = source[key];
  18075. }
  18076. }
  18077. }
  18078. return target;
  18079. };
  18080. var inherits = function (subClass, superClass) {
  18081. if (typeof superClass !== "function" && superClass !== null) {
  18082. throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  18083. }
  18084. subClass.prototype = Object.create(superClass && superClass.prototype, {
  18085. constructor: {
  18086. value: subClass,
  18087. enumerable: false,
  18088. writable: true,
  18089. configurable: true
  18090. }
  18091. });
  18092. if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  18093. };
  18094. var possibleConstructorReturn = function (self, call) {
  18095. if (!self) {
  18096. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  18097. }
  18098. return call && (typeof call === "object" || typeof call === "function") ? call : self;
  18099. };
  18100. var Connector = function () {
  18101. /**
  18102. * Create a new class instance.
  18103. */
  18104. function Connector(options) {
  18105. classCallCheck(this, Connector);
  18106. /**
  18107. * Default connector options.
  18108. */
  18109. this._defaultOptions = {
  18110. auth: {
  18111. headers: {}
  18112. },
  18113. authEndpoint: '/broadcasting/auth',
  18114. broadcaster: 'pusher',
  18115. csrfToken: null,
  18116. host: null,
  18117. key: null,
  18118. namespace: 'App.Events'
  18119. };
  18120. this.setOptions(options);
  18121. this.connect();
  18122. }
  18123. /**
  18124. * Merge the custom options with the defaults.
  18125. */
  18126. createClass(Connector, [{
  18127. key: 'setOptions',
  18128. value: function setOptions(options) {
  18129. this.options = _extends(this._defaultOptions, options);
  18130. if (this.csrfToken()) {
  18131. this.options.auth.headers['X-CSRF-TOKEN'] = this.csrfToken();
  18132. }
  18133. return options;
  18134. }
  18135. /**
  18136. * Extract the CSRF token from the page.
  18137. */
  18138. }, {
  18139. key: 'csrfToken',
  18140. value: function csrfToken() {
  18141. var selector = void 0;
  18142. if (typeof window !== 'undefined' && window['Laravel'] && window['Laravel'].csrfToken) {
  18143. return window['Laravel'].csrfToken;
  18144. } else if (this.options.csrfToken) {
  18145. return this.options.csrfToken;
  18146. } else if (typeof document !== 'undefined' && typeof document.querySelector === 'function' && (selector = document.querySelector('meta[name="csrf-token"]'))) {
  18147. return selector.getAttribute('content');
  18148. }
  18149. return null;
  18150. }
  18151. }]);
  18152. return Connector;
  18153. }();
  18154. /**
  18155. * This class represents a basic channel.
  18156. */
  18157. var Channel = function () {
  18158. function Channel() {
  18159. classCallCheck(this, Channel);
  18160. }
  18161. createClass(Channel, [{
  18162. key: 'listenForWhisper',
  18163. /**
  18164. * Listen for a whisper event on the channel instance.
  18165. */
  18166. value: function listenForWhisper(event, callback) {
  18167. return this.listen('.client-' + event, callback);
  18168. }
  18169. /**
  18170. * Listen for an event on the channel instance.
  18171. */
  18172. }, {
  18173. key: 'notification',
  18174. value: function notification(callback) {
  18175. return this.listen('.Illuminate\\Notifications\\Events\\BroadcastNotificationCreated', callback);
  18176. }
  18177. /**
  18178. * Stop listening for a whispser event on the channel instance.
  18179. */
  18180. }, {
  18181. key: 'stopListeningForWhisper',
  18182. value: function stopListeningForWhisper(event) {
  18183. return this.stopListening('.client-' + event);
  18184. }
  18185. }]);
  18186. return Channel;
  18187. }();
  18188. /**
  18189. * Event name formatter
  18190. */
  18191. var EventFormatter = function () {
  18192. /**
  18193. * Create a new class instance.
  18194. */
  18195. function EventFormatter(namespace) {
  18196. classCallCheck(this, EventFormatter);
  18197. this.setNamespace(namespace);
  18198. }
  18199. /**
  18200. * Format the given event name.
  18201. */
  18202. createClass(EventFormatter, [{
  18203. key: 'format',
  18204. value: function format(event) {
  18205. if (event.charAt(0) === '.' || event.charAt(0) === '\\') {
  18206. return event.substr(1);
  18207. } else if (this.namespace) {
  18208. event = this.namespace + '.' + event;
  18209. }
  18210. return event.replace(/\./g, '\\');
  18211. }
  18212. /**
  18213. * Set the event namespace.
  18214. */
  18215. }, {
  18216. key: 'setNamespace',
  18217. value: function setNamespace(value) {
  18218. this.namespace = value;
  18219. }
  18220. }]);
  18221. return EventFormatter;
  18222. }();
  18223. /**
  18224. * This class represents a Pusher channel.
  18225. */
  18226. var PusherChannel = function (_Channel) {
  18227. inherits(PusherChannel, _Channel);
  18228. /**
  18229. * Create a new class instance.
  18230. */
  18231. function PusherChannel(pusher, name, options) {
  18232. classCallCheck(this, PusherChannel);
  18233. var _this = possibleConstructorReturn(this, (PusherChannel.__proto__ || Object.getPrototypeOf(PusherChannel)).call(this));
  18234. _this.name = name;
  18235. _this.pusher = pusher;
  18236. _this.options = options;
  18237. _this.eventFormatter = new EventFormatter(_this.options.namespace);
  18238. _this.subscribe();
  18239. return _this;
  18240. }
  18241. /**
  18242. * Subscribe to a Pusher channel.
  18243. */
  18244. createClass(PusherChannel, [{
  18245. key: 'subscribe',
  18246. value: function subscribe() {
  18247. this.subscription = this.pusher.subscribe(this.name);
  18248. }
  18249. /**
  18250. * Unsubscribe from a Pusher channel.
  18251. */
  18252. }, {
  18253. key: 'unsubscribe',
  18254. value: function unsubscribe() {
  18255. this.pusher.unsubscribe(this.name);
  18256. }
  18257. /**
  18258. * Listen for an event on the channel instance.
  18259. */
  18260. }, {
  18261. key: 'listen',
  18262. value: function listen(event, callback) {
  18263. this.on(this.eventFormatter.format(event), callback);
  18264. return this;
  18265. }
  18266. /**
  18267. * Stop listening for an event on the channel instance.
  18268. */
  18269. }, {
  18270. key: 'stopListening',
  18271. value: function stopListening(event) {
  18272. this.subscription.unbind(this.eventFormatter.format(event));
  18273. return this;
  18274. }
  18275. /**
  18276. * Bind a channel to an event.
  18277. */
  18278. }, {
  18279. key: 'on',
  18280. value: function on(event, callback) {
  18281. this.subscription.bind(event, callback);
  18282. return this;
  18283. }
  18284. }]);
  18285. return PusherChannel;
  18286. }(Channel);
  18287. /**
  18288. * This class represents a Pusher private channel.
  18289. */
  18290. var PusherPrivateChannel = function (_PusherChannel) {
  18291. inherits(PusherPrivateChannel, _PusherChannel);
  18292. function PusherPrivateChannel() {
  18293. classCallCheck(this, PusherPrivateChannel);
  18294. return possibleConstructorReturn(this, (PusherPrivateChannel.__proto__ || Object.getPrototypeOf(PusherPrivateChannel)).apply(this, arguments));
  18295. }
  18296. createClass(PusherPrivateChannel, [{
  18297. key: 'whisper',
  18298. /**
  18299. * Trigger client event on the channel.
  18300. */
  18301. value: function whisper(eventName, data) {
  18302. this.pusher.channels.channels[this.name].trigger('client-' + eventName, data);
  18303. return this;
  18304. }
  18305. }]);
  18306. return PusherPrivateChannel;
  18307. }(PusherChannel);
  18308. /**
  18309. * This class represents a Pusher presence channel.
  18310. */
  18311. var PusherPresenceChannel = function (_PusherChannel) {
  18312. inherits(PusherPresenceChannel, _PusherChannel);
  18313. function PusherPresenceChannel() {
  18314. classCallCheck(this, PusherPresenceChannel);
  18315. return possibleConstructorReturn(this, (PusherPresenceChannel.__proto__ || Object.getPrototypeOf(PusherPresenceChannel)).apply(this, arguments));
  18316. }
  18317. createClass(PusherPresenceChannel, [{
  18318. key: 'here',
  18319. /**
  18320. * Register a callback to be called anytime the member list changes.
  18321. */
  18322. value: function here(callback) {
  18323. this.on('pusher:subscription_succeeded', function (data) {
  18324. callback(Object.keys(data.members).map(function (k) {
  18325. return data.members[k];
  18326. }));
  18327. });
  18328. return this;
  18329. }
  18330. /**
  18331. * Listen for someone joining the channel.
  18332. */
  18333. }, {
  18334. key: 'joining',
  18335. value: function joining(callback) {
  18336. this.on('pusher:member_added', function (member) {
  18337. callback(member.info);
  18338. });
  18339. return this;
  18340. }
  18341. /**
  18342. * Listen for someone leaving the channel.
  18343. */
  18344. }, {
  18345. key: 'leaving',
  18346. value: function leaving(callback) {
  18347. this.on('pusher:member_removed', function (member) {
  18348. callback(member.info);
  18349. });
  18350. return this;
  18351. }
  18352. /**
  18353. * Trigger client event on the channel.
  18354. */
  18355. }, {
  18356. key: 'whisper',
  18357. value: function whisper(eventName, data) {
  18358. this.pusher.channels.channels[this.name].trigger('client-' + eventName, data);
  18359. return this;
  18360. }
  18361. }]);
  18362. return PusherPresenceChannel;
  18363. }(PusherChannel);
  18364. /**
  18365. * This class represents a Socket.io channel.
  18366. */
  18367. var SocketIoChannel = function (_Channel) {
  18368. inherits(SocketIoChannel, _Channel);
  18369. /**
  18370. * Create a new class instance.
  18371. */
  18372. function SocketIoChannel(socket, name, options) {
  18373. classCallCheck(this, SocketIoChannel);
  18374. /**
  18375. * The event callbacks applied to the channel.
  18376. */
  18377. var _this = possibleConstructorReturn(this, (SocketIoChannel.__proto__ || Object.getPrototypeOf(SocketIoChannel)).call(this));
  18378. _this.events = {};
  18379. _this.name = name;
  18380. _this.socket = socket;
  18381. _this.options = options;
  18382. _this.eventFormatter = new EventFormatter(_this.options.namespace);
  18383. _this.subscribe();
  18384. _this.configureReconnector();
  18385. return _this;
  18386. }
  18387. /**
  18388. * Subscribe to a Socket.io channel.
  18389. */
  18390. createClass(SocketIoChannel, [{
  18391. key: 'subscribe',
  18392. value: function subscribe() {
  18393. this.socket.emit('subscribe', {
  18394. channel: this.name,
  18395. auth: this.options.auth || {}
  18396. });
  18397. }
  18398. /**
  18399. * Unsubscribe from channel and ubind event callbacks.
  18400. */
  18401. }, {
  18402. key: 'unsubscribe',
  18403. value: function unsubscribe() {
  18404. this.unbind();
  18405. this.socket.emit('unsubscribe', {
  18406. channel: this.name,
  18407. auth: this.options.auth || {}
  18408. });
  18409. }
  18410. /**
  18411. * Listen for an event on the channel instance.
  18412. */
  18413. }, {
  18414. key: 'listen',
  18415. value: function listen(event, callback) {
  18416. this.on(this.eventFormatter.format(event), callback);
  18417. return this;
  18418. }
  18419. /**
  18420. * Stop listening for an event on the channel instance.
  18421. */
  18422. }, {
  18423. key: 'stopListening',
  18424. value: function stopListening(event) {
  18425. var name = this.eventFormatter.format(event);
  18426. this.socket.removeListener(name);
  18427. delete this.events[name];
  18428. return this;
  18429. }
  18430. /**
  18431. * Bind the channel's socket to an event and store the callback.
  18432. */
  18433. }, {
  18434. key: 'on',
  18435. value: function on(event, callback) {
  18436. var _this2 = this;
  18437. var listener = function listener(channel, data) {
  18438. if (_this2.name == channel) {
  18439. callback(data);
  18440. }
  18441. };
  18442. this.socket.on(event, listener);
  18443. this.bind(event, listener);
  18444. }
  18445. /**
  18446. * Attach a 'reconnect' listener and bind the event.
  18447. */
  18448. }, {
  18449. key: 'configureReconnector',
  18450. value: function configureReconnector() {
  18451. var _this3 = this;
  18452. var listener = function listener() {
  18453. _this3.subscribe();
  18454. };
  18455. this.socket.on('reconnect', listener);
  18456. this.bind('reconnect', listener);
  18457. }
  18458. /**
  18459. * Bind the channel's socket to an event and store the callback.
  18460. */
  18461. }, {
  18462. key: 'bind',
  18463. value: function bind(event, callback) {
  18464. this.events[event] = this.events[event] || [];
  18465. this.events[event].push(callback);
  18466. }
  18467. /**
  18468. * Unbind the channel's socket from all stored event callbacks.
  18469. */
  18470. }, {
  18471. key: 'unbind',
  18472. value: function unbind() {
  18473. var _this4 = this;
  18474. Object.keys(this.events).forEach(function (event) {
  18475. _this4.events[event].forEach(function (callback) {
  18476. _this4.socket.removeListener(event, callback);
  18477. });
  18478. delete _this4.events[event];
  18479. });
  18480. }
  18481. }]);
  18482. return SocketIoChannel;
  18483. }(Channel);
  18484. /**
  18485. * This class represents a Socket.io presence channel.
  18486. */
  18487. var SocketIoPrivateChannel = function (_SocketIoChannel) {
  18488. inherits(SocketIoPrivateChannel, _SocketIoChannel);
  18489. function SocketIoPrivateChannel() {
  18490. classCallCheck(this, SocketIoPrivateChannel);
  18491. return possibleConstructorReturn(this, (SocketIoPrivateChannel.__proto__ || Object.getPrototypeOf(SocketIoPrivateChannel)).apply(this, arguments));
  18492. }
  18493. createClass(SocketIoPrivateChannel, [{
  18494. key: 'whisper',
  18495. /**
  18496. * Trigger client event on the channel.
  18497. */
  18498. value: function whisper(eventName, data) {
  18499. this.socket.emit('client event', {
  18500. channel: this.name,
  18501. event: 'client-' + eventName,
  18502. data: data
  18503. });
  18504. return this;
  18505. }
  18506. }]);
  18507. return SocketIoPrivateChannel;
  18508. }(SocketIoChannel);
  18509. /**
  18510. * This class represents a Socket.io presence channel.
  18511. */
  18512. var SocketIoPresenceChannel = function (_SocketIoPrivateChann) {
  18513. inherits(SocketIoPresenceChannel, _SocketIoPrivateChann);
  18514. function SocketIoPresenceChannel() {
  18515. classCallCheck(this, SocketIoPresenceChannel);
  18516. return possibleConstructorReturn(this, (SocketIoPresenceChannel.__proto__ || Object.getPrototypeOf(SocketIoPresenceChannel)).apply(this, arguments));
  18517. }
  18518. createClass(SocketIoPresenceChannel, [{
  18519. key: 'here',
  18520. /**
  18521. * Register a callback to be called anytime the member list changes.
  18522. */
  18523. value: function here(callback) {
  18524. this.on('presence:subscribed', function (members) {
  18525. callback(members.map(function (m) {
  18526. return m.user_info;
  18527. }));
  18528. });
  18529. return this;
  18530. }
  18531. /**
  18532. * Listen for someone joining the channel.
  18533. */
  18534. }, {
  18535. key: 'joining',
  18536. value: function joining(callback) {
  18537. this.on('presence:joining', function (member) {
  18538. return callback(member.user_info);
  18539. });
  18540. return this;
  18541. }
  18542. /**
  18543. * Listen for someone leaving the channel.
  18544. */
  18545. }, {
  18546. key: 'leaving',
  18547. value: function leaving(callback) {
  18548. this.on('presence:leaving', function (member) {
  18549. return callback(member.user_info);
  18550. });
  18551. return this;
  18552. }
  18553. }]);
  18554. return SocketIoPresenceChannel;
  18555. }(SocketIoPrivateChannel);
  18556. /**
  18557. * This class represents a null channel.
  18558. */
  18559. var NullChannel = function (_Channel) {
  18560. inherits(NullChannel, _Channel);
  18561. function NullChannel() {
  18562. classCallCheck(this, NullChannel);
  18563. return possibleConstructorReturn(this, (NullChannel.__proto__ || Object.getPrototypeOf(NullChannel)).apply(this, arguments));
  18564. }
  18565. createClass(NullChannel, [{
  18566. key: 'subscribe',
  18567. /**
  18568. * Subscribe to a channel.
  18569. */
  18570. value: function subscribe() {}
  18571. //
  18572. /**
  18573. * Unsubscribe from a channel.
  18574. */
  18575. }, {
  18576. key: 'unsubscribe',
  18577. value: function unsubscribe() {}
  18578. //
  18579. /**
  18580. * Listen for an event on the channel instance.
  18581. */
  18582. }, {
  18583. key: 'listen',
  18584. value: function listen(event, callback) {
  18585. return this;
  18586. }
  18587. /**
  18588. * Stop listening for an event on the channel instance.
  18589. */
  18590. }, {
  18591. key: 'stopListening',
  18592. value: function stopListening(event) {
  18593. return this;
  18594. }
  18595. /**
  18596. * Bind a channel to an event.
  18597. */
  18598. }, {
  18599. key: 'on',
  18600. value: function on(event, callback) {
  18601. return this;
  18602. }
  18603. }]);
  18604. return NullChannel;
  18605. }(Channel);
  18606. /**
  18607. * This class represents a null private channel.
  18608. */
  18609. var NullPrivateChannel = function (_NullChannel) {
  18610. inherits(NullPrivateChannel, _NullChannel);
  18611. function NullPrivateChannel() {
  18612. classCallCheck(this, NullPrivateChannel);
  18613. return possibleConstructorReturn(this, (NullPrivateChannel.__proto__ || Object.getPrototypeOf(NullPrivateChannel)).apply(this, arguments));
  18614. }
  18615. createClass(NullPrivateChannel, [{
  18616. key: 'whisper',
  18617. /**
  18618. * Trigger client event on the channel.
  18619. */
  18620. value: function whisper(eventName, data) {
  18621. return this;
  18622. }
  18623. }]);
  18624. return NullPrivateChannel;
  18625. }(NullChannel);
  18626. /**
  18627. * This class represents a null presence channel.
  18628. */
  18629. var NullPresenceChannel = function (_NullChannel) {
  18630. inherits(NullPresenceChannel, _NullChannel);
  18631. function NullPresenceChannel() {
  18632. classCallCheck(this, NullPresenceChannel);
  18633. return possibleConstructorReturn(this, (NullPresenceChannel.__proto__ || Object.getPrototypeOf(NullPresenceChannel)).apply(this, arguments));
  18634. }
  18635. createClass(NullPresenceChannel, [{
  18636. key: 'here',
  18637. /**
  18638. * Register a callback to be called anytime the member list changes.
  18639. */
  18640. value: function here(callback) {
  18641. return this;
  18642. }
  18643. /**
  18644. * Listen for someone joining the channel.
  18645. */
  18646. }, {
  18647. key: 'joining',
  18648. value: function joining(callback) {
  18649. return this;
  18650. }
  18651. /**
  18652. * Listen for someone leaving the channel.
  18653. */
  18654. }, {
  18655. key: 'leaving',
  18656. value: function leaving(callback) {
  18657. return this;
  18658. }
  18659. /**
  18660. * Trigger client event on the channel.
  18661. */
  18662. }, {
  18663. key: 'whisper',
  18664. value: function whisper(eventName, data) {
  18665. return this;
  18666. }
  18667. }]);
  18668. return NullPresenceChannel;
  18669. }(NullChannel);
  18670. /**
  18671. * This class creates a connector to Pusher.
  18672. */
  18673. var PusherConnector = function (_Connector) {
  18674. inherits(PusherConnector, _Connector);
  18675. function PusherConnector() {
  18676. classCallCheck(this, PusherConnector);
  18677. /**
  18678. * All of the subscribed channel names.
  18679. */
  18680. var _this = possibleConstructorReturn(this, (PusherConnector.__proto__ || Object.getPrototypeOf(PusherConnector)).apply(this, arguments));
  18681. _this.channels = {};
  18682. return _this;
  18683. }
  18684. /**
  18685. * Create a fresh Pusher connection.
  18686. */
  18687. createClass(PusherConnector, [{
  18688. key: 'connect',
  18689. value: function connect() {
  18690. if (typeof this.options.client !== 'undefined') {
  18691. this.pusher = this.options.client;
  18692. } else {
  18693. this.pusher = new Pusher(this.options.key, this.options);
  18694. }
  18695. }
  18696. /**
  18697. * Listen for an event on a channel instance.
  18698. */
  18699. }, {
  18700. key: 'listen',
  18701. value: function listen(name, event, callback) {
  18702. return this.channel(name).listen(event, callback);
  18703. }
  18704. /**
  18705. * Get a channel instance by name.
  18706. */
  18707. }, {
  18708. key: 'channel',
  18709. value: function channel(name) {
  18710. if (!this.channels[name]) {
  18711. this.channels[name] = new PusherChannel(this.pusher, name, this.options);
  18712. }
  18713. return this.channels[name];
  18714. }
  18715. /**
  18716. * Get a private channel instance by name.
  18717. */
  18718. }, {
  18719. key: 'privateChannel',
  18720. value: function privateChannel(name) {
  18721. if (!this.channels['private-' + name]) {
  18722. this.channels['private-' + name] = new PusherPrivateChannel(this.pusher, 'private-' + name, this.options);
  18723. }
  18724. return this.channels['private-' + name];
  18725. }
  18726. /**
  18727. * Get a presence channel instance by name.
  18728. */
  18729. }, {
  18730. key: 'presenceChannel',
  18731. value: function presenceChannel(name) {
  18732. if (!this.channels['presence-' + name]) {
  18733. this.channels['presence-' + name] = new PusherPresenceChannel(this.pusher, 'presence-' + name, this.options);
  18734. }
  18735. return this.channels['presence-' + name];
  18736. }
  18737. /**
  18738. * Leave the given channel, as well as its private and presence variants.
  18739. */
  18740. }, {
  18741. key: 'leave',
  18742. value: function leave(name) {
  18743. var _this2 = this;
  18744. var channels = [name, 'private-' + name, 'presence-' + name];
  18745. channels.forEach(function (name, index) {
  18746. _this2.leaveChannel(name);
  18747. });
  18748. }
  18749. /**
  18750. * Leave the given channel.
  18751. */
  18752. }, {
  18753. key: 'leaveChannel',
  18754. value: function leaveChannel(name) {
  18755. if (this.channels[name]) {
  18756. this.channels[name].unsubscribe();
  18757. delete this.channels[name];
  18758. }
  18759. }
  18760. /**
  18761. * Get the socket ID for the connection.
  18762. */
  18763. }, {
  18764. key: 'socketId',
  18765. value: function socketId() {
  18766. return this.pusher.connection.socket_id;
  18767. }
  18768. /**
  18769. * Disconnect Pusher connection.
  18770. */
  18771. }, {
  18772. key: 'disconnect',
  18773. value: function disconnect() {
  18774. this.pusher.disconnect();
  18775. }
  18776. }]);
  18777. return PusherConnector;
  18778. }(Connector);
  18779. /**
  18780. * This class creates a connnector to a Socket.io server.
  18781. */
  18782. var SocketIoConnector = function (_Connector) {
  18783. inherits(SocketIoConnector, _Connector);
  18784. function SocketIoConnector() {
  18785. classCallCheck(this, SocketIoConnector);
  18786. /**
  18787. * All of the subscribed channel names.
  18788. */
  18789. var _this = possibleConstructorReturn(this, (SocketIoConnector.__proto__ || Object.getPrototypeOf(SocketIoConnector)).apply(this, arguments));
  18790. _this.channels = {};
  18791. return _this;
  18792. }
  18793. /**
  18794. * Create a fresh Socket.io connection.
  18795. */
  18796. createClass(SocketIoConnector, [{
  18797. key: 'connect',
  18798. value: function connect() {
  18799. var io = this.getSocketIO();
  18800. this.socket = io(this.options.host, this.options);
  18801. return this.socket;
  18802. }
  18803. /**
  18804. * Get socket.io module from global scope or options.
  18805. */
  18806. }, {
  18807. key: 'getSocketIO',
  18808. value: function getSocketIO() {
  18809. if (typeof this.options.client !== 'undefined') {
  18810. return this.options.client;
  18811. }
  18812. if (typeof io !== 'undefined') {
  18813. return io;
  18814. }
  18815. throw new Error('Socket.io client not found. Should be globally available or passed via options.client');
  18816. }
  18817. /**
  18818. * Listen for an event on a channel instance.
  18819. */
  18820. }, {
  18821. key: 'listen',
  18822. value: function listen(name, event, callback) {
  18823. return this.channel(name).listen(event, callback);
  18824. }
  18825. /**
  18826. * Get a channel instance by name.
  18827. */
  18828. }, {
  18829. key: 'channel',
  18830. value: function channel(name) {
  18831. if (!this.channels[name]) {
  18832. this.channels[name] = new SocketIoChannel(this.socket, name, this.options);
  18833. }
  18834. return this.channels[name];
  18835. }
  18836. /**
  18837. * Get a private channel instance by name.
  18838. */
  18839. }, {
  18840. key: 'privateChannel',
  18841. value: function privateChannel(name) {
  18842. if (!this.channels['private-' + name]) {
  18843. this.channels['private-' + name] = new SocketIoPrivateChannel(this.socket, 'private-' + name, this.options);
  18844. }
  18845. return this.channels['private-' + name];
  18846. }
  18847. /**
  18848. * Get a presence channel instance by name.
  18849. */
  18850. }, {
  18851. key: 'presenceChannel',
  18852. value: function presenceChannel(name) {
  18853. if (!this.channels['presence-' + name]) {
  18854. this.channels['presence-' + name] = new SocketIoPresenceChannel(this.socket, 'presence-' + name, this.options);
  18855. }
  18856. return this.channels['presence-' + name];
  18857. }
  18858. /**
  18859. * Leave the given channel, as well as its private and presence variants.
  18860. */
  18861. }, {
  18862. key: 'leave',
  18863. value: function leave(name) {
  18864. var _this2 = this;
  18865. var channels = [name, 'private-' + name, 'presence-' + name];
  18866. channels.forEach(function (name) {
  18867. _this2.leaveChannel(name);
  18868. });
  18869. }
  18870. /**
  18871. * Leave the given channel.
  18872. */
  18873. }, {
  18874. key: 'leaveChannel',
  18875. value: function leaveChannel(name) {
  18876. if (this.channels[name]) {
  18877. this.channels[name].unsubscribe();
  18878. delete this.channels[name];
  18879. }
  18880. }
  18881. /**
  18882. * Get the socket ID for the connection.
  18883. */
  18884. }, {
  18885. key: 'socketId',
  18886. value: function socketId() {
  18887. return this.socket.id;
  18888. }
  18889. /**
  18890. * Disconnect Socketio connection.
  18891. */
  18892. }, {
  18893. key: 'disconnect',
  18894. value: function disconnect() {
  18895. this.socket.disconnect();
  18896. }
  18897. }]);
  18898. return SocketIoConnector;
  18899. }(Connector);
  18900. /**
  18901. * This class creates a null connector.
  18902. */
  18903. var NullConnector = function (_Connector) {
  18904. inherits(NullConnector, _Connector);
  18905. function NullConnector() {
  18906. classCallCheck(this, NullConnector);
  18907. /**
  18908. * All of the subscribed channel names.
  18909. */
  18910. var _this = possibleConstructorReturn(this, (NullConnector.__proto__ || Object.getPrototypeOf(NullConnector)).apply(this, arguments));
  18911. _this.channels = {};
  18912. return _this;
  18913. }
  18914. /**
  18915. * Create a fresh connection.
  18916. */
  18917. createClass(NullConnector, [{
  18918. key: 'connect',
  18919. value: function connect() {}
  18920. //
  18921. /**
  18922. * Listen for an event on a channel instance.
  18923. */
  18924. }, {
  18925. key: 'listen',
  18926. value: function listen(name, event, callback) {
  18927. return new NullChannel();
  18928. }
  18929. /**
  18930. * Get a channel instance by name.
  18931. */
  18932. }, {
  18933. key: 'channel',
  18934. value: function channel(name) {
  18935. return new NullChannel();
  18936. }
  18937. /**
  18938. * Get a private channel instance by name.
  18939. */
  18940. }, {
  18941. key: 'privateChannel',
  18942. value: function privateChannel(name) {
  18943. return new NullPrivateChannel();
  18944. }
  18945. /**
  18946. * Get a presence channel instance by name.
  18947. */
  18948. }, {
  18949. key: 'presenceChannel',
  18950. value: function presenceChannel(name) {
  18951. return new NullPresenceChannel();
  18952. }
  18953. /**
  18954. * Leave the given channel, as well as its private and presence variants.
  18955. */
  18956. }, {
  18957. key: 'leave',
  18958. value: function leave(name) {}
  18959. //
  18960. /**
  18961. * Leave the given channel.
  18962. */
  18963. }, {
  18964. key: 'leaveChannel',
  18965. value: function leaveChannel(name) {}
  18966. //
  18967. /**
  18968. * Get the socket ID for the connection.
  18969. */
  18970. }, {
  18971. key: 'socketId',
  18972. value: function socketId() {
  18973. return 'fake-socket-id';
  18974. }
  18975. /**
  18976. * Disconnect the connection.
  18977. */
  18978. }, {
  18979. key: 'disconnect',
  18980. value: function disconnect() {
  18981. //
  18982. }
  18983. }]);
  18984. return NullConnector;
  18985. }(Connector);
  18986. /**
  18987. * This class is the primary API for interacting with broadcasting.
  18988. */
  18989. var Echo = function () {
  18990. /**
  18991. * Create a new class instance.
  18992. */
  18993. function Echo(options) {
  18994. classCallCheck(this, Echo);
  18995. this.options = options;
  18996. this.connect();
  18997. if (!this.options.withoutInterceptors) {
  18998. this.registerInterceptors();
  18999. }
  19000. }
  19001. /**
  19002. * Get a channel instance by name.
  19003. */
  19004. createClass(Echo, [{
  19005. key: 'channel',
  19006. value: function channel(_channel) {
  19007. return this.connector.channel(_channel);
  19008. }
  19009. /**
  19010. * Create a new connection.
  19011. */
  19012. }, {
  19013. key: 'connect',
  19014. value: function connect() {
  19015. if (this.options.broadcaster == 'pusher') {
  19016. this.connector = new PusherConnector(this.options);
  19017. } else if (this.options.broadcaster == 'socket.io') {
  19018. this.connector = new SocketIoConnector(this.options);
  19019. } else if (this.options.broadcaster == 'null') {
  19020. this.connector = new NullConnector(this.options);
  19021. } else if (typeof this.options.broadcaster == 'function') {
  19022. this.connector = new this.options.broadcaster(this.options);
  19023. }
  19024. }
  19025. /**
  19026. * Disconnect from the Echo server.
  19027. */
  19028. }, {
  19029. key: 'disconnect',
  19030. value: function disconnect() {
  19031. this.connector.disconnect();
  19032. }
  19033. /**
  19034. * Get a presence channel instance by name.
  19035. */
  19036. }, {
  19037. key: 'join',
  19038. value: function join(channel) {
  19039. return this.connector.presenceChannel(channel);
  19040. }
  19041. /**
  19042. * Leave the given channel, as well as its private and presence variants.
  19043. */
  19044. }, {
  19045. key: 'leave',
  19046. value: function leave(channel) {
  19047. this.connector.leave(channel);
  19048. }
  19049. /**
  19050. * Leave the given channel.
  19051. */
  19052. }, {
  19053. key: 'leaveChannel',
  19054. value: function leaveChannel(channel) {
  19055. this.connector.leaveChannel(channel);
  19056. }
  19057. /**
  19058. * Listen for an event on a channel instance.
  19059. */
  19060. }, {
  19061. key: 'listen',
  19062. value: function listen(channel, event, callback) {
  19063. return this.connector.listen(channel, event, callback);
  19064. }
  19065. /**
  19066. * Get a private channel instance by name.
  19067. */
  19068. }, {
  19069. key: 'private',
  19070. value: function _private(channel) {
  19071. return this.connector.privateChannel(channel);
  19072. }
  19073. /**
  19074. * Get the Socket ID for the connection.
  19075. */
  19076. }, {
  19077. key: 'socketId',
  19078. value: function socketId() {
  19079. return this.connector.socketId();
  19080. }
  19081. /**
  19082. * Register 3rd party request interceptiors. These are used to automatically
  19083. * send a connections socket id to a Laravel app with a X-Socket-Id header.
  19084. */
  19085. }, {
  19086. key: 'registerInterceptors',
  19087. value: function registerInterceptors() {
  19088. if (typeof Vue === 'function' && Vue.http) {
  19089. this.registerVueRequestInterceptor();
  19090. }
  19091. if (typeof axios === 'function') {
  19092. this.registerAxiosRequestInterceptor();
  19093. }
  19094. if (typeof jQuery === 'function') {
  19095. this.registerjQueryAjaxSetup();
  19096. }
  19097. }
  19098. /**
  19099. * Register a Vue HTTP interceptor to add the X-Socket-ID header.
  19100. */
  19101. }, {
  19102. key: 'registerVueRequestInterceptor',
  19103. value: function registerVueRequestInterceptor() {
  19104. var _this = this;
  19105. Vue.http.interceptors.push(function (request, next) {
  19106. if (_this.socketId()) {
  19107. request.headers.set('X-Socket-ID', _this.socketId());
  19108. }
  19109. next();
  19110. });
  19111. }
  19112. /**
  19113. * Register an Axios HTTP interceptor to add the X-Socket-ID header.
  19114. */
  19115. }, {
  19116. key: 'registerAxiosRequestInterceptor',
  19117. value: function registerAxiosRequestInterceptor() {
  19118. var _this2 = this;
  19119. axios.interceptors.request.use(function (config) {
  19120. if (_this2.socketId()) {
  19121. config.headers['X-Socket-Id'] = _this2.socketId();
  19122. }
  19123. return config;
  19124. });
  19125. }
  19126. /**
  19127. * Register jQuery AjaxPrefilter to add the X-Socket-ID header.
  19128. */
  19129. }, {
  19130. key: 'registerjQueryAjaxSetup',
  19131. value: function registerjQueryAjaxSetup() {
  19132. var _this3 = this;
  19133. if (typeof jQuery.ajax != 'undefined') {
  19134. jQuery.ajaxPrefilter(function (options, originalOptions, xhr) {
  19135. if (_this3.socketId()) {
  19136. xhr.setRequestHeader('X-Socket-Id', _this3.socketId());
  19137. }
  19138. });
  19139. }
  19140. }
  19141. }]);
  19142. return Echo;
  19143. }();
  19144. /* harmony default export */ __webpack_exports__["default"] = (Echo);
  19145. /***/ }),
  19146. /***/ "./node_modules/lodash/lodash.js":
  19147. /*!***************************************!*\
  19148. !*** ./node_modules/lodash/lodash.js ***!
  19149. \***************************************/
  19150. /*! no static exports found */
  19151. /***/ (function(module, exports, __webpack_require__) {
  19152. /* WEBPACK VAR INJECTION */(function(global, module) {var __WEBPACK_AMD_DEFINE_RESULT__;/**
  19153. * @license
  19154. * Lodash <https://lodash.com/>
  19155. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  19156. * Released under MIT license <https://lodash.com/license>
  19157. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  19158. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  19159. */
  19160. ;(function() {
  19161. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  19162. var undefined;
  19163. /** Used as the semantic version number. */
  19164. var VERSION = '4.17.15';
  19165. /** Used as the size to enable large array optimizations. */
  19166. var LARGE_ARRAY_SIZE = 200;
  19167. /** Error message constants. */
  19168. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  19169. FUNC_ERROR_TEXT = 'Expected a function';
  19170. /** Used to stand-in for `undefined` hash values. */
  19171. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  19172. /** Used as the maximum memoize cache size. */
  19173. var MAX_MEMOIZE_SIZE = 500;
  19174. /** Used as the internal argument placeholder. */
  19175. var PLACEHOLDER = '__lodash_placeholder__';
  19176. /** Used to compose bitmasks for cloning. */
  19177. var CLONE_DEEP_FLAG = 1,
  19178. CLONE_FLAT_FLAG = 2,
  19179. CLONE_SYMBOLS_FLAG = 4;
  19180. /** Used to compose bitmasks for value comparisons. */
  19181. var COMPARE_PARTIAL_FLAG = 1,
  19182. COMPARE_UNORDERED_FLAG = 2;
  19183. /** Used to compose bitmasks for function metadata. */
  19184. var WRAP_BIND_FLAG = 1,
  19185. WRAP_BIND_KEY_FLAG = 2,
  19186. WRAP_CURRY_BOUND_FLAG = 4,
  19187. WRAP_CURRY_FLAG = 8,
  19188. WRAP_CURRY_RIGHT_FLAG = 16,
  19189. WRAP_PARTIAL_FLAG = 32,
  19190. WRAP_PARTIAL_RIGHT_FLAG = 64,
  19191. WRAP_ARY_FLAG = 128,
  19192. WRAP_REARG_FLAG = 256,
  19193. WRAP_FLIP_FLAG = 512;
  19194. /** Used as default options for `_.truncate`. */
  19195. var DEFAULT_TRUNC_LENGTH = 30,
  19196. DEFAULT_TRUNC_OMISSION = '...';
  19197. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  19198. var HOT_COUNT = 800,
  19199. HOT_SPAN = 16;
  19200. /** Used to indicate the type of lazy iteratees. */
  19201. var LAZY_FILTER_FLAG = 1,
  19202. LAZY_MAP_FLAG = 2,
  19203. LAZY_WHILE_FLAG = 3;
  19204. /** Used as references for various `Number` constants. */
  19205. var INFINITY = 1 / 0,
  19206. MAX_SAFE_INTEGER = 9007199254740991,
  19207. MAX_INTEGER = 1.7976931348623157e+308,
  19208. NAN = 0 / 0;
  19209. /** Used as references for the maximum length and index of an array. */
  19210. var MAX_ARRAY_LENGTH = 4294967295,
  19211. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  19212. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  19213. /** Used to associate wrap methods with their bit flags. */
  19214. var wrapFlags = [
  19215. ['ary', WRAP_ARY_FLAG],
  19216. ['bind', WRAP_BIND_FLAG],
  19217. ['bindKey', WRAP_BIND_KEY_FLAG],
  19218. ['curry', WRAP_CURRY_FLAG],
  19219. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  19220. ['flip', WRAP_FLIP_FLAG],
  19221. ['partial', WRAP_PARTIAL_FLAG],
  19222. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  19223. ['rearg', WRAP_REARG_FLAG]
  19224. ];
  19225. /** `Object#toString` result references. */
  19226. var argsTag = '[object Arguments]',
  19227. arrayTag = '[object Array]',
  19228. asyncTag = '[object AsyncFunction]',
  19229. boolTag = '[object Boolean]',
  19230. dateTag = '[object Date]',
  19231. domExcTag = '[object DOMException]',
  19232. errorTag = '[object Error]',
  19233. funcTag = '[object Function]',
  19234. genTag = '[object GeneratorFunction]',
  19235. mapTag = '[object Map]',
  19236. numberTag = '[object Number]',
  19237. nullTag = '[object Null]',
  19238. objectTag = '[object Object]',
  19239. promiseTag = '[object Promise]',
  19240. proxyTag = '[object Proxy]',
  19241. regexpTag = '[object RegExp]',
  19242. setTag = '[object Set]',
  19243. stringTag = '[object String]',
  19244. symbolTag = '[object Symbol]',
  19245. undefinedTag = '[object Undefined]',
  19246. weakMapTag = '[object WeakMap]',
  19247. weakSetTag = '[object WeakSet]';
  19248. var arrayBufferTag = '[object ArrayBuffer]',
  19249. dataViewTag = '[object DataView]',
  19250. float32Tag = '[object Float32Array]',
  19251. float64Tag = '[object Float64Array]',
  19252. int8Tag = '[object Int8Array]',
  19253. int16Tag = '[object Int16Array]',
  19254. int32Tag = '[object Int32Array]',
  19255. uint8Tag = '[object Uint8Array]',
  19256. uint8ClampedTag = '[object Uint8ClampedArray]',
  19257. uint16Tag = '[object Uint16Array]',
  19258. uint32Tag = '[object Uint32Array]';
  19259. /** Used to match empty string literals in compiled template source. */
  19260. var reEmptyStringLeading = /\b__p \+= '';/g,
  19261. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  19262. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  19263. /** Used to match HTML entities and HTML characters. */
  19264. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  19265. reUnescapedHtml = /[&<>"']/g,
  19266. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  19267. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  19268. /** Used to match template delimiters. */
  19269. var reEscape = /<%-([\s\S]+?)%>/g,
  19270. reEvaluate = /<%([\s\S]+?)%>/g,
  19271. reInterpolate = /<%=([\s\S]+?)%>/g;
  19272. /** Used to match property names within property paths. */
  19273. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  19274. reIsPlainProp = /^\w*$/,
  19275. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  19276. /**
  19277. * Used to match `RegExp`
  19278. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  19279. */
  19280. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  19281. reHasRegExpChar = RegExp(reRegExpChar.source);
  19282. /** Used to match leading and trailing whitespace. */
  19283. var reTrim = /^\s+|\s+$/g,
  19284. reTrimStart = /^\s+/,
  19285. reTrimEnd = /\s+$/;
  19286. /** Used to match wrap detail comments. */
  19287. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  19288. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  19289. reSplitDetails = /,? & /;
  19290. /** Used to match words composed of alphanumeric characters. */
  19291. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  19292. /** Used to match backslashes in property paths. */
  19293. var reEscapeChar = /\\(\\)?/g;
  19294. /**
  19295. * Used to match
  19296. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  19297. */
  19298. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  19299. /** Used to match `RegExp` flags from their coerced string values. */
  19300. var reFlags = /\w*$/;
  19301. /** Used to detect bad signed hexadecimal string values. */
  19302. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  19303. /** Used to detect binary string values. */
  19304. var reIsBinary = /^0b[01]+$/i;
  19305. /** Used to detect host constructors (Safari). */
  19306. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  19307. /** Used to detect octal string values. */
  19308. var reIsOctal = /^0o[0-7]+$/i;
  19309. /** Used to detect unsigned integer values. */
  19310. var reIsUint = /^(?:0|[1-9]\d*)$/;
  19311. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  19312. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  19313. /** Used to ensure capturing order of template delimiters. */
  19314. var reNoMatch = /($^)/;
  19315. /** Used to match unescaped characters in compiled string literals. */
  19316. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  19317. /** Used to compose unicode character classes. */
  19318. var rsAstralRange = '\\ud800-\\udfff',
  19319. rsComboMarksRange = '\\u0300-\\u036f',
  19320. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  19321. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  19322. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  19323. rsDingbatRange = '\\u2700-\\u27bf',
  19324. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  19325. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  19326. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  19327. rsPunctuationRange = '\\u2000-\\u206f',
  19328. rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000',
  19329. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  19330. rsVarRange = '\\ufe0e\\ufe0f',
  19331. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  19332. /** Used to compose unicode capture groups. */
  19333. var rsApos = "['\u2019]",
  19334. rsAstral = '[' + rsAstralRange + ']',
  19335. rsBreak = '[' + rsBreakRange + ']',
  19336. rsCombo = '[' + rsComboRange + ']',
  19337. rsDigits = '\\d+',
  19338. rsDingbat = '[' + rsDingbatRange + ']',
  19339. rsLower = '[' + rsLowerRange + ']',
  19340. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  19341. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  19342. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  19343. rsNonAstral = '[^' + rsAstralRange + ']',
  19344. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  19345. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  19346. rsUpper = '[' + rsUpperRange + ']',
  19347. rsZWJ = '\\u200d';
  19348. /** Used to compose unicode regexes. */
  19349. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  19350. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  19351. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  19352. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  19353. reOptMod = rsModifier + '?',
  19354. rsOptVar = '[' + rsVarRange + ']?',
  19355. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  19356. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  19357. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  19358. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  19359. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  19360. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  19361. /** Used to match apostrophes. */
  19362. var reApos = RegExp(rsApos, 'g');
  19363. /**
  19364. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  19365. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  19366. */
  19367. var reComboMark = RegExp(rsCombo, 'g');
  19368. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  19369. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  19370. /** Used to match complex or compound words. */
  19371. var reUnicodeWord = RegExp([
  19372. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  19373. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  19374. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  19375. rsUpper + '+' + rsOptContrUpper,
  19376. rsOrdUpper,
  19377. rsOrdLower,
  19378. rsDigits,
  19379. rsEmoji
  19380. ].join('|'), 'g');
  19381. /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
  19382. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  19383. /** Used to detect strings that need a more robust regexp to match words. */
  19384. var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
  19385. /** Used to assign default `context` object properties. */
  19386. var contextProps = [
  19387. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  19388. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  19389. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  19390. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  19391. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  19392. ];
  19393. /** Used to make template sourceURLs easier to identify. */
  19394. var templateCounter = -1;
  19395. /** Used to identify `toStringTag` values of typed arrays. */
  19396. var typedArrayTags = {};
  19397. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  19398. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  19399. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  19400. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  19401. typedArrayTags[uint32Tag] = true;
  19402. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  19403. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  19404. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  19405. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  19406. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  19407. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  19408. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  19409. typedArrayTags[weakMapTag] = false;
  19410. /** Used to identify `toStringTag` values supported by `_.clone`. */
  19411. var cloneableTags = {};
  19412. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  19413. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  19414. cloneableTags[boolTag] = cloneableTags[dateTag] =
  19415. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  19416. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  19417. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  19418. cloneableTags[numberTag] = cloneableTags[objectTag] =
  19419. cloneableTags[regexpTag] = cloneableTags[setTag] =
  19420. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  19421. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  19422. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  19423. cloneableTags[errorTag] = cloneableTags[funcTag] =
  19424. cloneableTags[weakMapTag] = false;
  19425. /** Used to map Latin Unicode letters to basic Latin letters. */
  19426. var deburredLetters = {
  19427. // Latin-1 Supplement block.
  19428. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  19429. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  19430. '\xc7': 'C', '\xe7': 'c',
  19431. '\xd0': 'D', '\xf0': 'd',
  19432. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  19433. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  19434. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  19435. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  19436. '\xd1': 'N', '\xf1': 'n',
  19437. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  19438. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  19439. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  19440. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  19441. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  19442. '\xc6': 'Ae', '\xe6': 'ae',
  19443. '\xde': 'Th', '\xfe': 'th',
  19444. '\xdf': 'ss',
  19445. // Latin Extended-A block.
  19446. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  19447. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  19448. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  19449. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  19450. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  19451. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  19452. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  19453. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  19454. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  19455. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  19456. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  19457. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  19458. '\u0134': 'J', '\u0135': 'j',
  19459. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  19460. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  19461. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  19462. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  19463. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  19464. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  19465. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  19466. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  19467. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  19468. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  19469. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  19470. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  19471. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  19472. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  19473. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  19474. '\u0174': 'W', '\u0175': 'w',
  19475. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  19476. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  19477. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  19478. '\u0132': 'IJ', '\u0133': 'ij',
  19479. '\u0152': 'Oe', '\u0153': 'oe',
  19480. '\u0149': "'n", '\u017f': 's'
  19481. };
  19482. /** Used to map characters to HTML entities. */
  19483. var htmlEscapes = {
  19484. '&': '&amp;',
  19485. '<': '&lt;',
  19486. '>': '&gt;',
  19487. '"': '&quot;',
  19488. "'": '&#39;'
  19489. };
  19490. /** Used to map HTML entities to characters. */
  19491. var htmlUnescapes = {
  19492. '&amp;': '&',
  19493. '&lt;': '<',
  19494. '&gt;': '>',
  19495. '&quot;': '"',
  19496. '&#39;': "'"
  19497. };
  19498. /** Used to escape characters for inclusion in compiled string literals. */
  19499. var stringEscapes = {
  19500. '\\': '\\',
  19501. "'": "'",
  19502. '\n': 'n',
  19503. '\r': 'r',
  19504. '\u2028': 'u2028',
  19505. '\u2029': 'u2029'
  19506. };
  19507. /** Built-in method references without a dependency on `root`. */
  19508. var freeParseFloat = parseFloat,
  19509. freeParseInt = parseInt;
  19510. /** Detect free variable `global` from Node.js. */
  19511. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  19512. /** Detect free variable `self`. */
  19513. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  19514. /** Used as a reference to the global object. */
  19515. var root = freeGlobal || freeSelf || Function('return this')();
  19516. /** Detect free variable `exports`. */
  19517. var freeExports = true && exports && !exports.nodeType && exports;
  19518. /** Detect free variable `module`. */
  19519. var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
  19520. /** Detect the popular CommonJS extension `module.exports`. */
  19521. var moduleExports = freeModule && freeModule.exports === freeExports;
  19522. /** Detect free variable `process` from Node.js. */
  19523. var freeProcess = moduleExports && freeGlobal.process;
  19524. /** Used to access faster Node.js helpers. */
  19525. var nodeUtil = (function() {
  19526. try {
  19527. // Use `util.types` for Node.js 10+.
  19528. var types = freeModule && freeModule.require && freeModule.require('util').types;
  19529. if (types) {
  19530. return types;
  19531. }
  19532. // Legacy `process.binding('util')` for Node.js < 10.
  19533. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  19534. } catch (e) {}
  19535. }());
  19536. /* Node.js helper references. */
  19537. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  19538. nodeIsDate = nodeUtil && nodeUtil.isDate,
  19539. nodeIsMap = nodeUtil && nodeUtil.isMap,
  19540. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  19541. nodeIsSet = nodeUtil && nodeUtil.isSet,
  19542. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  19543. /*--------------------------------------------------------------------------*/
  19544. /**
  19545. * A faster alternative to `Function#apply`, this function invokes `func`
  19546. * with the `this` binding of `thisArg` and the arguments of `args`.
  19547. *
  19548. * @private
  19549. * @param {Function} func The function to invoke.
  19550. * @param {*} thisArg The `this` binding of `func`.
  19551. * @param {Array} args The arguments to invoke `func` with.
  19552. * @returns {*} Returns the result of `func`.
  19553. */
  19554. function apply(func, thisArg, args) {
  19555. switch (args.length) {
  19556. case 0: return func.call(thisArg);
  19557. case 1: return func.call(thisArg, args[0]);
  19558. case 2: return func.call(thisArg, args[0], args[1]);
  19559. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  19560. }
  19561. return func.apply(thisArg, args);
  19562. }
  19563. /**
  19564. * A specialized version of `baseAggregator` for arrays.
  19565. *
  19566. * @private
  19567. * @param {Array} [array] The array to iterate over.
  19568. * @param {Function} setter The function to set `accumulator` values.
  19569. * @param {Function} iteratee The iteratee to transform keys.
  19570. * @param {Object} accumulator The initial aggregated object.
  19571. * @returns {Function} Returns `accumulator`.
  19572. */
  19573. function arrayAggregator(array, setter, iteratee, accumulator) {
  19574. var index = -1,
  19575. length = array == null ? 0 : array.length;
  19576. while (++index < length) {
  19577. var value = array[index];
  19578. setter(accumulator, value, iteratee(value), array);
  19579. }
  19580. return accumulator;
  19581. }
  19582. /**
  19583. * A specialized version of `_.forEach` for arrays without support for
  19584. * iteratee shorthands.
  19585. *
  19586. * @private
  19587. * @param {Array} [array] The array to iterate over.
  19588. * @param {Function} iteratee The function invoked per iteration.
  19589. * @returns {Array} Returns `array`.
  19590. */
  19591. function arrayEach(array, iteratee) {
  19592. var index = -1,
  19593. length = array == null ? 0 : array.length;
  19594. while (++index < length) {
  19595. if (iteratee(array[index], index, array) === false) {
  19596. break;
  19597. }
  19598. }
  19599. return array;
  19600. }
  19601. /**
  19602. * A specialized version of `_.forEachRight` for arrays without support for
  19603. * iteratee shorthands.
  19604. *
  19605. * @private
  19606. * @param {Array} [array] The array to iterate over.
  19607. * @param {Function} iteratee The function invoked per iteration.
  19608. * @returns {Array} Returns `array`.
  19609. */
  19610. function arrayEachRight(array, iteratee) {
  19611. var length = array == null ? 0 : array.length;
  19612. while (length--) {
  19613. if (iteratee(array[length], length, array) === false) {
  19614. break;
  19615. }
  19616. }
  19617. return array;
  19618. }
  19619. /**
  19620. * A specialized version of `_.every` for arrays without support for
  19621. * iteratee shorthands.
  19622. *
  19623. * @private
  19624. * @param {Array} [array] The array to iterate over.
  19625. * @param {Function} predicate The function invoked per iteration.
  19626. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  19627. * else `false`.
  19628. */
  19629. function arrayEvery(array, predicate) {
  19630. var index = -1,
  19631. length = array == null ? 0 : array.length;
  19632. while (++index < length) {
  19633. if (!predicate(array[index], index, array)) {
  19634. return false;
  19635. }
  19636. }
  19637. return true;
  19638. }
  19639. /**
  19640. * A specialized version of `_.filter` for arrays without support for
  19641. * iteratee shorthands.
  19642. *
  19643. * @private
  19644. * @param {Array} [array] The array to iterate over.
  19645. * @param {Function} predicate The function invoked per iteration.
  19646. * @returns {Array} Returns the new filtered array.
  19647. */
  19648. function arrayFilter(array, predicate) {
  19649. var index = -1,
  19650. length = array == null ? 0 : array.length,
  19651. resIndex = 0,
  19652. result = [];
  19653. while (++index < length) {
  19654. var value = array[index];
  19655. if (predicate(value, index, array)) {
  19656. result[resIndex++] = value;
  19657. }
  19658. }
  19659. return result;
  19660. }
  19661. /**
  19662. * A specialized version of `_.includes` for arrays without support for
  19663. * specifying an index to search from.
  19664. *
  19665. * @private
  19666. * @param {Array} [array] The array to inspect.
  19667. * @param {*} target The value to search for.
  19668. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  19669. */
  19670. function arrayIncludes(array, value) {
  19671. var length = array == null ? 0 : array.length;
  19672. return !!length && baseIndexOf(array, value, 0) > -1;
  19673. }
  19674. /**
  19675. * This function is like `arrayIncludes` except that it accepts a comparator.
  19676. *
  19677. * @private
  19678. * @param {Array} [array] The array to inspect.
  19679. * @param {*} target The value to search for.
  19680. * @param {Function} comparator The comparator invoked per element.
  19681. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  19682. */
  19683. function arrayIncludesWith(array, value, comparator) {
  19684. var index = -1,
  19685. length = array == null ? 0 : array.length;
  19686. while (++index < length) {
  19687. if (comparator(value, array[index])) {
  19688. return true;
  19689. }
  19690. }
  19691. return false;
  19692. }
  19693. /**
  19694. * A specialized version of `_.map` for arrays without support for iteratee
  19695. * shorthands.
  19696. *
  19697. * @private
  19698. * @param {Array} [array] The array to iterate over.
  19699. * @param {Function} iteratee The function invoked per iteration.
  19700. * @returns {Array} Returns the new mapped array.
  19701. */
  19702. function arrayMap(array, iteratee) {
  19703. var index = -1,
  19704. length = array == null ? 0 : array.length,
  19705. result = Array(length);
  19706. while (++index < length) {
  19707. result[index] = iteratee(array[index], index, array);
  19708. }
  19709. return result;
  19710. }
  19711. /**
  19712. * Appends the elements of `values` to `array`.
  19713. *
  19714. * @private
  19715. * @param {Array} array The array to modify.
  19716. * @param {Array} values The values to append.
  19717. * @returns {Array} Returns `array`.
  19718. */
  19719. function arrayPush(array, values) {
  19720. var index = -1,
  19721. length = values.length,
  19722. offset = array.length;
  19723. while (++index < length) {
  19724. array[offset + index] = values[index];
  19725. }
  19726. return array;
  19727. }
  19728. /**
  19729. * A specialized version of `_.reduce` for arrays without support for
  19730. * iteratee shorthands.
  19731. *
  19732. * @private
  19733. * @param {Array} [array] The array to iterate over.
  19734. * @param {Function} iteratee The function invoked per iteration.
  19735. * @param {*} [accumulator] The initial value.
  19736. * @param {boolean} [initAccum] Specify using the first element of `array` as
  19737. * the initial value.
  19738. * @returns {*} Returns the accumulated value.
  19739. */
  19740. function arrayReduce(array, iteratee, accumulator, initAccum) {
  19741. var index = -1,
  19742. length = array == null ? 0 : array.length;
  19743. if (initAccum && length) {
  19744. accumulator = array[++index];
  19745. }
  19746. while (++index < length) {
  19747. accumulator = iteratee(accumulator, array[index], index, array);
  19748. }
  19749. return accumulator;
  19750. }
  19751. /**
  19752. * A specialized version of `_.reduceRight` for arrays without support for
  19753. * iteratee shorthands.
  19754. *
  19755. * @private
  19756. * @param {Array} [array] The array to iterate over.
  19757. * @param {Function} iteratee The function invoked per iteration.
  19758. * @param {*} [accumulator] The initial value.
  19759. * @param {boolean} [initAccum] Specify using the last element of `array` as
  19760. * the initial value.
  19761. * @returns {*} Returns the accumulated value.
  19762. */
  19763. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  19764. var length = array == null ? 0 : array.length;
  19765. if (initAccum && length) {
  19766. accumulator = array[--length];
  19767. }
  19768. while (length--) {
  19769. accumulator = iteratee(accumulator, array[length], length, array);
  19770. }
  19771. return accumulator;
  19772. }
  19773. /**
  19774. * A specialized version of `_.some` for arrays without support for iteratee
  19775. * shorthands.
  19776. *
  19777. * @private
  19778. * @param {Array} [array] The array to iterate over.
  19779. * @param {Function} predicate The function invoked per iteration.
  19780. * @returns {boolean} Returns `true` if any element passes the predicate check,
  19781. * else `false`.
  19782. */
  19783. function arraySome(array, predicate) {
  19784. var index = -1,
  19785. length = array == null ? 0 : array.length;
  19786. while (++index < length) {
  19787. if (predicate(array[index], index, array)) {
  19788. return true;
  19789. }
  19790. }
  19791. return false;
  19792. }
  19793. /**
  19794. * Gets the size of an ASCII `string`.
  19795. *
  19796. * @private
  19797. * @param {string} string The string inspect.
  19798. * @returns {number} Returns the string size.
  19799. */
  19800. var asciiSize = baseProperty('length');
  19801. /**
  19802. * Converts an ASCII `string` to an array.
  19803. *
  19804. * @private
  19805. * @param {string} string The string to convert.
  19806. * @returns {Array} Returns the converted array.
  19807. */
  19808. function asciiToArray(string) {
  19809. return string.split('');
  19810. }
  19811. /**
  19812. * Splits an ASCII `string` into an array of its words.
  19813. *
  19814. * @private
  19815. * @param {string} The string to inspect.
  19816. * @returns {Array} Returns the words of `string`.
  19817. */
  19818. function asciiWords(string) {
  19819. return string.match(reAsciiWord) || [];
  19820. }
  19821. /**
  19822. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  19823. * without support for iteratee shorthands, which iterates over `collection`
  19824. * using `eachFunc`.
  19825. *
  19826. * @private
  19827. * @param {Array|Object} collection The collection to inspect.
  19828. * @param {Function} predicate The function invoked per iteration.
  19829. * @param {Function} eachFunc The function to iterate over `collection`.
  19830. * @returns {*} Returns the found element or its key, else `undefined`.
  19831. */
  19832. function baseFindKey(collection, predicate, eachFunc) {
  19833. var result;
  19834. eachFunc(collection, function(value, key, collection) {
  19835. if (predicate(value, key, collection)) {
  19836. result = key;
  19837. return false;
  19838. }
  19839. });
  19840. return result;
  19841. }
  19842. /**
  19843. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  19844. * support for iteratee shorthands.
  19845. *
  19846. * @private
  19847. * @param {Array} array The array to inspect.
  19848. * @param {Function} predicate The function invoked per iteration.
  19849. * @param {number} fromIndex The index to search from.
  19850. * @param {boolean} [fromRight] Specify iterating from right to left.
  19851. * @returns {number} Returns the index of the matched value, else `-1`.
  19852. */
  19853. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  19854. var length = array.length,
  19855. index = fromIndex + (fromRight ? 1 : -1);
  19856. while ((fromRight ? index-- : ++index < length)) {
  19857. if (predicate(array[index], index, array)) {
  19858. return index;
  19859. }
  19860. }
  19861. return -1;
  19862. }
  19863. /**
  19864. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  19865. *
  19866. * @private
  19867. * @param {Array} array The array to inspect.
  19868. * @param {*} value The value to search for.
  19869. * @param {number} fromIndex The index to search from.
  19870. * @returns {number} Returns the index of the matched value, else `-1`.
  19871. */
  19872. function baseIndexOf(array, value, fromIndex) {
  19873. return value === value
  19874. ? strictIndexOf(array, value, fromIndex)
  19875. : baseFindIndex(array, baseIsNaN, fromIndex);
  19876. }
  19877. /**
  19878. * This function is like `baseIndexOf` except that it accepts a comparator.
  19879. *
  19880. * @private
  19881. * @param {Array} array The array to inspect.
  19882. * @param {*} value The value to search for.
  19883. * @param {number} fromIndex The index to search from.
  19884. * @param {Function} comparator The comparator invoked per element.
  19885. * @returns {number} Returns the index of the matched value, else `-1`.
  19886. */
  19887. function baseIndexOfWith(array, value, fromIndex, comparator) {
  19888. var index = fromIndex - 1,
  19889. length = array.length;
  19890. while (++index < length) {
  19891. if (comparator(array[index], value)) {
  19892. return index;
  19893. }
  19894. }
  19895. return -1;
  19896. }
  19897. /**
  19898. * The base implementation of `_.isNaN` without support for number objects.
  19899. *
  19900. * @private
  19901. * @param {*} value The value to check.
  19902. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  19903. */
  19904. function baseIsNaN(value) {
  19905. return value !== value;
  19906. }
  19907. /**
  19908. * The base implementation of `_.mean` and `_.meanBy` without support for
  19909. * iteratee shorthands.
  19910. *
  19911. * @private
  19912. * @param {Array} array The array to iterate over.
  19913. * @param {Function} iteratee The function invoked per iteration.
  19914. * @returns {number} Returns the mean.
  19915. */
  19916. function baseMean(array, iteratee) {
  19917. var length = array == null ? 0 : array.length;
  19918. return length ? (baseSum(array, iteratee) / length) : NAN;
  19919. }
  19920. /**
  19921. * The base implementation of `_.property` without support for deep paths.
  19922. *
  19923. * @private
  19924. * @param {string} key The key of the property to get.
  19925. * @returns {Function} Returns the new accessor function.
  19926. */
  19927. function baseProperty(key) {
  19928. return function(object) {
  19929. return object == null ? undefined : object[key];
  19930. };
  19931. }
  19932. /**
  19933. * The base implementation of `_.propertyOf` without support for deep paths.
  19934. *
  19935. * @private
  19936. * @param {Object} object The object to query.
  19937. * @returns {Function} Returns the new accessor function.
  19938. */
  19939. function basePropertyOf(object) {
  19940. return function(key) {
  19941. return object == null ? undefined : object[key];
  19942. };
  19943. }
  19944. /**
  19945. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  19946. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  19947. *
  19948. * @private
  19949. * @param {Array|Object} collection The collection to iterate over.
  19950. * @param {Function} iteratee The function invoked per iteration.
  19951. * @param {*} accumulator The initial value.
  19952. * @param {boolean} initAccum Specify using the first or last element of
  19953. * `collection` as the initial value.
  19954. * @param {Function} eachFunc The function to iterate over `collection`.
  19955. * @returns {*} Returns the accumulated value.
  19956. */
  19957. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  19958. eachFunc(collection, function(value, index, collection) {
  19959. accumulator = initAccum
  19960. ? (initAccum = false, value)
  19961. : iteratee(accumulator, value, index, collection);
  19962. });
  19963. return accumulator;
  19964. }
  19965. /**
  19966. * The base implementation of `_.sortBy` which uses `comparer` to define the
  19967. * sort order of `array` and replaces criteria objects with their corresponding
  19968. * values.
  19969. *
  19970. * @private
  19971. * @param {Array} array The array to sort.
  19972. * @param {Function} comparer The function to define sort order.
  19973. * @returns {Array} Returns `array`.
  19974. */
  19975. function baseSortBy(array, comparer) {
  19976. var length = array.length;
  19977. array.sort(comparer);
  19978. while (length--) {
  19979. array[length] = array[length].value;
  19980. }
  19981. return array;
  19982. }
  19983. /**
  19984. * The base implementation of `_.sum` and `_.sumBy` without support for
  19985. * iteratee shorthands.
  19986. *
  19987. * @private
  19988. * @param {Array} array The array to iterate over.
  19989. * @param {Function} iteratee The function invoked per iteration.
  19990. * @returns {number} Returns the sum.
  19991. */
  19992. function baseSum(array, iteratee) {
  19993. var result,
  19994. index = -1,
  19995. length = array.length;
  19996. while (++index < length) {
  19997. var current = iteratee(array[index]);
  19998. if (current !== undefined) {
  19999. result = result === undefined ? current : (result + current);
  20000. }
  20001. }
  20002. return result;
  20003. }
  20004. /**
  20005. * The base implementation of `_.times` without support for iteratee shorthands
  20006. * or max array length checks.
  20007. *
  20008. * @private
  20009. * @param {number} n The number of times to invoke `iteratee`.
  20010. * @param {Function} iteratee The function invoked per iteration.
  20011. * @returns {Array} Returns the array of results.
  20012. */
  20013. function baseTimes(n, iteratee) {
  20014. var index = -1,
  20015. result = Array(n);
  20016. while (++index < n) {
  20017. result[index] = iteratee(index);
  20018. }
  20019. return result;
  20020. }
  20021. /**
  20022. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  20023. * of key-value pairs for `object` corresponding to the property names of `props`.
  20024. *
  20025. * @private
  20026. * @param {Object} object The object to query.
  20027. * @param {Array} props The property names to get values for.
  20028. * @returns {Object} Returns the key-value pairs.
  20029. */
  20030. function baseToPairs(object, props) {
  20031. return arrayMap(props, function(key) {
  20032. return [key, object[key]];
  20033. });
  20034. }
  20035. /**
  20036. * The base implementation of `_.unary` without support for storing metadata.
  20037. *
  20038. * @private
  20039. * @param {Function} func The function to cap arguments for.
  20040. * @returns {Function} Returns the new capped function.
  20041. */
  20042. function baseUnary(func) {
  20043. return function(value) {
  20044. return func(value);
  20045. };
  20046. }
  20047. /**
  20048. * The base implementation of `_.values` and `_.valuesIn` which creates an
  20049. * array of `object` property values corresponding to the property names
  20050. * of `props`.
  20051. *
  20052. * @private
  20053. * @param {Object} object The object to query.
  20054. * @param {Array} props The property names to get values for.
  20055. * @returns {Object} Returns the array of property values.
  20056. */
  20057. function baseValues(object, props) {
  20058. return arrayMap(props, function(key) {
  20059. return object[key];
  20060. });
  20061. }
  20062. /**
  20063. * Checks if a `cache` value for `key` exists.
  20064. *
  20065. * @private
  20066. * @param {Object} cache The cache to query.
  20067. * @param {string} key The key of the entry to check.
  20068. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  20069. */
  20070. function cacheHas(cache, key) {
  20071. return cache.has(key);
  20072. }
  20073. /**
  20074. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  20075. * that is not found in the character symbols.
  20076. *
  20077. * @private
  20078. * @param {Array} strSymbols The string symbols to inspect.
  20079. * @param {Array} chrSymbols The character symbols to find.
  20080. * @returns {number} Returns the index of the first unmatched string symbol.
  20081. */
  20082. function charsStartIndex(strSymbols, chrSymbols) {
  20083. var index = -1,
  20084. length = strSymbols.length;
  20085. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  20086. return index;
  20087. }
  20088. /**
  20089. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  20090. * that is not found in the character symbols.
  20091. *
  20092. * @private
  20093. * @param {Array} strSymbols The string symbols to inspect.
  20094. * @param {Array} chrSymbols The character symbols to find.
  20095. * @returns {number} Returns the index of the last unmatched string symbol.
  20096. */
  20097. function charsEndIndex(strSymbols, chrSymbols) {
  20098. var index = strSymbols.length;
  20099. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  20100. return index;
  20101. }
  20102. /**
  20103. * Gets the number of `placeholder` occurrences in `array`.
  20104. *
  20105. * @private
  20106. * @param {Array} array The array to inspect.
  20107. * @param {*} placeholder The placeholder to search for.
  20108. * @returns {number} Returns the placeholder count.
  20109. */
  20110. function countHolders(array, placeholder) {
  20111. var length = array.length,
  20112. result = 0;
  20113. while (length--) {
  20114. if (array[length] === placeholder) {
  20115. ++result;
  20116. }
  20117. }
  20118. return result;
  20119. }
  20120. /**
  20121. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  20122. * letters to basic Latin letters.
  20123. *
  20124. * @private
  20125. * @param {string} letter The matched letter to deburr.
  20126. * @returns {string} Returns the deburred letter.
  20127. */
  20128. var deburrLetter = basePropertyOf(deburredLetters);
  20129. /**
  20130. * Used by `_.escape` to convert characters to HTML entities.
  20131. *
  20132. * @private
  20133. * @param {string} chr The matched character to escape.
  20134. * @returns {string} Returns the escaped character.
  20135. */
  20136. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  20137. /**
  20138. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  20139. *
  20140. * @private
  20141. * @param {string} chr The matched character to escape.
  20142. * @returns {string} Returns the escaped character.
  20143. */
  20144. function escapeStringChar(chr) {
  20145. return '\\' + stringEscapes[chr];
  20146. }
  20147. /**
  20148. * Gets the value at `key` of `object`.
  20149. *
  20150. * @private
  20151. * @param {Object} [object] The object to query.
  20152. * @param {string} key The key of the property to get.
  20153. * @returns {*} Returns the property value.
  20154. */
  20155. function getValue(object, key) {
  20156. return object == null ? undefined : object[key];
  20157. }
  20158. /**
  20159. * Checks if `string` contains Unicode symbols.
  20160. *
  20161. * @private
  20162. * @param {string} string The string to inspect.
  20163. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  20164. */
  20165. function hasUnicode(string) {
  20166. return reHasUnicode.test(string);
  20167. }
  20168. /**
  20169. * Checks if `string` contains a word composed of Unicode symbols.
  20170. *
  20171. * @private
  20172. * @param {string} string The string to inspect.
  20173. * @returns {boolean} Returns `true` if a word is found, else `false`.
  20174. */
  20175. function hasUnicodeWord(string) {
  20176. return reHasUnicodeWord.test(string);
  20177. }
  20178. /**
  20179. * Converts `iterator` to an array.
  20180. *
  20181. * @private
  20182. * @param {Object} iterator The iterator to convert.
  20183. * @returns {Array} Returns the converted array.
  20184. */
  20185. function iteratorToArray(iterator) {
  20186. var data,
  20187. result = [];
  20188. while (!(data = iterator.next()).done) {
  20189. result.push(data.value);
  20190. }
  20191. return result;
  20192. }
  20193. /**
  20194. * Converts `map` to its key-value pairs.
  20195. *
  20196. * @private
  20197. * @param {Object} map The map to convert.
  20198. * @returns {Array} Returns the key-value pairs.
  20199. */
  20200. function mapToArray(map) {
  20201. var index = -1,
  20202. result = Array(map.size);
  20203. map.forEach(function(value, key) {
  20204. result[++index] = [key, value];
  20205. });
  20206. return result;
  20207. }
  20208. /**
  20209. * Creates a unary function that invokes `func` with its argument transformed.
  20210. *
  20211. * @private
  20212. * @param {Function} func The function to wrap.
  20213. * @param {Function} transform The argument transform.
  20214. * @returns {Function} Returns the new function.
  20215. */
  20216. function overArg(func, transform) {
  20217. return function(arg) {
  20218. return func(transform(arg));
  20219. };
  20220. }
  20221. /**
  20222. * Replaces all `placeholder` elements in `array` with an internal placeholder
  20223. * and returns an array of their indexes.
  20224. *
  20225. * @private
  20226. * @param {Array} array The array to modify.
  20227. * @param {*} placeholder The placeholder to replace.
  20228. * @returns {Array} Returns the new array of placeholder indexes.
  20229. */
  20230. function replaceHolders(array, placeholder) {
  20231. var index = -1,
  20232. length = array.length,
  20233. resIndex = 0,
  20234. result = [];
  20235. while (++index < length) {
  20236. var value = array[index];
  20237. if (value === placeholder || value === PLACEHOLDER) {
  20238. array[index] = PLACEHOLDER;
  20239. result[resIndex++] = index;
  20240. }
  20241. }
  20242. return result;
  20243. }
  20244. /**
  20245. * Converts `set` to an array of its values.
  20246. *
  20247. * @private
  20248. * @param {Object} set The set to convert.
  20249. * @returns {Array} Returns the values.
  20250. */
  20251. function setToArray(set) {
  20252. var index = -1,
  20253. result = Array(set.size);
  20254. set.forEach(function(value) {
  20255. result[++index] = value;
  20256. });
  20257. return result;
  20258. }
  20259. /**
  20260. * Converts `set` to its value-value pairs.
  20261. *
  20262. * @private
  20263. * @param {Object} set The set to convert.
  20264. * @returns {Array} Returns the value-value pairs.
  20265. */
  20266. function setToPairs(set) {
  20267. var index = -1,
  20268. result = Array(set.size);
  20269. set.forEach(function(value) {
  20270. result[++index] = [value, value];
  20271. });
  20272. return result;
  20273. }
  20274. /**
  20275. * A specialized version of `_.indexOf` which performs strict equality
  20276. * comparisons of values, i.e. `===`.
  20277. *
  20278. * @private
  20279. * @param {Array} array The array to inspect.
  20280. * @param {*} value The value to search for.
  20281. * @param {number} fromIndex The index to search from.
  20282. * @returns {number} Returns the index of the matched value, else `-1`.
  20283. */
  20284. function strictIndexOf(array, value, fromIndex) {
  20285. var index = fromIndex - 1,
  20286. length = array.length;
  20287. while (++index < length) {
  20288. if (array[index] === value) {
  20289. return index;
  20290. }
  20291. }
  20292. return -1;
  20293. }
  20294. /**
  20295. * A specialized version of `_.lastIndexOf` which performs strict equality
  20296. * comparisons of values, i.e. `===`.
  20297. *
  20298. * @private
  20299. * @param {Array} array The array to inspect.
  20300. * @param {*} value The value to search for.
  20301. * @param {number} fromIndex The index to search from.
  20302. * @returns {number} Returns the index of the matched value, else `-1`.
  20303. */
  20304. function strictLastIndexOf(array, value, fromIndex) {
  20305. var index = fromIndex + 1;
  20306. while (index--) {
  20307. if (array[index] === value) {
  20308. return index;
  20309. }
  20310. }
  20311. return index;
  20312. }
  20313. /**
  20314. * Gets the number of symbols in `string`.
  20315. *
  20316. * @private
  20317. * @param {string} string The string to inspect.
  20318. * @returns {number} Returns the string size.
  20319. */
  20320. function stringSize(string) {
  20321. return hasUnicode(string)
  20322. ? unicodeSize(string)
  20323. : asciiSize(string);
  20324. }
  20325. /**
  20326. * Converts `string` to an array.
  20327. *
  20328. * @private
  20329. * @param {string} string The string to convert.
  20330. * @returns {Array} Returns the converted array.
  20331. */
  20332. function stringToArray(string) {
  20333. return hasUnicode(string)
  20334. ? unicodeToArray(string)
  20335. : asciiToArray(string);
  20336. }
  20337. /**
  20338. * Used by `_.unescape` to convert HTML entities to characters.
  20339. *
  20340. * @private
  20341. * @param {string} chr The matched character to unescape.
  20342. * @returns {string} Returns the unescaped character.
  20343. */
  20344. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  20345. /**
  20346. * Gets the size of a Unicode `string`.
  20347. *
  20348. * @private
  20349. * @param {string} string The string inspect.
  20350. * @returns {number} Returns the string size.
  20351. */
  20352. function unicodeSize(string) {
  20353. var result = reUnicode.lastIndex = 0;
  20354. while (reUnicode.test(string)) {
  20355. ++result;
  20356. }
  20357. return result;
  20358. }
  20359. /**
  20360. * Converts a Unicode `string` to an array.
  20361. *
  20362. * @private
  20363. * @param {string} string The string to convert.
  20364. * @returns {Array} Returns the converted array.
  20365. */
  20366. function unicodeToArray(string) {
  20367. return string.match(reUnicode) || [];
  20368. }
  20369. /**
  20370. * Splits a Unicode `string` into an array of its words.
  20371. *
  20372. * @private
  20373. * @param {string} The string to inspect.
  20374. * @returns {Array} Returns the words of `string`.
  20375. */
  20376. function unicodeWords(string) {
  20377. return string.match(reUnicodeWord) || [];
  20378. }
  20379. /*--------------------------------------------------------------------------*/
  20380. /**
  20381. * Create a new pristine `lodash` function using the `context` object.
  20382. *
  20383. * @static
  20384. * @memberOf _
  20385. * @since 1.1.0
  20386. * @category Util
  20387. * @param {Object} [context=root] The context object.
  20388. * @returns {Function} Returns a new `lodash` function.
  20389. * @example
  20390. *
  20391. * _.mixin({ 'foo': _.constant('foo') });
  20392. *
  20393. * var lodash = _.runInContext();
  20394. * lodash.mixin({ 'bar': lodash.constant('bar') });
  20395. *
  20396. * _.isFunction(_.foo);
  20397. * // => true
  20398. * _.isFunction(_.bar);
  20399. * // => false
  20400. *
  20401. * lodash.isFunction(lodash.foo);
  20402. * // => false
  20403. * lodash.isFunction(lodash.bar);
  20404. * // => true
  20405. *
  20406. * // Create a suped-up `defer` in Node.js.
  20407. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  20408. */
  20409. var runInContext = (function runInContext(context) {
  20410. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  20411. /** Built-in constructor references. */
  20412. var Array = context.Array,
  20413. Date = context.Date,
  20414. Error = context.Error,
  20415. Function = context.Function,
  20416. Math = context.Math,
  20417. Object = context.Object,
  20418. RegExp = context.RegExp,
  20419. String = context.String,
  20420. TypeError = context.TypeError;
  20421. /** Used for built-in method references. */
  20422. var arrayProto = Array.prototype,
  20423. funcProto = Function.prototype,
  20424. objectProto = Object.prototype;
  20425. /** Used to detect overreaching core-js shims. */
  20426. var coreJsData = context['__core-js_shared__'];
  20427. /** Used to resolve the decompiled source of functions. */
  20428. var funcToString = funcProto.toString;
  20429. /** Used to check objects for own properties. */
  20430. var hasOwnProperty = objectProto.hasOwnProperty;
  20431. /** Used to generate unique IDs. */
  20432. var idCounter = 0;
  20433. /** Used to detect methods masquerading as native. */
  20434. var maskSrcKey = (function() {
  20435. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  20436. return uid ? ('Symbol(src)_1.' + uid) : '';
  20437. }());
  20438. /**
  20439. * Used to resolve the
  20440. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  20441. * of values.
  20442. */
  20443. var nativeObjectToString = objectProto.toString;
  20444. /** Used to infer the `Object` constructor. */
  20445. var objectCtorString = funcToString.call(Object);
  20446. /** Used to restore the original `_` reference in `_.noConflict`. */
  20447. var oldDash = root._;
  20448. /** Used to detect if a method is native. */
  20449. var reIsNative = RegExp('^' +
  20450. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  20451. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  20452. );
  20453. /** Built-in value references. */
  20454. var Buffer = moduleExports ? context.Buffer : undefined,
  20455. Symbol = context.Symbol,
  20456. Uint8Array = context.Uint8Array,
  20457. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  20458. getPrototype = overArg(Object.getPrototypeOf, Object),
  20459. objectCreate = Object.create,
  20460. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  20461. splice = arrayProto.splice,
  20462. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  20463. symIterator = Symbol ? Symbol.iterator : undefined,
  20464. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  20465. var defineProperty = (function() {
  20466. try {
  20467. var func = getNative(Object, 'defineProperty');
  20468. func({}, '', {});
  20469. return func;
  20470. } catch (e) {}
  20471. }());
  20472. /** Mocked built-ins. */
  20473. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  20474. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  20475. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  20476. /* Built-in method references for those with the same name as other `lodash` methods. */
  20477. var nativeCeil = Math.ceil,
  20478. nativeFloor = Math.floor,
  20479. nativeGetSymbols = Object.getOwnPropertySymbols,
  20480. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  20481. nativeIsFinite = context.isFinite,
  20482. nativeJoin = arrayProto.join,
  20483. nativeKeys = overArg(Object.keys, Object),
  20484. nativeMax = Math.max,
  20485. nativeMin = Math.min,
  20486. nativeNow = Date.now,
  20487. nativeParseInt = context.parseInt,
  20488. nativeRandom = Math.random,
  20489. nativeReverse = arrayProto.reverse;
  20490. /* Built-in method references that are verified to be native. */
  20491. var DataView = getNative(context, 'DataView'),
  20492. Map = getNative(context, 'Map'),
  20493. Promise = getNative(context, 'Promise'),
  20494. Set = getNative(context, 'Set'),
  20495. WeakMap = getNative(context, 'WeakMap'),
  20496. nativeCreate = getNative(Object, 'create');
  20497. /** Used to store function metadata. */
  20498. var metaMap = WeakMap && new WeakMap;
  20499. /** Used to lookup unminified function names. */
  20500. var realNames = {};
  20501. /** Used to detect maps, sets, and weakmaps. */
  20502. var dataViewCtorString = toSource(DataView),
  20503. mapCtorString = toSource(Map),
  20504. promiseCtorString = toSource(Promise),
  20505. setCtorString = toSource(Set),
  20506. weakMapCtorString = toSource(WeakMap);
  20507. /** Used to convert symbols to primitives and strings. */
  20508. var symbolProto = Symbol ? Symbol.prototype : undefined,
  20509. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  20510. symbolToString = symbolProto ? symbolProto.toString : undefined;
  20511. /*------------------------------------------------------------------------*/
  20512. /**
  20513. * Creates a `lodash` object which wraps `value` to enable implicit method
  20514. * chain sequences. Methods that operate on and return arrays, collections,
  20515. * and functions can be chained together. Methods that retrieve a single value
  20516. * or may return a primitive value will automatically end the chain sequence
  20517. * and return the unwrapped value. Otherwise, the value must be unwrapped
  20518. * with `_#value`.
  20519. *
  20520. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  20521. * enabled using `_.chain`.
  20522. *
  20523. * The execution of chained methods is lazy, that is, it's deferred until
  20524. * `_#value` is implicitly or explicitly called.
  20525. *
  20526. * Lazy evaluation allows several methods to support shortcut fusion.
  20527. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  20528. * the creation of intermediate arrays and can greatly reduce the number of
  20529. * iteratee executions. Sections of a chain sequence qualify for shortcut
  20530. * fusion if the section is applied to an array and iteratees accept only
  20531. * one argument. The heuristic for whether a section qualifies for shortcut
  20532. * fusion is subject to change.
  20533. *
  20534. * Chaining is supported in custom builds as long as the `_#value` method is
  20535. * directly or indirectly included in the build.
  20536. *
  20537. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  20538. *
  20539. * The wrapper `Array` methods are:
  20540. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  20541. *
  20542. * The wrapper `String` methods are:
  20543. * `replace` and `split`
  20544. *
  20545. * The wrapper methods that support shortcut fusion are:
  20546. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  20547. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  20548. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  20549. *
  20550. * The chainable wrapper methods are:
  20551. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  20552. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  20553. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  20554. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  20555. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  20556. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  20557. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  20558. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  20559. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  20560. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  20561. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  20562. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  20563. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  20564. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  20565. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  20566. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  20567. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  20568. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  20569. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  20570. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  20571. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  20572. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  20573. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  20574. * `zipObject`, `zipObjectDeep`, and `zipWith`
  20575. *
  20576. * The wrapper methods that are **not** chainable by default are:
  20577. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  20578. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  20579. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  20580. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  20581. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  20582. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  20583. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  20584. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  20585. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  20586. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  20587. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  20588. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  20589. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  20590. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  20591. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  20592. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  20593. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  20594. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  20595. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  20596. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  20597. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  20598. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  20599. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  20600. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  20601. * `upperFirst`, `value`, and `words`
  20602. *
  20603. * @name _
  20604. * @constructor
  20605. * @category Seq
  20606. * @param {*} value The value to wrap in a `lodash` instance.
  20607. * @returns {Object} Returns the new `lodash` wrapper instance.
  20608. * @example
  20609. *
  20610. * function square(n) {
  20611. * return n * n;
  20612. * }
  20613. *
  20614. * var wrapped = _([1, 2, 3]);
  20615. *
  20616. * // Returns an unwrapped value.
  20617. * wrapped.reduce(_.add);
  20618. * // => 6
  20619. *
  20620. * // Returns a wrapped value.
  20621. * var squares = wrapped.map(square);
  20622. *
  20623. * _.isArray(squares);
  20624. * // => false
  20625. *
  20626. * _.isArray(squares.value());
  20627. * // => true
  20628. */
  20629. function lodash(value) {
  20630. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  20631. if (value instanceof LodashWrapper) {
  20632. return value;
  20633. }
  20634. if (hasOwnProperty.call(value, '__wrapped__')) {
  20635. return wrapperClone(value);
  20636. }
  20637. }
  20638. return new LodashWrapper(value);
  20639. }
  20640. /**
  20641. * The base implementation of `_.create` without support for assigning
  20642. * properties to the created object.
  20643. *
  20644. * @private
  20645. * @param {Object} proto The object to inherit from.
  20646. * @returns {Object} Returns the new object.
  20647. */
  20648. var baseCreate = (function() {
  20649. function object() {}
  20650. return function(proto) {
  20651. if (!isObject(proto)) {
  20652. return {};
  20653. }
  20654. if (objectCreate) {
  20655. return objectCreate(proto);
  20656. }
  20657. object.prototype = proto;
  20658. var result = new object;
  20659. object.prototype = undefined;
  20660. return result;
  20661. };
  20662. }());
  20663. /**
  20664. * The function whose prototype chain sequence wrappers inherit from.
  20665. *
  20666. * @private
  20667. */
  20668. function baseLodash() {
  20669. // No operation performed.
  20670. }
  20671. /**
  20672. * The base constructor for creating `lodash` wrapper objects.
  20673. *
  20674. * @private
  20675. * @param {*} value The value to wrap.
  20676. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  20677. */
  20678. function LodashWrapper(value, chainAll) {
  20679. this.__wrapped__ = value;
  20680. this.__actions__ = [];
  20681. this.__chain__ = !!chainAll;
  20682. this.__index__ = 0;
  20683. this.__values__ = undefined;
  20684. }
  20685. /**
  20686. * By default, the template delimiters used by lodash are like those in
  20687. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  20688. * following template settings to use alternative delimiters.
  20689. *
  20690. * @static
  20691. * @memberOf _
  20692. * @type {Object}
  20693. */
  20694. lodash.templateSettings = {
  20695. /**
  20696. * Used to detect `data` property values to be HTML-escaped.
  20697. *
  20698. * @memberOf _.templateSettings
  20699. * @type {RegExp}
  20700. */
  20701. 'escape': reEscape,
  20702. /**
  20703. * Used to detect code to be evaluated.
  20704. *
  20705. * @memberOf _.templateSettings
  20706. * @type {RegExp}
  20707. */
  20708. 'evaluate': reEvaluate,
  20709. /**
  20710. * Used to detect `data` property values to inject.
  20711. *
  20712. * @memberOf _.templateSettings
  20713. * @type {RegExp}
  20714. */
  20715. 'interpolate': reInterpolate,
  20716. /**
  20717. * Used to reference the data object in the template text.
  20718. *
  20719. * @memberOf _.templateSettings
  20720. * @type {string}
  20721. */
  20722. 'variable': '',
  20723. /**
  20724. * Used to import variables into the compiled template.
  20725. *
  20726. * @memberOf _.templateSettings
  20727. * @type {Object}
  20728. */
  20729. 'imports': {
  20730. /**
  20731. * A reference to the `lodash` function.
  20732. *
  20733. * @memberOf _.templateSettings.imports
  20734. * @type {Function}
  20735. */
  20736. '_': lodash
  20737. }
  20738. };
  20739. // Ensure wrappers are instances of `baseLodash`.
  20740. lodash.prototype = baseLodash.prototype;
  20741. lodash.prototype.constructor = lodash;
  20742. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  20743. LodashWrapper.prototype.constructor = LodashWrapper;
  20744. /*------------------------------------------------------------------------*/
  20745. /**
  20746. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  20747. *
  20748. * @private
  20749. * @constructor
  20750. * @param {*} value The value to wrap.
  20751. */
  20752. function LazyWrapper(value) {
  20753. this.__wrapped__ = value;
  20754. this.__actions__ = [];
  20755. this.__dir__ = 1;
  20756. this.__filtered__ = false;
  20757. this.__iteratees__ = [];
  20758. this.__takeCount__ = MAX_ARRAY_LENGTH;
  20759. this.__views__ = [];
  20760. }
  20761. /**
  20762. * Creates a clone of the lazy wrapper object.
  20763. *
  20764. * @private
  20765. * @name clone
  20766. * @memberOf LazyWrapper
  20767. * @returns {Object} Returns the cloned `LazyWrapper` object.
  20768. */
  20769. function lazyClone() {
  20770. var result = new LazyWrapper(this.__wrapped__);
  20771. result.__actions__ = copyArray(this.__actions__);
  20772. result.__dir__ = this.__dir__;
  20773. result.__filtered__ = this.__filtered__;
  20774. result.__iteratees__ = copyArray(this.__iteratees__);
  20775. result.__takeCount__ = this.__takeCount__;
  20776. result.__views__ = copyArray(this.__views__);
  20777. return result;
  20778. }
  20779. /**
  20780. * Reverses the direction of lazy iteration.
  20781. *
  20782. * @private
  20783. * @name reverse
  20784. * @memberOf LazyWrapper
  20785. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  20786. */
  20787. function lazyReverse() {
  20788. if (this.__filtered__) {
  20789. var result = new LazyWrapper(this);
  20790. result.__dir__ = -1;
  20791. result.__filtered__ = true;
  20792. } else {
  20793. result = this.clone();
  20794. result.__dir__ *= -1;
  20795. }
  20796. return result;
  20797. }
  20798. /**
  20799. * Extracts the unwrapped value from its lazy wrapper.
  20800. *
  20801. * @private
  20802. * @name value
  20803. * @memberOf LazyWrapper
  20804. * @returns {*} Returns the unwrapped value.
  20805. */
  20806. function lazyValue() {
  20807. var array = this.__wrapped__.value(),
  20808. dir = this.__dir__,
  20809. isArr = isArray(array),
  20810. isRight = dir < 0,
  20811. arrLength = isArr ? array.length : 0,
  20812. view = getView(0, arrLength, this.__views__),
  20813. start = view.start,
  20814. end = view.end,
  20815. length = end - start,
  20816. index = isRight ? end : (start - 1),
  20817. iteratees = this.__iteratees__,
  20818. iterLength = iteratees.length,
  20819. resIndex = 0,
  20820. takeCount = nativeMin(length, this.__takeCount__);
  20821. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  20822. return baseWrapperValue(array, this.__actions__);
  20823. }
  20824. var result = [];
  20825. outer:
  20826. while (length-- && resIndex < takeCount) {
  20827. index += dir;
  20828. var iterIndex = -1,
  20829. value = array[index];
  20830. while (++iterIndex < iterLength) {
  20831. var data = iteratees[iterIndex],
  20832. iteratee = data.iteratee,
  20833. type = data.type,
  20834. computed = iteratee(value);
  20835. if (type == LAZY_MAP_FLAG) {
  20836. value = computed;
  20837. } else if (!computed) {
  20838. if (type == LAZY_FILTER_FLAG) {
  20839. continue outer;
  20840. } else {
  20841. break outer;
  20842. }
  20843. }
  20844. }
  20845. result[resIndex++] = value;
  20846. }
  20847. return result;
  20848. }
  20849. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  20850. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  20851. LazyWrapper.prototype.constructor = LazyWrapper;
  20852. /*------------------------------------------------------------------------*/
  20853. /**
  20854. * Creates a hash object.
  20855. *
  20856. * @private
  20857. * @constructor
  20858. * @param {Array} [entries] The key-value pairs to cache.
  20859. */
  20860. function Hash(entries) {
  20861. var index = -1,
  20862. length = entries == null ? 0 : entries.length;
  20863. this.clear();
  20864. while (++index < length) {
  20865. var entry = entries[index];
  20866. this.set(entry[0], entry[1]);
  20867. }
  20868. }
  20869. /**
  20870. * Removes all key-value entries from the hash.
  20871. *
  20872. * @private
  20873. * @name clear
  20874. * @memberOf Hash
  20875. */
  20876. function hashClear() {
  20877. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  20878. this.size = 0;
  20879. }
  20880. /**
  20881. * Removes `key` and its value from the hash.
  20882. *
  20883. * @private
  20884. * @name delete
  20885. * @memberOf Hash
  20886. * @param {Object} hash The hash to modify.
  20887. * @param {string} key The key of the value to remove.
  20888. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  20889. */
  20890. function hashDelete(key) {
  20891. var result = this.has(key) && delete this.__data__[key];
  20892. this.size -= result ? 1 : 0;
  20893. return result;
  20894. }
  20895. /**
  20896. * Gets the hash value for `key`.
  20897. *
  20898. * @private
  20899. * @name get
  20900. * @memberOf Hash
  20901. * @param {string} key The key of the value to get.
  20902. * @returns {*} Returns the entry value.
  20903. */
  20904. function hashGet(key) {
  20905. var data = this.__data__;
  20906. if (nativeCreate) {
  20907. var result = data[key];
  20908. return result === HASH_UNDEFINED ? undefined : result;
  20909. }
  20910. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  20911. }
  20912. /**
  20913. * Checks if a hash value for `key` exists.
  20914. *
  20915. * @private
  20916. * @name has
  20917. * @memberOf Hash
  20918. * @param {string} key The key of the entry to check.
  20919. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  20920. */
  20921. function hashHas(key) {
  20922. var data = this.__data__;
  20923. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  20924. }
  20925. /**
  20926. * Sets the hash `key` to `value`.
  20927. *
  20928. * @private
  20929. * @name set
  20930. * @memberOf Hash
  20931. * @param {string} key The key of the value to set.
  20932. * @param {*} value The value to set.
  20933. * @returns {Object} Returns the hash instance.
  20934. */
  20935. function hashSet(key, value) {
  20936. var data = this.__data__;
  20937. this.size += this.has(key) ? 0 : 1;
  20938. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  20939. return this;
  20940. }
  20941. // Add methods to `Hash`.
  20942. Hash.prototype.clear = hashClear;
  20943. Hash.prototype['delete'] = hashDelete;
  20944. Hash.prototype.get = hashGet;
  20945. Hash.prototype.has = hashHas;
  20946. Hash.prototype.set = hashSet;
  20947. /*------------------------------------------------------------------------*/
  20948. /**
  20949. * Creates an list cache object.
  20950. *
  20951. * @private
  20952. * @constructor
  20953. * @param {Array} [entries] The key-value pairs to cache.
  20954. */
  20955. function ListCache(entries) {
  20956. var index = -1,
  20957. length = entries == null ? 0 : entries.length;
  20958. this.clear();
  20959. while (++index < length) {
  20960. var entry = entries[index];
  20961. this.set(entry[0], entry[1]);
  20962. }
  20963. }
  20964. /**
  20965. * Removes all key-value entries from the list cache.
  20966. *
  20967. * @private
  20968. * @name clear
  20969. * @memberOf ListCache
  20970. */
  20971. function listCacheClear() {
  20972. this.__data__ = [];
  20973. this.size = 0;
  20974. }
  20975. /**
  20976. * Removes `key` and its value from the list cache.
  20977. *
  20978. * @private
  20979. * @name delete
  20980. * @memberOf ListCache
  20981. * @param {string} key The key of the value to remove.
  20982. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  20983. */
  20984. function listCacheDelete(key) {
  20985. var data = this.__data__,
  20986. index = assocIndexOf(data, key);
  20987. if (index < 0) {
  20988. return false;
  20989. }
  20990. var lastIndex = data.length - 1;
  20991. if (index == lastIndex) {
  20992. data.pop();
  20993. } else {
  20994. splice.call(data, index, 1);
  20995. }
  20996. --this.size;
  20997. return true;
  20998. }
  20999. /**
  21000. * Gets the list cache value for `key`.
  21001. *
  21002. * @private
  21003. * @name get
  21004. * @memberOf ListCache
  21005. * @param {string} key The key of the value to get.
  21006. * @returns {*} Returns the entry value.
  21007. */
  21008. function listCacheGet(key) {
  21009. var data = this.__data__,
  21010. index = assocIndexOf(data, key);
  21011. return index < 0 ? undefined : data[index][1];
  21012. }
  21013. /**
  21014. * Checks if a list cache value for `key` exists.
  21015. *
  21016. * @private
  21017. * @name has
  21018. * @memberOf ListCache
  21019. * @param {string} key The key of the entry to check.
  21020. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  21021. */
  21022. function listCacheHas(key) {
  21023. return assocIndexOf(this.__data__, key) > -1;
  21024. }
  21025. /**
  21026. * Sets the list cache `key` to `value`.
  21027. *
  21028. * @private
  21029. * @name set
  21030. * @memberOf ListCache
  21031. * @param {string} key The key of the value to set.
  21032. * @param {*} value The value to set.
  21033. * @returns {Object} Returns the list cache instance.
  21034. */
  21035. function listCacheSet(key, value) {
  21036. var data = this.__data__,
  21037. index = assocIndexOf(data, key);
  21038. if (index < 0) {
  21039. ++this.size;
  21040. data.push([key, value]);
  21041. } else {
  21042. data[index][1] = value;
  21043. }
  21044. return this;
  21045. }
  21046. // Add methods to `ListCache`.
  21047. ListCache.prototype.clear = listCacheClear;
  21048. ListCache.prototype['delete'] = listCacheDelete;
  21049. ListCache.prototype.get = listCacheGet;
  21050. ListCache.prototype.has = listCacheHas;
  21051. ListCache.prototype.set = listCacheSet;
  21052. /*------------------------------------------------------------------------*/
  21053. /**
  21054. * Creates a map cache object to store key-value pairs.
  21055. *
  21056. * @private
  21057. * @constructor
  21058. * @param {Array} [entries] The key-value pairs to cache.
  21059. */
  21060. function MapCache(entries) {
  21061. var index = -1,
  21062. length = entries == null ? 0 : entries.length;
  21063. this.clear();
  21064. while (++index < length) {
  21065. var entry = entries[index];
  21066. this.set(entry[0], entry[1]);
  21067. }
  21068. }
  21069. /**
  21070. * Removes all key-value entries from the map.
  21071. *
  21072. * @private
  21073. * @name clear
  21074. * @memberOf MapCache
  21075. */
  21076. function mapCacheClear() {
  21077. this.size = 0;
  21078. this.__data__ = {
  21079. 'hash': new Hash,
  21080. 'map': new (Map || ListCache),
  21081. 'string': new Hash
  21082. };
  21083. }
  21084. /**
  21085. * Removes `key` and its value from the map.
  21086. *
  21087. * @private
  21088. * @name delete
  21089. * @memberOf MapCache
  21090. * @param {string} key The key of the value to remove.
  21091. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  21092. */
  21093. function mapCacheDelete(key) {
  21094. var result = getMapData(this, key)['delete'](key);
  21095. this.size -= result ? 1 : 0;
  21096. return result;
  21097. }
  21098. /**
  21099. * Gets the map value for `key`.
  21100. *
  21101. * @private
  21102. * @name get
  21103. * @memberOf MapCache
  21104. * @param {string} key The key of the value to get.
  21105. * @returns {*} Returns the entry value.
  21106. */
  21107. function mapCacheGet(key) {
  21108. return getMapData(this, key).get(key);
  21109. }
  21110. /**
  21111. * Checks if a map value for `key` exists.
  21112. *
  21113. * @private
  21114. * @name has
  21115. * @memberOf MapCache
  21116. * @param {string} key The key of the entry to check.
  21117. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  21118. */
  21119. function mapCacheHas(key) {
  21120. return getMapData(this, key).has(key);
  21121. }
  21122. /**
  21123. * Sets the map `key` to `value`.
  21124. *
  21125. * @private
  21126. * @name set
  21127. * @memberOf MapCache
  21128. * @param {string} key The key of the value to set.
  21129. * @param {*} value The value to set.
  21130. * @returns {Object} Returns the map cache instance.
  21131. */
  21132. function mapCacheSet(key, value) {
  21133. var data = getMapData(this, key),
  21134. size = data.size;
  21135. data.set(key, value);
  21136. this.size += data.size == size ? 0 : 1;
  21137. return this;
  21138. }
  21139. // Add methods to `MapCache`.
  21140. MapCache.prototype.clear = mapCacheClear;
  21141. MapCache.prototype['delete'] = mapCacheDelete;
  21142. MapCache.prototype.get = mapCacheGet;
  21143. MapCache.prototype.has = mapCacheHas;
  21144. MapCache.prototype.set = mapCacheSet;
  21145. /*------------------------------------------------------------------------*/
  21146. /**
  21147. *
  21148. * Creates an array cache object to store unique values.
  21149. *
  21150. * @private
  21151. * @constructor
  21152. * @param {Array} [values] The values to cache.
  21153. */
  21154. function SetCache(values) {
  21155. var index = -1,
  21156. length = values == null ? 0 : values.length;
  21157. this.__data__ = new MapCache;
  21158. while (++index < length) {
  21159. this.add(values[index]);
  21160. }
  21161. }
  21162. /**
  21163. * Adds `value` to the array cache.
  21164. *
  21165. * @private
  21166. * @name add
  21167. * @memberOf SetCache
  21168. * @alias push
  21169. * @param {*} value The value to cache.
  21170. * @returns {Object} Returns the cache instance.
  21171. */
  21172. function setCacheAdd(value) {
  21173. this.__data__.set(value, HASH_UNDEFINED);
  21174. return this;
  21175. }
  21176. /**
  21177. * Checks if `value` is in the array cache.
  21178. *
  21179. * @private
  21180. * @name has
  21181. * @memberOf SetCache
  21182. * @param {*} value The value to search for.
  21183. * @returns {number} Returns `true` if `value` is found, else `false`.
  21184. */
  21185. function setCacheHas(value) {
  21186. return this.__data__.has(value);
  21187. }
  21188. // Add methods to `SetCache`.
  21189. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  21190. SetCache.prototype.has = setCacheHas;
  21191. /*------------------------------------------------------------------------*/
  21192. /**
  21193. * Creates a stack cache object to store key-value pairs.
  21194. *
  21195. * @private
  21196. * @constructor
  21197. * @param {Array} [entries] The key-value pairs to cache.
  21198. */
  21199. function Stack(entries) {
  21200. var data = this.__data__ = new ListCache(entries);
  21201. this.size = data.size;
  21202. }
  21203. /**
  21204. * Removes all key-value entries from the stack.
  21205. *
  21206. * @private
  21207. * @name clear
  21208. * @memberOf Stack
  21209. */
  21210. function stackClear() {
  21211. this.__data__ = new ListCache;
  21212. this.size = 0;
  21213. }
  21214. /**
  21215. * Removes `key` and its value from the stack.
  21216. *
  21217. * @private
  21218. * @name delete
  21219. * @memberOf Stack
  21220. * @param {string} key The key of the value to remove.
  21221. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  21222. */
  21223. function stackDelete(key) {
  21224. var data = this.__data__,
  21225. result = data['delete'](key);
  21226. this.size = data.size;
  21227. return result;
  21228. }
  21229. /**
  21230. * Gets the stack value for `key`.
  21231. *
  21232. * @private
  21233. * @name get
  21234. * @memberOf Stack
  21235. * @param {string} key The key of the value to get.
  21236. * @returns {*} Returns the entry value.
  21237. */
  21238. function stackGet(key) {
  21239. return this.__data__.get(key);
  21240. }
  21241. /**
  21242. * Checks if a stack value for `key` exists.
  21243. *
  21244. * @private
  21245. * @name has
  21246. * @memberOf Stack
  21247. * @param {string} key The key of the entry to check.
  21248. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  21249. */
  21250. function stackHas(key) {
  21251. return this.__data__.has(key);
  21252. }
  21253. /**
  21254. * Sets the stack `key` to `value`.
  21255. *
  21256. * @private
  21257. * @name set
  21258. * @memberOf Stack
  21259. * @param {string} key The key of the value to set.
  21260. * @param {*} value The value to set.
  21261. * @returns {Object} Returns the stack cache instance.
  21262. */
  21263. function stackSet(key, value) {
  21264. var data = this.__data__;
  21265. if (data instanceof ListCache) {
  21266. var pairs = data.__data__;
  21267. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  21268. pairs.push([key, value]);
  21269. this.size = ++data.size;
  21270. return this;
  21271. }
  21272. data = this.__data__ = new MapCache(pairs);
  21273. }
  21274. data.set(key, value);
  21275. this.size = data.size;
  21276. return this;
  21277. }
  21278. // Add methods to `Stack`.
  21279. Stack.prototype.clear = stackClear;
  21280. Stack.prototype['delete'] = stackDelete;
  21281. Stack.prototype.get = stackGet;
  21282. Stack.prototype.has = stackHas;
  21283. Stack.prototype.set = stackSet;
  21284. /*------------------------------------------------------------------------*/
  21285. /**
  21286. * Creates an array of the enumerable property names of the array-like `value`.
  21287. *
  21288. * @private
  21289. * @param {*} value The value to query.
  21290. * @param {boolean} inherited Specify returning inherited property names.
  21291. * @returns {Array} Returns the array of property names.
  21292. */
  21293. function arrayLikeKeys(value, inherited) {
  21294. var isArr = isArray(value),
  21295. isArg = !isArr && isArguments(value),
  21296. isBuff = !isArr && !isArg && isBuffer(value),
  21297. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  21298. skipIndexes = isArr || isArg || isBuff || isType,
  21299. result = skipIndexes ? baseTimes(value.length, String) : [],
  21300. length = result.length;
  21301. for (var key in value) {
  21302. if ((inherited || hasOwnProperty.call(value, key)) &&
  21303. !(skipIndexes && (
  21304. // Safari 9 has enumerable `arguments.length` in strict mode.
  21305. key == 'length' ||
  21306. // Node.js 0.10 has enumerable non-index properties on buffers.
  21307. (isBuff && (key == 'offset' || key == 'parent')) ||
  21308. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  21309. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  21310. // Skip index properties.
  21311. isIndex(key, length)
  21312. ))) {
  21313. result.push(key);
  21314. }
  21315. }
  21316. return result;
  21317. }
  21318. /**
  21319. * A specialized version of `_.sample` for arrays.
  21320. *
  21321. * @private
  21322. * @param {Array} array The array to sample.
  21323. * @returns {*} Returns the random element.
  21324. */
  21325. function arraySample(array) {
  21326. var length = array.length;
  21327. return length ? array[baseRandom(0, length - 1)] : undefined;
  21328. }
  21329. /**
  21330. * A specialized version of `_.sampleSize` for arrays.
  21331. *
  21332. * @private
  21333. * @param {Array} array The array to sample.
  21334. * @param {number} n The number of elements to sample.
  21335. * @returns {Array} Returns the random elements.
  21336. */
  21337. function arraySampleSize(array, n) {
  21338. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  21339. }
  21340. /**
  21341. * A specialized version of `_.shuffle` for arrays.
  21342. *
  21343. * @private
  21344. * @param {Array} array The array to shuffle.
  21345. * @returns {Array} Returns the new shuffled array.
  21346. */
  21347. function arrayShuffle(array) {
  21348. return shuffleSelf(copyArray(array));
  21349. }
  21350. /**
  21351. * This function is like `assignValue` except that it doesn't assign
  21352. * `undefined` values.
  21353. *
  21354. * @private
  21355. * @param {Object} object The object to modify.
  21356. * @param {string} key The key of the property to assign.
  21357. * @param {*} value The value to assign.
  21358. */
  21359. function assignMergeValue(object, key, value) {
  21360. if ((value !== undefined && !eq(object[key], value)) ||
  21361. (value === undefined && !(key in object))) {
  21362. baseAssignValue(object, key, value);
  21363. }
  21364. }
  21365. /**
  21366. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  21367. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  21368. * for equality comparisons.
  21369. *
  21370. * @private
  21371. * @param {Object} object The object to modify.
  21372. * @param {string} key The key of the property to assign.
  21373. * @param {*} value The value to assign.
  21374. */
  21375. function assignValue(object, key, value) {
  21376. var objValue = object[key];
  21377. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  21378. (value === undefined && !(key in object))) {
  21379. baseAssignValue(object, key, value);
  21380. }
  21381. }
  21382. /**
  21383. * Gets the index at which the `key` is found in `array` of key-value pairs.
  21384. *
  21385. * @private
  21386. * @param {Array} array The array to inspect.
  21387. * @param {*} key The key to search for.
  21388. * @returns {number} Returns the index of the matched value, else `-1`.
  21389. */
  21390. function assocIndexOf(array, key) {
  21391. var length = array.length;
  21392. while (length--) {
  21393. if (eq(array[length][0], key)) {
  21394. return length;
  21395. }
  21396. }
  21397. return -1;
  21398. }
  21399. /**
  21400. * Aggregates elements of `collection` on `accumulator` with keys transformed
  21401. * by `iteratee` and values set by `setter`.
  21402. *
  21403. * @private
  21404. * @param {Array|Object} collection The collection to iterate over.
  21405. * @param {Function} setter The function to set `accumulator` values.
  21406. * @param {Function} iteratee The iteratee to transform keys.
  21407. * @param {Object} accumulator The initial aggregated object.
  21408. * @returns {Function} Returns `accumulator`.
  21409. */
  21410. function baseAggregator(collection, setter, iteratee, accumulator) {
  21411. baseEach(collection, function(value, key, collection) {
  21412. setter(accumulator, value, iteratee(value), collection);
  21413. });
  21414. return accumulator;
  21415. }
  21416. /**
  21417. * The base implementation of `_.assign` without support for multiple sources
  21418. * or `customizer` functions.
  21419. *
  21420. * @private
  21421. * @param {Object} object The destination object.
  21422. * @param {Object} source The source object.
  21423. * @returns {Object} Returns `object`.
  21424. */
  21425. function baseAssign(object, source) {
  21426. return object && copyObject(source, keys(source), object);
  21427. }
  21428. /**
  21429. * The base implementation of `_.assignIn` without support for multiple sources
  21430. * or `customizer` functions.
  21431. *
  21432. * @private
  21433. * @param {Object} object The destination object.
  21434. * @param {Object} source The source object.
  21435. * @returns {Object} Returns `object`.
  21436. */
  21437. function baseAssignIn(object, source) {
  21438. return object && copyObject(source, keysIn(source), object);
  21439. }
  21440. /**
  21441. * The base implementation of `assignValue` and `assignMergeValue` without
  21442. * value checks.
  21443. *
  21444. * @private
  21445. * @param {Object} object The object to modify.
  21446. * @param {string} key The key of the property to assign.
  21447. * @param {*} value The value to assign.
  21448. */
  21449. function baseAssignValue(object, key, value) {
  21450. if (key == '__proto__' && defineProperty) {
  21451. defineProperty(object, key, {
  21452. 'configurable': true,
  21453. 'enumerable': true,
  21454. 'value': value,
  21455. 'writable': true
  21456. });
  21457. } else {
  21458. object[key] = value;
  21459. }
  21460. }
  21461. /**
  21462. * The base implementation of `_.at` without support for individual paths.
  21463. *
  21464. * @private
  21465. * @param {Object} object The object to iterate over.
  21466. * @param {string[]} paths The property paths to pick.
  21467. * @returns {Array} Returns the picked elements.
  21468. */
  21469. function baseAt(object, paths) {
  21470. var index = -1,
  21471. length = paths.length,
  21472. result = Array(length),
  21473. skip = object == null;
  21474. while (++index < length) {
  21475. result[index] = skip ? undefined : get(object, paths[index]);
  21476. }
  21477. return result;
  21478. }
  21479. /**
  21480. * The base implementation of `_.clamp` which doesn't coerce arguments.
  21481. *
  21482. * @private
  21483. * @param {number} number The number to clamp.
  21484. * @param {number} [lower] The lower bound.
  21485. * @param {number} upper The upper bound.
  21486. * @returns {number} Returns the clamped number.
  21487. */
  21488. function baseClamp(number, lower, upper) {
  21489. if (number === number) {
  21490. if (upper !== undefined) {
  21491. number = number <= upper ? number : upper;
  21492. }
  21493. if (lower !== undefined) {
  21494. number = number >= lower ? number : lower;
  21495. }
  21496. }
  21497. return number;
  21498. }
  21499. /**
  21500. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  21501. * traversed objects.
  21502. *
  21503. * @private
  21504. * @param {*} value The value to clone.
  21505. * @param {boolean} bitmask The bitmask flags.
  21506. * 1 - Deep clone
  21507. * 2 - Flatten inherited properties
  21508. * 4 - Clone symbols
  21509. * @param {Function} [customizer] The function to customize cloning.
  21510. * @param {string} [key] The key of `value`.
  21511. * @param {Object} [object] The parent object of `value`.
  21512. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  21513. * @returns {*} Returns the cloned value.
  21514. */
  21515. function baseClone(value, bitmask, customizer, key, object, stack) {
  21516. var result,
  21517. isDeep = bitmask & CLONE_DEEP_FLAG,
  21518. isFlat = bitmask & CLONE_FLAT_FLAG,
  21519. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  21520. if (customizer) {
  21521. result = object ? customizer(value, key, object, stack) : customizer(value);
  21522. }
  21523. if (result !== undefined) {
  21524. return result;
  21525. }
  21526. if (!isObject(value)) {
  21527. return value;
  21528. }
  21529. var isArr = isArray(value);
  21530. if (isArr) {
  21531. result = initCloneArray(value);
  21532. if (!isDeep) {
  21533. return copyArray(value, result);
  21534. }
  21535. } else {
  21536. var tag = getTag(value),
  21537. isFunc = tag == funcTag || tag == genTag;
  21538. if (isBuffer(value)) {
  21539. return cloneBuffer(value, isDeep);
  21540. }
  21541. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  21542. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  21543. if (!isDeep) {
  21544. return isFlat
  21545. ? copySymbolsIn(value, baseAssignIn(result, value))
  21546. : copySymbols(value, baseAssign(result, value));
  21547. }
  21548. } else {
  21549. if (!cloneableTags[tag]) {
  21550. return object ? value : {};
  21551. }
  21552. result = initCloneByTag(value, tag, isDeep);
  21553. }
  21554. }
  21555. // Check for circular references and return its corresponding clone.
  21556. stack || (stack = new Stack);
  21557. var stacked = stack.get(value);
  21558. if (stacked) {
  21559. return stacked;
  21560. }
  21561. stack.set(value, result);
  21562. if (isSet(value)) {
  21563. value.forEach(function(subValue) {
  21564. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  21565. });
  21566. } else if (isMap(value)) {
  21567. value.forEach(function(subValue, key) {
  21568. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  21569. });
  21570. }
  21571. var keysFunc = isFull
  21572. ? (isFlat ? getAllKeysIn : getAllKeys)
  21573. : (isFlat ? keysIn : keys);
  21574. var props = isArr ? undefined : keysFunc(value);
  21575. arrayEach(props || value, function(subValue, key) {
  21576. if (props) {
  21577. key = subValue;
  21578. subValue = value[key];
  21579. }
  21580. // Recursively populate clone (susceptible to call stack limits).
  21581. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  21582. });
  21583. return result;
  21584. }
  21585. /**
  21586. * The base implementation of `_.conforms` which doesn't clone `source`.
  21587. *
  21588. * @private
  21589. * @param {Object} source The object of property predicates to conform to.
  21590. * @returns {Function} Returns the new spec function.
  21591. */
  21592. function baseConforms(source) {
  21593. var props = keys(source);
  21594. return function(object) {
  21595. return baseConformsTo(object, source, props);
  21596. };
  21597. }
  21598. /**
  21599. * The base implementation of `_.conformsTo` which accepts `props` to check.
  21600. *
  21601. * @private
  21602. * @param {Object} object The object to inspect.
  21603. * @param {Object} source The object of property predicates to conform to.
  21604. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  21605. */
  21606. function baseConformsTo(object, source, props) {
  21607. var length = props.length;
  21608. if (object == null) {
  21609. return !length;
  21610. }
  21611. object = Object(object);
  21612. while (length--) {
  21613. var key = props[length],
  21614. predicate = source[key],
  21615. value = object[key];
  21616. if ((value === undefined && !(key in object)) || !predicate(value)) {
  21617. return false;
  21618. }
  21619. }
  21620. return true;
  21621. }
  21622. /**
  21623. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  21624. * to provide to `func`.
  21625. *
  21626. * @private
  21627. * @param {Function} func The function to delay.
  21628. * @param {number} wait The number of milliseconds to delay invocation.
  21629. * @param {Array} args The arguments to provide to `func`.
  21630. * @returns {number|Object} Returns the timer id or timeout object.
  21631. */
  21632. function baseDelay(func, wait, args) {
  21633. if (typeof func != 'function') {
  21634. throw new TypeError(FUNC_ERROR_TEXT);
  21635. }
  21636. return setTimeout(function() { func.apply(undefined, args); }, wait);
  21637. }
  21638. /**
  21639. * The base implementation of methods like `_.difference` without support
  21640. * for excluding multiple arrays or iteratee shorthands.
  21641. *
  21642. * @private
  21643. * @param {Array} array The array to inspect.
  21644. * @param {Array} values The values to exclude.
  21645. * @param {Function} [iteratee] The iteratee invoked per element.
  21646. * @param {Function} [comparator] The comparator invoked per element.
  21647. * @returns {Array} Returns the new array of filtered values.
  21648. */
  21649. function baseDifference(array, values, iteratee, comparator) {
  21650. var index = -1,
  21651. includes = arrayIncludes,
  21652. isCommon = true,
  21653. length = array.length,
  21654. result = [],
  21655. valuesLength = values.length;
  21656. if (!length) {
  21657. return result;
  21658. }
  21659. if (iteratee) {
  21660. values = arrayMap(values, baseUnary(iteratee));
  21661. }
  21662. if (comparator) {
  21663. includes = arrayIncludesWith;
  21664. isCommon = false;
  21665. }
  21666. else if (values.length >= LARGE_ARRAY_SIZE) {
  21667. includes = cacheHas;
  21668. isCommon = false;
  21669. values = new SetCache(values);
  21670. }
  21671. outer:
  21672. while (++index < length) {
  21673. var value = array[index],
  21674. computed = iteratee == null ? value : iteratee(value);
  21675. value = (comparator || value !== 0) ? value : 0;
  21676. if (isCommon && computed === computed) {
  21677. var valuesIndex = valuesLength;
  21678. while (valuesIndex--) {
  21679. if (values[valuesIndex] === computed) {
  21680. continue outer;
  21681. }
  21682. }
  21683. result.push(value);
  21684. }
  21685. else if (!includes(values, computed, comparator)) {
  21686. result.push(value);
  21687. }
  21688. }
  21689. return result;
  21690. }
  21691. /**
  21692. * The base implementation of `_.forEach` without support for iteratee shorthands.
  21693. *
  21694. * @private
  21695. * @param {Array|Object} collection The collection to iterate over.
  21696. * @param {Function} iteratee The function invoked per iteration.
  21697. * @returns {Array|Object} Returns `collection`.
  21698. */
  21699. var baseEach = createBaseEach(baseForOwn);
  21700. /**
  21701. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  21702. *
  21703. * @private
  21704. * @param {Array|Object} collection The collection to iterate over.
  21705. * @param {Function} iteratee The function invoked per iteration.
  21706. * @returns {Array|Object} Returns `collection`.
  21707. */
  21708. var baseEachRight = createBaseEach(baseForOwnRight, true);
  21709. /**
  21710. * The base implementation of `_.every` without support for iteratee shorthands.
  21711. *
  21712. * @private
  21713. * @param {Array|Object} collection The collection to iterate over.
  21714. * @param {Function} predicate The function invoked per iteration.
  21715. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  21716. * else `false`
  21717. */
  21718. function baseEvery(collection, predicate) {
  21719. var result = true;
  21720. baseEach(collection, function(value, index, collection) {
  21721. result = !!predicate(value, index, collection);
  21722. return result;
  21723. });
  21724. return result;
  21725. }
  21726. /**
  21727. * The base implementation of methods like `_.max` and `_.min` which accepts a
  21728. * `comparator` to determine the extremum value.
  21729. *
  21730. * @private
  21731. * @param {Array} array The array to iterate over.
  21732. * @param {Function} iteratee The iteratee invoked per iteration.
  21733. * @param {Function} comparator The comparator used to compare values.
  21734. * @returns {*} Returns the extremum value.
  21735. */
  21736. function baseExtremum(array, iteratee, comparator) {
  21737. var index = -1,
  21738. length = array.length;
  21739. while (++index < length) {
  21740. var value = array[index],
  21741. current = iteratee(value);
  21742. if (current != null && (computed === undefined
  21743. ? (current === current && !isSymbol(current))
  21744. : comparator(current, computed)
  21745. )) {
  21746. var computed = current,
  21747. result = value;
  21748. }
  21749. }
  21750. return result;
  21751. }
  21752. /**
  21753. * The base implementation of `_.fill` without an iteratee call guard.
  21754. *
  21755. * @private
  21756. * @param {Array} array The array to fill.
  21757. * @param {*} value The value to fill `array` with.
  21758. * @param {number} [start=0] The start position.
  21759. * @param {number} [end=array.length] The end position.
  21760. * @returns {Array} Returns `array`.
  21761. */
  21762. function baseFill(array, value, start, end) {
  21763. var length = array.length;
  21764. start = toInteger(start);
  21765. if (start < 0) {
  21766. start = -start > length ? 0 : (length + start);
  21767. }
  21768. end = (end === undefined || end > length) ? length : toInteger(end);
  21769. if (end < 0) {
  21770. end += length;
  21771. }
  21772. end = start > end ? 0 : toLength(end);
  21773. while (start < end) {
  21774. array[start++] = value;
  21775. }
  21776. return array;
  21777. }
  21778. /**
  21779. * The base implementation of `_.filter` without support for iteratee shorthands.
  21780. *
  21781. * @private
  21782. * @param {Array|Object} collection The collection to iterate over.
  21783. * @param {Function} predicate The function invoked per iteration.
  21784. * @returns {Array} Returns the new filtered array.
  21785. */
  21786. function baseFilter(collection, predicate) {
  21787. var result = [];
  21788. baseEach(collection, function(value, index, collection) {
  21789. if (predicate(value, index, collection)) {
  21790. result.push(value);
  21791. }
  21792. });
  21793. return result;
  21794. }
  21795. /**
  21796. * The base implementation of `_.flatten` with support for restricting flattening.
  21797. *
  21798. * @private
  21799. * @param {Array} array The array to flatten.
  21800. * @param {number} depth The maximum recursion depth.
  21801. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  21802. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  21803. * @param {Array} [result=[]] The initial result value.
  21804. * @returns {Array} Returns the new flattened array.
  21805. */
  21806. function baseFlatten(array, depth, predicate, isStrict, result) {
  21807. var index = -1,
  21808. length = array.length;
  21809. predicate || (predicate = isFlattenable);
  21810. result || (result = []);
  21811. while (++index < length) {
  21812. var value = array[index];
  21813. if (depth > 0 && predicate(value)) {
  21814. if (depth > 1) {
  21815. // Recursively flatten arrays (susceptible to call stack limits).
  21816. baseFlatten(value, depth - 1, predicate, isStrict, result);
  21817. } else {
  21818. arrayPush(result, value);
  21819. }
  21820. } else if (!isStrict) {
  21821. result[result.length] = value;
  21822. }
  21823. }
  21824. return result;
  21825. }
  21826. /**
  21827. * The base implementation of `baseForOwn` which iterates over `object`
  21828. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  21829. * Iteratee functions may exit iteration early by explicitly returning `false`.
  21830. *
  21831. * @private
  21832. * @param {Object} object The object to iterate over.
  21833. * @param {Function} iteratee The function invoked per iteration.
  21834. * @param {Function} keysFunc The function to get the keys of `object`.
  21835. * @returns {Object} Returns `object`.
  21836. */
  21837. var baseFor = createBaseFor();
  21838. /**
  21839. * This function is like `baseFor` except that it iterates over properties
  21840. * in the opposite order.
  21841. *
  21842. * @private
  21843. * @param {Object} object The object to iterate over.
  21844. * @param {Function} iteratee The function invoked per iteration.
  21845. * @param {Function} keysFunc The function to get the keys of `object`.
  21846. * @returns {Object} Returns `object`.
  21847. */
  21848. var baseForRight = createBaseFor(true);
  21849. /**
  21850. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  21851. *
  21852. * @private
  21853. * @param {Object} object The object to iterate over.
  21854. * @param {Function} iteratee The function invoked per iteration.
  21855. * @returns {Object} Returns `object`.
  21856. */
  21857. function baseForOwn(object, iteratee) {
  21858. return object && baseFor(object, iteratee, keys);
  21859. }
  21860. /**
  21861. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  21862. *
  21863. * @private
  21864. * @param {Object} object The object to iterate over.
  21865. * @param {Function} iteratee The function invoked per iteration.
  21866. * @returns {Object} Returns `object`.
  21867. */
  21868. function baseForOwnRight(object, iteratee) {
  21869. return object && baseForRight(object, iteratee, keys);
  21870. }
  21871. /**
  21872. * The base implementation of `_.functions` which creates an array of
  21873. * `object` function property names filtered from `props`.
  21874. *
  21875. * @private
  21876. * @param {Object} object The object to inspect.
  21877. * @param {Array} props The property names to filter.
  21878. * @returns {Array} Returns the function names.
  21879. */
  21880. function baseFunctions(object, props) {
  21881. return arrayFilter(props, function(key) {
  21882. return isFunction(object[key]);
  21883. });
  21884. }
  21885. /**
  21886. * The base implementation of `_.get` without support for default values.
  21887. *
  21888. * @private
  21889. * @param {Object} object The object to query.
  21890. * @param {Array|string} path The path of the property to get.
  21891. * @returns {*} Returns the resolved value.
  21892. */
  21893. function baseGet(object, path) {
  21894. path = castPath(path, object);
  21895. var index = 0,
  21896. length = path.length;
  21897. while (object != null && index < length) {
  21898. object = object[toKey(path[index++])];
  21899. }
  21900. return (index && index == length) ? object : undefined;
  21901. }
  21902. /**
  21903. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  21904. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  21905. * symbols of `object`.
  21906. *
  21907. * @private
  21908. * @param {Object} object The object to query.
  21909. * @param {Function} keysFunc The function to get the keys of `object`.
  21910. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  21911. * @returns {Array} Returns the array of property names and symbols.
  21912. */
  21913. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  21914. var result = keysFunc(object);
  21915. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  21916. }
  21917. /**
  21918. * The base implementation of `getTag` without fallbacks for buggy environments.
  21919. *
  21920. * @private
  21921. * @param {*} value The value to query.
  21922. * @returns {string} Returns the `toStringTag`.
  21923. */
  21924. function baseGetTag(value) {
  21925. if (value == null) {
  21926. return value === undefined ? undefinedTag : nullTag;
  21927. }
  21928. return (symToStringTag && symToStringTag in Object(value))
  21929. ? getRawTag(value)
  21930. : objectToString(value);
  21931. }
  21932. /**
  21933. * The base implementation of `_.gt` which doesn't coerce arguments.
  21934. *
  21935. * @private
  21936. * @param {*} value The value to compare.
  21937. * @param {*} other The other value to compare.
  21938. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  21939. * else `false`.
  21940. */
  21941. function baseGt(value, other) {
  21942. return value > other;
  21943. }
  21944. /**
  21945. * The base implementation of `_.has` without support for deep paths.
  21946. *
  21947. * @private
  21948. * @param {Object} [object] The object to query.
  21949. * @param {Array|string} key The key to check.
  21950. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  21951. */
  21952. function baseHas(object, key) {
  21953. return object != null && hasOwnProperty.call(object, key);
  21954. }
  21955. /**
  21956. * The base implementation of `_.hasIn` without support for deep paths.
  21957. *
  21958. * @private
  21959. * @param {Object} [object] The object to query.
  21960. * @param {Array|string} key The key to check.
  21961. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  21962. */
  21963. function baseHasIn(object, key) {
  21964. return object != null && key in Object(object);
  21965. }
  21966. /**
  21967. * The base implementation of `_.inRange` which doesn't coerce arguments.
  21968. *
  21969. * @private
  21970. * @param {number} number The number to check.
  21971. * @param {number} start The start of the range.
  21972. * @param {number} end The end of the range.
  21973. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  21974. */
  21975. function baseInRange(number, start, end) {
  21976. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  21977. }
  21978. /**
  21979. * The base implementation of methods like `_.intersection`, without support
  21980. * for iteratee shorthands, that accepts an array of arrays to inspect.
  21981. *
  21982. * @private
  21983. * @param {Array} arrays The arrays to inspect.
  21984. * @param {Function} [iteratee] The iteratee invoked per element.
  21985. * @param {Function} [comparator] The comparator invoked per element.
  21986. * @returns {Array} Returns the new array of shared values.
  21987. */
  21988. function baseIntersection(arrays, iteratee, comparator) {
  21989. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  21990. length = arrays[0].length,
  21991. othLength = arrays.length,
  21992. othIndex = othLength,
  21993. caches = Array(othLength),
  21994. maxLength = Infinity,
  21995. result = [];
  21996. while (othIndex--) {
  21997. var array = arrays[othIndex];
  21998. if (othIndex && iteratee) {
  21999. array = arrayMap(array, baseUnary(iteratee));
  22000. }
  22001. maxLength = nativeMin(array.length, maxLength);
  22002. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  22003. ? new SetCache(othIndex && array)
  22004. : undefined;
  22005. }
  22006. array = arrays[0];
  22007. var index = -1,
  22008. seen = caches[0];
  22009. outer:
  22010. while (++index < length && result.length < maxLength) {
  22011. var value = array[index],
  22012. computed = iteratee ? iteratee(value) : value;
  22013. value = (comparator || value !== 0) ? value : 0;
  22014. if (!(seen
  22015. ? cacheHas(seen, computed)
  22016. : includes(result, computed, comparator)
  22017. )) {
  22018. othIndex = othLength;
  22019. while (--othIndex) {
  22020. var cache = caches[othIndex];
  22021. if (!(cache
  22022. ? cacheHas(cache, computed)
  22023. : includes(arrays[othIndex], computed, comparator))
  22024. ) {
  22025. continue outer;
  22026. }
  22027. }
  22028. if (seen) {
  22029. seen.push(computed);
  22030. }
  22031. result.push(value);
  22032. }
  22033. }
  22034. return result;
  22035. }
  22036. /**
  22037. * The base implementation of `_.invert` and `_.invertBy` which inverts
  22038. * `object` with values transformed by `iteratee` and set by `setter`.
  22039. *
  22040. * @private
  22041. * @param {Object} object The object to iterate over.
  22042. * @param {Function} setter The function to set `accumulator` values.
  22043. * @param {Function} iteratee The iteratee to transform values.
  22044. * @param {Object} accumulator The initial inverted object.
  22045. * @returns {Function} Returns `accumulator`.
  22046. */
  22047. function baseInverter(object, setter, iteratee, accumulator) {
  22048. baseForOwn(object, function(value, key, object) {
  22049. setter(accumulator, iteratee(value), key, object);
  22050. });
  22051. return accumulator;
  22052. }
  22053. /**
  22054. * The base implementation of `_.invoke` without support for individual
  22055. * method arguments.
  22056. *
  22057. * @private
  22058. * @param {Object} object The object to query.
  22059. * @param {Array|string} path The path of the method to invoke.
  22060. * @param {Array} args The arguments to invoke the method with.
  22061. * @returns {*} Returns the result of the invoked method.
  22062. */
  22063. function baseInvoke(object, path, args) {
  22064. path = castPath(path, object);
  22065. object = parent(object, path);
  22066. var func = object == null ? object : object[toKey(last(path))];
  22067. return func == null ? undefined : apply(func, object, args);
  22068. }
  22069. /**
  22070. * The base implementation of `_.isArguments`.
  22071. *
  22072. * @private
  22073. * @param {*} value The value to check.
  22074. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  22075. */
  22076. function baseIsArguments(value) {
  22077. return isObjectLike(value) && baseGetTag(value) == argsTag;
  22078. }
  22079. /**
  22080. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  22081. *
  22082. * @private
  22083. * @param {*} value The value to check.
  22084. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  22085. */
  22086. function baseIsArrayBuffer(value) {
  22087. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  22088. }
  22089. /**
  22090. * The base implementation of `_.isDate` without Node.js optimizations.
  22091. *
  22092. * @private
  22093. * @param {*} value The value to check.
  22094. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  22095. */
  22096. function baseIsDate(value) {
  22097. return isObjectLike(value) && baseGetTag(value) == dateTag;
  22098. }
  22099. /**
  22100. * The base implementation of `_.isEqual` which supports partial comparisons
  22101. * and tracks traversed objects.
  22102. *
  22103. * @private
  22104. * @param {*} value The value to compare.
  22105. * @param {*} other The other value to compare.
  22106. * @param {boolean} bitmask The bitmask flags.
  22107. * 1 - Unordered comparison
  22108. * 2 - Partial comparison
  22109. * @param {Function} [customizer] The function to customize comparisons.
  22110. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  22111. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  22112. */
  22113. function baseIsEqual(value, other, bitmask, customizer, stack) {
  22114. if (value === other) {
  22115. return true;
  22116. }
  22117. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  22118. return value !== value && other !== other;
  22119. }
  22120. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  22121. }
  22122. /**
  22123. * A specialized version of `baseIsEqual` for arrays and objects which performs
  22124. * deep comparisons and tracks traversed objects enabling objects with circular
  22125. * references to be compared.
  22126. *
  22127. * @private
  22128. * @param {Object} object The object to compare.
  22129. * @param {Object} other The other object to compare.
  22130. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  22131. * @param {Function} customizer The function to customize comparisons.
  22132. * @param {Function} equalFunc The function to determine equivalents of values.
  22133. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  22134. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  22135. */
  22136. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  22137. var objIsArr = isArray(object),
  22138. othIsArr = isArray(other),
  22139. objTag = objIsArr ? arrayTag : getTag(object),
  22140. othTag = othIsArr ? arrayTag : getTag(other);
  22141. objTag = objTag == argsTag ? objectTag : objTag;
  22142. othTag = othTag == argsTag ? objectTag : othTag;
  22143. var objIsObj = objTag == objectTag,
  22144. othIsObj = othTag == objectTag,
  22145. isSameTag = objTag == othTag;
  22146. if (isSameTag && isBuffer(object)) {
  22147. if (!isBuffer(other)) {
  22148. return false;
  22149. }
  22150. objIsArr = true;
  22151. objIsObj = false;
  22152. }
  22153. if (isSameTag && !objIsObj) {
  22154. stack || (stack = new Stack);
  22155. return (objIsArr || isTypedArray(object))
  22156. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  22157. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  22158. }
  22159. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  22160. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  22161. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  22162. if (objIsWrapped || othIsWrapped) {
  22163. var objUnwrapped = objIsWrapped ? object.value() : object,
  22164. othUnwrapped = othIsWrapped ? other.value() : other;
  22165. stack || (stack = new Stack);
  22166. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  22167. }
  22168. }
  22169. if (!isSameTag) {
  22170. return false;
  22171. }
  22172. stack || (stack = new Stack);
  22173. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  22174. }
  22175. /**
  22176. * The base implementation of `_.isMap` without Node.js optimizations.
  22177. *
  22178. * @private
  22179. * @param {*} value The value to check.
  22180. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  22181. */
  22182. function baseIsMap(value) {
  22183. return isObjectLike(value) && getTag(value) == mapTag;
  22184. }
  22185. /**
  22186. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  22187. *
  22188. * @private
  22189. * @param {Object} object The object to inspect.
  22190. * @param {Object} source The object of property values to match.
  22191. * @param {Array} matchData The property names, values, and compare flags to match.
  22192. * @param {Function} [customizer] The function to customize comparisons.
  22193. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  22194. */
  22195. function baseIsMatch(object, source, matchData, customizer) {
  22196. var index = matchData.length,
  22197. length = index,
  22198. noCustomizer = !customizer;
  22199. if (object == null) {
  22200. return !length;
  22201. }
  22202. object = Object(object);
  22203. while (index--) {
  22204. var data = matchData[index];
  22205. if ((noCustomizer && data[2])
  22206. ? data[1] !== object[data[0]]
  22207. : !(data[0] in object)
  22208. ) {
  22209. return false;
  22210. }
  22211. }
  22212. while (++index < length) {
  22213. data = matchData[index];
  22214. var key = data[0],
  22215. objValue = object[key],
  22216. srcValue = data[1];
  22217. if (noCustomizer && data[2]) {
  22218. if (objValue === undefined && !(key in object)) {
  22219. return false;
  22220. }
  22221. } else {
  22222. var stack = new Stack;
  22223. if (customizer) {
  22224. var result = customizer(objValue, srcValue, key, object, source, stack);
  22225. }
  22226. if (!(result === undefined
  22227. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  22228. : result
  22229. )) {
  22230. return false;
  22231. }
  22232. }
  22233. }
  22234. return true;
  22235. }
  22236. /**
  22237. * The base implementation of `_.isNative` without bad shim checks.
  22238. *
  22239. * @private
  22240. * @param {*} value The value to check.
  22241. * @returns {boolean} Returns `true` if `value` is a native function,
  22242. * else `false`.
  22243. */
  22244. function baseIsNative(value) {
  22245. if (!isObject(value) || isMasked(value)) {
  22246. return false;
  22247. }
  22248. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  22249. return pattern.test(toSource(value));
  22250. }
  22251. /**
  22252. * The base implementation of `_.isRegExp` without Node.js optimizations.
  22253. *
  22254. * @private
  22255. * @param {*} value The value to check.
  22256. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  22257. */
  22258. function baseIsRegExp(value) {
  22259. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  22260. }
  22261. /**
  22262. * The base implementation of `_.isSet` without Node.js optimizations.
  22263. *
  22264. * @private
  22265. * @param {*} value The value to check.
  22266. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  22267. */
  22268. function baseIsSet(value) {
  22269. return isObjectLike(value) && getTag(value) == setTag;
  22270. }
  22271. /**
  22272. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  22273. *
  22274. * @private
  22275. * @param {*} value The value to check.
  22276. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  22277. */
  22278. function baseIsTypedArray(value) {
  22279. return isObjectLike(value) &&
  22280. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  22281. }
  22282. /**
  22283. * The base implementation of `_.iteratee`.
  22284. *
  22285. * @private
  22286. * @param {*} [value=_.identity] The value to convert to an iteratee.
  22287. * @returns {Function} Returns the iteratee.
  22288. */
  22289. function baseIteratee(value) {
  22290. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  22291. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  22292. if (typeof value == 'function') {
  22293. return value;
  22294. }
  22295. if (value == null) {
  22296. return identity;
  22297. }
  22298. if (typeof value == 'object') {
  22299. return isArray(value)
  22300. ? baseMatchesProperty(value[0], value[1])
  22301. : baseMatches(value);
  22302. }
  22303. return property(value);
  22304. }
  22305. /**
  22306. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  22307. *
  22308. * @private
  22309. * @param {Object} object The object to query.
  22310. * @returns {Array} Returns the array of property names.
  22311. */
  22312. function baseKeys(object) {
  22313. if (!isPrototype(object)) {
  22314. return nativeKeys(object);
  22315. }
  22316. var result = [];
  22317. for (var key in Object(object)) {
  22318. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  22319. result.push(key);
  22320. }
  22321. }
  22322. return result;
  22323. }
  22324. /**
  22325. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  22326. *
  22327. * @private
  22328. * @param {Object} object The object to query.
  22329. * @returns {Array} Returns the array of property names.
  22330. */
  22331. function baseKeysIn(object) {
  22332. if (!isObject(object)) {
  22333. return nativeKeysIn(object);
  22334. }
  22335. var isProto = isPrototype(object),
  22336. result = [];
  22337. for (var key in object) {
  22338. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  22339. result.push(key);
  22340. }
  22341. }
  22342. return result;
  22343. }
  22344. /**
  22345. * The base implementation of `_.lt` which doesn't coerce arguments.
  22346. *
  22347. * @private
  22348. * @param {*} value The value to compare.
  22349. * @param {*} other The other value to compare.
  22350. * @returns {boolean} Returns `true` if `value` is less than `other`,
  22351. * else `false`.
  22352. */
  22353. function baseLt(value, other) {
  22354. return value < other;
  22355. }
  22356. /**
  22357. * The base implementation of `_.map` without support for iteratee shorthands.
  22358. *
  22359. * @private
  22360. * @param {Array|Object} collection The collection to iterate over.
  22361. * @param {Function} iteratee The function invoked per iteration.
  22362. * @returns {Array} Returns the new mapped array.
  22363. */
  22364. function baseMap(collection, iteratee) {
  22365. var index = -1,
  22366. result = isArrayLike(collection) ? Array(collection.length) : [];
  22367. baseEach(collection, function(value, key, collection) {
  22368. result[++index] = iteratee(value, key, collection);
  22369. });
  22370. return result;
  22371. }
  22372. /**
  22373. * The base implementation of `_.matches` which doesn't clone `source`.
  22374. *
  22375. * @private
  22376. * @param {Object} source The object of property values to match.
  22377. * @returns {Function} Returns the new spec function.
  22378. */
  22379. function baseMatches(source) {
  22380. var matchData = getMatchData(source);
  22381. if (matchData.length == 1 && matchData[0][2]) {
  22382. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  22383. }
  22384. return function(object) {
  22385. return object === source || baseIsMatch(object, source, matchData);
  22386. };
  22387. }
  22388. /**
  22389. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  22390. *
  22391. * @private
  22392. * @param {string} path The path of the property to get.
  22393. * @param {*} srcValue The value to match.
  22394. * @returns {Function} Returns the new spec function.
  22395. */
  22396. function baseMatchesProperty(path, srcValue) {
  22397. if (isKey(path) && isStrictComparable(srcValue)) {
  22398. return matchesStrictComparable(toKey(path), srcValue);
  22399. }
  22400. return function(object) {
  22401. var objValue = get(object, path);
  22402. return (objValue === undefined && objValue === srcValue)
  22403. ? hasIn(object, path)
  22404. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  22405. };
  22406. }
  22407. /**
  22408. * The base implementation of `_.merge` without support for multiple sources.
  22409. *
  22410. * @private
  22411. * @param {Object} object The destination object.
  22412. * @param {Object} source The source object.
  22413. * @param {number} srcIndex The index of `source`.
  22414. * @param {Function} [customizer] The function to customize merged values.
  22415. * @param {Object} [stack] Tracks traversed source values and their merged
  22416. * counterparts.
  22417. */
  22418. function baseMerge(object, source, srcIndex, customizer, stack) {
  22419. if (object === source) {
  22420. return;
  22421. }
  22422. baseFor(source, function(srcValue, key) {
  22423. stack || (stack = new Stack);
  22424. if (isObject(srcValue)) {
  22425. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  22426. }
  22427. else {
  22428. var newValue = customizer
  22429. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  22430. : undefined;
  22431. if (newValue === undefined) {
  22432. newValue = srcValue;
  22433. }
  22434. assignMergeValue(object, key, newValue);
  22435. }
  22436. }, keysIn);
  22437. }
  22438. /**
  22439. * A specialized version of `baseMerge` for arrays and objects which performs
  22440. * deep merges and tracks traversed objects enabling objects with circular
  22441. * references to be merged.
  22442. *
  22443. * @private
  22444. * @param {Object} object The destination object.
  22445. * @param {Object} source The source object.
  22446. * @param {string} key The key of the value to merge.
  22447. * @param {number} srcIndex The index of `source`.
  22448. * @param {Function} mergeFunc The function to merge values.
  22449. * @param {Function} [customizer] The function to customize assigned values.
  22450. * @param {Object} [stack] Tracks traversed source values and their merged
  22451. * counterparts.
  22452. */
  22453. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  22454. var objValue = safeGet(object, key),
  22455. srcValue = safeGet(source, key),
  22456. stacked = stack.get(srcValue);
  22457. if (stacked) {
  22458. assignMergeValue(object, key, stacked);
  22459. return;
  22460. }
  22461. var newValue = customizer
  22462. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  22463. : undefined;
  22464. var isCommon = newValue === undefined;
  22465. if (isCommon) {
  22466. var isArr = isArray(srcValue),
  22467. isBuff = !isArr && isBuffer(srcValue),
  22468. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  22469. newValue = srcValue;
  22470. if (isArr || isBuff || isTyped) {
  22471. if (isArray(objValue)) {
  22472. newValue = objValue;
  22473. }
  22474. else if (isArrayLikeObject(objValue)) {
  22475. newValue = copyArray(objValue);
  22476. }
  22477. else if (isBuff) {
  22478. isCommon = false;
  22479. newValue = cloneBuffer(srcValue, true);
  22480. }
  22481. else if (isTyped) {
  22482. isCommon = false;
  22483. newValue = cloneTypedArray(srcValue, true);
  22484. }
  22485. else {
  22486. newValue = [];
  22487. }
  22488. }
  22489. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  22490. newValue = objValue;
  22491. if (isArguments(objValue)) {
  22492. newValue = toPlainObject(objValue);
  22493. }
  22494. else if (!isObject(objValue) || isFunction(objValue)) {
  22495. newValue = initCloneObject(srcValue);
  22496. }
  22497. }
  22498. else {
  22499. isCommon = false;
  22500. }
  22501. }
  22502. if (isCommon) {
  22503. // Recursively merge objects and arrays (susceptible to call stack limits).
  22504. stack.set(srcValue, newValue);
  22505. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  22506. stack['delete'](srcValue);
  22507. }
  22508. assignMergeValue(object, key, newValue);
  22509. }
  22510. /**
  22511. * The base implementation of `_.nth` which doesn't coerce arguments.
  22512. *
  22513. * @private
  22514. * @param {Array} array The array to query.
  22515. * @param {number} n The index of the element to return.
  22516. * @returns {*} Returns the nth element of `array`.
  22517. */
  22518. function baseNth(array, n) {
  22519. var length = array.length;
  22520. if (!length) {
  22521. return;
  22522. }
  22523. n += n < 0 ? length : 0;
  22524. return isIndex(n, length) ? array[n] : undefined;
  22525. }
  22526. /**
  22527. * The base implementation of `_.orderBy` without param guards.
  22528. *
  22529. * @private
  22530. * @param {Array|Object} collection The collection to iterate over.
  22531. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  22532. * @param {string[]} orders The sort orders of `iteratees`.
  22533. * @returns {Array} Returns the new sorted array.
  22534. */
  22535. function baseOrderBy(collection, iteratees, orders) {
  22536. var index = -1;
  22537. iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(getIteratee()));
  22538. var result = baseMap(collection, function(value, key, collection) {
  22539. var criteria = arrayMap(iteratees, function(iteratee) {
  22540. return iteratee(value);
  22541. });
  22542. return { 'criteria': criteria, 'index': ++index, 'value': value };
  22543. });
  22544. return baseSortBy(result, function(object, other) {
  22545. return compareMultiple(object, other, orders);
  22546. });
  22547. }
  22548. /**
  22549. * The base implementation of `_.pick` without support for individual
  22550. * property identifiers.
  22551. *
  22552. * @private
  22553. * @param {Object} object The source object.
  22554. * @param {string[]} paths The property paths to pick.
  22555. * @returns {Object} Returns the new object.
  22556. */
  22557. function basePick(object, paths) {
  22558. return basePickBy(object, paths, function(value, path) {
  22559. return hasIn(object, path);
  22560. });
  22561. }
  22562. /**
  22563. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  22564. *
  22565. * @private
  22566. * @param {Object} object The source object.
  22567. * @param {string[]} paths The property paths to pick.
  22568. * @param {Function} predicate The function invoked per property.
  22569. * @returns {Object} Returns the new object.
  22570. */
  22571. function basePickBy(object, paths, predicate) {
  22572. var index = -1,
  22573. length = paths.length,
  22574. result = {};
  22575. while (++index < length) {
  22576. var path = paths[index],
  22577. value = baseGet(object, path);
  22578. if (predicate(value, path)) {
  22579. baseSet(result, castPath(path, object), value);
  22580. }
  22581. }
  22582. return result;
  22583. }
  22584. /**
  22585. * A specialized version of `baseProperty` which supports deep paths.
  22586. *
  22587. * @private
  22588. * @param {Array|string} path The path of the property to get.
  22589. * @returns {Function} Returns the new accessor function.
  22590. */
  22591. function basePropertyDeep(path) {
  22592. return function(object) {
  22593. return baseGet(object, path);
  22594. };
  22595. }
  22596. /**
  22597. * The base implementation of `_.pullAllBy` without support for iteratee
  22598. * shorthands.
  22599. *
  22600. * @private
  22601. * @param {Array} array The array to modify.
  22602. * @param {Array} values The values to remove.
  22603. * @param {Function} [iteratee] The iteratee invoked per element.
  22604. * @param {Function} [comparator] The comparator invoked per element.
  22605. * @returns {Array} Returns `array`.
  22606. */
  22607. function basePullAll(array, values, iteratee, comparator) {
  22608. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  22609. index = -1,
  22610. length = values.length,
  22611. seen = array;
  22612. if (array === values) {
  22613. values = copyArray(values);
  22614. }
  22615. if (iteratee) {
  22616. seen = arrayMap(array, baseUnary(iteratee));
  22617. }
  22618. while (++index < length) {
  22619. var fromIndex = 0,
  22620. value = values[index],
  22621. computed = iteratee ? iteratee(value) : value;
  22622. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  22623. if (seen !== array) {
  22624. splice.call(seen, fromIndex, 1);
  22625. }
  22626. splice.call(array, fromIndex, 1);
  22627. }
  22628. }
  22629. return array;
  22630. }
  22631. /**
  22632. * The base implementation of `_.pullAt` without support for individual
  22633. * indexes or capturing the removed elements.
  22634. *
  22635. * @private
  22636. * @param {Array} array The array to modify.
  22637. * @param {number[]} indexes The indexes of elements to remove.
  22638. * @returns {Array} Returns `array`.
  22639. */
  22640. function basePullAt(array, indexes) {
  22641. var length = array ? indexes.length : 0,
  22642. lastIndex = length - 1;
  22643. while (length--) {
  22644. var index = indexes[length];
  22645. if (length == lastIndex || index !== previous) {
  22646. var previous = index;
  22647. if (isIndex(index)) {
  22648. splice.call(array, index, 1);
  22649. } else {
  22650. baseUnset(array, index);
  22651. }
  22652. }
  22653. }
  22654. return array;
  22655. }
  22656. /**
  22657. * The base implementation of `_.random` without support for returning
  22658. * floating-point numbers.
  22659. *
  22660. * @private
  22661. * @param {number} lower The lower bound.
  22662. * @param {number} upper The upper bound.
  22663. * @returns {number} Returns the random number.
  22664. */
  22665. function baseRandom(lower, upper) {
  22666. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  22667. }
  22668. /**
  22669. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  22670. * coerce arguments.
  22671. *
  22672. * @private
  22673. * @param {number} start The start of the range.
  22674. * @param {number} end The end of the range.
  22675. * @param {number} step The value to increment or decrement by.
  22676. * @param {boolean} [fromRight] Specify iterating from right to left.
  22677. * @returns {Array} Returns the range of numbers.
  22678. */
  22679. function baseRange(start, end, step, fromRight) {
  22680. var index = -1,
  22681. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  22682. result = Array(length);
  22683. while (length--) {
  22684. result[fromRight ? length : ++index] = start;
  22685. start += step;
  22686. }
  22687. return result;
  22688. }
  22689. /**
  22690. * The base implementation of `_.repeat` which doesn't coerce arguments.
  22691. *
  22692. * @private
  22693. * @param {string} string The string to repeat.
  22694. * @param {number} n The number of times to repeat the string.
  22695. * @returns {string} Returns the repeated string.
  22696. */
  22697. function baseRepeat(string, n) {
  22698. var result = '';
  22699. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  22700. return result;
  22701. }
  22702. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  22703. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  22704. do {
  22705. if (n % 2) {
  22706. result += string;
  22707. }
  22708. n = nativeFloor(n / 2);
  22709. if (n) {
  22710. string += string;
  22711. }
  22712. } while (n);
  22713. return result;
  22714. }
  22715. /**
  22716. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  22717. *
  22718. * @private
  22719. * @param {Function} func The function to apply a rest parameter to.
  22720. * @param {number} [start=func.length-1] The start position of the rest parameter.
  22721. * @returns {Function} Returns the new function.
  22722. */
  22723. function baseRest(func, start) {
  22724. return setToString(overRest(func, start, identity), func + '');
  22725. }
  22726. /**
  22727. * The base implementation of `_.sample`.
  22728. *
  22729. * @private
  22730. * @param {Array|Object} collection The collection to sample.
  22731. * @returns {*} Returns the random element.
  22732. */
  22733. function baseSample(collection) {
  22734. return arraySample(values(collection));
  22735. }
  22736. /**
  22737. * The base implementation of `_.sampleSize` without param guards.
  22738. *
  22739. * @private
  22740. * @param {Array|Object} collection The collection to sample.
  22741. * @param {number} n The number of elements to sample.
  22742. * @returns {Array} Returns the random elements.
  22743. */
  22744. function baseSampleSize(collection, n) {
  22745. var array = values(collection);
  22746. return shuffleSelf(array, baseClamp(n, 0, array.length));
  22747. }
  22748. /**
  22749. * The base implementation of `_.set`.
  22750. *
  22751. * @private
  22752. * @param {Object} object The object to modify.
  22753. * @param {Array|string} path The path of the property to set.
  22754. * @param {*} value The value to set.
  22755. * @param {Function} [customizer] The function to customize path creation.
  22756. * @returns {Object} Returns `object`.
  22757. */
  22758. function baseSet(object, path, value, customizer) {
  22759. if (!isObject(object)) {
  22760. return object;
  22761. }
  22762. path = castPath(path, object);
  22763. var index = -1,
  22764. length = path.length,
  22765. lastIndex = length - 1,
  22766. nested = object;
  22767. while (nested != null && ++index < length) {
  22768. var key = toKey(path[index]),
  22769. newValue = value;
  22770. if (index != lastIndex) {
  22771. var objValue = nested[key];
  22772. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  22773. if (newValue === undefined) {
  22774. newValue = isObject(objValue)
  22775. ? objValue
  22776. : (isIndex(path[index + 1]) ? [] : {});
  22777. }
  22778. }
  22779. assignValue(nested, key, newValue);
  22780. nested = nested[key];
  22781. }
  22782. return object;
  22783. }
  22784. /**
  22785. * The base implementation of `setData` without support for hot loop shorting.
  22786. *
  22787. * @private
  22788. * @param {Function} func The function to associate metadata with.
  22789. * @param {*} data The metadata.
  22790. * @returns {Function} Returns `func`.
  22791. */
  22792. var baseSetData = !metaMap ? identity : function(func, data) {
  22793. metaMap.set(func, data);
  22794. return func;
  22795. };
  22796. /**
  22797. * The base implementation of `setToString` without support for hot loop shorting.
  22798. *
  22799. * @private
  22800. * @param {Function} func The function to modify.
  22801. * @param {Function} string The `toString` result.
  22802. * @returns {Function} Returns `func`.
  22803. */
  22804. var baseSetToString = !defineProperty ? identity : function(func, string) {
  22805. return defineProperty(func, 'toString', {
  22806. 'configurable': true,
  22807. 'enumerable': false,
  22808. 'value': constant(string),
  22809. 'writable': true
  22810. });
  22811. };
  22812. /**
  22813. * The base implementation of `_.shuffle`.
  22814. *
  22815. * @private
  22816. * @param {Array|Object} collection The collection to shuffle.
  22817. * @returns {Array} Returns the new shuffled array.
  22818. */
  22819. function baseShuffle(collection) {
  22820. return shuffleSelf(values(collection));
  22821. }
  22822. /**
  22823. * The base implementation of `_.slice` without an iteratee call guard.
  22824. *
  22825. * @private
  22826. * @param {Array} array The array to slice.
  22827. * @param {number} [start=0] The start position.
  22828. * @param {number} [end=array.length] The end position.
  22829. * @returns {Array} Returns the slice of `array`.
  22830. */
  22831. function baseSlice(array, start, end) {
  22832. var index = -1,
  22833. length = array.length;
  22834. if (start < 0) {
  22835. start = -start > length ? 0 : (length + start);
  22836. }
  22837. end = end > length ? length : end;
  22838. if (end < 0) {
  22839. end += length;
  22840. }
  22841. length = start > end ? 0 : ((end - start) >>> 0);
  22842. start >>>= 0;
  22843. var result = Array(length);
  22844. while (++index < length) {
  22845. result[index] = array[index + start];
  22846. }
  22847. return result;
  22848. }
  22849. /**
  22850. * The base implementation of `_.some` without support for iteratee shorthands.
  22851. *
  22852. * @private
  22853. * @param {Array|Object} collection The collection to iterate over.
  22854. * @param {Function} predicate The function invoked per iteration.
  22855. * @returns {boolean} Returns `true` if any element passes the predicate check,
  22856. * else `false`.
  22857. */
  22858. function baseSome(collection, predicate) {
  22859. var result;
  22860. baseEach(collection, function(value, index, collection) {
  22861. result = predicate(value, index, collection);
  22862. return !result;
  22863. });
  22864. return !!result;
  22865. }
  22866. /**
  22867. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  22868. * performs a binary search of `array` to determine the index at which `value`
  22869. * should be inserted into `array` in order to maintain its sort order.
  22870. *
  22871. * @private
  22872. * @param {Array} array The sorted array to inspect.
  22873. * @param {*} value The value to evaluate.
  22874. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  22875. * @returns {number} Returns the index at which `value` should be inserted
  22876. * into `array`.
  22877. */
  22878. function baseSortedIndex(array, value, retHighest) {
  22879. var low = 0,
  22880. high = array == null ? low : array.length;
  22881. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  22882. while (low < high) {
  22883. var mid = (low + high) >>> 1,
  22884. computed = array[mid];
  22885. if (computed !== null && !isSymbol(computed) &&
  22886. (retHighest ? (computed <= value) : (computed < value))) {
  22887. low = mid + 1;
  22888. } else {
  22889. high = mid;
  22890. }
  22891. }
  22892. return high;
  22893. }
  22894. return baseSortedIndexBy(array, value, identity, retHighest);
  22895. }
  22896. /**
  22897. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  22898. * which invokes `iteratee` for `value` and each element of `array` to compute
  22899. * their sort ranking. The iteratee is invoked with one argument; (value).
  22900. *
  22901. * @private
  22902. * @param {Array} array The sorted array to inspect.
  22903. * @param {*} value The value to evaluate.
  22904. * @param {Function} iteratee The iteratee invoked per element.
  22905. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  22906. * @returns {number} Returns the index at which `value` should be inserted
  22907. * into `array`.
  22908. */
  22909. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  22910. value = iteratee(value);
  22911. var low = 0,
  22912. high = array == null ? 0 : array.length,
  22913. valIsNaN = value !== value,
  22914. valIsNull = value === null,
  22915. valIsSymbol = isSymbol(value),
  22916. valIsUndefined = value === undefined;
  22917. while (low < high) {
  22918. var mid = nativeFloor((low + high) / 2),
  22919. computed = iteratee(array[mid]),
  22920. othIsDefined = computed !== undefined,
  22921. othIsNull = computed === null,
  22922. othIsReflexive = computed === computed,
  22923. othIsSymbol = isSymbol(computed);
  22924. if (valIsNaN) {
  22925. var setLow = retHighest || othIsReflexive;
  22926. } else if (valIsUndefined) {
  22927. setLow = othIsReflexive && (retHighest || othIsDefined);
  22928. } else if (valIsNull) {
  22929. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  22930. } else if (valIsSymbol) {
  22931. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  22932. } else if (othIsNull || othIsSymbol) {
  22933. setLow = false;
  22934. } else {
  22935. setLow = retHighest ? (computed <= value) : (computed < value);
  22936. }
  22937. if (setLow) {
  22938. low = mid + 1;
  22939. } else {
  22940. high = mid;
  22941. }
  22942. }
  22943. return nativeMin(high, MAX_ARRAY_INDEX);
  22944. }
  22945. /**
  22946. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  22947. * support for iteratee shorthands.
  22948. *
  22949. * @private
  22950. * @param {Array} array The array to inspect.
  22951. * @param {Function} [iteratee] The iteratee invoked per element.
  22952. * @returns {Array} Returns the new duplicate free array.
  22953. */
  22954. function baseSortedUniq(array, iteratee) {
  22955. var index = -1,
  22956. length = array.length,
  22957. resIndex = 0,
  22958. result = [];
  22959. while (++index < length) {
  22960. var value = array[index],
  22961. computed = iteratee ? iteratee(value) : value;
  22962. if (!index || !eq(computed, seen)) {
  22963. var seen = computed;
  22964. result[resIndex++] = value === 0 ? 0 : value;
  22965. }
  22966. }
  22967. return result;
  22968. }
  22969. /**
  22970. * The base implementation of `_.toNumber` which doesn't ensure correct
  22971. * conversions of binary, hexadecimal, or octal string values.
  22972. *
  22973. * @private
  22974. * @param {*} value The value to process.
  22975. * @returns {number} Returns the number.
  22976. */
  22977. function baseToNumber(value) {
  22978. if (typeof value == 'number') {
  22979. return value;
  22980. }
  22981. if (isSymbol(value)) {
  22982. return NAN;
  22983. }
  22984. return +value;
  22985. }
  22986. /**
  22987. * The base implementation of `_.toString` which doesn't convert nullish
  22988. * values to empty strings.
  22989. *
  22990. * @private
  22991. * @param {*} value The value to process.
  22992. * @returns {string} Returns the string.
  22993. */
  22994. function baseToString(value) {
  22995. // Exit early for strings to avoid a performance hit in some environments.
  22996. if (typeof value == 'string') {
  22997. return value;
  22998. }
  22999. if (isArray(value)) {
  23000. // Recursively convert values (susceptible to call stack limits).
  23001. return arrayMap(value, baseToString) + '';
  23002. }
  23003. if (isSymbol(value)) {
  23004. return symbolToString ? symbolToString.call(value) : '';
  23005. }
  23006. var result = (value + '');
  23007. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  23008. }
  23009. /**
  23010. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  23011. *
  23012. * @private
  23013. * @param {Array} array The array to inspect.
  23014. * @param {Function} [iteratee] The iteratee invoked per element.
  23015. * @param {Function} [comparator] The comparator invoked per element.
  23016. * @returns {Array} Returns the new duplicate free array.
  23017. */
  23018. function baseUniq(array, iteratee, comparator) {
  23019. var index = -1,
  23020. includes = arrayIncludes,
  23021. length = array.length,
  23022. isCommon = true,
  23023. result = [],
  23024. seen = result;
  23025. if (comparator) {
  23026. isCommon = false;
  23027. includes = arrayIncludesWith;
  23028. }
  23029. else if (length >= LARGE_ARRAY_SIZE) {
  23030. var set = iteratee ? null : createSet(array);
  23031. if (set) {
  23032. return setToArray(set);
  23033. }
  23034. isCommon = false;
  23035. includes = cacheHas;
  23036. seen = new SetCache;
  23037. }
  23038. else {
  23039. seen = iteratee ? [] : result;
  23040. }
  23041. outer:
  23042. while (++index < length) {
  23043. var value = array[index],
  23044. computed = iteratee ? iteratee(value) : value;
  23045. value = (comparator || value !== 0) ? value : 0;
  23046. if (isCommon && computed === computed) {
  23047. var seenIndex = seen.length;
  23048. while (seenIndex--) {
  23049. if (seen[seenIndex] === computed) {
  23050. continue outer;
  23051. }
  23052. }
  23053. if (iteratee) {
  23054. seen.push(computed);
  23055. }
  23056. result.push(value);
  23057. }
  23058. else if (!includes(seen, computed, comparator)) {
  23059. if (seen !== result) {
  23060. seen.push(computed);
  23061. }
  23062. result.push(value);
  23063. }
  23064. }
  23065. return result;
  23066. }
  23067. /**
  23068. * The base implementation of `_.unset`.
  23069. *
  23070. * @private
  23071. * @param {Object} object The object to modify.
  23072. * @param {Array|string} path The property path to unset.
  23073. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  23074. */
  23075. function baseUnset(object, path) {
  23076. path = castPath(path, object);
  23077. object = parent(object, path);
  23078. return object == null || delete object[toKey(last(path))];
  23079. }
  23080. /**
  23081. * The base implementation of `_.update`.
  23082. *
  23083. * @private
  23084. * @param {Object} object The object to modify.
  23085. * @param {Array|string} path The path of the property to update.
  23086. * @param {Function} updater The function to produce the updated value.
  23087. * @param {Function} [customizer] The function to customize path creation.
  23088. * @returns {Object} Returns `object`.
  23089. */
  23090. function baseUpdate(object, path, updater, customizer) {
  23091. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  23092. }
  23093. /**
  23094. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  23095. * without support for iteratee shorthands.
  23096. *
  23097. * @private
  23098. * @param {Array} array The array to query.
  23099. * @param {Function} predicate The function invoked per iteration.
  23100. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  23101. * @param {boolean} [fromRight] Specify iterating from right to left.
  23102. * @returns {Array} Returns the slice of `array`.
  23103. */
  23104. function baseWhile(array, predicate, isDrop, fromRight) {
  23105. var length = array.length,
  23106. index = fromRight ? length : -1;
  23107. while ((fromRight ? index-- : ++index < length) &&
  23108. predicate(array[index], index, array)) {}
  23109. return isDrop
  23110. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  23111. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  23112. }
  23113. /**
  23114. * The base implementation of `wrapperValue` which returns the result of
  23115. * performing a sequence of actions on the unwrapped `value`, where each
  23116. * successive action is supplied the return value of the previous.
  23117. *
  23118. * @private
  23119. * @param {*} value The unwrapped value.
  23120. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  23121. * @returns {*} Returns the resolved value.
  23122. */
  23123. function baseWrapperValue(value, actions) {
  23124. var result = value;
  23125. if (result instanceof LazyWrapper) {
  23126. result = result.value();
  23127. }
  23128. return arrayReduce(actions, function(result, action) {
  23129. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  23130. }, result);
  23131. }
  23132. /**
  23133. * The base implementation of methods like `_.xor`, without support for
  23134. * iteratee shorthands, that accepts an array of arrays to inspect.
  23135. *
  23136. * @private
  23137. * @param {Array} arrays The arrays to inspect.
  23138. * @param {Function} [iteratee] The iteratee invoked per element.
  23139. * @param {Function} [comparator] The comparator invoked per element.
  23140. * @returns {Array} Returns the new array of values.
  23141. */
  23142. function baseXor(arrays, iteratee, comparator) {
  23143. var length = arrays.length;
  23144. if (length < 2) {
  23145. return length ? baseUniq(arrays[0]) : [];
  23146. }
  23147. var index = -1,
  23148. result = Array(length);
  23149. while (++index < length) {
  23150. var array = arrays[index],
  23151. othIndex = -1;
  23152. while (++othIndex < length) {
  23153. if (othIndex != index) {
  23154. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  23155. }
  23156. }
  23157. }
  23158. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  23159. }
  23160. /**
  23161. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  23162. *
  23163. * @private
  23164. * @param {Array} props The property identifiers.
  23165. * @param {Array} values The property values.
  23166. * @param {Function} assignFunc The function to assign values.
  23167. * @returns {Object} Returns the new object.
  23168. */
  23169. function baseZipObject(props, values, assignFunc) {
  23170. var index = -1,
  23171. length = props.length,
  23172. valsLength = values.length,
  23173. result = {};
  23174. while (++index < length) {
  23175. var value = index < valsLength ? values[index] : undefined;
  23176. assignFunc(result, props[index], value);
  23177. }
  23178. return result;
  23179. }
  23180. /**
  23181. * Casts `value` to an empty array if it's not an array like object.
  23182. *
  23183. * @private
  23184. * @param {*} value The value to inspect.
  23185. * @returns {Array|Object} Returns the cast array-like object.
  23186. */
  23187. function castArrayLikeObject(value) {
  23188. return isArrayLikeObject(value) ? value : [];
  23189. }
  23190. /**
  23191. * Casts `value` to `identity` if it's not a function.
  23192. *
  23193. * @private
  23194. * @param {*} value The value to inspect.
  23195. * @returns {Function} Returns cast function.
  23196. */
  23197. function castFunction(value) {
  23198. return typeof value == 'function' ? value : identity;
  23199. }
  23200. /**
  23201. * Casts `value` to a path array if it's not one.
  23202. *
  23203. * @private
  23204. * @param {*} value The value to inspect.
  23205. * @param {Object} [object] The object to query keys on.
  23206. * @returns {Array} Returns the cast property path array.
  23207. */
  23208. function castPath(value, object) {
  23209. if (isArray(value)) {
  23210. return value;
  23211. }
  23212. return isKey(value, object) ? [value] : stringToPath(toString(value));
  23213. }
  23214. /**
  23215. * A `baseRest` alias which can be replaced with `identity` by module
  23216. * replacement plugins.
  23217. *
  23218. * @private
  23219. * @type {Function}
  23220. * @param {Function} func The function to apply a rest parameter to.
  23221. * @returns {Function} Returns the new function.
  23222. */
  23223. var castRest = baseRest;
  23224. /**
  23225. * Casts `array` to a slice if it's needed.
  23226. *
  23227. * @private
  23228. * @param {Array} array The array to inspect.
  23229. * @param {number} start The start position.
  23230. * @param {number} [end=array.length] The end position.
  23231. * @returns {Array} Returns the cast slice.
  23232. */
  23233. function castSlice(array, start, end) {
  23234. var length = array.length;
  23235. end = end === undefined ? length : end;
  23236. return (!start && end >= length) ? array : baseSlice(array, start, end);
  23237. }
  23238. /**
  23239. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  23240. *
  23241. * @private
  23242. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  23243. */
  23244. var clearTimeout = ctxClearTimeout || function(id) {
  23245. return root.clearTimeout(id);
  23246. };
  23247. /**
  23248. * Creates a clone of `buffer`.
  23249. *
  23250. * @private
  23251. * @param {Buffer} buffer The buffer to clone.
  23252. * @param {boolean} [isDeep] Specify a deep clone.
  23253. * @returns {Buffer} Returns the cloned buffer.
  23254. */
  23255. function cloneBuffer(buffer, isDeep) {
  23256. if (isDeep) {
  23257. return buffer.slice();
  23258. }
  23259. var length = buffer.length,
  23260. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  23261. buffer.copy(result);
  23262. return result;
  23263. }
  23264. /**
  23265. * Creates a clone of `arrayBuffer`.
  23266. *
  23267. * @private
  23268. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  23269. * @returns {ArrayBuffer} Returns the cloned array buffer.
  23270. */
  23271. function cloneArrayBuffer(arrayBuffer) {
  23272. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  23273. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  23274. return result;
  23275. }
  23276. /**
  23277. * Creates a clone of `dataView`.
  23278. *
  23279. * @private
  23280. * @param {Object} dataView The data view to clone.
  23281. * @param {boolean} [isDeep] Specify a deep clone.
  23282. * @returns {Object} Returns the cloned data view.
  23283. */
  23284. function cloneDataView(dataView, isDeep) {
  23285. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  23286. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  23287. }
  23288. /**
  23289. * Creates a clone of `regexp`.
  23290. *
  23291. * @private
  23292. * @param {Object} regexp The regexp to clone.
  23293. * @returns {Object} Returns the cloned regexp.
  23294. */
  23295. function cloneRegExp(regexp) {
  23296. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  23297. result.lastIndex = regexp.lastIndex;
  23298. return result;
  23299. }
  23300. /**
  23301. * Creates a clone of the `symbol` object.
  23302. *
  23303. * @private
  23304. * @param {Object} symbol The symbol object to clone.
  23305. * @returns {Object} Returns the cloned symbol object.
  23306. */
  23307. function cloneSymbol(symbol) {
  23308. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  23309. }
  23310. /**
  23311. * Creates a clone of `typedArray`.
  23312. *
  23313. * @private
  23314. * @param {Object} typedArray The typed array to clone.
  23315. * @param {boolean} [isDeep] Specify a deep clone.
  23316. * @returns {Object} Returns the cloned typed array.
  23317. */
  23318. function cloneTypedArray(typedArray, isDeep) {
  23319. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  23320. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  23321. }
  23322. /**
  23323. * Compares values to sort them in ascending order.
  23324. *
  23325. * @private
  23326. * @param {*} value The value to compare.
  23327. * @param {*} other The other value to compare.
  23328. * @returns {number} Returns the sort order indicator for `value`.
  23329. */
  23330. function compareAscending(value, other) {
  23331. if (value !== other) {
  23332. var valIsDefined = value !== undefined,
  23333. valIsNull = value === null,
  23334. valIsReflexive = value === value,
  23335. valIsSymbol = isSymbol(value);
  23336. var othIsDefined = other !== undefined,
  23337. othIsNull = other === null,
  23338. othIsReflexive = other === other,
  23339. othIsSymbol = isSymbol(other);
  23340. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  23341. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  23342. (valIsNull && othIsDefined && othIsReflexive) ||
  23343. (!valIsDefined && othIsReflexive) ||
  23344. !valIsReflexive) {
  23345. return 1;
  23346. }
  23347. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  23348. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  23349. (othIsNull && valIsDefined && valIsReflexive) ||
  23350. (!othIsDefined && valIsReflexive) ||
  23351. !othIsReflexive) {
  23352. return -1;
  23353. }
  23354. }
  23355. return 0;
  23356. }
  23357. /**
  23358. * Used by `_.orderBy` to compare multiple properties of a value to another
  23359. * and stable sort them.
  23360. *
  23361. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  23362. * specify an order of "desc" for descending or "asc" for ascending sort order
  23363. * of corresponding values.
  23364. *
  23365. * @private
  23366. * @param {Object} object The object to compare.
  23367. * @param {Object} other The other object to compare.
  23368. * @param {boolean[]|string[]} orders The order to sort by for each property.
  23369. * @returns {number} Returns the sort order indicator for `object`.
  23370. */
  23371. function compareMultiple(object, other, orders) {
  23372. var index = -1,
  23373. objCriteria = object.criteria,
  23374. othCriteria = other.criteria,
  23375. length = objCriteria.length,
  23376. ordersLength = orders.length;
  23377. while (++index < length) {
  23378. var result = compareAscending(objCriteria[index], othCriteria[index]);
  23379. if (result) {
  23380. if (index >= ordersLength) {
  23381. return result;
  23382. }
  23383. var order = orders[index];
  23384. return result * (order == 'desc' ? -1 : 1);
  23385. }
  23386. }
  23387. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  23388. // that causes it, under certain circumstances, to provide the same value for
  23389. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  23390. // for more details.
  23391. //
  23392. // This also ensures a stable sort in V8 and other engines.
  23393. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  23394. return object.index - other.index;
  23395. }
  23396. /**
  23397. * Creates an array that is the composition of partially applied arguments,
  23398. * placeholders, and provided arguments into a single array of arguments.
  23399. *
  23400. * @private
  23401. * @param {Array} args The provided arguments.
  23402. * @param {Array} partials The arguments to prepend to those provided.
  23403. * @param {Array} holders The `partials` placeholder indexes.
  23404. * @params {boolean} [isCurried] Specify composing for a curried function.
  23405. * @returns {Array} Returns the new array of composed arguments.
  23406. */
  23407. function composeArgs(args, partials, holders, isCurried) {
  23408. var argsIndex = -1,
  23409. argsLength = args.length,
  23410. holdersLength = holders.length,
  23411. leftIndex = -1,
  23412. leftLength = partials.length,
  23413. rangeLength = nativeMax(argsLength - holdersLength, 0),
  23414. result = Array(leftLength + rangeLength),
  23415. isUncurried = !isCurried;
  23416. while (++leftIndex < leftLength) {
  23417. result[leftIndex] = partials[leftIndex];
  23418. }
  23419. while (++argsIndex < holdersLength) {
  23420. if (isUncurried || argsIndex < argsLength) {
  23421. result[holders[argsIndex]] = args[argsIndex];
  23422. }
  23423. }
  23424. while (rangeLength--) {
  23425. result[leftIndex++] = args[argsIndex++];
  23426. }
  23427. return result;
  23428. }
  23429. /**
  23430. * This function is like `composeArgs` except that the arguments composition
  23431. * is tailored for `_.partialRight`.
  23432. *
  23433. * @private
  23434. * @param {Array} args The provided arguments.
  23435. * @param {Array} partials The arguments to append to those provided.
  23436. * @param {Array} holders The `partials` placeholder indexes.
  23437. * @params {boolean} [isCurried] Specify composing for a curried function.
  23438. * @returns {Array} Returns the new array of composed arguments.
  23439. */
  23440. function composeArgsRight(args, partials, holders, isCurried) {
  23441. var argsIndex = -1,
  23442. argsLength = args.length,
  23443. holdersIndex = -1,
  23444. holdersLength = holders.length,
  23445. rightIndex = -1,
  23446. rightLength = partials.length,
  23447. rangeLength = nativeMax(argsLength - holdersLength, 0),
  23448. result = Array(rangeLength + rightLength),
  23449. isUncurried = !isCurried;
  23450. while (++argsIndex < rangeLength) {
  23451. result[argsIndex] = args[argsIndex];
  23452. }
  23453. var offset = argsIndex;
  23454. while (++rightIndex < rightLength) {
  23455. result[offset + rightIndex] = partials[rightIndex];
  23456. }
  23457. while (++holdersIndex < holdersLength) {
  23458. if (isUncurried || argsIndex < argsLength) {
  23459. result[offset + holders[holdersIndex]] = args[argsIndex++];
  23460. }
  23461. }
  23462. return result;
  23463. }
  23464. /**
  23465. * Copies the values of `source` to `array`.
  23466. *
  23467. * @private
  23468. * @param {Array} source The array to copy values from.
  23469. * @param {Array} [array=[]] The array to copy values to.
  23470. * @returns {Array} Returns `array`.
  23471. */
  23472. function copyArray(source, array) {
  23473. var index = -1,
  23474. length = source.length;
  23475. array || (array = Array(length));
  23476. while (++index < length) {
  23477. array[index] = source[index];
  23478. }
  23479. return array;
  23480. }
  23481. /**
  23482. * Copies properties of `source` to `object`.
  23483. *
  23484. * @private
  23485. * @param {Object} source The object to copy properties from.
  23486. * @param {Array} props The property identifiers to copy.
  23487. * @param {Object} [object={}] The object to copy properties to.
  23488. * @param {Function} [customizer] The function to customize copied values.
  23489. * @returns {Object} Returns `object`.
  23490. */
  23491. function copyObject(source, props, object, customizer) {
  23492. var isNew = !object;
  23493. object || (object = {});
  23494. var index = -1,
  23495. length = props.length;
  23496. while (++index < length) {
  23497. var key = props[index];
  23498. var newValue = customizer
  23499. ? customizer(object[key], source[key], key, object, source)
  23500. : undefined;
  23501. if (newValue === undefined) {
  23502. newValue = source[key];
  23503. }
  23504. if (isNew) {
  23505. baseAssignValue(object, key, newValue);
  23506. } else {
  23507. assignValue(object, key, newValue);
  23508. }
  23509. }
  23510. return object;
  23511. }
  23512. /**
  23513. * Copies own symbols of `source` to `object`.
  23514. *
  23515. * @private
  23516. * @param {Object} source The object to copy symbols from.
  23517. * @param {Object} [object={}] The object to copy symbols to.
  23518. * @returns {Object} Returns `object`.
  23519. */
  23520. function copySymbols(source, object) {
  23521. return copyObject(source, getSymbols(source), object);
  23522. }
  23523. /**
  23524. * Copies own and inherited symbols of `source` to `object`.
  23525. *
  23526. * @private
  23527. * @param {Object} source The object to copy symbols from.
  23528. * @param {Object} [object={}] The object to copy symbols to.
  23529. * @returns {Object} Returns `object`.
  23530. */
  23531. function copySymbolsIn(source, object) {
  23532. return copyObject(source, getSymbolsIn(source), object);
  23533. }
  23534. /**
  23535. * Creates a function like `_.groupBy`.
  23536. *
  23537. * @private
  23538. * @param {Function} setter The function to set accumulator values.
  23539. * @param {Function} [initializer] The accumulator object initializer.
  23540. * @returns {Function} Returns the new aggregator function.
  23541. */
  23542. function createAggregator(setter, initializer) {
  23543. return function(collection, iteratee) {
  23544. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  23545. accumulator = initializer ? initializer() : {};
  23546. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  23547. };
  23548. }
  23549. /**
  23550. * Creates a function like `_.assign`.
  23551. *
  23552. * @private
  23553. * @param {Function} assigner The function to assign values.
  23554. * @returns {Function} Returns the new assigner function.
  23555. */
  23556. function createAssigner(assigner) {
  23557. return baseRest(function(object, sources) {
  23558. var index = -1,
  23559. length = sources.length,
  23560. customizer = length > 1 ? sources[length - 1] : undefined,
  23561. guard = length > 2 ? sources[2] : undefined;
  23562. customizer = (assigner.length > 3 && typeof customizer == 'function')
  23563. ? (length--, customizer)
  23564. : undefined;
  23565. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  23566. customizer = length < 3 ? undefined : customizer;
  23567. length = 1;
  23568. }
  23569. object = Object(object);
  23570. while (++index < length) {
  23571. var source = sources[index];
  23572. if (source) {
  23573. assigner(object, source, index, customizer);
  23574. }
  23575. }
  23576. return object;
  23577. });
  23578. }
  23579. /**
  23580. * Creates a `baseEach` or `baseEachRight` function.
  23581. *
  23582. * @private
  23583. * @param {Function} eachFunc The function to iterate over a collection.
  23584. * @param {boolean} [fromRight] Specify iterating from right to left.
  23585. * @returns {Function} Returns the new base function.
  23586. */
  23587. function createBaseEach(eachFunc, fromRight) {
  23588. return function(collection, iteratee) {
  23589. if (collection == null) {
  23590. return collection;
  23591. }
  23592. if (!isArrayLike(collection)) {
  23593. return eachFunc(collection, iteratee);
  23594. }
  23595. var length = collection.length,
  23596. index = fromRight ? length : -1,
  23597. iterable = Object(collection);
  23598. while ((fromRight ? index-- : ++index < length)) {
  23599. if (iteratee(iterable[index], index, iterable) === false) {
  23600. break;
  23601. }
  23602. }
  23603. return collection;
  23604. };
  23605. }
  23606. /**
  23607. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  23608. *
  23609. * @private
  23610. * @param {boolean} [fromRight] Specify iterating from right to left.
  23611. * @returns {Function} Returns the new base function.
  23612. */
  23613. function createBaseFor(fromRight) {
  23614. return function(object, iteratee, keysFunc) {
  23615. var index = -1,
  23616. iterable = Object(object),
  23617. props = keysFunc(object),
  23618. length = props.length;
  23619. while (length--) {
  23620. var key = props[fromRight ? length : ++index];
  23621. if (iteratee(iterable[key], key, iterable) === false) {
  23622. break;
  23623. }
  23624. }
  23625. return object;
  23626. };
  23627. }
  23628. /**
  23629. * Creates a function that wraps `func` to invoke it with the optional `this`
  23630. * binding of `thisArg`.
  23631. *
  23632. * @private
  23633. * @param {Function} func The function to wrap.
  23634. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  23635. * @param {*} [thisArg] The `this` binding of `func`.
  23636. * @returns {Function} Returns the new wrapped function.
  23637. */
  23638. function createBind(func, bitmask, thisArg) {
  23639. var isBind = bitmask & WRAP_BIND_FLAG,
  23640. Ctor = createCtor(func);
  23641. function wrapper() {
  23642. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  23643. return fn.apply(isBind ? thisArg : this, arguments);
  23644. }
  23645. return wrapper;
  23646. }
  23647. /**
  23648. * Creates a function like `_.lowerFirst`.
  23649. *
  23650. * @private
  23651. * @param {string} methodName The name of the `String` case method to use.
  23652. * @returns {Function} Returns the new case function.
  23653. */
  23654. function createCaseFirst(methodName) {
  23655. return function(string) {
  23656. string = toString(string);
  23657. var strSymbols = hasUnicode(string)
  23658. ? stringToArray(string)
  23659. : undefined;
  23660. var chr = strSymbols
  23661. ? strSymbols[0]
  23662. : string.charAt(0);
  23663. var trailing = strSymbols
  23664. ? castSlice(strSymbols, 1).join('')
  23665. : string.slice(1);
  23666. return chr[methodName]() + trailing;
  23667. };
  23668. }
  23669. /**
  23670. * Creates a function like `_.camelCase`.
  23671. *
  23672. * @private
  23673. * @param {Function} callback The function to combine each word.
  23674. * @returns {Function} Returns the new compounder function.
  23675. */
  23676. function createCompounder(callback) {
  23677. return function(string) {
  23678. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  23679. };
  23680. }
  23681. /**
  23682. * Creates a function that produces an instance of `Ctor` regardless of
  23683. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  23684. *
  23685. * @private
  23686. * @param {Function} Ctor The constructor to wrap.
  23687. * @returns {Function} Returns the new wrapped function.
  23688. */
  23689. function createCtor(Ctor) {
  23690. return function() {
  23691. // Use a `switch` statement to work with class constructors. See
  23692. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  23693. // for more details.
  23694. var args = arguments;
  23695. switch (args.length) {
  23696. case 0: return new Ctor;
  23697. case 1: return new Ctor(args[0]);
  23698. case 2: return new Ctor(args[0], args[1]);
  23699. case 3: return new Ctor(args[0], args[1], args[2]);
  23700. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  23701. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  23702. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  23703. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  23704. }
  23705. var thisBinding = baseCreate(Ctor.prototype),
  23706. result = Ctor.apply(thisBinding, args);
  23707. // Mimic the constructor's `return` behavior.
  23708. // See https://es5.github.io/#x13.2.2 for more details.
  23709. return isObject(result) ? result : thisBinding;
  23710. };
  23711. }
  23712. /**
  23713. * Creates a function that wraps `func` to enable currying.
  23714. *
  23715. * @private
  23716. * @param {Function} func The function to wrap.
  23717. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  23718. * @param {number} arity The arity of `func`.
  23719. * @returns {Function} Returns the new wrapped function.
  23720. */
  23721. function createCurry(func, bitmask, arity) {
  23722. var Ctor = createCtor(func);
  23723. function wrapper() {
  23724. var length = arguments.length,
  23725. args = Array(length),
  23726. index = length,
  23727. placeholder = getHolder(wrapper);
  23728. while (index--) {
  23729. args[index] = arguments[index];
  23730. }
  23731. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  23732. ? []
  23733. : replaceHolders(args, placeholder);
  23734. length -= holders.length;
  23735. if (length < arity) {
  23736. return createRecurry(
  23737. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  23738. args, holders, undefined, undefined, arity - length);
  23739. }
  23740. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  23741. return apply(fn, this, args);
  23742. }
  23743. return wrapper;
  23744. }
  23745. /**
  23746. * Creates a `_.find` or `_.findLast` function.
  23747. *
  23748. * @private
  23749. * @param {Function} findIndexFunc The function to find the collection index.
  23750. * @returns {Function} Returns the new find function.
  23751. */
  23752. function createFind(findIndexFunc) {
  23753. return function(collection, predicate, fromIndex) {
  23754. var iterable = Object(collection);
  23755. if (!isArrayLike(collection)) {
  23756. var iteratee = getIteratee(predicate, 3);
  23757. collection = keys(collection);
  23758. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  23759. }
  23760. var index = findIndexFunc(collection, predicate, fromIndex);
  23761. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  23762. };
  23763. }
  23764. /**
  23765. * Creates a `_.flow` or `_.flowRight` function.
  23766. *
  23767. * @private
  23768. * @param {boolean} [fromRight] Specify iterating from right to left.
  23769. * @returns {Function} Returns the new flow function.
  23770. */
  23771. function createFlow(fromRight) {
  23772. return flatRest(function(funcs) {
  23773. var length = funcs.length,
  23774. index = length,
  23775. prereq = LodashWrapper.prototype.thru;
  23776. if (fromRight) {
  23777. funcs.reverse();
  23778. }
  23779. while (index--) {
  23780. var func = funcs[index];
  23781. if (typeof func != 'function') {
  23782. throw new TypeError(FUNC_ERROR_TEXT);
  23783. }
  23784. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  23785. var wrapper = new LodashWrapper([], true);
  23786. }
  23787. }
  23788. index = wrapper ? index : length;
  23789. while (++index < length) {
  23790. func = funcs[index];
  23791. var funcName = getFuncName(func),
  23792. data = funcName == 'wrapper' ? getData(func) : undefined;
  23793. if (data && isLaziable(data[0]) &&
  23794. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  23795. !data[4].length && data[9] == 1
  23796. ) {
  23797. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  23798. } else {
  23799. wrapper = (func.length == 1 && isLaziable(func))
  23800. ? wrapper[funcName]()
  23801. : wrapper.thru(func);
  23802. }
  23803. }
  23804. return function() {
  23805. var args = arguments,
  23806. value = args[0];
  23807. if (wrapper && args.length == 1 && isArray(value)) {
  23808. return wrapper.plant(value).value();
  23809. }
  23810. var index = 0,
  23811. result = length ? funcs[index].apply(this, args) : value;
  23812. while (++index < length) {
  23813. result = funcs[index].call(this, result);
  23814. }
  23815. return result;
  23816. };
  23817. });
  23818. }
  23819. /**
  23820. * Creates a function that wraps `func` to invoke it with optional `this`
  23821. * binding of `thisArg`, partial application, and currying.
  23822. *
  23823. * @private
  23824. * @param {Function|string} func The function or method name to wrap.
  23825. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  23826. * @param {*} [thisArg] The `this` binding of `func`.
  23827. * @param {Array} [partials] The arguments to prepend to those provided to
  23828. * the new function.
  23829. * @param {Array} [holders] The `partials` placeholder indexes.
  23830. * @param {Array} [partialsRight] The arguments to append to those provided
  23831. * to the new function.
  23832. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  23833. * @param {Array} [argPos] The argument positions of the new function.
  23834. * @param {number} [ary] The arity cap of `func`.
  23835. * @param {number} [arity] The arity of `func`.
  23836. * @returns {Function} Returns the new wrapped function.
  23837. */
  23838. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  23839. var isAry = bitmask & WRAP_ARY_FLAG,
  23840. isBind = bitmask & WRAP_BIND_FLAG,
  23841. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  23842. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  23843. isFlip = bitmask & WRAP_FLIP_FLAG,
  23844. Ctor = isBindKey ? undefined : createCtor(func);
  23845. function wrapper() {
  23846. var length = arguments.length,
  23847. args = Array(length),
  23848. index = length;
  23849. while (index--) {
  23850. args[index] = arguments[index];
  23851. }
  23852. if (isCurried) {
  23853. var placeholder = getHolder(wrapper),
  23854. holdersCount = countHolders(args, placeholder);
  23855. }
  23856. if (partials) {
  23857. args = composeArgs(args, partials, holders, isCurried);
  23858. }
  23859. if (partialsRight) {
  23860. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  23861. }
  23862. length -= holdersCount;
  23863. if (isCurried && length < arity) {
  23864. var newHolders = replaceHolders(args, placeholder);
  23865. return createRecurry(
  23866. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  23867. args, newHolders, argPos, ary, arity - length
  23868. );
  23869. }
  23870. var thisBinding = isBind ? thisArg : this,
  23871. fn = isBindKey ? thisBinding[func] : func;
  23872. length = args.length;
  23873. if (argPos) {
  23874. args = reorder(args, argPos);
  23875. } else if (isFlip && length > 1) {
  23876. args.reverse();
  23877. }
  23878. if (isAry && ary < length) {
  23879. args.length = ary;
  23880. }
  23881. if (this && this !== root && this instanceof wrapper) {
  23882. fn = Ctor || createCtor(fn);
  23883. }
  23884. return fn.apply(thisBinding, args);
  23885. }
  23886. return wrapper;
  23887. }
  23888. /**
  23889. * Creates a function like `_.invertBy`.
  23890. *
  23891. * @private
  23892. * @param {Function} setter The function to set accumulator values.
  23893. * @param {Function} toIteratee The function to resolve iteratees.
  23894. * @returns {Function} Returns the new inverter function.
  23895. */
  23896. function createInverter(setter, toIteratee) {
  23897. return function(object, iteratee) {
  23898. return baseInverter(object, setter, toIteratee(iteratee), {});
  23899. };
  23900. }
  23901. /**
  23902. * Creates a function that performs a mathematical operation on two values.
  23903. *
  23904. * @private
  23905. * @param {Function} operator The function to perform the operation.
  23906. * @param {number} [defaultValue] The value used for `undefined` arguments.
  23907. * @returns {Function} Returns the new mathematical operation function.
  23908. */
  23909. function createMathOperation(operator, defaultValue) {
  23910. return function(value, other) {
  23911. var result;
  23912. if (value === undefined && other === undefined) {
  23913. return defaultValue;
  23914. }
  23915. if (value !== undefined) {
  23916. result = value;
  23917. }
  23918. if (other !== undefined) {
  23919. if (result === undefined) {
  23920. return other;
  23921. }
  23922. if (typeof value == 'string' || typeof other == 'string') {
  23923. value = baseToString(value);
  23924. other = baseToString(other);
  23925. } else {
  23926. value = baseToNumber(value);
  23927. other = baseToNumber(other);
  23928. }
  23929. result = operator(value, other);
  23930. }
  23931. return result;
  23932. };
  23933. }
  23934. /**
  23935. * Creates a function like `_.over`.
  23936. *
  23937. * @private
  23938. * @param {Function} arrayFunc The function to iterate over iteratees.
  23939. * @returns {Function} Returns the new over function.
  23940. */
  23941. function createOver(arrayFunc) {
  23942. return flatRest(function(iteratees) {
  23943. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  23944. return baseRest(function(args) {
  23945. var thisArg = this;
  23946. return arrayFunc(iteratees, function(iteratee) {
  23947. return apply(iteratee, thisArg, args);
  23948. });
  23949. });
  23950. });
  23951. }
  23952. /**
  23953. * Creates the padding for `string` based on `length`. The `chars` string
  23954. * is truncated if the number of characters exceeds `length`.
  23955. *
  23956. * @private
  23957. * @param {number} length The padding length.
  23958. * @param {string} [chars=' '] The string used as padding.
  23959. * @returns {string} Returns the padding for `string`.
  23960. */
  23961. function createPadding(length, chars) {
  23962. chars = chars === undefined ? ' ' : baseToString(chars);
  23963. var charsLength = chars.length;
  23964. if (charsLength < 2) {
  23965. return charsLength ? baseRepeat(chars, length) : chars;
  23966. }
  23967. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  23968. return hasUnicode(chars)
  23969. ? castSlice(stringToArray(result), 0, length).join('')
  23970. : result.slice(0, length);
  23971. }
  23972. /**
  23973. * Creates a function that wraps `func` to invoke it with the `this` binding
  23974. * of `thisArg` and `partials` prepended to the arguments it receives.
  23975. *
  23976. * @private
  23977. * @param {Function} func The function to wrap.
  23978. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  23979. * @param {*} thisArg The `this` binding of `func`.
  23980. * @param {Array} partials The arguments to prepend to those provided to
  23981. * the new function.
  23982. * @returns {Function} Returns the new wrapped function.
  23983. */
  23984. function createPartial(func, bitmask, thisArg, partials) {
  23985. var isBind = bitmask & WRAP_BIND_FLAG,
  23986. Ctor = createCtor(func);
  23987. function wrapper() {
  23988. var argsIndex = -1,
  23989. argsLength = arguments.length,
  23990. leftIndex = -1,
  23991. leftLength = partials.length,
  23992. args = Array(leftLength + argsLength),
  23993. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  23994. while (++leftIndex < leftLength) {
  23995. args[leftIndex] = partials[leftIndex];
  23996. }
  23997. while (argsLength--) {
  23998. args[leftIndex++] = arguments[++argsIndex];
  23999. }
  24000. return apply(fn, isBind ? thisArg : this, args);
  24001. }
  24002. return wrapper;
  24003. }
  24004. /**
  24005. * Creates a `_.range` or `_.rangeRight` function.
  24006. *
  24007. * @private
  24008. * @param {boolean} [fromRight] Specify iterating from right to left.
  24009. * @returns {Function} Returns the new range function.
  24010. */
  24011. function createRange(fromRight) {
  24012. return function(start, end, step) {
  24013. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  24014. end = step = undefined;
  24015. }
  24016. // Ensure the sign of `-0` is preserved.
  24017. start = toFinite(start);
  24018. if (end === undefined) {
  24019. end = start;
  24020. start = 0;
  24021. } else {
  24022. end = toFinite(end);
  24023. }
  24024. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  24025. return baseRange(start, end, step, fromRight);
  24026. };
  24027. }
  24028. /**
  24029. * Creates a function that performs a relational operation on two values.
  24030. *
  24031. * @private
  24032. * @param {Function} operator The function to perform the operation.
  24033. * @returns {Function} Returns the new relational operation function.
  24034. */
  24035. function createRelationalOperation(operator) {
  24036. return function(value, other) {
  24037. if (!(typeof value == 'string' && typeof other == 'string')) {
  24038. value = toNumber(value);
  24039. other = toNumber(other);
  24040. }
  24041. return operator(value, other);
  24042. };
  24043. }
  24044. /**
  24045. * Creates a function that wraps `func` to continue currying.
  24046. *
  24047. * @private
  24048. * @param {Function} func The function to wrap.
  24049. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  24050. * @param {Function} wrapFunc The function to create the `func` wrapper.
  24051. * @param {*} placeholder The placeholder value.
  24052. * @param {*} [thisArg] The `this` binding of `func`.
  24053. * @param {Array} [partials] The arguments to prepend to those provided to
  24054. * the new function.
  24055. * @param {Array} [holders] The `partials` placeholder indexes.
  24056. * @param {Array} [argPos] The argument positions of the new function.
  24057. * @param {number} [ary] The arity cap of `func`.
  24058. * @param {number} [arity] The arity of `func`.
  24059. * @returns {Function} Returns the new wrapped function.
  24060. */
  24061. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  24062. var isCurry = bitmask & WRAP_CURRY_FLAG,
  24063. newHolders = isCurry ? holders : undefined,
  24064. newHoldersRight = isCurry ? undefined : holders,
  24065. newPartials = isCurry ? partials : undefined,
  24066. newPartialsRight = isCurry ? undefined : partials;
  24067. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  24068. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  24069. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  24070. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  24071. }
  24072. var newData = [
  24073. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  24074. newHoldersRight, argPos, ary, arity
  24075. ];
  24076. var result = wrapFunc.apply(undefined, newData);
  24077. if (isLaziable(func)) {
  24078. setData(result, newData);
  24079. }
  24080. result.placeholder = placeholder;
  24081. return setWrapToString(result, func, bitmask);
  24082. }
  24083. /**
  24084. * Creates a function like `_.round`.
  24085. *
  24086. * @private
  24087. * @param {string} methodName The name of the `Math` method to use when rounding.
  24088. * @returns {Function} Returns the new round function.
  24089. */
  24090. function createRound(methodName) {
  24091. var func = Math[methodName];
  24092. return function(number, precision) {
  24093. number = toNumber(number);
  24094. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  24095. if (precision && nativeIsFinite(number)) {
  24096. // Shift with exponential notation to avoid floating-point issues.
  24097. // See [MDN](https://mdn.io/round#Examples) for more details.
  24098. var pair = (toString(number) + 'e').split('e'),
  24099. value = func(pair[0] + 'e' + (+pair[1] + precision));
  24100. pair = (toString(value) + 'e').split('e');
  24101. return +(pair[0] + 'e' + (+pair[1] - precision));
  24102. }
  24103. return func(number);
  24104. };
  24105. }
  24106. /**
  24107. * Creates a set object of `values`.
  24108. *
  24109. * @private
  24110. * @param {Array} values The values to add to the set.
  24111. * @returns {Object} Returns the new set.
  24112. */
  24113. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  24114. return new Set(values);
  24115. };
  24116. /**
  24117. * Creates a `_.toPairs` or `_.toPairsIn` function.
  24118. *
  24119. * @private
  24120. * @param {Function} keysFunc The function to get the keys of a given object.
  24121. * @returns {Function} Returns the new pairs function.
  24122. */
  24123. function createToPairs(keysFunc) {
  24124. return function(object) {
  24125. var tag = getTag(object);
  24126. if (tag == mapTag) {
  24127. return mapToArray(object);
  24128. }
  24129. if (tag == setTag) {
  24130. return setToPairs(object);
  24131. }
  24132. return baseToPairs(object, keysFunc(object));
  24133. };
  24134. }
  24135. /**
  24136. * Creates a function that either curries or invokes `func` with optional
  24137. * `this` binding and partially applied arguments.
  24138. *
  24139. * @private
  24140. * @param {Function|string} func The function or method name to wrap.
  24141. * @param {number} bitmask The bitmask flags.
  24142. * 1 - `_.bind`
  24143. * 2 - `_.bindKey`
  24144. * 4 - `_.curry` or `_.curryRight` of a bound function
  24145. * 8 - `_.curry`
  24146. * 16 - `_.curryRight`
  24147. * 32 - `_.partial`
  24148. * 64 - `_.partialRight`
  24149. * 128 - `_.rearg`
  24150. * 256 - `_.ary`
  24151. * 512 - `_.flip`
  24152. * @param {*} [thisArg] The `this` binding of `func`.
  24153. * @param {Array} [partials] The arguments to be partially applied.
  24154. * @param {Array} [holders] The `partials` placeholder indexes.
  24155. * @param {Array} [argPos] The argument positions of the new function.
  24156. * @param {number} [ary] The arity cap of `func`.
  24157. * @param {number} [arity] The arity of `func`.
  24158. * @returns {Function} Returns the new wrapped function.
  24159. */
  24160. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  24161. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  24162. if (!isBindKey && typeof func != 'function') {
  24163. throw new TypeError(FUNC_ERROR_TEXT);
  24164. }
  24165. var length = partials ? partials.length : 0;
  24166. if (!length) {
  24167. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  24168. partials = holders = undefined;
  24169. }
  24170. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  24171. arity = arity === undefined ? arity : toInteger(arity);
  24172. length -= holders ? holders.length : 0;
  24173. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  24174. var partialsRight = partials,
  24175. holdersRight = holders;
  24176. partials = holders = undefined;
  24177. }
  24178. var data = isBindKey ? undefined : getData(func);
  24179. var newData = [
  24180. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  24181. argPos, ary, arity
  24182. ];
  24183. if (data) {
  24184. mergeData(newData, data);
  24185. }
  24186. func = newData[0];
  24187. bitmask = newData[1];
  24188. thisArg = newData[2];
  24189. partials = newData[3];
  24190. holders = newData[4];
  24191. arity = newData[9] = newData[9] === undefined
  24192. ? (isBindKey ? 0 : func.length)
  24193. : nativeMax(newData[9] - length, 0);
  24194. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  24195. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  24196. }
  24197. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  24198. var result = createBind(func, bitmask, thisArg);
  24199. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  24200. result = createCurry(func, bitmask, arity);
  24201. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  24202. result = createPartial(func, bitmask, thisArg, partials);
  24203. } else {
  24204. result = createHybrid.apply(undefined, newData);
  24205. }
  24206. var setter = data ? baseSetData : setData;
  24207. return setWrapToString(setter(result, newData), func, bitmask);
  24208. }
  24209. /**
  24210. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  24211. * of source objects to the destination object for all destination properties
  24212. * that resolve to `undefined`.
  24213. *
  24214. * @private
  24215. * @param {*} objValue The destination value.
  24216. * @param {*} srcValue The source value.
  24217. * @param {string} key The key of the property to assign.
  24218. * @param {Object} object The parent object of `objValue`.
  24219. * @returns {*} Returns the value to assign.
  24220. */
  24221. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  24222. if (objValue === undefined ||
  24223. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  24224. return srcValue;
  24225. }
  24226. return objValue;
  24227. }
  24228. /**
  24229. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  24230. * objects into destination objects that are passed thru.
  24231. *
  24232. * @private
  24233. * @param {*} objValue The destination value.
  24234. * @param {*} srcValue The source value.
  24235. * @param {string} key The key of the property to merge.
  24236. * @param {Object} object The parent object of `objValue`.
  24237. * @param {Object} source The parent object of `srcValue`.
  24238. * @param {Object} [stack] Tracks traversed source values and their merged
  24239. * counterparts.
  24240. * @returns {*} Returns the value to assign.
  24241. */
  24242. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  24243. if (isObject(objValue) && isObject(srcValue)) {
  24244. // Recursively merge objects and arrays (susceptible to call stack limits).
  24245. stack.set(srcValue, objValue);
  24246. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  24247. stack['delete'](srcValue);
  24248. }
  24249. return objValue;
  24250. }
  24251. /**
  24252. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  24253. * objects.
  24254. *
  24255. * @private
  24256. * @param {*} value The value to inspect.
  24257. * @param {string} key The key of the property to inspect.
  24258. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  24259. */
  24260. function customOmitClone(value) {
  24261. return isPlainObject(value) ? undefined : value;
  24262. }
  24263. /**
  24264. * A specialized version of `baseIsEqualDeep` for arrays with support for
  24265. * partial deep comparisons.
  24266. *
  24267. * @private
  24268. * @param {Array} array The array to compare.
  24269. * @param {Array} other The other array to compare.
  24270. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  24271. * @param {Function} customizer The function to customize comparisons.
  24272. * @param {Function} equalFunc The function to determine equivalents of values.
  24273. * @param {Object} stack Tracks traversed `array` and `other` objects.
  24274. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  24275. */
  24276. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  24277. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  24278. arrLength = array.length,
  24279. othLength = other.length;
  24280. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  24281. return false;
  24282. }
  24283. // Assume cyclic values are equal.
  24284. var stacked = stack.get(array);
  24285. if (stacked && stack.get(other)) {
  24286. return stacked == other;
  24287. }
  24288. var index = -1,
  24289. result = true,
  24290. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  24291. stack.set(array, other);
  24292. stack.set(other, array);
  24293. // Ignore non-index properties.
  24294. while (++index < arrLength) {
  24295. var arrValue = array[index],
  24296. othValue = other[index];
  24297. if (customizer) {
  24298. var compared = isPartial
  24299. ? customizer(othValue, arrValue, index, other, array, stack)
  24300. : customizer(arrValue, othValue, index, array, other, stack);
  24301. }
  24302. if (compared !== undefined) {
  24303. if (compared) {
  24304. continue;
  24305. }
  24306. result = false;
  24307. break;
  24308. }
  24309. // Recursively compare arrays (susceptible to call stack limits).
  24310. if (seen) {
  24311. if (!arraySome(other, function(othValue, othIndex) {
  24312. if (!cacheHas(seen, othIndex) &&
  24313. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  24314. return seen.push(othIndex);
  24315. }
  24316. })) {
  24317. result = false;
  24318. break;
  24319. }
  24320. } else if (!(
  24321. arrValue === othValue ||
  24322. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  24323. )) {
  24324. result = false;
  24325. break;
  24326. }
  24327. }
  24328. stack['delete'](array);
  24329. stack['delete'](other);
  24330. return result;
  24331. }
  24332. /**
  24333. * A specialized version of `baseIsEqualDeep` for comparing objects of
  24334. * the same `toStringTag`.
  24335. *
  24336. * **Note:** This function only supports comparing values with tags of
  24337. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  24338. *
  24339. * @private
  24340. * @param {Object} object The object to compare.
  24341. * @param {Object} other The other object to compare.
  24342. * @param {string} tag The `toStringTag` of the objects to compare.
  24343. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  24344. * @param {Function} customizer The function to customize comparisons.
  24345. * @param {Function} equalFunc The function to determine equivalents of values.
  24346. * @param {Object} stack Tracks traversed `object` and `other` objects.
  24347. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  24348. */
  24349. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  24350. switch (tag) {
  24351. case dataViewTag:
  24352. if ((object.byteLength != other.byteLength) ||
  24353. (object.byteOffset != other.byteOffset)) {
  24354. return false;
  24355. }
  24356. object = object.buffer;
  24357. other = other.buffer;
  24358. case arrayBufferTag:
  24359. if ((object.byteLength != other.byteLength) ||
  24360. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  24361. return false;
  24362. }
  24363. return true;
  24364. case boolTag:
  24365. case dateTag:
  24366. case numberTag:
  24367. // Coerce booleans to `1` or `0` and dates to milliseconds.
  24368. // Invalid dates are coerced to `NaN`.
  24369. return eq(+object, +other);
  24370. case errorTag:
  24371. return object.name == other.name && object.message == other.message;
  24372. case regexpTag:
  24373. case stringTag:
  24374. // Coerce regexes to strings and treat strings, primitives and objects,
  24375. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  24376. // for more details.
  24377. return object == (other + '');
  24378. case mapTag:
  24379. var convert = mapToArray;
  24380. case setTag:
  24381. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  24382. convert || (convert = setToArray);
  24383. if (object.size != other.size && !isPartial) {
  24384. return false;
  24385. }
  24386. // Assume cyclic values are equal.
  24387. var stacked = stack.get(object);
  24388. if (stacked) {
  24389. return stacked == other;
  24390. }
  24391. bitmask |= COMPARE_UNORDERED_FLAG;
  24392. // Recursively compare objects (susceptible to call stack limits).
  24393. stack.set(object, other);
  24394. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  24395. stack['delete'](object);
  24396. return result;
  24397. case symbolTag:
  24398. if (symbolValueOf) {
  24399. return symbolValueOf.call(object) == symbolValueOf.call(other);
  24400. }
  24401. }
  24402. return false;
  24403. }
  24404. /**
  24405. * A specialized version of `baseIsEqualDeep` for objects with support for
  24406. * partial deep comparisons.
  24407. *
  24408. * @private
  24409. * @param {Object} object The object to compare.
  24410. * @param {Object} other The other object to compare.
  24411. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  24412. * @param {Function} customizer The function to customize comparisons.
  24413. * @param {Function} equalFunc The function to determine equivalents of values.
  24414. * @param {Object} stack Tracks traversed `object` and `other` objects.
  24415. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  24416. */
  24417. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  24418. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  24419. objProps = getAllKeys(object),
  24420. objLength = objProps.length,
  24421. othProps = getAllKeys(other),
  24422. othLength = othProps.length;
  24423. if (objLength != othLength && !isPartial) {
  24424. return false;
  24425. }
  24426. var index = objLength;
  24427. while (index--) {
  24428. var key = objProps[index];
  24429. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  24430. return false;
  24431. }
  24432. }
  24433. // Assume cyclic values are equal.
  24434. var stacked = stack.get(object);
  24435. if (stacked && stack.get(other)) {
  24436. return stacked == other;
  24437. }
  24438. var result = true;
  24439. stack.set(object, other);
  24440. stack.set(other, object);
  24441. var skipCtor = isPartial;
  24442. while (++index < objLength) {
  24443. key = objProps[index];
  24444. var objValue = object[key],
  24445. othValue = other[key];
  24446. if (customizer) {
  24447. var compared = isPartial
  24448. ? customizer(othValue, objValue, key, other, object, stack)
  24449. : customizer(objValue, othValue, key, object, other, stack);
  24450. }
  24451. // Recursively compare objects (susceptible to call stack limits).
  24452. if (!(compared === undefined
  24453. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  24454. : compared
  24455. )) {
  24456. result = false;
  24457. break;
  24458. }
  24459. skipCtor || (skipCtor = key == 'constructor');
  24460. }
  24461. if (result && !skipCtor) {
  24462. var objCtor = object.constructor,
  24463. othCtor = other.constructor;
  24464. // Non `Object` object instances with different constructors are not equal.
  24465. if (objCtor != othCtor &&
  24466. ('constructor' in object && 'constructor' in other) &&
  24467. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  24468. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  24469. result = false;
  24470. }
  24471. }
  24472. stack['delete'](object);
  24473. stack['delete'](other);
  24474. return result;
  24475. }
  24476. /**
  24477. * A specialized version of `baseRest` which flattens the rest array.
  24478. *
  24479. * @private
  24480. * @param {Function} func The function to apply a rest parameter to.
  24481. * @returns {Function} Returns the new function.
  24482. */
  24483. function flatRest(func) {
  24484. return setToString(overRest(func, undefined, flatten), func + '');
  24485. }
  24486. /**
  24487. * Creates an array of own enumerable property names and symbols of `object`.
  24488. *
  24489. * @private
  24490. * @param {Object} object The object to query.
  24491. * @returns {Array} Returns the array of property names and symbols.
  24492. */
  24493. function getAllKeys(object) {
  24494. return baseGetAllKeys(object, keys, getSymbols);
  24495. }
  24496. /**
  24497. * Creates an array of own and inherited enumerable property names and
  24498. * symbols of `object`.
  24499. *
  24500. * @private
  24501. * @param {Object} object The object to query.
  24502. * @returns {Array} Returns the array of property names and symbols.
  24503. */
  24504. function getAllKeysIn(object) {
  24505. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  24506. }
  24507. /**
  24508. * Gets metadata for `func`.
  24509. *
  24510. * @private
  24511. * @param {Function} func The function to query.
  24512. * @returns {*} Returns the metadata for `func`.
  24513. */
  24514. var getData = !metaMap ? noop : function(func) {
  24515. return metaMap.get(func);
  24516. };
  24517. /**
  24518. * Gets the name of `func`.
  24519. *
  24520. * @private
  24521. * @param {Function} func The function to query.
  24522. * @returns {string} Returns the function name.
  24523. */
  24524. function getFuncName(func) {
  24525. var result = (func.name + ''),
  24526. array = realNames[result],
  24527. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  24528. while (length--) {
  24529. var data = array[length],
  24530. otherFunc = data.func;
  24531. if (otherFunc == null || otherFunc == func) {
  24532. return data.name;
  24533. }
  24534. }
  24535. return result;
  24536. }
  24537. /**
  24538. * Gets the argument placeholder value for `func`.
  24539. *
  24540. * @private
  24541. * @param {Function} func The function to inspect.
  24542. * @returns {*} Returns the placeholder value.
  24543. */
  24544. function getHolder(func) {
  24545. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  24546. return object.placeholder;
  24547. }
  24548. /**
  24549. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  24550. * this function returns the custom method, otherwise it returns `baseIteratee`.
  24551. * If arguments are provided, the chosen function is invoked with them and
  24552. * its result is returned.
  24553. *
  24554. * @private
  24555. * @param {*} [value] The value to convert to an iteratee.
  24556. * @param {number} [arity] The arity of the created iteratee.
  24557. * @returns {Function} Returns the chosen function or its result.
  24558. */
  24559. function getIteratee() {
  24560. var result = lodash.iteratee || iteratee;
  24561. result = result === iteratee ? baseIteratee : result;
  24562. return arguments.length ? result(arguments[0], arguments[1]) : result;
  24563. }
  24564. /**
  24565. * Gets the data for `map`.
  24566. *
  24567. * @private
  24568. * @param {Object} map The map to query.
  24569. * @param {string} key The reference key.
  24570. * @returns {*} Returns the map data.
  24571. */
  24572. function getMapData(map, key) {
  24573. var data = map.__data__;
  24574. return isKeyable(key)
  24575. ? data[typeof key == 'string' ? 'string' : 'hash']
  24576. : data.map;
  24577. }
  24578. /**
  24579. * Gets the property names, values, and compare flags of `object`.
  24580. *
  24581. * @private
  24582. * @param {Object} object The object to query.
  24583. * @returns {Array} Returns the match data of `object`.
  24584. */
  24585. function getMatchData(object) {
  24586. var result = keys(object),
  24587. length = result.length;
  24588. while (length--) {
  24589. var key = result[length],
  24590. value = object[key];
  24591. result[length] = [key, value, isStrictComparable(value)];
  24592. }
  24593. return result;
  24594. }
  24595. /**
  24596. * Gets the native function at `key` of `object`.
  24597. *
  24598. * @private
  24599. * @param {Object} object The object to query.
  24600. * @param {string} key The key of the method to get.
  24601. * @returns {*} Returns the function if it's native, else `undefined`.
  24602. */
  24603. function getNative(object, key) {
  24604. var value = getValue(object, key);
  24605. return baseIsNative(value) ? value : undefined;
  24606. }
  24607. /**
  24608. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  24609. *
  24610. * @private
  24611. * @param {*} value The value to query.
  24612. * @returns {string} Returns the raw `toStringTag`.
  24613. */
  24614. function getRawTag(value) {
  24615. var isOwn = hasOwnProperty.call(value, symToStringTag),
  24616. tag = value[symToStringTag];
  24617. try {
  24618. value[symToStringTag] = undefined;
  24619. var unmasked = true;
  24620. } catch (e) {}
  24621. var result = nativeObjectToString.call(value);
  24622. if (unmasked) {
  24623. if (isOwn) {
  24624. value[symToStringTag] = tag;
  24625. } else {
  24626. delete value[symToStringTag];
  24627. }
  24628. }
  24629. return result;
  24630. }
  24631. /**
  24632. * Creates an array of the own enumerable symbols of `object`.
  24633. *
  24634. * @private
  24635. * @param {Object} object The object to query.
  24636. * @returns {Array} Returns the array of symbols.
  24637. */
  24638. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  24639. if (object == null) {
  24640. return [];
  24641. }
  24642. object = Object(object);
  24643. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  24644. return propertyIsEnumerable.call(object, symbol);
  24645. });
  24646. };
  24647. /**
  24648. * Creates an array of the own and inherited enumerable symbols of `object`.
  24649. *
  24650. * @private
  24651. * @param {Object} object The object to query.
  24652. * @returns {Array} Returns the array of symbols.
  24653. */
  24654. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  24655. var result = [];
  24656. while (object) {
  24657. arrayPush(result, getSymbols(object));
  24658. object = getPrototype(object);
  24659. }
  24660. return result;
  24661. };
  24662. /**
  24663. * Gets the `toStringTag` of `value`.
  24664. *
  24665. * @private
  24666. * @param {*} value The value to query.
  24667. * @returns {string} Returns the `toStringTag`.
  24668. */
  24669. var getTag = baseGetTag;
  24670. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  24671. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  24672. (Map && getTag(new Map) != mapTag) ||
  24673. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  24674. (Set && getTag(new Set) != setTag) ||
  24675. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  24676. getTag = function(value) {
  24677. var result = baseGetTag(value),
  24678. Ctor = result == objectTag ? value.constructor : undefined,
  24679. ctorString = Ctor ? toSource(Ctor) : '';
  24680. if (ctorString) {
  24681. switch (ctorString) {
  24682. case dataViewCtorString: return dataViewTag;
  24683. case mapCtorString: return mapTag;
  24684. case promiseCtorString: return promiseTag;
  24685. case setCtorString: return setTag;
  24686. case weakMapCtorString: return weakMapTag;
  24687. }
  24688. }
  24689. return result;
  24690. };
  24691. }
  24692. /**
  24693. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  24694. *
  24695. * @private
  24696. * @param {number} start The start of the view.
  24697. * @param {number} end The end of the view.
  24698. * @param {Array} transforms The transformations to apply to the view.
  24699. * @returns {Object} Returns an object containing the `start` and `end`
  24700. * positions of the view.
  24701. */
  24702. function getView(start, end, transforms) {
  24703. var index = -1,
  24704. length = transforms.length;
  24705. while (++index < length) {
  24706. var data = transforms[index],
  24707. size = data.size;
  24708. switch (data.type) {
  24709. case 'drop': start += size; break;
  24710. case 'dropRight': end -= size; break;
  24711. case 'take': end = nativeMin(end, start + size); break;
  24712. case 'takeRight': start = nativeMax(start, end - size); break;
  24713. }
  24714. }
  24715. return { 'start': start, 'end': end };
  24716. }
  24717. /**
  24718. * Extracts wrapper details from the `source` body comment.
  24719. *
  24720. * @private
  24721. * @param {string} source The source to inspect.
  24722. * @returns {Array} Returns the wrapper details.
  24723. */
  24724. function getWrapDetails(source) {
  24725. var match = source.match(reWrapDetails);
  24726. return match ? match[1].split(reSplitDetails) : [];
  24727. }
  24728. /**
  24729. * Checks if `path` exists on `object`.
  24730. *
  24731. * @private
  24732. * @param {Object} object The object to query.
  24733. * @param {Array|string} path The path to check.
  24734. * @param {Function} hasFunc The function to check properties.
  24735. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  24736. */
  24737. function hasPath(object, path, hasFunc) {
  24738. path = castPath(path, object);
  24739. var index = -1,
  24740. length = path.length,
  24741. result = false;
  24742. while (++index < length) {
  24743. var key = toKey(path[index]);
  24744. if (!(result = object != null && hasFunc(object, key))) {
  24745. break;
  24746. }
  24747. object = object[key];
  24748. }
  24749. if (result || ++index != length) {
  24750. return result;
  24751. }
  24752. length = object == null ? 0 : object.length;
  24753. return !!length && isLength(length) && isIndex(key, length) &&
  24754. (isArray(object) || isArguments(object));
  24755. }
  24756. /**
  24757. * Initializes an array clone.
  24758. *
  24759. * @private
  24760. * @param {Array} array The array to clone.
  24761. * @returns {Array} Returns the initialized clone.
  24762. */
  24763. function initCloneArray(array) {
  24764. var length = array.length,
  24765. result = new array.constructor(length);
  24766. // Add properties assigned by `RegExp#exec`.
  24767. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  24768. result.index = array.index;
  24769. result.input = array.input;
  24770. }
  24771. return result;
  24772. }
  24773. /**
  24774. * Initializes an object clone.
  24775. *
  24776. * @private
  24777. * @param {Object} object The object to clone.
  24778. * @returns {Object} Returns the initialized clone.
  24779. */
  24780. function initCloneObject(object) {
  24781. return (typeof object.constructor == 'function' && !isPrototype(object))
  24782. ? baseCreate(getPrototype(object))
  24783. : {};
  24784. }
  24785. /**
  24786. * Initializes an object clone based on its `toStringTag`.
  24787. *
  24788. * **Note:** This function only supports cloning values with tags of
  24789. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  24790. *
  24791. * @private
  24792. * @param {Object} object The object to clone.
  24793. * @param {string} tag The `toStringTag` of the object to clone.
  24794. * @param {boolean} [isDeep] Specify a deep clone.
  24795. * @returns {Object} Returns the initialized clone.
  24796. */
  24797. function initCloneByTag(object, tag, isDeep) {
  24798. var Ctor = object.constructor;
  24799. switch (tag) {
  24800. case arrayBufferTag:
  24801. return cloneArrayBuffer(object);
  24802. case boolTag:
  24803. case dateTag:
  24804. return new Ctor(+object);
  24805. case dataViewTag:
  24806. return cloneDataView(object, isDeep);
  24807. case float32Tag: case float64Tag:
  24808. case int8Tag: case int16Tag: case int32Tag:
  24809. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  24810. return cloneTypedArray(object, isDeep);
  24811. case mapTag:
  24812. return new Ctor;
  24813. case numberTag:
  24814. case stringTag:
  24815. return new Ctor(object);
  24816. case regexpTag:
  24817. return cloneRegExp(object);
  24818. case setTag:
  24819. return new Ctor;
  24820. case symbolTag:
  24821. return cloneSymbol(object);
  24822. }
  24823. }
  24824. /**
  24825. * Inserts wrapper `details` in a comment at the top of the `source` body.
  24826. *
  24827. * @private
  24828. * @param {string} source The source to modify.
  24829. * @returns {Array} details The details to insert.
  24830. * @returns {string} Returns the modified source.
  24831. */
  24832. function insertWrapDetails(source, details) {
  24833. var length = details.length;
  24834. if (!length) {
  24835. return source;
  24836. }
  24837. var lastIndex = length - 1;
  24838. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  24839. details = details.join(length > 2 ? ', ' : ' ');
  24840. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  24841. }
  24842. /**
  24843. * Checks if `value` is a flattenable `arguments` object or array.
  24844. *
  24845. * @private
  24846. * @param {*} value The value to check.
  24847. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  24848. */
  24849. function isFlattenable(value) {
  24850. return isArray(value) || isArguments(value) ||
  24851. !!(spreadableSymbol && value && value[spreadableSymbol]);
  24852. }
  24853. /**
  24854. * Checks if `value` is a valid array-like index.
  24855. *
  24856. * @private
  24857. * @param {*} value The value to check.
  24858. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  24859. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  24860. */
  24861. function isIndex(value, length) {
  24862. var type = typeof value;
  24863. length = length == null ? MAX_SAFE_INTEGER : length;
  24864. return !!length &&
  24865. (type == 'number' ||
  24866. (type != 'symbol' && reIsUint.test(value))) &&
  24867. (value > -1 && value % 1 == 0 && value < length);
  24868. }
  24869. /**
  24870. * Checks if the given arguments are from an iteratee call.
  24871. *
  24872. * @private
  24873. * @param {*} value The potential iteratee value argument.
  24874. * @param {*} index The potential iteratee index or key argument.
  24875. * @param {*} object The potential iteratee object argument.
  24876. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  24877. * else `false`.
  24878. */
  24879. function isIterateeCall(value, index, object) {
  24880. if (!isObject(object)) {
  24881. return false;
  24882. }
  24883. var type = typeof index;
  24884. if (type == 'number'
  24885. ? (isArrayLike(object) && isIndex(index, object.length))
  24886. : (type == 'string' && index in object)
  24887. ) {
  24888. return eq(object[index], value);
  24889. }
  24890. return false;
  24891. }
  24892. /**
  24893. * Checks if `value` is a property name and not a property path.
  24894. *
  24895. * @private
  24896. * @param {*} value The value to check.
  24897. * @param {Object} [object] The object to query keys on.
  24898. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  24899. */
  24900. function isKey(value, object) {
  24901. if (isArray(value)) {
  24902. return false;
  24903. }
  24904. var type = typeof value;
  24905. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  24906. value == null || isSymbol(value)) {
  24907. return true;
  24908. }
  24909. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  24910. (object != null && value in Object(object));
  24911. }
  24912. /**
  24913. * Checks if `value` is suitable for use as unique object key.
  24914. *
  24915. * @private
  24916. * @param {*} value The value to check.
  24917. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  24918. */
  24919. function isKeyable(value) {
  24920. var type = typeof value;
  24921. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  24922. ? (value !== '__proto__')
  24923. : (value === null);
  24924. }
  24925. /**
  24926. * Checks if `func` has a lazy counterpart.
  24927. *
  24928. * @private
  24929. * @param {Function} func The function to check.
  24930. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  24931. * else `false`.
  24932. */
  24933. function isLaziable(func) {
  24934. var funcName = getFuncName(func),
  24935. other = lodash[funcName];
  24936. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  24937. return false;
  24938. }
  24939. if (func === other) {
  24940. return true;
  24941. }
  24942. var data = getData(other);
  24943. return !!data && func === data[0];
  24944. }
  24945. /**
  24946. * Checks if `func` has its source masked.
  24947. *
  24948. * @private
  24949. * @param {Function} func The function to check.
  24950. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  24951. */
  24952. function isMasked(func) {
  24953. return !!maskSrcKey && (maskSrcKey in func);
  24954. }
  24955. /**
  24956. * Checks if `func` is capable of being masked.
  24957. *
  24958. * @private
  24959. * @param {*} value The value to check.
  24960. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  24961. */
  24962. var isMaskable = coreJsData ? isFunction : stubFalse;
  24963. /**
  24964. * Checks if `value` is likely a prototype object.
  24965. *
  24966. * @private
  24967. * @param {*} value The value to check.
  24968. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  24969. */
  24970. function isPrototype(value) {
  24971. var Ctor = value && value.constructor,
  24972. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  24973. return value === proto;
  24974. }
  24975. /**
  24976. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  24977. *
  24978. * @private
  24979. * @param {*} value The value to check.
  24980. * @returns {boolean} Returns `true` if `value` if suitable for strict
  24981. * equality comparisons, else `false`.
  24982. */
  24983. function isStrictComparable(value) {
  24984. return value === value && !isObject(value);
  24985. }
  24986. /**
  24987. * A specialized version of `matchesProperty` for source values suitable
  24988. * for strict equality comparisons, i.e. `===`.
  24989. *
  24990. * @private
  24991. * @param {string} key The key of the property to get.
  24992. * @param {*} srcValue The value to match.
  24993. * @returns {Function} Returns the new spec function.
  24994. */
  24995. function matchesStrictComparable(key, srcValue) {
  24996. return function(object) {
  24997. if (object == null) {
  24998. return false;
  24999. }
  25000. return object[key] === srcValue &&
  25001. (srcValue !== undefined || (key in Object(object)));
  25002. };
  25003. }
  25004. /**
  25005. * A specialized version of `_.memoize` which clears the memoized function's
  25006. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  25007. *
  25008. * @private
  25009. * @param {Function} func The function to have its output memoized.
  25010. * @returns {Function} Returns the new memoized function.
  25011. */
  25012. function memoizeCapped(func) {
  25013. var result = memoize(func, function(key) {
  25014. if (cache.size === MAX_MEMOIZE_SIZE) {
  25015. cache.clear();
  25016. }
  25017. return key;
  25018. });
  25019. var cache = result.cache;
  25020. return result;
  25021. }
  25022. /**
  25023. * Merges the function metadata of `source` into `data`.
  25024. *
  25025. * Merging metadata reduces the number of wrappers used to invoke a function.
  25026. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  25027. * may be applied regardless of execution order. Methods like `_.ary` and
  25028. * `_.rearg` modify function arguments, making the order in which they are
  25029. * executed important, preventing the merging of metadata. However, we make
  25030. * an exception for a safe combined case where curried functions have `_.ary`
  25031. * and or `_.rearg` applied.
  25032. *
  25033. * @private
  25034. * @param {Array} data The destination metadata.
  25035. * @param {Array} source The source metadata.
  25036. * @returns {Array} Returns `data`.
  25037. */
  25038. function mergeData(data, source) {
  25039. var bitmask = data[1],
  25040. srcBitmask = source[1],
  25041. newBitmask = bitmask | srcBitmask,
  25042. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  25043. var isCombo =
  25044. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  25045. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  25046. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  25047. // Exit early if metadata can't be merged.
  25048. if (!(isCommon || isCombo)) {
  25049. return data;
  25050. }
  25051. // Use source `thisArg` if available.
  25052. if (srcBitmask & WRAP_BIND_FLAG) {
  25053. data[2] = source[2];
  25054. // Set when currying a bound function.
  25055. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  25056. }
  25057. // Compose partial arguments.
  25058. var value = source[3];
  25059. if (value) {
  25060. var partials = data[3];
  25061. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  25062. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  25063. }
  25064. // Compose partial right arguments.
  25065. value = source[5];
  25066. if (value) {
  25067. partials = data[5];
  25068. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  25069. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  25070. }
  25071. // Use source `argPos` if available.
  25072. value = source[7];
  25073. if (value) {
  25074. data[7] = value;
  25075. }
  25076. // Use source `ary` if it's smaller.
  25077. if (srcBitmask & WRAP_ARY_FLAG) {
  25078. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  25079. }
  25080. // Use source `arity` if one is not provided.
  25081. if (data[9] == null) {
  25082. data[9] = source[9];
  25083. }
  25084. // Use source `func` and merge bitmasks.
  25085. data[0] = source[0];
  25086. data[1] = newBitmask;
  25087. return data;
  25088. }
  25089. /**
  25090. * This function is like
  25091. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  25092. * except that it includes inherited enumerable properties.
  25093. *
  25094. * @private
  25095. * @param {Object} object The object to query.
  25096. * @returns {Array} Returns the array of property names.
  25097. */
  25098. function nativeKeysIn(object) {
  25099. var result = [];
  25100. if (object != null) {
  25101. for (var key in Object(object)) {
  25102. result.push(key);
  25103. }
  25104. }
  25105. return result;
  25106. }
  25107. /**
  25108. * Converts `value` to a string using `Object.prototype.toString`.
  25109. *
  25110. * @private
  25111. * @param {*} value The value to convert.
  25112. * @returns {string} Returns the converted string.
  25113. */
  25114. function objectToString(value) {
  25115. return nativeObjectToString.call(value);
  25116. }
  25117. /**
  25118. * A specialized version of `baseRest` which transforms the rest array.
  25119. *
  25120. * @private
  25121. * @param {Function} func The function to apply a rest parameter to.
  25122. * @param {number} [start=func.length-1] The start position of the rest parameter.
  25123. * @param {Function} transform The rest array transform.
  25124. * @returns {Function} Returns the new function.
  25125. */
  25126. function overRest(func, start, transform) {
  25127. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  25128. return function() {
  25129. var args = arguments,
  25130. index = -1,
  25131. length = nativeMax(args.length - start, 0),
  25132. array = Array(length);
  25133. while (++index < length) {
  25134. array[index] = args[start + index];
  25135. }
  25136. index = -1;
  25137. var otherArgs = Array(start + 1);
  25138. while (++index < start) {
  25139. otherArgs[index] = args[index];
  25140. }
  25141. otherArgs[start] = transform(array);
  25142. return apply(func, this, otherArgs);
  25143. };
  25144. }
  25145. /**
  25146. * Gets the parent value at `path` of `object`.
  25147. *
  25148. * @private
  25149. * @param {Object} object The object to query.
  25150. * @param {Array} path The path to get the parent value of.
  25151. * @returns {*} Returns the parent value.
  25152. */
  25153. function parent(object, path) {
  25154. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  25155. }
  25156. /**
  25157. * Reorder `array` according to the specified indexes where the element at
  25158. * the first index is assigned as the first element, the element at
  25159. * the second index is assigned as the second element, and so on.
  25160. *
  25161. * @private
  25162. * @param {Array} array The array to reorder.
  25163. * @param {Array} indexes The arranged array indexes.
  25164. * @returns {Array} Returns `array`.
  25165. */
  25166. function reorder(array, indexes) {
  25167. var arrLength = array.length,
  25168. length = nativeMin(indexes.length, arrLength),
  25169. oldArray = copyArray(array);
  25170. while (length--) {
  25171. var index = indexes[length];
  25172. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  25173. }
  25174. return array;
  25175. }
  25176. /**
  25177. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  25178. *
  25179. * @private
  25180. * @param {Object} object The object to query.
  25181. * @param {string} key The key of the property to get.
  25182. * @returns {*} Returns the property value.
  25183. */
  25184. function safeGet(object, key) {
  25185. if (key === 'constructor' && typeof object[key] === 'function') {
  25186. return;
  25187. }
  25188. if (key == '__proto__') {
  25189. return;
  25190. }
  25191. return object[key];
  25192. }
  25193. /**
  25194. * Sets metadata for `func`.
  25195. *
  25196. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  25197. * period of time, it will trip its breaker and transition to an identity
  25198. * function to avoid garbage collection pauses in V8. See
  25199. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  25200. * for more details.
  25201. *
  25202. * @private
  25203. * @param {Function} func The function to associate metadata with.
  25204. * @param {*} data The metadata.
  25205. * @returns {Function} Returns `func`.
  25206. */
  25207. var setData = shortOut(baseSetData);
  25208. /**
  25209. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  25210. *
  25211. * @private
  25212. * @param {Function} func The function to delay.
  25213. * @param {number} wait The number of milliseconds to delay invocation.
  25214. * @returns {number|Object} Returns the timer id or timeout object.
  25215. */
  25216. var setTimeout = ctxSetTimeout || function(func, wait) {
  25217. return root.setTimeout(func, wait);
  25218. };
  25219. /**
  25220. * Sets the `toString` method of `func` to return `string`.
  25221. *
  25222. * @private
  25223. * @param {Function} func The function to modify.
  25224. * @param {Function} string The `toString` result.
  25225. * @returns {Function} Returns `func`.
  25226. */
  25227. var setToString = shortOut(baseSetToString);
  25228. /**
  25229. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  25230. * with wrapper details in a comment at the top of the source body.
  25231. *
  25232. * @private
  25233. * @param {Function} wrapper The function to modify.
  25234. * @param {Function} reference The reference function.
  25235. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  25236. * @returns {Function} Returns `wrapper`.
  25237. */
  25238. function setWrapToString(wrapper, reference, bitmask) {
  25239. var source = (reference + '');
  25240. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  25241. }
  25242. /**
  25243. * Creates a function that'll short out and invoke `identity` instead
  25244. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  25245. * milliseconds.
  25246. *
  25247. * @private
  25248. * @param {Function} func The function to restrict.
  25249. * @returns {Function} Returns the new shortable function.
  25250. */
  25251. function shortOut(func) {
  25252. var count = 0,
  25253. lastCalled = 0;
  25254. return function() {
  25255. var stamp = nativeNow(),
  25256. remaining = HOT_SPAN - (stamp - lastCalled);
  25257. lastCalled = stamp;
  25258. if (remaining > 0) {
  25259. if (++count >= HOT_COUNT) {
  25260. return arguments[0];
  25261. }
  25262. } else {
  25263. count = 0;
  25264. }
  25265. return func.apply(undefined, arguments);
  25266. };
  25267. }
  25268. /**
  25269. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  25270. *
  25271. * @private
  25272. * @param {Array} array The array to shuffle.
  25273. * @param {number} [size=array.length] The size of `array`.
  25274. * @returns {Array} Returns `array`.
  25275. */
  25276. function shuffleSelf(array, size) {
  25277. var index = -1,
  25278. length = array.length,
  25279. lastIndex = length - 1;
  25280. size = size === undefined ? length : size;
  25281. while (++index < size) {
  25282. var rand = baseRandom(index, lastIndex),
  25283. value = array[rand];
  25284. array[rand] = array[index];
  25285. array[index] = value;
  25286. }
  25287. array.length = size;
  25288. return array;
  25289. }
  25290. /**
  25291. * Converts `string` to a property path array.
  25292. *
  25293. * @private
  25294. * @param {string} string The string to convert.
  25295. * @returns {Array} Returns the property path array.
  25296. */
  25297. var stringToPath = memoizeCapped(function(string) {
  25298. var result = [];
  25299. if (string.charCodeAt(0) === 46 /* . */) {
  25300. result.push('');
  25301. }
  25302. string.replace(rePropName, function(match, number, quote, subString) {
  25303. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  25304. });
  25305. return result;
  25306. });
  25307. /**
  25308. * Converts `value` to a string key if it's not a string or symbol.
  25309. *
  25310. * @private
  25311. * @param {*} value The value to inspect.
  25312. * @returns {string|symbol} Returns the key.
  25313. */
  25314. function toKey(value) {
  25315. if (typeof value == 'string' || isSymbol(value)) {
  25316. return value;
  25317. }
  25318. var result = (value + '');
  25319. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  25320. }
  25321. /**
  25322. * Converts `func` to its source code.
  25323. *
  25324. * @private
  25325. * @param {Function} func The function to convert.
  25326. * @returns {string} Returns the source code.
  25327. */
  25328. function toSource(func) {
  25329. if (func != null) {
  25330. try {
  25331. return funcToString.call(func);
  25332. } catch (e) {}
  25333. try {
  25334. return (func + '');
  25335. } catch (e) {}
  25336. }
  25337. return '';
  25338. }
  25339. /**
  25340. * Updates wrapper `details` based on `bitmask` flags.
  25341. *
  25342. * @private
  25343. * @returns {Array} details The details to modify.
  25344. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  25345. * @returns {Array} Returns `details`.
  25346. */
  25347. function updateWrapDetails(details, bitmask) {
  25348. arrayEach(wrapFlags, function(pair) {
  25349. var value = '_.' + pair[0];
  25350. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  25351. details.push(value);
  25352. }
  25353. });
  25354. return details.sort();
  25355. }
  25356. /**
  25357. * Creates a clone of `wrapper`.
  25358. *
  25359. * @private
  25360. * @param {Object} wrapper The wrapper to clone.
  25361. * @returns {Object} Returns the cloned wrapper.
  25362. */
  25363. function wrapperClone(wrapper) {
  25364. if (wrapper instanceof LazyWrapper) {
  25365. return wrapper.clone();
  25366. }
  25367. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  25368. result.__actions__ = copyArray(wrapper.__actions__);
  25369. result.__index__ = wrapper.__index__;
  25370. result.__values__ = wrapper.__values__;
  25371. return result;
  25372. }
  25373. /*------------------------------------------------------------------------*/
  25374. /**
  25375. * Creates an array of elements split into groups the length of `size`.
  25376. * If `array` can't be split evenly, the final chunk will be the remaining
  25377. * elements.
  25378. *
  25379. * @static
  25380. * @memberOf _
  25381. * @since 3.0.0
  25382. * @category Array
  25383. * @param {Array} array The array to process.
  25384. * @param {number} [size=1] The length of each chunk
  25385. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  25386. * @returns {Array} Returns the new array of chunks.
  25387. * @example
  25388. *
  25389. * _.chunk(['a', 'b', 'c', 'd'], 2);
  25390. * // => [['a', 'b'], ['c', 'd']]
  25391. *
  25392. * _.chunk(['a', 'b', 'c', 'd'], 3);
  25393. * // => [['a', 'b', 'c'], ['d']]
  25394. */
  25395. function chunk(array, size, guard) {
  25396. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  25397. size = 1;
  25398. } else {
  25399. size = nativeMax(toInteger(size), 0);
  25400. }
  25401. var length = array == null ? 0 : array.length;
  25402. if (!length || size < 1) {
  25403. return [];
  25404. }
  25405. var index = 0,
  25406. resIndex = 0,
  25407. result = Array(nativeCeil(length / size));
  25408. while (index < length) {
  25409. result[resIndex++] = baseSlice(array, index, (index += size));
  25410. }
  25411. return result;
  25412. }
  25413. /**
  25414. * Creates an array with all falsey values removed. The values `false`, `null`,
  25415. * `0`, `""`, `undefined`, and `NaN` are falsey.
  25416. *
  25417. * @static
  25418. * @memberOf _
  25419. * @since 0.1.0
  25420. * @category Array
  25421. * @param {Array} array The array to compact.
  25422. * @returns {Array} Returns the new array of filtered values.
  25423. * @example
  25424. *
  25425. * _.compact([0, 1, false, 2, '', 3]);
  25426. * // => [1, 2, 3]
  25427. */
  25428. function compact(array) {
  25429. var index = -1,
  25430. length = array == null ? 0 : array.length,
  25431. resIndex = 0,
  25432. result = [];
  25433. while (++index < length) {
  25434. var value = array[index];
  25435. if (value) {
  25436. result[resIndex++] = value;
  25437. }
  25438. }
  25439. return result;
  25440. }
  25441. /**
  25442. * Creates a new array concatenating `array` with any additional arrays
  25443. * and/or values.
  25444. *
  25445. * @static
  25446. * @memberOf _
  25447. * @since 4.0.0
  25448. * @category Array
  25449. * @param {Array} array The array to concatenate.
  25450. * @param {...*} [values] The values to concatenate.
  25451. * @returns {Array} Returns the new concatenated array.
  25452. * @example
  25453. *
  25454. * var array = [1];
  25455. * var other = _.concat(array, 2, [3], [[4]]);
  25456. *
  25457. * console.log(other);
  25458. * // => [1, 2, 3, [4]]
  25459. *
  25460. * console.log(array);
  25461. * // => [1]
  25462. */
  25463. function concat() {
  25464. var length = arguments.length;
  25465. if (!length) {
  25466. return [];
  25467. }
  25468. var args = Array(length - 1),
  25469. array = arguments[0],
  25470. index = length;
  25471. while (index--) {
  25472. args[index - 1] = arguments[index];
  25473. }
  25474. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  25475. }
  25476. /**
  25477. * Creates an array of `array` values not included in the other given arrays
  25478. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  25479. * for equality comparisons. The order and references of result values are
  25480. * determined by the first array.
  25481. *
  25482. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  25483. *
  25484. * @static
  25485. * @memberOf _
  25486. * @since 0.1.0
  25487. * @category Array
  25488. * @param {Array} array The array to inspect.
  25489. * @param {...Array} [values] The values to exclude.
  25490. * @returns {Array} Returns the new array of filtered values.
  25491. * @see _.without, _.xor
  25492. * @example
  25493. *
  25494. * _.difference([2, 1], [2, 3]);
  25495. * // => [1]
  25496. */
  25497. var difference = baseRest(function(array, values) {
  25498. return isArrayLikeObject(array)
  25499. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  25500. : [];
  25501. });
  25502. /**
  25503. * This method is like `_.difference` except that it accepts `iteratee` which
  25504. * is invoked for each element of `array` and `values` to generate the criterion
  25505. * by which they're compared. The order and references of result values are
  25506. * determined by the first array. The iteratee is invoked with one argument:
  25507. * (value).
  25508. *
  25509. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  25510. *
  25511. * @static
  25512. * @memberOf _
  25513. * @since 4.0.0
  25514. * @category Array
  25515. * @param {Array} array The array to inspect.
  25516. * @param {...Array} [values] The values to exclude.
  25517. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  25518. * @returns {Array} Returns the new array of filtered values.
  25519. * @example
  25520. *
  25521. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  25522. * // => [1.2]
  25523. *
  25524. * // The `_.property` iteratee shorthand.
  25525. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  25526. * // => [{ 'x': 2 }]
  25527. */
  25528. var differenceBy = baseRest(function(array, values) {
  25529. var iteratee = last(values);
  25530. if (isArrayLikeObject(iteratee)) {
  25531. iteratee = undefined;
  25532. }
  25533. return isArrayLikeObject(array)
  25534. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  25535. : [];
  25536. });
  25537. /**
  25538. * This method is like `_.difference` except that it accepts `comparator`
  25539. * which is invoked to compare elements of `array` to `values`. The order and
  25540. * references of result values are determined by the first array. The comparator
  25541. * is invoked with two arguments: (arrVal, othVal).
  25542. *
  25543. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  25544. *
  25545. * @static
  25546. * @memberOf _
  25547. * @since 4.0.0
  25548. * @category Array
  25549. * @param {Array} array The array to inspect.
  25550. * @param {...Array} [values] The values to exclude.
  25551. * @param {Function} [comparator] The comparator invoked per element.
  25552. * @returns {Array} Returns the new array of filtered values.
  25553. * @example
  25554. *
  25555. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  25556. *
  25557. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  25558. * // => [{ 'x': 2, 'y': 1 }]
  25559. */
  25560. var differenceWith = baseRest(function(array, values) {
  25561. var comparator = last(values);
  25562. if (isArrayLikeObject(comparator)) {
  25563. comparator = undefined;
  25564. }
  25565. return isArrayLikeObject(array)
  25566. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  25567. : [];
  25568. });
  25569. /**
  25570. * Creates a slice of `array` with `n` elements dropped from the beginning.
  25571. *
  25572. * @static
  25573. * @memberOf _
  25574. * @since 0.5.0
  25575. * @category Array
  25576. * @param {Array} array The array to query.
  25577. * @param {number} [n=1] The number of elements to drop.
  25578. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  25579. * @returns {Array} Returns the slice of `array`.
  25580. * @example
  25581. *
  25582. * _.drop([1, 2, 3]);
  25583. * // => [2, 3]
  25584. *
  25585. * _.drop([1, 2, 3], 2);
  25586. * // => [3]
  25587. *
  25588. * _.drop([1, 2, 3], 5);
  25589. * // => []
  25590. *
  25591. * _.drop([1, 2, 3], 0);
  25592. * // => [1, 2, 3]
  25593. */
  25594. function drop(array, n, guard) {
  25595. var length = array == null ? 0 : array.length;
  25596. if (!length) {
  25597. return [];
  25598. }
  25599. n = (guard || n === undefined) ? 1 : toInteger(n);
  25600. return baseSlice(array, n < 0 ? 0 : n, length);
  25601. }
  25602. /**
  25603. * Creates a slice of `array` with `n` elements dropped from the end.
  25604. *
  25605. * @static
  25606. * @memberOf _
  25607. * @since 3.0.0
  25608. * @category Array
  25609. * @param {Array} array The array to query.
  25610. * @param {number} [n=1] The number of elements to drop.
  25611. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  25612. * @returns {Array} Returns the slice of `array`.
  25613. * @example
  25614. *
  25615. * _.dropRight([1, 2, 3]);
  25616. * // => [1, 2]
  25617. *
  25618. * _.dropRight([1, 2, 3], 2);
  25619. * // => [1]
  25620. *
  25621. * _.dropRight([1, 2, 3], 5);
  25622. * // => []
  25623. *
  25624. * _.dropRight([1, 2, 3], 0);
  25625. * // => [1, 2, 3]
  25626. */
  25627. function dropRight(array, n, guard) {
  25628. var length = array == null ? 0 : array.length;
  25629. if (!length) {
  25630. return [];
  25631. }
  25632. n = (guard || n === undefined) ? 1 : toInteger(n);
  25633. n = length - n;
  25634. return baseSlice(array, 0, n < 0 ? 0 : n);
  25635. }
  25636. /**
  25637. * Creates a slice of `array` excluding elements dropped from the end.
  25638. * Elements are dropped until `predicate` returns falsey. The predicate is
  25639. * invoked with three arguments: (value, index, array).
  25640. *
  25641. * @static
  25642. * @memberOf _
  25643. * @since 3.0.0
  25644. * @category Array
  25645. * @param {Array} array The array to query.
  25646. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  25647. * @returns {Array} Returns the slice of `array`.
  25648. * @example
  25649. *
  25650. * var users = [
  25651. * { 'user': 'barney', 'active': true },
  25652. * { 'user': 'fred', 'active': false },
  25653. * { 'user': 'pebbles', 'active': false }
  25654. * ];
  25655. *
  25656. * _.dropRightWhile(users, function(o) { return !o.active; });
  25657. * // => objects for ['barney']
  25658. *
  25659. * // The `_.matches` iteratee shorthand.
  25660. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  25661. * // => objects for ['barney', 'fred']
  25662. *
  25663. * // The `_.matchesProperty` iteratee shorthand.
  25664. * _.dropRightWhile(users, ['active', false]);
  25665. * // => objects for ['barney']
  25666. *
  25667. * // The `_.property` iteratee shorthand.
  25668. * _.dropRightWhile(users, 'active');
  25669. * // => objects for ['barney', 'fred', 'pebbles']
  25670. */
  25671. function dropRightWhile(array, predicate) {
  25672. return (array && array.length)
  25673. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  25674. : [];
  25675. }
  25676. /**
  25677. * Creates a slice of `array` excluding elements dropped from the beginning.
  25678. * Elements are dropped until `predicate` returns falsey. The predicate is
  25679. * invoked with three arguments: (value, index, array).
  25680. *
  25681. * @static
  25682. * @memberOf _
  25683. * @since 3.0.0
  25684. * @category Array
  25685. * @param {Array} array The array to query.
  25686. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  25687. * @returns {Array} Returns the slice of `array`.
  25688. * @example
  25689. *
  25690. * var users = [
  25691. * { 'user': 'barney', 'active': false },
  25692. * { 'user': 'fred', 'active': false },
  25693. * { 'user': 'pebbles', 'active': true }
  25694. * ];
  25695. *
  25696. * _.dropWhile(users, function(o) { return !o.active; });
  25697. * // => objects for ['pebbles']
  25698. *
  25699. * // The `_.matches` iteratee shorthand.
  25700. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  25701. * // => objects for ['fred', 'pebbles']
  25702. *
  25703. * // The `_.matchesProperty` iteratee shorthand.
  25704. * _.dropWhile(users, ['active', false]);
  25705. * // => objects for ['pebbles']
  25706. *
  25707. * // The `_.property` iteratee shorthand.
  25708. * _.dropWhile(users, 'active');
  25709. * // => objects for ['barney', 'fred', 'pebbles']
  25710. */
  25711. function dropWhile(array, predicate) {
  25712. return (array && array.length)
  25713. ? baseWhile(array, getIteratee(predicate, 3), true)
  25714. : [];
  25715. }
  25716. /**
  25717. * Fills elements of `array` with `value` from `start` up to, but not
  25718. * including, `end`.
  25719. *
  25720. * **Note:** This method mutates `array`.
  25721. *
  25722. * @static
  25723. * @memberOf _
  25724. * @since 3.2.0
  25725. * @category Array
  25726. * @param {Array} array The array to fill.
  25727. * @param {*} value The value to fill `array` with.
  25728. * @param {number} [start=0] The start position.
  25729. * @param {number} [end=array.length] The end position.
  25730. * @returns {Array} Returns `array`.
  25731. * @example
  25732. *
  25733. * var array = [1, 2, 3];
  25734. *
  25735. * _.fill(array, 'a');
  25736. * console.log(array);
  25737. * // => ['a', 'a', 'a']
  25738. *
  25739. * _.fill(Array(3), 2);
  25740. * // => [2, 2, 2]
  25741. *
  25742. * _.fill([4, 6, 8, 10], '*', 1, 3);
  25743. * // => [4, '*', '*', 10]
  25744. */
  25745. function fill(array, value, start, end) {
  25746. var length = array == null ? 0 : array.length;
  25747. if (!length) {
  25748. return [];
  25749. }
  25750. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  25751. start = 0;
  25752. end = length;
  25753. }
  25754. return baseFill(array, value, start, end);
  25755. }
  25756. /**
  25757. * This method is like `_.find` except that it returns the index of the first
  25758. * element `predicate` returns truthy for instead of the element itself.
  25759. *
  25760. * @static
  25761. * @memberOf _
  25762. * @since 1.1.0
  25763. * @category Array
  25764. * @param {Array} array The array to inspect.
  25765. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  25766. * @param {number} [fromIndex=0] The index to search from.
  25767. * @returns {number} Returns the index of the found element, else `-1`.
  25768. * @example
  25769. *
  25770. * var users = [
  25771. * { 'user': 'barney', 'active': false },
  25772. * { 'user': 'fred', 'active': false },
  25773. * { 'user': 'pebbles', 'active': true }
  25774. * ];
  25775. *
  25776. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  25777. * // => 0
  25778. *
  25779. * // The `_.matches` iteratee shorthand.
  25780. * _.findIndex(users, { 'user': 'fred', 'active': false });
  25781. * // => 1
  25782. *
  25783. * // The `_.matchesProperty` iteratee shorthand.
  25784. * _.findIndex(users, ['active', false]);
  25785. * // => 0
  25786. *
  25787. * // The `_.property` iteratee shorthand.
  25788. * _.findIndex(users, 'active');
  25789. * // => 2
  25790. */
  25791. function findIndex(array, predicate, fromIndex) {
  25792. var length = array == null ? 0 : array.length;
  25793. if (!length) {
  25794. return -1;
  25795. }
  25796. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  25797. if (index < 0) {
  25798. index = nativeMax(length + index, 0);
  25799. }
  25800. return baseFindIndex(array, getIteratee(predicate, 3), index);
  25801. }
  25802. /**
  25803. * This method is like `_.findIndex` except that it iterates over elements
  25804. * of `collection` from right to left.
  25805. *
  25806. * @static
  25807. * @memberOf _
  25808. * @since 2.0.0
  25809. * @category Array
  25810. * @param {Array} array The array to inspect.
  25811. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  25812. * @param {number} [fromIndex=array.length-1] The index to search from.
  25813. * @returns {number} Returns the index of the found element, else `-1`.
  25814. * @example
  25815. *
  25816. * var users = [
  25817. * { 'user': 'barney', 'active': true },
  25818. * { 'user': 'fred', 'active': false },
  25819. * { 'user': 'pebbles', 'active': false }
  25820. * ];
  25821. *
  25822. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  25823. * // => 2
  25824. *
  25825. * // The `_.matches` iteratee shorthand.
  25826. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  25827. * // => 0
  25828. *
  25829. * // The `_.matchesProperty` iteratee shorthand.
  25830. * _.findLastIndex(users, ['active', false]);
  25831. * // => 2
  25832. *
  25833. * // The `_.property` iteratee shorthand.
  25834. * _.findLastIndex(users, 'active');
  25835. * // => 0
  25836. */
  25837. function findLastIndex(array, predicate, fromIndex) {
  25838. var length = array == null ? 0 : array.length;
  25839. if (!length) {
  25840. return -1;
  25841. }
  25842. var index = length - 1;
  25843. if (fromIndex !== undefined) {
  25844. index = toInteger(fromIndex);
  25845. index = fromIndex < 0
  25846. ? nativeMax(length + index, 0)
  25847. : nativeMin(index, length - 1);
  25848. }
  25849. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  25850. }
  25851. /**
  25852. * Flattens `array` a single level deep.
  25853. *
  25854. * @static
  25855. * @memberOf _
  25856. * @since 0.1.0
  25857. * @category Array
  25858. * @param {Array} array The array to flatten.
  25859. * @returns {Array} Returns the new flattened array.
  25860. * @example
  25861. *
  25862. * _.flatten([1, [2, [3, [4]], 5]]);
  25863. * // => [1, 2, [3, [4]], 5]
  25864. */
  25865. function flatten(array) {
  25866. var length = array == null ? 0 : array.length;
  25867. return length ? baseFlatten(array, 1) : [];
  25868. }
  25869. /**
  25870. * Recursively flattens `array`.
  25871. *
  25872. * @static
  25873. * @memberOf _
  25874. * @since 3.0.0
  25875. * @category Array
  25876. * @param {Array} array The array to flatten.
  25877. * @returns {Array} Returns the new flattened array.
  25878. * @example
  25879. *
  25880. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  25881. * // => [1, 2, 3, 4, 5]
  25882. */
  25883. function flattenDeep(array) {
  25884. var length = array == null ? 0 : array.length;
  25885. return length ? baseFlatten(array, INFINITY) : [];
  25886. }
  25887. /**
  25888. * Recursively flatten `array` up to `depth` times.
  25889. *
  25890. * @static
  25891. * @memberOf _
  25892. * @since 4.4.0
  25893. * @category Array
  25894. * @param {Array} array The array to flatten.
  25895. * @param {number} [depth=1] The maximum recursion depth.
  25896. * @returns {Array} Returns the new flattened array.
  25897. * @example
  25898. *
  25899. * var array = [1, [2, [3, [4]], 5]];
  25900. *
  25901. * _.flattenDepth(array, 1);
  25902. * // => [1, 2, [3, [4]], 5]
  25903. *
  25904. * _.flattenDepth(array, 2);
  25905. * // => [1, 2, 3, [4], 5]
  25906. */
  25907. function flattenDepth(array, depth) {
  25908. var length = array == null ? 0 : array.length;
  25909. if (!length) {
  25910. return [];
  25911. }
  25912. depth = depth === undefined ? 1 : toInteger(depth);
  25913. return baseFlatten(array, depth);
  25914. }
  25915. /**
  25916. * The inverse of `_.toPairs`; this method returns an object composed
  25917. * from key-value `pairs`.
  25918. *
  25919. * @static
  25920. * @memberOf _
  25921. * @since 4.0.0
  25922. * @category Array
  25923. * @param {Array} pairs The key-value pairs.
  25924. * @returns {Object} Returns the new object.
  25925. * @example
  25926. *
  25927. * _.fromPairs([['a', 1], ['b', 2]]);
  25928. * // => { 'a': 1, 'b': 2 }
  25929. */
  25930. function fromPairs(pairs) {
  25931. var index = -1,
  25932. length = pairs == null ? 0 : pairs.length,
  25933. result = {};
  25934. while (++index < length) {
  25935. var pair = pairs[index];
  25936. result[pair[0]] = pair[1];
  25937. }
  25938. return result;
  25939. }
  25940. /**
  25941. * Gets the first element of `array`.
  25942. *
  25943. * @static
  25944. * @memberOf _
  25945. * @since 0.1.0
  25946. * @alias first
  25947. * @category Array
  25948. * @param {Array} array The array to query.
  25949. * @returns {*} Returns the first element of `array`.
  25950. * @example
  25951. *
  25952. * _.head([1, 2, 3]);
  25953. * // => 1
  25954. *
  25955. * _.head([]);
  25956. * // => undefined
  25957. */
  25958. function head(array) {
  25959. return (array && array.length) ? array[0] : undefined;
  25960. }
  25961. /**
  25962. * Gets the index at which the first occurrence of `value` is found in `array`
  25963. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  25964. * for equality comparisons. If `fromIndex` is negative, it's used as the
  25965. * offset from the end of `array`.
  25966. *
  25967. * @static
  25968. * @memberOf _
  25969. * @since 0.1.0
  25970. * @category Array
  25971. * @param {Array} array The array to inspect.
  25972. * @param {*} value The value to search for.
  25973. * @param {number} [fromIndex=0] The index to search from.
  25974. * @returns {number} Returns the index of the matched value, else `-1`.
  25975. * @example
  25976. *
  25977. * _.indexOf([1, 2, 1, 2], 2);
  25978. * // => 1
  25979. *
  25980. * // Search from the `fromIndex`.
  25981. * _.indexOf([1, 2, 1, 2], 2, 2);
  25982. * // => 3
  25983. */
  25984. function indexOf(array, value, fromIndex) {
  25985. var length = array == null ? 0 : array.length;
  25986. if (!length) {
  25987. return -1;
  25988. }
  25989. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  25990. if (index < 0) {
  25991. index = nativeMax(length + index, 0);
  25992. }
  25993. return baseIndexOf(array, value, index);
  25994. }
  25995. /**
  25996. * Gets all but the last element of `array`.
  25997. *
  25998. * @static
  25999. * @memberOf _
  26000. * @since 0.1.0
  26001. * @category Array
  26002. * @param {Array} array The array to query.
  26003. * @returns {Array} Returns the slice of `array`.
  26004. * @example
  26005. *
  26006. * _.initial([1, 2, 3]);
  26007. * // => [1, 2]
  26008. */
  26009. function initial(array) {
  26010. var length = array == null ? 0 : array.length;
  26011. return length ? baseSlice(array, 0, -1) : [];
  26012. }
  26013. /**
  26014. * Creates an array of unique values that are included in all given arrays
  26015. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  26016. * for equality comparisons. The order and references of result values are
  26017. * determined by the first array.
  26018. *
  26019. * @static
  26020. * @memberOf _
  26021. * @since 0.1.0
  26022. * @category Array
  26023. * @param {...Array} [arrays] The arrays to inspect.
  26024. * @returns {Array} Returns the new array of intersecting values.
  26025. * @example
  26026. *
  26027. * _.intersection([2, 1], [2, 3]);
  26028. * // => [2]
  26029. */
  26030. var intersection = baseRest(function(arrays) {
  26031. var mapped = arrayMap(arrays, castArrayLikeObject);
  26032. return (mapped.length && mapped[0] === arrays[0])
  26033. ? baseIntersection(mapped)
  26034. : [];
  26035. });
  26036. /**
  26037. * This method is like `_.intersection` except that it accepts `iteratee`
  26038. * which is invoked for each element of each `arrays` to generate the criterion
  26039. * by which they're compared. The order and references of result values are
  26040. * determined by the first array. The iteratee is invoked with one argument:
  26041. * (value).
  26042. *
  26043. * @static
  26044. * @memberOf _
  26045. * @since 4.0.0
  26046. * @category Array
  26047. * @param {...Array} [arrays] The arrays to inspect.
  26048. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  26049. * @returns {Array} Returns the new array of intersecting values.
  26050. * @example
  26051. *
  26052. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  26053. * // => [2.1]
  26054. *
  26055. * // The `_.property` iteratee shorthand.
  26056. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  26057. * // => [{ 'x': 1 }]
  26058. */
  26059. var intersectionBy = baseRest(function(arrays) {
  26060. var iteratee = last(arrays),
  26061. mapped = arrayMap(arrays, castArrayLikeObject);
  26062. if (iteratee === last(mapped)) {
  26063. iteratee = undefined;
  26064. } else {
  26065. mapped.pop();
  26066. }
  26067. return (mapped.length && mapped[0] === arrays[0])
  26068. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  26069. : [];
  26070. });
  26071. /**
  26072. * This method is like `_.intersection` except that it accepts `comparator`
  26073. * which is invoked to compare elements of `arrays`. The order and references
  26074. * of result values are determined by the first array. The comparator is
  26075. * invoked with two arguments: (arrVal, othVal).
  26076. *
  26077. * @static
  26078. * @memberOf _
  26079. * @since 4.0.0
  26080. * @category Array
  26081. * @param {...Array} [arrays] The arrays to inspect.
  26082. * @param {Function} [comparator] The comparator invoked per element.
  26083. * @returns {Array} Returns the new array of intersecting values.
  26084. * @example
  26085. *
  26086. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  26087. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  26088. *
  26089. * _.intersectionWith(objects, others, _.isEqual);
  26090. * // => [{ 'x': 1, 'y': 2 }]
  26091. */
  26092. var intersectionWith = baseRest(function(arrays) {
  26093. var comparator = last(arrays),
  26094. mapped = arrayMap(arrays, castArrayLikeObject);
  26095. comparator = typeof comparator == 'function' ? comparator : undefined;
  26096. if (comparator) {
  26097. mapped.pop();
  26098. }
  26099. return (mapped.length && mapped[0] === arrays[0])
  26100. ? baseIntersection(mapped, undefined, comparator)
  26101. : [];
  26102. });
  26103. /**
  26104. * Converts all elements in `array` into a string separated by `separator`.
  26105. *
  26106. * @static
  26107. * @memberOf _
  26108. * @since 4.0.0
  26109. * @category Array
  26110. * @param {Array} array The array to convert.
  26111. * @param {string} [separator=','] The element separator.
  26112. * @returns {string} Returns the joined string.
  26113. * @example
  26114. *
  26115. * _.join(['a', 'b', 'c'], '~');
  26116. * // => 'a~b~c'
  26117. */
  26118. function join(array, separator) {
  26119. return array == null ? '' : nativeJoin.call(array, separator);
  26120. }
  26121. /**
  26122. * Gets the last element of `array`.
  26123. *
  26124. * @static
  26125. * @memberOf _
  26126. * @since 0.1.0
  26127. * @category Array
  26128. * @param {Array} array The array to query.
  26129. * @returns {*} Returns the last element of `array`.
  26130. * @example
  26131. *
  26132. * _.last([1, 2, 3]);
  26133. * // => 3
  26134. */
  26135. function last(array) {
  26136. var length = array == null ? 0 : array.length;
  26137. return length ? array[length - 1] : undefined;
  26138. }
  26139. /**
  26140. * This method is like `_.indexOf` except that it iterates over elements of
  26141. * `array` from right to left.
  26142. *
  26143. * @static
  26144. * @memberOf _
  26145. * @since 0.1.0
  26146. * @category Array
  26147. * @param {Array} array The array to inspect.
  26148. * @param {*} value The value to search for.
  26149. * @param {number} [fromIndex=array.length-1] The index to search from.
  26150. * @returns {number} Returns the index of the matched value, else `-1`.
  26151. * @example
  26152. *
  26153. * _.lastIndexOf([1, 2, 1, 2], 2);
  26154. * // => 3
  26155. *
  26156. * // Search from the `fromIndex`.
  26157. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  26158. * // => 1
  26159. */
  26160. function lastIndexOf(array, value, fromIndex) {
  26161. var length = array == null ? 0 : array.length;
  26162. if (!length) {
  26163. return -1;
  26164. }
  26165. var index = length;
  26166. if (fromIndex !== undefined) {
  26167. index = toInteger(fromIndex);
  26168. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  26169. }
  26170. return value === value
  26171. ? strictLastIndexOf(array, value, index)
  26172. : baseFindIndex(array, baseIsNaN, index, true);
  26173. }
  26174. /**
  26175. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  26176. * element from the end is returned.
  26177. *
  26178. * @static
  26179. * @memberOf _
  26180. * @since 4.11.0
  26181. * @category Array
  26182. * @param {Array} array The array to query.
  26183. * @param {number} [n=0] The index of the element to return.
  26184. * @returns {*} Returns the nth element of `array`.
  26185. * @example
  26186. *
  26187. * var array = ['a', 'b', 'c', 'd'];
  26188. *
  26189. * _.nth(array, 1);
  26190. * // => 'b'
  26191. *
  26192. * _.nth(array, -2);
  26193. * // => 'c';
  26194. */
  26195. function nth(array, n) {
  26196. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  26197. }
  26198. /**
  26199. * Removes all given values from `array` using
  26200. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  26201. * for equality comparisons.
  26202. *
  26203. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  26204. * to remove elements from an array by predicate.
  26205. *
  26206. * @static
  26207. * @memberOf _
  26208. * @since 2.0.0
  26209. * @category Array
  26210. * @param {Array} array The array to modify.
  26211. * @param {...*} [values] The values to remove.
  26212. * @returns {Array} Returns `array`.
  26213. * @example
  26214. *
  26215. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  26216. *
  26217. * _.pull(array, 'a', 'c');
  26218. * console.log(array);
  26219. * // => ['b', 'b']
  26220. */
  26221. var pull = baseRest(pullAll);
  26222. /**
  26223. * This method is like `_.pull` except that it accepts an array of values to remove.
  26224. *
  26225. * **Note:** Unlike `_.difference`, this method mutates `array`.
  26226. *
  26227. * @static
  26228. * @memberOf _
  26229. * @since 4.0.0
  26230. * @category Array
  26231. * @param {Array} array The array to modify.
  26232. * @param {Array} values The values to remove.
  26233. * @returns {Array} Returns `array`.
  26234. * @example
  26235. *
  26236. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  26237. *
  26238. * _.pullAll(array, ['a', 'c']);
  26239. * console.log(array);
  26240. * // => ['b', 'b']
  26241. */
  26242. function pullAll(array, values) {
  26243. return (array && array.length && values && values.length)
  26244. ? basePullAll(array, values)
  26245. : array;
  26246. }
  26247. /**
  26248. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  26249. * invoked for each element of `array` and `values` to generate the criterion
  26250. * by which they're compared. The iteratee is invoked with one argument: (value).
  26251. *
  26252. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  26253. *
  26254. * @static
  26255. * @memberOf _
  26256. * @since 4.0.0
  26257. * @category Array
  26258. * @param {Array} array The array to modify.
  26259. * @param {Array} values The values to remove.
  26260. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  26261. * @returns {Array} Returns `array`.
  26262. * @example
  26263. *
  26264. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  26265. *
  26266. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  26267. * console.log(array);
  26268. * // => [{ 'x': 2 }]
  26269. */
  26270. function pullAllBy(array, values, iteratee) {
  26271. return (array && array.length && values && values.length)
  26272. ? basePullAll(array, values, getIteratee(iteratee, 2))
  26273. : array;
  26274. }
  26275. /**
  26276. * This method is like `_.pullAll` except that it accepts `comparator` which
  26277. * is invoked to compare elements of `array` to `values`. The comparator is
  26278. * invoked with two arguments: (arrVal, othVal).
  26279. *
  26280. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  26281. *
  26282. * @static
  26283. * @memberOf _
  26284. * @since 4.6.0
  26285. * @category Array
  26286. * @param {Array} array The array to modify.
  26287. * @param {Array} values The values to remove.
  26288. * @param {Function} [comparator] The comparator invoked per element.
  26289. * @returns {Array} Returns `array`.
  26290. * @example
  26291. *
  26292. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  26293. *
  26294. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  26295. * console.log(array);
  26296. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  26297. */
  26298. function pullAllWith(array, values, comparator) {
  26299. return (array && array.length && values && values.length)
  26300. ? basePullAll(array, values, undefined, comparator)
  26301. : array;
  26302. }
  26303. /**
  26304. * Removes elements from `array` corresponding to `indexes` and returns an
  26305. * array of removed elements.
  26306. *
  26307. * **Note:** Unlike `_.at`, this method mutates `array`.
  26308. *
  26309. * @static
  26310. * @memberOf _
  26311. * @since 3.0.0
  26312. * @category Array
  26313. * @param {Array} array The array to modify.
  26314. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  26315. * @returns {Array} Returns the new array of removed elements.
  26316. * @example
  26317. *
  26318. * var array = ['a', 'b', 'c', 'd'];
  26319. * var pulled = _.pullAt(array, [1, 3]);
  26320. *
  26321. * console.log(array);
  26322. * // => ['a', 'c']
  26323. *
  26324. * console.log(pulled);
  26325. * // => ['b', 'd']
  26326. */
  26327. var pullAt = flatRest(function(array, indexes) {
  26328. var length = array == null ? 0 : array.length,
  26329. result = baseAt(array, indexes);
  26330. basePullAt(array, arrayMap(indexes, function(index) {
  26331. return isIndex(index, length) ? +index : index;
  26332. }).sort(compareAscending));
  26333. return result;
  26334. });
  26335. /**
  26336. * Removes all elements from `array` that `predicate` returns truthy for
  26337. * and returns an array of the removed elements. The predicate is invoked
  26338. * with three arguments: (value, index, array).
  26339. *
  26340. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  26341. * to pull elements from an array by value.
  26342. *
  26343. * @static
  26344. * @memberOf _
  26345. * @since 2.0.0
  26346. * @category Array
  26347. * @param {Array} array The array to modify.
  26348. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  26349. * @returns {Array} Returns the new array of removed elements.
  26350. * @example
  26351. *
  26352. * var array = [1, 2, 3, 4];
  26353. * var evens = _.remove(array, function(n) {
  26354. * return n % 2 == 0;
  26355. * });
  26356. *
  26357. * console.log(array);
  26358. * // => [1, 3]
  26359. *
  26360. * console.log(evens);
  26361. * // => [2, 4]
  26362. */
  26363. function remove(array, predicate) {
  26364. var result = [];
  26365. if (!(array && array.length)) {
  26366. return result;
  26367. }
  26368. var index = -1,
  26369. indexes = [],
  26370. length = array.length;
  26371. predicate = getIteratee(predicate, 3);
  26372. while (++index < length) {
  26373. var value = array[index];
  26374. if (predicate(value, index, array)) {
  26375. result.push(value);
  26376. indexes.push(index);
  26377. }
  26378. }
  26379. basePullAt(array, indexes);
  26380. return result;
  26381. }
  26382. /**
  26383. * Reverses `array` so that the first element becomes the last, the second
  26384. * element becomes the second to last, and so on.
  26385. *
  26386. * **Note:** This method mutates `array` and is based on
  26387. * [`Array#reverse`](https://mdn.io/Array/reverse).
  26388. *
  26389. * @static
  26390. * @memberOf _
  26391. * @since 4.0.0
  26392. * @category Array
  26393. * @param {Array} array The array to modify.
  26394. * @returns {Array} Returns `array`.
  26395. * @example
  26396. *
  26397. * var array = [1, 2, 3];
  26398. *
  26399. * _.reverse(array);
  26400. * // => [3, 2, 1]
  26401. *
  26402. * console.log(array);
  26403. * // => [3, 2, 1]
  26404. */
  26405. function reverse(array) {
  26406. return array == null ? array : nativeReverse.call(array);
  26407. }
  26408. /**
  26409. * Creates a slice of `array` from `start` up to, but not including, `end`.
  26410. *
  26411. * **Note:** This method is used instead of
  26412. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  26413. * returned.
  26414. *
  26415. * @static
  26416. * @memberOf _
  26417. * @since 3.0.0
  26418. * @category Array
  26419. * @param {Array} array The array to slice.
  26420. * @param {number} [start=0] The start position.
  26421. * @param {number} [end=array.length] The end position.
  26422. * @returns {Array} Returns the slice of `array`.
  26423. */
  26424. function slice(array, start, end) {
  26425. var length = array == null ? 0 : array.length;
  26426. if (!length) {
  26427. return [];
  26428. }
  26429. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  26430. start = 0;
  26431. end = length;
  26432. }
  26433. else {
  26434. start = start == null ? 0 : toInteger(start);
  26435. end = end === undefined ? length : toInteger(end);
  26436. }
  26437. return baseSlice(array, start, end);
  26438. }
  26439. /**
  26440. * Uses a binary search to determine the lowest index at which `value`
  26441. * should be inserted into `array` in order to maintain its sort order.
  26442. *
  26443. * @static
  26444. * @memberOf _
  26445. * @since 0.1.0
  26446. * @category Array
  26447. * @param {Array} array The sorted array to inspect.
  26448. * @param {*} value The value to evaluate.
  26449. * @returns {number} Returns the index at which `value` should be inserted
  26450. * into `array`.
  26451. * @example
  26452. *
  26453. * _.sortedIndex([30, 50], 40);
  26454. * // => 1
  26455. */
  26456. function sortedIndex(array, value) {
  26457. return baseSortedIndex(array, value);
  26458. }
  26459. /**
  26460. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  26461. * which is invoked for `value` and each element of `array` to compute their
  26462. * sort ranking. The iteratee is invoked with one argument: (value).
  26463. *
  26464. * @static
  26465. * @memberOf _
  26466. * @since 4.0.0
  26467. * @category Array
  26468. * @param {Array} array The sorted array to inspect.
  26469. * @param {*} value The value to evaluate.
  26470. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  26471. * @returns {number} Returns the index at which `value` should be inserted
  26472. * into `array`.
  26473. * @example
  26474. *
  26475. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  26476. *
  26477. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  26478. * // => 0
  26479. *
  26480. * // The `_.property` iteratee shorthand.
  26481. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  26482. * // => 0
  26483. */
  26484. function sortedIndexBy(array, value, iteratee) {
  26485. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  26486. }
  26487. /**
  26488. * This method is like `_.indexOf` except that it performs a binary
  26489. * search on a sorted `array`.
  26490. *
  26491. * @static
  26492. * @memberOf _
  26493. * @since 4.0.0
  26494. * @category Array
  26495. * @param {Array} array The array to inspect.
  26496. * @param {*} value The value to search for.
  26497. * @returns {number} Returns the index of the matched value, else `-1`.
  26498. * @example
  26499. *
  26500. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  26501. * // => 1
  26502. */
  26503. function sortedIndexOf(array, value) {
  26504. var length = array == null ? 0 : array.length;
  26505. if (length) {
  26506. var index = baseSortedIndex(array, value);
  26507. if (index < length && eq(array[index], value)) {
  26508. return index;
  26509. }
  26510. }
  26511. return -1;
  26512. }
  26513. /**
  26514. * This method is like `_.sortedIndex` except that it returns the highest
  26515. * index at which `value` should be inserted into `array` in order to
  26516. * maintain its sort order.
  26517. *
  26518. * @static
  26519. * @memberOf _
  26520. * @since 3.0.0
  26521. * @category Array
  26522. * @param {Array} array The sorted array to inspect.
  26523. * @param {*} value The value to evaluate.
  26524. * @returns {number} Returns the index at which `value` should be inserted
  26525. * into `array`.
  26526. * @example
  26527. *
  26528. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  26529. * // => 4
  26530. */
  26531. function sortedLastIndex(array, value) {
  26532. return baseSortedIndex(array, value, true);
  26533. }
  26534. /**
  26535. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  26536. * which is invoked for `value` and each element of `array` to compute their
  26537. * sort ranking. The iteratee is invoked with one argument: (value).
  26538. *
  26539. * @static
  26540. * @memberOf _
  26541. * @since 4.0.0
  26542. * @category Array
  26543. * @param {Array} array The sorted array to inspect.
  26544. * @param {*} value The value to evaluate.
  26545. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  26546. * @returns {number} Returns the index at which `value` should be inserted
  26547. * into `array`.
  26548. * @example
  26549. *
  26550. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  26551. *
  26552. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  26553. * // => 1
  26554. *
  26555. * // The `_.property` iteratee shorthand.
  26556. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  26557. * // => 1
  26558. */
  26559. function sortedLastIndexBy(array, value, iteratee) {
  26560. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  26561. }
  26562. /**
  26563. * This method is like `_.lastIndexOf` except that it performs a binary
  26564. * search on a sorted `array`.
  26565. *
  26566. * @static
  26567. * @memberOf _
  26568. * @since 4.0.0
  26569. * @category Array
  26570. * @param {Array} array The array to inspect.
  26571. * @param {*} value The value to search for.
  26572. * @returns {number} Returns the index of the matched value, else `-1`.
  26573. * @example
  26574. *
  26575. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  26576. * // => 3
  26577. */
  26578. function sortedLastIndexOf(array, value) {
  26579. var length = array == null ? 0 : array.length;
  26580. if (length) {
  26581. var index = baseSortedIndex(array, value, true) - 1;
  26582. if (eq(array[index], value)) {
  26583. return index;
  26584. }
  26585. }
  26586. return -1;
  26587. }
  26588. /**
  26589. * This method is like `_.uniq` except that it's designed and optimized
  26590. * for sorted arrays.
  26591. *
  26592. * @static
  26593. * @memberOf _
  26594. * @since 4.0.0
  26595. * @category Array
  26596. * @param {Array} array The array to inspect.
  26597. * @returns {Array} Returns the new duplicate free array.
  26598. * @example
  26599. *
  26600. * _.sortedUniq([1, 1, 2]);
  26601. * // => [1, 2]
  26602. */
  26603. function sortedUniq(array) {
  26604. return (array && array.length)
  26605. ? baseSortedUniq(array)
  26606. : [];
  26607. }
  26608. /**
  26609. * This method is like `_.uniqBy` except that it's designed and optimized
  26610. * for sorted arrays.
  26611. *
  26612. * @static
  26613. * @memberOf _
  26614. * @since 4.0.0
  26615. * @category Array
  26616. * @param {Array} array The array to inspect.
  26617. * @param {Function} [iteratee] The iteratee invoked per element.
  26618. * @returns {Array} Returns the new duplicate free array.
  26619. * @example
  26620. *
  26621. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  26622. * // => [1.1, 2.3]
  26623. */
  26624. function sortedUniqBy(array, iteratee) {
  26625. return (array && array.length)
  26626. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  26627. : [];
  26628. }
  26629. /**
  26630. * Gets all but the first element of `array`.
  26631. *
  26632. * @static
  26633. * @memberOf _
  26634. * @since 4.0.0
  26635. * @category Array
  26636. * @param {Array} array The array to query.
  26637. * @returns {Array} Returns the slice of `array`.
  26638. * @example
  26639. *
  26640. * _.tail([1, 2, 3]);
  26641. * // => [2, 3]
  26642. */
  26643. function tail(array) {
  26644. var length = array == null ? 0 : array.length;
  26645. return length ? baseSlice(array, 1, length) : [];
  26646. }
  26647. /**
  26648. * Creates a slice of `array` with `n` elements taken from the beginning.
  26649. *
  26650. * @static
  26651. * @memberOf _
  26652. * @since 0.1.0
  26653. * @category Array
  26654. * @param {Array} array The array to query.
  26655. * @param {number} [n=1] The number of elements to take.
  26656. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  26657. * @returns {Array} Returns the slice of `array`.
  26658. * @example
  26659. *
  26660. * _.take([1, 2, 3]);
  26661. * // => [1]
  26662. *
  26663. * _.take([1, 2, 3], 2);
  26664. * // => [1, 2]
  26665. *
  26666. * _.take([1, 2, 3], 5);
  26667. * // => [1, 2, 3]
  26668. *
  26669. * _.take([1, 2, 3], 0);
  26670. * // => []
  26671. */
  26672. function take(array, n, guard) {
  26673. if (!(array && array.length)) {
  26674. return [];
  26675. }
  26676. n = (guard || n === undefined) ? 1 : toInteger(n);
  26677. return baseSlice(array, 0, n < 0 ? 0 : n);
  26678. }
  26679. /**
  26680. * Creates a slice of `array` with `n` elements taken from the end.
  26681. *
  26682. * @static
  26683. * @memberOf _
  26684. * @since 3.0.0
  26685. * @category Array
  26686. * @param {Array} array The array to query.
  26687. * @param {number} [n=1] The number of elements to take.
  26688. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  26689. * @returns {Array} Returns the slice of `array`.
  26690. * @example
  26691. *
  26692. * _.takeRight([1, 2, 3]);
  26693. * // => [3]
  26694. *
  26695. * _.takeRight([1, 2, 3], 2);
  26696. * // => [2, 3]
  26697. *
  26698. * _.takeRight([1, 2, 3], 5);
  26699. * // => [1, 2, 3]
  26700. *
  26701. * _.takeRight([1, 2, 3], 0);
  26702. * // => []
  26703. */
  26704. function takeRight(array, n, guard) {
  26705. var length = array == null ? 0 : array.length;
  26706. if (!length) {
  26707. return [];
  26708. }
  26709. n = (guard || n === undefined) ? 1 : toInteger(n);
  26710. n = length - n;
  26711. return baseSlice(array, n < 0 ? 0 : n, length);
  26712. }
  26713. /**
  26714. * Creates a slice of `array` with elements taken from the end. Elements are
  26715. * taken until `predicate` returns falsey. The predicate is invoked with
  26716. * three arguments: (value, index, array).
  26717. *
  26718. * @static
  26719. * @memberOf _
  26720. * @since 3.0.0
  26721. * @category Array
  26722. * @param {Array} array The array to query.
  26723. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  26724. * @returns {Array} Returns the slice of `array`.
  26725. * @example
  26726. *
  26727. * var users = [
  26728. * { 'user': 'barney', 'active': true },
  26729. * { 'user': 'fred', 'active': false },
  26730. * { 'user': 'pebbles', 'active': false }
  26731. * ];
  26732. *
  26733. * _.takeRightWhile(users, function(o) { return !o.active; });
  26734. * // => objects for ['fred', 'pebbles']
  26735. *
  26736. * // The `_.matches` iteratee shorthand.
  26737. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  26738. * // => objects for ['pebbles']
  26739. *
  26740. * // The `_.matchesProperty` iteratee shorthand.
  26741. * _.takeRightWhile(users, ['active', false]);
  26742. * // => objects for ['fred', 'pebbles']
  26743. *
  26744. * // The `_.property` iteratee shorthand.
  26745. * _.takeRightWhile(users, 'active');
  26746. * // => []
  26747. */
  26748. function takeRightWhile(array, predicate) {
  26749. return (array && array.length)
  26750. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  26751. : [];
  26752. }
  26753. /**
  26754. * Creates a slice of `array` with elements taken from the beginning. Elements
  26755. * are taken until `predicate` returns falsey. The predicate is invoked with
  26756. * three arguments: (value, index, array).
  26757. *
  26758. * @static
  26759. * @memberOf _
  26760. * @since 3.0.0
  26761. * @category Array
  26762. * @param {Array} array The array to query.
  26763. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  26764. * @returns {Array} Returns the slice of `array`.
  26765. * @example
  26766. *
  26767. * var users = [
  26768. * { 'user': 'barney', 'active': false },
  26769. * { 'user': 'fred', 'active': false },
  26770. * { 'user': 'pebbles', 'active': true }
  26771. * ];
  26772. *
  26773. * _.takeWhile(users, function(o) { return !o.active; });
  26774. * // => objects for ['barney', 'fred']
  26775. *
  26776. * // The `_.matches` iteratee shorthand.
  26777. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  26778. * // => objects for ['barney']
  26779. *
  26780. * // The `_.matchesProperty` iteratee shorthand.
  26781. * _.takeWhile(users, ['active', false]);
  26782. * // => objects for ['barney', 'fred']
  26783. *
  26784. * // The `_.property` iteratee shorthand.
  26785. * _.takeWhile(users, 'active');
  26786. * // => []
  26787. */
  26788. function takeWhile(array, predicate) {
  26789. return (array && array.length)
  26790. ? baseWhile(array, getIteratee(predicate, 3))
  26791. : [];
  26792. }
  26793. /**
  26794. * Creates an array of unique values, in order, from all given arrays using
  26795. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  26796. * for equality comparisons.
  26797. *
  26798. * @static
  26799. * @memberOf _
  26800. * @since 0.1.0
  26801. * @category Array
  26802. * @param {...Array} [arrays] The arrays to inspect.
  26803. * @returns {Array} Returns the new array of combined values.
  26804. * @example
  26805. *
  26806. * _.union([2], [1, 2]);
  26807. * // => [2, 1]
  26808. */
  26809. var union = baseRest(function(arrays) {
  26810. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  26811. });
  26812. /**
  26813. * This method is like `_.union` except that it accepts `iteratee` which is
  26814. * invoked for each element of each `arrays` to generate the criterion by
  26815. * which uniqueness is computed. Result values are chosen from the first
  26816. * array in which the value occurs. The iteratee is invoked with one argument:
  26817. * (value).
  26818. *
  26819. * @static
  26820. * @memberOf _
  26821. * @since 4.0.0
  26822. * @category Array
  26823. * @param {...Array} [arrays] The arrays to inspect.
  26824. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  26825. * @returns {Array} Returns the new array of combined values.
  26826. * @example
  26827. *
  26828. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  26829. * // => [2.1, 1.2]
  26830. *
  26831. * // The `_.property` iteratee shorthand.
  26832. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  26833. * // => [{ 'x': 1 }, { 'x': 2 }]
  26834. */
  26835. var unionBy = baseRest(function(arrays) {
  26836. var iteratee = last(arrays);
  26837. if (isArrayLikeObject(iteratee)) {
  26838. iteratee = undefined;
  26839. }
  26840. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  26841. });
  26842. /**
  26843. * This method is like `_.union` except that it accepts `comparator` which
  26844. * is invoked to compare elements of `arrays`. Result values are chosen from
  26845. * the first array in which the value occurs. The comparator is invoked
  26846. * with two arguments: (arrVal, othVal).
  26847. *
  26848. * @static
  26849. * @memberOf _
  26850. * @since 4.0.0
  26851. * @category Array
  26852. * @param {...Array} [arrays] The arrays to inspect.
  26853. * @param {Function} [comparator] The comparator invoked per element.
  26854. * @returns {Array} Returns the new array of combined values.
  26855. * @example
  26856. *
  26857. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  26858. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  26859. *
  26860. * _.unionWith(objects, others, _.isEqual);
  26861. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  26862. */
  26863. var unionWith = baseRest(function(arrays) {
  26864. var comparator = last(arrays);
  26865. comparator = typeof comparator == 'function' ? comparator : undefined;
  26866. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  26867. });
  26868. /**
  26869. * Creates a duplicate-free version of an array, using
  26870. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  26871. * for equality comparisons, in which only the first occurrence of each element
  26872. * is kept. The order of result values is determined by the order they occur
  26873. * in the array.
  26874. *
  26875. * @static
  26876. * @memberOf _
  26877. * @since 0.1.0
  26878. * @category Array
  26879. * @param {Array} array The array to inspect.
  26880. * @returns {Array} Returns the new duplicate free array.
  26881. * @example
  26882. *
  26883. * _.uniq([2, 1, 2]);
  26884. * // => [2, 1]
  26885. */
  26886. function uniq(array) {
  26887. return (array && array.length) ? baseUniq(array) : [];
  26888. }
  26889. /**
  26890. * This method is like `_.uniq` except that it accepts `iteratee` which is
  26891. * invoked for each element in `array` to generate the criterion by which
  26892. * uniqueness is computed. The order of result values is determined by the
  26893. * order they occur in the array. The iteratee is invoked with one argument:
  26894. * (value).
  26895. *
  26896. * @static
  26897. * @memberOf _
  26898. * @since 4.0.0
  26899. * @category Array
  26900. * @param {Array} array The array to inspect.
  26901. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  26902. * @returns {Array} Returns the new duplicate free array.
  26903. * @example
  26904. *
  26905. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  26906. * // => [2.1, 1.2]
  26907. *
  26908. * // The `_.property` iteratee shorthand.
  26909. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  26910. * // => [{ 'x': 1 }, { 'x': 2 }]
  26911. */
  26912. function uniqBy(array, iteratee) {
  26913. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  26914. }
  26915. /**
  26916. * This method is like `_.uniq` except that it accepts `comparator` which
  26917. * is invoked to compare elements of `array`. The order of result values is
  26918. * determined by the order they occur in the array.The comparator is invoked
  26919. * with two arguments: (arrVal, othVal).
  26920. *
  26921. * @static
  26922. * @memberOf _
  26923. * @since 4.0.0
  26924. * @category Array
  26925. * @param {Array} array The array to inspect.
  26926. * @param {Function} [comparator] The comparator invoked per element.
  26927. * @returns {Array} Returns the new duplicate free array.
  26928. * @example
  26929. *
  26930. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  26931. *
  26932. * _.uniqWith(objects, _.isEqual);
  26933. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  26934. */
  26935. function uniqWith(array, comparator) {
  26936. comparator = typeof comparator == 'function' ? comparator : undefined;
  26937. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  26938. }
  26939. /**
  26940. * This method is like `_.zip` except that it accepts an array of grouped
  26941. * elements and creates an array regrouping the elements to their pre-zip
  26942. * configuration.
  26943. *
  26944. * @static
  26945. * @memberOf _
  26946. * @since 1.2.0
  26947. * @category Array
  26948. * @param {Array} array The array of grouped elements to process.
  26949. * @returns {Array} Returns the new array of regrouped elements.
  26950. * @example
  26951. *
  26952. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  26953. * // => [['a', 1, true], ['b', 2, false]]
  26954. *
  26955. * _.unzip(zipped);
  26956. * // => [['a', 'b'], [1, 2], [true, false]]
  26957. */
  26958. function unzip(array) {
  26959. if (!(array && array.length)) {
  26960. return [];
  26961. }
  26962. var length = 0;
  26963. array = arrayFilter(array, function(group) {
  26964. if (isArrayLikeObject(group)) {
  26965. length = nativeMax(group.length, length);
  26966. return true;
  26967. }
  26968. });
  26969. return baseTimes(length, function(index) {
  26970. return arrayMap(array, baseProperty(index));
  26971. });
  26972. }
  26973. /**
  26974. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  26975. * how regrouped values should be combined. The iteratee is invoked with the
  26976. * elements of each group: (...group).
  26977. *
  26978. * @static
  26979. * @memberOf _
  26980. * @since 3.8.0
  26981. * @category Array
  26982. * @param {Array} array The array of grouped elements to process.
  26983. * @param {Function} [iteratee=_.identity] The function to combine
  26984. * regrouped values.
  26985. * @returns {Array} Returns the new array of regrouped elements.
  26986. * @example
  26987. *
  26988. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  26989. * // => [[1, 10, 100], [2, 20, 200]]
  26990. *
  26991. * _.unzipWith(zipped, _.add);
  26992. * // => [3, 30, 300]
  26993. */
  26994. function unzipWith(array, iteratee) {
  26995. if (!(array && array.length)) {
  26996. return [];
  26997. }
  26998. var result = unzip(array);
  26999. if (iteratee == null) {
  27000. return result;
  27001. }
  27002. return arrayMap(result, function(group) {
  27003. return apply(iteratee, undefined, group);
  27004. });
  27005. }
  27006. /**
  27007. * Creates an array excluding all given values using
  27008. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  27009. * for equality comparisons.
  27010. *
  27011. * **Note:** Unlike `_.pull`, this method returns a new array.
  27012. *
  27013. * @static
  27014. * @memberOf _
  27015. * @since 0.1.0
  27016. * @category Array
  27017. * @param {Array} array The array to inspect.
  27018. * @param {...*} [values] The values to exclude.
  27019. * @returns {Array} Returns the new array of filtered values.
  27020. * @see _.difference, _.xor
  27021. * @example
  27022. *
  27023. * _.without([2, 1, 2, 3], 1, 2);
  27024. * // => [3]
  27025. */
  27026. var without = baseRest(function(array, values) {
  27027. return isArrayLikeObject(array)
  27028. ? baseDifference(array, values)
  27029. : [];
  27030. });
  27031. /**
  27032. * Creates an array of unique values that is the
  27033. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  27034. * of the given arrays. The order of result values is determined by the order
  27035. * they occur in the arrays.
  27036. *
  27037. * @static
  27038. * @memberOf _
  27039. * @since 2.4.0
  27040. * @category Array
  27041. * @param {...Array} [arrays] The arrays to inspect.
  27042. * @returns {Array} Returns the new array of filtered values.
  27043. * @see _.difference, _.without
  27044. * @example
  27045. *
  27046. * _.xor([2, 1], [2, 3]);
  27047. * // => [1, 3]
  27048. */
  27049. var xor = baseRest(function(arrays) {
  27050. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  27051. });
  27052. /**
  27053. * This method is like `_.xor` except that it accepts `iteratee` which is
  27054. * invoked for each element of each `arrays` to generate the criterion by
  27055. * which by which they're compared. The order of result values is determined
  27056. * by the order they occur in the arrays. The iteratee is invoked with one
  27057. * argument: (value).
  27058. *
  27059. * @static
  27060. * @memberOf _
  27061. * @since 4.0.0
  27062. * @category Array
  27063. * @param {...Array} [arrays] The arrays to inspect.
  27064. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  27065. * @returns {Array} Returns the new array of filtered values.
  27066. * @example
  27067. *
  27068. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  27069. * // => [1.2, 3.4]
  27070. *
  27071. * // The `_.property` iteratee shorthand.
  27072. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  27073. * // => [{ 'x': 2 }]
  27074. */
  27075. var xorBy = baseRest(function(arrays) {
  27076. var iteratee = last(arrays);
  27077. if (isArrayLikeObject(iteratee)) {
  27078. iteratee = undefined;
  27079. }
  27080. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  27081. });
  27082. /**
  27083. * This method is like `_.xor` except that it accepts `comparator` which is
  27084. * invoked to compare elements of `arrays`. The order of result values is
  27085. * determined by the order they occur in the arrays. The comparator is invoked
  27086. * with two arguments: (arrVal, othVal).
  27087. *
  27088. * @static
  27089. * @memberOf _
  27090. * @since 4.0.0
  27091. * @category Array
  27092. * @param {...Array} [arrays] The arrays to inspect.
  27093. * @param {Function} [comparator] The comparator invoked per element.
  27094. * @returns {Array} Returns the new array of filtered values.
  27095. * @example
  27096. *
  27097. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  27098. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  27099. *
  27100. * _.xorWith(objects, others, _.isEqual);
  27101. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  27102. */
  27103. var xorWith = baseRest(function(arrays) {
  27104. var comparator = last(arrays);
  27105. comparator = typeof comparator == 'function' ? comparator : undefined;
  27106. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  27107. });
  27108. /**
  27109. * Creates an array of grouped elements, the first of which contains the
  27110. * first elements of the given arrays, the second of which contains the
  27111. * second elements of the given arrays, and so on.
  27112. *
  27113. * @static
  27114. * @memberOf _
  27115. * @since 0.1.0
  27116. * @category Array
  27117. * @param {...Array} [arrays] The arrays to process.
  27118. * @returns {Array} Returns the new array of grouped elements.
  27119. * @example
  27120. *
  27121. * _.zip(['a', 'b'], [1, 2], [true, false]);
  27122. * // => [['a', 1, true], ['b', 2, false]]
  27123. */
  27124. var zip = baseRest(unzip);
  27125. /**
  27126. * This method is like `_.fromPairs` except that it accepts two arrays,
  27127. * one of property identifiers and one of corresponding values.
  27128. *
  27129. * @static
  27130. * @memberOf _
  27131. * @since 0.4.0
  27132. * @category Array
  27133. * @param {Array} [props=[]] The property identifiers.
  27134. * @param {Array} [values=[]] The property values.
  27135. * @returns {Object} Returns the new object.
  27136. * @example
  27137. *
  27138. * _.zipObject(['a', 'b'], [1, 2]);
  27139. * // => { 'a': 1, 'b': 2 }
  27140. */
  27141. function zipObject(props, values) {
  27142. return baseZipObject(props || [], values || [], assignValue);
  27143. }
  27144. /**
  27145. * This method is like `_.zipObject` except that it supports property paths.
  27146. *
  27147. * @static
  27148. * @memberOf _
  27149. * @since 4.1.0
  27150. * @category Array
  27151. * @param {Array} [props=[]] The property identifiers.
  27152. * @param {Array} [values=[]] The property values.
  27153. * @returns {Object} Returns the new object.
  27154. * @example
  27155. *
  27156. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  27157. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  27158. */
  27159. function zipObjectDeep(props, values) {
  27160. return baseZipObject(props || [], values || [], baseSet);
  27161. }
  27162. /**
  27163. * This method is like `_.zip` except that it accepts `iteratee` to specify
  27164. * how grouped values should be combined. The iteratee is invoked with the
  27165. * elements of each group: (...group).
  27166. *
  27167. * @static
  27168. * @memberOf _
  27169. * @since 3.8.0
  27170. * @category Array
  27171. * @param {...Array} [arrays] The arrays to process.
  27172. * @param {Function} [iteratee=_.identity] The function to combine
  27173. * grouped values.
  27174. * @returns {Array} Returns the new array of grouped elements.
  27175. * @example
  27176. *
  27177. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  27178. * return a + b + c;
  27179. * });
  27180. * // => [111, 222]
  27181. */
  27182. var zipWith = baseRest(function(arrays) {
  27183. var length = arrays.length,
  27184. iteratee = length > 1 ? arrays[length - 1] : undefined;
  27185. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  27186. return unzipWith(arrays, iteratee);
  27187. });
  27188. /*------------------------------------------------------------------------*/
  27189. /**
  27190. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  27191. * chain sequences enabled. The result of such sequences must be unwrapped
  27192. * with `_#value`.
  27193. *
  27194. * @static
  27195. * @memberOf _
  27196. * @since 1.3.0
  27197. * @category Seq
  27198. * @param {*} value The value to wrap.
  27199. * @returns {Object} Returns the new `lodash` wrapper instance.
  27200. * @example
  27201. *
  27202. * var users = [
  27203. * { 'user': 'barney', 'age': 36 },
  27204. * { 'user': 'fred', 'age': 40 },
  27205. * { 'user': 'pebbles', 'age': 1 }
  27206. * ];
  27207. *
  27208. * var youngest = _
  27209. * .chain(users)
  27210. * .sortBy('age')
  27211. * .map(function(o) {
  27212. * return o.user + ' is ' + o.age;
  27213. * })
  27214. * .head()
  27215. * .value();
  27216. * // => 'pebbles is 1'
  27217. */
  27218. function chain(value) {
  27219. var result = lodash(value);
  27220. result.__chain__ = true;
  27221. return result;
  27222. }
  27223. /**
  27224. * This method invokes `interceptor` and returns `value`. The interceptor
  27225. * is invoked with one argument; (value). The purpose of this method is to
  27226. * "tap into" a method chain sequence in order to modify intermediate results.
  27227. *
  27228. * @static
  27229. * @memberOf _
  27230. * @since 0.1.0
  27231. * @category Seq
  27232. * @param {*} value The value to provide to `interceptor`.
  27233. * @param {Function} interceptor The function to invoke.
  27234. * @returns {*} Returns `value`.
  27235. * @example
  27236. *
  27237. * _([1, 2, 3])
  27238. * .tap(function(array) {
  27239. * // Mutate input array.
  27240. * array.pop();
  27241. * })
  27242. * .reverse()
  27243. * .value();
  27244. * // => [2, 1]
  27245. */
  27246. function tap(value, interceptor) {
  27247. interceptor(value);
  27248. return value;
  27249. }
  27250. /**
  27251. * This method is like `_.tap` except that it returns the result of `interceptor`.
  27252. * The purpose of this method is to "pass thru" values replacing intermediate
  27253. * results in a method chain sequence.
  27254. *
  27255. * @static
  27256. * @memberOf _
  27257. * @since 3.0.0
  27258. * @category Seq
  27259. * @param {*} value The value to provide to `interceptor`.
  27260. * @param {Function} interceptor The function to invoke.
  27261. * @returns {*} Returns the result of `interceptor`.
  27262. * @example
  27263. *
  27264. * _(' abc ')
  27265. * .chain()
  27266. * .trim()
  27267. * .thru(function(value) {
  27268. * return [value];
  27269. * })
  27270. * .value();
  27271. * // => ['abc']
  27272. */
  27273. function thru(value, interceptor) {
  27274. return interceptor(value);
  27275. }
  27276. /**
  27277. * This method is the wrapper version of `_.at`.
  27278. *
  27279. * @name at
  27280. * @memberOf _
  27281. * @since 1.0.0
  27282. * @category Seq
  27283. * @param {...(string|string[])} [paths] The property paths to pick.
  27284. * @returns {Object} Returns the new `lodash` wrapper instance.
  27285. * @example
  27286. *
  27287. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  27288. *
  27289. * _(object).at(['a[0].b.c', 'a[1]']).value();
  27290. * // => [3, 4]
  27291. */
  27292. var wrapperAt = flatRest(function(paths) {
  27293. var length = paths.length,
  27294. start = length ? paths[0] : 0,
  27295. value = this.__wrapped__,
  27296. interceptor = function(object) { return baseAt(object, paths); };
  27297. if (length > 1 || this.__actions__.length ||
  27298. !(value instanceof LazyWrapper) || !isIndex(start)) {
  27299. return this.thru(interceptor);
  27300. }
  27301. value = value.slice(start, +start + (length ? 1 : 0));
  27302. value.__actions__.push({
  27303. 'func': thru,
  27304. 'args': [interceptor],
  27305. 'thisArg': undefined
  27306. });
  27307. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  27308. if (length && !array.length) {
  27309. array.push(undefined);
  27310. }
  27311. return array;
  27312. });
  27313. });
  27314. /**
  27315. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  27316. *
  27317. * @name chain
  27318. * @memberOf _
  27319. * @since 0.1.0
  27320. * @category Seq
  27321. * @returns {Object} Returns the new `lodash` wrapper instance.
  27322. * @example
  27323. *
  27324. * var users = [
  27325. * { 'user': 'barney', 'age': 36 },
  27326. * { 'user': 'fred', 'age': 40 }
  27327. * ];
  27328. *
  27329. * // A sequence without explicit chaining.
  27330. * _(users).head();
  27331. * // => { 'user': 'barney', 'age': 36 }
  27332. *
  27333. * // A sequence with explicit chaining.
  27334. * _(users)
  27335. * .chain()
  27336. * .head()
  27337. * .pick('user')
  27338. * .value();
  27339. * // => { 'user': 'barney' }
  27340. */
  27341. function wrapperChain() {
  27342. return chain(this);
  27343. }
  27344. /**
  27345. * Executes the chain sequence and returns the wrapped result.
  27346. *
  27347. * @name commit
  27348. * @memberOf _
  27349. * @since 3.2.0
  27350. * @category Seq
  27351. * @returns {Object} Returns the new `lodash` wrapper instance.
  27352. * @example
  27353. *
  27354. * var array = [1, 2];
  27355. * var wrapped = _(array).push(3);
  27356. *
  27357. * console.log(array);
  27358. * // => [1, 2]
  27359. *
  27360. * wrapped = wrapped.commit();
  27361. * console.log(array);
  27362. * // => [1, 2, 3]
  27363. *
  27364. * wrapped.last();
  27365. * // => 3
  27366. *
  27367. * console.log(array);
  27368. * // => [1, 2, 3]
  27369. */
  27370. function wrapperCommit() {
  27371. return new LodashWrapper(this.value(), this.__chain__);
  27372. }
  27373. /**
  27374. * Gets the next value on a wrapped object following the
  27375. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  27376. *
  27377. * @name next
  27378. * @memberOf _
  27379. * @since 4.0.0
  27380. * @category Seq
  27381. * @returns {Object} Returns the next iterator value.
  27382. * @example
  27383. *
  27384. * var wrapped = _([1, 2]);
  27385. *
  27386. * wrapped.next();
  27387. * // => { 'done': false, 'value': 1 }
  27388. *
  27389. * wrapped.next();
  27390. * // => { 'done': false, 'value': 2 }
  27391. *
  27392. * wrapped.next();
  27393. * // => { 'done': true, 'value': undefined }
  27394. */
  27395. function wrapperNext() {
  27396. if (this.__values__ === undefined) {
  27397. this.__values__ = toArray(this.value());
  27398. }
  27399. var done = this.__index__ >= this.__values__.length,
  27400. value = done ? undefined : this.__values__[this.__index__++];
  27401. return { 'done': done, 'value': value };
  27402. }
  27403. /**
  27404. * Enables the wrapper to be iterable.
  27405. *
  27406. * @name Symbol.iterator
  27407. * @memberOf _
  27408. * @since 4.0.0
  27409. * @category Seq
  27410. * @returns {Object} Returns the wrapper object.
  27411. * @example
  27412. *
  27413. * var wrapped = _([1, 2]);
  27414. *
  27415. * wrapped[Symbol.iterator]() === wrapped;
  27416. * // => true
  27417. *
  27418. * Array.from(wrapped);
  27419. * // => [1, 2]
  27420. */
  27421. function wrapperToIterator() {
  27422. return this;
  27423. }
  27424. /**
  27425. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  27426. *
  27427. * @name plant
  27428. * @memberOf _
  27429. * @since 3.2.0
  27430. * @category Seq
  27431. * @param {*} value The value to plant.
  27432. * @returns {Object} Returns the new `lodash` wrapper instance.
  27433. * @example
  27434. *
  27435. * function square(n) {
  27436. * return n * n;
  27437. * }
  27438. *
  27439. * var wrapped = _([1, 2]).map(square);
  27440. * var other = wrapped.plant([3, 4]);
  27441. *
  27442. * other.value();
  27443. * // => [9, 16]
  27444. *
  27445. * wrapped.value();
  27446. * // => [1, 4]
  27447. */
  27448. function wrapperPlant(value) {
  27449. var result,
  27450. parent = this;
  27451. while (parent instanceof baseLodash) {
  27452. var clone = wrapperClone(parent);
  27453. clone.__index__ = 0;
  27454. clone.__values__ = undefined;
  27455. if (result) {
  27456. previous.__wrapped__ = clone;
  27457. } else {
  27458. result = clone;
  27459. }
  27460. var previous = clone;
  27461. parent = parent.__wrapped__;
  27462. }
  27463. previous.__wrapped__ = value;
  27464. return result;
  27465. }
  27466. /**
  27467. * This method is the wrapper version of `_.reverse`.
  27468. *
  27469. * **Note:** This method mutates the wrapped array.
  27470. *
  27471. * @name reverse
  27472. * @memberOf _
  27473. * @since 0.1.0
  27474. * @category Seq
  27475. * @returns {Object} Returns the new `lodash` wrapper instance.
  27476. * @example
  27477. *
  27478. * var array = [1, 2, 3];
  27479. *
  27480. * _(array).reverse().value()
  27481. * // => [3, 2, 1]
  27482. *
  27483. * console.log(array);
  27484. * // => [3, 2, 1]
  27485. */
  27486. function wrapperReverse() {
  27487. var value = this.__wrapped__;
  27488. if (value instanceof LazyWrapper) {
  27489. var wrapped = value;
  27490. if (this.__actions__.length) {
  27491. wrapped = new LazyWrapper(this);
  27492. }
  27493. wrapped = wrapped.reverse();
  27494. wrapped.__actions__.push({
  27495. 'func': thru,
  27496. 'args': [reverse],
  27497. 'thisArg': undefined
  27498. });
  27499. return new LodashWrapper(wrapped, this.__chain__);
  27500. }
  27501. return this.thru(reverse);
  27502. }
  27503. /**
  27504. * Executes the chain sequence to resolve the unwrapped value.
  27505. *
  27506. * @name value
  27507. * @memberOf _
  27508. * @since 0.1.0
  27509. * @alias toJSON, valueOf
  27510. * @category Seq
  27511. * @returns {*} Returns the resolved unwrapped value.
  27512. * @example
  27513. *
  27514. * _([1, 2, 3]).value();
  27515. * // => [1, 2, 3]
  27516. */
  27517. function wrapperValue() {
  27518. return baseWrapperValue(this.__wrapped__, this.__actions__);
  27519. }
  27520. /*------------------------------------------------------------------------*/
  27521. /**
  27522. * Creates an object composed of keys generated from the results of running
  27523. * each element of `collection` thru `iteratee`. The corresponding value of
  27524. * each key is the number of times the key was returned by `iteratee`. The
  27525. * iteratee is invoked with one argument: (value).
  27526. *
  27527. * @static
  27528. * @memberOf _
  27529. * @since 0.5.0
  27530. * @category Collection
  27531. * @param {Array|Object} collection The collection to iterate over.
  27532. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  27533. * @returns {Object} Returns the composed aggregate object.
  27534. * @example
  27535. *
  27536. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  27537. * // => { '4': 1, '6': 2 }
  27538. *
  27539. * // The `_.property` iteratee shorthand.
  27540. * _.countBy(['one', 'two', 'three'], 'length');
  27541. * // => { '3': 2, '5': 1 }
  27542. */
  27543. var countBy = createAggregator(function(result, value, key) {
  27544. if (hasOwnProperty.call(result, key)) {
  27545. ++result[key];
  27546. } else {
  27547. baseAssignValue(result, key, 1);
  27548. }
  27549. });
  27550. /**
  27551. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  27552. * Iteration is stopped once `predicate` returns falsey. The predicate is
  27553. * invoked with three arguments: (value, index|key, collection).
  27554. *
  27555. * **Note:** This method returns `true` for
  27556. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  27557. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  27558. * elements of empty collections.
  27559. *
  27560. * @static
  27561. * @memberOf _
  27562. * @since 0.1.0
  27563. * @category Collection
  27564. * @param {Array|Object} collection The collection to iterate over.
  27565. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  27566. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  27567. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  27568. * else `false`.
  27569. * @example
  27570. *
  27571. * _.every([true, 1, null, 'yes'], Boolean);
  27572. * // => false
  27573. *
  27574. * var users = [
  27575. * { 'user': 'barney', 'age': 36, 'active': false },
  27576. * { 'user': 'fred', 'age': 40, 'active': false }
  27577. * ];
  27578. *
  27579. * // The `_.matches` iteratee shorthand.
  27580. * _.every(users, { 'user': 'barney', 'active': false });
  27581. * // => false
  27582. *
  27583. * // The `_.matchesProperty` iteratee shorthand.
  27584. * _.every(users, ['active', false]);
  27585. * // => true
  27586. *
  27587. * // The `_.property` iteratee shorthand.
  27588. * _.every(users, 'active');
  27589. * // => false
  27590. */
  27591. function every(collection, predicate, guard) {
  27592. var func = isArray(collection) ? arrayEvery : baseEvery;
  27593. if (guard && isIterateeCall(collection, predicate, guard)) {
  27594. predicate = undefined;
  27595. }
  27596. return func(collection, getIteratee(predicate, 3));
  27597. }
  27598. /**
  27599. * Iterates over elements of `collection`, returning an array of all elements
  27600. * `predicate` returns truthy for. The predicate is invoked with three
  27601. * arguments: (value, index|key, collection).
  27602. *
  27603. * **Note:** Unlike `_.remove`, this method returns a new array.
  27604. *
  27605. * @static
  27606. * @memberOf _
  27607. * @since 0.1.0
  27608. * @category Collection
  27609. * @param {Array|Object} collection The collection to iterate over.
  27610. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  27611. * @returns {Array} Returns the new filtered array.
  27612. * @see _.reject
  27613. * @example
  27614. *
  27615. * var users = [
  27616. * { 'user': 'barney', 'age': 36, 'active': true },
  27617. * { 'user': 'fred', 'age': 40, 'active': false }
  27618. * ];
  27619. *
  27620. * _.filter(users, function(o) { return !o.active; });
  27621. * // => objects for ['fred']
  27622. *
  27623. * // The `_.matches` iteratee shorthand.
  27624. * _.filter(users, { 'age': 36, 'active': true });
  27625. * // => objects for ['barney']
  27626. *
  27627. * // The `_.matchesProperty` iteratee shorthand.
  27628. * _.filter(users, ['active', false]);
  27629. * // => objects for ['fred']
  27630. *
  27631. * // The `_.property` iteratee shorthand.
  27632. * _.filter(users, 'active');
  27633. * // => objects for ['barney']
  27634. */
  27635. function filter(collection, predicate) {
  27636. var func = isArray(collection) ? arrayFilter : baseFilter;
  27637. return func(collection, getIteratee(predicate, 3));
  27638. }
  27639. /**
  27640. * Iterates over elements of `collection`, returning the first element
  27641. * `predicate` returns truthy for. The predicate is invoked with three
  27642. * arguments: (value, index|key, collection).
  27643. *
  27644. * @static
  27645. * @memberOf _
  27646. * @since 0.1.0
  27647. * @category Collection
  27648. * @param {Array|Object} collection The collection to inspect.
  27649. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  27650. * @param {number} [fromIndex=0] The index to search from.
  27651. * @returns {*} Returns the matched element, else `undefined`.
  27652. * @example
  27653. *
  27654. * var users = [
  27655. * { 'user': 'barney', 'age': 36, 'active': true },
  27656. * { 'user': 'fred', 'age': 40, 'active': false },
  27657. * { 'user': 'pebbles', 'age': 1, 'active': true }
  27658. * ];
  27659. *
  27660. * _.find(users, function(o) { return o.age < 40; });
  27661. * // => object for 'barney'
  27662. *
  27663. * // The `_.matches` iteratee shorthand.
  27664. * _.find(users, { 'age': 1, 'active': true });
  27665. * // => object for 'pebbles'
  27666. *
  27667. * // The `_.matchesProperty` iteratee shorthand.
  27668. * _.find(users, ['active', false]);
  27669. * // => object for 'fred'
  27670. *
  27671. * // The `_.property` iteratee shorthand.
  27672. * _.find(users, 'active');
  27673. * // => object for 'barney'
  27674. */
  27675. var find = createFind(findIndex);
  27676. /**
  27677. * This method is like `_.find` except that it iterates over elements of
  27678. * `collection` from right to left.
  27679. *
  27680. * @static
  27681. * @memberOf _
  27682. * @since 2.0.0
  27683. * @category Collection
  27684. * @param {Array|Object} collection The collection to inspect.
  27685. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  27686. * @param {number} [fromIndex=collection.length-1] The index to search from.
  27687. * @returns {*} Returns the matched element, else `undefined`.
  27688. * @example
  27689. *
  27690. * _.findLast([1, 2, 3, 4], function(n) {
  27691. * return n % 2 == 1;
  27692. * });
  27693. * // => 3
  27694. */
  27695. var findLast = createFind(findLastIndex);
  27696. /**
  27697. * Creates a flattened array of values by running each element in `collection`
  27698. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  27699. * with three arguments: (value, index|key, collection).
  27700. *
  27701. * @static
  27702. * @memberOf _
  27703. * @since 4.0.0
  27704. * @category Collection
  27705. * @param {Array|Object} collection The collection to iterate over.
  27706. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  27707. * @returns {Array} Returns the new flattened array.
  27708. * @example
  27709. *
  27710. * function duplicate(n) {
  27711. * return [n, n];
  27712. * }
  27713. *
  27714. * _.flatMap([1, 2], duplicate);
  27715. * // => [1, 1, 2, 2]
  27716. */
  27717. function flatMap(collection, iteratee) {
  27718. return baseFlatten(map(collection, iteratee), 1);
  27719. }
  27720. /**
  27721. * This method is like `_.flatMap` except that it recursively flattens the
  27722. * mapped results.
  27723. *
  27724. * @static
  27725. * @memberOf _
  27726. * @since 4.7.0
  27727. * @category Collection
  27728. * @param {Array|Object} collection The collection to iterate over.
  27729. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  27730. * @returns {Array} Returns the new flattened array.
  27731. * @example
  27732. *
  27733. * function duplicate(n) {
  27734. * return [[[n, n]]];
  27735. * }
  27736. *
  27737. * _.flatMapDeep([1, 2], duplicate);
  27738. * // => [1, 1, 2, 2]
  27739. */
  27740. function flatMapDeep(collection, iteratee) {
  27741. return baseFlatten(map(collection, iteratee), INFINITY);
  27742. }
  27743. /**
  27744. * This method is like `_.flatMap` except that it recursively flattens the
  27745. * mapped results up to `depth` times.
  27746. *
  27747. * @static
  27748. * @memberOf _
  27749. * @since 4.7.0
  27750. * @category Collection
  27751. * @param {Array|Object} collection The collection to iterate over.
  27752. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  27753. * @param {number} [depth=1] The maximum recursion depth.
  27754. * @returns {Array} Returns the new flattened array.
  27755. * @example
  27756. *
  27757. * function duplicate(n) {
  27758. * return [[[n, n]]];
  27759. * }
  27760. *
  27761. * _.flatMapDepth([1, 2], duplicate, 2);
  27762. * // => [[1, 1], [2, 2]]
  27763. */
  27764. function flatMapDepth(collection, iteratee, depth) {
  27765. depth = depth === undefined ? 1 : toInteger(depth);
  27766. return baseFlatten(map(collection, iteratee), depth);
  27767. }
  27768. /**
  27769. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  27770. * The iteratee is invoked with three arguments: (value, index|key, collection).
  27771. * Iteratee functions may exit iteration early by explicitly returning `false`.
  27772. *
  27773. * **Note:** As with other "Collections" methods, objects with a "length"
  27774. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  27775. * or `_.forOwn` for object iteration.
  27776. *
  27777. * @static
  27778. * @memberOf _
  27779. * @since 0.1.0
  27780. * @alias each
  27781. * @category Collection
  27782. * @param {Array|Object} collection The collection to iterate over.
  27783. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  27784. * @returns {Array|Object} Returns `collection`.
  27785. * @see _.forEachRight
  27786. * @example
  27787. *
  27788. * _.forEach([1, 2], function(value) {
  27789. * console.log(value);
  27790. * });
  27791. * // => Logs `1` then `2`.
  27792. *
  27793. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  27794. * console.log(key);
  27795. * });
  27796. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  27797. */
  27798. function forEach(collection, iteratee) {
  27799. var func = isArray(collection) ? arrayEach : baseEach;
  27800. return func(collection, getIteratee(iteratee, 3));
  27801. }
  27802. /**
  27803. * This method is like `_.forEach` except that it iterates over elements of
  27804. * `collection` from right to left.
  27805. *
  27806. * @static
  27807. * @memberOf _
  27808. * @since 2.0.0
  27809. * @alias eachRight
  27810. * @category Collection
  27811. * @param {Array|Object} collection The collection to iterate over.
  27812. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  27813. * @returns {Array|Object} Returns `collection`.
  27814. * @see _.forEach
  27815. * @example
  27816. *
  27817. * _.forEachRight([1, 2], function(value) {
  27818. * console.log(value);
  27819. * });
  27820. * // => Logs `2` then `1`.
  27821. */
  27822. function forEachRight(collection, iteratee) {
  27823. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  27824. return func(collection, getIteratee(iteratee, 3));
  27825. }
  27826. /**
  27827. * Creates an object composed of keys generated from the results of running
  27828. * each element of `collection` thru `iteratee`. The order of grouped values
  27829. * is determined by the order they occur in `collection`. The corresponding
  27830. * value of each key is an array of elements responsible for generating the
  27831. * key. The iteratee is invoked with one argument: (value).
  27832. *
  27833. * @static
  27834. * @memberOf _
  27835. * @since 0.1.0
  27836. * @category Collection
  27837. * @param {Array|Object} collection The collection to iterate over.
  27838. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  27839. * @returns {Object} Returns the composed aggregate object.
  27840. * @example
  27841. *
  27842. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  27843. * // => { '4': [4.2], '6': [6.1, 6.3] }
  27844. *
  27845. * // The `_.property` iteratee shorthand.
  27846. * _.groupBy(['one', 'two', 'three'], 'length');
  27847. * // => { '3': ['one', 'two'], '5': ['three'] }
  27848. */
  27849. var groupBy = createAggregator(function(result, value, key) {
  27850. if (hasOwnProperty.call(result, key)) {
  27851. result[key].push(value);
  27852. } else {
  27853. baseAssignValue(result, key, [value]);
  27854. }
  27855. });
  27856. /**
  27857. * Checks if `value` is in `collection`. If `collection` is a string, it's
  27858. * checked for a substring of `value`, otherwise
  27859. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  27860. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  27861. * the offset from the end of `collection`.
  27862. *
  27863. * @static
  27864. * @memberOf _
  27865. * @since 0.1.0
  27866. * @category Collection
  27867. * @param {Array|Object|string} collection The collection to inspect.
  27868. * @param {*} value The value to search for.
  27869. * @param {number} [fromIndex=0] The index to search from.
  27870. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  27871. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  27872. * @example
  27873. *
  27874. * _.includes([1, 2, 3], 1);
  27875. * // => true
  27876. *
  27877. * _.includes([1, 2, 3], 1, 2);
  27878. * // => false
  27879. *
  27880. * _.includes({ 'a': 1, 'b': 2 }, 1);
  27881. * // => true
  27882. *
  27883. * _.includes('abcd', 'bc');
  27884. * // => true
  27885. */
  27886. function includes(collection, value, fromIndex, guard) {
  27887. collection = isArrayLike(collection) ? collection : values(collection);
  27888. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  27889. var length = collection.length;
  27890. if (fromIndex < 0) {
  27891. fromIndex = nativeMax(length + fromIndex, 0);
  27892. }
  27893. return isString(collection)
  27894. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  27895. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  27896. }
  27897. /**
  27898. * Invokes the method at `path` of each element in `collection`, returning
  27899. * an array of the results of each invoked method. Any additional arguments
  27900. * are provided to each invoked method. If `path` is a function, it's invoked
  27901. * for, and `this` bound to, each element in `collection`.
  27902. *
  27903. * @static
  27904. * @memberOf _
  27905. * @since 4.0.0
  27906. * @category Collection
  27907. * @param {Array|Object} collection The collection to iterate over.
  27908. * @param {Array|Function|string} path The path of the method to invoke or
  27909. * the function invoked per iteration.
  27910. * @param {...*} [args] The arguments to invoke each method with.
  27911. * @returns {Array} Returns the array of results.
  27912. * @example
  27913. *
  27914. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  27915. * // => [[1, 5, 7], [1, 2, 3]]
  27916. *
  27917. * _.invokeMap([123, 456], String.prototype.split, '');
  27918. * // => [['1', '2', '3'], ['4', '5', '6']]
  27919. */
  27920. var invokeMap = baseRest(function(collection, path, args) {
  27921. var index = -1,
  27922. isFunc = typeof path == 'function',
  27923. result = isArrayLike(collection) ? Array(collection.length) : [];
  27924. baseEach(collection, function(value) {
  27925. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  27926. });
  27927. return result;
  27928. });
  27929. /**
  27930. * Creates an object composed of keys generated from the results of running
  27931. * each element of `collection` thru `iteratee`. The corresponding value of
  27932. * each key is the last element responsible for generating the key. The
  27933. * iteratee is invoked with one argument: (value).
  27934. *
  27935. * @static
  27936. * @memberOf _
  27937. * @since 4.0.0
  27938. * @category Collection
  27939. * @param {Array|Object} collection The collection to iterate over.
  27940. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  27941. * @returns {Object} Returns the composed aggregate object.
  27942. * @example
  27943. *
  27944. * var array = [
  27945. * { 'dir': 'left', 'code': 97 },
  27946. * { 'dir': 'right', 'code': 100 }
  27947. * ];
  27948. *
  27949. * _.keyBy(array, function(o) {
  27950. * return String.fromCharCode(o.code);
  27951. * });
  27952. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  27953. *
  27954. * _.keyBy(array, 'dir');
  27955. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  27956. */
  27957. var keyBy = createAggregator(function(result, value, key) {
  27958. baseAssignValue(result, key, value);
  27959. });
  27960. /**
  27961. * Creates an array of values by running each element in `collection` thru
  27962. * `iteratee`. The iteratee is invoked with three arguments:
  27963. * (value, index|key, collection).
  27964. *
  27965. * Many lodash methods are guarded to work as iteratees for methods like
  27966. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  27967. *
  27968. * The guarded methods are:
  27969. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  27970. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  27971. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  27972. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  27973. *
  27974. * @static
  27975. * @memberOf _
  27976. * @since 0.1.0
  27977. * @category Collection
  27978. * @param {Array|Object} collection The collection to iterate over.
  27979. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  27980. * @returns {Array} Returns the new mapped array.
  27981. * @example
  27982. *
  27983. * function square(n) {
  27984. * return n * n;
  27985. * }
  27986. *
  27987. * _.map([4, 8], square);
  27988. * // => [16, 64]
  27989. *
  27990. * _.map({ 'a': 4, 'b': 8 }, square);
  27991. * // => [16, 64] (iteration order is not guaranteed)
  27992. *
  27993. * var users = [
  27994. * { 'user': 'barney' },
  27995. * { 'user': 'fred' }
  27996. * ];
  27997. *
  27998. * // The `_.property` iteratee shorthand.
  27999. * _.map(users, 'user');
  28000. * // => ['barney', 'fred']
  28001. */
  28002. function map(collection, iteratee) {
  28003. var func = isArray(collection) ? arrayMap : baseMap;
  28004. return func(collection, getIteratee(iteratee, 3));
  28005. }
  28006. /**
  28007. * This method is like `_.sortBy` except that it allows specifying the sort
  28008. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  28009. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  28010. * descending or "asc" for ascending sort order of corresponding values.
  28011. *
  28012. * @static
  28013. * @memberOf _
  28014. * @since 4.0.0
  28015. * @category Collection
  28016. * @param {Array|Object} collection The collection to iterate over.
  28017. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  28018. * The iteratees to sort by.
  28019. * @param {string[]} [orders] The sort orders of `iteratees`.
  28020. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  28021. * @returns {Array} Returns the new sorted array.
  28022. * @example
  28023. *
  28024. * var users = [
  28025. * { 'user': 'fred', 'age': 48 },
  28026. * { 'user': 'barney', 'age': 34 },
  28027. * { 'user': 'fred', 'age': 40 },
  28028. * { 'user': 'barney', 'age': 36 }
  28029. * ];
  28030. *
  28031. * // Sort by `user` in ascending order and by `age` in descending order.
  28032. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  28033. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  28034. */
  28035. function orderBy(collection, iteratees, orders, guard) {
  28036. if (collection == null) {
  28037. return [];
  28038. }
  28039. if (!isArray(iteratees)) {
  28040. iteratees = iteratees == null ? [] : [iteratees];
  28041. }
  28042. orders = guard ? undefined : orders;
  28043. if (!isArray(orders)) {
  28044. orders = orders == null ? [] : [orders];
  28045. }
  28046. return baseOrderBy(collection, iteratees, orders);
  28047. }
  28048. /**
  28049. * Creates an array of elements split into two groups, the first of which
  28050. * contains elements `predicate` returns truthy for, the second of which
  28051. * contains elements `predicate` returns falsey for. The predicate is
  28052. * invoked with one argument: (value).
  28053. *
  28054. * @static
  28055. * @memberOf _
  28056. * @since 3.0.0
  28057. * @category Collection
  28058. * @param {Array|Object} collection The collection to iterate over.
  28059. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  28060. * @returns {Array} Returns the array of grouped elements.
  28061. * @example
  28062. *
  28063. * var users = [
  28064. * { 'user': 'barney', 'age': 36, 'active': false },
  28065. * { 'user': 'fred', 'age': 40, 'active': true },
  28066. * { 'user': 'pebbles', 'age': 1, 'active': false }
  28067. * ];
  28068. *
  28069. * _.partition(users, function(o) { return o.active; });
  28070. * // => objects for [['fred'], ['barney', 'pebbles']]
  28071. *
  28072. * // The `_.matches` iteratee shorthand.
  28073. * _.partition(users, { 'age': 1, 'active': false });
  28074. * // => objects for [['pebbles'], ['barney', 'fred']]
  28075. *
  28076. * // The `_.matchesProperty` iteratee shorthand.
  28077. * _.partition(users, ['active', false]);
  28078. * // => objects for [['barney', 'pebbles'], ['fred']]
  28079. *
  28080. * // The `_.property` iteratee shorthand.
  28081. * _.partition(users, 'active');
  28082. * // => objects for [['fred'], ['barney', 'pebbles']]
  28083. */
  28084. var partition = createAggregator(function(result, value, key) {
  28085. result[key ? 0 : 1].push(value);
  28086. }, function() { return [[], []]; });
  28087. /**
  28088. * Reduces `collection` to a value which is the accumulated result of running
  28089. * each element in `collection` thru `iteratee`, where each successive
  28090. * invocation is supplied the return value of the previous. If `accumulator`
  28091. * is not given, the first element of `collection` is used as the initial
  28092. * value. The iteratee is invoked with four arguments:
  28093. * (accumulator, value, index|key, collection).
  28094. *
  28095. * Many lodash methods are guarded to work as iteratees for methods like
  28096. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  28097. *
  28098. * The guarded methods are:
  28099. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  28100. * and `sortBy`
  28101. *
  28102. * @static
  28103. * @memberOf _
  28104. * @since 0.1.0
  28105. * @category Collection
  28106. * @param {Array|Object} collection The collection to iterate over.
  28107. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  28108. * @param {*} [accumulator] The initial value.
  28109. * @returns {*} Returns the accumulated value.
  28110. * @see _.reduceRight
  28111. * @example
  28112. *
  28113. * _.reduce([1, 2], function(sum, n) {
  28114. * return sum + n;
  28115. * }, 0);
  28116. * // => 3
  28117. *
  28118. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  28119. * (result[value] || (result[value] = [])).push(key);
  28120. * return result;
  28121. * }, {});
  28122. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  28123. */
  28124. function reduce(collection, iteratee, accumulator) {
  28125. var func = isArray(collection) ? arrayReduce : baseReduce,
  28126. initAccum = arguments.length < 3;
  28127. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  28128. }
  28129. /**
  28130. * This method is like `_.reduce` except that it iterates over elements of
  28131. * `collection` from right to left.
  28132. *
  28133. * @static
  28134. * @memberOf _
  28135. * @since 0.1.0
  28136. * @category Collection
  28137. * @param {Array|Object} collection The collection to iterate over.
  28138. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  28139. * @param {*} [accumulator] The initial value.
  28140. * @returns {*} Returns the accumulated value.
  28141. * @see _.reduce
  28142. * @example
  28143. *
  28144. * var array = [[0, 1], [2, 3], [4, 5]];
  28145. *
  28146. * _.reduceRight(array, function(flattened, other) {
  28147. * return flattened.concat(other);
  28148. * }, []);
  28149. * // => [4, 5, 2, 3, 0, 1]
  28150. */
  28151. function reduceRight(collection, iteratee, accumulator) {
  28152. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  28153. initAccum = arguments.length < 3;
  28154. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  28155. }
  28156. /**
  28157. * The opposite of `_.filter`; this method returns the elements of `collection`
  28158. * that `predicate` does **not** return truthy for.
  28159. *
  28160. * @static
  28161. * @memberOf _
  28162. * @since 0.1.0
  28163. * @category Collection
  28164. * @param {Array|Object} collection The collection to iterate over.
  28165. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  28166. * @returns {Array} Returns the new filtered array.
  28167. * @see _.filter
  28168. * @example
  28169. *
  28170. * var users = [
  28171. * { 'user': 'barney', 'age': 36, 'active': false },
  28172. * { 'user': 'fred', 'age': 40, 'active': true }
  28173. * ];
  28174. *
  28175. * _.reject(users, function(o) { return !o.active; });
  28176. * // => objects for ['fred']
  28177. *
  28178. * // The `_.matches` iteratee shorthand.
  28179. * _.reject(users, { 'age': 40, 'active': true });
  28180. * // => objects for ['barney']
  28181. *
  28182. * // The `_.matchesProperty` iteratee shorthand.
  28183. * _.reject(users, ['active', false]);
  28184. * // => objects for ['fred']
  28185. *
  28186. * // The `_.property` iteratee shorthand.
  28187. * _.reject(users, 'active');
  28188. * // => objects for ['barney']
  28189. */
  28190. function reject(collection, predicate) {
  28191. var func = isArray(collection) ? arrayFilter : baseFilter;
  28192. return func(collection, negate(getIteratee(predicate, 3)));
  28193. }
  28194. /**
  28195. * Gets a random element from `collection`.
  28196. *
  28197. * @static
  28198. * @memberOf _
  28199. * @since 2.0.0
  28200. * @category Collection
  28201. * @param {Array|Object} collection The collection to sample.
  28202. * @returns {*} Returns the random element.
  28203. * @example
  28204. *
  28205. * _.sample([1, 2, 3, 4]);
  28206. * // => 2
  28207. */
  28208. function sample(collection) {
  28209. var func = isArray(collection) ? arraySample : baseSample;
  28210. return func(collection);
  28211. }
  28212. /**
  28213. * Gets `n` random elements at unique keys from `collection` up to the
  28214. * size of `collection`.
  28215. *
  28216. * @static
  28217. * @memberOf _
  28218. * @since 4.0.0
  28219. * @category Collection
  28220. * @param {Array|Object} collection The collection to sample.
  28221. * @param {number} [n=1] The number of elements to sample.
  28222. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  28223. * @returns {Array} Returns the random elements.
  28224. * @example
  28225. *
  28226. * _.sampleSize([1, 2, 3], 2);
  28227. * // => [3, 1]
  28228. *
  28229. * _.sampleSize([1, 2, 3], 4);
  28230. * // => [2, 3, 1]
  28231. */
  28232. function sampleSize(collection, n, guard) {
  28233. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  28234. n = 1;
  28235. } else {
  28236. n = toInteger(n);
  28237. }
  28238. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  28239. return func(collection, n);
  28240. }
  28241. /**
  28242. * Creates an array of shuffled values, using a version of the
  28243. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  28244. *
  28245. * @static
  28246. * @memberOf _
  28247. * @since 0.1.0
  28248. * @category Collection
  28249. * @param {Array|Object} collection The collection to shuffle.
  28250. * @returns {Array} Returns the new shuffled array.
  28251. * @example
  28252. *
  28253. * _.shuffle([1, 2, 3, 4]);
  28254. * // => [4, 1, 3, 2]
  28255. */
  28256. function shuffle(collection) {
  28257. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  28258. return func(collection);
  28259. }
  28260. /**
  28261. * Gets the size of `collection` by returning its length for array-like
  28262. * values or the number of own enumerable string keyed properties for objects.
  28263. *
  28264. * @static
  28265. * @memberOf _
  28266. * @since 0.1.0
  28267. * @category Collection
  28268. * @param {Array|Object|string} collection The collection to inspect.
  28269. * @returns {number} Returns the collection size.
  28270. * @example
  28271. *
  28272. * _.size([1, 2, 3]);
  28273. * // => 3
  28274. *
  28275. * _.size({ 'a': 1, 'b': 2 });
  28276. * // => 2
  28277. *
  28278. * _.size('pebbles');
  28279. * // => 7
  28280. */
  28281. function size(collection) {
  28282. if (collection == null) {
  28283. return 0;
  28284. }
  28285. if (isArrayLike(collection)) {
  28286. return isString(collection) ? stringSize(collection) : collection.length;
  28287. }
  28288. var tag = getTag(collection);
  28289. if (tag == mapTag || tag == setTag) {
  28290. return collection.size;
  28291. }
  28292. return baseKeys(collection).length;
  28293. }
  28294. /**
  28295. * Checks if `predicate` returns truthy for **any** element of `collection`.
  28296. * Iteration is stopped once `predicate` returns truthy. The predicate is
  28297. * invoked with three arguments: (value, index|key, collection).
  28298. *
  28299. * @static
  28300. * @memberOf _
  28301. * @since 0.1.0
  28302. * @category Collection
  28303. * @param {Array|Object} collection The collection to iterate over.
  28304. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  28305. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  28306. * @returns {boolean} Returns `true` if any element passes the predicate check,
  28307. * else `false`.
  28308. * @example
  28309. *
  28310. * _.some([null, 0, 'yes', false], Boolean);
  28311. * // => true
  28312. *
  28313. * var users = [
  28314. * { 'user': 'barney', 'active': true },
  28315. * { 'user': 'fred', 'active': false }
  28316. * ];
  28317. *
  28318. * // The `_.matches` iteratee shorthand.
  28319. * _.some(users, { 'user': 'barney', 'active': false });
  28320. * // => false
  28321. *
  28322. * // The `_.matchesProperty` iteratee shorthand.
  28323. * _.some(users, ['active', false]);
  28324. * // => true
  28325. *
  28326. * // The `_.property` iteratee shorthand.
  28327. * _.some(users, 'active');
  28328. * // => true
  28329. */
  28330. function some(collection, predicate, guard) {
  28331. var func = isArray(collection) ? arraySome : baseSome;
  28332. if (guard && isIterateeCall(collection, predicate, guard)) {
  28333. predicate = undefined;
  28334. }
  28335. return func(collection, getIteratee(predicate, 3));
  28336. }
  28337. /**
  28338. * Creates an array of elements, sorted in ascending order by the results of
  28339. * running each element in a collection thru each iteratee. This method
  28340. * performs a stable sort, that is, it preserves the original sort order of
  28341. * equal elements. The iteratees are invoked with one argument: (value).
  28342. *
  28343. * @static
  28344. * @memberOf _
  28345. * @since 0.1.0
  28346. * @category Collection
  28347. * @param {Array|Object} collection The collection to iterate over.
  28348. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  28349. * The iteratees to sort by.
  28350. * @returns {Array} Returns the new sorted array.
  28351. * @example
  28352. *
  28353. * var users = [
  28354. * { 'user': 'fred', 'age': 48 },
  28355. * { 'user': 'barney', 'age': 36 },
  28356. * { 'user': 'fred', 'age': 40 },
  28357. * { 'user': 'barney', 'age': 34 }
  28358. * ];
  28359. *
  28360. * _.sortBy(users, [function(o) { return o.user; }]);
  28361. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  28362. *
  28363. * _.sortBy(users, ['user', 'age']);
  28364. * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]]
  28365. */
  28366. var sortBy = baseRest(function(collection, iteratees) {
  28367. if (collection == null) {
  28368. return [];
  28369. }
  28370. var length = iteratees.length;
  28371. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  28372. iteratees = [];
  28373. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  28374. iteratees = [iteratees[0]];
  28375. }
  28376. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  28377. });
  28378. /*------------------------------------------------------------------------*/
  28379. /**
  28380. * Gets the timestamp of the number of milliseconds that have elapsed since
  28381. * the Unix epoch (1 January 1970 00:00:00 UTC).
  28382. *
  28383. * @static
  28384. * @memberOf _
  28385. * @since 2.4.0
  28386. * @category Date
  28387. * @returns {number} Returns the timestamp.
  28388. * @example
  28389. *
  28390. * _.defer(function(stamp) {
  28391. * console.log(_.now() - stamp);
  28392. * }, _.now());
  28393. * // => Logs the number of milliseconds it took for the deferred invocation.
  28394. */
  28395. var now = ctxNow || function() {
  28396. return root.Date.now();
  28397. };
  28398. /*------------------------------------------------------------------------*/
  28399. /**
  28400. * The opposite of `_.before`; this method creates a function that invokes
  28401. * `func` once it's called `n` or more times.
  28402. *
  28403. * @static
  28404. * @memberOf _
  28405. * @since 0.1.0
  28406. * @category Function
  28407. * @param {number} n The number of calls before `func` is invoked.
  28408. * @param {Function} func The function to restrict.
  28409. * @returns {Function} Returns the new restricted function.
  28410. * @example
  28411. *
  28412. * var saves = ['profile', 'settings'];
  28413. *
  28414. * var done = _.after(saves.length, function() {
  28415. * console.log('done saving!');
  28416. * });
  28417. *
  28418. * _.forEach(saves, function(type) {
  28419. * asyncSave({ 'type': type, 'complete': done });
  28420. * });
  28421. * // => Logs 'done saving!' after the two async saves have completed.
  28422. */
  28423. function after(n, func) {
  28424. if (typeof func != 'function') {
  28425. throw new TypeError(FUNC_ERROR_TEXT);
  28426. }
  28427. n = toInteger(n);
  28428. return function() {
  28429. if (--n < 1) {
  28430. return func.apply(this, arguments);
  28431. }
  28432. };
  28433. }
  28434. /**
  28435. * Creates a function that invokes `func`, with up to `n` arguments,
  28436. * ignoring any additional arguments.
  28437. *
  28438. * @static
  28439. * @memberOf _
  28440. * @since 3.0.0
  28441. * @category Function
  28442. * @param {Function} func The function to cap arguments for.
  28443. * @param {number} [n=func.length] The arity cap.
  28444. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  28445. * @returns {Function} Returns the new capped function.
  28446. * @example
  28447. *
  28448. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  28449. * // => [6, 8, 10]
  28450. */
  28451. function ary(func, n, guard) {
  28452. n = guard ? undefined : n;
  28453. n = (func && n == null) ? func.length : n;
  28454. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  28455. }
  28456. /**
  28457. * Creates a function that invokes `func`, with the `this` binding and arguments
  28458. * of the created function, while it's called less than `n` times. Subsequent
  28459. * calls to the created function return the result of the last `func` invocation.
  28460. *
  28461. * @static
  28462. * @memberOf _
  28463. * @since 3.0.0
  28464. * @category Function
  28465. * @param {number} n The number of calls at which `func` is no longer invoked.
  28466. * @param {Function} func The function to restrict.
  28467. * @returns {Function} Returns the new restricted function.
  28468. * @example
  28469. *
  28470. * jQuery(element).on('click', _.before(5, addContactToList));
  28471. * // => Allows adding up to 4 contacts to the list.
  28472. */
  28473. function before(n, func) {
  28474. var result;
  28475. if (typeof func != 'function') {
  28476. throw new TypeError(FUNC_ERROR_TEXT);
  28477. }
  28478. n = toInteger(n);
  28479. return function() {
  28480. if (--n > 0) {
  28481. result = func.apply(this, arguments);
  28482. }
  28483. if (n <= 1) {
  28484. func = undefined;
  28485. }
  28486. return result;
  28487. };
  28488. }
  28489. /**
  28490. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  28491. * and `partials` prepended to the arguments it receives.
  28492. *
  28493. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  28494. * may be used as a placeholder for partially applied arguments.
  28495. *
  28496. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  28497. * property of bound functions.
  28498. *
  28499. * @static
  28500. * @memberOf _
  28501. * @since 0.1.0
  28502. * @category Function
  28503. * @param {Function} func The function to bind.
  28504. * @param {*} thisArg The `this` binding of `func`.
  28505. * @param {...*} [partials] The arguments to be partially applied.
  28506. * @returns {Function} Returns the new bound function.
  28507. * @example
  28508. *
  28509. * function greet(greeting, punctuation) {
  28510. * return greeting + ' ' + this.user + punctuation;
  28511. * }
  28512. *
  28513. * var object = { 'user': 'fred' };
  28514. *
  28515. * var bound = _.bind(greet, object, 'hi');
  28516. * bound('!');
  28517. * // => 'hi fred!'
  28518. *
  28519. * // Bound with placeholders.
  28520. * var bound = _.bind(greet, object, _, '!');
  28521. * bound('hi');
  28522. * // => 'hi fred!'
  28523. */
  28524. var bind = baseRest(function(func, thisArg, partials) {
  28525. var bitmask = WRAP_BIND_FLAG;
  28526. if (partials.length) {
  28527. var holders = replaceHolders(partials, getHolder(bind));
  28528. bitmask |= WRAP_PARTIAL_FLAG;
  28529. }
  28530. return createWrap(func, bitmask, thisArg, partials, holders);
  28531. });
  28532. /**
  28533. * Creates a function that invokes the method at `object[key]` with `partials`
  28534. * prepended to the arguments it receives.
  28535. *
  28536. * This method differs from `_.bind` by allowing bound functions to reference
  28537. * methods that may be redefined or don't yet exist. See
  28538. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  28539. * for more details.
  28540. *
  28541. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  28542. * builds, may be used as a placeholder for partially applied arguments.
  28543. *
  28544. * @static
  28545. * @memberOf _
  28546. * @since 0.10.0
  28547. * @category Function
  28548. * @param {Object} object The object to invoke the method on.
  28549. * @param {string} key The key of the method.
  28550. * @param {...*} [partials] The arguments to be partially applied.
  28551. * @returns {Function} Returns the new bound function.
  28552. * @example
  28553. *
  28554. * var object = {
  28555. * 'user': 'fred',
  28556. * 'greet': function(greeting, punctuation) {
  28557. * return greeting + ' ' + this.user + punctuation;
  28558. * }
  28559. * };
  28560. *
  28561. * var bound = _.bindKey(object, 'greet', 'hi');
  28562. * bound('!');
  28563. * // => 'hi fred!'
  28564. *
  28565. * object.greet = function(greeting, punctuation) {
  28566. * return greeting + 'ya ' + this.user + punctuation;
  28567. * };
  28568. *
  28569. * bound('!');
  28570. * // => 'hiya fred!'
  28571. *
  28572. * // Bound with placeholders.
  28573. * var bound = _.bindKey(object, 'greet', _, '!');
  28574. * bound('hi');
  28575. * // => 'hiya fred!'
  28576. */
  28577. var bindKey = baseRest(function(object, key, partials) {
  28578. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  28579. if (partials.length) {
  28580. var holders = replaceHolders(partials, getHolder(bindKey));
  28581. bitmask |= WRAP_PARTIAL_FLAG;
  28582. }
  28583. return createWrap(key, bitmask, object, partials, holders);
  28584. });
  28585. /**
  28586. * Creates a function that accepts arguments of `func` and either invokes
  28587. * `func` returning its result, if at least `arity` number of arguments have
  28588. * been provided, or returns a function that accepts the remaining `func`
  28589. * arguments, and so on. The arity of `func` may be specified if `func.length`
  28590. * is not sufficient.
  28591. *
  28592. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  28593. * may be used as a placeholder for provided arguments.
  28594. *
  28595. * **Note:** This method doesn't set the "length" property of curried functions.
  28596. *
  28597. * @static
  28598. * @memberOf _
  28599. * @since 2.0.0
  28600. * @category Function
  28601. * @param {Function} func The function to curry.
  28602. * @param {number} [arity=func.length] The arity of `func`.
  28603. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  28604. * @returns {Function} Returns the new curried function.
  28605. * @example
  28606. *
  28607. * var abc = function(a, b, c) {
  28608. * return [a, b, c];
  28609. * };
  28610. *
  28611. * var curried = _.curry(abc);
  28612. *
  28613. * curried(1)(2)(3);
  28614. * // => [1, 2, 3]
  28615. *
  28616. * curried(1, 2)(3);
  28617. * // => [1, 2, 3]
  28618. *
  28619. * curried(1, 2, 3);
  28620. * // => [1, 2, 3]
  28621. *
  28622. * // Curried with placeholders.
  28623. * curried(1)(_, 3)(2);
  28624. * // => [1, 2, 3]
  28625. */
  28626. function curry(func, arity, guard) {
  28627. arity = guard ? undefined : arity;
  28628. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  28629. result.placeholder = curry.placeholder;
  28630. return result;
  28631. }
  28632. /**
  28633. * This method is like `_.curry` except that arguments are applied to `func`
  28634. * in the manner of `_.partialRight` instead of `_.partial`.
  28635. *
  28636. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  28637. * builds, may be used as a placeholder for provided arguments.
  28638. *
  28639. * **Note:** This method doesn't set the "length" property of curried functions.
  28640. *
  28641. * @static
  28642. * @memberOf _
  28643. * @since 3.0.0
  28644. * @category Function
  28645. * @param {Function} func The function to curry.
  28646. * @param {number} [arity=func.length] The arity of `func`.
  28647. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  28648. * @returns {Function} Returns the new curried function.
  28649. * @example
  28650. *
  28651. * var abc = function(a, b, c) {
  28652. * return [a, b, c];
  28653. * };
  28654. *
  28655. * var curried = _.curryRight(abc);
  28656. *
  28657. * curried(3)(2)(1);
  28658. * // => [1, 2, 3]
  28659. *
  28660. * curried(2, 3)(1);
  28661. * // => [1, 2, 3]
  28662. *
  28663. * curried(1, 2, 3);
  28664. * // => [1, 2, 3]
  28665. *
  28666. * // Curried with placeholders.
  28667. * curried(3)(1, _)(2);
  28668. * // => [1, 2, 3]
  28669. */
  28670. function curryRight(func, arity, guard) {
  28671. arity = guard ? undefined : arity;
  28672. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  28673. result.placeholder = curryRight.placeholder;
  28674. return result;
  28675. }
  28676. /**
  28677. * Creates a debounced function that delays invoking `func` until after `wait`
  28678. * milliseconds have elapsed since the last time the debounced function was
  28679. * invoked. The debounced function comes with a `cancel` method to cancel
  28680. * delayed `func` invocations and a `flush` method to immediately invoke them.
  28681. * Provide `options` to indicate whether `func` should be invoked on the
  28682. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  28683. * with the last arguments provided to the debounced function. Subsequent
  28684. * calls to the debounced function return the result of the last `func`
  28685. * invocation.
  28686. *
  28687. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  28688. * invoked on the trailing edge of the timeout only if the debounced function
  28689. * is invoked more than once during the `wait` timeout.
  28690. *
  28691. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  28692. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  28693. *
  28694. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  28695. * for details over the differences between `_.debounce` and `_.throttle`.
  28696. *
  28697. * @static
  28698. * @memberOf _
  28699. * @since 0.1.0
  28700. * @category Function
  28701. * @param {Function} func The function to debounce.
  28702. * @param {number} [wait=0] The number of milliseconds to delay.
  28703. * @param {Object} [options={}] The options object.
  28704. * @param {boolean} [options.leading=false]
  28705. * Specify invoking on the leading edge of the timeout.
  28706. * @param {number} [options.maxWait]
  28707. * The maximum time `func` is allowed to be delayed before it's invoked.
  28708. * @param {boolean} [options.trailing=true]
  28709. * Specify invoking on the trailing edge of the timeout.
  28710. * @returns {Function} Returns the new debounced function.
  28711. * @example
  28712. *
  28713. * // Avoid costly calculations while the window size is in flux.
  28714. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  28715. *
  28716. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  28717. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  28718. * 'leading': true,
  28719. * 'trailing': false
  28720. * }));
  28721. *
  28722. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  28723. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  28724. * var source = new EventSource('/stream');
  28725. * jQuery(source).on('message', debounced);
  28726. *
  28727. * // Cancel the trailing debounced invocation.
  28728. * jQuery(window).on('popstate', debounced.cancel);
  28729. */
  28730. function debounce(func, wait, options) {
  28731. var lastArgs,
  28732. lastThis,
  28733. maxWait,
  28734. result,
  28735. timerId,
  28736. lastCallTime,
  28737. lastInvokeTime = 0,
  28738. leading = false,
  28739. maxing = false,
  28740. trailing = true;
  28741. if (typeof func != 'function') {
  28742. throw new TypeError(FUNC_ERROR_TEXT);
  28743. }
  28744. wait = toNumber(wait) || 0;
  28745. if (isObject(options)) {
  28746. leading = !!options.leading;
  28747. maxing = 'maxWait' in options;
  28748. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  28749. trailing = 'trailing' in options ? !!options.trailing : trailing;
  28750. }
  28751. function invokeFunc(time) {
  28752. var args = lastArgs,
  28753. thisArg = lastThis;
  28754. lastArgs = lastThis = undefined;
  28755. lastInvokeTime = time;
  28756. result = func.apply(thisArg, args);
  28757. return result;
  28758. }
  28759. function leadingEdge(time) {
  28760. // Reset any `maxWait` timer.
  28761. lastInvokeTime = time;
  28762. // Start the timer for the trailing edge.
  28763. timerId = setTimeout(timerExpired, wait);
  28764. // Invoke the leading edge.
  28765. return leading ? invokeFunc(time) : result;
  28766. }
  28767. function remainingWait(time) {
  28768. var timeSinceLastCall = time - lastCallTime,
  28769. timeSinceLastInvoke = time - lastInvokeTime,
  28770. timeWaiting = wait - timeSinceLastCall;
  28771. return maxing
  28772. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  28773. : timeWaiting;
  28774. }
  28775. function shouldInvoke(time) {
  28776. var timeSinceLastCall = time - lastCallTime,
  28777. timeSinceLastInvoke = time - lastInvokeTime;
  28778. // Either this is the first call, activity has stopped and we're at the
  28779. // trailing edge, the system time has gone backwards and we're treating
  28780. // it as the trailing edge, or we've hit the `maxWait` limit.
  28781. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  28782. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  28783. }
  28784. function timerExpired() {
  28785. var time = now();
  28786. if (shouldInvoke(time)) {
  28787. return trailingEdge(time);
  28788. }
  28789. // Restart the timer.
  28790. timerId = setTimeout(timerExpired, remainingWait(time));
  28791. }
  28792. function trailingEdge(time) {
  28793. timerId = undefined;
  28794. // Only invoke if we have `lastArgs` which means `func` has been
  28795. // debounced at least once.
  28796. if (trailing && lastArgs) {
  28797. return invokeFunc(time);
  28798. }
  28799. lastArgs = lastThis = undefined;
  28800. return result;
  28801. }
  28802. function cancel() {
  28803. if (timerId !== undefined) {
  28804. clearTimeout(timerId);
  28805. }
  28806. lastInvokeTime = 0;
  28807. lastArgs = lastCallTime = lastThis = timerId = undefined;
  28808. }
  28809. function flush() {
  28810. return timerId === undefined ? result : trailingEdge(now());
  28811. }
  28812. function debounced() {
  28813. var time = now(),
  28814. isInvoking = shouldInvoke(time);
  28815. lastArgs = arguments;
  28816. lastThis = this;
  28817. lastCallTime = time;
  28818. if (isInvoking) {
  28819. if (timerId === undefined) {
  28820. return leadingEdge(lastCallTime);
  28821. }
  28822. if (maxing) {
  28823. // Handle invocations in a tight loop.
  28824. clearTimeout(timerId);
  28825. timerId = setTimeout(timerExpired, wait);
  28826. return invokeFunc(lastCallTime);
  28827. }
  28828. }
  28829. if (timerId === undefined) {
  28830. timerId = setTimeout(timerExpired, wait);
  28831. }
  28832. return result;
  28833. }
  28834. debounced.cancel = cancel;
  28835. debounced.flush = flush;
  28836. return debounced;
  28837. }
  28838. /**
  28839. * Defers invoking the `func` until the current call stack has cleared. Any
  28840. * additional arguments are provided to `func` when it's invoked.
  28841. *
  28842. * @static
  28843. * @memberOf _
  28844. * @since 0.1.0
  28845. * @category Function
  28846. * @param {Function} func The function to defer.
  28847. * @param {...*} [args] The arguments to invoke `func` with.
  28848. * @returns {number} Returns the timer id.
  28849. * @example
  28850. *
  28851. * _.defer(function(text) {
  28852. * console.log(text);
  28853. * }, 'deferred');
  28854. * // => Logs 'deferred' after one millisecond.
  28855. */
  28856. var defer = baseRest(function(func, args) {
  28857. return baseDelay(func, 1, args);
  28858. });
  28859. /**
  28860. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  28861. * provided to `func` when it's invoked.
  28862. *
  28863. * @static
  28864. * @memberOf _
  28865. * @since 0.1.0
  28866. * @category Function
  28867. * @param {Function} func The function to delay.
  28868. * @param {number} wait The number of milliseconds to delay invocation.
  28869. * @param {...*} [args] The arguments to invoke `func` with.
  28870. * @returns {number} Returns the timer id.
  28871. * @example
  28872. *
  28873. * _.delay(function(text) {
  28874. * console.log(text);
  28875. * }, 1000, 'later');
  28876. * // => Logs 'later' after one second.
  28877. */
  28878. var delay = baseRest(function(func, wait, args) {
  28879. return baseDelay(func, toNumber(wait) || 0, args);
  28880. });
  28881. /**
  28882. * Creates a function that invokes `func` with arguments reversed.
  28883. *
  28884. * @static
  28885. * @memberOf _
  28886. * @since 4.0.0
  28887. * @category Function
  28888. * @param {Function} func The function to flip arguments for.
  28889. * @returns {Function} Returns the new flipped function.
  28890. * @example
  28891. *
  28892. * var flipped = _.flip(function() {
  28893. * return _.toArray(arguments);
  28894. * });
  28895. *
  28896. * flipped('a', 'b', 'c', 'd');
  28897. * // => ['d', 'c', 'b', 'a']
  28898. */
  28899. function flip(func) {
  28900. return createWrap(func, WRAP_FLIP_FLAG);
  28901. }
  28902. /**
  28903. * Creates a function that memoizes the result of `func`. If `resolver` is
  28904. * provided, it determines the cache key for storing the result based on the
  28905. * arguments provided to the memoized function. By default, the first argument
  28906. * provided to the memoized function is used as the map cache key. The `func`
  28907. * is invoked with the `this` binding of the memoized function.
  28908. *
  28909. * **Note:** The cache is exposed as the `cache` property on the memoized
  28910. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  28911. * constructor with one whose instances implement the
  28912. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  28913. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  28914. *
  28915. * @static
  28916. * @memberOf _
  28917. * @since 0.1.0
  28918. * @category Function
  28919. * @param {Function} func The function to have its output memoized.
  28920. * @param {Function} [resolver] The function to resolve the cache key.
  28921. * @returns {Function} Returns the new memoized function.
  28922. * @example
  28923. *
  28924. * var object = { 'a': 1, 'b': 2 };
  28925. * var other = { 'c': 3, 'd': 4 };
  28926. *
  28927. * var values = _.memoize(_.values);
  28928. * values(object);
  28929. * // => [1, 2]
  28930. *
  28931. * values(other);
  28932. * // => [3, 4]
  28933. *
  28934. * object.a = 2;
  28935. * values(object);
  28936. * // => [1, 2]
  28937. *
  28938. * // Modify the result cache.
  28939. * values.cache.set(object, ['a', 'b']);
  28940. * values(object);
  28941. * // => ['a', 'b']
  28942. *
  28943. * // Replace `_.memoize.Cache`.
  28944. * _.memoize.Cache = WeakMap;
  28945. */
  28946. function memoize(func, resolver) {
  28947. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  28948. throw new TypeError(FUNC_ERROR_TEXT);
  28949. }
  28950. var memoized = function() {
  28951. var args = arguments,
  28952. key = resolver ? resolver.apply(this, args) : args[0],
  28953. cache = memoized.cache;
  28954. if (cache.has(key)) {
  28955. return cache.get(key);
  28956. }
  28957. var result = func.apply(this, args);
  28958. memoized.cache = cache.set(key, result) || cache;
  28959. return result;
  28960. };
  28961. memoized.cache = new (memoize.Cache || MapCache);
  28962. return memoized;
  28963. }
  28964. // Expose `MapCache`.
  28965. memoize.Cache = MapCache;
  28966. /**
  28967. * Creates a function that negates the result of the predicate `func`. The
  28968. * `func` predicate is invoked with the `this` binding and arguments of the
  28969. * created function.
  28970. *
  28971. * @static
  28972. * @memberOf _
  28973. * @since 3.0.0
  28974. * @category Function
  28975. * @param {Function} predicate The predicate to negate.
  28976. * @returns {Function} Returns the new negated function.
  28977. * @example
  28978. *
  28979. * function isEven(n) {
  28980. * return n % 2 == 0;
  28981. * }
  28982. *
  28983. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  28984. * // => [1, 3, 5]
  28985. */
  28986. function negate(predicate) {
  28987. if (typeof predicate != 'function') {
  28988. throw new TypeError(FUNC_ERROR_TEXT);
  28989. }
  28990. return function() {
  28991. var args = arguments;
  28992. switch (args.length) {
  28993. case 0: return !predicate.call(this);
  28994. case 1: return !predicate.call(this, args[0]);
  28995. case 2: return !predicate.call(this, args[0], args[1]);
  28996. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  28997. }
  28998. return !predicate.apply(this, args);
  28999. };
  29000. }
  29001. /**
  29002. * Creates a function that is restricted to invoking `func` once. Repeat calls
  29003. * to the function return the value of the first invocation. The `func` is
  29004. * invoked with the `this` binding and arguments of the created function.
  29005. *
  29006. * @static
  29007. * @memberOf _
  29008. * @since 0.1.0
  29009. * @category Function
  29010. * @param {Function} func The function to restrict.
  29011. * @returns {Function} Returns the new restricted function.
  29012. * @example
  29013. *
  29014. * var initialize = _.once(createApplication);
  29015. * initialize();
  29016. * initialize();
  29017. * // => `createApplication` is invoked once
  29018. */
  29019. function once(func) {
  29020. return before(2, func);
  29021. }
  29022. /**
  29023. * Creates a function that invokes `func` with its arguments transformed.
  29024. *
  29025. * @static
  29026. * @since 4.0.0
  29027. * @memberOf _
  29028. * @category Function
  29029. * @param {Function} func The function to wrap.
  29030. * @param {...(Function|Function[])} [transforms=[_.identity]]
  29031. * The argument transforms.
  29032. * @returns {Function} Returns the new function.
  29033. * @example
  29034. *
  29035. * function doubled(n) {
  29036. * return n * 2;
  29037. * }
  29038. *
  29039. * function square(n) {
  29040. * return n * n;
  29041. * }
  29042. *
  29043. * var func = _.overArgs(function(x, y) {
  29044. * return [x, y];
  29045. * }, [square, doubled]);
  29046. *
  29047. * func(9, 3);
  29048. * // => [81, 6]
  29049. *
  29050. * func(10, 5);
  29051. * // => [100, 10]
  29052. */
  29053. var overArgs = castRest(function(func, transforms) {
  29054. transforms = (transforms.length == 1 && isArray(transforms[0]))
  29055. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  29056. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  29057. var funcsLength = transforms.length;
  29058. return baseRest(function(args) {
  29059. var index = -1,
  29060. length = nativeMin(args.length, funcsLength);
  29061. while (++index < length) {
  29062. args[index] = transforms[index].call(this, args[index]);
  29063. }
  29064. return apply(func, this, args);
  29065. });
  29066. });
  29067. /**
  29068. * Creates a function that invokes `func` with `partials` prepended to the
  29069. * arguments it receives. This method is like `_.bind` except it does **not**
  29070. * alter the `this` binding.
  29071. *
  29072. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  29073. * builds, may be used as a placeholder for partially applied arguments.
  29074. *
  29075. * **Note:** This method doesn't set the "length" property of partially
  29076. * applied functions.
  29077. *
  29078. * @static
  29079. * @memberOf _
  29080. * @since 0.2.0
  29081. * @category Function
  29082. * @param {Function} func The function to partially apply arguments to.
  29083. * @param {...*} [partials] The arguments to be partially applied.
  29084. * @returns {Function} Returns the new partially applied function.
  29085. * @example
  29086. *
  29087. * function greet(greeting, name) {
  29088. * return greeting + ' ' + name;
  29089. * }
  29090. *
  29091. * var sayHelloTo = _.partial(greet, 'hello');
  29092. * sayHelloTo('fred');
  29093. * // => 'hello fred'
  29094. *
  29095. * // Partially applied with placeholders.
  29096. * var greetFred = _.partial(greet, _, 'fred');
  29097. * greetFred('hi');
  29098. * // => 'hi fred'
  29099. */
  29100. var partial = baseRest(function(func, partials) {
  29101. var holders = replaceHolders(partials, getHolder(partial));
  29102. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  29103. });
  29104. /**
  29105. * This method is like `_.partial` except that partially applied arguments
  29106. * are appended to the arguments it receives.
  29107. *
  29108. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  29109. * builds, may be used as a placeholder for partially applied arguments.
  29110. *
  29111. * **Note:** This method doesn't set the "length" property of partially
  29112. * applied functions.
  29113. *
  29114. * @static
  29115. * @memberOf _
  29116. * @since 1.0.0
  29117. * @category Function
  29118. * @param {Function} func The function to partially apply arguments to.
  29119. * @param {...*} [partials] The arguments to be partially applied.
  29120. * @returns {Function} Returns the new partially applied function.
  29121. * @example
  29122. *
  29123. * function greet(greeting, name) {
  29124. * return greeting + ' ' + name;
  29125. * }
  29126. *
  29127. * var greetFred = _.partialRight(greet, 'fred');
  29128. * greetFred('hi');
  29129. * // => 'hi fred'
  29130. *
  29131. * // Partially applied with placeholders.
  29132. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  29133. * sayHelloTo('fred');
  29134. * // => 'hello fred'
  29135. */
  29136. var partialRight = baseRest(function(func, partials) {
  29137. var holders = replaceHolders(partials, getHolder(partialRight));
  29138. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  29139. });
  29140. /**
  29141. * Creates a function that invokes `func` with arguments arranged according
  29142. * to the specified `indexes` where the argument value at the first index is
  29143. * provided as the first argument, the argument value at the second index is
  29144. * provided as the second argument, and so on.
  29145. *
  29146. * @static
  29147. * @memberOf _
  29148. * @since 3.0.0
  29149. * @category Function
  29150. * @param {Function} func The function to rearrange arguments for.
  29151. * @param {...(number|number[])} indexes The arranged argument indexes.
  29152. * @returns {Function} Returns the new function.
  29153. * @example
  29154. *
  29155. * var rearged = _.rearg(function(a, b, c) {
  29156. * return [a, b, c];
  29157. * }, [2, 0, 1]);
  29158. *
  29159. * rearged('b', 'c', 'a')
  29160. * // => ['a', 'b', 'c']
  29161. */
  29162. var rearg = flatRest(function(func, indexes) {
  29163. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  29164. });
  29165. /**
  29166. * Creates a function that invokes `func` with the `this` binding of the
  29167. * created function and arguments from `start` and beyond provided as
  29168. * an array.
  29169. *
  29170. * **Note:** This method is based on the
  29171. * [rest parameter](https://mdn.io/rest_parameters).
  29172. *
  29173. * @static
  29174. * @memberOf _
  29175. * @since 4.0.0
  29176. * @category Function
  29177. * @param {Function} func The function to apply a rest parameter to.
  29178. * @param {number} [start=func.length-1] The start position of the rest parameter.
  29179. * @returns {Function} Returns the new function.
  29180. * @example
  29181. *
  29182. * var say = _.rest(function(what, names) {
  29183. * return what + ' ' + _.initial(names).join(', ') +
  29184. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  29185. * });
  29186. *
  29187. * say('hello', 'fred', 'barney', 'pebbles');
  29188. * // => 'hello fred, barney, & pebbles'
  29189. */
  29190. function rest(func, start) {
  29191. if (typeof func != 'function') {
  29192. throw new TypeError(FUNC_ERROR_TEXT);
  29193. }
  29194. start = start === undefined ? start : toInteger(start);
  29195. return baseRest(func, start);
  29196. }
  29197. /**
  29198. * Creates a function that invokes `func` with the `this` binding of the
  29199. * create function and an array of arguments much like
  29200. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  29201. *
  29202. * **Note:** This method is based on the
  29203. * [spread operator](https://mdn.io/spread_operator).
  29204. *
  29205. * @static
  29206. * @memberOf _
  29207. * @since 3.2.0
  29208. * @category Function
  29209. * @param {Function} func The function to spread arguments over.
  29210. * @param {number} [start=0] The start position of the spread.
  29211. * @returns {Function} Returns the new function.
  29212. * @example
  29213. *
  29214. * var say = _.spread(function(who, what) {
  29215. * return who + ' says ' + what;
  29216. * });
  29217. *
  29218. * say(['fred', 'hello']);
  29219. * // => 'fred says hello'
  29220. *
  29221. * var numbers = Promise.all([
  29222. * Promise.resolve(40),
  29223. * Promise.resolve(36)
  29224. * ]);
  29225. *
  29226. * numbers.then(_.spread(function(x, y) {
  29227. * return x + y;
  29228. * }));
  29229. * // => a Promise of 76
  29230. */
  29231. function spread(func, start) {
  29232. if (typeof func != 'function') {
  29233. throw new TypeError(FUNC_ERROR_TEXT);
  29234. }
  29235. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  29236. return baseRest(function(args) {
  29237. var array = args[start],
  29238. otherArgs = castSlice(args, 0, start);
  29239. if (array) {
  29240. arrayPush(otherArgs, array);
  29241. }
  29242. return apply(func, this, otherArgs);
  29243. });
  29244. }
  29245. /**
  29246. * Creates a throttled function that only invokes `func` at most once per
  29247. * every `wait` milliseconds. The throttled function comes with a `cancel`
  29248. * method to cancel delayed `func` invocations and a `flush` method to
  29249. * immediately invoke them. Provide `options` to indicate whether `func`
  29250. * should be invoked on the leading and/or trailing edge of the `wait`
  29251. * timeout. The `func` is invoked with the last arguments provided to the
  29252. * throttled function. Subsequent calls to the throttled function return the
  29253. * result of the last `func` invocation.
  29254. *
  29255. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  29256. * invoked on the trailing edge of the timeout only if the throttled function
  29257. * is invoked more than once during the `wait` timeout.
  29258. *
  29259. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  29260. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  29261. *
  29262. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  29263. * for details over the differences between `_.throttle` and `_.debounce`.
  29264. *
  29265. * @static
  29266. * @memberOf _
  29267. * @since 0.1.0
  29268. * @category Function
  29269. * @param {Function} func The function to throttle.
  29270. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  29271. * @param {Object} [options={}] The options object.
  29272. * @param {boolean} [options.leading=true]
  29273. * Specify invoking on the leading edge of the timeout.
  29274. * @param {boolean} [options.trailing=true]
  29275. * Specify invoking on the trailing edge of the timeout.
  29276. * @returns {Function} Returns the new throttled function.
  29277. * @example
  29278. *
  29279. * // Avoid excessively updating the position while scrolling.
  29280. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  29281. *
  29282. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  29283. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  29284. * jQuery(element).on('click', throttled);
  29285. *
  29286. * // Cancel the trailing throttled invocation.
  29287. * jQuery(window).on('popstate', throttled.cancel);
  29288. */
  29289. function throttle(func, wait, options) {
  29290. var leading = true,
  29291. trailing = true;
  29292. if (typeof func != 'function') {
  29293. throw new TypeError(FUNC_ERROR_TEXT);
  29294. }
  29295. if (isObject(options)) {
  29296. leading = 'leading' in options ? !!options.leading : leading;
  29297. trailing = 'trailing' in options ? !!options.trailing : trailing;
  29298. }
  29299. return debounce(func, wait, {
  29300. 'leading': leading,
  29301. 'maxWait': wait,
  29302. 'trailing': trailing
  29303. });
  29304. }
  29305. /**
  29306. * Creates a function that accepts up to one argument, ignoring any
  29307. * additional arguments.
  29308. *
  29309. * @static
  29310. * @memberOf _
  29311. * @since 4.0.0
  29312. * @category Function
  29313. * @param {Function} func The function to cap arguments for.
  29314. * @returns {Function} Returns the new capped function.
  29315. * @example
  29316. *
  29317. * _.map(['6', '8', '10'], _.unary(parseInt));
  29318. * // => [6, 8, 10]
  29319. */
  29320. function unary(func) {
  29321. return ary(func, 1);
  29322. }
  29323. /**
  29324. * Creates a function that provides `value` to `wrapper` as its first
  29325. * argument. Any additional arguments provided to the function are appended
  29326. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  29327. * binding of the created function.
  29328. *
  29329. * @static
  29330. * @memberOf _
  29331. * @since 0.1.0
  29332. * @category Function
  29333. * @param {*} value The value to wrap.
  29334. * @param {Function} [wrapper=identity] The wrapper function.
  29335. * @returns {Function} Returns the new function.
  29336. * @example
  29337. *
  29338. * var p = _.wrap(_.escape, function(func, text) {
  29339. * return '<p>' + func(text) + '</p>';
  29340. * });
  29341. *
  29342. * p('fred, barney, & pebbles');
  29343. * // => '<p>fred, barney, &amp; pebbles</p>'
  29344. */
  29345. function wrap(value, wrapper) {
  29346. return partial(castFunction(wrapper), value);
  29347. }
  29348. /*------------------------------------------------------------------------*/
  29349. /**
  29350. * Casts `value` as an array if it's not one.
  29351. *
  29352. * @static
  29353. * @memberOf _
  29354. * @since 4.4.0
  29355. * @category Lang
  29356. * @param {*} value The value to inspect.
  29357. * @returns {Array} Returns the cast array.
  29358. * @example
  29359. *
  29360. * _.castArray(1);
  29361. * // => [1]
  29362. *
  29363. * _.castArray({ 'a': 1 });
  29364. * // => [{ 'a': 1 }]
  29365. *
  29366. * _.castArray('abc');
  29367. * // => ['abc']
  29368. *
  29369. * _.castArray(null);
  29370. * // => [null]
  29371. *
  29372. * _.castArray(undefined);
  29373. * // => [undefined]
  29374. *
  29375. * _.castArray();
  29376. * // => []
  29377. *
  29378. * var array = [1, 2, 3];
  29379. * console.log(_.castArray(array) === array);
  29380. * // => true
  29381. */
  29382. function castArray() {
  29383. if (!arguments.length) {
  29384. return [];
  29385. }
  29386. var value = arguments[0];
  29387. return isArray(value) ? value : [value];
  29388. }
  29389. /**
  29390. * Creates a shallow clone of `value`.
  29391. *
  29392. * **Note:** This method is loosely based on the
  29393. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  29394. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  29395. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  29396. * arrays. The own enumerable properties of `arguments` objects are cloned
  29397. * as plain objects. An empty object is returned for uncloneable values such
  29398. * as error objects, functions, DOM nodes, and WeakMaps.
  29399. *
  29400. * @static
  29401. * @memberOf _
  29402. * @since 0.1.0
  29403. * @category Lang
  29404. * @param {*} value The value to clone.
  29405. * @returns {*} Returns the cloned value.
  29406. * @see _.cloneDeep
  29407. * @example
  29408. *
  29409. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  29410. *
  29411. * var shallow = _.clone(objects);
  29412. * console.log(shallow[0] === objects[0]);
  29413. * // => true
  29414. */
  29415. function clone(value) {
  29416. return baseClone(value, CLONE_SYMBOLS_FLAG);
  29417. }
  29418. /**
  29419. * This method is like `_.clone` except that it accepts `customizer` which
  29420. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  29421. * cloning is handled by the method instead. The `customizer` is invoked with
  29422. * up to four arguments; (value [, index|key, object, stack]).
  29423. *
  29424. * @static
  29425. * @memberOf _
  29426. * @since 4.0.0
  29427. * @category Lang
  29428. * @param {*} value The value to clone.
  29429. * @param {Function} [customizer] The function to customize cloning.
  29430. * @returns {*} Returns the cloned value.
  29431. * @see _.cloneDeepWith
  29432. * @example
  29433. *
  29434. * function customizer(value) {
  29435. * if (_.isElement(value)) {
  29436. * return value.cloneNode(false);
  29437. * }
  29438. * }
  29439. *
  29440. * var el = _.cloneWith(document.body, customizer);
  29441. *
  29442. * console.log(el === document.body);
  29443. * // => false
  29444. * console.log(el.nodeName);
  29445. * // => 'BODY'
  29446. * console.log(el.childNodes.length);
  29447. * // => 0
  29448. */
  29449. function cloneWith(value, customizer) {
  29450. customizer = typeof customizer == 'function' ? customizer : undefined;
  29451. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  29452. }
  29453. /**
  29454. * This method is like `_.clone` except that it recursively clones `value`.
  29455. *
  29456. * @static
  29457. * @memberOf _
  29458. * @since 1.0.0
  29459. * @category Lang
  29460. * @param {*} value The value to recursively clone.
  29461. * @returns {*} Returns the deep cloned value.
  29462. * @see _.clone
  29463. * @example
  29464. *
  29465. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  29466. *
  29467. * var deep = _.cloneDeep(objects);
  29468. * console.log(deep[0] === objects[0]);
  29469. * // => false
  29470. */
  29471. function cloneDeep(value) {
  29472. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  29473. }
  29474. /**
  29475. * This method is like `_.cloneWith` except that it recursively clones `value`.
  29476. *
  29477. * @static
  29478. * @memberOf _
  29479. * @since 4.0.0
  29480. * @category Lang
  29481. * @param {*} value The value to recursively clone.
  29482. * @param {Function} [customizer] The function to customize cloning.
  29483. * @returns {*} Returns the deep cloned value.
  29484. * @see _.cloneWith
  29485. * @example
  29486. *
  29487. * function customizer(value) {
  29488. * if (_.isElement(value)) {
  29489. * return value.cloneNode(true);
  29490. * }
  29491. * }
  29492. *
  29493. * var el = _.cloneDeepWith(document.body, customizer);
  29494. *
  29495. * console.log(el === document.body);
  29496. * // => false
  29497. * console.log(el.nodeName);
  29498. * // => 'BODY'
  29499. * console.log(el.childNodes.length);
  29500. * // => 20
  29501. */
  29502. function cloneDeepWith(value, customizer) {
  29503. customizer = typeof customizer == 'function' ? customizer : undefined;
  29504. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  29505. }
  29506. /**
  29507. * Checks if `object` conforms to `source` by invoking the predicate
  29508. * properties of `source` with the corresponding property values of `object`.
  29509. *
  29510. * **Note:** This method is equivalent to `_.conforms` when `source` is
  29511. * partially applied.
  29512. *
  29513. * @static
  29514. * @memberOf _
  29515. * @since 4.14.0
  29516. * @category Lang
  29517. * @param {Object} object The object to inspect.
  29518. * @param {Object} source The object of property predicates to conform to.
  29519. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  29520. * @example
  29521. *
  29522. * var object = { 'a': 1, 'b': 2 };
  29523. *
  29524. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  29525. * // => true
  29526. *
  29527. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  29528. * // => false
  29529. */
  29530. function conformsTo(object, source) {
  29531. return source == null || baseConformsTo(object, source, keys(source));
  29532. }
  29533. /**
  29534. * Performs a
  29535. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  29536. * comparison between two values to determine if they are equivalent.
  29537. *
  29538. * @static
  29539. * @memberOf _
  29540. * @since 4.0.0
  29541. * @category Lang
  29542. * @param {*} value The value to compare.
  29543. * @param {*} other The other value to compare.
  29544. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  29545. * @example
  29546. *
  29547. * var object = { 'a': 1 };
  29548. * var other = { 'a': 1 };
  29549. *
  29550. * _.eq(object, object);
  29551. * // => true
  29552. *
  29553. * _.eq(object, other);
  29554. * // => false
  29555. *
  29556. * _.eq('a', 'a');
  29557. * // => true
  29558. *
  29559. * _.eq('a', Object('a'));
  29560. * // => false
  29561. *
  29562. * _.eq(NaN, NaN);
  29563. * // => true
  29564. */
  29565. function eq(value, other) {
  29566. return value === other || (value !== value && other !== other);
  29567. }
  29568. /**
  29569. * Checks if `value` is greater than `other`.
  29570. *
  29571. * @static
  29572. * @memberOf _
  29573. * @since 3.9.0
  29574. * @category Lang
  29575. * @param {*} value The value to compare.
  29576. * @param {*} other The other value to compare.
  29577. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  29578. * else `false`.
  29579. * @see _.lt
  29580. * @example
  29581. *
  29582. * _.gt(3, 1);
  29583. * // => true
  29584. *
  29585. * _.gt(3, 3);
  29586. * // => false
  29587. *
  29588. * _.gt(1, 3);
  29589. * // => false
  29590. */
  29591. var gt = createRelationalOperation(baseGt);
  29592. /**
  29593. * Checks if `value` is greater than or equal to `other`.
  29594. *
  29595. * @static
  29596. * @memberOf _
  29597. * @since 3.9.0
  29598. * @category Lang
  29599. * @param {*} value The value to compare.
  29600. * @param {*} other The other value to compare.
  29601. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  29602. * `other`, else `false`.
  29603. * @see _.lte
  29604. * @example
  29605. *
  29606. * _.gte(3, 1);
  29607. * // => true
  29608. *
  29609. * _.gte(3, 3);
  29610. * // => true
  29611. *
  29612. * _.gte(1, 3);
  29613. * // => false
  29614. */
  29615. var gte = createRelationalOperation(function(value, other) {
  29616. return value >= other;
  29617. });
  29618. /**
  29619. * Checks if `value` is likely an `arguments` object.
  29620. *
  29621. * @static
  29622. * @memberOf _
  29623. * @since 0.1.0
  29624. * @category Lang
  29625. * @param {*} value The value to check.
  29626. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  29627. * else `false`.
  29628. * @example
  29629. *
  29630. * _.isArguments(function() { return arguments; }());
  29631. * // => true
  29632. *
  29633. * _.isArguments([1, 2, 3]);
  29634. * // => false
  29635. */
  29636. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  29637. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  29638. !propertyIsEnumerable.call(value, 'callee');
  29639. };
  29640. /**
  29641. * Checks if `value` is classified as an `Array` object.
  29642. *
  29643. * @static
  29644. * @memberOf _
  29645. * @since 0.1.0
  29646. * @category Lang
  29647. * @param {*} value The value to check.
  29648. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  29649. * @example
  29650. *
  29651. * _.isArray([1, 2, 3]);
  29652. * // => true
  29653. *
  29654. * _.isArray(document.body.children);
  29655. * // => false
  29656. *
  29657. * _.isArray('abc');
  29658. * // => false
  29659. *
  29660. * _.isArray(_.noop);
  29661. * // => false
  29662. */
  29663. var isArray = Array.isArray;
  29664. /**
  29665. * Checks if `value` is classified as an `ArrayBuffer` object.
  29666. *
  29667. * @static
  29668. * @memberOf _
  29669. * @since 4.3.0
  29670. * @category Lang
  29671. * @param {*} value The value to check.
  29672. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  29673. * @example
  29674. *
  29675. * _.isArrayBuffer(new ArrayBuffer(2));
  29676. * // => true
  29677. *
  29678. * _.isArrayBuffer(new Array(2));
  29679. * // => false
  29680. */
  29681. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  29682. /**
  29683. * Checks if `value` is array-like. A value is considered array-like if it's
  29684. * not a function and has a `value.length` that's an integer greater than or
  29685. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  29686. *
  29687. * @static
  29688. * @memberOf _
  29689. * @since 4.0.0
  29690. * @category Lang
  29691. * @param {*} value The value to check.
  29692. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  29693. * @example
  29694. *
  29695. * _.isArrayLike([1, 2, 3]);
  29696. * // => true
  29697. *
  29698. * _.isArrayLike(document.body.children);
  29699. * // => true
  29700. *
  29701. * _.isArrayLike('abc');
  29702. * // => true
  29703. *
  29704. * _.isArrayLike(_.noop);
  29705. * // => false
  29706. */
  29707. function isArrayLike(value) {
  29708. return value != null && isLength(value.length) && !isFunction(value);
  29709. }
  29710. /**
  29711. * This method is like `_.isArrayLike` except that it also checks if `value`
  29712. * is an object.
  29713. *
  29714. * @static
  29715. * @memberOf _
  29716. * @since 4.0.0
  29717. * @category Lang
  29718. * @param {*} value The value to check.
  29719. * @returns {boolean} Returns `true` if `value` is an array-like object,
  29720. * else `false`.
  29721. * @example
  29722. *
  29723. * _.isArrayLikeObject([1, 2, 3]);
  29724. * // => true
  29725. *
  29726. * _.isArrayLikeObject(document.body.children);
  29727. * // => true
  29728. *
  29729. * _.isArrayLikeObject('abc');
  29730. * // => false
  29731. *
  29732. * _.isArrayLikeObject(_.noop);
  29733. * // => false
  29734. */
  29735. function isArrayLikeObject(value) {
  29736. return isObjectLike(value) && isArrayLike(value);
  29737. }
  29738. /**
  29739. * Checks if `value` is classified as a boolean primitive or object.
  29740. *
  29741. * @static
  29742. * @memberOf _
  29743. * @since 0.1.0
  29744. * @category Lang
  29745. * @param {*} value The value to check.
  29746. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  29747. * @example
  29748. *
  29749. * _.isBoolean(false);
  29750. * // => true
  29751. *
  29752. * _.isBoolean(null);
  29753. * // => false
  29754. */
  29755. function isBoolean(value) {
  29756. return value === true || value === false ||
  29757. (isObjectLike(value) && baseGetTag(value) == boolTag);
  29758. }
  29759. /**
  29760. * Checks if `value` is a buffer.
  29761. *
  29762. * @static
  29763. * @memberOf _
  29764. * @since 4.3.0
  29765. * @category Lang
  29766. * @param {*} value The value to check.
  29767. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  29768. * @example
  29769. *
  29770. * _.isBuffer(new Buffer(2));
  29771. * // => true
  29772. *
  29773. * _.isBuffer(new Uint8Array(2));
  29774. * // => false
  29775. */
  29776. var isBuffer = nativeIsBuffer || stubFalse;
  29777. /**
  29778. * Checks if `value` is classified as a `Date` object.
  29779. *
  29780. * @static
  29781. * @memberOf _
  29782. * @since 0.1.0
  29783. * @category Lang
  29784. * @param {*} value The value to check.
  29785. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  29786. * @example
  29787. *
  29788. * _.isDate(new Date);
  29789. * // => true
  29790. *
  29791. * _.isDate('Mon April 23 2012');
  29792. * // => false
  29793. */
  29794. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  29795. /**
  29796. * Checks if `value` is likely a DOM element.
  29797. *
  29798. * @static
  29799. * @memberOf _
  29800. * @since 0.1.0
  29801. * @category Lang
  29802. * @param {*} value The value to check.
  29803. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  29804. * @example
  29805. *
  29806. * _.isElement(document.body);
  29807. * // => true
  29808. *
  29809. * _.isElement('<body>');
  29810. * // => false
  29811. */
  29812. function isElement(value) {
  29813. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  29814. }
  29815. /**
  29816. * Checks if `value` is an empty object, collection, map, or set.
  29817. *
  29818. * Objects are considered empty if they have no own enumerable string keyed
  29819. * properties.
  29820. *
  29821. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  29822. * jQuery-like collections are considered empty if they have a `length` of `0`.
  29823. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  29824. *
  29825. * @static
  29826. * @memberOf _
  29827. * @since 0.1.0
  29828. * @category Lang
  29829. * @param {*} value The value to check.
  29830. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  29831. * @example
  29832. *
  29833. * _.isEmpty(null);
  29834. * // => true
  29835. *
  29836. * _.isEmpty(true);
  29837. * // => true
  29838. *
  29839. * _.isEmpty(1);
  29840. * // => true
  29841. *
  29842. * _.isEmpty([1, 2, 3]);
  29843. * // => false
  29844. *
  29845. * _.isEmpty({ 'a': 1 });
  29846. * // => false
  29847. */
  29848. function isEmpty(value) {
  29849. if (value == null) {
  29850. return true;
  29851. }
  29852. if (isArrayLike(value) &&
  29853. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  29854. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  29855. return !value.length;
  29856. }
  29857. var tag = getTag(value);
  29858. if (tag == mapTag || tag == setTag) {
  29859. return !value.size;
  29860. }
  29861. if (isPrototype(value)) {
  29862. return !baseKeys(value).length;
  29863. }
  29864. for (var key in value) {
  29865. if (hasOwnProperty.call(value, key)) {
  29866. return false;
  29867. }
  29868. }
  29869. return true;
  29870. }
  29871. /**
  29872. * Performs a deep comparison between two values to determine if they are
  29873. * equivalent.
  29874. *
  29875. * **Note:** This method supports comparing arrays, array buffers, booleans,
  29876. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  29877. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  29878. * by their own, not inherited, enumerable properties. Functions and DOM
  29879. * nodes are compared by strict equality, i.e. `===`.
  29880. *
  29881. * @static
  29882. * @memberOf _
  29883. * @since 0.1.0
  29884. * @category Lang
  29885. * @param {*} value The value to compare.
  29886. * @param {*} other The other value to compare.
  29887. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  29888. * @example
  29889. *
  29890. * var object = { 'a': 1 };
  29891. * var other = { 'a': 1 };
  29892. *
  29893. * _.isEqual(object, other);
  29894. * // => true
  29895. *
  29896. * object === other;
  29897. * // => false
  29898. */
  29899. function isEqual(value, other) {
  29900. return baseIsEqual(value, other);
  29901. }
  29902. /**
  29903. * This method is like `_.isEqual` except that it accepts `customizer` which
  29904. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  29905. * are handled by the method instead. The `customizer` is invoked with up to
  29906. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  29907. *
  29908. * @static
  29909. * @memberOf _
  29910. * @since 4.0.0
  29911. * @category Lang
  29912. * @param {*} value The value to compare.
  29913. * @param {*} other The other value to compare.
  29914. * @param {Function} [customizer] The function to customize comparisons.
  29915. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  29916. * @example
  29917. *
  29918. * function isGreeting(value) {
  29919. * return /^h(?:i|ello)$/.test(value);
  29920. * }
  29921. *
  29922. * function customizer(objValue, othValue) {
  29923. * if (isGreeting(objValue) && isGreeting(othValue)) {
  29924. * return true;
  29925. * }
  29926. * }
  29927. *
  29928. * var array = ['hello', 'goodbye'];
  29929. * var other = ['hi', 'goodbye'];
  29930. *
  29931. * _.isEqualWith(array, other, customizer);
  29932. * // => true
  29933. */
  29934. function isEqualWith(value, other, customizer) {
  29935. customizer = typeof customizer == 'function' ? customizer : undefined;
  29936. var result = customizer ? customizer(value, other) : undefined;
  29937. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  29938. }
  29939. /**
  29940. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  29941. * `SyntaxError`, `TypeError`, or `URIError` object.
  29942. *
  29943. * @static
  29944. * @memberOf _
  29945. * @since 3.0.0
  29946. * @category Lang
  29947. * @param {*} value The value to check.
  29948. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  29949. * @example
  29950. *
  29951. * _.isError(new Error);
  29952. * // => true
  29953. *
  29954. * _.isError(Error);
  29955. * // => false
  29956. */
  29957. function isError(value) {
  29958. if (!isObjectLike(value)) {
  29959. return false;
  29960. }
  29961. var tag = baseGetTag(value);
  29962. return tag == errorTag || tag == domExcTag ||
  29963. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  29964. }
  29965. /**
  29966. * Checks if `value` is a finite primitive number.
  29967. *
  29968. * **Note:** This method is based on
  29969. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  29970. *
  29971. * @static
  29972. * @memberOf _
  29973. * @since 0.1.0
  29974. * @category Lang
  29975. * @param {*} value The value to check.
  29976. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  29977. * @example
  29978. *
  29979. * _.isFinite(3);
  29980. * // => true
  29981. *
  29982. * _.isFinite(Number.MIN_VALUE);
  29983. * // => true
  29984. *
  29985. * _.isFinite(Infinity);
  29986. * // => false
  29987. *
  29988. * _.isFinite('3');
  29989. * // => false
  29990. */
  29991. function isFinite(value) {
  29992. return typeof value == 'number' && nativeIsFinite(value);
  29993. }
  29994. /**
  29995. * Checks if `value` is classified as a `Function` object.
  29996. *
  29997. * @static
  29998. * @memberOf _
  29999. * @since 0.1.0
  30000. * @category Lang
  30001. * @param {*} value The value to check.
  30002. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  30003. * @example
  30004. *
  30005. * _.isFunction(_);
  30006. * // => true
  30007. *
  30008. * _.isFunction(/abc/);
  30009. * // => false
  30010. */
  30011. function isFunction(value) {
  30012. if (!isObject(value)) {
  30013. return false;
  30014. }
  30015. // The use of `Object#toString` avoids issues with the `typeof` operator
  30016. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  30017. var tag = baseGetTag(value);
  30018. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  30019. }
  30020. /**
  30021. * Checks if `value` is an integer.
  30022. *
  30023. * **Note:** This method is based on
  30024. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  30025. *
  30026. * @static
  30027. * @memberOf _
  30028. * @since 4.0.0
  30029. * @category Lang
  30030. * @param {*} value The value to check.
  30031. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  30032. * @example
  30033. *
  30034. * _.isInteger(3);
  30035. * // => true
  30036. *
  30037. * _.isInteger(Number.MIN_VALUE);
  30038. * // => false
  30039. *
  30040. * _.isInteger(Infinity);
  30041. * // => false
  30042. *
  30043. * _.isInteger('3');
  30044. * // => false
  30045. */
  30046. function isInteger(value) {
  30047. return typeof value == 'number' && value == toInteger(value);
  30048. }
  30049. /**
  30050. * Checks if `value` is a valid array-like length.
  30051. *
  30052. * **Note:** This method is loosely based on
  30053. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  30054. *
  30055. * @static
  30056. * @memberOf _
  30057. * @since 4.0.0
  30058. * @category Lang
  30059. * @param {*} value The value to check.
  30060. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  30061. * @example
  30062. *
  30063. * _.isLength(3);
  30064. * // => true
  30065. *
  30066. * _.isLength(Number.MIN_VALUE);
  30067. * // => false
  30068. *
  30069. * _.isLength(Infinity);
  30070. * // => false
  30071. *
  30072. * _.isLength('3');
  30073. * // => false
  30074. */
  30075. function isLength(value) {
  30076. return typeof value == 'number' &&
  30077. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  30078. }
  30079. /**
  30080. * Checks if `value` is the
  30081. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  30082. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  30083. *
  30084. * @static
  30085. * @memberOf _
  30086. * @since 0.1.0
  30087. * @category Lang
  30088. * @param {*} value The value to check.
  30089. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  30090. * @example
  30091. *
  30092. * _.isObject({});
  30093. * // => true
  30094. *
  30095. * _.isObject([1, 2, 3]);
  30096. * // => true
  30097. *
  30098. * _.isObject(_.noop);
  30099. * // => true
  30100. *
  30101. * _.isObject(null);
  30102. * // => false
  30103. */
  30104. function isObject(value) {
  30105. var type = typeof value;
  30106. return value != null && (type == 'object' || type == 'function');
  30107. }
  30108. /**
  30109. * Checks if `value` is object-like. A value is object-like if it's not `null`
  30110. * and has a `typeof` result of "object".
  30111. *
  30112. * @static
  30113. * @memberOf _
  30114. * @since 4.0.0
  30115. * @category Lang
  30116. * @param {*} value The value to check.
  30117. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  30118. * @example
  30119. *
  30120. * _.isObjectLike({});
  30121. * // => true
  30122. *
  30123. * _.isObjectLike([1, 2, 3]);
  30124. * // => true
  30125. *
  30126. * _.isObjectLike(_.noop);
  30127. * // => false
  30128. *
  30129. * _.isObjectLike(null);
  30130. * // => false
  30131. */
  30132. function isObjectLike(value) {
  30133. return value != null && typeof value == 'object';
  30134. }
  30135. /**
  30136. * Checks if `value` is classified as a `Map` object.
  30137. *
  30138. * @static
  30139. * @memberOf _
  30140. * @since 4.3.0
  30141. * @category Lang
  30142. * @param {*} value The value to check.
  30143. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  30144. * @example
  30145. *
  30146. * _.isMap(new Map);
  30147. * // => true
  30148. *
  30149. * _.isMap(new WeakMap);
  30150. * // => false
  30151. */
  30152. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  30153. /**
  30154. * Performs a partial deep comparison between `object` and `source` to
  30155. * determine if `object` contains equivalent property values.
  30156. *
  30157. * **Note:** This method is equivalent to `_.matches` when `source` is
  30158. * partially applied.
  30159. *
  30160. * Partial comparisons will match empty array and empty object `source`
  30161. * values against any array or object value, respectively. See `_.isEqual`
  30162. * for a list of supported value comparisons.
  30163. *
  30164. * @static
  30165. * @memberOf _
  30166. * @since 3.0.0
  30167. * @category Lang
  30168. * @param {Object} object The object to inspect.
  30169. * @param {Object} source The object of property values to match.
  30170. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  30171. * @example
  30172. *
  30173. * var object = { 'a': 1, 'b': 2 };
  30174. *
  30175. * _.isMatch(object, { 'b': 2 });
  30176. * // => true
  30177. *
  30178. * _.isMatch(object, { 'b': 1 });
  30179. * // => false
  30180. */
  30181. function isMatch(object, source) {
  30182. return object === source || baseIsMatch(object, source, getMatchData(source));
  30183. }
  30184. /**
  30185. * This method is like `_.isMatch` except that it accepts `customizer` which
  30186. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  30187. * are handled by the method instead. The `customizer` is invoked with five
  30188. * arguments: (objValue, srcValue, index|key, object, source).
  30189. *
  30190. * @static
  30191. * @memberOf _
  30192. * @since 4.0.0
  30193. * @category Lang
  30194. * @param {Object} object The object to inspect.
  30195. * @param {Object} source The object of property values to match.
  30196. * @param {Function} [customizer] The function to customize comparisons.
  30197. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  30198. * @example
  30199. *
  30200. * function isGreeting(value) {
  30201. * return /^h(?:i|ello)$/.test(value);
  30202. * }
  30203. *
  30204. * function customizer(objValue, srcValue) {
  30205. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  30206. * return true;
  30207. * }
  30208. * }
  30209. *
  30210. * var object = { 'greeting': 'hello' };
  30211. * var source = { 'greeting': 'hi' };
  30212. *
  30213. * _.isMatchWith(object, source, customizer);
  30214. * // => true
  30215. */
  30216. function isMatchWith(object, source, customizer) {
  30217. customizer = typeof customizer == 'function' ? customizer : undefined;
  30218. return baseIsMatch(object, source, getMatchData(source), customizer);
  30219. }
  30220. /**
  30221. * Checks if `value` is `NaN`.
  30222. *
  30223. * **Note:** This method is based on
  30224. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  30225. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  30226. * `undefined` and other non-number values.
  30227. *
  30228. * @static
  30229. * @memberOf _
  30230. * @since 0.1.0
  30231. * @category Lang
  30232. * @param {*} value The value to check.
  30233. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  30234. * @example
  30235. *
  30236. * _.isNaN(NaN);
  30237. * // => true
  30238. *
  30239. * _.isNaN(new Number(NaN));
  30240. * // => true
  30241. *
  30242. * isNaN(undefined);
  30243. * // => true
  30244. *
  30245. * _.isNaN(undefined);
  30246. * // => false
  30247. */
  30248. function isNaN(value) {
  30249. // An `NaN` primitive is the only value that is not equal to itself.
  30250. // Perform the `toStringTag` check first to avoid errors with some
  30251. // ActiveX objects in IE.
  30252. return isNumber(value) && value != +value;
  30253. }
  30254. /**
  30255. * Checks if `value` is a pristine native function.
  30256. *
  30257. * **Note:** This method can't reliably detect native functions in the presence
  30258. * of the core-js package because core-js circumvents this kind of detection.
  30259. * Despite multiple requests, the core-js maintainer has made it clear: any
  30260. * attempt to fix the detection will be obstructed. As a result, we're left
  30261. * with little choice but to throw an error. Unfortunately, this also affects
  30262. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  30263. * which rely on core-js.
  30264. *
  30265. * @static
  30266. * @memberOf _
  30267. * @since 3.0.0
  30268. * @category Lang
  30269. * @param {*} value The value to check.
  30270. * @returns {boolean} Returns `true` if `value` is a native function,
  30271. * else `false`.
  30272. * @example
  30273. *
  30274. * _.isNative(Array.prototype.push);
  30275. * // => true
  30276. *
  30277. * _.isNative(_);
  30278. * // => false
  30279. */
  30280. function isNative(value) {
  30281. if (isMaskable(value)) {
  30282. throw new Error(CORE_ERROR_TEXT);
  30283. }
  30284. return baseIsNative(value);
  30285. }
  30286. /**
  30287. * Checks if `value` is `null`.
  30288. *
  30289. * @static
  30290. * @memberOf _
  30291. * @since 0.1.0
  30292. * @category Lang
  30293. * @param {*} value The value to check.
  30294. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  30295. * @example
  30296. *
  30297. * _.isNull(null);
  30298. * // => true
  30299. *
  30300. * _.isNull(void 0);
  30301. * // => false
  30302. */
  30303. function isNull(value) {
  30304. return value === null;
  30305. }
  30306. /**
  30307. * Checks if `value` is `null` or `undefined`.
  30308. *
  30309. * @static
  30310. * @memberOf _
  30311. * @since 4.0.0
  30312. * @category Lang
  30313. * @param {*} value The value to check.
  30314. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  30315. * @example
  30316. *
  30317. * _.isNil(null);
  30318. * // => true
  30319. *
  30320. * _.isNil(void 0);
  30321. * // => true
  30322. *
  30323. * _.isNil(NaN);
  30324. * // => false
  30325. */
  30326. function isNil(value) {
  30327. return value == null;
  30328. }
  30329. /**
  30330. * Checks if `value` is classified as a `Number` primitive or object.
  30331. *
  30332. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  30333. * classified as numbers, use the `_.isFinite` method.
  30334. *
  30335. * @static
  30336. * @memberOf _
  30337. * @since 0.1.0
  30338. * @category Lang
  30339. * @param {*} value The value to check.
  30340. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  30341. * @example
  30342. *
  30343. * _.isNumber(3);
  30344. * // => true
  30345. *
  30346. * _.isNumber(Number.MIN_VALUE);
  30347. * // => true
  30348. *
  30349. * _.isNumber(Infinity);
  30350. * // => true
  30351. *
  30352. * _.isNumber('3');
  30353. * // => false
  30354. */
  30355. function isNumber(value) {
  30356. return typeof value == 'number' ||
  30357. (isObjectLike(value) && baseGetTag(value) == numberTag);
  30358. }
  30359. /**
  30360. * Checks if `value` is a plain object, that is, an object created by the
  30361. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  30362. *
  30363. * @static
  30364. * @memberOf _
  30365. * @since 0.8.0
  30366. * @category Lang
  30367. * @param {*} value The value to check.
  30368. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  30369. * @example
  30370. *
  30371. * function Foo() {
  30372. * this.a = 1;
  30373. * }
  30374. *
  30375. * _.isPlainObject(new Foo);
  30376. * // => false
  30377. *
  30378. * _.isPlainObject([1, 2, 3]);
  30379. * // => false
  30380. *
  30381. * _.isPlainObject({ 'x': 0, 'y': 0 });
  30382. * // => true
  30383. *
  30384. * _.isPlainObject(Object.create(null));
  30385. * // => true
  30386. */
  30387. function isPlainObject(value) {
  30388. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  30389. return false;
  30390. }
  30391. var proto = getPrototype(value);
  30392. if (proto === null) {
  30393. return true;
  30394. }
  30395. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  30396. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  30397. funcToString.call(Ctor) == objectCtorString;
  30398. }
  30399. /**
  30400. * Checks if `value` is classified as a `RegExp` object.
  30401. *
  30402. * @static
  30403. * @memberOf _
  30404. * @since 0.1.0
  30405. * @category Lang
  30406. * @param {*} value The value to check.
  30407. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  30408. * @example
  30409. *
  30410. * _.isRegExp(/abc/);
  30411. * // => true
  30412. *
  30413. * _.isRegExp('/abc/');
  30414. * // => false
  30415. */
  30416. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  30417. /**
  30418. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  30419. * double precision number which isn't the result of a rounded unsafe integer.
  30420. *
  30421. * **Note:** This method is based on
  30422. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  30423. *
  30424. * @static
  30425. * @memberOf _
  30426. * @since 4.0.0
  30427. * @category Lang
  30428. * @param {*} value The value to check.
  30429. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  30430. * @example
  30431. *
  30432. * _.isSafeInteger(3);
  30433. * // => true
  30434. *
  30435. * _.isSafeInteger(Number.MIN_VALUE);
  30436. * // => false
  30437. *
  30438. * _.isSafeInteger(Infinity);
  30439. * // => false
  30440. *
  30441. * _.isSafeInteger('3');
  30442. * // => false
  30443. */
  30444. function isSafeInteger(value) {
  30445. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  30446. }
  30447. /**
  30448. * Checks if `value` is classified as a `Set` object.
  30449. *
  30450. * @static
  30451. * @memberOf _
  30452. * @since 4.3.0
  30453. * @category Lang
  30454. * @param {*} value The value to check.
  30455. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  30456. * @example
  30457. *
  30458. * _.isSet(new Set);
  30459. * // => true
  30460. *
  30461. * _.isSet(new WeakSet);
  30462. * // => false
  30463. */
  30464. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  30465. /**
  30466. * Checks if `value` is classified as a `String` primitive or object.
  30467. *
  30468. * @static
  30469. * @since 0.1.0
  30470. * @memberOf _
  30471. * @category Lang
  30472. * @param {*} value The value to check.
  30473. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  30474. * @example
  30475. *
  30476. * _.isString('abc');
  30477. * // => true
  30478. *
  30479. * _.isString(1);
  30480. * // => false
  30481. */
  30482. function isString(value) {
  30483. return typeof value == 'string' ||
  30484. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  30485. }
  30486. /**
  30487. * Checks if `value` is classified as a `Symbol` primitive or object.
  30488. *
  30489. * @static
  30490. * @memberOf _
  30491. * @since 4.0.0
  30492. * @category Lang
  30493. * @param {*} value The value to check.
  30494. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  30495. * @example
  30496. *
  30497. * _.isSymbol(Symbol.iterator);
  30498. * // => true
  30499. *
  30500. * _.isSymbol('abc');
  30501. * // => false
  30502. */
  30503. function isSymbol(value) {
  30504. return typeof value == 'symbol' ||
  30505. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  30506. }
  30507. /**
  30508. * Checks if `value` is classified as a typed array.
  30509. *
  30510. * @static
  30511. * @memberOf _
  30512. * @since 3.0.0
  30513. * @category Lang
  30514. * @param {*} value The value to check.
  30515. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  30516. * @example
  30517. *
  30518. * _.isTypedArray(new Uint8Array);
  30519. * // => true
  30520. *
  30521. * _.isTypedArray([]);
  30522. * // => false
  30523. */
  30524. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  30525. /**
  30526. * Checks if `value` is `undefined`.
  30527. *
  30528. * @static
  30529. * @since 0.1.0
  30530. * @memberOf _
  30531. * @category Lang
  30532. * @param {*} value The value to check.
  30533. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  30534. * @example
  30535. *
  30536. * _.isUndefined(void 0);
  30537. * // => true
  30538. *
  30539. * _.isUndefined(null);
  30540. * // => false
  30541. */
  30542. function isUndefined(value) {
  30543. return value === undefined;
  30544. }
  30545. /**
  30546. * Checks if `value` is classified as a `WeakMap` object.
  30547. *
  30548. * @static
  30549. * @memberOf _
  30550. * @since 4.3.0
  30551. * @category Lang
  30552. * @param {*} value The value to check.
  30553. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  30554. * @example
  30555. *
  30556. * _.isWeakMap(new WeakMap);
  30557. * // => true
  30558. *
  30559. * _.isWeakMap(new Map);
  30560. * // => false
  30561. */
  30562. function isWeakMap(value) {
  30563. return isObjectLike(value) && getTag(value) == weakMapTag;
  30564. }
  30565. /**
  30566. * Checks if `value` is classified as a `WeakSet` object.
  30567. *
  30568. * @static
  30569. * @memberOf _
  30570. * @since 4.3.0
  30571. * @category Lang
  30572. * @param {*} value The value to check.
  30573. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  30574. * @example
  30575. *
  30576. * _.isWeakSet(new WeakSet);
  30577. * // => true
  30578. *
  30579. * _.isWeakSet(new Set);
  30580. * // => false
  30581. */
  30582. function isWeakSet(value) {
  30583. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  30584. }
  30585. /**
  30586. * Checks if `value` is less than `other`.
  30587. *
  30588. * @static
  30589. * @memberOf _
  30590. * @since 3.9.0
  30591. * @category Lang
  30592. * @param {*} value The value to compare.
  30593. * @param {*} other The other value to compare.
  30594. * @returns {boolean} Returns `true` if `value` is less than `other`,
  30595. * else `false`.
  30596. * @see _.gt
  30597. * @example
  30598. *
  30599. * _.lt(1, 3);
  30600. * // => true
  30601. *
  30602. * _.lt(3, 3);
  30603. * // => false
  30604. *
  30605. * _.lt(3, 1);
  30606. * // => false
  30607. */
  30608. var lt = createRelationalOperation(baseLt);
  30609. /**
  30610. * Checks if `value` is less than or equal to `other`.
  30611. *
  30612. * @static
  30613. * @memberOf _
  30614. * @since 3.9.0
  30615. * @category Lang
  30616. * @param {*} value The value to compare.
  30617. * @param {*} other The other value to compare.
  30618. * @returns {boolean} Returns `true` if `value` is less than or equal to
  30619. * `other`, else `false`.
  30620. * @see _.gte
  30621. * @example
  30622. *
  30623. * _.lte(1, 3);
  30624. * // => true
  30625. *
  30626. * _.lte(3, 3);
  30627. * // => true
  30628. *
  30629. * _.lte(3, 1);
  30630. * // => false
  30631. */
  30632. var lte = createRelationalOperation(function(value, other) {
  30633. return value <= other;
  30634. });
  30635. /**
  30636. * Converts `value` to an array.
  30637. *
  30638. * @static
  30639. * @since 0.1.0
  30640. * @memberOf _
  30641. * @category Lang
  30642. * @param {*} value The value to convert.
  30643. * @returns {Array} Returns the converted array.
  30644. * @example
  30645. *
  30646. * _.toArray({ 'a': 1, 'b': 2 });
  30647. * // => [1, 2]
  30648. *
  30649. * _.toArray('abc');
  30650. * // => ['a', 'b', 'c']
  30651. *
  30652. * _.toArray(1);
  30653. * // => []
  30654. *
  30655. * _.toArray(null);
  30656. * // => []
  30657. */
  30658. function toArray(value) {
  30659. if (!value) {
  30660. return [];
  30661. }
  30662. if (isArrayLike(value)) {
  30663. return isString(value) ? stringToArray(value) : copyArray(value);
  30664. }
  30665. if (symIterator && value[symIterator]) {
  30666. return iteratorToArray(value[symIterator]());
  30667. }
  30668. var tag = getTag(value),
  30669. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  30670. return func(value);
  30671. }
  30672. /**
  30673. * Converts `value` to a finite number.
  30674. *
  30675. * @static
  30676. * @memberOf _
  30677. * @since 4.12.0
  30678. * @category Lang
  30679. * @param {*} value The value to convert.
  30680. * @returns {number} Returns the converted number.
  30681. * @example
  30682. *
  30683. * _.toFinite(3.2);
  30684. * // => 3.2
  30685. *
  30686. * _.toFinite(Number.MIN_VALUE);
  30687. * // => 5e-324
  30688. *
  30689. * _.toFinite(Infinity);
  30690. * // => 1.7976931348623157e+308
  30691. *
  30692. * _.toFinite('3.2');
  30693. * // => 3.2
  30694. */
  30695. function toFinite(value) {
  30696. if (!value) {
  30697. return value === 0 ? value : 0;
  30698. }
  30699. value = toNumber(value);
  30700. if (value === INFINITY || value === -INFINITY) {
  30701. var sign = (value < 0 ? -1 : 1);
  30702. return sign * MAX_INTEGER;
  30703. }
  30704. return value === value ? value : 0;
  30705. }
  30706. /**
  30707. * Converts `value` to an integer.
  30708. *
  30709. * **Note:** This method is loosely based on
  30710. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  30711. *
  30712. * @static
  30713. * @memberOf _
  30714. * @since 4.0.0
  30715. * @category Lang
  30716. * @param {*} value The value to convert.
  30717. * @returns {number} Returns the converted integer.
  30718. * @example
  30719. *
  30720. * _.toInteger(3.2);
  30721. * // => 3
  30722. *
  30723. * _.toInteger(Number.MIN_VALUE);
  30724. * // => 0
  30725. *
  30726. * _.toInteger(Infinity);
  30727. * // => 1.7976931348623157e+308
  30728. *
  30729. * _.toInteger('3.2');
  30730. * // => 3
  30731. */
  30732. function toInteger(value) {
  30733. var result = toFinite(value),
  30734. remainder = result % 1;
  30735. return result === result ? (remainder ? result - remainder : result) : 0;
  30736. }
  30737. /**
  30738. * Converts `value` to an integer suitable for use as the length of an
  30739. * array-like object.
  30740. *
  30741. * **Note:** This method is based on
  30742. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  30743. *
  30744. * @static
  30745. * @memberOf _
  30746. * @since 4.0.0
  30747. * @category Lang
  30748. * @param {*} value The value to convert.
  30749. * @returns {number} Returns the converted integer.
  30750. * @example
  30751. *
  30752. * _.toLength(3.2);
  30753. * // => 3
  30754. *
  30755. * _.toLength(Number.MIN_VALUE);
  30756. * // => 0
  30757. *
  30758. * _.toLength(Infinity);
  30759. * // => 4294967295
  30760. *
  30761. * _.toLength('3.2');
  30762. * // => 3
  30763. */
  30764. function toLength(value) {
  30765. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  30766. }
  30767. /**
  30768. * Converts `value` to a number.
  30769. *
  30770. * @static
  30771. * @memberOf _
  30772. * @since 4.0.0
  30773. * @category Lang
  30774. * @param {*} value The value to process.
  30775. * @returns {number} Returns the number.
  30776. * @example
  30777. *
  30778. * _.toNumber(3.2);
  30779. * // => 3.2
  30780. *
  30781. * _.toNumber(Number.MIN_VALUE);
  30782. * // => 5e-324
  30783. *
  30784. * _.toNumber(Infinity);
  30785. * // => Infinity
  30786. *
  30787. * _.toNumber('3.2');
  30788. * // => 3.2
  30789. */
  30790. function toNumber(value) {
  30791. if (typeof value == 'number') {
  30792. return value;
  30793. }
  30794. if (isSymbol(value)) {
  30795. return NAN;
  30796. }
  30797. if (isObject(value)) {
  30798. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  30799. value = isObject(other) ? (other + '') : other;
  30800. }
  30801. if (typeof value != 'string') {
  30802. return value === 0 ? value : +value;
  30803. }
  30804. value = value.replace(reTrim, '');
  30805. var isBinary = reIsBinary.test(value);
  30806. return (isBinary || reIsOctal.test(value))
  30807. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  30808. : (reIsBadHex.test(value) ? NAN : +value);
  30809. }
  30810. /**
  30811. * Converts `value` to a plain object flattening inherited enumerable string
  30812. * keyed properties of `value` to own properties of the plain object.
  30813. *
  30814. * @static
  30815. * @memberOf _
  30816. * @since 3.0.0
  30817. * @category Lang
  30818. * @param {*} value The value to convert.
  30819. * @returns {Object} Returns the converted plain object.
  30820. * @example
  30821. *
  30822. * function Foo() {
  30823. * this.b = 2;
  30824. * }
  30825. *
  30826. * Foo.prototype.c = 3;
  30827. *
  30828. * _.assign({ 'a': 1 }, new Foo);
  30829. * // => { 'a': 1, 'b': 2 }
  30830. *
  30831. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  30832. * // => { 'a': 1, 'b': 2, 'c': 3 }
  30833. */
  30834. function toPlainObject(value) {
  30835. return copyObject(value, keysIn(value));
  30836. }
  30837. /**
  30838. * Converts `value` to a safe integer. A safe integer can be compared and
  30839. * represented correctly.
  30840. *
  30841. * @static
  30842. * @memberOf _
  30843. * @since 4.0.0
  30844. * @category Lang
  30845. * @param {*} value The value to convert.
  30846. * @returns {number} Returns the converted integer.
  30847. * @example
  30848. *
  30849. * _.toSafeInteger(3.2);
  30850. * // => 3
  30851. *
  30852. * _.toSafeInteger(Number.MIN_VALUE);
  30853. * // => 0
  30854. *
  30855. * _.toSafeInteger(Infinity);
  30856. * // => 9007199254740991
  30857. *
  30858. * _.toSafeInteger('3.2');
  30859. * // => 3
  30860. */
  30861. function toSafeInteger(value) {
  30862. return value
  30863. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  30864. : (value === 0 ? value : 0);
  30865. }
  30866. /**
  30867. * Converts `value` to a string. An empty string is returned for `null`
  30868. * and `undefined` values. The sign of `-0` is preserved.
  30869. *
  30870. * @static
  30871. * @memberOf _
  30872. * @since 4.0.0
  30873. * @category Lang
  30874. * @param {*} value The value to convert.
  30875. * @returns {string} Returns the converted string.
  30876. * @example
  30877. *
  30878. * _.toString(null);
  30879. * // => ''
  30880. *
  30881. * _.toString(-0);
  30882. * // => '-0'
  30883. *
  30884. * _.toString([1, 2, 3]);
  30885. * // => '1,2,3'
  30886. */
  30887. function toString(value) {
  30888. return value == null ? '' : baseToString(value);
  30889. }
  30890. /*------------------------------------------------------------------------*/
  30891. /**
  30892. * Assigns own enumerable string keyed properties of source objects to the
  30893. * destination object. Source objects are applied from left to right.
  30894. * Subsequent sources overwrite property assignments of previous sources.
  30895. *
  30896. * **Note:** This method mutates `object` and is loosely based on
  30897. * [`Object.assign`](https://mdn.io/Object/assign).
  30898. *
  30899. * @static
  30900. * @memberOf _
  30901. * @since 0.10.0
  30902. * @category Object
  30903. * @param {Object} object The destination object.
  30904. * @param {...Object} [sources] The source objects.
  30905. * @returns {Object} Returns `object`.
  30906. * @see _.assignIn
  30907. * @example
  30908. *
  30909. * function Foo() {
  30910. * this.a = 1;
  30911. * }
  30912. *
  30913. * function Bar() {
  30914. * this.c = 3;
  30915. * }
  30916. *
  30917. * Foo.prototype.b = 2;
  30918. * Bar.prototype.d = 4;
  30919. *
  30920. * _.assign({ 'a': 0 }, new Foo, new Bar);
  30921. * // => { 'a': 1, 'c': 3 }
  30922. */
  30923. var assign = createAssigner(function(object, source) {
  30924. if (isPrototype(source) || isArrayLike(source)) {
  30925. copyObject(source, keys(source), object);
  30926. return;
  30927. }
  30928. for (var key in source) {
  30929. if (hasOwnProperty.call(source, key)) {
  30930. assignValue(object, key, source[key]);
  30931. }
  30932. }
  30933. });
  30934. /**
  30935. * This method is like `_.assign` except that it iterates over own and
  30936. * inherited source properties.
  30937. *
  30938. * **Note:** This method mutates `object`.
  30939. *
  30940. * @static
  30941. * @memberOf _
  30942. * @since 4.0.0
  30943. * @alias extend
  30944. * @category Object
  30945. * @param {Object} object The destination object.
  30946. * @param {...Object} [sources] The source objects.
  30947. * @returns {Object} Returns `object`.
  30948. * @see _.assign
  30949. * @example
  30950. *
  30951. * function Foo() {
  30952. * this.a = 1;
  30953. * }
  30954. *
  30955. * function Bar() {
  30956. * this.c = 3;
  30957. * }
  30958. *
  30959. * Foo.prototype.b = 2;
  30960. * Bar.prototype.d = 4;
  30961. *
  30962. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  30963. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  30964. */
  30965. var assignIn = createAssigner(function(object, source) {
  30966. copyObject(source, keysIn(source), object);
  30967. });
  30968. /**
  30969. * This method is like `_.assignIn` except that it accepts `customizer`
  30970. * which is invoked to produce the assigned values. If `customizer` returns
  30971. * `undefined`, assignment is handled by the method instead. The `customizer`
  30972. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  30973. *
  30974. * **Note:** This method mutates `object`.
  30975. *
  30976. * @static
  30977. * @memberOf _
  30978. * @since 4.0.0
  30979. * @alias extendWith
  30980. * @category Object
  30981. * @param {Object} object The destination object.
  30982. * @param {...Object} sources The source objects.
  30983. * @param {Function} [customizer] The function to customize assigned values.
  30984. * @returns {Object} Returns `object`.
  30985. * @see _.assignWith
  30986. * @example
  30987. *
  30988. * function customizer(objValue, srcValue) {
  30989. * return _.isUndefined(objValue) ? srcValue : objValue;
  30990. * }
  30991. *
  30992. * var defaults = _.partialRight(_.assignInWith, customizer);
  30993. *
  30994. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  30995. * // => { 'a': 1, 'b': 2 }
  30996. */
  30997. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  30998. copyObject(source, keysIn(source), object, customizer);
  30999. });
  31000. /**
  31001. * This method is like `_.assign` except that it accepts `customizer`
  31002. * which is invoked to produce the assigned values. If `customizer` returns
  31003. * `undefined`, assignment is handled by the method instead. The `customizer`
  31004. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  31005. *
  31006. * **Note:** This method mutates `object`.
  31007. *
  31008. * @static
  31009. * @memberOf _
  31010. * @since 4.0.0
  31011. * @category Object
  31012. * @param {Object} object The destination object.
  31013. * @param {...Object} sources The source objects.
  31014. * @param {Function} [customizer] The function to customize assigned values.
  31015. * @returns {Object} Returns `object`.
  31016. * @see _.assignInWith
  31017. * @example
  31018. *
  31019. * function customizer(objValue, srcValue) {
  31020. * return _.isUndefined(objValue) ? srcValue : objValue;
  31021. * }
  31022. *
  31023. * var defaults = _.partialRight(_.assignWith, customizer);
  31024. *
  31025. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  31026. * // => { 'a': 1, 'b': 2 }
  31027. */
  31028. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  31029. copyObject(source, keys(source), object, customizer);
  31030. });
  31031. /**
  31032. * Creates an array of values corresponding to `paths` of `object`.
  31033. *
  31034. * @static
  31035. * @memberOf _
  31036. * @since 1.0.0
  31037. * @category Object
  31038. * @param {Object} object The object to iterate over.
  31039. * @param {...(string|string[])} [paths] The property paths to pick.
  31040. * @returns {Array} Returns the picked values.
  31041. * @example
  31042. *
  31043. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  31044. *
  31045. * _.at(object, ['a[0].b.c', 'a[1]']);
  31046. * // => [3, 4]
  31047. */
  31048. var at = flatRest(baseAt);
  31049. /**
  31050. * Creates an object that inherits from the `prototype` object. If a
  31051. * `properties` object is given, its own enumerable string keyed properties
  31052. * are assigned to the created object.
  31053. *
  31054. * @static
  31055. * @memberOf _
  31056. * @since 2.3.0
  31057. * @category Object
  31058. * @param {Object} prototype The object to inherit from.
  31059. * @param {Object} [properties] The properties to assign to the object.
  31060. * @returns {Object} Returns the new object.
  31061. * @example
  31062. *
  31063. * function Shape() {
  31064. * this.x = 0;
  31065. * this.y = 0;
  31066. * }
  31067. *
  31068. * function Circle() {
  31069. * Shape.call(this);
  31070. * }
  31071. *
  31072. * Circle.prototype = _.create(Shape.prototype, {
  31073. * 'constructor': Circle
  31074. * });
  31075. *
  31076. * var circle = new Circle;
  31077. * circle instanceof Circle;
  31078. * // => true
  31079. *
  31080. * circle instanceof Shape;
  31081. * // => true
  31082. */
  31083. function create(prototype, properties) {
  31084. var result = baseCreate(prototype);
  31085. return properties == null ? result : baseAssign(result, properties);
  31086. }
  31087. /**
  31088. * Assigns own and inherited enumerable string keyed properties of source
  31089. * objects to the destination object for all destination properties that
  31090. * resolve to `undefined`. Source objects are applied from left to right.
  31091. * Once a property is set, additional values of the same property are ignored.
  31092. *
  31093. * **Note:** This method mutates `object`.
  31094. *
  31095. * @static
  31096. * @since 0.1.0
  31097. * @memberOf _
  31098. * @category Object
  31099. * @param {Object} object The destination object.
  31100. * @param {...Object} [sources] The source objects.
  31101. * @returns {Object} Returns `object`.
  31102. * @see _.defaultsDeep
  31103. * @example
  31104. *
  31105. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  31106. * // => { 'a': 1, 'b': 2 }
  31107. */
  31108. var defaults = baseRest(function(object, sources) {
  31109. object = Object(object);
  31110. var index = -1;
  31111. var length = sources.length;
  31112. var guard = length > 2 ? sources[2] : undefined;
  31113. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  31114. length = 1;
  31115. }
  31116. while (++index < length) {
  31117. var source = sources[index];
  31118. var props = keysIn(source);
  31119. var propsIndex = -1;
  31120. var propsLength = props.length;
  31121. while (++propsIndex < propsLength) {
  31122. var key = props[propsIndex];
  31123. var value = object[key];
  31124. if (value === undefined ||
  31125. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  31126. object[key] = source[key];
  31127. }
  31128. }
  31129. }
  31130. return object;
  31131. });
  31132. /**
  31133. * This method is like `_.defaults` except that it recursively assigns
  31134. * default properties.
  31135. *
  31136. * **Note:** This method mutates `object`.
  31137. *
  31138. * @static
  31139. * @memberOf _
  31140. * @since 3.10.0
  31141. * @category Object
  31142. * @param {Object} object The destination object.
  31143. * @param {...Object} [sources] The source objects.
  31144. * @returns {Object} Returns `object`.
  31145. * @see _.defaults
  31146. * @example
  31147. *
  31148. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  31149. * // => { 'a': { 'b': 2, 'c': 3 } }
  31150. */
  31151. var defaultsDeep = baseRest(function(args) {
  31152. args.push(undefined, customDefaultsMerge);
  31153. return apply(mergeWith, undefined, args);
  31154. });
  31155. /**
  31156. * This method is like `_.find` except that it returns the key of the first
  31157. * element `predicate` returns truthy for instead of the element itself.
  31158. *
  31159. * @static
  31160. * @memberOf _
  31161. * @since 1.1.0
  31162. * @category Object
  31163. * @param {Object} object The object to inspect.
  31164. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  31165. * @returns {string|undefined} Returns the key of the matched element,
  31166. * else `undefined`.
  31167. * @example
  31168. *
  31169. * var users = {
  31170. * 'barney': { 'age': 36, 'active': true },
  31171. * 'fred': { 'age': 40, 'active': false },
  31172. * 'pebbles': { 'age': 1, 'active': true }
  31173. * };
  31174. *
  31175. * _.findKey(users, function(o) { return o.age < 40; });
  31176. * // => 'barney' (iteration order is not guaranteed)
  31177. *
  31178. * // The `_.matches` iteratee shorthand.
  31179. * _.findKey(users, { 'age': 1, 'active': true });
  31180. * // => 'pebbles'
  31181. *
  31182. * // The `_.matchesProperty` iteratee shorthand.
  31183. * _.findKey(users, ['active', false]);
  31184. * // => 'fred'
  31185. *
  31186. * // The `_.property` iteratee shorthand.
  31187. * _.findKey(users, 'active');
  31188. * // => 'barney'
  31189. */
  31190. function findKey(object, predicate) {
  31191. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  31192. }
  31193. /**
  31194. * This method is like `_.findKey` except that it iterates over elements of
  31195. * a collection in the opposite order.
  31196. *
  31197. * @static
  31198. * @memberOf _
  31199. * @since 2.0.0
  31200. * @category Object
  31201. * @param {Object} object The object to inspect.
  31202. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  31203. * @returns {string|undefined} Returns the key of the matched element,
  31204. * else `undefined`.
  31205. * @example
  31206. *
  31207. * var users = {
  31208. * 'barney': { 'age': 36, 'active': true },
  31209. * 'fred': { 'age': 40, 'active': false },
  31210. * 'pebbles': { 'age': 1, 'active': true }
  31211. * };
  31212. *
  31213. * _.findLastKey(users, function(o) { return o.age < 40; });
  31214. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  31215. *
  31216. * // The `_.matches` iteratee shorthand.
  31217. * _.findLastKey(users, { 'age': 36, 'active': true });
  31218. * // => 'barney'
  31219. *
  31220. * // The `_.matchesProperty` iteratee shorthand.
  31221. * _.findLastKey(users, ['active', false]);
  31222. * // => 'fred'
  31223. *
  31224. * // The `_.property` iteratee shorthand.
  31225. * _.findLastKey(users, 'active');
  31226. * // => 'pebbles'
  31227. */
  31228. function findLastKey(object, predicate) {
  31229. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  31230. }
  31231. /**
  31232. * Iterates over own and inherited enumerable string keyed properties of an
  31233. * object and invokes `iteratee` for each property. The iteratee is invoked
  31234. * with three arguments: (value, key, object). Iteratee functions may exit
  31235. * iteration early by explicitly returning `false`.
  31236. *
  31237. * @static
  31238. * @memberOf _
  31239. * @since 0.3.0
  31240. * @category Object
  31241. * @param {Object} object The object to iterate over.
  31242. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  31243. * @returns {Object} Returns `object`.
  31244. * @see _.forInRight
  31245. * @example
  31246. *
  31247. * function Foo() {
  31248. * this.a = 1;
  31249. * this.b = 2;
  31250. * }
  31251. *
  31252. * Foo.prototype.c = 3;
  31253. *
  31254. * _.forIn(new Foo, function(value, key) {
  31255. * console.log(key);
  31256. * });
  31257. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  31258. */
  31259. function forIn(object, iteratee) {
  31260. return object == null
  31261. ? object
  31262. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  31263. }
  31264. /**
  31265. * This method is like `_.forIn` except that it iterates over properties of
  31266. * `object` in the opposite order.
  31267. *
  31268. * @static
  31269. * @memberOf _
  31270. * @since 2.0.0
  31271. * @category Object
  31272. * @param {Object} object The object to iterate over.
  31273. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  31274. * @returns {Object} Returns `object`.
  31275. * @see _.forIn
  31276. * @example
  31277. *
  31278. * function Foo() {
  31279. * this.a = 1;
  31280. * this.b = 2;
  31281. * }
  31282. *
  31283. * Foo.prototype.c = 3;
  31284. *
  31285. * _.forInRight(new Foo, function(value, key) {
  31286. * console.log(key);
  31287. * });
  31288. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  31289. */
  31290. function forInRight(object, iteratee) {
  31291. return object == null
  31292. ? object
  31293. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  31294. }
  31295. /**
  31296. * Iterates over own enumerable string keyed properties of an object and
  31297. * invokes `iteratee` for each property. The iteratee is invoked with three
  31298. * arguments: (value, key, object). Iteratee functions may exit iteration
  31299. * early by explicitly returning `false`.
  31300. *
  31301. * @static
  31302. * @memberOf _
  31303. * @since 0.3.0
  31304. * @category Object
  31305. * @param {Object} object The object to iterate over.
  31306. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  31307. * @returns {Object} Returns `object`.
  31308. * @see _.forOwnRight
  31309. * @example
  31310. *
  31311. * function Foo() {
  31312. * this.a = 1;
  31313. * this.b = 2;
  31314. * }
  31315. *
  31316. * Foo.prototype.c = 3;
  31317. *
  31318. * _.forOwn(new Foo, function(value, key) {
  31319. * console.log(key);
  31320. * });
  31321. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  31322. */
  31323. function forOwn(object, iteratee) {
  31324. return object && baseForOwn(object, getIteratee(iteratee, 3));
  31325. }
  31326. /**
  31327. * This method is like `_.forOwn` except that it iterates over properties of
  31328. * `object` in the opposite order.
  31329. *
  31330. * @static
  31331. * @memberOf _
  31332. * @since 2.0.0
  31333. * @category Object
  31334. * @param {Object} object The object to iterate over.
  31335. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  31336. * @returns {Object} Returns `object`.
  31337. * @see _.forOwn
  31338. * @example
  31339. *
  31340. * function Foo() {
  31341. * this.a = 1;
  31342. * this.b = 2;
  31343. * }
  31344. *
  31345. * Foo.prototype.c = 3;
  31346. *
  31347. * _.forOwnRight(new Foo, function(value, key) {
  31348. * console.log(key);
  31349. * });
  31350. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  31351. */
  31352. function forOwnRight(object, iteratee) {
  31353. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  31354. }
  31355. /**
  31356. * Creates an array of function property names from own enumerable properties
  31357. * of `object`.
  31358. *
  31359. * @static
  31360. * @since 0.1.0
  31361. * @memberOf _
  31362. * @category Object
  31363. * @param {Object} object The object to inspect.
  31364. * @returns {Array} Returns the function names.
  31365. * @see _.functionsIn
  31366. * @example
  31367. *
  31368. * function Foo() {
  31369. * this.a = _.constant('a');
  31370. * this.b = _.constant('b');
  31371. * }
  31372. *
  31373. * Foo.prototype.c = _.constant('c');
  31374. *
  31375. * _.functions(new Foo);
  31376. * // => ['a', 'b']
  31377. */
  31378. function functions(object) {
  31379. return object == null ? [] : baseFunctions(object, keys(object));
  31380. }
  31381. /**
  31382. * Creates an array of function property names from own and inherited
  31383. * enumerable properties of `object`.
  31384. *
  31385. * @static
  31386. * @memberOf _
  31387. * @since 4.0.0
  31388. * @category Object
  31389. * @param {Object} object The object to inspect.
  31390. * @returns {Array} Returns the function names.
  31391. * @see _.functions
  31392. * @example
  31393. *
  31394. * function Foo() {
  31395. * this.a = _.constant('a');
  31396. * this.b = _.constant('b');
  31397. * }
  31398. *
  31399. * Foo.prototype.c = _.constant('c');
  31400. *
  31401. * _.functionsIn(new Foo);
  31402. * // => ['a', 'b', 'c']
  31403. */
  31404. function functionsIn(object) {
  31405. return object == null ? [] : baseFunctions(object, keysIn(object));
  31406. }
  31407. /**
  31408. * Gets the value at `path` of `object`. If the resolved value is
  31409. * `undefined`, the `defaultValue` is returned in its place.
  31410. *
  31411. * @static
  31412. * @memberOf _
  31413. * @since 3.7.0
  31414. * @category Object
  31415. * @param {Object} object The object to query.
  31416. * @param {Array|string} path The path of the property to get.
  31417. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  31418. * @returns {*} Returns the resolved value.
  31419. * @example
  31420. *
  31421. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  31422. *
  31423. * _.get(object, 'a[0].b.c');
  31424. * // => 3
  31425. *
  31426. * _.get(object, ['a', '0', 'b', 'c']);
  31427. * // => 3
  31428. *
  31429. * _.get(object, 'a.b.c', 'default');
  31430. * // => 'default'
  31431. */
  31432. function get(object, path, defaultValue) {
  31433. var result = object == null ? undefined : baseGet(object, path);
  31434. return result === undefined ? defaultValue : result;
  31435. }
  31436. /**
  31437. * Checks if `path` is a direct property of `object`.
  31438. *
  31439. * @static
  31440. * @since 0.1.0
  31441. * @memberOf _
  31442. * @category Object
  31443. * @param {Object} object The object to query.
  31444. * @param {Array|string} path The path to check.
  31445. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  31446. * @example
  31447. *
  31448. * var object = { 'a': { 'b': 2 } };
  31449. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  31450. *
  31451. * _.has(object, 'a');
  31452. * // => true
  31453. *
  31454. * _.has(object, 'a.b');
  31455. * // => true
  31456. *
  31457. * _.has(object, ['a', 'b']);
  31458. * // => true
  31459. *
  31460. * _.has(other, 'a');
  31461. * // => false
  31462. */
  31463. function has(object, path) {
  31464. return object != null && hasPath(object, path, baseHas);
  31465. }
  31466. /**
  31467. * Checks if `path` is a direct or inherited property of `object`.
  31468. *
  31469. * @static
  31470. * @memberOf _
  31471. * @since 4.0.0
  31472. * @category Object
  31473. * @param {Object} object The object to query.
  31474. * @param {Array|string} path The path to check.
  31475. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  31476. * @example
  31477. *
  31478. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  31479. *
  31480. * _.hasIn(object, 'a');
  31481. * // => true
  31482. *
  31483. * _.hasIn(object, 'a.b');
  31484. * // => true
  31485. *
  31486. * _.hasIn(object, ['a', 'b']);
  31487. * // => true
  31488. *
  31489. * _.hasIn(object, 'b');
  31490. * // => false
  31491. */
  31492. function hasIn(object, path) {
  31493. return object != null && hasPath(object, path, baseHasIn);
  31494. }
  31495. /**
  31496. * Creates an object composed of the inverted keys and values of `object`.
  31497. * If `object` contains duplicate values, subsequent values overwrite
  31498. * property assignments of previous values.
  31499. *
  31500. * @static
  31501. * @memberOf _
  31502. * @since 0.7.0
  31503. * @category Object
  31504. * @param {Object} object The object to invert.
  31505. * @returns {Object} Returns the new inverted object.
  31506. * @example
  31507. *
  31508. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  31509. *
  31510. * _.invert(object);
  31511. * // => { '1': 'c', '2': 'b' }
  31512. */
  31513. var invert = createInverter(function(result, value, key) {
  31514. if (value != null &&
  31515. typeof value.toString != 'function') {
  31516. value = nativeObjectToString.call(value);
  31517. }
  31518. result[value] = key;
  31519. }, constant(identity));
  31520. /**
  31521. * This method is like `_.invert` except that the inverted object is generated
  31522. * from the results of running each element of `object` thru `iteratee`. The
  31523. * corresponding inverted value of each inverted key is an array of keys
  31524. * responsible for generating the inverted value. The iteratee is invoked
  31525. * with one argument: (value).
  31526. *
  31527. * @static
  31528. * @memberOf _
  31529. * @since 4.1.0
  31530. * @category Object
  31531. * @param {Object} object The object to invert.
  31532. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  31533. * @returns {Object} Returns the new inverted object.
  31534. * @example
  31535. *
  31536. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  31537. *
  31538. * _.invertBy(object);
  31539. * // => { '1': ['a', 'c'], '2': ['b'] }
  31540. *
  31541. * _.invertBy(object, function(value) {
  31542. * return 'group' + value;
  31543. * });
  31544. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  31545. */
  31546. var invertBy = createInverter(function(result, value, key) {
  31547. if (value != null &&
  31548. typeof value.toString != 'function') {
  31549. value = nativeObjectToString.call(value);
  31550. }
  31551. if (hasOwnProperty.call(result, value)) {
  31552. result[value].push(key);
  31553. } else {
  31554. result[value] = [key];
  31555. }
  31556. }, getIteratee);
  31557. /**
  31558. * Invokes the method at `path` of `object`.
  31559. *
  31560. * @static
  31561. * @memberOf _
  31562. * @since 4.0.0
  31563. * @category Object
  31564. * @param {Object} object The object to query.
  31565. * @param {Array|string} path The path of the method to invoke.
  31566. * @param {...*} [args] The arguments to invoke the method with.
  31567. * @returns {*} Returns the result of the invoked method.
  31568. * @example
  31569. *
  31570. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  31571. *
  31572. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  31573. * // => [2, 3]
  31574. */
  31575. var invoke = baseRest(baseInvoke);
  31576. /**
  31577. * Creates an array of the own enumerable property names of `object`.
  31578. *
  31579. * **Note:** Non-object values are coerced to objects. See the
  31580. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  31581. * for more details.
  31582. *
  31583. * @static
  31584. * @since 0.1.0
  31585. * @memberOf _
  31586. * @category Object
  31587. * @param {Object} object The object to query.
  31588. * @returns {Array} Returns the array of property names.
  31589. * @example
  31590. *
  31591. * function Foo() {
  31592. * this.a = 1;
  31593. * this.b = 2;
  31594. * }
  31595. *
  31596. * Foo.prototype.c = 3;
  31597. *
  31598. * _.keys(new Foo);
  31599. * // => ['a', 'b'] (iteration order is not guaranteed)
  31600. *
  31601. * _.keys('hi');
  31602. * // => ['0', '1']
  31603. */
  31604. function keys(object) {
  31605. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  31606. }
  31607. /**
  31608. * Creates an array of the own and inherited enumerable property names of `object`.
  31609. *
  31610. * **Note:** Non-object values are coerced to objects.
  31611. *
  31612. * @static
  31613. * @memberOf _
  31614. * @since 3.0.0
  31615. * @category Object
  31616. * @param {Object} object The object to query.
  31617. * @returns {Array} Returns the array of property names.
  31618. * @example
  31619. *
  31620. * function Foo() {
  31621. * this.a = 1;
  31622. * this.b = 2;
  31623. * }
  31624. *
  31625. * Foo.prototype.c = 3;
  31626. *
  31627. * _.keysIn(new Foo);
  31628. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  31629. */
  31630. function keysIn(object) {
  31631. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  31632. }
  31633. /**
  31634. * The opposite of `_.mapValues`; this method creates an object with the
  31635. * same values as `object` and keys generated by running each own enumerable
  31636. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  31637. * with three arguments: (value, key, object).
  31638. *
  31639. * @static
  31640. * @memberOf _
  31641. * @since 3.8.0
  31642. * @category Object
  31643. * @param {Object} object The object to iterate over.
  31644. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  31645. * @returns {Object} Returns the new mapped object.
  31646. * @see _.mapValues
  31647. * @example
  31648. *
  31649. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  31650. * return key + value;
  31651. * });
  31652. * // => { 'a1': 1, 'b2': 2 }
  31653. */
  31654. function mapKeys(object, iteratee) {
  31655. var result = {};
  31656. iteratee = getIteratee(iteratee, 3);
  31657. baseForOwn(object, function(value, key, object) {
  31658. baseAssignValue(result, iteratee(value, key, object), value);
  31659. });
  31660. return result;
  31661. }
  31662. /**
  31663. * Creates an object with the same keys as `object` and values generated
  31664. * by running each own enumerable string keyed property of `object` thru
  31665. * `iteratee`. The iteratee is invoked with three arguments:
  31666. * (value, key, object).
  31667. *
  31668. * @static
  31669. * @memberOf _
  31670. * @since 2.4.0
  31671. * @category Object
  31672. * @param {Object} object The object to iterate over.
  31673. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  31674. * @returns {Object} Returns the new mapped object.
  31675. * @see _.mapKeys
  31676. * @example
  31677. *
  31678. * var users = {
  31679. * 'fred': { 'user': 'fred', 'age': 40 },
  31680. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  31681. * };
  31682. *
  31683. * _.mapValues(users, function(o) { return o.age; });
  31684. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  31685. *
  31686. * // The `_.property` iteratee shorthand.
  31687. * _.mapValues(users, 'age');
  31688. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  31689. */
  31690. function mapValues(object, iteratee) {
  31691. var result = {};
  31692. iteratee = getIteratee(iteratee, 3);
  31693. baseForOwn(object, function(value, key, object) {
  31694. baseAssignValue(result, key, iteratee(value, key, object));
  31695. });
  31696. return result;
  31697. }
  31698. /**
  31699. * This method is like `_.assign` except that it recursively merges own and
  31700. * inherited enumerable string keyed properties of source objects into the
  31701. * destination object. Source properties that resolve to `undefined` are
  31702. * skipped if a destination value exists. Array and plain object properties
  31703. * are merged recursively. Other objects and value types are overridden by
  31704. * assignment. Source objects are applied from left to right. Subsequent
  31705. * sources overwrite property assignments of previous sources.
  31706. *
  31707. * **Note:** This method mutates `object`.
  31708. *
  31709. * @static
  31710. * @memberOf _
  31711. * @since 0.5.0
  31712. * @category Object
  31713. * @param {Object} object The destination object.
  31714. * @param {...Object} [sources] The source objects.
  31715. * @returns {Object} Returns `object`.
  31716. * @example
  31717. *
  31718. * var object = {
  31719. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  31720. * };
  31721. *
  31722. * var other = {
  31723. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  31724. * };
  31725. *
  31726. * _.merge(object, other);
  31727. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  31728. */
  31729. var merge = createAssigner(function(object, source, srcIndex) {
  31730. baseMerge(object, source, srcIndex);
  31731. });
  31732. /**
  31733. * This method is like `_.merge` except that it accepts `customizer` which
  31734. * is invoked to produce the merged values of the destination and source
  31735. * properties. If `customizer` returns `undefined`, merging is handled by the
  31736. * method instead. The `customizer` is invoked with six arguments:
  31737. * (objValue, srcValue, key, object, source, stack).
  31738. *
  31739. * **Note:** This method mutates `object`.
  31740. *
  31741. * @static
  31742. * @memberOf _
  31743. * @since 4.0.0
  31744. * @category Object
  31745. * @param {Object} object The destination object.
  31746. * @param {...Object} sources The source objects.
  31747. * @param {Function} customizer The function to customize assigned values.
  31748. * @returns {Object} Returns `object`.
  31749. * @example
  31750. *
  31751. * function customizer(objValue, srcValue) {
  31752. * if (_.isArray(objValue)) {
  31753. * return objValue.concat(srcValue);
  31754. * }
  31755. * }
  31756. *
  31757. * var object = { 'a': [1], 'b': [2] };
  31758. * var other = { 'a': [3], 'b': [4] };
  31759. *
  31760. * _.mergeWith(object, other, customizer);
  31761. * // => { 'a': [1, 3], 'b': [2, 4] }
  31762. */
  31763. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  31764. baseMerge(object, source, srcIndex, customizer);
  31765. });
  31766. /**
  31767. * The opposite of `_.pick`; this method creates an object composed of the
  31768. * own and inherited enumerable property paths of `object` that are not omitted.
  31769. *
  31770. * **Note:** This method is considerably slower than `_.pick`.
  31771. *
  31772. * @static
  31773. * @since 0.1.0
  31774. * @memberOf _
  31775. * @category Object
  31776. * @param {Object} object The source object.
  31777. * @param {...(string|string[])} [paths] The property paths to omit.
  31778. * @returns {Object} Returns the new object.
  31779. * @example
  31780. *
  31781. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  31782. *
  31783. * _.omit(object, ['a', 'c']);
  31784. * // => { 'b': '2' }
  31785. */
  31786. var omit = flatRest(function(object, paths) {
  31787. var result = {};
  31788. if (object == null) {
  31789. return result;
  31790. }
  31791. var isDeep = false;
  31792. paths = arrayMap(paths, function(path) {
  31793. path = castPath(path, object);
  31794. isDeep || (isDeep = path.length > 1);
  31795. return path;
  31796. });
  31797. copyObject(object, getAllKeysIn(object), result);
  31798. if (isDeep) {
  31799. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  31800. }
  31801. var length = paths.length;
  31802. while (length--) {
  31803. baseUnset(result, paths[length]);
  31804. }
  31805. return result;
  31806. });
  31807. /**
  31808. * The opposite of `_.pickBy`; this method creates an object composed of
  31809. * the own and inherited enumerable string keyed properties of `object` that
  31810. * `predicate` doesn't return truthy for. The predicate is invoked with two
  31811. * arguments: (value, key).
  31812. *
  31813. * @static
  31814. * @memberOf _
  31815. * @since 4.0.0
  31816. * @category Object
  31817. * @param {Object} object The source object.
  31818. * @param {Function} [predicate=_.identity] The function invoked per property.
  31819. * @returns {Object} Returns the new object.
  31820. * @example
  31821. *
  31822. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  31823. *
  31824. * _.omitBy(object, _.isNumber);
  31825. * // => { 'b': '2' }
  31826. */
  31827. function omitBy(object, predicate) {
  31828. return pickBy(object, negate(getIteratee(predicate)));
  31829. }
  31830. /**
  31831. * Creates an object composed of the picked `object` properties.
  31832. *
  31833. * @static
  31834. * @since 0.1.0
  31835. * @memberOf _
  31836. * @category Object
  31837. * @param {Object} object The source object.
  31838. * @param {...(string|string[])} [paths] The property paths to pick.
  31839. * @returns {Object} Returns the new object.
  31840. * @example
  31841. *
  31842. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  31843. *
  31844. * _.pick(object, ['a', 'c']);
  31845. * // => { 'a': 1, 'c': 3 }
  31846. */
  31847. var pick = flatRest(function(object, paths) {
  31848. return object == null ? {} : basePick(object, paths);
  31849. });
  31850. /**
  31851. * Creates an object composed of the `object` properties `predicate` returns
  31852. * truthy for. The predicate is invoked with two arguments: (value, key).
  31853. *
  31854. * @static
  31855. * @memberOf _
  31856. * @since 4.0.0
  31857. * @category Object
  31858. * @param {Object} object The source object.
  31859. * @param {Function} [predicate=_.identity] The function invoked per property.
  31860. * @returns {Object} Returns the new object.
  31861. * @example
  31862. *
  31863. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  31864. *
  31865. * _.pickBy(object, _.isNumber);
  31866. * // => { 'a': 1, 'c': 3 }
  31867. */
  31868. function pickBy(object, predicate) {
  31869. if (object == null) {
  31870. return {};
  31871. }
  31872. var props = arrayMap(getAllKeysIn(object), function(prop) {
  31873. return [prop];
  31874. });
  31875. predicate = getIteratee(predicate);
  31876. return basePickBy(object, props, function(value, path) {
  31877. return predicate(value, path[0]);
  31878. });
  31879. }
  31880. /**
  31881. * This method is like `_.get` except that if the resolved value is a
  31882. * function it's invoked with the `this` binding of its parent object and
  31883. * its result is returned.
  31884. *
  31885. * @static
  31886. * @since 0.1.0
  31887. * @memberOf _
  31888. * @category Object
  31889. * @param {Object} object The object to query.
  31890. * @param {Array|string} path The path of the property to resolve.
  31891. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  31892. * @returns {*} Returns the resolved value.
  31893. * @example
  31894. *
  31895. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  31896. *
  31897. * _.result(object, 'a[0].b.c1');
  31898. * // => 3
  31899. *
  31900. * _.result(object, 'a[0].b.c2');
  31901. * // => 4
  31902. *
  31903. * _.result(object, 'a[0].b.c3', 'default');
  31904. * // => 'default'
  31905. *
  31906. * _.result(object, 'a[0].b.c3', _.constant('default'));
  31907. * // => 'default'
  31908. */
  31909. function result(object, path, defaultValue) {
  31910. path = castPath(path, object);
  31911. var index = -1,
  31912. length = path.length;
  31913. // Ensure the loop is entered when path is empty.
  31914. if (!length) {
  31915. length = 1;
  31916. object = undefined;
  31917. }
  31918. while (++index < length) {
  31919. var value = object == null ? undefined : object[toKey(path[index])];
  31920. if (value === undefined) {
  31921. index = length;
  31922. value = defaultValue;
  31923. }
  31924. object = isFunction(value) ? value.call(object) : value;
  31925. }
  31926. return object;
  31927. }
  31928. /**
  31929. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  31930. * it's created. Arrays are created for missing index properties while objects
  31931. * are created for all other missing properties. Use `_.setWith` to customize
  31932. * `path` creation.
  31933. *
  31934. * **Note:** This method mutates `object`.
  31935. *
  31936. * @static
  31937. * @memberOf _
  31938. * @since 3.7.0
  31939. * @category Object
  31940. * @param {Object} object The object to modify.
  31941. * @param {Array|string} path The path of the property to set.
  31942. * @param {*} value The value to set.
  31943. * @returns {Object} Returns `object`.
  31944. * @example
  31945. *
  31946. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  31947. *
  31948. * _.set(object, 'a[0].b.c', 4);
  31949. * console.log(object.a[0].b.c);
  31950. * // => 4
  31951. *
  31952. * _.set(object, ['x', '0', 'y', 'z'], 5);
  31953. * console.log(object.x[0].y.z);
  31954. * // => 5
  31955. */
  31956. function set(object, path, value) {
  31957. return object == null ? object : baseSet(object, path, value);
  31958. }
  31959. /**
  31960. * This method is like `_.set` except that it accepts `customizer` which is
  31961. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  31962. * path creation is handled by the method instead. The `customizer` is invoked
  31963. * with three arguments: (nsValue, key, nsObject).
  31964. *
  31965. * **Note:** This method mutates `object`.
  31966. *
  31967. * @static
  31968. * @memberOf _
  31969. * @since 4.0.0
  31970. * @category Object
  31971. * @param {Object} object The object to modify.
  31972. * @param {Array|string} path The path of the property to set.
  31973. * @param {*} value The value to set.
  31974. * @param {Function} [customizer] The function to customize assigned values.
  31975. * @returns {Object} Returns `object`.
  31976. * @example
  31977. *
  31978. * var object = {};
  31979. *
  31980. * _.setWith(object, '[0][1]', 'a', Object);
  31981. * // => { '0': { '1': 'a' } }
  31982. */
  31983. function setWith(object, path, value, customizer) {
  31984. customizer = typeof customizer == 'function' ? customizer : undefined;
  31985. return object == null ? object : baseSet(object, path, value, customizer);
  31986. }
  31987. /**
  31988. * Creates an array of own enumerable string keyed-value pairs for `object`
  31989. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  31990. * entries are returned.
  31991. *
  31992. * @static
  31993. * @memberOf _
  31994. * @since 4.0.0
  31995. * @alias entries
  31996. * @category Object
  31997. * @param {Object} object The object to query.
  31998. * @returns {Array} Returns the key-value pairs.
  31999. * @example
  32000. *
  32001. * function Foo() {
  32002. * this.a = 1;
  32003. * this.b = 2;
  32004. * }
  32005. *
  32006. * Foo.prototype.c = 3;
  32007. *
  32008. * _.toPairs(new Foo);
  32009. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  32010. */
  32011. var toPairs = createToPairs(keys);
  32012. /**
  32013. * Creates an array of own and inherited enumerable string keyed-value pairs
  32014. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  32015. * or set, its entries are returned.
  32016. *
  32017. * @static
  32018. * @memberOf _
  32019. * @since 4.0.0
  32020. * @alias entriesIn
  32021. * @category Object
  32022. * @param {Object} object The object to query.
  32023. * @returns {Array} Returns the key-value pairs.
  32024. * @example
  32025. *
  32026. * function Foo() {
  32027. * this.a = 1;
  32028. * this.b = 2;
  32029. * }
  32030. *
  32031. * Foo.prototype.c = 3;
  32032. *
  32033. * _.toPairsIn(new Foo);
  32034. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  32035. */
  32036. var toPairsIn = createToPairs(keysIn);
  32037. /**
  32038. * An alternative to `_.reduce`; this method transforms `object` to a new
  32039. * `accumulator` object which is the result of running each of its own
  32040. * enumerable string keyed properties thru `iteratee`, with each invocation
  32041. * potentially mutating the `accumulator` object. If `accumulator` is not
  32042. * provided, a new object with the same `[[Prototype]]` will be used. The
  32043. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  32044. * Iteratee functions may exit iteration early by explicitly returning `false`.
  32045. *
  32046. * @static
  32047. * @memberOf _
  32048. * @since 1.3.0
  32049. * @category Object
  32050. * @param {Object} object The object to iterate over.
  32051. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  32052. * @param {*} [accumulator] The custom accumulator value.
  32053. * @returns {*} Returns the accumulated value.
  32054. * @example
  32055. *
  32056. * _.transform([2, 3, 4], function(result, n) {
  32057. * result.push(n *= n);
  32058. * return n % 2 == 0;
  32059. * }, []);
  32060. * // => [4, 9]
  32061. *
  32062. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  32063. * (result[value] || (result[value] = [])).push(key);
  32064. * }, {});
  32065. * // => { '1': ['a', 'c'], '2': ['b'] }
  32066. */
  32067. function transform(object, iteratee, accumulator) {
  32068. var isArr = isArray(object),
  32069. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  32070. iteratee = getIteratee(iteratee, 4);
  32071. if (accumulator == null) {
  32072. var Ctor = object && object.constructor;
  32073. if (isArrLike) {
  32074. accumulator = isArr ? new Ctor : [];
  32075. }
  32076. else if (isObject(object)) {
  32077. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  32078. }
  32079. else {
  32080. accumulator = {};
  32081. }
  32082. }
  32083. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  32084. return iteratee(accumulator, value, index, object);
  32085. });
  32086. return accumulator;
  32087. }
  32088. /**
  32089. * Removes the property at `path` of `object`.
  32090. *
  32091. * **Note:** This method mutates `object`.
  32092. *
  32093. * @static
  32094. * @memberOf _
  32095. * @since 4.0.0
  32096. * @category Object
  32097. * @param {Object} object The object to modify.
  32098. * @param {Array|string} path The path of the property to unset.
  32099. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  32100. * @example
  32101. *
  32102. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  32103. * _.unset(object, 'a[0].b.c');
  32104. * // => true
  32105. *
  32106. * console.log(object);
  32107. * // => { 'a': [{ 'b': {} }] };
  32108. *
  32109. * _.unset(object, ['a', '0', 'b', 'c']);
  32110. * // => true
  32111. *
  32112. * console.log(object);
  32113. * // => { 'a': [{ 'b': {} }] };
  32114. */
  32115. function unset(object, path) {
  32116. return object == null ? true : baseUnset(object, path);
  32117. }
  32118. /**
  32119. * This method is like `_.set` except that accepts `updater` to produce the
  32120. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  32121. * is invoked with one argument: (value).
  32122. *
  32123. * **Note:** This method mutates `object`.
  32124. *
  32125. * @static
  32126. * @memberOf _
  32127. * @since 4.6.0
  32128. * @category Object
  32129. * @param {Object} object The object to modify.
  32130. * @param {Array|string} path The path of the property to set.
  32131. * @param {Function} updater The function to produce the updated value.
  32132. * @returns {Object} Returns `object`.
  32133. * @example
  32134. *
  32135. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  32136. *
  32137. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  32138. * console.log(object.a[0].b.c);
  32139. * // => 9
  32140. *
  32141. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  32142. * console.log(object.x[0].y.z);
  32143. * // => 0
  32144. */
  32145. function update(object, path, updater) {
  32146. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  32147. }
  32148. /**
  32149. * This method is like `_.update` except that it accepts `customizer` which is
  32150. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  32151. * path creation is handled by the method instead. The `customizer` is invoked
  32152. * with three arguments: (nsValue, key, nsObject).
  32153. *
  32154. * **Note:** This method mutates `object`.
  32155. *
  32156. * @static
  32157. * @memberOf _
  32158. * @since 4.6.0
  32159. * @category Object
  32160. * @param {Object} object The object to modify.
  32161. * @param {Array|string} path The path of the property to set.
  32162. * @param {Function} updater The function to produce the updated value.
  32163. * @param {Function} [customizer] The function to customize assigned values.
  32164. * @returns {Object} Returns `object`.
  32165. * @example
  32166. *
  32167. * var object = {};
  32168. *
  32169. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  32170. * // => { '0': { '1': 'a' } }
  32171. */
  32172. function updateWith(object, path, updater, customizer) {
  32173. customizer = typeof customizer == 'function' ? customizer : undefined;
  32174. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  32175. }
  32176. /**
  32177. * Creates an array of the own enumerable string keyed property values of `object`.
  32178. *
  32179. * **Note:** Non-object values are coerced to objects.
  32180. *
  32181. * @static
  32182. * @since 0.1.0
  32183. * @memberOf _
  32184. * @category Object
  32185. * @param {Object} object The object to query.
  32186. * @returns {Array} Returns the array of property values.
  32187. * @example
  32188. *
  32189. * function Foo() {
  32190. * this.a = 1;
  32191. * this.b = 2;
  32192. * }
  32193. *
  32194. * Foo.prototype.c = 3;
  32195. *
  32196. * _.values(new Foo);
  32197. * // => [1, 2] (iteration order is not guaranteed)
  32198. *
  32199. * _.values('hi');
  32200. * // => ['h', 'i']
  32201. */
  32202. function values(object) {
  32203. return object == null ? [] : baseValues(object, keys(object));
  32204. }
  32205. /**
  32206. * Creates an array of the own and inherited enumerable string keyed property
  32207. * values of `object`.
  32208. *
  32209. * **Note:** Non-object values are coerced to objects.
  32210. *
  32211. * @static
  32212. * @memberOf _
  32213. * @since 3.0.0
  32214. * @category Object
  32215. * @param {Object} object The object to query.
  32216. * @returns {Array} Returns the array of property values.
  32217. * @example
  32218. *
  32219. * function Foo() {
  32220. * this.a = 1;
  32221. * this.b = 2;
  32222. * }
  32223. *
  32224. * Foo.prototype.c = 3;
  32225. *
  32226. * _.valuesIn(new Foo);
  32227. * // => [1, 2, 3] (iteration order is not guaranteed)
  32228. */
  32229. function valuesIn(object) {
  32230. return object == null ? [] : baseValues(object, keysIn(object));
  32231. }
  32232. /*------------------------------------------------------------------------*/
  32233. /**
  32234. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  32235. *
  32236. * @static
  32237. * @memberOf _
  32238. * @since 4.0.0
  32239. * @category Number
  32240. * @param {number} number The number to clamp.
  32241. * @param {number} [lower] The lower bound.
  32242. * @param {number} upper The upper bound.
  32243. * @returns {number} Returns the clamped number.
  32244. * @example
  32245. *
  32246. * _.clamp(-10, -5, 5);
  32247. * // => -5
  32248. *
  32249. * _.clamp(10, -5, 5);
  32250. * // => 5
  32251. */
  32252. function clamp(number, lower, upper) {
  32253. if (upper === undefined) {
  32254. upper = lower;
  32255. lower = undefined;
  32256. }
  32257. if (upper !== undefined) {
  32258. upper = toNumber(upper);
  32259. upper = upper === upper ? upper : 0;
  32260. }
  32261. if (lower !== undefined) {
  32262. lower = toNumber(lower);
  32263. lower = lower === lower ? lower : 0;
  32264. }
  32265. return baseClamp(toNumber(number), lower, upper);
  32266. }
  32267. /**
  32268. * Checks if `n` is between `start` and up to, but not including, `end`. If
  32269. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  32270. * If `start` is greater than `end` the params are swapped to support
  32271. * negative ranges.
  32272. *
  32273. * @static
  32274. * @memberOf _
  32275. * @since 3.3.0
  32276. * @category Number
  32277. * @param {number} number The number to check.
  32278. * @param {number} [start=0] The start of the range.
  32279. * @param {number} end The end of the range.
  32280. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  32281. * @see _.range, _.rangeRight
  32282. * @example
  32283. *
  32284. * _.inRange(3, 2, 4);
  32285. * // => true
  32286. *
  32287. * _.inRange(4, 8);
  32288. * // => true
  32289. *
  32290. * _.inRange(4, 2);
  32291. * // => false
  32292. *
  32293. * _.inRange(2, 2);
  32294. * // => false
  32295. *
  32296. * _.inRange(1.2, 2);
  32297. * // => true
  32298. *
  32299. * _.inRange(5.2, 4);
  32300. * // => false
  32301. *
  32302. * _.inRange(-3, -2, -6);
  32303. * // => true
  32304. */
  32305. function inRange(number, start, end) {
  32306. start = toFinite(start);
  32307. if (end === undefined) {
  32308. end = start;
  32309. start = 0;
  32310. } else {
  32311. end = toFinite(end);
  32312. }
  32313. number = toNumber(number);
  32314. return baseInRange(number, start, end);
  32315. }
  32316. /**
  32317. * Produces a random number between the inclusive `lower` and `upper` bounds.
  32318. * If only one argument is provided a number between `0` and the given number
  32319. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  32320. * floats, a floating-point number is returned instead of an integer.
  32321. *
  32322. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  32323. * floating-point values which can produce unexpected results.
  32324. *
  32325. * @static
  32326. * @memberOf _
  32327. * @since 0.7.0
  32328. * @category Number
  32329. * @param {number} [lower=0] The lower bound.
  32330. * @param {number} [upper=1] The upper bound.
  32331. * @param {boolean} [floating] Specify returning a floating-point number.
  32332. * @returns {number} Returns the random number.
  32333. * @example
  32334. *
  32335. * _.random(0, 5);
  32336. * // => an integer between 0 and 5
  32337. *
  32338. * _.random(5);
  32339. * // => also an integer between 0 and 5
  32340. *
  32341. * _.random(5, true);
  32342. * // => a floating-point number between 0 and 5
  32343. *
  32344. * _.random(1.2, 5.2);
  32345. * // => a floating-point number between 1.2 and 5.2
  32346. */
  32347. function random(lower, upper, floating) {
  32348. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  32349. upper = floating = undefined;
  32350. }
  32351. if (floating === undefined) {
  32352. if (typeof upper == 'boolean') {
  32353. floating = upper;
  32354. upper = undefined;
  32355. }
  32356. else if (typeof lower == 'boolean') {
  32357. floating = lower;
  32358. lower = undefined;
  32359. }
  32360. }
  32361. if (lower === undefined && upper === undefined) {
  32362. lower = 0;
  32363. upper = 1;
  32364. }
  32365. else {
  32366. lower = toFinite(lower);
  32367. if (upper === undefined) {
  32368. upper = lower;
  32369. lower = 0;
  32370. } else {
  32371. upper = toFinite(upper);
  32372. }
  32373. }
  32374. if (lower > upper) {
  32375. var temp = lower;
  32376. lower = upper;
  32377. upper = temp;
  32378. }
  32379. if (floating || lower % 1 || upper % 1) {
  32380. var rand = nativeRandom();
  32381. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  32382. }
  32383. return baseRandom(lower, upper);
  32384. }
  32385. /*------------------------------------------------------------------------*/
  32386. /**
  32387. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  32388. *
  32389. * @static
  32390. * @memberOf _
  32391. * @since 3.0.0
  32392. * @category String
  32393. * @param {string} [string=''] The string to convert.
  32394. * @returns {string} Returns the camel cased string.
  32395. * @example
  32396. *
  32397. * _.camelCase('Foo Bar');
  32398. * // => 'fooBar'
  32399. *
  32400. * _.camelCase('--foo-bar--');
  32401. * // => 'fooBar'
  32402. *
  32403. * _.camelCase('__FOO_BAR__');
  32404. * // => 'fooBar'
  32405. */
  32406. var camelCase = createCompounder(function(result, word, index) {
  32407. word = word.toLowerCase();
  32408. return result + (index ? capitalize(word) : word);
  32409. });
  32410. /**
  32411. * Converts the first character of `string` to upper case and the remaining
  32412. * to lower case.
  32413. *
  32414. * @static
  32415. * @memberOf _
  32416. * @since 3.0.0
  32417. * @category String
  32418. * @param {string} [string=''] The string to capitalize.
  32419. * @returns {string} Returns the capitalized string.
  32420. * @example
  32421. *
  32422. * _.capitalize('FRED');
  32423. * // => 'Fred'
  32424. */
  32425. function capitalize(string) {
  32426. return upperFirst(toString(string).toLowerCase());
  32427. }
  32428. /**
  32429. * Deburrs `string` by converting
  32430. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  32431. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  32432. * letters to basic Latin letters and removing
  32433. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  32434. *
  32435. * @static
  32436. * @memberOf _
  32437. * @since 3.0.0
  32438. * @category String
  32439. * @param {string} [string=''] The string to deburr.
  32440. * @returns {string} Returns the deburred string.
  32441. * @example
  32442. *
  32443. * _.deburr('déjà vu');
  32444. * // => 'deja vu'
  32445. */
  32446. function deburr(string) {
  32447. string = toString(string);
  32448. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  32449. }
  32450. /**
  32451. * Checks if `string` ends with the given target string.
  32452. *
  32453. * @static
  32454. * @memberOf _
  32455. * @since 3.0.0
  32456. * @category String
  32457. * @param {string} [string=''] The string to inspect.
  32458. * @param {string} [target] The string to search for.
  32459. * @param {number} [position=string.length] The position to search up to.
  32460. * @returns {boolean} Returns `true` if `string` ends with `target`,
  32461. * else `false`.
  32462. * @example
  32463. *
  32464. * _.endsWith('abc', 'c');
  32465. * // => true
  32466. *
  32467. * _.endsWith('abc', 'b');
  32468. * // => false
  32469. *
  32470. * _.endsWith('abc', 'b', 2);
  32471. * // => true
  32472. */
  32473. function endsWith(string, target, position) {
  32474. string = toString(string);
  32475. target = baseToString(target);
  32476. var length = string.length;
  32477. position = position === undefined
  32478. ? length
  32479. : baseClamp(toInteger(position), 0, length);
  32480. var end = position;
  32481. position -= target.length;
  32482. return position >= 0 && string.slice(position, end) == target;
  32483. }
  32484. /**
  32485. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  32486. * corresponding HTML entities.
  32487. *
  32488. * **Note:** No other characters are escaped. To escape additional
  32489. * characters use a third-party library like [_he_](https://mths.be/he).
  32490. *
  32491. * Though the ">" character is escaped for symmetry, characters like
  32492. * ">" and "/" don't need escaping in HTML and have no special meaning
  32493. * unless they're part of a tag or unquoted attribute value. See
  32494. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  32495. * (under "semi-related fun fact") for more details.
  32496. *
  32497. * When working with HTML you should always
  32498. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  32499. * XSS vectors.
  32500. *
  32501. * @static
  32502. * @since 0.1.0
  32503. * @memberOf _
  32504. * @category String
  32505. * @param {string} [string=''] The string to escape.
  32506. * @returns {string} Returns the escaped string.
  32507. * @example
  32508. *
  32509. * _.escape('fred, barney, & pebbles');
  32510. * // => 'fred, barney, &amp; pebbles'
  32511. */
  32512. function escape(string) {
  32513. string = toString(string);
  32514. return (string && reHasUnescapedHtml.test(string))
  32515. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  32516. : string;
  32517. }
  32518. /**
  32519. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  32520. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  32521. *
  32522. * @static
  32523. * @memberOf _
  32524. * @since 3.0.0
  32525. * @category String
  32526. * @param {string} [string=''] The string to escape.
  32527. * @returns {string} Returns the escaped string.
  32528. * @example
  32529. *
  32530. * _.escapeRegExp('[lodash](https://lodash.com/)');
  32531. * // => '\[lodash\]\(https://lodash\.com/\)'
  32532. */
  32533. function escapeRegExp(string) {
  32534. string = toString(string);
  32535. return (string && reHasRegExpChar.test(string))
  32536. ? string.replace(reRegExpChar, '\\$&')
  32537. : string;
  32538. }
  32539. /**
  32540. * Converts `string` to
  32541. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  32542. *
  32543. * @static
  32544. * @memberOf _
  32545. * @since 3.0.0
  32546. * @category String
  32547. * @param {string} [string=''] The string to convert.
  32548. * @returns {string} Returns the kebab cased string.
  32549. * @example
  32550. *
  32551. * _.kebabCase('Foo Bar');
  32552. * // => 'foo-bar'
  32553. *
  32554. * _.kebabCase('fooBar');
  32555. * // => 'foo-bar'
  32556. *
  32557. * _.kebabCase('__FOO_BAR__');
  32558. * // => 'foo-bar'
  32559. */
  32560. var kebabCase = createCompounder(function(result, word, index) {
  32561. return result + (index ? '-' : '') + word.toLowerCase();
  32562. });
  32563. /**
  32564. * Converts `string`, as space separated words, to lower case.
  32565. *
  32566. * @static
  32567. * @memberOf _
  32568. * @since 4.0.0
  32569. * @category String
  32570. * @param {string} [string=''] The string to convert.
  32571. * @returns {string} Returns the lower cased string.
  32572. * @example
  32573. *
  32574. * _.lowerCase('--Foo-Bar--');
  32575. * // => 'foo bar'
  32576. *
  32577. * _.lowerCase('fooBar');
  32578. * // => 'foo bar'
  32579. *
  32580. * _.lowerCase('__FOO_BAR__');
  32581. * // => 'foo bar'
  32582. */
  32583. var lowerCase = createCompounder(function(result, word, index) {
  32584. return result + (index ? ' ' : '') + word.toLowerCase();
  32585. });
  32586. /**
  32587. * Converts the first character of `string` to lower case.
  32588. *
  32589. * @static
  32590. * @memberOf _
  32591. * @since 4.0.0
  32592. * @category String
  32593. * @param {string} [string=''] The string to convert.
  32594. * @returns {string} Returns the converted string.
  32595. * @example
  32596. *
  32597. * _.lowerFirst('Fred');
  32598. * // => 'fred'
  32599. *
  32600. * _.lowerFirst('FRED');
  32601. * // => 'fRED'
  32602. */
  32603. var lowerFirst = createCaseFirst('toLowerCase');
  32604. /**
  32605. * Pads `string` on the left and right sides if it's shorter than `length`.
  32606. * Padding characters are truncated if they can't be evenly divided by `length`.
  32607. *
  32608. * @static
  32609. * @memberOf _
  32610. * @since 3.0.0
  32611. * @category String
  32612. * @param {string} [string=''] The string to pad.
  32613. * @param {number} [length=0] The padding length.
  32614. * @param {string} [chars=' '] The string used as padding.
  32615. * @returns {string} Returns the padded string.
  32616. * @example
  32617. *
  32618. * _.pad('abc', 8);
  32619. * // => ' abc '
  32620. *
  32621. * _.pad('abc', 8, '_-');
  32622. * // => '_-abc_-_'
  32623. *
  32624. * _.pad('abc', 3);
  32625. * // => 'abc'
  32626. */
  32627. function pad(string, length, chars) {
  32628. string = toString(string);
  32629. length = toInteger(length);
  32630. var strLength = length ? stringSize(string) : 0;
  32631. if (!length || strLength >= length) {
  32632. return string;
  32633. }
  32634. var mid = (length - strLength) / 2;
  32635. return (
  32636. createPadding(nativeFloor(mid), chars) +
  32637. string +
  32638. createPadding(nativeCeil(mid), chars)
  32639. );
  32640. }
  32641. /**
  32642. * Pads `string` on the right side if it's shorter than `length`. Padding
  32643. * characters are truncated if they exceed `length`.
  32644. *
  32645. * @static
  32646. * @memberOf _
  32647. * @since 4.0.0
  32648. * @category String
  32649. * @param {string} [string=''] The string to pad.
  32650. * @param {number} [length=0] The padding length.
  32651. * @param {string} [chars=' '] The string used as padding.
  32652. * @returns {string} Returns the padded string.
  32653. * @example
  32654. *
  32655. * _.padEnd('abc', 6);
  32656. * // => 'abc '
  32657. *
  32658. * _.padEnd('abc', 6, '_-');
  32659. * // => 'abc_-_'
  32660. *
  32661. * _.padEnd('abc', 3);
  32662. * // => 'abc'
  32663. */
  32664. function padEnd(string, length, chars) {
  32665. string = toString(string);
  32666. length = toInteger(length);
  32667. var strLength = length ? stringSize(string) : 0;
  32668. return (length && strLength < length)
  32669. ? (string + createPadding(length - strLength, chars))
  32670. : string;
  32671. }
  32672. /**
  32673. * Pads `string` on the left side if it's shorter than `length`. Padding
  32674. * characters are truncated if they exceed `length`.
  32675. *
  32676. * @static
  32677. * @memberOf _
  32678. * @since 4.0.0
  32679. * @category String
  32680. * @param {string} [string=''] The string to pad.
  32681. * @param {number} [length=0] The padding length.
  32682. * @param {string} [chars=' '] The string used as padding.
  32683. * @returns {string} Returns the padded string.
  32684. * @example
  32685. *
  32686. * _.padStart('abc', 6);
  32687. * // => ' abc'
  32688. *
  32689. * _.padStart('abc', 6, '_-');
  32690. * // => '_-_abc'
  32691. *
  32692. * _.padStart('abc', 3);
  32693. * // => 'abc'
  32694. */
  32695. function padStart(string, length, chars) {
  32696. string = toString(string);
  32697. length = toInteger(length);
  32698. var strLength = length ? stringSize(string) : 0;
  32699. return (length && strLength < length)
  32700. ? (createPadding(length - strLength, chars) + string)
  32701. : string;
  32702. }
  32703. /**
  32704. * Converts `string` to an integer of the specified radix. If `radix` is
  32705. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  32706. * hexadecimal, in which case a `radix` of `16` is used.
  32707. *
  32708. * **Note:** This method aligns with the
  32709. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  32710. *
  32711. * @static
  32712. * @memberOf _
  32713. * @since 1.1.0
  32714. * @category String
  32715. * @param {string} string The string to convert.
  32716. * @param {number} [radix=10] The radix to interpret `value` by.
  32717. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  32718. * @returns {number} Returns the converted integer.
  32719. * @example
  32720. *
  32721. * _.parseInt('08');
  32722. * // => 8
  32723. *
  32724. * _.map(['6', '08', '10'], _.parseInt);
  32725. * // => [6, 8, 10]
  32726. */
  32727. function parseInt(string, radix, guard) {
  32728. if (guard || radix == null) {
  32729. radix = 0;
  32730. } else if (radix) {
  32731. radix = +radix;
  32732. }
  32733. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  32734. }
  32735. /**
  32736. * Repeats the given string `n` times.
  32737. *
  32738. * @static
  32739. * @memberOf _
  32740. * @since 3.0.0
  32741. * @category String
  32742. * @param {string} [string=''] The string to repeat.
  32743. * @param {number} [n=1] The number of times to repeat the string.
  32744. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  32745. * @returns {string} Returns the repeated string.
  32746. * @example
  32747. *
  32748. * _.repeat('*', 3);
  32749. * // => '***'
  32750. *
  32751. * _.repeat('abc', 2);
  32752. * // => 'abcabc'
  32753. *
  32754. * _.repeat('abc', 0);
  32755. * // => ''
  32756. */
  32757. function repeat(string, n, guard) {
  32758. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  32759. n = 1;
  32760. } else {
  32761. n = toInteger(n);
  32762. }
  32763. return baseRepeat(toString(string), n);
  32764. }
  32765. /**
  32766. * Replaces matches for `pattern` in `string` with `replacement`.
  32767. *
  32768. * **Note:** This method is based on
  32769. * [`String#replace`](https://mdn.io/String/replace).
  32770. *
  32771. * @static
  32772. * @memberOf _
  32773. * @since 4.0.0
  32774. * @category String
  32775. * @param {string} [string=''] The string to modify.
  32776. * @param {RegExp|string} pattern The pattern to replace.
  32777. * @param {Function|string} replacement The match replacement.
  32778. * @returns {string} Returns the modified string.
  32779. * @example
  32780. *
  32781. * _.replace('Hi Fred', 'Fred', 'Barney');
  32782. * // => 'Hi Barney'
  32783. */
  32784. function replace() {
  32785. var args = arguments,
  32786. string = toString(args[0]);
  32787. return args.length < 3 ? string : string.replace(args[1], args[2]);
  32788. }
  32789. /**
  32790. * Converts `string` to
  32791. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  32792. *
  32793. * @static
  32794. * @memberOf _
  32795. * @since 3.0.0
  32796. * @category String
  32797. * @param {string} [string=''] The string to convert.
  32798. * @returns {string} Returns the snake cased string.
  32799. * @example
  32800. *
  32801. * _.snakeCase('Foo Bar');
  32802. * // => 'foo_bar'
  32803. *
  32804. * _.snakeCase('fooBar');
  32805. * // => 'foo_bar'
  32806. *
  32807. * _.snakeCase('--FOO-BAR--');
  32808. * // => 'foo_bar'
  32809. */
  32810. var snakeCase = createCompounder(function(result, word, index) {
  32811. return result + (index ? '_' : '') + word.toLowerCase();
  32812. });
  32813. /**
  32814. * Splits `string` by `separator`.
  32815. *
  32816. * **Note:** This method is based on
  32817. * [`String#split`](https://mdn.io/String/split).
  32818. *
  32819. * @static
  32820. * @memberOf _
  32821. * @since 4.0.0
  32822. * @category String
  32823. * @param {string} [string=''] The string to split.
  32824. * @param {RegExp|string} separator The separator pattern to split by.
  32825. * @param {number} [limit] The length to truncate results to.
  32826. * @returns {Array} Returns the string segments.
  32827. * @example
  32828. *
  32829. * _.split('a-b-c', '-', 2);
  32830. * // => ['a', 'b']
  32831. */
  32832. function split(string, separator, limit) {
  32833. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  32834. separator = limit = undefined;
  32835. }
  32836. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  32837. if (!limit) {
  32838. return [];
  32839. }
  32840. string = toString(string);
  32841. if (string && (
  32842. typeof separator == 'string' ||
  32843. (separator != null && !isRegExp(separator))
  32844. )) {
  32845. separator = baseToString(separator);
  32846. if (!separator && hasUnicode(string)) {
  32847. return castSlice(stringToArray(string), 0, limit);
  32848. }
  32849. }
  32850. return string.split(separator, limit);
  32851. }
  32852. /**
  32853. * Converts `string` to
  32854. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  32855. *
  32856. * @static
  32857. * @memberOf _
  32858. * @since 3.1.0
  32859. * @category String
  32860. * @param {string} [string=''] The string to convert.
  32861. * @returns {string} Returns the start cased string.
  32862. * @example
  32863. *
  32864. * _.startCase('--foo-bar--');
  32865. * // => 'Foo Bar'
  32866. *
  32867. * _.startCase('fooBar');
  32868. * // => 'Foo Bar'
  32869. *
  32870. * _.startCase('__FOO_BAR__');
  32871. * // => 'FOO BAR'
  32872. */
  32873. var startCase = createCompounder(function(result, word, index) {
  32874. return result + (index ? ' ' : '') + upperFirst(word);
  32875. });
  32876. /**
  32877. * Checks if `string` starts with the given target string.
  32878. *
  32879. * @static
  32880. * @memberOf _
  32881. * @since 3.0.0
  32882. * @category String
  32883. * @param {string} [string=''] The string to inspect.
  32884. * @param {string} [target] The string to search for.
  32885. * @param {number} [position=0] The position to search from.
  32886. * @returns {boolean} Returns `true` if `string` starts with `target`,
  32887. * else `false`.
  32888. * @example
  32889. *
  32890. * _.startsWith('abc', 'a');
  32891. * // => true
  32892. *
  32893. * _.startsWith('abc', 'b');
  32894. * // => false
  32895. *
  32896. * _.startsWith('abc', 'b', 1);
  32897. * // => true
  32898. */
  32899. function startsWith(string, target, position) {
  32900. string = toString(string);
  32901. position = position == null
  32902. ? 0
  32903. : baseClamp(toInteger(position), 0, string.length);
  32904. target = baseToString(target);
  32905. return string.slice(position, position + target.length) == target;
  32906. }
  32907. /**
  32908. * Creates a compiled template function that can interpolate data properties
  32909. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  32910. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  32911. * properties may be accessed as free variables in the template. If a setting
  32912. * object is given, it takes precedence over `_.templateSettings` values.
  32913. *
  32914. * **Note:** In the development build `_.template` utilizes
  32915. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  32916. * for easier debugging.
  32917. *
  32918. * For more information on precompiling templates see
  32919. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  32920. *
  32921. * For more information on Chrome extension sandboxes see
  32922. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  32923. *
  32924. * @static
  32925. * @since 0.1.0
  32926. * @memberOf _
  32927. * @category String
  32928. * @param {string} [string=''] The template string.
  32929. * @param {Object} [options={}] The options object.
  32930. * @param {RegExp} [options.escape=_.templateSettings.escape]
  32931. * The HTML "escape" delimiter.
  32932. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  32933. * The "evaluate" delimiter.
  32934. * @param {Object} [options.imports=_.templateSettings.imports]
  32935. * An object to import into the template as free variables.
  32936. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  32937. * The "interpolate" delimiter.
  32938. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  32939. * The sourceURL of the compiled template.
  32940. * @param {string} [options.variable='obj']
  32941. * The data object variable name.
  32942. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  32943. * @returns {Function} Returns the compiled template function.
  32944. * @example
  32945. *
  32946. * // Use the "interpolate" delimiter to create a compiled template.
  32947. * var compiled = _.template('hello <%= user %>!');
  32948. * compiled({ 'user': 'fred' });
  32949. * // => 'hello fred!'
  32950. *
  32951. * // Use the HTML "escape" delimiter to escape data property values.
  32952. * var compiled = _.template('<b><%- value %></b>');
  32953. * compiled({ 'value': '<script>' });
  32954. * // => '<b>&lt;script&gt;</b>'
  32955. *
  32956. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  32957. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  32958. * compiled({ 'users': ['fred', 'barney'] });
  32959. * // => '<li>fred</li><li>barney</li>'
  32960. *
  32961. * // Use the internal `print` function in "evaluate" delimiters.
  32962. * var compiled = _.template('<% print("hello " + user); %>!');
  32963. * compiled({ 'user': 'barney' });
  32964. * // => 'hello barney!'
  32965. *
  32966. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  32967. * // Disable support by replacing the "interpolate" delimiter.
  32968. * var compiled = _.template('hello ${ user }!');
  32969. * compiled({ 'user': 'pebbles' });
  32970. * // => 'hello pebbles!'
  32971. *
  32972. * // Use backslashes to treat delimiters as plain text.
  32973. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  32974. * compiled({ 'value': 'ignored' });
  32975. * // => '<%- value %>'
  32976. *
  32977. * // Use the `imports` option to import `jQuery` as `jq`.
  32978. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  32979. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  32980. * compiled({ 'users': ['fred', 'barney'] });
  32981. * // => '<li>fred</li><li>barney</li>'
  32982. *
  32983. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  32984. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  32985. * compiled(data);
  32986. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  32987. *
  32988. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  32989. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  32990. * compiled.source;
  32991. * // => function(data) {
  32992. * // var __t, __p = '';
  32993. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  32994. * // return __p;
  32995. * // }
  32996. *
  32997. * // Use custom template delimiters.
  32998. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  32999. * var compiled = _.template('hello {{ user }}!');
  33000. * compiled({ 'user': 'mustache' });
  33001. * // => 'hello mustache!'
  33002. *
  33003. * // Use the `source` property to inline compiled templates for meaningful
  33004. * // line numbers in error messages and stack traces.
  33005. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  33006. * var JST = {\
  33007. * "main": ' + _.template(mainText).source + '\
  33008. * };\
  33009. * ');
  33010. */
  33011. function template(string, options, guard) {
  33012. // Based on John Resig's `tmpl` implementation
  33013. // (http://ejohn.org/blog/javascript-micro-templating/)
  33014. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  33015. var settings = lodash.templateSettings;
  33016. if (guard && isIterateeCall(string, options, guard)) {
  33017. options = undefined;
  33018. }
  33019. string = toString(string);
  33020. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  33021. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  33022. importsKeys = keys(imports),
  33023. importsValues = baseValues(imports, importsKeys);
  33024. var isEscaping,
  33025. isEvaluating,
  33026. index = 0,
  33027. interpolate = options.interpolate || reNoMatch,
  33028. source = "__p += '";
  33029. // Compile the regexp to match each delimiter.
  33030. var reDelimiters = RegExp(
  33031. (options.escape || reNoMatch).source + '|' +
  33032. interpolate.source + '|' +
  33033. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  33034. (options.evaluate || reNoMatch).source + '|$'
  33035. , 'g');
  33036. // Use a sourceURL for easier debugging.
  33037. // The sourceURL gets injected into the source that's eval-ed, so be careful
  33038. // with lookup (in case of e.g. prototype pollution), and strip newlines if any.
  33039. // A newline wouldn't be a valid sourceURL anyway, and it'd enable code injection.
  33040. var sourceURL = '//# sourceURL=' +
  33041. (hasOwnProperty.call(options, 'sourceURL')
  33042. ? (options.sourceURL + '').replace(/[\r\n]/g, ' ')
  33043. : ('lodash.templateSources[' + (++templateCounter) + ']')
  33044. ) + '\n';
  33045. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  33046. interpolateValue || (interpolateValue = esTemplateValue);
  33047. // Escape characters that can't be included in string literals.
  33048. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  33049. // Replace delimiters with snippets.
  33050. if (escapeValue) {
  33051. isEscaping = true;
  33052. source += "' +\n__e(" + escapeValue + ") +\n'";
  33053. }
  33054. if (evaluateValue) {
  33055. isEvaluating = true;
  33056. source += "';\n" + evaluateValue + ";\n__p += '";
  33057. }
  33058. if (interpolateValue) {
  33059. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  33060. }
  33061. index = offset + match.length;
  33062. // The JS engine embedded in Adobe products needs `match` returned in
  33063. // order to produce the correct `offset` value.
  33064. return match;
  33065. });
  33066. source += "';\n";
  33067. // If `variable` is not specified wrap a with-statement around the generated
  33068. // code to add the data object to the top of the scope chain.
  33069. // Like with sourceURL, we take care to not check the option's prototype,
  33070. // as this configuration is a code injection vector.
  33071. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  33072. if (!variable) {
  33073. source = 'with (obj) {\n' + source + '\n}\n';
  33074. }
  33075. // Cleanup code by stripping empty strings.
  33076. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  33077. .replace(reEmptyStringMiddle, '$1')
  33078. .replace(reEmptyStringTrailing, '$1;');
  33079. // Frame code as the function body.
  33080. source = 'function(' + (variable || 'obj') + ') {\n' +
  33081. (variable
  33082. ? ''
  33083. : 'obj || (obj = {});\n'
  33084. ) +
  33085. "var __t, __p = ''" +
  33086. (isEscaping
  33087. ? ', __e = _.escape'
  33088. : ''
  33089. ) +
  33090. (isEvaluating
  33091. ? ', __j = Array.prototype.join;\n' +
  33092. "function print() { __p += __j.call(arguments, '') }\n"
  33093. : ';\n'
  33094. ) +
  33095. source +
  33096. 'return __p\n}';
  33097. var result = attempt(function() {
  33098. return Function(importsKeys, sourceURL + 'return ' + source)
  33099. .apply(undefined, importsValues);
  33100. });
  33101. // Provide the compiled function's source by its `toString` method or
  33102. // the `source` property as a convenience for inlining compiled templates.
  33103. result.source = source;
  33104. if (isError(result)) {
  33105. throw result;
  33106. }
  33107. return result;
  33108. }
  33109. /**
  33110. * Converts `string`, as a whole, to lower case just like
  33111. * [String#toLowerCase](https://mdn.io/toLowerCase).
  33112. *
  33113. * @static
  33114. * @memberOf _
  33115. * @since 4.0.0
  33116. * @category String
  33117. * @param {string} [string=''] The string to convert.
  33118. * @returns {string} Returns the lower cased string.
  33119. * @example
  33120. *
  33121. * _.toLower('--Foo-Bar--');
  33122. * // => '--foo-bar--'
  33123. *
  33124. * _.toLower('fooBar');
  33125. * // => 'foobar'
  33126. *
  33127. * _.toLower('__FOO_BAR__');
  33128. * // => '__foo_bar__'
  33129. */
  33130. function toLower(value) {
  33131. return toString(value).toLowerCase();
  33132. }
  33133. /**
  33134. * Converts `string`, as a whole, to upper case just like
  33135. * [String#toUpperCase](https://mdn.io/toUpperCase).
  33136. *
  33137. * @static
  33138. * @memberOf _
  33139. * @since 4.0.0
  33140. * @category String
  33141. * @param {string} [string=''] The string to convert.
  33142. * @returns {string} Returns the upper cased string.
  33143. * @example
  33144. *
  33145. * _.toUpper('--foo-bar--');
  33146. * // => '--FOO-BAR--'
  33147. *
  33148. * _.toUpper('fooBar');
  33149. * // => 'FOOBAR'
  33150. *
  33151. * _.toUpper('__foo_bar__');
  33152. * // => '__FOO_BAR__'
  33153. */
  33154. function toUpper(value) {
  33155. return toString(value).toUpperCase();
  33156. }
  33157. /**
  33158. * Removes leading and trailing whitespace or specified characters from `string`.
  33159. *
  33160. * @static
  33161. * @memberOf _
  33162. * @since 3.0.0
  33163. * @category String
  33164. * @param {string} [string=''] The string to trim.
  33165. * @param {string} [chars=whitespace] The characters to trim.
  33166. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  33167. * @returns {string} Returns the trimmed string.
  33168. * @example
  33169. *
  33170. * _.trim(' abc ');
  33171. * // => 'abc'
  33172. *
  33173. * _.trim('-_-abc-_-', '_-');
  33174. * // => 'abc'
  33175. *
  33176. * _.map([' foo ', ' bar '], _.trim);
  33177. * // => ['foo', 'bar']
  33178. */
  33179. function trim(string, chars, guard) {
  33180. string = toString(string);
  33181. if (string && (guard || chars === undefined)) {
  33182. return string.replace(reTrim, '');
  33183. }
  33184. if (!string || !(chars = baseToString(chars))) {
  33185. return string;
  33186. }
  33187. var strSymbols = stringToArray(string),
  33188. chrSymbols = stringToArray(chars),
  33189. start = charsStartIndex(strSymbols, chrSymbols),
  33190. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  33191. return castSlice(strSymbols, start, end).join('');
  33192. }
  33193. /**
  33194. * Removes trailing whitespace or specified characters from `string`.
  33195. *
  33196. * @static
  33197. * @memberOf _
  33198. * @since 4.0.0
  33199. * @category String
  33200. * @param {string} [string=''] The string to trim.
  33201. * @param {string} [chars=whitespace] The characters to trim.
  33202. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  33203. * @returns {string} Returns the trimmed string.
  33204. * @example
  33205. *
  33206. * _.trimEnd(' abc ');
  33207. * // => ' abc'
  33208. *
  33209. * _.trimEnd('-_-abc-_-', '_-');
  33210. * // => '-_-abc'
  33211. */
  33212. function trimEnd(string, chars, guard) {
  33213. string = toString(string);
  33214. if (string && (guard || chars === undefined)) {
  33215. return string.replace(reTrimEnd, '');
  33216. }
  33217. if (!string || !(chars = baseToString(chars))) {
  33218. return string;
  33219. }
  33220. var strSymbols = stringToArray(string),
  33221. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  33222. return castSlice(strSymbols, 0, end).join('');
  33223. }
  33224. /**
  33225. * Removes leading whitespace or specified characters from `string`.
  33226. *
  33227. * @static
  33228. * @memberOf _
  33229. * @since 4.0.0
  33230. * @category String
  33231. * @param {string} [string=''] The string to trim.
  33232. * @param {string} [chars=whitespace] The characters to trim.
  33233. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  33234. * @returns {string} Returns the trimmed string.
  33235. * @example
  33236. *
  33237. * _.trimStart(' abc ');
  33238. * // => 'abc '
  33239. *
  33240. * _.trimStart('-_-abc-_-', '_-');
  33241. * // => 'abc-_-'
  33242. */
  33243. function trimStart(string, chars, guard) {
  33244. string = toString(string);
  33245. if (string && (guard || chars === undefined)) {
  33246. return string.replace(reTrimStart, '');
  33247. }
  33248. if (!string || !(chars = baseToString(chars))) {
  33249. return string;
  33250. }
  33251. var strSymbols = stringToArray(string),
  33252. start = charsStartIndex(strSymbols, stringToArray(chars));
  33253. return castSlice(strSymbols, start).join('');
  33254. }
  33255. /**
  33256. * Truncates `string` if it's longer than the given maximum string length.
  33257. * The last characters of the truncated string are replaced with the omission
  33258. * string which defaults to "...".
  33259. *
  33260. * @static
  33261. * @memberOf _
  33262. * @since 4.0.0
  33263. * @category String
  33264. * @param {string} [string=''] The string to truncate.
  33265. * @param {Object} [options={}] The options object.
  33266. * @param {number} [options.length=30] The maximum string length.
  33267. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  33268. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  33269. * @returns {string} Returns the truncated string.
  33270. * @example
  33271. *
  33272. * _.truncate('hi-diddly-ho there, neighborino');
  33273. * // => 'hi-diddly-ho there, neighbo...'
  33274. *
  33275. * _.truncate('hi-diddly-ho there, neighborino', {
  33276. * 'length': 24,
  33277. * 'separator': ' '
  33278. * });
  33279. * // => 'hi-diddly-ho there,...'
  33280. *
  33281. * _.truncate('hi-diddly-ho there, neighborino', {
  33282. * 'length': 24,
  33283. * 'separator': /,? +/
  33284. * });
  33285. * // => 'hi-diddly-ho there...'
  33286. *
  33287. * _.truncate('hi-diddly-ho there, neighborino', {
  33288. * 'omission': ' [...]'
  33289. * });
  33290. * // => 'hi-diddly-ho there, neig [...]'
  33291. */
  33292. function truncate(string, options) {
  33293. var length = DEFAULT_TRUNC_LENGTH,
  33294. omission = DEFAULT_TRUNC_OMISSION;
  33295. if (isObject(options)) {
  33296. var separator = 'separator' in options ? options.separator : separator;
  33297. length = 'length' in options ? toInteger(options.length) : length;
  33298. omission = 'omission' in options ? baseToString(options.omission) : omission;
  33299. }
  33300. string = toString(string);
  33301. var strLength = string.length;
  33302. if (hasUnicode(string)) {
  33303. var strSymbols = stringToArray(string);
  33304. strLength = strSymbols.length;
  33305. }
  33306. if (length >= strLength) {
  33307. return string;
  33308. }
  33309. var end = length - stringSize(omission);
  33310. if (end < 1) {
  33311. return omission;
  33312. }
  33313. var result = strSymbols
  33314. ? castSlice(strSymbols, 0, end).join('')
  33315. : string.slice(0, end);
  33316. if (separator === undefined) {
  33317. return result + omission;
  33318. }
  33319. if (strSymbols) {
  33320. end += (result.length - end);
  33321. }
  33322. if (isRegExp(separator)) {
  33323. if (string.slice(end).search(separator)) {
  33324. var match,
  33325. substring = result;
  33326. if (!separator.global) {
  33327. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  33328. }
  33329. separator.lastIndex = 0;
  33330. while ((match = separator.exec(substring))) {
  33331. var newEnd = match.index;
  33332. }
  33333. result = result.slice(0, newEnd === undefined ? end : newEnd);
  33334. }
  33335. } else if (string.indexOf(baseToString(separator), end) != end) {
  33336. var index = result.lastIndexOf(separator);
  33337. if (index > -1) {
  33338. result = result.slice(0, index);
  33339. }
  33340. }
  33341. return result + omission;
  33342. }
  33343. /**
  33344. * The inverse of `_.escape`; this method converts the HTML entities
  33345. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  33346. * their corresponding characters.
  33347. *
  33348. * **Note:** No other HTML entities are unescaped. To unescape additional
  33349. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  33350. *
  33351. * @static
  33352. * @memberOf _
  33353. * @since 0.6.0
  33354. * @category String
  33355. * @param {string} [string=''] The string to unescape.
  33356. * @returns {string} Returns the unescaped string.
  33357. * @example
  33358. *
  33359. * _.unescape('fred, barney, &amp; pebbles');
  33360. * // => 'fred, barney, & pebbles'
  33361. */
  33362. function unescape(string) {
  33363. string = toString(string);
  33364. return (string && reHasEscapedHtml.test(string))
  33365. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  33366. : string;
  33367. }
  33368. /**
  33369. * Converts `string`, as space separated words, to upper case.
  33370. *
  33371. * @static
  33372. * @memberOf _
  33373. * @since 4.0.0
  33374. * @category String
  33375. * @param {string} [string=''] The string to convert.
  33376. * @returns {string} Returns the upper cased string.
  33377. * @example
  33378. *
  33379. * _.upperCase('--foo-bar');
  33380. * // => 'FOO BAR'
  33381. *
  33382. * _.upperCase('fooBar');
  33383. * // => 'FOO BAR'
  33384. *
  33385. * _.upperCase('__foo_bar__');
  33386. * // => 'FOO BAR'
  33387. */
  33388. var upperCase = createCompounder(function(result, word, index) {
  33389. return result + (index ? ' ' : '') + word.toUpperCase();
  33390. });
  33391. /**
  33392. * Converts the first character of `string` to upper case.
  33393. *
  33394. * @static
  33395. * @memberOf _
  33396. * @since 4.0.0
  33397. * @category String
  33398. * @param {string} [string=''] The string to convert.
  33399. * @returns {string} Returns the converted string.
  33400. * @example
  33401. *
  33402. * _.upperFirst('fred');
  33403. * // => 'Fred'
  33404. *
  33405. * _.upperFirst('FRED');
  33406. * // => 'FRED'
  33407. */
  33408. var upperFirst = createCaseFirst('toUpperCase');
  33409. /**
  33410. * Splits `string` into an array of its words.
  33411. *
  33412. * @static
  33413. * @memberOf _
  33414. * @since 3.0.0
  33415. * @category String
  33416. * @param {string} [string=''] The string to inspect.
  33417. * @param {RegExp|string} [pattern] The pattern to match words.
  33418. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  33419. * @returns {Array} Returns the words of `string`.
  33420. * @example
  33421. *
  33422. * _.words('fred, barney, & pebbles');
  33423. * // => ['fred', 'barney', 'pebbles']
  33424. *
  33425. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  33426. * // => ['fred', 'barney', '&', 'pebbles']
  33427. */
  33428. function words(string, pattern, guard) {
  33429. string = toString(string);
  33430. pattern = guard ? undefined : pattern;
  33431. if (pattern === undefined) {
  33432. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  33433. }
  33434. return string.match(pattern) || [];
  33435. }
  33436. /*------------------------------------------------------------------------*/
  33437. /**
  33438. * Attempts to invoke `func`, returning either the result or the caught error
  33439. * object. Any additional arguments are provided to `func` when it's invoked.
  33440. *
  33441. * @static
  33442. * @memberOf _
  33443. * @since 3.0.0
  33444. * @category Util
  33445. * @param {Function} func The function to attempt.
  33446. * @param {...*} [args] The arguments to invoke `func` with.
  33447. * @returns {*} Returns the `func` result or error object.
  33448. * @example
  33449. *
  33450. * // Avoid throwing errors for invalid selectors.
  33451. * var elements = _.attempt(function(selector) {
  33452. * return document.querySelectorAll(selector);
  33453. * }, '>_>');
  33454. *
  33455. * if (_.isError(elements)) {
  33456. * elements = [];
  33457. * }
  33458. */
  33459. var attempt = baseRest(function(func, args) {
  33460. try {
  33461. return apply(func, undefined, args);
  33462. } catch (e) {
  33463. return isError(e) ? e : new Error(e);
  33464. }
  33465. });
  33466. /**
  33467. * Binds methods of an object to the object itself, overwriting the existing
  33468. * method.
  33469. *
  33470. * **Note:** This method doesn't set the "length" property of bound functions.
  33471. *
  33472. * @static
  33473. * @since 0.1.0
  33474. * @memberOf _
  33475. * @category Util
  33476. * @param {Object} object The object to bind and assign the bound methods to.
  33477. * @param {...(string|string[])} methodNames The object method names to bind.
  33478. * @returns {Object} Returns `object`.
  33479. * @example
  33480. *
  33481. * var view = {
  33482. * 'label': 'docs',
  33483. * 'click': function() {
  33484. * console.log('clicked ' + this.label);
  33485. * }
  33486. * };
  33487. *
  33488. * _.bindAll(view, ['click']);
  33489. * jQuery(element).on('click', view.click);
  33490. * // => Logs 'clicked docs' when clicked.
  33491. */
  33492. var bindAll = flatRest(function(object, methodNames) {
  33493. arrayEach(methodNames, function(key) {
  33494. key = toKey(key);
  33495. baseAssignValue(object, key, bind(object[key], object));
  33496. });
  33497. return object;
  33498. });
  33499. /**
  33500. * Creates a function that iterates over `pairs` and invokes the corresponding
  33501. * function of the first predicate to return truthy. The predicate-function
  33502. * pairs are invoked with the `this` binding and arguments of the created
  33503. * function.
  33504. *
  33505. * @static
  33506. * @memberOf _
  33507. * @since 4.0.0
  33508. * @category Util
  33509. * @param {Array} pairs The predicate-function pairs.
  33510. * @returns {Function} Returns the new composite function.
  33511. * @example
  33512. *
  33513. * var func = _.cond([
  33514. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  33515. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  33516. * [_.stubTrue, _.constant('no match')]
  33517. * ]);
  33518. *
  33519. * func({ 'a': 1, 'b': 2 });
  33520. * // => 'matches A'
  33521. *
  33522. * func({ 'a': 0, 'b': 1 });
  33523. * // => 'matches B'
  33524. *
  33525. * func({ 'a': '1', 'b': '2' });
  33526. * // => 'no match'
  33527. */
  33528. function cond(pairs) {
  33529. var length = pairs == null ? 0 : pairs.length,
  33530. toIteratee = getIteratee();
  33531. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  33532. if (typeof pair[1] != 'function') {
  33533. throw new TypeError(FUNC_ERROR_TEXT);
  33534. }
  33535. return [toIteratee(pair[0]), pair[1]];
  33536. });
  33537. return baseRest(function(args) {
  33538. var index = -1;
  33539. while (++index < length) {
  33540. var pair = pairs[index];
  33541. if (apply(pair[0], this, args)) {
  33542. return apply(pair[1], this, args);
  33543. }
  33544. }
  33545. });
  33546. }
  33547. /**
  33548. * Creates a function that invokes the predicate properties of `source` with
  33549. * the corresponding property values of a given object, returning `true` if
  33550. * all predicates return truthy, else `false`.
  33551. *
  33552. * **Note:** The created function is equivalent to `_.conformsTo` with
  33553. * `source` partially applied.
  33554. *
  33555. * @static
  33556. * @memberOf _
  33557. * @since 4.0.0
  33558. * @category Util
  33559. * @param {Object} source The object of property predicates to conform to.
  33560. * @returns {Function} Returns the new spec function.
  33561. * @example
  33562. *
  33563. * var objects = [
  33564. * { 'a': 2, 'b': 1 },
  33565. * { 'a': 1, 'b': 2 }
  33566. * ];
  33567. *
  33568. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  33569. * // => [{ 'a': 1, 'b': 2 }]
  33570. */
  33571. function conforms(source) {
  33572. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  33573. }
  33574. /**
  33575. * Creates a function that returns `value`.
  33576. *
  33577. * @static
  33578. * @memberOf _
  33579. * @since 2.4.0
  33580. * @category Util
  33581. * @param {*} value The value to return from the new function.
  33582. * @returns {Function} Returns the new constant function.
  33583. * @example
  33584. *
  33585. * var objects = _.times(2, _.constant({ 'a': 1 }));
  33586. *
  33587. * console.log(objects);
  33588. * // => [{ 'a': 1 }, { 'a': 1 }]
  33589. *
  33590. * console.log(objects[0] === objects[1]);
  33591. * // => true
  33592. */
  33593. function constant(value) {
  33594. return function() {
  33595. return value;
  33596. };
  33597. }
  33598. /**
  33599. * Checks `value` to determine whether a default value should be returned in
  33600. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  33601. * or `undefined`.
  33602. *
  33603. * @static
  33604. * @memberOf _
  33605. * @since 4.14.0
  33606. * @category Util
  33607. * @param {*} value The value to check.
  33608. * @param {*} defaultValue The default value.
  33609. * @returns {*} Returns the resolved value.
  33610. * @example
  33611. *
  33612. * _.defaultTo(1, 10);
  33613. * // => 1
  33614. *
  33615. * _.defaultTo(undefined, 10);
  33616. * // => 10
  33617. */
  33618. function defaultTo(value, defaultValue) {
  33619. return (value == null || value !== value) ? defaultValue : value;
  33620. }
  33621. /**
  33622. * Creates a function that returns the result of invoking the given functions
  33623. * with the `this` binding of the created function, where each successive
  33624. * invocation is supplied the return value of the previous.
  33625. *
  33626. * @static
  33627. * @memberOf _
  33628. * @since 3.0.0
  33629. * @category Util
  33630. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  33631. * @returns {Function} Returns the new composite function.
  33632. * @see _.flowRight
  33633. * @example
  33634. *
  33635. * function square(n) {
  33636. * return n * n;
  33637. * }
  33638. *
  33639. * var addSquare = _.flow([_.add, square]);
  33640. * addSquare(1, 2);
  33641. * // => 9
  33642. */
  33643. var flow = createFlow();
  33644. /**
  33645. * This method is like `_.flow` except that it creates a function that
  33646. * invokes the given functions from right to left.
  33647. *
  33648. * @static
  33649. * @since 3.0.0
  33650. * @memberOf _
  33651. * @category Util
  33652. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  33653. * @returns {Function} Returns the new composite function.
  33654. * @see _.flow
  33655. * @example
  33656. *
  33657. * function square(n) {
  33658. * return n * n;
  33659. * }
  33660. *
  33661. * var addSquare = _.flowRight([square, _.add]);
  33662. * addSquare(1, 2);
  33663. * // => 9
  33664. */
  33665. var flowRight = createFlow(true);
  33666. /**
  33667. * This method returns the first argument it receives.
  33668. *
  33669. * @static
  33670. * @since 0.1.0
  33671. * @memberOf _
  33672. * @category Util
  33673. * @param {*} value Any value.
  33674. * @returns {*} Returns `value`.
  33675. * @example
  33676. *
  33677. * var object = { 'a': 1 };
  33678. *
  33679. * console.log(_.identity(object) === object);
  33680. * // => true
  33681. */
  33682. function identity(value) {
  33683. return value;
  33684. }
  33685. /**
  33686. * Creates a function that invokes `func` with the arguments of the created
  33687. * function. If `func` is a property name, the created function returns the
  33688. * property value for a given element. If `func` is an array or object, the
  33689. * created function returns `true` for elements that contain the equivalent
  33690. * source properties, otherwise it returns `false`.
  33691. *
  33692. * @static
  33693. * @since 4.0.0
  33694. * @memberOf _
  33695. * @category Util
  33696. * @param {*} [func=_.identity] The value to convert to a callback.
  33697. * @returns {Function} Returns the callback.
  33698. * @example
  33699. *
  33700. * var users = [
  33701. * { 'user': 'barney', 'age': 36, 'active': true },
  33702. * { 'user': 'fred', 'age': 40, 'active': false }
  33703. * ];
  33704. *
  33705. * // The `_.matches` iteratee shorthand.
  33706. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  33707. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  33708. *
  33709. * // The `_.matchesProperty` iteratee shorthand.
  33710. * _.filter(users, _.iteratee(['user', 'fred']));
  33711. * // => [{ 'user': 'fred', 'age': 40 }]
  33712. *
  33713. * // The `_.property` iteratee shorthand.
  33714. * _.map(users, _.iteratee('user'));
  33715. * // => ['barney', 'fred']
  33716. *
  33717. * // Create custom iteratee shorthands.
  33718. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  33719. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  33720. * return func.test(string);
  33721. * };
  33722. * });
  33723. *
  33724. * _.filter(['abc', 'def'], /ef/);
  33725. * // => ['def']
  33726. */
  33727. function iteratee(func) {
  33728. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  33729. }
  33730. /**
  33731. * Creates a function that performs a partial deep comparison between a given
  33732. * object and `source`, returning `true` if the given object has equivalent
  33733. * property values, else `false`.
  33734. *
  33735. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  33736. * partially applied.
  33737. *
  33738. * Partial comparisons will match empty array and empty object `source`
  33739. * values against any array or object value, respectively. See `_.isEqual`
  33740. * for a list of supported value comparisons.
  33741. *
  33742. * @static
  33743. * @memberOf _
  33744. * @since 3.0.0
  33745. * @category Util
  33746. * @param {Object} source The object of property values to match.
  33747. * @returns {Function} Returns the new spec function.
  33748. * @example
  33749. *
  33750. * var objects = [
  33751. * { 'a': 1, 'b': 2, 'c': 3 },
  33752. * { 'a': 4, 'b': 5, 'c': 6 }
  33753. * ];
  33754. *
  33755. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  33756. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  33757. */
  33758. function matches(source) {
  33759. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  33760. }
  33761. /**
  33762. * Creates a function that performs a partial deep comparison between the
  33763. * value at `path` of a given object to `srcValue`, returning `true` if the
  33764. * object value is equivalent, else `false`.
  33765. *
  33766. * **Note:** Partial comparisons will match empty array and empty object
  33767. * `srcValue` values against any array or object value, respectively. See
  33768. * `_.isEqual` for a list of supported value comparisons.
  33769. *
  33770. * @static
  33771. * @memberOf _
  33772. * @since 3.2.0
  33773. * @category Util
  33774. * @param {Array|string} path The path of the property to get.
  33775. * @param {*} srcValue The value to match.
  33776. * @returns {Function} Returns the new spec function.
  33777. * @example
  33778. *
  33779. * var objects = [
  33780. * { 'a': 1, 'b': 2, 'c': 3 },
  33781. * { 'a': 4, 'b': 5, 'c': 6 }
  33782. * ];
  33783. *
  33784. * _.find(objects, _.matchesProperty('a', 4));
  33785. * // => { 'a': 4, 'b': 5, 'c': 6 }
  33786. */
  33787. function matchesProperty(path, srcValue) {
  33788. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  33789. }
  33790. /**
  33791. * Creates a function that invokes the method at `path` of a given object.
  33792. * Any additional arguments are provided to the invoked method.
  33793. *
  33794. * @static
  33795. * @memberOf _
  33796. * @since 3.7.0
  33797. * @category Util
  33798. * @param {Array|string} path The path of the method to invoke.
  33799. * @param {...*} [args] The arguments to invoke the method with.
  33800. * @returns {Function} Returns the new invoker function.
  33801. * @example
  33802. *
  33803. * var objects = [
  33804. * { 'a': { 'b': _.constant(2) } },
  33805. * { 'a': { 'b': _.constant(1) } }
  33806. * ];
  33807. *
  33808. * _.map(objects, _.method('a.b'));
  33809. * // => [2, 1]
  33810. *
  33811. * _.map(objects, _.method(['a', 'b']));
  33812. * // => [2, 1]
  33813. */
  33814. var method = baseRest(function(path, args) {
  33815. return function(object) {
  33816. return baseInvoke(object, path, args);
  33817. };
  33818. });
  33819. /**
  33820. * The opposite of `_.method`; this method creates a function that invokes
  33821. * the method at a given path of `object`. Any additional arguments are
  33822. * provided to the invoked method.
  33823. *
  33824. * @static
  33825. * @memberOf _
  33826. * @since 3.7.0
  33827. * @category Util
  33828. * @param {Object} object The object to query.
  33829. * @param {...*} [args] The arguments to invoke the method with.
  33830. * @returns {Function} Returns the new invoker function.
  33831. * @example
  33832. *
  33833. * var array = _.times(3, _.constant),
  33834. * object = { 'a': array, 'b': array, 'c': array };
  33835. *
  33836. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  33837. * // => [2, 0]
  33838. *
  33839. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  33840. * // => [2, 0]
  33841. */
  33842. var methodOf = baseRest(function(object, args) {
  33843. return function(path) {
  33844. return baseInvoke(object, path, args);
  33845. };
  33846. });
  33847. /**
  33848. * Adds all own enumerable string keyed function properties of a source
  33849. * object to the destination object. If `object` is a function, then methods
  33850. * are added to its prototype as well.
  33851. *
  33852. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  33853. * avoid conflicts caused by modifying the original.
  33854. *
  33855. * @static
  33856. * @since 0.1.0
  33857. * @memberOf _
  33858. * @category Util
  33859. * @param {Function|Object} [object=lodash] The destination object.
  33860. * @param {Object} source The object of functions to add.
  33861. * @param {Object} [options={}] The options object.
  33862. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  33863. * @returns {Function|Object} Returns `object`.
  33864. * @example
  33865. *
  33866. * function vowels(string) {
  33867. * return _.filter(string, function(v) {
  33868. * return /[aeiou]/i.test(v);
  33869. * });
  33870. * }
  33871. *
  33872. * _.mixin({ 'vowels': vowels });
  33873. * _.vowels('fred');
  33874. * // => ['e']
  33875. *
  33876. * _('fred').vowels().value();
  33877. * // => ['e']
  33878. *
  33879. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  33880. * _('fred').vowels();
  33881. * // => ['e']
  33882. */
  33883. function mixin(object, source, options) {
  33884. var props = keys(source),
  33885. methodNames = baseFunctions(source, props);
  33886. if (options == null &&
  33887. !(isObject(source) && (methodNames.length || !props.length))) {
  33888. options = source;
  33889. source = object;
  33890. object = this;
  33891. methodNames = baseFunctions(source, keys(source));
  33892. }
  33893. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  33894. isFunc = isFunction(object);
  33895. arrayEach(methodNames, function(methodName) {
  33896. var func = source[methodName];
  33897. object[methodName] = func;
  33898. if (isFunc) {
  33899. object.prototype[methodName] = function() {
  33900. var chainAll = this.__chain__;
  33901. if (chain || chainAll) {
  33902. var result = object(this.__wrapped__),
  33903. actions = result.__actions__ = copyArray(this.__actions__);
  33904. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  33905. result.__chain__ = chainAll;
  33906. return result;
  33907. }
  33908. return func.apply(object, arrayPush([this.value()], arguments));
  33909. };
  33910. }
  33911. });
  33912. return object;
  33913. }
  33914. /**
  33915. * Reverts the `_` variable to its previous value and returns a reference to
  33916. * the `lodash` function.
  33917. *
  33918. * @static
  33919. * @since 0.1.0
  33920. * @memberOf _
  33921. * @category Util
  33922. * @returns {Function} Returns the `lodash` function.
  33923. * @example
  33924. *
  33925. * var lodash = _.noConflict();
  33926. */
  33927. function noConflict() {
  33928. if (root._ === this) {
  33929. root._ = oldDash;
  33930. }
  33931. return this;
  33932. }
  33933. /**
  33934. * This method returns `undefined`.
  33935. *
  33936. * @static
  33937. * @memberOf _
  33938. * @since 2.3.0
  33939. * @category Util
  33940. * @example
  33941. *
  33942. * _.times(2, _.noop);
  33943. * // => [undefined, undefined]
  33944. */
  33945. function noop() {
  33946. // No operation performed.
  33947. }
  33948. /**
  33949. * Creates a function that gets the argument at index `n`. If `n` is negative,
  33950. * the nth argument from the end is returned.
  33951. *
  33952. * @static
  33953. * @memberOf _
  33954. * @since 4.0.0
  33955. * @category Util
  33956. * @param {number} [n=0] The index of the argument to return.
  33957. * @returns {Function} Returns the new pass-thru function.
  33958. * @example
  33959. *
  33960. * var func = _.nthArg(1);
  33961. * func('a', 'b', 'c', 'd');
  33962. * // => 'b'
  33963. *
  33964. * var func = _.nthArg(-2);
  33965. * func('a', 'b', 'c', 'd');
  33966. * // => 'c'
  33967. */
  33968. function nthArg(n) {
  33969. n = toInteger(n);
  33970. return baseRest(function(args) {
  33971. return baseNth(args, n);
  33972. });
  33973. }
  33974. /**
  33975. * Creates a function that invokes `iteratees` with the arguments it receives
  33976. * and returns their results.
  33977. *
  33978. * @static
  33979. * @memberOf _
  33980. * @since 4.0.0
  33981. * @category Util
  33982. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  33983. * The iteratees to invoke.
  33984. * @returns {Function} Returns the new function.
  33985. * @example
  33986. *
  33987. * var func = _.over([Math.max, Math.min]);
  33988. *
  33989. * func(1, 2, 3, 4);
  33990. * // => [4, 1]
  33991. */
  33992. var over = createOver(arrayMap);
  33993. /**
  33994. * Creates a function that checks if **all** of the `predicates` return
  33995. * truthy when invoked with the arguments it receives.
  33996. *
  33997. * @static
  33998. * @memberOf _
  33999. * @since 4.0.0
  34000. * @category Util
  34001. * @param {...(Function|Function[])} [predicates=[_.identity]]
  34002. * The predicates to check.
  34003. * @returns {Function} Returns the new function.
  34004. * @example
  34005. *
  34006. * var func = _.overEvery([Boolean, isFinite]);
  34007. *
  34008. * func('1');
  34009. * // => true
  34010. *
  34011. * func(null);
  34012. * // => false
  34013. *
  34014. * func(NaN);
  34015. * // => false
  34016. */
  34017. var overEvery = createOver(arrayEvery);
  34018. /**
  34019. * Creates a function that checks if **any** of the `predicates` return
  34020. * truthy when invoked with the arguments it receives.
  34021. *
  34022. * @static
  34023. * @memberOf _
  34024. * @since 4.0.0
  34025. * @category Util
  34026. * @param {...(Function|Function[])} [predicates=[_.identity]]
  34027. * The predicates to check.
  34028. * @returns {Function} Returns the new function.
  34029. * @example
  34030. *
  34031. * var func = _.overSome([Boolean, isFinite]);
  34032. *
  34033. * func('1');
  34034. * // => true
  34035. *
  34036. * func(null);
  34037. * // => true
  34038. *
  34039. * func(NaN);
  34040. * // => false
  34041. */
  34042. var overSome = createOver(arraySome);
  34043. /**
  34044. * Creates a function that returns the value at `path` of a given object.
  34045. *
  34046. * @static
  34047. * @memberOf _
  34048. * @since 2.4.0
  34049. * @category Util
  34050. * @param {Array|string} path The path of the property to get.
  34051. * @returns {Function} Returns the new accessor function.
  34052. * @example
  34053. *
  34054. * var objects = [
  34055. * { 'a': { 'b': 2 } },
  34056. * { 'a': { 'b': 1 } }
  34057. * ];
  34058. *
  34059. * _.map(objects, _.property('a.b'));
  34060. * // => [2, 1]
  34061. *
  34062. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  34063. * // => [1, 2]
  34064. */
  34065. function property(path) {
  34066. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  34067. }
  34068. /**
  34069. * The opposite of `_.property`; this method creates a function that returns
  34070. * the value at a given path of `object`.
  34071. *
  34072. * @static
  34073. * @memberOf _
  34074. * @since 3.0.0
  34075. * @category Util
  34076. * @param {Object} object The object to query.
  34077. * @returns {Function} Returns the new accessor function.
  34078. * @example
  34079. *
  34080. * var array = [0, 1, 2],
  34081. * object = { 'a': array, 'b': array, 'c': array };
  34082. *
  34083. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  34084. * // => [2, 0]
  34085. *
  34086. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  34087. * // => [2, 0]
  34088. */
  34089. function propertyOf(object) {
  34090. return function(path) {
  34091. return object == null ? undefined : baseGet(object, path);
  34092. };
  34093. }
  34094. /**
  34095. * Creates an array of numbers (positive and/or negative) progressing from
  34096. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  34097. * `start` is specified without an `end` or `step`. If `end` is not specified,
  34098. * it's set to `start` with `start` then set to `0`.
  34099. *
  34100. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  34101. * floating-point values which can produce unexpected results.
  34102. *
  34103. * @static
  34104. * @since 0.1.0
  34105. * @memberOf _
  34106. * @category Util
  34107. * @param {number} [start=0] The start of the range.
  34108. * @param {number} end The end of the range.
  34109. * @param {number} [step=1] The value to increment or decrement by.
  34110. * @returns {Array} Returns the range of numbers.
  34111. * @see _.inRange, _.rangeRight
  34112. * @example
  34113. *
  34114. * _.range(4);
  34115. * // => [0, 1, 2, 3]
  34116. *
  34117. * _.range(-4);
  34118. * // => [0, -1, -2, -3]
  34119. *
  34120. * _.range(1, 5);
  34121. * // => [1, 2, 3, 4]
  34122. *
  34123. * _.range(0, 20, 5);
  34124. * // => [0, 5, 10, 15]
  34125. *
  34126. * _.range(0, -4, -1);
  34127. * // => [0, -1, -2, -3]
  34128. *
  34129. * _.range(1, 4, 0);
  34130. * // => [1, 1, 1]
  34131. *
  34132. * _.range(0);
  34133. * // => []
  34134. */
  34135. var range = createRange();
  34136. /**
  34137. * This method is like `_.range` except that it populates values in
  34138. * descending order.
  34139. *
  34140. * @static
  34141. * @memberOf _
  34142. * @since 4.0.0
  34143. * @category Util
  34144. * @param {number} [start=0] The start of the range.
  34145. * @param {number} end The end of the range.
  34146. * @param {number} [step=1] The value to increment or decrement by.
  34147. * @returns {Array} Returns the range of numbers.
  34148. * @see _.inRange, _.range
  34149. * @example
  34150. *
  34151. * _.rangeRight(4);
  34152. * // => [3, 2, 1, 0]
  34153. *
  34154. * _.rangeRight(-4);
  34155. * // => [-3, -2, -1, 0]
  34156. *
  34157. * _.rangeRight(1, 5);
  34158. * // => [4, 3, 2, 1]
  34159. *
  34160. * _.rangeRight(0, 20, 5);
  34161. * // => [15, 10, 5, 0]
  34162. *
  34163. * _.rangeRight(0, -4, -1);
  34164. * // => [-3, -2, -1, 0]
  34165. *
  34166. * _.rangeRight(1, 4, 0);
  34167. * // => [1, 1, 1]
  34168. *
  34169. * _.rangeRight(0);
  34170. * // => []
  34171. */
  34172. var rangeRight = createRange(true);
  34173. /**
  34174. * This method returns a new empty array.
  34175. *
  34176. * @static
  34177. * @memberOf _
  34178. * @since 4.13.0
  34179. * @category Util
  34180. * @returns {Array} Returns the new empty array.
  34181. * @example
  34182. *
  34183. * var arrays = _.times(2, _.stubArray);
  34184. *
  34185. * console.log(arrays);
  34186. * // => [[], []]
  34187. *
  34188. * console.log(arrays[0] === arrays[1]);
  34189. * // => false
  34190. */
  34191. function stubArray() {
  34192. return [];
  34193. }
  34194. /**
  34195. * This method returns `false`.
  34196. *
  34197. * @static
  34198. * @memberOf _
  34199. * @since 4.13.0
  34200. * @category Util
  34201. * @returns {boolean} Returns `false`.
  34202. * @example
  34203. *
  34204. * _.times(2, _.stubFalse);
  34205. * // => [false, false]
  34206. */
  34207. function stubFalse() {
  34208. return false;
  34209. }
  34210. /**
  34211. * This method returns a new empty object.
  34212. *
  34213. * @static
  34214. * @memberOf _
  34215. * @since 4.13.0
  34216. * @category Util
  34217. * @returns {Object} Returns the new empty object.
  34218. * @example
  34219. *
  34220. * var objects = _.times(2, _.stubObject);
  34221. *
  34222. * console.log(objects);
  34223. * // => [{}, {}]
  34224. *
  34225. * console.log(objects[0] === objects[1]);
  34226. * // => false
  34227. */
  34228. function stubObject() {
  34229. return {};
  34230. }
  34231. /**
  34232. * This method returns an empty string.
  34233. *
  34234. * @static
  34235. * @memberOf _
  34236. * @since 4.13.0
  34237. * @category Util
  34238. * @returns {string} Returns the empty string.
  34239. * @example
  34240. *
  34241. * _.times(2, _.stubString);
  34242. * // => ['', '']
  34243. */
  34244. function stubString() {
  34245. return '';
  34246. }
  34247. /**
  34248. * This method returns `true`.
  34249. *
  34250. * @static
  34251. * @memberOf _
  34252. * @since 4.13.0
  34253. * @category Util
  34254. * @returns {boolean} Returns `true`.
  34255. * @example
  34256. *
  34257. * _.times(2, _.stubTrue);
  34258. * // => [true, true]
  34259. */
  34260. function stubTrue() {
  34261. return true;
  34262. }
  34263. /**
  34264. * Invokes the iteratee `n` times, returning an array of the results of
  34265. * each invocation. The iteratee is invoked with one argument; (index).
  34266. *
  34267. * @static
  34268. * @since 0.1.0
  34269. * @memberOf _
  34270. * @category Util
  34271. * @param {number} n The number of times to invoke `iteratee`.
  34272. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  34273. * @returns {Array} Returns the array of results.
  34274. * @example
  34275. *
  34276. * _.times(3, String);
  34277. * // => ['0', '1', '2']
  34278. *
  34279. * _.times(4, _.constant(0));
  34280. * // => [0, 0, 0, 0]
  34281. */
  34282. function times(n, iteratee) {
  34283. n = toInteger(n);
  34284. if (n < 1 || n > MAX_SAFE_INTEGER) {
  34285. return [];
  34286. }
  34287. var index = MAX_ARRAY_LENGTH,
  34288. length = nativeMin(n, MAX_ARRAY_LENGTH);
  34289. iteratee = getIteratee(iteratee);
  34290. n -= MAX_ARRAY_LENGTH;
  34291. var result = baseTimes(length, iteratee);
  34292. while (++index < n) {
  34293. iteratee(index);
  34294. }
  34295. return result;
  34296. }
  34297. /**
  34298. * Converts `value` to a property path array.
  34299. *
  34300. * @static
  34301. * @memberOf _
  34302. * @since 4.0.0
  34303. * @category Util
  34304. * @param {*} value The value to convert.
  34305. * @returns {Array} Returns the new property path array.
  34306. * @example
  34307. *
  34308. * _.toPath('a.b.c');
  34309. * // => ['a', 'b', 'c']
  34310. *
  34311. * _.toPath('a[0].b.c');
  34312. * // => ['a', '0', 'b', 'c']
  34313. */
  34314. function toPath(value) {
  34315. if (isArray(value)) {
  34316. return arrayMap(value, toKey);
  34317. }
  34318. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  34319. }
  34320. /**
  34321. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  34322. *
  34323. * @static
  34324. * @since 0.1.0
  34325. * @memberOf _
  34326. * @category Util
  34327. * @param {string} [prefix=''] The value to prefix the ID with.
  34328. * @returns {string} Returns the unique ID.
  34329. * @example
  34330. *
  34331. * _.uniqueId('contact_');
  34332. * // => 'contact_104'
  34333. *
  34334. * _.uniqueId();
  34335. * // => '105'
  34336. */
  34337. function uniqueId(prefix) {
  34338. var id = ++idCounter;
  34339. return toString(prefix) + id;
  34340. }
  34341. /*------------------------------------------------------------------------*/
  34342. /**
  34343. * Adds two numbers.
  34344. *
  34345. * @static
  34346. * @memberOf _
  34347. * @since 3.4.0
  34348. * @category Math
  34349. * @param {number} augend The first number in an addition.
  34350. * @param {number} addend The second number in an addition.
  34351. * @returns {number} Returns the total.
  34352. * @example
  34353. *
  34354. * _.add(6, 4);
  34355. * // => 10
  34356. */
  34357. var add = createMathOperation(function(augend, addend) {
  34358. return augend + addend;
  34359. }, 0);
  34360. /**
  34361. * Computes `number` rounded up to `precision`.
  34362. *
  34363. * @static
  34364. * @memberOf _
  34365. * @since 3.10.0
  34366. * @category Math
  34367. * @param {number} number The number to round up.
  34368. * @param {number} [precision=0] The precision to round up to.
  34369. * @returns {number} Returns the rounded up number.
  34370. * @example
  34371. *
  34372. * _.ceil(4.006);
  34373. * // => 5
  34374. *
  34375. * _.ceil(6.004, 2);
  34376. * // => 6.01
  34377. *
  34378. * _.ceil(6040, -2);
  34379. * // => 6100
  34380. */
  34381. var ceil = createRound('ceil');
  34382. /**
  34383. * Divide two numbers.
  34384. *
  34385. * @static
  34386. * @memberOf _
  34387. * @since 4.7.0
  34388. * @category Math
  34389. * @param {number} dividend The first number in a division.
  34390. * @param {number} divisor The second number in a division.
  34391. * @returns {number} Returns the quotient.
  34392. * @example
  34393. *
  34394. * _.divide(6, 4);
  34395. * // => 1.5
  34396. */
  34397. var divide = createMathOperation(function(dividend, divisor) {
  34398. return dividend / divisor;
  34399. }, 1);
  34400. /**
  34401. * Computes `number` rounded down to `precision`.
  34402. *
  34403. * @static
  34404. * @memberOf _
  34405. * @since 3.10.0
  34406. * @category Math
  34407. * @param {number} number The number to round down.
  34408. * @param {number} [precision=0] The precision to round down to.
  34409. * @returns {number} Returns the rounded down number.
  34410. * @example
  34411. *
  34412. * _.floor(4.006);
  34413. * // => 4
  34414. *
  34415. * _.floor(0.046, 2);
  34416. * // => 0.04
  34417. *
  34418. * _.floor(4060, -2);
  34419. * // => 4000
  34420. */
  34421. var floor = createRound('floor');
  34422. /**
  34423. * Computes the maximum value of `array`. If `array` is empty or falsey,
  34424. * `undefined` is returned.
  34425. *
  34426. * @static
  34427. * @since 0.1.0
  34428. * @memberOf _
  34429. * @category Math
  34430. * @param {Array} array The array to iterate over.
  34431. * @returns {*} Returns the maximum value.
  34432. * @example
  34433. *
  34434. * _.max([4, 2, 8, 6]);
  34435. * // => 8
  34436. *
  34437. * _.max([]);
  34438. * // => undefined
  34439. */
  34440. function max(array) {
  34441. return (array && array.length)
  34442. ? baseExtremum(array, identity, baseGt)
  34443. : undefined;
  34444. }
  34445. /**
  34446. * This method is like `_.max` except that it accepts `iteratee` which is
  34447. * invoked for each element in `array` to generate the criterion by which
  34448. * the value is ranked. The iteratee is invoked with one argument: (value).
  34449. *
  34450. * @static
  34451. * @memberOf _
  34452. * @since 4.0.0
  34453. * @category Math
  34454. * @param {Array} array The array to iterate over.
  34455. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  34456. * @returns {*} Returns the maximum value.
  34457. * @example
  34458. *
  34459. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  34460. *
  34461. * _.maxBy(objects, function(o) { return o.n; });
  34462. * // => { 'n': 2 }
  34463. *
  34464. * // The `_.property` iteratee shorthand.
  34465. * _.maxBy(objects, 'n');
  34466. * // => { 'n': 2 }
  34467. */
  34468. function maxBy(array, iteratee) {
  34469. return (array && array.length)
  34470. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  34471. : undefined;
  34472. }
  34473. /**
  34474. * Computes the mean of the values in `array`.
  34475. *
  34476. * @static
  34477. * @memberOf _
  34478. * @since 4.0.0
  34479. * @category Math
  34480. * @param {Array} array The array to iterate over.
  34481. * @returns {number} Returns the mean.
  34482. * @example
  34483. *
  34484. * _.mean([4, 2, 8, 6]);
  34485. * // => 5
  34486. */
  34487. function mean(array) {
  34488. return baseMean(array, identity);
  34489. }
  34490. /**
  34491. * This method is like `_.mean` except that it accepts `iteratee` which is
  34492. * invoked for each element in `array` to generate the value to be averaged.
  34493. * The iteratee is invoked with one argument: (value).
  34494. *
  34495. * @static
  34496. * @memberOf _
  34497. * @since 4.7.0
  34498. * @category Math
  34499. * @param {Array} array The array to iterate over.
  34500. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  34501. * @returns {number} Returns the mean.
  34502. * @example
  34503. *
  34504. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  34505. *
  34506. * _.meanBy(objects, function(o) { return o.n; });
  34507. * // => 5
  34508. *
  34509. * // The `_.property` iteratee shorthand.
  34510. * _.meanBy(objects, 'n');
  34511. * // => 5
  34512. */
  34513. function meanBy(array, iteratee) {
  34514. return baseMean(array, getIteratee(iteratee, 2));
  34515. }
  34516. /**
  34517. * Computes the minimum value of `array`. If `array` is empty or falsey,
  34518. * `undefined` is returned.
  34519. *
  34520. * @static
  34521. * @since 0.1.0
  34522. * @memberOf _
  34523. * @category Math
  34524. * @param {Array} array The array to iterate over.
  34525. * @returns {*} Returns the minimum value.
  34526. * @example
  34527. *
  34528. * _.min([4, 2, 8, 6]);
  34529. * // => 2
  34530. *
  34531. * _.min([]);
  34532. * // => undefined
  34533. */
  34534. function min(array) {
  34535. return (array && array.length)
  34536. ? baseExtremum(array, identity, baseLt)
  34537. : undefined;
  34538. }
  34539. /**
  34540. * This method is like `_.min` except that it accepts `iteratee` which is
  34541. * invoked for each element in `array` to generate the criterion by which
  34542. * the value is ranked. The iteratee is invoked with one argument: (value).
  34543. *
  34544. * @static
  34545. * @memberOf _
  34546. * @since 4.0.0
  34547. * @category Math
  34548. * @param {Array} array The array to iterate over.
  34549. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  34550. * @returns {*} Returns the minimum value.
  34551. * @example
  34552. *
  34553. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  34554. *
  34555. * _.minBy(objects, function(o) { return o.n; });
  34556. * // => { 'n': 1 }
  34557. *
  34558. * // The `_.property` iteratee shorthand.
  34559. * _.minBy(objects, 'n');
  34560. * // => { 'n': 1 }
  34561. */
  34562. function minBy(array, iteratee) {
  34563. return (array && array.length)
  34564. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  34565. : undefined;
  34566. }
  34567. /**
  34568. * Multiply two numbers.
  34569. *
  34570. * @static
  34571. * @memberOf _
  34572. * @since 4.7.0
  34573. * @category Math
  34574. * @param {number} multiplier The first number in a multiplication.
  34575. * @param {number} multiplicand The second number in a multiplication.
  34576. * @returns {number} Returns the product.
  34577. * @example
  34578. *
  34579. * _.multiply(6, 4);
  34580. * // => 24
  34581. */
  34582. var multiply = createMathOperation(function(multiplier, multiplicand) {
  34583. return multiplier * multiplicand;
  34584. }, 1);
  34585. /**
  34586. * Computes `number` rounded to `precision`.
  34587. *
  34588. * @static
  34589. * @memberOf _
  34590. * @since 3.10.0
  34591. * @category Math
  34592. * @param {number} number The number to round.
  34593. * @param {number} [precision=0] The precision to round to.
  34594. * @returns {number} Returns the rounded number.
  34595. * @example
  34596. *
  34597. * _.round(4.006);
  34598. * // => 4
  34599. *
  34600. * _.round(4.006, 2);
  34601. * // => 4.01
  34602. *
  34603. * _.round(4060, -2);
  34604. * // => 4100
  34605. */
  34606. var round = createRound('round');
  34607. /**
  34608. * Subtract two numbers.
  34609. *
  34610. * @static
  34611. * @memberOf _
  34612. * @since 4.0.0
  34613. * @category Math
  34614. * @param {number} minuend The first number in a subtraction.
  34615. * @param {number} subtrahend The second number in a subtraction.
  34616. * @returns {number} Returns the difference.
  34617. * @example
  34618. *
  34619. * _.subtract(6, 4);
  34620. * // => 2
  34621. */
  34622. var subtract = createMathOperation(function(minuend, subtrahend) {
  34623. return minuend - subtrahend;
  34624. }, 0);
  34625. /**
  34626. * Computes the sum of the values in `array`.
  34627. *
  34628. * @static
  34629. * @memberOf _
  34630. * @since 3.4.0
  34631. * @category Math
  34632. * @param {Array} array The array to iterate over.
  34633. * @returns {number} Returns the sum.
  34634. * @example
  34635. *
  34636. * _.sum([4, 2, 8, 6]);
  34637. * // => 20
  34638. */
  34639. function sum(array) {
  34640. return (array && array.length)
  34641. ? baseSum(array, identity)
  34642. : 0;
  34643. }
  34644. /**
  34645. * This method is like `_.sum` except that it accepts `iteratee` which is
  34646. * invoked for each element in `array` to generate the value to be summed.
  34647. * The iteratee is invoked with one argument: (value).
  34648. *
  34649. * @static
  34650. * @memberOf _
  34651. * @since 4.0.0
  34652. * @category Math
  34653. * @param {Array} array The array to iterate over.
  34654. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  34655. * @returns {number} Returns the sum.
  34656. * @example
  34657. *
  34658. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  34659. *
  34660. * _.sumBy(objects, function(o) { return o.n; });
  34661. * // => 20
  34662. *
  34663. * // The `_.property` iteratee shorthand.
  34664. * _.sumBy(objects, 'n');
  34665. * // => 20
  34666. */
  34667. function sumBy(array, iteratee) {
  34668. return (array && array.length)
  34669. ? baseSum(array, getIteratee(iteratee, 2))
  34670. : 0;
  34671. }
  34672. /*------------------------------------------------------------------------*/
  34673. // Add methods that return wrapped values in chain sequences.
  34674. lodash.after = after;
  34675. lodash.ary = ary;
  34676. lodash.assign = assign;
  34677. lodash.assignIn = assignIn;
  34678. lodash.assignInWith = assignInWith;
  34679. lodash.assignWith = assignWith;
  34680. lodash.at = at;
  34681. lodash.before = before;
  34682. lodash.bind = bind;
  34683. lodash.bindAll = bindAll;
  34684. lodash.bindKey = bindKey;
  34685. lodash.castArray = castArray;
  34686. lodash.chain = chain;
  34687. lodash.chunk = chunk;
  34688. lodash.compact = compact;
  34689. lodash.concat = concat;
  34690. lodash.cond = cond;
  34691. lodash.conforms = conforms;
  34692. lodash.constant = constant;
  34693. lodash.countBy = countBy;
  34694. lodash.create = create;
  34695. lodash.curry = curry;
  34696. lodash.curryRight = curryRight;
  34697. lodash.debounce = debounce;
  34698. lodash.defaults = defaults;
  34699. lodash.defaultsDeep = defaultsDeep;
  34700. lodash.defer = defer;
  34701. lodash.delay = delay;
  34702. lodash.difference = difference;
  34703. lodash.differenceBy = differenceBy;
  34704. lodash.differenceWith = differenceWith;
  34705. lodash.drop = drop;
  34706. lodash.dropRight = dropRight;
  34707. lodash.dropRightWhile = dropRightWhile;
  34708. lodash.dropWhile = dropWhile;
  34709. lodash.fill = fill;
  34710. lodash.filter = filter;
  34711. lodash.flatMap = flatMap;
  34712. lodash.flatMapDeep = flatMapDeep;
  34713. lodash.flatMapDepth = flatMapDepth;
  34714. lodash.flatten = flatten;
  34715. lodash.flattenDeep = flattenDeep;
  34716. lodash.flattenDepth = flattenDepth;
  34717. lodash.flip = flip;
  34718. lodash.flow = flow;
  34719. lodash.flowRight = flowRight;
  34720. lodash.fromPairs = fromPairs;
  34721. lodash.functions = functions;
  34722. lodash.functionsIn = functionsIn;
  34723. lodash.groupBy = groupBy;
  34724. lodash.initial = initial;
  34725. lodash.intersection = intersection;
  34726. lodash.intersectionBy = intersectionBy;
  34727. lodash.intersectionWith = intersectionWith;
  34728. lodash.invert = invert;
  34729. lodash.invertBy = invertBy;
  34730. lodash.invokeMap = invokeMap;
  34731. lodash.iteratee = iteratee;
  34732. lodash.keyBy = keyBy;
  34733. lodash.keys = keys;
  34734. lodash.keysIn = keysIn;
  34735. lodash.map = map;
  34736. lodash.mapKeys = mapKeys;
  34737. lodash.mapValues = mapValues;
  34738. lodash.matches = matches;
  34739. lodash.matchesProperty = matchesProperty;
  34740. lodash.memoize = memoize;
  34741. lodash.merge = merge;
  34742. lodash.mergeWith = mergeWith;
  34743. lodash.method = method;
  34744. lodash.methodOf = methodOf;
  34745. lodash.mixin = mixin;
  34746. lodash.negate = negate;
  34747. lodash.nthArg = nthArg;
  34748. lodash.omit = omit;
  34749. lodash.omitBy = omitBy;
  34750. lodash.once = once;
  34751. lodash.orderBy = orderBy;
  34752. lodash.over = over;
  34753. lodash.overArgs = overArgs;
  34754. lodash.overEvery = overEvery;
  34755. lodash.overSome = overSome;
  34756. lodash.partial = partial;
  34757. lodash.partialRight = partialRight;
  34758. lodash.partition = partition;
  34759. lodash.pick = pick;
  34760. lodash.pickBy = pickBy;
  34761. lodash.property = property;
  34762. lodash.propertyOf = propertyOf;
  34763. lodash.pull = pull;
  34764. lodash.pullAll = pullAll;
  34765. lodash.pullAllBy = pullAllBy;
  34766. lodash.pullAllWith = pullAllWith;
  34767. lodash.pullAt = pullAt;
  34768. lodash.range = range;
  34769. lodash.rangeRight = rangeRight;
  34770. lodash.rearg = rearg;
  34771. lodash.reject = reject;
  34772. lodash.remove = remove;
  34773. lodash.rest = rest;
  34774. lodash.reverse = reverse;
  34775. lodash.sampleSize = sampleSize;
  34776. lodash.set = set;
  34777. lodash.setWith = setWith;
  34778. lodash.shuffle = shuffle;
  34779. lodash.slice = slice;
  34780. lodash.sortBy = sortBy;
  34781. lodash.sortedUniq = sortedUniq;
  34782. lodash.sortedUniqBy = sortedUniqBy;
  34783. lodash.split = split;
  34784. lodash.spread = spread;
  34785. lodash.tail = tail;
  34786. lodash.take = take;
  34787. lodash.takeRight = takeRight;
  34788. lodash.takeRightWhile = takeRightWhile;
  34789. lodash.takeWhile = takeWhile;
  34790. lodash.tap = tap;
  34791. lodash.throttle = throttle;
  34792. lodash.thru = thru;
  34793. lodash.toArray = toArray;
  34794. lodash.toPairs = toPairs;
  34795. lodash.toPairsIn = toPairsIn;
  34796. lodash.toPath = toPath;
  34797. lodash.toPlainObject = toPlainObject;
  34798. lodash.transform = transform;
  34799. lodash.unary = unary;
  34800. lodash.union = union;
  34801. lodash.unionBy = unionBy;
  34802. lodash.unionWith = unionWith;
  34803. lodash.uniq = uniq;
  34804. lodash.uniqBy = uniqBy;
  34805. lodash.uniqWith = uniqWith;
  34806. lodash.unset = unset;
  34807. lodash.unzip = unzip;
  34808. lodash.unzipWith = unzipWith;
  34809. lodash.update = update;
  34810. lodash.updateWith = updateWith;
  34811. lodash.values = values;
  34812. lodash.valuesIn = valuesIn;
  34813. lodash.without = without;
  34814. lodash.words = words;
  34815. lodash.wrap = wrap;
  34816. lodash.xor = xor;
  34817. lodash.xorBy = xorBy;
  34818. lodash.xorWith = xorWith;
  34819. lodash.zip = zip;
  34820. lodash.zipObject = zipObject;
  34821. lodash.zipObjectDeep = zipObjectDeep;
  34822. lodash.zipWith = zipWith;
  34823. // Add aliases.
  34824. lodash.entries = toPairs;
  34825. lodash.entriesIn = toPairsIn;
  34826. lodash.extend = assignIn;
  34827. lodash.extendWith = assignInWith;
  34828. // Add methods to `lodash.prototype`.
  34829. mixin(lodash, lodash);
  34830. /*------------------------------------------------------------------------*/
  34831. // Add methods that return unwrapped values in chain sequences.
  34832. lodash.add = add;
  34833. lodash.attempt = attempt;
  34834. lodash.camelCase = camelCase;
  34835. lodash.capitalize = capitalize;
  34836. lodash.ceil = ceil;
  34837. lodash.clamp = clamp;
  34838. lodash.clone = clone;
  34839. lodash.cloneDeep = cloneDeep;
  34840. lodash.cloneDeepWith = cloneDeepWith;
  34841. lodash.cloneWith = cloneWith;
  34842. lodash.conformsTo = conformsTo;
  34843. lodash.deburr = deburr;
  34844. lodash.defaultTo = defaultTo;
  34845. lodash.divide = divide;
  34846. lodash.endsWith = endsWith;
  34847. lodash.eq = eq;
  34848. lodash.escape = escape;
  34849. lodash.escapeRegExp = escapeRegExp;
  34850. lodash.every = every;
  34851. lodash.find = find;
  34852. lodash.findIndex = findIndex;
  34853. lodash.findKey = findKey;
  34854. lodash.findLast = findLast;
  34855. lodash.findLastIndex = findLastIndex;
  34856. lodash.findLastKey = findLastKey;
  34857. lodash.floor = floor;
  34858. lodash.forEach = forEach;
  34859. lodash.forEachRight = forEachRight;
  34860. lodash.forIn = forIn;
  34861. lodash.forInRight = forInRight;
  34862. lodash.forOwn = forOwn;
  34863. lodash.forOwnRight = forOwnRight;
  34864. lodash.get = get;
  34865. lodash.gt = gt;
  34866. lodash.gte = gte;
  34867. lodash.has = has;
  34868. lodash.hasIn = hasIn;
  34869. lodash.head = head;
  34870. lodash.identity = identity;
  34871. lodash.includes = includes;
  34872. lodash.indexOf = indexOf;
  34873. lodash.inRange = inRange;
  34874. lodash.invoke = invoke;
  34875. lodash.isArguments = isArguments;
  34876. lodash.isArray = isArray;
  34877. lodash.isArrayBuffer = isArrayBuffer;
  34878. lodash.isArrayLike = isArrayLike;
  34879. lodash.isArrayLikeObject = isArrayLikeObject;
  34880. lodash.isBoolean = isBoolean;
  34881. lodash.isBuffer = isBuffer;
  34882. lodash.isDate = isDate;
  34883. lodash.isElement = isElement;
  34884. lodash.isEmpty = isEmpty;
  34885. lodash.isEqual = isEqual;
  34886. lodash.isEqualWith = isEqualWith;
  34887. lodash.isError = isError;
  34888. lodash.isFinite = isFinite;
  34889. lodash.isFunction = isFunction;
  34890. lodash.isInteger = isInteger;
  34891. lodash.isLength = isLength;
  34892. lodash.isMap = isMap;
  34893. lodash.isMatch = isMatch;
  34894. lodash.isMatchWith = isMatchWith;
  34895. lodash.isNaN = isNaN;
  34896. lodash.isNative = isNative;
  34897. lodash.isNil = isNil;
  34898. lodash.isNull = isNull;
  34899. lodash.isNumber = isNumber;
  34900. lodash.isObject = isObject;
  34901. lodash.isObjectLike = isObjectLike;
  34902. lodash.isPlainObject = isPlainObject;
  34903. lodash.isRegExp = isRegExp;
  34904. lodash.isSafeInteger = isSafeInteger;
  34905. lodash.isSet = isSet;
  34906. lodash.isString = isString;
  34907. lodash.isSymbol = isSymbol;
  34908. lodash.isTypedArray = isTypedArray;
  34909. lodash.isUndefined = isUndefined;
  34910. lodash.isWeakMap = isWeakMap;
  34911. lodash.isWeakSet = isWeakSet;
  34912. lodash.join = join;
  34913. lodash.kebabCase = kebabCase;
  34914. lodash.last = last;
  34915. lodash.lastIndexOf = lastIndexOf;
  34916. lodash.lowerCase = lowerCase;
  34917. lodash.lowerFirst = lowerFirst;
  34918. lodash.lt = lt;
  34919. lodash.lte = lte;
  34920. lodash.max = max;
  34921. lodash.maxBy = maxBy;
  34922. lodash.mean = mean;
  34923. lodash.meanBy = meanBy;
  34924. lodash.min = min;
  34925. lodash.minBy = minBy;
  34926. lodash.stubArray = stubArray;
  34927. lodash.stubFalse = stubFalse;
  34928. lodash.stubObject = stubObject;
  34929. lodash.stubString = stubString;
  34930. lodash.stubTrue = stubTrue;
  34931. lodash.multiply = multiply;
  34932. lodash.nth = nth;
  34933. lodash.noConflict = noConflict;
  34934. lodash.noop = noop;
  34935. lodash.now = now;
  34936. lodash.pad = pad;
  34937. lodash.padEnd = padEnd;
  34938. lodash.padStart = padStart;
  34939. lodash.parseInt = parseInt;
  34940. lodash.random = random;
  34941. lodash.reduce = reduce;
  34942. lodash.reduceRight = reduceRight;
  34943. lodash.repeat = repeat;
  34944. lodash.replace = replace;
  34945. lodash.result = result;
  34946. lodash.round = round;
  34947. lodash.runInContext = runInContext;
  34948. lodash.sample = sample;
  34949. lodash.size = size;
  34950. lodash.snakeCase = snakeCase;
  34951. lodash.some = some;
  34952. lodash.sortedIndex = sortedIndex;
  34953. lodash.sortedIndexBy = sortedIndexBy;
  34954. lodash.sortedIndexOf = sortedIndexOf;
  34955. lodash.sortedLastIndex = sortedLastIndex;
  34956. lodash.sortedLastIndexBy = sortedLastIndexBy;
  34957. lodash.sortedLastIndexOf = sortedLastIndexOf;
  34958. lodash.startCase = startCase;
  34959. lodash.startsWith = startsWith;
  34960. lodash.subtract = subtract;
  34961. lodash.sum = sum;
  34962. lodash.sumBy = sumBy;
  34963. lodash.template = template;
  34964. lodash.times = times;
  34965. lodash.toFinite = toFinite;
  34966. lodash.toInteger = toInteger;
  34967. lodash.toLength = toLength;
  34968. lodash.toLower = toLower;
  34969. lodash.toNumber = toNumber;
  34970. lodash.toSafeInteger = toSafeInteger;
  34971. lodash.toString = toString;
  34972. lodash.toUpper = toUpper;
  34973. lodash.trim = trim;
  34974. lodash.trimEnd = trimEnd;
  34975. lodash.trimStart = trimStart;
  34976. lodash.truncate = truncate;
  34977. lodash.unescape = unescape;
  34978. lodash.uniqueId = uniqueId;
  34979. lodash.upperCase = upperCase;
  34980. lodash.upperFirst = upperFirst;
  34981. // Add aliases.
  34982. lodash.each = forEach;
  34983. lodash.eachRight = forEachRight;
  34984. lodash.first = head;
  34985. mixin(lodash, (function() {
  34986. var source = {};
  34987. baseForOwn(lodash, function(func, methodName) {
  34988. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  34989. source[methodName] = func;
  34990. }
  34991. });
  34992. return source;
  34993. }()), { 'chain': false });
  34994. /*------------------------------------------------------------------------*/
  34995. /**
  34996. * The semantic version number.
  34997. *
  34998. * @static
  34999. * @memberOf _
  35000. * @type {string}
  35001. */
  35002. lodash.VERSION = VERSION;
  35003. // Assign default placeholders.
  35004. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  35005. lodash[methodName].placeholder = lodash;
  35006. });
  35007. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  35008. arrayEach(['drop', 'take'], function(methodName, index) {
  35009. LazyWrapper.prototype[methodName] = function(n) {
  35010. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  35011. var result = (this.__filtered__ && !index)
  35012. ? new LazyWrapper(this)
  35013. : this.clone();
  35014. if (result.__filtered__) {
  35015. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  35016. } else {
  35017. result.__views__.push({
  35018. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  35019. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  35020. });
  35021. }
  35022. return result;
  35023. };
  35024. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  35025. return this.reverse()[methodName](n).reverse();
  35026. };
  35027. });
  35028. // Add `LazyWrapper` methods that accept an `iteratee` value.
  35029. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  35030. var type = index + 1,
  35031. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  35032. LazyWrapper.prototype[methodName] = function(iteratee) {
  35033. var result = this.clone();
  35034. result.__iteratees__.push({
  35035. 'iteratee': getIteratee(iteratee, 3),
  35036. 'type': type
  35037. });
  35038. result.__filtered__ = result.__filtered__ || isFilter;
  35039. return result;
  35040. };
  35041. });
  35042. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  35043. arrayEach(['head', 'last'], function(methodName, index) {
  35044. var takeName = 'take' + (index ? 'Right' : '');
  35045. LazyWrapper.prototype[methodName] = function() {
  35046. return this[takeName](1).value()[0];
  35047. };
  35048. });
  35049. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  35050. arrayEach(['initial', 'tail'], function(methodName, index) {
  35051. var dropName = 'drop' + (index ? '' : 'Right');
  35052. LazyWrapper.prototype[methodName] = function() {
  35053. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  35054. };
  35055. });
  35056. LazyWrapper.prototype.compact = function() {
  35057. return this.filter(identity);
  35058. };
  35059. LazyWrapper.prototype.find = function(predicate) {
  35060. return this.filter(predicate).head();
  35061. };
  35062. LazyWrapper.prototype.findLast = function(predicate) {
  35063. return this.reverse().find(predicate);
  35064. };
  35065. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  35066. if (typeof path == 'function') {
  35067. return new LazyWrapper(this);
  35068. }
  35069. return this.map(function(value) {
  35070. return baseInvoke(value, path, args);
  35071. });
  35072. });
  35073. LazyWrapper.prototype.reject = function(predicate) {
  35074. return this.filter(negate(getIteratee(predicate)));
  35075. };
  35076. LazyWrapper.prototype.slice = function(start, end) {
  35077. start = toInteger(start);
  35078. var result = this;
  35079. if (result.__filtered__ && (start > 0 || end < 0)) {
  35080. return new LazyWrapper(result);
  35081. }
  35082. if (start < 0) {
  35083. result = result.takeRight(-start);
  35084. } else if (start) {
  35085. result = result.drop(start);
  35086. }
  35087. if (end !== undefined) {
  35088. end = toInteger(end);
  35089. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  35090. }
  35091. return result;
  35092. };
  35093. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  35094. return this.reverse().takeWhile(predicate).reverse();
  35095. };
  35096. LazyWrapper.prototype.toArray = function() {
  35097. return this.take(MAX_ARRAY_LENGTH);
  35098. };
  35099. // Add `LazyWrapper` methods to `lodash.prototype`.
  35100. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  35101. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  35102. isTaker = /^(?:head|last)$/.test(methodName),
  35103. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  35104. retUnwrapped = isTaker || /^find/.test(methodName);
  35105. if (!lodashFunc) {
  35106. return;
  35107. }
  35108. lodash.prototype[methodName] = function() {
  35109. var value = this.__wrapped__,
  35110. args = isTaker ? [1] : arguments,
  35111. isLazy = value instanceof LazyWrapper,
  35112. iteratee = args[0],
  35113. useLazy = isLazy || isArray(value);
  35114. var interceptor = function(value) {
  35115. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  35116. return (isTaker && chainAll) ? result[0] : result;
  35117. };
  35118. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  35119. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  35120. isLazy = useLazy = false;
  35121. }
  35122. var chainAll = this.__chain__,
  35123. isHybrid = !!this.__actions__.length,
  35124. isUnwrapped = retUnwrapped && !chainAll,
  35125. onlyLazy = isLazy && !isHybrid;
  35126. if (!retUnwrapped && useLazy) {
  35127. value = onlyLazy ? value : new LazyWrapper(this);
  35128. var result = func.apply(value, args);
  35129. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  35130. return new LodashWrapper(result, chainAll);
  35131. }
  35132. if (isUnwrapped && onlyLazy) {
  35133. return func.apply(this, args);
  35134. }
  35135. result = this.thru(interceptor);
  35136. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  35137. };
  35138. });
  35139. // Add `Array` methods to `lodash.prototype`.
  35140. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  35141. var func = arrayProto[methodName],
  35142. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  35143. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  35144. lodash.prototype[methodName] = function() {
  35145. var args = arguments;
  35146. if (retUnwrapped && !this.__chain__) {
  35147. var value = this.value();
  35148. return func.apply(isArray(value) ? value : [], args);
  35149. }
  35150. return this[chainName](function(value) {
  35151. return func.apply(isArray(value) ? value : [], args);
  35152. });
  35153. };
  35154. });
  35155. // Map minified method names to their real names.
  35156. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  35157. var lodashFunc = lodash[methodName];
  35158. if (lodashFunc) {
  35159. var key = lodashFunc.name + '';
  35160. if (!hasOwnProperty.call(realNames, key)) {
  35161. realNames[key] = [];
  35162. }
  35163. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  35164. }
  35165. });
  35166. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  35167. 'name': 'wrapper',
  35168. 'func': undefined
  35169. }];
  35170. // Add methods to `LazyWrapper`.
  35171. LazyWrapper.prototype.clone = lazyClone;
  35172. LazyWrapper.prototype.reverse = lazyReverse;
  35173. LazyWrapper.prototype.value = lazyValue;
  35174. // Add chain sequence methods to the `lodash` wrapper.
  35175. lodash.prototype.at = wrapperAt;
  35176. lodash.prototype.chain = wrapperChain;
  35177. lodash.prototype.commit = wrapperCommit;
  35178. lodash.prototype.next = wrapperNext;
  35179. lodash.prototype.plant = wrapperPlant;
  35180. lodash.prototype.reverse = wrapperReverse;
  35181. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  35182. // Add lazy aliases.
  35183. lodash.prototype.first = lodash.prototype.head;
  35184. if (symIterator) {
  35185. lodash.prototype[symIterator] = wrapperToIterator;
  35186. }
  35187. return lodash;
  35188. });
  35189. /*--------------------------------------------------------------------------*/
  35190. // Export lodash.
  35191. var _ = runInContext();
  35192. // Some AMD build optimizers, like r.js, check for condition patterns like:
  35193. if (true) {
  35194. // Expose Lodash on the global object to prevent errors when Lodash is
  35195. // loaded by a script tag in the presence of an AMD loader.
  35196. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  35197. // Use `_.noConflict` to remove Lodash from the global object.
  35198. root._ = _;
  35199. // Define as an anonymous module so, through path mapping, it can be
  35200. // referenced as the "underscore" module.
  35201. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  35202. return _;
  35203. }).call(exports, __webpack_require__, exports, module),
  35204. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  35205. }
  35206. // Check for `exports` after `define` in case a build optimizer adds it.
  35207. else {}
  35208. }.call(this));
  35209. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"), __webpack_require__(/*! ./../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module)))
  35210. /***/ }),
  35211. /***/ "./node_modules/popper.js/dist/esm/popper.js":
  35212. /*!***************************************************!*\
  35213. !*** ./node_modules/popper.js/dist/esm/popper.js ***!
  35214. \***************************************************/
  35215. /*! exports provided: default */
  35216. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  35217. "use strict";
  35218. __webpack_require__.r(__webpack_exports__);
  35219. /* WEBPACK VAR INJECTION */(function(global) {/**!
  35220. * @fileOverview Kickass library to create and place poppers near their reference elements.
  35221. * @version 1.16.1
  35222. * @license
  35223. * Copyright (c) 2016 Federico Zivolo and contributors
  35224. *
  35225. * Permission is hereby granted, free of charge, to any person obtaining a copy
  35226. * of this software and associated documentation files (the "Software"), to deal
  35227. * in the Software without restriction, including without limitation the rights
  35228. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  35229. * copies of the Software, and to permit persons to whom the Software is
  35230. * furnished to do so, subject to the following conditions:
  35231. *
  35232. * The above copyright notice and this permission notice shall be included in all
  35233. * copies or substantial portions of the Software.
  35234. *
  35235. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  35236. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  35237. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  35238. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  35239. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  35240. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  35241. * SOFTWARE.
  35242. */
  35243. var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined';
  35244. var timeoutDuration = function () {
  35245. var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];
  35246. for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) {
  35247. if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {
  35248. return 1;
  35249. }
  35250. }
  35251. return 0;
  35252. }();
  35253. function microtaskDebounce(fn) {
  35254. var called = false;
  35255. return function () {
  35256. if (called) {
  35257. return;
  35258. }
  35259. called = true;
  35260. window.Promise.resolve().then(function () {
  35261. called = false;
  35262. fn();
  35263. });
  35264. };
  35265. }
  35266. function taskDebounce(fn) {
  35267. var scheduled = false;
  35268. return function () {
  35269. if (!scheduled) {
  35270. scheduled = true;
  35271. setTimeout(function () {
  35272. scheduled = false;
  35273. fn();
  35274. }, timeoutDuration);
  35275. }
  35276. };
  35277. }
  35278. var supportsMicroTasks = isBrowser && window.Promise;
  35279. /**
  35280. * Create a debounced version of a method, that's asynchronously deferred
  35281. * but called in the minimum time possible.
  35282. *
  35283. * @method
  35284. * @memberof Popper.Utils
  35285. * @argument {Function} fn
  35286. * @returns {Function}
  35287. */
  35288. var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce;
  35289. /**
  35290. * Check if the given variable is a function
  35291. * @method
  35292. * @memberof Popper.Utils
  35293. * @argument {Any} functionToCheck - variable to check
  35294. * @returns {Boolean} answer to: is a function?
  35295. */
  35296. function isFunction(functionToCheck) {
  35297. var getType = {};
  35298. return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
  35299. }
  35300. /**
  35301. * Get CSS computed property of the given element
  35302. * @method
  35303. * @memberof Popper.Utils
  35304. * @argument {Eement} element
  35305. * @argument {String} property
  35306. */
  35307. function getStyleComputedProperty(element, property) {
  35308. if (element.nodeType !== 1) {
  35309. return [];
  35310. }
  35311. // NOTE: 1 DOM access here
  35312. var window = element.ownerDocument.defaultView;
  35313. var css = window.getComputedStyle(element, null);
  35314. return property ? css[property] : css;
  35315. }
  35316. /**
  35317. * Returns the parentNode or the host of the element
  35318. * @method
  35319. * @memberof Popper.Utils
  35320. * @argument {Element} element
  35321. * @returns {Element} parent
  35322. */
  35323. function getParentNode(element) {
  35324. if (element.nodeName === 'HTML') {
  35325. return element;
  35326. }
  35327. return element.parentNode || element.host;
  35328. }
  35329. /**
  35330. * Returns the scrolling parent of the given element
  35331. * @method
  35332. * @memberof Popper.Utils
  35333. * @argument {Element} element
  35334. * @returns {Element} scroll parent
  35335. */
  35336. function getScrollParent(element) {
  35337. // Return body, `getScroll` will take care to get the correct `scrollTop` from it
  35338. if (!element) {
  35339. return document.body;
  35340. }
  35341. switch (element.nodeName) {
  35342. case 'HTML':
  35343. case 'BODY':
  35344. return element.ownerDocument.body;
  35345. case '#document':
  35346. return element.body;
  35347. }
  35348. // Firefox want us to check `-x` and `-y` variations as well
  35349. var _getStyleComputedProp = getStyleComputedProperty(element),
  35350. overflow = _getStyleComputedProp.overflow,
  35351. overflowX = _getStyleComputedProp.overflowX,
  35352. overflowY = _getStyleComputedProp.overflowY;
  35353. if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {
  35354. return element;
  35355. }
  35356. return getScrollParent(getParentNode(element));
  35357. }
  35358. /**
  35359. * Returns the reference node of the reference object, or the reference object itself.
  35360. * @method
  35361. * @memberof Popper.Utils
  35362. * @param {Element|Object} reference - the reference element (the popper will be relative to this)
  35363. * @returns {Element} parent
  35364. */
  35365. function getReferenceNode(reference) {
  35366. return reference && reference.referenceNode ? reference.referenceNode : reference;
  35367. }
  35368. var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode);
  35369. var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent);
  35370. /**
  35371. * Determines if the browser is Internet Explorer
  35372. * @method
  35373. * @memberof Popper.Utils
  35374. * @param {Number} version to check
  35375. * @returns {Boolean} isIE
  35376. */
  35377. function isIE(version) {
  35378. if (version === 11) {
  35379. return isIE11;
  35380. }
  35381. if (version === 10) {
  35382. return isIE10;
  35383. }
  35384. return isIE11 || isIE10;
  35385. }
  35386. /**
  35387. * Returns the offset parent of the given element
  35388. * @method
  35389. * @memberof Popper.Utils
  35390. * @argument {Element} element
  35391. * @returns {Element} offset parent
  35392. */
  35393. function getOffsetParent(element) {
  35394. if (!element) {
  35395. return document.documentElement;
  35396. }
  35397. var noOffsetParent = isIE(10) ? document.body : null;
  35398. // NOTE: 1 DOM access here
  35399. var offsetParent = element.offsetParent || null;
  35400. // Skip hidden elements which don't have an offsetParent
  35401. while (offsetParent === noOffsetParent && element.nextElementSibling) {
  35402. offsetParent = (element = element.nextElementSibling).offsetParent;
  35403. }
  35404. var nodeName = offsetParent && offsetParent.nodeName;
  35405. if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {
  35406. return element ? element.ownerDocument.documentElement : document.documentElement;
  35407. }
  35408. // .offsetParent will return the closest TH, TD or TABLE in case
  35409. // no offsetParent is present, I hate this job...
  35410. if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') {
  35411. return getOffsetParent(offsetParent);
  35412. }
  35413. return offsetParent;
  35414. }
  35415. function isOffsetContainer(element) {
  35416. var nodeName = element.nodeName;
  35417. if (nodeName === 'BODY') {
  35418. return false;
  35419. }
  35420. return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element;
  35421. }
  35422. /**
  35423. * Finds the root node (document, shadowDOM root) of the given element
  35424. * @method
  35425. * @memberof Popper.Utils
  35426. * @argument {Element} node
  35427. * @returns {Element} root node
  35428. */
  35429. function getRoot(node) {
  35430. if (node.parentNode !== null) {
  35431. return getRoot(node.parentNode);
  35432. }
  35433. return node;
  35434. }
  35435. /**
  35436. * Finds the offset parent common to the two provided nodes
  35437. * @method
  35438. * @memberof Popper.Utils
  35439. * @argument {Element} element1
  35440. * @argument {Element} element2
  35441. * @returns {Element} common offset parent
  35442. */
  35443. function findCommonOffsetParent(element1, element2) {
  35444. // This check is needed to avoid errors in case one of the elements isn't defined for any reason
  35445. if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {
  35446. return document.documentElement;
  35447. }
  35448. // Here we make sure to give as "start" the element that comes first in the DOM
  35449. var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING;
  35450. var start = order ? element1 : element2;
  35451. var end = order ? element2 : element1;
  35452. // Get common ancestor container
  35453. var range = document.createRange();
  35454. range.setStart(start, 0);
  35455. range.setEnd(end, 0);
  35456. var commonAncestorContainer = range.commonAncestorContainer;
  35457. // Both nodes are inside #document
  35458. if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) {
  35459. if (isOffsetContainer(commonAncestorContainer)) {
  35460. return commonAncestorContainer;
  35461. }
  35462. return getOffsetParent(commonAncestorContainer);
  35463. }
  35464. // one of the nodes is inside shadowDOM, find which one
  35465. var element1root = getRoot(element1);
  35466. if (element1root.host) {
  35467. return findCommonOffsetParent(element1root.host, element2);
  35468. } else {
  35469. return findCommonOffsetParent(element1, getRoot(element2).host);
  35470. }
  35471. }
  35472. /**
  35473. * Gets the scroll value of the given element in the given side (top and left)
  35474. * @method
  35475. * @memberof Popper.Utils
  35476. * @argument {Element} element
  35477. * @argument {String} side `top` or `left`
  35478. * @returns {number} amount of scrolled pixels
  35479. */
  35480. function getScroll(element) {
  35481. var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top';
  35482. var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';
  35483. var nodeName = element.nodeName;
  35484. if (nodeName === 'BODY' || nodeName === 'HTML') {
  35485. var html = element.ownerDocument.documentElement;
  35486. var scrollingElement = element.ownerDocument.scrollingElement || html;
  35487. return scrollingElement[upperSide];
  35488. }
  35489. return element[upperSide];
  35490. }
  35491. /*
  35492. * Sum or subtract the element scroll values (left and top) from a given rect object
  35493. * @method
  35494. * @memberof Popper.Utils
  35495. * @param {Object} rect - Rect object you want to change
  35496. * @param {HTMLElement} element - The element from the function reads the scroll values
  35497. * @param {Boolean} subtract - set to true if you want to subtract the scroll values
  35498. * @return {Object} rect - The modifier rect object
  35499. */
  35500. function includeScroll(rect, element) {
  35501. var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  35502. var scrollTop = getScroll(element, 'top');
  35503. var scrollLeft = getScroll(element, 'left');
  35504. var modifier = subtract ? -1 : 1;
  35505. rect.top += scrollTop * modifier;
  35506. rect.bottom += scrollTop * modifier;
  35507. rect.left += scrollLeft * modifier;
  35508. rect.right += scrollLeft * modifier;
  35509. return rect;
  35510. }
  35511. /*
  35512. * Helper to detect borders of a given element
  35513. * @method
  35514. * @memberof Popper.Utils
  35515. * @param {CSSStyleDeclaration} styles
  35516. * Result of `getStyleComputedProperty` on the given element
  35517. * @param {String} axis - `x` or `y`
  35518. * @return {number} borders - The borders size of the given axis
  35519. */
  35520. function getBordersSize(styles, axis) {
  35521. var sideA = axis === 'x' ? 'Left' : 'Top';
  35522. var sideB = sideA === 'Left' ? 'Right' : 'Bottom';
  35523. return parseFloat(styles['border' + sideA + 'Width']) + parseFloat(styles['border' + sideB + 'Width']);
  35524. }
  35525. function getSize(axis, body, html, computedStyle) {
  35526. return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0);
  35527. }
  35528. function getWindowSizes(document) {
  35529. var body = document.body;
  35530. var html = document.documentElement;
  35531. var computedStyle = isIE(10) && getComputedStyle(html);
  35532. return {
  35533. height: getSize('Height', body, html, computedStyle),
  35534. width: getSize('Width', body, html, computedStyle)
  35535. };
  35536. }
  35537. var classCallCheck = function (instance, Constructor) {
  35538. if (!(instance instanceof Constructor)) {
  35539. throw new TypeError("Cannot call a class as a function");
  35540. }
  35541. };
  35542. var createClass = function () {
  35543. function defineProperties(target, props) {
  35544. for (var i = 0; i < props.length; i++) {
  35545. var descriptor = props[i];
  35546. descriptor.enumerable = descriptor.enumerable || false;
  35547. descriptor.configurable = true;
  35548. if ("value" in descriptor) descriptor.writable = true;
  35549. Object.defineProperty(target, descriptor.key, descriptor);
  35550. }
  35551. }
  35552. return function (Constructor, protoProps, staticProps) {
  35553. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  35554. if (staticProps) defineProperties(Constructor, staticProps);
  35555. return Constructor;
  35556. };
  35557. }();
  35558. var defineProperty = function (obj, key, value) {
  35559. if (key in obj) {
  35560. Object.defineProperty(obj, key, {
  35561. value: value,
  35562. enumerable: true,
  35563. configurable: true,
  35564. writable: true
  35565. });
  35566. } else {
  35567. obj[key] = value;
  35568. }
  35569. return obj;
  35570. };
  35571. var _extends = Object.assign || function (target) {
  35572. for (var i = 1; i < arguments.length; i++) {
  35573. var source = arguments[i];
  35574. for (var key in source) {
  35575. if (Object.prototype.hasOwnProperty.call(source, key)) {
  35576. target[key] = source[key];
  35577. }
  35578. }
  35579. }
  35580. return target;
  35581. };
  35582. /**
  35583. * Given element offsets, generate an output similar to getBoundingClientRect
  35584. * @method
  35585. * @memberof Popper.Utils
  35586. * @argument {Object} offsets
  35587. * @returns {Object} ClientRect like output
  35588. */
  35589. function getClientRect(offsets) {
  35590. return _extends({}, offsets, {
  35591. right: offsets.left + offsets.width,
  35592. bottom: offsets.top + offsets.height
  35593. });
  35594. }
  35595. /**
  35596. * Get bounding client rect of given element
  35597. * @method
  35598. * @memberof Popper.Utils
  35599. * @param {HTMLElement} element
  35600. * @return {Object} client rect
  35601. */
  35602. function getBoundingClientRect(element) {
  35603. var rect = {};
  35604. // IE10 10 FIX: Please, don't ask, the element isn't
  35605. // considered in DOM in some circumstances...
  35606. // This isn't reproducible in IE10 compatibility mode of IE11
  35607. try {
  35608. if (isIE(10)) {
  35609. rect = element.getBoundingClientRect();
  35610. var scrollTop = getScroll(element, 'top');
  35611. var scrollLeft = getScroll(element, 'left');
  35612. rect.top += scrollTop;
  35613. rect.left += scrollLeft;
  35614. rect.bottom += scrollTop;
  35615. rect.right += scrollLeft;
  35616. } else {
  35617. rect = element.getBoundingClientRect();
  35618. }
  35619. } catch (e) {}
  35620. var result = {
  35621. left: rect.left,
  35622. top: rect.top,
  35623. width: rect.right - rect.left,
  35624. height: rect.bottom - rect.top
  35625. };
  35626. // subtract scrollbar size from sizes
  35627. var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {};
  35628. var width = sizes.width || element.clientWidth || result.width;
  35629. var height = sizes.height || element.clientHeight || result.height;
  35630. var horizScrollbar = element.offsetWidth - width;
  35631. var vertScrollbar = element.offsetHeight - height;
  35632. // if an hypothetical scrollbar is detected, we must be sure it's not a `border`
  35633. // we make this check conditional for performance reasons
  35634. if (horizScrollbar || vertScrollbar) {
  35635. var styles = getStyleComputedProperty(element);
  35636. horizScrollbar -= getBordersSize(styles, 'x');
  35637. vertScrollbar -= getBordersSize(styles, 'y');
  35638. result.width -= horizScrollbar;
  35639. result.height -= vertScrollbar;
  35640. }
  35641. return getClientRect(result);
  35642. }
  35643. function getOffsetRectRelativeToArbitraryNode(children, parent) {
  35644. var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  35645. var isIE10 = isIE(10);
  35646. var isHTML = parent.nodeName === 'HTML';
  35647. var childrenRect = getBoundingClientRect(children);
  35648. var parentRect = getBoundingClientRect(parent);
  35649. var scrollParent = getScrollParent(children);
  35650. var styles = getStyleComputedProperty(parent);
  35651. var borderTopWidth = parseFloat(styles.borderTopWidth);
  35652. var borderLeftWidth = parseFloat(styles.borderLeftWidth);
  35653. // In cases where the parent is fixed, we must ignore negative scroll in offset calc
  35654. if (fixedPosition && isHTML) {
  35655. parentRect.top = Math.max(parentRect.top, 0);
  35656. parentRect.left = Math.max(parentRect.left, 0);
  35657. }
  35658. var offsets = getClientRect({
  35659. top: childrenRect.top - parentRect.top - borderTopWidth,
  35660. left: childrenRect.left - parentRect.left - borderLeftWidth,
  35661. width: childrenRect.width,
  35662. height: childrenRect.height
  35663. });
  35664. offsets.marginTop = 0;
  35665. offsets.marginLeft = 0;
  35666. // Subtract margins of documentElement in case it's being used as parent
  35667. // we do this only on HTML because it's the only element that behaves
  35668. // differently when margins are applied to it. The margins are included in
  35669. // the box of the documentElement, in the other cases not.
  35670. if (!isIE10 && isHTML) {
  35671. var marginTop = parseFloat(styles.marginTop);
  35672. var marginLeft = parseFloat(styles.marginLeft);
  35673. offsets.top -= borderTopWidth - marginTop;
  35674. offsets.bottom -= borderTopWidth - marginTop;
  35675. offsets.left -= borderLeftWidth - marginLeft;
  35676. offsets.right -= borderLeftWidth - marginLeft;
  35677. // Attach marginTop and marginLeft because in some circumstances we may need them
  35678. offsets.marginTop = marginTop;
  35679. offsets.marginLeft = marginLeft;
  35680. }
  35681. if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') {
  35682. offsets = includeScroll(offsets, parent);
  35683. }
  35684. return offsets;
  35685. }
  35686. function getViewportOffsetRectRelativeToArtbitraryNode(element) {
  35687. var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  35688. var html = element.ownerDocument.documentElement;
  35689. var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);
  35690. var width = Math.max(html.clientWidth, window.innerWidth || 0);
  35691. var height = Math.max(html.clientHeight, window.innerHeight || 0);
  35692. var scrollTop = !excludeScroll ? getScroll(html) : 0;
  35693. var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0;
  35694. var offset = {
  35695. top: scrollTop - relativeOffset.top + relativeOffset.marginTop,
  35696. left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,
  35697. width: width,
  35698. height: height
  35699. };
  35700. return getClientRect(offset);
  35701. }
  35702. /**
  35703. * Check if the given element is fixed or is inside a fixed parent
  35704. * @method
  35705. * @memberof Popper.Utils
  35706. * @argument {Element} element
  35707. * @argument {Element} customContainer
  35708. * @returns {Boolean} answer to "isFixed?"
  35709. */
  35710. function isFixed(element) {
  35711. var nodeName = element.nodeName;
  35712. if (nodeName === 'BODY' || nodeName === 'HTML') {
  35713. return false;
  35714. }
  35715. if (getStyleComputedProperty(element, 'position') === 'fixed') {
  35716. return true;
  35717. }
  35718. var parentNode = getParentNode(element);
  35719. if (!parentNode) {
  35720. return false;
  35721. }
  35722. return isFixed(parentNode);
  35723. }
  35724. /**
  35725. * Finds the first parent of an element that has a transformed property defined
  35726. * @method
  35727. * @memberof Popper.Utils
  35728. * @argument {Element} element
  35729. * @returns {Element} first transformed parent or documentElement
  35730. */
  35731. function getFixedPositionOffsetParent(element) {
  35732. // This check is needed to avoid errors in case one of the elements isn't defined for any reason
  35733. if (!element || !element.parentElement || isIE()) {
  35734. return document.documentElement;
  35735. }
  35736. var el = element.parentElement;
  35737. while (el && getStyleComputedProperty(el, 'transform') === 'none') {
  35738. el = el.parentElement;
  35739. }
  35740. return el || document.documentElement;
  35741. }
  35742. /**
  35743. * Computed the boundaries limits and return them
  35744. * @method
  35745. * @memberof Popper.Utils
  35746. * @param {HTMLElement} popper
  35747. * @param {HTMLElement} reference
  35748. * @param {number} padding
  35749. * @param {HTMLElement} boundariesElement - Element used to define the boundaries
  35750. * @param {Boolean} fixedPosition - Is in fixed position mode
  35751. * @returns {Object} Coordinates of the boundaries
  35752. */
  35753. function getBoundaries(popper, reference, padding, boundariesElement) {
  35754. var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  35755. // NOTE: 1 DOM access here
  35756. var boundaries = { top: 0, left: 0 };
  35757. var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));
  35758. // Handle viewport case
  35759. if (boundariesElement === 'viewport') {
  35760. boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition);
  35761. } else {
  35762. // Handle other cases based on DOM element used as boundaries
  35763. var boundariesNode = void 0;
  35764. if (boundariesElement === 'scrollParent') {
  35765. boundariesNode = getScrollParent(getParentNode(reference));
  35766. if (boundariesNode.nodeName === 'BODY') {
  35767. boundariesNode = popper.ownerDocument.documentElement;
  35768. }
  35769. } else if (boundariesElement === 'window') {
  35770. boundariesNode = popper.ownerDocument.documentElement;
  35771. } else {
  35772. boundariesNode = boundariesElement;
  35773. }
  35774. var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition);
  35775. // In case of HTML, we need a different computation
  35776. if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {
  35777. var _getWindowSizes = getWindowSizes(popper.ownerDocument),
  35778. height = _getWindowSizes.height,
  35779. width = _getWindowSizes.width;
  35780. boundaries.top += offsets.top - offsets.marginTop;
  35781. boundaries.bottom = height + offsets.top;
  35782. boundaries.left += offsets.left - offsets.marginLeft;
  35783. boundaries.right = width + offsets.left;
  35784. } else {
  35785. // for all the other DOM elements, this one is good
  35786. boundaries = offsets;
  35787. }
  35788. }
  35789. // Add paddings
  35790. padding = padding || 0;
  35791. var isPaddingNumber = typeof padding === 'number';
  35792. boundaries.left += isPaddingNumber ? padding : padding.left || 0;
  35793. boundaries.top += isPaddingNumber ? padding : padding.top || 0;
  35794. boundaries.right -= isPaddingNumber ? padding : padding.right || 0;
  35795. boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0;
  35796. return boundaries;
  35797. }
  35798. function getArea(_ref) {
  35799. var width = _ref.width,
  35800. height = _ref.height;
  35801. return width * height;
  35802. }
  35803. /**
  35804. * Utility used to transform the `auto` placement to the placement with more
  35805. * available space.
  35806. * @method
  35807. * @memberof Popper.Utils
  35808. * @argument {Object} data - The data object generated by update method
  35809. * @argument {Object} options - Modifiers configuration and options
  35810. * @returns {Object} The data object, properly modified
  35811. */
  35812. function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) {
  35813. var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
  35814. if (placement.indexOf('auto') === -1) {
  35815. return placement;
  35816. }
  35817. var boundaries = getBoundaries(popper, reference, padding, boundariesElement);
  35818. var rects = {
  35819. top: {
  35820. width: boundaries.width,
  35821. height: refRect.top - boundaries.top
  35822. },
  35823. right: {
  35824. width: boundaries.right - refRect.right,
  35825. height: boundaries.height
  35826. },
  35827. bottom: {
  35828. width: boundaries.width,
  35829. height: boundaries.bottom - refRect.bottom
  35830. },
  35831. left: {
  35832. width: refRect.left - boundaries.left,
  35833. height: boundaries.height
  35834. }
  35835. };
  35836. var sortedAreas = Object.keys(rects).map(function (key) {
  35837. return _extends({
  35838. key: key
  35839. }, rects[key], {
  35840. area: getArea(rects[key])
  35841. });
  35842. }).sort(function (a, b) {
  35843. return b.area - a.area;
  35844. });
  35845. var filteredAreas = sortedAreas.filter(function (_ref2) {
  35846. var width = _ref2.width,
  35847. height = _ref2.height;
  35848. return width >= popper.clientWidth && height >= popper.clientHeight;
  35849. });
  35850. var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key;
  35851. var variation = placement.split('-')[1];
  35852. return computedPlacement + (variation ? '-' + variation : '');
  35853. }
  35854. /**
  35855. * Get offsets to the reference element
  35856. * @method
  35857. * @memberof Popper.Utils
  35858. * @param {Object} state
  35859. * @param {Element} popper - the popper element
  35860. * @param {Element} reference - the reference element (the popper will be relative to this)
  35861. * @param {Element} fixedPosition - is in fixed position mode
  35862. * @returns {Object} An object containing the offsets which will be applied to the popper
  35863. */
  35864. function getReferenceOffsets(state, popper, reference) {
  35865. var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
  35866. var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));
  35867. return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition);
  35868. }
  35869. /**
  35870. * Get the outer sizes of the given element (offset size + margins)
  35871. * @method
  35872. * @memberof Popper.Utils
  35873. * @argument {Element} element
  35874. * @returns {Object} object containing width and height properties
  35875. */
  35876. function getOuterSizes(element) {
  35877. var window = element.ownerDocument.defaultView;
  35878. var styles = window.getComputedStyle(element);
  35879. var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0);
  35880. var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0);
  35881. var result = {
  35882. width: element.offsetWidth + y,
  35883. height: element.offsetHeight + x
  35884. };
  35885. return result;
  35886. }
  35887. /**
  35888. * Get the opposite placement of the given one
  35889. * @method
  35890. * @memberof Popper.Utils
  35891. * @argument {String} placement
  35892. * @returns {String} flipped placement
  35893. */
  35894. function getOppositePlacement(placement) {
  35895. var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };
  35896. return placement.replace(/left|right|bottom|top/g, function (matched) {
  35897. return hash[matched];
  35898. });
  35899. }
  35900. /**
  35901. * Get offsets to the popper
  35902. * @method
  35903. * @memberof Popper.Utils
  35904. * @param {Object} position - CSS position the Popper will get applied
  35905. * @param {HTMLElement} popper - the popper element
  35906. * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)
  35907. * @param {String} placement - one of the valid placement options
  35908. * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper
  35909. */
  35910. function getPopperOffsets(popper, referenceOffsets, placement) {
  35911. placement = placement.split('-')[0];
  35912. // Get popper node sizes
  35913. var popperRect = getOuterSizes(popper);
  35914. // Add position, width and height to our offsets object
  35915. var popperOffsets = {
  35916. width: popperRect.width,
  35917. height: popperRect.height
  35918. };
  35919. // depending by the popper placement we have to compute its offsets slightly differently
  35920. var isHoriz = ['right', 'left'].indexOf(placement) !== -1;
  35921. var mainSide = isHoriz ? 'top' : 'left';
  35922. var secondarySide = isHoriz ? 'left' : 'top';
  35923. var measurement = isHoriz ? 'height' : 'width';
  35924. var secondaryMeasurement = !isHoriz ? 'height' : 'width';
  35925. popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2;
  35926. if (placement === secondarySide) {
  35927. popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];
  35928. } else {
  35929. popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)];
  35930. }
  35931. return popperOffsets;
  35932. }
  35933. /**
  35934. * Mimics the `find` method of Array
  35935. * @method
  35936. * @memberof Popper.Utils
  35937. * @argument {Array} arr
  35938. * @argument prop
  35939. * @argument value
  35940. * @returns index or -1
  35941. */
  35942. function find(arr, check) {
  35943. // use native find if supported
  35944. if (Array.prototype.find) {
  35945. return arr.find(check);
  35946. }
  35947. // use `filter` to obtain the same behavior of `find`
  35948. return arr.filter(check)[0];
  35949. }
  35950. /**
  35951. * Return the index of the matching object
  35952. * @method
  35953. * @memberof Popper.Utils
  35954. * @argument {Array} arr
  35955. * @argument prop
  35956. * @argument value
  35957. * @returns index or -1
  35958. */
  35959. function findIndex(arr, prop, value) {
  35960. // use native findIndex if supported
  35961. if (Array.prototype.findIndex) {
  35962. return arr.findIndex(function (cur) {
  35963. return cur[prop] === value;
  35964. });
  35965. }
  35966. // use `find` + `indexOf` if `findIndex` isn't supported
  35967. var match = find(arr, function (obj) {
  35968. return obj[prop] === value;
  35969. });
  35970. return arr.indexOf(match);
  35971. }
  35972. /**
  35973. * Loop trough the list of modifiers and run them in order,
  35974. * each of them will then edit the data object.
  35975. * @method
  35976. * @memberof Popper.Utils
  35977. * @param {dataObject} data
  35978. * @param {Array} modifiers
  35979. * @param {String} ends - Optional modifier name used as stopper
  35980. * @returns {dataObject}
  35981. */
  35982. function runModifiers(modifiers, data, ends) {
  35983. var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends));
  35984. modifiersToRun.forEach(function (modifier) {
  35985. if (modifier['function']) {
  35986. // eslint-disable-line dot-notation
  35987. console.warn('`modifier.function` is deprecated, use `modifier.fn`!');
  35988. }
  35989. var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation
  35990. if (modifier.enabled && isFunction(fn)) {
  35991. // Add properties to offsets to make them a complete clientRect object
  35992. // we do this before each modifier to make sure the previous one doesn't
  35993. // mess with these values
  35994. data.offsets.popper = getClientRect(data.offsets.popper);
  35995. data.offsets.reference = getClientRect(data.offsets.reference);
  35996. data = fn(data, modifier);
  35997. }
  35998. });
  35999. return data;
  36000. }
  36001. /**
  36002. * Updates the position of the popper, computing the new offsets and applying
  36003. * the new style.<br />
  36004. * Prefer `scheduleUpdate` over `update` because of performance reasons.
  36005. * @method
  36006. * @memberof Popper
  36007. */
  36008. function update() {
  36009. // if popper is destroyed, don't perform any further update
  36010. if (this.state.isDestroyed) {
  36011. return;
  36012. }
  36013. var data = {
  36014. instance: this,
  36015. styles: {},
  36016. arrowStyles: {},
  36017. attributes: {},
  36018. flipped: false,
  36019. offsets: {}
  36020. };
  36021. // compute reference element offsets
  36022. data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);
  36023. // compute auto placement, store placement inside the data object,
  36024. // modifiers will be able to edit `placement` if needed
  36025. // and refer to originalPlacement to know the original value
  36026. data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);
  36027. // store the computed placement inside `originalPlacement`
  36028. data.originalPlacement = data.placement;
  36029. data.positionFixed = this.options.positionFixed;
  36030. // compute the popper offsets
  36031. data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);
  36032. data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';
  36033. // run the modifiers
  36034. data = runModifiers(this.modifiers, data);
  36035. // the first `update` will call `onCreate` callback
  36036. // the other ones will call `onUpdate` callback
  36037. if (!this.state.isCreated) {
  36038. this.state.isCreated = true;
  36039. this.options.onCreate(data);
  36040. } else {
  36041. this.options.onUpdate(data);
  36042. }
  36043. }
  36044. /**
  36045. * Helper used to know if the given modifier is enabled.
  36046. * @method
  36047. * @memberof Popper.Utils
  36048. * @returns {Boolean}
  36049. */
  36050. function isModifierEnabled(modifiers, modifierName) {
  36051. return modifiers.some(function (_ref) {
  36052. var name = _ref.name,
  36053. enabled = _ref.enabled;
  36054. return enabled && name === modifierName;
  36055. });
  36056. }
  36057. /**
  36058. * Get the prefixed supported property name
  36059. * @method
  36060. * @memberof Popper.Utils
  36061. * @argument {String} property (camelCase)
  36062. * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix)
  36063. */
  36064. function getSupportedPropertyName(property) {
  36065. var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];
  36066. var upperProp = property.charAt(0).toUpperCase() + property.slice(1);
  36067. for (var i = 0; i < prefixes.length; i++) {
  36068. var prefix = prefixes[i];
  36069. var toCheck = prefix ? '' + prefix + upperProp : property;
  36070. if (typeof document.body.style[toCheck] !== 'undefined') {
  36071. return toCheck;
  36072. }
  36073. }
  36074. return null;
  36075. }
  36076. /**
  36077. * Destroys the popper.
  36078. * @method
  36079. * @memberof Popper
  36080. */
  36081. function destroy() {
  36082. this.state.isDestroyed = true;
  36083. // touch DOM only if `applyStyle` modifier is enabled
  36084. if (isModifierEnabled(this.modifiers, 'applyStyle')) {
  36085. this.popper.removeAttribute('x-placement');
  36086. this.popper.style.position = '';
  36087. this.popper.style.top = '';
  36088. this.popper.style.left = '';
  36089. this.popper.style.right = '';
  36090. this.popper.style.bottom = '';
  36091. this.popper.style.willChange = '';
  36092. this.popper.style[getSupportedPropertyName('transform')] = '';
  36093. }
  36094. this.disableEventListeners();
  36095. // remove the popper if user explicitly asked for the deletion on destroy
  36096. // do not use `remove` because IE11 doesn't support it
  36097. if (this.options.removeOnDestroy) {
  36098. this.popper.parentNode.removeChild(this.popper);
  36099. }
  36100. return this;
  36101. }
  36102. /**
  36103. * Get the window associated with the element
  36104. * @argument {Element} element
  36105. * @returns {Window}
  36106. */
  36107. function getWindow(element) {
  36108. var ownerDocument = element.ownerDocument;
  36109. return ownerDocument ? ownerDocument.defaultView : window;
  36110. }
  36111. function attachToScrollParents(scrollParent, event, callback, scrollParents) {
  36112. var isBody = scrollParent.nodeName === 'BODY';
  36113. var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;
  36114. target.addEventListener(event, callback, { passive: true });
  36115. if (!isBody) {
  36116. attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents);
  36117. }
  36118. scrollParents.push(target);
  36119. }
  36120. /**
  36121. * Setup needed event listeners used to update the popper position
  36122. * @method
  36123. * @memberof Popper.Utils
  36124. * @private
  36125. */
  36126. function setupEventListeners(reference, options, state, updateBound) {
  36127. // Resize event listener on window
  36128. state.updateBound = updateBound;
  36129. getWindow(reference).addEventListener('resize', state.updateBound, { passive: true });
  36130. // Scroll event listener on scroll parents
  36131. var scrollElement = getScrollParent(reference);
  36132. attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents);
  36133. state.scrollElement = scrollElement;
  36134. state.eventsEnabled = true;
  36135. return state;
  36136. }
  36137. /**
  36138. * It will add resize/scroll events and start recalculating
  36139. * position of the popper element when they are triggered.
  36140. * @method
  36141. * @memberof Popper
  36142. */
  36143. function enableEventListeners() {
  36144. if (!this.state.eventsEnabled) {
  36145. this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate);
  36146. }
  36147. }
  36148. /**
  36149. * Remove event listeners used to update the popper position
  36150. * @method
  36151. * @memberof Popper.Utils
  36152. * @private
  36153. */
  36154. function removeEventListeners(reference, state) {
  36155. // Remove resize event listener on window
  36156. getWindow(reference).removeEventListener('resize', state.updateBound);
  36157. // Remove scroll event listener on scroll parents
  36158. state.scrollParents.forEach(function (target) {
  36159. target.removeEventListener('scroll', state.updateBound);
  36160. });
  36161. // Reset state
  36162. state.updateBound = null;
  36163. state.scrollParents = [];
  36164. state.scrollElement = null;
  36165. state.eventsEnabled = false;
  36166. return state;
  36167. }
  36168. /**
  36169. * It will remove resize/scroll events and won't recalculate popper position
  36170. * when they are triggered. It also won't trigger `onUpdate` callback anymore,
  36171. * unless you call `update` method manually.
  36172. * @method
  36173. * @memberof Popper
  36174. */
  36175. function disableEventListeners() {
  36176. if (this.state.eventsEnabled) {
  36177. cancelAnimationFrame(this.scheduleUpdate);
  36178. this.state = removeEventListeners(this.reference, this.state);
  36179. }
  36180. }
  36181. /**
  36182. * Tells if a given input is a number
  36183. * @method
  36184. * @memberof Popper.Utils
  36185. * @param {*} input to check
  36186. * @return {Boolean}
  36187. */
  36188. function isNumeric(n) {
  36189. return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);
  36190. }
  36191. /**
  36192. * Set the style to the given popper
  36193. * @method
  36194. * @memberof Popper.Utils
  36195. * @argument {Element} element - Element to apply the style to
  36196. * @argument {Object} styles
  36197. * Object with a list of properties and values which will be applied to the element
  36198. */
  36199. function setStyles(element, styles) {
  36200. Object.keys(styles).forEach(function (prop) {
  36201. var unit = '';
  36202. // add unit if the value is numeric and is one of the following
  36203. if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) {
  36204. unit = 'px';
  36205. }
  36206. element.style[prop] = styles[prop] + unit;
  36207. });
  36208. }
  36209. /**
  36210. * Set the attributes to the given popper
  36211. * @method
  36212. * @memberof Popper.Utils
  36213. * @argument {Element} element - Element to apply the attributes to
  36214. * @argument {Object} styles
  36215. * Object with a list of properties and values which will be applied to the element
  36216. */
  36217. function setAttributes(element, attributes) {
  36218. Object.keys(attributes).forEach(function (prop) {
  36219. var value = attributes[prop];
  36220. if (value !== false) {
  36221. element.setAttribute(prop, attributes[prop]);
  36222. } else {
  36223. element.removeAttribute(prop);
  36224. }
  36225. });
  36226. }
  36227. /**
  36228. * @function
  36229. * @memberof Modifiers
  36230. * @argument {Object} data - The data object generated by `update` method
  36231. * @argument {Object} data.styles - List of style properties - values to apply to popper element
  36232. * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element
  36233. * @argument {Object} options - Modifiers configuration and options
  36234. * @returns {Object} The same data object
  36235. */
  36236. function applyStyle(data) {
  36237. // any property present in `data.styles` will be applied to the popper,
  36238. // in this way we can make the 3rd party modifiers add custom styles to it
  36239. // Be aware, modifiers could override the properties defined in the previous
  36240. // lines of this modifier!
  36241. setStyles(data.instance.popper, data.styles);
  36242. // any property present in `data.attributes` will be applied to the popper,
  36243. // they will be set as HTML attributes of the element
  36244. setAttributes(data.instance.popper, data.attributes);
  36245. // if arrowElement is defined and arrowStyles has some properties
  36246. if (data.arrowElement && Object.keys(data.arrowStyles).length) {
  36247. setStyles(data.arrowElement, data.arrowStyles);
  36248. }
  36249. return data;
  36250. }
  36251. /**
  36252. * Set the x-placement attribute before everything else because it could be used
  36253. * to add margins to the popper margins needs to be calculated to get the
  36254. * correct popper offsets.
  36255. * @method
  36256. * @memberof Popper.modifiers
  36257. * @param {HTMLElement} reference - The reference element used to position the popper
  36258. * @param {HTMLElement} popper - The HTML element used as popper
  36259. * @param {Object} options - Popper.js options
  36260. */
  36261. function applyStyleOnLoad(reference, popper, options, modifierOptions, state) {
  36262. // compute reference element offsets
  36263. var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed);
  36264. // compute auto placement, store placement inside the data object,
  36265. // modifiers will be able to edit `placement` if needed
  36266. // and refer to originalPlacement to know the original value
  36267. var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding);
  36268. popper.setAttribute('x-placement', placement);
  36269. // Apply `position` to popper before anything else because
  36270. // without the position applied we can't guarantee correct computations
  36271. setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' });
  36272. return options;
  36273. }
  36274. /**
  36275. * @function
  36276. * @memberof Popper.Utils
  36277. * @argument {Object} data - The data object generated by `update` method
  36278. * @argument {Boolean} shouldRound - If the offsets should be rounded at all
  36279. * @returns {Object} The popper's position offsets rounded
  36280. *
  36281. * The tale of pixel-perfect positioning. It's still not 100% perfect, but as
  36282. * good as it can be within reason.
  36283. * Discussion here: https://github.com/FezVrasta/popper.js/pull/715
  36284. *
  36285. * Low DPI screens cause a popper to be blurry if not using full pixels (Safari
  36286. * as well on High DPI screens).
  36287. *
  36288. * Firefox prefers no rounding for positioning and does not have blurriness on
  36289. * high DPI screens.
  36290. *
  36291. * Only horizontal placement and left/right values need to be considered.
  36292. */
  36293. function getRoundedOffsets(data, shouldRound) {
  36294. var _data$offsets = data.offsets,
  36295. popper = _data$offsets.popper,
  36296. reference = _data$offsets.reference;
  36297. var round = Math.round,
  36298. floor = Math.floor;
  36299. var noRound = function noRound(v) {
  36300. return v;
  36301. };
  36302. var referenceWidth = round(reference.width);
  36303. var popperWidth = round(popper.width);
  36304. var isVertical = ['left', 'right'].indexOf(data.placement) !== -1;
  36305. var isVariation = data.placement.indexOf('-') !== -1;
  36306. var sameWidthParity = referenceWidth % 2 === popperWidth % 2;
  36307. var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1;
  36308. var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor;
  36309. var verticalToInteger = !shouldRound ? noRound : round;
  36310. return {
  36311. left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left),
  36312. top: verticalToInteger(popper.top),
  36313. bottom: verticalToInteger(popper.bottom),
  36314. right: horizontalToInteger(popper.right)
  36315. };
  36316. }
  36317. var isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent);
  36318. /**
  36319. * @function
  36320. * @memberof Modifiers
  36321. * @argument {Object} data - The data object generated by `update` method
  36322. * @argument {Object} options - Modifiers configuration and options
  36323. * @returns {Object} The data object, properly modified
  36324. */
  36325. function computeStyle(data, options) {
  36326. var x = options.x,
  36327. y = options.y;
  36328. var popper = data.offsets.popper;
  36329. // Remove this legacy support in Popper.js v2
  36330. var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) {
  36331. return modifier.name === 'applyStyle';
  36332. }).gpuAcceleration;
  36333. if (legacyGpuAccelerationOption !== undefined) {
  36334. console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');
  36335. }
  36336. var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration;
  36337. var offsetParent = getOffsetParent(data.instance.popper);
  36338. var offsetParentRect = getBoundingClientRect(offsetParent);
  36339. // Styles
  36340. var styles = {
  36341. position: popper.position
  36342. };
  36343. var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox);
  36344. var sideA = x === 'bottom' ? 'top' : 'bottom';
  36345. var sideB = y === 'right' ? 'left' : 'right';
  36346. // if gpuAcceleration is set to `true` and transform is supported,
  36347. // we use `translate3d` to apply the position to the popper we
  36348. // automatically use the supported prefixed version if needed
  36349. var prefixedProperty = getSupportedPropertyName('transform');
  36350. // now, let's make a step back and look at this code closely (wtf?)
  36351. // If the content of the popper grows once it's been positioned, it
  36352. // may happen that the popper gets misplaced because of the new content
  36353. // overflowing its reference element
  36354. // To avoid this problem, we provide two options (x and y), which allow
  36355. // the consumer to define the offset origin.
  36356. // If we position a popper on top of a reference element, we can set
  36357. // `x` to `top` to make the popper grow towards its top instead of
  36358. // its bottom.
  36359. var left = void 0,
  36360. top = void 0;
  36361. if (sideA === 'bottom') {
  36362. // when offsetParent is <html> the positioning is relative to the bottom of the screen (excluding the scrollbar)
  36363. // and not the bottom of the html element
  36364. if (offsetParent.nodeName === 'HTML') {
  36365. top = -offsetParent.clientHeight + offsets.bottom;
  36366. } else {
  36367. top = -offsetParentRect.height + offsets.bottom;
  36368. }
  36369. } else {
  36370. top = offsets.top;
  36371. }
  36372. if (sideB === 'right') {
  36373. if (offsetParent.nodeName === 'HTML') {
  36374. left = -offsetParent.clientWidth + offsets.right;
  36375. } else {
  36376. left = -offsetParentRect.width + offsets.right;
  36377. }
  36378. } else {
  36379. left = offsets.left;
  36380. }
  36381. if (gpuAcceleration && prefixedProperty) {
  36382. styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';
  36383. styles[sideA] = 0;
  36384. styles[sideB] = 0;
  36385. styles.willChange = 'transform';
  36386. } else {
  36387. // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties
  36388. var invertTop = sideA === 'bottom' ? -1 : 1;
  36389. var invertLeft = sideB === 'right' ? -1 : 1;
  36390. styles[sideA] = top * invertTop;
  36391. styles[sideB] = left * invertLeft;
  36392. styles.willChange = sideA + ', ' + sideB;
  36393. }
  36394. // Attributes
  36395. var attributes = {
  36396. 'x-placement': data.placement
  36397. };
  36398. // Update `data` attributes, styles and arrowStyles
  36399. data.attributes = _extends({}, attributes, data.attributes);
  36400. data.styles = _extends({}, styles, data.styles);
  36401. data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles);
  36402. return data;
  36403. }
  36404. /**
  36405. * Helper used to know if the given modifier depends from another one.<br />
  36406. * It checks if the needed modifier is listed and enabled.
  36407. * @method
  36408. * @memberof Popper.Utils
  36409. * @param {Array} modifiers - list of modifiers
  36410. * @param {String} requestingName - name of requesting modifier
  36411. * @param {String} requestedName - name of requested modifier
  36412. * @returns {Boolean}
  36413. */
  36414. function isModifierRequired(modifiers, requestingName, requestedName) {
  36415. var requesting = find(modifiers, function (_ref) {
  36416. var name = _ref.name;
  36417. return name === requestingName;
  36418. });
  36419. var isRequired = !!requesting && modifiers.some(function (modifier) {
  36420. return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order;
  36421. });
  36422. if (!isRequired) {
  36423. var _requesting = '`' + requestingName + '`';
  36424. var requested = '`' + requestedName + '`';
  36425. console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!');
  36426. }
  36427. return isRequired;
  36428. }
  36429. /**
  36430. * @function
  36431. * @memberof Modifiers
  36432. * @argument {Object} data - The data object generated by update method
  36433. * @argument {Object} options - Modifiers configuration and options
  36434. * @returns {Object} The data object, properly modified
  36435. */
  36436. function arrow(data, options) {
  36437. var _data$offsets$arrow;
  36438. // arrow depends on keepTogether in order to work
  36439. if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {
  36440. return data;
  36441. }
  36442. var arrowElement = options.element;
  36443. // if arrowElement is a string, suppose it's a CSS selector
  36444. if (typeof arrowElement === 'string') {
  36445. arrowElement = data.instance.popper.querySelector(arrowElement);
  36446. // if arrowElement is not found, don't run the modifier
  36447. if (!arrowElement) {
  36448. return data;
  36449. }
  36450. } else {
  36451. // if the arrowElement isn't a query selector we must check that the
  36452. // provided DOM node is child of its popper node
  36453. if (!data.instance.popper.contains(arrowElement)) {
  36454. console.warn('WARNING: `arrow.element` must be child of its popper element!');
  36455. return data;
  36456. }
  36457. }
  36458. var placement = data.placement.split('-')[0];
  36459. var _data$offsets = data.offsets,
  36460. popper = _data$offsets.popper,
  36461. reference = _data$offsets.reference;
  36462. var isVertical = ['left', 'right'].indexOf(placement) !== -1;
  36463. var len = isVertical ? 'height' : 'width';
  36464. var sideCapitalized = isVertical ? 'Top' : 'Left';
  36465. var side = sideCapitalized.toLowerCase();
  36466. var altSide = isVertical ? 'left' : 'top';
  36467. var opSide = isVertical ? 'bottom' : 'right';
  36468. var arrowElementSize = getOuterSizes(arrowElement)[len];
  36469. //
  36470. // extends keepTogether behavior making sure the popper and its
  36471. // reference have enough pixels in conjunction
  36472. //
  36473. // top/left side
  36474. if (reference[opSide] - arrowElementSize < popper[side]) {
  36475. data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize);
  36476. }
  36477. // bottom/right side
  36478. if (reference[side] + arrowElementSize > popper[opSide]) {
  36479. data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide];
  36480. }
  36481. data.offsets.popper = getClientRect(data.offsets.popper);
  36482. // compute center of the popper
  36483. var center = reference[side] + reference[len] / 2 - arrowElementSize / 2;
  36484. // Compute the sideValue using the updated popper offsets
  36485. // take popper margin in account because we don't have this info available
  36486. var css = getStyleComputedProperty(data.instance.popper);
  36487. var popperMarginSide = parseFloat(css['margin' + sideCapitalized]);
  36488. var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width']);
  36489. var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide;
  36490. // prevent arrowElement from being placed not contiguously to its popper
  36491. sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);
  36492. data.arrowElement = arrowElement;
  36493. data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow);
  36494. return data;
  36495. }
  36496. /**
  36497. * Get the opposite placement variation of the given one
  36498. * @method
  36499. * @memberof Popper.Utils
  36500. * @argument {String} placement variation
  36501. * @returns {String} flipped placement variation
  36502. */
  36503. function getOppositeVariation(variation) {
  36504. if (variation === 'end') {
  36505. return 'start';
  36506. } else if (variation === 'start') {
  36507. return 'end';
  36508. }
  36509. return variation;
  36510. }
  36511. /**
  36512. * List of accepted placements to use as values of the `placement` option.<br />
  36513. * Valid placements are:
  36514. * - `auto`
  36515. * - `top`
  36516. * - `right`
  36517. * - `bottom`
  36518. * - `left`
  36519. *
  36520. * Each placement can have a variation from this list:
  36521. * - `-start`
  36522. * - `-end`
  36523. *
  36524. * Variations are interpreted easily if you think of them as the left to right
  36525. * written languages. Horizontally (`top` and `bottom`), `start` is left and `end`
  36526. * is right.<br />
  36527. * Vertically (`left` and `right`), `start` is top and `end` is bottom.
  36528. *
  36529. * Some valid examples are:
  36530. * - `top-end` (on top of reference, right aligned)
  36531. * - `right-start` (on right of reference, top aligned)
  36532. * - `bottom` (on bottom, centered)
  36533. * - `auto-end` (on the side with more space available, alignment depends by placement)
  36534. *
  36535. * @static
  36536. * @type {Array}
  36537. * @enum {String}
  36538. * @readonly
  36539. * @method placements
  36540. * @memberof Popper
  36541. */
  36542. var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start'];
  36543. // Get rid of `auto` `auto-start` and `auto-end`
  36544. var validPlacements = placements.slice(3);
  36545. /**
  36546. * Given an initial placement, returns all the subsequent placements
  36547. * clockwise (or counter-clockwise).
  36548. *
  36549. * @method
  36550. * @memberof Popper.Utils
  36551. * @argument {String} placement - A valid placement (it accepts variations)
  36552. * @argument {Boolean} counter - Set to true to walk the placements counterclockwise
  36553. * @returns {Array} placements including their variations
  36554. */
  36555. function clockwise(placement) {
  36556. var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  36557. var index = validPlacements.indexOf(placement);
  36558. var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));
  36559. return counter ? arr.reverse() : arr;
  36560. }
  36561. var BEHAVIORS = {
  36562. FLIP: 'flip',
  36563. CLOCKWISE: 'clockwise',
  36564. COUNTERCLOCKWISE: 'counterclockwise'
  36565. };
  36566. /**
  36567. * @function
  36568. * @memberof Modifiers
  36569. * @argument {Object} data - The data object generated by update method
  36570. * @argument {Object} options - Modifiers configuration and options
  36571. * @returns {Object} The data object, properly modified
  36572. */
  36573. function flip(data, options) {
  36574. // if `inner` modifier is enabled, we can't use the `flip` modifier
  36575. if (isModifierEnabled(data.instance.modifiers, 'inner')) {
  36576. return data;
  36577. }
  36578. if (data.flipped && data.placement === data.originalPlacement) {
  36579. // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides
  36580. return data;
  36581. }
  36582. var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed);
  36583. var placement = data.placement.split('-')[0];
  36584. var placementOpposite = getOppositePlacement(placement);
  36585. var variation = data.placement.split('-')[1] || '';
  36586. var flipOrder = [];
  36587. switch (options.behavior) {
  36588. case BEHAVIORS.FLIP:
  36589. flipOrder = [placement, placementOpposite];
  36590. break;
  36591. case BEHAVIORS.CLOCKWISE:
  36592. flipOrder = clockwise(placement);
  36593. break;
  36594. case BEHAVIORS.COUNTERCLOCKWISE:
  36595. flipOrder = clockwise(placement, true);
  36596. break;
  36597. default:
  36598. flipOrder = options.behavior;
  36599. }
  36600. flipOrder.forEach(function (step, index) {
  36601. if (placement !== step || flipOrder.length === index + 1) {
  36602. return data;
  36603. }
  36604. placement = data.placement.split('-')[0];
  36605. placementOpposite = getOppositePlacement(placement);
  36606. var popperOffsets = data.offsets.popper;
  36607. var refOffsets = data.offsets.reference;
  36608. // using floor because the reference offsets may contain decimals we are not going to consider here
  36609. var floor = Math.floor;
  36610. var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom);
  36611. var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);
  36612. var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);
  36613. var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);
  36614. var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom);
  36615. var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom;
  36616. // flip the variation if required
  36617. var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
  36618. // flips variation if reference element overflows boundaries
  36619. var flippedVariationByRef = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom);
  36620. // flips variation if popper content overflows boundaries
  36621. var flippedVariationByContent = !!options.flipVariationsByContent && (isVertical && variation === 'start' && overflowsRight || isVertical && variation === 'end' && overflowsLeft || !isVertical && variation === 'start' && overflowsBottom || !isVertical && variation === 'end' && overflowsTop);
  36622. var flippedVariation = flippedVariationByRef || flippedVariationByContent;
  36623. if (overlapsRef || overflowsBoundaries || flippedVariation) {
  36624. // this boolean to detect any flip loop
  36625. data.flipped = true;
  36626. if (overlapsRef || overflowsBoundaries) {
  36627. placement = flipOrder[index + 1];
  36628. }
  36629. if (flippedVariation) {
  36630. variation = getOppositeVariation(variation);
  36631. }
  36632. data.placement = placement + (variation ? '-' + variation : '');
  36633. // this object contains `position`, we want to preserve it along with
  36634. // any additional property we may add in the future
  36635. data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));
  36636. data = runModifiers(data.instance.modifiers, data, 'flip');
  36637. }
  36638. });
  36639. return data;
  36640. }
  36641. /**
  36642. * @function
  36643. * @memberof Modifiers
  36644. * @argument {Object} data - The data object generated by update method
  36645. * @argument {Object} options - Modifiers configuration and options
  36646. * @returns {Object} The data object, properly modified
  36647. */
  36648. function keepTogether(data) {
  36649. var _data$offsets = data.offsets,
  36650. popper = _data$offsets.popper,
  36651. reference = _data$offsets.reference;
  36652. var placement = data.placement.split('-')[0];
  36653. var floor = Math.floor;
  36654. var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
  36655. var side = isVertical ? 'right' : 'bottom';
  36656. var opSide = isVertical ? 'left' : 'top';
  36657. var measurement = isVertical ? 'width' : 'height';
  36658. if (popper[side] < floor(reference[opSide])) {
  36659. data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement];
  36660. }
  36661. if (popper[opSide] > floor(reference[side])) {
  36662. data.offsets.popper[opSide] = floor(reference[side]);
  36663. }
  36664. return data;
  36665. }
  36666. /**
  36667. * Converts a string containing value + unit into a px value number
  36668. * @function
  36669. * @memberof {modifiers~offset}
  36670. * @private
  36671. * @argument {String} str - Value + unit string
  36672. * @argument {String} measurement - `height` or `width`
  36673. * @argument {Object} popperOffsets
  36674. * @argument {Object} referenceOffsets
  36675. * @returns {Number|String}
  36676. * Value in pixels, or original string if no values were extracted
  36677. */
  36678. function toValue(str, measurement, popperOffsets, referenceOffsets) {
  36679. // separate value from unit
  36680. var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/);
  36681. var value = +split[1];
  36682. var unit = split[2];
  36683. // If it's not a number it's an operator, I guess
  36684. if (!value) {
  36685. return str;
  36686. }
  36687. if (unit.indexOf('%') === 0) {
  36688. var element = void 0;
  36689. switch (unit) {
  36690. case '%p':
  36691. element = popperOffsets;
  36692. break;
  36693. case '%':
  36694. case '%r':
  36695. default:
  36696. element = referenceOffsets;
  36697. }
  36698. var rect = getClientRect(element);
  36699. return rect[measurement] / 100 * value;
  36700. } else if (unit === 'vh' || unit === 'vw') {
  36701. // if is a vh or vw, we calculate the size based on the viewport
  36702. var size = void 0;
  36703. if (unit === 'vh') {
  36704. size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
  36705. } else {
  36706. size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
  36707. }
  36708. return size / 100 * value;
  36709. } else {
  36710. // if is an explicit pixel unit, we get rid of the unit and keep the value
  36711. // if is an implicit unit, it's px, and we return just the value
  36712. return value;
  36713. }
  36714. }
  36715. /**
  36716. * Parse an `offset` string to extrapolate `x` and `y` numeric offsets.
  36717. * @function
  36718. * @memberof {modifiers~offset}
  36719. * @private
  36720. * @argument {String} offset
  36721. * @argument {Object} popperOffsets
  36722. * @argument {Object} referenceOffsets
  36723. * @argument {String} basePlacement
  36724. * @returns {Array} a two cells array with x and y offsets in numbers
  36725. */
  36726. function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) {
  36727. var offsets = [0, 0];
  36728. // Use height if placement is left or right and index is 0 otherwise use width
  36729. // in this way the first offset will use an axis and the second one
  36730. // will use the other one
  36731. var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1;
  36732. // Split the offset string to obtain a list of values and operands
  36733. // The regex addresses values with the plus or minus sign in front (+10, -20, etc)
  36734. var fragments = offset.split(/(\+|\-)/).map(function (frag) {
  36735. return frag.trim();
  36736. });
  36737. // Detect if the offset string contains a pair of values or a single one
  36738. // they could be separated by comma or space
  36739. var divider = fragments.indexOf(find(fragments, function (frag) {
  36740. return frag.search(/,|\s/) !== -1;
  36741. }));
  36742. if (fragments[divider] && fragments[divider].indexOf(',') === -1) {
  36743. console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');
  36744. }
  36745. // If divider is found, we divide the list of values and operands to divide
  36746. // them by ofset X and Y.
  36747. var splitRegex = /\s*,\s*|\s+/;
  36748. var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments];
  36749. // Convert the values with units to absolute pixels to allow our computations
  36750. ops = ops.map(function (op, index) {
  36751. // Most of the units rely on the orientation of the popper
  36752. var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width';
  36753. var mergeWithPrevious = false;
  36754. return op
  36755. // This aggregates any `+` or `-` sign that aren't considered operators
  36756. // e.g.: 10 + +5 => [10, +, +5]
  36757. .reduce(function (a, b) {
  36758. if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {
  36759. a[a.length - 1] = b;
  36760. mergeWithPrevious = true;
  36761. return a;
  36762. } else if (mergeWithPrevious) {
  36763. a[a.length - 1] += b;
  36764. mergeWithPrevious = false;
  36765. return a;
  36766. } else {
  36767. return a.concat(b);
  36768. }
  36769. }, [])
  36770. // Here we convert the string values into number values (in px)
  36771. .map(function (str) {
  36772. return toValue(str, measurement, popperOffsets, referenceOffsets);
  36773. });
  36774. });
  36775. // Loop trough the offsets arrays and execute the operations
  36776. ops.forEach(function (op, index) {
  36777. op.forEach(function (frag, index2) {
  36778. if (isNumeric(frag)) {
  36779. offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);
  36780. }
  36781. });
  36782. });
  36783. return offsets;
  36784. }
  36785. /**
  36786. * @function
  36787. * @memberof Modifiers
  36788. * @argument {Object} data - The data object generated by update method
  36789. * @argument {Object} options - Modifiers configuration and options
  36790. * @argument {Number|String} options.offset=0
  36791. * The offset value as described in the modifier description
  36792. * @returns {Object} The data object, properly modified
  36793. */
  36794. function offset(data, _ref) {
  36795. var offset = _ref.offset;
  36796. var placement = data.placement,
  36797. _data$offsets = data.offsets,
  36798. popper = _data$offsets.popper,
  36799. reference = _data$offsets.reference;
  36800. var basePlacement = placement.split('-')[0];
  36801. var offsets = void 0;
  36802. if (isNumeric(+offset)) {
  36803. offsets = [+offset, 0];
  36804. } else {
  36805. offsets = parseOffset(offset, popper, reference, basePlacement);
  36806. }
  36807. if (basePlacement === 'left') {
  36808. popper.top += offsets[0];
  36809. popper.left -= offsets[1];
  36810. } else if (basePlacement === 'right') {
  36811. popper.top += offsets[0];
  36812. popper.left += offsets[1];
  36813. } else if (basePlacement === 'top') {
  36814. popper.left += offsets[0];
  36815. popper.top -= offsets[1];
  36816. } else if (basePlacement === 'bottom') {
  36817. popper.left += offsets[0];
  36818. popper.top += offsets[1];
  36819. }
  36820. data.popper = popper;
  36821. return data;
  36822. }
  36823. /**
  36824. * @function
  36825. * @memberof Modifiers
  36826. * @argument {Object} data - The data object generated by `update` method
  36827. * @argument {Object} options - Modifiers configuration and options
  36828. * @returns {Object} The data object, properly modified
  36829. */
  36830. function preventOverflow(data, options) {
  36831. var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper);
  36832. // If offsetParent is the reference element, we really want to
  36833. // go one step up and use the next offsetParent as reference to
  36834. // avoid to make this modifier completely useless and look like broken
  36835. if (data.instance.reference === boundariesElement) {
  36836. boundariesElement = getOffsetParent(boundariesElement);
  36837. }
  36838. // NOTE: DOM access here
  36839. // resets the popper's position so that the document size can be calculated excluding
  36840. // the size of the popper element itself
  36841. var transformProp = getSupportedPropertyName('transform');
  36842. var popperStyles = data.instance.popper.style; // assignment to help minification
  36843. var top = popperStyles.top,
  36844. left = popperStyles.left,
  36845. transform = popperStyles[transformProp];
  36846. popperStyles.top = '';
  36847. popperStyles.left = '';
  36848. popperStyles[transformProp] = '';
  36849. var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed);
  36850. // NOTE: DOM access here
  36851. // restores the original style properties after the offsets have been computed
  36852. popperStyles.top = top;
  36853. popperStyles.left = left;
  36854. popperStyles[transformProp] = transform;
  36855. options.boundaries = boundaries;
  36856. var order = options.priority;
  36857. var popper = data.offsets.popper;
  36858. var check = {
  36859. primary: function primary(placement) {
  36860. var value = popper[placement];
  36861. if (popper[placement] < boundaries[placement] && !options.escapeWithReference) {
  36862. value = Math.max(popper[placement], boundaries[placement]);
  36863. }
  36864. return defineProperty({}, placement, value);
  36865. },
  36866. secondary: function secondary(placement) {
  36867. var mainSide = placement === 'right' ? 'left' : 'top';
  36868. var value = popper[mainSide];
  36869. if (popper[placement] > boundaries[placement] && !options.escapeWithReference) {
  36870. value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height));
  36871. }
  36872. return defineProperty({}, mainSide, value);
  36873. }
  36874. };
  36875. order.forEach(function (placement) {
  36876. var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';
  36877. popper = _extends({}, popper, check[side](placement));
  36878. });
  36879. data.offsets.popper = popper;
  36880. return data;
  36881. }
  36882. /**
  36883. * @function
  36884. * @memberof Modifiers
  36885. * @argument {Object} data - The data object generated by `update` method
  36886. * @argument {Object} options - Modifiers configuration and options
  36887. * @returns {Object} The data object, properly modified
  36888. */
  36889. function shift(data) {
  36890. var placement = data.placement;
  36891. var basePlacement = placement.split('-')[0];
  36892. var shiftvariation = placement.split('-')[1];
  36893. // if shift shiftvariation is specified, run the modifier
  36894. if (shiftvariation) {
  36895. var _data$offsets = data.offsets,
  36896. reference = _data$offsets.reference,
  36897. popper = _data$offsets.popper;
  36898. var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;
  36899. var side = isVertical ? 'left' : 'top';
  36900. var measurement = isVertical ? 'width' : 'height';
  36901. var shiftOffsets = {
  36902. start: defineProperty({}, side, reference[side]),
  36903. end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement])
  36904. };
  36905. data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]);
  36906. }
  36907. return data;
  36908. }
  36909. /**
  36910. * @function
  36911. * @memberof Modifiers
  36912. * @argument {Object} data - The data object generated by update method
  36913. * @argument {Object} options - Modifiers configuration and options
  36914. * @returns {Object} The data object, properly modified
  36915. */
  36916. function hide(data) {
  36917. if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {
  36918. return data;
  36919. }
  36920. var refRect = data.offsets.reference;
  36921. var bound = find(data.instance.modifiers, function (modifier) {
  36922. return modifier.name === 'preventOverflow';
  36923. }).boundaries;
  36924. if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) {
  36925. // Avoid unnecessary DOM access if visibility hasn't changed
  36926. if (data.hide === true) {
  36927. return data;
  36928. }
  36929. data.hide = true;
  36930. data.attributes['x-out-of-boundaries'] = '';
  36931. } else {
  36932. // Avoid unnecessary DOM access if visibility hasn't changed
  36933. if (data.hide === false) {
  36934. return data;
  36935. }
  36936. data.hide = false;
  36937. data.attributes['x-out-of-boundaries'] = false;
  36938. }
  36939. return data;
  36940. }
  36941. /**
  36942. * @function
  36943. * @memberof Modifiers
  36944. * @argument {Object} data - The data object generated by `update` method
  36945. * @argument {Object} options - Modifiers configuration and options
  36946. * @returns {Object} The data object, properly modified
  36947. */
  36948. function inner(data) {
  36949. var placement = data.placement;
  36950. var basePlacement = placement.split('-')[0];
  36951. var _data$offsets = data.offsets,
  36952. popper = _data$offsets.popper,
  36953. reference = _data$offsets.reference;
  36954. var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;
  36955. var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;
  36956. popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);
  36957. data.placement = getOppositePlacement(placement);
  36958. data.offsets.popper = getClientRect(popper);
  36959. return data;
  36960. }
  36961. /**
  36962. * Modifier function, each modifier can have a function of this type assigned
  36963. * to its `fn` property.<br />
  36964. * These functions will be called on each update, this means that you must
  36965. * make sure they are performant enough to avoid performance bottlenecks.
  36966. *
  36967. * @function ModifierFn
  36968. * @argument {dataObject} data - The data object generated by `update` method
  36969. * @argument {Object} options - Modifiers configuration and options
  36970. * @returns {dataObject} The data object, properly modified
  36971. */
  36972. /**
  36973. * Modifiers are plugins used to alter the behavior of your poppers.<br />
  36974. * Popper.js uses a set of 9 modifiers to provide all the basic functionalities
  36975. * needed by the library.
  36976. *
  36977. * Usually you don't want to override the `order`, `fn` and `onLoad` props.
  36978. * All the other properties are configurations that could be tweaked.
  36979. * @namespace modifiers
  36980. */
  36981. var modifiers = {
  36982. /**
  36983. * Modifier used to shift the popper on the start or end of its reference
  36984. * element.<br />
  36985. * It will read the variation of the `placement` property.<br />
  36986. * It can be one either `-end` or `-start`.
  36987. * @memberof modifiers
  36988. * @inner
  36989. */
  36990. shift: {
  36991. /** @prop {number} order=100 - Index used to define the order of execution */
  36992. order: 100,
  36993. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  36994. enabled: true,
  36995. /** @prop {ModifierFn} */
  36996. fn: shift
  36997. },
  36998. /**
  36999. * The `offset` modifier can shift your popper on both its axis.
  37000. *
  37001. * It accepts the following units:
  37002. * - `px` or unit-less, interpreted as pixels
  37003. * - `%` or `%r`, percentage relative to the length of the reference element
  37004. * - `%p`, percentage relative to the length of the popper element
  37005. * - `vw`, CSS viewport width unit
  37006. * - `vh`, CSS viewport height unit
  37007. *
  37008. * For length is intended the main axis relative to the placement of the popper.<br />
  37009. * This means that if the placement is `top` or `bottom`, the length will be the
  37010. * `width`. In case of `left` or `right`, it will be the `height`.
  37011. *
  37012. * You can provide a single value (as `Number` or `String`), or a pair of values
  37013. * as `String` divided by a comma or one (or more) white spaces.<br />
  37014. * The latter is a deprecated method because it leads to confusion and will be
  37015. * removed in v2.<br />
  37016. * Additionally, it accepts additions and subtractions between different units.
  37017. * Note that multiplications and divisions aren't supported.
  37018. *
  37019. * Valid examples are:
  37020. * ```
  37021. * 10
  37022. * '10%'
  37023. * '10, 10'
  37024. * '10%, 10'
  37025. * '10 + 10%'
  37026. * '10 - 5vh + 3%'
  37027. * '-10px + 5vh, 5px - 6%'
  37028. * ```
  37029. * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap
  37030. * > with their reference element, unfortunately, you will have to disable the `flip` modifier.
  37031. * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373).
  37032. *
  37033. * @memberof modifiers
  37034. * @inner
  37035. */
  37036. offset: {
  37037. /** @prop {number} order=200 - Index used to define the order of execution */
  37038. order: 200,
  37039. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  37040. enabled: true,
  37041. /** @prop {ModifierFn} */
  37042. fn: offset,
  37043. /** @prop {Number|String} offset=0
  37044. * The offset value as described in the modifier description
  37045. */
  37046. offset: 0
  37047. },
  37048. /**
  37049. * Modifier used to prevent the popper from being positioned outside the boundary.
  37050. *
  37051. * A scenario exists where the reference itself is not within the boundaries.<br />
  37052. * We can say it has "escaped the boundaries" — or just "escaped".<br />
  37053. * In this case we need to decide whether the popper should either:
  37054. *
  37055. * - detach from the reference and remain "trapped" in the boundaries, or
  37056. * - if it should ignore the boundary and "escape with its reference"
  37057. *
  37058. * When `escapeWithReference` is set to`true` and reference is completely
  37059. * outside its boundaries, the popper will overflow (or completely leave)
  37060. * the boundaries in order to remain attached to the edge of the reference.
  37061. *
  37062. * @memberof modifiers
  37063. * @inner
  37064. */
  37065. preventOverflow: {
  37066. /** @prop {number} order=300 - Index used to define the order of execution */
  37067. order: 300,
  37068. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  37069. enabled: true,
  37070. /** @prop {ModifierFn} */
  37071. fn: preventOverflow,
  37072. /**
  37073. * @prop {Array} [priority=['left','right','top','bottom']]
  37074. * Popper will try to prevent overflow following these priorities by default,
  37075. * then, it could overflow on the left and on top of the `boundariesElement`
  37076. */
  37077. priority: ['left', 'right', 'top', 'bottom'],
  37078. /**
  37079. * @prop {number} padding=5
  37080. * Amount of pixel used to define a minimum distance between the boundaries
  37081. * and the popper. This makes sure the popper always has a little padding
  37082. * between the edges of its container
  37083. */
  37084. padding: 5,
  37085. /**
  37086. * @prop {String|HTMLElement} boundariesElement='scrollParent'
  37087. * Boundaries used by the modifier. Can be `scrollParent`, `window`,
  37088. * `viewport` or any DOM element.
  37089. */
  37090. boundariesElement: 'scrollParent'
  37091. },
  37092. /**
  37093. * Modifier used to make sure the reference and its popper stay near each other
  37094. * without leaving any gap between the two. Especially useful when the arrow is
  37095. * enabled and you want to ensure that it points to its reference element.
  37096. * It cares only about the first axis. You can still have poppers with margin
  37097. * between the popper and its reference element.
  37098. * @memberof modifiers
  37099. * @inner
  37100. */
  37101. keepTogether: {
  37102. /** @prop {number} order=400 - Index used to define the order of execution */
  37103. order: 400,
  37104. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  37105. enabled: true,
  37106. /** @prop {ModifierFn} */
  37107. fn: keepTogether
  37108. },
  37109. /**
  37110. * This modifier is used to move the `arrowElement` of the popper to make
  37111. * sure it is positioned between the reference element and its popper element.
  37112. * It will read the outer size of the `arrowElement` node to detect how many
  37113. * pixels of conjunction are needed.
  37114. *
  37115. * It has no effect if no `arrowElement` is provided.
  37116. * @memberof modifiers
  37117. * @inner
  37118. */
  37119. arrow: {
  37120. /** @prop {number} order=500 - Index used to define the order of execution */
  37121. order: 500,
  37122. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  37123. enabled: true,
  37124. /** @prop {ModifierFn} */
  37125. fn: arrow,
  37126. /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */
  37127. element: '[x-arrow]'
  37128. },
  37129. /**
  37130. * Modifier used to flip the popper's placement when it starts to overlap its
  37131. * reference element.
  37132. *
  37133. * Requires the `preventOverflow` modifier before it in order to work.
  37134. *
  37135. * **NOTE:** this modifier will interrupt the current update cycle and will
  37136. * restart it if it detects the need to flip the placement.
  37137. * @memberof modifiers
  37138. * @inner
  37139. */
  37140. flip: {
  37141. /** @prop {number} order=600 - Index used to define the order of execution */
  37142. order: 600,
  37143. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  37144. enabled: true,
  37145. /** @prop {ModifierFn} */
  37146. fn: flip,
  37147. /**
  37148. * @prop {String|Array} behavior='flip'
  37149. * The behavior used to change the popper's placement. It can be one of
  37150. * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid
  37151. * placements (with optional variations)
  37152. */
  37153. behavior: 'flip',
  37154. /**
  37155. * @prop {number} padding=5
  37156. * The popper will flip if it hits the edges of the `boundariesElement`
  37157. */
  37158. padding: 5,
  37159. /**
  37160. * @prop {String|HTMLElement} boundariesElement='viewport'
  37161. * The element which will define the boundaries of the popper position.
  37162. * The popper will never be placed outside of the defined boundaries
  37163. * (except if `keepTogether` is enabled)
  37164. */
  37165. boundariesElement: 'viewport',
  37166. /**
  37167. * @prop {Boolean} flipVariations=false
  37168. * The popper will switch placement variation between `-start` and `-end` when
  37169. * the reference element overlaps its boundaries.
  37170. *
  37171. * The original placement should have a set variation.
  37172. */
  37173. flipVariations: false,
  37174. /**
  37175. * @prop {Boolean} flipVariationsByContent=false
  37176. * The popper will switch placement variation between `-start` and `-end` when
  37177. * the popper element overlaps its reference boundaries.
  37178. *
  37179. * The original placement should have a set variation.
  37180. */
  37181. flipVariationsByContent: false
  37182. },
  37183. /**
  37184. * Modifier used to make the popper flow toward the inner of the reference element.
  37185. * By default, when this modifier is disabled, the popper will be placed outside
  37186. * the reference element.
  37187. * @memberof modifiers
  37188. * @inner
  37189. */
  37190. inner: {
  37191. /** @prop {number} order=700 - Index used to define the order of execution */
  37192. order: 700,
  37193. /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */
  37194. enabled: false,
  37195. /** @prop {ModifierFn} */
  37196. fn: inner
  37197. },
  37198. /**
  37199. * Modifier used to hide the popper when its reference element is outside of the
  37200. * popper boundaries. It will set a `x-out-of-boundaries` attribute which can
  37201. * be used to hide with a CSS selector the popper when its reference is
  37202. * out of boundaries.
  37203. *
  37204. * Requires the `preventOverflow` modifier before it in order to work.
  37205. * @memberof modifiers
  37206. * @inner
  37207. */
  37208. hide: {
  37209. /** @prop {number} order=800 - Index used to define the order of execution */
  37210. order: 800,
  37211. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  37212. enabled: true,
  37213. /** @prop {ModifierFn} */
  37214. fn: hide
  37215. },
  37216. /**
  37217. * Computes the style that will be applied to the popper element to gets
  37218. * properly positioned.
  37219. *
  37220. * Note that this modifier will not touch the DOM, it just prepares the styles
  37221. * so that `applyStyle` modifier can apply it. This separation is useful
  37222. * in case you need to replace `applyStyle` with a custom implementation.
  37223. *
  37224. * This modifier has `850` as `order` value to maintain backward compatibility
  37225. * with previous versions of Popper.js. Expect the modifiers ordering method
  37226. * to change in future major versions of the library.
  37227. *
  37228. * @memberof modifiers
  37229. * @inner
  37230. */
  37231. computeStyle: {
  37232. /** @prop {number} order=850 - Index used to define the order of execution */
  37233. order: 850,
  37234. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  37235. enabled: true,
  37236. /** @prop {ModifierFn} */
  37237. fn: computeStyle,
  37238. /**
  37239. * @prop {Boolean} gpuAcceleration=true
  37240. * If true, it uses the CSS 3D transformation to position the popper.
  37241. * Otherwise, it will use the `top` and `left` properties
  37242. */
  37243. gpuAcceleration: true,
  37244. /**
  37245. * @prop {string} [x='bottom']
  37246. * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.
  37247. * Change this if your popper should grow in a direction different from `bottom`
  37248. */
  37249. x: 'bottom',
  37250. /**
  37251. * @prop {string} [x='left']
  37252. * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.
  37253. * Change this if your popper should grow in a direction different from `right`
  37254. */
  37255. y: 'right'
  37256. },
  37257. /**
  37258. * Applies the computed styles to the popper element.
  37259. *
  37260. * All the DOM manipulations are limited to this modifier. This is useful in case
  37261. * you want to integrate Popper.js inside a framework or view library and you
  37262. * want to delegate all the DOM manipulations to it.
  37263. *
  37264. * Note that if you disable this modifier, you must make sure the popper element
  37265. * has its position set to `absolute` before Popper.js can do its work!
  37266. *
  37267. * Just disable this modifier and define your own to achieve the desired effect.
  37268. *
  37269. * @memberof modifiers
  37270. * @inner
  37271. */
  37272. applyStyle: {
  37273. /** @prop {number} order=900 - Index used to define the order of execution */
  37274. order: 900,
  37275. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  37276. enabled: true,
  37277. /** @prop {ModifierFn} */
  37278. fn: applyStyle,
  37279. /** @prop {Function} */
  37280. onLoad: applyStyleOnLoad,
  37281. /**
  37282. * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier
  37283. * @prop {Boolean} gpuAcceleration=true
  37284. * If true, it uses the CSS 3D transformation to position the popper.
  37285. * Otherwise, it will use the `top` and `left` properties
  37286. */
  37287. gpuAcceleration: undefined
  37288. }
  37289. };
  37290. /**
  37291. * The `dataObject` is an object containing all the information used by Popper.js.
  37292. * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks.
  37293. * @name dataObject
  37294. * @property {Object} data.instance The Popper.js instance
  37295. * @property {String} data.placement Placement applied to popper
  37296. * @property {String} data.originalPlacement Placement originally defined on init
  37297. * @property {Boolean} data.flipped True if popper has been flipped by flip modifier
  37298. * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper
  37299. * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier
  37300. * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`)
  37301. * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`)
  37302. * @property {Object} data.boundaries Offsets of the popper boundaries
  37303. * @property {Object} data.offsets The measurements of popper, reference and arrow elements
  37304. * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values
  37305. * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values
  37306. * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0
  37307. */
  37308. /**
  37309. * Default options provided to Popper.js constructor.<br />
  37310. * These can be overridden using the `options` argument of Popper.js.<br />
  37311. * To override an option, simply pass an object with the same
  37312. * structure of the `options` object, as the 3rd argument. For example:
  37313. * ```
  37314. * new Popper(ref, pop, {
  37315. * modifiers: {
  37316. * preventOverflow: { enabled: false }
  37317. * }
  37318. * })
  37319. * ```
  37320. * @type {Object}
  37321. * @static
  37322. * @memberof Popper
  37323. */
  37324. var Defaults = {
  37325. /**
  37326. * Popper's placement.
  37327. * @prop {Popper.placements} placement='bottom'
  37328. */
  37329. placement: 'bottom',
  37330. /**
  37331. * Set this to true if you want popper to position it self in 'fixed' mode
  37332. * @prop {Boolean} positionFixed=false
  37333. */
  37334. positionFixed: false,
  37335. /**
  37336. * Whether events (resize, scroll) are initially enabled.
  37337. * @prop {Boolean} eventsEnabled=true
  37338. */
  37339. eventsEnabled: true,
  37340. /**
  37341. * Set to true if you want to automatically remove the popper when
  37342. * you call the `destroy` method.
  37343. * @prop {Boolean} removeOnDestroy=false
  37344. */
  37345. removeOnDestroy: false,
  37346. /**
  37347. * Callback called when the popper is created.<br />
  37348. * By default, it is set to no-op.<br />
  37349. * Access Popper.js instance with `data.instance`.
  37350. * @prop {onCreate}
  37351. */
  37352. onCreate: function onCreate() {},
  37353. /**
  37354. * Callback called when the popper is updated. This callback is not called
  37355. * on the initialization/creation of the popper, but only on subsequent
  37356. * updates.<br />
  37357. * By default, it is set to no-op.<br />
  37358. * Access Popper.js instance with `data.instance`.
  37359. * @prop {onUpdate}
  37360. */
  37361. onUpdate: function onUpdate() {},
  37362. /**
  37363. * List of modifiers used to modify the offsets before they are applied to the popper.
  37364. * They provide most of the functionalities of Popper.js.
  37365. * @prop {modifiers}
  37366. */
  37367. modifiers: modifiers
  37368. };
  37369. /**
  37370. * @callback onCreate
  37371. * @param {dataObject} data
  37372. */
  37373. /**
  37374. * @callback onUpdate
  37375. * @param {dataObject} data
  37376. */
  37377. // Utils
  37378. // Methods
  37379. var Popper = function () {
  37380. /**
  37381. * Creates a new Popper.js instance.
  37382. * @class Popper
  37383. * @param {Element|referenceObject} reference - The reference element used to position the popper
  37384. * @param {Element} popper - The HTML / XML element used as the popper
  37385. * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults)
  37386. * @return {Object} instance - The generated Popper.js instance
  37387. */
  37388. function Popper(reference, popper) {
  37389. var _this = this;
  37390. var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  37391. classCallCheck(this, Popper);
  37392. this.scheduleUpdate = function () {
  37393. return requestAnimationFrame(_this.update);
  37394. };
  37395. // make update() debounced, so that it only runs at most once-per-tick
  37396. this.update = debounce(this.update.bind(this));
  37397. // with {} we create a new object with the options inside it
  37398. this.options = _extends({}, Popper.Defaults, options);
  37399. // init state
  37400. this.state = {
  37401. isDestroyed: false,
  37402. isCreated: false,
  37403. scrollParents: []
  37404. };
  37405. // get reference and popper elements (allow jQuery wrappers)
  37406. this.reference = reference && reference.jquery ? reference[0] : reference;
  37407. this.popper = popper && popper.jquery ? popper[0] : popper;
  37408. // Deep merge modifiers options
  37409. this.options.modifiers = {};
  37410. Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) {
  37411. _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});
  37412. });
  37413. // Refactoring modifiers' list (Object => Array)
  37414. this.modifiers = Object.keys(this.options.modifiers).map(function (name) {
  37415. return _extends({
  37416. name: name
  37417. }, _this.options.modifiers[name]);
  37418. })
  37419. // sort the modifiers by order
  37420. .sort(function (a, b) {
  37421. return a.order - b.order;
  37422. });
  37423. // modifiers have the ability to execute arbitrary code when Popper.js get inited
  37424. // such code is executed in the same order of its modifier
  37425. // they could add new properties to their options configuration
  37426. // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`!
  37427. this.modifiers.forEach(function (modifierOptions) {
  37428. if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) {
  37429. modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state);
  37430. }
  37431. });
  37432. // fire the first update to position the popper in the right place
  37433. this.update();
  37434. var eventsEnabled = this.options.eventsEnabled;
  37435. if (eventsEnabled) {
  37436. // setup event listeners, they will take care of update the position in specific situations
  37437. this.enableEventListeners();
  37438. }
  37439. this.state.eventsEnabled = eventsEnabled;
  37440. }
  37441. // We can't use class properties because they don't get listed in the
  37442. // class prototype and break stuff like Sinon stubs
  37443. createClass(Popper, [{
  37444. key: 'update',
  37445. value: function update$$1() {
  37446. return update.call(this);
  37447. }
  37448. }, {
  37449. key: 'destroy',
  37450. value: function destroy$$1() {
  37451. return destroy.call(this);
  37452. }
  37453. }, {
  37454. key: 'enableEventListeners',
  37455. value: function enableEventListeners$$1() {
  37456. return enableEventListeners.call(this);
  37457. }
  37458. }, {
  37459. key: 'disableEventListeners',
  37460. value: function disableEventListeners$$1() {
  37461. return disableEventListeners.call(this);
  37462. }
  37463. /**
  37464. * Schedules an update. It will run on the next UI update available.
  37465. * @method scheduleUpdate
  37466. * @memberof Popper
  37467. */
  37468. /**
  37469. * Collection of utilities useful when writing custom modifiers.
  37470. * Starting from version 1.7, this method is available only if you
  37471. * include `popper-utils.js` before `popper.js`.
  37472. *
  37473. * **DEPRECATION**: This way to access PopperUtils is deprecated
  37474. * and will be removed in v2! Use the PopperUtils module directly instead.
  37475. * Due to the high instability of the methods contained in Utils, we can't
  37476. * guarantee them to follow semver. Use them at your own risk!
  37477. * @static
  37478. * @private
  37479. * @type {Object}
  37480. * @deprecated since version 1.8
  37481. * @member Utils
  37482. * @memberof Popper
  37483. */
  37484. }]);
  37485. return Popper;
  37486. }();
  37487. /**
  37488. * The `referenceObject` is an object that provides an interface compatible with Popper.js
  37489. * and lets you use it as replacement of a real DOM node.<br />
  37490. * You can use this method to position a popper relatively to a set of coordinates
  37491. * in case you don't have a DOM node to use as reference.
  37492. *
  37493. * ```
  37494. * new Popper(referenceObject, popperNode);
  37495. * ```
  37496. *
  37497. * NB: This feature isn't supported in Internet Explorer 10.
  37498. * @name referenceObject
  37499. * @property {Function} data.getBoundingClientRect
  37500. * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method.
  37501. * @property {number} data.clientWidth
  37502. * An ES6 getter that will return the width of the virtual reference element.
  37503. * @property {number} data.clientHeight
  37504. * An ES6 getter that will return the height of the virtual reference element.
  37505. */
  37506. Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils;
  37507. Popper.placements = placements;
  37508. Popper.Defaults = Defaults;
  37509. /* harmony default export */ __webpack_exports__["default"] = (Popper);
  37510. //# sourceMappingURL=popper.js.map
  37511. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  37512. /***/ }),
  37513. /***/ "./node_modules/process/browser.js":
  37514. /*!*****************************************!*\
  37515. !*** ./node_modules/process/browser.js ***!
  37516. \*****************************************/
  37517. /*! no static exports found */
  37518. /***/ (function(module, exports) {
  37519. // shim for using process in browser
  37520. var process = module.exports = {};
  37521. // cached from whatever global is present so that test runners that stub it
  37522. // don't break things. But we need to wrap it in a try catch in case it is
  37523. // wrapped in strict mode code which doesn't define any globals. It's inside a
  37524. // function because try/catches deoptimize in certain engines.
  37525. var cachedSetTimeout;
  37526. var cachedClearTimeout;
  37527. function defaultSetTimout() {
  37528. throw new Error('setTimeout has not been defined');
  37529. }
  37530. function defaultClearTimeout () {
  37531. throw new Error('clearTimeout has not been defined');
  37532. }
  37533. (function () {
  37534. try {
  37535. if (typeof setTimeout === 'function') {
  37536. cachedSetTimeout = setTimeout;
  37537. } else {
  37538. cachedSetTimeout = defaultSetTimout;
  37539. }
  37540. } catch (e) {
  37541. cachedSetTimeout = defaultSetTimout;
  37542. }
  37543. try {
  37544. if (typeof clearTimeout === 'function') {
  37545. cachedClearTimeout = clearTimeout;
  37546. } else {
  37547. cachedClearTimeout = defaultClearTimeout;
  37548. }
  37549. } catch (e) {
  37550. cachedClearTimeout = defaultClearTimeout;
  37551. }
  37552. } ())
  37553. function runTimeout(fun) {
  37554. if (cachedSetTimeout === setTimeout) {
  37555. //normal enviroments in sane situations
  37556. return setTimeout(fun, 0);
  37557. }
  37558. // if setTimeout wasn't available but was latter defined
  37559. if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
  37560. cachedSetTimeout = setTimeout;
  37561. return setTimeout(fun, 0);
  37562. }
  37563. try {
  37564. // when when somebody has screwed with setTimeout but no I.E. maddness
  37565. return cachedSetTimeout(fun, 0);
  37566. } catch(e){
  37567. try {
  37568. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  37569. return cachedSetTimeout.call(null, fun, 0);
  37570. } catch(e){
  37571. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
  37572. return cachedSetTimeout.call(this, fun, 0);
  37573. }
  37574. }
  37575. }
  37576. function runClearTimeout(marker) {
  37577. if (cachedClearTimeout === clearTimeout) {
  37578. //normal enviroments in sane situations
  37579. return clearTimeout(marker);
  37580. }
  37581. // if clearTimeout wasn't available but was latter defined
  37582. if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
  37583. cachedClearTimeout = clearTimeout;
  37584. return clearTimeout(marker);
  37585. }
  37586. try {
  37587. // when when somebody has screwed with setTimeout but no I.E. maddness
  37588. return cachedClearTimeout(marker);
  37589. } catch (e){
  37590. try {
  37591. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  37592. return cachedClearTimeout.call(null, marker);
  37593. } catch (e){
  37594. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
  37595. // Some versions of I.E. have different rules for clearTimeout vs setTimeout
  37596. return cachedClearTimeout.call(this, marker);
  37597. }
  37598. }
  37599. }
  37600. var queue = [];
  37601. var draining = false;
  37602. var currentQueue;
  37603. var queueIndex = -1;
  37604. function cleanUpNextTick() {
  37605. if (!draining || !currentQueue) {
  37606. return;
  37607. }
  37608. draining = false;
  37609. if (currentQueue.length) {
  37610. queue = currentQueue.concat(queue);
  37611. } else {
  37612. queueIndex = -1;
  37613. }
  37614. if (queue.length) {
  37615. drainQueue();
  37616. }
  37617. }
  37618. function drainQueue() {
  37619. if (draining) {
  37620. return;
  37621. }
  37622. var timeout = runTimeout(cleanUpNextTick);
  37623. draining = true;
  37624. var len = queue.length;
  37625. while(len) {
  37626. currentQueue = queue;
  37627. queue = [];
  37628. while (++queueIndex < len) {
  37629. if (currentQueue) {
  37630. currentQueue[queueIndex].run();
  37631. }
  37632. }
  37633. queueIndex = -1;
  37634. len = queue.length;
  37635. }
  37636. currentQueue = null;
  37637. draining = false;
  37638. runClearTimeout(timeout);
  37639. }
  37640. process.nextTick = function (fun) {
  37641. var args = new Array(arguments.length - 1);
  37642. if (arguments.length > 1) {
  37643. for (var i = 1; i < arguments.length; i++) {
  37644. args[i - 1] = arguments[i];
  37645. }
  37646. }
  37647. queue.push(new Item(fun, args));
  37648. if (queue.length === 1 && !draining) {
  37649. runTimeout(drainQueue);
  37650. }
  37651. };
  37652. // v8 likes predictible objects
  37653. function Item(fun, array) {
  37654. this.fun = fun;
  37655. this.array = array;
  37656. }
  37657. Item.prototype.run = function () {
  37658. this.fun.apply(null, this.array);
  37659. };
  37660. process.title = 'browser';
  37661. process.browser = true;
  37662. process.env = {};
  37663. process.argv = [];
  37664. process.version = ''; // empty string to avoid regexp issues
  37665. process.versions = {};
  37666. function noop() {}
  37667. process.on = noop;
  37668. process.addListener = noop;
  37669. process.once = noop;
  37670. process.off = noop;
  37671. process.removeListener = noop;
  37672. process.removeAllListeners = noop;
  37673. process.emit = noop;
  37674. process.prependListener = noop;
  37675. process.prependOnceListener = noop;
  37676. process.listeners = function (name) { return [] }
  37677. process.binding = function (name) {
  37678. throw new Error('process.binding is not supported');
  37679. };
  37680. process.cwd = function () { return '/' };
  37681. process.chdir = function (dir) {
  37682. throw new Error('process.chdir is not supported');
  37683. };
  37684. process.umask = function() { return 0; };
  37685. /***/ }),
  37686. /***/ "./node_modules/pusher-js/dist/web/pusher.js":
  37687. /*!***************************************************!*\
  37688. !*** ./node_modules/pusher-js/dist/web/pusher.js ***!
  37689. \***************************************************/
  37690. /*! no static exports found */
  37691. /***/ (function(module, exports, __webpack_require__) {
  37692. /* WEBPACK VAR INJECTION */(function(Buffer) {/*!
  37693. * Pusher JavaScript Library v5.0.3
  37694. * https://pusher.com/
  37695. *
  37696. * Copyright 2017, Pusher
  37697. * Released under the MIT licence.
  37698. */
  37699. (function webpackUniversalModuleDefinition(root, factory) {
  37700. if(true)
  37701. module.exports = factory();
  37702. else {}
  37703. })(window, function() {
  37704. return /******/ (function(modules) { // webpackBootstrap
  37705. /******/ // The module cache
  37706. /******/ var installedModules = {};
  37707. /******/
  37708. /******/ // The require function
  37709. /******/ function __webpack_require__(moduleId) {
  37710. /******/
  37711. /******/ // Check if module is in cache
  37712. /******/ if(installedModules[moduleId]) {
  37713. /******/ return installedModules[moduleId].exports;
  37714. /******/ }
  37715. /******/ // Create a new module (and put it into the cache)
  37716. /******/ var module = installedModules[moduleId] = {
  37717. /******/ i: moduleId,
  37718. /******/ l: false,
  37719. /******/ exports: {}
  37720. /******/ };
  37721. /******/
  37722. /******/ // Execute the module function
  37723. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  37724. /******/
  37725. /******/ // Flag the module as loaded
  37726. /******/ module.l = true;
  37727. /******/
  37728. /******/ // Return the exports of the module
  37729. /******/ return module.exports;
  37730. /******/ }
  37731. /******/
  37732. /******/
  37733. /******/ // expose the modules object (__webpack_modules__)
  37734. /******/ __webpack_require__.m = modules;
  37735. /******/
  37736. /******/ // expose the module cache
  37737. /******/ __webpack_require__.c = installedModules;
  37738. /******/
  37739. /******/ // define getter function for harmony exports
  37740. /******/ __webpack_require__.d = function(exports, name, getter) {
  37741. /******/ if(!__webpack_require__.o(exports, name)) {
  37742. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  37743. /******/ }
  37744. /******/ };
  37745. /******/
  37746. /******/ // define __esModule on exports
  37747. /******/ __webpack_require__.r = function(exports) {
  37748. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  37749. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  37750. /******/ }
  37751. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  37752. /******/ };
  37753. /******/
  37754. /******/ // create a fake namespace object
  37755. /******/ // mode & 1: value is a module id, require it
  37756. /******/ // mode & 2: merge all properties of value into the ns
  37757. /******/ // mode & 4: return value when already ns object
  37758. /******/ // mode & 8|1: behave like require
  37759. /******/ __webpack_require__.t = function(value, mode) {
  37760. /******/ if(mode & 1) value = __webpack_require__(value);
  37761. /******/ if(mode & 8) return value;
  37762. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  37763. /******/ var ns = Object.create(null);
  37764. /******/ __webpack_require__.r(ns);
  37765. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  37766. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  37767. /******/ return ns;
  37768. /******/ };
  37769. /******/
  37770. /******/ // getDefaultExport function for compatibility with non-harmony modules
  37771. /******/ __webpack_require__.n = function(module) {
  37772. /******/ var getter = module && module.__esModule ?
  37773. /******/ function getDefault() { return module['default']; } :
  37774. /******/ function getModuleExports() { return module; };
  37775. /******/ __webpack_require__.d(getter, 'a', getter);
  37776. /******/ return getter;
  37777. /******/ };
  37778. /******/
  37779. /******/ // Object.prototype.hasOwnProperty.call
  37780. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  37781. /******/
  37782. /******/ // __webpack_public_path__
  37783. /******/ __webpack_require__.p = "";
  37784. /******/
  37785. /******/
  37786. /******/ // Load entry module and return exports
  37787. /******/ return __webpack_require__(__webpack_require__.s = 2);
  37788. /******/ })
  37789. /************************************************************************/
  37790. /******/ ([
  37791. /* 0 */
  37792. /***/ (function(module, exports, __webpack_require__) {
  37793. (function(nacl) {
  37794. 'use strict';
  37795. // Ported in 2014 by Dmitry Chestnykh and Devi Mandiri.
  37796. // Public domain.
  37797. //
  37798. // Implementation derived from TweetNaCl version 20140427.
  37799. // See for details: http://tweetnacl.cr.yp.to/
  37800. var gf = function(init) {
  37801. var i, r = new Float64Array(16);
  37802. if (init) for (i = 0; i < init.length; i++) r[i] = init[i];
  37803. return r;
  37804. };
  37805. // Pluggable, initialized in high-level API below.
  37806. var randombytes = function(/* x, n */) { throw new Error('no PRNG'); };
  37807. var _0 = new Uint8Array(16);
  37808. var _9 = new Uint8Array(32); _9[0] = 9;
  37809. var gf0 = gf(),
  37810. gf1 = gf([1]),
  37811. _121665 = gf([0xdb41, 1]),
  37812. D = gf([0x78a3, 0x1359, 0x4dca, 0x75eb, 0xd8ab, 0x4141, 0x0a4d, 0x0070, 0xe898, 0x7779, 0x4079, 0x8cc7, 0xfe73, 0x2b6f, 0x6cee, 0x5203]),
  37813. D2 = gf([0xf159, 0x26b2, 0x9b94, 0xebd6, 0xb156, 0x8283, 0x149a, 0x00e0, 0xd130, 0xeef3, 0x80f2, 0x198e, 0xfce7, 0x56df, 0xd9dc, 0x2406]),
  37814. X = gf([0xd51a, 0x8f25, 0x2d60, 0xc956, 0xa7b2, 0x9525, 0xc760, 0x692c, 0xdc5c, 0xfdd6, 0xe231, 0xc0a4, 0x53fe, 0xcd6e, 0x36d3, 0x2169]),
  37815. Y = gf([0x6658, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666]),
  37816. I = gf([0xa0b0, 0x4a0e, 0x1b27, 0xc4ee, 0xe478, 0xad2f, 0x1806, 0x2f43, 0xd7a7, 0x3dfb, 0x0099, 0x2b4d, 0xdf0b, 0x4fc1, 0x2480, 0x2b83]);
  37817. function ts64(x, i, h, l) {
  37818. x[i] = (h >> 24) & 0xff;
  37819. x[i+1] = (h >> 16) & 0xff;
  37820. x[i+2] = (h >> 8) & 0xff;
  37821. x[i+3] = h & 0xff;
  37822. x[i+4] = (l >> 24) & 0xff;
  37823. x[i+5] = (l >> 16) & 0xff;
  37824. x[i+6] = (l >> 8) & 0xff;
  37825. x[i+7] = l & 0xff;
  37826. }
  37827. function vn(x, xi, y, yi, n) {
  37828. var i,d = 0;
  37829. for (i = 0; i < n; i++) d |= x[xi+i]^y[yi+i];
  37830. return (1 & ((d - 1) >>> 8)) - 1;
  37831. }
  37832. function crypto_verify_16(x, xi, y, yi) {
  37833. return vn(x,xi,y,yi,16);
  37834. }
  37835. function crypto_verify_32(x, xi, y, yi) {
  37836. return vn(x,xi,y,yi,32);
  37837. }
  37838. function core_salsa20(o, p, k, c) {
  37839. var j0 = c[ 0] & 0xff | (c[ 1] & 0xff)<<8 | (c[ 2] & 0xff)<<16 | (c[ 3] & 0xff)<<24,
  37840. j1 = k[ 0] & 0xff | (k[ 1] & 0xff)<<8 | (k[ 2] & 0xff)<<16 | (k[ 3] & 0xff)<<24,
  37841. j2 = k[ 4] & 0xff | (k[ 5] & 0xff)<<8 | (k[ 6] & 0xff)<<16 | (k[ 7] & 0xff)<<24,
  37842. j3 = k[ 8] & 0xff | (k[ 9] & 0xff)<<8 | (k[10] & 0xff)<<16 | (k[11] & 0xff)<<24,
  37843. j4 = k[12] & 0xff | (k[13] & 0xff)<<8 | (k[14] & 0xff)<<16 | (k[15] & 0xff)<<24,
  37844. j5 = c[ 4] & 0xff | (c[ 5] & 0xff)<<8 | (c[ 6] & 0xff)<<16 | (c[ 7] & 0xff)<<24,
  37845. j6 = p[ 0] & 0xff | (p[ 1] & 0xff)<<8 | (p[ 2] & 0xff)<<16 | (p[ 3] & 0xff)<<24,
  37846. j7 = p[ 4] & 0xff | (p[ 5] & 0xff)<<8 | (p[ 6] & 0xff)<<16 | (p[ 7] & 0xff)<<24,
  37847. j8 = p[ 8] & 0xff | (p[ 9] & 0xff)<<8 | (p[10] & 0xff)<<16 | (p[11] & 0xff)<<24,
  37848. j9 = p[12] & 0xff | (p[13] & 0xff)<<8 | (p[14] & 0xff)<<16 | (p[15] & 0xff)<<24,
  37849. j10 = c[ 8] & 0xff | (c[ 9] & 0xff)<<8 | (c[10] & 0xff)<<16 | (c[11] & 0xff)<<24,
  37850. j11 = k[16] & 0xff | (k[17] & 0xff)<<8 | (k[18] & 0xff)<<16 | (k[19] & 0xff)<<24,
  37851. j12 = k[20] & 0xff | (k[21] & 0xff)<<8 | (k[22] & 0xff)<<16 | (k[23] & 0xff)<<24,
  37852. j13 = k[24] & 0xff | (k[25] & 0xff)<<8 | (k[26] & 0xff)<<16 | (k[27] & 0xff)<<24,
  37853. j14 = k[28] & 0xff | (k[29] & 0xff)<<8 | (k[30] & 0xff)<<16 | (k[31] & 0xff)<<24,
  37854. j15 = c[12] & 0xff | (c[13] & 0xff)<<8 | (c[14] & 0xff)<<16 | (c[15] & 0xff)<<24;
  37855. var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7,
  37856. x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14,
  37857. x15 = j15, u;
  37858. for (var i = 0; i < 20; i += 2) {
  37859. u = x0 + x12 | 0;
  37860. x4 ^= u<<7 | u>>>(32-7);
  37861. u = x4 + x0 | 0;
  37862. x8 ^= u<<9 | u>>>(32-9);
  37863. u = x8 + x4 | 0;
  37864. x12 ^= u<<13 | u>>>(32-13);
  37865. u = x12 + x8 | 0;
  37866. x0 ^= u<<18 | u>>>(32-18);
  37867. u = x5 + x1 | 0;
  37868. x9 ^= u<<7 | u>>>(32-7);
  37869. u = x9 + x5 | 0;
  37870. x13 ^= u<<9 | u>>>(32-9);
  37871. u = x13 + x9 | 0;
  37872. x1 ^= u<<13 | u>>>(32-13);
  37873. u = x1 + x13 | 0;
  37874. x5 ^= u<<18 | u>>>(32-18);
  37875. u = x10 + x6 | 0;
  37876. x14 ^= u<<7 | u>>>(32-7);
  37877. u = x14 + x10 | 0;
  37878. x2 ^= u<<9 | u>>>(32-9);
  37879. u = x2 + x14 | 0;
  37880. x6 ^= u<<13 | u>>>(32-13);
  37881. u = x6 + x2 | 0;
  37882. x10 ^= u<<18 | u>>>(32-18);
  37883. u = x15 + x11 | 0;
  37884. x3 ^= u<<7 | u>>>(32-7);
  37885. u = x3 + x15 | 0;
  37886. x7 ^= u<<9 | u>>>(32-9);
  37887. u = x7 + x3 | 0;
  37888. x11 ^= u<<13 | u>>>(32-13);
  37889. u = x11 + x7 | 0;
  37890. x15 ^= u<<18 | u>>>(32-18);
  37891. u = x0 + x3 | 0;
  37892. x1 ^= u<<7 | u>>>(32-7);
  37893. u = x1 + x0 | 0;
  37894. x2 ^= u<<9 | u>>>(32-9);
  37895. u = x2 + x1 | 0;
  37896. x3 ^= u<<13 | u>>>(32-13);
  37897. u = x3 + x2 | 0;
  37898. x0 ^= u<<18 | u>>>(32-18);
  37899. u = x5 + x4 | 0;
  37900. x6 ^= u<<7 | u>>>(32-7);
  37901. u = x6 + x5 | 0;
  37902. x7 ^= u<<9 | u>>>(32-9);
  37903. u = x7 + x6 | 0;
  37904. x4 ^= u<<13 | u>>>(32-13);
  37905. u = x4 + x7 | 0;
  37906. x5 ^= u<<18 | u>>>(32-18);
  37907. u = x10 + x9 | 0;
  37908. x11 ^= u<<7 | u>>>(32-7);
  37909. u = x11 + x10 | 0;
  37910. x8 ^= u<<9 | u>>>(32-9);
  37911. u = x8 + x11 | 0;
  37912. x9 ^= u<<13 | u>>>(32-13);
  37913. u = x9 + x8 | 0;
  37914. x10 ^= u<<18 | u>>>(32-18);
  37915. u = x15 + x14 | 0;
  37916. x12 ^= u<<7 | u>>>(32-7);
  37917. u = x12 + x15 | 0;
  37918. x13 ^= u<<9 | u>>>(32-9);
  37919. u = x13 + x12 | 0;
  37920. x14 ^= u<<13 | u>>>(32-13);
  37921. u = x14 + x13 | 0;
  37922. x15 ^= u<<18 | u>>>(32-18);
  37923. }
  37924. x0 = x0 + j0 | 0;
  37925. x1 = x1 + j1 | 0;
  37926. x2 = x2 + j2 | 0;
  37927. x3 = x3 + j3 | 0;
  37928. x4 = x4 + j4 | 0;
  37929. x5 = x5 + j5 | 0;
  37930. x6 = x6 + j6 | 0;
  37931. x7 = x7 + j7 | 0;
  37932. x8 = x8 + j8 | 0;
  37933. x9 = x9 + j9 | 0;
  37934. x10 = x10 + j10 | 0;
  37935. x11 = x11 + j11 | 0;
  37936. x12 = x12 + j12 | 0;
  37937. x13 = x13 + j13 | 0;
  37938. x14 = x14 + j14 | 0;
  37939. x15 = x15 + j15 | 0;
  37940. o[ 0] = x0 >>> 0 & 0xff;
  37941. o[ 1] = x0 >>> 8 & 0xff;
  37942. o[ 2] = x0 >>> 16 & 0xff;
  37943. o[ 3] = x0 >>> 24 & 0xff;
  37944. o[ 4] = x1 >>> 0 & 0xff;
  37945. o[ 5] = x1 >>> 8 & 0xff;
  37946. o[ 6] = x1 >>> 16 & 0xff;
  37947. o[ 7] = x1 >>> 24 & 0xff;
  37948. o[ 8] = x2 >>> 0 & 0xff;
  37949. o[ 9] = x2 >>> 8 & 0xff;
  37950. o[10] = x2 >>> 16 & 0xff;
  37951. o[11] = x2 >>> 24 & 0xff;
  37952. o[12] = x3 >>> 0 & 0xff;
  37953. o[13] = x3 >>> 8 & 0xff;
  37954. o[14] = x3 >>> 16 & 0xff;
  37955. o[15] = x3 >>> 24 & 0xff;
  37956. o[16] = x4 >>> 0 & 0xff;
  37957. o[17] = x4 >>> 8 & 0xff;
  37958. o[18] = x4 >>> 16 & 0xff;
  37959. o[19] = x4 >>> 24 & 0xff;
  37960. o[20] = x5 >>> 0 & 0xff;
  37961. o[21] = x5 >>> 8 & 0xff;
  37962. o[22] = x5 >>> 16 & 0xff;
  37963. o[23] = x5 >>> 24 & 0xff;
  37964. o[24] = x6 >>> 0 & 0xff;
  37965. o[25] = x6 >>> 8 & 0xff;
  37966. o[26] = x6 >>> 16 & 0xff;
  37967. o[27] = x6 >>> 24 & 0xff;
  37968. o[28] = x7 >>> 0 & 0xff;
  37969. o[29] = x7 >>> 8 & 0xff;
  37970. o[30] = x7 >>> 16 & 0xff;
  37971. o[31] = x7 >>> 24 & 0xff;
  37972. o[32] = x8 >>> 0 & 0xff;
  37973. o[33] = x8 >>> 8 & 0xff;
  37974. o[34] = x8 >>> 16 & 0xff;
  37975. o[35] = x8 >>> 24 & 0xff;
  37976. o[36] = x9 >>> 0 & 0xff;
  37977. o[37] = x9 >>> 8 & 0xff;
  37978. o[38] = x9 >>> 16 & 0xff;
  37979. o[39] = x9 >>> 24 & 0xff;
  37980. o[40] = x10 >>> 0 & 0xff;
  37981. o[41] = x10 >>> 8 & 0xff;
  37982. o[42] = x10 >>> 16 & 0xff;
  37983. o[43] = x10 >>> 24 & 0xff;
  37984. o[44] = x11 >>> 0 & 0xff;
  37985. o[45] = x11 >>> 8 & 0xff;
  37986. o[46] = x11 >>> 16 & 0xff;
  37987. o[47] = x11 >>> 24 & 0xff;
  37988. o[48] = x12 >>> 0 & 0xff;
  37989. o[49] = x12 >>> 8 & 0xff;
  37990. o[50] = x12 >>> 16 & 0xff;
  37991. o[51] = x12 >>> 24 & 0xff;
  37992. o[52] = x13 >>> 0 & 0xff;
  37993. o[53] = x13 >>> 8 & 0xff;
  37994. o[54] = x13 >>> 16 & 0xff;
  37995. o[55] = x13 >>> 24 & 0xff;
  37996. o[56] = x14 >>> 0 & 0xff;
  37997. o[57] = x14 >>> 8 & 0xff;
  37998. o[58] = x14 >>> 16 & 0xff;
  37999. o[59] = x14 >>> 24 & 0xff;
  38000. o[60] = x15 >>> 0 & 0xff;
  38001. o[61] = x15 >>> 8 & 0xff;
  38002. o[62] = x15 >>> 16 & 0xff;
  38003. o[63] = x15 >>> 24 & 0xff;
  38004. }
  38005. function core_hsalsa20(o,p,k,c) {
  38006. var j0 = c[ 0] & 0xff | (c[ 1] & 0xff)<<8 | (c[ 2] & 0xff)<<16 | (c[ 3] & 0xff)<<24,
  38007. j1 = k[ 0] & 0xff | (k[ 1] & 0xff)<<8 | (k[ 2] & 0xff)<<16 | (k[ 3] & 0xff)<<24,
  38008. j2 = k[ 4] & 0xff | (k[ 5] & 0xff)<<8 | (k[ 6] & 0xff)<<16 | (k[ 7] & 0xff)<<24,
  38009. j3 = k[ 8] & 0xff | (k[ 9] & 0xff)<<8 | (k[10] & 0xff)<<16 | (k[11] & 0xff)<<24,
  38010. j4 = k[12] & 0xff | (k[13] & 0xff)<<8 | (k[14] & 0xff)<<16 | (k[15] & 0xff)<<24,
  38011. j5 = c[ 4] & 0xff | (c[ 5] & 0xff)<<8 | (c[ 6] & 0xff)<<16 | (c[ 7] & 0xff)<<24,
  38012. j6 = p[ 0] & 0xff | (p[ 1] & 0xff)<<8 | (p[ 2] & 0xff)<<16 | (p[ 3] & 0xff)<<24,
  38013. j7 = p[ 4] & 0xff | (p[ 5] & 0xff)<<8 | (p[ 6] & 0xff)<<16 | (p[ 7] & 0xff)<<24,
  38014. j8 = p[ 8] & 0xff | (p[ 9] & 0xff)<<8 | (p[10] & 0xff)<<16 | (p[11] & 0xff)<<24,
  38015. j9 = p[12] & 0xff | (p[13] & 0xff)<<8 | (p[14] & 0xff)<<16 | (p[15] & 0xff)<<24,
  38016. j10 = c[ 8] & 0xff | (c[ 9] & 0xff)<<8 | (c[10] & 0xff)<<16 | (c[11] & 0xff)<<24,
  38017. j11 = k[16] & 0xff | (k[17] & 0xff)<<8 | (k[18] & 0xff)<<16 | (k[19] & 0xff)<<24,
  38018. j12 = k[20] & 0xff | (k[21] & 0xff)<<8 | (k[22] & 0xff)<<16 | (k[23] & 0xff)<<24,
  38019. j13 = k[24] & 0xff | (k[25] & 0xff)<<8 | (k[26] & 0xff)<<16 | (k[27] & 0xff)<<24,
  38020. j14 = k[28] & 0xff | (k[29] & 0xff)<<8 | (k[30] & 0xff)<<16 | (k[31] & 0xff)<<24,
  38021. j15 = c[12] & 0xff | (c[13] & 0xff)<<8 | (c[14] & 0xff)<<16 | (c[15] & 0xff)<<24;
  38022. var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7,
  38023. x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14,
  38024. x15 = j15, u;
  38025. for (var i = 0; i < 20; i += 2) {
  38026. u = x0 + x12 | 0;
  38027. x4 ^= u<<7 | u>>>(32-7);
  38028. u = x4 + x0 | 0;
  38029. x8 ^= u<<9 | u>>>(32-9);
  38030. u = x8 + x4 | 0;
  38031. x12 ^= u<<13 | u>>>(32-13);
  38032. u = x12 + x8 | 0;
  38033. x0 ^= u<<18 | u>>>(32-18);
  38034. u = x5 + x1 | 0;
  38035. x9 ^= u<<7 | u>>>(32-7);
  38036. u = x9 + x5 | 0;
  38037. x13 ^= u<<9 | u>>>(32-9);
  38038. u = x13 + x9 | 0;
  38039. x1 ^= u<<13 | u>>>(32-13);
  38040. u = x1 + x13 | 0;
  38041. x5 ^= u<<18 | u>>>(32-18);
  38042. u = x10 + x6 | 0;
  38043. x14 ^= u<<7 | u>>>(32-7);
  38044. u = x14 + x10 | 0;
  38045. x2 ^= u<<9 | u>>>(32-9);
  38046. u = x2 + x14 | 0;
  38047. x6 ^= u<<13 | u>>>(32-13);
  38048. u = x6 + x2 | 0;
  38049. x10 ^= u<<18 | u>>>(32-18);
  38050. u = x15 + x11 | 0;
  38051. x3 ^= u<<7 | u>>>(32-7);
  38052. u = x3 + x15 | 0;
  38053. x7 ^= u<<9 | u>>>(32-9);
  38054. u = x7 + x3 | 0;
  38055. x11 ^= u<<13 | u>>>(32-13);
  38056. u = x11 + x7 | 0;
  38057. x15 ^= u<<18 | u>>>(32-18);
  38058. u = x0 + x3 | 0;
  38059. x1 ^= u<<7 | u>>>(32-7);
  38060. u = x1 + x0 | 0;
  38061. x2 ^= u<<9 | u>>>(32-9);
  38062. u = x2 + x1 | 0;
  38063. x3 ^= u<<13 | u>>>(32-13);
  38064. u = x3 + x2 | 0;
  38065. x0 ^= u<<18 | u>>>(32-18);
  38066. u = x5 + x4 | 0;
  38067. x6 ^= u<<7 | u>>>(32-7);
  38068. u = x6 + x5 | 0;
  38069. x7 ^= u<<9 | u>>>(32-9);
  38070. u = x7 + x6 | 0;
  38071. x4 ^= u<<13 | u>>>(32-13);
  38072. u = x4 + x7 | 0;
  38073. x5 ^= u<<18 | u>>>(32-18);
  38074. u = x10 + x9 | 0;
  38075. x11 ^= u<<7 | u>>>(32-7);
  38076. u = x11 + x10 | 0;
  38077. x8 ^= u<<9 | u>>>(32-9);
  38078. u = x8 + x11 | 0;
  38079. x9 ^= u<<13 | u>>>(32-13);
  38080. u = x9 + x8 | 0;
  38081. x10 ^= u<<18 | u>>>(32-18);
  38082. u = x15 + x14 | 0;
  38083. x12 ^= u<<7 | u>>>(32-7);
  38084. u = x12 + x15 | 0;
  38085. x13 ^= u<<9 | u>>>(32-9);
  38086. u = x13 + x12 | 0;
  38087. x14 ^= u<<13 | u>>>(32-13);
  38088. u = x14 + x13 | 0;
  38089. x15 ^= u<<18 | u>>>(32-18);
  38090. }
  38091. o[ 0] = x0 >>> 0 & 0xff;
  38092. o[ 1] = x0 >>> 8 & 0xff;
  38093. o[ 2] = x0 >>> 16 & 0xff;
  38094. o[ 3] = x0 >>> 24 & 0xff;
  38095. o[ 4] = x5 >>> 0 & 0xff;
  38096. o[ 5] = x5 >>> 8 & 0xff;
  38097. o[ 6] = x5 >>> 16 & 0xff;
  38098. o[ 7] = x5 >>> 24 & 0xff;
  38099. o[ 8] = x10 >>> 0 & 0xff;
  38100. o[ 9] = x10 >>> 8 & 0xff;
  38101. o[10] = x10 >>> 16 & 0xff;
  38102. o[11] = x10 >>> 24 & 0xff;
  38103. o[12] = x15 >>> 0 & 0xff;
  38104. o[13] = x15 >>> 8 & 0xff;
  38105. o[14] = x15 >>> 16 & 0xff;
  38106. o[15] = x15 >>> 24 & 0xff;
  38107. o[16] = x6 >>> 0 & 0xff;
  38108. o[17] = x6 >>> 8 & 0xff;
  38109. o[18] = x6 >>> 16 & 0xff;
  38110. o[19] = x6 >>> 24 & 0xff;
  38111. o[20] = x7 >>> 0 & 0xff;
  38112. o[21] = x7 >>> 8 & 0xff;
  38113. o[22] = x7 >>> 16 & 0xff;
  38114. o[23] = x7 >>> 24 & 0xff;
  38115. o[24] = x8 >>> 0 & 0xff;
  38116. o[25] = x8 >>> 8 & 0xff;
  38117. o[26] = x8 >>> 16 & 0xff;
  38118. o[27] = x8 >>> 24 & 0xff;
  38119. o[28] = x9 >>> 0 & 0xff;
  38120. o[29] = x9 >>> 8 & 0xff;
  38121. o[30] = x9 >>> 16 & 0xff;
  38122. o[31] = x9 >>> 24 & 0xff;
  38123. }
  38124. function crypto_core_salsa20(out,inp,k,c) {
  38125. core_salsa20(out,inp,k,c);
  38126. }
  38127. function crypto_core_hsalsa20(out,inp,k,c) {
  38128. core_hsalsa20(out,inp,k,c);
  38129. }
  38130. var sigma = new Uint8Array([101, 120, 112, 97, 110, 100, 32, 51, 50, 45, 98, 121, 116, 101, 32, 107]);
  38131. // "expand 32-byte k"
  38132. function crypto_stream_salsa20_xor(c,cpos,m,mpos,b,n,k) {
  38133. var z = new Uint8Array(16), x = new Uint8Array(64);
  38134. var u, i;
  38135. for (i = 0; i < 16; i++) z[i] = 0;
  38136. for (i = 0; i < 8; i++) z[i] = n[i];
  38137. while (b >= 64) {
  38138. crypto_core_salsa20(x,z,k,sigma);
  38139. for (i = 0; i < 64; i++) c[cpos+i] = m[mpos+i] ^ x[i];
  38140. u = 1;
  38141. for (i = 8; i < 16; i++) {
  38142. u = u + (z[i] & 0xff) | 0;
  38143. z[i] = u & 0xff;
  38144. u >>>= 8;
  38145. }
  38146. b -= 64;
  38147. cpos += 64;
  38148. mpos += 64;
  38149. }
  38150. if (b > 0) {
  38151. crypto_core_salsa20(x,z,k,sigma);
  38152. for (i = 0; i < b; i++) c[cpos+i] = m[mpos+i] ^ x[i];
  38153. }
  38154. return 0;
  38155. }
  38156. function crypto_stream_salsa20(c,cpos,b,n,k) {
  38157. var z = new Uint8Array(16), x = new Uint8Array(64);
  38158. var u, i;
  38159. for (i = 0; i < 16; i++) z[i] = 0;
  38160. for (i = 0; i < 8; i++) z[i] = n[i];
  38161. while (b >= 64) {
  38162. crypto_core_salsa20(x,z,k,sigma);
  38163. for (i = 0; i < 64; i++) c[cpos+i] = x[i];
  38164. u = 1;
  38165. for (i = 8; i < 16; i++) {
  38166. u = u + (z[i] & 0xff) | 0;
  38167. z[i] = u & 0xff;
  38168. u >>>= 8;
  38169. }
  38170. b -= 64;
  38171. cpos += 64;
  38172. }
  38173. if (b > 0) {
  38174. crypto_core_salsa20(x,z,k,sigma);
  38175. for (i = 0; i < b; i++) c[cpos+i] = x[i];
  38176. }
  38177. return 0;
  38178. }
  38179. function crypto_stream(c,cpos,d,n,k) {
  38180. var s = new Uint8Array(32);
  38181. crypto_core_hsalsa20(s,n,k,sigma);
  38182. var sn = new Uint8Array(8);
  38183. for (var i = 0; i < 8; i++) sn[i] = n[i+16];
  38184. return crypto_stream_salsa20(c,cpos,d,sn,s);
  38185. }
  38186. function crypto_stream_xor(c,cpos,m,mpos,d,n,k) {
  38187. var s = new Uint8Array(32);
  38188. crypto_core_hsalsa20(s,n,k,sigma);
  38189. var sn = new Uint8Array(8);
  38190. for (var i = 0; i < 8; i++) sn[i] = n[i+16];
  38191. return crypto_stream_salsa20_xor(c,cpos,m,mpos,d,sn,s);
  38192. }
  38193. /*
  38194. * Port of Andrew Moon's Poly1305-donna-16. Public domain.
  38195. * https://github.com/floodyberry/poly1305-donna
  38196. */
  38197. var poly1305 = function(key) {
  38198. this.buffer = new Uint8Array(16);
  38199. this.r = new Uint16Array(10);
  38200. this.h = new Uint16Array(10);
  38201. this.pad = new Uint16Array(8);
  38202. this.leftover = 0;
  38203. this.fin = 0;
  38204. var t0, t1, t2, t3, t4, t5, t6, t7;
  38205. t0 = key[ 0] & 0xff | (key[ 1] & 0xff) << 8; this.r[0] = ( t0 ) & 0x1fff;
  38206. t1 = key[ 2] & 0xff | (key[ 3] & 0xff) << 8; this.r[1] = ((t0 >>> 13) | (t1 << 3)) & 0x1fff;
  38207. t2 = key[ 4] & 0xff | (key[ 5] & 0xff) << 8; this.r[2] = ((t1 >>> 10) | (t2 << 6)) & 0x1f03;
  38208. t3 = key[ 6] & 0xff | (key[ 7] & 0xff) << 8; this.r[3] = ((t2 >>> 7) | (t3 << 9)) & 0x1fff;
  38209. t4 = key[ 8] & 0xff | (key[ 9] & 0xff) << 8; this.r[4] = ((t3 >>> 4) | (t4 << 12)) & 0x00ff;
  38210. this.r[5] = ((t4 >>> 1)) & 0x1ffe;
  38211. t5 = key[10] & 0xff | (key[11] & 0xff) << 8; this.r[6] = ((t4 >>> 14) | (t5 << 2)) & 0x1fff;
  38212. t6 = key[12] & 0xff | (key[13] & 0xff) << 8; this.r[7] = ((t5 >>> 11) | (t6 << 5)) & 0x1f81;
  38213. t7 = key[14] & 0xff | (key[15] & 0xff) << 8; this.r[8] = ((t6 >>> 8) | (t7 << 8)) & 0x1fff;
  38214. this.r[9] = ((t7 >>> 5)) & 0x007f;
  38215. this.pad[0] = key[16] & 0xff | (key[17] & 0xff) << 8;
  38216. this.pad[1] = key[18] & 0xff | (key[19] & 0xff) << 8;
  38217. this.pad[2] = key[20] & 0xff | (key[21] & 0xff) << 8;
  38218. this.pad[3] = key[22] & 0xff | (key[23] & 0xff) << 8;
  38219. this.pad[4] = key[24] & 0xff | (key[25] & 0xff) << 8;
  38220. this.pad[5] = key[26] & 0xff | (key[27] & 0xff) << 8;
  38221. this.pad[6] = key[28] & 0xff | (key[29] & 0xff) << 8;
  38222. this.pad[7] = key[30] & 0xff | (key[31] & 0xff) << 8;
  38223. };
  38224. poly1305.prototype.blocks = function(m, mpos, bytes) {
  38225. var hibit = this.fin ? 0 : (1 << 11);
  38226. var t0, t1, t2, t3, t4, t5, t6, t7, c;
  38227. var d0, d1, d2, d3, d4, d5, d6, d7, d8, d9;
  38228. var h0 = this.h[0],
  38229. h1 = this.h[1],
  38230. h2 = this.h[2],
  38231. h3 = this.h[3],
  38232. h4 = this.h[4],
  38233. h5 = this.h[5],
  38234. h6 = this.h[6],
  38235. h7 = this.h[7],
  38236. h8 = this.h[8],
  38237. h9 = this.h[9];
  38238. var r0 = this.r[0],
  38239. r1 = this.r[1],
  38240. r2 = this.r[2],
  38241. r3 = this.r[3],
  38242. r4 = this.r[4],
  38243. r5 = this.r[5],
  38244. r6 = this.r[6],
  38245. r7 = this.r[7],
  38246. r8 = this.r[8],
  38247. r9 = this.r[9];
  38248. while (bytes >= 16) {
  38249. t0 = m[mpos+ 0] & 0xff | (m[mpos+ 1] & 0xff) << 8; h0 += ( t0 ) & 0x1fff;
  38250. t1 = m[mpos+ 2] & 0xff | (m[mpos+ 3] & 0xff) << 8; h1 += ((t0 >>> 13) | (t1 << 3)) & 0x1fff;
  38251. t2 = m[mpos+ 4] & 0xff | (m[mpos+ 5] & 0xff) << 8; h2 += ((t1 >>> 10) | (t2 << 6)) & 0x1fff;
  38252. t3 = m[mpos+ 6] & 0xff | (m[mpos+ 7] & 0xff) << 8; h3 += ((t2 >>> 7) | (t3 << 9)) & 0x1fff;
  38253. t4 = m[mpos+ 8] & 0xff | (m[mpos+ 9] & 0xff) << 8; h4 += ((t3 >>> 4) | (t4 << 12)) & 0x1fff;
  38254. h5 += ((t4 >>> 1)) & 0x1fff;
  38255. t5 = m[mpos+10] & 0xff | (m[mpos+11] & 0xff) << 8; h6 += ((t4 >>> 14) | (t5 << 2)) & 0x1fff;
  38256. t6 = m[mpos+12] & 0xff | (m[mpos+13] & 0xff) << 8; h7 += ((t5 >>> 11) | (t6 << 5)) & 0x1fff;
  38257. t7 = m[mpos+14] & 0xff | (m[mpos+15] & 0xff) << 8; h8 += ((t6 >>> 8) | (t7 << 8)) & 0x1fff;
  38258. h9 += ((t7 >>> 5)) | hibit;
  38259. c = 0;
  38260. d0 = c;
  38261. d0 += h0 * r0;
  38262. d0 += h1 * (5 * r9);
  38263. d0 += h2 * (5 * r8);
  38264. d0 += h3 * (5 * r7);
  38265. d0 += h4 * (5 * r6);
  38266. c = (d0 >>> 13); d0 &= 0x1fff;
  38267. d0 += h5 * (5 * r5);
  38268. d0 += h6 * (5 * r4);
  38269. d0 += h7 * (5 * r3);
  38270. d0 += h8 * (5 * r2);
  38271. d0 += h9 * (5 * r1);
  38272. c += (d0 >>> 13); d0 &= 0x1fff;
  38273. d1 = c;
  38274. d1 += h0 * r1;
  38275. d1 += h1 * r0;
  38276. d1 += h2 * (5 * r9);
  38277. d1 += h3 * (5 * r8);
  38278. d1 += h4 * (5 * r7);
  38279. c = (d1 >>> 13); d1 &= 0x1fff;
  38280. d1 += h5 * (5 * r6);
  38281. d1 += h6 * (5 * r5);
  38282. d1 += h7 * (5 * r4);
  38283. d1 += h8 * (5 * r3);
  38284. d1 += h9 * (5 * r2);
  38285. c += (d1 >>> 13); d1 &= 0x1fff;
  38286. d2 = c;
  38287. d2 += h0 * r2;
  38288. d2 += h1 * r1;
  38289. d2 += h2 * r0;
  38290. d2 += h3 * (5 * r9);
  38291. d2 += h4 * (5 * r8);
  38292. c = (d2 >>> 13); d2 &= 0x1fff;
  38293. d2 += h5 * (5 * r7);
  38294. d2 += h6 * (5 * r6);
  38295. d2 += h7 * (5 * r5);
  38296. d2 += h8 * (5 * r4);
  38297. d2 += h9 * (5 * r3);
  38298. c += (d2 >>> 13); d2 &= 0x1fff;
  38299. d3 = c;
  38300. d3 += h0 * r3;
  38301. d3 += h1 * r2;
  38302. d3 += h2 * r1;
  38303. d3 += h3 * r0;
  38304. d3 += h4 * (5 * r9);
  38305. c = (d3 >>> 13); d3 &= 0x1fff;
  38306. d3 += h5 * (5 * r8);
  38307. d3 += h6 * (5 * r7);
  38308. d3 += h7 * (5 * r6);
  38309. d3 += h8 * (5 * r5);
  38310. d3 += h9 * (5 * r4);
  38311. c += (d3 >>> 13); d3 &= 0x1fff;
  38312. d4 = c;
  38313. d4 += h0 * r4;
  38314. d4 += h1 * r3;
  38315. d4 += h2 * r2;
  38316. d4 += h3 * r1;
  38317. d4 += h4 * r0;
  38318. c = (d4 >>> 13); d4 &= 0x1fff;
  38319. d4 += h5 * (5 * r9);
  38320. d4 += h6 * (5 * r8);
  38321. d4 += h7 * (5 * r7);
  38322. d4 += h8 * (5 * r6);
  38323. d4 += h9 * (5 * r5);
  38324. c += (d4 >>> 13); d4 &= 0x1fff;
  38325. d5 = c;
  38326. d5 += h0 * r5;
  38327. d5 += h1 * r4;
  38328. d5 += h2 * r3;
  38329. d5 += h3 * r2;
  38330. d5 += h4 * r1;
  38331. c = (d5 >>> 13); d5 &= 0x1fff;
  38332. d5 += h5 * r0;
  38333. d5 += h6 * (5 * r9);
  38334. d5 += h7 * (5 * r8);
  38335. d5 += h8 * (5 * r7);
  38336. d5 += h9 * (5 * r6);
  38337. c += (d5 >>> 13); d5 &= 0x1fff;
  38338. d6 = c;
  38339. d6 += h0 * r6;
  38340. d6 += h1 * r5;
  38341. d6 += h2 * r4;
  38342. d6 += h3 * r3;
  38343. d6 += h4 * r2;
  38344. c = (d6 >>> 13); d6 &= 0x1fff;
  38345. d6 += h5 * r1;
  38346. d6 += h6 * r0;
  38347. d6 += h7 * (5 * r9);
  38348. d6 += h8 * (5 * r8);
  38349. d6 += h9 * (5 * r7);
  38350. c += (d6 >>> 13); d6 &= 0x1fff;
  38351. d7 = c;
  38352. d7 += h0 * r7;
  38353. d7 += h1 * r6;
  38354. d7 += h2 * r5;
  38355. d7 += h3 * r4;
  38356. d7 += h4 * r3;
  38357. c = (d7 >>> 13); d7 &= 0x1fff;
  38358. d7 += h5 * r2;
  38359. d7 += h6 * r1;
  38360. d7 += h7 * r0;
  38361. d7 += h8 * (5 * r9);
  38362. d7 += h9 * (5 * r8);
  38363. c += (d7 >>> 13); d7 &= 0x1fff;
  38364. d8 = c;
  38365. d8 += h0 * r8;
  38366. d8 += h1 * r7;
  38367. d8 += h2 * r6;
  38368. d8 += h3 * r5;
  38369. d8 += h4 * r4;
  38370. c = (d8 >>> 13); d8 &= 0x1fff;
  38371. d8 += h5 * r3;
  38372. d8 += h6 * r2;
  38373. d8 += h7 * r1;
  38374. d8 += h8 * r0;
  38375. d8 += h9 * (5 * r9);
  38376. c += (d8 >>> 13); d8 &= 0x1fff;
  38377. d9 = c;
  38378. d9 += h0 * r9;
  38379. d9 += h1 * r8;
  38380. d9 += h2 * r7;
  38381. d9 += h3 * r6;
  38382. d9 += h4 * r5;
  38383. c = (d9 >>> 13); d9 &= 0x1fff;
  38384. d9 += h5 * r4;
  38385. d9 += h6 * r3;
  38386. d9 += h7 * r2;
  38387. d9 += h8 * r1;
  38388. d9 += h9 * r0;
  38389. c += (d9 >>> 13); d9 &= 0x1fff;
  38390. c = (((c << 2) + c)) | 0;
  38391. c = (c + d0) | 0;
  38392. d0 = c & 0x1fff;
  38393. c = (c >>> 13);
  38394. d1 += c;
  38395. h0 = d0;
  38396. h1 = d1;
  38397. h2 = d2;
  38398. h3 = d3;
  38399. h4 = d4;
  38400. h5 = d5;
  38401. h6 = d6;
  38402. h7 = d7;
  38403. h8 = d8;
  38404. h9 = d9;
  38405. mpos += 16;
  38406. bytes -= 16;
  38407. }
  38408. this.h[0] = h0;
  38409. this.h[1] = h1;
  38410. this.h[2] = h2;
  38411. this.h[3] = h3;
  38412. this.h[4] = h4;
  38413. this.h[5] = h5;
  38414. this.h[6] = h6;
  38415. this.h[7] = h7;
  38416. this.h[8] = h8;
  38417. this.h[9] = h9;
  38418. };
  38419. poly1305.prototype.finish = function(mac, macpos) {
  38420. var g = new Uint16Array(10);
  38421. var c, mask, f, i;
  38422. if (this.leftover) {
  38423. i = this.leftover;
  38424. this.buffer[i++] = 1;
  38425. for (; i < 16; i++) this.buffer[i] = 0;
  38426. this.fin = 1;
  38427. this.blocks(this.buffer, 0, 16);
  38428. }
  38429. c = this.h[1] >>> 13;
  38430. this.h[1] &= 0x1fff;
  38431. for (i = 2; i < 10; i++) {
  38432. this.h[i] += c;
  38433. c = this.h[i] >>> 13;
  38434. this.h[i] &= 0x1fff;
  38435. }
  38436. this.h[0] += (c * 5);
  38437. c = this.h[0] >>> 13;
  38438. this.h[0] &= 0x1fff;
  38439. this.h[1] += c;
  38440. c = this.h[1] >>> 13;
  38441. this.h[1] &= 0x1fff;
  38442. this.h[2] += c;
  38443. g[0] = this.h[0] + 5;
  38444. c = g[0] >>> 13;
  38445. g[0] &= 0x1fff;
  38446. for (i = 1; i < 10; i++) {
  38447. g[i] = this.h[i] + c;
  38448. c = g[i] >>> 13;
  38449. g[i] &= 0x1fff;
  38450. }
  38451. g[9] -= (1 << 13);
  38452. mask = (c ^ 1) - 1;
  38453. for (i = 0; i < 10; i++) g[i] &= mask;
  38454. mask = ~mask;
  38455. for (i = 0; i < 10; i++) this.h[i] = (this.h[i] & mask) | g[i];
  38456. this.h[0] = ((this.h[0] ) | (this.h[1] << 13) ) & 0xffff;
  38457. this.h[1] = ((this.h[1] >>> 3) | (this.h[2] << 10) ) & 0xffff;
  38458. this.h[2] = ((this.h[2] >>> 6) | (this.h[3] << 7) ) & 0xffff;
  38459. this.h[3] = ((this.h[3] >>> 9) | (this.h[4] << 4) ) & 0xffff;
  38460. this.h[4] = ((this.h[4] >>> 12) | (this.h[5] << 1) | (this.h[6] << 14)) & 0xffff;
  38461. this.h[5] = ((this.h[6] >>> 2) | (this.h[7] << 11) ) & 0xffff;
  38462. this.h[6] = ((this.h[7] >>> 5) | (this.h[8] << 8) ) & 0xffff;
  38463. this.h[7] = ((this.h[8] >>> 8) | (this.h[9] << 5) ) & 0xffff;
  38464. f = this.h[0] + this.pad[0];
  38465. this.h[0] = f & 0xffff;
  38466. for (i = 1; i < 8; i++) {
  38467. f = (((this.h[i] + this.pad[i]) | 0) + (f >>> 16)) | 0;
  38468. this.h[i] = f & 0xffff;
  38469. }
  38470. mac[macpos+ 0] = (this.h[0] >>> 0) & 0xff;
  38471. mac[macpos+ 1] = (this.h[0] >>> 8) & 0xff;
  38472. mac[macpos+ 2] = (this.h[1] >>> 0) & 0xff;
  38473. mac[macpos+ 3] = (this.h[1] >>> 8) & 0xff;
  38474. mac[macpos+ 4] = (this.h[2] >>> 0) & 0xff;
  38475. mac[macpos+ 5] = (this.h[2] >>> 8) & 0xff;
  38476. mac[macpos+ 6] = (this.h[3] >>> 0) & 0xff;
  38477. mac[macpos+ 7] = (this.h[3] >>> 8) & 0xff;
  38478. mac[macpos+ 8] = (this.h[4] >>> 0) & 0xff;
  38479. mac[macpos+ 9] = (this.h[4] >>> 8) & 0xff;
  38480. mac[macpos+10] = (this.h[5] >>> 0) & 0xff;
  38481. mac[macpos+11] = (this.h[5] >>> 8) & 0xff;
  38482. mac[macpos+12] = (this.h[6] >>> 0) & 0xff;
  38483. mac[macpos+13] = (this.h[6] >>> 8) & 0xff;
  38484. mac[macpos+14] = (this.h[7] >>> 0) & 0xff;
  38485. mac[macpos+15] = (this.h[7] >>> 8) & 0xff;
  38486. };
  38487. poly1305.prototype.update = function(m, mpos, bytes) {
  38488. var i, want;
  38489. if (this.leftover) {
  38490. want = (16 - this.leftover);
  38491. if (want > bytes)
  38492. want = bytes;
  38493. for (i = 0; i < want; i++)
  38494. this.buffer[this.leftover + i] = m[mpos+i];
  38495. bytes -= want;
  38496. mpos += want;
  38497. this.leftover += want;
  38498. if (this.leftover < 16)
  38499. return;
  38500. this.blocks(this.buffer, 0, 16);
  38501. this.leftover = 0;
  38502. }
  38503. if (bytes >= 16) {
  38504. want = bytes - (bytes % 16);
  38505. this.blocks(m, mpos, want);
  38506. mpos += want;
  38507. bytes -= want;
  38508. }
  38509. if (bytes) {
  38510. for (i = 0; i < bytes; i++)
  38511. this.buffer[this.leftover + i] = m[mpos+i];
  38512. this.leftover += bytes;
  38513. }
  38514. };
  38515. function crypto_onetimeauth(out, outpos, m, mpos, n, k) {
  38516. var s = new poly1305(k);
  38517. s.update(m, mpos, n);
  38518. s.finish(out, outpos);
  38519. return 0;
  38520. }
  38521. function crypto_onetimeauth_verify(h, hpos, m, mpos, n, k) {
  38522. var x = new Uint8Array(16);
  38523. crypto_onetimeauth(x,0,m,mpos,n,k);
  38524. return crypto_verify_16(h,hpos,x,0);
  38525. }
  38526. function crypto_secretbox(c,m,d,n,k) {
  38527. var i;
  38528. if (d < 32) return -1;
  38529. crypto_stream_xor(c,0,m,0,d,n,k);
  38530. crypto_onetimeauth(c, 16, c, 32, d - 32, c);
  38531. for (i = 0; i < 16; i++) c[i] = 0;
  38532. return 0;
  38533. }
  38534. function crypto_secretbox_open(m,c,d,n,k) {
  38535. var i;
  38536. var x = new Uint8Array(32);
  38537. if (d < 32) return -1;
  38538. crypto_stream(x,0,32,n,k);
  38539. if (crypto_onetimeauth_verify(c, 16,c, 32,d - 32,x) !== 0) return -1;
  38540. crypto_stream_xor(m,0,c,0,d,n,k);
  38541. for (i = 0; i < 32; i++) m[i] = 0;
  38542. return 0;
  38543. }
  38544. function set25519(r, a) {
  38545. var i;
  38546. for (i = 0; i < 16; i++) r[i] = a[i]|0;
  38547. }
  38548. function car25519(o) {
  38549. var i, v, c = 1;
  38550. for (i = 0; i < 16; i++) {
  38551. v = o[i] + c + 65535;
  38552. c = Math.floor(v / 65536);
  38553. o[i] = v - c * 65536;
  38554. }
  38555. o[0] += c-1 + 37 * (c-1);
  38556. }
  38557. function sel25519(p, q, b) {
  38558. var t, c = ~(b-1);
  38559. for (var i = 0; i < 16; i++) {
  38560. t = c & (p[i] ^ q[i]);
  38561. p[i] ^= t;
  38562. q[i] ^= t;
  38563. }
  38564. }
  38565. function pack25519(o, n) {
  38566. var i, j, b;
  38567. var m = gf(), t = gf();
  38568. for (i = 0; i < 16; i++) t[i] = n[i];
  38569. car25519(t);
  38570. car25519(t);
  38571. car25519(t);
  38572. for (j = 0; j < 2; j++) {
  38573. m[0] = t[0] - 0xffed;
  38574. for (i = 1; i < 15; i++) {
  38575. m[i] = t[i] - 0xffff - ((m[i-1]>>16) & 1);
  38576. m[i-1] &= 0xffff;
  38577. }
  38578. m[15] = t[15] - 0x7fff - ((m[14]>>16) & 1);
  38579. b = (m[15]>>16) & 1;
  38580. m[14] &= 0xffff;
  38581. sel25519(t, m, 1-b);
  38582. }
  38583. for (i = 0; i < 16; i++) {
  38584. o[2*i] = t[i] & 0xff;
  38585. o[2*i+1] = t[i]>>8;
  38586. }
  38587. }
  38588. function neq25519(a, b) {
  38589. var c = new Uint8Array(32), d = new Uint8Array(32);
  38590. pack25519(c, a);
  38591. pack25519(d, b);
  38592. return crypto_verify_32(c, 0, d, 0);
  38593. }
  38594. function par25519(a) {
  38595. var d = new Uint8Array(32);
  38596. pack25519(d, a);
  38597. return d[0] & 1;
  38598. }
  38599. function unpack25519(o, n) {
  38600. var i;
  38601. for (i = 0; i < 16; i++) o[i] = n[2*i] + (n[2*i+1] << 8);
  38602. o[15] &= 0x7fff;
  38603. }
  38604. function A(o, a, b) {
  38605. for (var i = 0; i < 16; i++) o[i] = a[i] + b[i];
  38606. }
  38607. function Z(o, a, b) {
  38608. for (var i = 0; i < 16; i++) o[i] = a[i] - b[i];
  38609. }
  38610. function M(o, a, b) {
  38611. var v, c,
  38612. t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0,
  38613. t8 = 0, t9 = 0, t10 = 0, t11 = 0, t12 = 0, t13 = 0, t14 = 0, t15 = 0,
  38614. t16 = 0, t17 = 0, t18 = 0, t19 = 0, t20 = 0, t21 = 0, t22 = 0, t23 = 0,
  38615. t24 = 0, t25 = 0, t26 = 0, t27 = 0, t28 = 0, t29 = 0, t30 = 0,
  38616. b0 = b[0],
  38617. b1 = b[1],
  38618. b2 = b[2],
  38619. b3 = b[3],
  38620. b4 = b[4],
  38621. b5 = b[5],
  38622. b6 = b[6],
  38623. b7 = b[7],
  38624. b8 = b[8],
  38625. b9 = b[9],
  38626. b10 = b[10],
  38627. b11 = b[11],
  38628. b12 = b[12],
  38629. b13 = b[13],
  38630. b14 = b[14],
  38631. b15 = b[15];
  38632. v = a[0];
  38633. t0 += v * b0;
  38634. t1 += v * b1;
  38635. t2 += v * b2;
  38636. t3 += v * b3;
  38637. t4 += v * b4;
  38638. t5 += v * b5;
  38639. t6 += v * b6;
  38640. t7 += v * b7;
  38641. t8 += v * b8;
  38642. t9 += v * b9;
  38643. t10 += v * b10;
  38644. t11 += v * b11;
  38645. t12 += v * b12;
  38646. t13 += v * b13;
  38647. t14 += v * b14;
  38648. t15 += v * b15;
  38649. v = a[1];
  38650. t1 += v * b0;
  38651. t2 += v * b1;
  38652. t3 += v * b2;
  38653. t4 += v * b3;
  38654. t5 += v * b4;
  38655. t6 += v * b5;
  38656. t7 += v * b6;
  38657. t8 += v * b7;
  38658. t9 += v * b8;
  38659. t10 += v * b9;
  38660. t11 += v * b10;
  38661. t12 += v * b11;
  38662. t13 += v * b12;
  38663. t14 += v * b13;
  38664. t15 += v * b14;
  38665. t16 += v * b15;
  38666. v = a[2];
  38667. t2 += v * b0;
  38668. t3 += v * b1;
  38669. t4 += v * b2;
  38670. t5 += v * b3;
  38671. t6 += v * b4;
  38672. t7 += v * b5;
  38673. t8 += v * b6;
  38674. t9 += v * b7;
  38675. t10 += v * b8;
  38676. t11 += v * b9;
  38677. t12 += v * b10;
  38678. t13 += v * b11;
  38679. t14 += v * b12;
  38680. t15 += v * b13;
  38681. t16 += v * b14;
  38682. t17 += v * b15;
  38683. v = a[3];
  38684. t3 += v * b0;
  38685. t4 += v * b1;
  38686. t5 += v * b2;
  38687. t6 += v * b3;
  38688. t7 += v * b4;
  38689. t8 += v * b5;
  38690. t9 += v * b6;
  38691. t10 += v * b7;
  38692. t11 += v * b8;
  38693. t12 += v * b9;
  38694. t13 += v * b10;
  38695. t14 += v * b11;
  38696. t15 += v * b12;
  38697. t16 += v * b13;
  38698. t17 += v * b14;
  38699. t18 += v * b15;
  38700. v = a[4];
  38701. t4 += v * b0;
  38702. t5 += v * b1;
  38703. t6 += v * b2;
  38704. t7 += v * b3;
  38705. t8 += v * b4;
  38706. t9 += v * b5;
  38707. t10 += v * b6;
  38708. t11 += v * b7;
  38709. t12 += v * b8;
  38710. t13 += v * b9;
  38711. t14 += v * b10;
  38712. t15 += v * b11;
  38713. t16 += v * b12;
  38714. t17 += v * b13;
  38715. t18 += v * b14;
  38716. t19 += v * b15;
  38717. v = a[5];
  38718. t5 += v * b0;
  38719. t6 += v * b1;
  38720. t7 += v * b2;
  38721. t8 += v * b3;
  38722. t9 += v * b4;
  38723. t10 += v * b5;
  38724. t11 += v * b6;
  38725. t12 += v * b7;
  38726. t13 += v * b8;
  38727. t14 += v * b9;
  38728. t15 += v * b10;
  38729. t16 += v * b11;
  38730. t17 += v * b12;
  38731. t18 += v * b13;
  38732. t19 += v * b14;
  38733. t20 += v * b15;
  38734. v = a[6];
  38735. t6 += v * b0;
  38736. t7 += v * b1;
  38737. t8 += v * b2;
  38738. t9 += v * b3;
  38739. t10 += v * b4;
  38740. t11 += v * b5;
  38741. t12 += v * b6;
  38742. t13 += v * b7;
  38743. t14 += v * b8;
  38744. t15 += v * b9;
  38745. t16 += v * b10;
  38746. t17 += v * b11;
  38747. t18 += v * b12;
  38748. t19 += v * b13;
  38749. t20 += v * b14;
  38750. t21 += v * b15;
  38751. v = a[7];
  38752. t7 += v * b0;
  38753. t8 += v * b1;
  38754. t9 += v * b2;
  38755. t10 += v * b3;
  38756. t11 += v * b4;
  38757. t12 += v * b5;
  38758. t13 += v * b6;
  38759. t14 += v * b7;
  38760. t15 += v * b8;
  38761. t16 += v * b9;
  38762. t17 += v * b10;
  38763. t18 += v * b11;
  38764. t19 += v * b12;
  38765. t20 += v * b13;
  38766. t21 += v * b14;
  38767. t22 += v * b15;
  38768. v = a[8];
  38769. t8 += v * b0;
  38770. t9 += v * b1;
  38771. t10 += v * b2;
  38772. t11 += v * b3;
  38773. t12 += v * b4;
  38774. t13 += v * b5;
  38775. t14 += v * b6;
  38776. t15 += v * b7;
  38777. t16 += v * b8;
  38778. t17 += v * b9;
  38779. t18 += v * b10;
  38780. t19 += v * b11;
  38781. t20 += v * b12;
  38782. t21 += v * b13;
  38783. t22 += v * b14;
  38784. t23 += v * b15;
  38785. v = a[9];
  38786. t9 += v * b0;
  38787. t10 += v * b1;
  38788. t11 += v * b2;
  38789. t12 += v * b3;
  38790. t13 += v * b4;
  38791. t14 += v * b5;
  38792. t15 += v * b6;
  38793. t16 += v * b7;
  38794. t17 += v * b8;
  38795. t18 += v * b9;
  38796. t19 += v * b10;
  38797. t20 += v * b11;
  38798. t21 += v * b12;
  38799. t22 += v * b13;
  38800. t23 += v * b14;
  38801. t24 += v * b15;
  38802. v = a[10];
  38803. t10 += v * b0;
  38804. t11 += v * b1;
  38805. t12 += v * b2;
  38806. t13 += v * b3;
  38807. t14 += v * b4;
  38808. t15 += v * b5;
  38809. t16 += v * b6;
  38810. t17 += v * b7;
  38811. t18 += v * b8;
  38812. t19 += v * b9;
  38813. t20 += v * b10;
  38814. t21 += v * b11;
  38815. t22 += v * b12;
  38816. t23 += v * b13;
  38817. t24 += v * b14;
  38818. t25 += v * b15;
  38819. v = a[11];
  38820. t11 += v * b0;
  38821. t12 += v * b1;
  38822. t13 += v * b2;
  38823. t14 += v * b3;
  38824. t15 += v * b4;
  38825. t16 += v * b5;
  38826. t17 += v * b6;
  38827. t18 += v * b7;
  38828. t19 += v * b8;
  38829. t20 += v * b9;
  38830. t21 += v * b10;
  38831. t22 += v * b11;
  38832. t23 += v * b12;
  38833. t24 += v * b13;
  38834. t25 += v * b14;
  38835. t26 += v * b15;
  38836. v = a[12];
  38837. t12 += v * b0;
  38838. t13 += v * b1;
  38839. t14 += v * b2;
  38840. t15 += v * b3;
  38841. t16 += v * b4;
  38842. t17 += v * b5;
  38843. t18 += v * b6;
  38844. t19 += v * b7;
  38845. t20 += v * b8;
  38846. t21 += v * b9;
  38847. t22 += v * b10;
  38848. t23 += v * b11;
  38849. t24 += v * b12;
  38850. t25 += v * b13;
  38851. t26 += v * b14;
  38852. t27 += v * b15;
  38853. v = a[13];
  38854. t13 += v * b0;
  38855. t14 += v * b1;
  38856. t15 += v * b2;
  38857. t16 += v * b3;
  38858. t17 += v * b4;
  38859. t18 += v * b5;
  38860. t19 += v * b6;
  38861. t20 += v * b7;
  38862. t21 += v * b8;
  38863. t22 += v * b9;
  38864. t23 += v * b10;
  38865. t24 += v * b11;
  38866. t25 += v * b12;
  38867. t26 += v * b13;
  38868. t27 += v * b14;
  38869. t28 += v * b15;
  38870. v = a[14];
  38871. t14 += v * b0;
  38872. t15 += v * b1;
  38873. t16 += v * b2;
  38874. t17 += v * b3;
  38875. t18 += v * b4;
  38876. t19 += v * b5;
  38877. t20 += v * b6;
  38878. t21 += v * b7;
  38879. t22 += v * b8;
  38880. t23 += v * b9;
  38881. t24 += v * b10;
  38882. t25 += v * b11;
  38883. t26 += v * b12;
  38884. t27 += v * b13;
  38885. t28 += v * b14;
  38886. t29 += v * b15;
  38887. v = a[15];
  38888. t15 += v * b0;
  38889. t16 += v * b1;
  38890. t17 += v * b2;
  38891. t18 += v * b3;
  38892. t19 += v * b4;
  38893. t20 += v * b5;
  38894. t21 += v * b6;
  38895. t22 += v * b7;
  38896. t23 += v * b8;
  38897. t24 += v * b9;
  38898. t25 += v * b10;
  38899. t26 += v * b11;
  38900. t27 += v * b12;
  38901. t28 += v * b13;
  38902. t29 += v * b14;
  38903. t30 += v * b15;
  38904. t0 += 38 * t16;
  38905. t1 += 38 * t17;
  38906. t2 += 38 * t18;
  38907. t3 += 38 * t19;
  38908. t4 += 38 * t20;
  38909. t5 += 38 * t21;
  38910. t6 += 38 * t22;
  38911. t7 += 38 * t23;
  38912. t8 += 38 * t24;
  38913. t9 += 38 * t25;
  38914. t10 += 38 * t26;
  38915. t11 += 38 * t27;
  38916. t12 += 38 * t28;
  38917. t13 += 38 * t29;
  38918. t14 += 38 * t30;
  38919. // t15 left as is
  38920. // first car
  38921. c = 1;
  38922. v = t0 + c + 65535; c = Math.floor(v / 65536); t0 = v - c * 65536;
  38923. v = t1 + c + 65535; c = Math.floor(v / 65536); t1 = v - c * 65536;
  38924. v = t2 + c + 65535; c = Math.floor(v / 65536); t2 = v - c * 65536;
  38925. v = t3 + c + 65535; c = Math.floor(v / 65536); t3 = v - c * 65536;
  38926. v = t4 + c + 65535; c = Math.floor(v / 65536); t4 = v - c * 65536;
  38927. v = t5 + c + 65535; c = Math.floor(v / 65536); t5 = v - c * 65536;
  38928. v = t6 + c + 65535; c = Math.floor(v / 65536); t6 = v - c * 65536;
  38929. v = t7 + c + 65535; c = Math.floor(v / 65536); t7 = v - c * 65536;
  38930. v = t8 + c + 65535; c = Math.floor(v / 65536); t8 = v - c * 65536;
  38931. v = t9 + c + 65535; c = Math.floor(v / 65536); t9 = v - c * 65536;
  38932. v = t10 + c + 65535; c = Math.floor(v / 65536); t10 = v - c * 65536;
  38933. v = t11 + c + 65535; c = Math.floor(v / 65536); t11 = v - c * 65536;
  38934. v = t12 + c + 65535; c = Math.floor(v / 65536); t12 = v - c * 65536;
  38935. v = t13 + c + 65535; c = Math.floor(v / 65536); t13 = v - c * 65536;
  38936. v = t14 + c + 65535; c = Math.floor(v / 65536); t14 = v - c * 65536;
  38937. v = t15 + c + 65535; c = Math.floor(v / 65536); t15 = v - c * 65536;
  38938. t0 += c-1 + 37 * (c-1);
  38939. // second car
  38940. c = 1;
  38941. v = t0 + c + 65535; c = Math.floor(v / 65536); t0 = v - c * 65536;
  38942. v = t1 + c + 65535; c = Math.floor(v / 65536); t1 = v - c * 65536;
  38943. v = t2 + c + 65535; c = Math.floor(v / 65536); t2 = v - c * 65536;
  38944. v = t3 + c + 65535; c = Math.floor(v / 65536); t3 = v - c * 65536;
  38945. v = t4 + c + 65535; c = Math.floor(v / 65536); t4 = v - c * 65536;
  38946. v = t5 + c + 65535; c = Math.floor(v / 65536); t5 = v - c * 65536;
  38947. v = t6 + c + 65535; c = Math.floor(v / 65536); t6 = v - c * 65536;
  38948. v = t7 + c + 65535; c = Math.floor(v / 65536); t7 = v - c * 65536;
  38949. v = t8 + c + 65535; c = Math.floor(v / 65536); t8 = v - c * 65536;
  38950. v = t9 + c + 65535; c = Math.floor(v / 65536); t9 = v - c * 65536;
  38951. v = t10 + c + 65535; c = Math.floor(v / 65536); t10 = v - c * 65536;
  38952. v = t11 + c + 65535; c = Math.floor(v / 65536); t11 = v - c * 65536;
  38953. v = t12 + c + 65535; c = Math.floor(v / 65536); t12 = v - c * 65536;
  38954. v = t13 + c + 65535; c = Math.floor(v / 65536); t13 = v - c * 65536;
  38955. v = t14 + c + 65535; c = Math.floor(v / 65536); t14 = v - c * 65536;
  38956. v = t15 + c + 65535; c = Math.floor(v / 65536); t15 = v - c * 65536;
  38957. t0 += c-1 + 37 * (c-1);
  38958. o[ 0] = t0;
  38959. o[ 1] = t1;
  38960. o[ 2] = t2;
  38961. o[ 3] = t3;
  38962. o[ 4] = t4;
  38963. o[ 5] = t5;
  38964. o[ 6] = t6;
  38965. o[ 7] = t7;
  38966. o[ 8] = t8;
  38967. o[ 9] = t9;
  38968. o[10] = t10;
  38969. o[11] = t11;
  38970. o[12] = t12;
  38971. o[13] = t13;
  38972. o[14] = t14;
  38973. o[15] = t15;
  38974. }
  38975. function S(o, a) {
  38976. M(o, a, a);
  38977. }
  38978. function inv25519(o, i) {
  38979. var c = gf();
  38980. var a;
  38981. for (a = 0; a < 16; a++) c[a] = i[a];
  38982. for (a = 253; a >= 0; a--) {
  38983. S(c, c);
  38984. if(a !== 2 && a !== 4) M(c, c, i);
  38985. }
  38986. for (a = 0; a < 16; a++) o[a] = c[a];
  38987. }
  38988. function pow2523(o, i) {
  38989. var c = gf();
  38990. var a;
  38991. for (a = 0; a < 16; a++) c[a] = i[a];
  38992. for (a = 250; a >= 0; a--) {
  38993. S(c, c);
  38994. if(a !== 1) M(c, c, i);
  38995. }
  38996. for (a = 0; a < 16; a++) o[a] = c[a];
  38997. }
  38998. function crypto_scalarmult(q, n, p) {
  38999. var z = new Uint8Array(32);
  39000. var x = new Float64Array(80), r, i;
  39001. var a = gf(), b = gf(), c = gf(),
  39002. d = gf(), e = gf(), f = gf();
  39003. for (i = 0; i < 31; i++) z[i] = n[i];
  39004. z[31]=(n[31]&127)|64;
  39005. z[0]&=248;
  39006. unpack25519(x,p);
  39007. for (i = 0; i < 16; i++) {
  39008. b[i]=x[i];
  39009. d[i]=a[i]=c[i]=0;
  39010. }
  39011. a[0]=d[0]=1;
  39012. for (i=254; i>=0; --i) {
  39013. r=(z[i>>>3]>>>(i&7))&1;
  39014. sel25519(a,b,r);
  39015. sel25519(c,d,r);
  39016. A(e,a,c);
  39017. Z(a,a,c);
  39018. A(c,b,d);
  39019. Z(b,b,d);
  39020. S(d,e);
  39021. S(f,a);
  39022. M(a,c,a);
  39023. M(c,b,e);
  39024. A(e,a,c);
  39025. Z(a,a,c);
  39026. S(b,a);
  39027. Z(c,d,f);
  39028. M(a,c,_121665);
  39029. A(a,a,d);
  39030. M(c,c,a);
  39031. M(a,d,f);
  39032. M(d,b,x);
  39033. S(b,e);
  39034. sel25519(a,b,r);
  39035. sel25519(c,d,r);
  39036. }
  39037. for (i = 0; i < 16; i++) {
  39038. x[i+16]=a[i];
  39039. x[i+32]=c[i];
  39040. x[i+48]=b[i];
  39041. x[i+64]=d[i];
  39042. }
  39043. var x32 = x.subarray(32);
  39044. var x16 = x.subarray(16);
  39045. inv25519(x32,x32);
  39046. M(x16,x16,x32);
  39047. pack25519(q,x16);
  39048. return 0;
  39049. }
  39050. function crypto_scalarmult_base(q, n) {
  39051. return crypto_scalarmult(q, n, _9);
  39052. }
  39053. function crypto_box_keypair(y, x) {
  39054. randombytes(x, 32);
  39055. return crypto_scalarmult_base(y, x);
  39056. }
  39057. function crypto_box_beforenm(k, y, x) {
  39058. var s = new Uint8Array(32);
  39059. crypto_scalarmult(s, x, y);
  39060. return crypto_core_hsalsa20(k, _0, s, sigma);
  39061. }
  39062. var crypto_box_afternm = crypto_secretbox;
  39063. var crypto_box_open_afternm = crypto_secretbox_open;
  39064. function crypto_box(c, m, d, n, y, x) {
  39065. var k = new Uint8Array(32);
  39066. crypto_box_beforenm(k, y, x);
  39067. return crypto_box_afternm(c, m, d, n, k);
  39068. }
  39069. function crypto_box_open(m, c, d, n, y, x) {
  39070. var k = new Uint8Array(32);
  39071. crypto_box_beforenm(k, y, x);
  39072. return crypto_box_open_afternm(m, c, d, n, k);
  39073. }
  39074. var K = [
  39075. 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,
  39076. 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,
  39077. 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,
  39078. 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,
  39079. 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,
  39080. 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,
  39081. 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,
  39082. 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,
  39083. 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,
  39084. 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,
  39085. 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,
  39086. 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,
  39087. 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,
  39088. 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,
  39089. 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,
  39090. 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,
  39091. 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,
  39092. 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,
  39093. 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,
  39094. 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,
  39095. 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,
  39096. 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,
  39097. 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,
  39098. 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,
  39099. 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,
  39100. 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,
  39101. 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,
  39102. 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,
  39103. 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,
  39104. 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,
  39105. 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,
  39106. 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,
  39107. 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,
  39108. 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,
  39109. 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,
  39110. 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,
  39111. 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,
  39112. 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,
  39113. 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,
  39114. 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817
  39115. ];
  39116. function crypto_hashblocks_hl(hh, hl, m, n) {
  39117. var wh = new Int32Array(16), wl = new Int32Array(16),
  39118. bh0, bh1, bh2, bh3, bh4, bh5, bh6, bh7,
  39119. bl0, bl1, bl2, bl3, bl4, bl5, bl6, bl7,
  39120. th, tl, i, j, h, l, a, b, c, d;
  39121. var ah0 = hh[0],
  39122. ah1 = hh[1],
  39123. ah2 = hh[2],
  39124. ah3 = hh[3],
  39125. ah4 = hh[4],
  39126. ah5 = hh[5],
  39127. ah6 = hh[6],
  39128. ah7 = hh[7],
  39129. al0 = hl[0],
  39130. al1 = hl[1],
  39131. al2 = hl[2],
  39132. al3 = hl[3],
  39133. al4 = hl[4],
  39134. al5 = hl[5],
  39135. al6 = hl[6],
  39136. al7 = hl[7];
  39137. var pos = 0;
  39138. while (n >= 128) {
  39139. for (i = 0; i < 16; i++) {
  39140. j = 8 * i + pos;
  39141. wh[i] = (m[j+0] << 24) | (m[j+1] << 16) | (m[j+2] << 8) | m[j+3];
  39142. wl[i] = (m[j+4] << 24) | (m[j+5] << 16) | (m[j+6] << 8) | m[j+7];
  39143. }
  39144. for (i = 0; i < 80; i++) {
  39145. bh0 = ah0;
  39146. bh1 = ah1;
  39147. bh2 = ah2;
  39148. bh3 = ah3;
  39149. bh4 = ah4;
  39150. bh5 = ah5;
  39151. bh6 = ah6;
  39152. bh7 = ah7;
  39153. bl0 = al0;
  39154. bl1 = al1;
  39155. bl2 = al2;
  39156. bl3 = al3;
  39157. bl4 = al4;
  39158. bl5 = al5;
  39159. bl6 = al6;
  39160. bl7 = al7;
  39161. // add
  39162. h = ah7;
  39163. l = al7;
  39164. a = l & 0xffff; b = l >>> 16;
  39165. c = h & 0xffff; d = h >>> 16;
  39166. // Sigma1
  39167. h = ((ah4 >>> 14) | (al4 << (32-14))) ^ ((ah4 >>> 18) | (al4 << (32-18))) ^ ((al4 >>> (41-32)) | (ah4 << (32-(41-32))));
  39168. l = ((al4 >>> 14) | (ah4 << (32-14))) ^ ((al4 >>> 18) | (ah4 << (32-18))) ^ ((ah4 >>> (41-32)) | (al4 << (32-(41-32))));
  39169. a += l & 0xffff; b += l >>> 16;
  39170. c += h & 0xffff; d += h >>> 16;
  39171. // Ch
  39172. h = (ah4 & ah5) ^ (~ah4 & ah6);
  39173. l = (al4 & al5) ^ (~al4 & al6);
  39174. a += l & 0xffff; b += l >>> 16;
  39175. c += h & 0xffff; d += h >>> 16;
  39176. // K
  39177. h = K[i*2];
  39178. l = K[i*2+1];
  39179. a += l & 0xffff; b += l >>> 16;
  39180. c += h & 0xffff; d += h >>> 16;
  39181. // w
  39182. h = wh[i%16];
  39183. l = wl[i%16];
  39184. a += l & 0xffff; b += l >>> 16;
  39185. c += h & 0xffff; d += h >>> 16;
  39186. b += a >>> 16;
  39187. c += b >>> 16;
  39188. d += c >>> 16;
  39189. th = c & 0xffff | d << 16;
  39190. tl = a & 0xffff | b << 16;
  39191. // add
  39192. h = th;
  39193. l = tl;
  39194. a = l & 0xffff; b = l >>> 16;
  39195. c = h & 0xffff; d = h >>> 16;
  39196. // Sigma0
  39197. h = ((ah0 >>> 28) | (al0 << (32-28))) ^ ((al0 >>> (34-32)) | (ah0 << (32-(34-32)))) ^ ((al0 >>> (39-32)) | (ah0 << (32-(39-32))));
  39198. l = ((al0 >>> 28) | (ah0 << (32-28))) ^ ((ah0 >>> (34-32)) | (al0 << (32-(34-32)))) ^ ((ah0 >>> (39-32)) | (al0 << (32-(39-32))));
  39199. a += l & 0xffff; b += l >>> 16;
  39200. c += h & 0xffff; d += h >>> 16;
  39201. // Maj
  39202. h = (ah0 & ah1) ^ (ah0 & ah2) ^ (ah1 & ah2);
  39203. l = (al0 & al1) ^ (al0 & al2) ^ (al1 & al2);
  39204. a += l & 0xffff; b += l >>> 16;
  39205. c += h & 0xffff; d += h >>> 16;
  39206. b += a >>> 16;
  39207. c += b >>> 16;
  39208. d += c >>> 16;
  39209. bh7 = (c & 0xffff) | (d << 16);
  39210. bl7 = (a & 0xffff) | (b << 16);
  39211. // add
  39212. h = bh3;
  39213. l = bl3;
  39214. a = l & 0xffff; b = l >>> 16;
  39215. c = h & 0xffff; d = h >>> 16;
  39216. h = th;
  39217. l = tl;
  39218. a += l & 0xffff; b += l >>> 16;
  39219. c += h & 0xffff; d += h >>> 16;
  39220. b += a >>> 16;
  39221. c += b >>> 16;
  39222. d += c >>> 16;
  39223. bh3 = (c & 0xffff) | (d << 16);
  39224. bl3 = (a & 0xffff) | (b << 16);
  39225. ah1 = bh0;
  39226. ah2 = bh1;
  39227. ah3 = bh2;
  39228. ah4 = bh3;
  39229. ah5 = bh4;
  39230. ah6 = bh5;
  39231. ah7 = bh6;
  39232. ah0 = bh7;
  39233. al1 = bl0;
  39234. al2 = bl1;
  39235. al3 = bl2;
  39236. al4 = bl3;
  39237. al5 = bl4;
  39238. al6 = bl5;
  39239. al7 = bl6;
  39240. al0 = bl7;
  39241. if (i%16 === 15) {
  39242. for (j = 0; j < 16; j++) {
  39243. // add
  39244. h = wh[j];
  39245. l = wl[j];
  39246. a = l & 0xffff; b = l >>> 16;
  39247. c = h & 0xffff; d = h >>> 16;
  39248. h = wh[(j+9)%16];
  39249. l = wl[(j+9)%16];
  39250. a += l & 0xffff; b += l >>> 16;
  39251. c += h & 0xffff; d += h >>> 16;
  39252. // sigma0
  39253. th = wh[(j+1)%16];
  39254. tl = wl[(j+1)%16];
  39255. h = ((th >>> 1) | (tl << (32-1))) ^ ((th >>> 8) | (tl << (32-8))) ^ (th >>> 7);
  39256. l = ((tl >>> 1) | (th << (32-1))) ^ ((tl >>> 8) | (th << (32-8))) ^ ((tl >>> 7) | (th << (32-7)));
  39257. a += l & 0xffff; b += l >>> 16;
  39258. c += h & 0xffff; d += h >>> 16;
  39259. // sigma1
  39260. th = wh[(j+14)%16];
  39261. tl = wl[(j+14)%16];
  39262. h = ((th >>> 19) | (tl << (32-19))) ^ ((tl >>> (61-32)) | (th << (32-(61-32)))) ^ (th >>> 6);
  39263. l = ((tl >>> 19) | (th << (32-19))) ^ ((th >>> (61-32)) | (tl << (32-(61-32)))) ^ ((tl >>> 6) | (th << (32-6)));
  39264. a += l & 0xffff; b += l >>> 16;
  39265. c += h & 0xffff; d += h >>> 16;
  39266. b += a >>> 16;
  39267. c += b >>> 16;
  39268. d += c >>> 16;
  39269. wh[j] = (c & 0xffff) | (d << 16);
  39270. wl[j] = (a & 0xffff) | (b << 16);
  39271. }
  39272. }
  39273. }
  39274. // add
  39275. h = ah0;
  39276. l = al0;
  39277. a = l & 0xffff; b = l >>> 16;
  39278. c = h & 0xffff; d = h >>> 16;
  39279. h = hh[0];
  39280. l = hl[0];
  39281. a += l & 0xffff; b += l >>> 16;
  39282. c += h & 0xffff; d += h >>> 16;
  39283. b += a >>> 16;
  39284. c += b >>> 16;
  39285. d += c >>> 16;
  39286. hh[0] = ah0 = (c & 0xffff) | (d << 16);
  39287. hl[0] = al0 = (a & 0xffff) | (b << 16);
  39288. h = ah1;
  39289. l = al1;
  39290. a = l & 0xffff; b = l >>> 16;
  39291. c = h & 0xffff; d = h >>> 16;
  39292. h = hh[1];
  39293. l = hl[1];
  39294. a += l & 0xffff; b += l >>> 16;
  39295. c += h & 0xffff; d += h >>> 16;
  39296. b += a >>> 16;
  39297. c += b >>> 16;
  39298. d += c >>> 16;
  39299. hh[1] = ah1 = (c & 0xffff) | (d << 16);
  39300. hl[1] = al1 = (a & 0xffff) | (b << 16);
  39301. h = ah2;
  39302. l = al2;
  39303. a = l & 0xffff; b = l >>> 16;
  39304. c = h & 0xffff; d = h >>> 16;
  39305. h = hh[2];
  39306. l = hl[2];
  39307. a += l & 0xffff; b += l >>> 16;
  39308. c += h & 0xffff; d += h >>> 16;
  39309. b += a >>> 16;
  39310. c += b >>> 16;
  39311. d += c >>> 16;
  39312. hh[2] = ah2 = (c & 0xffff) | (d << 16);
  39313. hl[2] = al2 = (a & 0xffff) | (b << 16);
  39314. h = ah3;
  39315. l = al3;
  39316. a = l & 0xffff; b = l >>> 16;
  39317. c = h & 0xffff; d = h >>> 16;
  39318. h = hh[3];
  39319. l = hl[3];
  39320. a += l & 0xffff; b += l >>> 16;
  39321. c += h & 0xffff; d += h >>> 16;
  39322. b += a >>> 16;
  39323. c += b >>> 16;
  39324. d += c >>> 16;
  39325. hh[3] = ah3 = (c & 0xffff) | (d << 16);
  39326. hl[3] = al3 = (a & 0xffff) | (b << 16);
  39327. h = ah4;
  39328. l = al4;
  39329. a = l & 0xffff; b = l >>> 16;
  39330. c = h & 0xffff; d = h >>> 16;
  39331. h = hh[4];
  39332. l = hl[4];
  39333. a += l & 0xffff; b += l >>> 16;
  39334. c += h & 0xffff; d += h >>> 16;
  39335. b += a >>> 16;
  39336. c += b >>> 16;
  39337. d += c >>> 16;
  39338. hh[4] = ah4 = (c & 0xffff) | (d << 16);
  39339. hl[4] = al4 = (a & 0xffff) | (b << 16);
  39340. h = ah5;
  39341. l = al5;
  39342. a = l & 0xffff; b = l >>> 16;
  39343. c = h & 0xffff; d = h >>> 16;
  39344. h = hh[5];
  39345. l = hl[5];
  39346. a += l & 0xffff; b += l >>> 16;
  39347. c += h & 0xffff; d += h >>> 16;
  39348. b += a >>> 16;
  39349. c += b >>> 16;
  39350. d += c >>> 16;
  39351. hh[5] = ah5 = (c & 0xffff) | (d << 16);
  39352. hl[5] = al5 = (a & 0xffff) | (b << 16);
  39353. h = ah6;
  39354. l = al6;
  39355. a = l & 0xffff; b = l >>> 16;
  39356. c = h & 0xffff; d = h >>> 16;
  39357. h = hh[6];
  39358. l = hl[6];
  39359. a += l & 0xffff; b += l >>> 16;
  39360. c += h & 0xffff; d += h >>> 16;
  39361. b += a >>> 16;
  39362. c += b >>> 16;
  39363. d += c >>> 16;
  39364. hh[6] = ah6 = (c & 0xffff) | (d << 16);
  39365. hl[6] = al6 = (a & 0xffff) | (b << 16);
  39366. h = ah7;
  39367. l = al7;
  39368. a = l & 0xffff; b = l >>> 16;
  39369. c = h & 0xffff; d = h >>> 16;
  39370. h = hh[7];
  39371. l = hl[7];
  39372. a += l & 0xffff; b += l >>> 16;
  39373. c += h & 0xffff; d += h >>> 16;
  39374. b += a >>> 16;
  39375. c += b >>> 16;
  39376. d += c >>> 16;
  39377. hh[7] = ah7 = (c & 0xffff) | (d << 16);
  39378. hl[7] = al7 = (a & 0xffff) | (b << 16);
  39379. pos += 128;
  39380. n -= 128;
  39381. }
  39382. return n;
  39383. }
  39384. function crypto_hash(out, m, n) {
  39385. var hh = new Int32Array(8),
  39386. hl = new Int32Array(8),
  39387. x = new Uint8Array(256),
  39388. i, b = n;
  39389. hh[0] = 0x6a09e667;
  39390. hh[1] = 0xbb67ae85;
  39391. hh[2] = 0x3c6ef372;
  39392. hh[3] = 0xa54ff53a;
  39393. hh[4] = 0x510e527f;
  39394. hh[5] = 0x9b05688c;
  39395. hh[6] = 0x1f83d9ab;
  39396. hh[7] = 0x5be0cd19;
  39397. hl[0] = 0xf3bcc908;
  39398. hl[1] = 0x84caa73b;
  39399. hl[2] = 0xfe94f82b;
  39400. hl[3] = 0x5f1d36f1;
  39401. hl[4] = 0xade682d1;
  39402. hl[5] = 0x2b3e6c1f;
  39403. hl[6] = 0xfb41bd6b;
  39404. hl[7] = 0x137e2179;
  39405. crypto_hashblocks_hl(hh, hl, m, n);
  39406. n %= 128;
  39407. for (i = 0; i < n; i++) x[i] = m[b-n+i];
  39408. x[n] = 128;
  39409. n = 256-128*(n<112?1:0);
  39410. x[n-9] = 0;
  39411. ts64(x, n-8, (b / 0x20000000) | 0, b << 3);
  39412. crypto_hashblocks_hl(hh, hl, x, n);
  39413. for (i = 0; i < 8; i++) ts64(out, 8*i, hh[i], hl[i]);
  39414. return 0;
  39415. }
  39416. function add(p, q) {
  39417. var a = gf(), b = gf(), c = gf(),
  39418. d = gf(), e = gf(), f = gf(),
  39419. g = gf(), h = gf(), t = gf();
  39420. Z(a, p[1], p[0]);
  39421. Z(t, q[1], q[0]);
  39422. M(a, a, t);
  39423. A(b, p[0], p[1]);
  39424. A(t, q[0], q[1]);
  39425. M(b, b, t);
  39426. M(c, p[3], q[3]);
  39427. M(c, c, D2);
  39428. M(d, p[2], q[2]);
  39429. A(d, d, d);
  39430. Z(e, b, a);
  39431. Z(f, d, c);
  39432. A(g, d, c);
  39433. A(h, b, a);
  39434. M(p[0], e, f);
  39435. M(p[1], h, g);
  39436. M(p[2], g, f);
  39437. M(p[3], e, h);
  39438. }
  39439. function cswap(p, q, b) {
  39440. var i;
  39441. for (i = 0; i < 4; i++) {
  39442. sel25519(p[i], q[i], b);
  39443. }
  39444. }
  39445. function pack(r, p) {
  39446. var tx = gf(), ty = gf(), zi = gf();
  39447. inv25519(zi, p[2]);
  39448. M(tx, p[0], zi);
  39449. M(ty, p[1], zi);
  39450. pack25519(r, ty);
  39451. r[31] ^= par25519(tx) << 7;
  39452. }
  39453. function scalarmult(p, q, s) {
  39454. var b, i;
  39455. set25519(p[0], gf0);
  39456. set25519(p[1], gf1);
  39457. set25519(p[2], gf1);
  39458. set25519(p[3], gf0);
  39459. for (i = 255; i >= 0; --i) {
  39460. b = (s[(i/8)|0] >> (i&7)) & 1;
  39461. cswap(p, q, b);
  39462. add(q, p);
  39463. add(p, p);
  39464. cswap(p, q, b);
  39465. }
  39466. }
  39467. function scalarbase(p, s) {
  39468. var q = [gf(), gf(), gf(), gf()];
  39469. set25519(q[0], X);
  39470. set25519(q[1], Y);
  39471. set25519(q[2], gf1);
  39472. M(q[3], X, Y);
  39473. scalarmult(p, q, s);
  39474. }
  39475. function crypto_sign_keypair(pk, sk, seeded) {
  39476. var d = new Uint8Array(64);
  39477. var p = [gf(), gf(), gf(), gf()];
  39478. var i;
  39479. if (!seeded) randombytes(sk, 32);
  39480. crypto_hash(d, sk, 32);
  39481. d[0] &= 248;
  39482. d[31] &= 127;
  39483. d[31] |= 64;
  39484. scalarbase(p, d);
  39485. pack(pk, p);
  39486. for (i = 0; i < 32; i++) sk[i+32] = pk[i];
  39487. return 0;
  39488. }
  39489. var L = new Float64Array([0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x10]);
  39490. function modL(r, x) {
  39491. var carry, i, j, k;
  39492. for (i = 63; i >= 32; --i) {
  39493. carry = 0;
  39494. for (j = i - 32, k = i - 12; j < k; ++j) {
  39495. x[j] += carry - 16 * x[i] * L[j - (i - 32)];
  39496. carry = (x[j] + 128) >> 8;
  39497. x[j] -= carry * 256;
  39498. }
  39499. x[j] += carry;
  39500. x[i] = 0;
  39501. }
  39502. carry = 0;
  39503. for (j = 0; j < 32; j++) {
  39504. x[j] += carry - (x[31] >> 4) * L[j];
  39505. carry = x[j] >> 8;
  39506. x[j] &= 255;
  39507. }
  39508. for (j = 0; j < 32; j++) x[j] -= carry * L[j];
  39509. for (i = 0; i < 32; i++) {
  39510. x[i+1] += x[i] >> 8;
  39511. r[i] = x[i] & 255;
  39512. }
  39513. }
  39514. function reduce(r) {
  39515. var x = new Float64Array(64), i;
  39516. for (i = 0; i < 64; i++) x[i] = r[i];
  39517. for (i = 0; i < 64; i++) r[i] = 0;
  39518. modL(r, x);
  39519. }
  39520. // Note: difference from C - smlen returned, not passed as argument.
  39521. function crypto_sign(sm, m, n, sk) {
  39522. var d = new Uint8Array(64), h = new Uint8Array(64), r = new Uint8Array(64);
  39523. var i, j, x = new Float64Array(64);
  39524. var p = [gf(), gf(), gf(), gf()];
  39525. crypto_hash(d, sk, 32);
  39526. d[0] &= 248;
  39527. d[31] &= 127;
  39528. d[31] |= 64;
  39529. var smlen = n + 64;
  39530. for (i = 0; i < n; i++) sm[64 + i] = m[i];
  39531. for (i = 0; i < 32; i++) sm[32 + i] = d[32 + i];
  39532. crypto_hash(r, sm.subarray(32), n+32);
  39533. reduce(r);
  39534. scalarbase(p, r);
  39535. pack(sm, p);
  39536. for (i = 32; i < 64; i++) sm[i] = sk[i];
  39537. crypto_hash(h, sm, n + 64);
  39538. reduce(h);
  39539. for (i = 0; i < 64; i++) x[i] = 0;
  39540. for (i = 0; i < 32; i++) x[i] = r[i];
  39541. for (i = 0; i < 32; i++) {
  39542. for (j = 0; j < 32; j++) {
  39543. x[i+j] += h[i] * d[j];
  39544. }
  39545. }
  39546. modL(sm.subarray(32), x);
  39547. return smlen;
  39548. }
  39549. function unpackneg(r, p) {
  39550. var t = gf(), chk = gf(), num = gf(),
  39551. den = gf(), den2 = gf(), den4 = gf(),
  39552. den6 = gf();
  39553. set25519(r[2], gf1);
  39554. unpack25519(r[1], p);
  39555. S(num, r[1]);
  39556. M(den, num, D);
  39557. Z(num, num, r[2]);
  39558. A(den, r[2], den);
  39559. S(den2, den);
  39560. S(den4, den2);
  39561. M(den6, den4, den2);
  39562. M(t, den6, num);
  39563. M(t, t, den);
  39564. pow2523(t, t);
  39565. M(t, t, num);
  39566. M(t, t, den);
  39567. M(t, t, den);
  39568. M(r[0], t, den);
  39569. S(chk, r[0]);
  39570. M(chk, chk, den);
  39571. if (neq25519(chk, num)) M(r[0], r[0], I);
  39572. S(chk, r[0]);
  39573. M(chk, chk, den);
  39574. if (neq25519(chk, num)) return -1;
  39575. if (par25519(r[0]) === (p[31]>>7)) Z(r[0], gf0, r[0]);
  39576. M(r[3], r[0], r[1]);
  39577. return 0;
  39578. }
  39579. function crypto_sign_open(m, sm, n, pk) {
  39580. var i, mlen;
  39581. var t = new Uint8Array(32), h = new Uint8Array(64);
  39582. var p = [gf(), gf(), gf(), gf()],
  39583. q = [gf(), gf(), gf(), gf()];
  39584. mlen = -1;
  39585. if (n < 64) return -1;
  39586. if (unpackneg(q, pk)) return -1;
  39587. for (i = 0; i < n; i++) m[i] = sm[i];
  39588. for (i = 0; i < 32; i++) m[i+32] = pk[i];
  39589. crypto_hash(h, m, n);
  39590. reduce(h);
  39591. scalarmult(p, q, h);
  39592. scalarbase(q, sm.subarray(32));
  39593. add(p, q);
  39594. pack(t, p);
  39595. n -= 64;
  39596. if (crypto_verify_32(sm, 0, t, 0)) {
  39597. for (i = 0; i < n; i++) m[i] = 0;
  39598. return -1;
  39599. }
  39600. for (i = 0; i < n; i++) m[i] = sm[i + 64];
  39601. mlen = n;
  39602. return mlen;
  39603. }
  39604. var crypto_secretbox_KEYBYTES = 32,
  39605. crypto_secretbox_NONCEBYTES = 24,
  39606. crypto_secretbox_ZEROBYTES = 32,
  39607. crypto_secretbox_BOXZEROBYTES = 16,
  39608. crypto_scalarmult_BYTES = 32,
  39609. crypto_scalarmult_SCALARBYTES = 32,
  39610. crypto_box_PUBLICKEYBYTES = 32,
  39611. crypto_box_SECRETKEYBYTES = 32,
  39612. crypto_box_BEFORENMBYTES = 32,
  39613. crypto_box_NONCEBYTES = crypto_secretbox_NONCEBYTES,
  39614. crypto_box_ZEROBYTES = crypto_secretbox_ZEROBYTES,
  39615. crypto_box_BOXZEROBYTES = crypto_secretbox_BOXZEROBYTES,
  39616. crypto_sign_BYTES = 64,
  39617. crypto_sign_PUBLICKEYBYTES = 32,
  39618. crypto_sign_SECRETKEYBYTES = 64,
  39619. crypto_sign_SEEDBYTES = 32,
  39620. crypto_hash_BYTES = 64;
  39621. nacl.lowlevel = {
  39622. crypto_core_hsalsa20: crypto_core_hsalsa20,
  39623. crypto_stream_xor: crypto_stream_xor,
  39624. crypto_stream: crypto_stream,
  39625. crypto_stream_salsa20_xor: crypto_stream_salsa20_xor,
  39626. crypto_stream_salsa20: crypto_stream_salsa20,
  39627. crypto_onetimeauth: crypto_onetimeauth,
  39628. crypto_onetimeauth_verify: crypto_onetimeauth_verify,
  39629. crypto_verify_16: crypto_verify_16,
  39630. crypto_verify_32: crypto_verify_32,
  39631. crypto_secretbox: crypto_secretbox,
  39632. crypto_secretbox_open: crypto_secretbox_open,
  39633. crypto_scalarmult: crypto_scalarmult,
  39634. crypto_scalarmult_base: crypto_scalarmult_base,
  39635. crypto_box_beforenm: crypto_box_beforenm,
  39636. crypto_box_afternm: crypto_box_afternm,
  39637. crypto_box: crypto_box,
  39638. crypto_box_open: crypto_box_open,
  39639. crypto_box_keypair: crypto_box_keypair,
  39640. crypto_hash: crypto_hash,
  39641. crypto_sign: crypto_sign,
  39642. crypto_sign_keypair: crypto_sign_keypair,
  39643. crypto_sign_open: crypto_sign_open,
  39644. crypto_secretbox_KEYBYTES: crypto_secretbox_KEYBYTES,
  39645. crypto_secretbox_NONCEBYTES: crypto_secretbox_NONCEBYTES,
  39646. crypto_secretbox_ZEROBYTES: crypto_secretbox_ZEROBYTES,
  39647. crypto_secretbox_BOXZEROBYTES: crypto_secretbox_BOXZEROBYTES,
  39648. crypto_scalarmult_BYTES: crypto_scalarmult_BYTES,
  39649. crypto_scalarmult_SCALARBYTES: crypto_scalarmult_SCALARBYTES,
  39650. crypto_box_PUBLICKEYBYTES: crypto_box_PUBLICKEYBYTES,
  39651. crypto_box_SECRETKEYBYTES: crypto_box_SECRETKEYBYTES,
  39652. crypto_box_BEFORENMBYTES: crypto_box_BEFORENMBYTES,
  39653. crypto_box_NONCEBYTES: crypto_box_NONCEBYTES,
  39654. crypto_box_ZEROBYTES: crypto_box_ZEROBYTES,
  39655. crypto_box_BOXZEROBYTES: crypto_box_BOXZEROBYTES,
  39656. crypto_sign_BYTES: crypto_sign_BYTES,
  39657. crypto_sign_PUBLICKEYBYTES: crypto_sign_PUBLICKEYBYTES,
  39658. crypto_sign_SECRETKEYBYTES: crypto_sign_SECRETKEYBYTES,
  39659. crypto_sign_SEEDBYTES: crypto_sign_SEEDBYTES,
  39660. crypto_hash_BYTES: crypto_hash_BYTES
  39661. };
  39662. /* High-level API */
  39663. function checkLengths(k, n) {
  39664. if (k.length !== crypto_secretbox_KEYBYTES) throw new Error('bad key size');
  39665. if (n.length !== crypto_secretbox_NONCEBYTES) throw new Error('bad nonce size');
  39666. }
  39667. function checkBoxLengths(pk, sk) {
  39668. if (pk.length !== crypto_box_PUBLICKEYBYTES) throw new Error('bad public key size');
  39669. if (sk.length !== crypto_box_SECRETKEYBYTES) throw new Error('bad secret key size');
  39670. }
  39671. function checkArrayTypes() {
  39672. for (var i = 0; i < arguments.length; i++) {
  39673. if (!(arguments[i] instanceof Uint8Array))
  39674. throw new TypeError('unexpected type, use Uint8Array');
  39675. }
  39676. }
  39677. function cleanup(arr) {
  39678. for (var i = 0; i < arr.length; i++) arr[i] = 0;
  39679. }
  39680. nacl.randomBytes = function(n) {
  39681. var b = new Uint8Array(n);
  39682. randombytes(b, n);
  39683. return b;
  39684. };
  39685. nacl.secretbox = function(msg, nonce, key) {
  39686. checkArrayTypes(msg, nonce, key);
  39687. checkLengths(key, nonce);
  39688. var m = new Uint8Array(crypto_secretbox_ZEROBYTES + msg.length);
  39689. var c = new Uint8Array(m.length);
  39690. for (var i = 0; i < msg.length; i++) m[i+crypto_secretbox_ZEROBYTES] = msg[i];
  39691. crypto_secretbox(c, m, m.length, nonce, key);
  39692. return c.subarray(crypto_secretbox_BOXZEROBYTES);
  39693. };
  39694. nacl.secretbox.open = function(box, nonce, key) {
  39695. checkArrayTypes(box, nonce, key);
  39696. checkLengths(key, nonce);
  39697. var c = new Uint8Array(crypto_secretbox_BOXZEROBYTES + box.length);
  39698. var m = new Uint8Array(c.length);
  39699. for (var i = 0; i < box.length; i++) c[i+crypto_secretbox_BOXZEROBYTES] = box[i];
  39700. if (c.length < 32) return null;
  39701. if (crypto_secretbox_open(m, c, c.length, nonce, key) !== 0) return null;
  39702. return m.subarray(crypto_secretbox_ZEROBYTES);
  39703. };
  39704. nacl.secretbox.keyLength = crypto_secretbox_KEYBYTES;
  39705. nacl.secretbox.nonceLength = crypto_secretbox_NONCEBYTES;
  39706. nacl.secretbox.overheadLength = crypto_secretbox_BOXZEROBYTES;
  39707. nacl.scalarMult = function(n, p) {
  39708. checkArrayTypes(n, p);
  39709. if (n.length !== crypto_scalarmult_SCALARBYTES) throw new Error('bad n size');
  39710. if (p.length !== crypto_scalarmult_BYTES) throw new Error('bad p size');
  39711. var q = new Uint8Array(crypto_scalarmult_BYTES);
  39712. crypto_scalarmult(q, n, p);
  39713. return q;
  39714. };
  39715. nacl.scalarMult.base = function(n) {
  39716. checkArrayTypes(n);
  39717. if (n.length !== crypto_scalarmult_SCALARBYTES) throw new Error('bad n size');
  39718. var q = new Uint8Array(crypto_scalarmult_BYTES);
  39719. crypto_scalarmult_base(q, n);
  39720. return q;
  39721. };
  39722. nacl.scalarMult.scalarLength = crypto_scalarmult_SCALARBYTES;
  39723. nacl.scalarMult.groupElementLength = crypto_scalarmult_BYTES;
  39724. nacl.box = function(msg, nonce, publicKey, secretKey) {
  39725. var k = nacl.box.before(publicKey, secretKey);
  39726. return nacl.secretbox(msg, nonce, k);
  39727. };
  39728. nacl.box.before = function(publicKey, secretKey) {
  39729. checkArrayTypes(publicKey, secretKey);
  39730. checkBoxLengths(publicKey, secretKey);
  39731. var k = new Uint8Array(crypto_box_BEFORENMBYTES);
  39732. crypto_box_beforenm(k, publicKey, secretKey);
  39733. return k;
  39734. };
  39735. nacl.box.after = nacl.secretbox;
  39736. nacl.box.open = function(msg, nonce, publicKey, secretKey) {
  39737. var k = nacl.box.before(publicKey, secretKey);
  39738. return nacl.secretbox.open(msg, nonce, k);
  39739. };
  39740. nacl.box.open.after = nacl.secretbox.open;
  39741. nacl.box.keyPair = function() {
  39742. var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES);
  39743. var sk = new Uint8Array(crypto_box_SECRETKEYBYTES);
  39744. crypto_box_keypair(pk, sk);
  39745. return {publicKey: pk, secretKey: sk};
  39746. };
  39747. nacl.box.keyPair.fromSecretKey = function(secretKey) {
  39748. checkArrayTypes(secretKey);
  39749. if (secretKey.length !== crypto_box_SECRETKEYBYTES)
  39750. throw new Error('bad secret key size');
  39751. var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES);
  39752. crypto_scalarmult_base(pk, secretKey);
  39753. return {publicKey: pk, secretKey: new Uint8Array(secretKey)};
  39754. };
  39755. nacl.box.publicKeyLength = crypto_box_PUBLICKEYBYTES;
  39756. nacl.box.secretKeyLength = crypto_box_SECRETKEYBYTES;
  39757. nacl.box.sharedKeyLength = crypto_box_BEFORENMBYTES;
  39758. nacl.box.nonceLength = crypto_box_NONCEBYTES;
  39759. nacl.box.overheadLength = nacl.secretbox.overheadLength;
  39760. nacl.sign = function(msg, secretKey) {
  39761. checkArrayTypes(msg, secretKey);
  39762. if (secretKey.length !== crypto_sign_SECRETKEYBYTES)
  39763. throw new Error('bad secret key size');
  39764. var signedMsg = new Uint8Array(crypto_sign_BYTES+msg.length);
  39765. crypto_sign(signedMsg, msg, msg.length, secretKey);
  39766. return signedMsg;
  39767. };
  39768. nacl.sign.open = function(signedMsg, publicKey) {
  39769. checkArrayTypes(signedMsg, publicKey);
  39770. if (publicKey.length !== crypto_sign_PUBLICKEYBYTES)
  39771. throw new Error('bad public key size');
  39772. var tmp = new Uint8Array(signedMsg.length);
  39773. var mlen = crypto_sign_open(tmp, signedMsg, signedMsg.length, publicKey);
  39774. if (mlen < 0) return null;
  39775. var m = new Uint8Array(mlen);
  39776. for (var i = 0; i < m.length; i++) m[i] = tmp[i];
  39777. return m;
  39778. };
  39779. nacl.sign.detached = function(msg, secretKey) {
  39780. var signedMsg = nacl.sign(msg, secretKey);
  39781. var sig = new Uint8Array(crypto_sign_BYTES);
  39782. for (var i = 0; i < sig.length; i++) sig[i] = signedMsg[i];
  39783. return sig;
  39784. };
  39785. nacl.sign.detached.verify = function(msg, sig, publicKey) {
  39786. checkArrayTypes(msg, sig, publicKey);
  39787. if (sig.length !== crypto_sign_BYTES)
  39788. throw new Error('bad signature size');
  39789. if (publicKey.length !== crypto_sign_PUBLICKEYBYTES)
  39790. throw new Error('bad public key size');
  39791. var sm = new Uint8Array(crypto_sign_BYTES + msg.length);
  39792. var m = new Uint8Array(crypto_sign_BYTES + msg.length);
  39793. var i;
  39794. for (i = 0; i < crypto_sign_BYTES; i++) sm[i] = sig[i];
  39795. for (i = 0; i < msg.length; i++) sm[i+crypto_sign_BYTES] = msg[i];
  39796. return (crypto_sign_open(m, sm, sm.length, publicKey) >= 0);
  39797. };
  39798. nacl.sign.keyPair = function() {
  39799. var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);
  39800. var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES);
  39801. crypto_sign_keypair(pk, sk);
  39802. return {publicKey: pk, secretKey: sk};
  39803. };
  39804. nacl.sign.keyPair.fromSecretKey = function(secretKey) {
  39805. checkArrayTypes(secretKey);
  39806. if (secretKey.length !== crypto_sign_SECRETKEYBYTES)
  39807. throw new Error('bad secret key size');
  39808. var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);
  39809. for (var i = 0; i < pk.length; i++) pk[i] = secretKey[32+i];
  39810. return {publicKey: pk, secretKey: new Uint8Array(secretKey)};
  39811. };
  39812. nacl.sign.keyPair.fromSeed = function(seed) {
  39813. checkArrayTypes(seed);
  39814. if (seed.length !== crypto_sign_SEEDBYTES)
  39815. throw new Error('bad seed size');
  39816. var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);
  39817. var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES);
  39818. for (var i = 0; i < 32; i++) sk[i] = seed[i];
  39819. crypto_sign_keypair(pk, sk, true);
  39820. return {publicKey: pk, secretKey: sk};
  39821. };
  39822. nacl.sign.publicKeyLength = crypto_sign_PUBLICKEYBYTES;
  39823. nacl.sign.secretKeyLength = crypto_sign_SECRETKEYBYTES;
  39824. nacl.sign.seedLength = crypto_sign_SEEDBYTES;
  39825. nacl.sign.signatureLength = crypto_sign_BYTES;
  39826. nacl.hash = function(msg) {
  39827. checkArrayTypes(msg);
  39828. var h = new Uint8Array(crypto_hash_BYTES);
  39829. crypto_hash(h, msg, msg.length);
  39830. return h;
  39831. };
  39832. nacl.hash.hashLength = crypto_hash_BYTES;
  39833. nacl.verify = function(x, y) {
  39834. checkArrayTypes(x, y);
  39835. // Zero length arguments are considered not equal.
  39836. if (x.length === 0 || y.length === 0) return false;
  39837. if (x.length !== y.length) return false;
  39838. return (vn(x, 0, y, 0, x.length) === 0) ? true : false;
  39839. };
  39840. nacl.setPRNG = function(fn) {
  39841. randombytes = fn;
  39842. };
  39843. (function() {
  39844. // Initialize PRNG if environment provides CSPRNG.
  39845. // If not, methods calling randombytes will throw.
  39846. var crypto = typeof self !== 'undefined' ? (self.crypto || self.msCrypto) : null;
  39847. if (crypto && crypto.getRandomValues) {
  39848. // Browsers.
  39849. var QUOTA = 65536;
  39850. nacl.setPRNG(function(x, n) {
  39851. var i, v = new Uint8Array(n);
  39852. for (i = 0; i < n; i += QUOTA) {
  39853. crypto.getRandomValues(v.subarray(i, i + Math.min(n - i, QUOTA)));
  39854. }
  39855. for (i = 0; i < n; i++) x[i] = v[i];
  39856. cleanup(v);
  39857. });
  39858. } else if (true) {
  39859. // Node.js.
  39860. crypto = __webpack_require__(3);
  39861. if (crypto && crypto.randomBytes) {
  39862. nacl.setPRNG(function(x, n) {
  39863. var i, v = crypto.randomBytes(n);
  39864. for (i = 0; i < n; i++) x[i] = v[i];
  39865. cleanup(v);
  39866. });
  39867. }
  39868. }
  39869. })();
  39870. })( true && module.exports ? module.exports : (self.nacl = self.nacl || {}));
  39871. /***/ }),
  39872. /* 1 */
  39873. /***/ (function(module, exports, __webpack_require__) {
  39874. // Written in 2014-2016 by Dmitry Chestnykh and Devi Mandiri.
  39875. // Public domain.
  39876. (function(root, f) {
  39877. 'use strict';
  39878. if ( true && module.exports) module.exports = f();
  39879. else if (root.nacl) root.nacl.util = f();
  39880. else {
  39881. root.nacl = {};
  39882. root.nacl.util = f();
  39883. }
  39884. }(this, function() {
  39885. 'use strict';
  39886. var util = {};
  39887. function validateBase64(s) {
  39888. if (!(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(s))) {
  39889. throw new TypeError('invalid encoding');
  39890. }
  39891. }
  39892. util.decodeUTF8 = function(s) {
  39893. if (typeof s !== 'string') throw new TypeError('expected string');
  39894. var i, d = unescape(encodeURIComponent(s)), b = new Uint8Array(d.length);
  39895. for (i = 0; i < d.length; i++) b[i] = d.charCodeAt(i);
  39896. return b;
  39897. };
  39898. util.encodeUTF8 = function(arr) {
  39899. var i, s = [];
  39900. for (i = 0; i < arr.length; i++) s.push(String.fromCharCode(arr[i]));
  39901. return decodeURIComponent(escape(s.join('')));
  39902. };
  39903. if (typeof atob === 'undefined') {
  39904. // Node.js
  39905. if (typeof Buffer.from !== 'undefined') {
  39906. // Node v6 and later
  39907. util.encodeBase64 = function (arr) { // v6 and later
  39908. return Buffer.from(arr).toString('base64');
  39909. };
  39910. util.decodeBase64 = function (s) {
  39911. validateBase64(s);
  39912. return new Uint8Array(Array.prototype.slice.call(Buffer.from(s, 'base64'), 0));
  39913. };
  39914. } else {
  39915. // Node earlier than v6
  39916. util.encodeBase64 = function (arr) { // v6 and later
  39917. return (new Buffer(arr)).toString('base64');
  39918. };
  39919. util.decodeBase64 = function(s) {
  39920. validateBase64(s);
  39921. return new Uint8Array(Array.prototype.slice.call(new Buffer(s, 'base64'), 0));
  39922. };
  39923. }
  39924. } else {
  39925. // Browsers
  39926. util.encodeBase64 = function(arr) {
  39927. var i, s = [], len = arr.length;
  39928. for (i = 0; i < len; i++) s.push(String.fromCharCode(arr[i]));
  39929. return btoa(s.join(''));
  39930. };
  39931. util.decodeBase64 = function(s) {
  39932. validateBase64(s);
  39933. var i, d = atob(s), b = new Uint8Array(d.length);
  39934. for (i = 0; i < d.length; i++) b[i] = d.charCodeAt(i);
  39935. return b;
  39936. };
  39937. }
  39938. return util;
  39939. }));
  39940. /***/ }),
  39941. /* 2 */
  39942. /***/ (function(module, exports, __webpack_require__) {
  39943. // required so we don't have to do require('pusher').default etc.
  39944. module.exports = __webpack_require__(4).default;
  39945. /***/ }),
  39946. /* 3 */
  39947. /***/ (function(module, exports) {
  39948. /* (ignored) */
  39949. /***/ }),
  39950. /* 4 */
  39951. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39952. "use strict";
  39953. __webpack_require__.r(__webpack_exports__);
  39954. // CONCATENATED MODULE: ./src/runtimes/web/dom/script_receiver_factory.ts
  39955. var ScriptReceiverFactory = (function () {
  39956. function ScriptReceiverFactory(prefix, name) {
  39957. this.lastId = 0;
  39958. this.prefix = prefix;
  39959. this.name = name;
  39960. }
  39961. ScriptReceiverFactory.prototype.create = function (callback) {
  39962. this.lastId++;
  39963. var number = this.lastId;
  39964. var id = this.prefix + number;
  39965. var name = this.name + "[" + number + "]";
  39966. var called = false;
  39967. var callbackWrapper = function () {
  39968. if (!called) {
  39969. callback.apply(null, arguments);
  39970. called = true;
  39971. }
  39972. };
  39973. this[number] = callbackWrapper;
  39974. return { number: number, id: id, name: name, callback: callbackWrapper };
  39975. };
  39976. ScriptReceiverFactory.prototype.remove = function (receiver) {
  39977. delete this[receiver.number];
  39978. };
  39979. return ScriptReceiverFactory;
  39980. }());
  39981. var ScriptReceivers = new ScriptReceiverFactory("_pusher_script_", "Pusher.ScriptReceivers");
  39982. // CONCATENATED MODULE: ./src/core/defaults.ts
  39983. var Defaults = {
  39984. VERSION: "5.0.3",
  39985. PROTOCOL: 7,
  39986. host: 'ws.pusherapp.com',
  39987. ws_port: 80,
  39988. wss_port: 443,
  39989. ws_path: '',
  39990. sockjs_host: 'sockjs.pusher.com',
  39991. sockjs_http_port: 80,
  39992. sockjs_https_port: 443,
  39993. sockjs_path: '/pusher',
  39994. stats_host: 'stats.pusher.com',
  39995. channel_auth_endpoint: '/pusher/auth',
  39996. channel_auth_transport: 'ajax',
  39997. activity_timeout: 120000,
  39998. pong_timeout: 30000,
  39999. unavailable_timeout: 10000,
  40000. cdn_http: "http://js.pusher.com",
  40001. cdn_https: "https://js.pusher.com",
  40002. dependency_suffix: ""
  40003. };
  40004. /* harmony default export */ var defaults = (Defaults);
  40005. // CONCATENATED MODULE: ./src/runtimes/web/dom/dependency_loader.ts
  40006. var dependency_loader_DependencyLoader = (function () {
  40007. function DependencyLoader(options) {
  40008. this.options = options;
  40009. this.receivers = options.receivers || ScriptReceivers;
  40010. this.loading = {};
  40011. }
  40012. DependencyLoader.prototype.load = function (name, options, callback) {
  40013. var self = this;
  40014. if (self.loading[name] && self.loading[name].length > 0) {
  40015. self.loading[name].push(callback);
  40016. }
  40017. else {
  40018. self.loading[name] = [callback];
  40019. var request = runtime.createScriptRequest(self.getPath(name, options));
  40020. var receiver = self.receivers.create(function (error) {
  40021. self.receivers.remove(receiver);
  40022. if (self.loading[name]) {
  40023. var callbacks = self.loading[name];
  40024. delete self.loading[name];
  40025. var successCallback = function (wasSuccessful) {
  40026. if (!wasSuccessful) {
  40027. request.cleanup();
  40028. }
  40029. };
  40030. for (var i = 0; i < callbacks.length; i++) {
  40031. callbacks[i](error, successCallback);
  40032. }
  40033. }
  40034. });
  40035. request.send(receiver);
  40036. }
  40037. };
  40038. DependencyLoader.prototype.getRoot = function (options) {
  40039. var cdn;
  40040. var protocol = runtime.getDocument().location.protocol;
  40041. if ((options && options.useTLS) || protocol === "https:") {
  40042. cdn = this.options.cdn_https;
  40043. }
  40044. else {
  40045. cdn = this.options.cdn_http;
  40046. }
  40047. return cdn.replace(/\/*$/, "") + "/" + this.options.version;
  40048. };
  40049. DependencyLoader.prototype.getPath = function (name, options) {
  40050. return this.getRoot(options) + '/' + name + this.options.suffix + '.js';
  40051. };
  40052. ;
  40053. return DependencyLoader;
  40054. }());
  40055. /* harmony default export */ var dependency_loader = (dependency_loader_DependencyLoader);
  40056. // CONCATENATED MODULE: ./src/runtimes/web/dom/dependencies.ts
  40057. var DependenciesReceivers = new ScriptReceiverFactory("_pusher_dependencies", "Pusher.DependenciesReceivers");
  40058. var Dependencies = new dependency_loader({
  40059. cdn_http: defaults.cdn_http,
  40060. cdn_https: defaults.cdn_https,
  40061. version: defaults.VERSION,
  40062. suffix: defaults.dependency_suffix,
  40063. receivers: DependenciesReceivers
  40064. });
  40065. // CONCATENATED MODULE: ./src/core/base64.ts
  40066. function encode(s) {
  40067. return btoa(utob(s));
  40068. }
  40069. var fromCharCode = String.fromCharCode;
  40070. var b64chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
  40071. var b64tab = {};
  40072. for (var base64_i = 0, l = b64chars.length; base64_i < l; base64_i++) {
  40073. b64tab[b64chars.charAt(base64_i)] = base64_i;
  40074. }
  40075. var cb_utob = function (c) {
  40076. var cc = c.charCodeAt(0);
  40077. return cc < 0x80
  40078. ? c
  40079. : cc < 0x800
  40080. ? fromCharCode(0xc0 | (cc >>> 6)) + fromCharCode(0x80 | (cc & 0x3f))
  40081. : fromCharCode(0xe0 | ((cc >>> 12) & 0x0f)) +
  40082. fromCharCode(0x80 | ((cc >>> 6) & 0x3f)) +
  40083. fromCharCode(0x80 | (cc & 0x3f));
  40084. };
  40085. var utob = function (u) {
  40086. return u.replace(/[^\x00-\x7F]/g, cb_utob);
  40087. };
  40088. var cb_encode = function (ccc) {
  40089. var padlen = [0, 2, 1][ccc.length % 3];
  40090. var ord = (ccc.charCodeAt(0) << 16) |
  40091. ((ccc.length > 1 ? ccc.charCodeAt(1) : 0) << 8) |
  40092. (ccc.length > 2 ? ccc.charCodeAt(2) : 0);
  40093. var chars = [
  40094. b64chars.charAt(ord >>> 18),
  40095. b64chars.charAt((ord >>> 12) & 63),
  40096. padlen >= 2 ? '=' : b64chars.charAt((ord >>> 6) & 63),
  40097. padlen >= 1 ? '=' : b64chars.charAt(ord & 63)
  40098. ];
  40099. return chars.join('');
  40100. };
  40101. var btoa = window.btoa ||
  40102. function (b) {
  40103. return b.replace(/[\s\S]{1,3}/g, cb_encode);
  40104. };
  40105. // CONCATENATED MODULE: ./src/core/utils/timers/abstract_timer.ts
  40106. var Timer = (function () {
  40107. function Timer(set, clear, delay, callback) {
  40108. var _this = this;
  40109. this.clear = clear;
  40110. this.timer = set(function () {
  40111. if (_this.timer) {
  40112. _this.timer = callback(_this.timer);
  40113. }
  40114. }, delay);
  40115. }
  40116. Timer.prototype.isRunning = function () {
  40117. return this.timer !== null;
  40118. };
  40119. Timer.prototype.ensureAborted = function () {
  40120. if (this.timer) {
  40121. this.clear(this.timer);
  40122. this.timer = null;
  40123. }
  40124. };
  40125. return Timer;
  40126. }());
  40127. /* harmony default export */ var abstract_timer = (Timer);
  40128. // CONCATENATED MODULE: ./src/core/utils/timers/index.ts
  40129. var __extends = (undefined && undefined.__extends) || (function () {
  40130. var extendStatics = function (d, b) {
  40131. extendStatics = Object.setPrototypeOf ||
  40132. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  40133. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  40134. return extendStatics(d, b);
  40135. };
  40136. return function (d, b) {
  40137. extendStatics(d, b);
  40138. function __() { this.constructor = d; }
  40139. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  40140. };
  40141. })();
  40142. function timers_clearTimeout(timer) {
  40143. window.clearTimeout(timer);
  40144. }
  40145. function timers_clearInterval(timer) {
  40146. window.clearInterval(timer);
  40147. }
  40148. var OneOffTimer = (function (_super) {
  40149. __extends(OneOffTimer, _super);
  40150. function OneOffTimer(delay, callback) {
  40151. return _super.call(this, setTimeout, timers_clearTimeout, delay, function (timer) {
  40152. callback();
  40153. return null;
  40154. }) || this;
  40155. }
  40156. return OneOffTimer;
  40157. }(abstract_timer));
  40158. var PeriodicTimer = (function (_super) {
  40159. __extends(PeriodicTimer, _super);
  40160. function PeriodicTimer(delay, callback) {
  40161. return _super.call(this, setInterval, timers_clearInterval, delay, function (timer) {
  40162. callback();
  40163. return timer;
  40164. }) || this;
  40165. }
  40166. return PeriodicTimer;
  40167. }(abstract_timer));
  40168. // CONCATENATED MODULE: ./src/core/util.ts
  40169. var Util = {
  40170. now: function () {
  40171. if (Date.now) {
  40172. return Date.now();
  40173. }
  40174. else {
  40175. return new Date().valueOf();
  40176. }
  40177. },
  40178. defer: function (callback) {
  40179. return new OneOffTimer(0, callback);
  40180. },
  40181. method: function (name) {
  40182. var args = [];
  40183. for (var _i = 1; _i < arguments.length; _i++) {
  40184. args[_i - 1] = arguments[_i];
  40185. }
  40186. var boundArguments = Array.prototype.slice.call(arguments, 1);
  40187. return function (object) {
  40188. return object[name].apply(object, boundArguments.concat(arguments));
  40189. };
  40190. }
  40191. };
  40192. /* harmony default export */ var util = (Util);
  40193. // CONCATENATED MODULE: ./src/core/utils/collections.ts
  40194. function extend(target) {
  40195. var sources = [];
  40196. for (var _i = 1; _i < arguments.length; _i++) {
  40197. sources[_i - 1] = arguments[_i];
  40198. }
  40199. for (var i = 0; i < sources.length; i++) {
  40200. var extensions = sources[i];
  40201. for (var property in extensions) {
  40202. if (extensions[property] && extensions[property].constructor &&
  40203. extensions[property].constructor === Object) {
  40204. target[property] = extend(target[property] || {}, extensions[property]);
  40205. }
  40206. else {
  40207. target[property] = extensions[property];
  40208. }
  40209. }
  40210. }
  40211. return target;
  40212. }
  40213. function stringify() {
  40214. var m = ["Pusher"];
  40215. for (var i = 0; i < arguments.length; i++) {
  40216. if (typeof arguments[i] === "string") {
  40217. m.push(arguments[i]);
  40218. }
  40219. else {
  40220. m.push(safeJSONStringify(arguments[i]));
  40221. }
  40222. }
  40223. return m.join(" : ");
  40224. }
  40225. function arrayIndexOf(array, item) {
  40226. var nativeIndexOf = Array.prototype.indexOf;
  40227. if (array === null) {
  40228. return -1;
  40229. }
  40230. if (nativeIndexOf && array.indexOf === nativeIndexOf) {
  40231. return array.indexOf(item);
  40232. }
  40233. for (var i = 0, l = array.length; i < l; i++) {
  40234. if (array[i] === item) {
  40235. return i;
  40236. }
  40237. }
  40238. return -1;
  40239. }
  40240. function objectApply(object, f) {
  40241. for (var key in object) {
  40242. if (Object.prototype.hasOwnProperty.call(object, key)) {
  40243. f(object[key], key, object);
  40244. }
  40245. }
  40246. }
  40247. function keys(object) {
  40248. var keys = [];
  40249. objectApply(object, function (_, key) {
  40250. keys.push(key);
  40251. });
  40252. return keys;
  40253. }
  40254. function values(object) {
  40255. var values = [];
  40256. objectApply(object, function (value) {
  40257. values.push(value);
  40258. });
  40259. return values;
  40260. }
  40261. function apply(array, f, context) {
  40262. for (var i = 0; i < array.length; i++) {
  40263. f.call(context || window, array[i], i, array);
  40264. }
  40265. }
  40266. function map(array, f) {
  40267. var result = [];
  40268. for (var i = 0; i < array.length; i++) {
  40269. result.push(f(array[i], i, array, result));
  40270. }
  40271. return result;
  40272. }
  40273. function mapObject(object, f) {
  40274. var result = {};
  40275. objectApply(object, function (value, key) {
  40276. result[key] = f(value);
  40277. });
  40278. return result;
  40279. }
  40280. function filter(array, test) {
  40281. test = test || function (value) { return !!value; };
  40282. var result = [];
  40283. for (var i = 0; i < array.length; i++) {
  40284. if (test(array[i], i, array, result)) {
  40285. result.push(array[i]);
  40286. }
  40287. }
  40288. return result;
  40289. }
  40290. function filterObject(object, test) {
  40291. var result = {};
  40292. objectApply(object, function (value, key) {
  40293. if ((test && test(value, key, object, result)) || Boolean(value)) {
  40294. result[key] = value;
  40295. }
  40296. });
  40297. return result;
  40298. }
  40299. function flatten(object) {
  40300. var result = [];
  40301. objectApply(object, function (value, key) {
  40302. result.push([key, value]);
  40303. });
  40304. return result;
  40305. }
  40306. function any(array, test) {
  40307. for (var i = 0; i < array.length; i++) {
  40308. if (test(array[i], i, array)) {
  40309. return true;
  40310. }
  40311. }
  40312. return false;
  40313. }
  40314. function collections_all(array, test) {
  40315. for (var i = 0; i < array.length; i++) {
  40316. if (!test(array[i], i, array)) {
  40317. return false;
  40318. }
  40319. }
  40320. return true;
  40321. }
  40322. function encodeParamsObject(data) {
  40323. return mapObject(data, function (value) {
  40324. if (typeof value === "object") {
  40325. value = safeJSONStringify(value);
  40326. }
  40327. return encodeURIComponent(encode(value.toString()));
  40328. });
  40329. }
  40330. function buildQueryString(data) {
  40331. var params = filterObject(data, function (value) {
  40332. return value !== undefined;
  40333. });
  40334. var query = map(flatten(encodeParamsObject(params)), util.method("join", "=")).join("&");
  40335. return query;
  40336. }
  40337. function decycleObject(object) {
  40338. var objects = [], paths = [];
  40339. return (function derez(value, path) {
  40340. var i, name, nu;
  40341. switch (typeof value) {
  40342. case 'object':
  40343. if (!value) {
  40344. return null;
  40345. }
  40346. for (i = 0; i < objects.length; i += 1) {
  40347. if (objects[i] === value) {
  40348. return { $ref: paths[i] };
  40349. }
  40350. }
  40351. objects.push(value);
  40352. paths.push(path);
  40353. if (Object.prototype.toString.apply(value) === '[object Array]') {
  40354. nu = [];
  40355. for (i = 0; i < value.length; i += 1) {
  40356. nu[i] = derez(value[i], path + '[' + i + ']');
  40357. }
  40358. }
  40359. else {
  40360. nu = {};
  40361. for (name in value) {
  40362. if (Object.prototype.hasOwnProperty.call(value, name)) {
  40363. nu[name] = derez(value[name], path + '[' + JSON.stringify(name) + ']');
  40364. }
  40365. }
  40366. }
  40367. return nu;
  40368. case 'number':
  40369. case 'string':
  40370. case 'boolean':
  40371. return value;
  40372. }
  40373. }(object, '$'));
  40374. }
  40375. function safeJSONStringify(source) {
  40376. try {
  40377. return JSON.stringify(source);
  40378. }
  40379. catch (e) {
  40380. return JSON.stringify(decycleObject(source));
  40381. }
  40382. }
  40383. // CONCATENATED MODULE: ./src/core/logger.ts
  40384. var logger_Logger = (function () {
  40385. function Logger() {
  40386. this.globalLog = function (message) {
  40387. if (window.console && window.console.log) {
  40388. window.console.log(message);
  40389. }
  40390. };
  40391. }
  40392. Logger.prototype.debug = function () {
  40393. var args = [];
  40394. for (var _i = 0; _i < arguments.length; _i++) {
  40395. args[_i] = arguments[_i];
  40396. }
  40397. this.log(this.globalLog, args);
  40398. };
  40399. Logger.prototype.warn = function () {
  40400. var args = [];
  40401. for (var _i = 0; _i < arguments.length; _i++) {
  40402. args[_i] = arguments[_i];
  40403. }
  40404. this.log(this.globalLogWarn, args);
  40405. };
  40406. Logger.prototype.error = function () {
  40407. var args = [];
  40408. for (var _i = 0; _i < arguments.length; _i++) {
  40409. args[_i] = arguments[_i];
  40410. }
  40411. this.log(this.globalLogError, args);
  40412. };
  40413. Logger.prototype.globalLogWarn = function (message) {
  40414. if (window.console && window.console.warn) {
  40415. window.console.warn(message);
  40416. }
  40417. else {
  40418. this.globalLog(message);
  40419. }
  40420. };
  40421. Logger.prototype.globalLogError = function (message) {
  40422. if (window.console && window.console.error) {
  40423. window.console.error(message);
  40424. }
  40425. else {
  40426. this.globalLogWarn(message);
  40427. }
  40428. };
  40429. Logger.prototype.log = function (defaultLoggingFunction) {
  40430. var args = [];
  40431. for (var _i = 1; _i < arguments.length; _i++) {
  40432. args[_i - 1] = arguments[_i];
  40433. }
  40434. var message = stringify.apply(this, arguments);
  40435. if (core_pusher.log) {
  40436. core_pusher.log(message);
  40437. }
  40438. else if (core_pusher.logToConsole) {
  40439. var log = defaultLoggingFunction.bind(this);
  40440. log(message);
  40441. }
  40442. };
  40443. return Logger;
  40444. }());
  40445. /* harmony default export */ var logger = (new logger_Logger());
  40446. // CONCATENATED MODULE: ./src/core/utils/url_store.ts
  40447. var urlStore = {
  40448. baseUrl: "https://pusher.com",
  40449. urls: {
  40450. authenticationEndpoint: {
  40451. path: "/docs/authenticating_users",
  40452. },
  40453. javascriptQuickStart: {
  40454. path: "/docs/javascript_quick_start"
  40455. },
  40456. triggeringClientEvents: {
  40457. path: "/docs/client_api_guide/client_events#trigger-events"
  40458. }
  40459. }
  40460. };
  40461. var buildLogSuffix = function (key) {
  40462. var urlPrefix = "See:";
  40463. var urlObj = urlStore.urls[key];
  40464. if (!urlObj)
  40465. return "";
  40466. var url;
  40467. if (urlObj.fullUrl) {
  40468. url = urlObj.fullUrl;
  40469. }
  40470. else if (urlObj.path) {
  40471. url = urlStore.baseUrl + urlObj.path;
  40472. }
  40473. if (!url)
  40474. return "";
  40475. return urlPrefix + " " + url;
  40476. };
  40477. /* harmony default export */ var url_store = ({ buildLogSuffix: buildLogSuffix });
  40478. // CONCATENATED MODULE: ./src/runtimes/isomorphic/auth/xhr_auth.ts
  40479. var ajax = function (context, socketId, callback) {
  40480. var self = this, xhr;
  40481. xhr = runtime.createXHR();
  40482. xhr.open("POST", self.options.authEndpoint, true);
  40483. xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  40484. for (var headerName in this.authOptions.headers) {
  40485. xhr.setRequestHeader(headerName, this.authOptions.headers[headerName]);
  40486. }
  40487. xhr.onreadystatechange = function () {
  40488. if (xhr.readyState === 4) {
  40489. if (xhr.status === 200) {
  40490. var data, parsed = false;
  40491. try {
  40492. data = JSON.parse(xhr.responseText);
  40493. parsed = true;
  40494. }
  40495. catch (e) {
  40496. callback(true, 'JSON returned from auth endpoint was invalid, yet status code was 200. Data was: ' + xhr.responseText);
  40497. }
  40498. if (parsed) {
  40499. callback(false, data);
  40500. }
  40501. }
  40502. else {
  40503. var suffix = url_store.buildLogSuffix("authenticationEndpoint");
  40504. logger.error('Unable to retrieve auth string from auth endpoint - ' +
  40505. ("received status " + xhr.status + " from " + self.options.authEndpoint + ". ") +
  40506. ("Clients must be authenticated to join private or presence channels. " + suffix));
  40507. callback(true, xhr.status);
  40508. }
  40509. }
  40510. };
  40511. xhr.send(this.composeQuery(socketId));
  40512. return xhr;
  40513. };
  40514. /* harmony default export */ var xhr_auth = (ajax);
  40515. // CONCATENATED MODULE: ./src/runtimes/web/auth/jsonp_auth.ts
  40516. var jsonp = function (context, socketId, callback) {
  40517. if (this.authOptions.headers !== undefined) {
  40518. logger.warn('To send headers with the auth request, you must use AJAX, rather than JSONP.');
  40519. }
  40520. var callbackName = context.nextAuthCallbackID.toString();
  40521. context.nextAuthCallbackID++;
  40522. var document = context.getDocument();
  40523. var script = document.createElement("script");
  40524. context.auth_callbacks[callbackName] = function (data) {
  40525. callback(false, data);
  40526. };
  40527. var callback_name = "Pusher.auth_callbacks['" + callbackName + "']";
  40528. script.src = this.options.authEndpoint +
  40529. '?callback=' +
  40530. encodeURIComponent(callback_name) +
  40531. '&' +
  40532. this.composeQuery(socketId);
  40533. var head = document.getElementsByTagName("head")[0] || document.documentElement;
  40534. head.insertBefore(script, head.firstChild);
  40535. };
  40536. /* harmony default export */ var jsonp_auth = (jsonp);
  40537. // CONCATENATED MODULE: ./src/runtimes/web/dom/script_request.ts
  40538. var ScriptRequest = (function () {
  40539. function ScriptRequest(src) {
  40540. this.src = src;
  40541. }
  40542. ScriptRequest.prototype.send = function (receiver) {
  40543. var self = this;
  40544. var errorString = "Error loading " + self.src;
  40545. self.script = document.createElement("script");
  40546. self.script.id = receiver.id;
  40547. self.script.src = self.src;
  40548. self.script.type = "text/javascript";
  40549. self.script.charset = "UTF-8";
  40550. if (self.script.addEventListener) {
  40551. self.script.onerror = function () {
  40552. receiver.callback(errorString);
  40553. };
  40554. self.script.onload = function () {
  40555. receiver.callback(null);
  40556. };
  40557. }
  40558. else {
  40559. self.script.onreadystatechange = function () {
  40560. if (self.script.readyState === 'loaded' ||
  40561. self.script.readyState === 'complete') {
  40562. receiver.callback(null);
  40563. }
  40564. };
  40565. }
  40566. if (self.script.async === undefined && document.attachEvent &&
  40567. /opera/i.test(navigator.userAgent)) {
  40568. self.errorScript = document.createElement("script");
  40569. self.errorScript.id = receiver.id + "_error";
  40570. self.errorScript.text = receiver.name + "('" + errorString + "');";
  40571. self.script.async = self.errorScript.async = false;
  40572. }
  40573. else {
  40574. self.script.async = true;
  40575. }
  40576. var head = document.getElementsByTagName('head')[0];
  40577. head.insertBefore(self.script, head.firstChild);
  40578. if (self.errorScript) {
  40579. head.insertBefore(self.errorScript, self.script.nextSibling);
  40580. }
  40581. };
  40582. ScriptRequest.prototype.cleanup = function () {
  40583. if (this.script) {
  40584. this.script.onload = this.script.onerror = null;
  40585. this.script.onreadystatechange = null;
  40586. }
  40587. if (this.script && this.script.parentNode) {
  40588. this.script.parentNode.removeChild(this.script);
  40589. }
  40590. if (this.errorScript && this.errorScript.parentNode) {
  40591. this.errorScript.parentNode.removeChild(this.errorScript);
  40592. }
  40593. this.script = null;
  40594. this.errorScript = null;
  40595. };
  40596. return ScriptRequest;
  40597. }());
  40598. /* harmony default export */ var script_request = (ScriptRequest);
  40599. // CONCATENATED MODULE: ./src/runtimes/web/dom/jsonp_request.ts
  40600. var jsonp_request_JSONPRequest = (function () {
  40601. function JSONPRequest(url, data) {
  40602. this.url = url;
  40603. this.data = data;
  40604. }
  40605. JSONPRequest.prototype.send = function (receiver) {
  40606. if (this.request) {
  40607. return;
  40608. }
  40609. var query = buildQueryString(this.data);
  40610. var url = this.url + "/" + receiver.number + "?" + query;
  40611. this.request = runtime.createScriptRequest(url);
  40612. this.request.send(receiver);
  40613. };
  40614. JSONPRequest.prototype.cleanup = function () {
  40615. if (this.request) {
  40616. this.request.cleanup();
  40617. }
  40618. };
  40619. return JSONPRequest;
  40620. }());
  40621. /* harmony default export */ var jsonp_request = (jsonp_request_JSONPRequest);
  40622. // CONCATENATED MODULE: ./src/runtimes/web/timeline/jsonp_timeline.ts
  40623. var getAgent = function (sender, useTLS) {
  40624. return function (data, callback) {
  40625. var scheme = "http" + (useTLS ? "s" : "") + "://";
  40626. var url = scheme + (sender.host || sender.options.host) + sender.options.path;
  40627. var request = runtime.createJSONPRequest(url, data);
  40628. var receiver = runtime.ScriptReceivers.create(function (error, result) {
  40629. ScriptReceivers.remove(receiver);
  40630. request.cleanup();
  40631. if (result && result.host) {
  40632. sender.host = result.host;
  40633. }
  40634. if (callback) {
  40635. callback(error, result);
  40636. }
  40637. });
  40638. request.send(receiver);
  40639. };
  40640. };
  40641. var jsonp_timeline_jsonp = {
  40642. name: 'jsonp',
  40643. getAgent: getAgent
  40644. };
  40645. /* harmony default export */ var jsonp_timeline = (jsonp_timeline_jsonp);
  40646. // CONCATENATED MODULE: ./src/core/transports/url_schemes.ts
  40647. function getGenericURL(baseScheme, params, path) {
  40648. var scheme = baseScheme + (params.useTLS ? "s" : "");
  40649. var host = params.useTLS ? params.hostTLS : params.hostNonTLS;
  40650. return scheme + "://" + host + path;
  40651. }
  40652. function getGenericPath(key, queryString) {
  40653. var path = "/app/" + key;
  40654. var query = "?protocol=" + defaults.PROTOCOL +
  40655. "&client=js" +
  40656. "&version=" + defaults.VERSION +
  40657. (queryString ? ("&" + queryString) : "");
  40658. return path + query;
  40659. }
  40660. var ws = {
  40661. getInitial: function (key, params) {
  40662. var path = (params.httpPath || "") + getGenericPath(key, "flash=false");
  40663. return getGenericURL("ws", params, path);
  40664. }
  40665. };
  40666. var http = {
  40667. getInitial: function (key, params) {
  40668. var path = (params.httpPath || "/pusher") + getGenericPath(key);
  40669. return getGenericURL("http", params, path);
  40670. }
  40671. };
  40672. var sockjs = {
  40673. getInitial: function (key, params) {
  40674. return getGenericURL("http", params, params.httpPath || "/pusher");
  40675. },
  40676. getPath: function (key, params) {
  40677. return getGenericPath(key);
  40678. }
  40679. };
  40680. // CONCATENATED MODULE: ./src/core/events/callback_registry.ts
  40681. var callback_registry_CallbackRegistry = (function () {
  40682. function CallbackRegistry() {
  40683. this._callbacks = {};
  40684. }
  40685. CallbackRegistry.prototype.get = function (name) {
  40686. return this._callbacks[prefix(name)];
  40687. };
  40688. CallbackRegistry.prototype.add = function (name, callback, context) {
  40689. var prefixedEventName = prefix(name);
  40690. this._callbacks[prefixedEventName] = this._callbacks[prefixedEventName] || [];
  40691. this._callbacks[prefixedEventName].push({
  40692. fn: callback,
  40693. context: context
  40694. });
  40695. };
  40696. CallbackRegistry.prototype.remove = function (name, callback, context) {
  40697. if (!name && !callback && !context) {
  40698. this._callbacks = {};
  40699. return;
  40700. }
  40701. var names = name ? [prefix(name)] : keys(this._callbacks);
  40702. if (callback || context) {
  40703. this.removeCallback(names, callback, context);
  40704. }
  40705. else {
  40706. this.removeAllCallbacks(names);
  40707. }
  40708. };
  40709. CallbackRegistry.prototype.removeCallback = function (names, callback, context) {
  40710. apply(names, function (name) {
  40711. this._callbacks[name] = filter(this._callbacks[name] || [], function (binding) {
  40712. return (callback && callback !== binding.fn) ||
  40713. (context && context !== binding.context);
  40714. });
  40715. if (this._callbacks[name].length === 0) {
  40716. delete this._callbacks[name];
  40717. }
  40718. }, this);
  40719. };
  40720. CallbackRegistry.prototype.removeAllCallbacks = function (names) {
  40721. apply(names, function (name) {
  40722. delete this._callbacks[name];
  40723. }, this);
  40724. };
  40725. return CallbackRegistry;
  40726. }());
  40727. /* harmony default export */ var callback_registry = (callback_registry_CallbackRegistry);
  40728. function prefix(name) {
  40729. return "_" + name;
  40730. }
  40731. // CONCATENATED MODULE: ./src/core/events/dispatcher.ts
  40732. var dispatcher_Dispatcher = (function () {
  40733. function Dispatcher(failThrough) {
  40734. this.callbacks = new callback_registry();
  40735. this.global_callbacks = [];
  40736. this.failThrough = failThrough;
  40737. }
  40738. Dispatcher.prototype.bind = function (eventName, callback, context) {
  40739. this.callbacks.add(eventName, callback, context);
  40740. return this;
  40741. };
  40742. Dispatcher.prototype.bind_global = function (callback) {
  40743. this.global_callbacks.push(callback);
  40744. return this;
  40745. };
  40746. Dispatcher.prototype.unbind = function (eventName, callback, context) {
  40747. this.callbacks.remove(eventName, callback, context);
  40748. return this;
  40749. };
  40750. Dispatcher.prototype.unbind_global = function (callback) {
  40751. if (!callback) {
  40752. this.global_callbacks = [];
  40753. return this;
  40754. }
  40755. this.global_callbacks = filter(this.global_callbacks || [], function (c) { return c !== callback; });
  40756. return this;
  40757. };
  40758. Dispatcher.prototype.unbind_all = function () {
  40759. this.unbind();
  40760. this.unbind_global();
  40761. return this;
  40762. };
  40763. Dispatcher.prototype.emit = function (eventName, data, metadata) {
  40764. for (var i = 0; i < this.global_callbacks.length; i++) {
  40765. this.global_callbacks[i](eventName, data);
  40766. }
  40767. var callbacks = this.callbacks.get(eventName);
  40768. var args = [];
  40769. if (metadata) {
  40770. args.push(data, metadata);
  40771. }
  40772. else if (data) {
  40773. args.push(data);
  40774. }
  40775. if (callbacks && callbacks.length > 0) {
  40776. for (var i = 0; i < callbacks.length; i++) {
  40777. callbacks[i].fn.apply(callbacks[i].context || window, args);
  40778. }
  40779. }
  40780. else if (this.failThrough) {
  40781. this.failThrough(eventName, data);
  40782. }
  40783. return this;
  40784. };
  40785. return Dispatcher;
  40786. }());
  40787. /* harmony default export */ var dispatcher = (dispatcher_Dispatcher);
  40788. // CONCATENATED MODULE: ./src/core/transports/transport_connection.ts
  40789. var transport_connection_extends = (undefined && undefined.__extends) || (function () {
  40790. var extendStatics = function (d, b) {
  40791. extendStatics = Object.setPrototypeOf ||
  40792. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  40793. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  40794. return extendStatics(d, b);
  40795. };
  40796. return function (d, b) {
  40797. extendStatics(d, b);
  40798. function __() { this.constructor = d; }
  40799. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  40800. };
  40801. })();
  40802. var transport_connection_TransportConnection = (function (_super) {
  40803. transport_connection_extends(TransportConnection, _super);
  40804. function TransportConnection(hooks, name, priority, key, options) {
  40805. var _this = _super.call(this) || this;
  40806. _this.initialize = runtime.transportConnectionInitializer;
  40807. _this.hooks = hooks;
  40808. _this.name = name;
  40809. _this.priority = priority;
  40810. _this.key = key;
  40811. _this.options = options;
  40812. _this.state = "new";
  40813. _this.timeline = options.timeline;
  40814. _this.activityTimeout = options.activityTimeout;
  40815. _this.id = _this.timeline.generateUniqueID();
  40816. return _this;
  40817. }
  40818. TransportConnection.prototype.handlesActivityChecks = function () {
  40819. return Boolean(this.hooks.handlesActivityChecks);
  40820. };
  40821. TransportConnection.prototype.supportsPing = function () {
  40822. return Boolean(this.hooks.supportsPing);
  40823. };
  40824. TransportConnection.prototype.connect = function () {
  40825. var _this = this;
  40826. if (this.socket || this.state !== "initialized") {
  40827. return false;
  40828. }
  40829. var url = this.hooks.urls.getInitial(this.key, this.options);
  40830. try {
  40831. this.socket = this.hooks.getSocket(url, this.options);
  40832. }
  40833. catch (e) {
  40834. util.defer(function () {
  40835. _this.onError(e);
  40836. _this.changeState("closed");
  40837. });
  40838. return false;
  40839. }
  40840. this.bindListeners();
  40841. logger.debug("Connecting", { transport: this.name, url: url });
  40842. this.changeState("connecting");
  40843. return true;
  40844. };
  40845. TransportConnection.prototype.close = function () {
  40846. if (this.socket) {
  40847. this.socket.close();
  40848. return true;
  40849. }
  40850. else {
  40851. return false;
  40852. }
  40853. };
  40854. TransportConnection.prototype.send = function (data) {
  40855. var _this = this;
  40856. if (this.state === "open") {
  40857. util.defer(function () {
  40858. if (_this.socket) {
  40859. _this.socket.send(data);
  40860. }
  40861. });
  40862. return true;
  40863. }
  40864. else {
  40865. return false;
  40866. }
  40867. };
  40868. TransportConnection.prototype.ping = function () {
  40869. if (this.state === "open" && this.supportsPing()) {
  40870. this.socket.ping();
  40871. }
  40872. };
  40873. TransportConnection.prototype.onOpen = function () {
  40874. if (this.hooks.beforeOpen) {
  40875. this.hooks.beforeOpen(this.socket, this.hooks.urls.getPath(this.key, this.options));
  40876. }
  40877. this.changeState("open");
  40878. this.socket.onopen = undefined;
  40879. };
  40880. TransportConnection.prototype.onError = function (error) {
  40881. this.emit("error", { type: 'WebSocketError', error: error });
  40882. this.timeline.error(this.buildTimelineMessage({ error: error.toString() }));
  40883. };
  40884. TransportConnection.prototype.onClose = function (closeEvent) {
  40885. if (closeEvent) {
  40886. this.changeState("closed", {
  40887. code: closeEvent.code,
  40888. reason: closeEvent.reason,
  40889. wasClean: closeEvent.wasClean
  40890. });
  40891. }
  40892. else {
  40893. this.changeState("closed");
  40894. }
  40895. this.unbindListeners();
  40896. this.socket = undefined;
  40897. };
  40898. TransportConnection.prototype.onMessage = function (message) {
  40899. this.emit("message", message);
  40900. };
  40901. TransportConnection.prototype.onActivity = function () {
  40902. this.emit("activity");
  40903. };
  40904. TransportConnection.prototype.bindListeners = function () {
  40905. var _this = this;
  40906. this.socket.onopen = function () {
  40907. _this.onOpen();
  40908. };
  40909. this.socket.onerror = function (error) {
  40910. _this.onError(error);
  40911. };
  40912. this.socket.onclose = function (closeEvent) {
  40913. _this.onClose(closeEvent);
  40914. };
  40915. this.socket.onmessage = function (message) {
  40916. _this.onMessage(message);
  40917. };
  40918. if (this.supportsPing()) {
  40919. this.socket.onactivity = function () { _this.onActivity(); };
  40920. }
  40921. };
  40922. TransportConnection.prototype.unbindListeners = function () {
  40923. if (this.socket) {
  40924. this.socket.onopen = undefined;
  40925. this.socket.onerror = undefined;
  40926. this.socket.onclose = undefined;
  40927. this.socket.onmessage = undefined;
  40928. if (this.supportsPing()) {
  40929. this.socket.onactivity = undefined;
  40930. }
  40931. }
  40932. };
  40933. TransportConnection.prototype.changeState = function (state, params) {
  40934. this.state = state;
  40935. this.timeline.info(this.buildTimelineMessage({
  40936. state: state,
  40937. params: params
  40938. }));
  40939. this.emit(state, params);
  40940. };
  40941. TransportConnection.prototype.buildTimelineMessage = function (message) {
  40942. return extend({ cid: this.id }, message);
  40943. };
  40944. return TransportConnection;
  40945. }(dispatcher));
  40946. /* harmony default export */ var transport_connection = (transport_connection_TransportConnection);
  40947. // CONCATENATED MODULE: ./src/core/transports/transport.ts
  40948. var transport_Transport = (function () {
  40949. function Transport(hooks) {
  40950. this.hooks = hooks;
  40951. }
  40952. Transport.prototype.isSupported = function (environment) {
  40953. return this.hooks.isSupported(environment);
  40954. };
  40955. Transport.prototype.createConnection = function (name, priority, key, options) {
  40956. return new transport_connection(this.hooks, name, priority, key, options);
  40957. };
  40958. return Transport;
  40959. }());
  40960. /* harmony default export */ var transports_transport = (transport_Transport);
  40961. // CONCATENATED MODULE: ./src/runtimes/isomorphic/transports/transports.ts
  40962. var WSTransport = new transports_transport({
  40963. urls: ws,
  40964. handlesActivityChecks: false,
  40965. supportsPing: false,
  40966. isInitialized: function () {
  40967. return Boolean(runtime.getWebSocketAPI());
  40968. },
  40969. isSupported: function () {
  40970. return Boolean(runtime.getWebSocketAPI());
  40971. },
  40972. getSocket: function (url) {
  40973. return runtime.createWebSocket(url);
  40974. }
  40975. });
  40976. var httpConfiguration = {
  40977. urls: http,
  40978. handlesActivityChecks: false,
  40979. supportsPing: true,
  40980. isInitialized: function () {
  40981. return true;
  40982. }
  40983. };
  40984. var streamingConfiguration = extend({ getSocket: function (url) {
  40985. return runtime.HTTPFactory.createStreamingSocket(url);
  40986. }
  40987. }, httpConfiguration);
  40988. var pollingConfiguration = extend({ getSocket: function (url) {
  40989. return runtime.HTTPFactory.createPollingSocket(url);
  40990. }
  40991. }, httpConfiguration);
  40992. var xhrConfiguration = {
  40993. isSupported: function () {
  40994. return runtime.isXHRSupported();
  40995. }
  40996. };
  40997. var XHRStreamingTransport = new transports_transport(extend({}, streamingConfiguration, xhrConfiguration));
  40998. var XHRPollingTransport = new transports_transport(extend({}, pollingConfiguration, xhrConfiguration));
  40999. var Transports = {
  41000. ws: WSTransport,
  41001. xhr_streaming: XHRStreamingTransport,
  41002. xhr_polling: XHRPollingTransport
  41003. };
  41004. /* harmony default export */ var transports = (Transports);
  41005. // CONCATENATED MODULE: ./src/runtimes/web/transports/transports.ts
  41006. var SockJSTransport = new transports_transport({
  41007. file: "sockjs",
  41008. urls: sockjs,
  41009. handlesActivityChecks: true,
  41010. supportsPing: false,
  41011. isSupported: function () {
  41012. return true;
  41013. },
  41014. isInitialized: function () {
  41015. return window.SockJS !== undefined;
  41016. },
  41017. getSocket: function (url, options) {
  41018. return new window.SockJS(url, null, {
  41019. js_path: Dependencies.getPath("sockjs", {
  41020. useTLS: options.useTLS
  41021. }),
  41022. ignore_null_origin: options.ignoreNullOrigin
  41023. });
  41024. },
  41025. beforeOpen: function (socket, path) {
  41026. socket.send(JSON.stringify({
  41027. path: path
  41028. }));
  41029. }
  41030. });
  41031. var xdrConfiguration = {
  41032. isSupported: function (environment) {
  41033. var yes = runtime.isXDRSupported(environment.useTLS);
  41034. return yes;
  41035. }
  41036. };
  41037. var XDRStreamingTransport = new transports_transport(extend({}, streamingConfiguration, xdrConfiguration));
  41038. var XDRPollingTransport = new transports_transport(extend({}, pollingConfiguration, xdrConfiguration));
  41039. transports.xdr_streaming = XDRStreamingTransport;
  41040. transports.xdr_polling = XDRPollingTransport;
  41041. transports.sockjs = SockJSTransport;
  41042. /* harmony default export */ var transports_transports = (transports);
  41043. // CONCATENATED MODULE: ./src/runtimes/web/net_info.ts
  41044. var net_info_extends = (undefined && undefined.__extends) || (function () {
  41045. var extendStatics = function (d, b) {
  41046. extendStatics = Object.setPrototypeOf ||
  41047. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  41048. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  41049. return extendStatics(d, b);
  41050. };
  41051. return function (d, b) {
  41052. extendStatics(d, b);
  41053. function __() { this.constructor = d; }
  41054. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  41055. };
  41056. })();
  41057. var NetInfo = (function (_super) {
  41058. net_info_extends(NetInfo, _super);
  41059. function NetInfo() {
  41060. var _this = _super.call(this) || this;
  41061. var self = _this;
  41062. if (window.addEventListener !== undefined) {
  41063. window.addEventListener("online", function () {
  41064. self.emit('online');
  41065. }, false);
  41066. window.addEventListener("offline", function () {
  41067. self.emit('offline');
  41068. }, false);
  41069. }
  41070. return _this;
  41071. }
  41072. NetInfo.prototype.isOnline = function () {
  41073. if (window.navigator.onLine === undefined) {
  41074. return true;
  41075. }
  41076. else {
  41077. return window.navigator.onLine;
  41078. }
  41079. };
  41080. return NetInfo;
  41081. }(dispatcher));
  41082. var net_info_Network = new NetInfo();
  41083. // CONCATENATED MODULE: ./src/core/transports/assistant_to_the_transport_manager.ts
  41084. var assistant_to_the_transport_manager_AssistantToTheTransportManager = (function () {
  41085. function AssistantToTheTransportManager(manager, transport, options) {
  41086. this.manager = manager;
  41087. this.transport = transport;
  41088. this.minPingDelay = options.minPingDelay;
  41089. this.maxPingDelay = options.maxPingDelay;
  41090. this.pingDelay = undefined;
  41091. }
  41092. AssistantToTheTransportManager.prototype.createConnection = function (name, priority, key, options) {
  41093. var _this = this;
  41094. options = extend({}, options, {
  41095. activityTimeout: this.pingDelay
  41096. });
  41097. var connection = this.transport.createConnection(name, priority, key, options);
  41098. var openTimestamp = null;
  41099. var onOpen = function () {
  41100. connection.unbind("open", onOpen);
  41101. connection.bind("closed", onClosed);
  41102. openTimestamp = util.now();
  41103. };
  41104. var onClosed = function (closeEvent) {
  41105. connection.unbind("closed", onClosed);
  41106. if (closeEvent.code === 1002 || closeEvent.code === 1003) {
  41107. _this.manager.reportDeath();
  41108. }
  41109. else if (!closeEvent.wasClean && openTimestamp) {
  41110. var lifespan = util.now() - openTimestamp;
  41111. if (lifespan < 2 * _this.maxPingDelay) {
  41112. _this.manager.reportDeath();
  41113. _this.pingDelay = Math.max(lifespan / 2, _this.minPingDelay);
  41114. }
  41115. }
  41116. };
  41117. connection.bind("open", onOpen);
  41118. return connection;
  41119. };
  41120. AssistantToTheTransportManager.prototype.isSupported = function (environment) {
  41121. return this.manager.isAlive() && this.transport.isSupported(environment);
  41122. };
  41123. return AssistantToTheTransportManager;
  41124. }());
  41125. /* harmony default export */ var assistant_to_the_transport_manager = (assistant_to_the_transport_manager_AssistantToTheTransportManager);
  41126. // CONCATENATED MODULE: ./src/core/connection/protocol/protocol.ts
  41127. var Protocol = {
  41128. decodeMessage: function (messageEvent) {
  41129. try {
  41130. var messageData = JSON.parse(messageEvent.data);
  41131. var pusherEventData = messageData.data;
  41132. if (typeof pusherEventData === 'string') {
  41133. try {
  41134. pusherEventData = JSON.parse(messageData.data);
  41135. }
  41136. catch (e) { }
  41137. }
  41138. var pusherEvent = {
  41139. event: messageData.event,
  41140. channel: messageData.channel,
  41141. data: pusherEventData,
  41142. };
  41143. if (messageData.user_id) {
  41144. pusherEvent.user_id = messageData.user_id;
  41145. }
  41146. return pusherEvent;
  41147. }
  41148. catch (e) {
  41149. throw { type: 'MessageParseError', error: e, data: messageEvent.data };
  41150. }
  41151. },
  41152. encodeMessage: function (event) {
  41153. return JSON.stringify(event);
  41154. },
  41155. processHandshake: function (messageEvent) {
  41156. var message = Protocol.decodeMessage(messageEvent);
  41157. if (message.event === "pusher:connection_established") {
  41158. if (!message.data.activity_timeout) {
  41159. throw "No activity timeout specified in handshake";
  41160. }
  41161. return {
  41162. action: "connected",
  41163. id: message.data.socket_id,
  41164. activityTimeout: message.data.activity_timeout * 1000
  41165. };
  41166. }
  41167. else if (message.event === "pusher:error") {
  41168. return {
  41169. action: this.getCloseAction(message.data),
  41170. error: this.getCloseError(message.data)
  41171. };
  41172. }
  41173. else {
  41174. throw "Invalid handshake";
  41175. }
  41176. },
  41177. getCloseAction: function (closeEvent) {
  41178. if (closeEvent.code < 4000) {
  41179. if (closeEvent.code >= 1002 && closeEvent.code <= 1004) {
  41180. return "backoff";
  41181. }
  41182. else {
  41183. return null;
  41184. }
  41185. }
  41186. else if (closeEvent.code === 4000) {
  41187. return "tls_only";
  41188. }
  41189. else if (closeEvent.code < 4100) {
  41190. return "refused";
  41191. }
  41192. else if (closeEvent.code < 4200) {
  41193. return "backoff";
  41194. }
  41195. else if (closeEvent.code < 4300) {
  41196. return "retry";
  41197. }
  41198. else {
  41199. return "refused";
  41200. }
  41201. },
  41202. getCloseError: function (closeEvent) {
  41203. if (closeEvent.code !== 1000 && closeEvent.code !== 1001) {
  41204. return {
  41205. type: 'PusherError',
  41206. data: {
  41207. code: closeEvent.code,
  41208. message: closeEvent.reason || closeEvent.message
  41209. }
  41210. };
  41211. }
  41212. else {
  41213. return null;
  41214. }
  41215. }
  41216. };
  41217. /* harmony default export */ var protocol_protocol = (Protocol);
  41218. // CONCATENATED MODULE: ./src/core/connection/connection.ts
  41219. var connection_extends = (undefined && undefined.__extends) || (function () {
  41220. var extendStatics = function (d, b) {
  41221. extendStatics = Object.setPrototypeOf ||
  41222. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  41223. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  41224. return extendStatics(d, b);
  41225. };
  41226. return function (d, b) {
  41227. extendStatics(d, b);
  41228. function __() { this.constructor = d; }
  41229. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  41230. };
  41231. })();
  41232. var connection_Connection = (function (_super) {
  41233. connection_extends(Connection, _super);
  41234. function Connection(id, transport) {
  41235. var _this = _super.call(this) || this;
  41236. _this.id = id;
  41237. _this.transport = transport;
  41238. _this.activityTimeout = transport.activityTimeout;
  41239. _this.bindListeners();
  41240. return _this;
  41241. }
  41242. Connection.prototype.handlesActivityChecks = function () {
  41243. return this.transport.handlesActivityChecks();
  41244. };
  41245. Connection.prototype.send = function (data) {
  41246. return this.transport.send(data);
  41247. };
  41248. Connection.prototype.send_event = function (name, data, channel) {
  41249. var event = { event: name, data: data };
  41250. if (channel) {
  41251. event.channel = channel;
  41252. }
  41253. logger.debug('Event sent', event);
  41254. return this.send(protocol_protocol.encodeMessage(event));
  41255. };
  41256. Connection.prototype.ping = function () {
  41257. if (this.transport.supportsPing()) {
  41258. this.transport.ping();
  41259. }
  41260. else {
  41261. this.send_event('pusher:ping', {});
  41262. }
  41263. };
  41264. Connection.prototype.close = function () {
  41265. this.transport.close();
  41266. };
  41267. Connection.prototype.bindListeners = function () {
  41268. var _this = this;
  41269. var listeners = {
  41270. message: function (messageEvent) {
  41271. var pusherEvent;
  41272. try {
  41273. pusherEvent = protocol_protocol.decodeMessage(messageEvent);
  41274. }
  41275. catch (e) {
  41276. _this.emit('error', {
  41277. type: 'MessageParseError',
  41278. error: e,
  41279. data: messageEvent.data
  41280. });
  41281. }
  41282. if (pusherEvent !== undefined) {
  41283. logger.debug('Event recd', pusherEvent);
  41284. switch (pusherEvent.event) {
  41285. case 'pusher:error':
  41286. _this.emit('error', { type: 'PusherError', data: pusherEvent.data });
  41287. break;
  41288. case 'pusher:ping':
  41289. _this.emit("ping");
  41290. break;
  41291. case 'pusher:pong':
  41292. _this.emit("pong");
  41293. break;
  41294. }
  41295. _this.emit('message', pusherEvent);
  41296. }
  41297. },
  41298. activity: function () {
  41299. _this.emit("activity");
  41300. },
  41301. error: function (error) {
  41302. _this.emit("error", { type: "WebSocketError", error: error });
  41303. },
  41304. closed: function (closeEvent) {
  41305. unbindListeners();
  41306. if (closeEvent && closeEvent.code) {
  41307. _this.handleCloseEvent(closeEvent);
  41308. }
  41309. _this.transport = null;
  41310. _this.emit("closed");
  41311. }
  41312. };
  41313. var unbindListeners = function () {
  41314. objectApply(listeners, function (listener, event) {
  41315. _this.transport.unbind(event, listener);
  41316. });
  41317. };
  41318. objectApply(listeners, function (listener, event) {
  41319. _this.transport.bind(event, listener);
  41320. });
  41321. };
  41322. Connection.prototype.handleCloseEvent = function (closeEvent) {
  41323. var action = protocol_protocol.getCloseAction(closeEvent);
  41324. var error = protocol_protocol.getCloseError(closeEvent);
  41325. if (error) {
  41326. this.emit('error', error);
  41327. }
  41328. if (action) {
  41329. this.emit(action, { action: action, error: error });
  41330. }
  41331. };
  41332. return Connection;
  41333. }(dispatcher));
  41334. /* harmony default export */ var connection_connection = (connection_Connection);
  41335. // CONCATENATED MODULE: ./src/core/connection/handshake/index.ts
  41336. var handshake_Handshake = (function () {
  41337. function Handshake(transport, callback) {
  41338. this.transport = transport;
  41339. this.callback = callback;
  41340. this.bindListeners();
  41341. }
  41342. Handshake.prototype.close = function () {
  41343. this.unbindListeners();
  41344. this.transport.close();
  41345. };
  41346. Handshake.prototype.bindListeners = function () {
  41347. var _this = this;
  41348. this.onMessage = function (m) {
  41349. _this.unbindListeners();
  41350. var result;
  41351. try {
  41352. result = protocol_protocol.processHandshake(m);
  41353. }
  41354. catch (e) {
  41355. _this.finish("error", { error: e });
  41356. _this.transport.close();
  41357. return;
  41358. }
  41359. if (result.action === "connected") {
  41360. _this.finish("connected", {
  41361. connection: new connection_connection(result.id, _this.transport),
  41362. activityTimeout: result.activityTimeout
  41363. });
  41364. }
  41365. else {
  41366. _this.finish(result.action, { error: result.error });
  41367. _this.transport.close();
  41368. }
  41369. };
  41370. this.onClosed = function (closeEvent) {
  41371. _this.unbindListeners();
  41372. var action = protocol_protocol.getCloseAction(closeEvent) || "backoff";
  41373. var error = protocol_protocol.getCloseError(closeEvent);
  41374. _this.finish(action, { error: error });
  41375. };
  41376. this.transport.bind("message", this.onMessage);
  41377. this.transport.bind("closed", this.onClosed);
  41378. };
  41379. Handshake.prototype.unbindListeners = function () {
  41380. this.transport.unbind("message", this.onMessage);
  41381. this.transport.unbind("closed", this.onClosed);
  41382. };
  41383. Handshake.prototype.finish = function (action, params) {
  41384. this.callback(extend({ transport: this.transport, action: action }, params));
  41385. };
  41386. return Handshake;
  41387. }());
  41388. /* harmony default export */ var connection_handshake = (handshake_Handshake);
  41389. // CONCATENATED MODULE: ./src/core/auth/pusher_authorizer.ts
  41390. var pusher_authorizer_PusherAuthorizer = (function () {
  41391. function PusherAuthorizer(channel, options) {
  41392. this.channel = channel;
  41393. var authTransport = options.authTransport;
  41394. if (typeof runtime.getAuthorizers()[authTransport] === "undefined") {
  41395. throw "'" + authTransport + "' is not a recognized auth transport";
  41396. }
  41397. this.type = authTransport;
  41398. this.options = options;
  41399. this.authOptions = (options || {}).auth || {};
  41400. }
  41401. PusherAuthorizer.prototype.composeQuery = function (socketId) {
  41402. var query = 'socket_id=' + encodeURIComponent(socketId) +
  41403. '&channel_name=' + encodeURIComponent(this.channel.name);
  41404. for (var i in this.authOptions.params) {
  41405. query += "&" + encodeURIComponent(i) + "=" + encodeURIComponent(this.authOptions.params[i]);
  41406. }
  41407. return query;
  41408. };
  41409. PusherAuthorizer.prototype.authorize = function (socketId, callback) {
  41410. PusherAuthorizer.authorizers = PusherAuthorizer.authorizers || runtime.getAuthorizers();
  41411. return PusherAuthorizer.authorizers[this.type].call(this, runtime, socketId, callback);
  41412. };
  41413. return PusherAuthorizer;
  41414. }());
  41415. /* harmony default export */ var pusher_authorizer = (pusher_authorizer_PusherAuthorizer);
  41416. // CONCATENATED MODULE: ./src/core/timeline/timeline_sender.ts
  41417. var timeline_sender_TimelineSender = (function () {
  41418. function TimelineSender(timeline, options) {
  41419. this.timeline = timeline;
  41420. this.options = options || {};
  41421. }
  41422. TimelineSender.prototype.send = function (useTLS, callback) {
  41423. if (this.timeline.isEmpty()) {
  41424. return;
  41425. }
  41426. this.timeline.send(runtime.TimelineTransport.getAgent(this, useTLS), callback);
  41427. };
  41428. return TimelineSender;
  41429. }());
  41430. /* harmony default export */ var timeline_sender = (timeline_sender_TimelineSender);
  41431. // CONCATENATED MODULE: ./src/core/errors.ts
  41432. var errors_extends = (undefined && undefined.__extends) || (function () {
  41433. var extendStatics = function (d, b) {
  41434. extendStatics = Object.setPrototypeOf ||
  41435. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  41436. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  41437. return extendStatics(d, b);
  41438. };
  41439. return function (d, b) {
  41440. extendStatics(d, b);
  41441. function __() { this.constructor = d; }
  41442. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  41443. };
  41444. })();
  41445. var BadEventName = (function (_super) {
  41446. errors_extends(BadEventName, _super);
  41447. function BadEventName(msg) {
  41448. var _newTarget = this.constructor;
  41449. var _this = _super.call(this, msg) || this;
  41450. Object.setPrototypeOf(_this, _newTarget.prototype);
  41451. return _this;
  41452. }
  41453. return BadEventName;
  41454. }(Error));
  41455. var RequestTimedOut = (function (_super) {
  41456. errors_extends(RequestTimedOut, _super);
  41457. function RequestTimedOut(msg) {
  41458. var _newTarget = this.constructor;
  41459. var _this = _super.call(this, msg) || this;
  41460. Object.setPrototypeOf(_this, _newTarget.prototype);
  41461. return _this;
  41462. }
  41463. return RequestTimedOut;
  41464. }(Error));
  41465. var TransportPriorityTooLow = (function (_super) {
  41466. errors_extends(TransportPriorityTooLow, _super);
  41467. function TransportPriorityTooLow(msg) {
  41468. var _newTarget = this.constructor;
  41469. var _this = _super.call(this, msg) || this;
  41470. Object.setPrototypeOf(_this, _newTarget.prototype);
  41471. return _this;
  41472. }
  41473. return TransportPriorityTooLow;
  41474. }(Error));
  41475. var TransportClosed = (function (_super) {
  41476. errors_extends(TransportClosed, _super);
  41477. function TransportClosed(msg) {
  41478. var _newTarget = this.constructor;
  41479. var _this = _super.call(this, msg) || this;
  41480. Object.setPrototypeOf(_this, _newTarget.prototype);
  41481. return _this;
  41482. }
  41483. return TransportClosed;
  41484. }(Error));
  41485. var UnsupportedFeature = (function (_super) {
  41486. errors_extends(UnsupportedFeature, _super);
  41487. function UnsupportedFeature(msg) {
  41488. var _newTarget = this.constructor;
  41489. var _this = _super.call(this, msg) || this;
  41490. Object.setPrototypeOf(_this, _newTarget.prototype);
  41491. return _this;
  41492. }
  41493. return UnsupportedFeature;
  41494. }(Error));
  41495. var UnsupportedTransport = (function (_super) {
  41496. errors_extends(UnsupportedTransport, _super);
  41497. function UnsupportedTransport(msg) {
  41498. var _newTarget = this.constructor;
  41499. var _this = _super.call(this, msg) || this;
  41500. Object.setPrototypeOf(_this, _newTarget.prototype);
  41501. return _this;
  41502. }
  41503. return UnsupportedTransport;
  41504. }(Error));
  41505. var UnsupportedStrategy = (function (_super) {
  41506. errors_extends(UnsupportedStrategy, _super);
  41507. function UnsupportedStrategy(msg) {
  41508. var _newTarget = this.constructor;
  41509. var _this = _super.call(this, msg) || this;
  41510. Object.setPrototypeOf(_this, _newTarget.prototype);
  41511. return _this;
  41512. }
  41513. return UnsupportedStrategy;
  41514. }(Error));
  41515. // CONCATENATED MODULE: ./src/core/channels/channel.ts
  41516. var channel_extends = (undefined && undefined.__extends) || (function () {
  41517. var extendStatics = function (d, b) {
  41518. extendStatics = Object.setPrototypeOf ||
  41519. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  41520. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  41521. return extendStatics(d, b);
  41522. };
  41523. return function (d, b) {
  41524. extendStatics(d, b);
  41525. function __() { this.constructor = d; }
  41526. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  41527. };
  41528. })();
  41529. var channel_Channel = (function (_super) {
  41530. channel_extends(Channel, _super);
  41531. function Channel(name, pusher) {
  41532. var _this = _super.call(this, function (event, data) {
  41533. logger.debug('No callbacks on ' + name + ' for ' + event);
  41534. }) || this;
  41535. _this.name = name;
  41536. _this.pusher = pusher;
  41537. _this.subscribed = false;
  41538. _this.subscriptionPending = false;
  41539. _this.subscriptionCancelled = false;
  41540. return _this;
  41541. }
  41542. Channel.prototype.authorize = function (socketId, callback) {
  41543. return callback(false, {});
  41544. };
  41545. Channel.prototype.trigger = function (event, data) {
  41546. if (event.indexOf("client-") !== 0) {
  41547. throw new BadEventName("Event '" + event + "' does not start with 'client-'");
  41548. }
  41549. if (!this.subscribed) {
  41550. var suffix = url_store.buildLogSuffix("triggeringClientEvents");
  41551. logger.warn("Client event triggered before channel 'subscription_succeeded' event . " + suffix);
  41552. }
  41553. return this.pusher.send_event(event, data, this.name);
  41554. };
  41555. Channel.prototype.disconnect = function () {
  41556. this.subscribed = false;
  41557. this.subscriptionPending = false;
  41558. };
  41559. Channel.prototype.handleEvent = function (event) {
  41560. var eventName = event.event;
  41561. var data = event.data;
  41562. if (eventName === "pusher_internal:subscription_succeeded") {
  41563. this.handleSubscriptionSucceededEvent(event);
  41564. }
  41565. else if (eventName.indexOf("pusher_internal:") !== 0) {
  41566. var metadata = {};
  41567. this.emit(eventName, data, metadata);
  41568. }
  41569. };
  41570. Channel.prototype.handleSubscriptionSucceededEvent = function (event) {
  41571. this.subscriptionPending = false;
  41572. this.subscribed = true;
  41573. if (this.subscriptionCancelled) {
  41574. this.pusher.unsubscribe(this.name);
  41575. }
  41576. else {
  41577. this.emit("pusher:subscription_succeeded", event.data);
  41578. }
  41579. };
  41580. Channel.prototype.subscribe = function () {
  41581. var _this = this;
  41582. if (this.subscribed) {
  41583. return;
  41584. }
  41585. this.subscriptionPending = true;
  41586. this.subscriptionCancelled = false;
  41587. this.authorize(this.pusher.connection.socket_id, function (error, data) {
  41588. if (error) {
  41589. logger.error(data);
  41590. _this.emit('pusher:subscription_error', data);
  41591. }
  41592. else {
  41593. _this.pusher.send_event('pusher:subscribe', {
  41594. auth: data.auth,
  41595. channel_data: data.channel_data,
  41596. channel: _this.name
  41597. });
  41598. }
  41599. });
  41600. };
  41601. Channel.prototype.unsubscribe = function () {
  41602. this.subscribed = false;
  41603. this.pusher.send_event('pusher:unsubscribe', {
  41604. channel: this.name
  41605. });
  41606. };
  41607. Channel.prototype.cancelSubscription = function () {
  41608. this.subscriptionCancelled = true;
  41609. };
  41610. Channel.prototype.reinstateSubscription = function () {
  41611. this.subscriptionCancelled = false;
  41612. };
  41613. return Channel;
  41614. }(dispatcher));
  41615. /* harmony default export */ var channels_channel = (channel_Channel);
  41616. // CONCATENATED MODULE: ./src/core/channels/private_channel.ts
  41617. var private_channel_extends = (undefined && undefined.__extends) || (function () {
  41618. var extendStatics = function (d, b) {
  41619. extendStatics = Object.setPrototypeOf ||
  41620. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  41621. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  41622. return extendStatics(d, b);
  41623. };
  41624. return function (d, b) {
  41625. extendStatics(d, b);
  41626. function __() { this.constructor = d; }
  41627. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  41628. };
  41629. })();
  41630. var private_channel_PrivateChannel = (function (_super) {
  41631. private_channel_extends(PrivateChannel, _super);
  41632. function PrivateChannel() {
  41633. return _super !== null && _super.apply(this, arguments) || this;
  41634. }
  41635. PrivateChannel.prototype.authorize = function (socketId, callback) {
  41636. var authorizer = factory.createAuthorizer(this, this.pusher.config);
  41637. return authorizer.authorize(socketId, callback);
  41638. };
  41639. return PrivateChannel;
  41640. }(channels_channel));
  41641. /* harmony default export */ var private_channel = (private_channel_PrivateChannel);
  41642. // CONCATENATED MODULE: ./src/core/channels/members.ts
  41643. var members_Members = (function () {
  41644. function Members() {
  41645. this.reset();
  41646. }
  41647. Members.prototype.get = function (id) {
  41648. if (Object.prototype.hasOwnProperty.call(this.members, id)) {
  41649. return {
  41650. id: id,
  41651. info: this.members[id]
  41652. };
  41653. }
  41654. else {
  41655. return null;
  41656. }
  41657. };
  41658. Members.prototype.each = function (callback) {
  41659. var _this = this;
  41660. objectApply(this.members, function (member, id) {
  41661. callback(_this.get(id));
  41662. });
  41663. };
  41664. Members.prototype.setMyID = function (id) {
  41665. this.myID = id;
  41666. };
  41667. Members.prototype.onSubscription = function (subscriptionData) {
  41668. this.members = subscriptionData.presence.hash;
  41669. this.count = subscriptionData.presence.count;
  41670. this.me = this.get(this.myID);
  41671. };
  41672. Members.prototype.addMember = function (memberData) {
  41673. if (this.get(memberData.user_id) === null) {
  41674. this.count++;
  41675. }
  41676. this.members[memberData.user_id] = memberData.user_info;
  41677. return this.get(memberData.user_id);
  41678. };
  41679. Members.prototype.removeMember = function (memberData) {
  41680. var member = this.get(memberData.user_id);
  41681. if (member) {
  41682. delete this.members[memberData.user_id];
  41683. this.count--;
  41684. }
  41685. return member;
  41686. };
  41687. Members.prototype.reset = function () {
  41688. this.members = {};
  41689. this.count = 0;
  41690. this.myID = null;
  41691. this.me = null;
  41692. };
  41693. return Members;
  41694. }());
  41695. /* harmony default export */ var members = (members_Members);
  41696. // CONCATENATED MODULE: ./src/core/channels/presence_channel.ts
  41697. var presence_channel_extends = (undefined && undefined.__extends) || (function () {
  41698. var extendStatics = function (d, b) {
  41699. extendStatics = Object.setPrototypeOf ||
  41700. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  41701. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  41702. return extendStatics(d, b);
  41703. };
  41704. return function (d, b) {
  41705. extendStatics(d, b);
  41706. function __() { this.constructor = d; }
  41707. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  41708. };
  41709. })();
  41710. var presence_channel_PresenceChannel = (function (_super) {
  41711. presence_channel_extends(PresenceChannel, _super);
  41712. function PresenceChannel(name, pusher) {
  41713. var _this = _super.call(this, name, pusher) || this;
  41714. _this.members = new members();
  41715. return _this;
  41716. }
  41717. PresenceChannel.prototype.authorize = function (socketId, callback) {
  41718. var _this = this;
  41719. _super.prototype.authorize.call(this, socketId, function (error, authData) {
  41720. if (!error) {
  41721. if (authData.channel_data === undefined) {
  41722. var suffix = url_store.buildLogSuffix("authenticationEndpoint");
  41723. logger.error("Invalid auth response for channel '" + _this.name + "'," +
  41724. ("expected 'channel_data' field. " + suffix));
  41725. callback("Invalid auth response");
  41726. return;
  41727. }
  41728. var channelData = JSON.parse(authData.channel_data);
  41729. _this.members.setMyID(channelData.user_id);
  41730. }
  41731. callback(error, authData);
  41732. });
  41733. };
  41734. PresenceChannel.prototype.handleEvent = function (event) {
  41735. var eventName = event.event;
  41736. if (eventName.indexOf("pusher_internal:") === 0) {
  41737. this.handleInternalEvent(event);
  41738. }
  41739. else {
  41740. var data = event.data;
  41741. var metadata = {};
  41742. if (event.user_id) {
  41743. metadata.user_id = event.user_id;
  41744. }
  41745. this.emit(eventName, data, metadata);
  41746. }
  41747. };
  41748. PresenceChannel.prototype.handleInternalEvent = function (event) {
  41749. var eventName = event.event;
  41750. var data = event.data;
  41751. switch (eventName) {
  41752. case "pusher_internal:subscription_succeeded":
  41753. this.handleSubscriptionSucceededEvent(event);
  41754. break;
  41755. case "pusher_internal:member_added":
  41756. var addedMember = this.members.addMember(data);
  41757. this.emit('pusher:member_added', addedMember);
  41758. break;
  41759. case "pusher_internal:member_removed":
  41760. var removedMember = this.members.removeMember(data);
  41761. if (removedMember) {
  41762. this.emit('pusher:member_removed', removedMember);
  41763. }
  41764. break;
  41765. }
  41766. };
  41767. PresenceChannel.prototype.handleSubscriptionSucceededEvent = function (event) {
  41768. this.subscriptionPending = false;
  41769. this.subscribed = true;
  41770. if (this.subscriptionCancelled) {
  41771. this.pusher.unsubscribe(this.name);
  41772. }
  41773. else {
  41774. this.members.onSubscription(event.data);
  41775. this.emit("pusher:subscription_succeeded", this.members);
  41776. }
  41777. };
  41778. PresenceChannel.prototype.disconnect = function () {
  41779. this.members.reset();
  41780. _super.prototype.disconnect.call(this);
  41781. };
  41782. return PresenceChannel;
  41783. }(private_channel));
  41784. /* harmony default export */ var presence_channel = (presence_channel_PresenceChannel);
  41785. // EXTERNAL MODULE: ./node_modules/tweetnacl/nacl-fast.js
  41786. var nacl_fast = __webpack_require__(0);
  41787. // EXTERNAL MODULE: ./node_modules/tweetnacl-util/nacl-util.js
  41788. var nacl_util = __webpack_require__(1);
  41789. // CONCATENATED MODULE: ./src/core/channels/encrypted_channel.ts
  41790. var encrypted_channel_extends = (undefined && undefined.__extends) || (function () {
  41791. var extendStatics = function (d, b) {
  41792. extendStatics = Object.setPrototypeOf ||
  41793. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  41794. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  41795. return extendStatics(d, b);
  41796. };
  41797. return function (d, b) {
  41798. extendStatics(d, b);
  41799. function __() { this.constructor = d; }
  41800. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  41801. };
  41802. })();
  41803. var encrypted_channel_EncryptedChannel = (function (_super) {
  41804. encrypted_channel_extends(EncryptedChannel, _super);
  41805. function EncryptedChannel() {
  41806. var _this = _super !== null && _super.apply(this, arguments) || this;
  41807. _this.key = null;
  41808. return _this;
  41809. }
  41810. EncryptedChannel.prototype.authorize = function (socketId, callback) {
  41811. var _this = this;
  41812. _super.prototype.authorize.call(this, socketId, function (error, authData) {
  41813. if (error) {
  41814. callback(true, authData);
  41815. return;
  41816. }
  41817. var sharedSecret = authData["shared_secret"];
  41818. if (!sharedSecret) {
  41819. var errorMsg = "No shared_secret key in auth payload for encrypted channel: " + _this.name;
  41820. callback(true, errorMsg);
  41821. return;
  41822. }
  41823. _this.key = Object(nacl_util["decodeBase64"])(sharedSecret);
  41824. delete authData["shared_secret"];
  41825. callback(false, authData);
  41826. });
  41827. };
  41828. EncryptedChannel.prototype.trigger = function (event, data) {
  41829. throw new UnsupportedFeature('Client events are not currently supported for encrypted channels');
  41830. };
  41831. EncryptedChannel.prototype.handleEvent = function (event) {
  41832. var eventName = event.event;
  41833. var data = event.data;
  41834. if (eventName.indexOf("pusher_internal:") === 0 || eventName.indexOf("pusher:") === 0) {
  41835. _super.prototype.handleEvent.call(this, event);
  41836. return;
  41837. }
  41838. this.handleEncryptedEvent(eventName, data);
  41839. };
  41840. EncryptedChannel.prototype.handleEncryptedEvent = function (event, data) {
  41841. var _this = this;
  41842. if (!this.key) {
  41843. logger.debug('Received encrypted event before key has been retrieved from the authEndpoint');
  41844. return;
  41845. }
  41846. if (!data.ciphertext || !data.nonce) {
  41847. logger.error('Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: ' + data);
  41848. return;
  41849. }
  41850. var cipherText = Object(nacl_util["decodeBase64"])(data.ciphertext);
  41851. if (cipherText.length < nacl_fast["secretbox"].overheadLength) {
  41852. logger.error("Expected encrypted event ciphertext length to be " + nacl_fast["secretbox"].overheadLength + ", got: " + cipherText.length);
  41853. return;
  41854. }
  41855. var nonce = Object(nacl_util["decodeBase64"])(data.nonce);
  41856. if (nonce.length < nacl_fast["secretbox"].nonceLength) {
  41857. logger.error("Expected encrypted event nonce length to be " + nacl_fast["secretbox"].nonceLength + ", got: " + nonce.length);
  41858. return;
  41859. }
  41860. var bytes = nacl_fast["secretbox"].open(cipherText, nonce, this.key);
  41861. if (bytes === null) {
  41862. logger.debug('Failed to decrypt an event, probably because it was encrypted with a different key. Fetching a new key from the authEndpoint...');
  41863. this.authorize(this.pusher.connection.socket_id, function (error, authData) {
  41864. if (error) {
  41865. logger.error("Failed to make a request to the authEndpoint: " + authData + ". Unable to fetch new key, so dropping encrypted event");
  41866. return;
  41867. }
  41868. bytes = nacl_fast["secretbox"].open(cipherText, nonce, _this.key);
  41869. if (bytes === null) {
  41870. logger.error("Failed to decrypt event with new key. Dropping encrypted event");
  41871. return;
  41872. }
  41873. _this.emitJSON(event, Object(nacl_util["encodeUTF8"])(bytes));
  41874. return;
  41875. });
  41876. return;
  41877. }
  41878. this.emitJSON(event, Object(nacl_util["encodeUTF8"])(bytes));
  41879. };
  41880. EncryptedChannel.prototype.emitJSON = function (eventName, data) {
  41881. try {
  41882. this.emit(eventName, JSON.parse(data));
  41883. }
  41884. catch (e) {
  41885. this.emit(eventName, data);
  41886. }
  41887. return this;
  41888. };
  41889. return EncryptedChannel;
  41890. }(private_channel));
  41891. /* harmony default export */ var encrypted_channel = (encrypted_channel_EncryptedChannel);
  41892. // CONCATENATED MODULE: ./src/core/connection/connection_manager.ts
  41893. var connection_manager_extends = (undefined && undefined.__extends) || (function () {
  41894. var extendStatics = function (d, b) {
  41895. extendStatics = Object.setPrototypeOf ||
  41896. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  41897. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  41898. return extendStatics(d, b);
  41899. };
  41900. return function (d, b) {
  41901. extendStatics(d, b);
  41902. function __() { this.constructor = d; }
  41903. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  41904. };
  41905. })();
  41906. var connection_manager_ConnectionManager = (function (_super) {
  41907. connection_manager_extends(ConnectionManager, _super);
  41908. function ConnectionManager(key, options) {
  41909. var _this = _super.call(this) || this;
  41910. _this.key = key;
  41911. _this.options = options || {};
  41912. _this.state = "initialized";
  41913. _this.connection = null;
  41914. _this.usingTLS = !!options.useTLS;
  41915. _this.timeline = _this.options.timeline;
  41916. _this.errorCallbacks = _this.buildErrorCallbacks();
  41917. _this.connectionCallbacks = _this.buildConnectionCallbacks(_this.errorCallbacks);
  41918. _this.handshakeCallbacks = _this.buildHandshakeCallbacks(_this.errorCallbacks);
  41919. var Network = runtime.getNetwork();
  41920. Network.bind("online", function () {
  41921. _this.timeline.info({ netinfo: "online" });
  41922. if (_this.state === "connecting" || _this.state === "unavailable") {
  41923. _this.retryIn(0);
  41924. }
  41925. });
  41926. Network.bind("offline", function () {
  41927. _this.timeline.info({ netinfo: "offline" });
  41928. if (_this.connection) {
  41929. _this.sendActivityCheck();
  41930. }
  41931. });
  41932. _this.updateStrategy();
  41933. return _this;
  41934. }
  41935. ConnectionManager.prototype.connect = function () {
  41936. if (this.connection || this.runner) {
  41937. return;
  41938. }
  41939. if (!this.strategy.isSupported()) {
  41940. this.updateState("failed");
  41941. return;
  41942. }
  41943. this.updateState("connecting");
  41944. this.startConnecting();
  41945. this.setUnavailableTimer();
  41946. };
  41947. ;
  41948. ConnectionManager.prototype.send = function (data) {
  41949. if (this.connection) {
  41950. return this.connection.send(data);
  41951. }
  41952. else {
  41953. return false;
  41954. }
  41955. };
  41956. ;
  41957. ConnectionManager.prototype.send_event = function (name, data, channel) {
  41958. if (this.connection) {
  41959. return this.connection.send_event(name, data, channel);
  41960. }
  41961. else {
  41962. return false;
  41963. }
  41964. };
  41965. ;
  41966. ConnectionManager.prototype.disconnect = function () {
  41967. this.disconnectInternally();
  41968. this.updateState("disconnected");
  41969. };
  41970. ;
  41971. ConnectionManager.prototype.isUsingTLS = function () {
  41972. return this.usingTLS;
  41973. };
  41974. ;
  41975. ConnectionManager.prototype.startConnecting = function () {
  41976. var _this = this;
  41977. var callback = function (error, handshake) {
  41978. if (error) {
  41979. _this.runner = _this.strategy.connect(0, callback);
  41980. }
  41981. else {
  41982. if (handshake.action === "error") {
  41983. _this.emit("error", { type: "HandshakeError", error: handshake.error });
  41984. _this.timeline.error({ handshakeError: handshake.error });
  41985. }
  41986. else {
  41987. _this.abortConnecting();
  41988. _this.handshakeCallbacks[handshake.action](handshake);
  41989. }
  41990. }
  41991. };
  41992. this.runner = this.strategy.connect(0, callback);
  41993. };
  41994. ;
  41995. ConnectionManager.prototype.abortConnecting = function () {
  41996. if (this.runner) {
  41997. this.runner.abort();
  41998. this.runner = null;
  41999. }
  42000. };
  42001. ;
  42002. ConnectionManager.prototype.disconnectInternally = function () {
  42003. this.abortConnecting();
  42004. this.clearRetryTimer();
  42005. this.clearUnavailableTimer();
  42006. if (this.connection) {
  42007. var connection = this.abandonConnection();
  42008. connection.close();
  42009. }
  42010. };
  42011. ;
  42012. ConnectionManager.prototype.updateStrategy = function () {
  42013. this.strategy = this.options.getStrategy({
  42014. key: this.key,
  42015. timeline: this.timeline,
  42016. useTLS: this.usingTLS
  42017. });
  42018. };
  42019. ;
  42020. ConnectionManager.prototype.retryIn = function (delay) {
  42021. var _this = this;
  42022. this.timeline.info({ action: "retry", delay: delay });
  42023. if (delay > 0) {
  42024. this.emit("connecting_in", Math.round(delay / 1000));
  42025. }
  42026. this.retryTimer = new OneOffTimer(delay || 0, function () {
  42027. _this.disconnectInternally();
  42028. _this.connect();
  42029. });
  42030. };
  42031. ;
  42032. ConnectionManager.prototype.clearRetryTimer = function () {
  42033. if (this.retryTimer) {
  42034. this.retryTimer.ensureAborted();
  42035. this.retryTimer = null;
  42036. }
  42037. };
  42038. ;
  42039. ConnectionManager.prototype.setUnavailableTimer = function () {
  42040. var _this = this;
  42041. this.unavailableTimer = new OneOffTimer(this.options.unavailableTimeout, function () {
  42042. _this.updateState("unavailable");
  42043. });
  42044. };
  42045. ;
  42046. ConnectionManager.prototype.clearUnavailableTimer = function () {
  42047. if (this.unavailableTimer) {
  42048. this.unavailableTimer.ensureAborted();
  42049. }
  42050. };
  42051. ;
  42052. ConnectionManager.prototype.sendActivityCheck = function () {
  42053. var _this = this;
  42054. this.stopActivityCheck();
  42055. this.connection.ping();
  42056. this.activityTimer = new OneOffTimer(this.options.pongTimeout, function () {
  42057. _this.timeline.error({ pong_timed_out: _this.options.pongTimeout });
  42058. _this.retryIn(0);
  42059. });
  42060. };
  42061. ;
  42062. ConnectionManager.prototype.resetActivityCheck = function () {
  42063. var _this = this;
  42064. this.stopActivityCheck();
  42065. if (this.connection && !this.connection.handlesActivityChecks()) {
  42066. this.activityTimer = new OneOffTimer(this.activityTimeout, function () {
  42067. _this.sendActivityCheck();
  42068. });
  42069. }
  42070. };
  42071. ;
  42072. ConnectionManager.prototype.stopActivityCheck = function () {
  42073. if (this.activityTimer) {
  42074. this.activityTimer.ensureAborted();
  42075. }
  42076. };
  42077. ;
  42078. ConnectionManager.prototype.buildConnectionCallbacks = function (errorCallbacks) {
  42079. var _this = this;
  42080. return extend({}, errorCallbacks, {
  42081. message: function (message) {
  42082. _this.resetActivityCheck();
  42083. _this.emit('message', message);
  42084. },
  42085. ping: function () {
  42086. _this.send_event('pusher:pong', {});
  42087. },
  42088. activity: function () {
  42089. _this.resetActivityCheck();
  42090. },
  42091. error: function (error) {
  42092. _this.emit("error", { type: "WebSocketError", error: error });
  42093. },
  42094. closed: function () {
  42095. _this.abandonConnection();
  42096. if (_this.shouldRetry()) {
  42097. _this.retryIn(1000);
  42098. }
  42099. }
  42100. });
  42101. };
  42102. ;
  42103. ConnectionManager.prototype.buildHandshakeCallbacks = function (errorCallbacks) {
  42104. var _this = this;
  42105. return extend({}, errorCallbacks, {
  42106. connected: function (handshake) {
  42107. _this.activityTimeout = Math.min(_this.options.activityTimeout, handshake.activityTimeout, handshake.connection.activityTimeout || Infinity);
  42108. _this.clearUnavailableTimer();
  42109. _this.setConnection(handshake.connection);
  42110. _this.socket_id = _this.connection.id;
  42111. _this.updateState("connected", { socket_id: _this.socket_id });
  42112. }
  42113. });
  42114. };
  42115. ;
  42116. ConnectionManager.prototype.buildErrorCallbacks = function () {
  42117. var _this = this;
  42118. var withErrorEmitted = function (callback) {
  42119. return function (result) {
  42120. if (result.error) {
  42121. _this.emit("error", { type: "WebSocketError", error: result.error });
  42122. }
  42123. callback(result);
  42124. };
  42125. };
  42126. return {
  42127. tls_only: withErrorEmitted(function () {
  42128. _this.usingTLS = true;
  42129. _this.updateStrategy();
  42130. _this.retryIn(0);
  42131. }),
  42132. refused: withErrorEmitted(function () {
  42133. _this.disconnect();
  42134. }),
  42135. backoff: withErrorEmitted(function () {
  42136. _this.retryIn(1000);
  42137. }),
  42138. retry: withErrorEmitted(function () {
  42139. _this.retryIn(0);
  42140. })
  42141. };
  42142. };
  42143. ;
  42144. ConnectionManager.prototype.setConnection = function (connection) {
  42145. this.connection = connection;
  42146. for (var event in this.connectionCallbacks) {
  42147. this.connection.bind(event, this.connectionCallbacks[event]);
  42148. }
  42149. this.resetActivityCheck();
  42150. };
  42151. ;
  42152. ConnectionManager.prototype.abandonConnection = function () {
  42153. if (!this.connection) {
  42154. return;
  42155. }
  42156. this.stopActivityCheck();
  42157. for (var event in this.connectionCallbacks) {
  42158. this.connection.unbind(event, this.connectionCallbacks[event]);
  42159. }
  42160. var connection = this.connection;
  42161. this.connection = null;
  42162. return connection;
  42163. };
  42164. ConnectionManager.prototype.updateState = function (newState, data) {
  42165. var previousState = this.state;
  42166. this.state = newState;
  42167. if (previousState !== newState) {
  42168. var newStateDescription = newState;
  42169. if (newStateDescription === "connected") {
  42170. newStateDescription += " with new socket ID " + data.socket_id;
  42171. }
  42172. logger.debug('State changed', previousState + ' -> ' + newStateDescription);
  42173. this.timeline.info({ state: newState, params: data });
  42174. this.emit('state_change', { previous: previousState, current: newState });
  42175. this.emit(newState, data);
  42176. }
  42177. };
  42178. ConnectionManager.prototype.shouldRetry = function () {
  42179. return this.state === "connecting" || this.state === "connected";
  42180. };
  42181. return ConnectionManager;
  42182. }(dispatcher));
  42183. /* harmony default export */ var connection_manager = (connection_manager_ConnectionManager);
  42184. // CONCATENATED MODULE: ./src/core/channels/channels.ts
  42185. var channels_Channels = (function () {
  42186. function Channels() {
  42187. this.channels = {};
  42188. }
  42189. Channels.prototype.add = function (name, pusher) {
  42190. if (!this.channels[name]) {
  42191. this.channels[name] = createChannel(name, pusher);
  42192. }
  42193. return this.channels[name];
  42194. };
  42195. Channels.prototype.all = function () {
  42196. return values(this.channels);
  42197. };
  42198. Channels.prototype.find = function (name) {
  42199. return this.channels[name];
  42200. };
  42201. Channels.prototype.remove = function (name) {
  42202. var channel = this.channels[name];
  42203. delete this.channels[name];
  42204. return channel;
  42205. };
  42206. Channels.prototype.disconnect = function () {
  42207. objectApply(this.channels, function (channel) {
  42208. channel.disconnect();
  42209. });
  42210. };
  42211. return Channels;
  42212. }());
  42213. /* harmony default export */ var channels = (channels_Channels);
  42214. function createChannel(name, pusher) {
  42215. if (name.indexOf('private-encrypted-') === 0) {
  42216. if (false) { var errorMsg; }
  42217. return factory.createEncryptedChannel(name, pusher);
  42218. }
  42219. else if (name.indexOf('private-') === 0) {
  42220. return factory.createPrivateChannel(name, pusher);
  42221. }
  42222. else if (name.indexOf('presence-') === 0) {
  42223. return factory.createPresenceChannel(name, pusher);
  42224. }
  42225. else {
  42226. return factory.createChannel(name, pusher);
  42227. }
  42228. }
  42229. // CONCATENATED MODULE: ./src/core/utils/factory.ts
  42230. var Factory = {
  42231. createChannels: function () {
  42232. return new channels();
  42233. },
  42234. createConnectionManager: function (key, options) {
  42235. return new connection_manager(key, options);
  42236. },
  42237. createChannel: function (name, pusher) {
  42238. return new channels_channel(name, pusher);
  42239. },
  42240. createPrivateChannel: function (name, pusher) {
  42241. return new private_channel(name, pusher);
  42242. },
  42243. createPresenceChannel: function (name, pusher) {
  42244. return new presence_channel(name, pusher);
  42245. },
  42246. createEncryptedChannel: function (name, pusher) {
  42247. return new encrypted_channel(name, pusher);
  42248. },
  42249. createTimelineSender: function (timeline, options) {
  42250. return new timeline_sender(timeline, options);
  42251. },
  42252. createAuthorizer: function (channel, options) {
  42253. if (options.authorizer) {
  42254. return options.authorizer(channel, options);
  42255. }
  42256. return new pusher_authorizer(channel, options);
  42257. },
  42258. createHandshake: function (transport, callback) {
  42259. return new connection_handshake(transport, callback);
  42260. },
  42261. createAssistantToTheTransportManager: function (manager, transport, options) {
  42262. return new assistant_to_the_transport_manager(manager, transport, options);
  42263. }
  42264. };
  42265. /* harmony default export */ var factory = (Factory);
  42266. // CONCATENATED MODULE: ./src/core/transports/transport_manager.ts
  42267. var transport_manager_TransportManager = (function () {
  42268. function TransportManager(options) {
  42269. this.options = options || {};
  42270. this.livesLeft = this.options.lives || Infinity;
  42271. }
  42272. TransportManager.prototype.getAssistant = function (transport) {
  42273. return factory.createAssistantToTheTransportManager(this, transport, {
  42274. minPingDelay: this.options.minPingDelay,
  42275. maxPingDelay: this.options.maxPingDelay
  42276. });
  42277. };
  42278. TransportManager.prototype.isAlive = function () {
  42279. return this.livesLeft > 0;
  42280. };
  42281. TransportManager.prototype.reportDeath = function () {
  42282. this.livesLeft -= 1;
  42283. };
  42284. return TransportManager;
  42285. }());
  42286. /* harmony default export */ var transport_manager = (transport_manager_TransportManager);
  42287. // CONCATENATED MODULE: ./src/core/strategies/sequential_strategy.ts
  42288. var sequential_strategy_SequentialStrategy = (function () {
  42289. function SequentialStrategy(strategies, options) {
  42290. this.strategies = strategies;
  42291. this.loop = Boolean(options.loop);
  42292. this.failFast = Boolean(options.failFast);
  42293. this.timeout = options.timeout;
  42294. this.timeoutLimit = options.timeoutLimit;
  42295. }
  42296. SequentialStrategy.prototype.isSupported = function () {
  42297. return any(this.strategies, util.method("isSupported"));
  42298. };
  42299. SequentialStrategy.prototype.connect = function (minPriority, callback) {
  42300. var _this = this;
  42301. var strategies = this.strategies;
  42302. var current = 0;
  42303. var timeout = this.timeout;
  42304. var runner = null;
  42305. var tryNextStrategy = function (error, handshake) {
  42306. if (handshake) {
  42307. callback(null, handshake);
  42308. }
  42309. else {
  42310. current = current + 1;
  42311. if (_this.loop) {
  42312. current = current % strategies.length;
  42313. }
  42314. if (current < strategies.length) {
  42315. if (timeout) {
  42316. timeout = timeout * 2;
  42317. if (_this.timeoutLimit) {
  42318. timeout = Math.min(timeout, _this.timeoutLimit);
  42319. }
  42320. }
  42321. runner = _this.tryStrategy(strategies[current], minPriority, { timeout: timeout, failFast: _this.failFast }, tryNextStrategy);
  42322. }
  42323. else {
  42324. callback(true);
  42325. }
  42326. }
  42327. };
  42328. runner = this.tryStrategy(strategies[current], minPriority, { timeout: timeout, failFast: this.failFast }, tryNextStrategy);
  42329. return {
  42330. abort: function () {
  42331. runner.abort();
  42332. },
  42333. forceMinPriority: function (p) {
  42334. minPriority = p;
  42335. if (runner) {
  42336. runner.forceMinPriority(p);
  42337. }
  42338. }
  42339. };
  42340. };
  42341. SequentialStrategy.prototype.tryStrategy = function (strategy, minPriority, options, callback) {
  42342. var timer = null;
  42343. var runner = null;
  42344. if (options.timeout > 0) {
  42345. timer = new OneOffTimer(options.timeout, function () {
  42346. runner.abort();
  42347. callback(true);
  42348. });
  42349. }
  42350. runner = strategy.connect(minPriority, function (error, handshake) {
  42351. if (error && timer && timer.isRunning() && !options.failFast) {
  42352. return;
  42353. }
  42354. if (timer) {
  42355. timer.ensureAborted();
  42356. }
  42357. callback(error, handshake);
  42358. });
  42359. return {
  42360. abort: function () {
  42361. if (timer) {
  42362. timer.ensureAborted();
  42363. }
  42364. runner.abort();
  42365. },
  42366. forceMinPriority: function (p) {
  42367. runner.forceMinPriority(p);
  42368. }
  42369. };
  42370. };
  42371. return SequentialStrategy;
  42372. }());
  42373. /* harmony default export */ var sequential_strategy = (sequential_strategy_SequentialStrategy);
  42374. // CONCATENATED MODULE: ./src/core/strategies/best_connected_ever_strategy.ts
  42375. var best_connected_ever_strategy_BestConnectedEverStrategy = (function () {
  42376. function BestConnectedEverStrategy(strategies) {
  42377. this.strategies = strategies;
  42378. }
  42379. BestConnectedEverStrategy.prototype.isSupported = function () {
  42380. return any(this.strategies, util.method("isSupported"));
  42381. };
  42382. BestConnectedEverStrategy.prototype.connect = function (minPriority, callback) {
  42383. return connect(this.strategies, minPriority, function (i, runners) {
  42384. return function (error, handshake) {
  42385. runners[i].error = error;
  42386. if (error) {
  42387. if (allRunnersFailed(runners)) {
  42388. callback(true);
  42389. }
  42390. return;
  42391. }
  42392. apply(runners, function (runner) {
  42393. runner.forceMinPriority(handshake.transport.priority);
  42394. });
  42395. callback(null, handshake);
  42396. };
  42397. });
  42398. };
  42399. return BestConnectedEverStrategy;
  42400. }());
  42401. /* harmony default export */ var best_connected_ever_strategy = (best_connected_ever_strategy_BestConnectedEverStrategy);
  42402. function connect(strategies, minPriority, callbackBuilder) {
  42403. var runners = map(strategies, function (strategy, i, _, rs) {
  42404. return strategy.connect(minPriority, callbackBuilder(i, rs));
  42405. });
  42406. return {
  42407. abort: function () {
  42408. apply(runners, abortRunner);
  42409. },
  42410. forceMinPriority: function (p) {
  42411. apply(runners, function (runner) {
  42412. runner.forceMinPriority(p);
  42413. });
  42414. }
  42415. };
  42416. }
  42417. function allRunnersFailed(runners) {
  42418. return collections_all(runners, function (runner) {
  42419. return Boolean(runner.error);
  42420. });
  42421. }
  42422. function abortRunner(runner) {
  42423. if (!runner.error && !runner.aborted) {
  42424. runner.abort();
  42425. runner.aborted = true;
  42426. }
  42427. }
  42428. // CONCATENATED MODULE: ./src/core/strategies/cached_strategy.ts
  42429. var cached_strategy_CachedStrategy = (function () {
  42430. function CachedStrategy(strategy, transports, options) {
  42431. this.strategy = strategy;
  42432. this.transports = transports;
  42433. this.ttl = options.ttl || 1800 * 1000;
  42434. this.usingTLS = options.useTLS;
  42435. this.timeline = options.timeline;
  42436. }
  42437. CachedStrategy.prototype.isSupported = function () {
  42438. return this.strategy.isSupported();
  42439. };
  42440. CachedStrategy.prototype.connect = function (minPriority, callback) {
  42441. var usingTLS = this.usingTLS;
  42442. var info = fetchTransportCache(usingTLS);
  42443. var strategies = [this.strategy];
  42444. if (info && info.timestamp + this.ttl >= util.now()) {
  42445. var transport = this.transports[info.transport];
  42446. if (transport) {
  42447. this.timeline.info({
  42448. cached: true,
  42449. transport: info.transport,
  42450. latency: info.latency
  42451. });
  42452. strategies.push(new sequential_strategy([transport], {
  42453. timeout: info.latency * 2 + 1000,
  42454. failFast: true
  42455. }));
  42456. }
  42457. }
  42458. var startTimestamp = util.now();
  42459. var runner = strategies.pop().connect(minPriority, function cb(error, handshake) {
  42460. if (error) {
  42461. flushTransportCache(usingTLS);
  42462. if (strategies.length > 0) {
  42463. startTimestamp = util.now();
  42464. runner = strategies.pop().connect(minPriority, cb);
  42465. }
  42466. else {
  42467. callback(error);
  42468. }
  42469. }
  42470. else {
  42471. storeTransportCache(usingTLS, handshake.transport.name, util.now() - startTimestamp);
  42472. callback(null, handshake);
  42473. }
  42474. });
  42475. return {
  42476. abort: function () {
  42477. runner.abort();
  42478. },
  42479. forceMinPriority: function (p) {
  42480. minPriority = p;
  42481. if (runner) {
  42482. runner.forceMinPriority(p);
  42483. }
  42484. }
  42485. };
  42486. };
  42487. return CachedStrategy;
  42488. }());
  42489. /* harmony default export */ var cached_strategy = (cached_strategy_CachedStrategy);
  42490. function getTransportCacheKey(usingTLS) {
  42491. return "pusherTransport" + (usingTLS ? "TLS" : "NonTLS");
  42492. }
  42493. function fetchTransportCache(usingTLS) {
  42494. var storage = runtime.getLocalStorage();
  42495. if (storage) {
  42496. try {
  42497. var serializedCache = storage[getTransportCacheKey(usingTLS)];
  42498. if (serializedCache) {
  42499. return JSON.parse(serializedCache);
  42500. }
  42501. }
  42502. catch (e) {
  42503. flushTransportCache(usingTLS);
  42504. }
  42505. }
  42506. return null;
  42507. }
  42508. function storeTransportCache(usingTLS, transport, latency) {
  42509. var storage = runtime.getLocalStorage();
  42510. if (storage) {
  42511. try {
  42512. storage[getTransportCacheKey(usingTLS)] = safeJSONStringify({
  42513. timestamp: util.now(),
  42514. transport: transport,
  42515. latency: latency
  42516. });
  42517. }
  42518. catch (e) {
  42519. }
  42520. }
  42521. }
  42522. function flushTransportCache(usingTLS) {
  42523. var storage = runtime.getLocalStorage();
  42524. if (storage) {
  42525. try {
  42526. delete storage[getTransportCacheKey(usingTLS)];
  42527. }
  42528. catch (e) {
  42529. }
  42530. }
  42531. }
  42532. // CONCATENATED MODULE: ./src/core/strategies/delayed_strategy.ts
  42533. var delayed_strategy_DelayedStrategy = (function () {
  42534. function DelayedStrategy(strategy, _a) {
  42535. var number = _a.delay;
  42536. this.strategy = strategy;
  42537. this.options = { delay: number };
  42538. }
  42539. DelayedStrategy.prototype.isSupported = function () {
  42540. return this.strategy.isSupported();
  42541. };
  42542. DelayedStrategy.prototype.connect = function (minPriority, callback) {
  42543. var strategy = this.strategy;
  42544. var runner;
  42545. var timer = new OneOffTimer(this.options.delay, function () {
  42546. runner = strategy.connect(minPriority, callback);
  42547. });
  42548. return {
  42549. abort: function () {
  42550. timer.ensureAborted();
  42551. if (runner) {
  42552. runner.abort();
  42553. }
  42554. },
  42555. forceMinPriority: function (p) {
  42556. minPriority = p;
  42557. if (runner) {
  42558. runner.forceMinPriority(p);
  42559. }
  42560. }
  42561. };
  42562. };
  42563. return DelayedStrategy;
  42564. }());
  42565. /* harmony default export */ var delayed_strategy = (delayed_strategy_DelayedStrategy);
  42566. // CONCATENATED MODULE: ./src/core/strategies/if_strategy.ts
  42567. var IfStrategy = (function () {
  42568. function IfStrategy(test, trueBranch, falseBranch) {
  42569. this.test = test;
  42570. this.trueBranch = trueBranch;
  42571. this.falseBranch = falseBranch;
  42572. }
  42573. IfStrategy.prototype.isSupported = function () {
  42574. var branch = this.test() ? this.trueBranch : this.falseBranch;
  42575. return branch.isSupported();
  42576. };
  42577. IfStrategy.prototype.connect = function (minPriority, callback) {
  42578. var branch = this.test() ? this.trueBranch : this.falseBranch;
  42579. return branch.connect(minPriority, callback);
  42580. };
  42581. return IfStrategy;
  42582. }());
  42583. /* harmony default export */ var if_strategy = (IfStrategy);
  42584. // CONCATENATED MODULE: ./src/core/strategies/first_connected_strategy.ts
  42585. var FirstConnectedStrategy = (function () {
  42586. function FirstConnectedStrategy(strategy) {
  42587. this.strategy = strategy;
  42588. }
  42589. FirstConnectedStrategy.prototype.isSupported = function () {
  42590. return this.strategy.isSupported();
  42591. };
  42592. FirstConnectedStrategy.prototype.connect = function (minPriority, callback) {
  42593. var runner = this.strategy.connect(minPriority, function (error, handshake) {
  42594. if (handshake) {
  42595. runner.abort();
  42596. }
  42597. callback(error, handshake);
  42598. });
  42599. return runner;
  42600. };
  42601. return FirstConnectedStrategy;
  42602. }());
  42603. /* harmony default export */ var first_connected_strategy = (FirstConnectedStrategy);
  42604. // CONCATENATED MODULE: ./src/runtimes/web/default_strategy.ts
  42605. function testSupportsStrategy(strategy) {
  42606. return function () {
  42607. return strategy.isSupported();
  42608. };
  42609. }
  42610. var getDefaultStrategy = function (config, defineTransport) {
  42611. var definedTransports = {};
  42612. function defineTransportStrategy(name, type, priority, options, manager) {
  42613. var transport = defineTransport(config, name, type, priority, options, manager);
  42614. definedTransports[name] = transport;
  42615. return transport;
  42616. }
  42617. var ws_options = {
  42618. hostNonTLS: config.wsHost + ":" + config.wsPort,
  42619. hostTLS: config.wsHost + ":" + config.wssPort,
  42620. httpPath: config.wsPath
  42621. };
  42622. var wss_options = extend({}, ws_options, {
  42623. useTLS: true
  42624. });
  42625. var sockjs_options = {
  42626. hostNonTLS: config.httpHost + ":" + config.httpPort,
  42627. hostTLS: config.httpHost + ":" + config.httpsPort,
  42628. httpPath: config.httpPath
  42629. };
  42630. var timeouts = {
  42631. loop: true,
  42632. timeout: 15000,
  42633. timeoutLimit: 60000
  42634. };
  42635. var ws_manager = new transport_manager({
  42636. lives: 2,
  42637. minPingDelay: 10000,
  42638. maxPingDelay: config.activity_timeout
  42639. });
  42640. var streaming_manager = new transport_manager({
  42641. lives: 2,
  42642. minPingDelay: 10000,
  42643. maxPingDelay: config.activity_timeout
  42644. });
  42645. var ws_transport = defineTransportStrategy("ws", "ws", 3, ws_options, ws_manager);
  42646. var wss_transport = defineTransportStrategy("wss", "ws", 3, wss_options, ws_manager);
  42647. var sockjs_transport = defineTransportStrategy("sockjs", "sockjs", 1, sockjs_options);
  42648. var xhr_streaming_transport = defineTransportStrategy("xhr_streaming", "xhr_streaming", 1, sockjs_options, streaming_manager);
  42649. var xdr_streaming_transport = defineTransportStrategy("xdr_streaming", "xdr_streaming", 1, sockjs_options, streaming_manager);
  42650. var xhr_polling_transport = defineTransportStrategy("xhr_polling", "xhr_polling", 1, sockjs_options);
  42651. var xdr_polling_transport = defineTransportStrategy("xdr_polling", "xdr_polling", 1, sockjs_options);
  42652. var ws_loop = new sequential_strategy([ws_transport], timeouts);
  42653. var wss_loop = new sequential_strategy([wss_transport], timeouts);
  42654. var sockjs_loop = new sequential_strategy([sockjs_transport], timeouts);
  42655. var streaming_loop = new sequential_strategy([new if_strategy(testSupportsStrategy(xhr_streaming_transport), xhr_streaming_transport, xdr_streaming_transport)], timeouts);
  42656. var polling_loop = new sequential_strategy([new if_strategy(testSupportsStrategy(xhr_polling_transport), xhr_polling_transport, xdr_polling_transport)], timeouts);
  42657. var http_loop = new sequential_strategy([new if_strategy(testSupportsStrategy(streaming_loop), new best_connected_ever_strategy([streaming_loop, new delayed_strategy(polling_loop, { delay: 4000 })]), polling_loop)], timeouts);
  42658. var http_fallback_loop = new if_strategy(testSupportsStrategy(http_loop), http_loop, sockjs_loop);
  42659. var wsStrategy;
  42660. if (config.useTLS) {
  42661. wsStrategy = new best_connected_ever_strategy([ws_loop, new delayed_strategy(http_fallback_loop, { delay: 2000 })]);
  42662. }
  42663. else {
  42664. wsStrategy = new best_connected_ever_strategy([
  42665. ws_loop,
  42666. new delayed_strategy(wss_loop, { delay: 2000 }),
  42667. new delayed_strategy(http_fallback_loop, { delay: 5000 })
  42668. ]);
  42669. }
  42670. return new cached_strategy(new first_connected_strategy(new if_strategy(testSupportsStrategy(ws_transport), wsStrategy, http_fallback_loop)), definedTransports, {
  42671. ttl: 1800000,
  42672. timeline: config.timeline,
  42673. useTLS: config.useTLS
  42674. });
  42675. };
  42676. /* harmony default export */ var default_strategy = (getDefaultStrategy);
  42677. // CONCATENATED MODULE: ./src/runtimes/web/transports/transport_connection_initializer.ts
  42678. /* harmony default export */ var transport_connection_initializer = (function () {
  42679. var self = this;
  42680. self.timeline.info(self.buildTimelineMessage({
  42681. transport: self.name + (self.options.useTLS ? "s" : "")
  42682. }));
  42683. if (self.hooks.isInitialized()) {
  42684. self.changeState("initialized");
  42685. }
  42686. else if (self.hooks.file) {
  42687. self.changeState("initializing");
  42688. Dependencies.load(self.hooks.file, { useTLS: self.options.useTLS }, function (error, callback) {
  42689. if (self.hooks.isInitialized()) {
  42690. self.changeState("initialized");
  42691. callback(true);
  42692. }
  42693. else {
  42694. if (error) {
  42695. self.onError(error);
  42696. }
  42697. self.onClose();
  42698. callback(false);
  42699. }
  42700. });
  42701. }
  42702. else {
  42703. self.onClose();
  42704. }
  42705. });
  42706. // CONCATENATED MODULE: ./src/runtimes/web/http/http_xdomain_request.ts
  42707. var http_xdomain_request_hooks = {
  42708. getRequest: function (socket) {
  42709. var xdr = new window.XDomainRequest();
  42710. xdr.ontimeout = function () {
  42711. socket.emit("error", new RequestTimedOut());
  42712. socket.close();
  42713. };
  42714. xdr.onerror = function (e) {
  42715. socket.emit("error", e);
  42716. socket.close();
  42717. };
  42718. xdr.onprogress = function () {
  42719. if (xdr.responseText && xdr.responseText.length > 0) {
  42720. socket.onChunk(200, xdr.responseText);
  42721. }
  42722. };
  42723. xdr.onload = function () {
  42724. if (xdr.responseText && xdr.responseText.length > 0) {
  42725. socket.onChunk(200, xdr.responseText);
  42726. }
  42727. socket.emit("finished", 200);
  42728. socket.close();
  42729. };
  42730. return xdr;
  42731. },
  42732. abortRequest: function (xdr) {
  42733. xdr.ontimeout = xdr.onerror = xdr.onprogress = xdr.onload = null;
  42734. xdr.abort();
  42735. }
  42736. };
  42737. /* harmony default export */ var http_xdomain_request = (http_xdomain_request_hooks);
  42738. // CONCATENATED MODULE: ./src/core/http/http_request.ts
  42739. var http_request_extends = (undefined && undefined.__extends) || (function () {
  42740. var extendStatics = function (d, b) {
  42741. extendStatics = Object.setPrototypeOf ||
  42742. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  42743. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  42744. return extendStatics(d, b);
  42745. };
  42746. return function (d, b) {
  42747. extendStatics(d, b);
  42748. function __() { this.constructor = d; }
  42749. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  42750. };
  42751. })();
  42752. var MAX_BUFFER_LENGTH = 256 * 1024;
  42753. var http_request_HTTPRequest = (function (_super) {
  42754. http_request_extends(HTTPRequest, _super);
  42755. function HTTPRequest(hooks, method, url) {
  42756. var _this = _super.call(this) || this;
  42757. _this.hooks = hooks;
  42758. _this.method = method;
  42759. _this.url = url;
  42760. return _this;
  42761. }
  42762. HTTPRequest.prototype.start = function (payload) {
  42763. var _this = this;
  42764. this.position = 0;
  42765. this.xhr = this.hooks.getRequest(this);
  42766. this.unloader = function () {
  42767. _this.close();
  42768. };
  42769. runtime.addUnloadListener(this.unloader);
  42770. this.xhr.open(this.method, this.url, true);
  42771. if (this.xhr.setRequestHeader) {
  42772. this.xhr.setRequestHeader("Content-Type", "application/json");
  42773. }
  42774. this.xhr.send(payload);
  42775. };
  42776. HTTPRequest.prototype.close = function () {
  42777. if (this.unloader) {
  42778. runtime.removeUnloadListener(this.unloader);
  42779. this.unloader = null;
  42780. }
  42781. if (this.xhr) {
  42782. this.hooks.abortRequest(this.xhr);
  42783. this.xhr = null;
  42784. }
  42785. };
  42786. HTTPRequest.prototype.onChunk = function (status, data) {
  42787. while (true) {
  42788. var chunk = this.advanceBuffer(data);
  42789. if (chunk) {
  42790. this.emit("chunk", { status: status, data: chunk });
  42791. }
  42792. else {
  42793. break;
  42794. }
  42795. }
  42796. if (this.isBufferTooLong(data)) {
  42797. this.emit("buffer_too_long");
  42798. }
  42799. };
  42800. HTTPRequest.prototype.advanceBuffer = function (buffer) {
  42801. var unreadData = buffer.slice(this.position);
  42802. var endOfLinePosition = unreadData.indexOf("\n");
  42803. if (endOfLinePosition !== -1) {
  42804. this.position += endOfLinePosition + 1;
  42805. return unreadData.slice(0, endOfLinePosition);
  42806. }
  42807. else {
  42808. return null;
  42809. }
  42810. };
  42811. HTTPRequest.prototype.isBufferTooLong = function (buffer) {
  42812. return this.position === buffer.length && buffer.length > MAX_BUFFER_LENGTH;
  42813. };
  42814. return HTTPRequest;
  42815. }(dispatcher));
  42816. /* harmony default export */ var http_request = (http_request_HTTPRequest);
  42817. // CONCATENATED MODULE: ./src/core/http/state.ts
  42818. var State;
  42819. (function (State) {
  42820. State[State["CONNECTING"] = 0] = "CONNECTING";
  42821. State[State["OPEN"] = 1] = "OPEN";
  42822. State[State["CLOSED"] = 3] = "CLOSED";
  42823. })(State || (State = {}));
  42824. /* harmony default export */ var state = (State);
  42825. // CONCATENATED MODULE: ./src/core/http/http_socket.ts
  42826. var autoIncrement = 1;
  42827. var http_socket_HTTPSocket = (function () {
  42828. function HTTPSocket(hooks, url) {
  42829. this.hooks = hooks;
  42830. this.session = randomNumber(1000) + "/" + randomString(8);
  42831. this.location = getLocation(url);
  42832. this.readyState = state.CONNECTING;
  42833. this.openStream();
  42834. }
  42835. HTTPSocket.prototype.send = function (payload) {
  42836. return this.sendRaw(JSON.stringify([payload]));
  42837. };
  42838. HTTPSocket.prototype.ping = function () {
  42839. this.hooks.sendHeartbeat(this);
  42840. };
  42841. HTTPSocket.prototype.close = function (code, reason) {
  42842. this.onClose(code, reason, true);
  42843. };
  42844. HTTPSocket.prototype.sendRaw = function (payload) {
  42845. if (this.readyState === state.OPEN) {
  42846. try {
  42847. runtime.createSocketRequest("POST", getUniqueURL(getSendURL(this.location, this.session))).start(payload);
  42848. return true;
  42849. }
  42850. catch (e) {
  42851. return false;
  42852. }
  42853. }
  42854. else {
  42855. return false;
  42856. }
  42857. };
  42858. HTTPSocket.prototype.reconnect = function () {
  42859. this.closeStream();
  42860. this.openStream();
  42861. };
  42862. ;
  42863. HTTPSocket.prototype.onClose = function (code, reason, wasClean) {
  42864. this.closeStream();
  42865. this.readyState = state.CLOSED;
  42866. if (this.onclose) {
  42867. this.onclose({
  42868. code: code,
  42869. reason: reason,
  42870. wasClean: wasClean
  42871. });
  42872. }
  42873. };
  42874. HTTPSocket.prototype.onChunk = function (chunk) {
  42875. if (chunk.status !== 200) {
  42876. return;
  42877. }
  42878. if (this.readyState === state.OPEN) {
  42879. this.onActivity();
  42880. }
  42881. var payload;
  42882. var type = chunk.data.slice(0, 1);
  42883. switch (type) {
  42884. case 'o':
  42885. payload = JSON.parse(chunk.data.slice(1) || '{}');
  42886. this.onOpen(payload);
  42887. break;
  42888. case 'a':
  42889. payload = JSON.parse(chunk.data.slice(1) || '[]');
  42890. for (var i = 0; i < payload.length; i++) {
  42891. this.onEvent(payload[i]);
  42892. }
  42893. break;
  42894. case 'm':
  42895. payload = JSON.parse(chunk.data.slice(1) || 'null');
  42896. this.onEvent(payload);
  42897. break;
  42898. case 'h':
  42899. this.hooks.onHeartbeat(this);
  42900. break;
  42901. case 'c':
  42902. payload = JSON.parse(chunk.data.slice(1) || '[]');
  42903. this.onClose(payload[0], payload[1], true);
  42904. break;
  42905. }
  42906. };
  42907. HTTPSocket.prototype.onOpen = function (options) {
  42908. if (this.readyState === state.CONNECTING) {
  42909. if (options && options.hostname) {
  42910. this.location.base = replaceHost(this.location.base, options.hostname);
  42911. }
  42912. this.readyState = state.OPEN;
  42913. if (this.onopen) {
  42914. this.onopen();
  42915. }
  42916. }
  42917. else {
  42918. this.onClose(1006, "Server lost session", true);
  42919. }
  42920. };
  42921. HTTPSocket.prototype.onEvent = function (event) {
  42922. if (this.readyState === state.OPEN && this.onmessage) {
  42923. this.onmessage({ data: event });
  42924. }
  42925. };
  42926. HTTPSocket.prototype.onActivity = function () {
  42927. if (this.onactivity) {
  42928. this.onactivity();
  42929. }
  42930. };
  42931. HTTPSocket.prototype.onError = function (error) {
  42932. if (this.onerror) {
  42933. this.onerror(error);
  42934. }
  42935. };
  42936. HTTPSocket.prototype.openStream = function () {
  42937. var _this = this;
  42938. this.stream = runtime.createSocketRequest("POST", getUniqueURL(this.hooks.getReceiveURL(this.location, this.session)));
  42939. this.stream.bind("chunk", function (chunk) {
  42940. _this.onChunk(chunk);
  42941. });
  42942. this.stream.bind("finished", function (status) {
  42943. _this.hooks.onFinished(_this, status);
  42944. });
  42945. this.stream.bind("buffer_too_long", function () {
  42946. _this.reconnect();
  42947. });
  42948. try {
  42949. this.stream.start();
  42950. }
  42951. catch (error) {
  42952. util.defer(function () {
  42953. _this.onError(error);
  42954. _this.onClose(1006, "Could not start streaming", false);
  42955. });
  42956. }
  42957. };
  42958. HTTPSocket.prototype.closeStream = function () {
  42959. if (this.stream) {
  42960. this.stream.unbind_all();
  42961. this.stream.close();
  42962. this.stream = null;
  42963. }
  42964. };
  42965. return HTTPSocket;
  42966. }());
  42967. function getLocation(url) {
  42968. var parts = /([^\?]*)\/*(\??.*)/.exec(url);
  42969. return {
  42970. base: parts[1],
  42971. queryString: parts[2]
  42972. };
  42973. }
  42974. function getSendURL(url, session) {
  42975. return url.base + "/" + session + "/xhr_send";
  42976. }
  42977. function getUniqueURL(url) {
  42978. var separator = (url.indexOf('?') === -1) ? "?" : "&";
  42979. return url + separator + "t=" + (+new Date()) + "&n=" + autoIncrement++;
  42980. }
  42981. function replaceHost(url, hostname) {
  42982. var urlParts = /(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(url);
  42983. return urlParts[1] + hostname + urlParts[3];
  42984. }
  42985. function randomNumber(max) {
  42986. return Math.floor(Math.random() * max);
  42987. }
  42988. function randomString(length) {
  42989. var result = [];
  42990. for (var i = 0; i < length; i++) {
  42991. result.push(randomNumber(32).toString(32));
  42992. }
  42993. return result.join('');
  42994. }
  42995. /* harmony default export */ var http_socket = (http_socket_HTTPSocket);
  42996. // CONCATENATED MODULE: ./src/core/http/http_streaming_socket.ts
  42997. var http_streaming_socket_hooks = {
  42998. getReceiveURL: function (url, session) {
  42999. return url.base + "/" + session + "/xhr_streaming" + url.queryString;
  43000. },
  43001. onHeartbeat: function (socket) {
  43002. socket.sendRaw("[]");
  43003. },
  43004. sendHeartbeat: function (socket) {
  43005. socket.sendRaw("[]");
  43006. },
  43007. onFinished: function (socket, status) {
  43008. socket.onClose(1006, "Connection interrupted (" + status + ")", false);
  43009. }
  43010. };
  43011. /* harmony default export */ var http_streaming_socket = (http_streaming_socket_hooks);
  43012. // CONCATENATED MODULE: ./src/core/http/http_polling_socket.ts
  43013. var http_polling_socket_hooks = {
  43014. getReceiveURL: function (url, session) {
  43015. return url.base + "/" + session + "/xhr" + url.queryString;
  43016. },
  43017. onHeartbeat: function () {
  43018. },
  43019. sendHeartbeat: function (socket) {
  43020. socket.sendRaw("[]");
  43021. },
  43022. onFinished: function (socket, status) {
  43023. if (status === 200) {
  43024. socket.reconnect();
  43025. }
  43026. else {
  43027. socket.onClose(1006, "Connection interrupted (" + status + ")", false);
  43028. }
  43029. }
  43030. };
  43031. /* harmony default export */ var http_polling_socket = (http_polling_socket_hooks);
  43032. // CONCATENATED MODULE: ./src/runtimes/isomorphic/http/http_xhr_request.ts
  43033. var http_xhr_request_hooks = {
  43034. getRequest: function (socket) {
  43035. var Constructor = runtime.getXHRAPI();
  43036. var xhr = new Constructor();
  43037. xhr.onreadystatechange = xhr.onprogress = function () {
  43038. switch (xhr.readyState) {
  43039. case 3:
  43040. if (xhr.responseText && xhr.responseText.length > 0) {
  43041. socket.onChunk(xhr.status, xhr.responseText);
  43042. }
  43043. break;
  43044. case 4:
  43045. if (xhr.responseText && xhr.responseText.length > 0) {
  43046. socket.onChunk(xhr.status, xhr.responseText);
  43047. }
  43048. socket.emit("finished", xhr.status);
  43049. socket.close();
  43050. break;
  43051. }
  43052. };
  43053. return xhr;
  43054. },
  43055. abortRequest: function (xhr) {
  43056. xhr.onreadystatechange = null;
  43057. xhr.abort();
  43058. }
  43059. };
  43060. /* harmony default export */ var http_xhr_request = (http_xhr_request_hooks);
  43061. // CONCATENATED MODULE: ./src/runtimes/isomorphic/http/http.ts
  43062. var HTTP = {
  43063. createStreamingSocket: function (url) {
  43064. return this.createSocket(http_streaming_socket, url);
  43065. },
  43066. createPollingSocket: function (url) {
  43067. return this.createSocket(http_polling_socket, url);
  43068. },
  43069. createSocket: function (hooks, url) {
  43070. return new http_socket(hooks, url);
  43071. },
  43072. createXHR: function (method, url) {
  43073. return this.createRequest(http_xhr_request, method, url);
  43074. },
  43075. createRequest: function (hooks, method, url) {
  43076. return new http_request(hooks, method, url);
  43077. }
  43078. };
  43079. /* harmony default export */ var http_http = (HTTP);
  43080. // CONCATENATED MODULE: ./src/runtimes/web/http/http.ts
  43081. http_http.createXDR = function (method, url) {
  43082. return this.createRequest(http_xdomain_request, method, url);
  43083. };
  43084. /* harmony default export */ var web_http_http = (http_http);
  43085. // CONCATENATED MODULE: ./src/runtimes/web/runtime.ts
  43086. var Runtime = {
  43087. nextAuthCallbackID: 1,
  43088. auth_callbacks: {},
  43089. ScriptReceivers: ScriptReceivers,
  43090. DependenciesReceivers: DependenciesReceivers,
  43091. getDefaultStrategy: default_strategy,
  43092. Transports: transports_transports,
  43093. transportConnectionInitializer: transport_connection_initializer,
  43094. HTTPFactory: web_http_http,
  43095. TimelineTransport: jsonp_timeline,
  43096. getXHRAPI: function () {
  43097. return window.XMLHttpRequest;
  43098. },
  43099. getWebSocketAPI: function () {
  43100. return window.WebSocket || window.MozWebSocket;
  43101. },
  43102. setup: function (PusherClass) {
  43103. var _this = this;
  43104. window.Pusher = PusherClass;
  43105. var initializeOnDocumentBody = function () {
  43106. _this.onDocumentBody(PusherClass.ready);
  43107. };
  43108. if (!window.JSON) {
  43109. Dependencies.load("json2", {}, initializeOnDocumentBody);
  43110. }
  43111. else {
  43112. initializeOnDocumentBody();
  43113. }
  43114. },
  43115. getDocument: function () {
  43116. return document;
  43117. },
  43118. getProtocol: function () {
  43119. return this.getDocument().location.protocol;
  43120. },
  43121. getAuthorizers: function () {
  43122. return { ajax: xhr_auth, jsonp: jsonp_auth };
  43123. },
  43124. onDocumentBody: function (callback) {
  43125. var _this = this;
  43126. if (document.body) {
  43127. callback();
  43128. }
  43129. else {
  43130. setTimeout(function () {
  43131. _this.onDocumentBody(callback);
  43132. }, 0);
  43133. }
  43134. },
  43135. createJSONPRequest: function (url, data) {
  43136. return new jsonp_request(url, data);
  43137. },
  43138. createScriptRequest: function (src) {
  43139. return new script_request(src);
  43140. },
  43141. getLocalStorage: function () {
  43142. try {
  43143. return window.localStorage;
  43144. }
  43145. catch (e) {
  43146. return undefined;
  43147. }
  43148. },
  43149. createXHR: function () {
  43150. if (this.getXHRAPI()) {
  43151. return this.createXMLHttpRequest();
  43152. }
  43153. else {
  43154. return this.createMicrosoftXHR();
  43155. }
  43156. },
  43157. createXMLHttpRequest: function () {
  43158. var Constructor = this.getXHRAPI();
  43159. return new Constructor();
  43160. },
  43161. createMicrosoftXHR: function () {
  43162. return new ActiveXObject("Microsoft.XMLHTTP");
  43163. },
  43164. getNetwork: function () {
  43165. return net_info_Network;
  43166. },
  43167. createWebSocket: function (url) {
  43168. var Constructor = this.getWebSocketAPI();
  43169. return new Constructor(url);
  43170. },
  43171. createSocketRequest: function (method, url) {
  43172. if (this.isXHRSupported()) {
  43173. return this.HTTPFactory.createXHR(method, url);
  43174. }
  43175. else if (this.isXDRSupported(url.indexOf("https:") === 0)) {
  43176. return this.HTTPFactory.createXDR(method, url);
  43177. }
  43178. else {
  43179. throw "Cross-origin HTTP requests are not supported";
  43180. }
  43181. },
  43182. isXHRSupported: function () {
  43183. var Constructor = this.getXHRAPI();
  43184. return Boolean(Constructor) && (new Constructor()).withCredentials !== undefined;
  43185. },
  43186. isXDRSupported: function (useTLS) {
  43187. var protocol = useTLS ? "https:" : "http:";
  43188. var documentProtocol = this.getProtocol();
  43189. return Boolean((window['XDomainRequest'])) && documentProtocol === protocol;
  43190. },
  43191. addUnloadListener: function (listener) {
  43192. if (window.addEventListener !== undefined) {
  43193. window.addEventListener("unload", listener, false);
  43194. }
  43195. else if (window.attachEvent !== undefined) {
  43196. window.attachEvent("onunload", listener);
  43197. }
  43198. },
  43199. removeUnloadListener: function (listener) {
  43200. if (window.addEventListener !== undefined) {
  43201. window.removeEventListener("unload", listener, false);
  43202. }
  43203. else if (window.detachEvent !== undefined) {
  43204. window.detachEvent("onunload", listener);
  43205. }
  43206. }
  43207. };
  43208. /* harmony default export */ var runtime = (Runtime);
  43209. // CONCATENATED MODULE: ./src/core/timeline/level.ts
  43210. var TimelineLevel;
  43211. (function (TimelineLevel) {
  43212. TimelineLevel[TimelineLevel["ERROR"] = 3] = "ERROR";
  43213. TimelineLevel[TimelineLevel["INFO"] = 6] = "INFO";
  43214. TimelineLevel[TimelineLevel["DEBUG"] = 7] = "DEBUG";
  43215. })(TimelineLevel || (TimelineLevel = {}));
  43216. /* harmony default export */ var timeline_level = (TimelineLevel);
  43217. // CONCATENATED MODULE: ./src/core/timeline/timeline.ts
  43218. var timeline_Timeline = (function () {
  43219. function Timeline(key, session, options) {
  43220. this.key = key;
  43221. this.session = session;
  43222. this.events = [];
  43223. this.options = options || {};
  43224. this.sent = 0;
  43225. this.uniqueID = 0;
  43226. }
  43227. Timeline.prototype.log = function (level, event) {
  43228. if (level <= this.options.level) {
  43229. this.events.push(extend({}, event, { timestamp: util.now() }));
  43230. if (this.options.limit && this.events.length > this.options.limit) {
  43231. this.events.shift();
  43232. }
  43233. }
  43234. };
  43235. Timeline.prototype.error = function (event) {
  43236. this.log(timeline_level.ERROR, event);
  43237. };
  43238. Timeline.prototype.info = function (event) {
  43239. this.log(timeline_level.INFO, event);
  43240. };
  43241. Timeline.prototype.debug = function (event) {
  43242. this.log(timeline_level.DEBUG, event);
  43243. };
  43244. Timeline.prototype.isEmpty = function () {
  43245. return this.events.length === 0;
  43246. };
  43247. Timeline.prototype.send = function (sendfn, callback) {
  43248. var _this = this;
  43249. var data = extend({
  43250. session: this.session,
  43251. bundle: this.sent + 1,
  43252. key: this.key,
  43253. lib: "js",
  43254. version: this.options.version,
  43255. cluster: this.options.cluster,
  43256. features: this.options.features,
  43257. timeline: this.events
  43258. }, this.options.params);
  43259. this.events = [];
  43260. sendfn(data, function (error, result) {
  43261. if (!error) {
  43262. _this.sent++;
  43263. }
  43264. if (callback) {
  43265. callback(error, result);
  43266. }
  43267. });
  43268. return true;
  43269. };
  43270. Timeline.prototype.generateUniqueID = function () {
  43271. this.uniqueID++;
  43272. return this.uniqueID;
  43273. };
  43274. return Timeline;
  43275. }());
  43276. /* harmony default export */ var timeline_timeline = (timeline_Timeline);
  43277. // CONCATENATED MODULE: ./src/core/strategies/transport_strategy.ts
  43278. var transport_strategy_TransportStrategy = (function () {
  43279. function TransportStrategy(name, priority, transport, options) {
  43280. this.name = name;
  43281. this.priority = priority;
  43282. this.transport = transport;
  43283. this.options = options || {};
  43284. }
  43285. TransportStrategy.prototype.isSupported = function () {
  43286. return this.transport.isSupported({
  43287. useTLS: this.options.useTLS
  43288. });
  43289. };
  43290. TransportStrategy.prototype.connect = function (minPriority, callback) {
  43291. var _this = this;
  43292. if (!this.isSupported()) {
  43293. return failAttempt(new UnsupportedStrategy(), callback);
  43294. }
  43295. else if (this.priority < minPriority) {
  43296. return failAttempt(new TransportPriorityTooLow(), callback);
  43297. }
  43298. var connected = false;
  43299. var transport = this.transport.createConnection(this.name, this.priority, this.options.key, this.options);
  43300. var handshake = null;
  43301. var onInitialized = function () {
  43302. transport.unbind("initialized", onInitialized);
  43303. transport.connect();
  43304. };
  43305. var onOpen = function () {
  43306. handshake = factory.createHandshake(transport, function (result) {
  43307. connected = true;
  43308. unbindListeners();
  43309. callback(null, result);
  43310. });
  43311. };
  43312. var onError = function (error) {
  43313. unbindListeners();
  43314. callback(error);
  43315. };
  43316. var onClosed = function () {
  43317. unbindListeners();
  43318. var serializedTransport;
  43319. serializedTransport = safeJSONStringify(transport);
  43320. callback(new TransportClosed(serializedTransport));
  43321. };
  43322. var unbindListeners = function () {
  43323. transport.unbind("initialized", onInitialized);
  43324. transport.unbind("open", onOpen);
  43325. transport.unbind("error", onError);
  43326. transport.unbind("closed", onClosed);
  43327. };
  43328. transport.bind("initialized", onInitialized);
  43329. transport.bind("open", onOpen);
  43330. transport.bind("error", onError);
  43331. transport.bind("closed", onClosed);
  43332. transport.initialize();
  43333. return {
  43334. abort: function () {
  43335. if (connected) {
  43336. return;
  43337. }
  43338. unbindListeners();
  43339. if (handshake) {
  43340. handshake.close();
  43341. }
  43342. else {
  43343. transport.close();
  43344. }
  43345. },
  43346. forceMinPriority: function (p) {
  43347. if (connected) {
  43348. return;
  43349. }
  43350. if (_this.priority < p) {
  43351. if (handshake) {
  43352. handshake.close();
  43353. }
  43354. else {
  43355. transport.close();
  43356. }
  43357. }
  43358. }
  43359. };
  43360. };
  43361. return TransportStrategy;
  43362. }());
  43363. /* harmony default export */ var transport_strategy = (transport_strategy_TransportStrategy);
  43364. function failAttempt(error, callback) {
  43365. util.defer(function () {
  43366. callback(error);
  43367. });
  43368. return {
  43369. abort: function () { },
  43370. forceMinPriority: function () { }
  43371. };
  43372. }
  43373. // CONCATENATED MODULE: ./src/core/strategies/strategy_builder.ts
  43374. var strategy_builder_Transports = runtime.Transports;
  43375. var strategy_builder_defineTransport = function (config, name, type, priority, options, manager) {
  43376. var transportClass = strategy_builder_Transports[type];
  43377. if (!transportClass) {
  43378. throw new UnsupportedTransport(type);
  43379. }
  43380. var enabled = (!config.enabledTransports ||
  43381. arrayIndexOf(config.enabledTransports, name) !== -1) &&
  43382. (!config.disabledTransports ||
  43383. arrayIndexOf(config.disabledTransports, name) === -1);
  43384. var transport;
  43385. if (enabled) {
  43386. transport = new transport_strategy(name, priority, manager ? manager.getAssistant(transportClass) : transportClass, extend({
  43387. key: config.key,
  43388. useTLS: config.useTLS,
  43389. timeline: config.timeline,
  43390. ignoreNullOrigin: config.ignoreNullOrigin
  43391. }, options));
  43392. }
  43393. else {
  43394. transport = strategy_builder_UnsupportedStrategy;
  43395. }
  43396. return transport;
  43397. };
  43398. var strategy_builder_UnsupportedStrategy = {
  43399. isSupported: function () {
  43400. return false;
  43401. },
  43402. connect: function (_, callback) {
  43403. var deferred = util.defer(function () {
  43404. callback(new UnsupportedStrategy());
  43405. });
  43406. return {
  43407. abort: function () {
  43408. deferred.ensureAborted();
  43409. },
  43410. forceMinPriority: function () { }
  43411. };
  43412. }
  43413. };
  43414. // CONCATENATED MODULE: ./src/core/config.ts
  43415. var getGlobalConfig = function () {
  43416. return {
  43417. wsHost: defaults.host,
  43418. wsPort: defaults.ws_port,
  43419. wssPort: defaults.wss_port,
  43420. wsPath: defaults.ws_path,
  43421. httpHost: defaults.sockjs_host,
  43422. httpPort: defaults.sockjs_http_port,
  43423. httpsPort: defaults.sockjs_https_port,
  43424. httpPath: defaults.sockjs_path,
  43425. statsHost: defaults.stats_host,
  43426. authEndpoint: defaults.channel_auth_endpoint,
  43427. authTransport: defaults.channel_auth_transport,
  43428. activity_timeout: defaults.activity_timeout,
  43429. pong_timeout: defaults.pong_timeout,
  43430. unavailable_timeout: defaults.unavailable_timeout
  43431. };
  43432. };
  43433. var getClusterConfig = function (clusterName) {
  43434. return {
  43435. wsHost: 'ws-' + clusterName + '.pusher.com',
  43436. httpHost: 'sockjs-' + clusterName + '.pusher.com'
  43437. };
  43438. };
  43439. // CONCATENATED MODULE: ./src/core/pusher.ts
  43440. var pusher_Pusher = (function () {
  43441. function Pusher(app_key, options) {
  43442. var _this = this;
  43443. checkAppKey(app_key);
  43444. options = options || {};
  43445. if (!options.cluster && !(options.wsHost || options.httpHost)) {
  43446. var suffix = url_store.buildLogSuffix('javascriptQuickStart');
  43447. logger.warn("You should always specify a cluster when connecting. " + suffix);
  43448. }
  43449. this.key = app_key;
  43450. this.config = extend(getGlobalConfig(), options.cluster ? getClusterConfig(options.cluster) : {}, options);
  43451. this.channels = factory.createChannels();
  43452. this.global_emitter = new dispatcher();
  43453. this.sessionID = Math.floor(Math.random() * 1000000000);
  43454. this.timeline = new timeline_timeline(this.key, this.sessionID, {
  43455. cluster: this.config.cluster,
  43456. features: Pusher.getClientFeatures(),
  43457. params: this.config.timelineParams || {},
  43458. limit: 50,
  43459. level: timeline_level.INFO,
  43460. version: defaults.VERSION
  43461. });
  43462. if (!this.config.disableStats) {
  43463. this.timelineSender = factory.createTimelineSender(this.timeline, {
  43464. host: this.config.statsHost,
  43465. path: '/timeline/v2/' + runtime.TimelineTransport.name
  43466. });
  43467. }
  43468. var getStrategy = function (options) {
  43469. var config = extend({}, _this.config, options);
  43470. return runtime.getDefaultStrategy(config, strategy_builder_defineTransport);
  43471. };
  43472. this.connection = factory.createConnectionManager(this.key, extend({
  43473. getStrategy: getStrategy,
  43474. timeline: this.timeline,
  43475. activityTimeout: this.config.activity_timeout,
  43476. pongTimeout: this.config.pong_timeout,
  43477. unavailableTimeout: this.config.unavailable_timeout
  43478. }, this.config, { useTLS: this.shouldUseTLS() }));
  43479. this.connection.bind('connected', function () {
  43480. _this.subscribeAll();
  43481. if (_this.timelineSender) {
  43482. _this.timelineSender.send(_this.connection.isUsingTLS());
  43483. }
  43484. });
  43485. this.connection.bind('message', function (event) {
  43486. var eventName = event.event;
  43487. var internal = eventName.indexOf('pusher_internal:') === 0;
  43488. if (event.channel) {
  43489. var channel = _this.channel(event.channel);
  43490. if (channel) {
  43491. channel.handleEvent(event);
  43492. }
  43493. }
  43494. if (!internal) {
  43495. _this.global_emitter.emit(event.event, event.data);
  43496. }
  43497. });
  43498. this.connection.bind('connecting', function () {
  43499. _this.channels.disconnect();
  43500. });
  43501. this.connection.bind('disconnected', function () {
  43502. _this.channels.disconnect();
  43503. });
  43504. this.connection.bind('error', function (err) {
  43505. logger.warn(err);
  43506. });
  43507. Pusher.instances.push(this);
  43508. this.timeline.info({ instances: Pusher.instances.length });
  43509. if (Pusher.isReady) {
  43510. this.connect();
  43511. }
  43512. }
  43513. Pusher.ready = function () {
  43514. Pusher.isReady = true;
  43515. for (var i = 0, l = Pusher.instances.length; i < l; i++) {
  43516. Pusher.instances[i].connect();
  43517. }
  43518. };
  43519. Pusher.getClientFeatures = function () {
  43520. return keys(filterObject({ ws: runtime.Transports.ws }, function (t) {
  43521. return t.isSupported({});
  43522. }));
  43523. };
  43524. Pusher.prototype.channel = function (name) {
  43525. return this.channels.find(name);
  43526. };
  43527. Pusher.prototype.allChannels = function () {
  43528. return this.channels.all();
  43529. };
  43530. Pusher.prototype.connect = function () {
  43531. this.connection.connect();
  43532. if (this.timelineSender) {
  43533. if (!this.timelineSenderTimer) {
  43534. var usingTLS = this.connection.isUsingTLS();
  43535. var timelineSender = this.timelineSender;
  43536. this.timelineSenderTimer = new PeriodicTimer(60000, function () {
  43537. timelineSender.send(usingTLS);
  43538. });
  43539. }
  43540. }
  43541. };
  43542. Pusher.prototype.disconnect = function () {
  43543. this.connection.disconnect();
  43544. if (this.timelineSenderTimer) {
  43545. this.timelineSenderTimer.ensureAborted();
  43546. this.timelineSenderTimer = null;
  43547. }
  43548. };
  43549. Pusher.prototype.bind = function (event_name, callback, context) {
  43550. this.global_emitter.bind(event_name, callback, context);
  43551. return this;
  43552. };
  43553. Pusher.prototype.unbind = function (event_name, callback, context) {
  43554. this.global_emitter.unbind(event_name, callback, context);
  43555. return this;
  43556. };
  43557. Pusher.prototype.bind_global = function (callback) {
  43558. this.global_emitter.bind_global(callback);
  43559. return this;
  43560. };
  43561. Pusher.prototype.unbind_global = function (callback) {
  43562. this.global_emitter.unbind_global(callback);
  43563. return this;
  43564. };
  43565. Pusher.prototype.unbind_all = function (callback) {
  43566. this.global_emitter.unbind_all();
  43567. return this;
  43568. };
  43569. Pusher.prototype.subscribeAll = function () {
  43570. var channelName;
  43571. for (channelName in this.channels.channels) {
  43572. if (this.channels.channels.hasOwnProperty(channelName)) {
  43573. this.subscribe(channelName);
  43574. }
  43575. }
  43576. };
  43577. Pusher.prototype.subscribe = function (channel_name) {
  43578. var channel = this.channels.add(channel_name, this);
  43579. if (channel.subscriptionPending && channel.subscriptionCancelled) {
  43580. channel.reinstateSubscription();
  43581. }
  43582. else if (!channel.subscriptionPending &&
  43583. this.connection.state === 'connected') {
  43584. channel.subscribe();
  43585. }
  43586. return channel;
  43587. };
  43588. Pusher.prototype.unsubscribe = function (channel_name) {
  43589. var channel = this.channels.find(channel_name);
  43590. if (channel && channel.subscriptionPending) {
  43591. channel.cancelSubscription();
  43592. }
  43593. else {
  43594. channel = this.channels.remove(channel_name);
  43595. if (channel && this.connection.state === 'connected') {
  43596. channel.unsubscribe();
  43597. }
  43598. }
  43599. };
  43600. Pusher.prototype.send_event = function (event_name, data, channel) {
  43601. return this.connection.send_event(event_name, data, channel);
  43602. };
  43603. Pusher.prototype.shouldUseTLS = function () {
  43604. if (runtime.getProtocol() === 'https:') {
  43605. return true;
  43606. }
  43607. else if (this.config.forceTLS === true) {
  43608. return true;
  43609. }
  43610. else {
  43611. return Boolean(this.config.encrypted);
  43612. }
  43613. };
  43614. Pusher.instances = [];
  43615. Pusher.isReady = false;
  43616. Pusher.logToConsole = false;
  43617. Pusher.Runtime = runtime;
  43618. Pusher.ScriptReceivers = runtime.ScriptReceivers;
  43619. Pusher.DependenciesReceivers = runtime.DependenciesReceivers;
  43620. Pusher.auth_callbacks = runtime.auth_callbacks;
  43621. return Pusher;
  43622. }());
  43623. /* harmony default export */ var core_pusher = __webpack_exports__["default"] = (pusher_Pusher);
  43624. function checkAppKey(key) {
  43625. if (key === null || key === undefined) {
  43626. throw 'You must pass your app key when you instantiate Pusher.';
  43627. }
  43628. }
  43629. runtime.setup(pusher_Pusher);
  43630. /***/ })
  43631. /******/ ]);
  43632. });
  43633. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../buffer/index.js */ "./node_modules/buffer/index.js").Buffer))
  43634. /***/ }),
  43635. /***/ "./node_modules/setimmediate/setImmediate.js":
  43636. /*!***************************************************!*\
  43637. !*** ./node_modules/setimmediate/setImmediate.js ***!
  43638. \***************************************************/
  43639. /*! no static exports found */
  43640. /***/ (function(module, exports, __webpack_require__) {
  43641. /* WEBPACK VAR INJECTION */(function(global, process) {(function (global, undefined) {
  43642. "use strict";
  43643. if (global.setImmediate) {
  43644. return;
  43645. }
  43646. var nextHandle = 1; // Spec says greater than zero
  43647. var tasksByHandle = {};
  43648. var currentlyRunningATask = false;
  43649. var doc = global.document;
  43650. var registerImmediate;
  43651. function setImmediate(callback) {
  43652. // Callback can either be a function or a string
  43653. if (typeof callback !== "function") {
  43654. callback = new Function("" + callback);
  43655. }
  43656. // Copy function arguments
  43657. var args = new Array(arguments.length - 1);
  43658. for (var i = 0; i < args.length; i++) {
  43659. args[i] = arguments[i + 1];
  43660. }
  43661. // Store and register the task
  43662. var task = { callback: callback, args: args };
  43663. tasksByHandle[nextHandle] = task;
  43664. registerImmediate(nextHandle);
  43665. return nextHandle++;
  43666. }
  43667. function clearImmediate(handle) {
  43668. delete tasksByHandle[handle];
  43669. }
  43670. function run(task) {
  43671. var callback = task.callback;
  43672. var args = task.args;
  43673. switch (args.length) {
  43674. case 0:
  43675. callback();
  43676. break;
  43677. case 1:
  43678. callback(args[0]);
  43679. break;
  43680. case 2:
  43681. callback(args[0], args[1]);
  43682. break;
  43683. case 3:
  43684. callback(args[0], args[1], args[2]);
  43685. break;
  43686. default:
  43687. callback.apply(undefined, args);
  43688. break;
  43689. }
  43690. }
  43691. function runIfPresent(handle) {
  43692. // From the spec: "Wait until any invocations of this algorithm started before this one have completed."
  43693. // So if we're currently running a task, we'll need to delay this invocation.
  43694. if (currentlyRunningATask) {
  43695. // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a
  43696. // "too much recursion" error.
  43697. setTimeout(runIfPresent, 0, handle);
  43698. } else {
  43699. var task = tasksByHandle[handle];
  43700. if (task) {
  43701. currentlyRunningATask = true;
  43702. try {
  43703. run(task);
  43704. } finally {
  43705. clearImmediate(handle);
  43706. currentlyRunningATask = false;
  43707. }
  43708. }
  43709. }
  43710. }
  43711. function installNextTickImplementation() {
  43712. registerImmediate = function(handle) {
  43713. process.nextTick(function () { runIfPresent(handle); });
  43714. };
  43715. }
  43716. function canUsePostMessage() {
  43717. // The test against `importScripts` prevents this implementation from being installed inside a web worker,
  43718. // where `global.postMessage` means something completely different and can't be used for this purpose.
  43719. if (global.postMessage && !global.importScripts) {
  43720. var postMessageIsAsynchronous = true;
  43721. var oldOnMessage = global.onmessage;
  43722. global.onmessage = function() {
  43723. postMessageIsAsynchronous = false;
  43724. };
  43725. global.postMessage("", "*");
  43726. global.onmessage = oldOnMessage;
  43727. return postMessageIsAsynchronous;
  43728. }
  43729. }
  43730. function installPostMessageImplementation() {
  43731. // Installs an event handler on `global` for the `message` event: see
  43732. // * https://developer.mozilla.org/en/DOM/window.postMessage
  43733. // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages
  43734. var messagePrefix = "setImmediate$" + Math.random() + "$";
  43735. var onGlobalMessage = function(event) {
  43736. if (event.source === global &&
  43737. typeof event.data === "string" &&
  43738. event.data.indexOf(messagePrefix) === 0) {
  43739. runIfPresent(+event.data.slice(messagePrefix.length));
  43740. }
  43741. };
  43742. if (global.addEventListener) {
  43743. global.addEventListener("message", onGlobalMessage, false);
  43744. } else {
  43745. global.attachEvent("onmessage", onGlobalMessage);
  43746. }
  43747. registerImmediate = function(handle) {
  43748. global.postMessage(messagePrefix + handle, "*");
  43749. };
  43750. }
  43751. function installMessageChannelImplementation() {
  43752. var channel = new MessageChannel();
  43753. channel.port1.onmessage = function(event) {
  43754. var handle = event.data;
  43755. runIfPresent(handle);
  43756. };
  43757. registerImmediate = function(handle) {
  43758. channel.port2.postMessage(handle);
  43759. };
  43760. }
  43761. function installReadyStateChangeImplementation() {
  43762. var html = doc.documentElement;
  43763. registerImmediate = function(handle) {
  43764. // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted
  43765. // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.
  43766. var script = doc.createElement("script");
  43767. script.onreadystatechange = function () {
  43768. runIfPresent(handle);
  43769. script.onreadystatechange = null;
  43770. html.removeChild(script);
  43771. script = null;
  43772. };
  43773. html.appendChild(script);
  43774. };
  43775. }
  43776. function installSetTimeoutImplementation() {
  43777. registerImmediate = function(handle) {
  43778. setTimeout(runIfPresent, 0, handle);
  43779. };
  43780. }
  43781. // If supported, we should attach to the prototype of global, since that is where setTimeout et al. live.
  43782. var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global);
  43783. attachTo = attachTo && attachTo.setTimeout ? attachTo : global;
  43784. // Don't get fooled by e.g. browserify environments.
  43785. if ({}.toString.call(global.process) === "[object process]") {
  43786. // For Node.js before 0.9
  43787. installNextTickImplementation();
  43788. } else if (canUsePostMessage()) {
  43789. // For non-IE10 modern browsers
  43790. installPostMessageImplementation();
  43791. } else if (global.MessageChannel) {
  43792. // For web workers, where supported
  43793. installMessageChannelImplementation();
  43794. } else if (doc && "onreadystatechange" in doc.createElement("script")) {
  43795. // For IE 6–8
  43796. installReadyStateChangeImplementation();
  43797. } else {
  43798. // For older browsers
  43799. installSetTimeoutImplementation();
  43800. }
  43801. attachTo.setImmediate = setImmediate;
  43802. attachTo.clearImmediate = clearImmediate;
  43803. }(typeof self === "undefined" ? typeof global === "undefined" ? this : global : self));
  43804. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"), __webpack_require__(/*! ./../process/browser.js */ "./node_modules/process/browser.js")))
  43805. /***/ }),
  43806. /***/ "./node_modules/style-loader/index.js!./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/CircleSpinner.vue?vue&type=style&index=0&id=9a543b64&scoped=true&lang=css&":
  43807. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  43808. !*** ./node_modules/style-loader!./node_modules/css-loader??ref--6-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--6-2!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/CircleSpinner.vue?vue&type=style&index=0&id=9a543b64&scoped=true&lang=css& ***!
  43809. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************/
  43810. /*! no static exports found */
  43811. /***/ (function(module, exports, __webpack_require__) {
  43812. var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--6-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src??ref--6-2!../../../node_modules/vue-loader/lib??vue-loader-options!./CircleSpinner.vue?vue&type=style&index=0&id=9a543b64&scoped=true&lang=css& */ "./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/CircleSpinner.vue?vue&type=style&index=0&id=9a543b64&scoped=true&lang=css&");
  43813. if(typeof content === 'string') content = [[module.i, content, '']];
  43814. var transform;
  43815. var insertInto;
  43816. var options = {"hmr":true}
  43817. options.transform = transform
  43818. options.insertInto = undefined;
  43819. var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options);
  43820. if(content.locals) module.exports = content.locals;
  43821. if(false) {}
  43822. /***/ }),
  43823. /***/ "./node_modules/style-loader/index.js!./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/views/Welcome.vue?vue&type=style&index=0&id=1ae8ae93&scoped=true&lang=css&":
  43824. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  43825. !*** ./node_modules/style-loader!./node_modules/css-loader??ref--6-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--6-2!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/views/Welcome.vue?vue&type=style&index=0&id=1ae8ae93&scoped=true&lang=css& ***!
  43826. \************************************************************************************************************************************************************************************************************************************************************************************************************************/
  43827. /*! no static exports found */
  43828. /***/ (function(module, exports, __webpack_require__) {
  43829. var content = __webpack_require__(/*! !../../../node_modules/css-loader??ref--6-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src??ref--6-2!../../../node_modules/vue-loader/lib??vue-loader-options!./Welcome.vue?vue&type=style&index=0&id=1ae8ae93&scoped=true&lang=css& */ "./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/views/Welcome.vue?vue&type=style&index=0&id=1ae8ae93&scoped=true&lang=css&");
  43830. if(typeof content === 'string') content = [[module.i, content, '']];
  43831. var transform;
  43832. var insertInto;
  43833. var options = {"hmr":true}
  43834. options.transform = transform
  43835. options.insertInto = undefined;
  43836. var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options);
  43837. if(content.locals) module.exports = content.locals;
  43838. if(false) {}
  43839. /***/ }),
  43840. /***/ "./node_modules/style-loader/lib/addStyles.js":
  43841. /*!****************************************************!*\
  43842. !*** ./node_modules/style-loader/lib/addStyles.js ***!
  43843. \****************************************************/
  43844. /*! no static exports found */
  43845. /***/ (function(module, exports, __webpack_require__) {
  43846. /*
  43847. MIT License http://www.opensource.org/licenses/mit-license.php
  43848. Author Tobias Koppers @sokra
  43849. */
  43850. var stylesInDom = {};
  43851. var memoize = function (fn) {
  43852. var memo;
  43853. return function () {
  43854. if (typeof memo === "undefined") memo = fn.apply(this, arguments);
  43855. return memo;
  43856. };
  43857. };
  43858. var isOldIE = memoize(function () {
  43859. // Test for IE <= 9 as proposed by Browserhacks
  43860. // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805
  43861. // Tests for existence of standard globals is to allow style-loader
  43862. // to operate correctly into non-standard environments
  43863. // @see https://github.com/webpack-contrib/style-loader/issues/177
  43864. return window && document && document.all && !window.atob;
  43865. });
  43866. var getTarget = function (target, parent) {
  43867. if (parent){
  43868. return parent.querySelector(target);
  43869. }
  43870. return document.querySelector(target);
  43871. };
  43872. var getElement = (function (fn) {
  43873. var memo = {};
  43874. return function(target, parent) {
  43875. // If passing function in options, then use it for resolve "head" element.
  43876. // Useful for Shadow Root style i.e
  43877. // {
  43878. // insertInto: function () { return document.querySelector("#foo").shadowRoot }
  43879. // }
  43880. if (typeof target === 'function') {
  43881. return target();
  43882. }
  43883. if (typeof memo[target] === "undefined") {
  43884. var styleTarget = getTarget.call(this, target, parent);
  43885. // Special case to return head of iframe instead of iframe itself
  43886. if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
  43887. try {
  43888. // This will throw an exception if access to iframe is blocked
  43889. // due to cross-origin restrictions
  43890. styleTarget = styleTarget.contentDocument.head;
  43891. } catch(e) {
  43892. styleTarget = null;
  43893. }
  43894. }
  43895. memo[target] = styleTarget;
  43896. }
  43897. return memo[target]
  43898. };
  43899. })();
  43900. var singleton = null;
  43901. var singletonCounter = 0;
  43902. var stylesInsertedAtTop = [];
  43903. var fixUrls = __webpack_require__(/*! ./urls */ "./node_modules/style-loader/lib/urls.js");
  43904. module.exports = function(list, options) {
  43905. if (typeof DEBUG !== "undefined" && DEBUG) {
  43906. if (typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment");
  43907. }
  43908. options = options || {};
  43909. options.attrs = typeof options.attrs === "object" ? options.attrs : {};
  43910. // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
  43911. // tags it will allow on a page
  43912. if (!options.singleton && typeof options.singleton !== "boolean") options.singleton = isOldIE();
  43913. // By default, add <style> tags to the <head> element
  43914. if (!options.insertInto) options.insertInto = "head";
  43915. // By default, add <style> tags to the bottom of the target
  43916. if (!options.insertAt) options.insertAt = "bottom";
  43917. var styles = listToStyles(list, options);
  43918. addStylesToDom(styles, options);
  43919. return function update (newList) {
  43920. var mayRemove = [];
  43921. for (var i = 0; i < styles.length; i++) {
  43922. var item = styles[i];
  43923. var domStyle = stylesInDom[item.id];
  43924. domStyle.refs--;
  43925. mayRemove.push(domStyle);
  43926. }
  43927. if(newList) {
  43928. var newStyles = listToStyles(newList, options);
  43929. addStylesToDom(newStyles, options);
  43930. }
  43931. for (var i = 0; i < mayRemove.length; i++) {
  43932. var domStyle = mayRemove[i];
  43933. if(domStyle.refs === 0) {
  43934. for (var j = 0; j < domStyle.parts.length; j++) domStyle.parts[j]();
  43935. delete stylesInDom[domStyle.id];
  43936. }
  43937. }
  43938. };
  43939. };
  43940. function addStylesToDom (styles, options) {
  43941. for (var i = 0; i < styles.length; i++) {
  43942. var item = styles[i];
  43943. var domStyle = stylesInDom[item.id];
  43944. if(domStyle) {
  43945. domStyle.refs++;
  43946. for(var j = 0; j < domStyle.parts.length; j++) {
  43947. domStyle.parts[j](item.parts[j]);
  43948. }
  43949. for(; j < item.parts.length; j++) {
  43950. domStyle.parts.push(addStyle(item.parts[j], options));
  43951. }
  43952. } else {
  43953. var parts = [];
  43954. for(var j = 0; j < item.parts.length; j++) {
  43955. parts.push(addStyle(item.parts[j], options));
  43956. }
  43957. stylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};
  43958. }
  43959. }
  43960. }
  43961. function listToStyles (list, options) {
  43962. var styles = [];
  43963. var newStyles = {};
  43964. for (var i = 0; i < list.length; i++) {
  43965. var item = list[i];
  43966. var id = options.base ? item[0] + options.base : item[0];
  43967. var css = item[1];
  43968. var media = item[2];
  43969. var sourceMap = item[3];
  43970. var part = {css: css, media: media, sourceMap: sourceMap};
  43971. if(!newStyles[id]) styles.push(newStyles[id] = {id: id, parts: [part]});
  43972. else newStyles[id].parts.push(part);
  43973. }
  43974. return styles;
  43975. }
  43976. function insertStyleElement (options, style) {
  43977. var target = getElement(options.insertInto)
  43978. if (!target) {
  43979. throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");
  43980. }
  43981. var lastStyleElementInsertedAtTop = stylesInsertedAtTop[stylesInsertedAtTop.length - 1];
  43982. if (options.insertAt === "top") {
  43983. if (!lastStyleElementInsertedAtTop) {
  43984. target.insertBefore(style, target.firstChild);
  43985. } else if (lastStyleElementInsertedAtTop.nextSibling) {
  43986. target.insertBefore(style, lastStyleElementInsertedAtTop.nextSibling);
  43987. } else {
  43988. target.appendChild(style);
  43989. }
  43990. stylesInsertedAtTop.push(style);
  43991. } else if (options.insertAt === "bottom") {
  43992. target.appendChild(style);
  43993. } else if (typeof options.insertAt === "object" && options.insertAt.before) {
  43994. var nextSibling = getElement(options.insertAt.before, target);
  43995. target.insertBefore(style, nextSibling);
  43996. } else {
  43997. throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");
  43998. }
  43999. }
  44000. function removeStyleElement (style) {
  44001. if (style.parentNode === null) return false;
  44002. style.parentNode.removeChild(style);
  44003. var idx = stylesInsertedAtTop.indexOf(style);
  44004. if(idx >= 0) {
  44005. stylesInsertedAtTop.splice(idx, 1);
  44006. }
  44007. }
  44008. function createStyleElement (options) {
  44009. var style = document.createElement("style");
  44010. if(options.attrs.type === undefined) {
  44011. options.attrs.type = "text/css";
  44012. }
  44013. if(options.attrs.nonce === undefined) {
  44014. var nonce = getNonce();
  44015. if (nonce) {
  44016. options.attrs.nonce = nonce;
  44017. }
  44018. }
  44019. addAttrs(style, options.attrs);
  44020. insertStyleElement(options, style);
  44021. return style;
  44022. }
  44023. function createLinkElement (options) {
  44024. var link = document.createElement("link");
  44025. if(options.attrs.type === undefined) {
  44026. options.attrs.type = "text/css";
  44027. }
  44028. options.attrs.rel = "stylesheet";
  44029. addAttrs(link, options.attrs);
  44030. insertStyleElement(options, link);
  44031. return link;
  44032. }
  44033. function addAttrs (el, attrs) {
  44034. Object.keys(attrs).forEach(function (key) {
  44035. el.setAttribute(key, attrs[key]);
  44036. });
  44037. }
  44038. function getNonce() {
  44039. if (false) {}
  44040. return __webpack_require__.nc;
  44041. }
  44042. function addStyle (obj, options) {
  44043. var style, update, remove, result;
  44044. // If a transform function was defined, run it on the css
  44045. if (options.transform && obj.css) {
  44046. result = typeof options.transform === 'function'
  44047. ? options.transform(obj.css)
  44048. : options.transform.default(obj.css);
  44049. if (result) {
  44050. // If transform returns a value, use that instead of the original css.
  44051. // This allows running runtime transformations on the css.
  44052. obj.css = result;
  44053. } else {
  44054. // If the transform function returns a falsy value, don't add this css.
  44055. // This allows conditional loading of css
  44056. return function() {
  44057. // noop
  44058. };
  44059. }
  44060. }
  44061. if (options.singleton) {
  44062. var styleIndex = singletonCounter++;
  44063. style = singleton || (singleton = createStyleElement(options));
  44064. update = applyToSingletonTag.bind(null, style, styleIndex, false);
  44065. remove = applyToSingletonTag.bind(null, style, styleIndex, true);
  44066. } else if (
  44067. obj.sourceMap &&
  44068. typeof URL === "function" &&
  44069. typeof URL.createObjectURL === "function" &&
  44070. typeof URL.revokeObjectURL === "function" &&
  44071. typeof Blob === "function" &&
  44072. typeof btoa === "function"
  44073. ) {
  44074. style = createLinkElement(options);
  44075. update = updateLink.bind(null, style, options);
  44076. remove = function () {
  44077. removeStyleElement(style);
  44078. if(style.href) URL.revokeObjectURL(style.href);
  44079. };
  44080. } else {
  44081. style = createStyleElement(options);
  44082. update = applyToTag.bind(null, style);
  44083. remove = function () {
  44084. removeStyleElement(style);
  44085. };
  44086. }
  44087. update(obj);
  44088. return function updateStyle (newObj) {
  44089. if (newObj) {
  44090. if (
  44091. newObj.css === obj.css &&
  44092. newObj.media === obj.media &&
  44093. newObj.sourceMap === obj.sourceMap
  44094. ) {
  44095. return;
  44096. }
  44097. update(obj = newObj);
  44098. } else {
  44099. remove();
  44100. }
  44101. };
  44102. }
  44103. var replaceText = (function () {
  44104. var textStore = [];
  44105. return function (index, replacement) {
  44106. textStore[index] = replacement;
  44107. return textStore.filter(Boolean).join('\n');
  44108. };
  44109. })();
  44110. function applyToSingletonTag (style, index, remove, obj) {
  44111. var css = remove ? "" : obj.css;
  44112. if (style.styleSheet) {
  44113. style.styleSheet.cssText = replaceText(index, css);
  44114. } else {
  44115. var cssNode = document.createTextNode(css);
  44116. var childNodes = style.childNodes;
  44117. if (childNodes[index]) style.removeChild(childNodes[index]);
  44118. if (childNodes.length) {
  44119. style.insertBefore(cssNode, childNodes[index]);
  44120. } else {
  44121. style.appendChild(cssNode);
  44122. }
  44123. }
  44124. }
  44125. function applyToTag (style, obj) {
  44126. var css = obj.css;
  44127. var media = obj.media;
  44128. if(media) {
  44129. style.setAttribute("media", media)
  44130. }
  44131. if(style.styleSheet) {
  44132. style.styleSheet.cssText = css;
  44133. } else {
  44134. while(style.firstChild) {
  44135. style.removeChild(style.firstChild);
  44136. }
  44137. style.appendChild(document.createTextNode(css));
  44138. }
  44139. }
  44140. function updateLink (link, options, obj) {
  44141. var css = obj.css;
  44142. var sourceMap = obj.sourceMap;
  44143. /*
  44144. If convertToAbsoluteUrls isn't defined, but sourcemaps are enabled
  44145. and there is no publicPath defined then lets turn convertToAbsoluteUrls
  44146. on by default. Otherwise default to the convertToAbsoluteUrls option
  44147. directly
  44148. */
  44149. var autoFixUrls = options.convertToAbsoluteUrls === undefined && sourceMap;
  44150. if (options.convertToAbsoluteUrls || autoFixUrls) {
  44151. css = fixUrls(css);
  44152. }
  44153. if (sourceMap) {
  44154. // http://stackoverflow.com/a/26603875
  44155. css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */";
  44156. }
  44157. var blob = new Blob([css], { type: "text/css" });
  44158. var oldSrc = link.href;
  44159. link.href = URL.createObjectURL(blob);
  44160. if(oldSrc) URL.revokeObjectURL(oldSrc);
  44161. }
  44162. /***/ }),
  44163. /***/ "./node_modules/style-loader/lib/urls.js":
  44164. /*!***********************************************!*\
  44165. !*** ./node_modules/style-loader/lib/urls.js ***!
  44166. \***********************************************/
  44167. /*! no static exports found */
  44168. /***/ (function(module, exports) {
  44169. /**
  44170. * When source maps are enabled, `style-loader` uses a link element with a data-uri to
  44171. * embed the css on the page. This breaks all relative urls because now they are relative to a
  44172. * bundle instead of the current page.
  44173. *
  44174. * One solution is to only use full urls, but that may be impossible.
  44175. *
  44176. * Instead, this function "fixes" the relative urls to be absolute according to the current page location.
  44177. *
  44178. * A rudimentary test suite is located at `test/fixUrls.js` and can be run via the `npm test` command.
  44179. *
  44180. */
  44181. module.exports = function (css) {
  44182. // get current location
  44183. var location = typeof window !== "undefined" && window.location;
  44184. if (!location) {
  44185. throw new Error("fixUrls requires window.location");
  44186. }
  44187. // blank or null?
  44188. if (!css || typeof css !== "string") {
  44189. return css;
  44190. }
  44191. var baseUrl = location.protocol + "//" + location.host;
  44192. var currentDir = baseUrl + location.pathname.replace(/\/[^\/]*$/, "/");
  44193. // convert each url(...)
  44194. /*
  44195. This regular expression is just a way to recursively match brackets within
  44196. a string.
  44197. /url\s*\( = Match on the word "url" with any whitespace after it and then a parens
  44198. ( = Start a capturing group
  44199. (?: = Start a non-capturing group
  44200. [^)(] = Match anything that isn't a parentheses
  44201. | = OR
  44202. \( = Match a start parentheses
  44203. (?: = Start another non-capturing groups
  44204. [^)(]+ = Match anything that isn't a parentheses
  44205. | = OR
  44206. \( = Match a start parentheses
  44207. [^)(]* = Match anything that isn't a parentheses
  44208. \) = Match a end parentheses
  44209. ) = End Group
  44210. *\) = Match anything and then a close parens
  44211. ) = Close non-capturing group
  44212. * = Match anything
  44213. ) = Close capturing group
  44214. \) = Match a close parens
  44215. /gi = Get all matches, not the first. Be case insensitive.
  44216. */
  44217. var fixedCss = css.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi, function(fullMatch, origUrl) {
  44218. // strip quotes (if they exist)
  44219. var unquotedOrigUrl = origUrl
  44220. .trim()
  44221. .replace(/^"(.*)"$/, function(o, $1){ return $1; })
  44222. .replace(/^'(.*)'$/, function(o, $1){ return $1; });
  44223. // already a full url? no change
  44224. if (/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(unquotedOrigUrl)) {
  44225. return fullMatch;
  44226. }
  44227. // convert the url to a full url
  44228. var newUrl;
  44229. if (unquotedOrigUrl.indexOf("//") === 0) {
  44230. //TODO: should we add protocol?
  44231. newUrl = unquotedOrigUrl;
  44232. } else if (unquotedOrigUrl.indexOf("/") === 0) {
  44233. // path should be relative to the base url
  44234. newUrl = baseUrl + unquotedOrigUrl; // already starts with '/'
  44235. } else {
  44236. // path should be relative to current directory
  44237. newUrl = currentDir + unquotedOrigUrl.replace(/^\.\//, ""); // Strip leading './'
  44238. }
  44239. // send back the fixed url(...)
  44240. return "url(" + JSON.stringify(newUrl) + ")";
  44241. });
  44242. // send back the fixed css
  44243. return fixedCss;
  44244. };
  44245. /***/ }),
  44246. /***/ "./node_modules/timers-browserify/main.js":
  44247. /*!************************************************!*\
  44248. !*** ./node_modules/timers-browserify/main.js ***!
  44249. \************************************************/
  44250. /*! no static exports found */
  44251. /***/ (function(module, exports, __webpack_require__) {
  44252. /* WEBPACK VAR INJECTION */(function(global) {var scope = (typeof global !== "undefined" && global) ||
  44253. (typeof self !== "undefined" && self) ||
  44254. window;
  44255. var apply = Function.prototype.apply;
  44256. // DOM APIs, for completeness
  44257. exports.setTimeout = function() {
  44258. return new Timeout(apply.call(setTimeout, scope, arguments), clearTimeout);
  44259. };
  44260. exports.setInterval = function() {
  44261. return new Timeout(apply.call(setInterval, scope, arguments), clearInterval);
  44262. };
  44263. exports.clearTimeout =
  44264. exports.clearInterval = function(timeout) {
  44265. if (timeout) {
  44266. timeout.close();
  44267. }
  44268. };
  44269. function Timeout(id, clearFn) {
  44270. this._id = id;
  44271. this._clearFn = clearFn;
  44272. }
  44273. Timeout.prototype.unref = Timeout.prototype.ref = function() {};
  44274. Timeout.prototype.close = function() {
  44275. this._clearFn.call(scope, this._id);
  44276. };
  44277. // Does not start the time, just sets up the members needed.
  44278. exports.enroll = function(item, msecs) {
  44279. clearTimeout(item._idleTimeoutId);
  44280. item._idleTimeout = msecs;
  44281. };
  44282. exports.unenroll = function(item) {
  44283. clearTimeout(item._idleTimeoutId);
  44284. item._idleTimeout = -1;
  44285. };
  44286. exports._unrefActive = exports.active = function(item) {
  44287. clearTimeout(item._idleTimeoutId);
  44288. var msecs = item._idleTimeout;
  44289. if (msecs >= 0) {
  44290. item._idleTimeoutId = setTimeout(function onTimeout() {
  44291. if (item._onTimeout)
  44292. item._onTimeout();
  44293. }, msecs);
  44294. }
  44295. };
  44296. // setimmediate attaches itself to the global object
  44297. __webpack_require__(/*! setimmediate */ "./node_modules/setimmediate/setImmediate.js");
  44298. // On some exotic environments, it's not clear which object `setimmediate` was
  44299. // able to install onto. Search each possibility in the same order as the
  44300. // `setimmediate` library.
  44301. exports.setImmediate = (typeof self !== "undefined" && self.setImmediate) ||
  44302. (typeof global !== "undefined" && global.setImmediate) ||
  44303. (this && this.setImmediate);
  44304. exports.clearImmediate = (typeof self !== "undefined" && self.clearImmediate) ||
  44305. (typeof global !== "undefined" && global.clearImmediate) ||
  44306. (this && this.clearImmediate);
  44307. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  44308. /***/ }),
  44309. /***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/AssetInfo.vue?vue&type=template&id=f949323a&":
  44310. /*!************************************************************************************************************************************************************************************************************!*\
  44311. !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/AssetInfo.vue?vue&type=template&id=f949323a& ***!
  44312. \************************************************************************************************************************************************************************************************************/
  44313. /*! exports provided: render, staticRenderFns */
  44314. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  44315. "use strict";
  44316. __webpack_require__.r(__webpack_exports__);
  44317. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
  44318. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
  44319. var render = function() {
  44320. var _vm = this
  44321. var _h = _vm.$createElement
  44322. var _c = _vm._self._c || _h
  44323. return _c(
  44324. "div",
  44325. [
  44326. _c("asset-info-edit-modal", {
  44327. attrs: {
  44328. "modal-id": "asset" + _vm.asset.pcid + "editModal",
  44329. "populate-with": _vm.asset
  44330. }
  44331. }),
  44332. _vm._v(" "),
  44333. _c("h4", { staticClass: "text-center" }, [
  44334. _vm._v(
  44335. _vm._s(this.asset.pcmanu) + " " + _vm._s(this.asset.pcmake) + " - "
  44336. ),
  44337. _c("small", { staticClass: "text-muted" }, [
  44338. _vm._v(_vm._s(this.asset.pcnickname))
  44339. ])
  44340. ]),
  44341. _vm._v(" "),
  44342. _c("p", [_vm._v("OS: " + _vm._s(this.asset.pcextra[2]))]),
  44343. _vm._v(" "),
  44344. _c("p", [_vm._v("S/N: " + _vm._s(this.asset.pcextra[104]))]),
  44345. _vm._v(" "),
  44346. _c("p", [_vm._v("CPU: " + _vm._s(this.asset.pcextra[101]))]),
  44347. _vm._v(" "),
  44348. _c("p", [_vm._v("RAM: " + _vm._s(this.asset.pcextra[100]))]),
  44349. _vm._v(" "),
  44350. _c("p", [_vm._v("Graphics: " + _vm._s(this.asset.pcextra[4]))]),
  44351. _vm._v(" "),
  44352. _c(
  44353. "button",
  44354. {
  44355. staticClass: "btn btn-primary",
  44356. attrs: {
  44357. type: "button",
  44358. "data-toggle": "modal",
  44359. "data-target": "#asset" + _vm.asset.pcid + "editModal"
  44360. }
  44361. },
  44362. [_vm._v("Edit")]
  44363. )
  44364. ],
  44365. 1
  44366. )
  44367. }
  44368. var staticRenderFns = []
  44369. render._withStripped = true
  44370. /***/ }),
  44371. /***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/AssetInfoEditModal.vue?vue&type=template&id=24c98bd0&":
  44372. /*!*********************************************************************************************************************************************************************************************************************!*\
  44373. !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/AssetInfoEditModal.vue?vue&type=template&id=24c98bd0& ***!
  44374. \*********************************************************************************************************************************************************************************************************************/
  44375. /*! exports provided: render, staticRenderFns */
  44376. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  44377. "use strict";
  44378. __webpack_require__.r(__webpack_exports__);
  44379. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
  44380. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
  44381. var render = function() {
  44382. var _vm = this
  44383. var _h = _vm.$createElement
  44384. var _c = _vm._self._c || _h
  44385. return _c(
  44386. "modal",
  44387. {
  44388. attrs: {
  44389. id: _vm.modalId,
  44390. tabindex: "-1",
  44391. role: "dialog",
  44392. "aria-labelledby": _vm.modalId + "Label"
  44393. }
  44394. },
  44395. [
  44396. _c(
  44397. "h5",
  44398. {
  44399. staticClass: "modal-title",
  44400. attrs: { slot: "header", id: _vm.modalId + "Label" },
  44401. slot: "header"
  44402. },
  44403. [_vm._v("\n Edit Work Order Information\n ")]
  44404. ),
  44405. _vm._v(" "),
  44406. _c("div", { attrs: { slot: "body" }, slot: "body" }, [
  44407. _c("div", { staticClass: "form-group" }, [
  44408. _c("label", { attrs: { for: "manufacturer" } }, [
  44409. _vm._v("Manufacturer")
  44410. ]),
  44411. _vm._v(" "),
  44412. _c("input", {
  44413. directives: [
  44414. {
  44415. name: "model",
  44416. rawName: "v-model",
  44417. value: _vm.asset.pcmanu,
  44418. expression: "asset.pcmanu"
  44419. }
  44420. ],
  44421. staticClass: "form-control",
  44422. attrs: { type: "text", name: "manufacturer", id: "manufacturer" },
  44423. domProps: { value: _vm.asset.pcmanu },
  44424. on: {
  44425. input: function($event) {
  44426. if ($event.target.composing) {
  44427. return
  44428. }
  44429. _vm.$set(_vm.asset, "pcmanu", $event.target.value)
  44430. }
  44431. }
  44432. })
  44433. ]),
  44434. _vm._v(" "),
  44435. _c("div", { staticClass: "form-group" }, [
  44436. _c("label", { attrs: { for: "make" } }, [_vm._v("Make")]),
  44437. _vm._v(" "),
  44438. _c("input", {
  44439. directives: [
  44440. {
  44441. name: "model",
  44442. rawName: "v-model",
  44443. value: _vm.asset.pcmake,
  44444. expression: "asset.pcmake"
  44445. }
  44446. ],
  44447. staticClass: "form-control",
  44448. attrs: { type: "text", name: "make", id: "make" },
  44449. domProps: { value: _vm.asset.pcmake },
  44450. on: {
  44451. input: function($event) {
  44452. if ($event.target.composing) {
  44453. return
  44454. }
  44455. _vm.$set(_vm.asset, "pcmake", $event.target.value)
  44456. }
  44457. }
  44458. })
  44459. ]),
  44460. _vm._v(" "),
  44461. _c("div", { staticClass: "form-group" }, [
  44462. _c("label", { attrs: { for: "nickname" } }, [_vm._v("Nickname")]),
  44463. _vm._v(" "),
  44464. _c("input", {
  44465. directives: [
  44466. {
  44467. name: "model",
  44468. rawName: "v-model",
  44469. value: _vm.asset.pcnickname,
  44470. expression: "asset.pcnickname"
  44471. }
  44472. ],
  44473. staticClass: "form-control",
  44474. attrs: { type: "text", name: "nickname", id: "nickname" },
  44475. domProps: { value: _vm.asset.pcnickname },
  44476. on: {
  44477. input: function($event) {
  44478. if ($event.target.composing) {
  44479. return
  44480. }
  44481. _vm.$set(_vm.asset, "pcnickname", $event.target.value)
  44482. }
  44483. }
  44484. })
  44485. ]),
  44486. _vm._v(" "),
  44487. _c("div", { staticClass: "form-group" }, [
  44488. _c("label", { attrs: { for: "os" } }, [_vm._v("OS")]),
  44489. _vm._v(" "),
  44490. _c("input", {
  44491. directives: [
  44492. {
  44493. name: "model",
  44494. rawName: "v-model",
  44495. value: _vm.asset.pcextra[2],
  44496. expression: "asset.pcextra[2]"
  44497. }
  44498. ],
  44499. staticClass: "form-control",
  44500. attrs: { type: "text", name: "os", id: "os" },
  44501. domProps: { value: _vm.asset.pcextra[2] },
  44502. on: {
  44503. input: function($event) {
  44504. if ($event.target.composing) {
  44505. return
  44506. }
  44507. _vm.$set(_vm.asset.pcextra, 2, $event.target.value)
  44508. }
  44509. }
  44510. })
  44511. ]),
  44512. _vm._v(" "),
  44513. _c("div", { staticClass: "form-group" }, [
  44514. _c("label", { attrs: { for: "serial" } }, [_vm._v("Serial Number")]),
  44515. _vm._v(" "),
  44516. _c("input", {
  44517. directives: [
  44518. {
  44519. name: "model",
  44520. rawName: "v-model",
  44521. value: _vm.asset.pcextra[104],
  44522. expression: "asset.pcextra[104]"
  44523. }
  44524. ],
  44525. staticClass: "form-control",
  44526. attrs: { type: "text", id: "serial", name: "serial" },
  44527. domProps: { value: _vm.asset.pcextra[104] },
  44528. on: {
  44529. input: function($event) {
  44530. if ($event.target.composing) {
  44531. return
  44532. }
  44533. _vm.$set(_vm.asset.pcextra, 104, $event.target.value)
  44534. }
  44535. }
  44536. })
  44537. ]),
  44538. _vm._v(" "),
  44539. _c("div", { staticClass: "form-group" }, [
  44540. _c("label", { attrs: { for: "cpu" } }, [_vm._v("CPU")]),
  44541. _vm._v(" "),
  44542. _c("input", {
  44543. directives: [
  44544. {
  44545. name: "model",
  44546. rawName: "v-model",
  44547. value: _vm.asset.pcextra[101],
  44548. expression: "asset.pcextra[101]"
  44549. }
  44550. ],
  44551. staticClass: "form-control",
  44552. attrs: { type: "text", id: "cpu", name: "cpu" },
  44553. domProps: { value: _vm.asset.pcextra[101] },
  44554. on: {
  44555. input: function($event) {
  44556. if ($event.target.composing) {
  44557. return
  44558. }
  44559. _vm.$set(_vm.asset.pcextra, 101, $event.target.value)
  44560. }
  44561. }
  44562. })
  44563. ]),
  44564. _vm._v(" "),
  44565. _c("div", { staticClass: "form-group" }, [
  44566. _c("label", { attrs: { for: "ram" } }, [_vm._v("RAM")]),
  44567. _vm._v(" "),
  44568. _c("input", {
  44569. directives: [
  44570. {
  44571. name: "model",
  44572. rawName: "v-model",
  44573. value: _vm.asset.pcextra[100],
  44574. expression: "asset.pcextra[100]"
  44575. }
  44576. ],
  44577. staticClass: "form-control",
  44578. attrs: { type: "text", name: "ram", id: "ram" },
  44579. domProps: { value: _vm.asset.pcextra[100] },
  44580. on: {
  44581. input: function($event) {
  44582. if ($event.target.composing) {
  44583. return
  44584. }
  44585. _vm.$set(_vm.asset.pcextra, 100, $event.target.value)
  44586. }
  44587. }
  44588. })
  44589. ]),
  44590. _vm._v(" "),
  44591. _c("div", { staticClass: "form-group" }, [
  44592. _c("label", { attrs: { for: "graphics" } }, [_vm._v("Graphics")]),
  44593. _vm._v(" "),
  44594. _c("input", {
  44595. directives: [
  44596. {
  44597. name: "model",
  44598. rawName: "v-model",
  44599. value: _vm.asset.pcextra[4],
  44600. expression: "asset.pcextra[4]"
  44601. }
  44602. ],
  44603. staticClass: "form-control",
  44604. attrs: { type: "text", name: "graphics", id: "grapics" },
  44605. domProps: { value: _vm.asset.pcextra[4] },
  44606. on: {
  44607. input: function($event) {
  44608. if ($event.target.composing) {
  44609. return
  44610. }
  44611. _vm.$set(_vm.asset.pcextra, 4, $event.target.value)
  44612. }
  44613. }
  44614. })
  44615. ])
  44616. ]),
  44617. _vm._v(" "),
  44618. _c("div", { attrs: { slot: "footer" }, slot: "footer" }, [
  44619. _c(
  44620. "button",
  44621. {
  44622. staticClass: "btn btn-secondary",
  44623. attrs: { type: "button", "data-dismiss": "modal" }
  44624. },
  44625. [_vm._v("Close")]
  44626. ),
  44627. _vm._v(" "),
  44628. _c(
  44629. "button",
  44630. {
  44631. staticClass: "btn btn-primary",
  44632. attrs: { type: "button" },
  44633. on: {
  44634. click: function($event) {
  44635. return _vm.updateAsset()
  44636. }
  44637. }
  44638. },
  44639. [
  44640. !_vm.assetSaving
  44641. ? _c("div", [_vm._v("Save")])
  44642. : _c("circle-spinner", { attrs: { size: 2 } })
  44643. ],
  44644. 1
  44645. )
  44646. ])
  44647. ]
  44648. )
  44649. }
  44650. var staticRenderFns = []
  44651. render._withStripped = true
  44652. /***/ }),
  44653. /***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/AutocompleteCustomDropdown.vue?vue&type=template&id=5fcc8b56&":
  44654. /*!*****************************************************************************************************************************************************************************************************************************!*\
  44655. !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/AutocompleteCustomDropdown.vue?vue&type=template&id=5fcc8b56& ***!
  44656. \*****************************************************************************************************************************************************************************************************************************/
  44657. /*! exports provided: render, staticRenderFns */
  44658. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  44659. "use strict";
  44660. __webpack_require__.r(__webpack_exports__);
  44661. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
  44662. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
  44663. var render = function() {
  44664. var _vm = this
  44665. var _h = _vm.$createElement
  44666. var _c = _vm._self._c || _h
  44667. return _c("div", { staticClass: "dropdown", class: { open: _vm.open } }, [
  44668. _c("div", { staticClass: "input-group" }, [
  44669. _c("input", {
  44670. directives: [
  44671. {
  44672. name: "model",
  44673. rawName: "v-model",
  44674. value: _vm.searchText,
  44675. expression: "searchText"
  44676. }
  44677. ],
  44678. staticClass: "form-control",
  44679. attrs: { type: "text" },
  44680. domProps: { value: _vm.searchText },
  44681. on: {
  44682. input: [
  44683. function($event) {
  44684. if ($event.target.composing) {
  44685. return
  44686. }
  44687. _vm.searchText = $event.target.value
  44688. },
  44689. _vm.searchChanged
  44690. ]
  44691. }
  44692. }),
  44693. _vm._v(" "),
  44694. _c("div", { staticClass: "form-group-append" }, [
  44695. _c(
  44696. "a",
  44697. {
  44698. staticClass: "toggle input-group-text bg-primary text-light",
  44699. on: {
  44700. mousedown: function($event) {
  44701. $event.preventDefault()
  44702. },
  44703. click: function($event) {
  44704. return _vm.setOpen(!_vm.open)
  44705. }
  44706. }
  44707. },
  44708. [
  44709. _c("span", { staticClass: "arrow-up" }, [_vm._v("▲")]),
  44710. _vm._v(" "),
  44711. _c("span", { staticClass: "arrow-down" }, [_vm._v("▼")])
  44712. ]
  44713. )
  44714. ])
  44715. ]),
  44716. _vm._v(" "),
  44717. _c(
  44718. "ul",
  44719. { staticClass: "suggestion-list list-unstyled" },
  44720. _vm._l(_vm.matches, function(suggestion, index) {
  44721. return _c(
  44722. "li",
  44723. {
  44724. key: index,
  44725. on: {
  44726. mousedown: function($event) {
  44727. $event.preventDefault()
  44728. },
  44729. click: function($event) {
  44730. return _vm.suggestionSelected(suggestion)
  44731. }
  44732. }
  44733. },
  44734. [_vm._v("\n " + _vm._s(suggestion[1]) + "\n ")]
  44735. )
  44736. }),
  44737. 0
  44738. )
  44739. ])
  44740. }
  44741. var staticRenderFns = []
  44742. render._withStripped = true
  44743. /***/ }),
  44744. /***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/CircleSpinner.vue?vue&type=template&id=9a543b64&scoped=true&":
  44745. /*!****************************************************************************************************************************************************************************************************************************!*\
  44746. !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/CircleSpinner.vue?vue&type=template&id=9a543b64&scoped=true& ***!
  44747. \****************************************************************************************************************************************************************************************************************************/
  44748. /*! exports provided: render, staticRenderFns */
  44749. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  44750. "use strict";
  44751. __webpack_require__.r(__webpack_exports__);
  44752. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
  44753. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
  44754. var render = function() {
  44755. var _vm = this
  44756. var _h = _vm.$createElement
  44757. var _c = _vm._self._c || _h
  44758. return _c(
  44759. "div",
  44760. {
  44761. staticClass: "loader",
  44762. style: {
  44763. fontSize: _vm.size + "px",
  44764. borderLeft: "1.1em solid " + _vm.color
  44765. }
  44766. },
  44767. [_vm._v("Loading...")]
  44768. )
  44769. }
  44770. var staticRenderFns = []
  44771. render._withStripped = true
  44772. /***/ }),
  44773. /***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/Credential.vue?vue&type=template&id=58b8dcfc&":
  44774. /*!*************************************************************************************************************************************************************************************************************!*\
  44775. !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/Credential.vue?vue&type=template&id=58b8dcfc& ***!
  44776. \*************************************************************************************************************************************************************************************************************/
  44777. /*! exports provided: render, staticRenderFns */
  44778. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  44779. "use strict";
  44780. __webpack_require__.r(__webpack_exports__);
  44781. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
  44782. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
  44783. var render = function() {
  44784. var _vm = this
  44785. var _h = _vm.$createElement
  44786. var _c = _vm._self._c || _h
  44787. return _c(
  44788. "div",
  44789. { staticClass: "bg-lightgray m-1 p-2 border rounded container-fluid" },
  44790. [
  44791. _c("credential-form-modal", {
  44792. attrs: {
  44793. descriptions: _vm.creddescList,
  44794. "modal-id": "credential" + this.data.credid + "editModal",
  44795. populateWith: this.data
  44796. }
  44797. }),
  44798. _vm._v(" "),
  44799. _c(
  44800. "modal",
  44801. {
  44802. attrs: {
  44803. id: "credential" + this.data.credid + "deleteModal",
  44804. tabindex: "-1"
  44805. }
  44806. },
  44807. [
  44808. _c(
  44809. "h5",
  44810. {
  44811. staticClass: "modal-title",
  44812. attrs: {
  44813. slot: "header",
  44814. id: "credential" + this.data.credid + "deleteModalLabel"
  44815. },
  44816. slot: "header"
  44817. },
  44818. [_vm._v("\r\n Delete Credential\r\n ")]
  44819. ),
  44820. _vm._v(" "),
  44821. _c("div", { attrs: { slot: "body" }, slot: "body" }, [
  44822. _vm._v("\r\n Are you sure?\r\n ")
  44823. ]),
  44824. _vm._v(" "),
  44825. _c("div", { attrs: { slot: "footer" }, slot: "footer" }, [
  44826. _c(
  44827. "button",
  44828. {
  44829. staticClass: "btn btn-secondary",
  44830. attrs: { type: "button", "data-dismiss": "modal" }
  44831. },
  44832. [_vm._v("Cancel")]
  44833. ),
  44834. _vm._v(" "),
  44835. _c(
  44836. "button",
  44837. {
  44838. staticClass: "btn btn-danger",
  44839. attrs: { type: "button" },
  44840. on: {
  44841. click: function($event) {
  44842. return _vm.deleteCredential()
  44843. }
  44844. }
  44845. },
  44846. [_vm._v("Confirm")]
  44847. )
  44848. ])
  44849. ]
  44850. ),
  44851. _vm._v(" "),
  44852. _c("div", { staticClass: "row no-gutters" }, [
  44853. _c("div", { staticClass: "h5 col-3 text-left" }, [
  44854. _vm._v(_vm._s(this.data.creddesc))
  44855. ]),
  44856. _vm._v(" "),
  44857. _c("div", { staticClass: "col-9 text-right" }, [
  44858. _vm._v(_vm._s(this.data.creddate))
  44859. ])
  44860. ]),
  44861. _vm._v(" "),
  44862. _c("div", { staticClass: "row" }, [
  44863. _c("div", { staticClass: "col-lg-9" }, [
  44864. _c("div", [
  44865. _vm._m(0),
  44866. _vm._v(" "),
  44867. _c("input", {
  44868. staticClass: "border-0 credential",
  44869. attrs: {
  44870. type: "text",
  44871. id: "username" + this.data.credid,
  44872. readonly: ""
  44873. },
  44874. domProps: { value: this.data.creduser }
  44875. }),
  44876. _vm._v(" "),
  44877. _c(
  44878. "button",
  44879. {
  44880. staticClass: "btn-clip btn btn-sm btn-primary rounded-pill",
  44881. attrs: {
  44882. id: "btn-username" + this.data.credid,
  44883. "data-clipboard-target": "#username" + this.data.credid
  44884. }
  44885. },
  44886. [_c("i", { staticClass: "far fa-clone" })]
  44887. )
  44888. ]),
  44889. _vm._v(" "),
  44890. _c("div", [
  44891. _vm._m(1),
  44892. _vm._v(" "),
  44893. _c("input", {
  44894. staticClass: "border-0 credential",
  44895. attrs: {
  44896. type: "text",
  44897. id: "password" + this.data.credid,
  44898. readonly: ""
  44899. },
  44900. domProps: { value: this.data.credpass }
  44901. }),
  44902. _vm._v(" "),
  44903. _c(
  44904. "button",
  44905. {
  44906. staticClass: "btn-clip btn btn-sm btn-primary rounded-pill",
  44907. attrs: {
  44908. id: "btn-password" + this.data.credid,
  44909. "data-clipboard-target": "#password" + this.data.credid
  44910. }
  44911. },
  44912. [_c("i", { staticClass: "far fa-clone" })]
  44913. )
  44914. ])
  44915. ]),
  44916. _vm._v(" "),
  44917. _c(
  44918. "div",
  44919. {
  44920. staticClass: "btn-group col-lg-2 align-self-end w-25 w-lg-auto",
  44921. attrs: { role: "group", "aria-label": "Edit and Delete" }
  44922. },
  44923. [
  44924. _c(
  44925. "button",
  44926. {
  44927. staticClass: "btn btn-sm btn-secondary p-lg-1",
  44928. attrs: {
  44929. type: "button",
  44930. "data-toggle": "modal",
  44931. "data-target": "#credential" + this.data.credid + "editModal"
  44932. }
  44933. },
  44934. [_c("i", { staticClass: "fas fa-fw fa-edit" })]
  44935. ),
  44936. _vm._v(" "),
  44937. _c(
  44938. "button",
  44939. {
  44940. staticClass: "btn btn-sm btn-danger p-lg-1",
  44941. attrs: {
  44942. type: "button",
  44943. "data-toggle": "modal",
  44944. "data-target":
  44945. "#credential" + this.data.credid + "deleteModal"
  44946. }
  44947. },
  44948. [_c("i", { staticClass: "fas fa-fw fa-trash-alt" })]
  44949. )
  44950. ]
  44951. )
  44952. ])
  44953. ],
  44954. 1
  44955. )
  44956. }
  44957. var staticRenderFns = [
  44958. function() {
  44959. var _vm = this
  44960. var _h = _vm.$createElement
  44961. var _c = _vm._self._c || _h
  44962. return _c("label", { attrs: { for: "username" } }, [
  44963. _c("i", { staticClass: "fas fa-fw fa-user" })
  44964. ])
  44965. },
  44966. function() {
  44967. var _vm = this
  44968. var _h = _vm.$createElement
  44969. var _c = _vm._self._c || _h
  44970. return _c("label", { attrs: { for: "password" } }, [
  44971. _c("i", { staticClass: "fas fa-fw fa-key" })
  44972. ])
  44973. }
  44974. ]
  44975. render._withStripped = true
  44976. /***/ }),
  44977. /***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/CredentialFormModal.vue?vue&type=template&id=3cdb3697&":
  44978. /*!**********************************************************************************************************************************************************************************************************************!*\
  44979. !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/CredentialFormModal.vue?vue&type=template&id=3cdb3697& ***!
  44980. \**********************************************************************************************************************************************************************************************************************/
  44981. /*! exports provided: render, staticRenderFns */
  44982. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  44983. "use strict";
  44984. __webpack_require__.r(__webpack_exports__);
  44985. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
  44986. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
  44987. var render = function() {
  44988. var _vm = this
  44989. var _h = _vm.$createElement
  44990. var _c = _vm._self._c || _h
  44991. return _c(
  44992. "modal",
  44993. {
  44994. attrs: {
  44995. id: _vm.id,
  44996. tabindex: "-1",
  44997. role: "dialog",
  44998. "aria-labelledby": _vm.id + "Label"
  44999. }
  45000. },
  45001. [
  45002. _c(
  45003. "h5",
  45004. {
  45005. staticClass: "modal-title",
  45006. attrs: { slot: "header", id: _vm.id + "Label" },
  45007. slot: "header"
  45008. },
  45009. [_vm._v("\n Edit Credential\n ")]
  45010. ),
  45011. _vm._v(" "),
  45012. _c("div", { attrs: { slot: "body" }, slot: "body" }, [
  45013. _c(
  45014. "div",
  45015. { staticClass: "form" },
  45016. [
  45017. _c("autocomplete-custom-dropdown", {
  45018. attrs: {
  45019. options: _vm.descriptions,
  45020. value: _vm.creddesc,
  45021. "allow-custom": true
  45022. },
  45023. model: {
  45024. value: _vm.creddesc,
  45025. callback: function($$v) {
  45026. _vm.creddesc = $$v
  45027. },
  45028. expression: "creddesc"
  45029. }
  45030. })
  45031. ],
  45032. 1
  45033. ),
  45034. _vm._v(" "),
  45035. _c("div", { staticClass: "form-group" }, [
  45036. _c("label", { attrs: { for: "newusername" } }, [_vm._v("Username")]),
  45037. _vm._v(" "),
  45038. _c("input", {
  45039. directives: [
  45040. {
  45041. name: "model",
  45042. rawName: "v-model",
  45043. value: _vm.data.creduser,
  45044. expression: "data.creduser"
  45045. }
  45046. ],
  45047. staticClass: "form-control credential",
  45048. attrs: {
  45049. type: "text",
  45050. name: "newusername" + _vm.data.credid,
  45051. id: "newusername" + _vm.data.credid
  45052. },
  45053. domProps: { value: _vm.data.creduser },
  45054. on: {
  45055. input: function($event) {
  45056. if ($event.target.composing) {
  45057. return
  45058. }
  45059. _vm.$set(_vm.data, "creduser", $event.target.value)
  45060. }
  45061. }
  45062. })
  45063. ]),
  45064. _vm._v(" "),
  45065. _c("div", { staticClass: "form-group" }, [
  45066. _c("label", { attrs: { for: "newpassword" } }, [_vm._v("Password")]),
  45067. _vm._v(" "),
  45068. _c("input", {
  45069. directives: [
  45070. {
  45071. name: "model",
  45072. rawName: "v-model",
  45073. value: _vm.data.credpass,
  45074. expression: "data.credpass"
  45075. }
  45076. ],
  45077. staticClass: "form-control credential",
  45078. attrs: {
  45079. type: "text",
  45080. name: "newpassword" + _vm.data.credid,
  45081. id: "newpassword" + _vm.data.credid
  45082. },
  45083. domProps: { value: _vm.data.credpass },
  45084. on: {
  45085. input: function($event) {
  45086. if ($event.target.composing) {
  45087. return
  45088. }
  45089. _vm.$set(_vm.data, "credpass", $event.target.value)
  45090. }
  45091. }
  45092. }),
  45093. _vm._v(" "),
  45094. _c(
  45095. "button",
  45096. {
  45097. staticClass: "btn btn-secondary",
  45098. attrs: { type: "button" },
  45099. on: {
  45100. click: function($event) {
  45101. return _vm.getRandomPassword(_vm.data.credid)
  45102. }
  45103. }
  45104. },
  45105. [_vm._v("Generate Random")]
  45106. )
  45107. ]),
  45108. _vm._v(" "),
  45109. _c("div", { staticClass: "form-group" })
  45110. ]),
  45111. _vm._v(" "),
  45112. _c("div", { attrs: { slot: "footer" }, slot: "footer" }, [
  45113. _c(
  45114. "button",
  45115. {
  45116. staticClass: "btn btn-secondary",
  45117. attrs: { type: "button", "data-dismiss": "modal" }
  45118. },
  45119. [_vm._v("Close")]
  45120. ),
  45121. _vm._v(" "),
  45122. _c(
  45123. "button",
  45124. {
  45125. staticClass: "btn btn-primary",
  45126. attrs: { type: "button" },
  45127. on: {
  45128. click: function($event) {
  45129. return _vm.updateCredential()
  45130. }
  45131. }
  45132. },
  45133. [_vm._v("Save")]
  45134. )
  45135. ])
  45136. ]
  45137. )
  45138. }
  45139. var staticRenderFns = []
  45140. render._withStripped = true
  45141. /***/ }),
  45142. /***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/CredentialList.vue?vue&type=template&id=7264bb80&":
  45143. /*!*****************************************************************************************************************************************************************************************************************!*\
  45144. !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/CredentialList.vue?vue&type=template&id=7264bb80& ***!
  45145. \*****************************************************************************************************************************************************************************************************************/
  45146. /*! exports provided: render, staticRenderFns */
  45147. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  45148. "use strict";
  45149. __webpack_require__.r(__webpack_exports__);
  45150. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
  45151. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
  45152. var render = function() {
  45153. var _vm = this
  45154. var _h = _vm.$createElement
  45155. var _c = _vm._self._c || _h
  45156. return _c(
  45157. "div",
  45158. [
  45159. _c("credential-form-modal", {
  45160. attrs: {
  45161. "modal-id": "newCredentialModal",
  45162. descriptions: _vm.creddescList,
  45163. create: true,
  45164. pcid: _vm.pcid
  45165. }
  45166. }),
  45167. _vm._v(" "),
  45168. _c(
  45169. "button",
  45170. {
  45171. staticClass: "btn btn-primary",
  45172. attrs: {
  45173. type: "button",
  45174. "data-toggle": "modal",
  45175. "data-target": "#newCredentialModal"
  45176. }
  45177. },
  45178. [_vm._v("New Credential")]
  45179. ),
  45180. _vm._v(" "),
  45181. _vm._l(_vm.credentials, function(credential) {
  45182. return _c(
  45183. "div",
  45184. { key: credential.credid },
  45185. [
  45186. _c("credential", {
  45187. attrs: { credential: credential, descriptions: _vm.creddescList }
  45188. })
  45189. ],
  45190. 1
  45191. )
  45192. })
  45193. ],
  45194. 2
  45195. )
  45196. }
  45197. var staticRenderFns = []
  45198. render._withStripped = true
  45199. /***/ }),
  45200. /***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/ErrorList.vue?vue&type=template&id=48c089eb&":
  45201. /*!************************************************************************************************************************************************************************************************************!*\
  45202. !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/ErrorList.vue?vue&type=template&id=48c089eb& ***!
  45203. \************************************************************************************************************************************************************************************************************/
  45204. /*! exports provided: render, staticRenderFns */
  45205. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  45206. "use strict";
  45207. __webpack_require__.r(__webpack_exports__);
  45208. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
  45209. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
  45210. var render = function() {
  45211. var _vm = this
  45212. var _h = _vm.$createElement
  45213. var _c = _vm._self._c || _h
  45214. return _c(
  45215. "ul",
  45216. { staticClass: "list-unstyled" },
  45217. _vm._l(_vm.errorList, function(error) {
  45218. return _c("li", { key: error, staticClass: "text-danger" }, [
  45219. _vm._v(" " + _vm._s(error) + " ")
  45220. ])
  45221. }),
  45222. 0
  45223. )
  45224. }
  45225. var staticRenderFns = []
  45226. render._withStripped = true
  45227. /***/ }),
  45228. /***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/Modal.vue?vue&type=template&id=53ab54d2&":
  45229. /*!********************************************************************************************************************************************************************************************************!*\
  45230. !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/Modal.vue?vue&type=template&id=53ab54d2& ***!
  45231. \********************************************************************************************************************************************************************************************************/
  45232. /*! exports provided: render, staticRenderFns */
  45233. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  45234. "use strict";
  45235. __webpack_require__.r(__webpack_exports__);
  45236. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
  45237. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
  45238. var render = function() {
  45239. var _vm = this
  45240. var _h = _vm.$createElement
  45241. var _c = _vm._self._c || _h
  45242. return _c("div", { staticClass: "modal fade" }, [
  45243. _c(
  45244. "div",
  45245. { staticClass: "modal-dialog modal-lg", attrs: { role: "document" } },
  45246. [
  45247. _c("div", { staticClass: "modal-content" }, [
  45248. _c(
  45249. "div",
  45250. { staticClass: "modal-header" },
  45251. [_vm._m(0), _vm._v(" "), _vm._t("header")],
  45252. 2
  45253. ),
  45254. _vm._v(" "),
  45255. _c("div", { staticClass: "modal-body" }, [_vm._t("body")], 2),
  45256. _vm._v(" "),
  45257. _c("div", { staticClass: "modal-footer" }, [_vm._t("footer")], 2)
  45258. ])
  45259. ]
  45260. )
  45261. ])
  45262. }
  45263. var staticRenderFns = [
  45264. function() {
  45265. var _vm = this
  45266. var _h = _vm.$createElement
  45267. var _c = _vm._self._c || _h
  45268. return _c(
  45269. "button",
  45270. {
  45271. staticClass: "close",
  45272. attrs: {
  45273. type: "button",
  45274. "data-dismiss": "modal",
  45275. "aria-label": "Close"
  45276. }
  45277. },
  45278. [_c("span", { attrs: { "aria-hidden": "true" } }, [_vm._v("×")])]
  45279. )
  45280. }
  45281. ]
  45282. render._withStripped = true
  45283. /***/ }),
  45284. /***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/NoteFormModal.vue?vue&type=template&id=1391a09c&":
  45285. /*!****************************************************************************************************************************************************************************************************************!*\
  45286. !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/NoteFormModal.vue?vue&type=template&id=1391a09c& ***!
  45287. \****************************************************************************************************************************************************************************************************************/
  45288. /*! exports provided: render, staticRenderFns */
  45289. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  45290. "use strict";
  45291. __webpack_require__.r(__webpack_exports__);
  45292. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
  45293. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
  45294. var render = function() {
  45295. var _vm = this
  45296. var _h = _vm.$createElement
  45297. var _c = _vm._self._c || _h
  45298. return _c(
  45299. "modal",
  45300. {
  45301. attrs: {
  45302. id: _vm.modalId,
  45303. tabindex: "-1",
  45304. role: "dialog",
  45305. "aria-labelledby": _vm.modalId + "Label"
  45306. }
  45307. },
  45308. [
  45309. _c(
  45310. "h5",
  45311. {
  45312. staticClass: "modal-title",
  45313. attrs: { slot: "header", id: _vm.modalId + "Label" },
  45314. slot: "header"
  45315. },
  45316. [_vm._v("\n Edit Note\n ")]
  45317. ),
  45318. _vm._v(" "),
  45319. _c("div", { attrs: { slot: "body" }, slot: "body" }, [
  45320. _c("div", { staticClass: "form-group" }, [
  45321. _c("label", { attrs: { for: "content" } }, [_vm._v("Content")]),
  45322. _vm._v(" "),
  45323. _c("textarea", {
  45324. directives: [
  45325. {
  45326. name: "model",
  45327. rawName: "v-model",
  45328. value: _vm.note.thenote,
  45329. expression: "note.thenote"
  45330. }
  45331. ],
  45332. staticClass: "form-control",
  45333. attrs: {
  45334. name: "content" + _vm.note.noteid,
  45335. id: "content" + _vm.note.noteid
  45336. },
  45337. domProps: { value: _vm.note.thenote },
  45338. on: {
  45339. input: function($event) {
  45340. if ($event.target.composing) {
  45341. return
  45342. }
  45343. _vm.$set(_vm.note, "thenote", $event.target.value)
  45344. }
  45345. }
  45346. })
  45347. ])
  45348. ]),
  45349. _vm._v(" "),
  45350. _c("div", { attrs: { slot: "footer" }, slot: "footer" }, [
  45351. _c(
  45352. "button",
  45353. {
  45354. staticClass: "btn btn-secondary",
  45355. attrs: { type: "button", "data-dismiss": "modal" }
  45356. },
  45357. [_vm._v("Close")]
  45358. ),
  45359. _vm._v(" "),
  45360. _c(
  45361. "button",
  45362. {
  45363. staticClass: "btn btn-primary",
  45364. attrs: { type: "button" },
  45365. on: {
  45366. click: function($event) {
  45367. return _vm.updateNote(_vm.note)
  45368. }
  45369. }
  45370. },
  45371. [_vm._v("Save")]
  45372. )
  45373. ])
  45374. ]
  45375. )
  45376. }
  45377. var staticRenderFns = []
  45378. render._withStripped = true
  45379. /***/ }),
  45380. /***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/Notes.vue?vue&type=template&id=3d897ee6&":
  45381. /*!********************************************************************************************************************************************************************************************************!*\
  45382. !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/Notes.vue?vue&type=template&id=3d897ee6& ***!
  45383. \********************************************************************************************************************************************************************************************************/
  45384. /*! exports provided: render, staticRenderFns */
  45385. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  45386. "use strict";
  45387. __webpack_require__.r(__webpack_exports__);
  45388. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
  45389. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
  45390. var render = function() {
  45391. var _vm = this
  45392. var _h = _vm.$createElement
  45393. var _c = _vm._self._c || _h
  45394. return _c(
  45395. "ul",
  45396. { staticClass: "list-unstyled" },
  45397. [
  45398. _c("div", { staticClass: "row" }, [
  45399. _c(
  45400. "div",
  45401. {
  45402. staticClass:
  45403. "col-md-2 d-flex justify-content-center justify-content-md-start"
  45404. },
  45405. [
  45406. _c(
  45407. "button",
  45408. {
  45409. staticClass: "btn btn-primary m-2",
  45410. attrs: {
  45411. type: "button",
  45412. "data-toggle": "collapse",
  45413. "data-target": "#note" + _vm.noteType + "add"
  45414. }
  45415. },
  45416. [
  45417. _c("i", { staticClass: "fas fa-fw fa-plus" }),
  45418. _vm._v(" Add New Note")
  45419. ]
  45420. )
  45421. ]
  45422. ),
  45423. _vm._v(" "),
  45424. _c("div", { staticClass: "col-md-10" }, [
  45425. _c(
  45426. "div",
  45427. {
  45428. staticClass: "collapse",
  45429. attrs: { id: "note" + _vm.noteType + "add" }
  45430. },
  45431. [
  45432. _c(
  45433. "div",
  45434. {
  45435. staticClass:
  45436. "d-flex flex-wrap flex-md-nowrap justify-content-center"
  45437. },
  45438. [
  45439. _c("textarea", {
  45440. directives: [
  45441. {
  45442. name: "model",
  45443. rawName: "v-model",
  45444. value: _vm.newNote.thenote,
  45445. expression: "newNote.thenote"
  45446. }
  45447. ],
  45448. staticClass: "form-control",
  45449. attrs: {
  45450. name: "newnote" + _vm.noteType,
  45451. id: "newnote" + _vm.noteType
  45452. },
  45453. domProps: { value: _vm.newNote.thenote },
  45454. on: {
  45455. input: function($event) {
  45456. if ($event.target.composing) {
  45457. return
  45458. }
  45459. _vm.$set(_vm.newNote, "thenote", $event.target.value)
  45460. }
  45461. }
  45462. }),
  45463. _vm._v(" "),
  45464. _c(
  45465. "button",
  45466. {
  45467. staticClass: "btn btn-secondary m-2",
  45468. attrs: { type: "button" },
  45469. on: {
  45470. click: function($event) {
  45471. return _vm.createNote()
  45472. }
  45473. }
  45474. },
  45475. [_vm._v("Save")]
  45476. )
  45477. ]
  45478. )
  45479. ]
  45480. )
  45481. ])
  45482. ]),
  45483. _vm._v(" "),
  45484. _vm._l(this.notes, function(note, index) {
  45485. return _c(
  45486. "li",
  45487. { key: index, staticClass: "row no-gutters mb-2" },
  45488. [
  45489. _c("note-form-modal", {
  45490. attrs: {
  45491. "modal-id": "note" + note.noteid + "editModal",
  45492. "populate-with": note
  45493. }
  45494. }),
  45495. _vm._v(" "),
  45496. _c(
  45497. "div",
  45498. {
  45499. staticClass: "col-md-1 d-flex flex-column mx-md-3",
  45500. class: _vm.noteOrders[index]
  45501. },
  45502. [
  45503. _c("div", { staticClass: "text-center p-0 m-0" }, [
  45504. _vm._v(_vm._s(note.noteuser))
  45505. ]),
  45506. _vm._v(" "),
  45507. _c(
  45508. "div",
  45509. { staticClass: "text-muted text-small text-center p-0 m-0" },
  45510. [_vm._v(_vm._s(_vm.getHRDate(note.notetime)))]
  45511. ),
  45512. _vm._v(" "),
  45513. _c(
  45514. "div",
  45515. { staticClass: "btn-group justify-content-center p-0 m-0" },
  45516. [
  45517. _vm.authusername === note.noteuser ||
  45518. _vm.authusername === "admin"
  45519. ? [
  45520. _c(
  45521. "button",
  45522. {
  45523. staticClass: "btn btn-sm btn-primary m-1",
  45524. attrs: {
  45525. "data-toggle": "modal",
  45526. "data-target":
  45527. "#note" + note.noteid + "editModal"
  45528. }
  45529. },
  45530. [_c("i", { staticClass: "fas fa-fw fa-edit" })]
  45531. ),
  45532. _vm._v(" "),
  45533. _vm._m(0, true),
  45534. _vm._v(" "),
  45535. _vm._m(1, true)
  45536. ]
  45537. : _vm._e()
  45538. ],
  45539. 2
  45540. )
  45541. ]
  45542. ),
  45543. _vm._v(" "),
  45544. _c("div", { staticClass: "col-md-10" }, [
  45545. _c("div", { staticClass: "card m-2" }, [
  45546. _c("div", { staticClass: "card-body p-2" }, [
  45547. _vm._v(
  45548. "\n " +
  45549. _vm._s(note.thenote) +
  45550. "\n "
  45551. )
  45552. ])
  45553. ])
  45554. ])
  45555. ],
  45556. 1
  45557. )
  45558. })
  45559. ],
  45560. 2
  45561. )
  45562. }
  45563. var staticRenderFns = [
  45564. function() {
  45565. var _vm = this
  45566. var _h = _vm.$createElement
  45567. var _c = _vm._self._c || _h
  45568. return _c("button", { staticClass: "btn btn-sm btn-danger m-1" }, [
  45569. _c("i", { staticClass: "fas fa-fw fa-trash-alt" })
  45570. ])
  45571. },
  45572. function() {
  45573. var _vm = this
  45574. var _h = _vm.$createElement
  45575. var _c = _vm._self._c || _h
  45576. return _c("button", { staticClass: "btn btn-sm btn-primary m-1" }, [
  45577. _c("i", { staticClass: "fa fa-fw fa-random" })
  45578. ])
  45579. }
  45580. ]
  45581. render._withStripped = true
  45582. /***/ }),
  45583. /***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/WoInfoEditModal.vue?vue&type=template&id=352dd7a2&":
  45584. /*!******************************************************************************************************************************************************************************************************************!*\
  45585. !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/WoInfoEditModal.vue?vue&type=template&id=352dd7a2& ***!
  45586. \******************************************************************************************************************************************************************************************************************/
  45587. /*! exports provided: render, staticRenderFns */
  45588. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  45589. "use strict";
  45590. __webpack_require__.r(__webpack_exports__);
  45591. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
  45592. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
  45593. var render = function() {
  45594. var _vm = this
  45595. var _h = _vm.$createElement
  45596. var _c = _vm._self._c || _h
  45597. return _c(
  45598. "modal",
  45599. {
  45600. attrs: {
  45601. id: _vm.id,
  45602. tabindex: "-1",
  45603. role: "dialog",
  45604. "aria-labelledby": _vm.id + "Label"
  45605. }
  45606. },
  45607. [
  45608. _c(
  45609. "h5",
  45610. {
  45611. staticClass: "modal-title",
  45612. attrs: { slot: "header", id: _vm.id + "Label" },
  45613. slot: "header"
  45614. },
  45615. [_vm._v("\r\n Edit Work Order Information\r\n ")]
  45616. ),
  45617. _vm._v(" "),
  45618. _c("div", { attrs: { slot: "body" }, slot: "body" }, [
  45619. _c(
  45620. "div",
  45621. { staticClass: "form-group" },
  45622. [
  45623. _c("label", { attrs: { for: "probdesc" } }, [
  45624. _vm._v("Problem Description")
  45625. ]),
  45626. _vm._v(" "),
  45627. _c("textarea", {
  45628. directives: [
  45629. {
  45630. name: "model",
  45631. rawName: "v-model",
  45632. value: _vm.data.probdesc,
  45633. expression: "data.probdesc"
  45634. }
  45635. ],
  45636. class: {
  45637. "form-control": true,
  45638. "is-invalid": _vm.errors.probdesc
  45639. },
  45640. attrs: { id: "probdesc", name: "probdesc" },
  45641. domProps: { value: _vm.data.probdesc },
  45642. on: {
  45643. input: function($event) {
  45644. if ($event.target.composing) {
  45645. return
  45646. }
  45647. _vm.$set(_vm.data, "probdesc", $event.target.value)
  45648. }
  45649. }
  45650. }),
  45651. _vm._v(" "),
  45652. _c("error-list", { attrs: { errors: _vm.errors.probdesc } })
  45653. ],
  45654. 1
  45655. ),
  45656. _vm._v(" "),
  45657. _c(
  45658. "div",
  45659. { staticClass: "form-group" },
  45660. [
  45661. _c("label", { attrs: { for: "suggested" } }, [
  45662. _vm._v("Suggested Solution")
  45663. ]),
  45664. _vm._v(" "),
  45665. _c("textarea", {
  45666. directives: [
  45667. {
  45668. name: "model",
  45669. rawName: "v-model",
  45670. value: _vm.data.suggested,
  45671. expression: "data.suggested"
  45672. }
  45673. ],
  45674. class: {
  45675. "form-control": true,
  45676. "is-invalid": _vm.errors.suggested
  45677. },
  45678. attrs: { id: "suggested", name: "suggested" },
  45679. domProps: { value: _vm.data.suggested },
  45680. on: {
  45681. input: function($event) {
  45682. if ($event.target.composing) {
  45683. return
  45684. }
  45685. _vm.$set(_vm.data, "suggested", $event.target.value)
  45686. }
  45687. }
  45688. }),
  45689. _vm._v(" "),
  45690. _c("error-list", { attrs: { errors: _vm.errors.suggested } })
  45691. ],
  45692. 1
  45693. ),
  45694. _vm._v(" "),
  45695. _c(
  45696. "div",
  45697. { staticClass: "form-group" },
  45698. [
  45699. _c("label", { attrs: { for: "storelist" } }, [_vm._v("Store")]),
  45700. _vm._v(" "),
  45701. _c("autocomplete-custom-dropdown", {
  45702. attrs: { options: _vm.storeList, value: this.store },
  45703. model: {
  45704. value: _vm.store,
  45705. callback: function($$v) {
  45706. _vm.store = $$v
  45707. },
  45708. expression: "store"
  45709. }
  45710. })
  45711. ],
  45712. 1
  45713. )
  45714. ]),
  45715. _vm._v(" "),
  45716. _c("div", { attrs: { slot: "footer" }, slot: "footer" }, [
  45717. _c(
  45718. "button",
  45719. {
  45720. staticClass: "btn btn-secondary",
  45721. attrs: { type: "button", "data-dismiss": "modal" }
  45722. },
  45723. [_vm._v("Close")]
  45724. ),
  45725. _vm._v(" "),
  45726. _c(
  45727. "button",
  45728. {
  45729. staticClass: "btn btn-primary",
  45730. attrs: { type: "button" },
  45731. on: {
  45732. click: function($event) {
  45733. return _vm.updateWorkOrder()
  45734. }
  45735. }
  45736. },
  45737. [
  45738. !_vm.woInfoSaving
  45739. ? _c("div", [_vm._v("Save")])
  45740. : _c("circle-spinner", { attrs: { size: 2 } })
  45741. ],
  45742. 1
  45743. )
  45744. ])
  45745. ]
  45746. )
  45747. }
  45748. var staticRenderFns = []
  45749. render._withStripped = true
  45750. /***/ }),
  45751. /***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/WorkOrderInfo.vue?vue&type=template&id=50116330&":
  45752. /*!****************************************************************************************************************************************************************************************************************!*\
  45753. !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/WorkOrderInfo.vue?vue&type=template&id=50116330& ***!
  45754. \****************************************************************************************************************************************************************************************************************/
  45755. /*! exports provided: render, staticRenderFns */
  45756. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  45757. "use strict";
  45758. __webpack_require__.r(__webpack_exports__);
  45759. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
  45760. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
  45761. var render = function() {
  45762. var _vm = this
  45763. var _h = _vm.$createElement
  45764. var _c = _vm._self._c || _h
  45765. return _c(
  45766. "div",
  45767. [
  45768. _c("wo-info-edit-modal", {
  45769. attrs: {
  45770. "modal-id": "workordereditModal",
  45771. "populate-with": _vm.workOrder,
  45772. "store-list": this.storeList
  45773. }
  45774. }),
  45775. _vm._v(" "),
  45776. _c("p", [
  45777. _c("i", { staticClass: "fas fa-fw fa-info-circle" }),
  45778. _vm._v(" "),
  45779. _c("span", {
  45780. domProps: { textContent: _vm._s(_vm.workOrder.probdesc) }
  45781. })
  45782. ]),
  45783. _vm._v(" "),
  45784. _c("p", [
  45785. _c("i", { staticClass: "far fa-fw fa-lightbulb" }),
  45786. _vm._v(" "),
  45787. _c("span", {
  45788. domProps: { textContent: _vm._s(_vm.workOrder.suggested) }
  45789. })
  45790. ]),
  45791. _vm._v(" "),
  45792. _c("p", [
  45793. _c("i", { staticClass: "fas fa-fw fa-paste" }),
  45794. _vm._v(" "),
  45795. _c("span", { domProps: { textContent: _vm._s(_vm.workOrder.woid) } })
  45796. ]),
  45797. _vm._v(" "),
  45798. _c("p", [
  45799. _c("i", { staticClass: "fas fa-fw fa-building" }),
  45800. _vm._v(" "),
  45801. _c("span", [_vm._v(_vm._s(_vm.storeList[_vm.workOrder.storeid]))])
  45802. ]),
  45803. _vm._v(" "),
  45804. _c("p", [
  45805. _c("i", { staticClass: "fas fa-fw fa-sign-in-alt" }),
  45806. _vm._v(" "),
  45807. _c(
  45808. "span",
  45809. {
  45810. staticClass: "dashed-underline",
  45811. attrs: {
  45812. "data-toggle": "tooltip",
  45813. "data-placement": "bottom",
  45814. title: this.getHRDate(_vm.workOrder.dropdate)
  45815. }
  45816. },
  45817. [
  45818. _vm._v(
  45819. "\n " +
  45820. _vm._s(
  45821. Math.floor(this.daysSinceToday(_vm.workOrder.dropdate))
  45822. ) +
  45823. " days ago\n "
  45824. )
  45825. ]
  45826. )
  45827. ]),
  45828. _vm._v(" "),
  45829. _c("p", [
  45830. _c("i", { staticClass: "fas fa-sign-out-alt" }),
  45831. _vm._v(" "),
  45832. !this.isZero(_vm.workOrder.pickupdate)
  45833. ? _c(
  45834. "span",
  45835. {
  45836. staticClass: "dashed-underline",
  45837. attrs: {
  45838. "data-toggle": "tooltip",
  45839. "data-placement": "bottom",
  45840. title: this.getHRDate(_vm.workOrder.pickupdate)
  45841. }
  45842. },
  45843. [
  45844. _vm._v(
  45845. "\n " +
  45846. _vm._s(
  45847. Math.floor(this.daysSinceToday(_vm.workOrder.pickupdate))
  45848. ) +
  45849. " days ago\n "
  45850. )
  45851. ]
  45852. )
  45853. : _vm._e()
  45854. ]),
  45855. _vm._v(" "),
  45856. _c(
  45857. "button",
  45858. {
  45859. staticClass: "btn btn-primary",
  45860. attrs: {
  45861. type: "button",
  45862. "data-toggle": "modal",
  45863. "data-target": "#workordereditModal"
  45864. }
  45865. },
  45866. [_vm._v("Edit")]
  45867. )
  45868. ],
  45869. 1
  45870. )
  45871. }
  45872. var staticRenderFns = []
  45873. render._withStripped = true
  45874. /***/ }),
  45875. /***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/views/App.vue?vue&type=template&id=91ac6b5c&":
  45876. /*!*************************************************************************************************************************************************************************************************!*\
  45877. !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/views/App.vue?vue&type=template&id=91ac6b5c& ***!
  45878. \*************************************************************************************************************************************************************************************************/
  45879. /*! exports provided: render, staticRenderFns */
  45880. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  45881. "use strict";
  45882. __webpack_require__.r(__webpack_exports__);
  45883. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
  45884. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
  45885. var render = function() {
  45886. var _vm = this
  45887. var _h = _vm.$createElement
  45888. var _c = _vm._self._c || _h
  45889. return _c("div", [
  45890. _c(
  45891. "nav",
  45892. {
  45893. staticClass:
  45894. "navbar navbar-expand navbar-dark bg-primary text-light shadow-sm"
  45895. },
  45896. [
  45897. _c(
  45898. "div",
  45899. { staticClass: "container-fluid" },
  45900. [
  45901. _c(
  45902. "router-link",
  45903. { staticClass: "navbar-brand", attrs: { to: { name: "home" } } },
  45904. [_vm._v("\n UPCCRT\n ")]
  45905. ),
  45906. _vm._v(" "),
  45907. _vm._m(0),
  45908. _vm._v(" "),
  45909. _c(
  45910. "div",
  45911. {
  45912. staticClass: "collapse navbar-collapse",
  45913. attrs: { id: "navbarSupportedContent" }
  45914. },
  45915. [
  45916. _c("ul", { staticClass: "navbar-nav mr-auto text-center" }, [
  45917. _vm._m(1),
  45918. _vm._v(" "),
  45919. _vm._m(2),
  45920. _vm._v(" "),
  45921. _c(
  45922. "li",
  45923. { staticClass: "nav-item" },
  45924. [
  45925. _c(
  45926. "router-link",
  45927. {
  45928. staticClass: "nav-link",
  45929. attrs: { to: { name: "dashboard" } }
  45930. },
  45931. [
  45932. _c("i", { staticClass: "fas fa-tachometer-alt" }),
  45933. _vm._v(" "),
  45934. _c(
  45935. "span",
  45936. { staticClass: "d-none d-sm-block d-md-inline" },
  45937. [_vm._v("Dashboard")]
  45938. )
  45939. ]
  45940. )
  45941. ],
  45942. 1
  45943. ),
  45944. _vm._v(" "),
  45945. _vm._m(3)
  45946. ]),
  45947. _vm._v(" "),
  45948. _c(
  45949. "ul",
  45950. { staticClass: "navbar-nav ml-auto" },
  45951. [
  45952. !_vm.isLoggedIn
  45953. ? _c(
  45954. "router-link",
  45955. {
  45956. staticClass: "nav-link",
  45957. attrs: { to: { name: "login" } }
  45958. },
  45959. [_vm._v("Login")]
  45960. )
  45961. : _vm._e(),
  45962. _vm._v(" "),
  45963. _vm.isLoggedIn
  45964. ? _c("li", { staticClass: "nav-link" }, [
  45965. _vm._v(_vm._s(_vm.username))
  45966. ])
  45967. : _vm._e(),
  45968. _vm._v(" "),
  45969. _vm.isLoggedIn
  45970. ? _c(
  45971. "router-link",
  45972. {
  45973. staticClass: "nav-link",
  45974. attrs: { to: { name: "home" } }
  45975. },
  45976. [_vm._v("Home")]
  45977. )
  45978. : _vm._e()
  45979. ],
  45980. 1
  45981. )
  45982. ]
  45983. )
  45984. ],
  45985. 1
  45986. )
  45987. ]
  45988. ),
  45989. _vm._v(" "),
  45990. _c("main", { staticClass: "py-4" }, [_c("router-view")], 1)
  45991. ])
  45992. }
  45993. var staticRenderFns = [
  45994. function() {
  45995. var _vm = this
  45996. var _h = _vm.$createElement
  45997. var _c = _vm._self._c || _h
  45998. return _c(
  45999. "button",
  46000. {
  46001. staticClass: "navbar-toggler",
  46002. attrs: {
  46003. type: "button",
  46004. "data-toggle": "collapse",
  46005. "data-target": "#navbarSupportedContent",
  46006. "aria-controls": "navbarSupportedContent",
  46007. "aria-expanded": "false"
  46008. }
  46009. },
  46010. [_c("span", { staticClass: "navbar-toggler-icon" })]
  46011. )
  46012. },
  46013. function() {
  46014. var _vm = this
  46015. var _h = _vm.$createElement
  46016. var _c = _vm._self._c || _h
  46017. return _c("li", { staticClass: "nav-item" }, [
  46018. _c("a", { staticClass: "nav-link", attrs: { href: "#" } }, [
  46019. _c("i", { staticClass: "fas fa-sign-in-alt" }),
  46020. _vm._v(" "),
  46021. _c("span", { staticClass: "d-none d-sm-block d-md-inline" }, [
  46022. _vm._v("Check-In")
  46023. ])
  46024. ])
  46025. ])
  46026. },
  46027. function() {
  46028. var _vm = this
  46029. var _h = _vm.$createElement
  46030. var _c = _vm._self._c || _h
  46031. return _c("li", { staticClass: "nav-item" }, [
  46032. _c("a", { staticClass: "nav-link", attrs: { href: "#" } }, [
  46033. _c("i", { staticClass: "fas fa-sign-out-alt" }),
  46034. _vm._v(" "),
  46035. _c("span", { staticClass: "d-none d-sm-block d-md-inline" }, [
  46036. _vm._v("Check-Out")
  46037. ])
  46038. ])
  46039. ])
  46040. },
  46041. function() {
  46042. var _vm = this
  46043. var _h = _vm.$createElement
  46044. var _c = _vm._self._c || _h
  46045. return _c("li", { staticClass: "nav-item" }, [
  46046. _c("a", { staticClass: "nav-link", attrs: { href: "#" } }, [
  46047. _c("i", { staticClass: "fas fa-chart-bar" }),
  46048. _vm._v(" "),
  46049. _c("span", { staticClass: "d-none d-sm-block d-md-inline" }, [
  46050. _vm._v("Reports")
  46051. ])
  46052. ])
  46053. ])
  46054. }
  46055. ]
  46056. render._withStripped = true
  46057. /***/ }),
  46058. /***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/views/Dashboard.vue?vue&type=template&id=1f79daf6&":
  46059. /*!*******************************************************************************************************************************************************************************************************!*\
  46060. !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/views/Dashboard.vue?vue&type=template&id=1f79daf6& ***!
  46061. \*******************************************************************************************************************************************************************************************************/
  46062. /*! exports provided: render, staticRenderFns */
  46063. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  46064. "use strict";
  46065. __webpack_require__.r(__webpack_exports__);
  46066. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
  46067. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
  46068. var render = function() {
  46069. var _vm = this
  46070. var _h = _vm.$createElement
  46071. var _c = _vm._self._c || _h
  46072. return _c("div", { staticClass: "container" }, [
  46073. _c("div", { staticClass: "row justify-content-center" }, [
  46074. !_vm.isLoading
  46075. ? _c(
  46076. "div",
  46077. { staticClass: "col-md-12" },
  46078. _vm._l(_vm.workOrders, function(workOrder, index) {
  46079. return _c(
  46080. "div",
  46081. { key: workOrder.woid, staticClass: "col-md-4" },
  46082. [
  46083. _c("div", { staticClass: "card" }, [
  46084. _c(
  46085. "div",
  46086. { staticClass: "card-header" },
  46087. [
  46088. _c(
  46089. "router-link",
  46090. {
  46091. staticClass: "h4 card-title",
  46092. attrs: {
  46093. to: {
  46094. name: "workorders",
  46095. params: { id: workOrder.woid }
  46096. }
  46097. }
  46098. },
  46099. [_vm._v(_vm._s(workOrder.woid))]
  46100. )
  46101. ],
  46102. 1
  46103. ),
  46104. _vm._v(" "),
  46105. _c("div", { staticClass: "card-body card-body-dark" }, [
  46106. _c("div", [
  46107. _vm._v(
  46108. "\n " +
  46109. _vm._s(workOrder.probdesc) +
  46110. "\n "
  46111. )
  46112. ]),
  46113. _vm._v(" "),
  46114. _c("div", [
  46115. _vm._v(
  46116. "\n " +
  46117. _vm._s(workOrder.suggested) +
  46118. "\n "
  46119. )
  46120. ])
  46121. ])
  46122. ])
  46123. ]
  46124. )
  46125. }),
  46126. 0
  46127. )
  46128. : _c(
  46129. "div",
  46130. { staticClass: "col-md-12" },
  46131. [_c("circle-spinner", { attrs: { color: "#663399" } })],
  46132. 1
  46133. )
  46134. ])
  46135. ])
  46136. }
  46137. var staticRenderFns = []
  46138. render._withStripped = true
  46139. /***/ }),
  46140. /***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/views/Login.vue?vue&type=template&id=12f5395a&":
  46141. /*!***************************************************************************************************************************************************************************************************!*\
  46142. !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/views/Login.vue?vue&type=template&id=12f5395a& ***!
  46143. \***************************************************************************************************************************************************************************************************/
  46144. /*! exports provided: render, staticRenderFns */
  46145. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  46146. "use strict";
  46147. __webpack_require__.r(__webpack_exports__);
  46148. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
  46149. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
  46150. var render = function() {
  46151. var _vm = this
  46152. var _h = _vm.$createElement
  46153. var _c = _vm._self._c || _h
  46154. return _c("div", { staticClass: "container" }, [
  46155. _c("div", { staticClass: "row justify-content-center" }, [
  46156. _c("div", { staticClass: "col-md-8" }, [
  46157. _c("div", { staticClass: "card card-default" }, [
  46158. _c("div", { staticClass: "card-header" }, [_vm._v("Login")]),
  46159. _vm._v(" "),
  46160. _c("div", { staticClass: "card-body" }, [
  46161. _c("form", { attrs: { method: "POST", action: "/login" } }, [
  46162. _c("div", { staticClass: "form-group row" }, [
  46163. _c(
  46164. "label",
  46165. {
  46166. staticClass: "col-sm-4 col-form-label text-md-right",
  46167. attrs: { for: "username" }
  46168. },
  46169. [_vm._v("Username")]
  46170. ),
  46171. _vm._v(" "),
  46172. _c("div", { staticClass: "col-md-6" }, [
  46173. _c("input", {
  46174. directives: [
  46175. {
  46176. name: "model",
  46177. rawName: "v-model",
  46178. value: _vm.username,
  46179. expression: "username"
  46180. }
  46181. ],
  46182. staticClass: "form-control",
  46183. attrs: {
  46184. id: "username",
  46185. type: "username",
  46186. required: "",
  46187. autofocus: ""
  46188. },
  46189. domProps: { value: _vm.username },
  46190. on: {
  46191. input: function($event) {
  46192. if ($event.target.composing) {
  46193. return
  46194. }
  46195. _vm.username = $event.target.value
  46196. }
  46197. }
  46198. })
  46199. ])
  46200. ]),
  46201. _vm._v(" "),
  46202. _c("div", { staticClass: "form-group row" }, [
  46203. _c(
  46204. "label",
  46205. {
  46206. staticClass: "col-md-4 col-form-label text-md-right",
  46207. attrs: { for: "password" }
  46208. },
  46209. [_vm._v("Password")]
  46210. ),
  46211. _vm._v(" "),
  46212. _c("div", { staticClass: "col-md-6" }, [
  46213. _c("input", {
  46214. directives: [
  46215. {
  46216. name: "model",
  46217. rawName: "v-model",
  46218. value: _vm.password,
  46219. expression: "password"
  46220. }
  46221. ],
  46222. staticClass: "form-control",
  46223. attrs: { id: "password", type: "password", required: "" },
  46224. domProps: { value: _vm.password },
  46225. on: {
  46226. input: function($event) {
  46227. if ($event.target.composing) {
  46228. return
  46229. }
  46230. _vm.password = $event.target.value
  46231. }
  46232. }
  46233. })
  46234. ])
  46235. ]),
  46236. _vm._v(" "),
  46237. _c("div", { staticClass: "form-group row mb-0" }, [
  46238. _c("div", { staticClass: "col-md-8 offset-md-4" }, [
  46239. _c(
  46240. "button",
  46241. {
  46242. staticClass: "btn btn-primary",
  46243. attrs: { type: "submit" },
  46244. on: { click: _vm.handleSubmit }
  46245. },
  46246. [
  46247. _vm._v(
  46248. "\n Login\n "
  46249. )
  46250. ]
  46251. )
  46252. ])
  46253. ])
  46254. ])
  46255. ])
  46256. ])
  46257. ])
  46258. ])
  46259. ])
  46260. }
  46261. var staticRenderFns = []
  46262. render._withStripped = true
  46263. /***/ }),
  46264. /***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/views/Welcome.vue?vue&type=template&id=1ae8ae93&scoped=true&":
  46265. /*!*****************************************************************************************************************************************************************************************************************!*\
  46266. !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/views/Welcome.vue?vue&type=template&id=1ae8ae93&scoped=true& ***!
  46267. \*****************************************************************************************************************************************************************************************************************/
  46268. /*! exports provided: render, staticRenderFns */
  46269. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  46270. "use strict";
  46271. __webpack_require__.r(__webpack_exports__);
  46272. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
  46273. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
  46274. var render = function() {
  46275. var _vm = this
  46276. var _h = _vm.$createElement
  46277. var _c = _vm._self._c || _h
  46278. return _vm._m(0)
  46279. }
  46280. var staticRenderFns = [
  46281. function() {
  46282. var _vm = this
  46283. var _h = _vm.$createElement
  46284. var _c = _vm._self._c || _h
  46285. return _c("div", { staticClass: "flex-center position-ref full-height" }, [
  46286. _c("div", { staticClass: "content" }, [
  46287. _c("div", { staticClass: "m-b-md" }, [
  46288. _c("h2", { staticClass: "title m-b-md" }, [
  46289. _vm._v("\n UPCCRT\n ")
  46290. ]),
  46291. _vm._v(" "),
  46292. _c("h3", [
  46293. _vm._v(
  46294. "\n University PC Care Repair Tracker\n "
  46295. )
  46296. ])
  46297. ])
  46298. ])
  46299. ])
  46300. }
  46301. ]
  46302. render._withStripped = true
  46303. /***/ }),
  46304. /***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/views/WorkOrder.vue?vue&type=template&id=17837e2e&":
  46305. /*!*******************************************************************************************************************************************************************************************************!*\
  46306. !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/views/WorkOrder.vue?vue&type=template&id=17837e2e& ***!
  46307. \*******************************************************************************************************************************************************************************************************/
  46308. /*! exports provided: render, staticRenderFns */
  46309. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  46310. "use strict";
  46311. __webpack_require__.r(__webpack_exports__);
  46312. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
  46313. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
  46314. var render = function() {
  46315. var _vm = this
  46316. var _h = _vm.$createElement
  46317. var _c = _vm._self._c || _h
  46318. return _c("div", { staticClass: "container-fluid" }, [
  46319. _c("div", { staticClass: "row my-3" }, [
  46320. _c("div", { staticClass: "col-lg-6" }, [
  46321. _c("div", { staticClass: "card h-100" }, [
  46322. _vm._m(0),
  46323. _vm._v(" "),
  46324. _c("div", { staticClass: "card-body" }, [
  46325. _c("div", { staticClass: "tab-content" }, [
  46326. _c(
  46327. "div",
  46328. {
  46329. staticClass: "tab-pane active",
  46330. attrs: {
  46331. id: "assetinfo",
  46332. role: "tabpanel",
  46333. "aria-labelledby": "assetinfo-tab"
  46334. }
  46335. },
  46336. [
  46337. !_vm.assetLoading
  46338. ? _c("asset-info", { attrs: { asset: _vm.asset } })
  46339. : _c("circle-spinner", { attrs: { color: "#663399" } })
  46340. ],
  46341. 1
  46342. ),
  46343. _vm._v(" "),
  46344. _c(
  46345. "div",
  46346. {
  46347. staticClass: "tab-pane",
  46348. attrs: {
  46349. id: "credentials",
  46350. role: "tabpanel",
  46351. "aria-labelledby": "credentials-tab"
  46352. }
  46353. },
  46354. [
  46355. !_vm.credentialsLoading && !_vm.credentialDescriptionsLoading
  46356. ? _c("credential-list", {
  46357. attrs: {
  46358. credentials: _vm.credentials,
  46359. descriptions: _vm.credentialDescriptions,
  46360. pcid: _vm.asset.pcid
  46361. }
  46362. })
  46363. : _c("circle-spinner", { attrs: { color: "#663399" } })
  46364. ],
  46365. 1
  46366. )
  46367. ])
  46368. ])
  46369. ])
  46370. ]),
  46371. _vm._v(" "),
  46372. _c("div", { staticClass: "col-lg-6" }, [
  46373. _c("div", { staticClass: "card h-100" }, [
  46374. _vm._m(1),
  46375. _vm._v(" "),
  46376. _c("div", { staticClass: "card-body" }, [
  46377. _c("div", { staticClass: "tab-content" }, [
  46378. _c(
  46379. "div",
  46380. {
  46381. staticClass: "tab-pane active",
  46382. attrs: {
  46383. id: "workordersumm",
  46384. role: "tabpanel",
  46385. "aria-labelledby": "workordersumm-tab"
  46386. }
  46387. },
  46388. [
  46389. !_vm.woLoading && !_vm.storesLoading
  46390. ? _c("work-order-info", {
  46391. attrs: {
  46392. "work-order": _vm.workOrder,
  46393. stores: _vm.stores
  46394. }
  46395. })
  46396. : _c("circle-spinner", { attrs: { color: "#663399" } })
  46397. ],
  46398. 1
  46399. ),
  46400. _vm._v(" "),
  46401. _c(
  46402. "div",
  46403. {
  46404. staticClass: "tab-pane",
  46405. attrs: {
  46406. id: "attachments",
  46407. role: "tabpanel",
  46408. "aria-labelledby": "attachments-tab"
  46409. }
  46410. },
  46411. [
  46412. _vm._v(
  46413. "\n TODO 2\n "
  46414. )
  46415. ]
  46416. )
  46417. ])
  46418. ])
  46419. ])
  46420. ])
  46421. ]),
  46422. _vm._v(" "),
  46423. _c("div", { staticClass: "row my-3 no-gutters" }, [
  46424. _c("div", { staticClass: "col-12" }, [
  46425. _c("div", { staticClass: "card" }, [
  46426. _c(
  46427. "div",
  46428. { staticClass: "card-body" },
  46429. [
  46430. _c("h5", { staticClass: "card-title" }, [
  46431. _vm._v("Customer Notes")
  46432. ]),
  46433. _vm._v(" "),
  46434. !_vm.workOrderNotesLoading
  46435. ? _c("notes", {
  46436. attrs: {
  46437. notes: _vm.publicNotes,
  46438. authusername: _vm.authUser,
  46439. "note-type": 0,
  46440. woid: _vm.id
  46441. }
  46442. })
  46443. : _c("circle-spinner", { attrs: { color: "#663399" } })
  46444. ],
  46445. 1
  46446. )
  46447. ])
  46448. ])
  46449. ]),
  46450. _vm._v(" "),
  46451. _c("div", { staticClass: "row my-3 no-gutters" }, [
  46452. _c("div", { staticClass: "col-12" }, [
  46453. _c("div", { staticClass: "card" }, [
  46454. _c(
  46455. "div",
  46456. { staticClass: "card-body" },
  46457. [
  46458. _c("h5", { staticClass: "card-title" }, [
  46459. _vm._v("Private/Billing Notes")
  46460. ]),
  46461. _vm._v(" "),
  46462. !_vm.workOrderNotesLoading
  46463. ? _c("notes", {
  46464. attrs: {
  46465. notes: _vm.privateNotes,
  46466. authusername: _vm.authUser,
  46467. "note-type": 1,
  46468. woid: _vm.id
  46469. }
  46470. })
  46471. : _c("circle-spinner", { attrs: { color: "#663399" } })
  46472. ],
  46473. 1
  46474. )
  46475. ])
  46476. ])
  46477. ])
  46478. ])
  46479. }
  46480. var staticRenderFns = [
  46481. function() {
  46482. var _vm = this
  46483. var _h = _vm.$createElement
  46484. var _c = _vm._self._c || _h
  46485. return _c("div", { staticClass: "card-header text-right" }, [
  46486. _c(
  46487. "button",
  46488. {
  46489. staticClass: "btn btn-default xs-toggle",
  46490. attrs: {
  46491. type: "button",
  46492. "data-toggle": "collapse",
  46493. "data-target": "#assetTab"
  46494. }
  46495. },
  46496. [
  46497. _c("span", { staticClass: "sr-only" }, [_vm._v("Toggle Navigation")]),
  46498. _vm._v(" "),
  46499. _c("span", { staticClass: "icon-bar" }),
  46500. _vm._v(" "),
  46501. _c("span", { staticClass: "icon-bar" }),
  46502. _vm._v(" "),
  46503. _c("span", { staticClass: "icon-bar" })
  46504. ]
  46505. ),
  46506. _vm._v(" "),
  46507. _c(
  46508. "ul",
  46509. {
  46510. staticClass:
  46511. "nav nav-pills card-header-pills nav-justified xs-collapse collapse",
  46512. attrs: { id: "assetTab", role: "tablist" }
  46513. },
  46514. [
  46515. _c("li", { staticClass: "nav-item" }, [
  46516. _c(
  46517. "a",
  46518. {
  46519. staticClass: "nav-link active",
  46520. attrs: {
  46521. id: "assetinfo-tab",
  46522. "data-toggle": "pill",
  46523. href: "#assetinfo",
  46524. role: "tab",
  46525. "aria-controls": "assetinfo",
  46526. "aria-selected": "true"
  46527. }
  46528. },
  46529. [_vm._v("Hardware")]
  46530. )
  46531. ]),
  46532. _vm._v(" "),
  46533. _c("li", { staticClass: "nav-item" }, [
  46534. _c(
  46535. "a",
  46536. {
  46537. staticClass: "nav-link",
  46538. attrs: {
  46539. id: "credentials-tab",
  46540. "data-toggle": "pill",
  46541. href: "#credentials",
  46542. role: "tab",
  46543. "aria-controls": "credentials",
  46544. "aria-selected": "false"
  46545. }
  46546. },
  46547. [_vm._v("Credentials")]
  46548. )
  46549. ])
  46550. ]
  46551. )
  46552. ])
  46553. },
  46554. function() {
  46555. var _vm = this
  46556. var _h = _vm.$createElement
  46557. var _c = _vm._self._c || _h
  46558. return _c("div", { staticClass: "card-header text-right" }, [
  46559. _c(
  46560. "button",
  46561. {
  46562. staticClass: "btn btn-default xs-toggle",
  46563. attrs: {
  46564. type: "button",
  46565. "data-toggle": "collapse",
  46566. "data-target": "#workorderTab"
  46567. }
  46568. },
  46569. [
  46570. _c("span", { staticClass: "sr-only" }, [_vm._v("Toggle Navigation")]),
  46571. _vm._v(" "),
  46572. _c("span", { staticClass: "icon-bar" }),
  46573. _vm._v(" "),
  46574. _c("span", { staticClass: "icon-bar" }),
  46575. _vm._v(" "),
  46576. _c("span", { staticClass: "icon-bar" })
  46577. ]
  46578. ),
  46579. _vm._v(" "),
  46580. _c(
  46581. "ul",
  46582. {
  46583. staticClass:
  46584. "nav nav-pills card-header-pills nav-justified xs-collapse collapse",
  46585. attrs: { id: "workorderTab", role: "tablist" }
  46586. },
  46587. [
  46588. _c("li", { staticClass: "nav-item" }, [
  46589. _c(
  46590. "a",
  46591. {
  46592. staticClass: "nav-link active",
  46593. attrs: {
  46594. id: "workordersumm-tab",
  46595. "data-toggle": "pill",
  46596. href: "#workordersumm",
  46597. role: "tab",
  46598. "aria-controls": "workordersumm",
  46599. "aria-selected": "true"
  46600. }
  46601. },
  46602. [_vm._v("Summary")]
  46603. )
  46604. ]),
  46605. _vm._v(" "),
  46606. _c("li", { staticClass: "nav-item" }, [
  46607. _c(
  46608. "a",
  46609. {
  46610. staticClass: "nav-link",
  46611. attrs: {
  46612. id: "attachments-tab",
  46613. "data-toggle": "pill",
  46614. href: "#attachments",
  46615. role: "tab",
  46616. "aria-controls": "attachments",
  46617. "aria-selected": "false"
  46618. }
  46619. },
  46620. [_vm._v("Attachments")]
  46621. )
  46622. ])
  46623. ]
  46624. )
  46625. ])
  46626. }
  46627. ]
  46628. render._withStripped = true
  46629. /***/ }),
  46630. /***/ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js":
  46631. /*!********************************************************************!*\
  46632. !*** ./node_modules/vue-loader/lib/runtime/componentNormalizer.js ***!
  46633. \********************************************************************/
  46634. /*! exports provided: default */
  46635. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  46636. "use strict";
  46637. __webpack_require__.r(__webpack_exports__);
  46638. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  46639. /* globals __VUE_SSR_CONTEXT__ */
  46640. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  46641. // This module is a runtime utility for cleaner component module output and will
  46642. // be included in the final webpack user bundle.
  46643. function normalizeComponent (
  46644. scriptExports,
  46645. render,
  46646. staticRenderFns,
  46647. functionalTemplate,
  46648. injectStyles,
  46649. scopeId,
  46650. moduleIdentifier, /* server only */
  46651. shadowMode /* vue-cli only */
  46652. ) {
  46653. // Vue.extend constructor export interop
  46654. var options = typeof scriptExports === 'function'
  46655. ? scriptExports.options
  46656. : scriptExports
  46657. // render functions
  46658. if (render) {
  46659. options.render = render
  46660. options.staticRenderFns = staticRenderFns
  46661. options._compiled = true
  46662. }
  46663. // functional template
  46664. if (functionalTemplate) {
  46665. options.functional = true
  46666. }
  46667. // scopedId
  46668. if (scopeId) {
  46669. options._scopeId = 'data-v-' + scopeId
  46670. }
  46671. var hook
  46672. if (moduleIdentifier) { // server build
  46673. hook = function (context) {
  46674. // 2.3 injection
  46675. context =
  46676. context || // cached call
  46677. (this.$vnode && this.$vnode.ssrContext) || // stateful
  46678. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  46679. // 2.2 with runInNewContext: true
  46680. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  46681. context = __VUE_SSR_CONTEXT__
  46682. }
  46683. // inject component styles
  46684. if (injectStyles) {
  46685. injectStyles.call(this, context)
  46686. }
  46687. // register component module identifier for async chunk inferrence
  46688. if (context && context._registeredComponents) {
  46689. context._registeredComponents.add(moduleIdentifier)
  46690. }
  46691. }
  46692. // used by ssr in case component is cached and beforeCreate
  46693. // never gets called
  46694. options._ssrRegister = hook
  46695. } else if (injectStyles) {
  46696. hook = shadowMode
  46697. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  46698. : injectStyles
  46699. }
  46700. if (hook) {
  46701. if (options.functional) {
  46702. // for template-only hot-reload because in that case the render fn doesn't
  46703. // go through the normalizer
  46704. options._injectStyles = hook
  46705. // register for functioal component in vue file
  46706. var originalRender = options.render
  46707. options.render = function renderWithStyleInjection (h, context) {
  46708. hook.call(context)
  46709. return originalRender(h, context)
  46710. }
  46711. } else {
  46712. // inject component registration as beforeCreate hook
  46713. var existing = options.beforeCreate
  46714. options.beforeCreate = existing
  46715. ? [].concat(existing, hook)
  46716. : [hook]
  46717. }
  46718. }
  46719. return {
  46720. exports: scriptExports,
  46721. options: options
  46722. }
  46723. }
  46724. /***/ }),
  46725. /***/ "./node_modules/vue-router/dist/vue-router.esm.js":
  46726. /*!********************************************************!*\
  46727. !*** ./node_modules/vue-router/dist/vue-router.esm.js ***!
  46728. \********************************************************/
  46729. /*! exports provided: default */
  46730. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  46731. "use strict";
  46732. __webpack_require__.r(__webpack_exports__);
  46733. /*!
  46734. * vue-router v3.1.6
  46735. * (c) 2020 Evan You
  46736. * @license MIT
  46737. */
  46738. /* */
  46739. function assert (condition, message) {
  46740. if (!condition) {
  46741. throw new Error(("[vue-router] " + message))
  46742. }
  46743. }
  46744. function warn (condition, message) {
  46745. if ( true && !condition) {
  46746. typeof console !== 'undefined' && console.warn(("[vue-router] " + message));
  46747. }
  46748. }
  46749. function isError (err) {
  46750. return Object.prototype.toString.call(err).indexOf('Error') > -1
  46751. }
  46752. function isExtendedError (constructor, err) {
  46753. return (
  46754. err instanceof constructor ||
  46755. // _name is to support IE9 too
  46756. (err && (err.name === constructor.name || err._name === constructor._name))
  46757. )
  46758. }
  46759. function extend (a, b) {
  46760. for (var key in b) {
  46761. a[key] = b[key];
  46762. }
  46763. return a
  46764. }
  46765. var View = {
  46766. name: 'RouterView',
  46767. functional: true,
  46768. props: {
  46769. name: {
  46770. type: String,
  46771. default: 'default'
  46772. }
  46773. },
  46774. render: function render (_, ref) {
  46775. var props = ref.props;
  46776. var children = ref.children;
  46777. var parent = ref.parent;
  46778. var data = ref.data;
  46779. // used by devtools to display a router-view badge
  46780. data.routerView = true;
  46781. // directly use parent context's createElement() function
  46782. // so that components rendered by router-view can resolve named slots
  46783. var h = parent.$createElement;
  46784. var name = props.name;
  46785. var route = parent.$route;
  46786. var cache = parent._routerViewCache || (parent._routerViewCache = {});
  46787. // determine current view depth, also check to see if the tree
  46788. // has been toggled inactive but kept-alive.
  46789. var depth = 0;
  46790. var inactive = false;
  46791. while (parent && parent._routerRoot !== parent) {
  46792. var vnodeData = parent.$vnode ? parent.$vnode.data : {};
  46793. if (vnodeData.routerView) {
  46794. depth++;
  46795. }
  46796. if (vnodeData.keepAlive && parent._directInactive && parent._inactive) {
  46797. inactive = true;
  46798. }
  46799. parent = parent.$parent;
  46800. }
  46801. data.routerViewDepth = depth;
  46802. // render previous view if the tree is inactive and kept-alive
  46803. if (inactive) {
  46804. var cachedData = cache[name];
  46805. var cachedComponent = cachedData && cachedData.component;
  46806. if (cachedComponent) {
  46807. // #2301
  46808. // pass props
  46809. if (cachedData.configProps) {
  46810. fillPropsinData(cachedComponent, data, cachedData.route, cachedData.configProps);
  46811. }
  46812. return h(cachedComponent, data, children)
  46813. } else {
  46814. // render previous empty view
  46815. return h()
  46816. }
  46817. }
  46818. var matched = route.matched[depth];
  46819. var component = matched && matched.components[name];
  46820. // render empty node if no matched route or no config component
  46821. if (!matched || !component) {
  46822. cache[name] = null;
  46823. return h()
  46824. }
  46825. // cache component
  46826. cache[name] = { component: component };
  46827. // attach instance registration hook
  46828. // this will be called in the instance's injected lifecycle hooks
  46829. data.registerRouteInstance = function (vm, val) {
  46830. // val could be undefined for unregistration
  46831. var current = matched.instances[name];
  46832. if (
  46833. (val && current !== vm) ||
  46834. (!val && current === vm)
  46835. ) {
  46836. matched.instances[name] = val;
  46837. }
  46838. }
  46839. // also register instance in prepatch hook
  46840. // in case the same component instance is reused across different routes
  46841. ;(data.hook || (data.hook = {})).prepatch = function (_, vnode) {
  46842. matched.instances[name] = vnode.componentInstance;
  46843. };
  46844. // register instance in init hook
  46845. // in case kept-alive component be actived when routes changed
  46846. data.hook.init = function (vnode) {
  46847. if (vnode.data.keepAlive &&
  46848. vnode.componentInstance &&
  46849. vnode.componentInstance !== matched.instances[name]
  46850. ) {
  46851. matched.instances[name] = vnode.componentInstance;
  46852. }
  46853. };
  46854. var configProps = matched.props && matched.props[name];
  46855. // save route and configProps in cachce
  46856. if (configProps) {
  46857. extend(cache[name], {
  46858. route: route,
  46859. configProps: configProps
  46860. });
  46861. fillPropsinData(component, data, route, configProps);
  46862. }
  46863. return h(component, data, children)
  46864. }
  46865. };
  46866. function fillPropsinData (component, data, route, configProps) {
  46867. // resolve props
  46868. var propsToPass = data.props = resolveProps(route, configProps);
  46869. if (propsToPass) {
  46870. // clone to prevent mutation
  46871. propsToPass = data.props = extend({}, propsToPass);
  46872. // pass non-declared props as attrs
  46873. var attrs = data.attrs = data.attrs || {};
  46874. for (var key in propsToPass) {
  46875. if (!component.props || !(key in component.props)) {
  46876. attrs[key] = propsToPass[key];
  46877. delete propsToPass[key];
  46878. }
  46879. }
  46880. }
  46881. }
  46882. function resolveProps (route, config) {
  46883. switch (typeof config) {
  46884. case 'undefined':
  46885. return
  46886. case 'object':
  46887. return config
  46888. case 'function':
  46889. return config(route)
  46890. case 'boolean':
  46891. return config ? route.params : undefined
  46892. default:
  46893. if (true) {
  46894. warn(
  46895. false,
  46896. "props in \"" + (route.path) + "\" is a " + (typeof config) + ", " +
  46897. "expecting an object, function or boolean."
  46898. );
  46899. }
  46900. }
  46901. }
  46902. /* */
  46903. var encodeReserveRE = /[!'()*]/g;
  46904. var encodeReserveReplacer = function (c) { return '%' + c.charCodeAt(0).toString(16); };
  46905. var commaRE = /%2C/g;
  46906. // fixed encodeURIComponent which is more conformant to RFC3986:
  46907. // - escapes [!'()*]
  46908. // - preserve commas
  46909. var encode = function (str) { return encodeURIComponent(str)
  46910. .replace(encodeReserveRE, encodeReserveReplacer)
  46911. .replace(commaRE, ','); };
  46912. var decode = decodeURIComponent;
  46913. function resolveQuery (
  46914. query,
  46915. extraQuery,
  46916. _parseQuery
  46917. ) {
  46918. if ( extraQuery === void 0 ) extraQuery = {};
  46919. var parse = _parseQuery || parseQuery;
  46920. var parsedQuery;
  46921. try {
  46922. parsedQuery = parse(query || '');
  46923. } catch (e) {
  46924. true && warn(false, e.message);
  46925. parsedQuery = {};
  46926. }
  46927. for (var key in extraQuery) {
  46928. parsedQuery[key] = extraQuery[key];
  46929. }
  46930. return parsedQuery
  46931. }
  46932. function parseQuery (query) {
  46933. var res = {};
  46934. query = query.trim().replace(/^(\?|#|&)/, '');
  46935. if (!query) {
  46936. return res
  46937. }
  46938. query.split('&').forEach(function (param) {
  46939. var parts = param.replace(/\+/g, ' ').split('=');
  46940. var key = decode(parts.shift());
  46941. var val = parts.length > 0
  46942. ? decode(parts.join('='))
  46943. : null;
  46944. if (res[key] === undefined) {
  46945. res[key] = val;
  46946. } else if (Array.isArray(res[key])) {
  46947. res[key].push(val);
  46948. } else {
  46949. res[key] = [res[key], val];
  46950. }
  46951. });
  46952. return res
  46953. }
  46954. function stringifyQuery (obj) {
  46955. var res = obj ? Object.keys(obj).map(function (key) {
  46956. var val = obj[key];
  46957. if (val === undefined) {
  46958. return ''
  46959. }
  46960. if (val === null) {
  46961. return encode(key)
  46962. }
  46963. if (Array.isArray(val)) {
  46964. var result = [];
  46965. val.forEach(function (val2) {
  46966. if (val2 === undefined) {
  46967. return
  46968. }
  46969. if (val2 === null) {
  46970. result.push(encode(key));
  46971. } else {
  46972. result.push(encode(key) + '=' + encode(val2));
  46973. }
  46974. });
  46975. return result.join('&')
  46976. }
  46977. return encode(key) + '=' + encode(val)
  46978. }).filter(function (x) { return x.length > 0; }).join('&') : null;
  46979. return res ? ("?" + res) : ''
  46980. }
  46981. /* */
  46982. var trailingSlashRE = /\/?$/;
  46983. function createRoute (
  46984. record,
  46985. location,
  46986. redirectedFrom,
  46987. router
  46988. ) {
  46989. var stringifyQuery = router && router.options.stringifyQuery;
  46990. var query = location.query || {};
  46991. try {
  46992. query = clone(query);
  46993. } catch (e) {}
  46994. var route = {
  46995. name: location.name || (record && record.name),
  46996. meta: (record && record.meta) || {},
  46997. path: location.path || '/',
  46998. hash: location.hash || '',
  46999. query: query,
  47000. params: location.params || {},
  47001. fullPath: getFullPath(location, stringifyQuery),
  47002. matched: record ? formatMatch(record) : []
  47003. };
  47004. if (redirectedFrom) {
  47005. route.redirectedFrom = getFullPath(redirectedFrom, stringifyQuery);
  47006. }
  47007. return Object.freeze(route)
  47008. }
  47009. function clone (value) {
  47010. if (Array.isArray(value)) {
  47011. return value.map(clone)
  47012. } else if (value && typeof value === 'object') {
  47013. var res = {};
  47014. for (var key in value) {
  47015. res[key] = clone(value[key]);
  47016. }
  47017. return res
  47018. } else {
  47019. return value
  47020. }
  47021. }
  47022. // the starting route that represents the initial state
  47023. var START = createRoute(null, {
  47024. path: '/'
  47025. });
  47026. function formatMatch (record) {
  47027. var res = [];
  47028. while (record) {
  47029. res.unshift(record);
  47030. record = record.parent;
  47031. }
  47032. return res
  47033. }
  47034. function getFullPath (
  47035. ref,
  47036. _stringifyQuery
  47037. ) {
  47038. var path = ref.path;
  47039. var query = ref.query; if ( query === void 0 ) query = {};
  47040. var hash = ref.hash; if ( hash === void 0 ) hash = '';
  47041. var stringify = _stringifyQuery || stringifyQuery;
  47042. return (path || '/') + stringify(query) + hash
  47043. }
  47044. function isSameRoute (a, b) {
  47045. if (b === START) {
  47046. return a === b
  47047. } else if (!b) {
  47048. return false
  47049. } else if (a.path && b.path) {
  47050. return (
  47051. a.path.replace(trailingSlashRE, '') === b.path.replace(trailingSlashRE, '') &&
  47052. a.hash === b.hash &&
  47053. isObjectEqual(a.query, b.query)
  47054. )
  47055. } else if (a.name && b.name) {
  47056. return (
  47057. a.name === b.name &&
  47058. a.hash === b.hash &&
  47059. isObjectEqual(a.query, b.query) &&
  47060. isObjectEqual(a.params, b.params)
  47061. )
  47062. } else {
  47063. return false
  47064. }
  47065. }
  47066. function isObjectEqual (a, b) {
  47067. if ( a === void 0 ) a = {};
  47068. if ( b === void 0 ) b = {};
  47069. // handle null value #1566
  47070. if (!a || !b) { return a === b }
  47071. var aKeys = Object.keys(a);
  47072. var bKeys = Object.keys(b);
  47073. if (aKeys.length !== bKeys.length) {
  47074. return false
  47075. }
  47076. return aKeys.every(function (key) {
  47077. var aVal = a[key];
  47078. var bVal = b[key];
  47079. // check nested equality
  47080. if (typeof aVal === 'object' && typeof bVal === 'object') {
  47081. return isObjectEqual(aVal, bVal)
  47082. }
  47083. return String(aVal) === String(bVal)
  47084. })
  47085. }
  47086. function isIncludedRoute (current, target) {
  47087. return (
  47088. current.path.replace(trailingSlashRE, '/').indexOf(
  47089. target.path.replace(trailingSlashRE, '/')
  47090. ) === 0 &&
  47091. (!target.hash || current.hash === target.hash) &&
  47092. queryIncludes(current.query, target.query)
  47093. )
  47094. }
  47095. function queryIncludes (current, target) {
  47096. for (var key in target) {
  47097. if (!(key in current)) {
  47098. return false
  47099. }
  47100. }
  47101. return true
  47102. }
  47103. /* */
  47104. function resolvePath (
  47105. relative,
  47106. base,
  47107. append
  47108. ) {
  47109. var firstChar = relative.charAt(0);
  47110. if (firstChar === '/') {
  47111. return relative
  47112. }
  47113. if (firstChar === '?' || firstChar === '#') {
  47114. return base + relative
  47115. }
  47116. var stack = base.split('/');
  47117. // remove trailing segment if:
  47118. // - not appending
  47119. // - appending to trailing slash (last segment is empty)
  47120. if (!append || !stack[stack.length - 1]) {
  47121. stack.pop();
  47122. }
  47123. // resolve relative path
  47124. var segments = relative.replace(/^\//, '').split('/');
  47125. for (var i = 0; i < segments.length; i++) {
  47126. var segment = segments[i];
  47127. if (segment === '..') {
  47128. stack.pop();
  47129. } else if (segment !== '.') {
  47130. stack.push(segment);
  47131. }
  47132. }
  47133. // ensure leading slash
  47134. if (stack[0] !== '') {
  47135. stack.unshift('');
  47136. }
  47137. return stack.join('/')
  47138. }
  47139. function parsePath (path) {
  47140. var hash = '';
  47141. var query = '';
  47142. var hashIndex = path.indexOf('#');
  47143. if (hashIndex >= 0) {
  47144. hash = path.slice(hashIndex);
  47145. path = path.slice(0, hashIndex);
  47146. }
  47147. var queryIndex = path.indexOf('?');
  47148. if (queryIndex >= 0) {
  47149. query = path.slice(queryIndex + 1);
  47150. path = path.slice(0, queryIndex);
  47151. }
  47152. return {
  47153. path: path,
  47154. query: query,
  47155. hash: hash
  47156. }
  47157. }
  47158. function cleanPath (path) {
  47159. return path.replace(/\/\//g, '/')
  47160. }
  47161. var isarray = Array.isArray || function (arr) {
  47162. return Object.prototype.toString.call(arr) == '[object Array]';
  47163. };
  47164. /**
  47165. * Expose `pathToRegexp`.
  47166. */
  47167. var pathToRegexp_1 = pathToRegexp;
  47168. var parse_1 = parse;
  47169. var compile_1 = compile;
  47170. var tokensToFunction_1 = tokensToFunction;
  47171. var tokensToRegExp_1 = tokensToRegExp;
  47172. /**
  47173. * The main path matching regexp utility.
  47174. *
  47175. * @type {RegExp}
  47176. */
  47177. var PATH_REGEXP = new RegExp([
  47178. // Match escaped characters that would otherwise appear in future matches.
  47179. // This allows the user to escape special characters that won't transform.
  47180. '(\\\\.)',
  47181. // Match Express-style parameters and un-named parameters with a prefix
  47182. // and optional suffixes. Matches appear as:
  47183. //
  47184. // "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined]
  47185. // "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined]
  47186. // "/*" => ["/", undefined, undefined, undefined, undefined, "*"]
  47187. '([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))'
  47188. ].join('|'), 'g');
  47189. /**
  47190. * Parse a string for the raw tokens.
  47191. *
  47192. * @param {string} str
  47193. * @param {Object=} options
  47194. * @return {!Array}
  47195. */
  47196. function parse (str, options) {
  47197. var tokens = [];
  47198. var key = 0;
  47199. var index = 0;
  47200. var path = '';
  47201. var defaultDelimiter = options && options.delimiter || '/';
  47202. var res;
  47203. while ((res = PATH_REGEXP.exec(str)) != null) {
  47204. var m = res[0];
  47205. var escaped = res[1];
  47206. var offset = res.index;
  47207. path += str.slice(index, offset);
  47208. index = offset + m.length;
  47209. // Ignore already escaped sequences.
  47210. if (escaped) {
  47211. path += escaped[1];
  47212. continue
  47213. }
  47214. var next = str[index];
  47215. var prefix = res[2];
  47216. var name = res[3];
  47217. var capture = res[4];
  47218. var group = res[5];
  47219. var modifier = res[6];
  47220. var asterisk = res[7];
  47221. // Push the current path onto the tokens.
  47222. if (path) {
  47223. tokens.push(path);
  47224. path = '';
  47225. }
  47226. var partial = prefix != null && next != null && next !== prefix;
  47227. var repeat = modifier === '+' || modifier === '*';
  47228. var optional = modifier === '?' || modifier === '*';
  47229. var delimiter = res[2] || defaultDelimiter;
  47230. var pattern = capture || group;
  47231. tokens.push({
  47232. name: name || key++,
  47233. prefix: prefix || '',
  47234. delimiter: delimiter,
  47235. optional: optional,
  47236. repeat: repeat,
  47237. partial: partial,
  47238. asterisk: !!asterisk,
  47239. pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?')
  47240. });
  47241. }
  47242. // Match any characters still remaining.
  47243. if (index < str.length) {
  47244. path += str.substr(index);
  47245. }
  47246. // If the path exists, push it onto the end.
  47247. if (path) {
  47248. tokens.push(path);
  47249. }
  47250. return tokens
  47251. }
  47252. /**
  47253. * Compile a string to a template function for the path.
  47254. *
  47255. * @param {string} str
  47256. * @param {Object=} options
  47257. * @return {!function(Object=, Object=)}
  47258. */
  47259. function compile (str, options) {
  47260. return tokensToFunction(parse(str, options))
  47261. }
  47262. /**
  47263. * Prettier encoding of URI path segments.
  47264. *
  47265. * @param {string}
  47266. * @return {string}
  47267. */
  47268. function encodeURIComponentPretty (str) {
  47269. return encodeURI(str).replace(/[\/?#]/g, function (c) {
  47270. return '%' + c.charCodeAt(0).toString(16).toUpperCase()
  47271. })
  47272. }
  47273. /**
  47274. * Encode the asterisk parameter. Similar to `pretty`, but allows slashes.
  47275. *
  47276. * @param {string}
  47277. * @return {string}
  47278. */
  47279. function encodeAsterisk (str) {
  47280. return encodeURI(str).replace(/[?#]/g, function (c) {
  47281. return '%' + c.charCodeAt(0).toString(16).toUpperCase()
  47282. })
  47283. }
  47284. /**
  47285. * Expose a method for transforming tokens into the path function.
  47286. */
  47287. function tokensToFunction (tokens) {
  47288. // Compile all the tokens into regexps.
  47289. var matches = new Array(tokens.length);
  47290. // Compile all the patterns before compilation.
  47291. for (var i = 0; i < tokens.length; i++) {
  47292. if (typeof tokens[i] === 'object') {
  47293. matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$');
  47294. }
  47295. }
  47296. return function (obj, opts) {
  47297. var path = '';
  47298. var data = obj || {};
  47299. var options = opts || {};
  47300. var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent;
  47301. for (var i = 0; i < tokens.length; i++) {
  47302. var token = tokens[i];
  47303. if (typeof token === 'string') {
  47304. path += token;
  47305. continue
  47306. }
  47307. var value = data[token.name];
  47308. var segment;
  47309. if (value == null) {
  47310. if (token.optional) {
  47311. // Prepend partial segment prefixes.
  47312. if (token.partial) {
  47313. path += token.prefix;
  47314. }
  47315. continue
  47316. } else {
  47317. throw new TypeError('Expected "' + token.name + '" to be defined')
  47318. }
  47319. }
  47320. if (isarray(value)) {
  47321. if (!token.repeat) {
  47322. throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`')
  47323. }
  47324. if (value.length === 0) {
  47325. if (token.optional) {
  47326. continue
  47327. } else {
  47328. throw new TypeError('Expected "' + token.name + '" to not be empty')
  47329. }
  47330. }
  47331. for (var j = 0; j < value.length; j++) {
  47332. segment = encode(value[j]);
  47333. if (!matches[i].test(segment)) {
  47334. throw new TypeError('Expected all "' + token.name + '" to match "' + token.pattern + '", but received `' + JSON.stringify(segment) + '`')
  47335. }
  47336. path += (j === 0 ? token.prefix : token.delimiter) + segment;
  47337. }
  47338. continue
  47339. }
  47340. segment = token.asterisk ? encodeAsterisk(value) : encode(value);
  47341. if (!matches[i].test(segment)) {
  47342. throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"')
  47343. }
  47344. path += token.prefix + segment;
  47345. }
  47346. return path
  47347. }
  47348. }
  47349. /**
  47350. * Escape a regular expression string.
  47351. *
  47352. * @param {string} str
  47353. * @return {string}
  47354. */
  47355. function escapeString (str) {
  47356. return str.replace(/([.+*?=^!:${}()[\]|\/\\])/g, '\\$1')
  47357. }
  47358. /**
  47359. * Escape the capturing group by escaping special characters and meaning.
  47360. *
  47361. * @param {string} group
  47362. * @return {string}
  47363. */
  47364. function escapeGroup (group) {
  47365. return group.replace(/([=!:$\/()])/g, '\\$1')
  47366. }
  47367. /**
  47368. * Attach the keys as a property of the regexp.
  47369. *
  47370. * @param {!RegExp} re
  47371. * @param {Array} keys
  47372. * @return {!RegExp}
  47373. */
  47374. function attachKeys (re, keys) {
  47375. re.keys = keys;
  47376. return re
  47377. }
  47378. /**
  47379. * Get the flags for a regexp from the options.
  47380. *
  47381. * @param {Object} options
  47382. * @return {string}
  47383. */
  47384. function flags (options) {
  47385. return options.sensitive ? '' : 'i'
  47386. }
  47387. /**
  47388. * Pull out keys from a regexp.
  47389. *
  47390. * @param {!RegExp} path
  47391. * @param {!Array} keys
  47392. * @return {!RegExp}
  47393. */
  47394. function regexpToRegexp (path, keys) {
  47395. // Use a negative lookahead to match only capturing groups.
  47396. var groups = path.source.match(/\((?!\?)/g);
  47397. if (groups) {
  47398. for (var i = 0; i < groups.length; i++) {
  47399. keys.push({
  47400. name: i,
  47401. prefix: null,
  47402. delimiter: null,
  47403. optional: false,
  47404. repeat: false,
  47405. partial: false,
  47406. asterisk: false,
  47407. pattern: null
  47408. });
  47409. }
  47410. }
  47411. return attachKeys(path, keys)
  47412. }
  47413. /**
  47414. * Transform an array into a regexp.
  47415. *
  47416. * @param {!Array} path
  47417. * @param {Array} keys
  47418. * @param {!Object} options
  47419. * @return {!RegExp}
  47420. */
  47421. function arrayToRegexp (path, keys, options) {
  47422. var parts = [];
  47423. for (var i = 0; i < path.length; i++) {
  47424. parts.push(pathToRegexp(path[i], keys, options).source);
  47425. }
  47426. var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options));
  47427. return attachKeys(regexp, keys)
  47428. }
  47429. /**
  47430. * Create a path regexp from string input.
  47431. *
  47432. * @param {string} path
  47433. * @param {!Array} keys
  47434. * @param {!Object} options
  47435. * @return {!RegExp}
  47436. */
  47437. function stringToRegexp (path, keys, options) {
  47438. return tokensToRegExp(parse(path, options), keys, options)
  47439. }
  47440. /**
  47441. * Expose a function for taking tokens and returning a RegExp.
  47442. *
  47443. * @param {!Array} tokens
  47444. * @param {(Array|Object)=} keys
  47445. * @param {Object=} options
  47446. * @return {!RegExp}
  47447. */
  47448. function tokensToRegExp (tokens, keys, options) {
  47449. if (!isarray(keys)) {
  47450. options = /** @type {!Object} */ (keys || options);
  47451. keys = [];
  47452. }
  47453. options = options || {};
  47454. var strict = options.strict;
  47455. var end = options.end !== false;
  47456. var route = '';
  47457. // Iterate over the tokens and create our regexp string.
  47458. for (var i = 0; i < tokens.length; i++) {
  47459. var token = tokens[i];
  47460. if (typeof token === 'string') {
  47461. route += escapeString(token);
  47462. } else {
  47463. var prefix = escapeString(token.prefix);
  47464. var capture = '(?:' + token.pattern + ')';
  47465. keys.push(token);
  47466. if (token.repeat) {
  47467. capture += '(?:' + prefix + capture + ')*';
  47468. }
  47469. if (token.optional) {
  47470. if (!token.partial) {
  47471. capture = '(?:' + prefix + '(' + capture + '))?';
  47472. } else {
  47473. capture = prefix + '(' + capture + ')?';
  47474. }
  47475. } else {
  47476. capture = prefix + '(' + capture + ')';
  47477. }
  47478. route += capture;
  47479. }
  47480. }
  47481. var delimiter = escapeString(options.delimiter || '/');
  47482. var endsWithDelimiter = route.slice(-delimiter.length) === delimiter;
  47483. // In non-strict mode we allow a slash at the end of match. If the path to
  47484. // match already ends with a slash, we remove it for consistency. The slash
  47485. // is valid at the end of a path match, not in the middle. This is important
  47486. // in non-ending mode, where "/test/" shouldn't match "/test//route".
  47487. if (!strict) {
  47488. route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?';
  47489. }
  47490. if (end) {
  47491. route += '$';
  47492. } else {
  47493. // In non-ending mode, we need the capturing groups to match as much as
  47494. // possible by using a positive lookahead to the end or next path segment.
  47495. route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)';
  47496. }
  47497. return attachKeys(new RegExp('^' + route, flags(options)), keys)
  47498. }
  47499. /**
  47500. * Normalize the given path string, returning a regular expression.
  47501. *
  47502. * An empty array can be passed in for the keys, which will hold the
  47503. * placeholder key descriptions. For example, using `/user/:id`, `keys` will
  47504. * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.
  47505. *
  47506. * @param {(string|RegExp|Array)} path
  47507. * @param {(Array|Object)=} keys
  47508. * @param {Object=} options
  47509. * @return {!RegExp}
  47510. */
  47511. function pathToRegexp (path, keys, options) {
  47512. if (!isarray(keys)) {
  47513. options = /** @type {!Object} */ (keys || options);
  47514. keys = [];
  47515. }
  47516. options = options || {};
  47517. if (path instanceof RegExp) {
  47518. return regexpToRegexp(path, /** @type {!Array} */ (keys))
  47519. }
  47520. if (isarray(path)) {
  47521. return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options)
  47522. }
  47523. return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options)
  47524. }
  47525. pathToRegexp_1.parse = parse_1;
  47526. pathToRegexp_1.compile = compile_1;
  47527. pathToRegexp_1.tokensToFunction = tokensToFunction_1;
  47528. pathToRegexp_1.tokensToRegExp = tokensToRegExp_1;
  47529. /* */
  47530. // $flow-disable-line
  47531. var regexpCompileCache = Object.create(null);
  47532. function fillParams (
  47533. path,
  47534. params,
  47535. routeMsg
  47536. ) {
  47537. params = params || {};
  47538. try {
  47539. var filler =
  47540. regexpCompileCache[path] ||
  47541. (regexpCompileCache[path] = pathToRegexp_1.compile(path));
  47542. // Fix #2505 resolving asterisk routes { name: 'not-found', params: { pathMatch: '/not-found' }}
  47543. // and fix #3106 so that you can work with location descriptor object having params.pathMatch equal to empty string
  47544. if (typeof params.pathMatch === 'string') { params[0] = params.pathMatch; }
  47545. return filler(params, { pretty: true })
  47546. } catch (e) {
  47547. if (true) {
  47548. // Fix #3072 no warn if `pathMatch` is string
  47549. warn(typeof params.pathMatch === 'string', ("missing param for " + routeMsg + ": " + (e.message)));
  47550. }
  47551. return ''
  47552. } finally {
  47553. // delete the 0 if it was added
  47554. delete params[0];
  47555. }
  47556. }
  47557. /* */
  47558. function normalizeLocation (
  47559. raw,
  47560. current,
  47561. append,
  47562. router
  47563. ) {
  47564. var next = typeof raw === 'string' ? { path: raw } : raw;
  47565. // named target
  47566. if (next._normalized) {
  47567. return next
  47568. } else if (next.name) {
  47569. next = extend({}, raw);
  47570. var params = next.params;
  47571. if (params && typeof params === 'object') {
  47572. next.params = extend({}, params);
  47573. }
  47574. return next
  47575. }
  47576. // relative params
  47577. if (!next.path && next.params && current) {
  47578. next = extend({}, next);
  47579. next._normalized = true;
  47580. var params$1 = extend(extend({}, current.params), next.params);
  47581. if (current.name) {
  47582. next.name = current.name;
  47583. next.params = params$1;
  47584. } else if (current.matched.length) {
  47585. var rawPath = current.matched[current.matched.length - 1].path;
  47586. next.path = fillParams(rawPath, params$1, ("path " + (current.path)));
  47587. } else if (true) {
  47588. warn(false, "relative params navigation requires a current route.");
  47589. }
  47590. return next
  47591. }
  47592. var parsedPath = parsePath(next.path || '');
  47593. var basePath = (current && current.path) || '/';
  47594. var path = parsedPath.path
  47595. ? resolvePath(parsedPath.path, basePath, append || next.append)
  47596. : basePath;
  47597. var query = resolveQuery(
  47598. parsedPath.query,
  47599. next.query,
  47600. router && router.options.parseQuery
  47601. );
  47602. var hash = next.hash || parsedPath.hash;
  47603. if (hash && hash.charAt(0) !== '#') {
  47604. hash = "#" + hash;
  47605. }
  47606. return {
  47607. _normalized: true,
  47608. path: path,
  47609. query: query,
  47610. hash: hash
  47611. }
  47612. }
  47613. /* */
  47614. // work around weird flow bug
  47615. var toTypes = [String, Object];
  47616. var eventTypes = [String, Array];
  47617. var noop = function () {};
  47618. var Link = {
  47619. name: 'RouterLink',
  47620. props: {
  47621. to: {
  47622. type: toTypes,
  47623. required: true
  47624. },
  47625. tag: {
  47626. type: String,
  47627. default: 'a'
  47628. },
  47629. exact: Boolean,
  47630. append: Boolean,
  47631. replace: Boolean,
  47632. activeClass: String,
  47633. exactActiveClass: String,
  47634. event: {
  47635. type: eventTypes,
  47636. default: 'click'
  47637. }
  47638. },
  47639. render: function render (h) {
  47640. var this$1 = this;
  47641. var router = this.$router;
  47642. var current = this.$route;
  47643. var ref = router.resolve(
  47644. this.to,
  47645. current,
  47646. this.append
  47647. );
  47648. var location = ref.location;
  47649. var route = ref.route;
  47650. var href = ref.href;
  47651. var classes = {};
  47652. var globalActiveClass = router.options.linkActiveClass;
  47653. var globalExactActiveClass = router.options.linkExactActiveClass;
  47654. // Support global empty active class
  47655. var activeClassFallback =
  47656. globalActiveClass == null ? 'router-link-active' : globalActiveClass;
  47657. var exactActiveClassFallback =
  47658. globalExactActiveClass == null
  47659. ? 'router-link-exact-active'
  47660. : globalExactActiveClass;
  47661. var activeClass =
  47662. this.activeClass == null ? activeClassFallback : this.activeClass;
  47663. var exactActiveClass =
  47664. this.exactActiveClass == null
  47665. ? exactActiveClassFallback
  47666. : this.exactActiveClass;
  47667. var compareTarget = route.redirectedFrom
  47668. ? createRoute(null, normalizeLocation(route.redirectedFrom), null, router)
  47669. : route;
  47670. classes[exactActiveClass] = isSameRoute(current, compareTarget);
  47671. classes[activeClass] = this.exact
  47672. ? classes[exactActiveClass]
  47673. : isIncludedRoute(current, compareTarget);
  47674. var handler = function (e) {
  47675. if (guardEvent(e)) {
  47676. if (this$1.replace) {
  47677. router.replace(location, noop);
  47678. } else {
  47679. router.push(location, noop);
  47680. }
  47681. }
  47682. };
  47683. var on = { click: guardEvent };
  47684. if (Array.isArray(this.event)) {
  47685. this.event.forEach(function (e) {
  47686. on[e] = handler;
  47687. });
  47688. } else {
  47689. on[this.event] = handler;
  47690. }
  47691. var data = { class: classes };
  47692. var scopedSlot =
  47693. !this.$scopedSlots.$hasNormal &&
  47694. this.$scopedSlots.default &&
  47695. this.$scopedSlots.default({
  47696. href: href,
  47697. route: route,
  47698. navigate: handler,
  47699. isActive: classes[activeClass],
  47700. isExactActive: classes[exactActiveClass]
  47701. });
  47702. if (scopedSlot) {
  47703. if (scopedSlot.length === 1) {
  47704. return scopedSlot[0]
  47705. } else if (scopedSlot.length > 1 || !scopedSlot.length) {
  47706. if (true) {
  47707. warn(
  47708. false,
  47709. ("RouterLink with to=\"" + (this.to) + "\" is trying to use a scoped slot but it didn't provide exactly one child. Wrapping the content with a span element.")
  47710. );
  47711. }
  47712. return scopedSlot.length === 0 ? h() : h('span', {}, scopedSlot)
  47713. }
  47714. }
  47715. if (this.tag === 'a') {
  47716. data.on = on;
  47717. data.attrs = { href: href };
  47718. } else {
  47719. // find the first <a> child and apply listener and href
  47720. var a = findAnchor(this.$slots.default);
  47721. if (a) {
  47722. // in case the <a> is a static node
  47723. a.isStatic = false;
  47724. var aData = (a.data = extend({}, a.data));
  47725. aData.on = aData.on || {};
  47726. // transform existing events in both objects into arrays so we can push later
  47727. for (var event in aData.on) {
  47728. var handler$1 = aData.on[event];
  47729. if (event in on) {
  47730. aData.on[event] = Array.isArray(handler$1) ? handler$1 : [handler$1];
  47731. }
  47732. }
  47733. // append new listeners for router-link
  47734. for (var event$1 in on) {
  47735. if (event$1 in aData.on) {
  47736. // on[event] is always a function
  47737. aData.on[event$1].push(on[event$1]);
  47738. } else {
  47739. aData.on[event$1] = handler;
  47740. }
  47741. }
  47742. var aAttrs = (a.data.attrs = extend({}, a.data.attrs));
  47743. aAttrs.href = href;
  47744. } else {
  47745. // doesn't have <a> child, apply listener to self
  47746. data.on = on;
  47747. }
  47748. }
  47749. return h(this.tag, data, this.$slots.default)
  47750. }
  47751. };
  47752. function guardEvent (e) {
  47753. // don't redirect with control keys
  47754. if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) { return }
  47755. // don't redirect when preventDefault called
  47756. if (e.defaultPrevented) { return }
  47757. // don't redirect on right click
  47758. if (e.button !== undefined && e.button !== 0) { return }
  47759. // don't redirect if `target="_blank"`
  47760. if (e.currentTarget && e.currentTarget.getAttribute) {
  47761. var target = e.currentTarget.getAttribute('target');
  47762. if (/\b_blank\b/i.test(target)) { return }
  47763. }
  47764. // this may be a Weex event which doesn't have this method
  47765. if (e.preventDefault) {
  47766. e.preventDefault();
  47767. }
  47768. return true
  47769. }
  47770. function findAnchor (children) {
  47771. if (children) {
  47772. var child;
  47773. for (var i = 0; i < children.length; i++) {
  47774. child = children[i];
  47775. if (child.tag === 'a') {
  47776. return child
  47777. }
  47778. if (child.children && (child = findAnchor(child.children))) {
  47779. return child
  47780. }
  47781. }
  47782. }
  47783. }
  47784. var _Vue;
  47785. function install (Vue) {
  47786. if (install.installed && _Vue === Vue) { return }
  47787. install.installed = true;
  47788. _Vue = Vue;
  47789. var isDef = function (v) { return v !== undefined; };
  47790. var registerInstance = function (vm, callVal) {
  47791. var i = vm.$options._parentVnode;
  47792. if (isDef(i) && isDef(i = i.data) && isDef(i = i.registerRouteInstance)) {
  47793. i(vm, callVal);
  47794. }
  47795. };
  47796. Vue.mixin({
  47797. beforeCreate: function beforeCreate () {
  47798. if (isDef(this.$options.router)) {
  47799. this._routerRoot = this;
  47800. this._router = this.$options.router;
  47801. this._router.init(this);
  47802. Vue.util.defineReactive(this, '_route', this._router.history.current);
  47803. } else {
  47804. this._routerRoot = (this.$parent && this.$parent._routerRoot) || this;
  47805. }
  47806. registerInstance(this, this);
  47807. },
  47808. destroyed: function destroyed () {
  47809. registerInstance(this);
  47810. }
  47811. });
  47812. Object.defineProperty(Vue.prototype, '$router', {
  47813. get: function get () { return this._routerRoot._router }
  47814. });
  47815. Object.defineProperty(Vue.prototype, '$route', {
  47816. get: function get () { return this._routerRoot._route }
  47817. });
  47818. Vue.component('RouterView', View);
  47819. Vue.component('RouterLink', Link);
  47820. var strats = Vue.config.optionMergeStrategies;
  47821. // use the same hook merging strategy for route hooks
  47822. strats.beforeRouteEnter = strats.beforeRouteLeave = strats.beforeRouteUpdate = strats.created;
  47823. }
  47824. /* */
  47825. var inBrowser = typeof window !== 'undefined';
  47826. /* */
  47827. function createRouteMap (
  47828. routes,
  47829. oldPathList,
  47830. oldPathMap,
  47831. oldNameMap
  47832. ) {
  47833. // the path list is used to control path matching priority
  47834. var pathList = oldPathList || [];
  47835. // $flow-disable-line
  47836. var pathMap = oldPathMap || Object.create(null);
  47837. // $flow-disable-line
  47838. var nameMap = oldNameMap || Object.create(null);
  47839. routes.forEach(function (route) {
  47840. addRouteRecord(pathList, pathMap, nameMap, route);
  47841. });
  47842. // ensure wildcard routes are always at the end
  47843. for (var i = 0, l = pathList.length; i < l; i++) {
  47844. if (pathList[i] === '*') {
  47845. pathList.push(pathList.splice(i, 1)[0]);
  47846. l--;
  47847. i--;
  47848. }
  47849. }
  47850. if (true) {
  47851. // warn if routes do not include leading slashes
  47852. var found = pathList
  47853. // check for missing leading slash
  47854. .filter(function (path) { return path && path.charAt(0) !== '*' && path.charAt(0) !== '/'; });
  47855. if (found.length > 0) {
  47856. var pathNames = found.map(function (path) { return ("- " + path); }).join('\n');
  47857. warn(false, ("Non-nested routes must include a leading slash character. Fix the following routes: \n" + pathNames));
  47858. }
  47859. }
  47860. return {
  47861. pathList: pathList,
  47862. pathMap: pathMap,
  47863. nameMap: nameMap
  47864. }
  47865. }
  47866. function addRouteRecord (
  47867. pathList,
  47868. pathMap,
  47869. nameMap,
  47870. route,
  47871. parent,
  47872. matchAs
  47873. ) {
  47874. var path = route.path;
  47875. var name = route.name;
  47876. if (true) {
  47877. assert(path != null, "\"path\" is required in a route configuration.");
  47878. assert(
  47879. typeof route.component !== 'string',
  47880. "route config \"component\" for path: " + (String(
  47881. path || name
  47882. )) + " cannot be a " + "string id. Use an actual component instead."
  47883. );
  47884. }
  47885. var pathToRegexpOptions =
  47886. route.pathToRegexpOptions || {};
  47887. var normalizedPath = normalizePath(path, parent, pathToRegexpOptions.strict);
  47888. if (typeof route.caseSensitive === 'boolean') {
  47889. pathToRegexpOptions.sensitive = route.caseSensitive;
  47890. }
  47891. var record = {
  47892. path: normalizedPath,
  47893. regex: compileRouteRegex(normalizedPath, pathToRegexpOptions),
  47894. components: route.components || { default: route.component },
  47895. instances: {},
  47896. name: name,
  47897. parent: parent,
  47898. matchAs: matchAs,
  47899. redirect: route.redirect,
  47900. beforeEnter: route.beforeEnter,
  47901. meta: route.meta || {},
  47902. props:
  47903. route.props == null
  47904. ? {}
  47905. : route.components
  47906. ? route.props
  47907. : { default: route.props }
  47908. };
  47909. if (route.children) {
  47910. // Warn if route is named, does not redirect and has a default child route.
  47911. // If users navigate to this route by name, the default child will
  47912. // not be rendered (GH Issue #629)
  47913. if (true) {
  47914. if (
  47915. route.name &&
  47916. !route.redirect &&
  47917. route.children.some(function (child) { return /^\/?$/.test(child.path); })
  47918. ) {
  47919. warn(
  47920. false,
  47921. "Named Route '" + (route.name) + "' has a default child route. " +
  47922. "When navigating to this named route (:to=\"{name: '" + (route.name) + "'\"), " +
  47923. "the default child route will not be rendered. Remove the name from " +
  47924. "this route and use the name of the default child route for named " +
  47925. "links instead."
  47926. );
  47927. }
  47928. }
  47929. route.children.forEach(function (child) {
  47930. var childMatchAs = matchAs
  47931. ? cleanPath((matchAs + "/" + (child.path)))
  47932. : undefined;
  47933. addRouteRecord(pathList, pathMap, nameMap, child, record, childMatchAs);
  47934. });
  47935. }
  47936. if (!pathMap[record.path]) {
  47937. pathList.push(record.path);
  47938. pathMap[record.path] = record;
  47939. }
  47940. if (route.alias !== undefined) {
  47941. var aliases = Array.isArray(route.alias) ? route.alias : [route.alias];
  47942. for (var i = 0; i < aliases.length; ++i) {
  47943. var alias = aliases[i];
  47944. if ( true && alias === path) {
  47945. warn(
  47946. false,
  47947. ("Found an alias with the same value as the path: \"" + path + "\". You have to remove that alias. It will be ignored in development.")
  47948. );
  47949. // skip in dev to make it work
  47950. continue
  47951. }
  47952. var aliasRoute = {
  47953. path: alias,
  47954. children: route.children
  47955. };
  47956. addRouteRecord(
  47957. pathList,
  47958. pathMap,
  47959. nameMap,
  47960. aliasRoute,
  47961. parent,
  47962. record.path || '/' // matchAs
  47963. );
  47964. }
  47965. }
  47966. if (name) {
  47967. if (!nameMap[name]) {
  47968. nameMap[name] = record;
  47969. } else if ( true && !matchAs) {
  47970. warn(
  47971. false,
  47972. "Duplicate named routes definition: " +
  47973. "{ name: \"" + name + "\", path: \"" + (record.path) + "\" }"
  47974. );
  47975. }
  47976. }
  47977. }
  47978. function compileRouteRegex (
  47979. path,
  47980. pathToRegexpOptions
  47981. ) {
  47982. var regex = pathToRegexp_1(path, [], pathToRegexpOptions);
  47983. if (true) {
  47984. var keys = Object.create(null);
  47985. regex.keys.forEach(function (key) {
  47986. warn(
  47987. !keys[key.name],
  47988. ("Duplicate param keys in route with path: \"" + path + "\"")
  47989. );
  47990. keys[key.name] = true;
  47991. });
  47992. }
  47993. return regex
  47994. }
  47995. function normalizePath (
  47996. path,
  47997. parent,
  47998. strict
  47999. ) {
  48000. if (!strict) { path = path.replace(/\/$/, ''); }
  48001. if (path[0] === '/') { return path }
  48002. if (parent == null) { return path }
  48003. return cleanPath(((parent.path) + "/" + path))
  48004. }
  48005. /* */
  48006. function createMatcher (
  48007. routes,
  48008. router
  48009. ) {
  48010. var ref = createRouteMap(routes);
  48011. var pathList = ref.pathList;
  48012. var pathMap = ref.pathMap;
  48013. var nameMap = ref.nameMap;
  48014. function addRoutes (routes) {
  48015. createRouteMap(routes, pathList, pathMap, nameMap);
  48016. }
  48017. function match (
  48018. raw,
  48019. currentRoute,
  48020. redirectedFrom
  48021. ) {
  48022. var location = normalizeLocation(raw, currentRoute, false, router);
  48023. var name = location.name;
  48024. if (name) {
  48025. var record = nameMap[name];
  48026. if (true) {
  48027. warn(record, ("Route with name '" + name + "' does not exist"));
  48028. }
  48029. if (!record) { return _createRoute(null, location) }
  48030. var paramNames = record.regex.keys
  48031. .filter(function (key) { return !key.optional; })
  48032. .map(function (key) { return key.name; });
  48033. if (typeof location.params !== 'object') {
  48034. location.params = {};
  48035. }
  48036. if (currentRoute && typeof currentRoute.params === 'object') {
  48037. for (var key in currentRoute.params) {
  48038. if (!(key in location.params) && paramNames.indexOf(key) > -1) {
  48039. location.params[key] = currentRoute.params[key];
  48040. }
  48041. }
  48042. }
  48043. location.path = fillParams(record.path, location.params, ("named route \"" + name + "\""));
  48044. return _createRoute(record, location, redirectedFrom)
  48045. } else if (location.path) {
  48046. location.params = {};
  48047. for (var i = 0; i < pathList.length; i++) {
  48048. var path = pathList[i];
  48049. var record$1 = pathMap[path];
  48050. if (matchRoute(record$1.regex, location.path, location.params)) {
  48051. return _createRoute(record$1, location, redirectedFrom)
  48052. }
  48053. }
  48054. }
  48055. // no match
  48056. return _createRoute(null, location)
  48057. }
  48058. function redirect (
  48059. record,
  48060. location
  48061. ) {
  48062. var originalRedirect = record.redirect;
  48063. var redirect = typeof originalRedirect === 'function'
  48064. ? originalRedirect(createRoute(record, location, null, router))
  48065. : originalRedirect;
  48066. if (typeof redirect === 'string') {
  48067. redirect = { path: redirect };
  48068. }
  48069. if (!redirect || typeof redirect !== 'object') {
  48070. if (true) {
  48071. warn(
  48072. false, ("invalid redirect option: " + (JSON.stringify(redirect)))
  48073. );
  48074. }
  48075. return _createRoute(null, location)
  48076. }
  48077. var re = redirect;
  48078. var name = re.name;
  48079. var path = re.path;
  48080. var query = location.query;
  48081. var hash = location.hash;
  48082. var params = location.params;
  48083. query = re.hasOwnProperty('query') ? re.query : query;
  48084. hash = re.hasOwnProperty('hash') ? re.hash : hash;
  48085. params = re.hasOwnProperty('params') ? re.params : params;
  48086. if (name) {
  48087. // resolved named direct
  48088. var targetRecord = nameMap[name];
  48089. if (true) {
  48090. assert(targetRecord, ("redirect failed: named route \"" + name + "\" not found."));
  48091. }
  48092. return match({
  48093. _normalized: true,
  48094. name: name,
  48095. query: query,
  48096. hash: hash,
  48097. params: params
  48098. }, undefined, location)
  48099. } else if (path) {
  48100. // 1. resolve relative redirect
  48101. var rawPath = resolveRecordPath(path, record);
  48102. // 2. resolve params
  48103. var resolvedPath = fillParams(rawPath, params, ("redirect route with path \"" + rawPath + "\""));
  48104. // 3. rematch with existing query and hash
  48105. return match({
  48106. _normalized: true,
  48107. path: resolvedPath,
  48108. query: query,
  48109. hash: hash
  48110. }, undefined, location)
  48111. } else {
  48112. if (true) {
  48113. warn(false, ("invalid redirect option: " + (JSON.stringify(redirect))));
  48114. }
  48115. return _createRoute(null, location)
  48116. }
  48117. }
  48118. function alias (
  48119. record,
  48120. location,
  48121. matchAs
  48122. ) {
  48123. var aliasedPath = fillParams(matchAs, location.params, ("aliased route with path \"" + matchAs + "\""));
  48124. var aliasedMatch = match({
  48125. _normalized: true,
  48126. path: aliasedPath
  48127. });
  48128. if (aliasedMatch) {
  48129. var matched = aliasedMatch.matched;
  48130. var aliasedRecord = matched[matched.length - 1];
  48131. location.params = aliasedMatch.params;
  48132. return _createRoute(aliasedRecord, location)
  48133. }
  48134. return _createRoute(null, location)
  48135. }
  48136. function _createRoute (
  48137. record,
  48138. location,
  48139. redirectedFrom
  48140. ) {
  48141. if (record && record.redirect) {
  48142. return redirect(record, redirectedFrom || location)
  48143. }
  48144. if (record && record.matchAs) {
  48145. return alias(record, location, record.matchAs)
  48146. }
  48147. return createRoute(record, location, redirectedFrom, router)
  48148. }
  48149. return {
  48150. match: match,
  48151. addRoutes: addRoutes
  48152. }
  48153. }
  48154. function matchRoute (
  48155. regex,
  48156. path,
  48157. params
  48158. ) {
  48159. var m = path.match(regex);
  48160. if (!m) {
  48161. return false
  48162. } else if (!params) {
  48163. return true
  48164. }
  48165. for (var i = 1, len = m.length; i < len; ++i) {
  48166. var key = regex.keys[i - 1];
  48167. var val = typeof m[i] === 'string' ? decodeURIComponent(m[i]) : m[i];
  48168. if (key) {
  48169. // Fix #1994: using * with props: true generates a param named 0
  48170. params[key.name || 'pathMatch'] = val;
  48171. }
  48172. }
  48173. return true
  48174. }
  48175. function resolveRecordPath (path, record) {
  48176. return resolvePath(path, record.parent ? record.parent.path : '/', true)
  48177. }
  48178. /* */
  48179. // use User Timing api (if present) for more accurate key precision
  48180. var Time =
  48181. inBrowser && window.performance && window.performance.now
  48182. ? window.performance
  48183. : Date;
  48184. function genStateKey () {
  48185. return Time.now().toFixed(3)
  48186. }
  48187. var _key = genStateKey();
  48188. function getStateKey () {
  48189. return _key
  48190. }
  48191. function setStateKey (key) {
  48192. return (_key = key)
  48193. }
  48194. /* */
  48195. var positionStore = Object.create(null);
  48196. function setupScroll () {
  48197. // Fix for #1585 for Firefox
  48198. // Fix for #2195 Add optional third attribute to workaround a bug in safari https://bugs.webkit.org/show_bug.cgi?id=182678
  48199. // Fix for #2774 Support for apps loaded from Windows file shares not mapped to network drives: replaced location.origin with
  48200. // window.location.protocol + '//' + window.location.host
  48201. // location.host contains the port and location.hostname doesn't
  48202. var protocolAndPath = window.location.protocol + '//' + window.location.host;
  48203. var absolutePath = window.location.href.replace(protocolAndPath, '');
  48204. // preserve existing history state as it could be overriden by the user
  48205. var stateCopy = extend({}, window.history.state);
  48206. stateCopy.key = getStateKey();
  48207. window.history.replaceState(stateCopy, '', absolutePath);
  48208. window.addEventListener('popstate', function (e) {
  48209. saveScrollPosition();
  48210. if (e.state && e.state.key) {
  48211. setStateKey(e.state.key);
  48212. }
  48213. });
  48214. }
  48215. function handleScroll (
  48216. router,
  48217. to,
  48218. from,
  48219. isPop
  48220. ) {
  48221. if (!router.app) {
  48222. return
  48223. }
  48224. var behavior = router.options.scrollBehavior;
  48225. if (!behavior) {
  48226. return
  48227. }
  48228. if (true) {
  48229. assert(typeof behavior === 'function', "scrollBehavior must be a function");
  48230. }
  48231. // wait until re-render finishes before scrolling
  48232. router.app.$nextTick(function () {
  48233. var position = getScrollPosition();
  48234. var shouldScroll = behavior.call(
  48235. router,
  48236. to,
  48237. from,
  48238. isPop ? position : null
  48239. );
  48240. if (!shouldScroll) {
  48241. return
  48242. }
  48243. if (typeof shouldScroll.then === 'function') {
  48244. shouldScroll
  48245. .then(function (shouldScroll) {
  48246. scrollToPosition((shouldScroll), position);
  48247. })
  48248. .catch(function (err) {
  48249. if (true) {
  48250. assert(false, err.toString());
  48251. }
  48252. });
  48253. } else {
  48254. scrollToPosition(shouldScroll, position);
  48255. }
  48256. });
  48257. }
  48258. function saveScrollPosition () {
  48259. var key = getStateKey();
  48260. if (key) {
  48261. positionStore[key] = {
  48262. x: window.pageXOffset,
  48263. y: window.pageYOffset
  48264. };
  48265. }
  48266. }
  48267. function getScrollPosition () {
  48268. var key = getStateKey();
  48269. if (key) {
  48270. return positionStore[key]
  48271. }
  48272. }
  48273. function getElementPosition (el, offset) {
  48274. var docEl = document.documentElement;
  48275. var docRect = docEl.getBoundingClientRect();
  48276. var elRect = el.getBoundingClientRect();
  48277. return {
  48278. x: elRect.left - docRect.left - offset.x,
  48279. y: elRect.top - docRect.top - offset.y
  48280. }
  48281. }
  48282. function isValidPosition (obj) {
  48283. return isNumber(obj.x) || isNumber(obj.y)
  48284. }
  48285. function normalizePosition (obj) {
  48286. return {
  48287. x: isNumber(obj.x) ? obj.x : window.pageXOffset,
  48288. y: isNumber(obj.y) ? obj.y : window.pageYOffset
  48289. }
  48290. }
  48291. function normalizeOffset (obj) {
  48292. return {
  48293. x: isNumber(obj.x) ? obj.x : 0,
  48294. y: isNumber(obj.y) ? obj.y : 0
  48295. }
  48296. }
  48297. function isNumber (v) {
  48298. return typeof v === 'number'
  48299. }
  48300. var hashStartsWithNumberRE = /^#\d/;
  48301. function scrollToPosition (shouldScroll, position) {
  48302. var isObject = typeof shouldScroll === 'object';
  48303. if (isObject && typeof shouldScroll.selector === 'string') {
  48304. // getElementById would still fail if the selector contains a more complicated query like #main[data-attr]
  48305. // but at the same time, it doesn't make much sense to select an element with an id and an extra selector
  48306. var el = hashStartsWithNumberRE.test(shouldScroll.selector) // $flow-disable-line
  48307. ? document.getElementById(shouldScroll.selector.slice(1)) // $flow-disable-line
  48308. : document.querySelector(shouldScroll.selector);
  48309. if (el) {
  48310. var offset =
  48311. shouldScroll.offset && typeof shouldScroll.offset === 'object'
  48312. ? shouldScroll.offset
  48313. : {};
  48314. offset = normalizeOffset(offset);
  48315. position = getElementPosition(el, offset);
  48316. } else if (isValidPosition(shouldScroll)) {
  48317. position = normalizePosition(shouldScroll);
  48318. }
  48319. } else if (isObject && isValidPosition(shouldScroll)) {
  48320. position = normalizePosition(shouldScroll);
  48321. }
  48322. if (position) {
  48323. window.scrollTo(position.x, position.y);
  48324. }
  48325. }
  48326. /* */
  48327. var supportsPushState =
  48328. inBrowser &&
  48329. (function () {
  48330. var ua = window.navigator.userAgent;
  48331. if (
  48332. (ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) &&
  48333. ua.indexOf('Mobile Safari') !== -1 &&
  48334. ua.indexOf('Chrome') === -1 &&
  48335. ua.indexOf('Windows Phone') === -1
  48336. ) {
  48337. return false
  48338. }
  48339. return window.history && 'pushState' in window.history
  48340. })();
  48341. function pushState (url, replace) {
  48342. saveScrollPosition();
  48343. // try...catch the pushState call to get around Safari
  48344. // DOM Exception 18 where it limits to 100 pushState calls
  48345. var history = window.history;
  48346. try {
  48347. if (replace) {
  48348. // preserve existing history state as it could be overriden by the user
  48349. var stateCopy = extend({}, history.state);
  48350. stateCopy.key = getStateKey();
  48351. history.replaceState(stateCopy, '', url);
  48352. } else {
  48353. history.pushState({ key: setStateKey(genStateKey()) }, '', url);
  48354. }
  48355. } catch (e) {
  48356. window.location[replace ? 'replace' : 'assign'](url);
  48357. }
  48358. }
  48359. function replaceState (url) {
  48360. pushState(url, true);
  48361. }
  48362. /* */
  48363. function runQueue (queue, fn, cb) {
  48364. var step = function (index) {
  48365. if (index >= queue.length) {
  48366. cb();
  48367. } else {
  48368. if (queue[index]) {
  48369. fn(queue[index], function () {
  48370. step(index + 1);
  48371. });
  48372. } else {
  48373. step(index + 1);
  48374. }
  48375. }
  48376. };
  48377. step(0);
  48378. }
  48379. /* */
  48380. function resolveAsyncComponents (matched) {
  48381. return function (to, from, next) {
  48382. var hasAsync = false;
  48383. var pending = 0;
  48384. var error = null;
  48385. flatMapComponents(matched, function (def, _, match, key) {
  48386. // if it's a function and doesn't have cid attached,
  48387. // assume it's an async component resolve function.
  48388. // we are not using Vue's default async resolving mechanism because
  48389. // we want to halt the navigation until the incoming component has been
  48390. // resolved.
  48391. if (typeof def === 'function' && def.cid === undefined) {
  48392. hasAsync = true;
  48393. pending++;
  48394. var resolve = once(function (resolvedDef) {
  48395. if (isESModule(resolvedDef)) {
  48396. resolvedDef = resolvedDef.default;
  48397. }
  48398. // save resolved on async factory in case it's used elsewhere
  48399. def.resolved = typeof resolvedDef === 'function'
  48400. ? resolvedDef
  48401. : _Vue.extend(resolvedDef);
  48402. match.components[key] = resolvedDef;
  48403. pending--;
  48404. if (pending <= 0) {
  48405. next();
  48406. }
  48407. });
  48408. var reject = once(function (reason) {
  48409. var msg = "Failed to resolve async component " + key + ": " + reason;
  48410. true && warn(false, msg);
  48411. if (!error) {
  48412. error = isError(reason)
  48413. ? reason
  48414. : new Error(msg);
  48415. next(error);
  48416. }
  48417. });
  48418. var res;
  48419. try {
  48420. res = def(resolve, reject);
  48421. } catch (e) {
  48422. reject(e);
  48423. }
  48424. if (res) {
  48425. if (typeof res.then === 'function') {
  48426. res.then(resolve, reject);
  48427. } else {
  48428. // new syntax in Vue 2.3
  48429. var comp = res.component;
  48430. if (comp && typeof comp.then === 'function') {
  48431. comp.then(resolve, reject);
  48432. }
  48433. }
  48434. }
  48435. }
  48436. });
  48437. if (!hasAsync) { next(); }
  48438. }
  48439. }
  48440. function flatMapComponents (
  48441. matched,
  48442. fn
  48443. ) {
  48444. return flatten(matched.map(function (m) {
  48445. return Object.keys(m.components).map(function (key) { return fn(
  48446. m.components[key],
  48447. m.instances[key],
  48448. m, key
  48449. ); })
  48450. }))
  48451. }
  48452. function flatten (arr) {
  48453. return Array.prototype.concat.apply([], arr)
  48454. }
  48455. var hasSymbol =
  48456. typeof Symbol === 'function' &&
  48457. typeof Symbol.toStringTag === 'symbol';
  48458. function isESModule (obj) {
  48459. return obj.__esModule || (hasSymbol && obj[Symbol.toStringTag] === 'Module')
  48460. }
  48461. // in Webpack 2, require.ensure now also returns a Promise
  48462. // so the resolve/reject functions may get called an extra time
  48463. // if the user uses an arrow function shorthand that happens to
  48464. // return that Promise.
  48465. function once (fn) {
  48466. var called = false;
  48467. return function () {
  48468. var args = [], len = arguments.length;
  48469. while ( len-- ) args[ len ] = arguments[ len ];
  48470. if (called) { return }
  48471. called = true;
  48472. return fn.apply(this, args)
  48473. }
  48474. }
  48475. var NavigationDuplicated = /*@__PURE__*/(function (Error) {
  48476. function NavigationDuplicated (normalizedLocation) {
  48477. Error.call(this);
  48478. this.name = this._name = 'NavigationDuplicated';
  48479. // passing the message to super() doesn't seem to work in the transpiled version
  48480. this.message = "Navigating to current location (\"" + (normalizedLocation.fullPath) + "\") is not allowed";
  48481. // add a stack property so services like Sentry can correctly display it
  48482. Object.defineProperty(this, 'stack', {
  48483. value: new Error().stack,
  48484. writable: true,
  48485. configurable: true
  48486. });
  48487. // we could also have used
  48488. // Error.captureStackTrace(this, this.constructor)
  48489. // but it only exists on node and chrome
  48490. }
  48491. if ( Error ) NavigationDuplicated.__proto__ = Error;
  48492. NavigationDuplicated.prototype = Object.create( Error && Error.prototype );
  48493. NavigationDuplicated.prototype.constructor = NavigationDuplicated;
  48494. return NavigationDuplicated;
  48495. }(Error));
  48496. // support IE9
  48497. NavigationDuplicated._name = 'NavigationDuplicated';
  48498. /* */
  48499. var History = function History (router, base) {
  48500. this.router = router;
  48501. this.base = normalizeBase(base);
  48502. // start with a route object that stands for "nowhere"
  48503. this.current = START;
  48504. this.pending = null;
  48505. this.ready = false;
  48506. this.readyCbs = [];
  48507. this.readyErrorCbs = [];
  48508. this.errorCbs = [];
  48509. };
  48510. History.prototype.listen = function listen (cb) {
  48511. this.cb = cb;
  48512. };
  48513. History.prototype.onReady = function onReady (cb, errorCb) {
  48514. if (this.ready) {
  48515. cb();
  48516. } else {
  48517. this.readyCbs.push(cb);
  48518. if (errorCb) {
  48519. this.readyErrorCbs.push(errorCb);
  48520. }
  48521. }
  48522. };
  48523. History.prototype.onError = function onError (errorCb) {
  48524. this.errorCbs.push(errorCb);
  48525. };
  48526. History.prototype.transitionTo = function transitionTo (
  48527. location,
  48528. onComplete,
  48529. onAbort
  48530. ) {
  48531. var this$1 = this;
  48532. var route = this.router.match(location, this.current);
  48533. this.confirmTransition(
  48534. route,
  48535. function () {
  48536. this$1.updateRoute(route);
  48537. onComplete && onComplete(route);
  48538. this$1.ensureURL();
  48539. // fire ready cbs once
  48540. if (!this$1.ready) {
  48541. this$1.ready = true;
  48542. this$1.readyCbs.forEach(function (cb) {
  48543. cb(route);
  48544. });
  48545. }
  48546. },
  48547. function (err) {
  48548. if (onAbort) {
  48549. onAbort(err);
  48550. }
  48551. if (err && !this$1.ready) {
  48552. this$1.ready = true;
  48553. this$1.readyErrorCbs.forEach(function (cb) {
  48554. cb(err);
  48555. });
  48556. }
  48557. }
  48558. );
  48559. };
  48560. History.prototype.confirmTransition = function confirmTransition (route, onComplete, onAbort) {
  48561. var this$1 = this;
  48562. var current = this.current;
  48563. var abort = function (err) {
  48564. // after merging https://github.com/vuejs/vue-router/pull/2771 we
  48565. // When the user navigates through history through back/forward buttons
  48566. // we do not want to throw the error. We only throw it if directly calling
  48567. // push/replace. That's why it's not included in isError
  48568. if (!isExtendedError(NavigationDuplicated, err) && isError(err)) {
  48569. if (this$1.errorCbs.length) {
  48570. this$1.errorCbs.forEach(function (cb) {
  48571. cb(err);
  48572. });
  48573. } else {
  48574. warn(false, 'uncaught error during route navigation:');
  48575. console.error(err);
  48576. }
  48577. }
  48578. onAbort && onAbort(err);
  48579. };
  48580. if (
  48581. isSameRoute(route, current) &&
  48582. // in the case the route map has been dynamically appended to
  48583. route.matched.length === current.matched.length
  48584. ) {
  48585. this.ensureURL();
  48586. return abort(new NavigationDuplicated(route))
  48587. }
  48588. var ref = resolveQueue(
  48589. this.current.matched,
  48590. route.matched
  48591. );
  48592. var updated = ref.updated;
  48593. var deactivated = ref.deactivated;
  48594. var activated = ref.activated;
  48595. var queue = [].concat(
  48596. // in-component leave guards
  48597. extractLeaveGuards(deactivated),
  48598. // global before hooks
  48599. this.router.beforeHooks,
  48600. // in-component update hooks
  48601. extractUpdateHooks(updated),
  48602. // in-config enter guards
  48603. activated.map(function (m) { return m.beforeEnter; }),
  48604. // async components
  48605. resolveAsyncComponents(activated)
  48606. );
  48607. this.pending = route;
  48608. var iterator = function (hook, next) {
  48609. if (this$1.pending !== route) {
  48610. return abort()
  48611. }
  48612. try {
  48613. hook(route, current, function (to) {
  48614. if (to === false || isError(to)) {
  48615. // next(false) -> abort navigation, ensure current URL
  48616. this$1.ensureURL(true);
  48617. abort(to);
  48618. } else if (
  48619. typeof to === 'string' ||
  48620. (typeof to === 'object' &&
  48621. (typeof to.path === 'string' || typeof to.name === 'string'))
  48622. ) {
  48623. // next('/') or next({ path: '/' }) -> redirect
  48624. abort();
  48625. if (typeof to === 'object' && to.replace) {
  48626. this$1.replace(to);
  48627. } else {
  48628. this$1.push(to);
  48629. }
  48630. } else {
  48631. // confirm transition and pass on the value
  48632. next(to);
  48633. }
  48634. });
  48635. } catch (e) {
  48636. abort(e);
  48637. }
  48638. };
  48639. runQueue(queue, iterator, function () {
  48640. var postEnterCbs = [];
  48641. var isValid = function () { return this$1.current === route; };
  48642. // wait until async components are resolved before
  48643. // extracting in-component enter guards
  48644. var enterGuards = extractEnterGuards(activated, postEnterCbs, isValid);
  48645. var queue = enterGuards.concat(this$1.router.resolveHooks);
  48646. runQueue(queue, iterator, function () {
  48647. if (this$1.pending !== route) {
  48648. return abort()
  48649. }
  48650. this$1.pending = null;
  48651. onComplete(route);
  48652. if (this$1.router.app) {
  48653. this$1.router.app.$nextTick(function () {
  48654. postEnterCbs.forEach(function (cb) {
  48655. cb();
  48656. });
  48657. });
  48658. }
  48659. });
  48660. });
  48661. };
  48662. History.prototype.updateRoute = function updateRoute (route) {
  48663. var prev = this.current;
  48664. this.current = route;
  48665. this.cb && this.cb(route);
  48666. this.router.afterHooks.forEach(function (hook) {
  48667. hook && hook(route, prev);
  48668. });
  48669. };
  48670. function normalizeBase (base) {
  48671. if (!base) {
  48672. if (inBrowser) {
  48673. // respect <base> tag
  48674. var baseEl = document.querySelector('base');
  48675. base = (baseEl && baseEl.getAttribute('href')) || '/';
  48676. // strip full URL origin
  48677. base = base.replace(/^https?:\/\/[^\/]+/, '');
  48678. } else {
  48679. base = '/';
  48680. }
  48681. }
  48682. // make sure there's the starting slash
  48683. if (base.charAt(0) !== '/') {
  48684. base = '/' + base;
  48685. }
  48686. // remove trailing slash
  48687. return base.replace(/\/$/, '')
  48688. }
  48689. function resolveQueue (
  48690. current,
  48691. next
  48692. ) {
  48693. var i;
  48694. var max = Math.max(current.length, next.length);
  48695. for (i = 0; i < max; i++) {
  48696. if (current[i] !== next[i]) {
  48697. break
  48698. }
  48699. }
  48700. return {
  48701. updated: next.slice(0, i),
  48702. activated: next.slice(i),
  48703. deactivated: current.slice(i)
  48704. }
  48705. }
  48706. function extractGuards (
  48707. records,
  48708. name,
  48709. bind,
  48710. reverse
  48711. ) {
  48712. var guards = flatMapComponents(records, function (def, instance, match, key) {
  48713. var guard = extractGuard(def, name);
  48714. if (guard) {
  48715. return Array.isArray(guard)
  48716. ? guard.map(function (guard) { return bind(guard, instance, match, key); })
  48717. : bind(guard, instance, match, key)
  48718. }
  48719. });
  48720. return flatten(reverse ? guards.reverse() : guards)
  48721. }
  48722. function extractGuard (
  48723. def,
  48724. key
  48725. ) {
  48726. if (typeof def !== 'function') {
  48727. // extend now so that global mixins are applied.
  48728. def = _Vue.extend(def);
  48729. }
  48730. return def.options[key]
  48731. }
  48732. function extractLeaveGuards (deactivated) {
  48733. return extractGuards(deactivated, 'beforeRouteLeave', bindGuard, true)
  48734. }
  48735. function extractUpdateHooks (updated) {
  48736. return extractGuards(updated, 'beforeRouteUpdate', bindGuard)
  48737. }
  48738. function bindGuard (guard, instance) {
  48739. if (instance) {
  48740. return function boundRouteGuard () {
  48741. return guard.apply(instance, arguments)
  48742. }
  48743. }
  48744. }
  48745. function extractEnterGuards (
  48746. activated,
  48747. cbs,
  48748. isValid
  48749. ) {
  48750. return extractGuards(
  48751. activated,
  48752. 'beforeRouteEnter',
  48753. function (guard, _, match, key) {
  48754. return bindEnterGuard(guard, match, key, cbs, isValid)
  48755. }
  48756. )
  48757. }
  48758. function bindEnterGuard (
  48759. guard,
  48760. match,
  48761. key,
  48762. cbs,
  48763. isValid
  48764. ) {
  48765. return function routeEnterGuard (to, from, next) {
  48766. return guard(to, from, function (cb) {
  48767. if (typeof cb === 'function') {
  48768. cbs.push(function () {
  48769. // #750
  48770. // if a router-view is wrapped with an out-in transition,
  48771. // the instance may not have been registered at this time.
  48772. // we will need to poll for registration until current route
  48773. // is no longer valid.
  48774. poll(cb, match.instances, key, isValid);
  48775. });
  48776. }
  48777. next(cb);
  48778. })
  48779. }
  48780. }
  48781. function poll (
  48782. cb, // somehow flow cannot infer this is a function
  48783. instances,
  48784. key,
  48785. isValid
  48786. ) {
  48787. if (
  48788. instances[key] &&
  48789. !instances[key]._isBeingDestroyed // do not reuse being destroyed instance
  48790. ) {
  48791. cb(instances[key]);
  48792. } else if (isValid()) {
  48793. setTimeout(function () {
  48794. poll(cb, instances, key, isValid);
  48795. }, 16);
  48796. }
  48797. }
  48798. /* */
  48799. var HTML5History = /*@__PURE__*/(function (History) {
  48800. function HTML5History (router, base) {
  48801. var this$1 = this;
  48802. History.call(this, router, base);
  48803. var expectScroll = router.options.scrollBehavior;
  48804. var supportsScroll = supportsPushState && expectScroll;
  48805. if (supportsScroll) {
  48806. setupScroll();
  48807. }
  48808. var initLocation = getLocation(this.base);
  48809. window.addEventListener('popstate', function (e) {
  48810. var current = this$1.current;
  48811. // Avoiding first `popstate` event dispatched in some browsers but first
  48812. // history route not updated since async guard at the same time.
  48813. var location = getLocation(this$1.base);
  48814. if (this$1.current === START && location === initLocation) {
  48815. return
  48816. }
  48817. this$1.transitionTo(location, function (route) {
  48818. if (supportsScroll) {
  48819. handleScroll(router, route, current, true);
  48820. }
  48821. });
  48822. });
  48823. }
  48824. if ( History ) HTML5History.__proto__ = History;
  48825. HTML5History.prototype = Object.create( History && History.prototype );
  48826. HTML5History.prototype.constructor = HTML5History;
  48827. HTML5History.prototype.go = function go (n) {
  48828. window.history.go(n);
  48829. };
  48830. HTML5History.prototype.push = function push (location, onComplete, onAbort) {
  48831. var this$1 = this;
  48832. var ref = this;
  48833. var fromRoute = ref.current;
  48834. this.transitionTo(location, function (route) {
  48835. pushState(cleanPath(this$1.base + route.fullPath));
  48836. handleScroll(this$1.router, route, fromRoute, false);
  48837. onComplete && onComplete(route);
  48838. }, onAbort);
  48839. };
  48840. HTML5History.prototype.replace = function replace (location, onComplete, onAbort) {
  48841. var this$1 = this;
  48842. var ref = this;
  48843. var fromRoute = ref.current;
  48844. this.transitionTo(location, function (route) {
  48845. replaceState(cleanPath(this$1.base + route.fullPath));
  48846. handleScroll(this$1.router, route, fromRoute, false);
  48847. onComplete && onComplete(route);
  48848. }, onAbort);
  48849. };
  48850. HTML5History.prototype.ensureURL = function ensureURL (push) {
  48851. if (getLocation(this.base) !== this.current.fullPath) {
  48852. var current = cleanPath(this.base + this.current.fullPath);
  48853. push ? pushState(current) : replaceState(current);
  48854. }
  48855. };
  48856. HTML5History.prototype.getCurrentLocation = function getCurrentLocation () {
  48857. return getLocation(this.base)
  48858. };
  48859. return HTML5History;
  48860. }(History));
  48861. function getLocation (base) {
  48862. var path = decodeURI(window.location.pathname);
  48863. if (base && path.indexOf(base) === 0) {
  48864. path = path.slice(base.length);
  48865. }
  48866. return (path || '/') + window.location.search + window.location.hash
  48867. }
  48868. /* */
  48869. var HashHistory = /*@__PURE__*/(function (History) {
  48870. function HashHistory (router, base, fallback) {
  48871. History.call(this, router, base);
  48872. // check history fallback deeplinking
  48873. if (fallback && checkFallback(this.base)) {
  48874. return
  48875. }
  48876. ensureSlash();
  48877. }
  48878. if ( History ) HashHistory.__proto__ = History;
  48879. HashHistory.prototype = Object.create( History && History.prototype );
  48880. HashHistory.prototype.constructor = HashHistory;
  48881. // this is delayed until the app mounts
  48882. // to avoid the hashchange listener being fired too early
  48883. HashHistory.prototype.setupListeners = function setupListeners () {
  48884. var this$1 = this;
  48885. var router = this.router;
  48886. var expectScroll = router.options.scrollBehavior;
  48887. var supportsScroll = supportsPushState && expectScroll;
  48888. if (supportsScroll) {
  48889. setupScroll();
  48890. }
  48891. window.addEventListener(
  48892. supportsPushState ? 'popstate' : 'hashchange',
  48893. function () {
  48894. var current = this$1.current;
  48895. if (!ensureSlash()) {
  48896. return
  48897. }
  48898. this$1.transitionTo(getHash(), function (route) {
  48899. if (supportsScroll) {
  48900. handleScroll(this$1.router, route, current, true);
  48901. }
  48902. if (!supportsPushState) {
  48903. replaceHash(route.fullPath);
  48904. }
  48905. });
  48906. }
  48907. );
  48908. };
  48909. HashHistory.prototype.push = function push (location, onComplete, onAbort) {
  48910. var this$1 = this;
  48911. var ref = this;
  48912. var fromRoute = ref.current;
  48913. this.transitionTo(
  48914. location,
  48915. function (route) {
  48916. pushHash(route.fullPath);
  48917. handleScroll(this$1.router, route, fromRoute, false);
  48918. onComplete && onComplete(route);
  48919. },
  48920. onAbort
  48921. );
  48922. };
  48923. HashHistory.prototype.replace = function replace (location, onComplete, onAbort) {
  48924. var this$1 = this;
  48925. var ref = this;
  48926. var fromRoute = ref.current;
  48927. this.transitionTo(
  48928. location,
  48929. function (route) {
  48930. replaceHash(route.fullPath);
  48931. handleScroll(this$1.router, route, fromRoute, false);
  48932. onComplete && onComplete(route);
  48933. },
  48934. onAbort
  48935. );
  48936. };
  48937. HashHistory.prototype.go = function go (n) {
  48938. window.history.go(n);
  48939. };
  48940. HashHistory.prototype.ensureURL = function ensureURL (push) {
  48941. var current = this.current.fullPath;
  48942. if (getHash() !== current) {
  48943. push ? pushHash(current) : replaceHash(current);
  48944. }
  48945. };
  48946. HashHistory.prototype.getCurrentLocation = function getCurrentLocation () {
  48947. return getHash()
  48948. };
  48949. return HashHistory;
  48950. }(History));
  48951. function checkFallback (base) {
  48952. var location = getLocation(base);
  48953. if (!/^\/#/.test(location)) {
  48954. window.location.replace(cleanPath(base + '/#' + location));
  48955. return true
  48956. }
  48957. }
  48958. function ensureSlash () {
  48959. var path = getHash();
  48960. if (path.charAt(0) === '/') {
  48961. return true
  48962. }
  48963. replaceHash('/' + path);
  48964. return false
  48965. }
  48966. function getHash () {
  48967. // We can't use window.location.hash here because it's not
  48968. // consistent across browsers - Firefox will pre-decode it!
  48969. var href = window.location.href;
  48970. var index = href.indexOf('#');
  48971. // empty path
  48972. if (index < 0) { return '' }
  48973. href = href.slice(index + 1);
  48974. // decode the hash but not the search or hash
  48975. // as search(query) is already decoded
  48976. // https://github.com/vuejs/vue-router/issues/2708
  48977. var searchIndex = href.indexOf('?');
  48978. if (searchIndex < 0) {
  48979. var hashIndex = href.indexOf('#');
  48980. if (hashIndex > -1) {
  48981. href = decodeURI(href.slice(0, hashIndex)) + href.slice(hashIndex);
  48982. } else { href = decodeURI(href); }
  48983. } else {
  48984. href = decodeURI(href.slice(0, searchIndex)) + href.slice(searchIndex);
  48985. }
  48986. return href
  48987. }
  48988. function getUrl (path) {
  48989. var href = window.location.href;
  48990. var i = href.indexOf('#');
  48991. var base = i >= 0 ? href.slice(0, i) : href;
  48992. return (base + "#" + path)
  48993. }
  48994. function pushHash (path) {
  48995. if (supportsPushState) {
  48996. pushState(getUrl(path));
  48997. } else {
  48998. window.location.hash = path;
  48999. }
  49000. }
  49001. function replaceHash (path) {
  49002. if (supportsPushState) {
  49003. replaceState(getUrl(path));
  49004. } else {
  49005. window.location.replace(getUrl(path));
  49006. }
  49007. }
  49008. /* */
  49009. var AbstractHistory = /*@__PURE__*/(function (History) {
  49010. function AbstractHistory (router, base) {
  49011. History.call(this, router, base);
  49012. this.stack = [];
  49013. this.index = -1;
  49014. }
  49015. if ( History ) AbstractHistory.__proto__ = History;
  49016. AbstractHistory.prototype = Object.create( History && History.prototype );
  49017. AbstractHistory.prototype.constructor = AbstractHistory;
  49018. AbstractHistory.prototype.push = function push (location, onComplete, onAbort) {
  49019. var this$1 = this;
  49020. this.transitionTo(
  49021. location,
  49022. function (route) {
  49023. this$1.stack = this$1.stack.slice(0, this$1.index + 1).concat(route);
  49024. this$1.index++;
  49025. onComplete && onComplete(route);
  49026. },
  49027. onAbort
  49028. );
  49029. };
  49030. AbstractHistory.prototype.replace = function replace (location, onComplete, onAbort) {
  49031. var this$1 = this;
  49032. this.transitionTo(
  49033. location,
  49034. function (route) {
  49035. this$1.stack = this$1.stack.slice(0, this$1.index).concat(route);
  49036. onComplete && onComplete(route);
  49037. },
  49038. onAbort
  49039. );
  49040. };
  49041. AbstractHistory.prototype.go = function go (n) {
  49042. var this$1 = this;
  49043. var targetIndex = this.index + n;
  49044. if (targetIndex < 0 || targetIndex >= this.stack.length) {
  49045. return
  49046. }
  49047. var route = this.stack[targetIndex];
  49048. this.confirmTransition(
  49049. route,
  49050. function () {
  49051. this$1.index = targetIndex;
  49052. this$1.updateRoute(route);
  49053. },
  49054. function (err) {
  49055. if (isExtendedError(NavigationDuplicated, err)) {
  49056. this$1.index = targetIndex;
  49057. }
  49058. }
  49059. );
  49060. };
  49061. AbstractHistory.prototype.getCurrentLocation = function getCurrentLocation () {
  49062. var current = this.stack[this.stack.length - 1];
  49063. return current ? current.fullPath : '/'
  49064. };
  49065. AbstractHistory.prototype.ensureURL = function ensureURL () {
  49066. // noop
  49067. };
  49068. return AbstractHistory;
  49069. }(History));
  49070. /* */
  49071. var VueRouter = function VueRouter (options) {
  49072. if ( options === void 0 ) options = {};
  49073. this.app = null;
  49074. this.apps = [];
  49075. this.options = options;
  49076. this.beforeHooks = [];
  49077. this.resolveHooks = [];
  49078. this.afterHooks = [];
  49079. this.matcher = createMatcher(options.routes || [], this);
  49080. var mode = options.mode || 'hash';
  49081. this.fallback = mode === 'history' && !supportsPushState && options.fallback !== false;
  49082. if (this.fallback) {
  49083. mode = 'hash';
  49084. }
  49085. if (!inBrowser) {
  49086. mode = 'abstract';
  49087. }
  49088. this.mode = mode;
  49089. switch (mode) {
  49090. case 'history':
  49091. this.history = new HTML5History(this, options.base);
  49092. break
  49093. case 'hash':
  49094. this.history = new HashHistory(this, options.base, this.fallback);
  49095. break
  49096. case 'abstract':
  49097. this.history = new AbstractHistory(this, options.base);
  49098. break
  49099. default:
  49100. if (true) {
  49101. assert(false, ("invalid mode: " + mode));
  49102. }
  49103. }
  49104. };
  49105. var prototypeAccessors = { currentRoute: { configurable: true } };
  49106. VueRouter.prototype.match = function match (
  49107. raw,
  49108. current,
  49109. redirectedFrom
  49110. ) {
  49111. return this.matcher.match(raw, current, redirectedFrom)
  49112. };
  49113. prototypeAccessors.currentRoute.get = function () {
  49114. return this.history && this.history.current
  49115. };
  49116. VueRouter.prototype.init = function init (app /* Vue component instance */) {
  49117. var this$1 = this;
  49118. true && assert(
  49119. install.installed,
  49120. "not installed. Make sure to call `Vue.use(VueRouter)` " +
  49121. "before creating root instance."
  49122. );
  49123. this.apps.push(app);
  49124. // set up app destroyed handler
  49125. // https://github.com/vuejs/vue-router/issues/2639
  49126. app.$once('hook:destroyed', function () {
  49127. // clean out app from this.apps array once destroyed
  49128. var index = this$1.apps.indexOf(app);
  49129. if (index > -1) { this$1.apps.splice(index, 1); }
  49130. // ensure we still have a main app or null if no apps
  49131. // we do not release the router so it can be reused
  49132. if (this$1.app === app) { this$1.app = this$1.apps[0] || null; }
  49133. });
  49134. // main app previously initialized
  49135. // return as we don't need to set up new history listener
  49136. if (this.app) {
  49137. return
  49138. }
  49139. this.app = app;
  49140. var history = this.history;
  49141. if (history instanceof HTML5History) {
  49142. history.transitionTo(history.getCurrentLocation());
  49143. } else if (history instanceof HashHistory) {
  49144. var setupHashListener = function () {
  49145. history.setupListeners();
  49146. };
  49147. history.transitionTo(
  49148. history.getCurrentLocation(),
  49149. setupHashListener,
  49150. setupHashListener
  49151. );
  49152. }
  49153. history.listen(function (route) {
  49154. this$1.apps.forEach(function (app) {
  49155. app._route = route;
  49156. });
  49157. });
  49158. };
  49159. VueRouter.prototype.beforeEach = function beforeEach (fn) {
  49160. return registerHook(this.beforeHooks, fn)
  49161. };
  49162. VueRouter.prototype.beforeResolve = function beforeResolve (fn) {
  49163. return registerHook(this.resolveHooks, fn)
  49164. };
  49165. VueRouter.prototype.afterEach = function afterEach (fn) {
  49166. return registerHook(this.afterHooks, fn)
  49167. };
  49168. VueRouter.prototype.onReady = function onReady (cb, errorCb) {
  49169. this.history.onReady(cb, errorCb);
  49170. };
  49171. VueRouter.prototype.onError = function onError (errorCb) {
  49172. this.history.onError(errorCb);
  49173. };
  49174. VueRouter.prototype.push = function push (location, onComplete, onAbort) {
  49175. var this$1 = this;
  49176. // $flow-disable-line
  49177. if (!onComplete && !onAbort && typeof Promise !== 'undefined') {
  49178. return new Promise(function (resolve, reject) {
  49179. this$1.history.push(location, resolve, reject);
  49180. })
  49181. } else {
  49182. this.history.push(location, onComplete, onAbort);
  49183. }
  49184. };
  49185. VueRouter.prototype.replace = function replace (location, onComplete, onAbort) {
  49186. var this$1 = this;
  49187. // $flow-disable-line
  49188. if (!onComplete && !onAbort && typeof Promise !== 'undefined') {
  49189. return new Promise(function (resolve, reject) {
  49190. this$1.history.replace(location, resolve, reject);
  49191. })
  49192. } else {
  49193. this.history.replace(location, onComplete, onAbort);
  49194. }
  49195. };
  49196. VueRouter.prototype.go = function go (n) {
  49197. this.history.go(n);
  49198. };
  49199. VueRouter.prototype.back = function back () {
  49200. this.go(-1);
  49201. };
  49202. VueRouter.prototype.forward = function forward () {
  49203. this.go(1);
  49204. };
  49205. VueRouter.prototype.getMatchedComponents = function getMatchedComponents (to) {
  49206. var route = to
  49207. ? to.matched
  49208. ? to
  49209. : this.resolve(to).route
  49210. : this.currentRoute;
  49211. if (!route) {
  49212. return []
  49213. }
  49214. return [].concat.apply([], route.matched.map(function (m) {
  49215. return Object.keys(m.components).map(function (key) {
  49216. return m.components[key]
  49217. })
  49218. }))
  49219. };
  49220. VueRouter.prototype.resolve = function resolve (
  49221. to,
  49222. current,
  49223. append
  49224. ) {
  49225. current = current || this.history.current;
  49226. var location = normalizeLocation(
  49227. to,
  49228. current,
  49229. append,
  49230. this
  49231. );
  49232. var route = this.match(location, current);
  49233. var fullPath = route.redirectedFrom || route.fullPath;
  49234. var base = this.history.base;
  49235. var href = createHref(base, fullPath, this.mode);
  49236. return {
  49237. location: location,
  49238. route: route,
  49239. href: href,
  49240. // for backwards compat
  49241. normalizedTo: location,
  49242. resolved: route
  49243. }
  49244. };
  49245. VueRouter.prototype.addRoutes = function addRoutes (routes) {
  49246. this.matcher.addRoutes(routes);
  49247. if (this.history.current !== START) {
  49248. this.history.transitionTo(this.history.getCurrentLocation());
  49249. }
  49250. };
  49251. Object.defineProperties( VueRouter.prototype, prototypeAccessors );
  49252. function registerHook (list, fn) {
  49253. list.push(fn);
  49254. return function () {
  49255. var i = list.indexOf(fn);
  49256. if (i > -1) { list.splice(i, 1); }
  49257. }
  49258. }
  49259. function createHref (base, fullPath, mode) {
  49260. var path = mode === 'hash' ? '#' + fullPath : fullPath;
  49261. return base ? cleanPath(base + '/' + path) : path
  49262. }
  49263. VueRouter.install = install;
  49264. VueRouter.version = '3.1.6';
  49265. if (inBrowser && window.Vue) {
  49266. window.Vue.use(VueRouter);
  49267. }
  49268. /* harmony default export */ __webpack_exports__["default"] = (VueRouter);
  49269. /***/ }),
  49270. /***/ "./node_modules/vue/dist/vue.common.dev.js":
  49271. /*!*************************************************!*\
  49272. !*** ./node_modules/vue/dist/vue.common.dev.js ***!
  49273. \*************************************************/
  49274. /*! no static exports found */
  49275. /***/ (function(module, exports, __webpack_require__) {
  49276. "use strict";
  49277. /* WEBPACK VAR INJECTION */(function(global, setImmediate) {/*!
  49278. * Vue.js v2.6.11
  49279. * (c) 2014-2019 Evan You
  49280. * Released under the MIT License.
  49281. */
  49282. /* */
  49283. var emptyObject = Object.freeze({});
  49284. // These helpers produce better VM code in JS engines due to their
  49285. // explicitness and function inlining.
  49286. function isUndef (v) {
  49287. return v === undefined || v === null
  49288. }
  49289. function isDef (v) {
  49290. return v !== undefined && v !== null
  49291. }
  49292. function isTrue (v) {
  49293. return v === true
  49294. }
  49295. function isFalse (v) {
  49296. return v === false
  49297. }
  49298. /**
  49299. * Check if value is primitive.
  49300. */
  49301. function isPrimitive (value) {
  49302. return (
  49303. typeof value === 'string' ||
  49304. typeof value === 'number' ||
  49305. // $flow-disable-line
  49306. typeof value === 'symbol' ||
  49307. typeof value === 'boolean'
  49308. )
  49309. }
  49310. /**
  49311. * Quick object check - this is primarily used to tell
  49312. * Objects from primitive values when we know the value
  49313. * is a JSON-compliant type.
  49314. */
  49315. function isObject (obj) {
  49316. return obj !== null && typeof obj === 'object'
  49317. }
  49318. /**
  49319. * Get the raw type string of a value, e.g., [object Object].
  49320. */
  49321. var _toString = Object.prototype.toString;
  49322. function toRawType (value) {
  49323. return _toString.call(value).slice(8, -1)
  49324. }
  49325. /**
  49326. * Strict object type check. Only returns true
  49327. * for plain JavaScript objects.
  49328. */
  49329. function isPlainObject (obj) {
  49330. return _toString.call(obj) === '[object Object]'
  49331. }
  49332. function isRegExp (v) {
  49333. return _toString.call(v) === '[object RegExp]'
  49334. }
  49335. /**
  49336. * Check if val is a valid array index.
  49337. */
  49338. function isValidArrayIndex (val) {
  49339. var n = parseFloat(String(val));
  49340. return n >= 0 && Math.floor(n) === n && isFinite(val)
  49341. }
  49342. function isPromise (val) {
  49343. return (
  49344. isDef(val) &&
  49345. typeof val.then === 'function' &&
  49346. typeof val.catch === 'function'
  49347. )
  49348. }
  49349. /**
  49350. * Convert a value to a string that is actually rendered.
  49351. */
  49352. function toString (val) {
  49353. return val == null
  49354. ? ''
  49355. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  49356. ? JSON.stringify(val, null, 2)
  49357. : String(val)
  49358. }
  49359. /**
  49360. * Convert an input value to a number for persistence.
  49361. * If the conversion fails, return original string.
  49362. */
  49363. function toNumber (val) {
  49364. var n = parseFloat(val);
  49365. return isNaN(n) ? val : n
  49366. }
  49367. /**
  49368. * Make a map and return a function for checking if a key
  49369. * is in that map.
  49370. */
  49371. function makeMap (
  49372. str,
  49373. expectsLowerCase
  49374. ) {
  49375. var map = Object.create(null);
  49376. var list = str.split(',');
  49377. for (var i = 0; i < list.length; i++) {
  49378. map[list[i]] = true;
  49379. }
  49380. return expectsLowerCase
  49381. ? function (val) { return map[val.toLowerCase()]; }
  49382. : function (val) { return map[val]; }
  49383. }
  49384. /**
  49385. * Check if a tag is a built-in tag.
  49386. */
  49387. var isBuiltInTag = makeMap('slot,component', true);
  49388. /**
  49389. * Check if an attribute is a reserved attribute.
  49390. */
  49391. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  49392. /**
  49393. * Remove an item from an array.
  49394. */
  49395. function remove (arr, item) {
  49396. if (arr.length) {
  49397. var index = arr.indexOf(item);
  49398. if (index > -1) {
  49399. return arr.splice(index, 1)
  49400. }
  49401. }
  49402. }
  49403. /**
  49404. * Check whether an object has the property.
  49405. */
  49406. var hasOwnProperty = Object.prototype.hasOwnProperty;
  49407. function hasOwn (obj, key) {
  49408. return hasOwnProperty.call(obj, key)
  49409. }
  49410. /**
  49411. * Create a cached version of a pure function.
  49412. */
  49413. function cached (fn) {
  49414. var cache = Object.create(null);
  49415. return (function cachedFn (str) {
  49416. var hit = cache[str];
  49417. return hit || (cache[str] = fn(str))
  49418. })
  49419. }
  49420. /**
  49421. * Camelize a hyphen-delimited string.
  49422. */
  49423. var camelizeRE = /-(\w)/g;
  49424. var camelize = cached(function (str) {
  49425. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  49426. });
  49427. /**
  49428. * Capitalize a string.
  49429. */
  49430. var capitalize = cached(function (str) {
  49431. return str.charAt(0).toUpperCase() + str.slice(1)
  49432. });
  49433. /**
  49434. * Hyphenate a camelCase string.
  49435. */
  49436. var hyphenateRE = /\B([A-Z])/g;
  49437. var hyphenate = cached(function (str) {
  49438. return str.replace(hyphenateRE, '-$1').toLowerCase()
  49439. });
  49440. /**
  49441. * Simple bind polyfill for environments that do not support it,
  49442. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  49443. * since native bind is now performant enough in most browsers.
  49444. * But removing it would mean breaking code that was able to run in
  49445. * PhantomJS 1.x, so this must be kept for backward compatibility.
  49446. */
  49447. /* istanbul ignore next */
  49448. function polyfillBind (fn, ctx) {
  49449. function boundFn (a) {
  49450. var l = arguments.length;
  49451. return l
  49452. ? l > 1
  49453. ? fn.apply(ctx, arguments)
  49454. : fn.call(ctx, a)
  49455. : fn.call(ctx)
  49456. }
  49457. boundFn._length = fn.length;
  49458. return boundFn
  49459. }
  49460. function nativeBind (fn, ctx) {
  49461. return fn.bind(ctx)
  49462. }
  49463. var bind = Function.prototype.bind
  49464. ? nativeBind
  49465. : polyfillBind;
  49466. /**
  49467. * Convert an Array-like object to a real Array.
  49468. */
  49469. function toArray (list, start) {
  49470. start = start || 0;
  49471. var i = list.length - start;
  49472. var ret = new Array(i);
  49473. while (i--) {
  49474. ret[i] = list[i + start];
  49475. }
  49476. return ret
  49477. }
  49478. /**
  49479. * Mix properties into target object.
  49480. */
  49481. function extend (to, _from) {
  49482. for (var key in _from) {
  49483. to[key] = _from[key];
  49484. }
  49485. return to
  49486. }
  49487. /**
  49488. * Merge an Array of Objects into a single Object.
  49489. */
  49490. function toObject (arr) {
  49491. var res = {};
  49492. for (var i = 0; i < arr.length; i++) {
  49493. if (arr[i]) {
  49494. extend(res, arr[i]);
  49495. }
  49496. }
  49497. return res
  49498. }
  49499. /* eslint-disable no-unused-vars */
  49500. /**
  49501. * Perform no operation.
  49502. * Stubbing args to make Flow happy without leaving useless transpiled code
  49503. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  49504. */
  49505. function noop (a, b, c) {}
  49506. /**
  49507. * Always return false.
  49508. */
  49509. var no = function (a, b, c) { return false; };
  49510. /* eslint-enable no-unused-vars */
  49511. /**
  49512. * Return the same value.
  49513. */
  49514. var identity = function (_) { return _; };
  49515. /**
  49516. * Generate a string containing static keys from compiler modules.
  49517. */
  49518. function genStaticKeys (modules) {
  49519. return modules.reduce(function (keys, m) {
  49520. return keys.concat(m.staticKeys || [])
  49521. }, []).join(',')
  49522. }
  49523. /**
  49524. * Check if two values are loosely equal - that is,
  49525. * if they are plain objects, do they have the same shape?
  49526. */
  49527. function looseEqual (a, b) {
  49528. if (a === b) { return true }
  49529. var isObjectA = isObject(a);
  49530. var isObjectB = isObject(b);
  49531. if (isObjectA && isObjectB) {
  49532. try {
  49533. var isArrayA = Array.isArray(a);
  49534. var isArrayB = Array.isArray(b);
  49535. if (isArrayA && isArrayB) {
  49536. return a.length === b.length && a.every(function (e, i) {
  49537. return looseEqual(e, b[i])
  49538. })
  49539. } else if (a instanceof Date && b instanceof Date) {
  49540. return a.getTime() === b.getTime()
  49541. } else if (!isArrayA && !isArrayB) {
  49542. var keysA = Object.keys(a);
  49543. var keysB = Object.keys(b);
  49544. return keysA.length === keysB.length && keysA.every(function (key) {
  49545. return looseEqual(a[key], b[key])
  49546. })
  49547. } else {
  49548. /* istanbul ignore next */
  49549. return false
  49550. }
  49551. } catch (e) {
  49552. /* istanbul ignore next */
  49553. return false
  49554. }
  49555. } else if (!isObjectA && !isObjectB) {
  49556. return String(a) === String(b)
  49557. } else {
  49558. return false
  49559. }
  49560. }
  49561. /**
  49562. * Return the first index at which a loosely equal value can be
  49563. * found in the array (if value is a plain object, the array must
  49564. * contain an object of the same shape), or -1 if it is not present.
  49565. */
  49566. function looseIndexOf (arr, val) {
  49567. for (var i = 0; i < arr.length; i++) {
  49568. if (looseEqual(arr[i], val)) { return i }
  49569. }
  49570. return -1
  49571. }
  49572. /**
  49573. * Ensure a function is called only once.
  49574. */
  49575. function once (fn) {
  49576. var called = false;
  49577. return function () {
  49578. if (!called) {
  49579. called = true;
  49580. fn.apply(this, arguments);
  49581. }
  49582. }
  49583. }
  49584. var SSR_ATTR = 'data-server-rendered';
  49585. var ASSET_TYPES = [
  49586. 'component',
  49587. 'directive',
  49588. 'filter'
  49589. ];
  49590. var LIFECYCLE_HOOKS = [
  49591. 'beforeCreate',
  49592. 'created',
  49593. 'beforeMount',
  49594. 'mounted',
  49595. 'beforeUpdate',
  49596. 'updated',
  49597. 'beforeDestroy',
  49598. 'destroyed',
  49599. 'activated',
  49600. 'deactivated',
  49601. 'errorCaptured',
  49602. 'serverPrefetch'
  49603. ];
  49604. /* */
  49605. var config = ({
  49606. /**
  49607. * Option merge strategies (used in core/util/options)
  49608. */
  49609. // $flow-disable-line
  49610. optionMergeStrategies: Object.create(null),
  49611. /**
  49612. * Whether to suppress warnings.
  49613. */
  49614. silent: false,
  49615. /**
  49616. * Show production mode tip message on boot?
  49617. */
  49618. productionTip: "development" !== 'production',
  49619. /**
  49620. * Whether to enable devtools
  49621. */
  49622. devtools: "development" !== 'production',
  49623. /**
  49624. * Whether to record perf
  49625. */
  49626. performance: false,
  49627. /**
  49628. * Error handler for watcher errors
  49629. */
  49630. errorHandler: null,
  49631. /**
  49632. * Warn handler for watcher warns
  49633. */
  49634. warnHandler: null,
  49635. /**
  49636. * Ignore certain custom elements
  49637. */
  49638. ignoredElements: [],
  49639. /**
  49640. * Custom user key aliases for v-on
  49641. */
  49642. // $flow-disable-line
  49643. keyCodes: Object.create(null),
  49644. /**
  49645. * Check if a tag is reserved so that it cannot be registered as a
  49646. * component. This is platform-dependent and may be overwritten.
  49647. */
  49648. isReservedTag: no,
  49649. /**
  49650. * Check if an attribute is reserved so that it cannot be used as a component
  49651. * prop. This is platform-dependent and may be overwritten.
  49652. */
  49653. isReservedAttr: no,
  49654. /**
  49655. * Check if a tag is an unknown element.
  49656. * Platform-dependent.
  49657. */
  49658. isUnknownElement: no,
  49659. /**
  49660. * Get the namespace of an element
  49661. */
  49662. getTagNamespace: noop,
  49663. /**
  49664. * Parse the real tag name for the specific platform.
  49665. */
  49666. parsePlatformTagName: identity,
  49667. /**
  49668. * Check if an attribute must be bound using property, e.g. value
  49669. * Platform-dependent.
  49670. */
  49671. mustUseProp: no,
  49672. /**
  49673. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  49674. * This will significantly reduce performance if set to false.
  49675. */
  49676. async: true,
  49677. /**
  49678. * Exposed for legacy reasons
  49679. */
  49680. _lifecycleHooks: LIFECYCLE_HOOKS
  49681. });
  49682. /* */
  49683. /**
  49684. * unicode letters used for parsing html tags, component names and property paths.
  49685. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  49686. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  49687. */
  49688. var unicodeRegExp = /a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;
  49689. /**
  49690. * Check if a string starts with $ or _
  49691. */
  49692. function isReserved (str) {
  49693. var c = (str + '').charCodeAt(0);
  49694. return c === 0x24 || c === 0x5F
  49695. }
  49696. /**
  49697. * Define a property.
  49698. */
  49699. function def (obj, key, val, enumerable) {
  49700. Object.defineProperty(obj, key, {
  49701. value: val,
  49702. enumerable: !!enumerable,
  49703. writable: true,
  49704. configurable: true
  49705. });
  49706. }
  49707. /**
  49708. * Parse simple path.
  49709. */
  49710. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  49711. function parsePath (path) {
  49712. if (bailRE.test(path)) {
  49713. return
  49714. }
  49715. var segments = path.split('.');
  49716. return function (obj) {
  49717. for (var i = 0; i < segments.length; i++) {
  49718. if (!obj) { return }
  49719. obj = obj[segments[i]];
  49720. }
  49721. return obj
  49722. }
  49723. }
  49724. /* */
  49725. // can we use __proto__?
  49726. var hasProto = '__proto__' in {};
  49727. // Browser environment sniffing
  49728. var inBrowser = typeof window !== 'undefined';
  49729. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  49730. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  49731. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  49732. var isIE = UA && /msie|trident/.test(UA);
  49733. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  49734. var isEdge = UA && UA.indexOf('edge/') > 0;
  49735. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  49736. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  49737. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  49738. var isPhantomJS = UA && /phantomjs/.test(UA);
  49739. var isFF = UA && UA.match(/firefox\/(\d+)/);
  49740. // Firefox has a "watch" function on Object.prototype...
  49741. var nativeWatch = ({}).watch;
  49742. var supportsPassive = false;
  49743. if (inBrowser) {
  49744. try {
  49745. var opts = {};
  49746. Object.defineProperty(opts, 'passive', ({
  49747. get: function get () {
  49748. /* istanbul ignore next */
  49749. supportsPassive = true;
  49750. }
  49751. })); // https://github.com/facebook/flow/issues/285
  49752. window.addEventListener('test-passive', null, opts);
  49753. } catch (e) {}
  49754. }
  49755. // this needs to be lazy-evaled because vue may be required before
  49756. // vue-server-renderer can set VUE_ENV
  49757. var _isServer;
  49758. var isServerRendering = function () {
  49759. if (_isServer === undefined) {
  49760. /* istanbul ignore if */
  49761. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  49762. // detect presence of vue-server-renderer and avoid
  49763. // Webpack shimming the process
  49764. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  49765. } else {
  49766. _isServer = false;
  49767. }
  49768. }
  49769. return _isServer
  49770. };
  49771. // detect devtools
  49772. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  49773. /* istanbul ignore next */
  49774. function isNative (Ctor) {
  49775. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  49776. }
  49777. var hasSymbol =
  49778. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  49779. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  49780. var _Set;
  49781. /* istanbul ignore if */ // $flow-disable-line
  49782. if (typeof Set !== 'undefined' && isNative(Set)) {
  49783. // use native Set when available.
  49784. _Set = Set;
  49785. } else {
  49786. // a non-standard Set polyfill that only works with primitive keys.
  49787. _Set = /*@__PURE__*/(function () {
  49788. function Set () {
  49789. this.set = Object.create(null);
  49790. }
  49791. Set.prototype.has = function has (key) {
  49792. return this.set[key] === true
  49793. };
  49794. Set.prototype.add = function add (key) {
  49795. this.set[key] = true;
  49796. };
  49797. Set.prototype.clear = function clear () {
  49798. this.set = Object.create(null);
  49799. };
  49800. return Set;
  49801. }());
  49802. }
  49803. /* */
  49804. var warn = noop;
  49805. var tip = noop;
  49806. var generateComponentTrace = (noop); // work around flow check
  49807. var formatComponentName = (noop);
  49808. {
  49809. var hasConsole = typeof console !== 'undefined';
  49810. var classifyRE = /(?:^|[-_])(\w)/g;
  49811. var classify = function (str) { return str
  49812. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  49813. .replace(/[-_]/g, ''); };
  49814. warn = function (msg, vm) {
  49815. var trace = vm ? generateComponentTrace(vm) : '';
  49816. if (config.warnHandler) {
  49817. config.warnHandler.call(null, msg, vm, trace);
  49818. } else if (hasConsole && (!config.silent)) {
  49819. console.error(("[Vue warn]: " + msg + trace));
  49820. }
  49821. };
  49822. tip = function (msg, vm) {
  49823. if (hasConsole && (!config.silent)) {
  49824. console.warn("[Vue tip]: " + msg + (
  49825. vm ? generateComponentTrace(vm) : ''
  49826. ));
  49827. }
  49828. };
  49829. formatComponentName = function (vm, includeFile) {
  49830. if (vm.$root === vm) {
  49831. return '<Root>'
  49832. }
  49833. var options = typeof vm === 'function' && vm.cid != null
  49834. ? vm.options
  49835. : vm._isVue
  49836. ? vm.$options || vm.constructor.options
  49837. : vm;
  49838. var name = options.name || options._componentTag;
  49839. var file = options.__file;
  49840. if (!name && file) {
  49841. var match = file.match(/([^/\\]+)\.vue$/);
  49842. name = match && match[1];
  49843. }
  49844. return (
  49845. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  49846. (file && includeFile !== false ? (" at " + file) : '')
  49847. )
  49848. };
  49849. var repeat = function (str, n) {
  49850. var res = '';
  49851. while (n) {
  49852. if (n % 2 === 1) { res += str; }
  49853. if (n > 1) { str += str; }
  49854. n >>= 1;
  49855. }
  49856. return res
  49857. };
  49858. generateComponentTrace = function (vm) {
  49859. if (vm._isVue && vm.$parent) {
  49860. var tree = [];
  49861. var currentRecursiveSequence = 0;
  49862. while (vm) {
  49863. if (tree.length > 0) {
  49864. var last = tree[tree.length - 1];
  49865. if (last.constructor === vm.constructor) {
  49866. currentRecursiveSequence++;
  49867. vm = vm.$parent;
  49868. continue
  49869. } else if (currentRecursiveSequence > 0) {
  49870. tree[tree.length - 1] = [last, currentRecursiveSequence];
  49871. currentRecursiveSequence = 0;
  49872. }
  49873. }
  49874. tree.push(vm);
  49875. vm = vm.$parent;
  49876. }
  49877. return '\n\nfound in\n\n' + tree
  49878. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  49879. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  49880. : formatComponentName(vm))); })
  49881. .join('\n')
  49882. } else {
  49883. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  49884. }
  49885. };
  49886. }
  49887. /* */
  49888. var uid = 0;
  49889. /**
  49890. * A dep is an observable that can have multiple
  49891. * directives subscribing to it.
  49892. */
  49893. var Dep = function Dep () {
  49894. this.id = uid++;
  49895. this.subs = [];
  49896. };
  49897. Dep.prototype.addSub = function addSub (sub) {
  49898. this.subs.push(sub);
  49899. };
  49900. Dep.prototype.removeSub = function removeSub (sub) {
  49901. remove(this.subs, sub);
  49902. };
  49903. Dep.prototype.depend = function depend () {
  49904. if (Dep.target) {
  49905. Dep.target.addDep(this);
  49906. }
  49907. };
  49908. Dep.prototype.notify = function notify () {
  49909. // stabilize the subscriber list first
  49910. var subs = this.subs.slice();
  49911. if (!config.async) {
  49912. // subs aren't sorted in scheduler if not running async
  49913. // we need to sort them now to make sure they fire in correct
  49914. // order
  49915. subs.sort(function (a, b) { return a.id - b.id; });
  49916. }
  49917. for (var i = 0, l = subs.length; i < l; i++) {
  49918. subs[i].update();
  49919. }
  49920. };
  49921. // The current target watcher being evaluated.
  49922. // This is globally unique because only one watcher
  49923. // can be evaluated at a time.
  49924. Dep.target = null;
  49925. var targetStack = [];
  49926. function pushTarget (target) {
  49927. targetStack.push(target);
  49928. Dep.target = target;
  49929. }
  49930. function popTarget () {
  49931. targetStack.pop();
  49932. Dep.target = targetStack[targetStack.length - 1];
  49933. }
  49934. /* */
  49935. var VNode = function VNode (
  49936. tag,
  49937. data,
  49938. children,
  49939. text,
  49940. elm,
  49941. context,
  49942. componentOptions,
  49943. asyncFactory
  49944. ) {
  49945. this.tag = tag;
  49946. this.data = data;
  49947. this.children = children;
  49948. this.text = text;
  49949. this.elm = elm;
  49950. this.ns = undefined;
  49951. this.context = context;
  49952. this.fnContext = undefined;
  49953. this.fnOptions = undefined;
  49954. this.fnScopeId = undefined;
  49955. this.key = data && data.key;
  49956. this.componentOptions = componentOptions;
  49957. this.componentInstance = undefined;
  49958. this.parent = undefined;
  49959. this.raw = false;
  49960. this.isStatic = false;
  49961. this.isRootInsert = true;
  49962. this.isComment = false;
  49963. this.isCloned = false;
  49964. this.isOnce = false;
  49965. this.asyncFactory = asyncFactory;
  49966. this.asyncMeta = undefined;
  49967. this.isAsyncPlaceholder = false;
  49968. };
  49969. var prototypeAccessors = { child: { configurable: true } };
  49970. // DEPRECATED: alias for componentInstance for backwards compat.
  49971. /* istanbul ignore next */
  49972. prototypeAccessors.child.get = function () {
  49973. return this.componentInstance
  49974. };
  49975. Object.defineProperties( VNode.prototype, prototypeAccessors );
  49976. var createEmptyVNode = function (text) {
  49977. if ( text === void 0 ) text = '';
  49978. var node = new VNode();
  49979. node.text = text;
  49980. node.isComment = true;
  49981. return node
  49982. };
  49983. function createTextVNode (val) {
  49984. return new VNode(undefined, undefined, undefined, String(val))
  49985. }
  49986. // optimized shallow clone
  49987. // used for static nodes and slot nodes because they may be reused across
  49988. // multiple renders, cloning them avoids errors when DOM manipulations rely
  49989. // on their elm reference.
  49990. function cloneVNode (vnode) {
  49991. var cloned = new VNode(
  49992. vnode.tag,
  49993. vnode.data,
  49994. // #7975
  49995. // clone children array to avoid mutating original in case of cloning
  49996. // a child.
  49997. vnode.children && vnode.children.slice(),
  49998. vnode.text,
  49999. vnode.elm,
  50000. vnode.context,
  50001. vnode.componentOptions,
  50002. vnode.asyncFactory
  50003. );
  50004. cloned.ns = vnode.ns;
  50005. cloned.isStatic = vnode.isStatic;
  50006. cloned.key = vnode.key;
  50007. cloned.isComment = vnode.isComment;
  50008. cloned.fnContext = vnode.fnContext;
  50009. cloned.fnOptions = vnode.fnOptions;
  50010. cloned.fnScopeId = vnode.fnScopeId;
  50011. cloned.asyncMeta = vnode.asyncMeta;
  50012. cloned.isCloned = true;
  50013. return cloned
  50014. }
  50015. /*
  50016. * not type checking this file because flow doesn't play well with
  50017. * dynamically accessing methods on Array prototype
  50018. */
  50019. var arrayProto = Array.prototype;
  50020. var arrayMethods = Object.create(arrayProto);
  50021. var methodsToPatch = [
  50022. 'push',
  50023. 'pop',
  50024. 'shift',
  50025. 'unshift',
  50026. 'splice',
  50027. 'sort',
  50028. 'reverse'
  50029. ];
  50030. /**
  50031. * Intercept mutating methods and emit events
  50032. */
  50033. methodsToPatch.forEach(function (method) {
  50034. // cache original method
  50035. var original = arrayProto[method];
  50036. def(arrayMethods, method, function mutator () {
  50037. var args = [], len = arguments.length;
  50038. while ( len-- ) args[ len ] = arguments[ len ];
  50039. var result = original.apply(this, args);
  50040. var ob = this.__ob__;
  50041. var inserted;
  50042. switch (method) {
  50043. case 'push':
  50044. case 'unshift':
  50045. inserted = args;
  50046. break
  50047. case 'splice':
  50048. inserted = args.slice(2);
  50049. break
  50050. }
  50051. if (inserted) { ob.observeArray(inserted); }
  50052. // notify change
  50053. ob.dep.notify();
  50054. return result
  50055. });
  50056. });
  50057. /* */
  50058. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  50059. /**
  50060. * In some cases we may want to disable observation inside a component's
  50061. * update computation.
  50062. */
  50063. var shouldObserve = true;
  50064. function toggleObserving (value) {
  50065. shouldObserve = value;
  50066. }
  50067. /**
  50068. * Observer class that is attached to each observed
  50069. * object. Once attached, the observer converts the target
  50070. * object's property keys into getter/setters that
  50071. * collect dependencies and dispatch updates.
  50072. */
  50073. var Observer = function Observer (value) {
  50074. this.value = value;
  50075. this.dep = new Dep();
  50076. this.vmCount = 0;
  50077. def(value, '__ob__', this);
  50078. if (Array.isArray(value)) {
  50079. if (hasProto) {
  50080. protoAugment(value, arrayMethods);
  50081. } else {
  50082. copyAugment(value, arrayMethods, arrayKeys);
  50083. }
  50084. this.observeArray(value);
  50085. } else {
  50086. this.walk(value);
  50087. }
  50088. };
  50089. /**
  50090. * Walk through all properties and convert them into
  50091. * getter/setters. This method should only be called when
  50092. * value type is Object.
  50093. */
  50094. Observer.prototype.walk = function walk (obj) {
  50095. var keys = Object.keys(obj);
  50096. for (var i = 0; i < keys.length; i++) {
  50097. defineReactive$$1(obj, keys[i]);
  50098. }
  50099. };
  50100. /**
  50101. * Observe a list of Array items.
  50102. */
  50103. Observer.prototype.observeArray = function observeArray (items) {
  50104. for (var i = 0, l = items.length; i < l; i++) {
  50105. observe(items[i]);
  50106. }
  50107. };
  50108. // helpers
  50109. /**
  50110. * Augment a target Object or Array by intercepting
  50111. * the prototype chain using __proto__
  50112. */
  50113. function protoAugment (target, src) {
  50114. /* eslint-disable no-proto */
  50115. target.__proto__ = src;
  50116. /* eslint-enable no-proto */
  50117. }
  50118. /**
  50119. * Augment a target Object or Array by defining
  50120. * hidden properties.
  50121. */
  50122. /* istanbul ignore next */
  50123. function copyAugment (target, src, keys) {
  50124. for (var i = 0, l = keys.length; i < l; i++) {
  50125. var key = keys[i];
  50126. def(target, key, src[key]);
  50127. }
  50128. }
  50129. /**
  50130. * Attempt to create an observer instance for a value,
  50131. * returns the new observer if successfully observed,
  50132. * or the existing observer if the value already has one.
  50133. */
  50134. function observe (value, asRootData) {
  50135. if (!isObject(value) || value instanceof VNode) {
  50136. return
  50137. }
  50138. var ob;
  50139. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  50140. ob = value.__ob__;
  50141. } else if (
  50142. shouldObserve &&
  50143. !isServerRendering() &&
  50144. (Array.isArray(value) || isPlainObject(value)) &&
  50145. Object.isExtensible(value) &&
  50146. !value._isVue
  50147. ) {
  50148. ob = new Observer(value);
  50149. }
  50150. if (asRootData && ob) {
  50151. ob.vmCount++;
  50152. }
  50153. return ob
  50154. }
  50155. /**
  50156. * Define a reactive property on an Object.
  50157. */
  50158. function defineReactive$$1 (
  50159. obj,
  50160. key,
  50161. val,
  50162. customSetter,
  50163. shallow
  50164. ) {
  50165. var dep = new Dep();
  50166. var property = Object.getOwnPropertyDescriptor(obj, key);
  50167. if (property && property.configurable === false) {
  50168. return
  50169. }
  50170. // cater for pre-defined getter/setters
  50171. var getter = property && property.get;
  50172. var setter = property && property.set;
  50173. if ((!getter || setter) && arguments.length === 2) {
  50174. val = obj[key];
  50175. }
  50176. var childOb = !shallow && observe(val);
  50177. Object.defineProperty(obj, key, {
  50178. enumerable: true,
  50179. configurable: true,
  50180. get: function reactiveGetter () {
  50181. var value = getter ? getter.call(obj) : val;
  50182. if (Dep.target) {
  50183. dep.depend();
  50184. if (childOb) {
  50185. childOb.dep.depend();
  50186. if (Array.isArray(value)) {
  50187. dependArray(value);
  50188. }
  50189. }
  50190. }
  50191. return value
  50192. },
  50193. set: function reactiveSetter (newVal) {
  50194. var value = getter ? getter.call(obj) : val;
  50195. /* eslint-disable no-self-compare */
  50196. if (newVal === value || (newVal !== newVal && value !== value)) {
  50197. return
  50198. }
  50199. /* eslint-enable no-self-compare */
  50200. if (customSetter) {
  50201. customSetter();
  50202. }
  50203. // #7981: for accessor properties without setter
  50204. if (getter && !setter) { return }
  50205. if (setter) {
  50206. setter.call(obj, newVal);
  50207. } else {
  50208. val = newVal;
  50209. }
  50210. childOb = !shallow && observe(newVal);
  50211. dep.notify();
  50212. }
  50213. });
  50214. }
  50215. /**
  50216. * Set a property on an object. Adds the new property and
  50217. * triggers change notification if the property doesn't
  50218. * already exist.
  50219. */
  50220. function set (target, key, val) {
  50221. if (isUndef(target) || isPrimitive(target)
  50222. ) {
  50223. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  50224. }
  50225. if (Array.isArray(target) && isValidArrayIndex(key)) {
  50226. target.length = Math.max(target.length, key);
  50227. target.splice(key, 1, val);
  50228. return val
  50229. }
  50230. if (key in target && !(key in Object.prototype)) {
  50231. target[key] = val;
  50232. return val
  50233. }
  50234. var ob = (target).__ob__;
  50235. if (target._isVue || (ob && ob.vmCount)) {
  50236. warn(
  50237. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  50238. 'at runtime - declare it upfront in the data option.'
  50239. );
  50240. return val
  50241. }
  50242. if (!ob) {
  50243. target[key] = val;
  50244. return val
  50245. }
  50246. defineReactive$$1(ob.value, key, val);
  50247. ob.dep.notify();
  50248. return val
  50249. }
  50250. /**
  50251. * Delete a property and trigger change if necessary.
  50252. */
  50253. function del (target, key) {
  50254. if (isUndef(target) || isPrimitive(target)
  50255. ) {
  50256. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  50257. }
  50258. if (Array.isArray(target) && isValidArrayIndex(key)) {
  50259. target.splice(key, 1);
  50260. return
  50261. }
  50262. var ob = (target).__ob__;
  50263. if (target._isVue || (ob && ob.vmCount)) {
  50264. warn(
  50265. 'Avoid deleting properties on a Vue instance or its root $data ' +
  50266. '- just set it to null.'
  50267. );
  50268. return
  50269. }
  50270. if (!hasOwn(target, key)) {
  50271. return
  50272. }
  50273. delete target[key];
  50274. if (!ob) {
  50275. return
  50276. }
  50277. ob.dep.notify();
  50278. }
  50279. /**
  50280. * Collect dependencies on array elements when the array is touched, since
  50281. * we cannot intercept array element access like property getters.
  50282. */
  50283. function dependArray (value) {
  50284. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  50285. e = value[i];
  50286. e && e.__ob__ && e.__ob__.dep.depend();
  50287. if (Array.isArray(e)) {
  50288. dependArray(e);
  50289. }
  50290. }
  50291. }
  50292. /* */
  50293. /**
  50294. * Option overwriting strategies are functions that handle
  50295. * how to merge a parent option value and a child option
  50296. * value into the final value.
  50297. */
  50298. var strats = config.optionMergeStrategies;
  50299. /**
  50300. * Options with restrictions
  50301. */
  50302. {
  50303. strats.el = strats.propsData = function (parent, child, vm, key) {
  50304. if (!vm) {
  50305. warn(
  50306. "option \"" + key + "\" can only be used during instance " +
  50307. 'creation with the `new` keyword.'
  50308. );
  50309. }
  50310. return defaultStrat(parent, child)
  50311. };
  50312. }
  50313. /**
  50314. * Helper that recursively merges two data objects together.
  50315. */
  50316. function mergeData (to, from) {
  50317. if (!from) { return to }
  50318. var key, toVal, fromVal;
  50319. var keys = hasSymbol
  50320. ? Reflect.ownKeys(from)
  50321. : Object.keys(from);
  50322. for (var i = 0; i < keys.length; i++) {
  50323. key = keys[i];
  50324. // in case the object is already observed...
  50325. if (key === '__ob__') { continue }
  50326. toVal = to[key];
  50327. fromVal = from[key];
  50328. if (!hasOwn(to, key)) {
  50329. set(to, key, fromVal);
  50330. } else if (
  50331. toVal !== fromVal &&
  50332. isPlainObject(toVal) &&
  50333. isPlainObject(fromVal)
  50334. ) {
  50335. mergeData(toVal, fromVal);
  50336. }
  50337. }
  50338. return to
  50339. }
  50340. /**
  50341. * Data
  50342. */
  50343. function mergeDataOrFn (
  50344. parentVal,
  50345. childVal,
  50346. vm
  50347. ) {
  50348. if (!vm) {
  50349. // in a Vue.extend merge, both should be functions
  50350. if (!childVal) {
  50351. return parentVal
  50352. }
  50353. if (!parentVal) {
  50354. return childVal
  50355. }
  50356. // when parentVal & childVal are both present,
  50357. // we need to return a function that returns the
  50358. // merged result of both functions... no need to
  50359. // check if parentVal is a function here because
  50360. // it has to be a function to pass previous merges.
  50361. return function mergedDataFn () {
  50362. return mergeData(
  50363. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  50364. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  50365. )
  50366. }
  50367. } else {
  50368. return function mergedInstanceDataFn () {
  50369. // instance merge
  50370. var instanceData = typeof childVal === 'function'
  50371. ? childVal.call(vm, vm)
  50372. : childVal;
  50373. var defaultData = typeof parentVal === 'function'
  50374. ? parentVal.call(vm, vm)
  50375. : parentVal;
  50376. if (instanceData) {
  50377. return mergeData(instanceData, defaultData)
  50378. } else {
  50379. return defaultData
  50380. }
  50381. }
  50382. }
  50383. }
  50384. strats.data = function (
  50385. parentVal,
  50386. childVal,
  50387. vm
  50388. ) {
  50389. if (!vm) {
  50390. if (childVal && typeof childVal !== 'function') {
  50391. warn(
  50392. 'The "data" option should be a function ' +
  50393. 'that returns a per-instance value in component ' +
  50394. 'definitions.',
  50395. vm
  50396. );
  50397. return parentVal
  50398. }
  50399. return mergeDataOrFn(parentVal, childVal)
  50400. }
  50401. return mergeDataOrFn(parentVal, childVal, vm)
  50402. };
  50403. /**
  50404. * Hooks and props are merged as arrays.
  50405. */
  50406. function mergeHook (
  50407. parentVal,
  50408. childVal
  50409. ) {
  50410. var res = childVal
  50411. ? parentVal
  50412. ? parentVal.concat(childVal)
  50413. : Array.isArray(childVal)
  50414. ? childVal
  50415. : [childVal]
  50416. : parentVal;
  50417. return res
  50418. ? dedupeHooks(res)
  50419. : res
  50420. }
  50421. function dedupeHooks (hooks) {
  50422. var res = [];
  50423. for (var i = 0; i < hooks.length; i++) {
  50424. if (res.indexOf(hooks[i]) === -1) {
  50425. res.push(hooks[i]);
  50426. }
  50427. }
  50428. return res
  50429. }
  50430. LIFECYCLE_HOOKS.forEach(function (hook) {
  50431. strats[hook] = mergeHook;
  50432. });
  50433. /**
  50434. * Assets
  50435. *
  50436. * When a vm is present (instance creation), we need to do
  50437. * a three-way merge between constructor options, instance
  50438. * options and parent options.
  50439. */
  50440. function mergeAssets (
  50441. parentVal,
  50442. childVal,
  50443. vm,
  50444. key
  50445. ) {
  50446. var res = Object.create(parentVal || null);
  50447. if (childVal) {
  50448. assertObjectType(key, childVal, vm);
  50449. return extend(res, childVal)
  50450. } else {
  50451. return res
  50452. }
  50453. }
  50454. ASSET_TYPES.forEach(function (type) {
  50455. strats[type + 's'] = mergeAssets;
  50456. });
  50457. /**
  50458. * Watchers.
  50459. *
  50460. * Watchers hashes should not overwrite one
  50461. * another, so we merge them as arrays.
  50462. */
  50463. strats.watch = function (
  50464. parentVal,
  50465. childVal,
  50466. vm,
  50467. key
  50468. ) {
  50469. // work around Firefox's Object.prototype.watch...
  50470. if (parentVal === nativeWatch) { parentVal = undefined; }
  50471. if (childVal === nativeWatch) { childVal = undefined; }
  50472. /* istanbul ignore if */
  50473. if (!childVal) { return Object.create(parentVal || null) }
  50474. {
  50475. assertObjectType(key, childVal, vm);
  50476. }
  50477. if (!parentVal) { return childVal }
  50478. var ret = {};
  50479. extend(ret, parentVal);
  50480. for (var key$1 in childVal) {
  50481. var parent = ret[key$1];
  50482. var child = childVal[key$1];
  50483. if (parent && !Array.isArray(parent)) {
  50484. parent = [parent];
  50485. }
  50486. ret[key$1] = parent
  50487. ? parent.concat(child)
  50488. : Array.isArray(child) ? child : [child];
  50489. }
  50490. return ret
  50491. };
  50492. /**
  50493. * Other object hashes.
  50494. */
  50495. strats.props =
  50496. strats.methods =
  50497. strats.inject =
  50498. strats.computed = function (
  50499. parentVal,
  50500. childVal,
  50501. vm,
  50502. key
  50503. ) {
  50504. if (childVal && "development" !== 'production') {
  50505. assertObjectType(key, childVal, vm);
  50506. }
  50507. if (!parentVal) { return childVal }
  50508. var ret = Object.create(null);
  50509. extend(ret, parentVal);
  50510. if (childVal) { extend(ret, childVal); }
  50511. return ret
  50512. };
  50513. strats.provide = mergeDataOrFn;
  50514. /**
  50515. * Default strategy.
  50516. */
  50517. var defaultStrat = function (parentVal, childVal) {
  50518. return childVal === undefined
  50519. ? parentVal
  50520. : childVal
  50521. };
  50522. /**
  50523. * Validate component names
  50524. */
  50525. function checkComponents (options) {
  50526. for (var key in options.components) {
  50527. validateComponentName(key);
  50528. }
  50529. }
  50530. function validateComponentName (name) {
  50531. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  50532. warn(
  50533. 'Invalid component name: "' + name + '". Component names ' +
  50534. 'should conform to valid custom element name in html5 specification.'
  50535. );
  50536. }
  50537. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  50538. warn(
  50539. 'Do not use built-in or reserved HTML elements as component ' +
  50540. 'id: ' + name
  50541. );
  50542. }
  50543. }
  50544. /**
  50545. * Ensure all props option syntax are normalized into the
  50546. * Object-based format.
  50547. */
  50548. function normalizeProps (options, vm) {
  50549. var props = options.props;
  50550. if (!props) { return }
  50551. var res = {};
  50552. var i, val, name;
  50553. if (Array.isArray(props)) {
  50554. i = props.length;
  50555. while (i--) {
  50556. val = props[i];
  50557. if (typeof val === 'string') {
  50558. name = camelize(val);
  50559. res[name] = { type: null };
  50560. } else {
  50561. warn('props must be strings when using array syntax.');
  50562. }
  50563. }
  50564. } else if (isPlainObject(props)) {
  50565. for (var key in props) {
  50566. val = props[key];
  50567. name = camelize(key);
  50568. res[name] = isPlainObject(val)
  50569. ? val
  50570. : { type: val };
  50571. }
  50572. } else {
  50573. warn(
  50574. "Invalid value for option \"props\": expected an Array or an Object, " +
  50575. "but got " + (toRawType(props)) + ".",
  50576. vm
  50577. );
  50578. }
  50579. options.props = res;
  50580. }
  50581. /**
  50582. * Normalize all injections into Object-based format
  50583. */
  50584. function normalizeInject (options, vm) {
  50585. var inject = options.inject;
  50586. if (!inject) { return }
  50587. var normalized = options.inject = {};
  50588. if (Array.isArray(inject)) {
  50589. for (var i = 0; i < inject.length; i++) {
  50590. normalized[inject[i]] = { from: inject[i] };
  50591. }
  50592. } else if (isPlainObject(inject)) {
  50593. for (var key in inject) {
  50594. var val = inject[key];
  50595. normalized[key] = isPlainObject(val)
  50596. ? extend({ from: key }, val)
  50597. : { from: val };
  50598. }
  50599. } else {
  50600. warn(
  50601. "Invalid value for option \"inject\": expected an Array or an Object, " +
  50602. "but got " + (toRawType(inject)) + ".",
  50603. vm
  50604. );
  50605. }
  50606. }
  50607. /**
  50608. * Normalize raw function directives into object format.
  50609. */
  50610. function normalizeDirectives (options) {
  50611. var dirs = options.directives;
  50612. if (dirs) {
  50613. for (var key in dirs) {
  50614. var def$$1 = dirs[key];
  50615. if (typeof def$$1 === 'function') {
  50616. dirs[key] = { bind: def$$1, update: def$$1 };
  50617. }
  50618. }
  50619. }
  50620. }
  50621. function assertObjectType (name, value, vm) {
  50622. if (!isPlainObject(value)) {
  50623. warn(
  50624. "Invalid value for option \"" + name + "\": expected an Object, " +
  50625. "but got " + (toRawType(value)) + ".",
  50626. vm
  50627. );
  50628. }
  50629. }
  50630. /**
  50631. * Merge two option objects into a new one.
  50632. * Core utility used in both instantiation and inheritance.
  50633. */
  50634. function mergeOptions (
  50635. parent,
  50636. child,
  50637. vm
  50638. ) {
  50639. {
  50640. checkComponents(child);
  50641. }
  50642. if (typeof child === 'function') {
  50643. child = child.options;
  50644. }
  50645. normalizeProps(child, vm);
  50646. normalizeInject(child, vm);
  50647. normalizeDirectives(child);
  50648. // Apply extends and mixins on the child options,
  50649. // but only if it is a raw options object that isn't
  50650. // the result of another mergeOptions call.
  50651. // Only merged options has the _base property.
  50652. if (!child._base) {
  50653. if (child.extends) {
  50654. parent = mergeOptions(parent, child.extends, vm);
  50655. }
  50656. if (child.mixins) {
  50657. for (var i = 0, l = child.mixins.length; i < l; i++) {
  50658. parent = mergeOptions(parent, child.mixins[i], vm);
  50659. }
  50660. }
  50661. }
  50662. var options = {};
  50663. var key;
  50664. for (key in parent) {
  50665. mergeField(key);
  50666. }
  50667. for (key in child) {
  50668. if (!hasOwn(parent, key)) {
  50669. mergeField(key);
  50670. }
  50671. }
  50672. function mergeField (key) {
  50673. var strat = strats[key] || defaultStrat;
  50674. options[key] = strat(parent[key], child[key], vm, key);
  50675. }
  50676. return options
  50677. }
  50678. /**
  50679. * Resolve an asset.
  50680. * This function is used because child instances need access
  50681. * to assets defined in its ancestor chain.
  50682. */
  50683. function resolveAsset (
  50684. options,
  50685. type,
  50686. id,
  50687. warnMissing
  50688. ) {
  50689. /* istanbul ignore if */
  50690. if (typeof id !== 'string') {
  50691. return
  50692. }
  50693. var assets = options[type];
  50694. // check local registration variations first
  50695. if (hasOwn(assets, id)) { return assets[id] }
  50696. var camelizedId = camelize(id);
  50697. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  50698. var PascalCaseId = capitalize(camelizedId);
  50699. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  50700. // fallback to prototype chain
  50701. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  50702. if (warnMissing && !res) {
  50703. warn(
  50704. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  50705. options
  50706. );
  50707. }
  50708. return res
  50709. }
  50710. /* */
  50711. function validateProp (
  50712. key,
  50713. propOptions,
  50714. propsData,
  50715. vm
  50716. ) {
  50717. var prop = propOptions[key];
  50718. var absent = !hasOwn(propsData, key);
  50719. var value = propsData[key];
  50720. // boolean casting
  50721. var booleanIndex = getTypeIndex(Boolean, prop.type);
  50722. if (booleanIndex > -1) {
  50723. if (absent && !hasOwn(prop, 'default')) {
  50724. value = false;
  50725. } else if (value === '' || value === hyphenate(key)) {
  50726. // only cast empty string / same name to boolean if
  50727. // boolean has higher priority
  50728. var stringIndex = getTypeIndex(String, prop.type);
  50729. if (stringIndex < 0 || booleanIndex < stringIndex) {
  50730. value = true;
  50731. }
  50732. }
  50733. }
  50734. // check default value
  50735. if (value === undefined) {
  50736. value = getPropDefaultValue(vm, prop, key);
  50737. // since the default value is a fresh copy,
  50738. // make sure to observe it.
  50739. var prevShouldObserve = shouldObserve;
  50740. toggleObserving(true);
  50741. observe(value);
  50742. toggleObserving(prevShouldObserve);
  50743. }
  50744. {
  50745. assertProp(prop, key, value, vm, absent);
  50746. }
  50747. return value
  50748. }
  50749. /**
  50750. * Get the default value of a prop.
  50751. */
  50752. function getPropDefaultValue (vm, prop, key) {
  50753. // no default, return undefined
  50754. if (!hasOwn(prop, 'default')) {
  50755. return undefined
  50756. }
  50757. var def = prop.default;
  50758. // warn against non-factory defaults for Object & Array
  50759. if (isObject(def)) {
  50760. warn(
  50761. 'Invalid default value for prop "' + key + '": ' +
  50762. 'Props with type Object/Array must use a factory function ' +
  50763. 'to return the default value.',
  50764. vm
  50765. );
  50766. }
  50767. // the raw prop value was also undefined from previous render,
  50768. // return previous default value to avoid unnecessary watcher trigger
  50769. if (vm && vm.$options.propsData &&
  50770. vm.$options.propsData[key] === undefined &&
  50771. vm._props[key] !== undefined
  50772. ) {
  50773. return vm._props[key]
  50774. }
  50775. // call factory function for non-Function types
  50776. // a value is Function if its prototype is function even across different execution context
  50777. return typeof def === 'function' && getType(prop.type) !== 'Function'
  50778. ? def.call(vm)
  50779. : def
  50780. }
  50781. /**
  50782. * Assert whether a prop is valid.
  50783. */
  50784. function assertProp (
  50785. prop,
  50786. name,
  50787. value,
  50788. vm,
  50789. absent
  50790. ) {
  50791. if (prop.required && absent) {
  50792. warn(
  50793. 'Missing required prop: "' + name + '"',
  50794. vm
  50795. );
  50796. return
  50797. }
  50798. if (value == null && !prop.required) {
  50799. return
  50800. }
  50801. var type = prop.type;
  50802. var valid = !type || type === true;
  50803. var expectedTypes = [];
  50804. if (type) {
  50805. if (!Array.isArray(type)) {
  50806. type = [type];
  50807. }
  50808. for (var i = 0; i < type.length && !valid; i++) {
  50809. var assertedType = assertType(value, type[i]);
  50810. expectedTypes.push(assertedType.expectedType || '');
  50811. valid = assertedType.valid;
  50812. }
  50813. }
  50814. if (!valid) {
  50815. warn(
  50816. getInvalidTypeMessage(name, value, expectedTypes),
  50817. vm
  50818. );
  50819. return
  50820. }
  50821. var validator = prop.validator;
  50822. if (validator) {
  50823. if (!validator(value)) {
  50824. warn(
  50825. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  50826. vm
  50827. );
  50828. }
  50829. }
  50830. }
  50831. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  50832. function assertType (value, type) {
  50833. var valid;
  50834. var expectedType = getType(type);
  50835. if (simpleCheckRE.test(expectedType)) {
  50836. var t = typeof value;
  50837. valid = t === expectedType.toLowerCase();
  50838. // for primitive wrapper objects
  50839. if (!valid && t === 'object') {
  50840. valid = value instanceof type;
  50841. }
  50842. } else if (expectedType === 'Object') {
  50843. valid = isPlainObject(value);
  50844. } else if (expectedType === 'Array') {
  50845. valid = Array.isArray(value);
  50846. } else {
  50847. valid = value instanceof type;
  50848. }
  50849. return {
  50850. valid: valid,
  50851. expectedType: expectedType
  50852. }
  50853. }
  50854. /**
  50855. * Use function string name to check built-in types,
  50856. * because a simple equality check will fail when running
  50857. * across different vms / iframes.
  50858. */
  50859. function getType (fn) {
  50860. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  50861. return match ? match[1] : ''
  50862. }
  50863. function isSameType (a, b) {
  50864. return getType(a) === getType(b)
  50865. }
  50866. function getTypeIndex (type, expectedTypes) {
  50867. if (!Array.isArray(expectedTypes)) {
  50868. return isSameType(expectedTypes, type) ? 0 : -1
  50869. }
  50870. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  50871. if (isSameType(expectedTypes[i], type)) {
  50872. return i
  50873. }
  50874. }
  50875. return -1
  50876. }
  50877. function getInvalidTypeMessage (name, value, expectedTypes) {
  50878. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  50879. " Expected " + (expectedTypes.map(capitalize).join(', '));
  50880. var expectedType = expectedTypes[0];
  50881. var receivedType = toRawType(value);
  50882. var expectedValue = styleValue(value, expectedType);
  50883. var receivedValue = styleValue(value, receivedType);
  50884. // check if we need to specify expected value
  50885. if (expectedTypes.length === 1 &&
  50886. isExplicable(expectedType) &&
  50887. !isBoolean(expectedType, receivedType)) {
  50888. message += " with value " + expectedValue;
  50889. }
  50890. message += ", got " + receivedType + " ";
  50891. // check if we need to specify received value
  50892. if (isExplicable(receivedType)) {
  50893. message += "with value " + receivedValue + ".";
  50894. }
  50895. return message
  50896. }
  50897. function styleValue (value, type) {
  50898. if (type === 'String') {
  50899. return ("\"" + value + "\"")
  50900. } else if (type === 'Number') {
  50901. return ("" + (Number(value)))
  50902. } else {
  50903. return ("" + value)
  50904. }
  50905. }
  50906. function isExplicable (value) {
  50907. var explicitTypes = ['string', 'number', 'boolean'];
  50908. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  50909. }
  50910. function isBoolean () {
  50911. var args = [], len = arguments.length;
  50912. while ( len-- ) args[ len ] = arguments[ len ];
  50913. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  50914. }
  50915. /* */
  50916. function handleError (err, vm, info) {
  50917. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  50918. // See: https://github.com/vuejs/vuex/issues/1505
  50919. pushTarget();
  50920. try {
  50921. if (vm) {
  50922. var cur = vm;
  50923. while ((cur = cur.$parent)) {
  50924. var hooks = cur.$options.errorCaptured;
  50925. if (hooks) {
  50926. for (var i = 0; i < hooks.length; i++) {
  50927. try {
  50928. var capture = hooks[i].call(cur, err, vm, info) === false;
  50929. if (capture) { return }
  50930. } catch (e) {
  50931. globalHandleError(e, cur, 'errorCaptured hook');
  50932. }
  50933. }
  50934. }
  50935. }
  50936. }
  50937. globalHandleError(err, vm, info);
  50938. } finally {
  50939. popTarget();
  50940. }
  50941. }
  50942. function invokeWithErrorHandling (
  50943. handler,
  50944. context,
  50945. args,
  50946. vm,
  50947. info
  50948. ) {
  50949. var res;
  50950. try {
  50951. res = args ? handler.apply(context, args) : handler.call(context);
  50952. if (res && !res._isVue && isPromise(res) && !res._handled) {
  50953. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  50954. // issue #9511
  50955. // avoid catch triggering multiple times when nested calls
  50956. res._handled = true;
  50957. }
  50958. } catch (e) {
  50959. handleError(e, vm, info);
  50960. }
  50961. return res
  50962. }
  50963. function globalHandleError (err, vm, info) {
  50964. if (config.errorHandler) {
  50965. try {
  50966. return config.errorHandler.call(null, err, vm, info)
  50967. } catch (e) {
  50968. // if the user intentionally throws the original error in the handler,
  50969. // do not log it twice
  50970. if (e !== err) {
  50971. logError(e, null, 'config.errorHandler');
  50972. }
  50973. }
  50974. }
  50975. logError(err, vm, info);
  50976. }
  50977. function logError (err, vm, info) {
  50978. {
  50979. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  50980. }
  50981. /* istanbul ignore else */
  50982. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  50983. console.error(err);
  50984. } else {
  50985. throw err
  50986. }
  50987. }
  50988. /* */
  50989. var isUsingMicroTask = false;
  50990. var callbacks = [];
  50991. var pending = false;
  50992. function flushCallbacks () {
  50993. pending = false;
  50994. var copies = callbacks.slice(0);
  50995. callbacks.length = 0;
  50996. for (var i = 0; i < copies.length; i++) {
  50997. copies[i]();
  50998. }
  50999. }
  51000. // Here we have async deferring wrappers using microtasks.
  51001. // In 2.5 we used (macro) tasks (in combination with microtasks).
  51002. // However, it has subtle problems when state is changed right before repaint
  51003. // (e.g. #6813, out-in transitions).
  51004. // Also, using (macro) tasks in event handler would cause some weird behaviors
  51005. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  51006. // So we now use microtasks everywhere, again.
  51007. // A major drawback of this tradeoff is that there are some scenarios
  51008. // where microtasks have too high a priority and fire in between supposedly
  51009. // sequential events (e.g. #4521, #6690, which have workarounds)
  51010. // or even between bubbling of the same event (#6566).
  51011. var timerFunc;
  51012. // The nextTick behavior leverages the microtask queue, which can be accessed
  51013. // via either native Promise.then or MutationObserver.
  51014. // MutationObserver has wider support, however it is seriously bugged in
  51015. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  51016. // completely stops working after triggering a few times... so, if native
  51017. // Promise is available, we will use it:
  51018. /* istanbul ignore next, $flow-disable-line */
  51019. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  51020. var p = Promise.resolve();
  51021. timerFunc = function () {
  51022. p.then(flushCallbacks);
  51023. // In problematic UIWebViews, Promise.then doesn't completely break, but
  51024. // it can get stuck in a weird state where callbacks are pushed into the
  51025. // microtask queue but the queue isn't being flushed, until the browser
  51026. // needs to do some other work, e.g. handle a timer. Therefore we can
  51027. // "force" the microtask queue to be flushed by adding an empty timer.
  51028. if (isIOS) { setTimeout(noop); }
  51029. };
  51030. isUsingMicroTask = true;
  51031. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  51032. isNative(MutationObserver) ||
  51033. // PhantomJS and iOS 7.x
  51034. MutationObserver.toString() === '[object MutationObserverConstructor]'
  51035. )) {
  51036. // Use MutationObserver where native Promise is not available,
  51037. // e.g. PhantomJS, iOS7, Android 4.4
  51038. // (#6466 MutationObserver is unreliable in IE11)
  51039. var counter = 1;
  51040. var observer = new MutationObserver(flushCallbacks);
  51041. var textNode = document.createTextNode(String(counter));
  51042. observer.observe(textNode, {
  51043. characterData: true
  51044. });
  51045. timerFunc = function () {
  51046. counter = (counter + 1) % 2;
  51047. textNode.data = String(counter);
  51048. };
  51049. isUsingMicroTask = true;
  51050. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  51051. // Fallback to setImmediate.
  51052. // Technically it leverages the (macro) task queue,
  51053. // but it is still a better choice than setTimeout.
  51054. timerFunc = function () {
  51055. setImmediate(flushCallbacks);
  51056. };
  51057. } else {
  51058. // Fallback to setTimeout.
  51059. timerFunc = function () {
  51060. setTimeout(flushCallbacks, 0);
  51061. };
  51062. }
  51063. function nextTick (cb, ctx) {
  51064. var _resolve;
  51065. callbacks.push(function () {
  51066. if (cb) {
  51067. try {
  51068. cb.call(ctx);
  51069. } catch (e) {
  51070. handleError(e, ctx, 'nextTick');
  51071. }
  51072. } else if (_resolve) {
  51073. _resolve(ctx);
  51074. }
  51075. });
  51076. if (!pending) {
  51077. pending = true;
  51078. timerFunc();
  51079. }
  51080. // $flow-disable-line
  51081. if (!cb && typeof Promise !== 'undefined') {
  51082. return new Promise(function (resolve) {
  51083. _resolve = resolve;
  51084. })
  51085. }
  51086. }
  51087. /* */
  51088. var mark;
  51089. var measure;
  51090. {
  51091. var perf = inBrowser && window.performance;
  51092. /* istanbul ignore if */
  51093. if (
  51094. perf &&
  51095. perf.mark &&
  51096. perf.measure &&
  51097. perf.clearMarks &&
  51098. perf.clearMeasures
  51099. ) {
  51100. mark = function (tag) { return perf.mark(tag); };
  51101. measure = function (name, startTag, endTag) {
  51102. perf.measure(name, startTag, endTag);
  51103. perf.clearMarks(startTag);
  51104. perf.clearMarks(endTag);
  51105. // perf.clearMeasures(name)
  51106. };
  51107. }
  51108. }
  51109. /* not type checking this file because flow doesn't play well with Proxy */
  51110. var initProxy;
  51111. {
  51112. var allowedGlobals = makeMap(
  51113. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  51114. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  51115. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  51116. 'require' // for Webpack/Browserify
  51117. );
  51118. var warnNonPresent = function (target, key) {
  51119. warn(
  51120. "Property or method \"" + key + "\" is not defined on the instance but " +
  51121. 'referenced during render. Make sure that this property is reactive, ' +
  51122. 'either in the data option, or for class-based components, by ' +
  51123. 'initializing the property. ' +
  51124. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  51125. target
  51126. );
  51127. };
  51128. var warnReservedPrefix = function (target, key) {
  51129. warn(
  51130. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  51131. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  51132. 'prevent conflicts with Vue internals. ' +
  51133. 'See: https://vuejs.org/v2/api/#data',
  51134. target
  51135. );
  51136. };
  51137. var hasProxy =
  51138. typeof Proxy !== 'undefined' && isNative(Proxy);
  51139. if (hasProxy) {
  51140. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  51141. config.keyCodes = new Proxy(config.keyCodes, {
  51142. set: function set (target, key, value) {
  51143. if (isBuiltInModifier(key)) {
  51144. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  51145. return false
  51146. } else {
  51147. target[key] = value;
  51148. return true
  51149. }
  51150. }
  51151. });
  51152. }
  51153. var hasHandler = {
  51154. has: function has (target, key) {
  51155. var has = key in target;
  51156. var isAllowed = allowedGlobals(key) ||
  51157. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  51158. if (!has && !isAllowed) {
  51159. if (key in target.$data) { warnReservedPrefix(target, key); }
  51160. else { warnNonPresent(target, key); }
  51161. }
  51162. return has || !isAllowed
  51163. }
  51164. };
  51165. var getHandler = {
  51166. get: function get (target, key) {
  51167. if (typeof key === 'string' && !(key in target)) {
  51168. if (key in target.$data) { warnReservedPrefix(target, key); }
  51169. else { warnNonPresent(target, key); }
  51170. }
  51171. return target[key]
  51172. }
  51173. };
  51174. initProxy = function initProxy (vm) {
  51175. if (hasProxy) {
  51176. // determine which proxy handler to use
  51177. var options = vm.$options;
  51178. var handlers = options.render && options.render._withStripped
  51179. ? getHandler
  51180. : hasHandler;
  51181. vm._renderProxy = new Proxy(vm, handlers);
  51182. } else {
  51183. vm._renderProxy = vm;
  51184. }
  51185. };
  51186. }
  51187. /* */
  51188. var seenObjects = new _Set();
  51189. /**
  51190. * Recursively traverse an object to evoke all converted
  51191. * getters, so that every nested property inside the object
  51192. * is collected as a "deep" dependency.
  51193. */
  51194. function traverse (val) {
  51195. _traverse(val, seenObjects);
  51196. seenObjects.clear();
  51197. }
  51198. function _traverse (val, seen) {
  51199. var i, keys;
  51200. var isA = Array.isArray(val);
  51201. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  51202. return
  51203. }
  51204. if (val.__ob__) {
  51205. var depId = val.__ob__.dep.id;
  51206. if (seen.has(depId)) {
  51207. return
  51208. }
  51209. seen.add(depId);
  51210. }
  51211. if (isA) {
  51212. i = val.length;
  51213. while (i--) { _traverse(val[i], seen); }
  51214. } else {
  51215. keys = Object.keys(val);
  51216. i = keys.length;
  51217. while (i--) { _traverse(val[keys[i]], seen); }
  51218. }
  51219. }
  51220. /* */
  51221. var normalizeEvent = cached(function (name) {
  51222. var passive = name.charAt(0) === '&';
  51223. name = passive ? name.slice(1) : name;
  51224. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  51225. name = once$$1 ? name.slice(1) : name;
  51226. var capture = name.charAt(0) === '!';
  51227. name = capture ? name.slice(1) : name;
  51228. return {
  51229. name: name,
  51230. once: once$$1,
  51231. capture: capture,
  51232. passive: passive
  51233. }
  51234. });
  51235. function createFnInvoker (fns, vm) {
  51236. function invoker () {
  51237. var arguments$1 = arguments;
  51238. var fns = invoker.fns;
  51239. if (Array.isArray(fns)) {
  51240. var cloned = fns.slice();
  51241. for (var i = 0; i < cloned.length; i++) {
  51242. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  51243. }
  51244. } else {
  51245. // return handler return value for single handlers
  51246. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  51247. }
  51248. }
  51249. invoker.fns = fns;
  51250. return invoker
  51251. }
  51252. function updateListeners (
  51253. on,
  51254. oldOn,
  51255. add,
  51256. remove$$1,
  51257. createOnceHandler,
  51258. vm
  51259. ) {
  51260. var name, def$$1, cur, old, event;
  51261. for (name in on) {
  51262. def$$1 = cur = on[name];
  51263. old = oldOn[name];
  51264. event = normalizeEvent(name);
  51265. if (isUndef(cur)) {
  51266. warn(
  51267. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  51268. vm
  51269. );
  51270. } else if (isUndef(old)) {
  51271. if (isUndef(cur.fns)) {
  51272. cur = on[name] = createFnInvoker(cur, vm);
  51273. }
  51274. if (isTrue(event.once)) {
  51275. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  51276. }
  51277. add(event.name, cur, event.capture, event.passive, event.params);
  51278. } else if (cur !== old) {
  51279. old.fns = cur;
  51280. on[name] = old;
  51281. }
  51282. }
  51283. for (name in oldOn) {
  51284. if (isUndef(on[name])) {
  51285. event = normalizeEvent(name);
  51286. remove$$1(event.name, oldOn[name], event.capture);
  51287. }
  51288. }
  51289. }
  51290. /* */
  51291. function mergeVNodeHook (def, hookKey, hook) {
  51292. if (def instanceof VNode) {
  51293. def = def.data.hook || (def.data.hook = {});
  51294. }
  51295. var invoker;
  51296. var oldHook = def[hookKey];
  51297. function wrappedHook () {
  51298. hook.apply(this, arguments);
  51299. // important: remove merged hook to ensure it's called only once
  51300. // and prevent memory leak
  51301. remove(invoker.fns, wrappedHook);
  51302. }
  51303. if (isUndef(oldHook)) {
  51304. // no existing hook
  51305. invoker = createFnInvoker([wrappedHook]);
  51306. } else {
  51307. /* istanbul ignore if */
  51308. if (isDef(oldHook.fns) && isTrue(oldHook.merged)) {
  51309. // already a merged invoker
  51310. invoker = oldHook;
  51311. invoker.fns.push(wrappedHook);
  51312. } else {
  51313. // existing plain hook
  51314. invoker = createFnInvoker([oldHook, wrappedHook]);
  51315. }
  51316. }
  51317. invoker.merged = true;
  51318. def[hookKey] = invoker;
  51319. }
  51320. /* */
  51321. function extractPropsFromVNodeData (
  51322. data,
  51323. Ctor,
  51324. tag
  51325. ) {
  51326. // we are only extracting raw values here.
  51327. // validation and default values are handled in the child
  51328. // component itself.
  51329. var propOptions = Ctor.options.props;
  51330. if (isUndef(propOptions)) {
  51331. return
  51332. }
  51333. var res = {};
  51334. var attrs = data.attrs;
  51335. var props = data.props;
  51336. if (isDef(attrs) || isDef(props)) {
  51337. for (var key in propOptions) {
  51338. var altKey = hyphenate(key);
  51339. {
  51340. var keyInLowerCase = key.toLowerCase();
  51341. if (
  51342. key !== keyInLowerCase &&
  51343. attrs && hasOwn(attrs, keyInLowerCase)
  51344. ) {
  51345. tip(
  51346. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  51347. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  51348. " \"" + key + "\". " +
  51349. "Note that HTML attributes are case-insensitive and camelCased " +
  51350. "props need to use their kebab-case equivalents when using in-DOM " +
  51351. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  51352. );
  51353. }
  51354. }
  51355. checkProp(res, props, key, altKey, true) ||
  51356. checkProp(res, attrs, key, altKey, false);
  51357. }
  51358. }
  51359. return res
  51360. }
  51361. function checkProp (
  51362. res,
  51363. hash,
  51364. key,
  51365. altKey,
  51366. preserve
  51367. ) {
  51368. if (isDef(hash)) {
  51369. if (hasOwn(hash, key)) {
  51370. res[key] = hash[key];
  51371. if (!preserve) {
  51372. delete hash[key];
  51373. }
  51374. return true
  51375. } else if (hasOwn(hash, altKey)) {
  51376. res[key] = hash[altKey];
  51377. if (!preserve) {
  51378. delete hash[altKey];
  51379. }
  51380. return true
  51381. }
  51382. }
  51383. return false
  51384. }
  51385. /* */
  51386. // The template compiler attempts to minimize the need for normalization by
  51387. // statically analyzing the template at compile time.
  51388. //
  51389. // For plain HTML markup, normalization can be completely skipped because the
  51390. // generated render function is guaranteed to return Array<VNode>. There are
  51391. // two cases where extra normalization is needed:
  51392. // 1. When the children contains components - because a functional component
  51393. // may return an Array instead of a single root. In this case, just a simple
  51394. // normalization is needed - if any child is an Array, we flatten the whole
  51395. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  51396. // because functional components already normalize their own children.
  51397. function simpleNormalizeChildren (children) {
  51398. for (var i = 0; i < children.length; i++) {
  51399. if (Array.isArray(children[i])) {
  51400. return Array.prototype.concat.apply([], children)
  51401. }
  51402. }
  51403. return children
  51404. }
  51405. // 2. When the children contains constructs that always generated nested Arrays,
  51406. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  51407. // with hand-written render functions / JSX. In such cases a full normalization
  51408. // is needed to cater to all possible types of children values.
  51409. function normalizeChildren (children) {
  51410. return isPrimitive(children)
  51411. ? [createTextVNode(children)]
  51412. : Array.isArray(children)
  51413. ? normalizeArrayChildren(children)
  51414. : undefined
  51415. }
  51416. function isTextNode (node) {
  51417. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  51418. }
  51419. function normalizeArrayChildren (children, nestedIndex) {
  51420. var res = [];
  51421. var i, c, lastIndex, last;
  51422. for (i = 0; i < children.length; i++) {
  51423. c = children[i];
  51424. if (isUndef(c) || typeof c === 'boolean') { continue }
  51425. lastIndex = res.length - 1;
  51426. last = res[lastIndex];
  51427. // nested
  51428. if (Array.isArray(c)) {
  51429. if (c.length > 0) {
  51430. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  51431. // merge adjacent text nodes
  51432. if (isTextNode(c[0]) && isTextNode(last)) {
  51433. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  51434. c.shift();
  51435. }
  51436. res.push.apply(res, c);
  51437. }
  51438. } else if (isPrimitive(c)) {
  51439. if (isTextNode(last)) {
  51440. // merge adjacent text nodes
  51441. // this is necessary for SSR hydration because text nodes are
  51442. // essentially merged when rendered to HTML strings
  51443. res[lastIndex] = createTextVNode(last.text + c);
  51444. } else if (c !== '') {
  51445. // convert primitive to vnode
  51446. res.push(createTextVNode(c));
  51447. }
  51448. } else {
  51449. if (isTextNode(c) && isTextNode(last)) {
  51450. // merge adjacent text nodes
  51451. res[lastIndex] = createTextVNode(last.text + c.text);
  51452. } else {
  51453. // default key for nested array children (likely generated by v-for)
  51454. if (isTrue(children._isVList) &&
  51455. isDef(c.tag) &&
  51456. isUndef(c.key) &&
  51457. isDef(nestedIndex)) {
  51458. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  51459. }
  51460. res.push(c);
  51461. }
  51462. }
  51463. }
  51464. return res
  51465. }
  51466. /* */
  51467. function initProvide (vm) {
  51468. var provide = vm.$options.provide;
  51469. if (provide) {
  51470. vm._provided = typeof provide === 'function'
  51471. ? provide.call(vm)
  51472. : provide;
  51473. }
  51474. }
  51475. function initInjections (vm) {
  51476. var result = resolveInject(vm.$options.inject, vm);
  51477. if (result) {
  51478. toggleObserving(false);
  51479. Object.keys(result).forEach(function (key) {
  51480. /* istanbul ignore else */
  51481. {
  51482. defineReactive$$1(vm, key, result[key], function () {
  51483. warn(
  51484. "Avoid mutating an injected value directly since the changes will be " +
  51485. "overwritten whenever the provided component re-renders. " +
  51486. "injection being mutated: \"" + key + "\"",
  51487. vm
  51488. );
  51489. });
  51490. }
  51491. });
  51492. toggleObserving(true);
  51493. }
  51494. }
  51495. function resolveInject (inject, vm) {
  51496. if (inject) {
  51497. // inject is :any because flow is not smart enough to figure out cached
  51498. var result = Object.create(null);
  51499. var keys = hasSymbol
  51500. ? Reflect.ownKeys(inject)
  51501. : Object.keys(inject);
  51502. for (var i = 0; i < keys.length; i++) {
  51503. var key = keys[i];
  51504. // #6574 in case the inject object is observed...
  51505. if (key === '__ob__') { continue }
  51506. var provideKey = inject[key].from;
  51507. var source = vm;
  51508. while (source) {
  51509. if (source._provided && hasOwn(source._provided, provideKey)) {
  51510. result[key] = source._provided[provideKey];
  51511. break
  51512. }
  51513. source = source.$parent;
  51514. }
  51515. if (!source) {
  51516. if ('default' in inject[key]) {
  51517. var provideDefault = inject[key].default;
  51518. result[key] = typeof provideDefault === 'function'
  51519. ? provideDefault.call(vm)
  51520. : provideDefault;
  51521. } else {
  51522. warn(("Injection \"" + key + "\" not found"), vm);
  51523. }
  51524. }
  51525. }
  51526. return result
  51527. }
  51528. }
  51529. /* */
  51530. /**
  51531. * Runtime helper for resolving raw children VNodes into a slot object.
  51532. */
  51533. function resolveSlots (
  51534. children,
  51535. context
  51536. ) {
  51537. if (!children || !children.length) {
  51538. return {}
  51539. }
  51540. var slots = {};
  51541. for (var i = 0, l = children.length; i < l; i++) {
  51542. var child = children[i];
  51543. var data = child.data;
  51544. // remove slot attribute if the node is resolved as a Vue slot node
  51545. if (data && data.attrs && data.attrs.slot) {
  51546. delete data.attrs.slot;
  51547. }
  51548. // named slots should only be respected if the vnode was rendered in the
  51549. // same context.
  51550. if ((child.context === context || child.fnContext === context) &&
  51551. data && data.slot != null
  51552. ) {
  51553. var name = data.slot;
  51554. var slot = (slots[name] || (slots[name] = []));
  51555. if (child.tag === 'template') {
  51556. slot.push.apply(slot, child.children || []);
  51557. } else {
  51558. slot.push(child);
  51559. }
  51560. } else {
  51561. (slots.default || (slots.default = [])).push(child);
  51562. }
  51563. }
  51564. // ignore slots that contains only whitespace
  51565. for (var name$1 in slots) {
  51566. if (slots[name$1].every(isWhitespace)) {
  51567. delete slots[name$1];
  51568. }
  51569. }
  51570. return slots
  51571. }
  51572. function isWhitespace (node) {
  51573. return (node.isComment && !node.asyncFactory) || node.text === ' '
  51574. }
  51575. /* */
  51576. function normalizeScopedSlots (
  51577. slots,
  51578. normalSlots,
  51579. prevSlots
  51580. ) {
  51581. var res;
  51582. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  51583. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  51584. var key = slots && slots.$key;
  51585. if (!slots) {
  51586. res = {};
  51587. } else if (slots._normalized) {
  51588. // fast path 1: child component re-render only, parent did not change
  51589. return slots._normalized
  51590. } else if (
  51591. isStable &&
  51592. prevSlots &&
  51593. prevSlots !== emptyObject &&
  51594. key === prevSlots.$key &&
  51595. !hasNormalSlots &&
  51596. !prevSlots.$hasNormal
  51597. ) {
  51598. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  51599. // only need to normalize once
  51600. return prevSlots
  51601. } else {
  51602. res = {};
  51603. for (var key$1 in slots) {
  51604. if (slots[key$1] && key$1[0] !== '$') {
  51605. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  51606. }
  51607. }
  51608. }
  51609. // expose normal slots on scopedSlots
  51610. for (var key$2 in normalSlots) {
  51611. if (!(key$2 in res)) {
  51612. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  51613. }
  51614. }
  51615. // avoriaz seems to mock a non-extensible $scopedSlots object
  51616. // and when that is passed down this would cause an error
  51617. if (slots && Object.isExtensible(slots)) {
  51618. (slots)._normalized = res;
  51619. }
  51620. def(res, '$stable', isStable);
  51621. def(res, '$key', key);
  51622. def(res, '$hasNormal', hasNormalSlots);
  51623. return res
  51624. }
  51625. function normalizeScopedSlot(normalSlots, key, fn) {
  51626. var normalized = function () {
  51627. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  51628. res = res && typeof res === 'object' && !Array.isArray(res)
  51629. ? [res] // single vnode
  51630. : normalizeChildren(res);
  51631. return res && (
  51632. res.length === 0 ||
  51633. (res.length === 1 && res[0].isComment) // #9658
  51634. ) ? undefined
  51635. : res
  51636. };
  51637. // this is a slot using the new v-slot syntax without scope. although it is
  51638. // compiled as a scoped slot, render fn users would expect it to be present
  51639. // on this.$slots because the usage is semantically a normal slot.
  51640. if (fn.proxy) {
  51641. Object.defineProperty(normalSlots, key, {
  51642. get: normalized,
  51643. enumerable: true,
  51644. configurable: true
  51645. });
  51646. }
  51647. return normalized
  51648. }
  51649. function proxyNormalSlot(slots, key) {
  51650. return function () { return slots[key]; }
  51651. }
  51652. /* */
  51653. /**
  51654. * Runtime helper for rendering v-for lists.
  51655. */
  51656. function renderList (
  51657. val,
  51658. render
  51659. ) {
  51660. var ret, i, l, keys, key;
  51661. if (Array.isArray(val) || typeof val === 'string') {
  51662. ret = new Array(val.length);
  51663. for (i = 0, l = val.length; i < l; i++) {
  51664. ret[i] = render(val[i], i);
  51665. }
  51666. } else if (typeof val === 'number') {
  51667. ret = new Array(val);
  51668. for (i = 0; i < val; i++) {
  51669. ret[i] = render(i + 1, i);
  51670. }
  51671. } else if (isObject(val)) {
  51672. if (hasSymbol && val[Symbol.iterator]) {
  51673. ret = [];
  51674. var iterator = val[Symbol.iterator]();
  51675. var result = iterator.next();
  51676. while (!result.done) {
  51677. ret.push(render(result.value, ret.length));
  51678. result = iterator.next();
  51679. }
  51680. } else {
  51681. keys = Object.keys(val);
  51682. ret = new Array(keys.length);
  51683. for (i = 0, l = keys.length; i < l; i++) {
  51684. key = keys[i];
  51685. ret[i] = render(val[key], key, i);
  51686. }
  51687. }
  51688. }
  51689. if (!isDef(ret)) {
  51690. ret = [];
  51691. }
  51692. (ret)._isVList = true;
  51693. return ret
  51694. }
  51695. /* */
  51696. /**
  51697. * Runtime helper for rendering <slot>
  51698. */
  51699. function renderSlot (
  51700. name,
  51701. fallback,
  51702. props,
  51703. bindObject
  51704. ) {
  51705. var scopedSlotFn = this.$scopedSlots[name];
  51706. var nodes;
  51707. if (scopedSlotFn) { // scoped slot
  51708. props = props || {};
  51709. if (bindObject) {
  51710. if (!isObject(bindObject)) {
  51711. warn(
  51712. 'slot v-bind without argument expects an Object',
  51713. this
  51714. );
  51715. }
  51716. props = extend(extend({}, bindObject), props);
  51717. }
  51718. nodes = scopedSlotFn(props) || fallback;
  51719. } else {
  51720. nodes = this.$slots[name] || fallback;
  51721. }
  51722. var target = props && props.slot;
  51723. if (target) {
  51724. return this.$createElement('template', { slot: target }, nodes)
  51725. } else {
  51726. return nodes
  51727. }
  51728. }
  51729. /* */
  51730. /**
  51731. * Runtime helper for resolving filters
  51732. */
  51733. function resolveFilter (id) {
  51734. return resolveAsset(this.$options, 'filters', id, true) || identity
  51735. }
  51736. /* */
  51737. function isKeyNotMatch (expect, actual) {
  51738. if (Array.isArray(expect)) {
  51739. return expect.indexOf(actual) === -1
  51740. } else {
  51741. return expect !== actual
  51742. }
  51743. }
  51744. /**
  51745. * Runtime helper for checking keyCodes from config.
  51746. * exposed as Vue.prototype._k
  51747. * passing in eventKeyName as last argument separately for backwards compat
  51748. */
  51749. function checkKeyCodes (
  51750. eventKeyCode,
  51751. key,
  51752. builtInKeyCode,
  51753. eventKeyName,
  51754. builtInKeyName
  51755. ) {
  51756. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  51757. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  51758. return isKeyNotMatch(builtInKeyName, eventKeyName)
  51759. } else if (mappedKeyCode) {
  51760. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  51761. } else if (eventKeyName) {
  51762. return hyphenate(eventKeyName) !== key
  51763. }
  51764. }
  51765. /* */
  51766. /**
  51767. * Runtime helper for merging v-bind="object" into a VNode's data.
  51768. */
  51769. function bindObjectProps (
  51770. data,
  51771. tag,
  51772. value,
  51773. asProp,
  51774. isSync
  51775. ) {
  51776. if (value) {
  51777. if (!isObject(value)) {
  51778. warn(
  51779. 'v-bind without argument expects an Object or Array value',
  51780. this
  51781. );
  51782. } else {
  51783. if (Array.isArray(value)) {
  51784. value = toObject(value);
  51785. }
  51786. var hash;
  51787. var loop = function ( key ) {
  51788. if (
  51789. key === 'class' ||
  51790. key === 'style' ||
  51791. isReservedAttribute(key)
  51792. ) {
  51793. hash = data;
  51794. } else {
  51795. var type = data.attrs && data.attrs.type;
  51796. hash = asProp || config.mustUseProp(tag, type, key)
  51797. ? data.domProps || (data.domProps = {})
  51798. : data.attrs || (data.attrs = {});
  51799. }
  51800. var camelizedKey = camelize(key);
  51801. var hyphenatedKey = hyphenate(key);
  51802. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  51803. hash[key] = value[key];
  51804. if (isSync) {
  51805. var on = data.on || (data.on = {});
  51806. on[("update:" + key)] = function ($event) {
  51807. value[key] = $event;
  51808. };
  51809. }
  51810. }
  51811. };
  51812. for (var key in value) loop( key );
  51813. }
  51814. }
  51815. return data
  51816. }
  51817. /* */
  51818. /**
  51819. * Runtime helper for rendering static trees.
  51820. */
  51821. function renderStatic (
  51822. index,
  51823. isInFor
  51824. ) {
  51825. var cached = this._staticTrees || (this._staticTrees = []);
  51826. var tree = cached[index];
  51827. // if has already-rendered static tree and not inside v-for,
  51828. // we can reuse the same tree.
  51829. if (tree && !isInFor) {
  51830. return tree
  51831. }
  51832. // otherwise, render a fresh tree.
  51833. tree = cached[index] = this.$options.staticRenderFns[index].call(
  51834. this._renderProxy,
  51835. null,
  51836. this // for render fns generated for functional component templates
  51837. );
  51838. markStatic(tree, ("__static__" + index), false);
  51839. return tree
  51840. }
  51841. /**
  51842. * Runtime helper for v-once.
  51843. * Effectively it means marking the node as static with a unique key.
  51844. */
  51845. function markOnce (
  51846. tree,
  51847. index,
  51848. key
  51849. ) {
  51850. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  51851. return tree
  51852. }
  51853. function markStatic (
  51854. tree,
  51855. key,
  51856. isOnce
  51857. ) {
  51858. if (Array.isArray(tree)) {
  51859. for (var i = 0; i < tree.length; i++) {
  51860. if (tree[i] && typeof tree[i] !== 'string') {
  51861. markStaticNode(tree[i], (key + "_" + i), isOnce);
  51862. }
  51863. }
  51864. } else {
  51865. markStaticNode(tree, key, isOnce);
  51866. }
  51867. }
  51868. function markStaticNode (node, key, isOnce) {
  51869. node.isStatic = true;
  51870. node.key = key;
  51871. node.isOnce = isOnce;
  51872. }
  51873. /* */
  51874. function bindObjectListeners (data, value) {
  51875. if (value) {
  51876. if (!isPlainObject(value)) {
  51877. warn(
  51878. 'v-on without argument expects an Object value',
  51879. this
  51880. );
  51881. } else {
  51882. var on = data.on = data.on ? extend({}, data.on) : {};
  51883. for (var key in value) {
  51884. var existing = on[key];
  51885. var ours = value[key];
  51886. on[key] = existing ? [].concat(existing, ours) : ours;
  51887. }
  51888. }
  51889. }
  51890. return data
  51891. }
  51892. /* */
  51893. function resolveScopedSlots (
  51894. fns, // see flow/vnode
  51895. res,
  51896. // the following are added in 2.6
  51897. hasDynamicKeys,
  51898. contentHashKey
  51899. ) {
  51900. res = res || { $stable: !hasDynamicKeys };
  51901. for (var i = 0; i < fns.length; i++) {
  51902. var slot = fns[i];
  51903. if (Array.isArray(slot)) {
  51904. resolveScopedSlots(slot, res, hasDynamicKeys);
  51905. } else if (slot) {
  51906. // marker for reverse proxying v-slot without scope on this.$slots
  51907. if (slot.proxy) {
  51908. slot.fn.proxy = true;
  51909. }
  51910. res[slot.key] = slot.fn;
  51911. }
  51912. }
  51913. if (contentHashKey) {
  51914. (res).$key = contentHashKey;
  51915. }
  51916. return res
  51917. }
  51918. /* */
  51919. function bindDynamicKeys (baseObj, values) {
  51920. for (var i = 0; i < values.length; i += 2) {
  51921. var key = values[i];
  51922. if (typeof key === 'string' && key) {
  51923. baseObj[values[i]] = values[i + 1];
  51924. } else if (key !== '' && key !== null) {
  51925. // null is a special value for explicitly removing a binding
  51926. warn(
  51927. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  51928. this
  51929. );
  51930. }
  51931. }
  51932. return baseObj
  51933. }
  51934. // helper to dynamically append modifier runtime markers to event names.
  51935. // ensure only append when value is already string, otherwise it will be cast
  51936. // to string and cause the type check to miss.
  51937. function prependModifier (value, symbol) {
  51938. return typeof value === 'string' ? symbol + value : value
  51939. }
  51940. /* */
  51941. function installRenderHelpers (target) {
  51942. target._o = markOnce;
  51943. target._n = toNumber;
  51944. target._s = toString;
  51945. target._l = renderList;
  51946. target._t = renderSlot;
  51947. target._q = looseEqual;
  51948. target._i = looseIndexOf;
  51949. target._m = renderStatic;
  51950. target._f = resolveFilter;
  51951. target._k = checkKeyCodes;
  51952. target._b = bindObjectProps;
  51953. target._v = createTextVNode;
  51954. target._e = createEmptyVNode;
  51955. target._u = resolveScopedSlots;
  51956. target._g = bindObjectListeners;
  51957. target._d = bindDynamicKeys;
  51958. target._p = prependModifier;
  51959. }
  51960. /* */
  51961. function FunctionalRenderContext (
  51962. data,
  51963. props,
  51964. children,
  51965. parent,
  51966. Ctor
  51967. ) {
  51968. var this$1 = this;
  51969. var options = Ctor.options;
  51970. // ensure the createElement function in functional components
  51971. // gets a unique context - this is necessary for correct named slot check
  51972. var contextVm;
  51973. if (hasOwn(parent, '_uid')) {
  51974. contextVm = Object.create(parent);
  51975. // $flow-disable-line
  51976. contextVm._original = parent;
  51977. } else {
  51978. // the context vm passed in is a functional context as well.
  51979. // in this case we want to make sure we are able to get a hold to the
  51980. // real context instance.
  51981. contextVm = parent;
  51982. // $flow-disable-line
  51983. parent = parent._original;
  51984. }
  51985. var isCompiled = isTrue(options._compiled);
  51986. var needNormalization = !isCompiled;
  51987. this.data = data;
  51988. this.props = props;
  51989. this.children = children;
  51990. this.parent = parent;
  51991. this.listeners = data.on || emptyObject;
  51992. this.injections = resolveInject(options.inject, parent);
  51993. this.slots = function () {
  51994. if (!this$1.$slots) {
  51995. normalizeScopedSlots(
  51996. data.scopedSlots,
  51997. this$1.$slots = resolveSlots(children, parent)
  51998. );
  51999. }
  52000. return this$1.$slots
  52001. };
  52002. Object.defineProperty(this, 'scopedSlots', ({
  52003. enumerable: true,
  52004. get: function get () {
  52005. return normalizeScopedSlots(data.scopedSlots, this.slots())
  52006. }
  52007. }));
  52008. // support for compiled functional template
  52009. if (isCompiled) {
  52010. // exposing $options for renderStatic()
  52011. this.$options = options;
  52012. // pre-resolve slots for renderSlot()
  52013. this.$slots = this.slots();
  52014. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  52015. }
  52016. if (options._scopeId) {
  52017. this._c = function (a, b, c, d) {
  52018. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  52019. if (vnode && !Array.isArray(vnode)) {
  52020. vnode.fnScopeId = options._scopeId;
  52021. vnode.fnContext = parent;
  52022. }
  52023. return vnode
  52024. };
  52025. } else {
  52026. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  52027. }
  52028. }
  52029. installRenderHelpers(FunctionalRenderContext.prototype);
  52030. function createFunctionalComponent (
  52031. Ctor,
  52032. propsData,
  52033. data,
  52034. contextVm,
  52035. children
  52036. ) {
  52037. var options = Ctor.options;
  52038. var props = {};
  52039. var propOptions = options.props;
  52040. if (isDef(propOptions)) {
  52041. for (var key in propOptions) {
  52042. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  52043. }
  52044. } else {
  52045. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  52046. if (isDef(data.props)) { mergeProps(props, data.props); }
  52047. }
  52048. var renderContext = new FunctionalRenderContext(
  52049. data,
  52050. props,
  52051. children,
  52052. contextVm,
  52053. Ctor
  52054. );
  52055. var vnode = options.render.call(null, renderContext._c, renderContext);
  52056. if (vnode instanceof VNode) {
  52057. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  52058. } else if (Array.isArray(vnode)) {
  52059. var vnodes = normalizeChildren(vnode) || [];
  52060. var res = new Array(vnodes.length);
  52061. for (var i = 0; i < vnodes.length; i++) {
  52062. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  52063. }
  52064. return res
  52065. }
  52066. }
  52067. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  52068. // #7817 clone node before setting fnContext, otherwise if the node is reused
  52069. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  52070. // that should not be matched to match.
  52071. var clone = cloneVNode(vnode);
  52072. clone.fnContext = contextVm;
  52073. clone.fnOptions = options;
  52074. {
  52075. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  52076. }
  52077. if (data.slot) {
  52078. (clone.data || (clone.data = {})).slot = data.slot;
  52079. }
  52080. return clone
  52081. }
  52082. function mergeProps (to, from) {
  52083. for (var key in from) {
  52084. to[camelize(key)] = from[key];
  52085. }
  52086. }
  52087. /* */
  52088. /* */
  52089. /* */
  52090. /* */
  52091. // inline hooks to be invoked on component VNodes during patch
  52092. var componentVNodeHooks = {
  52093. init: function init (vnode, hydrating) {
  52094. if (
  52095. vnode.componentInstance &&
  52096. !vnode.componentInstance._isDestroyed &&
  52097. vnode.data.keepAlive
  52098. ) {
  52099. // kept-alive components, treat as a patch
  52100. var mountedNode = vnode; // work around flow
  52101. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  52102. } else {
  52103. var child = vnode.componentInstance = createComponentInstanceForVnode(
  52104. vnode,
  52105. activeInstance
  52106. );
  52107. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  52108. }
  52109. },
  52110. prepatch: function prepatch (oldVnode, vnode) {
  52111. var options = vnode.componentOptions;
  52112. var child = vnode.componentInstance = oldVnode.componentInstance;
  52113. updateChildComponent(
  52114. child,
  52115. options.propsData, // updated props
  52116. options.listeners, // updated listeners
  52117. vnode, // new parent vnode
  52118. options.children // new children
  52119. );
  52120. },
  52121. insert: function insert (vnode) {
  52122. var context = vnode.context;
  52123. var componentInstance = vnode.componentInstance;
  52124. if (!componentInstance._isMounted) {
  52125. componentInstance._isMounted = true;
  52126. callHook(componentInstance, 'mounted');
  52127. }
  52128. if (vnode.data.keepAlive) {
  52129. if (context._isMounted) {
  52130. // vue-router#1212
  52131. // During updates, a kept-alive component's child components may
  52132. // change, so directly walking the tree here may call activated hooks
  52133. // on incorrect children. Instead we push them into a queue which will
  52134. // be processed after the whole patch process ended.
  52135. queueActivatedComponent(componentInstance);
  52136. } else {
  52137. activateChildComponent(componentInstance, true /* direct */);
  52138. }
  52139. }
  52140. },
  52141. destroy: function destroy (vnode) {
  52142. var componentInstance = vnode.componentInstance;
  52143. if (!componentInstance._isDestroyed) {
  52144. if (!vnode.data.keepAlive) {
  52145. componentInstance.$destroy();
  52146. } else {
  52147. deactivateChildComponent(componentInstance, true /* direct */);
  52148. }
  52149. }
  52150. }
  52151. };
  52152. var hooksToMerge = Object.keys(componentVNodeHooks);
  52153. function createComponent (
  52154. Ctor,
  52155. data,
  52156. context,
  52157. children,
  52158. tag
  52159. ) {
  52160. if (isUndef(Ctor)) {
  52161. return
  52162. }
  52163. var baseCtor = context.$options._base;
  52164. // plain options object: turn it into a constructor
  52165. if (isObject(Ctor)) {
  52166. Ctor = baseCtor.extend(Ctor);
  52167. }
  52168. // if at this stage it's not a constructor or an async component factory,
  52169. // reject.
  52170. if (typeof Ctor !== 'function') {
  52171. {
  52172. warn(("Invalid Component definition: " + (String(Ctor))), context);
  52173. }
  52174. return
  52175. }
  52176. // async component
  52177. var asyncFactory;
  52178. if (isUndef(Ctor.cid)) {
  52179. asyncFactory = Ctor;
  52180. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  52181. if (Ctor === undefined) {
  52182. // return a placeholder node for async component, which is rendered
  52183. // as a comment node but preserves all the raw information for the node.
  52184. // the information will be used for async server-rendering and hydration.
  52185. return createAsyncPlaceholder(
  52186. asyncFactory,
  52187. data,
  52188. context,
  52189. children,
  52190. tag
  52191. )
  52192. }
  52193. }
  52194. data = data || {};
  52195. // resolve constructor options in case global mixins are applied after
  52196. // component constructor creation
  52197. resolveConstructorOptions(Ctor);
  52198. // transform component v-model data into props & events
  52199. if (isDef(data.model)) {
  52200. transformModel(Ctor.options, data);
  52201. }
  52202. // extract props
  52203. var propsData = extractPropsFromVNodeData(data, Ctor, tag);
  52204. // functional component
  52205. if (isTrue(Ctor.options.functional)) {
  52206. return createFunctionalComponent(Ctor, propsData, data, context, children)
  52207. }
  52208. // extract listeners, since these needs to be treated as
  52209. // child component listeners instead of DOM listeners
  52210. var listeners = data.on;
  52211. // replace with listeners with .native modifier
  52212. // so it gets processed during parent component patch.
  52213. data.on = data.nativeOn;
  52214. if (isTrue(Ctor.options.abstract)) {
  52215. // abstract components do not keep anything
  52216. // other than props & listeners & slot
  52217. // work around flow
  52218. var slot = data.slot;
  52219. data = {};
  52220. if (slot) {
  52221. data.slot = slot;
  52222. }
  52223. }
  52224. // install component management hooks onto the placeholder node
  52225. installComponentHooks(data);
  52226. // return a placeholder vnode
  52227. var name = Ctor.options.name || tag;
  52228. var vnode = new VNode(
  52229. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  52230. data, undefined, undefined, undefined, context,
  52231. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  52232. asyncFactory
  52233. );
  52234. return vnode
  52235. }
  52236. function createComponentInstanceForVnode (
  52237. vnode, // we know it's MountedComponentVNode but flow doesn't
  52238. parent // activeInstance in lifecycle state
  52239. ) {
  52240. var options = {
  52241. _isComponent: true,
  52242. _parentVnode: vnode,
  52243. parent: parent
  52244. };
  52245. // check inline-template render functions
  52246. var inlineTemplate = vnode.data.inlineTemplate;
  52247. if (isDef(inlineTemplate)) {
  52248. options.render = inlineTemplate.render;
  52249. options.staticRenderFns = inlineTemplate.staticRenderFns;
  52250. }
  52251. return new vnode.componentOptions.Ctor(options)
  52252. }
  52253. function installComponentHooks (data) {
  52254. var hooks = data.hook || (data.hook = {});
  52255. for (var i = 0; i < hooksToMerge.length; i++) {
  52256. var key = hooksToMerge[i];
  52257. var existing = hooks[key];
  52258. var toMerge = componentVNodeHooks[key];
  52259. if (existing !== toMerge && !(existing && existing._merged)) {
  52260. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  52261. }
  52262. }
  52263. }
  52264. function mergeHook$1 (f1, f2) {
  52265. var merged = function (a, b) {
  52266. // flow complains about extra args which is why we use any
  52267. f1(a, b);
  52268. f2(a, b);
  52269. };
  52270. merged._merged = true;
  52271. return merged
  52272. }
  52273. // transform component v-model info (value and callback) into
  52274. // prop and event handler respectively.
  52275. function transformModel (options, data) {
  52276. var prop = (options.model && options.model.prop) || 'value';
  52277. var event = (options.model && options.model.event) || 'input'
  52278. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  52279. var on = data.on || (data.on = {});
  52280. var existing = on[event];
  52281. var callback = data.model.callback;
  52282. if (isDef(existing)) {
  52283. if (
  52284. Array.isArray(existing)
  52285. ? existing.indexOf(callback) === -1
  52286. : existing !== callback
  52287. ) {
  52288. on[event] = [callback].concat(existing);
  52289. }
  52290. } else {
  52291. on[event] = callback;
  52292. }
  52293. }
  52294. /* */
  52295. var SIMPLE_NORMALIZE = 1;
  52296. var ALWAYS_NORMALIZE = 2;
  52297. // wrapper function for providing a more flexible interface
  52298. // without getting yelled at by flow
  52299. function createElement (
  52300. context,
  52301. tag,
  52302. data,
  52303. children,
  52304. normalizationType,
  52305. alwaysNormalize
  52306. ) {
  52307. if (Array.isArray(data) || isPrimitive(data)) {
  52308. normalizationType = children;
  52309. children = data;
  52310. data = undefined;
  52311. }
  52312. if (isTrue(alwaysNormalize)) {
  52313. normalizationType = ALWAYS_NORMALIZE;
  52314. }
  52315. return _createElement(context, tag, data, children, normalizationType)
  52316. }
  52317. function _createElement (
  52318. context,
  52319. tag,
  52320. data,
  52321. children,
  52322. normalizationType
  52323. ) {
  52324. if (isDef(data) && isDef((data).__ob__)) {
  52325. warn(
  52326. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  52327. 'Always create fresh vnode data objects in each render!',
  52328. context
  52329. );
  52330. return createEmptyVNode()
  52331. }
  52332. // object syntax in v-bind
  52333. if (isDef(data) && isDef(data.is)) {
  52334. tag = data.is;
  52335. }
  52336. if (!tag) {
  52337. // in case of component :is set to falsy value
  52338. return createEmptyVNode()
  52339. }
  52340. // warn against non-primitive key
  52341. if (isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  52342. ) {
  52343. {
  52344. warn(
  52345. 'Avoid using non-primitive value as key, ' +
  52346. 'use string/number value instead.',
  52347. context
  52348. );
  52349. }
  52350. }
  52351. // support single function children as default scoped slot
  52352. if (Array.isArray(children) &&
  52353. typeof children[0] === 'function'
  52354. ) {
  52355. data = data || {};
  52356. data.scopedSlots = { default: children[0] };
  52357. children.length = 0;
  52358. }
  52359. if (normalizationType === ALWAYS_NORMALIZE) {
  52360. children = normalizeChildren(children);
  52361. } else if (normalizationType === SIMPLE_NORMALIZE) {
  52362. children = simpleNormalizeChildren(children);
  52363. }
  52364. var vnode, ns;
  52365. if (typeof tag === 'string') {
  52366. var Ctor;
  52367. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  52368. if (config.isReservedTag(tag)) {
  52369. // platform built-in elements
  52370. if (isDef(data) && isDef(data.nativeOn)) {
  52371. warn(
  52372. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  52373. context
  52374. );
  52375. }
  52376. vnode = new VNode(
  52377. config.parsePlatformTagName(tag), data, children,
  52378. undefined, undefined, context
  52379. );
  52380. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  52381. // component
  52382. vnode = createComponent(Ctor, data, context, children, tag);
  52383. } else {
  52384. // unknown or unlisted namespaced elements
  52385. // check at runtime because it may get assigned a namespace when its
  52386. // parent normalizes children
  52387. vnode = new VNode(
  52388. tag, data, children,
  52389. undefined, undefined, context
  52390. );
  52391. }
  52392. } else {
  52393. // direct component options / constructor
  52394. vnode = createComponent(tag, data, context, children);
  52395. }
  52396. if (Array.isArray(vnode)) {
  52397. return vnode
  52398. } else if (isDef(vnode)) {
  52399. if (isDef(ns)) { applyNS(vnode, ns); }
  52400. if (isDef(data)) { registerDeepBindings(data); }
  52401. return vnode
  52402. } else {
  52403. return createEmptyVNode()
  52404. }
  52405. }
  52406. function applyNS (vnode, ns, force) {
  52407. vnode.ns = ns;
  52408. if (vnode.tag === 'foreignObject') {
  52409. // use default namespace inside foreignObject
  52410. ns = undefined;
  52411. force = true;
  52412. }
  52413. if (isDef(vnode.children)) {
  52414. for (var i = 0, l = vnode.children.length; i < l; i++) {
  52415. var child = vnode.children[i];
  52416. if (isDef(child.tag) && (
  52417. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  52418. applyNS(child, ns, force);
  52419. }
  52420. }
  52421. }
  52422. }
  52423. // ref #5318
  52424. // necessary to ensure parent re-render when deep bindings like :style and
  52425. // :class are used on slot nodes
  52426. function registerDeepBindings (data) {
  52427. if (isObject(data.style)) {
  52428. traverse(data.style);
  52429. }
  52430. if (isObject(data.class)) {
  52431. traverse(data.class);
  52432. }
  52433. }
  52434. /* */
  52435. function initRender (vm) {
  52436. vm._vnode = null; // the root of the child tree
  52437. vm._staticTrees = null; // v-once cached trees
  52438. var options = vm.$options;
  52439. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  52440. var renderContext = parentVnode && parentVnode.context;
  52441. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  52442. vm.$scopedSlots = emptyObject;
  52443. // bind the createElement fn to this instance
  52444. // so that we get proper render context inside it.
  52445. // args order: tag, data, children, normalizationType, alwaysNormalize
  52446. // internal version is used by render functions compiled from templates
  52447. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  52448. // normalization is always applied for the public version, used in
  52449. // user-written render functions.
  52450. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  52451. // $attrs & $listeners are exposed for easier HOC creation.
  52452. // they need to be reactive so that HOCs using them are always updated
  52453. var parentData = parentVnode && parentVnode.data;
  52454. /* istanbul ignore else */
  52455. {
  52456. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  52457. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  52458. }, true);
  52459. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  52460. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  52461. }, true);
  52462. }
  52463. }
  52464. var currentRenderingInstance = null;
  52465. function renderMixin (Vue) {
  52466. // install runtime convenience helpers
  52467. installRenderHelpers(Vue.prototype);
  52468. Vue.prototype.$nextTick = function (fn) {
  52469. return nextTick(fn, this)
  52470. };
  52471. Vue.prototype._render = function () {
  52472. var vm = this;
  52473. var ref = vm.$options;
  52474. var render = ref.render;
  52475. var _parentVnode = ref._parentVnode;
  52476. if (_parentVnode) {
  52477. vm.$scopedSlots = normalizeScopedSlots(
  52478. _parentVnode.data.scopedSlots,
  52479. vm.$slots,
  52480. vm.$scopedSlots
  52481. );
  52482. }
  52483. // set parent vnode. this allows render functions to have access
  52484. // to the data on the placeholder node.
  52485. vm.$vnode = _parentVnode;
  52486. // render self
  52487. var vnode;
  52488. try {
  52489. // There's no need to maintain a stack because all render fns are called
  52490. // separately from one another. Nested component's render fns are called
  52491. // when parent component is patched.
  52492. currentRenderingInstance = vm;
  52493. vnode = render.call(vm._renderProxy, vm.$createElement);
  52494. } catch (e) {
  52495. handleError(e, vm, "render");
  52496. // return error render result,
  52497. // or previous vnode to prevent render error causing blank component
  52498. /* istanbul ignore else */
  52499. if (vm.$options.renderError) {
  52500. try {
  52501. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  52502. } catch (e) {
  52503. handleError(e, vm, "renderError");
  52504. vnode = vm._vnode;
  52505. }
  52506. } else {
  52507. vnode = vm._vnode;
  52508. }
  52509. } finally {
  52510. currentRenderingInstance = null;
  52511. }
  52512. // if the returned array contains only a single node, allow it
  52513. if (Array.isArray(vnode) && vnode.length === 1) {
  52514. vnode = vnode[0];
  52515. }
  52516. // return empty vnode in case the render function errored out
  52517. if (!(vnode instanceof VNode)) {
  52518. if (Array.isArray(vnode)) {
  52519. warn(
  52520. 'Multiple root nodes returned from render function. Render function ' +
  52521. 'should return a single root node.',
  52522. vm
  52523. );
  52524. }
  52525. vnode = createEmptyVNode();
  52526. }
  52527. // set parent
  52528. vnode.parent = _parentVnode;
  52529. return vnode
  52530. };
  52531. }
  52532. /* */
  52533. function ensureCtor (comp, base) {
  52534. if (
  52535. comp.__esModule ||
  52536. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  52537. ) {
  52538. comp = comp.default;
  52539. }
  52540. return isObject(comp)
  52541. ? base.extend(comp)
  52542. : comp
  52543. }
  52544. function createAsyncPlaceholder (
  52545. factory,
  52546. data,
  52547. context,
  52548. children,
  52549. tag
  52550. ) {
  52551. var node = createEmptyVNode();
  52552. node.asyncFactory = factory;
  52553. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  52554. return node
  52555. }
  52556. function resolveAsyncComponent (
  52557. factory,
  52558. baseCtor
  52559. ) {
  52560. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  52561. return factory.errorComp
  52562. }
  52563. if (isDef(factory.resolved)) {
  52564. return factory.resolved
  52565. }
  52566. var owner = currentRenderingInstance;
  52567. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  52568. // already pending
  52569. factory.owners.push(owner);
  52570. }
  52571. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  52572. return factory.loadingComp
  52573. }
  52574. if (owner && !isDef(factory.owners)) {
  52575. var owners = factory.owners = [owner];
  52576. var sync = true;
  52577. var timerLoading = null;
  52578. var timerTimeout = null
  52579. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  52580. var forceRender = function (renderCompleted) {
  52581. for (var i = 0, l = owners.length; i < l; i++) {
  52582. (owners[i]).$forceUpdate();
  52583. }
  52584. if (renderCompleted) {
  52585. owners.length = 0;
  52586. if (timerLoading !== null) {
  52587. clearTimeout(timerLoading);
  52588. timerLoading = null;
  52589. }
  52590. if (timerTimeout !== null) {
  52591. clearTimeout(timerTimeout);
  52592. timerTimeout = null;
  52593. }
  52594. }
  52595. };
  52596. var resolve = once(function (res) {
  52597. // cache resolved
  52598. factory.resolved = ensureCtor(res, baseCtor);
  52599. // invoke callbacks only if this is not a synchronous resolve
  52600. // (async resolves are shimmed as synchronous during SSR)
  52601. if (!sync) {
  52602. forceRender(true);
  52603. } else {
  52604. owners.length = 0;
  52605. }
  52606. });
  52607. var reject = once(function (reason) {
  52608. warn(
  52609. "Failed to resolve async component: " + (String(factory)) +
  52610. (reason ? ("\nReason: " + reason) : '')
  52611. );
  52612. if (isDef(factory.errorComp)) {
  52613. factory.error = true;
  52614. forceRender(true);
  52615. }
  52616. });
  52617. var res = factory(resolve, reject);
  52618. if (isObject(res)) {
  52619. if (isPromise(res)) {
  52620. // () => Promise
  52621. if (isUndef(factory.resolved)) {
  52622. res.then(resolve, reject);
  52623. }
  52624. } else if (isPromise(res.component)) {
  52625. res.component.then(resolve, reject);
  52626. if (isDef(res.error)) {
  52627. factory.errorComp = ensureCtor(res.error, baseCtor);
  52628. }
  52629. if (isDef(res.loading)) {
  52630. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  52631. if (res.delay === 0) {
  52632. factory.loading = true;
  52633. } else {
  52634. timerLoading = setTimeout(function () {
  52635. timerLoading = null;
  52636. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  52637. factory.loading = true;
  52638. forceRender(false);
  52639. }
  52640. }, res.delay || 200);
  52641. }
  52642. }
  52643. if (isDef(res.timeout)) {
  52644. timerTimeout = setTimeout(function () {
  52645. timerTimeout = null;
  52646. if (isUndef(factory.resolved)) {
  52647. reject(
  52648. "timeout (" + (res.timeout) + "ms)"
  52649. );
  52650. }
  52651. }, res.timeout);
  52652. }
  52653. }
  52654. }
  52655. sync = false;
  52656. // return in case resolved synchronously
  52657. return factory.loading
  52658. ? factory.loadingComp
  52659. : factory.resolved
  52660. }
  52661. }
  52662. /* */
  52663. function isAsyncPlaceholder (node) {
  52664. return node.isComment && node.asyncFactory
  52665. }
  52666. /* */
  52667. function getFirstComponentChild (children) {
  52668. if (Array.isArray(children)) {
  52669. for (var i = 0; i < children.length; i++) {
  52670. var c = children[i];
  52671. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  52672. return c
  52673. }
  52674. }
  52675. }
  52676. }
  52677. /* */
  52678. /* */
  52679. function initEvents (vm) {
  52680. vm._events = Object.create(null);
  52681. vm._hasHookEvent = false;
  52682. // init parent attached events
  52683. var listeners = vm.$options._parentListeners;
  52684. if (listeners) {
  52685. updateComponentListeners(vm, listeners);
  52686. }
  52687. }
  52688. var target;
  52689. function add (event, fn) {
  52690. target.$on(event, fn);
  52691. }
  52692. function remove$1 (event, fn) {
  52693. target.$off(event, fn);
  52694. }
  52695. function createOnceHandler (event, fn) {
  52696. var _target = target;
  52697. return function onceHandler () {
  52698. var res = fn.apply(null, arguments);
  52699. if (res !== null) {
  52700. _target.$off(event, onceHandler);
  52701. }
  52702. }
  52703. }
  52704. function updateComponentListeners (
  52705. vm,
  52706. listeners,
  52707. oldListeners
  52708. ) {
  52709. target = vm;
  52710. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  52711. target = undefined;
  52712. }
  52713. function eventsMixin (Vue) {
  52714. var hookRE = /^hook:/;
  52715. Vue.prototype.$on = function (event, fn) {
  52716. var vm = this;
  52717. if (Array.isArray(event)) {
  52718. for (var i = 0, l = event.length; i < l; i++) {
  52719. vm.$on(event[i], fn);
  52720. }
  52721. } else {
  52722. (vm._events[event] || (vm._events[event] = [])).push(fn);
  52723. // optimize hook:event cost by using a boolean flag marked at registration
  52724. // instead of a hash lookup
  52725. if (hookRE.test(event)) {
  52726. vm._hasHookEvent = true;
  52727. }
  52728. }
  52729. return vm
  52730. };
  52731. Vue.prototype.$once = function (event, fn) {
  52732. var vm = this;
  52733. function on () {
  52734. vm.$off(event, on);
  52735. fn.apply(vm, arguments);
  52736. }
  52737. on.fn = fn;
  52738. vm.$on(event, on);
  52739. return vm
  52740. };
  52741. Vue.prototype.$off = function (event, fn) {
  52742. var vm = this;
  52743. // all
  52744. if (!arguments.length) {
  52745. vm._events = Object.create(null);
  52746. return vm
  52747. }
  52748. // array of events
  52749. if (Array.isArray(event)) {
  52750. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  52751. vm.$off(event[i$1], fn);
  52752. }
  52753. return vm
  52754. }
  52755. // specific event
  52756. var cbs = vm._events[event];
  52757. if (!cbs) {
  52758. return vm
  52759. }
  52760. if (!fn) {
  52761. vm._events[event] = null;
  52762. return vm
  52763. }
  52764. // specific handler
  52765. var cb;
  52766. var i = cbs.length;
  52767. while (i--) {
  52768. cb = cbs[i];
  52769. if (cb === fn || cb.fn === fn) {
  52770. cbs.splice(i, 1);
  52771. break
  52772. }
  52773. }
  52774. return vm
  52775. };
  52776. Vue.prototype.$emit = function (event) {
  52777. var vm = this;
  52778. {
  52779. var lowerCaseEvent = event.toLowerCase();
  52780. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  52781. tip(
  52782. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  52783. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  52784. "Note that HTML attributes are case-insensitive and you cannot use " +
  52785. "v-on to listen to camelCase events when using in-DOM templates. " +
  52786. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  52787. );
  52788. }
  52789. }
  52790. var cbs = vm._events[event];
  52791. if (cbs) {
  52792. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  52793. var args = toArray(arguments, 1);
  52794. var info = "event handler for \"" + event + "\"";
  52795. for (var i = 0, l = cbs.length; i < l; i++) {
  52796. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  52797. }
  52798. }
  52799. return vm
  52800. };
  52801. }
  52802. /* */
  52803. var activeInstance = null;
  52804. var isUpdatingChildComponent = false;
  52805. function setActiveInstance(vm) {
  52806. var prevActiveInstance = activeInstance;
  52807. activeInstance = vm;
  52808. return function () {
  52809. activeInstance = prevActiveInstance;
  52810. }
  52811. }
  52812. function initLifecycle (vm) {
  52813. var options = vm.$options;
  52814. // locate first non-abstract parent
  52815. var parent = options.parent;
  52816. if (parent && !options.abstract) {
  52817. while (parent.$options.abstract && parent.$parent) {
  52818. parent = parent.$parent;
  52819. }
  52820. parent.$children.push(vm);
  52821. }
  52822. vm.$parent = parent;
  52823. vm.$root = parent ? parent.$root : vm;
  52824. vm.$children = [];
  52825. vm.$refs = {};
  52826. vm._watcher = null;
  52827. vm._inactive = null;
  52828. vm._directInactive = false;
  52829. vm._isMounted = false;
  52830. vm._isDestroyed = false;
  52831. vm._isBeingDestroyed = false;
  52832. }
  52833. function lifecycleMixin (Vue) {
  52834. Vue.prototype._update = function (vnode, hydrating) {
  52835. var vm = this;
  52836. var prevEl = vm.$el;
  52837. var prevVnode = vm._vnode;
  52838. var restoreActiveInstance = setActiveInstance(vm);
  52839. vm._vnode = vnode;
  52840. // Vue.prototype.__patch__ is injected in entry points
  52841. // based on the rendering backend used.
  52842. if (!prevVnode) {
  52843. // initial render
  52844. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  52845. } else {
  52846. // updates
  52847. vm.$el = vm.__patch__(prevVnode, vnode);
  52848. }
  52849. restoreActiveInstance();
  52850. // update __vue__ reference
  52851. if (prevEl) {
  52852. prevEl.__vue__ = null;
  52853. }
  52854. if (vm.$el) {
  52855. vm.$el.__vue__ = vm;
  52856. }
  52857. // if parent is an HOC, update its $el as well
  52858. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  52859. vm.$parent.$el = vm.$el;
  52860. }
  52861. // updated hook is called by the scheduler to ensure that children are
  52862. // updated in a parent's updated hook.
  52863. };
  52864. Vue.prototype.$forceUpdate = function () {
  52865. var vm = this;
  52866. if (vm._watcher) {
  52867. vm._watcher.update();
  52868. }
  52869. };
  52870. Vue.prototype.$destroy = function () {
  52871. var vm = this;
  52872. if (vm._isBeingDestroyed) {
  52873. return
  52874. }
  52875. callHook(vm, 'beforeDestroy');
  52876. vm._isBeingDestroyed = true;
  52877. // remove self from parent
  52878. var parent = vm.$parent;
  52879. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  52880. remove(parent.$children, vm);
  52881. }
  52882. // teardown watchers
  52883. if (vm._watcher) {
  52884. vm._watcher.teardown();
  52885. }
  52886. var i = vm._watchers.length;
  52887. while (i--) {
  52888. vm._watchers[i].teardown();
  52889. }
  52890. // remove reference from data ob
  52891. // frozen object may not have observer.
  52892. if (vm._data.__ob__) {
  52893. vm._data.__ob__.vmCount--;
  52894. }
  52895. // call the last hook...
  52896. vm._isDestroyed = true;
  52897. // invoke destroy hooks on current rendered tree
  52898. vm.__patch__(vm._vnode, null);
  52899. // fire destroyed hook
  52900. callHook(vm, 'destroyed');
  52901. // turn off all instance listeners.
  52902. vm.$off();
  52903. // remove __vue__ reference
  52904. if (vm.$el) {
  52905. vm.$el.__vue__ = null;
  52906. }
  52907. // release circular reference (#6759)
  52908. if (vm.$vnode) {
  52909. vm.$vnode.parent = null;
  52910. }
  52911. };
  52912. }
  52913. function mountComponent (
  52914. vm,
  52915. el,
  52916. hydrating
  52917. ) {
  52918. vm.$el = el;
  52919. if (!vm.$options.render) {
  52920. vm.$options.render = createEmptyVNode;
  52921. {
  52922. /* istanbul ignore if */
  52923. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  52924. vm.$options.el || el) {
  52925. warn(
  52926. 'You are using the runtime-only build of Vue where the template ' +
  52927. 'compiler is not available. Either pre-compile the templates into ' +
  52928. 'render functions, or use the compiler-included build.',
  52929. vm
  52930. );
  52931. } else {
  52932. warn(
  52933. 'Failed to mount component: template or render function not defined.',
  52934. vm
  52935. );
  52936. }
  52937. }
  52938. }
  52939. callHook(vm, 'beforeMount');
  52940. var updateComponent;
  52941. /* istanbul ignore if */
  52942. if (config.performance && mark) {
  52943. updateComponent = function () {
  52944. var name = vm._name;
  52945. var id = vm._uid;
  52946. var startTag = "vue-perf-start:" + id;
  52947. var endTag = "vue-perf-end:" + id;
  52948. mark(startTag);
  52949. var vnode = vm._render();
  52950. mark(endTag);
  52951. measure(("vue " + name + " render"), startTag, endTag);
  52952. mark(startTag);
  52953. vm._update(vnode, hydrating);
  52954. mark(endTag);
  52955. measure(("vue " + name + " patch"), startTag, endTag);
  52956. };
  52957. } else {
  52958. updateComponent = function () {
  52959. vm._update(vm._render(), hydrating);
  52960. };
  52961. }
  52962. // we set this to vm._watcher inside the watcher's constructor
  52963. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  52964. // component's mounted hook), which relies on vm._watcher being already defined
  52965. new Watcher(vm, updateComponent, noop, {
  52966. before: function before () {
  52967. if (vm._isMounted && !vm._isDestroyed) {
  52968. callHook(vm, 'beforeUpdate');
  52969. }
  52970. }
  52971. }, true /* isRenderWatcher */);
  52972. hydrating = false;
  52973. // manually mounted instance, call mounted on self
  52974. // mounted is called for render-created child components in its inserted hook
  52975. if (vm.$vnode == null) {
  52976. vm._isMounted = true;
  52977. callHook(vm, 'mounted');
  52978. }
  52979. return vm
  52980. }
  52981. function updateChildComponent (
  52982. vm,
  52983. propsData,
  52984. listeners,
  52985. parentVnode,
  52986. renderChildren
  52987. ) {
  52988. {
  52989. isUpdatingChildComponent = true;
  52990. }
  52991. // determine whether component has slot children
  52992. // we need to do this before overwriting $options._renderChildren.
  52993. // check if there are dynamic scopedSlots (hand-written or compiled but with
  52994. // dynamic slot names). Static scoped slots compiled from template has the
  52995. // "$stable" marker.
  52996. var newScopedSlots = parentVnode.data.scopedSlots;
  52997. var oldScopedSlots = vm.$scopedSlots;
  52998. var hasDynamicScopedSlot = !!(
  52999. (newScopedSlots && !newScopedSlots.$stable) ||
  53000. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  53001. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  53002. );
  53003. // Any static slot children from the parent may have changed during parent's
  53004. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  53005. // update is necessary to ensure correctness.
  53006. var needsForceUpdate = !!(
  53007. renderChildren || // has new static slots
  53008. vm.$options._renderChildren || // has old static slots
  53009. hasDynamicScopedSlot
  53010. );
  53011. vm.$options._parentVnode = parentVnode;
  53012. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  53013. if (vm._vnode) { // update child tree's parent
  53014. vm._vnode.parent = parentVnode;
  53015. }
  53016. vm.$options._renderChildren = renderChildren;
  53017. // update $attrs and $listeners hash
  53018. // these are also reactive so they may trigger child update if the child
  53019. // used them during render
  53020. vm.$attrs = parentVnode.data.attrs || emptyObject;
  53021. vm.$listeners = listeners || emptyObject;
  53022. // update props
  53023. if (propsData && vm.$options.props) {
  53024. toggleObserving(false);
  53025. var props = vm._props;
  53026. var propKeys = vm.$options._propKeys || [];
  53027. for (var i = 0; i < propKeys.length; i++) {
  53028. var key = propKeys[i];
  53029. var propOptions = vm.$options.props; // wtf flow?
  53030. props[key] = validateProp(key, propOptions, propsData, vm);
  53031. }
  53032. toggleObserving(true);
  53033. // keep a copy of raw propsData
  53034. vm.$options.propsData = propsData;
  53035. }
  53036. // update listeners
  53037. listeners = listeners || emptyObject;
  53038. var oldListeners = vm.$options._parentListeners;
  53039. vm.$options._parentListeners = listeners;
  53040. updateComponentListeners(vm, listeners, oldListeners);
  53041. // resolve slots + force update if has children
  53042. if (needsForceUpdate) {
  53043. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  53044. vm.$forceUpdate();
  53045. }
  53046. {
  53047. isUpdatingChildComponent = false;
  53048. }
  53049. }
  53050. function isInInactiveTree (vm) {
  53051. while (vm && (vm = vm.$parent)) {
  53052. if (vm._inactive) { return true }
  53053. }
  53054. return false
  53055. }
  53056. function activateChildComponent (vm, direct) {
  53057. if (direct) {
  53058. vm._directInactive = false;
  53059. if (isInInactiveTree(vm)) {
  53060. return
  53061. }
  53062. } else if (vm._directInactive) {
  53063. return
  53064. }
  53065. if (vm._inactive || vm._inactive === null) {
  53066. vm._inactive = false;
  53067. for (var i = 0; i < vm.$children.length; i++) {
  53068. activateChildComponent(vm.$children[i]);
  53069. }
  53070. callHook(vm, 'activated');
  53071. }
  53072. }
  53073. function deactivateChildComponent (vm, direct) {
  53074. if (direct) {
  53075. vm._directInactive = true;
  53076. if (isInInactiveTree(vm)) {
  53077. return
  53078. }
  53079. }
  53080. if (!vm._inactive) {
  53081. vm._inactive = true;
  53082. for (var i = 0; i < vm.$children.length; i++) {
  53083. deactivateChildComponent(vm.$children[i]);
  53084. }
  53085. callHook(vm, 'deactivated');
  53086. }
  53087. }
  53088. function callHook (vm, hook) {
  53089. // #7573 disable dep collection when invoking lifecycle hooks
  53090. pushTarget();
  53091. var handlers = vm.$options[hook];
  53092. var info = hook + " hook";
  53093. if (handlers) {
  53094. for (var i = 0, j = handlers.length; i < j; i++) {
  53095. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  53096. }
  53097. }
  53098. if (vm._hasHookEvent) {
  53099. vm.$emit('hook:' + hook);
  53100. }
  53101. popTarget();
  53102. }
  53103. /* */
  53104. var MAX_UPDATE_COUNT = 100;
  53105. var queue = [];
  53106. var activatedChildren = [];
  53107. var has = {};
  53108. var circular = {};
  53109. var waiting = false;
  53110. var flushing = false;
  53111. var index = 0;
  53112. /**
  53113. * Reset the scheduler's state.
  53114. */
  53115. function resetSchedulerState () {
  53116. index = queue.length = activatedChildren.length = 0;
  53117. has = {};
  53118. {
  53119. circular = {};
  53120. }
  53121. waiting = flushing = false;
  53122. }
  53123. // Async edge case #6566 requires saving the timestamp when event listeners are
  53124. // attached. However, calling performance.now() has a perf overhead especially
  53125. // if the page has thousands of event listeners. Instead, we take a timestamp
  53126. // every time the scheduler flushes and use that for all event listeners
  53127. // attached during that flush.
  53128. var currentFlushTimestamp = 0;
  53129. // Async edge case fix requires storing an event listener's attach timestamp.
  53130. var getNow = Date.now;
  53131. // Determine what event timestamp the browser is using. Annoyingly, the
  53132. // timestamp can either be hi-res (relative to page load) or low-res
  53133. // (relative to UNIX epoch), so in order to compare time we have to use the
  53134. // same timestamp type when saving the flush timestamp.
  53135. // All IE versions use low-res event timestamps, and have problematic clock
  53136. // implementations (#9632)
  53137. if (inBrowser && !isIE) {
  53138. var performance = window.performance;
  53139. if (
  53140. performance &&
  53141. typeof performance.now === 'function' &&
  53142. getNow() > document.createEvent('Event').timeStamp
  53143. ) {
  53144. // if the event timestamp, although evaluated AFTER the Date.now(), is
  53145. // smaller than it, it means the event is using a hi-res timestamp,
  53146. // and we need to use the hi-res version for event listener timestamps as
  53147. // well.
  53148. getNow = function () { return performance.now(); };
  53149. }
  53150. }
  53151. /**
  53152. * Flush both queues and run the watchers.
  53153. */
  53154. function flushSchedulerQueue () {
  53155. currentFlushTimestamp = getNow();
  53156. flushing = true;
  53157. var watcher, id;
  53158. // Sort queue before flush.
  53159. // This ensures that:
  53160. // 1. Components are updated from parent to child. (because parent is always
  53161. // created before the child)
  53162. // 2. A component's user watchers are run before its render watcher (because
  53163. // user watchers are created before the render watcher)
  53164. // 3. If a component is destroyed during a parent component's watcher run,
  53165. // its watchers can be skipped.
  53166. queue.sort(function (a, b) { return a.id - b.id; });
  53167. // do not cache length because more watchers might be pushed
  53168. // as we run existing watchers
  53169. for (index = 0; index < queue.length; index++) {
  53170. watcher = queue[index];
  53171. if (watcher.before) {
  53172. watcher.before();
  53173. }
  53174. id = watcher.id;
  53175. has[id] = null;
  53176. watcher.run();
  53177. // in dev build, check and stop circular updates.
  53178. if (has[id] != null) {
  53179. circular[id] = (circular[id] || 0) + 1;
  53180. if (circular[id] > MAX_UPDATE_COUNT) {
  53181. warn(
  53182. 'You may have an infinite update loop ' + (
  53183. watcher.user
  53184. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  53185. : "in a component render function."
  53186. ),
  53187. watcher.vm
  53188. );
  53189. break
  53190. }
  53191. }
  53192. }
  53193. // keep copies of post queues before resetting state
  53194. var activatedQueue = activatedChildren.slice();
  53195. var updatedQueue = queue.slice();
  53196. resetSchedulerState();
  53197. // call component updated and activated hooks
  53198. callActivatedHooks(activatedQueue);
  53199. callUpdatedHooks(updatedQueue);
  53200. // devtool hook
  53201. /* istanbul ignore if */
  53202. if (devtools && config.devtools) {
  53203. devtools.emit('flush');
  53204. }
  53205. }
  53206. function callUpdatedHooks (queue) {
  53207. var i = queue.length;
  53208. while (i--) {
  53209. var watcher = queue[i];
  53210. var vm = watcher.vm;
  53211. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  53212. callHook(vm, 'updated');
  53213. }
  53214. }
  53215. }
  53216. /**
  53217. * Queue a kept-alive component that was activated during patch.
  53218. * The queue will be processed after the entire tree has been patched.
  53219. */
  53220. function queueActivatedComponent (vm) {
  53221. // setting _inactive to false here so that a render function can
  53222. // rely on checking whether it's in an inactive tree (e.g. router-view)
  53223. vm._inactive = false;
  53224. activatedChildren.push(vm);
  53225. }
  53226. function callActivatedHooks (queue) {
  53227. for (var i = 0; i < queue.length; i++) {
  53228. queue[i]._inactive = true;
  53229. activateChildComponent(queue[i], true /* true */);
  53230. }
  53231. }
  53232. /**
  53233. * Push a watcher into the watcher queue.
  53234. * Jobs with duplicate IDs will be skipped unless it's
  53235. * pushed when the queue is being flushed.
  53236. */
  53237. function queueWatcher (watcher) {
  53238. var id = watcher.id;
  53239. if (has[id] == null) {
  53240. has[id] = true;
  53241. if (!flushing) {
  53242. queue.push(watcher);
  53243. } else {
  53244. // if already flushing, splice the watcher based on its id
  53245. // if already past its id, it will be run next immediately.
  53246. var i = queue.length - 1;
  53247. while (i > index && queue[i].id > watcher.id) {
  53248. i--;
  53249. }
  53250. queue.splice(i + 1, 0, watcher);
  53251. }
  53252. // queue the flush
  53253. if (!waiting) {
  53254. waiting = true;
  53255. if (!config.async) {
  53256. flushSchedulerQueue();
  53257. return
  53258. }
  53259. nextTick(flushSchedulerQueue);
  53260. }
  53261. }
  53262. }
  53263. /* */
  53264. var uid$2 = 0;
  53265. /**
  53266. * A watcher parses an expression, collects dependencies,
  53267. * and fires callback when the expression value changes.
  53268. * This is used for both the $watch() api and directives.
  53269. */
  53270. var Watcher = function Watcher (
  53271. vm,
  53272. expOrFn,
  53273. cb,
  53274. options,
  53275. isRenderWatcher
  53276. ) {
  53277. this.vm = vm;
  53278. if (isRenderWatcher) {
  53279. vm._watcher = this;
  53280. }
  53281. vm._watchers.push(this);
  53282. // options
  53283. if (options) {
  53284. this.deep = !!options.deep;
  53285. this.user = !!options.user;
  53286. this.lazy = !!options.lazy;
  53287. this.sync = !!options.sync;
  53288. this.before = options.before;
  53289. } else {
  53290. this.deep = this.user = this.lazy = this.sync = false;
  53291. }
  53292. this.cb = cb;
  53293. this.id = ++uid$2; // uid for batching
  53294. this.active = true;
  53295. this.dirty = this.lazy; // for lazy watchers
  53296. this.deps = [];
  53297. this.newDeps = [];
  53298. this.depIds = new _Set();
  53299. this.newDepIds = new _Set();
  53300. this.expression = expOrFn.toString();
  53301. // parse expression for getter
  53302. if (typeof expOrFn === 'function') {
  53303. this.getter = expOrFn;
  53304. } else {
  53305. this.getter = parsePath(expOrFn);
  53306. if (!this.getter) {
  53307. this.getter = noop;
  53308. warn(
  53309. "Failed watching path: \"" + expOrFn + "\" " +
  53310. 'Watcher only accepts simple dot-delimited paths. ' +
  53311. 'For full control, use a function instead.',
  53312. vm
  53313. );
  53314. }
  53315. }
  53316. this.value = this.lazy
  53317. ? undefined
  53318. : this.get();
  53319. };
  53320. /**
  53321. * Evaluate the getter, and re-collect dependencies.
  53322. */
  53323. Watcher.prototype.get = function get () {
  53324. pushTarget(this);
  53325. var value;
  53326. var vm = this.vm;
  53327. try {
  53328. value = this.getter.call(vm, vm);
  53329. } catch (e) {
  53330. if (this.user) {
  53331. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  53332. } else {
  53333. throw e
  53334. }
  53335. } finally {
  53336. // "touch" every property so they are all tracked as
  53337. // dependencies for deep watching
  53338. if (this.deep) {
  53339. traverse(value);
  53340. }
  53341. popTarget();
  53342. this.cleanupDeps();
  53343. }
  53344. return value
  53345. };
  53346. /**
  53347. * Add a dependency to this directive.
  53348. */
  53349. Watcher.prototype.addDep = function addDep (dep) {
  53350. var id = dep.id;
  53351. if (!this.newDepIds.has(id)) {
  53352. this.newDepIds.add(id);
  53353. this.newDeps.push(dep);
  53354. if (!this.depIds.has(id)) {
  53355. dep.addSub(this);
  53356. }
  53357. }
  53358. };
  53359. /**
  53360. * Clean up for dependency collection.
  53361. */
  53362. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  53363. var i = this.deps.length;
  53364. while (i--) {
  53365. var dep = this.deps[i];
  53366. if (!this.newDepIds.has(dep.id)) {
  53367. dep.removeSub(this);
  53368. }
  53369. }
  53370. var tmp = this.depIds;
  53371. this.depIds = this.newDepIds;
  53372. this.newDepIds = tmp;
  53373. this.newDepIds.clear();
  53374. tmp = this.deps;
  53375. this.deps = this.newDeps;
  53376. this.newDeps = tmp;
  53377. this.newDeps.length = 0;
  53378. };
  53379. /**
  53380. * Subscriber interface.
  53381. * Will be called when a dependency changes.
  53382. */
  53383. Watcher.prototype.update = function update () {
  53384. /* istanbul ignore else */
  53385. if (this.lazy) {
  53386. this.dirty = true;
  53387. } else if (this.sync) {
  53388. this.run();
  53389. } else {
  53390. queueWatcher(this);
  53391. }
  53392. };
  53393. /**
  53394. * Scheduler job interface.
  53395. * Will be called by the scheduler.
  53396. */
  53397. Watcher.prototype.run = function run () {
  53398. if (this.active) {
  53399. var value = this.get();
  53400. if (
  53401. value !== this.value ||
  53402. // Deep watchers and watchers on Object/Arrays should fire even
  53403. // when the value is the same, because the value may
  53404. // have mutated.
  53405. isObject(value) ||
  53406. this.deep
  53407. ) {
  53408. // set new value
  53409. var oldValue = this.value;
  53410. this.value = value;
  53411. if (this.user) {
  53412. try {
  53413. this.cb.call(this.vm, value, oldValue);
  53414. } catch (e) {
  53415. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  53416. }
  53417. } else {
  53418. this.cb.call(this.vm, value, oldValue);
  53419. }
  53420. }
  53421. }
  53422. };
  53423. /**
  53424. * Evaluate the value of the watcher.
  53425. * This only gets called for lazy watchers.
  53426. */
  53427. Watcher.prototype.evaluate = function evaluate () {
  53428. this.value = this.get();
  53429. this.dirty = false;
  53430. };
  53431. /**
  53432. * Depend on all deps collected by this watcher.
  53433. */
  53434. Watcher.prototype.depend = function depend () {
  53435. var i = this.deps.length;
  53436. while (i--) {
  53437. this.deps[i].depend();
  53438. }
  53439. };
  53440. /**
  53441. * Remove self from all dependencies' subscriber list.
  53442. */
  53443. Watcher.prototype.teardown = function teardown () {
  53444. if (this.active) {
  53445. // remove self from vm's watcher list
  53446. // this is a somewhat expensive operation so we skip it
  53447. // if the vm is being destroyed.
  53448. if (!this.vm._isBeingDestroyed) {
  53449. remove(this.vm._watchers, this);
  53450. }
  53451. var i = this.deps.length;
  53452. while (i--) {
  53453. this.deps[i].removeSub(this);
  53454. }
  53455. this.active = false;
  53456. }
  53457. };
  53458. /* */
  53459. var sharedPropertyDefinition = {
  53460. enumerable: true,
  53461. configurable: true,
  53462. get: noop,
  53463. set: noop
  53464. };
  53465. function proxy (target, sourceKey, key) {
  53466. sharedPropertyDefinition.get = function proxyGetter () {
  53467. return this[sourceKey][key]
  53468. };
  53469. sharedPropertyDefinition.set = function proxySetter (val) {
  53470. this[sourceKey][key] = val;
  53471. };
  53472. Object.defineProperty(target, key, sharedPropertyDefinition);
  53473. }
  53474. function initState (vm) {
  53475. vm._watchers = [];
  53476. var opts = vm.$options;
  53477. if (opts.props) { initProps(vm, opts.props); }
  53478. if (opts.methods) { initMethods(vm, opts.methods); }
  53479. if (opts.data) {
  53480. initData(vm);
  53481. } else {
  53482. observe(vm._data = {}, true /* asRootData */);
  53483. }
  53484. if (opts.computed) { initComputed(vm, opts.computed); }
  53485. if (opts.watch && opts.watch !== nativeWatch) {
  53486. initWatch(vm, opts.watch);
  53487. }
  53488. }
  53489. function initProps (vm, propsOptions) {
  53490. var propsData = vm.$options.propsData || {};
  53491. var props = vm._props = {};
  53492. // cache prop keys so that future props updates can iterate using Array
  53493. // instead of dynamic object key enumeration.
  53494. var keys = vm.$options._propKeys = [];
  53495. var isRoot = !vm.$parent;
  53496. // root instance props should be converted
  53497. if (!isRoot) {
  53498. toggleObserving(false);
  53499. }
  53500. var loop = function ( key ) {
  53501. keys.push(key);
  53502. var value = validateProp(key, propsOptions, propsData, vm);
  53503. /* istanbul ignore else */
  53504. {
  53505. var hyphenatedKey = hyphenate(key);
  53506. if (isReservedAttribute(hyphenatedKey) ||
  53507. config.isReservedAttr(hyphenatedKey)) {
  53508. warn(
  53509. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  53510. vm
  53511. );
  53512. }
  53513. defineReactive$$1(props, key, value, function () {
  53514. if (!isRoot && !isUpdatingChildComponent) {
  53515. warn(
  53516. "Avoid mutating a prop directly since the value will be " +
  53517. "overwritten whenever the parent component re-renders. " +
  53518. "Instead, use a data or computed property based on the prop's " +
  53519. "value. Prop being mutated: \"" + key + "\"",
  53520. vm
  53521. );
  53522. }
  53523. });
  53524. }
  53525. // static props are already proxied on the component's prototype
  53526. // during Vue.extend(). We only need to proxy props defined at
  53527. // instantiation here.
  53528. if (!(key in vm)) {
  53529. proxy(vm, "_props", key);
  53530. }
  53531. };
  53532. for (var key in propsOptions) loop( key );
  53533. toggleObserving(true);
  53534. }
  53535. function initData (vm) {
  53536. var data = vm.$options.data;
  53537. data = vm._data = typeof data === 'function'
  53538. ? getData(data, vm)
  53539. : data || {};
  53540. if (!isPlainObject(data)) {
  53541. data = {};
  53542. warn(
  53543. 'data functions should return an object:\n' +
  53544. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  53545. vm
  53546. );
  53547. }
  53548. // proxy data on instance
  53549. var keys = Object.keys(data);
  53550. var props = vm.$options.props;
  53551. var methods = vm.$options.methods;
  53552. var i = keys.length;
  53553. while (i--) {
  53554. var key = keys[i];
  53555. {
  53556. if (methods && hasOwn(methods, key)) {
  53557. warn(
  53558. ("Method \"" + key + "\" has already been defined as a data property."),
  53559. vm
  53560. );
  53561. }
  53562. }
  53563. if (props && hasOwn(props, key)) {
  53564. warn(
  53565. "The data property \"" + key + "\" is already declared as a prop. " +
  53566. "Use prop default value instead.",
  53567. vm
  53568. );
  53569. } else if (!isReserved(key)) {
  53570. proxy(vm, "_data", key);
  53571. }
  53572. }
  53573. // observe data
  53574. observe(data, true /* asRootData */);
  53575. }
  53576. function getData (data, vm) {
  53577. // #7573 disable dep collection when invoking data getters
  53578. pushTarget();
  53579. try {
  53580. return data.call(vm, vm)
  53581. } catch (e) {
  53582. handleError(e, vm, "data()");
  53583. return {}
  53584. } finally {
  53585. popTarget();
  53586. }
  53587. }
  53588. var computedWatcherOptions = { lazy: true };
  53589. function initComputed (vm, computed) {
  53590. // $flow-disable-line
  53591. var watchers = vm._computedWatchers = Object.create(null);
  53592. // computed properties are just getters during SSR
  53593. var isSSR = isServerRendering();
  53594. for (var key in computed) {
  53595. var userDef = computed[key];
  53596. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  53597. if (getter == null) {
  53598. warn(
  53599. ("Getter is missing for computed property \"" + key + "\"."),
  53600. vm
  53601. );
  53602. }
  53603. if (!isSSR) {
  53604. // create internal watcher for the computed property.
  53605. watchers[key] = new Watcher(
  53606. vm,
  53607. getter || noop,
  53608. noop,
  53609. computedWatcherOptions
  53610. );
  53611. }
  53612. // component-defined computed properties are already defined on the
  53613. // component prototype. We only need to define computed properties defined
  53614. // at instantiation here.
  53615. if (!(key in vm)) {
  53616. defineComputed(vm, key, userDef);
  53617. } else {
  53618. if (key in vm.$data) {
  53619. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  53620. } else if (vm.$options.props && key in vm.$options.props) {
  53621. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  53622. }
  53623. }
  53624. }
  53625. }
  53626. function defineComputed (
  53627. target,
  53628. key,
  53629. userDef
  53630. ) {
  53631. var shouldCache = !isServerRendering();
  53632. if (typeof userDef === 'function') {
  53633. sharedPropertyDefinition.get = shouldCache
  53634. ? createComputedGetter(key)
  53635. : createGetterInvoker(userDef);
  53636. sharedPropertyDefinition.set = noop;
  53637. } else {
  53638. sharedPropertyDefinition.get = userDef.get
  53639. ? shouldCache && userDef.cache !== false
  53640. ? createComputedGetter(key)
  53641. : createGetterInvoker(userDef.get)
  53642. : noop;
  53643. sharedPropertyDefinition.set = userDef.set || noop;
  53644. }
  53645. if (sharedPropertyDefinition.set === noop) {
  53646. sharedPropertyDefinition.set = function () {
  53647. warn(
  53648. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  53649. this
  53650. );
  53651. };
  53652. }
  53653. Object.defineProperty(target, key, sharedPropertyDefinition);
  53654. }
  53655. function createComputedGetter (key) {
  53656. return function computedGetter () {
  53657. var watcher = this._computedWatchers && this._computedWatchers[key];
  53658. if (watcher) {
  53659. if (watcher.dirty) {
  53660. watcher.evaluate();
  53661. }
  53662. if (Dep.target) {
  53663. watcher.depend();
  53664. }
  53665. return watcher.value
  53666. }
  53667. }
  53668. }
  53669. function createGetterInvoker(fn) {
  53670. return function computedGetter () {
  53671. return fn.call(this, this)
  53672. }
  53673. }
  53674. function initMethods (vm, methods) {
  53675. var props = vm.$options.props;
  53676. for (var key in methods) {
  53677. {
  53678. if (typeof methods[key] !== 'function') {
  53679. warn(
  53680. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  53681. "Did you reference the function correctly?",
  53682. vm
  53683. );
  53684. }
  53685. if (props && hasOwn(props, key)) {
  53686. warn(
  53687. ("Method \"" + key + "\" has already been defined as a prop."),
  53688. vm
  53689. );
  53690. }
  53691. if ((key in vm) && isReserved(key)) {
  53692. warn(
  53693. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  53694. "Avoid defining component methods that start with _ or $."
  53695. );
  53696. }
  53697. }
  53698. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  53699. }
  53700. }
  53701. function initWatch (vm, watch) {
  53702. for (var key in watch) {
  53703. var handler = watch[key];
  53704. if (Array.isArray(handler)) {
  53705. for (var i = 0; i < handler.length; i++) {
  53706. createWatcher(vm, key, handler[i]);
  53707. }
  53708. } else {
  53709. createWatcher(vm, key, handler);
  53710. }
  53711. }
  53712. }
  53713. function createWatcher (
  53714. vm,
  53715. expOrFn,
  53716. handler,
  53717. options
  53718. ) {
  53719. if (isPlainObject(handler)) {
  53720. options = handler;
  53721. handler = handler.handler;
  53722. }
  53723. if (typeof handler === 'string') {
  53724. handler = vm[handler];
  53725. }
  53726. return vm.$watch(expOrFn, handler, options)
  53727. }
  53728. function stateMixin (Vue) {
  53729. // flow somehow has problems with directly declared definition object
  53730. // when using Object.defineProperty, so we have to procedurally build up
  53731. // the object here.
  53732. var dataDef = {};
  53733. dataDef.get = function () { return this._data };
  53734. var propsDef = {};
  53735. propsDef.get = function () { return this._props };
  53736. {
  53737. dataDef.set = function () {
  53738. warn(
  53739. 'Avoid replacing instance root $data. ' +
  53740. 'Use nested data properties instead.',
  53741. this
  53742. );
  53743. };
  53744. propsDef.set = function () {
  53745. warn("$props is readonly.", this);
  53746. };
  53747. }
  53748. Object.defineProperty(Vue.prototype, '$data', dataDef);
  53749. Object.defineProperty(Vue.prototype, '$props', propsDef);
  53750. Vue.prototype.$set = set;
  53751. Vue.prototype.$delete = del;
  53752. Vue.prototype.$watch = function (
  53753. expOrFn,
  53754. cb,
  53755. options
  53756. ) {
  53757. var vm = this;
  53758. if (isPlainObject(cb)) {
  53759. return createWatcher(vm, expOrFn, cb, options)
  53760. }
  53761. options = options || {};
  53762. options.user = true;
  53763. var watcher = new Watcher(vm, expOrFn, cb, options);
  53764. if (options.immediate) {
  53765. try {
  53766. cb.call(vm, watcher.value);
  53767. } catch (error) {
  53768. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  53769. }
  53770. }
  53771. return function unwatchFn () {
  53772. watcher.teardown();
  53773. }
  53774. };
  53775. }
  53776. /* */
  53777. var uid$3 = 0;
  53778. function initMixin (Vue) {
  53779. Vue.prototype._init = function (options) {
  53780. var vm = this;
  53781. // a uid
  53782. vm._uid = uid$3++;
  53783. var startTag, endTag;
  53784. /* istanbul ignore if */
  53785. if (config.performance && mark) {
  53786. startTag = "vue-perf-start:" + (vm._uid);
  53787. endTag = "vue-perf-end:" + (vm._uid);
  53788. mark(startTag);
  53789. }
  53790. // a flag to avoid this being observed
  53791. vm._isVue = true;
  53792. // merge options
  53793. if (options && options._isComponent) {
  53794. // optimize internal component instantiation
  53795. // since dynamic options merging is pretty slow, and none of the
  53796. // internal component options needs special treatment.
  53797. initInternalComponent(vm, options);
  53798. } else {
  53799. vm.$options = mergeOptions(
  53800. resolveConstructorOptions(vm.constructor),
  53801. options || {},
  53802. vm
  53803. );
  53804. }
  53805. /* istanbul ignore else */
  53806. {
  53807. initProxy(vm);
  53808. }
  53809. // expose real self
  53810. vm._self = vm;
  53811. initLifecycle(vm);
  53812. initEvents(vm);
  53813. initRender(vm);
  53814. callHook(vm, 'beforeCreate');
  53815. initInjections(vm); // resolve injections before data/props
  53816. initState(vm);
  53817. initProvide(vm); // resolve provide after data/props
  53818. callHook(vm, 'created');
  53819. /* istanbul ignore if */
  53820. if (config.performance && mark) {
  53821. vm._name = formatComponentName(vm, false);
  53822. mark(endTag);
  53823. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  53824. }
  53825. if (vm.$options.el) {
  53826. vm.$mount(vm.$options.el);
  53827. }
  53828. };
  53829. }
  53830. function initInternalComponent (vm, options) {
  53831. var opts = vm.$options = Object.create(vm.constructor.options);
  53832. // doing this because it's faster than dynamic enumeration.
  53833. var parentVnode = options._parentVnode;
  53834. opts.parent = options.parent;
  53835. opts._parentVnode = parentVnode;
  53836. var vnodeComponentOptions = parentVnode.componentOptions;
  53837. opts.propsData = vnodeComponentOptions.propsData;
  53838. opts._parentListeners = vnodeComponentOptions.listeners;
  53839. opts._renderChildren = vnodeComponentOptions.children;
  53840. opts._componentTag = vnodeComponentOptions.tag;
  53841. if (options.render) {
  53842. opts.render = options.render;
  53843. opts.staticRenderFns = options.staticRenderFns;
  53844. }
  53845. }
  53846. function resolveConstructorOptions (Ctor) {
  53847. var options = Ctor.options;
  53848. if (Ctor.super) {
  53849. var superOptions = resolveConstructorOptions(Ctor.super);
  53850. var cachedSuperOptions = Ctor.superOptions;
  53851. if (superOptions !== cachedSuperOptions) {
  53852. // super option changed,
  53853. // need to resolve new options.
  53854. Ctor.superOptions = superOptions;
  53855. // check if there are any late-modified/attached options (#4976)
  53856. var modifiedOptions = resolveModifiedOptions(Ctor);
  53857. // update base extend options
  53858. if (modifiedOptions) {
  53859. extend(Ctor.extendOptions, modifiedOptions);
  53860. }
  53861. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  53862. if (options.name) {
  53863. options.components[options.name] = Ctor;
  53864. }
  53865. }
  53866. }
  53867. return options
  53868. }
  53869. function resolveModifiedOptions (Ctor) {
  53870. var modified;
  53871. var latest = Ctor.options;
  53872. var sealed = Ctor.sealedOptions;
  53873. for (var key in latest) {
  53874. if (latest[key] !== sealed[key]) {
  53875. if (!modified) { modified = {}; }
  53876. modified[key] = latest[key];
  53877. }
  53878. }
  53879. return modified
  53880. }
  53881. function Vue (options) {
  53882. if (!(this instanceof Vue)
  53883. ) {
  53884. warn('Vue is a constructor and should be called with the `new` keyword');
  53885. }
  53886. this._init(options);
  53887. }
  53888. initMixin(Vue);
  53889. stateMixin(Vue);
  53890. eventsMixin(Vue);
  53891. lifecycleMixin(Vue);
  53892. renderMixin(Vue);
  53893. /* */
  53894. function initUse (Vue) {
  53895. Vue.use = function (plugin) {
  53896. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  53897. if (installedPlugins.indexOf(plugin) > -1) {
  53898. return this
  53899. }
  53900. // additional parameters
  53901. var args = toArray(arguments, 1);
  53902. args.unshift(this);
  53903. if (typeof plugin.install === 'function') {
  53904. plugin.install.apply(plugin, args);
  53905. } else if (typeof plugin === 'function') {
  53906. plugin.apply(null, args);
  53907. }
  53908. installedPlugins.push(plugin);
  53909. return this
  53910. };
  53911. }
  53912. /* */
  53913. function initMixin$1 (Vue) {
  53914. Vue.mixin = function (mixin) {
  53915. this.options = mergeOptions(this.options, mixin);
  53916. return this
  53917. };
  53918. }
  53919. /* */
  53920. function initExtend (Vue) {
  53921. /**
  53922. * Each instance constructor, including Vue, has a unique
  53923. * cid. This enables us to create wrapped "child
  53924. * constructors" for prototypal inheritance and cache them.
  53925. */
  53926. Vue.cid = 0;
  53927. var cid = 1;
  53928. /**
  53929. * Class inheritance
  53930. */
  53931. Vue.extend = function (extendOptions) {
  53932. extendOptions = extendOptions || {};
  53933. var Super = this;
  53934. var SuperId = Super.cid;
  53935. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  53936. if (cachedCtors[SuperId]) {
  53937. return cachedCtors[SuperId]
  53938. }
  53939. var name = extendOptions.name || Super.options.name;
  53940. if (name) {
  53941. validateComponentName(name);
  53942. }
  53943. var Sub = function VueComponent (options) {
  53944. this._init(options);
  53945. };
  53946. Sub.prototype = Object.create(Super.prototype);
  53947. Sub.prototype.constructor = Sub;
  53948. Sub.cid = cid++;
  53949. Sub.options = mergeOptions(
  53950. Super.options,
  53951. extendOptions
  53952. );
  53953. Sub['super'] = Super;
  53954. // For props and computed properties, we define the proxy getters on
  53955. // the Vue instances at extension time, on the extended prototype. This
  53956. // avoids Object.defineProperty calls for each instance created.
  53957. if (Sub.options.props) {
  53958. initProps$1(Sub);
  53959. }
  53960. if (Sub.options.computed) {
  53961. initComputed$1(Sub);
  53962. }
  53963. // allow further extension/mixin/plugin usage
  53964. Sub.extend = Super.extend;
  53965. Sub.mixin = Super.mixin;
  53966. Sub.use = Super.use;
  53967. // create asset registers, so extended classes
  53968. // can have their private assets too.
  53969. ASSET_TYPES.forEach(function (type) {
  53970. Sub[type] = Super[type];
  53971. });
  53972. // enable recursive self-lookup
  53973. if (name) {
  53974. Sub.options.components[name] = Sub;
  53975. }
  53976. // keep a reference to the super options at extension time.
  53977. // later at instantiation we can check if Super's options have
  53978. // been updated.
  53979. Sub.superOptions = Super.options;
  53980. Sub.extendOptions = extendOptions;
  53981. Sub.sealedOptions = extend({}, Sub.options);
  53982. // cache constructor
  53983. cachedCtors[SuperId] = Sub;
  53984. return Sub
  53985. };
  53986. }
  53987. function initProps$1 (Comp) {
  53988. var props = Comp.options.props;
  53989. for (var key in props) {
  53990. proxy(Comp.prototype, "_props", key);
  53991. }
  53992. }
  53993. function initComputed$1 (Comp) {
  53994. var computed = Comp.options.computed;
  53995. for (var key in computed) {
  53996. defineComputed(Comp.prototype, key, computed[key]);
  53997. }
  53998. }
  53999. /* */
  54000. function initAssetRegisters (Vue) {
  54001. /**
  54002. * Create asset registration methods.
  54003. */
  54004. ASSET_TYPES.forEach(function (type) {
  54005. Vue[type] = function (
  54006. id,
  54007. definition
  54008. ) {
  54009. if (!definition) {
  54010. return this.options[type + 's'][id]
  54011. } else {
  54012. /* istanbul ignore if */
  54013. if (type === 'component') {
  54014. validateComponentName(id);
  54015. }
  54016. if (type === 'component' && isPlainObject(definition)) {
  54017. definition.name = definition.name || id;
  54018. definition = this.options._base.extend(definition);
  54019. }
  54020. if (type === 'directive' && typeof definition === 'function') {
  54021. definition = { bind: definition, update: definition };
  54022. }
  54023. this.options[type + 's'][id] = definition;
  54024. return definition
  54025. }
  54026. };
  54027. });
  54028. }
  54029. /* */
  54030. function getComponentName (opts) {
  54031. return opts && (opts.Ctor.options.name || opts.tag)
  54032. }
  54033. function matches (pattern, name) {
  54034. if (Array.isArray(pattern)) {
  54035. return pattern.indexOf(name) > -1
  54036. } else if (typeof pattern === 'string') {
  54037. return pattern.split(',').indexOf(name) > -1
  54038. } else if (isRegExp(pattern)) {
  54039. return pattern.test(name)
  54040. }
  54041. /* istanbul ignore next */
  54042. return false
  54043. }
  54044. function pruneCache (keepAliveInstance, filter) {
  54045. var cache = keepAliveInstance.cache;
  54046. var keys = keepAliveInstance.keys;
  54047. var _vnode = keepAliveInstance._vnode;
  54048. for (var key in cache) {
  54049. var cachedNode = cache[key];
  54050. if (cachedNode) {
  54051. var name = getComponentName(cachedNode.componentOptions);
  54052. if (name && !filter(name)) {
  54053. pruneCacheEntry(cache, key, keys, _vnode);
  54054. }
  54055. }
  54056. }
  54057. }
  54058. function pruneCacheEntry (
  54059. cache,
  54060. key,
  54061. keys,
  54062. current
  54063. ) {
  54064. var cached$$1 = cache[key];
  54065. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  54066. cached$$1.componentInstance.$destroy();
  54067. }
  54068. cache[key] = null;
  54069. remove(keys, key);
  54070. }
  54071. var patternTypes = [String, RegExp, Array];
  54072. var KeepAlive = {
  54073. name: 'keep-alive',
  54074. abstract: true,
  54075. props: {
  54076. include: patternTypes,
  54077. exclude: patternTypes,
  54078. max: [String, Number]
  54079. },
  54080. created: function created () {
  54081. this.cache = Object.create(null);
  54082. this.keys = [];
  54083. },
  54084. destroyed: function destroyed () {
  54085. for (var key in this.cache) {
  54086. pruneCacheEntry(this.cache, key, this.keys);
  54087. }
  54088. },
  54089. mounted: function mounted () {
  54090. var this$1 = this;
  54091. this.$watch('include', function (val) {
  54092. pruneCache(this$1, function (name) { return matches(val, name); });
  54093. });
  54094. this.$watch('exclude', function (val) {
  54095. pruneCache(this$1, function (name) { return !matches(val, name); });
  54096. });
  54097. },
  54098. render: function render () {
  54099. var slot = this.$slots.default;
  54100. var vnode = getFirstComponentChild(slot);
  54101. var componentOptions = vnode && vnode.componentOptions;
  54102. if (componentOptions) {
  54103. // check pattern
  54104. var name = getComponentName(componentOptions);
  54105. var ref = this;
  54106. var include = ref.include;
  54107. var exclude = ref.exclude;
  54108. if (
  54109. // not included
  54110. (include && (!name || !matches(include, name))) ||
  54111. // excluded
  54112. (exclude && name && matches(exclude, name))
  54113. ) {
  54114. return vnode
  54115. }
  54116. var ref$1 = this;
  54117. var cache = ref$1.cache;
  54118. var keys = ref$1.keys;
  54119. var key = vnode.key == null
  54120. // same constructor may get registered as different local components
  54121. // so cid alone is not enough (#3269)
  54122. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  54123. : vnode.key;
  54124. if (cache[key]) {
  54125. vnode.componentInstance = cache[key].componentInstance;
  54126. // make current key freshest
  54127. remove(keys, key);
  54128. keys.push(key);
  54129. } else {
  54130. cache[key] = vnode;
  54131. keys.push(key);
  54132. // prune oldest entry
  54133. if (this.max && keys.length > parseInt(this.max)) {
  54134. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  54135. }
  54136. }
  54137. vnode.data.keepAlive = true;
  54138. }
  54139. return vnode || (slot && slot[0])
  54140. }
  54141. };
  54142. var builtInComponents = {
  54143. KeepAlive: KeepAlive
  54144. };
  54145. /* */
  54146. function initGlobalAPI (Vue) {
  54147. // config
  54148. var configDef = {};
  54149. configDef.get = function () { return config; };
  54150. {
  54151. configDef.set = function () {
  54152. warn(
  54153. 'Do not replace the Vue.config object, set individual fields instead.'
  54154. );
  54155. };
  54156. }
  54157. Object.defineProperty(Vue, 'config', configDef);
  54158. // exposed util methods.
  54159. // NOTE: these are not considered part of the public API - avoid relying on
  54160. // them unless you are aware of the risk.
  54161. Vue.util = {
  54162. warn: warn,
  54163. extend: extend,
  54164. mergeOptions: mergeOptions,
  54165. defineReactive: defineReactive$$1
  54166. };
  54167. Vue.set = set;
  54168. Vue.delete = del;
  54169. Vue.nextTick = nextTick;
  54170. // 2.6 explicit observable API
  54171. Vue.observable = function (obj) {
  54172. observe(obj);
  54173. return obj
  54174. };
  54175. Vue.options = Object.create(null);
  54176. ASSET_TYPES.forEach(function (type) {
  54177. Vue.options[type + 's'] = Object.create(null);
  54178. });
  54179. // this is used to identify the "base" constructor to extend all plain-object
  54180. // components with in Weex's multi-instance scenarios.
  54181. Vue.options._base = Vue;
  54182. extend(Vue.options.components, builtInComponents);
  54183. initUse(Vue);
  54184. initMixin$1(Vue);
  54185. initExtend(Vue);
  54186. initAssetRegisters(Vue);
  54187. }
  54188. initGlobalAPI(Vue);
  54189. Object.defineProperty(Vue.prototype, '$isServer', {
  54190. get: isServerRendering
  54191. });
  54192. Object.defineProperty(Vue.prototype, '$ssrContext', {
  54193. get: function get () {
  54194. /* istanbul ignore next */
  54195. return this.$vnode && this.$vnode.ssrContext
  54196. }
  54197. });
  54198. // expose FunctionalRenderContext for ssr runtime helper installation
  54199. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  54200. value: FunctionalRenderContext
  54201. });
  54202. Vue.version = '2.6.11';
  54203. /* */
  54204. // these are reserved for web because they are directly compiled away
  54205. // during template compilation
  54206. var isReservedAttr = makeMap('style,class');
  54207. // attributes that should be using props for binding
  54208. var acceptValue = makeMap('input,textarea,option,select,progress');
  54209. var mustUseProp = function (tag, type, attr) {
  54210. return (
  54211. (attr === 'value' && acceptValue(tag)) && type !== 'button' ||
  54212. (attr === 'selected' && tag === 'option') ||
  54213. (attr === 'checked' && tag === 'input') ||
  54214. (attr === 'muted' && tag === 'video')
  54215. )
  54216. };
  54217. var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck');
  54218. var isValidContentEditableValue = makeMap('events,caret,typing,plaintext-only');
  54219. var convertEnumeratedValue = function (key, value) {
  54220. return isFalsyAttrValue(value) || value === 'false'
  54221. ? 'false'
  54222. // allow arbitrary string value for contenteditable
  54223. : key === 'contenteditable' && isValidContentEditableValue(value)
  54224. ? value
  54225. : 'true'
  54226. };
  54227. var isBooleanAttr = makeMap(
  54228. 'allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' +
  54229. 'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +
  54230. 'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +
  54231. 'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +
  54232. 'required,reversed,scoped,seamless,selected,sortable,translate,' +
  54233. 'truespeed,typemustmatch,visible'
  54234. );
  54235. var xlinkNS = 'http://www.w3.org/1999/xlink';
  54236. var isXlink = function (name) {
  54237. return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink'
  54238. };
  54239. var getXlinkProp = function (name) {
  54240. return isXlink(name) ? name.slice(6, name.length) : ''
  54241. };
  54242. var isFalsyAttrValue = function (val) {
  54243. return val == null || val === false
  54244. };
  54245. /* */
  54246. function genClassForVnode (vnode) {
  54247. var data = vnode.data;
  54248. var parentNode = vnode;
  54249. var childNode = vnode;
  54250. while (isDef(childNode.componentInstance)) {
  54251. childNode = childNode.componentInstance._vnode;
  54252. if (childNode && childNode.data) {
  54253. data = mergeClassData(childNode.data, data);
  54254. }
  54255. }
  54256. while (isDef(parentNode = parentNode.parent)) {
  54257. if (parentNode && parentNode.data) {
  54258. data = mergeClassData(data, parentNode.data);
  54259. }
  54260. }
  54261. return renderClass(data.staticClass, data.class)
  54262. }
  54263. function mergeClassData (child, parent) {
  54264. return {
  54265. staticClass: concat(child.staticClass, parent.staticClass),
  54266. class: isDef(child.class)
  54267. ? [child.class, parent.class]
  54268. : parent.class
  54269. }
  54270. }
  54271. function renderClass (
  54272. staticClass,
  54273. dynamicClass
  54274. ) {
  54275. if (isDef(staticClass) || isDef(dynamicClass)) {
  54276. return concat(staticClass, stringifyClass(dynamicClass))
  54277. }
  54278. /* istanbul ignore next */
  54279. return ''
  54280. }
  54281. function concat (a, b) {
  54282. return a ? b ? (a + ' ' + b) : a : (b || '')
  54283. }
  54284. function stringifyClass (value) {
  54285. if (Array.isArray(value)) {
  54286. return stringifyArray(value)
  54287. }
  54288. if (isObject(value)) {
  54289. return stringifyObject(value)
  54290. }
  54291. if (typeof value === 'string') {
  54292. return value
  54293. }
  54294. /* istanbul ignore next */
  54295. return ''
  54296. }
  54297. function stringifyArray (value) {
  54298. var res = '';
  54299. var stringified;
  54300. for (var i = 0, l = value.length; i < l; i++) {
  54301. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  54302. if (res) { res += ' '; }
  54303. res += stringified;
  54304. }
  54305. }
  54306. return res
  54307. }
  54308. function stringifyObject (value) {
  54309. var res = '';
  54310. for (var key in value) {
  54311. if (value[key]) {
  54312. if (res) { res += ' '; }
  54313. res += key;
  54314. }
  54315. }
  54316. return res
  54317. }
  54318. /* */
  54319. var namespaceMap = {
  54320. svg: 'http://www.w3.org/2000/svg',
  54321. math: 'http://www.w3.org/1998/Math/MathML'
  54322. };
  54323. var isHTMLTag = makeMap(
  54324. 'html,body,base,head,link,meta,style,title,' +
  54325. 'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +
  54326. 'div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,' +
  54327. 'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +
  54328. 's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' +
  54329. 'embed,object,param,source,canvas,script,noscript,del,ins,' +
  54330. 'caption,col,colgroup,table,thead,tbody,td,th,tr,' +
  54331. 'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' +
  54332. 'output,progress,select,textarea,' +
  54333. 'details,dialog,menu,menuitem,summary,' +
  54334. 'content,element,shadow,template,blockquote,iframe,tfoot'
  54335. );
  54336. // this map is intentionally selective, only covering SVG elements that may
  54337. // contain child elements.
  54338. var isSVG = makeMap(
  54339. 'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,' +
  54340. 'foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +
  54341. 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view',
  54342. true
  54343. );
  54344. var isPreTag = function (tag) { return tag === 'pre'; };
  54345. var isReservedTag = function (tag) {
  54346. return isHTMLTag(tag) || isSVG(tag)
  54347. };
  54348. function getTagNamespace (tag) {
  54349. if (isSVG(tag)) {
  54350. return 'svg'
  54351. }
  54352. // basic support for MathML
  54353. // note it doesn't support other MathML elements being component roots
  54354. if (tag === 'math') {
  54355. return 'math'
  54356. }
  54357. }
  54358. var unknownElementCache = Object.create(null);
  54359. function isUnknownElement (tag) {
  54360. /* istanbul ignore if */
  54361. if (!inBrowser) {
  54362. return true
  54363. }
  54364. if (isReservedTag(tag)) {
  54365. return false
  54366. }
  54367. tag = tag.toLowerCase();
  54368. /* istanbul ignore if */
  54369. if (unknownElementCache[tag] != null) {
  54370. return unknownElementCache[tag]
  54371. }
  54372. var el = document.createElement(tag);
  54373. if (tag.indexOf('-') > -1) {
  54374. // http://stackoverflow.com/a/28210364/1070244
  54375. return (unknownElementCache[tag] = (
  54376. el.constructor === window.HTMLUnknownElement ||
  54377. el.constructor === window.HTMLElement
  54378. ))
  54379. } else {
  54380. return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString()))
  54381. }
  54382. }
  54383. var isTextInputType = makeMap('text,number,password,search,email,tel,url');
  54384. /* */
  54385. /**
  54386. * Query an element selector if it's not an element already.
  54387. */
  54388. function query (el) {
  54389. if (typeof el === 'string') {
  54390. var selected = document.querySelector(el);
  54391. if (!selected) {
  54392. warn(
  54393. 'Cannot find element: ' + el
  54394. );
  54395. return document.createElement('div')
  54396. }
  54397. return selected
  54398. } else {
  54399. return el
  54400. }
  54401. }
  54402. /* */
  54403. function createElement$1 (tagName, vnode) {
  54404. var elm = document.createElement(tagName);
  54405. if (tagName !== 'select') {
  54406. return elm
  54407. }
  54408. // false or null will remove the attribute but undefined will not
  54409. if (vnode.data && vnode.data.attrs && vnode.data.attrs.multiple !== undefined) {
  54410. elm.setAttribute('multiple', 'multiple');
  54411. }
  54412. return elm
  54413. }
  54414. function createElementNS (namespace, tagName) {
  54415. return document.createElementNS(namespaceMap[namespace], tagName)
  54416. }
  54417. function createTextNode (text) {
  54418. return document.createTextNode(text)
  54419. }
  54420. function createComment (text) {
  54421. return document.createComment(text)
  54422. }
  54423. function insertBefore (parentNode, newNode, referenceNode) {
  54424. parentNode.insertBefore(newNode, referenceNode);
  54425. }
  54426. function removeChild (node, child) {
  54427. node.removeChild(child);
  54428. }
  54429. function appendChild (node, child) {
  54430. node.appendChild(child);
  54431. }
  54432. function parentNode (node) {
  54433. return node.parentNode
  54434. }
  54435. function nextSibling (node) {
  54436. return node.nextSibling
  54437. }
  54438. function tagName (node) {
  54439. return node.tagName
  54440. }
  54441. function setTextContent (node, text) {
  54442. node.textContent = text;
  54443. }
  54444. function setStyleScope (node, scopeId) {
  54445. node.setAttribute(scopeId, '');
  54446. }
  54447. var nodeOps = /*#__PURE__*/Object.freeze({
  54448. createElement: createElement$1,
  54449. createElementNS: createElementNS,
  54450. createTextNode: createTextNode,
  54451. createComment: createComment,
  54452. insertBefore: insertBefore,
  54453. removeChild: removeChild,
  54454. appendChild: appendChild,
  54455. parentNode: parentNode,
  54456. nextSibling: nextSibling,
  54457. tagName: tagName,
  54458. setTextContent: setTextContent,
  54459. setStyleScope: setStyleScope
  54460. });
  54461. /* */
  54462. var ref = {
  54463. create: function create (_, vnode) {
  54464. registerRef(vnode);
  54465. },
  54466. update: function update (oldVnode, vnode) {
  54467. if (oldVnode.data.ref !== vnode.data.ref) {
  54468. registerRef(oldVnode, true);
  54469. registerRef(vnode);
  54470. }
  54471. },
  54472. destroy: function destroy (vnode) {
  54473. registerRef(vnode, true);
  54474. }
  54475. };
  54476. function registerRef (vnode, isRemoval) {
  54477. var key = vnode.data.ref;
  54478. if (!isDef(key)) { return }
  54479. var vm = vnode.context;
  54480. var ref = vnode.componentInstance || vnode.elm;
  54481. var refs = vm.$refs;
  54482. if (isRemoval) {
  54483. if (Array.isArray(refs[key])) {
  54484. remove(refs[key], ref);
  54485. } else if (refs[key] === ref) {
  54486. refs[key] = undefined;
  54487. }
  54488. } else {
  54489. if (vnode.data.refInFor) {
  54490. if (!Array.isArray(refs[key])) {
  54491. refs[key] = [ref];
  54492. } else if (refs[key].indexOf(ref) < 0) {
  54493. // $flow-disable-line
  54494. refs[key].push(ref);
  54495. }
  54496. } else {
  54497. refs[key] = ref;
  54498. }
  54499. }
  54500. }
  54501. /**
  54502. * Virtual DOM patching algorithm based on Snabbdom by
  54503. * Simon Friis Vindum (@paldepind)
  54504. * Licensed under the MIT License
  54505. * https://github.com/paldepind/snabbdom/blob/master/LICENSE
  54506. *
  54507. * modified by Evan You (@yyx990803)
  54508. *
  54509. * Not type-checking this because this file is perf-critical and the cost
  54510. * of making flow understand it is not worth it.
  54511. */
  54512. var emptyNode = new VNode('', {}, []);
  54513. var hooks = ['create', 'activate', 'update', 'remove', 'destroy'];
  54514. function sameVnode (a, b) {
  54515. return (
  54516. a.key === b.key && (
  54517. (
  54518. a.tag === b.tag &&
  54519. a.isComment === b.isComment &&
  54520. isDef(a.data) === isDef(b.data) &&
  54521. sameInputType(a, b)
  54522. ) || (
  54523. isTrue(a.isAsyncPlaceholder) &&
  54524. a.asyncFactory === b.asyncFactory &&
  54525. isUndef(b.asyncFactory.error)
  54526. )
  54527. )
  54528. )
  54529. }
  54530. function sameInputType (a, b) {
  54531. if (a.tag !== 'input') { return true }
  54532. var i;
  54533. var typeA = isDef(i = a.data) && isDef(i = i.attrs) && i.type;
  54534. var typeB = isDef(i = b.data) && isDef(i = i.attrs) && i.type;
  54535. return typeA === typeB || isTextInputType(typeA) && isTextInputType(typeB)
  54536. }
  54537. function createKeyToOldIdx (children, beginIdx, endIdx) {
  54538. var i, key;
  54539. var map = {};
  54540. for (i = beginIdx; i <= endIdx; ++i) {
  54541. key = children[i].key;
  54542. if (isDef(key)) { map[key] = i; }
  54543. }
  54544. return map
  54545. }
  54546. function createPatchFunction (backend) {
  54547. var i, j;
  54548. var cbs = {};
  54549. var modules = backend.modules;
  54550. var nodeOps = backend.nodeOps;
  54551. for (i = 0; i < hooks.length; ++i) {
  54552. cbs[hooks[i]] = [];
  54553. for (j = 0; j < modules.length; ++j) {
  54554. if (isDef(modules[j][hooks[i]])) {
  54555. cbs[hooks[i]].push(modules[j][hooks[i]]);
  54556. }
  54557. }
  54558. }
  54559. function emptyNodeAt (elm) {
  54560. return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm)
  54561. }
  54562. function createRmCb (childElm, listeners) {
  54563. function remove$$1 () {
  54564. if (--remove$$1.listeners === 0) {
  54565. removeNode(childElm);
  54566. }
  54567. }
  54568. remove$$1.listeners = listeners;
  54569. return remove$$1
  54570. }
  54571. function removeNode (el) {
  54572. var parent = nodeOps.parentNode(el);
  54573. // element may have already been removed due to v-html / v-text
  54574. if (isDef(parent)) {
  54575. nodeOps.removeChild(parent, el);
  54576. }
  54577. }
  54578. function isUnknownElement$$1 (vnode, inVPre) {
  54579. return (
  54580. !inVPre &&
  54581. !vnode.ns &&
  54582. !(
  54583. config.ignoredElements.length &&
  54584. config.ignoredElements.some(function (ignore) {
  54585. return isRegExp(ignore)
  54586. ? ignore.test(vnode.tag)
  54587. : ignore === vnode.tag
  54588. })
  54589. ) &&
  54590. config.isUnknownElement(vnode.tag)
  54591. )
  54592. }
  54593. var creatingElmInVPre = 0;
  54594. function createElm (
  54595. vnode,
  54596. insertedVnodeQueue,
  54597. parentElm,
  54598. refElm,
  54599. nested,
  54600. ownerArray,
  54601. index
  54602. ) {
  54603. if (isDef(vnode.elm) && isDef(ownerArray)) {
  54604. // This vnode was used in a previous render!
  54605. // now it's used as a new node, overwriting its elm would cause
  54606. // potential patch errors down the road when it's used as an insertion
  54607. // reference node. Instead, we clone the node on-demand before creating
  54608. // associated DOM element for it.
  54609. vnode = ownerArray[index] = cloneVNode(vnode);
  54610. }
  54611. vnode.isRootInsert = !nested; // for transition enter check
  54612. if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) {
  54613. return
  54614. }
  54615. var data = vnode.data;
  54616. var children = vnode.children;
  54617. var tag = vnode.tag;
  54618. if (isDef(tag)) {
  54619. {
  54620. if (data && data.pre) {
  54621. creatingElmInVPre++;
  54622. }
  54623. if (isUnknownElement$$1(vnode, creatingElmInVPre)) {
  54624. warn(
  54625. 'Unknown custom element: <' + tag + '> - did you ' +
  54626. 'register the component correctly? For recursive components, ' +
  54627. 'make sure to provide the "name" option.',
  54628. vnode.context
  54629. );
  54630. }
  54631. }
  54632. vnode.elm = vnode.ns
  54633. ? nodeOps.createElementNS(vnode.ns, tag)
  54634. : nodeOps.createElement(tag, vnode);
  54635. setScope(vnode);
  54636. /* istanbul ignore if */
  54637. {
  54638. createChildren(vnode, children, insertedVnodeQueue);
  54639. if (isDef(data)) {
  54640. invokeCreateHooks(vnode, insertedVnodeQueue);
  54641. }
  54642. insert(parentElm, vnode.elm, refElm);
  54643. }
  54644. if (data && data.pre) {
  54645. creatingElmInVPre--;
  54646. }
  54647. } else if (isTrue(vnode.isComment)) {
  54648. vnode.elm = nodeOps.createComment(vnode.text);
  54649. insert(parentElm, vnode.elm, refElm);
  54650. } else {
  54651. vnode.elm = nodeOps.createTextNode(vnode.text);
  54652. insert(parentElm, vnode.elm, refElm);
  54653. }
  54654. }
  54655. function createComponent (vnode, insertedVnodeQueue, parentElm, refElm) {
  54656. var i = vnode.data;
  54657. if (isDef(i)) {
  54658. var isReactivated = isDef(vnode.componentInstance) && i.keepAlive;
  54659. if (isDef(i = i.hook) && isDef(i = i.init)) {
  54660. i(vnode, false /* hydrating */);
  54661. }
  54662. // after calling the init hook, if the vnode is a child component
  54663. // it should've created a child instance and mounted it. the child
  54664. // component also has set the placeholder vnode's elm.
  54665. // in that case we can just return the element and be done.
  54666. if (isDef(vnode.componentInstance)) {
  54667. initComponent(vnode, insertedVnodeQueue);
  54668. insert(parentElm, vnode.elm, refElm);
  54669. if (isTrue(isReactivated)) {
  54670. reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm);
  54671. }
  54672. return true
  54673. }
  54674. }
  54675. }
  54676. function initComponent (vnode, insertedVnodeQueue) {
  54677. if (isDef(vnode.data.pendingInsert)) {
  54678. insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert);
  54679. vnode.data.pendingInsert = null;
  54680. }
  54681. vnode.elm = vnode.componentInstance.$el;
  54682. if (isPatchable(vnode)) {
  54683. invokeCreateHooks(vnode, insertedVnodeQueue);
  54684. setScope(vnode);
  54685. } else {
  54686. // empty component root.
  54687. // skip all element-related modules except for ref (#3455)
  54688. registerRef(vnode);
  54689. // make sure to invoke the insert hook
  54690. insertedVnodeQueue.push(vnode);
  54691. }
  54692. }
  54693. function reactivateComponent (vnode, insertedVnodeQueue, parentElm, refElm) {
  54694. var i;
  54695. // hack for #4339: a reactivated component with inner transition
  54696. // does not trigger because the inner node's created hooks are not called
  54697. // again. It's not ideal to involve module-specific logic in here but
  54698. // there doesn't seem to be a better way to do it.
  54699. var innerNode = vnode;
  54700. while (innerNode.componentInstance) {
  54701. innerNode = innerNode.componentInstance._vnode;
  54702. if (isDef(i = innerNode.data) && isDef(i = i.transition)) {
  54703. for (i = 0; i < cbs.activate.length; ++i) {
  54704. cbs.activate[i](emptyNode, innerNode);
  54705. }
  54706. insertedVnodeQueue.push(innerNode);
  54707. break
  54708. }
  54709. }
  54710. // unlike a newly created component,
  54711. // a reactivated keep-alive component doesn't insert itself
  54712. insert(parentElm, vnode.elm, refElm);
  54713. }
  54714. function insert (parent, elm, ref$$1) {
  54715. if (isDef(parent)) {
  54716. if (isDef(ref$$1)) {
  54717. if (nodeOps.parentNode(ref$$1) === parent) {
  54718. nodeOps.insertBefore(parent, elm, ref$$1);
  54719. }
  54720. } else {
  54721. nodeOps.appendChild(parent, elm);
  54722. }
  54723. }
  54724. }
  54725. function createChildren (vnode, children, insertedVnodeQueue) {
  54726. if (Array.isArray(children)) {
  54727. {
  54728. checkDuplicateKeys(children);
  54729. }
  54730. for (var i = 0; i < children.length; ++i) {
  54731. createElm(children[i], insertedVnodeQueue, vnode.elm, null, true, children, i);
  54732. }
  54733. } else if (isPrimitive(vnode.text)) {
  54734. nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(String(vnode.text)));
  54735. }
  54736. }
  54737. function isPatchable (vnode) {
  54738. while (vnode.componentInstance) {
  54739. vnode = vnode.componentInstance._vnode;
  54740. }
  54741. return isDef(vnode.tag)
  54742. }
  54743. function invokeCreateHooks (vnode, insertedVnodeQueue) {
  54744. for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {
  54745. cbs.create[i$1](emptyNode, vnode);
  54746. }
  54747. i = vnode.data.hook; // Reuse variable
  54748. if (isDef(i)) {
  54749. if (isDef(i.create)) { i.create(emptyNode, vnode); }
  54750. if (isDef(i.insert)) { insertedVnodeQueue.push(vnode); }
  54751. }
  54752. }
  54753. // set scope id attribute for scoped CSS.
  54754. // this is implemented as a special case to avoid the overhead
  54755. // of going through the normal attribute patching process.
  54756. function setScope (vnode) {
  54757. var i;
  54758. if (isDef(i = vnode.fnScopeId)) {
  54759. nodeOps.setStyleScope(vnode.elm, i);
  54760. } else {
  54761. var ancestor = vnode;
  54762. while (ancestor) {
  54763. if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {
  54764. nodeOps.setStyleScope(vnode.elm, i);
  54765. }
  54766. ancestor = ancestor.parent;
  54767. }
  54768. }
  54769. // for slot content they should also get the scopeId from the host instance.
  54770. if (isDef(i = activeInstance) &&
  54771. i !== vnode.context &&
  54772. i !== vnode.fnContext &&
  54773. isDef(i = i.$options._scopeId)
  54774. ) {
  54775. nodeOps.setStyleScope(vnode.elm, i);
  54776. }
  54777. }
  54778. function addVnodes (parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) {
  54779. for (; startIdx <= endIdx; ++startIdx) {
  54780. createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm, false, vnodes, startIdx);
  54781. }
  54782. }
  54783. function invokeDestroyHook (vnode) {
  54784. var i, j;
  54785. var data = vnode.data;
  54786. if (isDef(data)) {
  54787. if (isDef(i = data.hook) && isDef(i = i.destroy)) { i(vnode); }
  54788. for (i = 0; i < cbs.destroy.length; ++i) { cbs.destroy[i](vnode); }
  54789. }
  54790. if (isDef(i = vnode.children)) {
  54791. for (j = 0; j < vnode.children.length; ++j) {
  54792. invokeDestroyHook(vnode.children[j]);
  54793. }
  54794. }
  54795. }
  54796. function removeVnodes (vnodes, startIdx, endIdx) {
  54797. for (; startIdx <= endIdx; ++startIdx) {
  54798. var ch = vnodes[startIdx];
  54799. if (isDef(ch)) {
  54800. if (isDef(ch.tag)) {
  54801. removeAndInvokeRemoveHook(ch);
  54802. invokeDestroyHook(ch);
  54803. } else { // Text node
  54804. removeNode(ch.elm);
  54805. }
  54806. }
  54807. }
  54808. }
  54809. function removeAndInvokeRemoveHook (vnode, rm) {
  54810. if (isDef(rm) || isDef(vnode.data)) {
  54811. var i;
  54812. var listeners = cbs.remove.length + 1;
  54813. if (isDef(rm)) {
  54814. // we have a recursively passed down rm callback
  54815. // increase the listeners count
  54816. rm.listeners += listeners;
  54817. } else {
  54818. // directly removing
  54819. rm = createRmCb(vnode.elm, listeners);
  54820. }
  54821. // recursively invoke hooks on child component root node
  54822. if (isDef(i = vnode.componentInstance) && isDef(i = i._vnode) && isDef(i.data)) {
  54823. removeAndInvokeRemoveHook(i, rm);
  54824. }
  54825. for (i = 0; i < cbs.remove.length; ++i) {
  54826. cbs.remove[i](vnode, rm);
  54827. }
  54828. if (isDef(i = vnode.data.hook) && isDef(i = i.remove)) {
  54829. i(vnode, rm);
  54830. } else {
  54831. rm();
  54832. }
  54833. } else {
  54834. removeNode(vnode.elm);
  54835. }
  54836. }
  54837. function updateChildren (parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) {
  54838. var oldStartIdx = 0;
  54839. var newStartIdx = 0;
  54840. var oldEndIdx = oldCh.length - 1;
  54841. var oldStartVnode = oldCh[0];
  54842. var oldEndVnode = oldCh[oldEndIdx];
  54843. var newEndIdx = newCh.length - 1;
  54844. var newStartVnode = newCh[0];
  54845. var newEndVnode = newCh[newEndIdx];
  54846. var oldKeyToIdx, idxInOld, vnodeToMove, refElm;
  54847. // removeOnly is a special flag used only by <transition-group>
  54848. // to ensure removed elements stay in correct relative positions
  54849. // during leaving transitions
  54850. var canMove = !removeOnly;
  54851. {
  54852. checkDuplicateKeys(newCh);
  54853. }
  54854. while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
  54855. if (isUndef(oldStartVnode)) {
  54856. oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left
  54857. } else if (isUndef(oldEndVnode)) {
  54858. oldEndVnode = oldCh[--oldEndIdx];
  54859. } else if (sameVnode(oldStartVnode, newStartVnode)) {
  54860. patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
  54861. oldStartVnode = oldCh[++oldStartIdx];
  54862. newStartVnode = newCh[++newStartIdx];
  54863. } else if (sameVnode(oldEndVnode, newEndVnode)) {
  54864. patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);
  54865. oldEndVnode = oldCh[--oldEndIdx];
  54866. newEndVnode = newCh[--newEndIdx];
  54867. } else if (sameVnode(oldStartVnode, newEndVnode)) { // Vnode moved right
  54868. patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);
  54869. canMove && nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm));
  54870. oldStartVnode = oldCh[++oldStartIdx];
  54871. newEndVnode = newCh[--newEndIdx];
  54872. } else if (sameVnode(oldEndVnode, newStartVnode)) { // Vnode moved left
  54873. patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
  54874. canMove && nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);
  54875. oldEndVnode = oldCh[--oldEndIdx];
  54876. newStartVnode = newCh[++newStartIdx];
  54877. } else {
  54878. if (isUndef(oldKeyToIdx)) { oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx); }
  54879. idxInOld = isDef(newStartVnode.key)
  54880. ? oldKeyToIdx[newStartVnode.key]
  54881. : findIdxInOld(newStartVnode, oldCh, oldStartIdx, oldEndIdx);
  54882. if (isUndef(idxInOld)) { // New element
  54883. createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);
  54884. } else {
  54885. vnodeToMove = oldCh[idxInOld];
  54886. if (sameVnode(vnodeToMove, newStartVnode)) {
  54887. patchVnode(vnodeToMove, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
  54888. oldCh[idxInOld] = undefined;
  54889. canMove && nodeOps.insertBefore(parentElm, vnodeToMove.elm, oldStartVnode.elm);
  54890. } else {
  54891. // same key but different element. treat as new element
  54892. createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);
  54893. }
  54894. }
  54895. newStartVnode = newCh[++newStartIdx];
  54896. }
  54897. }
  54898. if (oldStartIdx > oldEndIdx) {
  54899. refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;
  54900. addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
  54901. } else if (newStartIdx > newEndIdx) {
  54902. removeVnodes(oldCh, oldStartIdx, oldEndIdx);
  54903. }
  54904. }
  54905. function checkDuplicateKeys (children) {
  54906. var seenKeys = {};
  54907. for (var i = 0; i < children.length; i++) {
  54908. var vnode = children[i];
  54909. var key = vnode.key;
  54910. if (isDef(key)) {
  54911. if (seenKeys[key]) {
  54912. warn(
  54913. ("Duplicate keys detected: '" + key + "'. This may cause an update error."),
  54914. vnode.context
  54915. );
  54916. } else {
  54917. seenKeys[key] = true;
  54918. }
  54919. }
  54920. }
  54921. }
  54922. function findIdxInOld (node, oldCh, start, end) {
  54923. for (var i = start; i < end; i++) {
  54924. var c = oldCh[i];
  54925. if (isDef(c) && sameVnode(node, c)) { return i }
  54926. }
  54927. }
  54928. function patchVnode (
  54929. oldVnode,
  54930. vnode,
  54931. insertedVnodeQueue,
  54932. ownerArray,
  54933. index,
  54934. removeOnly
  54935. ) {
  54936. if (oldVnode === vnode) {
  54937. return
  54938. }
  54939. if (isDef(vnode.elm) && isDef(ownerArray)) {
  54940. // clone reused vnode
  54941. vnode = ownerArray[index] = cloneVNode(vnode);
  54942. }
  54943. var elm = vnode.elm = oldVnode.elm;
  54944. if (isTrue(oldVnode.isAsyncPlaceholder)) {
  54945. if (isDef(vnode.asyncFactory.resolved)) {
  54946. hydrate(oldVnode.elm, vnode, insertedVnodeQueue);
  54947. } else {
  54948. vnode.isAsyncPlaceholder = true;
  54949. }
  54950. return
  54951. }
  54952. // reuse element for static trees.
  54953. // note we only do this if the vnode is cloned -
  54954. // if the new node is not cloned it means the render functions have been
  54955. // reset by the hot-reload-api and we need to do a proper re-render.
  54956. if (isTrue(vnode.isStatic) &&
  54957. isTrue(oldVnode.isStatic) &&
  54958. vnode.key === oldVnode.key &&
  54959. (isTrue(vnode.isCloned) || isTrue(vnode.isOnce))
  54960. ) {
  54961. vnode.componentInstance = oldVnode.componentInstance;
  54962. return
  54963. }
  54964. var i;
  54965. var data = vnode.data;
  54966. if (isDef(data) && isDef(i = data.hook) && isDef(i = i.prepatch)) {
  54967. i(oldVnode, vnode);
  54968. }
  54969. var oldCh = oldVnode.children;
  54970. var ch = vnode.children;
  54971. if (isDef(data) && isPatchable(vnode)) {
  54972. for (i = 0; i < cbs.update.length; ++i) { cbs.update[i](oldVnode, vnode); }
  54973. if (isDef(i = data.hook) && isDef(i = i.update)) { i(oldVnode, vnode); }
  54974. }
  54975. if (isUndef(vnode.text)) {
  54976. if (isDef(oldCh) && isDef(ch)) {
  54977. if (oldCh !== ch) { updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly); }
  54978. } else if (isDef(ch)) {
  54979. {
  54980. checkDuplicateKeys(ch);
  54981. }
  54982. if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); }
  54983. addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
  54984. } else if (isDef(oldCh)) {
  54985. removeVnodes(oldCh, 0, oldCh.length - 1);
  54986. } else if (isDef(oldVnode.text)) {
  54987. nodeOps.setTextContent(elm, '');
  54988. }
  54989. } else if (oldVnode.text !== vnode.text) {
  54990. nodeOps.setTextContent(elm, vnode.text);
  54991. }
  54992. if (isDef(data)) {
  54993. if (isDef(i = data.hook) && isDef(i = i.postpatch)) { i(oldVnode, vnode); }
  54994. }
  54995. }
  54996. function invokeInsertHook (vnode, queue, initial) {
  54997. // delay insert hooks for component root nodes, invoke them after the
  54998. // element is really inserted
  54999. if (isTrue(initial) && isDef(vnode.parent)) {
  55000. vnode.parent.data.pendingInsert = queue;
  55001. } else {
  55002. for (var i = 0; i < queue.length; ++i) {
  55003. queue[i].data.hook.insert(queue[i]);
  55004. }
  55005. }
  55006. }
  55007. var hydrationBailed = false;
  55008. // list of modules that can skip create hook during hydration because they
  55009. // are already rendered on the client or has no need for initialization
  55010. // Note: style is excluded because it relies on initial clone for future
  55011. // deep updates (#7063).
  55012. var isRenderedModule = makeMap('attrs,class,staticClass,staticStyle,key');
  55013. // Note: this is a browser-only function so we can assume elms are DOM nodes.
  55014. function hydrate (elm, vnode, insertedVnodeQueue, inVPre) {
  55015. var i;
  55016. var tag = vnode.tag;
  55017. var data = vnode.data;
  55018. var children = vnode.children;
  55019. inVPre = inVPre || (data && data.pre);
  55020. vnode.elm = elm;
  55021. if (isTrue(vnode.isComment) && isDef(vnode.asyncFactory)) {
  55022. vnode.isAsyncPlaceholder = true;
  55023. return true
  55024. }
  55025. // assert node match
  55026. {
  55027. if (!assertNodeMatch(elm, vnode, inVPre)) {
  55028. return false
  55029. }
  55030. }
  55031. if (isDef(data)) {
  55032. if (isDef(i = data.hook) && isDef(i = i.init)) { i(vnode, true /* hydrating */); }
  55033. if (isDef(i = vnode.componentInstance)) {
  55034. // child component. it should have hydrated its own tree.
  55035. initComponent(vnode, insertedVnodeQueue);
  55036. return true
  55037. }
  55038. }
  55039. if (isDef(tag)) {
  55040. if (isDef(children)) {
  55041. // empty element, allow client to pick up and populate children
  55042. if (!elm.hasChildNodes()) {
  55043. createChildren(vnode, children, insertedVnodeQueue);
  55044. } else {
  55045. // v-html and domProps: innerHTML
  55046. if (isDef(i = data) && isDef(i = i.domProps) && isDef(i = i.innerHTML)) {
  55047. if (i !== elm.innerHTML) {
  55048. /* istanbul ignore if */
  55049. if (typeof console !== 'undefined' &&
  55050. !hydrationBailed
  55051. ) {
  55052. hydrationBailed = true;
  55053. console.warn('Parent: ', elm);
  55054. console.warn('server innerHTML: ', i);
  55055. console.warn('client innerHTML: ', elm.innerHTML);
  55056. }
  55057. return false
  55058. }
  55059. } else {
  55060. // iterate and compare children lists
  55061. var childrenMatch = true;
  55062. var childNode = elm.firstChild;
  55063. for (var i$1 = 0; i$1 < children.length; i$1++) {
  55064. if (!childNode || !hydrate(childNode, children[i$1], insertedVnodeQueue, inVPre)) {
  55065. childrenMatch = false;
  55066. break
  55067. }
  55068. childNode = childNode.nextSibling;
  55069. }
  55070. // if childNode is not null, it means the actual childNodes list is
  55071. // longer than the virtual children list.
  55072. if (!childrenMatch || childNode) {
  55073. /* istanbul ignore if */
  55074. if (typeof console !== 'undefined' &&
  55075. !hydrationBailed
  55076. ) {
  55077. hydrationBailed = true;
  55078. console.warn('Parent: ', elm);
  55079. console.warn('Mismatching childNodes vs. VNodes: ', elm.childNodes, children);
  55080. }
  55081. return false
  55082. }
  55083. }
  55084. }
  55085. }
  55086. if (isDef(data)) {
  55087. var fullInvoke = false;
  55088. for (var key in data) {
  55089. if (!isRenderedModule(key)) {
  55090. fullInvoke = true;
  55091. invokeCreateHooks(vnode, insertedVnodeQueue);
  55092. break
  55093. }
  55094. }
  55095. if (!fullInvoke && data['class']) {
  55096. // ensure collecting deps for deep class bindings for future updates
  55097. traverse(data['class']);
  55098. }
  55099. }
  55100. } else if (elm.data !== vnode.text) {
  55101. elm.data = vnode.text;
  55102. }
  55103. return true
  55104. }
  55105. function assertNodeMatch (node, vnode, inVPre) {
  55106. if (isDef(vnode.tag)) {
  55107. return vnode.tag.indexOf('vue-component') === 0 || (
  55108. !isUnknownElement$$1(vnode, inVPre) &&
  55109. vnode.tag.toLowerCase() === (node.tagName && node.tagName.toLowerCase())
  55110. )
  55111. } else {
  55112. return node.nodeType === (vnode.isComment ? 8 : 3)
  55113. }
  55114. }
  55115. return function patch (oldVnode, vnode, hydrating, removeOnly) {
  55116. if (isUndef(vnode)) {
  55117. if (isDef(oldVnode)) { invokeDestroyHook(oldVnode); }
  55118. return
  55119. }
  55120. var isInitialPatch = false;
  55121. var insertedVnodeQueue = [];
  55122. if (isUndef(oldVnode)) {
  55123. // empty mount (likely as component), create new root element
  55124. isInitialPatch = true;
  55125. createElm(vnode, insertedVnodeQueue);
  55126. } else {
  55127. var isRealElement = isDef(oldVnode.nodeType);
  55128. if (!isRealElement && sameVnode(oldVnode, vnode)) {
  55129. // patch existing root node
  55130. patchVnode(oldVnode, vnode, insertedVnodeQueue, null, null, removeOnly);
  55131. } else {
  55132. if (isRealElement) {
  55133. // mounting to a real element
  55134. // check if this is server-rendered content and if we can perform
  55135. // a successful hydration.
  55136. if (oldVnode.nodeType === 1 && oldVnode.hasAttribute(SSR_ATTR)) {
  55137. oldVnode.removeAttribute(SSR_ATTR);
  55138. hydrating = true;
  55139. }
  55140. if (isTrue(hydrating)) {
  55141. if (hydrate(oldVnode, vnode, insertedVnodeQueue)) {
  55142. invokeInsertHook(vnode, insertedVnodeQueue, true);
  55143. return oldVnode
  55144. } else {
  55145. warn(
  55146. 'The client-side rendered virtual DOM tree is not matching ' +
  55147. 'server-rendered content. This is likely caused by incorrect ' +
  55148. 'HTML markup, for example nesting block-level elements inside ' +
  55149. '<p>, or missing <tbody>. Bailing hydration and performing ' +
  55150. 'full client-side render.'
  55151. );
  55152. }
  55153. }
  55154. // either not server-rendered, or hydration failed.
  55155. // create an empty node and replace it
  55156. oldVnode = emptyNodeAt(oldVnode);
  55157. }
  55158. // replacing existing element
  55159. var oldElm = oldVnode.elm;
  55160. var parentElm = nodeOps.parentNode(oldElm);
  55161. // create new node
  55162. createElm(
  55163. vnode,
  55164. insertedVnodeQueue,
  55165. // extremely rare edge case: do not insert if old element is in a
  55166. // leaving transition. Only happens when combining transition +
  55167. // keep-alive + HOCs. (#4590)
  55168. oldElm._leaveCb ? null : parentElm,
  55169. nodeOps.nextSibling(oldElm)
  55170. );
  55171. // update parent placeholder node element, recursively
  55172. if (isDef(vnode.parent)) {
  55173. var ancestor = vnode.parent;
  55174. var patchable = isPatchable(vnode);
  55175. while (ancestor) {
  55176. for (var i = 0; i < cbs.destroy.length; ++i) {
  55177. cbs.destroy[i](ancestor);
  55178. }
  55179. ancestor.elm = vnode.elm;
  55180. if (patchable) {
  55181. for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {
  55182. cbs.create[i$1](emptyNode, ancestor);
  55183. }
  55184. // #6513
  55185. // invoke insert hooks that may have been merged by create hooks.
  55186. // e.g. for directives that uses the "inserted" hook.
  55187. var insert = ancestor.data.hook.insert;
  55188. if (insert.merged) {
  55189. // start at index 1 to avoid re-invoking component mounted hook
  55190. for (var i$2 = 1; i$2 < insert.fns.length; i$2++) {
  55191. insert.fns[i$2]();
  55192. }
  55193. }
  55194. } else {
  55195. registerRef(ancestor);
  55196. }
  55197. ancestor = ancestor.parent;
  55198. }
  55199. }
  55200. // destroy old node
  55201. if (isDef(parentElm)) {
  55202. removeVnodes([oldVnode], 0, 0);
  55203. } else if (isDef(oldVnode.tag)) {
  55204. invokeDestroyHook(oldVnode);
  55205. }
  55206. }
  55207. }
  55208. invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch);
  55209. return vnode.elm
  55210. }
  55211. }
  55212. /* */
  55213. var directives = {
  55214. create: updateDirectives,
  55215. update: updateDirectives,
  55216. destroy: function unbindDirectives (vnode) {
  55217. updateDirectives(vnode, emptyNode);
  55218. }
  55219. };
  55220. function updateDirectives (oldVnode, vnode) {
  55221. if (oldVnode.data.directives || vnode.data.directives) {
  55222. _update(oldVnode, vnode);
  55223. }
  55224. }
  55225. function _update (oldVnode, vnode) {
  55226. var isCreate = oldVnode === emptyNode;
  55227. var isDestroy = vnode === emptyNode;
  55228. var oldDirs = normalizeDirectives$1(oldVnode.data.directives, oldVnode.context);
  55229. var newDirs = normalizeDirectives$1(vnode.data.directives, vnode.context);
  55230. var dirsWithInsert = [];
  55231. var dirsWithPostpatch = [];
  55232. var key, oldDir, dir;
  55233. for (key in newDirs) {
  55234. oldDir = oldDirs[key];
  55235. dir = newDirs[key];
  55236. if (!oldDir) {
  55237. // new directive, bind
  55238. callHook$1(dir, 'bind', vnode, oldVnode);
  55239. if (dir.def && dir.def.inserted) {
  55240. dirsWithInsert.push(dir);
  55241. }
  55242. } else {
  55243. // existing directive, update
  55244. dir.oldValue = oldDir.value;
  55245. dir.oldArg = oldDir.arg;
  55246. callHook$1(dir, 'update', vnode, oldVnode);
  55247. if (dir.def && dir.def.componentUpdated) {
  55248. dirsWithPostpatch.push(dir);
  55249. }
  55250. }
  55251. }
  55252. if (dirsWithInsert.length) {
  55253. var callInsert = function () {
  55254. for (var i = 0; i < dirsWithInsert.length; i++) {
  55255. callHook$1(dirsWithInsert[i], 'inserted', vnode, oldVnode);
  55256. }
  55257. };
  55258. if (isCreate) {
  55259. mergeVNodeHook(vnode, 'insert', callInsert);
  55260. } else {
  55261. callInsert();
  55262. }
  55263. }
  55264. if (dirsWithPostpatch.length) {
  55265. mergeVNodeHook(vnode, 'postpatch', function () {
  55266. for (var i = 0; i < dirsWithPostpatch.length; i++) {
  55267. callHook$1(dirsWithPostpatch[i], 'componentUpdated', vnode, oldVnode);
  55268. }
  55269. });
  55270. }
  55271. if (!isCreate) {
  55272. for (key in oldDirs) {
  55273. if (!newDirs[key]) {
  55274. // no longer present, unbind
  55275. callHook$1(oldDirs[key], 'unbind', oldVnode, oldVnode, isDestroy);
  55276. }
  55277. }
  55278. }
  55279. }
  55280. var emptyModifiers = Object.create(null);
  55281. function normalizeDirectives$1 (
  55282. dirs,
  55283. vm
  55284. ) {
  55285. var res = Object.create(null);
  55286. if (!dirs) {
  55287. // $flow-disable-line
  55288. return res
  55289. }
  55290. var i, dir;
  55291. for (i = 0; i < dirs.length; i++) {
  55292. dir = dirs[i];
  55293. if (!dir.modifiers) {
  55294. // $flow-disable-line
  55295. dir.modifiers = emptyModifiers;
  55296. }
  55297. res[getRawDirName(dir)] = dir;
  55298. dir.def = resolveAsset(vm.$options, 'directives', dir.name, true);
  55299. }
  55300. // $flow-disable-line
  55301. return res
  55302. }
  55303. function getRawDirName (dir) {
  55304. return dir.rawName || ((dir.name) + "." + (Object.keys(dir.modifiers || {}).join('.')))
  55305. }
  55306. function callHook$1 (dir, hook, vnode, oldVnode, isDestroy) {
  55307. var fn = dir.def && dir.def[hook];
  55308. if (fn) {
  55309. try {
  55310. fn(vnode.elm, dir, vnode, oldVnode, isDestroy);
  55311. } catch (e) {
  55312. handleError(e, vnode.context, ("directive " + (dir.name) + " " + hook + " hook"));
  55313. }
  55314. }
  55315. }
  55316. var baseModules = [
  55317. ref,
  55318. directives
  55319. ];
  55320. /* */
  55321. function updateAttrs (oldVnode, vnode) {
  55322. var opts = vnode.componentOptions;
  55323. if (isDef(opts) && opts.Ctor.options.inheritAttrs === false) {
  55324. return
  55325. }
  55326. if (isUndef(oldVnode.data.attrs) && isUndef(vnode.data.attrs)) {
  55327. return
  55328. }
  55329. var key, cur, old;
  55330. var elm = vnode.elm;
  55331. var oldAttrs = oldVnode.data.attrs || {};
  55332. var attrs = vnode.data.attrs || {};
  55333. // clone observed objects, as the user probably wants to mutate it
  55334. if (isDef(attrs.__ob__)) {
  55335. attrs = vnode.data.attrs = extend({}, attrs);
  55336. }
  55337. for (key in attrs) {
  55338. cur = attrs[key];
  55339. old = oldAttrs[key];
  55340. if (old !== cur) {
  55341. setAttr(elm, key, cur);
  55342. }
  55343. }
  55344. // #4391: in IE9, setting type can reset value for input[type=radio]
  55345. // #6666: IE/Edge forces progress value down to 1 before setting a max
  55346. /* istanbul ignore if */
  55347. if ((isIE || isEdge) && attrs.value !== oldAttrs.value) {
  55348. setAttr(elm, 'value', attrs.value);
  55349. }
  55350. for (key in oldAttrs) {
  55351. if (isUndef(attrs[key])) {
  55352. if (isXlink(key)) {
  55353. elm.removeAttributeNS(xlinkNS, getXlinkProp(key));
  55354. } else if (!isEnumeratedAttr(key)) {
  55355. elm.removeAttribute(key);
  55356. }
  55357. }
  55358. }
  55359. }
  55360. function setAttr (el, key, value) {
  55361. if (el.tagName.indexOf('-') > -1) {
  55362. baseSetAttr(el, key, value);
  55363. } else if (isBooleanAttr(key)) {
  55364. // set attribute for blank value
  55365. // e.g. <option disabled>Select one</option>
  55366. if (isFalsyAttrValue(value)) {
  55367. el.removeAttribute(key);
  55368. } else {
  55369. // technically allowfullscreen is a boolean attribute for <iframe>,
  55370. // but Flash expects a value of "true" when used on <embed> tag
  55371. value = key === 'allowfullscreen' && el.tagName === 'EMBED'
  55372. ? 'true'
  55373. : key;
  55374. el.setAttribute(key, value);
  55375. }
  55376. } else if (isEnumeratedAttr(key)) {
  55377. el.setAttribute(key, convertEnumeratedValue(key, value));
  55378. } else if (isXlink(key)) {
  55379. if (isFalsyAttrValue(value)) {
  55380. el.removeAttributeNS(xlinkNS, getXlinkProp(key));
  55381. } else {
  55382. el.setAttributeNS(xlinkNS, key, value);
  55383. }
  55384. } else {
  55385. baseSetAttr(el, key, value);
  55386. }
  55387. }
  55388. function baseSetAttr (el, key, value) {
  55389. if (isFalsyAttrValue(value)) {
  55390. el.removeAttribute(key);
  55391. } else {
  55392. // #7138: IE10 & 11 fires input event when setting placeholder on
  55393. // <textarea>... block the first input event and remove the blocker
  55394. // immediately.
  55395. /* istanbul ignore if */
  55396. if (
  55397. isIE && !isIE9 &&
  55398. el.tagName === 'TEXTAREA' &&
  55399. key === 'placeholder' && value !== '' && !el.__ieph
  55400. ) {
  55401. var blocker = function (e) {
  55402. e.stopImmediatePropagation();
  55403. el.removeEventListener('input', blocker);
  55404. };
  55405. el.addEventListener('input', blocker);
  55406. // $flow-disable-line
  55407. el.__ieph = true; /* IE placeholder patched */
  55408. }
  55409. el.setAttribute(key, value);
  55410. }
  55411. }
  55412. var attrs = {
  55413. create: updateAttrs,
  55414. update: updateAttrs
  55415. };
  55416. /* */
  55417. function updateClass (oldVnode, vnode) {
  55418. var el = vnode.elm;
  55419. var data = vnode.data;
  55420. var oldData = oldVnode.data;
  55421. if (
  55422. isUndef(data.staticClass) &&
  55423. isUndef(data.class) && (
  55424. isUndef(oldData) || (
  55425. isUndef(oldData.staticClass) &&
  55426. isUndef(oldData.class)
  55427. )
  55428. )
  55429. ) {
  55430. return
  55431. }
  55432. var cls = genClassForVnode(vnode);
  55433. // handle transition classes
  55434. var transitionClass = el._transitionClasses;
  55435. if (isDef(transitionClass)) {
  55436. cls = concat(cls, stringifyClass(transitionClass));
  55437. }
  55438. // set the class
  55439. if (cls !== el._prevClass) {
  55440. el.setAttribute('class', cls);
  55441. el._prevClass = cls;
  55442. }
  55443. }
  55444. var klass = {
  55445. create: updateClass,
  55446. update: updateClass
  55447. };
  55448. /* */
  55449. var validDivisionCharRE = /[\w).+\-_$\]]/;
  55450. function parseFilters (exp) {
  55451. var inSingle = false;
  55452. var inDouble = false;
  55453. var inTemplateString = false;
  55454. var inRegex = false;
  55455. var curly = 0;
  55456. var square = 0;
  55457. var paren = 0;
  55458. var lastFilterIndex = 0;
  55459. var c, prev, i, expression, filters;
  55460. for (i = 0; i < exp.length; i++) {
  55461. prev = c;
  55462. c = exp.charCodeAt(i);
  55463. if (inSingle) {
  55464. if (c === 0x27 && prev !== 0x5C) { inSingle = false; }
  55465. } else if (inDouble) {
  55466. if (c === 0x22 && prev !== 0x5C) { inDouble = false; }
  55467. } else if (inTemplateString) {
  55468. if (c === 0x60 && prev !== 0x5C) { inTemplateString = false; }
  55469. } else if (inRegex) {
  55470. if (c === 0x2f && prev !== 0x5C) { inRegex = false; }
  55471. } else if (
  55472. c === 0x7C && // pipe
  55473. exp.charCodeAt(i + 1) !== 0x7C &&
  55474. exp.charCodeAt(i - 1) !== 0x7C &&
  55475. !curly && !square && !paren
  55476. ) {
  55477. if (expression === undefined) {
  55478. // first filter, end of expression
  55479. lastFilterIndex = i + 1;
  55480. expression = exp.slice(0, i).trim();
  55481. } else {
  55482. pushFilter();
  55483. }
  55484. } else {
  55485. switch (c) {
  55486. case 0x22: inDouble = true; break // "
  55487. case 0x27: inSingle = true; break // '
  55488. case 0x60: inTemplateString = true; break // `
  55489. case 0x28: paren++; break // (
  55490. case 0x29: paren--; break // )
  55491. case 0x5B: square++; break // [
  55492. case 0x5D: square--; break // ]
  55493. case 0x7B: curly++; break // {
  55494. case 0x7D: curly--; break // }
  55495. }
  55496. if (c === 0x2f) { // /
  55497. var j = i - 1;
  55498. var p = (void 0);
  55499. // find first non-whitespace prev char
  55500. for (; j >= 0; j--) {
  55501. p = exp.charAt(j);
  55502. if (p !== ' ') { break }
  55503. }
  55504. if (!p || !validDivisionCharRE.test(p)) {
  55505. inRegex = true;
  55506. }
  55507. }
  55508. }
  55509. }
  55510. if (expression === undefined) {
  55511. expression = exp.slice(0, i).trim();
  55512. } else if (lastFilterIndex !== 0) {
  55513. pushFilter();
  55514. }
  55515. function pushFilter () {
  55516. (filters || (filters = [])).push(exp.slice(lastFilterIndex, i).trim());
  55517. lastFilterIndex = i + 1;
  55518. }
  55519. if (filters) {
  55520. for (i = 0; i < filters.length; i++) {
  55521. expression = wrapFilter(expression, filters[i]);
  55522. }
  55523. }
  55524. return expression
  55525. }
  55526. function wrapFilter (exp, filter) {
  55527. var i = filter.indexOf('(');
  55528. if (i < 0) {
  55529. // _f: resolveFilter
  55530. return ("_f(\"" + filter + "\")(" + exp + ")")
  55531. } else {
  55532. var name = filter.slice(0, i);
  55533. var args = filter.slice(i + 1);
  55534. return ("_f(\"" + name + "\")(" + exp + (args !== ')' ? ',' + args : args))
  55535. }
  55536. }
  55537. /* */
  55538. /* eslint-disable no-unused-vars */
  55539. function baseWarn (msg, range) {
  55540. console.error(("[Vue compiler]: " + msg));
  55541. }
  55542. /* eslint-enable no-unused-vars */
  55543. function pluckModuleFunction (
  55544. modules,
  55545. key
  55546. ) {
  55547. return modules
  55548. ? modules.map(function (m) { return m[key]; }).filter(function (_) { return _; })
  55549. : []
  55550. }
  55551. function addProp (el, name, value, range, dynamic) {
  55552. (el.props || (el.props = [])).push(rangeSetItem({ name: name, value: value, dynamic: dynamic }, range));
  55553. el.plain = false;
  55554. }
  55555. function addAttr (el, name, value, range, dynamic) {
  55556. var attrs = dynamic
  55557. ? (el.dynamicAttrs || (el.dynamicAttrs = []))
  55558. : (el.attrs || (el.attrs = []));
  55559. attrs.push(rangeSetItem({ name: name, value: value, dynamic: dynamic }, range));
  55560. el.plain = false;
  55561. }
  55562. // add a raw attr (use this in preTransforms)
  55563. function addRawAttr (el, name, value, range) {
  55564. el.attrsMap[name] = value;
  55565. el.attrsList.push(rangeSetItem({ name: name, value: value }, range));
  55566. }
  55567. function addDirective (
  55568. el,
  55569. name,
  55570. rawName,
  55571. value,
  55572. arg,
  55573. isDynamicArg,
  55574. modifiers,
  55575. range
  55576. ) {
  55577. (el.directives || (el.directives = [])).push(rangeSetItem({
  55578. name: name,
  55579. rawName: rawName,
  55580. value: value,
  55581. arg: arg,
  55582. isDynamicArg: isDynamicArg,
  55583. modifiers: modifiers
  55584. }, range));
  55585. el.plain = false;
  55586. }
  55587. function prependModifierMarker (symbol, name, dynamic) {
  55588. return dynamic
  55589. ? ("_p(" + name + ",\"" + symbol + "\")")
  55590. : symbol + name // mark the event as captured
  55591. }
  55592. function addHandler (
  55593. el,
  55594. name,
  55595. value,
  55596. modifiers,
  55597. important,
  55598. warn,
  55599. range,
  55600. dynamic
  55601. ) {
  55602. modifiers = modifiers || emptyObject;
  55603. // warn prevent and passive modifier
  55604. /* istanbul ignore if */
  55605. if (
  55606. warn &&
  55607. modifiers.prevent && modifiers.passive
  55608. ) {
  55609. warn(
  55610. 'passive and prevent can\'t be used together. ' +
  55611. 'Passive handler can\'t prevent default event.',
  55612. range
  55613. );
  55614. }
  55615. // normalize click.right and click.middle since they don't actually fire
  55616. // this is technically browser-specific, but at least for now browsers are
  55617. // the only target envs that have right/middle clicks.
  55618. if (modifiers.right) {
  55619. if (dynamic) {
  55620. name = "(" + name + ")==='click'?'contextmenu':(" + name + ")";
  55621. } else if (name === 'click') {
  55622. name = 'contextmenu';
  55623. delete modifiers.right;
  55624. }
  55625. } else if (modifiers.middle) {
  55626. if (dynamic) {
  55627. name = "(" + name + ")==='click'?'mouseup':(" + name + ")";
  55628. } else if (name === 'click') {
  55629. name = 'mouseup';
  55630. }
  55631. }
  55632. // check capture modifier
  55633. if (modifiers.capture) {
  55634. delete modifiers.capture;
  55635. name = prependModifierMarker('!', name, dynamic);
  55636. }
  55637. if (modifiers.once) {
  55638. delete modifiers.once;
  55639. name = prependModifierMarker('~', name, dynamic);
  55640. }
  55641. /* istanbul ignore if */
  55642. if (modifiers.passive) {
  55643. delete modifiers.passive;
  55644. name = prependModifierMarker('&', name, dynamic);
  55645. }
  55646. var events;
  55647. if (modifiers.native) {
  55648. delete modifiers.native;
  55649. events = el.nativeEvents || (el.nativeEvents = {});
  55650. } else {
  55651. events = el.events || (el.events = {});
  55652. }
  55653. var newHandler = rangeSetItem({ value: value.trim(), dynamic: dynamic }, range);
  55654. if (modifiers !== emptyObject) {
  55655. newHandler.modifiers = modifiers;
  55656. }
  55657. var handlers = events[name];
  55658. /* istanbul ignore if */
  55659. if (Array.isArray(handlers)) {
  55660. important ? handlers.unshift(newHandler) : handlers.push(newHandler);
  55661. } else if (handlers) {
  55662. events[name] = important ? [newHandler, handlers] : [handlers, newHandler];
  55663. } else {
  55664. events[name] = newHandler;
  55665. }
  55666. el.plain = false;
  55667. }
  55668. function getRawBindingAttr (
  55669. el,
  55670. name
  55671. ) {
  55672. return el.rawAttrsMap[':' + name] ||
  55673. el.rawAttrsMap['v-bind:' + name] ||
  55674. el.rawAttrsMap[name]
  55675. }
  55676. function getBindingAttr (
  55677. el,
  55678. name,
  55679. getStatic
  55680. ) {
  55681. var dynamicValue =
  55682. getAndRemoveAttr(el, ':' + name) ||
  55683. getAndRemoveAttr(el, 'v-bind:' + name);
  55684. if (dynamicValue != null) {
  55685. return parseFilters(dynamicValue)
  55686. } else if (getStatic !== false) {
  55687. var staticValue = getAndRemoveAttr(el, name);
  55688. if (staticValue != null) {
  55689. return JSON.stringify(staticValue)
  55690. }
  55691. }
  55692. }
  55693. // note: this only removes the attr from the Array (attrsList) so that it
  55694. // doesn't get processed by processAttrs.
  55695. // By default it does NOT remove it from the map (attrsMap) because the map is
  55696. // needed during codegen.
  55697. function getAndRemoveAttr (
  55698. el,
  55699. name,
  55700. removeFromMap
  55701. ) {
  55702. var val;
  55703. if ((val = el.attrsMap[name]) != null) {
  55704. var list = el.attrsList;
  55705. for (var i = 0, l = list.length; i < l; i++) {
  55706. if (list[i].name === name) {
  55707. list.splice(i, 1);
  55708. break
  55709. }
  55710. }
  55711. }
  55712. if (removeFromMap) {
  55713. delete el.attrsMap[name];
  55714. }
  55715. return val
  55716. }
  55717. function getAndRemoveAttrByRegex (
  55718. el,
  55719. name
  55720. ) {
  55721. var list = el.attrsList;
  55722. for (var i = 0, l = list.length; i < l; i++) {
  55723. var attr = list[i];
  55724. if (name.test(attr.name)) {
  55725. list.splice(i, 1);
  55726. return attr
  55727. }
  55728. }
  55729. }
  55730. function rangeSetItem (
  55731. item,
  55732. range
  55733. ) {
  55734. if (range) {
  55735. if (range.start != null) {
  55736. item.start = range.start;
  55737. }
  55738. if (range.end != null) {
  55739. item.end = range.end;
  55740. }
  55741. }
  55742. return item
  55743. }
  55744. /* */
  55745. /**
  55746. * Cross-platform code generation for component v-model
  55747. */
  55748. function genComponentModel (
  55749. el,
  55750. value,
  55751. modifiers
  55752. ) {
  55753. var ref = modifiers || {};
  55754. var number = ref.number;
  55755. var trim = ref.trim;
  55756. var baseValueExpression = '$$v';
  55757. var valueExpression = baseValueExpression;
  55758. if (trim) {
  55759. valueExpression =
  55760. "(typeof " + baseValueExpression + " === 'string'" +
  55761. "? " + baseValueExpression + ".trim()" +
  55762. ": " + baseValueExpression + ")";
  55763. }
  55764. if (number) {
  55765. valueExpression = "_n(" + valueExpression + ")";
  55766. }
  55767. var assignment = genAssignmentCode(value, valueExpression);
  55768. el.model = {
  55769. value: ("(" + value + ")"),
  55770. expression: JSON.stringify(value),
  55771. callback: ("function (" + baseValueExpression + ") {" + assignment + "}")
  55772. };
  55773. }
  55774. /**
  55775. * Cross-platform codegen helper for generating v-model value assignment code.
  55776. */
  55777. function genAssignmentCode (
  55778. value,
  55779. assignment
  55780. ) {
  55781. var res = parseModel(value);
  55782. if (res.key === null) {
  55783. return (value + "=" + assignment)
  55784. } else {
  55785. return ("$set(" + (res.exp) + ", " + (res.key) + ", " + assignment + ")")
  55786. }
  55787. }
  55788. /**
  55789. * Parse a v-model expression into a base path and a final key segment.
  55790. * Handles both dot-path and possible square brackets.
  55791. *
  55792. * Possible cases:
  55793. *
  55794. * - test
  55795. * - test[key]
  55796. * - test[test1[key]]
  55797. * - test["a"][key]
  55798. * - xxx.test[a[a].test1[key]]
  55799. * - test.xxx.a["asa"][test1[key]]
  55800. *
  55801. */
  55802. var len, str, chr, index$1, expressionPos, expressionEndPos;
  55803. function parseModel (val) {
  55804. // Fix https://github.com/vuejs/vue/pull/7730
  55805. // allow v-model="obj.val " (trailing whitespace)
  55806. val = val.trim();
  55807. len = val.length;
  55808. if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) {
  55809. index$1 = val.lastIndexOf('.');
  55810. if (index$1 > -1) {
  55811. return {
  55812. exp: val.slice(0, index$1),
  55813. key: '"' + val.slice(index$1 + 1) + '"'
  55814. }
  55815. } else {
  55816. return {
  55817. exp: val,
  55818. key: null
  55819. }
  55820. }
  55821. }
  55822. str = val;
  55823. index$1 = expressionPos = expressionEndPos = 0;
  55824. while (!eof()) {
  55825. chr = next();
  55826. /* istanbul ignore if */
  55827. if (isStringStart(chr)) {
  55828. parseString(chr);
  55829. } else if (chr === 0x5B) {
  55830. parseBracket(chr);
  55831. }
  55832. }
  55833. return {
  55834. exp: val.slice(0, expressionPos),
  55835. key: val.slice(expressionPos + 1, expressionEndPos)
  55836. }
  55837. }
  55838. function next () {
  55839. return str.charCodeAt(++index$1)
  55840. }
  55841. function eof () {
  55842. return index$1 >= len
  55843. }
  55844. function isStringStart (chr) {
  55845. return chr === 0x22 || chr === 0x27
  55846. }
  55847. function parseBracket (chr) {
  55848. var inBracket = 1;
  55849. expressionPos = index$1;
  55850. while (!eof()) {
  55851. chr = next();
  55852. if (isStringStart(chr)) {
  55853. parseString(chr);
  55854. continue
  55855. }
  55856. if (chr === 0x5B) { inBracket++; }
  55857. if (chr === 0x5D) { inBracket--; }
  55858. if (inBracket === 0) {
  55859. expressionEndPos = index$1;
  55860. break
  55861. }
  55862. }
  55863. }
  55864. function parseString (chr) {
  55865. var stringQuote = chr;
  55866. while (!eof()) {
  55867. chr = next();
  55868. if (chr === stringQuote) {
  55869. break
  55870. }
  55871. }
  55872. }
  55873. /* */
  55874. var warn$1;
  55875. // in some cases, the event used has to be determined at runtime
  55876. // so we used some reserved tokens during compile.
  55877. var RANGE_TOKEN = '__r';
  55878. var CHECKBOX_RADIO_TOKEN = '__c';
  55879. function model (
  55880. el,
  55881. dir,
  55882. _warn
  55883. ) {
  55884. warn$1 = _warn;
  55885. var value = dir.value;
  55886. var modifiers = dir.modifiers;
  55887. var tag = el.tag;
  55888. var type = el.attrsMap.type;
  55889. {
  55890. // inputs with type="file" are read only and setting the input's
  55891. // value will throw an error.
  55892. if (tag === 'input' && type === 'file') {
  55893. warn$1(
  55894. "<" + (el.tag) + " v-model=\"" + value + "\" type=\"file\">:\n" +
  55895. "File inputs are read only. Use a v-on:change listener instead.",
  55896. el.rawAttrsMap['v-model']
  55897. );
  55898. }
  55899. }
  55900. if (el.component) {
  55901. genComponentModel(el, value, modifiers);
  55902. // component v-model doesn't need extra runtime
  55903. return false
  55904. } else if (tag === 'select') {
  55905. genSelect(el, value, modifiers);
  55906. } else if (tag === 'input' && type === 'checkbox') {
  55907. genCheckboxModel(el, value, modifiers);
  55908. } else if (tag === 'input' && type === 'radio') {
  55909. genRadioModel(el, value, modifiers);
  55910. } else if (tag === 'input' || tag === 'textarea') {
  55911. genDefaultModel(el, value, modifiers);
  55912. } else if (!config.isReservedTag(tag)) {
  55913. genComponentModel(el, value, modifiers);
  55914. // component v-model doesn't need extra runtime
  55915. return false
  55916. } else {
  55917. warn$1(
  55918. "<" + (el.tag) + " v-model=\"" + value + "\">: " +
  55919. "v-model is not supported on this element type. " +
  55920. 'If you are working with contenteditable, it\'s recommended to ' +
  55921. 'wrap a library dedicated for that purpose inside a custom component.',
  55922. el.rawAttrsMap['v-model']
  55923. );
  55924. }
  55925. // ensure runtime directive metadata
  55926. return true
  55927. }
  55928. function genCheckboxModel (
  55929. el,
  55930. value,
  55931. modifiers
  55932. ) {
  55933. var number = modifiers && modifiers.number;
  55934. var valueBinding = getBindingAttr(el, 'value') || 'null';
  55935. var trueValueBinding = getBindingAttr(el, 'true-value') || 'true';
  55936. var falseValueBinding = getBindingAttr(el, 'false-value') || 'false';
  55937. addProp(el, 'checked',
  55938. "Array.isArray(" + value + ")" +
  55939. "?_i(" + value + "," + valueBinding + ")>-1" + (
  55940. trueValueBinding === 'true'
  55941. ? (":(" + value + ")")
  55942. : (":_q(" + value + "," + trueValueBinding + ")")
  55943. )
  55944. );
  55945. addHandler(el, 'change',
  55946. "var $$a=" + value + "," +
  55947. '$$el=$event.target,' +
  55948. "$$c=$$el.checked?(" + trueValueBinding + "):(" + falseValueBinding + ");" +
  55949. 'if(Array.isArray($$a)){' +
  55950. "var $$v=" + (number ? '_n(' + valueBinding + ')' : valueBinding) + "," +
  55951. '$$i=_i($$a,$$v);' +
  55952. "if($$el.checked){$$i<0&&(" + (genAssignmentCode(value, '$$a.concat([$$v])')) + ")}" +
  55953. "else{$$i>-1&&(" + (genAssignmentCode(value, '$$a.slice(0,$$i).concat($$a.slice($$i+1))')) + ")}" +
  55954. "}else{" + (genAssignmentCode(value, '$$c')) + "}",
  55955. null, true
  55956. );
  55957. }
  55958. function genRadioModel (
  55959. el,
  55960. value,
  55961. modifiers
  55962. ) {
  55963. var number = modifiers && modifiers.number;
  55964. var valueBinding = getBindingAttr(el, 'value') || 'null';
  55965. valueBinding = number ? ("_n(" + valueBinding + ")") : valueBinding;
  55966. addProp(el, 'checked', ("_q(" + value + "," + valueBinding + ")"));
  55967. addHandler(el, 'change', genAssignmentCode(value, valueBinding), null, true);
  55968. }
  55969. function genSelect (
  55970. el,
  55971. value,
  55972. modifiers
  55973. ) {
  55974. var number = modifiers && modifiers.number;
  55975. var selectedVal = "Array.prototype.filter" +
  55976. ".call($event.target.options,function(o){return o.selected})" +
  55977. ".map(function(o){var val = \"_value\" in o ? o._value : o.value;" +
  55978. "return " + (number ? '_n(val)' : 'val') + "})";
  55979. var assignment = '$event.target.multiple ? $$selectedVal : $$selectedVal[0]';
  55980. var code = "var $$selectedVal = " + selectedVal + ";";
  55981. code = code + " " + (genAssignmentCode(value, assignment));
  55982. addHandler(el, 'change', code, null, true);
  55983. }
  55984. function genDefaultModel (
  55985. el,
  55986. value,
  55987. modifiers
  55988. ) {
  55989. var type = el.attrsMap.type;
  55990. // warn if v-bind:value conflicts with v-model
  55991. // except for inputs with v-bind:type
  55992. {
  55993. var value$1 = el.attrsMap['v-bind:value'] || el.attrsMap[':value'];
  55994. var typeBinding = el.attrsMap['v-bind:type'] || el.attrsMap[':type'];
  55995. if (value$1 && !typeBinding) {
  55996. var binding = el.attrsMap['v-bind:value'] ? 'v-bind:value' : ':value';
  55997. warn$1(
  55998. binding + "=\"" + value$1 + "\" conflicts with v-model on the same element " +
  55999. 'because the latter already expands to a value binding internally',
  56000. el.rawAttrsMap[binding]
  56001. );
  56002. }
  56003. }
  56004. var ref = modifiers || {};
  56005. var lazy = ref.lazy;
  56006. var number = ref.number;
  56007. var trim = ref.trim;
  56008. var needCompositionGuard = !lazy && type !== 'range';
  56009. var event = lazy
  56010. ? 'change'
  56011. : type === 'range'
  56012. ? RANGE_TOKEN
  56013. : 'input';
  56014. var valueExpression = '$event.target.value';
  56015. if (trim) {
  56016. valueExpression = "$event.target.value.trim()";
  56017. }
  56018. if (number) {
  56019. valueExpression = "_n(" + valueExpression + ")";
  56020. }
  56021. var code = genAssignmentCode(value, valueExpression);
  56022. if (needCompositionGuard) {
  56023. code = "if($event.target.composing)return;" + code;
  56024. }
  56025. addProp(el, 'value', ("(" + value + ")"));
  56026. addHandler(el, event, code, null, true);
  56027. if (trim || number) {
  56028. addHandler(el, 'blur', '$forceUpdate()');
  56029. }
  56030. }
  56031. /* */
  56032. // normalize v-model event tokens that can only be determined at runtime.
  56033. // it's important to place the event as the first in the array because
  56034. // the whole point is ensuring the v-model callback gets called before
  56035. // user-attached handlers.
  56036. function normalizeEvents (on) {
  56037. /* istanbul ignore if */
  56038. if (isDef(on[RANGE_TOKEN])) {
  56039. // IE input[type=range] only supports `change` event
  56040. var event = isIE ? 'change' : 'input';
  56041. on[event] = [].concat(on[RANGE_TOKEN], on[event] || []);
  56042. delete on[RANGE_TOKEN];
  56043. }
  56044. // This was originally intended to fix #4521 but no longer necessary
  56045. // after 2.5. Keeping it for backwards compat with generated code from < 2.4
  56046. /* istanbul ignore if */
  56047. if (isDef(on[CHECKBOX_RADIO_TOKEN])) {
  56048. on.change = [].concat(on[CHECKBOX_RADIO_TOKEN], on.change || []);
  56049. delete on[CHECKBOX_RADIO_TOKEN];
  56050. }
  56051. }
  56052. var target$1;
  56053. function createOnceHandler$1 (event, handler, capture) {
  56054. var _target = target$1; // save current target element in closure
  56055. return function onceHandler () {
  56056. var res = handler.apply(null, arguments);
  56057. if (res !== null) {
  56058. remove$2(event, onceHandler, capture, _target);
  56059. }
  56060. }
  56061. }
  56062. // #9446: Firefox <= 53 (in particular, ESR 52) has incorrect Event.timeStamp
  56063. // implementation and does not fire microtasks in between event propagation, so
  56064. // safe to exclude.
  56065. var useMicrotaskFix = isUsingMicroTask && !(isFF && Number(isFF[1]) <= 53);
  56066. function add$1 (
  56067. name,
  56068. handler,
  56069. capture,
  56070. passive
  56071. ) {
  56072. // async edge case #6566: inner click event triggers patch, event handler
  56073. // attached to outer element during patch, and triggered again. This
  56074. // happens because browsers fire microtask ticks between event propagation.
  56075. // the solution is simple: we save the timestamp when a handler is attached,
  56076. // and the handler would only fire if the event passed to it was fired
  56077. // AFTER it was attached.
  56078. if (useMicrotaskFix) {
  56079. var attachedTimestamp = currentFlushTimestamp;
  56080. var original = handler;
  56081. handler = original._wrapper = function (e) {
  56082. if (
  56083. // no bubbling, should always fire.
  56084. // this is just a safety net in case event.timeStamp is unreliable in
  56085. // certain weird environments...
  56086. e.target === e.currentTarget ||
  56087. // event is fired after handler attachment
  56088. e.timeStamp >= attachedTimestamp ||
  56089. // bail for environments that have buggy event.timeStamp implementations
  56090. // #9462 iOS 9 bug: event.timeStamp is 0 after history.pushState
  56091. // #9681 QtWebEngine event.timeStamp is negative value
  56092. e.timeStamp <= 0 ||
  56093. // #9448 bail if event is fired in another document in a multi-page
  56094. // electron/nw.js app, since event.timeStamp will be using a different
  56095. // starting reference
  56096. e.target.ownerDocument !== document
  56097. ) {
  56098. return original.apply(this, arguments)
  56099. }
  56100. };
  56101. }
  56102. target$1.addEventListener(
  56103. name,
  56104. handler,
  56105. supportsPassive
  56106. ? { capture: capture, passive: passive }
  56107. : capture
  56108. );
  56109. }
  56110. function remove$2 (
  56111. name,
  56112. handler,
  56113. capture,
  56114. _target
  56115. ) {
  56116. (_target || target$1).removeEventListener(
  56117. name,
  56118. handler._wrapper || handler,
  56119. capture
  56120. );
  56121. }
  56122. function updateDOMListeners (oldVnode, vnode) {
  56123. if (isUndef(oldVnode.data.on) && isUndef(vnode.data.on)) {
  56124. return
  56125. }
  56126. var on = vnode.data.on || {};
  56127. var oldOn = oldVnode.data.on || {};
  56128. target$1 = vnode.elm;
  56129. normalizeEvents(on);
  56130. updateListeners(on, oldOn, add$1, remove$2, createOnceHandler$1, vnode.context);
  56131. target$1 = undefined;
  56132. }
  56133. var events = {
  56134. create: updateDOMListeners,
  56135. update: updateDOMListeners
  56136. };
  56137. /* */
  56138. var svgContainer;
  56139. function updateDOMProps (oldVnode, vnode) {
  56140. if (isUndef(oldVnode.data.domProps) && isUndef(vnode.data.domProps)) {
  56141. return
  56142. }
  56143. var key, cur;
  56144. var elm = vnode.elm;
  56145. var oldProps = oldVnode.data.domProps || {};
  56146. var props = vnode.data.domProps || {};
  56147. // clone observed objects, as the user probably wants to mutate it
  56148. if (isDef(props.__ob__)) {
  56149. props = vnode.data.domProps = extend({}, props);
  56150. }
  56151. for (key in oldProps) {
  56152. if (!(key in props)) {
  56153. elm[key] = '';
  56154. }
  56155. }
  56156. for (key in props) {
  56157. cur = props[key];
  56158. // ignore children if the node has textContent or innerHTML,
  56159. // as these will throw away existing DOM nodes and cause removal errors
  56160. // on subsequent patches (#3360)
  56161. if (key === 'textContent' || key === 'innerHTML') {
  56162. if (vnode.children) { vnode.children.length = 0; }
  56163. if (cur === oldProps[key]) { continue }
  56164. // #6601 work around Chrome version <= 55 bug where single textNode
  56165. // replaced by innerHTML/textContent retains its parentNode property
  56166. if (elm.childNodes.length === 1) {
  56167. elm.removeChild(elm.childNodes[0]);
  56168. }
  56169. }
  56170. if (key === 'value' && elm.tagName !== 'PROGRESS') {
  56171. // store value as _value as well since
  56172. // non-string values will be stringified
  56173. elm._value = cur;
  56174. // avoid resetting cursor position when value is the same
  56175. var strCur = isUndef(cur) ? '' : String(cur);
  56176. if (shouldUpdateValue(elm, strCur)) {
  56177. elm.value = strCur;
  56178. }
  56179. } else if (key === 'innerHTML' && isSVG(elm.tagName) && isUndef(elm.innerHTML)) {
  56180. // IE doesn't support innerHTML for SVG elements
  56181. svgContainer = svgContainer || document.createElement('div');
  56182. svgContainer.innerHTML = "<svg>" + cur + "</svg>";
  56183. var svg = svgContainer.firstChild;
  56184. while (elm.firstChild) {
  56185. elm.removeChild(elm.firstChild);
  56186. }
  56187. while (svg.firstChild) {
  56188. elm.appendChild(svg.firstChild);
  56189. }
  56190. } else if (
  56191. // skip the update if old and new VDOM state is the same.
  56192. // `value` is handled separately because the DOM value may be temporarily
  56193. // out of sync with VDOM state due to focus, composition and modifiers.
  56194. // This #4521 by skipping the unnecesarry `checked` update.
  56195. cur !== oldProps[key]
  56196. ) {
  56197. // some property updates can throw
  56198. // e.g. `value` on <progress> w/ non-finite value
  56199. try {
  56200. elm[key] = cur;
  56201. } catch (e) {}
  56202. }
  56203. }
  56204. }
  56205. // check platforms/web/util/attrs.js acceptValue
  56206. function shouldUpdateValue (elm, checkVal) {
  56207. return (!elm.composing && (
  56208. elm.tagName === 'OPTION' ||
  56209. isNotInFocusAndDirty(elm, checkVal) ||
  56210. isDirtyWithModifiers(elm, checkVal)
  56211. ))
  56212. }
  56213. function isNotInFocusAndDirty (elm, checkVal) {
  56214. // return true when textbox (.number and .trim) loses focus and its value is
  56215. // not equal to the updated value
  56216. var notInFocus = true;
  56217. // #6157
  56218. // work around IE bug when accessing document.activeElement in an iframe
  56219. try { notInFocus = document.activeElement !== elm; } catch (e) {}
  56220. return notInFocus && elm.value !== checkVal
  56221. }
  56222. function isDirtyWithModifiers (elm, newVal) {
  56223. var value = elm.value;
  56224. var modifiers = elm._vModifiers; // injected by v-model runtime
  56225. if (isDef(modifiers)) {
  56226. if (modifiers.number) {
  56227. return toNumber(value) !== toNumber(newVal)
  56228. }
  56229. if (modifiers.trim) {
  56230. return value.trim() !== newVal.trim()
  56231. }
  56232. }
  56233. return value !== newVal
  56234. }
  56235. var domProps = {
  56236. create: updateDOMProps,
  56237. update: updateDOMProps
  56238. };
  56239. /* */
  56240. var parseStyleText = cached(function (cssText) {
  56241. var res = {};
  56242. var listDelimiter = /;(?![^(]*\))/g;
  56243. var propertyDelimiter = /:(.+)/;
  56244. cssText.split(listDelimiter).forEach(function (item) {
  56245. if (item) {
  56246. var tmp = item.split(propertyDelimiter);
  56247. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  56248. }
  56249. });
  56250. return res
  56251. });
  56252. // merge static and dynamic style data on the same vnode
  56253. function normalizeStyleData (data) {
  56254. var style = normalizeStyleBinding(data.style);
  56255. // static style is pre-processed into an object during compilation
  56256. // and is always a fresh object, so it's safe to merge into it
  56257. return data.staticStyle
  56258. ? extend(data.staticStyle, style)
  56259. : style
  56260. }
  56261. // normalize possible array / string values into Object
  56262. function normalizeStyleBinding (bindingStyle) {
  56263. if (Array.isArray(bindingStyle)) {
  56264. return toObject(bindingStyle)
  56265. }
  56266. if (typeof bindingStyle === 'string') {
  56267. return parseStyleText(bindingStyle)
  56268. }
  56269. return bindingStyle
  56270. }
  56271. /**
  56272. * parent component style should be after child's
  56273. * so that parent component's style could override it
  56274. */
  56275. function getStyle (vnode, checkChild) {
  56276. var res = {};
  56277. var styleData;
  56278. if (checkChild) {
  56279. var childNode = vnode;
  56280. while (childNode.componentInstance) {
  56281. childNode = childNode.componentInstance._vnode;
  56282. if (
  56283. childNode && childNode.data &&
  56284. (styleData = normalizeStyleData(childNode.data))
  56285. ) {
  56286. extend(res, styleData);
  56287. }
  56288. }
  56289. }
  56290. if ((styleData = normalizeStyleData(vnode.data))) {
  56291. extend(res, styleData);
  56292. }
  56293. var parentNode = vnode;
  56294. while ((parentNode = parentNode.parent)) {
  56295. if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {
  56296. extend(res, styleData);
  56297. }
  56298. }
  56299. return res
  56300. }
  56301. /* */
  56302. var cssVarRE = /^--/;
  56303. var importantRE = /\s*!important$/;
  56304. var setProp = function (el, name, val) {
  56305. /* istanbul ignore if */
  56306. if (cssVarRE.test(name)) {
  56307. el.style.setProperty(name, val);
  56308. } else if (importantRE.test(val)) {
  56309. el.style.setProperty(hyphenate(name), val.replace(importantRE, ''), 'important');
  56310. } else {
  56311. var normalizedName = normalize(name);
  56312. if (Array.isArray(val)) {
  56313. // Support values array created by autoprefixer, e.g.
  56314. // {display: ["-webkit-box", "-ms-flexbox", "flex"]}
  56315. // Set them one by one, and the browser will only set those it can recognize
  56316. for (var i = 0, len = val.length; i < len; i++) {
  56317. el.style[normalizedName] = val[i];
  56318. }
  56319. } else {
  56320. el.style[normalizedName] = val;
  56321. }
  56322. }
  56323. };
  56324. var vendorNames = ['Webkit', 'Moz', 'ms'];
  56325. var emptyStyle;
  56326. var normalize = cached(function (prop) {
  56327. emptyStyle = emptyStyle || document.createElement('div').style;
  56328. prop = camelize(prop);
  56329. if (prop !== 'filter' && (prop in emptyStyle)) {
  56330. return prop
  56331. }
  56332. var capName = prop.charAt(0).toUpperCase() + prop.slice(1);
  56333. for (var i = 0; i < vendorNames.length; i++) {
  56334. var name = vendorNames[i] + capName;
  56335. if (name in emptyStyle) {
  56336. return name
  56337. }
  56338. }
  56339. });
  56340. function updateStyle (oldVnode, vnode) {
  56341. var data = vnode.data;
  56342. var oldData = oldVnode.data;
  56343. if (isUndef(data.staticStyle) && isUndef(data.style) &&
  56344. isUndef(oldData.staticStyle) && isUndef(oldData.style)
  56345. ) {
  56346. return
  56347. }
  56348. var cur, name;
  56349. var el = vnode.elm;
  56350. var oldStaticStyle = oldData.staticStyle;
  56351. var oldStyleBinding = oldData.normalizedStyle || oldData.style || {};
  56352. // if static style exists, stylebinding already merged into it when doing normalizeStyleData
  56353. var oldStyle = oldStaticStyle || oldStyleBinding;
  56354. var style = normalizeStyleBinding(vnode.data.style) || {};
  56355. // store normalized style under a different key for next diff
  56356. // make sure to clone it if it's reactive, since the user likely wants
  56357. // to mutate it.
  56358. vnode.data.normalizedStyle = isDef(style.__ob__)
  56359. ? extend({}, style)
  56360. : style;
  56361. var newStyle = getStyle(vnode, true);
  56362. for (name in oldStyle) {
  56363. if (isUndef(newStyle[name])) {
  56364. setProp(el, name, '');
  56365. }
  56366. }
  56367. for (name in newStyle) {
  56368. cur = newStyle[name];
  56369. if (cur !== oldStyle[name]) {
  56370. // ie9 setting to null has no effect, must use empty string
  56371. setProp(el, name, cur == null ? '' : cur);
  56372. }
  56373. }
  56374. }
  56375. var style = {
  56376. create: updateStyle,
  56377. update: updateStyle
  56378. };
  56379. /* */
  56380. var whitespaceRE = /\s+/;
  56381. /**
  56382. * Add class with compatibility for SVG since classList is not supported on
  56383. * SVG elements in IE
  56384. */
  56385. function addClass (el, cls) {
  56386. /* istanbul ignore if */
  56387. if (!cls || !(cls = cls.trim())) {
  56388. return
  56389. }
  56390. /* istanbul ignore else */
  56391. if (el.classList) {
  56392. if (cls.indexOf(' ') > -1) {
  56393. cls.split(whitespaceRE).forEach(function (c) { return el.classList.add(c); });
  56394. } else {
  56395. el.classList.add(cls);
  56396. }
  56397. } else {
  56398. var cur = " " + (el.getAttribute('class') || '') + " ";
  56399. if (cur.indexOf(' ' + cls + ' ') < 0) {
  56400. el.setAttribute('class', (cur + cls).trim());
  56401. }
  56402. }
  56403. }
  56404. /**
  56405. * Remove class with compatibility for SVG since classList is not supported on
  56406. * SVG elements in IE
  56407. */
  56408. function removeClass (el, cls) {
  56409. /* istanbul ignore if */
  56410. if (!cls || !(cls = cls.trim())) {
  56411. return
  56412. }
  56413. /* istanbul ignore else */
  56414. if (el.classList) {
  56415. if (cls.indexOf(' ') > -1) {
  56416. cls.split(whitespaceRE).forEach(function (c) { return el.classList.remove(c); });
  56417. } else {
  56418. el.classList.remove(cls);
  56419. }
  56420. if (!el.classList.length) {
  56421. el.removeAttribute('class');
  56422. }
  56423. } else {
  56424. var cur = " " + (el.getAttribute('class') || '') + " ";
  56425. var tar = ' ' + cls + ' ';
  56426. while (cur.indexOf(tar) >= 0) {
  56427. cur = cur.replace(tar, ' ');
  56428. }
  56429. cur = cur.trim();
  56430. if (cur) {
  56431. el.setAttribute('class', cur);
  56432. } else {
  56433. el.removeAttribute('class');
  56434. }
  56435. }
  56436. }
  56437. /* */
  56438. function resolveTransition (def$$1) {
  56439. if (!def$$1) {
  56440. return
  56441. }
  56442. /* istanbul ignore else */
  56443. if (typeof def$$1 === 'object') {
  56444. var res = {};
  56445. if (def$$1.css !== false) {
  56446. extend(res, autoCssTransition(def$$1.name || 'v'));
  56447. }
  56448. extend(res, def$$1);
  56449. return res
  56450. } else if (typeof def$$1 === 'string') {
  56451. return autoCssTransition(def$$1)
  56452. }
  56453. }
  56454. var autoCssTransition = cached(function (name) {
  56455. return {
  56456. enterClass: (name + "-enter"),
  56457. enterToClass: (name + "-enter-to"),
  56458. enterActiveClass: (name + "-enter-active"),
  56459. leaveClass: (name + "-leave"),
  56460. leaveToClass: (name + "-leave-to"),
  56461. leaveActiveClass: (name + "-leave-active")
  56462. }
  56463. });
  56464. var hasTransition = inBrowser && !isIE9;
  56465. var TRANSITION = 'transition';
  56466. var ANIMATION = 'animation';
  56467. // Transition property/event sniffing
  56468. var transitionProp = 'transition';
  56469. var transitionEndEvent = 'transitionend';
  56470. var animationProp = 'animation';
  56471. var animationEndEvent = 'animationend';
  56472. if (hasTransition) {
  56473. /* istanbul ignore if */
  56474. if (window.ontransitionend === undefined &&
  56475. window.onwebkittransitionend !== undefined
  56476. ) {
  56477. transitionProp = 'WebkitTransition';
  56478. transitionEndEvent = 'webkitTransitionEnd';
  56479. }
  56480. if (window.onanimationend === undefined &&
  56481. window.onwebkitanimationend !== undefined
  56482. ) {
  56483. animationProp = 'WebkitAnimation';
  56484. animationEndEvent = 'webkitAnimationEnd';
  56485. }
  56486. }
  56487. // binding to window is necessary to make hot reload work in IE in strict mode
  56488. var raf = inBrowser
  56489. ? window.requestAnimationFrame
  56490. ? window.requestAnimationFrame.bind(window)
  56491. : setTimeout
  56492. : /* istanbul ignore next */ function (fn) { return fn(); };
  56493. function nextFrame (fn) {
  56494. raf(function () {
  56495. raf(fn);
  56496. });
  56497. }
  56498. function addTransitionClass (el, cls) {
  56499. var transitionClasses = el._transitionClasses || (el._transitionClasses = []);
  56500. if (transitionClasses.indexOf(cls) < 0) {
  56501. transitionClasses.push(cls);
  56502. addClass(el, cls);
  56503. }
  56504. }
  56505. function removeTransitionClass (el, cls) {
  56506. if (el._transitionClasses) {
  56507. remove(el._transitionClasses, cls);
  56508. }
  56509. removeClass(el, cls);
  56510. }
  56511. function whenTransitionEnds (
  56512. el,
  56513. expectedType,
  56514. cb
  56515. ) {
  56516. var ref = getTransitionInfo(el, expectedType);
  56517. var type = ref.type;
  56518. var timeout = ref.timeout;
  56519. var propCount = ref.propCount;
  56520. if (!type) { return cb() }
  56521. var event = type === TRANSITION ? transitionEndEvent : animationEndEvent;
  56522. var ended = 0;
  56523. var end = function () {
  56524. el.removeEventListener(event, onEnd);
  56525. cb();
  56526. };
  56527. var onEnd = function (e) {
  56528. if (e.target === el) {
  56529. if (++ended >= propCount) {
  56530. end();
  56531. }
  56532. }
  56533. };
  56534. setTimeout(function () {
  56535. if (ended < propCount) {
  56536. end();
  56537. }
  56538. }, timeout + 1);
  56539. el.addEventListener(event, onEnd);
  56540. }
  56541. var transformRE = /\b(transform|all)(,|$)/;
  56542. function getTransitionInfo (el, expectedType) {
  56543. var styles = window.getComputedStyle(el);
  56544. // JSDOM may return undefined for transition properties
  56545. var transitionDelays = (styles[transitionProp + 'Delay'] || '').split(', ');
  56546. var transitionDurations = (styles[transitionProp + 'Duration'] || '').split(', ');
  56547. var transitionTimeout = getTimeout(transitionDelays, transitionDurations);
  56548. var animationDelays = (styles[animationProp + 'Delay'] || '').split(', ');
  56549. var animationDurations = (styles[animationProp + 'Duration'] || '').split(', ');
  56550. var animationTimeout = getTimeout(animationDelays, animationDurations);
  56551. var type;
  56552. var timeout = 0;
  56553. var propCount = 0;
  56554. /* istanbul ignore if */
  56555. if (expectedType === TRANSITION) {
  56556. if (transitionTimeout > 0) {
  56557. type = TRANSITION;
  56558. timeout = transitionTimeout;
  56559. propCount = transitionDurations.length;
  56560. }
  56561. } else if (expectedType === ANIMATION) {
  56562. if (animationTimeout > 0) {
  56563. type = ANIMATION;
  56564. timeout = animationTimeout;
  56565. propCount = animationDurations.length;
  56566. }
  56567. } else {
  56568. timeout = Math.max(transitionTimeout, animationTimeout);
  56569. type = timeout > 0
  56570. ? transitionTimeout > animationTimeout
  56571. ? TRANSITION
  56572. : ANIMATION
  56573. : null;
  56574. propCount = type
  56575. ? type === TRANSITION
  56576. ? transitionDurations.length
  56577. : animationDurations.length
  56578. : 0;
  56579. }
  56580. var hasTransform =
  56581. type === TRANSITION &&
  56582. transformRE.test(styles[transitionProp + 'Property']);
  56583. return {
  56584. type: type,
  56585. timeout: timeout,
  56586. propCount: propCount,
  56587. hasTransform: hasTransform
  56588. }
  56589. }
  56590. function getTimeout (delays, durations) {
  56591. /* istanbul ignore next */
  56592. while (delays.length < durations.length) {
  56593. delays = delays.concat(delays);
  56594. }
  56595. return Math.max.apply(null, durations.map(function (d, i) {
  56596. return toMs(d) + toMs(delays[i])
  56597. }))
  56598. }
  56599. // Old versions of Chromium (below 61.0.3163.100) formats floating pointer numbers
  56600. // in a locale-dependent way, using a comma instead of a dot.
  56601. // If comma is not replaced with a dot, the input will be rounded down (i.e. acting
  56602. // as a floor function) causing unexpected behaviors
  56603. function toMs (s) {
  56604. return Number(s.slice(0, -1).replace(',', '.')) * 1000
  56605. }
  56606. /* */
  56607. function enter (vnode, toggleDisplay) {
  56608. var el = vnode.elm;
  56609. // call leave callback now
  56610. if (isDef(el._leaveCb)) {
  56611. el._leaveCb.cancelled = true;
  56612. el._leaveCb();
  56613. }
  56614. var data = resolveTransition(vnode.data.transition);
  56615. if (isUndef(data)) {
  56616. return
  56617. }
  56618. /* istanbul ignore if */
  56619. if (isDef(el._enterCb) || el.nodeType !== 1) {
  56620. return
  56621. }
  56622. var css = data.css;
  56623. var type = data.type;
  56624. var enterClass = data.enterClass;
  56625. var enterToClass = data.enterToClass;
  56626. var enterActiveClass = data.enterActiveClass;
  56627. var appearClass = data.appearClass;
  56628. var appearToClass = data.appearToClass;
  56629. var appearActiveClass = data.appearActiveClass;
  56630. var beforeEnter = data.beforeEnter;
  56631. var enter = data.enter;
  56632. var afterEnter = data.afterEnter;
  56633. var enterCancelled = data.enterCancelled;
  56634. var beforeAppear = data.beforeAppear;
  56635. var appear = data.appear;
  56636. var afterAppear = data.afterAppear;
  56637. var appearCancelled = data.appearCancelled;
  56638. var duration = data.duration;
  56639. // activeInstance will always be the <transition> component managing this
  56640. // transition. One edge case to check is when the <transition> is placed
  56641. // as the root node of a child component. In that case we need to check
  56642. // <transition>'s parent for appear check.
  56643. var context = activeInstance;
  56644. var transitionNode = activeInstance.$vnode;
  56645. while (transitionNode && transitionNode.parent) {
  56646. context = transitionNode.context;
  56647. transitionNode = transitionNode.parent;
  56648. }
  56649. var isAppear = !context._isMounted || !vnode.isRootInsert;
  56650. if (isAppear && !appear && appear !== '') {
  56651. return
  56652. }
  56653. var startClass = isAppear && appearClass
  56654. ? appearClass
  56655. : enterClass;
  56656. var activeClass = isAppear && appearActiveClass
  56657. ? appearActiveClass
  56658. : enterActiveClass;
  56659. var toClass = isAppear && appearToClass
  56660. ? appearToClass
  56661. : enterToClass;
  56662. var beforeEnterHook = isAppear
  56663. ? (beforeAppear || beforeEnter)
  56664. : beforeEnter;
  56665. var enterHook = isAppear
  56666. ? (typeof appear === 'function' ? appear : enter)
  56667. : enter;
  56668. var afterEnterHook = isAppear
  56669. ? (afterAppear || afterEnter)
  56670. : afterEnter;
  56671. var enterCancelledHook = isAppear
  56672. ? (appearCancelled || enterCancelled)
  56673. : enterCancelled;
  56674. var explicitEnterDuration = toNumber(
  56675. isObject(duration)
  56676. ? duration.enter
  56677. : duration
  56678. );
  56679. if (explicitEnterDuration != null) {
  56680. checkDuration(explicitEnterDuration, 'enter', vnode);
  56681. }
  56682. var expectsCSS = css !== false && !isIE9;
  56683. var userWantsControl = getHookArgumentsLength(enterHook);
  56684. var cb = el._enterCb = once(function () {
  56685. if (expectsCSS) {
  56686. removeTransitionClass(el, toClass);
  56687. removeTransitionClass(el, activeClass);
  56688. }
  56689. if (cb.cancelled) {
  56690. if (expectsCSS) {
  56691. removeTransitionClass(el, startClass);
  56692. }
  56693. enterCancelledHook && enterCancelledHook(el);
  56694. } else {
  56695. afterEnterHook && afterEnterHook(el);
  56696. }
  56697. el._enterCb = null;
  56698. });
  56699. if (!vnode.data.show) {
  56700. // remove pending leave element on enter by injecting an insert hook
  56701. mergeVNodeHook(vnode, 'insert', function () {
  56702. var parent = el.parentNode;
  56703. var pendingNode = parent && parent._pending && parent._pending[vnode.key];
  56704. if (pendingNode &&
  56705. pendingNode.tag === vnode.tag &&
  56706. pendingNode.elm._leaveCb
  56707. ) {
  56708. pendingNode.elm._leaveCb();
  56709. }
  56710. enterHook && enterHook(el, cb);
  56711. });
  56712. }
  56713. // start enter transition
  56714. beforeEnterHook && beforeEnterHook(el);
  56715. if (expectsCSS) {
  56716. addTransitionClass(el, startClass);
  56717. addTransitionClass(el, activeClass);
  56718. nextFrame(function () {
  56719. removeTransitionClass(el, startClass);
  56720. if (!cb.cancelled) {
  56721. addTransitionClass(el, toClass);
  56722. if (!userWantsControl) {
  56723. if (isValidDuration(explicitEnterDuration)) {
  56724. setTimeout(cb, explicitEnterDuration);
  56725. } else {
  56726. whenTransitionEnds(el, type, cb);
  56727. }
  56728. }
  56729. }
  56730. });
  56731. }
  56732. if (vnode.data.show) {
  56733. toggleDisplay && toggleDisplay();
  56734. enterHook && enterHook(el, cb);
  56735. }
  56736. if (!expectsCSS && !userWantsControl) {
  56737. cb();
  56738. }
  56739. }
  56740. function leave (vnode, rm) {
  56741. var el = vnode.elm;
  56742. // call enter callback now
  56743. if (isDef(el._enterCb)) {
  56744. el._enterCb.cancelled = true;
  56745. el._enterCb();
  56746. }
  56747. var data = resolveTransition(vnode.data.transition);
  56748. if (isUndef(data) || el.nodeType !== 1) {
  56749. return rm()
  56750. }
  56751. /* istanbul ignore if */
  56752. if (isDef(el._leaveCb)) {
  56753. return
  56754. }
  56755. var css = data.css;
  56756. var type = data.type;
  56757. var leaveClass = data.leaveClass;
  56758. var leaveToClass = data.leaveToClass;
  56759. var leaveActiveClass = data.leaveActiveClass;
  56760. var beforeLeave = data.beforeLeave;
  56761. var leave = data.leave;
  56762. var afterLeave = data.afterLeave;
  56763. var leaveCancelled = data.leaveCancelled;
  56764. var delayLeave = data.delayLeave;
  56765. var duration = data.duration;
  56766. var expectsCSS = css !== false && !isIE9;
  56767. var userWantsControl = getHookArgumentsLength(leave);
  56768. var explicitLeaveDuration = toNumber(
  56769. isObject(duration)
  56770. ? duration.leave
  56771. : duration
  56772. );
  56773. if (isDef(explicitLeaveDuration)) {
  56774. checkDuration(explicitLeaveDuration, 'leave', vnode);
  56775. }
  56776. var cb = el._leaveCb = once(function () {
  56777. if (el.parentNode && el.parentNode._pending) {
  56778. el.parentNode._pending[vnode.key] = null;
  56779. }
  56780. if (expectsCSS) {
  56781. removeTransitionClass(el, leaveToClass);
  56782. removeTransitionClass(el, leaveActiveClass);
  56783. }
  56784. if (cb.cancelled) {
  56785. if (expectsCSS) {
  56786. removeTransitionClass(el, leaveClass);
  56787. }
  56788. leaveCancelled && leaveCancelled(el);
  56789. } else {
  56790. rm();
  56791. afterLeave && afterLeave(el);
  56792. }
  56793. el._leaveCb = null;
  56794. });
  56795. if (delayLeave) {
  56796. delayLeave(performLeave);
  56797. } else {
  56798. performLeave();
  56799. }
  56800. function performLeave () {
  56801. // the delayed leave may have already been cancelled
  56802. if (cb.cancelled) {
  56803. return
  56804. }
  56805. // record leaving element
  56806. if (!vnode.data.show && el.parentNode) {
  56807. (el.parentNode._pending || (el.parentNode._pending = {}))[(vnode.key)] = vnode;
  56808. }
  56809. beforeLeave && beforeLeave(el);
  56810. if (expectsCSS) {
  56811. addTransitionClass(el, leaveClass);
  56812. addTransitionClass(el, leaveActiveClass);
  56813. nextFrame(function () {
  56814. removeTransitionClass(el, leaveClass);
  56815. if (!cb.cancelled) {
  56816. addTransitionClass(el, leaveToClass);
  56817. if (!userWantsControl) {
  56818. if (isValidDuration(explicitLeaveDuration)) {
  56819. setTimeout(cb, explicitLeaveDuration);
  56820. } else {
  56821. whenTransitionEnds(el, type, cb);
  56822. }
  56823. }
  56824. }
  56825. });
  56826. }
  56827. leave && leave(el, cb);
  56828. if (!expectsCSS && !userWantsControl) {
  56829. cb();
  56830. }
  56831. }
  56832. }
  56833. // only used in dev mode
  56834. function checkDuration (val, name, vnode) {
  56835. if (typeof val !== 'number') {
  56836. warn(
  56837. "<transition> explicit " + name + " duration is not a valid number - " +
  56838. "got " + (JSON.stringify(val)) + ".",
  56839. vnode.context
  56840. );
  56841. } else if (isNaN(val)) {
  56842. warn(
  56843. "<transition> explicit " + name + " duration is NaN - " +
  56844. 'the duration expression might be incorrect.',
  56845. vnode.context
  56846. );
  56847. }
  56848. }
  56849. function isValidDuration (val) {
  56850. return typeof val === 'number' && !isNaN(val)
  56851. }
  56852. /**
  56853. * Normalize a transition hook's argument length. The hook may be:
  56854. * - a merged hook (invoker) with the original in .fns
  56855. * - a wrapped component method (check ._length)
  56856. * - a plain function (.length)
  56857. */
  56858. function getHookArgumentsLength (fn) {
  56859. if (isUndef(fn)) {
  56860. return false
  56861. }
  56862. var invokerFns = fn.fns;
  56863. if (isDef(invokerFns)) {
  56864. // invoker
  56865. return getHookArgumentsLength(
  56866. Array.isArray(invokerFns)
  56867. ? invokerFns[0]
  56868. : invokerFns
  56869. )
  56870. } else {
  56871. return (fn._length || fn.length) > 1
  56872. }
  56873. }
  56874. function _enter (_, vnode) {
  56875. if (vnode.data.show !== true) {
  56876. enter(vnode);
  56877. }
  56878. }
  56879. var transition = inBrowser ? {
  56880. create: _enter,
  56881. activate: _enter,
  56882. remove: function remove$$1 (vnode, rm) {
  56883. /* istanbul ignore else */
  56884. if (vnode.data.show !== true) {
  56885. leave(vnode, rm);
  56886. } else {
  56887. rm();
  56888. }
  56889. }
  56890. } : {};
  56891. var platformModules = [
  56892. attrs,
  56893. klass,
  56894. events,
  56895. domProps,
  56896. style,
  56897. transition
  56898. ];
  56899. /* */
  56900. // the directive module should be applied last, after all
  56901. // built-in modules have been applied.
  56902. var modules = platformModules.concat(baseModules);
  56903. var patch = createPatchFunction({ nodeOps: nodeOps, modules: modules });
  56904. /**
  56905. * Not type checking this file because flow doesn't like attaching
  56906. * properties to Elements.
  56907. */
  56908. /* istanbul ignore if */
  56909. if (isIE9) {
  56910. // http://www.matts411.com/post/internet-explorer-9-oninput/
  56911. document.addEventListener('selectionchange', function () {
  56912. var el = document.activeElement;
  56913. if (el && el.vmodel) {
  56914. trigger(el, 'input');
  56915. }
  56916. });
  56917. }
  56918. var directive = {
  56919. inserted: function inserted (el, binding, vnode, oldVnode) {
  56920. if (vnode.tag === 'select') {
  56921. // #6903
  56922. if (oldVnode.elm && !oldVnode.elm._vOptions) {
  56923. mergeVNodeHook(vnode, 'postpatch', function () {
  56924. directive.componentUpdated(el, binding, vnode);
  56925. });
  56926. } else {
  56927. setSelected(el, binding, vnode.context);
  56928. }
  56929. el._vOptions = [].map.call(el.options, getValue);
  56930. } else if (vnode.tag === 'textarea' || isTextInputType(el.type)) {
  56931. el._vModifiers = binding.modifiers;
  56932. if (!binding.modifiers.lazy) {
  56933. el.addEventListener('compositionstart', onCompositionStart);
  56934. el.addEventListener('compositionend', onCompositionEnd);
  56935. // Safari < 10.2 & UIWebView doesn't fire compositionend when
  56936. // switching focus before confirming composition choice
  56937. // this also fixes the issue where some browsers e.g. iOS Chrome
  56938. // fires "change" instead of "input" on autocomplete.
  56939. el.addEventListener('change', onCompositionEnd);
  56940. /* istanbul ignore if */
  56941. if (isIE9) {
  56942. el.vmodel = true;
  56943. }
  56944. }
  56945. }
  56946. },
  56947. componentUpdated: function componentUpdated (el, binding, vnode) {
  56948. if (vnode.tag === 'select') {
  56949. setSelected(el, binding, vnode.context);
  56950. // in case the options rendered by v-for have changed,
  56951. // it's possible that the value is out-of-sync with the rendered options.
  56952. // detect such cases and filter out values that no longer has a matching
  56953. // option in the DOM.
  56954. var prevOptions = el._vOptions;
  56955. var curOptions = el._vOptions = [].map.call(el.options, getValue);
  56956. if (curOptions.some(function (o, i) { return !looseEqual(o, prevOptions[i]); })) {
  56957. // trigger change event if
  56958. // no matching option found for at least one value
  56959. var needReset = el.multiple
  56960. ? binding.value.some(function (v) { return hasNoMatchingOption(v, curOptions); })
  56961. : binding.value !== binding.oldValue && hasNoMatchingOption(binding.value, curOptions);
  56962. if (needReset) {
  56963. trigger(el, 'change');
  56964. }
  56965. }
  56966. }
  56967. }
  56968. };
  56969. function setSelected (el, binding, vm) {
  56970. actuallySetSelected(el, binding, vm);
  56971. /* istanbul ignore if */
  56972. if (isIE || isEdge) {
  56973. setTimeout(function () {
  56974. actuallySetSelected(el, binding, vm);
  56975. }, 0);
  56976. }
  56977. }
  56978. function actuallySetSelected (el, binding, vm) {
  56979. var value = binding.value;
  56980. var isMultiple = el.multiple;
  56981. if (isMultiple && !Array.isArray(value)) {
  56982. warn(
  56983. "<select multiple v-model=\"" + (binding.expression) + "\"> " +
  56984. "expects an Array value for its binding, but got " + (Object.prototype.toString.call(value).slice(8, -1)),
  56985. vm
  56986. );
  56987. return
  56988. }
  56989. var selected, option;
  56990. for (var i = 0, l = el.options.length; i < l; i++) {
  56991. option = el.options[i];
  56992. if (isMultiple) {
  56993. selected = looseIndexOf(value, getValue(option)) > -1;
  56994. if (option.selected !== selected) {
  56995. option.selected = selected;
  56996. }
  56997. } else {
  56998. if (looseEqual(getValue(option), value)) {
  56999. if (el.selectedIndex !== i) {
  57000. el.selectedIndex = i;
  57001. }
  57002. return
  57003. }
  57004. }
  57005. }
  57006. if (!isMultiple) {
  57007. el.selectedIndex = -1;
  57008. }
  57009. }
  57010. function hasNoMatchingOption (value, options) {
  57011. return options.every(function (o) { return !looseEqual(o, value); })
  57012. }
  57013. function getValue (option) {
  57014. return '_value' in option
  57015. ? option._value
  57016. : option.value
  57017. }
  57018. function onCompositionStart (e) {
  57019. e.target.composing = true;
  57020. }
  57021. function onCompositionEnd (e) {
  57022. // prevent triggering an input event for no reason
  57023. if (!e.target.composing) { return }
  57024. e.target.composing = false;
  57025. trigger(e.target, 'input');
  57026. }
  57027. function trigger (el, type) {
  57028. var e = document.createEvent('HTMLEvents');
  57029. e.initEvent(type, true, true);
  57030. el.dispatchEvent(e);
  57031. }
  57032. /* */
  57033. // recursively search for possible transition defined inside the component root
  57034. function locateNode (vnode) {
  57035. return vnode.componentInstance && (!vnode.data || !vnode.data.transition)
  57036. ? locateNode(vnode.componentInstance._vnode)
  57037. : vnode
  57038. }
  57039. var show = {
  57040. bind: function bind (el, ref, vnode) {
  57041. var value = ref.value;
  57042. vnode = locateNode(vnode);
  57043. var transition$$1 = vnode.data && vnode.data.transition;
  57044. var originalDisplay = el.__vOriginalDisplay =
  57045. el.style.display === 'none' ? '' : el.style.display;
  57046. if (value && transition$$1) {
  57047. vnode.data.show = true;
  57048. enter(vnode, function () {
  57049. el.style.display = originalDisplay;
  57050. });
  57051. } else {
  57052. el.style.display = value ? originalDisplay : 'none';
  57053. }
  57054. },
  57055. update: function update (el, ref, vnode) {
  57056. var value = ref.value;
  57057. var oldValue = ref.oldValue;
  57058. /* istanbul ignore if */
  57059. if (!value === !oldValue) { return }
  57060. vnode = locateNode(vnode);
  57061. var transition$$1 = vnode.data && vnode.data.transition;
  57062. if (transition$$1) {
  57063. vnode.data.show = true;
  57064. if (value) {
  57065. enter(vnode, function () {
  57066. el.style.display = el.__vOriginalDisplay;
  57067. });
  57068. } else {
  57069. leave(vnode, function () {
  57070. el.style.display = 'none';
  57071. });
  57072. }
  57073. } else {
  57074. el.style.display = value ? el.__vOriginalDisplay : 'none';
  57075. }
  57076. },
  57077. unbind: function unbind (
  57078. el,
  57079. binding,
  57080. vnode,
  57081. oldVnode,
  57082. isDestroy
  57083. ) {
  57084. if (!isDestroy) {
  57085. el.style.display = el.__vOriginalDisplay;
  57086. }
  57087. }
  57088. };
  57089. var platformDirectives = {
  57090. model: directive,
  57091. show: show
  57092. };
  57093. /* */
  57094. var transitionProps = {
  57095. name: String,
  57096. appear: Boolean,
  57097. css: Boolean,
  57098. mode: String,
  57099. type: String,
  57100. enterClass: String,
  57101. leaveClass: String,
  57102. enterToClass: String,
  57103. leaveToClass: String,
  57104. enterActiveClass: String,
  57105. leaveActiveClass: String,
  57106. appearClass: String,
  57107. appearActiveClass: String,
  57108. appearToClass: String,
  57109. duration: [Number, String, Object]
  57110. };
  57111. // in case the child is also an abstract component, e.g. <keep-alive>
  57112. // we want to recursively retrieve the real component to be rendered
  57113. function getRealChild (vnode) {
  57114. var compOptions = vnode && vnode.componentOptions;
  57115. if (compOptions && compOptions.Ctor.options.abstract) {
  57116. return getRealChild(getFirstComponentChild(compOptions.children))
  57117. } else {
  57118. return vnode
  57119. }
  57120. }
  57121. function extractTransitionData (comp) {
  57122. var data = {};
  57123. var options = comp.$options;
  57124. // props
  57125. for (var key in options.propsData) {
  57126. data[key] = comp[key];
  57127. }
  57128. // events.
  57129. // extract listeners and pass them directly to the transition methods
  57130. var listeners = options._parentListeners;
  57131. for (var key$1 in listeners) {
  57132. data[camelize(key$1)] = listeners[key$1];
  57133. }
  57134. return data
  57135. }
  57136. function placeholder (h, rawChild) {
  57137. if (/\d-keep-alive$/.test(rawChild.tag)) {
  57138. return h('keep-alive', {
  57139. props: rawChild.componentOptions.propsData
  57140. })
  57141. }
  57142. }
  57143. function hasParentTransition (vnode) {
  57144. while ((vnode = vnode.parent)) {
  57145. if (vnode.data.transition) {
  57146. return true
  57147. }
  57148. }
  57149. }
  57150. function isSameChild (child, oldChild) {
  57151. return oldChild.key === child.key && oldChild.tag === child.tag
  57152. }
  57153. var isNotTextNode = function (c) { return c.tag || isAsyncPlaceholder(c); };
  57154. var isVShowDirective = function (d) { return d.name === 'show'; };
  57155. var Transition = {
  57156. name: 'transition',
  57157. props: transitionProps,
  57158. abstract: true,
  57159. render: function render (h) {
  57160. var this$1 = this;
  57161. var children = this.$slots.default;
  57162. if (!children) {
  57163. return
  57164. }
  57165. // filter out text nodes (possible whitespaces)
  57166. children = children.filter(isNotTextNode);
  57167. /* istanbul ignore if */
  57168. if (!children.length) {
  57169. return
  57170. }
  57171. // warn multiple elements
  57172. if (children.length > 1) {
  57173. warn(
  57174. '<transition> can only be used on a single element. Use ' +
  57175. '<transition-group> for lists.',
  57176. this.$parent
  57177. );
  57178. }
  57179. var mode = this.mode;
  57180. // warn invalid mode
  57181. if (mode && mode !== 'in-out' && mode !== 'out-in'
  57182. ) {
  57183. warn(
  57184. 'invalid <transition> mode: ' + mode,
  57185. this.$parent
  57186. );
  57187. }
  57188. var rawChild = children[0];
  57189. // if this is a component root node and the component's
  57190. // parent container node also has transition, skip.
  57191. if (hasParentTransition(this.$vnode)) {
  57192. return rawChild
  57193. }
  57194. // apply transition data to child
  57195. // use getRealChild() to ignore abstract components e.g. keep-alive
  57196. var child = getRealChild(rawChild);
  57197. /* istanbul ignore if */
  57198. if (!child) {
  57199. return rawChild
  57200. }
  57201. if (this._leaving) {
  57202. return placeholder(h, rawChild)
  57203. }
  57204. // ensure a key that is unique to the vnode type and to this transition
  57205. // component instance. This key will be used to remove pending leaving nodes
  57206. // during entering.
  57207. var id = "__transition-" + (this._uid) + "-";
  57208. child.key = child.key == null
  57209. ? child.isComment
  57210. ? id + 'comment'
  57211. : id + child.tag
  57212. : isPrimitive(child.key)
  57213. ? (String(child.key).indexOf(id) === 0 ? child.key : id + child.key)
  57214. : child.key;
  57215. var data = (child.data || (child.data = {})).transition = extractTransitionData(this);
  57216. var oldRawChild = this._vnode;
  57217. var oldChild = getRealChild(oldRawChild);
  57218. // mark v-show
  57219. // so that the transition module can hand over the control to the directive
  57220. if (child.data.directives && child.data.directives.some(isVShowDirective)) {
  57221. child.data.show = true;
  57222. }
  57223. if (
  57224. oldChild &&
  57225. oldChild.data &&
  57226. !isSameChild(child, oldChild) &&
  57227. !isAsyncPlaceholder(oldChild) &&
  57228. // #6687 component root is a comment node
  57229. !(oldChild.componentInstance && oldChild.componentInstance._vnode.isComment)
  57230. ) {
  57231. // replace old child transition data with fresh one
  57232. // important for dynamic transitions!
  57233. var oldData = oldChild.data.transition = extend({}, data);
  57234. // handle transition mode
  57235. if (mode === 'out-in') {
  57236. // return placeholder node and queue update when leave finishes
  57237. this._leaving = true;
  57238. mergeVNodeHook(oldData, 'afterLeave', function () {
  57239. this$1._leaving = false;
  57240. this$1.$forceUpdate();
  57241. });
  57242. return placeholder(h, rawChild)
  57243. } else if (mode === 'in-out') {
  57244. if (isAsyncPlaceholder(child)) {
  57245. return oldRawChild
  57246. }
  57247. var delayedLeave;
  57248. var performLeave = function () { delayedLeave(); };
  57249. mergeVNodeHook(data, 'afterEnter', performLeave);
  57250. mergeVNodeHook(data, 'enterCancelled', performLeave);
  57251. mergeVNodeHook(oldData, 'delayLeave', function (leave) { delayedLeave = leave; });
  57252. }
  57253. }
  57254. return rawChild
  57255. }
  57256. };
  57257. /* */
  57258. var props = extend({
  57259. tag: String,
  57260. moveClass: String
  57261. }, transitionProps);
  57262. delete props.mode;
  57263. var TransitionGroup = {
  57264. props: props,
  57265. beforeMount: function beforeMount () {
  57266. var this$1 = this;
  57267. var update = this._update;
  57268. this._update = function (vnode, hydrating) {
  57269. var restoreActiveInstance = setActiveInstance(this$1);
  57270. // force removing pass
  57271. this$1.__patch__(
  57272. this$1._vnode,
  57273. this$1.kept,
  57274. false, // hydrating
  57275. true // removeOnly (!important, avoids unnecessary moves)
  57276. );
  57277. this$1._vnode = this$1.kept;
  57278. restoreActiveInstance();
  57279. update.call(this$1, vnode, hydrating);
  57280. };
  57281. },
  57282. render: function render (h) {
  57283. var tag = this.tag || this.$vnode.data.tag || 'span';
  57284. var map = Object.create(null);
  57285. var prevChildren = this.prevChildren = this.children;
  57286. var rawChildren = this.$slots.default || [];
  57287. var children = this.children = [];
  57288. var transitionData = extractTransitionData(this);
  57289. for (var i = 0; i < rawChildren.length; i++) {
  57290. var c = rawChildren[i];
  57291. if (c.tag) {
  57292. if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {
  57293. children.push(c);
  57294. map[c.key] = c
  57295. ;(c.data || (c.data = {})).transition = transitionData;
  57296. } else {
  57297. var opts = c.componentOptions;
  57298. var name = opts ? (opts.Ctor.options.name || opts.tag || '') : c.tag;
  57299. warn(("<transition-group> children must be keyed: <" + name + ">"));
  57300. }
  57301. }
  57302. }
  57303. if (prevChildren) {
  57304. var kept = [];
  57305. var removed = [];
  57306. for (var i$1 = 0; i$1 < prevChildren.length; i$1++) {
  57307. var c$1 = prevChildren[i$1];
  57308. c$1.data.transition = transitionData;
  57309. c$1.data.pos = c$1.elm.getBoundingClientRect();
  57310. if (map[c$1.key]) {
  57311. kept.push(c$1);
  57312. } else {
  57313. removed.push(c$1);
  57314. }
  57315. }
  57316. this.kept = h(tag, null, kept);
  57317. this.removed = removed;
  57318. }
  57319. return h(tag, null, children)
  57320. },
  57321. updated: function updated () {
  57322. var children = this.prevChildren;
  57323. var moveClass = this.moveClass || ((this.name || 'v') + '-move');
  57324. if (!children.length || !this.hasMove(children[0].elm, moveClass)) {
  57325. return
  57326. }
  57327. // we divide the work into three loops to avoid mixing DOM reads and writes
  57328. // in each iteration - which helps prevent layout thrashing.
  57329. children.forEach(callPendingCbs);
  57330. children.forEach(recordPosition);
  57331. children.forEach(applyTranslation);
  57332. // force reflow to put everything in position
  57333. // assign to this to avoid being removed in tree-shaking
  57334. // $flow-disable-line
  57335. this._reflow = document.body.offsetHeight;
  57336. children.forEach(function (c) {
  57337. if (c.data.moved) {
  57338. var el = c.elm;
  57339. var s = el.style;
  57340. addTransitionClass(el, moveClass);
  57341. s.transform = s.WebkitTransform = s.transitionDuration = '';
  57342. el.addEventListener(transitionEndEvent, el._moveCb = function cb (e) {
  57343. if (e && e.target !== el) {
  57344. return
  57345. }
  57346. if (!e || /transform$/.test(e.propertyName)) {
  57347. el.removeEventListener(transitionEndEvent, cb);
  57348. el._moveCb = null;
  57349. removeTransitionClass(el, moveClass);
  57350. }
  57351. });
  57352. }
  57353. });
  57354. },
  57355. methods: {
  57356. hasMove: function hasMove (el, moveClass) {
  57357. /* istanbul ignore if */
  57358. if (!hasTransition) {
  57359. return false
  57360. }
  57361. /* istanbul ignore if */
  57362. if (this._hasMove) {
  57363. return this._hasMove
  57364. }
  57365. // Detect whether an element with the move class applied has
  57366. // CSS transitions. Since the element may be inside an entering
  57367. // transition at this very moment, we make a clone of it and remove
  57368. // all other transition classes applied to ensure only the move class
  57369. // is applied.
  57370. var clone = el.cloneNode();
  57371. if (el._transitionClasses) {
  57372. el._transitionClasses.forEach(function (cls) { removeClass(clone, cls); });
  57373. }
  57374. addClass(clone, moveClass);
  57375. clone.style.display = 'none';
  57376. this.$el.appendChild(clone);
  57377. var info = getTransitionInfo(clone);
  57378. this.$el.removeChild(clone);
  57379. return (this._hasMove = info.hasTransform)
  57380. }
  57381. }
  57382. };
  57383. function callPendingCbs (c) {
  57384. /* istanbul ignore if */
  57385. if (c.elm._moveCb) {
  57386. c.elm._moveCb();
  57387. }
  57388. /* istanbul ignore if */
  57389. if (c.elm._enterCb) {
  57390. c.elm._enterCb();
  57391. }
  57392. }
  57393. function recordPosition (c) {
  57394. c.data.newPos = c.elm.getBoundingClientRect();
  57395. }
  57396. function applyTranslation (c) {
  57397. var oldPos = c.data.pos;
  57398. var newPos = c.data.newPos;
  57399. var dx = oldPos.left - newPos.left;
  57400. var dy = oldPos.top - newPos.top;
  57401. if (dx || dy) {
  57402. c.data.moved = true;
  57403. var s = c.elm.style;
  57404. s.transform = s.WebkitTransform = "translate(" + dx + "px," + dy + "px)";
  57405. s.transitionDuration = '0s';
  57406. }
  57407. }
  57408. var platformComponents = {
  57409. Transition: Transition,
  57410. TransitionGroup: TransitionGroup
  57411. };
  57412. /* */
  57413. // install platform specific utils
  57414. Vue.config.mustUseProp = mustUseProp;
  57415. Vue.config.isReservedTag = isReservedTag;
  57416. Vue.config.isReservedAttr = isReservedAttr;
  57417. Vue.config.getTagNamespace = getTagNamespace;
  57418. Vue.config.isUnknownElement = isUnknownElement;
  57419. // install platform runtime directives & components
  57420. extend(Vue.options.directives, platformDirectives);
  57421. extend(Vue.options.components, platformComponents);
  57422. // install platform patch function
  57423. Vue.prototype.__patch__ = inBrowser ? patch : noop;
  57424. // public mount method
  57425. Vue.prototype.$mount = function (
  57426. el,
  57427. hydrating
  57428. ) {
  57429. el = el && inBrowser ? query(el) : undefined;
  57430. return mountComponent(this, el, hydrating)
  57431. };
  57432. // devtools global hook
  57433. /* istanbul ignore next */
  57434. if (inBrowser) {
  57435. setTimeout(function () {
  57436. if (config.devtools) {
  57437. if (devtools) {
  57438. devtools.emit('init', Vue);
  57439. } else {
  57440. console[console.info ? 'info' : 'log'](
  57441. 'Download the Vue Devtools extension for a better development experience:\n' +
  57442. 'https://github.com/vuejs/vue-devtools'
  57443. );
  57444. }
  57445. }
  57446. if (config.productionTip !== false &&
  57447. typeof console !== 'undefined'
  57448. ) {
  57449. console[console.info ? 'info' : 'log'](
  57450. "You are running Vue in development mode.\n" +
  57451. "Make sure to turn on production mode when deploying for production.\n" +
  57452. "See more tips at https://vuejs.org/guide/deployment.html"
  57453. );
  57454. }
  57455. }, 0);
  57456. }
  57457. /* */
  57458. var defaultTagRE = /\{\{((?:.|\r?\n)+?)\}\}/g;
  57459. var regexEscapeRE = /[-.*+?^${}()|[\]\/\\]/g;
  57460. var buildRegex = cached(function (delimiters) {
  57461. var open = delimiters[0].replace(regexEscapeRE, '\\$&');
  57462. var close = delimiters[1].replace(regexEscapeRE, '\\$&');
  57463. return new RegExp(open + '((?:.|\\n)+?)' + close, 'g')
  57464. });
  57465. function parseText (
  57466. text,
  57467. delimiters
  57468. ) {
  57469. var tagRE = delimiters ? buildRegex(delimiters) : defaultTagRE;
  57470. if (!tagRE.test(text)) {
  57471. return
  57472. }
  57473. var tokens = [];
  57474. var rawTokens = [];
  57475. var lastIndex = tagRE.lastIndex = 0;
  57476. var match, index, tokenValue;
  57477. while ((match = tagRE.exec(text))) {
  57478. index = match.index;
  57479. // push text token
  57480. if (index > lastIndex) {
  57481. rawTokens.push(tokenValue = text.slice(lastIndex, index));
  57482. tokens.push(JSON.stringify(tokenValue));
  57483. }
  57484. // tag token
  57485. var exp = parseFilters(match[1].trim());
  57486. tokens.push(("_s(" + exp + ")"));
  57487. rawTokens.push({ '@binding': exp });
  57488. lastIndex = index + match[0].length;
  57489. }
  57490. if (lastIndex < text.length) {
  57491. rawTokens.push(tokenValue = text.slice(lastIndex));
  57492. tokens.push(JSON.stringify(tokenValue));
  57493. }
  57494. return {
  57495. expression: tokens.join('+'),
  57496. tokens: rawTokens
  57497. }
  57498. }
  57499. /* */
  57500. function transformNode (el, options) {
  57501. var warn = options.warn || baseWarn;
  57502. var staticClass = getAndRemoveAttr(el, 'class');
  57503. if (staticClass) {
  57504. var res = parseText(staticClass, options.delimiters);
  57505. if (res) {
  57506. warn(
  57507. "class=\"" + staticClass + "\": " +
  57508. 'Interpolation inside attributes has been removed. ' +
  57509. 'Use v-bind or the colon shorthand instead. For example, ' +
  57510. 'instead of <div class="{{ val }}">, use <div :class="val">.',
  57511. el.rawAttrsMap['class']
  57512. );
  57513. }
  57514. }
  57515. if (staticClass) {
  57516. el.staticClass = JSON.stringify(staticClass);
  57517. }
  57518. var classBinding = getBindingAttr(el, 'class', false /* getStatic */);
  57519. if (classBinding) {
  57520. el.classBinding = classBinding;
  57521. }
  57522. }
  57523. function genData (el) {
  57524. var data = '';
  57525. if (el.staticClass) {
  57526. data += "staticClass:" + (el.staticClass) + ",";
  57527. }
  57528. if (el.classBinding) {
  57529. data += "class:" + (el.classBinding) + ",";
  57530. }
  57531. return data
  57532. }
  57533. var klass$1 = {
  57534. staticKeys: ['staticClass'],
  57535. transformNode: transformNode,
  57536. genData: genData
  57537. };
  57538. /* */
  57539. function transformNode$1 (el, options) {
  57540. var warn = options.warn || baseWarn;
  57541. var staticStyle = getAndRemoveAttr(el, 'style');
  57542. if (staticStyle) {
  57543. /* istanbul ignore if */
  57544. {
  57545. var res = parseText(staticStyle, options.delimiters);
  57546. if (res) {
  57547. warn(
  57548. "style=\"" + staticStyle + "\": " +
  57549. 'Interpolation inside attributes has been removed. ' +
  57550. 'Use v-bind or the colon shorthand instead. For example, ' +
  57551. 'instead of <div style="{{ val }}">, use <div :style="val">.',
  57552. el.rawAttrsMap['style']
  57553. );
  57554. }
  57555. }
  57556. el.staticStyle = JSON.stringify(parseStyleText(staticStyle));
  57557. }
  57558. var styleBinding = getBindingAttr(el, 'style', false /* getStatic */);
  57559. if (styleBinding) {
  57560. el.styleBinding = styleBinding;
  57561. }
  57562. }
  57563. function genData$1 (el) {
  57564. var data = '';
  57565. if (el.staticStyle) {
  57566. data += "staticStyle:" + (el.staticStyle) + ",";
  57567. }
  57568. if (el.styleBinding) {
  57569. data += "style:(" + (el.styleBinding) + "),";
  57570. }
  57571. return data
  57572. }
  57573. var style$1 = {
  57574. staticKeys: ['staticStyle'],
  57575. transformNode: transformNode$1,
  57576. genData: genData$1
  57577. };
  57578. /* */
  57579. var decoder;
  57580. var he = {
  57581. decode: function decode (html) {
  57582. decoder = decoder || document.createElement('div');
  57583. decoder.innerHTML = html;
  57584. return decoder.textContent
  57585. }
  57586. };
  57587. /* */
  57588. var isUnaryTag = makeMap(
  57589. 'area,base,br,col,embed,frame,hr,img,input,isindex,keygen,' +
  57590. 'link,meta,param,source,track,wbr'
  57591. );
  57592. // Elements that you can, intentionally, leave open
  57593. // (and which close themselves)
  57594. var canBeLeftOpenTag = makeMap(
  57595. 'colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source'
  57596. );
  57597. // HTML5 tags https://html.spec.whatwg.org/multipage/indices.html#elements-3
  57598. // Phrasing Content https://html.spec.whatwg.org/multipage/dom.html#phrasing-content
  57599. var isNonPhrasingTag = makeMap(
  57600. 'address,article,aside,base,blockquote,body,caption,col,colgroup,dd,' +
  57601. 'details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,' +
  57602. 'h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,' +
  57603. 'optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,' +
  57604. 'title,tr,track'
  57605. );
  57606. /**
  57607. * Not type-checking this file because it's mostly vendor code.
  57608. */
  57609. // Regular Expressions for parsing tags and attributes
  57610. var attribute = /^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/;
  57611. var dynamicArgAttribute = /^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/;
  57612. var ncname = "[a-zA-Z_][\\-\\.0-9_a-zA-Z" + (unicodeRegExp.source) + "]*";
  57613. var qnameCapture = "((?:" + ncname + "\\:)?" + ncname + ")";
  57614. var startTagOpen = new RegExp(("^<" + qnameCapture));
  57615. var startTagClose = /^\s*(\/?)>/;
  57616. var endTag = new RegExp(("^<\\/" + qnameCapture + "[^>]*>"));
  57617. var doctype = /^<!DOCTYPE [^>]+>/i;
  57618. // #7298: escape - to avoid being passed as HTML comment when inlined in page
  57619. var comment = /^<!\--/;
  57620. var conditionalComment = /^<!\[/;
  57621. // Special Elements (can contain anything)
  57622. var isPlainTextElement = makeMap('script,style,textarea', true);
  57623. var reCache = {};
  57624. var decodingMap = {
  57625. '&lt;': '<',
  57626. '&gt;': '>',
  57627. '&quot;': '"',
  57628. '&amp;': '&',
  57629. '&#10;': '\n',
  57630. '&#9;': '\t',
  57631. '&#39;': "'"
  57632. };
  57633. var encodedAttr = /&(?:lt|gt|quot|amp|#39);/g;
  57634. var encodedAttrWithNewLines = /&(?:lt|gt|quot|amp|#39|#10|#9);/g;
  57635. // #5992
  57636. var isIgnoreNewlineTag = makeMap('pre,textarea', true);
  57637. var shouldIgnoreFirstNewline = function (tag, html) { return tag && isIgnoreNewlineTag(tag) && html[0] === '\n'; };
  57638. function decodeAttr (value, shouldDecodeNewlines) {
  57639. var re = shouldDecodeNewlines ? encodedAttrWithNewLines : encodedAttr;
  57640. return value.replace(re, function (match) { return decodingMap[match]; })
  57641. }
  57642. function parseHTML (html, options) {
  57643. var stack = [];
  57644. var expectHTML = options.expectHTML;
  57645. var isUnaryTag$$1 = options.isUnaryTag || no;
  57646. var canBeLeftOpenTag$$1 = options.canBeLeftOpenTag || no;
  57647. var index = 0;
  57648. var last, lastTag;
  57649. while (html) {
  57650. last = html;
  57651. // Make sure we're not in a plaintext content element like script/style
  57652. if (!lastTag || !isPlainTextElement(lastTag)) {
  57653. var textEnd = html.indexOf('<');
  57654. if (textEnd === 0) {
  57655. // Comment:
  57656. if (comment.test(html)) {
  57657. var commentEnd = html.indexOf('-->');
  57658. if (commentEnd >= 0) {
  57659. if (options.shouldKeepComment) {
  57660. options.comment(html.substring(4, commentEnd), index, index + commentEnd + 3);
  57661. }
  57662. advance(commentEnd + 3);
  57663. continue
  57664. }
  57665. }
  57666. // http://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment
  57667. if (conditionalComment.test(html)) {
  57668. var conditionalEnd = html.indexOf(']>');
  57669. if (conditionalEnd >= 0) {
  57670. advance(conditionalEnd + 2);
  57671. continue
  57672. }
  57673. }
  57674. // Doctype:
  57675. var doctypeMatch = html.match(doctype);
  57676. if (doctypeMatch) {
  57677. advance(doctypeMatch[0].length);
  57678. continue
  57679. }
  57680. // End tag:
  57681. var endTagMatch = html.match(endTag);
  57682. if (endTagMatch) {
  57683. var curIndex = index;
  57684. advance(endTagMatch[0].length);
  57685. parseEndTag(endTagMatch[1], curIndex, index);
  57686. continue
  57687. }
  57688. // Start tag:
  57689. var startTagMatch = parseStartTag();
  57690. if (startTagMatch) {
  57691. handleStartTag(startTagMatch);
  57692. if (shouldIgnoreFirstNewline(startTagMatch.tagName, html)) {
  57693. advance(1);
  57694. }
  57695. continue
  57696. }
  57697. }
  57698. var text = (void 0), rest = (void 0), next = (void 0);
  57699. if (textEnd >= 0) {
  57700. rest = html.slice(textEnd);
  57701. while (
  57702. !endTag.test(rest) &&
  57703. !startTagOpen.test(rest) &&
  57704. !comment.test(rest) &&
  57705. !conditionalComment.test(rest)
  57706. ) {
  57707. // < in plain text, be forgiving and treat it as text
  57708. next = rest.indexOf('<', 1);
  57709. if (next < 0) { break }
  57710. textEnd += next;
  57711. rest = html.slice(textEnd);
  57712. }
  57713. text = html.substring(0, textEnd);
  57714. }
  57715. if (textEnd < 0) {
  57716. text = html;
  57717. }
  57718. if (text) {
  57719. advance(text.length);
  57720. }
  57721. if (options.chars && text) {
  57722. options.chars(text, index - text.length, index);
  57723. }
  57724. } else {
  57725. var endTagLength = 0;
  57726. var stackedTag = lastTag.toLowerCase();
  57727. var reStackedTag = reCache[stackedTag] || (reCache[stackedTag] = new RegExp('([\\s\\S]*?)(</' + stackedTag + '[^>]*>)', 'i'));
  57728. var rest$1 = html.replace(reStackedTag, function (all, text, endTag) {
  57729. endTagLength = endTag.length;
  57730. if (!isPlainTextElement(stackedTag) && stackedTag !== 'noscript') {
  57731. text = text
  57732. .replace(/<!\--([\s\S]*?)-->/g, '$1') // #7298
  57733. .replace(/<!\[CDATA\[([\s\S]*?)]]>/g, '$1');
  57734. }
  57735. if (shouldIgnoreFirstNewline(stackedTag, text)) {
  57736. text = text.slice(1);
  57737. }
  57738. if (options.chars) {
  57739. options.chars(text);
  57740. }
  57741. return ''
  57742. });
  57743. index += html.length - rest$1.length;
  57744. html = rest$1;
  57745. parseEndTag(stackedTag, index - endTagLength, index);
  57746. }
  57747. if (html === last) {
  57748. options.chars && options.chars(html);
  57749. if (!stack.length && options.warn) {
  57750. options.warn(("Mal-formatted tag at end of template: \"" + html + "\""), { start: index + html.length });
  57751. }
  57752. break
  57753. }
  57754. }
  57755. // Clean up any remaining tags
  57756. parseEndTag();
  57757. function advance (n) {
  57758. index += n;
  57759. html = html.substring(n);
  57760. }
  57761. function parseStartTag () {
  57762. var start = html.match(startTagOpen);
  57763. if (start) {
  57764. var match = {
  57765. tagName: start[1],
  57766. attrs: [],
  57767. start: index
  57768. };
  57769. advance(start[0].length);
  57770. var end, attr;
  57771. while (!(end = html.match(startTagClose)) && (attr = html.match(dynamicArgAttribute) || html.match(attribute))) {
  57772. attr.start = index;
  57773. advance(attr[0].length);
  57774. attr.end = index;
  57775. match.attrs.push(attr);
  57776. }
  57777. if (end) {
  57778. match.unarySlash = end[1];
  57779. advance(end[0].length);
  57780. match.end = index;
  57781. return match
  57782. }
  57783. }
  57784. }
  57785. function handleStartTag (match) {
  57786. var tagName = match.tagName;
  57787. var unarySlash = match.unarySlash;
  57788. if (expectHTML) {
  57789. if (lastTag === 'p' && isNonPhrasingTag(tagName)) {
  57790. parseEndTag(lastTag);
  57791. }
  57792. if (canBeLeftOpenTag$$1(tagName) && lastTag === tagName) {
  57793. parseEndTag(tagName);
  57794. }
  57795. }
  57796. var unary = isUnaryTag$$1(tagName) || !!unarySlash;
  57797. var l = match.attrs.length;
  57798. var attrs = new Array(l);
  57799. for (var i = 0; i < l; i++) {
  57800. var args = match.attrs[i];
  57801. var value = args[3] || args[4] || args[5] || '';
  57802. var shouldDecodeNewlines = tagName === 'a' && args[1] === 'href'
  57803. ? options.shouldDecodeNewlinesForHref
  57804. : options.shouldDecodeNewlines;
  57805. attrs[i] = {
  57806. name: args[1],
  57807. value: decodeAttr(value, shouldDecodeNewlines)
  57808. };
  57809. if (options.outputSourceRange) {
  57810. attrs[i].start = args.start + args[0].match(/^\s*/).length;
  57811. attrs[i].end = args.end;
  57812. }
  57813. }
  57814. if (!unary) {
  57815. stack.push({ tag: tagName, lowerCasedTag: tagName.toLowerCase(), attrs: attrs, start: match.start, end: match.end });
  57816. lastTag = tagName;
  57817. }
  57818. if (options.start) {
  57819. options.start(tagName, attrs, unary, match.start, match.end);
  57820. }
  57821. }
  57822. function parseEndTag (tagName, start, end) {
  57823. var pos, lowerCasedTagName;
  57824. if (start == null) { start = index; }
  57825. if (end == null) { end = index; }
  57826. // Find the closest opened tag of the same type
  57827. if (tagName) {
  57828. lowerCasedTagName = tagName.toLowerCase();
  57829. for (pos = stack.length - 1; pos >= 0; pos--) {
  57830. if (stack[pos].lowerCasedTag === lowerCasedTagName) {
  57831. break
  57832. }
  57833. }
  57834. } else {
  57835. // If no tag name is provided, clean shop
  57836. pos = 0;
  57837. }
  57838. if (pos >= 0) {
  57839. // Close all the open elements, up the stack
  57840. for (var i = stack.length - 1; i >= pos; i--) {
  57841. if (i > pos || !tagName &&
  57842. options.warn
  57843. ) {
  57844. options.warn(
  57845. ("tag <" + (stack[i].tag) + "> has no matching end tag."),
  57846. { start: stack[i].start, end: stack[i].end }
  57847. );
  57848. }
  57849. if (options.end) {
  57850. options.end(stack[i].tag, start, end);
  57851. }
  57852. }
  57853. // Remove the open elements from the stack
  57854. stack.length = pos;
  57855. lastTag = pos && stack[pos - 1].tag;
  57856. } else if (lowerCasedTagName === 'br') {
  57857. if (options.start) {
  57858. options.start(tagName, [], true, start, end);
  57859. }
  57860. } else if (lowerCasedTagName === 'p') {
  57861. if (options.start) {
  57862. options.start(tagName, [], false, start, end);
  57863. }
  57864. if (options.end) {
  57865. options.end(tagName, start, end);
  57866. }
  57867. }
  57868. }
  57869. }
  57870. /* */
  57871. var onRE = /^@|^v-on:/;
  57872. var dirRE = /^v-|^@|^:|^#/;
  57873. var forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;
  57874. var forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
  57875. var stripParensRE = /^\(|\)$/g;
  57876. var dynamicArgRE = /^\[.*\]$/;
  57877. var argRE = /:(.*)$/;
  57878. var bindRE = /^:|^\.|^v-bind:/;
  57879. var modifierRE = /\.[^.\]]+(?=[^\]]*$)/g;
  57880. var slotRE = /^v-slot(:|$)|^#/;
  57881. var lineBreakRE = /[\r\n]/;
  57882. var whitespaceRE$1 = /\s+/g;
  57883. var invalidAttributeRE = /[\s"'<>\/=]/;
  57884. var decodeHTMLCached = cached(he.decode);
  57885. var emptySlotScopeToken = "_empty_";
  57886. // configurable state
  57887. var warn$2;
  57888. var delimiters;
  57889. var transforms;
  57890. var preTransforms;
  57891. var postTransforms;
  57892. var platformIsPreTag;
  57893. var platformMustUseProp;
  57894. var platformGetTagNamespace;
  57895. var maybeComponent;
  57896. function createASTElement (
  57897. tag,
  57898. attrs,
  57899. parent
  57900. ) {
  57901. return {
  57902. type: 1,
  57903. tag: tag,
  57904. attrsList: attrs,
  57905. attrsMap: makeAttrsMap(attrs),
  57906. rawAttrsMap: {},
  57907. parent: parent,
  57908. children: []
  57909. }
  57910. }
  57911. /**
  57912. * Convert HTML string to AST.
  57913. */
  57914. function parse (
  57915. template,
  57916. options
  57917. ) {
  57918. warn$2 = options.warn || baseWarn;
  57919. platformIsPreTag = options.isPreTag || no;
  57920. platformMustUseProp = options.mustUseProp || no;
  57921. platformGetTagNamespace = options.getTagNamespace || no;
  57922. var isReservedTag = options.isReservedTag || no;
  57923. maybeComponent = function (el) { return !!el.component || !isReservedTag(el.tag); };
  57924. transforms = pluckModuleFunction(options.modules, 'transformNode');
  57925. preTransforms = pluckModuleFunction(options.modules, 'preTransformNode');
  57926. postTransforms = pluckModuleFunction(options.modules, 'postTransformNode');
  57927. delimiters = options.delimiters;
  57928. var stack = [];
  57929. var preserveWhitespace = options.preserveWhitespace !== false;
  57930. var whitespaceOption = options.whitespace;
  57931. var root;
  57932. var currentParent;
  57933. var inVPre = false;
  57934. var inPre = false;
  57935. var warned = false;
  57936. function warnOnce (msg, range) {
  57937. if (!warned) {
  57938. warned = true;
  57939. warn$2(msg, range);
  57940. }
  57941. }
  57942. function closeElement (element) {
  57943. trimEndingWhitespace(element);
  57944. if (!inVPre && !element.processed) {
  57945. element = processElement(element, options);
  57946. }
  57947. // tree management
  57948. if (!stack.length && element !== root) {
  57949. // allow root elements with v-if, v-else-if and v-else
  57950. if (root.if && (element.elseif || element.else)) {
  57951. {
  57952. checkRootConstraints(element);
  57953. }
  57954. addIfCondition(root, {
  57955. exp: element.elseif,
  57956. block: element
  57957. });
  57958. } else {
  57959. warnOnce(
  57960. "Component template should contain exactly one root element. " +
  57961. "If you are using v-if on multiple elements, " +
  57962. "use v-else-if to chain them instead.",
  57963. { start: element.start }
  57964. );
  57965. }
  57966. }
  57967. if (currentParent && !element.forbidden) {
  57968. if (element.elseif || element.else) {
  57969. processIfConditions(element, currentParent);
  57970. } else {
  57971. if (element.slotScope) {
  57972. // scoped slot
  57973. // keep it in the children list so that v-else(-if) conditions can
  57974. // find it as the prev node.
  57975. var name = element.slotTarget || '"default"'
  57976. ;(currentParent.scopedSlots || (currentParent.scopedSlots = {}))[name] = element;
  57977. }
  57978. currentParent.children.push(element);
  57979. element.parent = currentParent;
  57980. }
  57981. }
  57982. // final children cleanup
  57983. // filter out scoped slots
  57984. element.children = element.children.filter(function (c) { return !(c).slotScope; });
  57985. // remove trailing whitespace node again
  57986. trimEndingWhitespace(element);
  57987. // check pre state
  57988. if (element.pre) {
  57989. inVPre = false;
  57990. }
  57991. if (platformIsPreTag(element.tag)) {
  57992. inPre = false;
  57993. }
  57994. // apply post-transforms
  57995. for (var i = 0; i < postTransforms.length; i++) {
  57996. postTransforms[i](element, options);
  57997. }
  57998. }
  57999. function trimEndingWhitespace (el) {
  58000. // remove trailing whitespace node
  58001. if (!inPre) {
  58002. var lastNode;
  58003. while (
  58004. (lastNode = el.children[el.children.length - 1]) &&
  58005. lastNode.type === 3 &&
  58006. lastNode.text === ' '
  58007. ) {
  58008. el.children.pop();
  58009. }
  58010. }
  58011. }
  58012. function checkRootConstraints (el) {
  58013. if (el.tag === 'slot' || el.tag === 'template') {
  58014. warnOnce(
  58015. "Cannot use <" + (el.tag) + "> as component root element because it may " +
  58016. 'contain multiple nodes.',
  58017. { start: el.start }
  58018. );
  58019. }
  58020. if (el.attrsMap.hasOwnProperty('v-for')) {
  58021. warnOnce(
  58022. 'Cannot use v-for on stateful component root element because ' +
  58023. 'it renders multiple elements.',
  58024. el.rawAttrsMap['v-for']
  58025. );
  58026. }
  58027. }
  58028. parseHTML(template, {
  58029. warn: warn$2,
  58030. expectHTML: options.expectHTML,
  58031. isUnaryTag: options.isUnaryTag,
  58032. canBeLeftOpenTag: options.canBeLeftOpenTag,
  58033. shouldDecodeNewlines: options.shouldDecodeNewlines,
  58034. shouldDecodeNewlinesForHref: options.shouldDecodeNewlinesForHref,
  58035. shouldKeepComment: options.comments,
  58036. outputSourceRange: options.outputSourceRange,
  58037. start: function start (tag, attrs, unary, start$1, end) {
  58038. // check namespace.
  58039. // inherit parent ns if there is one
  58040. var ns = (currentParent && currentParent.ns) || platformGetTagNamespace(tag);
  58041. // handle IE svg bug
  58042. /* istanbul ignore if */
  58043. if (isIE && ns === 'svg') {
  58044. attrs = guardIESVGBug(attrs);
  58045. }
  58046. var element = createASTElement(tag, attrs, currentParent);
  58047. if (ns) {
  58048. element.ns = ns;
  58049. }
  58050. {
  58051. if (options.outputSourceRange) {
  58052. element.start = start$1;
  58053. element.end = end;
  58054. element.rawAttrsMap = element.attrsList.reduce(function (cumulated, attr) {
  58055. cumulated[attr.name] = attr;
  58056. return cumulated
  58057. }, {});
  58058. }
  58059. attrs.forEach(function (attr) {
  58060. if (invalidAttributeRE.test(attr.name)) {
  58061. warn$2(
  58062. "Invalid dynamic argument expression: attribute names cannot contain " +
  58063. "spaces, quotes, <, >, / or =.",
  58064. {
  58065. start: attr.start + attr.name.indexOf("["),
  58066. end: attr.start + attr.name.length
  58067. }
  58068. );
  58069. }
  58070. });
  58071. }
  58072. if (isForbiddenTag(element) && !isServerRendering()) {
  58073. element.forbidden = true;
  58074. warn$2(
  58075. 'Templates should only be responsible for mapping the state to the ' +
  58076. 'UI. Avoid placing tags with side-effects in your templates, such as ' +
  58077. "<" + tag + ">" + ', as they will not be parsed.',
  58078. { start: element.start }
  58079. );
  58080. }
  58081. // apply pre-transforms
  58082. for (var i = 0; i < preTransforms.length; i++) {
  58083. element = preTransforms[i](element, options) || element;
  58084. }
  58085. if (!inVPre) {
  58086. processPre(element);
  58087. if (element.pre) {
  58088. inVPre = true;
  58089. }
  58090. }
  58091. if (platformIsPreTag(element.tag)) {
  58092. inPre = true;
  58093. }
  58094. if (inVPre) {
  58095. processRawAttrs(element);
  58096. } else if (!element.processed) {
  58097. // structural directives
  58098. processFor(element);
  58099. processIf(element);
  58100. processOnce(element);
  58101. }
  58102. if (!root) {
  58103. root = element;
  58104. {
  58105. checkRootConstraints(root);
  58106. }
  58107. }
  58108. if (!unary) {
  58109. currentParent = element;
  58110. stack.push(element);
  58111. } else {
  58112. closeElement(element);
  58113. }
  58114. },
  58115. end: function end (tag, start, end$1) {
  58116. var element = stack[stack.length - 1];
  58117. // pop stack
  58118. stack.length -= 1;
  58119. currentParent = stack[stack.length - 1];
  58120. if (options.outputSourceRange) {
  58121. element.end = end$1;
  58122. }
  58123. closeElement(element);
  58124. },
  58125. chars: function chars (text, start, end) {
  58126. if (!currentParent) {
  58127. {
  58128. if (text === template) {
  58129. warnOnce(
  58130. 'Component template requires a root element, rather than just text.',
  58131. { start: start }
  58132. );
  58133. } else if ((text = text.trim())) {
  58134. warnOnce(
  58135. ("text \"" + text + "\" outside root element will be ignored."),
  58136. { start: start }
  58137. );
  58138. }
  58139. }
  58140. return
  58141. }
  58142. // IE textarea placeholder bug
  58143. /* istanbul ignore if */
  58144. if (isIE &&
  58145. currentParent.tag === 'textarea' &&
  58146. currentParent.attrsMap.placeholder === text
  58147. ) {
  58148. return
  58149. }
  58150. var children = currentParent.children;
  58151. if (inPre || text.trim()) {
  58152. text = isTextTag(currentParent) ? text : decodeHTMLCached(text);
  58153. } else if (!children.length) {
  58154. // remove the whitespace-only node right after an opening tag
  58155. text = '';
  58156. } else if (whitespaceOption) {
  58157. if (whitespaceOption === 'condense') {
  58158. // in condense mode, remove the whitespace node if it contains
  58159. // line break, otherwise condense to a single space
  58160. text = lineBreakRE.test(text) ? '' : ' ';
  58161. } else {
  58162. text = ' ';
  58163. }
  58164. } else {
  58165. text = preserveWhitespace ? ' ' : '';
  58166. }
  58167. if (text) {
  58168. if (!inPre && whitespaceOption === 'condense') {
  58169. // condense consecutive whitespaces into single space
  58170. text = text.replace(whitespaceRE$1, ' ');
  58171. }
  58172. var res;
  58173. var child;
  58174. if (!inVPre && text !== ' ' && (res = parseText(text, delimiters))) {
  58175. child = {
  58176. type: 2,
  58177. expression: res.expression,
  58178. tokens: res.tokens,
  58179. text: text
  58180. };
  58181. } else if (text !== ' ' || !children.length || children[children.length - 1].text !== ' ') {
  58182. child = {
  58183. type: 3,
  58184. text: text
  58185. };
  58186. }
  58187. if (child) {
  58188. if (options.outputSourceRange) {
  58189. child.start = start;
  58190. child.end = end;
  58191. }
  58192. children.push(child);
  58193. }
  58194. }
  58195. },
  58196. comment: function comment (text, start, end) {
  58197. // adding anyting as a sibling to the root node is forbidden
  58198. // comments should still be allowed, but ignored
  58199. if (currentParent) {
  58200. var child = {
  58201. type: 3,
  58202. text: text,
  58203. isComment: true
  58204. };
  58205. if (options.outputSourceRange) {
  58206. child.start = start;
  58207. child.end = end;
  58208. }
  58209. currentParent.children.push(child);
  58210. }
  58211. }
  58212. });
  58213. return root
  58214. }
  58215. function processPre (el) {
  58216. if (getAndRemoveAttr(el, 'v-pre') != null) {
  58217. el.pre = true;
  58218. }
  58219. }
  58220. function processRawAttrs (el) {
  58221. var list = el.attrsList;
  58222. var len = list.length;
  58223. if (len) {
  58224. var attrs = el.attrs = new Array(len);
  58225. for (var i = 0; i < len; i++) {
  58226. attrs[i] = {
  58227. name: list[i].name,
  58228. value: JSON.stringify(list[i].value)
  58229. };
  58230. if (list[i].start != null) {
  58231. attrs[i].start = list[i].start;
  58232. attrs[i].end = list[i].end;
  58233. }
  58234. }
  58235. } else if (!el.pre) {
  58236. // non root node in pre blocks with no attributes
  58237. el.plain = true;
  58238. }
  58239. }
  58240. function processElement (
  58241. element,
  58242. options
  58243. ) {
  58244. processKey(element);
  58245. // determine whether this is a plain element after
  58246. // removing structural attributes
  58247. element.plain = (
  58248. !element.key &&
  58249. !element.scopedSlots &&
  58250. !element.attrsList.length
  58251. );
  58252. processRef(element);
  58253. processSlotContent(element);
  58254. processSlotOutlet(element);
  58255. processComponent(element);
  58256. for (var i = 0; i < transforms.length; i++) {
  58257. element = transforms[i](element, options) || element;
  58258. }
  58259. processAttrs(element);
  58260. return element
  58261. }
  58262. function processKey (el) {
  58263. var exp = getBindingAttr(el, 'key');
  58264. if (exp) {
  58265. {
  58266. if (el.tag === 'template') {
  58267. warn$2(
  58268. "<template> cannot be keyed. Place the key on real elements instead.",
  58269. getRawBindingAttr(el, 'key')
  58270. );
  58271. }
  58272. if (el.for) {
  58273. var iterator = el.iterator2 || el.iterator1;
  58274. var parent = el.parent;
  58275. if (iterator && iterator === exp && parent && parent.tag === 'transition-group') {
  58276. warn$2(
  58277. "Do not use v-for index as key on <transition-group> children, " +
  58278. "this is the same as not using keys.",
  58279. getRawBindingAttr(el, 'key'),
  58280. true /* tip */
  58281. );
  58282. }
  58283. }
  58284. }
  58285. el.key = exp;
  58286. }
  58287. }
  58288. function processRef (el) {
  58289. var ref = getBindingAttr(el, 'ref');
  58290. if (ref) {
  58291. el.ref = ref;
  58292. el.refInFor = checkInFor(el);
  58293. }
  58294. }
  58295. function processFor (el) {
  58296. var exp;
  58297. if ((exp = getAndRemoveAttr(el, 'v-for'))) {
  58298. var res = parseFor(exp);
  58299. if (res) {
  58300. extend(el, res);
  58301. } else {
  58302. warn$2(
  58303. ("Invalid v-for expression: " + exp),
  58304. el.rawAttrsMap['v-for']
  58305. );
  58306. }
  58307. }
  58308. }
  58309. function parseFor (exp) {
  58310. var inMatch = exp.match(forAliasRE);
  58311. if (!inMatch) { return }
  58312. var res = {};
  58313. res.for = inMatch[2].trim();
  58314. var alias = inMatch[1].trim().replace(stripParensRE, '');
  58315. var iteratorMatch = alias.match(forIteratorRE);
  58316. if (iteratorMatch) {
  58317. res.alias = alias.replace(forIteratorRE, '').trim();
  58318. res.iterator1 = iteratorMatch[1].trim();
  58319. if (iteratorMatch[2]) {
  58320. res.iterator2 = iteratorMatch[2].trim();
  58321. }
  58322. } else {
  58323. res.alias = alias;
  58324. }
  58325. return res
  58326. }
  58327. function processIf (el) {
  58328. var exp = getAndRemoveAttr(el, 'v-if');
  58329. if (exp) {
  58330. el.if = exp;
  58331. addIfCondition(el, {
  58332. exp: exp,
  58333. block: el
  58334. });
  58335. } else {
  58336. if (getAndRemoveAttr(el, 'v-else') != null) {
  58337. el.else = true;
  58338. }
  58339. var elseif = getAndRemoveAttr(el, 'v-else-if');
  58340. if (elseif) {
  58341. el.elseif = elseif;
  58342. }
  58343. }
  58344. }
  58345. function processIfConditions (el, parent) {
  58346. var prev = findPrevElement(parent.children);
  58347. if (prev && prev.if) {
  58348. addIfCondition(prev, {
  58349. exp: el.elseif,
  58350. block: el
  58351. });
  58352. } else {
  58353. warn$2(
  58354. "v-" + (el.elseif ? ('else-if="' + el.elseif + '"') : 'else') + " " +
  58355. "used on element <" + (el.tag) + "> without corresponding v-if.",
  58356. el.rawAttrsMap[el.elseif ? 'v-else-if' : 'v-else']
  58357. );
  58358. }
  58359. }
  58360. function findPrevElement (children) {
  58361. var i = children.length;
  58362. while (i--) {
  58363. if (children[i].type === 1) {
  58364. return children[i]
  58365. } else {
  58366. if (children[i].text !== ' ') {
  58367. warn$2(
  58368. "text \"" + (children[i].text.trim()) + "\" between v-if and v-else(-if) " +
  58369. "will be ignored.",
  58370. children[i]
  58371. );
  58372. }
  58373. children.pop();
  58374. }
  58375. }
  58376. }
  58377. function addIfCondition (el, condition) {
  58378. if (!el.ifConditions) {
  58379. el.ifConditions = [];
  58380. }
  58381. el.ifConditions.push(condition);
  58382. }
  58383. function processOnce (el) {
  58384. var once$$1 = getAndRemoveAttr(el, 'v-once');
  58385. if (once$$1 != null) {
  58386. el.once = true;
  58387. }
  58388. }
  58389. // handle content being passed to a component as slot,
  58390. // e.g. <template slot="xxx">, <div slot-scope="xxx">
  58391. function processSlotContent (el) {
  58392. var slotScope;
  58393. if (el.tag === 'template') {
  58394. slotScope = getAndRemoveAttr(el, 'scope');
  58395. /* istanbul ignore if */
  58396. if (slotScope) {
  58397. warn$2(
  58398. "the \"scope\" attribute for scoped slots have been deprecated and " +
  58399. "replaced by \"slot-scope\" since 2.5. The new \"slot-scope\" attribute " +
  58400. "can also be used on plain elements in addition to <template> to " +
  58401. "denote scoped slots.",
  58402. el.rawAttrsMap['scope'],
  58403. true
  58404. );
  58405. }
  58406. el.slotScope = slotScope || getAndRemoveAttr(el, 'slot-scope');
  58407. } else if ((slotScope = getAndRemoveAttr(el, 'slot-scope'))) {
  58408. /* istanbul ignore if */
  58409. if (el.attrsMap['v-for']) {
  58410. warn$2(
  58411. "Ambiguous combined usage of slot-scope and v-for on <" + (el.tag) + "> " +
  58412. "(v-for takes higher priority). Use a wrapper <template> for the " +
  58413. "scoped slot to make it clearer.",
  58414. el.rawAttrsMap['slot-scope'],
  58415. true
  58416. );
  58417. }
  58418. el.slotScope = slotScope;
  58419. }
  58420. // slot="xxx"
  58421. var slotTarget = getBindingAttr(el, 'slot');
  58422. if (slotTarget) {
  58423. el.slotTarget = slotTarget === '""' ? '"default"' : slotTarget;
  58424. el.slotTargetDynamic = !!(el.attrsMap[':slot'] || el.attrsMap['v-bind:slot']);
  58425. // preserve slot as an attribute for native shadow DOM compat
  58426. // only for non-scoped slots.
  58427. if (el.tag !== 'template' && !el.slotScope) {
  58428. addAttr(el, 'slot', slotTarget, getRawBindingAttr(el, 'slot'));
  58429. }
  58430. }
  58431. // 2.6 v-slot syntax
  58432. {
  58433. if (el.tag === 'template') {
  58434. // v-slot on <template>
  58435. var slotBinding = getAndRemoveAttrByRegex(el, slotRE);
  58436. if (slotBinding) {
  58437. {
  58438. if (el.slotTarget || el.slotScope) {
  58439. warn$2(
  58440. "Unexpected mixed usage of different slot syntaxes.",
  58441. el
  58442. );
  58443. }
  58444. if (el.parent && !maybeComponent(el.parent)) {
  58445. warn$2(
  58446. "<template v-slot> can only appear at the root level inside " +
  58447. "the receiving component",
  58448. el
  58449. );
  58450. }
  58451. }
  58452. var ref = getSlotName(slotBinding);
  58453. var name = ref.name;
  58454. var dynamic = ref.dynamic;
  58455. el.slotTarget = name;
  58456. el.slotTargetDynamic = dynamic;
  58457. el.slotScope = slotBinding.value || emptySlotScopeToken; // force it into a scoped slot for perf
  58458. }
  58459. } else {
  58460. // v-slot on component, denotes default slot
  58461. var slotBinding$1 = getAndRemoveAttrByRegex(el, slotRE);
  58462. if (slotBinding$1) {
  58463. {
  58464. if (!maybeComponent(el)) {
  58465. warn$2(
  58466. "v-slot can only be used on components or <template>.",
  58467. slotBinding$1
  58468. );
  58469. }
  58470. if (el.slotScope || el.slotTarget) {
  58471. warn$2(
  58472. "Unexpected mixed usage of different slot syntaxes.",
  58473. el
  58474. );
  58475. }
  58476. if (el.scopedSlots) {
  58477. warn$2(
  58478. "To avoid scope ambiguity, the default slot should also use " +
  58479. "<template> syntax when there are other named slots.",
  58480. slotBinding$1
  58481. );
  58482. }
  58483. }
  58484. // add the component's children to its default slot
  58485. var slots = el.scopedSlots || (el.scopedSlots = {});
  58486. var ref$1 = getSlotName(slotBinding$1);
  58487. var name$1 = ref$1.name;
  58488. var dynamic$1 = ref$1.dynamic;
  58489. var slotContainer = slots[name$1] = createASTElement('template', [], el);
  58490. slotContainer.slotTarget = name$1;
  58491. slotContainer.slotTargetDynamic = dynamic$1;
  58492. slotContainer.children = el.children.filter(function (c) {
  58493. if (!c.slotScope) {
  58494. c.parent = slotContainer;
  58495. return true
  58496. }
  58497. });
  58498. slotContainer.slotScope = slotBinding$1.value || emptySlotScopeToken;
  58499. // remove children as they are returned from scopedSlots now
  58500. el.children = [];
  58501. // mark el non-plain so data gets generated
  58502. el.plain = false;
  58503. }
  58504. }
  58505. }
  58506. }
  58507. function getSlotName (binding) {
  58508. var name = binding.name.replace(slotRE, '');
  58509. if (!name) {
  58510. if (binding.name[0] !== '#') {
  58511. name = 'default';
  58512. } else {
  58513. warn$2(
  58514. "v-slot shorthand syntax requires a slot name.",
  58515. binding
  58516. );
  58517. }
  58518. }
  58519. return dynamicArgRE.test(name)
  58520. // dynamic [name]
  58521. ? { name: name.slice(1, -1), dynamic: true }
  58522. // static name
  58523. : { name: ("\"" + name + "\""), dynamic: false }
  58524. }
  58525. // handle <slot/> outlets
  58526. function processSlotOutlet (el) {
  58527. if (el.tag === 'slot') {
  58528. el.slotName = getBindingAttr(el, 'name');
  58529. if (el.key) {
  58530. warn$2(
  58531. "`key` does not work on <slot> because slots are abstract outlets " +
  58532. "and can possibly expand into multiple elements. " +
  58533. "Use the key on a wrapping element instead.",
  58534. getRawBindingAttr(el, 'key')
  58535. );
  58536. }
  58537. }
  58538. }
  58539. function processComponent (el) {
  58540. var binding;
  58541. if ((binding = getBindingAttr(el, 'is'))) {
  58542. el.component = binding;
  58543. }
  58544. if (getAndRemoveAttr(el, 'inline-template') != null) {
  58545. el.inlineTemplate = true;
  58546. }
  58547. }
  58548. function processAttrs (el) {
  58549. var list = el.attrsList;
  58550. var i, l, name, rawName, value, modifiers, syncGen, isDynamic;
  58551. for (i = 0, l = list.length; i < l; i++) {
  58552. name = rawName = list[i].name;
  58553. value = list[i].value;
  58554. if (dirRE.test(name)) {
  58555. // mark element as dynamic
  58556. el.hasBindings = true;
  58557. // modifiers
  58558. modifiers = parseModifiers(name.replace(dirRE, ''));
  58559. // support .foo shorthand syntax for the .prop modifier
  58560. if (modifiers) {
  58561. name = name.replace(modifierRE, '');
  58562. }
  58563. if (bindRE.test(name)) { // v-bind
  58564. name = name.replace(bindRE, '');
  58565. value = parseFilters(value);
  58566. isDynamic = dynamicArgRE.test(name);
  58567. if (isDynamic) {
  58568. name = name.slice(1, -1);
  58569. }
  58570. if (
  58571. value.trim().length === 0
  58572. ) {
  58573. warn$2(
  58574. ("The value for a v-bind expression cannot be empty. Found in \"v-bind:" + name + "\"")
  58575. );
  58576. }
  58577. if (modifiers) {
  58578. if (modifiers.prop && !isDynamic) {
  58579. name = camelize(name);
  58580. if (name === 'innerHtml') { name = 'innerHTML'; }
  58581. }
  58582. if (modifiers.camel && !isDynamic) {
  58583. name = camelize(name);
  58584. }
  58585. if (modifiers.sync) {
  58586. syncGen = genAssignmentCode(value, "$event");
  58587. if (!isDynamic) {
  58588. addHandler(
  58589. el,
  58590. ("update:" + (camelize(name))),
  58591. syncGen,
  58592. null,
  58593. false,
  58594. warn$2,
  58595. list[i]
  58596. );
  58597. if (hyphenate(name) !== camelize(name)) {
  58598. addHandler(
  58599. el,
  58600. ("update:" + (hyphenate(name))),
  58601. syncGen,
  58602. null,
  58603. false,
  58604. warn$2,
  58605. list[i]
  58606. );
  58607. }
  58608. } else {
  58609. // handler w/ dynamic event name
  58610. addHandler(
  58611. el,
  58612. ("\"update:\"+(" + name + ")"),
  58613. syncGen,
  58614. null,
  58615. false,
  58616. warn$2,
  58617. list[i],
  58618. true // dynamic
  58619. );
  58620. }
  58621. }
  58622. }
  58623. if ((modifiers && modifiers.prop) || (
  58624. !el.component && platformMustUseProp(el.tag, el.attrsMap.type, name)
  58625. )) {
  58626. addProp(el, name, value, list[i], isDynamic);
  58627. } else {
  58628. addAttr(el, name, value, list[i], isDynamic);
  58629. }
  58630. } else if (onRE.test(name)) { // v-on
  58631. name = name.replace(onRE, '');
  58632. isDynamic = dynamicArgRE.test(name);
  58633. if (isDynamic) {
  58634. name = name.slice(1, -1);
  58635. }
  58636. addHandler(el, name, value, modifiers, false, warn$2, list[i], isDynamic);
  58637. } else { // normal directives
  58638. name = name.replace(dirRE, '');
  58639. // parse arg
  58640. var argMatch = name.match(argRE);
  58641. var arg = argMatch && argMatch[1];
  58642. isDynamic = false;
  58643. if (arg) {
  58644. name = name.slice(0, -(arg.length + 1));
  58645. if (dynamicArgRE.test(arg)) {
  58646. arg = arg.slice(1, -1);
  58647. isDynamic = true;
  58648. }
  58649. }
  58650. addDirective(el, name, rawName, value, arg, isDynamic, modifiers, list[i]);
  58651. if (name === 'model') {
  58652. checkForAliasModel(el, value);
  58653. }
  58654. }
  58655. } else {
  58656. // literal attribute
  58657. {
  58658. var res = parseText(value, delimiters);
  58659. if (res) {
  58660. warn$2(
  58661. name + "=\"" + value + "\": " +
  58662. 'Interpolation inside attributes has been removed. ' +
  58663. 'Use v-bind or the colon shorthand instead. For example, ' +
  58664. 'instead of <div id="{{ val }}">, use <div :id="val">.',
  58665. list[i]
  58666. );
  58667. }
  58668. }
  58669. addAttr(el, name, JSON.stringify(value), list[i]);
  58670. // #6887 firefox doesn't update muted state if set via attribute
  58671. // even immediately after element creation
  58672. if (!el.component &&
  58673. name === 'muted' &&
  58674. platformMustUseProp(el.tag, el.attrsMap.type, name)) {
  58675. addProp(el, name, 'true', list[i]);
  58676. }
  58677. }
  58678. }
  58679. }
  58680. function checkInFor (el) {
  58681. var parent = el;
  58682. while (parent) {
  58683. if (parent.for !== undefined) {
  58684. return true
  58685. }
  58686. parent = parent.parent;
  58687. }
  58688. return false
  58689. }
  58690. function parseModifiers (name) {
  58691. var match = name.match(modifierRE);
  58692. if (match) {
  58693. var ret = {};
  58694. match.forEach(function (m) { ret[m.slice(1)] = true; });
  58695. return ret
  58696. }
  58697. }
  58698. function makeAttrsMap (attrs) {
  58699. var map = {};
  58700. for (var i = 0, l = attrs.length; i < l; i++) {
  58701. if (
  58702. map[attrs[i].name] && !isIE && !isEdge
  58703. ) {
  58704. warn$2('duplicate attribute: ' + attrs[i].name, attrs[i]);
  58705. }
  58706. map[attrs[i].name] = attrs[i].value;
  58707. }
  58708. return map
  58709. }
  58710. // for script (e.g. type="x/template") or style, do not decode content
  58711. function isTextTag (el) {
  58712. return el.tag === 'script' || el.tag === 'style'
  58713. }
  58714. function isForbiddenTag (el) {
  58715. return (
  58716. el.tag === 'style' ||
  58717. (el.tag === 'script' && (
  58718. !el.attrsMap.type ||
  58719. el.attrsMap.type === 'text/javascript'
  58720. ))
  58721. )
  58722. }
  58723. var ieNSBug = /^xmlns:NS\d+/;
  58724. var ieNSPrefix = /^NS\d+:/;
  58725. /* istanbul ignore next */
  58726. function guardIESVGBug (attrs) {
  58727. var res = [];
  58728. for (var i = 0; i < attrs.length; i++) {
  58729. var attr = attrs[i];
  58730. if (!ieNSBug.test(attr.name)) {
  58731. attr.name = attr.name.replace(ieNSPrefix, '');
  58732. res.push(attr);
  58733. }
  58734. }
  58735. return res
  58736. }
  58737. function checkForAliasModel (el, value) {
  58738. var _el = el;
  58739. while (_el) {
  58740. if (_el.for && _el.alias === value) {
  58741. warn$2(
  58742. "<" + (el.tag) + " v-model=\"" + value + "\">: " +
  58743. "You are binding v-model directly to a v-for iteration alias. " +
  58744. "This will not be able to modify the v-for source array because " +
  58745. "writing to the alias is like modifying a function local variable. " +
  58746. "Consider using an array of objects and use v-model on an object property instead.",
  58747. el.rawAttrsMap['v-model']
  58748. );
  58749. }
  58750. _el = _el.parent;
  58751. }
  58752. }
  58753. /* */
  58754. function preTransformNode (el, options) {
  58755. if (el.tag === 'input') {
  58756. var map = el.attrsMap;
  58757. if (!map['v-model']) {
  58758. return
  58759. }
  58760. var typeBinding;
  58761. if (map[':type'] || map['v-bind:type']) {
  58762. typeBinding = getBindingAttr(el, 'type');
  58763. }
  58764. if (!map.type && !typeBinding && map['v-bind']) {
  58765. typeBinding = "(" + (map['v-bind']) + ").type";
  58766. }
  58767. if (typeBinding) {
  58768. var ifCondition = getAndRemoveAttr(el, 'v-if', true);
  58769. var ifConditionExtra = ifCondition ? ("&&(" + ifCondition + ")") : "";
  58770. var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;
  58771. var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);
  58772. // 1. checkbox
  58773. var branch0 = cloneASTElement(el);
  58774. // process for on the main node
  58775. processFor(branch0);
  58776. addRawAttr(branch0, 'type', 'checkbox');
  58777. processElement(branch0, options);
  58778. branch0.processed = true; // prevent it from double-processed
  58779. branch0.if = "(" + typeBinding + ")==='checkbox'" + ifConditionExtra;
  58780. addIfCondition(branch0, {
  58781. exp: branch0.if,
  58782. block: branch0
  58783. });
  58784. // 2. add radio else-if condition
  58785. var branch1 = cloneASTElement(el);
  58786. getAndRemoveAttr(branch1, 'v-for', true);
  58787. addRawAttr(branch1, 'type', 'radio');
  58788. processElement(branch1, options);
  58789. addIfCondition(branch0, {
  58790. exp: "(" + typeBinding + ")==='radio'" + ifConditionExtra,
  58791. block: branch1
  58792. });
  58793. // 3. other
  58794. var branch2 = cloneASTElement(el);
  58795. getAndRemoveAttr(branch2, 'v-for', true);
  58796. addRawAttr(branch2, ':type', typeBinding);
  58797. processElement(branch2, options);
  58798. addIfCondition(branch0, {
  58799. exp: ifCondition,
  58800. block: branch2
  58801. });
  58802. if (hasElse) {
  58803. branch0.else = true;
  58804. } else if (elseIfCondition) {
  58805. branch0.elseif = elseIfCondition;
  58806. }
  58807. return branch0
  58808. }
  58809. }
  58810. }
  58811. function cloneASTElement (el) {
  58812. return createASTElement(el.tag, el.attrsList.slice(), el.parent)
  58813. }
  58814. var model$1 = {
  58815. preTransformNode: preTransformNode
  58816. };
  58817. var modules$1 = [
  58818. klass$1,
  58819. style$1,
  58820. model$1
  58821. ];
  58822. /* */
  58823. function text (el, dir) {
  58824. if (dir.value) {
  58825. addProp(el, 'textContent', ("_s(" + (dir.value) + ")"), dir);
  58826. }
  58827. }
  58828. /* */
  58829. function html (el, dir) {
  58830. if (dir.value) {
  58831. addProp(el, 'innerHTML', ("_s(" + (dir.value) + ")"), dir);
  58832. }
  58833. }
  58834. var directives$1 = {
  58835. model: model,
  58836. text: text,
  58837. html: html
  58838. };
  58839. /* */
  58840. var baseOptions = {
  58841. expectHTML: true,
  58842. modules: modules$1,
  58843. directives: directives$1,
  58844. isPreTag: isPreTag,
  58845. isUnaryTag: isUnaryTag,
  58846. mustUseProp: mustUseProp,
  58847. canBeLeftOpenTag: canBeLeftOpenTag,
  58848. isReservedTag: isReservedTag,
  58849. getTagNamespace: getTagNamespace,
  58850. staticKeys: genStaticKeys(modules$1)
  58851. };
  58852. /* */
  58853. var isStaticKey;
  58854. var isPlatformReservedTag;
  58855. var genStaticKeysCached = cached(genStaticKeys$1);
  58856. /**
  58857. * Goal of the optimizer: walk the generated template AST tree
  58858. * and detect sub-trees that are purely static, i.e. parts of
  58859. * the DOM that never needs to change.
  58860. *
  58861. * Once we detect these sub-trees, we can:
  58862. *
  58863. * 1. Hoist them into constants, so that we no longer need to
  58864. * create fresh nodes for them on each re-render;
  58865. * 2. Completely skip them in the patching process.
  58866. */
  58867. function optimize (root, options) {
  58868. if (!root) { return }
  58869. isStaticKey = genStaticKeysCached(options.staticKeys || '');
  58870. isPlatformReservedTag = options.isReservedTag || no;
  58871. // first pass: mark all non-static nodes.
  58872. markStatic$1(root);
  58873. // second pass: mark static roots.
  58874. markStaticRoots(root, false);
  58875. }
  58876. function genStaticKeys$1 (keys) {
  58877. return makeMap(
  58878. 'type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap' +
  58879. (keys ? ',' + keys : '')
  58880. )
  58881. }
  58882. function markStatic$1 (node) {
  58883. node.static = isStatic(node);
  58884. if (node.type === 1) {
  58885. // do not make component slot content static. this avoids
  58886. // 1. components not able to mutate slot nodes
  58887. // 2. static slot content fails for hot-reloading
  58888. if (
  58889. !isPlatformReservedTag(node.tag) &&
  58890. node.tag !== 'slot' &&
  58891. node.attrsMap['inline-template'] == null
  58892. ) {
  58893. return
  58894. }
  58895. for (var i = 0, l = node.children.length; i < l; i++) {
  58896. var child = node.children[i];
  58897. markStatic$1(child);
  58898. if (!child.static) {
  58899. node.static = false;
  58900. }
  58901. }
  58902. if (node.ifConditions) {
  58903. for (var i$1 = 1, l$1 = node.ifConditions.length; i$1 < l$1; i$1++) {
  58904. var block = node.ifConditions[i$1].block;
  58905. markStatic$1(block);
  58906. if (!block.static) {
  58907. node.static = false;
  58908. }
  58909. }
  58910. }
  58911. }
  58912. }
  58913. function markStaticRoots (node, isInFor) {
  58914. if (node.type === 1) {
  58915. if (node.static || node.once) {
  58916. node.staticInFor = isInFor;
  58917. }
  58918. // For a node to qualify as a static root, it should have children that
  58919. // are not just static text. Otherwise the cost of hoisting out will
  58920. // outweigh the benefits and it's better off to just always render it fresh.
  58921. if (node.static && node.children.length && !(
  58922. node.children.length === 1 &&
  58923. node.children[0].type === 3
  58924. )) {
  58925. node.staticRoot = true;
  58926. return
  58927. } else {
  58928. node.staticRoot = false;
  58929. }
  58930. if (node.children) {
  58931. for (var i = 0, l = node.children.length; i < l; i++) {
  58932. markStaticRoots(node.children[i], isInFor || !!node.for);
  58933. }
  58934. }
  58935. if (node.ifConditions) {
  58936. for (var i$1 = 1, l$1 = node.ifConditions.length; i$1 < l$1; i$1++) {
  58937. markStaticRoots(node.ifConditions[i$1].block, isInFor);
  58938. }
  58939. }
  58940. }
  58941. }
  58942. function isStatic (node) {
  58943. if (node.type === 2) { // expression
  58944. return false
  58945. }
  58946. if (node.type === 3) { // text
  58947. return true
  58948. }
  58949. return !!(node.pre || (
  58950. !node.hasBindings && // no dynamic bindings
  58951. !node.if && !node.for && // not v-if or v-for or v-else
  58952. !isBuiltInTag(node.tag) && // not a built-in
  58953. isPlatformReservedTag(node.tag) && // not a component
  58954. !isDirectChildOfTemplateFor(node) &&
  58955. Object.keys(node).every(isStaticKey)
  58956. ))
  58957. }
  58958. function isDirectChildOfTemplateFor (node) {
  58959. while (node.parent) {
  58960. node = node.parent;
  58961. if (node.tag !== 'template') {
  58962. return false
  58963. }
  58964. if (node.for) {
  58965. return true
  58966. }
  58967. }
  58968. return false
  58969. }
  58970. /* */
  58971. var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function(?:\s+[\w$]+)?\s*\(/;
  58972. var fnInvokeRE = /\([^)]*?\);*$/;
  58973. var simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/;
  58974. // KeyboardEvent.keyCode aliases
  58975. var keyCodes = {
  58976. esc: 27,
  58977. tab: 9,
  58978. enter: 13,
  58979. space: 32,
  58980. up: 38,
  58981. left: 37,
  58982. right: 39,
  58983. down: 40,
  58984. 'delete': [8, 46]
  58985. };
  58986. // KeyboardEvent.key aliases
  58987. var keyNames = {
  58988. // #7880: IE11 and Edge use `Esc` for Escape key name.
  58989. esc: ['Esc', 'Escape'],
  58990. tab: 'Tab',
  58991. enter: 'Enter',
  58992. // #9112: IE11 uses `Spacebar` for Space key name.
  58993. space: [' ', 'Spacebar'],
  58994. // #7806: IE11 uses key names without `Arrow` prefix for arrow keys.
  58995. up: ['Up', 'ArrowUp'],
  58996. left: ['Left', 'ArrowLeft'],
  58997. right: ['Right', 'ArrowRight'],
  58998. down: ['Down', 'ArrowDown'],
  58999. // #9112: IE11 uses `Del` for Delete key name.
  59000. 'delete': ['Backspace', 'Delete', 'Del']
  59001. };
  59002. // #4868: modifiers that prevent the execution of the listener
  59003. // need to explicitly return null so that we can determine whether to remove
  59004. // the listener for .once
  59005. var genGuard = function (condition) { return ("if(" + condition + ")return null;"); };
  59006. var modifierCode = {
  59007. stop: '$event.stopPropagation();',
  59008. prevent: '$event.preventDefault();',
  59009. self: genGuard("$event.target !== $event.currentTarget"),
  59010. ctrl: genGuard("!$event.ctrlKey"),
  59011. shift: genGuard("!$event.shiftKey"),
  59012. alt: genGuard("!$event.altKey"),
  59013. meta: genGuard("!$event.metaKey"),
  59014. left: genGuard("'button' in $event && $event.button !== 0"),
  59015. middle: genGuard("'button' in $event && $event.button !== 1"),
  59016. right: genGuard("'button' in $event && $event.button !== 2")
  59017. };
  59018. function genHandlers (
  59019. events,
  59020. isNative
  59021. ) {
  59022. var prefix = isNative ? 'nativeOn:' : 'on:';
  59023. var staticHandlers = "";
  59024. var dynamicHandlers = "";
  59025. for (var name in events) {
  59026. var handlerCode = genHandler(events[name]);
  59027. if (events[name] && events[name].dynamic) {
  59028. dynamicHandlers += name + "," + handlerCode + ",";
  59029. } else {
  59030. staticHandlers += "\"" + name + "\":" + handlerCode + ",";
  59031. }
  59032. }
  59033. staticHandlers = "{" + (staticHandlers.slice(0, -1)) + "}";
  59034. if (dynamicHandlers) {
  59035. return prefix + "_d(" + staticHandlers + ",[" + (dynamicHandlers.slice(0, -1)) + "])"
  59036. } else {
  59037. return prefix + staticHandlers
  59038. }
  59039. }
  59040. function genHandler (handler) {
  59041. if (!handler) {
  59042. return 'function(){}'
  59043. }
  59044. if (Array.isArray(handler)) {
  59045. return ("[" + (handler.map(function (handler) { return genHandler(handler); }).join(',')) + "]")
  59046. }
  59047. var isMethodPath = simplePathRE.test(handler.value);
  59048. var isFunctionExpression = fnExpRE.test(handler.value);
  59049. var isFunctionInvocation = simplePathRE.test(handler.value.replace(fnInvokeRE, ''));
  59050. if (!handler.modifiers) {
  59051. if (isMethodPath || isFunctionExpression) {
  59052. return handler.value
  59053. }
  59054. return ("function($event){" + (isFunctionInvocation ? ("return " + (handler.value)) : handler.value) + "}") // inline statement
  59055. } else {
  59056. var code = '';
  59057. var genModifierCode = '';
  59058. var keys = [];
  59059. for (var key in handler.modifiers) {
  59060. if (modifierCode[key]) {
  59061. genModifierCode += modifierCode[key];
  59062. // left/right
  59063. if (keyCodes[key]) {
  59064. keys.push(key);
  59065. }
  59066. } else if (key === 'exact') {
  59067. var modifiers = (handler.modifiers);
  59068. genModifierCode += genGuard(
  59069. ['ctrl', 'shift', 'alt', 'meta']
  59070. .filter(function (keyModifier) { return !modifiers[keyModifier]; })
  59071. .map(function (keyModifier) { return ("$event." + keyModifier + "Key"); })
  59072. .join('||')
  59073. );
  59074. } else {
  59075. keys.push(key);
  59076. }
  59077. }
  59078. if (keys.length) {
  59079. code += genKeyFilter(keys);
  59080. }
  59081. // Make sure modifiers like prevent and stop get executed after key filtering
  59082. if (genModifierCode) {
  59083. code += genModifierCode;
  59084. }
  59085. var handlerCode = isMethodPath
  59086. ? ("return " + (handler.value) + "($event)")
  59087. : isFunctionExpression
  59088. ? ("return (" + (handler.value) + ")($event)")
  59089. : isFunctionInvocation
  59090. ? ("return " + (handler.value))
  59091. : handler.value;
  59092. return ("function($event){" + code + handlerCode + "}")
  59093. }
  59094. }
  59095. function genKeyFilter (keys) {
  59096. return (
  59097. // make sure the key filters only apply to KeyboardEvents
  59098. // #9441: can't use 'keyCode' in $event because Chrome autofill fires fake
  59099. // key events that do not have keyCode property...
  59100. "if(!$event.type.indexOf('key')&&" +
  59101. (keys.map(genFilterCode).join('&&')) + ")return null;"
  59102. )
  59103. }
  59104. function genFilterCode (key) {
  59105. var keyVal = parseInt(key, 10);
  59106. if (keyVal) {
  59107. return ("$event.keyCode!==" + keyVal)
  59108. }
  59109. var keyCode = keyCodes[key];
  59110. var keyName = keyNames[key];
  59111. return (
  59112. "_k($event.keyCode," +
  59113. (JSON.stringify(key)) + "," +
  59114. (JSON.stringify(keyCode)) + "," +
  59115. "$event.key," +
  59116. "" + (JSON.stringify(keyName)) +
  59117. ")"
  59118. )
  59119. }
  59120. /* */
  59121. function on (el, dir) {
  59122. if (dir.modifiers) {
  59123. warn("v-on without argument does not support modifiers.");
  59124. }
  59125. el.wrapListeners = function (code) { return ("_g(" + code + "," + (dir.value) + ")"); };
  59126. }
  59127. /* */
  59128. function bind$1 (el, dir) {
  59129. el.wrapData = function (code) {
  59130. return ("_b(" + code + ",'" + (el.tag) + "'," + (dir.value) + "," + (dir.modifiers && dir.modifiers.prop ? 'true' : 'false') + (dir.modifiers && dir.modifiers.sync ? ',true' : '') + ")")
  59131. };
  59132. }
  59133. /* */
  59134. var baseDirectives = {
  59135. on: on,
  59136. bind: bind$1,
  59137. cloak: noop
  59138. };
  59139. /* */
  59140. var CodegenState = function CodegenState (options) {
  59141. this.options = options;
  59142. this.warn = options.warn || baseWarn;
  59143. this.transforms = pluckModuleFunction(options.modules, 'transformCode');
  59144. this.dataGenFns = pluckModuleFunction(options.modules, 'genData');
  59145. this.directives = extend(extend({}, baseDirectives), options.directives);
  59146. var isReservedTag = options.isReservedTag || no;
  59147. this.maybeComponent = function (el) { return !!el.component || !isReservedTag(el.tag); };
  59148. this.onceId = 0;
  59149. this.staticRenderFns = [];
  59150. this.pre = false;
  59151. };
  59152. function generate (
  59153. ast,
  59154. options
  59155. ) {
  59156. var state = new CodegenState(options);
  59157. var code = ast ? genElement(ast, state) : '_c("div")';
  59158. return {
  59159. render: ("with(this){return " + code + "}"),
  59160. staticRenderFns: state.staticRenderFns
  59161. }
  59162. }
  59163. function genElement (el, state) {
  59164. if (el.parent) {
  59165. el.pre = el.pre || el.parent.pre;
  59166. }
  59167. if (el.staticRoot && !el.staticProcessed) {
  59168. return genStatic(el, state)
  59169. } else if (el.once && !el.onceProcessed) {
  59170. return genOnce(el, state)
  59171. } else if (el.for && !el.forProcessed) {
  59172. return genFor(el, state)
  59173. } else if (el.if && !el.ifProcessed) {
  59174. return genIf(el, state)
  59175. } else if (el.tag === 'template' && !el.slotTarget && !state.pre) {
  59176. return genChildren(el, state) || 'void 0'
  59177. } else if (el.tag === 'slot') {
  59178. return genSlot(el, state)
  59179. } else {
  59180. // component or element
  59181. var code;
  59182. if (el.component) {
  59183. code = genComponent(el.component, el, state);
  59184. } else {
  59185. var data;
  59186. if (!el.plain || (el.pre && state.maybeComponent(el))) {
  59187. data = genData$2(el, state);
  59188. }
  59189. var children = el.inlineTemplate ? null : genChildren(el, state, true);
  59190. code = "_c('" + (el.tag) + "'" + (data ? ("," + data) : '') + (children ? ("," + children) : '') + ")";
  59191. }
  59192. // module transforms
  59193. for (var i = 0; i < state.transforms.length; i++) {
  59194. code = state.transforms[i](el, code);
  59195. }
  59196. return code
  59197. }
  59198. }
  59199. // hoist static sub-trees out
  59200. function genStatic (el, state) {
  59201. el.staticProcessed = true;
  59202. // Some elements (templates) need to behave differently inside of a v-pre
  59203. // node. All pre nodes are static roots, so we can use this as a location to
  59204. // wrap a state change and reset it upon exiting the pre node.
  59205. var originalPreState = state.pre;
  59206. if (el.pre) {
  59207. state.pre = el.pre;
  59208. }
  59209. state.staticRenderFns.push(("with(this){return " + (genElement(el, state)) + "}"));
  59210. state.pre = originalPreState;
  59211. return ("_m(" + (state.staticRenderFns.length - 1) + (el.staticInFor ? ',true' : '') + ")")
  59212. }
  59213. // v-once
  59214. function genOnce (el, state) {
  59215. el.onceProcessed = true;
  59216. if (el.if && !el.ifProcessed) {
  59217. return genIf(el, state)
  59218. } else if (el.staticInFor) {
  59219. var key = '';
  59220. var parent = el.parent;
  59221. while (parent) {
  59222. if (parent.for) {
  59223. key = parent.key;
  59224. break
  59225. }
  59226. parent = parent.parent;
  59227. }
  59228. if (!key) {
  59229. state.warn(
  59230. "v-once can only be used inside v-for that is keyed. ",
  59231. el.rawAttrsMap['v-once']
  59232. );
  59233. return genElement(el, state)
  59234. }
  59235. return ("_o(" + (genElement(el, state)) + "," + (state.onceId++) + "," + key + ")")
  59236. } else {
  59237. return genStatic(el, state)
  59238. }
  59239. }
  59240. function genIf (
  59241. el,
  59242. state,
  59243. altGen,
  59244. altEmpty
  59245. ) {
  59246. el.ifProcessed = true; // avoid recursion
  59247. return genIfConditions(el.ifConditions.slice(), state, altGen, altEmpty)
  59248. }
  59249. function genIfConditions (
  59250. conditions,
  59251. state,
  59252. altGen,
  59253. altEmpty
  59254. ) {
  59255. if (!conditions.length) {
  59256. return altEmpty || '_e()'
  59257. }
  59258. var condition = conditions.shift();
  59259. if (condition.exp) {
  59260. return ("(" + (condition.exp) + ")?" + (genTernaryExp(condition.block)) + ":" + (genIfConditions(conditions, state, altGen, altEmpty)))
  59261. } else {
  59262. return ("" + (genTernaryExp(condition.block)))
  59263. }
  59264. // v-if with v-once should generate code like (a)?_m(0):_m(1)
  59265. function genTernaryExp (el) {
  59266. return altGen
  59267. ? altGen(el, state)
  59268. : el.once
  59269. ? genOnce(el, state)
  59270. : genElement(el, state)
  59271. }
  59272. }
  59273. function genFor (
  59274. el,
  59275. state,
  59276. altGen,
  59277. altHelper
  59278. ) {
  59279. var exp = el.for;
  59280. var alias = el.alias;
  59281. var iterator1 = el.iterator1 ? ("," + (el.iterator1)) : '';
  59282. var iterator2 = el.iterator2 ? ("," + (el.iterator2)) : '';
  59283. if (state.maybeComponent(el) &&
  59284. el.tag !== 'slot' &&
  59285. el.tag !== 'template' &&
  59286. !el.key
  59287. ) {
  59288. state.warn(
  59289. "<" + (el.tag) + " v-for=\"" + alias + " in " + exp + "\">: component lists rendered with " +
  59290. "v-for should have explicit keys. " +
  59291. "See https://vuejs.org/guide/list.html#key for more info.",
  59292. el.rawAttrsMap['v-for'],
  59293. true /* tip */
  59294. );
  59295. }
  59296. el.forProcessed = true; // avoid recursion
  59297. return (altHelper || '_l') + "((" + exp + ")," +
  59298. "function(" + alias + iterator1 + iterator2 + "){" +
  59299. "return " + ((altGen || genElement)(el, state)) +
  59300. '})'
  59301. }
  59302. function genData$2 (el, state) {
  59303. var data = '{';
  59304. // directives first.
  59305. // directives may mutate the el's other properties before they are generated.
  59306. var dirs = genDirectives(el, state);
  59307. if (dirs) { data += dirs + ','; }
  59308. // key
  59309. if (el.key) {
  59310. data += "key:" + (el.key) + ",";
  59311. }
  59312. // ref
  59313. if (el.ref) {
  59314. data += "ref:" + (el.ref) + ",";
  59315. }
  59316. if (el.refInFor) {
  59317. data += "refInFor:true,";
  59318. }
  59319. // pre
  59320. if (el.pre) {
  59321. data += "pre:true,";
  59322. }
  59323. // record original tag name for components using "is" attribute
  59324. if (el.component) {
  59325. data += "tag:\"" + (el.tag) + "\",";
  59326. }
  59327. // module data generation functions
  59328. for (var i = 0; i < state.dataGenFns.length; i++) {
  59329. data += state.dataGenFns[i](el);
  59330. }
  59331. // attributes
  59332. if (el.attrs) {
  59333. data += "attrs:" + (genProps(el.attrs)) + ",";
  59334. }
  59335. // DOM props
  59336. if (el.props) {
  59337. data += "domProps:" + (genProps(el.props)) + ",";
  59338. }
  59339. // event handlers
  59340. if (el.events) {
  59341. data += (genHandlers(el.events, false)) + ",";
  59342. }
  59343. if (el.nativeEvents) {
  59344. data += (genHandlers(el.nativeEvents, true)) + ",";
  59345. }
  59346. // slot target
  59347. // only for non-scoped slots
  59348. if (el.slotTarget && !el.slotScope) {
  59349. data += "slot:" + (el.slotTarget) + ",";
  59350. }
  59351. // scoped slots
  59352. if (el.scopedSlots) {
  59353. data += (genScopedSlots(el, el.scopedSlots, state)) + ",";
  59354. }
  59355. // component v-model
  59356. if (el.model) {
  59357. data += "model:{value:" + (el.model.value) + ",callback:" + (el.model.callback) + ",expression:" + (el.model.expression) + "},";
  59358. }
  59359. // inline-template
  59360. if (el.inlineTemplate) {
  59361. var inlineTemplate = genInlineTemplate(el, state);
  59362. if (inlineTemplate) {
  59363. data += inlineTemplate + ",";
  59364. }
  59365. }
  59366. data = data.replace(/,$/, '') + '}';
  59367. // v-bind dynamic argument wrap
  59368. // v-bind with dynamic arguments must be applied using the same v-bind object
  59369. // merge helper so that class/style/mustUseProp attrs are handled correctly.
  59370. if (el.dynamicAttrs) {
  59371. data = "_b(" + data + ",\"" + (el.tag) + "\"," + (genProps(el.dynamicAttrs)) + ")";
  59372. }
  59373. // v-bind data wrap
  59374. if (el.wrapData) {
  59375. data = el.wrapData(data);
  59376. }
  59377. // v-on data wrap
  59378. if (el.wrapListeners) {
  59379. data = el.wrapListeners(data);
  59380. }
  59381. return data
  59382. }
  59383. function genDirectives (el, state) {
  59384. var dirs = el.directives;
  59385. if (!dirs) { return }
  59386. var res = 'directives:[';
  59387. var hasRuntime = false;
  59388. var i, l, dir, needRuntime;
  59389. for (i = 0, l = dirs.length; i < l; i++) {
  59390. dir = dirs[i];
  59391. needRuntime = true;
  59392. var gen = state.directives[dir.name];
  59393. if (gen) {
  59394. // compile-time directive that manipulates AST.
  59395. // returns true if it also needs a runtime counterpart.
  59396. needRuntime = !!gen(el, dir, state.warn);
  59397. }
  59398. if (needRuntime) {
  59399. hasRuntime = true;
  59400. res += "{name:\"" + (dir.name) + "\",rawName:\"" + (dir.rawName) + "\"" + (dir.value ? (",value:(" + (dir.value) + "),expression:" + (JSON.stringify(dir.value))) : '') + (dir.arg ? (",arg:" + (dir.isDynamicArg ? dir.arg : ("\"" + (dir.arg) + "\""))) : '') + (dir.modifiers ? (",modifiers:" + (JSON.stringify(dir.modifiers))) : '') + "},";
  59401. }
  59402. }
  59403. if (hasRuntime) {
  59404. return res.slice(0, -1) + ']'
  59405. }
  59406. }
  59407. function genInlineTemplate (el, state) {
  59408. var ast = el.children[0];
  59409. if (el.children.length !== 1 || ast.type !== 1) {
  59410. state.warn(
  59411. 'Inline-template components must have exactly one child element.',
  59412. { start: el.start }
  59413. );
  59414. }
  59415. if (ast && ast.type === 1) {
  59416. var inlineRenderFns = generate(ast, state.options);
  59417. return ("inlineTemplate:{render:function(){" + (inlineRenderFns.render) + "},staticRenderFns:[" + (inlineRenderFns.staticRenderFns.map(function (code) { return ("function(){" + code + "}"); }).join(',')) + "]}")
  59418. }
  59419. }
  59420. function genScopedSlots (
  59421. el,
  59422. slots,
  59423. state
  59424. ) {
  59425. // by default scoped slots are considered "stable", this allows child
  59426. // components with only scoped slots to skip forced updates from parent.
  59427. // but in some cases we have to bail-out of this optimization
  59428. // for example if the slot contains dynamic names, has v-if or v-for on them...
  59429. var needsForceUpdate = el.for || Object.keys(slots).some(function (key) {
  59430. var slot = slots[key];
  59431. return (
  59432. slot.slotTargetDynamic ||
  59433. slot.if ||
  59434. slot.for ||
  59435. containsSlotChild(slot) // is passing down slot from parent which may be dynamic
  59436. )
  59437. });
  59438. // #9534: if a component with scoped slots is inside a conditional branch,
  59439. // it's possible for the same component to be reused but with different
  59440. // compiled slot content. To avoid that, we generate a unique key based on
  59441. // the generated code of all the slot contents.
  59442. var needsKey = !!el.if;
  59443. // OR when it is inside another scoped slot or v-for (the reactivity may be
  59444. // disconnected due to the intermediate scope variable)
  59445. // #9438, #9506
  59446. // TODO: this can be further optimized by properly analyzing in-scope bindings
  59447. // and skip force updating ones that do not actually use scope variables.
  59448. if (!needsForceUpdate) {
  59449. var parent = el.parent;
  59450. while (parent) {
  59451. if (
  59452. (parent.slotScope && parent.slotScope !== emptySlotScopeToken) ||
  59453. parent.for
  59454. ) {
  59455. needsForceUpdate = true;
  59456. break
  59457. }
  59458. if (parent.if) {
  59459. needsKey = true;
  59460. }
  59461. parent = parent.parent;
  59462. }
  59463. }
  59464. var generatedSlots = Object.keys(slots)
  59465. .map(function (key) { return genScopedSlot(slots[key], state); })
  59466. .join(',');
  59467. return ("scopedSlots:_u([" + generatedSlots + "]" + (needsForceUpdate ? ",null,true" : "") + (!needsForceUpdate && needsKey ? (",null,false," + (hash(generatedSlots))) : "") + ")")
  59468. }
  59469. function hash(str) {
  59470. var hash = 5381;
  59471. var i = str.length;
  59472. while(i) {
  59473. hash = (hash * 33) ^ str.charCodeAt(--i);
  59474. }
  59475. return hash >>> 0
  59476. }
  59477. function containsSlotChild (el) {
  59478. if (el.type === 1) {
  59479. if (el.tag === 'slot') {
  59480. return true
  59481. }
  59482. return el.children.some(containsSlotChild)
  59483. }
  59484. return false
  59485. }
  59486. function genScopedSlot (
  59487. el,
  59488. state
  59489. ) {
  59490. var isLegacySyntax = el.attrsMap['slot-scope'];
  59491. if (el.if && !el.ifProcessed && !isLegacySyntax) {
  59492. return genIf(el, state, genScopedSlot, "null")
  59493. }
  59494. if (el.for && !el.forProcessed) {
  59495. return genFor(el, state, genScopedSlot)
  59496. }
  59497. var slotScope = el.slotScope === emptySlotScopeToken
  59498. ? ""
  59499. : String(el.slotScope);
  59500. var fn = "function(" + slotScope + "){" +
  59501. "return " + (el.tag === 'template'
  59502. ? el.if && isLegacySyntax
  59503. ? ("(" + (el.if) + ")?" + (genChildren(el, state) || 'undefined') + ":undefined")
  59504. : genChildren(el, state) || 'undefined'
  59505. : genElement(el, state)) + "}";
  59506. // reverse proxy v-slot without scope on this.$slots
  59507. var reverseProxy = slotScope ? "" : ",proxy:true";
  59508. return ("{key:" + (el.slotTarget || "\"default\"") + ",fn:" + fn + reverseProxy + "}")
  59509. }
  59510. function genChildren (
  59511. el,
  59512. state,
  59513. checkSkip,
  59514. altGenElement,
  59515. altGenNode
  59516. ) {
  59517. var children = el.children;
  59518. if (children.length) {
  59519. var el$1 = children[0];
  59520. // optimize single v-for
  59521. if (children.length === 1 &&
  59522. el$1.for &&
  59523. el$1.tag !== 'template' &&
  59524. el$1.tag !== 'slot'
  59525. ) {
  59526. var normalizationType = checkSkip
  59527. ? state.maybeComponent(el$1) ? ",1" : ",0"
  59528. : "";
  59529. return ("" + ((altGenElement || genElement)(el$1, state)) + normalizationType)
  59530. }
  59531. var normalizationType$1 = checkSkip
  59532. ? getNormalizationType(children, state.maybeComponent)
  59533. : 0;
  59534. var gen = altGenNode || genNode;
  59535. return ("[" + (children.map(function (c) { return gen(c, state); }).join(',')) + "]" + (normalizationType$1 ? ("," + normalizationType$1) : ''))
  59536. }
  59537. }
  59538. // determine the normalization needed for the children array.
  59539. // 0: no normalization needed
  59540. // 1: simple normalization needed (possible 1-level deep nested array)
  59541. // 2: full normalization needed
  59542. function getNormalizationType (
  59543. children,
  59544. maybeComponent
  59545. ) {
  59546. var res = 0;
  59547. for (var i = 0; i < children.length; i++) {
  59548. var el = children[i];
  59549. if (el.type !== 1) {
  59550. continue
  59551. }
  59552. if (needsNormalization(el) ||
  59553. (el.ifConditions && el.ifConditions.some(function (c) { return needsNormalization(c.block); }))) {
  59554. res = 2;
  59555. break
  59556. }
  59557. if (maybeComponent(el) ||
  59558. (el.ifConditions && el.ifConditions.some(function (c) { return maybeComponent(c.block); }))) {
  59559. res = 1;
  59560. }
  59561. }
  59562. return res
  59563. }
  59564. function needsNormalization (el) {
  59565. return el.for !== undefined || el.tag === 'template' || el.tag === 'slot'
  59566. }
  59567. function genNode (node, state) {
  59568. if (node.type === 1) {
  59569. return genElement(node, state)
  59570. } else if (node.type === 3 && node.isComment) {
  59571. return genComment(node)
  59572. } else {
  59573. return genText(node)
  59574. }
  59575. }
  59576. function genText (text) {
  59577. return ("_v(" + (text.type === 2
  59578. ? text.expression // no need for () because already wrapped in _s()
  59579. : transformSpecialNewlines(JSON.stringify(text.text))) + ")")
  59580. }
  59581. function genComment (comment) {
  59582. return ("_e(" + (JSON.stringify(comment.text)) + ")")
  59583. }
  59584. function genSlot (el, state) {
  59585. var slotName = el.slotName || '"default"';
  59586. var children = genChildren(el, state);
  59587. var res = "_t(" + slotName + (children ? ("," + children) : '');
  59588. var attrs = el.attrs || el.dynamicAttrs
  59589. ? genProps((el.attrs || []).concat(el.dynamicAttrs || []).map(function (attr) { return ({
  59590. // slot props are camelized
  59591. name: camelize(attr.name),
  59592. value: attr.value,
  59593. dynamic: attr.dynamic
  59594. }); }))
  59595. : null;
  59596. var bind$$1 = el.attrsMap['v-bind'];
  59597. if ((attrs || bind$$1) && !children) {
  59598. res += ",null";
  59599. }
  59600. if (attrs) {
  59601. res += "," + attrs;
  59602. }
  59603. if (bind$$1) {
  59604. res += (attrs ? '' : ',null') + "," + bind$$1;
  59605. }
  59606. return res + ')'
  59607. }
  59608. // componentName is el.component, take it as argument to shun flow's pessimistic refinement
  59609. function genComponent (
  59610. componentName,
  59611. el,
  59612. state
  59613. ) {
  59614. var children = el.inlineTemplate ? null : genChildren(el, state, true);
  59615. return ("_c(" + componentName + "," + (genData$2(el, state)) + (children ? ("," + children) : '') + ")")
  59616. }
  59617. function genProps (props) {
  59618. var staticProps = "";
  59619. var dynamicProps = "";
  59620. for (var i = 0; i < props.length; i++) {
  59621. var prop = props[i];
  59622. var value = transformSpecialNewlines(prop.value);
  59623. if (prop.dynamic) {
  59624. dynamicProps += (prop.name) + "," + value + ",";
  59625. } else {
  59626. staticProps += "\"" + (prop.name) + "\":" + value + ",";
  59627. }
  59628. }
  59629. staticProps = "{" + (staticProps.slice(0, -1)) + "}";
  59630. if (dynamicProps) {
  59631. return ("_d(" + staticProps + ",[" + (dynamicProps.slice(0, -1)) + "])")
  59632. } else {
  59633. return staticProps
  59634. }
  59635. }
  59636. // #3895, #4268
  59637. function transformSpecialNewlines (text) {
  59638. return text
  59639. .replace(/\u2028/g, '\\u2028')
  59640. .replace(/\u2029/g, '\\u2029')
  59641. }
  59642. /* */
  59643. // these keywords should not appear inside expressions, but operators like
  59644. // typeof, instanceof and in are allowed
  59645. var prohibitedKeywordRE = new RegExp('\\b' + (
  59646. 'do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' +
  59647. 'super,throw,while,yield,delete,export,import,return,switch,default,' +
  59648. 'extends,finally,continue,debugger,function,arguments'
  59649. ).split(',').join('\\b|\\b') + '\\b');
  59650. // these unary operators should not be used as property/method names
  59651. var unaryOperatorsRE = new RegExp('\\b' + (
  59652. 'delete,typeof,void'
  59653. ).split(',').join('\\s*\\([^\\)]*\\)|\\b') + '\\s*\\([^\\)]*\\)');
  59654. // strip strings in expressions
  59655. var stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;
  59656. // detect problematic expressions in a template
  59657. function detectErrors (ast, warn) {
  59658. if (ast) {
  59659. checkNode(ast, warn);
  59660. }
  59661. }
  59662. function checkNode (node, warn) {
  59663. if (node.type === 1) {
  59664. for (var name in node.attrsMap) {
  59665. if (dirRE.test(name)) {
  59666. var value = node.attrsMap[name];
  59667. if (value) {
  59668. var range = node.rawAttrsMap[name];
  59669. if (name === 'v-for') {
  59670. checkFor(node, ("v-for=\"" + value + "\""), warn, range);
  59671. } else if (name === 'v-slot' || name[0] === '#') {
  59672. checkFunctionParameterExpression(value, (name + "=\"" + value + "\""), warn, range);
  59673. } else if (onRE.test(name)) {
  59674. checkEvent(value, (name + "=\"" + value + "\""), warn, range);
  59675. } else {
  59676. checkExpression(value, (name + "=\"" + value + "\""), warn, range);
  59677. }
  59678. }
  59679. }
  59680. }
  59681. if (node.children) {
  59682. for (var i = 0; i < node.children.length; i++) {
  59683. checkNode(node.children[i], warn);
  59684. }
  59685. }
  59686. } else if (node.type === 2) {
  59687. checkExpression(node.expression, node.text, warn, node);
  59688. }
  59689. }
  59690. function checkEvent (exp, text, warn, range) {
  59691. var stripped = exp.replace(stripStringRE, '');
  59692. var keywordMatch = stripped.match(unaryOperatorsRE);
  59693. if (keywordMatch && stripped.charAt(keywordMatch.index - 1) !== '$') {
  59694. warn(
  59695. "avoid using JavaScript unary operator as property name: " +
  59696. "\"" + (keywordMatch[0]) + "\" in expression " + (text.trim()),
  59697. range
  59698. );
  59699. }
  59700. checkExpression(exp, text, warn, range);
  59701. }
  59702. function checkFor (node, text, warn, range) {
  59703. checkExpression(node.for || '', text, warn, range);
  59704. checkIdentifier(node.alias, 'v-for alias', text, warn, range);
  59705. checkIdentifier(node.iterator1, 'v-for iterator', text, warn, range);
  59706. checkIdentifier(node.iterator2, 'v-for iterator', text, warn, range);
  59707. }
  59708. function checkIdentifier (
  59709. ident,
  59710. type,
  59711. text,
  59712. warn,
  59713. range
  59714. ) {
  59715. if (typeof ident === 'string') {
  59716. try {
  59717. new Function(("var " + ident + "=_"));
  59718. } catch (e) {
  59719. warn(("invalid " + type + " \"" + ident + "\" in expression: " + (text.trim())), range);
  59720. }
  59721. }
  59722. }
  59723. function checkExpression (exp, text, warn, range) {
  59724. try {
  59725. new Function(("return " + exp));
  59726. } catch (e) {
  59727. var keywordMatch = exp.replace(stripStringRE, '').match(prohibitedKeywordRE);
  59728. if (keywordMatch) {
  59729. warn(
  59730. "avoid using JavaScript keyword as property name: " +
  59731. "\"" + (keywordMatch[0]) + "\"\n Raw expression: " + (text.trim()),
  59732. range
  59733. );
  59734. } else {
  59735. warn(
  59736. "invalid expression: " + (e.message) + " in\n\n" +
  59737. " " + exp + "\n\n" +
  59738. " Raw expression: " + (text.trim()) + "\n",
  59739. range
  59740. );
  59741. }
  59742. }
  59743. }
  59744. function checkFunctionParameterExpression (exp, text, warn, range) {
  59745. try {
  59746. new Function(exp, '');
  59747. } catch (e) {
  59748. warn(
  59749. "invalid function parameter expression: " + (e.message) + " in\n\n" +
  59750. " " + exp + "\n\n" +
  59751. " Raw expression: " + (text.trim()) + "\n",
  59752. range
  59753. );
  59754. }
  59755. }
  59756. /* */
  59757. var range = 2;
  59758. function generateCodeFrame (
  59759. source,
  59760. start,
  59761. end
  59762. ) {
  59763. if ( start === void 0 ) start = 0;
  59764. if ( end === void 0 ) end = source.length;
  59765. var lines = source.split(/\r?\n/);
  59766. var count = 0;
  59767. var res = [];
  59768. for (var i = 0; i < lines.length; i++) {
  59769. count += lines[i].length + 1;
  59770. if (count >= start) {
  59771. for (var j = i - range; j <= i + range || end > count; j++) {
  59772. if (j < 0 || j >= lines.length) { continue }
  59773. res.push(("" + (j + 1) + (repeat$1(" ", 3 - String(j + 1).length)) + "| " + (lines[j])));
  59774. var lineLength = lines[j].length;
  59775. if (j === i) {
  59776. // push underline
  59777. var pad = start - (count - lineLength) + 1;
  59778. var length = end > count ? lineLength - pad : end - start;
  59779. res.push(" | " + repeat$1(" ", pad) + repeat$1("^", length));
  59780. } else if (j > i) {
  59781. if (end > count) {
  59782. var length$1 = Math.min(end - count, lineLength);
  59783. res.push(" | " + repeat$1("^", length$1));
  59784. }
  59785. count += lineLength + 1;
  59786. }
  59787. }
  59788. break
  59789. }
  59790. }
  59791. return res.join('\n')
  59792. }
  59793. function repeat$1 (str, n) {
  59794. var result = '';
  59795. if (n > 0) {
  59796. while (true) { // eslint-disable-line
  59797. if (n & 1) { result += str; }
  59798. n >>>= 1;
  59799. if (n <= 0) { break }
  59800. str += str;
  59801. }
  59802. }
  59803. return result
  59804. }
  59805. /* */
  59806. function createFunction (code, errors) {
  59807. try {
  59808. return new Function(code)
  59809. } catch (err) {
  59810. errors.push({ err: err, code: code });
  59811. return noop
  59812. }
  59813. }
  59814. function createCompileToFunctionFn (compile) {
  59815. var cache = Object.create(null);
  59816. return function compileToFunctions (
  59817. template,
  59818. options,
  59819. vm
  59820. ) {
  59821. options = extend({}, options);
  59822. var warn$$1 = options.warn || warn;
  59823. delete options.warn;
  59824. /* istanbul ignore if */
  59825. {
  59826. // detect possible CSP restriction
  59827. try {
  59828. new Function('return 1');
  59829. } catch (e) {
  59830. if (e.toString().match(/unsafe-eval|CSP/)) {
  59831. warn$$1(
  59832. 'It seems you are using the standalone build of Vue.js in an ' +
  59833. 'environment with Content Security Policy that prohibits unsafe-eval. ' +
  59834. 'The template compiler cannot work in this environment. Consider ' +
  59835. 'relaxing the policy to allow unsafe-eval or pre-compiling your ' +
  59836. 'templates into render functions.'
  59837. );
  59838. }
  59839. }
  59840. }
  59841. // check cache
  59842. var key = options.delimiters
  59843. ? String(options.delimiters) + template
  59844. : template;
  59845. if (cache[key]) {
  59846. return cache[key]
  59847. }
  59848. // compile
  59849. var compiled = compile(template, options);
  59850. // check compilation errors/tips
  59851. {
  59852. if (compiled.errors && compiled.errors.length) {
  59853. if (options.outputSourceRange) {
  59854. compiled.errors.forEach(function (e) {
  59855. warn$$1(
  59856. "Error compiling template:\n\n" + (e.msg) + "\n\n" +
  59857. generateCodeFrame(template, e.start, e.end),
  59858. vm
  59859. );
  59860. });
  59861. } else {
  59862. warn$$1(
  59863. "Error compiling template:\n\n" + template + "\n\n" +
  59864. compiled.errors.map(function (e) { return ("- " + e); }).join('\n') + '\n',
  59865. vm
  59866. );
  59867. }
  59868. }
  59869. if (compiled.tips && compiled.tips.length) {
  59870. if (options.outputSourceRange) {
  59871. compiled.tips.forEach(function (e) { return tip(e.msg, vm); });
  59872. } else {
  59873. compiled.tips.forEach(function (msg) { return tip(msg, vm); });
  59874. }
  59875. }
  59876. }
  59877. // turn code into functions
  59878. var res = {};
  59879. var fnGenErrors = [];
  59880. res.render = createFunction(compiled.render, fnGenErrors);
  59881. res.staticRenderFns = compiled.staticRenderFns.map(function (code) {
  59882. return createFunction(code, fnGenErrors)
  59883. });
  59884. // check function generation errors.
  59885. // this should only happen if there is a bug in the compiler itself.
  59886. // mostly for codegen development use
  59887. /* istanbul ignore if */
  59888. {
  59889. if ((!compiled.errors || !compiled.errors.length) && fnGenErrors.length) {
  59890. warn$$1(
  59891. "Failed to generate render function:\n\n" +
  59892. fnGenErrors.map(function (ref) {
  59893. var err = ref.err;
  59894. var code = ref.code;
  59895. return ((err.toString()) + " in\n\n" + code + "\n");
  59896. }).join('\n'),
  59897. vm
  59898. );
  59899. }
  59900. }
  59901. return (cache[key] = res)
  59902. }
  59903. }
  59904. /* */
  59905. function createCompilerCreator (baseCompile) {
  59906. return function createCompiler (baseOptions) {
  59907. function compile (
  59908. template,
  59909. options
  59910. ) {
  59911. var finalOptions = Object.create(baseOptions);
  59912. var errors = [];
  59913. var tips = [];
  59914. var warn = function (msg, range, tip) {
  59915. (tip ? tips : errors).push(msg);
  59916. };
  59917. if (options) {
  59918. if (options.outputSourceRange) {
  59919. // $flow-disable-line
  59920. var leadingSpaceLength = template.match(/^\s*/)[0].length;
  59921. warn = function (msg, range, tip) {
  59922. var data = { msg: msg };
  59923. if (range) {
  59924. if (range.start != null) {
  59925. data.start = range.start + leadingSpaceLength;
  59926. }
  59927. if (range.end != null) {
  59928. data.end = range.end + leadingSpaceLength;
  59929. }
  59930. }
  59931. (tip ? tips : errors).push(data);
  59932. };
  59933. }
  59934. // merge custom modules
  59935. if (options.modules) {
  59936. finalOptions.modules =
  59937. (baseOptions.modules || []).concat(options.modules);
  59938. }
  59939. // merge custom directives
  59940. if (options.directives) {
  59941. finalOptions.directives = extend(
  59942. Object.create(baseOptions.directives || null),
  59943. options.directives
  59944. );
  59945. }
  59946. // copy other options
  59947. for (var key in options) {
  59948. if (key !== 'modules' && key !== 'directives') {
  59949. finalOptions[key] = options[key];
  59950. }
  59951. }
  59952. }
  59953. finalOptions.warn = warn;
  59954. var compiled = baseCompile(template.trim(), finalOptions);
  59955. {
  59956. detectErrors(compiled.ast, warn);
  59957. }
  59958. compiled.errors = errors;
  59959. compiled.tips = tips;
  59960. return compiled
  59961. }
  59962. return {
  59963. compile: compile,
  59964. compileToFunctions: createCompileToFunctionFn(compile)
  59965. }
  59966. }
  59967. }
  59968. /* */
  59969. // `createCompilerCreator` allows creating compilers that use alternative
  59970. // parser/optimizer/codegen, e.g the SSR optimizing compiler.
  59971. // Here we just export a default compiler using the default parts.
  59972. var createCompiler = createCompilerCreator(function baseCompile (
  59973. template,
  59974. options
  59975. ) {
  59976. var ast = parse(template.trim(), options);
  59977. if (options.optimize !== false) {
  59978. optimize(ast, options);
  59979. }
  59980. var code = generate(ast, options);
  59981. return {
  59982. ast: ast,
  59983. render: code.render,
  59984. staticRenderFns: code.staticRenderFns
  59985. }
  59986. });
  59987. /* */
  59988. var ref$1 = createCompiler(baseOptions);
  59989. var compile = ref$1.compile;
  59990. var compileToFunctions = ref$1.compileToFunctions;
  59991. /* */
  59992. // check whether current browser encodes a char inside attribute values
  59993. var div;
  59994. function getShouldDecode (href) {
  59995. div = div || document.createElement('div');
  59996. div.innerHTML = href ? "<a href=\"\n\"/>" : "<div a=\"\n\"/>";
  59997. return div.innerHTML.indexOf('&#10;') > 0
  59998. }
  59999. // #3663: IE encodes newlines inside attribute values while other browsers don't
  60000. var shouldDecodeNewlines = inBrowser ? getShouldDecode(false) : false;
  60001. // #6828: chrome encodes content in a[href]
  60002. var shouldDecodeNewlinesForHref = inBrowser ? getShouldDecode(true) : false;
  60003. /* */
  60004. var idToTemplate = cached(function (id) {
  60005. var el = query(id);
  60006. return el && el.innerHTML
  60007. });
  60008. var mount = Vue.prototype.$mount;
  60009. Vue.prototype.$mount = function (
  60010. el,
  60011. hydrating
  60012. ) {
  60013. el = el && query(el);
  60014. /* istanbul ignore if */
  60015. if (el === document.body || el === document.documentElement) {
  60016. warn(
  60017. "Do not mount Vue to <html> or <body> - mount to normal elements instead."
  60018. );
  60019. return this
  60020. }
  60021. var options = this.$options;
  60022. // resolve template/el and convert to render function
  60023. if (!options.render) {
  60024. var template = options.template;
  60025. if (template) {
  60026. if (typeof template === 'string') {
  60027. if (template.charAt(0) === '#') {
  60028. template = idToTemplate(template);
  60029. /* istanbul ignore if */
  60030. if (!template) {
  60031. warn(
  60032. ("Template element not found or is empty: " + (options.template)),
  60033. this
  60034. );
  60035. }
  60036. }
  60037. } else if (template.nodeType) {
  60038. template = template.innerHTML;
  60039. } else {
  60040. {
  60041. warn('invalid template option:' + template, this);
  60042. }
  60043. return this
  60044. }
  60045. } else if (el) {
  60046. template = getOuterHTML(el);
  60047. }
  60048. if (template) {
  60049. /* istanbul ignore if */
  60050. if (config.performance && mark) {
  60051. mark('compile');
  60052. }
  60053. var ref = compileToFunctions(template, {
  60054. outputSourceRange: "development" !== 'production',
  60055. shouldDecodeNewlines: shouldDecodeNewlines,
  60056. shouldDecodeNewlinesForHref: shouldDecodeNewlinesForHref,
  60057. delimiters: options.delimiters,
  60058. comments: options.comments
  60059. }, this);
  60060. var render = ref.render;
  60061. var staticRenderFns = ref.staticRenderFns;
  60062. options.render = render;
  60063. options.staticRenderFns = staticRenderFns;
  60064. /* istanbul ignore if */
  60065. if (config.performance && mark) {
  60066. mark('compile end');
  60067. measure(("vue " + (this._name) + " compile"), 'compile', 'compile end');
  60068. }
  60069. }
  60070. }
  60071. return mount.call(this, el, hydrating)
  60072. };
  60073. /**
  60074. * Get outerHTML of elements, taking care
  60075. * of SVG elements in IE as well.
  60076. */
  60077. function getOuterHTML (el) {
  60078. if (el.outerHTML) {
  60079. return el.outerHTML
  60080. } else {
  60081. var container = document.createElement('div');
  60082. container.appendChild(el.cloneNode(true));
  60083. return container.innerHTML
  60084. }
  60085. }
  60086. Vue.compile = compileToFunctions;
  60087. module.exports = Vue;
  60088. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"), __webpack_require__(/*! ./../../timers-browserify/main.js */ "./node_modules/timers-browserify/main.js").setImmediate))
  60089. /***/ }),
  60090. /***/ "./node_modules/vue/dist/vue.common.js":
  60091. /*!*********************************************!*\
  60092. !*** ./node_modules/vue/dist/vue.common.js ***!
  60093. \*********************************************/
  60094. /*! no static exports found */
  60095. /***/ (function(module, exports, __webpack_require__) {
  60096. if (false) {} else {
  60097. module.exports = __webpack_require__(/*! ./vue.common.dev.js */ "./node_modules/vue/dist/vue.common.dev.js")
  60098. }
  60099. /***/ }),
  60100. /***/ "./node_modules/webpack/buildin/global.js":
  60101. /*!***********************************!*\
  60102. !*** (webpack)/buildin/global.js ***!
  60103. \***********************************/
  60104. /*! no static exports found */
  60105. /***/ (function(module, exports) {
  60106. var g;
  60107. // This works in non-strict mode
  60108. g = (function() {
  60109. return this;
  60110. })();
  60111. try {
  60112. // This works if eval is allowed (see CSP)
  60113. g = g || new Function("return this")();
  60114. } catch (e) {
  60115. // This works if the window reference is available
  60116. if (typeof window === "object") g = window;
  60117. }
  60118. // g can still be undefined, but nothing to do about it...
  60119. // We return undefined, instead of nothing here, so it's
  60120. // easier to handle this case. if(!global) { ...}
  60121. module.exports = g;
  60122. /***/ }),
  60123. /***/ "./node_modules/webpack/buildin/module.js":
  60124. /*!***********************************!*\
  60125. !*** (webpack)/buildin/module.js ***!
  60126. \***********************************/
  60127. /*! no static exports found */
  60128. /***/ (function(module, exports) {
  60129. module.exports = function(module) {
  60130. if (!module.webpackPolyfill) {
  60131. module.deprecate = function() {};
  60132. module.paths = [];
  60133. // module.parent = undefined by default
  60134. if (!module.children) module.children = [];
  60135. Object.defineProperty(module, "loaded", {
  60136. enumerable: true,
  60137. get: function() {
  60138. return module.l;
  60139. }
  60140. });
  60141. Object.defineProperty(module, "id", {
  60142. enumerable: true,
  60143. get: function() {
  60144. return module.i;
  60145. }
  60146. });
  60147. module.webpackPolyfill = 1;
  60148. }
  60149. return module;
  60150. };
  60151. /***/ }),
  60152. /***/ "./resources/js/app.js":
  60153. /*!*****************************!*\
  60154. !*** ./resources/js/app.js ***!
  60155. \*****************************/
  60156. /*! no exports provided */
  60157. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60158. "use strict";
  60159. __webpack_require__.r(__webpack_exports__);
  60160. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.common.js");
  60161. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
  60162. /* harmony import */ var vue_router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vue-router */ "./node_modules/vue-router/dist/vue-router.esm.js");
  60163. /* harmony import */ var _views_App__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./views/App */ "./resources/js/views/App.vue");
  60164. /* harmony import */ var _views_Dashboard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./views/Dashboard */ "./resources/js/views/Dashboard.vue");
  60165. /* harmony import */ var _views_WorkOrder__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./views/WorkOrder */ "./resources/js/views/WorkOrder.vue");
  60166. /* harmony import */ var _views_Login__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./views/Login */ "./resources/js/views/Login.vue");
  60167. /* harmony import */ var _views_Welcome__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./views/Welcome */ "./resources/js/views/Welcome.vue");
  60168. /**
  60169. * First we will load all of this project's JavaScript dependencies which
  60170. * includes Vue and other libraries. It is a great starting point when
  60171. * building robust, powerful web applications using Vue and Laravel.
  60172. */
  60173. __webpack_require__(/*! ./bootstrap */ "./resources/js/bootstrap.js");
  60174. window.Clipboard = __webpack_require__(/*! clipboard */ "./node_modules/clipboard/dist/clipboard.js");
  60175. __webpack_require__(/*! ./notify.min.js */ "./resources/js/notify.min.js");
  60176. vue__WEBPACK_IMPORTED_MODULE_0___default.a.use(vue_router__WEBPACK_IMPORTED_MODULE_1__["default"]);
  60177. var router = new vue_router__WEBPACK_IMPORTED_MODULE_1__["default"]({
  60178. mode: 'history',
  60179. routes: [{
  60180. path: '/',
  60181. name: 'home',
  60182. component: _views_Welcome__WEBPACK_IMPORTED_MODULE_6__["default"]
  60183. }, {
  60184. path: '/login',
  60185. name: 'login',
  60186. component: _views_Login__WEBPACK_IMPORTED_MODULE_5__["default"]
  60187. }, {
  60188. path: '/dashboard',
  60189. name: 'dashboard',
  60190. component: _views_Dashboard__WEBPACK_IMPORTED_MODULE_3__["default"]
  60191. }, {
  60192. path: '/workorders/:id',
  60193. name: 'workorders',
  60194. component: _views_WorkOrder__WEBPACK_IMPORTED_MODULE_4__["default"],
  60195. props: true
  60196. }]
  60197. });
  60198. var app = new vue__WEBPACK_IMPORTED_MODULE_0___default.a({
  60199. el: '#app',
  60200. components: {
  60201. App: _views_App__WEBPACK_IMPORTED_MODULE_2__["default"]
  60202. },
  60203. router: router
  60204. });
  60205. $(function () {
  60206. $('[data-toggle="tooltip"]').tooltip();
  60207. });
  60208. var clipboard = new Clipboard('.btn-clip');
  60209. clipboard.on('success', function (e) {
  60210. $('#' + e.trigger.getAttribute('id')).notify('Copied to Clipboard', {
  60211. position: "right",
  60212. className: 'success'
  60213. });
  60214. e.clearSelection();
  60215. });
  60216. /***/ }),
  60217. /***/ "./resources/js/bootstrap.js":
  60218. /*!***********************************!*\
  60219. !*** ./resources/js/bootstrap.js ***!
  60220. \***********************************/
  60221. /*! no exports provided */
  60222. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60223. "use strict";
  60224. __webpack_require__.r(__webpack_exports__);
  60225. /* harmony import */ var laravel_echo__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! laravel-echo */ "./node_modules/laravel-echo/dist/echo.js");
  60226. window._ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
  60227. /**
  60228. * We'll load jQuery and the Bootstrap jQuery plugin which provides support
  60229. * for JavaScript based Bootstrap features such as modals and tabs. This
  60230. * code may be modified to fit the specific needs of your application.
  60231. */
  60232. try {
  60233. window.Popper = __webpack_require__(/*! popper.js */ "./node_modules/popper.js/dist/esm/popper.js")["default"];
  60234. window.$ = window.jQuery = __webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js");
  60235. __webpack_require__(/*! bootstrap */ "./node_modules/bootstrap/dist/js/bootstrap.js");
  60236. } catch (e) {}
  60237. /**
  60238. * We'll load the axios HTTP library which allows us to easily issue requests
  60239. * to our Laravel back-end. This library automatically handles sending the
  60240. * CSRF token as a header based on the value of the "XSRF" token cookie.
  60241. */
  60242. window.axios = __webpack_require__(/*! axios */ "./node_modules/axios/index.js");
  60243. window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
  60244. /**
  60245. * Echo exposes an expressive API for subscribing to channels and listening
  60246. * for events that are broadcast by Laravel. Echo and event broadcasting
  60247. * allows your team to easily build robust real-time web applications.
  60248. */
  60249. window.Pusher = __webpack_require__(/*! pusher-js */ "./node_modules/pusher-js/dist/web/pusher.js");
  60250. window.Echo = new laravel_echo__WEBPACK_IMPORTED_MODULE_0__["default"]({
  60251. broadcaster: 'pusher',
  60252. key: "upccrt",
  60253. authEndpoint: '/broadcasting/auth',
  60254. wsHost: window.location.hostname,
  60255. wsPort: 6001,
  60256. disableStats: true
  60257. });
  60258. /***/ }),
  60259. /***/ "./resources/js/components/AssetInfo.vue":
  60260. /*!***********************************************!*\
  60261. !*** ./resources/js/components/AssetInfo.vue ***!
  60262. \***********************************************/
  60263. /*! exports provided: default */
  60264. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60265. "use strict";
  60266. __webpack_require__.r(__webpack_exports__);
  60267. /* harmony import */ var _AssetInfo_vue_vue_type_template_id_f949323a___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AssetInfo.vue?vue&type=template&id=f949323a& */ "./resources/js/components/AssetInfo.vue?vue&type=template&id=f949323a&");
  60268. /* harmony import */ var _AssetInfo_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AssetInfo.vue?vue&type=script&lang=js& */ "./resources/js/components/AssetInfo.vue?vue&type=script&lang=js&");
  60269. /* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js");
  60270. /* normalize component */
  60271. var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(
  60272. _AssetInfo_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
  60273. _AssetInfo_vue_vue_type_template_id_f949323a___WEBPACK_IMPORTED_MODULE_0__["render"],
  60274. _AssetInfo_vue_vue_type_template_id_f949323a___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
  60275. false,
  60276. null,
  60277. null,
  60278. null
  60279. )
  60280. /* hot reload */
  60281. if (false) { var api; }
  60282. component.options.__file = "resources/js/components/AssetInfo.vue"
  60283. /* harmony default export */ __webpack_exports__["default"] = (component.exports);
  60284. /***/ }),
  60285. /***/ "./resources/js/components/AssetInfo.vue?vue&type=script&lang=js&":
  60286. /*!************************************************************************!*\
  60287. !*** ./resources/js/components/AssetInfo.vue?vue&type=script&lang=js& ***!
  60288. \************************************************************************/
  60289. /*! exports provided: default */
  60290. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60291. "use strict";
  60292. __webpack_require__.r(__webpack_exports__);
  60293. /* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_AssetInfo_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib??ref--4-0!../../../node_modules/vue-loader/lib??vue-loader-options!./AssetInfo.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/AssetInfo.vue?vue&type=script&lang=js&");
  60294. /* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_AssetInfo_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]);
  60295. /***/ }),
  60296. /***/ "./resources/js/components/AssetInfo.vue?vue&type=template&id=f949323a&":
  60297. /*!******************************************************************************!*\
  60298. !*** ./resources/js/components/AssetInfo.vue?vue&type=template&id=f949323a& ***!
  60299. \******************************************************************************/
  60300. /*! exports provided: render, staticRenderFns */
  60301. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60302. "use strict";
  60303. __webpack_require__.r(__webpack_exports__);
  60304. /* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_AssetInfo_vue_vue_type_template_id_f949323a___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib??vue-loader-options!./AssetInfo.vue?vue&type=template&id=f949323a& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/AssetInfo.vue?vue&type=template&id=f949323a&");
  60305. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_AssetInfo_vue_vue_type_template_id_f949323a___WEBPACK_IMPORTED_MODULE_0__["render"]; });
  60306. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_AssetInfo_vue_vue_type_template_id_f949323a___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; });
  60307. /***/ }),
  60308. /***/ "./resources/js/components/AssetInfoEditModal.vue":
  60309. /*!********************************************************!*\
  60310. !*** ./resources/js/components/AssetInfoEditModal.vue ***!
  60311. \********************************************************/
  60312. /*! exports provided: default */
  60313. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60314. "use strict";
  60315. __webpack_require__.r(__webpack_exports__);
  60316. /* harmony import */ var _AssetInfoEditModal_vue_vue_type_template_id_24c98bd0___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AssetInfoEditModal.vue?vue&type=template&id=24c98bd0& */ "./resources/js/components/AssetInfoEditModal.vue?vue&type=template&id=24c98bd0&");
  60317. /* harmony import */ var _AssetInfoEditModal_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AssetInfoEditModal.vue?vue&type=script&lang=js& */ "./resources/js/components/AssetInfoEditModal.vue?vue&type=script&lang=js&");
  60318. /* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js");
  60319. /* normalize component */
  60320. var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(
  60321. _AssetInfoEditModal_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
  60322. _AssetInfoEditModal_vue_vue_type_template_id_24c98bd0___WEBPACK_IMPORTED_MODULE_0__["render"],
  60323. _AssetInfoEditModal_vue_vue_type_template_id_24c98bd0___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
  60324. false,
  60325. null,
  60326. null,
  60327. null
  60328. )
  60329. /* hot reload */
  60330. if (false) { var api; }
  60331. component.options.__file = "resources/js/components/AssetInfoEditModal.vue"
  60332. /* harmony default export */ __webpack_exports__["default"] = (component.exports);
  60333. /***/ }),
  60334. /***/ "./resources/js/components/AssetInfoEditModal.vue?vue&type=script&lang=js&":
  60335. /*!*********************************************************************************!*\
  60336. !*** ./resources/js/components/AssetInfoEditModal.vue?vue&type=script&lang=js& ***!
  60337. \*********************************************************************************/
  60338. /*! exports provided: default */
  60339. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60340. "use strict";
  60341. __webpack_require__.r(__webpack_exports__);
  60342. /* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_AssetInfoEditModal_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib??ref--4-0!../../../node_modules/vue-loader/lib??vue-loader-options!./AssetInfoEditModal.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/AssetInfoEditModal.vue?vue&type=script&lang=js&");
  60343. /* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_AssetInfoEditModal_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]);
  60344. /***/ }),
  60345. /***/ "./resources/js/components/AssetInfoEditModal.vue?vue&type=template&id=24c98bd0&":
  60346. /*!***************************************************************************************!*\
  60347. !*** ./resources/js/components/AssetInfoEditModal.vue?vue&type=template&id=24c98bd0& ***!
  60348. \***************************************************************************************/
  60349. /*! exports provided: render, staticRenderFns */
  60350. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60351. "use strict";
  60352. __webpack_require__.r(__webpack_exports__);
  60353. /* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_AssetInfoEditModal_vue_vue_type_template_id_24c98bd0___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib??vue-loader-options!./AssetInfoEditModal.vue?vue&type=template&id=24c98bd0& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/AssetInfoEditModal.vue?vue&type=template&id=24c98bd0&");
  60354. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_AssetInfoEditModal_vue_vue_type_template_id_24c98bd0___WEBPACK_IMPORTED_MODULE_0__["render"]; });
  60355. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_AssetInfoEditModal_vue_vue_type_template_id_24c98bd0___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; });
  60356. /***/ }),
  60357. /***/ "./resources/js/components/AutocompleteCustomDropdown.vue":
  60358. /*!****************************************************************!*\
  60359. !*** ./resources/js/components/AutocompleteCustomDropdown.vue ***!
  60360. \****************************************************************/
  60361. /*! exports provided: default */
  60362. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60363. "use strict";
  60364. __webpack_require__.r(__webpack_exports__);
  60365. /* harmony import */ var _AutocompleteCustomDropdown_vue_vue_type_template_id_5fcc8b56___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AutocompleteCustomDropdown.vue?vue&type=template&id=5fcc8b56& */ "./resources/js/components/AutocompleteCustomDropdown.vue?vue&type=template&id=5fcc8b56&");
  60366. /* harmony import */ var _AutocompleteCustomDropdown_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AutocompleteCustomDropdown.vue?vue&type=script&lang=js& */ "./resources/js/components/AutocompleteCustomDropdown.vue?vue&type=script&lang=js&");
  60367. /* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js");
  60368. /* normalize component */
  60369. var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(
  60370. _AutocompleteCustomDropdown_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
  60371. _AutocompleteCustomDropdown_vue_vue_type_template_id_5fcc8b56___WEBPACK_IMPORTED_MODULE_0__["render"],
  60372. _AutocompleteCustomDropdown_vue_vue_type_template_id_5fcc8b56___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
  60373. false,
  60374. null,
  60375. null,
  60376. null
  60377. )
  60378. /* hot reload */
  60379. if (false) { var api; }
  60380. component.options.__file = "resources/js/components/AutocompleteCustomDropdown.vue"
  60381. /* harmony default export */ __webpack_exports__["default"] = (component.exports);
  60382. /***/ }),
  60383. /***/ "./resources/js/components/AutocompleteCustomDropdown.vue?vue&type=script&lang=js&":
  60384. /*!*****************************************************************************************!*\
  60385. !*** ./resources/js/components/AutocompleteCustomDropdown.vue?vue&type=script&lang=js& ***!
  60386. \*****************************************************************************************/
  60387. /*! exports provided: default */
  60388. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60389. "use strict";
  60390. __webpack_require__.r(__webpack_exports__);
  60391. /* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_AutocompleteCustomDropdown_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib??ref--4-0!../../../node_modules/vue-loader/lib??vue-loader-options!./AutocompleteCustomDropdown.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/AutocompleteCustomDropdown.vue?vue&type=script&lang=js&");
  60392. /* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_AutocompleteCustomDropdown_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]);
  60393. /***/ }),
  60394. /***/ "./resources/js/components/AutocompleteCustomDropdown.vue?vue&type=template&id=5fcc8b56&":
  60395. /*!***********************************************************************************************!*\
  60396. !*** ./resources/js/components/AutocompleteCustomDropdown.vue?vue&type=template&id=5fcc8b56& ***!
  60397. \***********************************************************************************************/
  60398. /*! exports provided: render, staticRenderFns */
  60399. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60400. "use strict";
  60401. __webpack_require__.r(__webpack_exports__);
  60402. /* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_AutocompleteCustomDropdown_vue_vue_type_template_id_5fcc8b56___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib??vue-loader-options!./AutocompleteCustomDropdown.vue?vue&type=template&id=5fcc8b56& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/AutocompleteCustomDropdown.vue?vue&type=template&id=5fcc8b56&");
  60403. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_AutocompleteCustomDropdown_vue_vue_type_template_id_5fcc8b56___WEBPACK_IMPORTED_MODULE_0__["render"]; });
  60404. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_AutocompleteCustomDropdown_vue_vue_type_template_id_5fcc8b56___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; });
  60405. /***/ }),
  60406. /***/ "./resources/js/components/CircleSpinner.vue":
  60407. /*!***************************************************!*\
  60408. !*** ./resources/js/components/CircleSpinner.vue ***!
  60409. \***************************************************/
  60410. /*! no static exports found */
  60411. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60412. "use strict";
  60413. __webpack_require__.r(__webpack_exports__);
  60414. /* harmony import */ var _CircleSpinner_vue_vue_type_template_id_9a543b64_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CircleSpinner.vue?vue&type=template&id=9a543b64&scoped=true& */ "./resources/js/components/CircleSpinner.vue?vue&type=template&id=9a543b64&scoped=true&");
  60415. /* harmony import */ var _CircleSpinner_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./CircleSpinner.vue?vue&type=script&lang=js& */ "./resources/js/components/CircleSpinner.vue?vue&type=script&lang=js&");
  60416. /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _CircleSpinner_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _CircleSpinner_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  60417. /* harmony import */ var _CircleSpinner_vue_vue_type_style_index_0_id_9a543b64_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./CircleSpinner.vue?vue&type=style&index=0&id=9a543b64&scoped=true&lang=css& */ "./resources/js/components/CircleSpinner.vue?vue&type=style&index=0&id=9a543b64&scoped=true&lang=css&");
  60418. /* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js");
  60419. /* normalize component */
  60420. var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__["default"])(
  60421. _CircleSpinner_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
  60422. _CircleSpinner_vue_vue_type_template_id_9a543b64_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"],
  60423. _CircleSpinner_vue_vue_type_template_id_9a543b64_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
  60424. false,
  60425. null,
  60426. "9a543b64",
  60427. null
  60428. )
  60429. /* hot reload */
  60430. if (false) { var api; }
  60431. component.options.__file = "resources/js/components/CircleSpinner.vue"
  60432. /* harmony default export */ __webpack_exports__["default"] = (component.exports);
  60433. /***/ }),
  60434. /***/ "./resources/js/components/CircleSpinner.vue?vue&type=script&lang=js&":
  60435. /*!****************************************************************************!*\
  60436. !*** ./resources/js/components/CircleSpinner.vue?vue&type=script&lang=js& ***!
  60437. \****************************************************************************/
  60438. /*! no static exports found */
  60439. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60440. "use strict";
  60441. __webpack_require__.r(__webpack_exports__);
  60442. /* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_CircleSpinner_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib??ref--4-0!../../../node_modules/vue-loader/lib??vue-loader-options!./CircleSpinner.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/CircleSpinner.vue?vue&type=script&lang=js&");
  60443. /* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_CircleSpinner_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]);
  60444. /***/ }),
  60445. /***/ "./resources/js/components/CircleSpinner.vue?vue&type=style&index=0&id=9a543b64&scoped=true&lang=css&":
  60446. /*!************************************************************************************************************!*\
  60447. !*** ./resources/js/components/CircleSpinner.vue?vue&type=style&index=0&id=9a543b64&scoped=true&lang=css& ***!
  60448. \************************************************************************************************************/
  60449. /*! no static exports found */
  60450. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60451. "use strict";
  60452. __webpack_require__.r(__webpack_exports__);
  60453. /* harmony import */ var _node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_6_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_2_node_modules_vue_loader_lib_index_js_vue_loader_options_CircleSpinner_vue_vue_type_style_index_0_id_9a543b64_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader!../../../node_modules/css-loader??ref--6-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src??ref--6-2!../../../node_modules/vue-loader/lib??vue-loader-options!./CircleSpinner.vue?vue&type=style&index=0&id=9a543b64&scoped=true&lang=css& */ "./node_modules/style-loader/index.js!./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/CircleSpinner.vue?vue&type=style&index=0&id=9a543b64&scoped=true&lang=css&");
  60454. /* harmony import */ var _node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_6_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_2_node_modules_vue_loader_lib_index_js_vue_loader_options_CircleSpinner_vue_vue_type_style_index_0_id_9a543b64_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_6_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_2_node_modules_vue_loader_lib_index_js_vue_loader_options_CircleSpinner_vue_vue_type_style_index_0_id_9a543b64_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__);
  60455. /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_6_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_2_node_modules_vue_loader_lib_index_js_vue_loader_options_CircleSpinner_vue_vue_type_style_index_0_id_9a543b64_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_6_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_2_node_modules_vue_loader_lib_index_js_vue_loader_options_CircleSpinner_vue_vue_type_style_index_0_id_9a543b64_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  60456. /* harmony default export */ __webpack_exports__["default"] = (_node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_6_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_2_node_modules_vue_loader_lib_index_js_vue_loader_options_CircleSpinner_vue_vue_type_style_index_0_id_9a543b64_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a);
  60457. /***/ }),
  60458. /***/ "./resources/js/components/CircleSpinner.vue?vue&type=template&id=9a543b64&scoped=true&":
  60459. /*!**********************************************************************************************!*\
  60460. !*** ./resources/js/components/CircleSpinner.vue?vue&type=template&id=9a543b64&scoped=true& ***!
  60461. \**********************************************************************************************/
  60462. /*! exports provided: render, staticRenderFns */
  60463. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60464. "use strict";
  60465. __webpack_require__.r(__webpack_exports__);
  60466. /* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_CircleSpinner_vue_vue_type_template_id_9a543b64_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib??vue-loader-options!./CircleSpinner.vue?vue&type=template&id=9a543b64&scoped=true& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/CircleSpinner.vue?vue&type=template&id=9a543b64&scoped=true&");
  60467. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_CircleSpinner_vue_vue_type_template_id_9a543b64_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"]; });
  60468. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_CircleSpinner_vue_vue_type_template_id_9a543b64_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; });
  60469. /***/ }),
  60470. /***/ "./resources/js/components/Credential.vue":
  60471. /*!************************************************!*\
  60472. !*** ./resources/js/components/Credential.vue ***!
  60473. \************************************************/
  60474. /*! exports provided: default */
  60475. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60476. "use strict";
  60477. __webpack_require__.r(__webpack_exports__);
  60478. /* harmony import */ var _Credential_vue_vue_type_template_id_58b8dcfc___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Credential.vue?vue&type=template&id=58b8dcfc& */ "./resources/js/components/Credential.vue?vue&type=template&id=58b8dcfc&");
  60479. /* harmony import */ var _Credential_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Credential.vue?vue&type=script&lang=js& */ "./resources/js/components/Credential.vue?vue&type=script&lang=js&");
  60480. /* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js");
  60481. /* normalize component */
  60482. var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(
  60483. _Credential_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
  60484. _Credential_vue_vue_type_template_id_58b8dcfc___WEBPACK_IMPORTED_MODULE_0__["render"],
  60485. _Credential_vue_vue_type_template_id_58b8dcfc___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
  60486. false,
  60487. null,
  60488. null,
  60489. null
  60490. )
  60491. /* hot reload */
  60492. if (false) { var api; }
  60493. component.options.__file = "resources/js/components/Credential.vue"
  60494. /* harmony default export */ __webpack_exports__["default"] = (component.exports);
  60495. /***/ }),
  60496. /***/ "./resources/js/components/Credential.vue?vue&type=script&lang=js&":
  60497. /*!*************************************************************************!*\
  60498. !*** ./resources/js/components/Credential.vue?vue&type=script&lang=js& ***!
  60499. \*************************************************************************/
  60500. /*! exports provided: default */
  60501. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60502. "use strict";
  60503. __webpack_require__.r(__webpack_exports__);
  60504. /* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Credential_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib??ref--4-0!../../../node_modules/vue-loader/lib??vue-loader-options!./Credential.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/Credential.vue?vue&type=script&lang=js&");
  60505. /* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Credential_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]);
  60506. /***/ }),
  60507. /***/ "./resources/js/components/Credential.vue?vue&type=template&id=58b8dcfc&":
  60508. /*!*******************************************************************************!*\
  60509. !*** ./resources/js/components/Credential.vue?vue&type=template&id=58b8dcfc& ***!
  60510. \*******************************************************************************/
  60511. /*! exports provided: render, staticRenderFns */
  60512. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60513. "use strict";
  60514. __webpack_require__.r(__webpack_exports__);
  60515. /* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Credential_vue_vue_type_template_id_58b8dcfc___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib??vue-loader-options!./Credential.vue?vue&type=template&id=58b8dcfc& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/Credential.vue?vue&type=template&id=58b8dcfc&");
  60516. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Credential_vue_vue_type_template_id_58b8dcfc___WEBPACK_IMPORTED_MODULE_0__["render"]; });
  60517. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Credential_vue_vue_type_template_id_58b8dcfc___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; });
  60518. /***/ }),
  60519. /***/ "./resources/js/components/CredentialFormModal.vue":
  60520. /*!*********************************************************!*\
  60521. !*** ./resources/js/components/CredentialFormModal.vue ***!
  60522. \*********************************************************/
  60523. /*! exports provided: default */
  60524. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60525. "use strict";
  60526. __webpack_require__.r(__webpack_exports__);
  60527. /* harmony import */ var _CredentialFormModal_vue_vue_type_template_id_3cdb3697___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CredentialFormModal.vue?vue&type=template&id=3cdb3697& */ "./resources/js/components/CredentialFormModal.vue?vue&type=template&id=3cdb3697&");
  60528. /* harmony import */ var _CredentialFormModal_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./CredentialFormModal.vue?vue&type=script&lang=js& */ "./resources/js/components/CredentialFormModal.vue?vue&type=script&lang=js&");
  60529. /* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js");
  60530. /* normalize component */
  60531. var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(
  60532. _CredentialFormModal_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
  60533. _CredentialFormModal_vue_vue_type_template_id_3cdb3697___WEBPACK_IMPORTED_MODULE_0__["render"],
  60534. _CredentialFormModal_vue_vue_type_template_id_3cdb3697___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
  60535. false,
  60536. null,
  60537. null,
  60538. null
  60539. )
  60540. /* hot reload */
  60541. if (false) { var api; }
  60542. component.options.__file = "resources/js/components/CredentialFormModal.vue"
  60543. /* harmony default export */ __webpack_exports__["default"] = (component.exports);
  60544. /***/ }),
  60545. /***/ "./resources/js/components/CredentialFormModal.vue?vue&type=script&lang=js&":
  60546. /*!**********************************************************************************!*\
  60547. !*** ./resources/js/components/CredentialFormModal.vue?vue&type=script&lang=js& ***!
  60548. \**********************************************************************************/
  60549. /*! exports provided: default */
  60550. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60551. "use strict";
  60552. __webpack_require__.r(__webpack_exports__);
  60553. /* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_CredentialFormModal_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib??ref--4-0!../../../node_modules/vue-loader/lib??vue-loader-options!./CredentialFormModal.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/CredentialFormModal.vue?vue&type=script&lang=js&");
  60554. /* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_CredentialFormModal_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]);
  60555. /***/ }),
  60556. /***/ "./resources/js/components/CredentialFormModal.vue?vue&type=template&id=3cdb3697&":
  60557. /*!****************************************************************************************!*\
  60558. !*** ./resources/js/components/CredentialFormModal.vue?vue&type=template&id=3cdb3697& ***!
  60559. \****************************************************************************************/
  60560. /*! exports provided: render, staticRenderFns */
  60561. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60562. "use strict";
  60563. __webpack_require__.r(__webpack_exports__);
  60564. /* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_CredentialFormModal_vue_vue_type_template_id_3cdb3697___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib??vue-loader-options!./CredentialFormModal.vue?vue&type=template&id=3cdb3697& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/CredentialFormModal.vue?vue&type=template&id=3cdb3697&");
  60565. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_CredentialFormModal_vue_vue_type_template_id_3cdb3697___WEBPACK_IMPORTED_MODULE_0__["render"]; });
  60566. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_CredentialFormModal_vue_vue_type_template_id_3cdb3697___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; });
  60567. /***/ }),
  60568. /***/ "./resources/js/components/CredentialList.vue":
  60569. /*!****************************************************!*\
  60570. !*** ./resources/js/components/CredentialList.vue ***!
  60571. \****************************************************/
  60572. /*! exports provided: default */
  60573. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60574. "use strict";
  60575. __webpack_require__.r(__webpack_exports__);
  60576. /* harmony import */ var _CredentialList_vue_vue_type_template_id_7264bb80___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CredentialList.vue?vue&type=template&id=7264bb80& */ "./resources/js/components/CredentialList.vue?vue&type=template&id=7264bb80&");
  60577. /* harmony import */ var _CredentialList_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./CredentialList.vue?vue&type=script&lang=js& */ "./resources/js/components/CredentialList.vue?vue&type=script&lang=js&");
  60578. /* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js");
  60579. /* normalize component */
  60580. var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(
  60581. _CredentialList_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
  60582. _CredentialList_vue_vue_type_template_id_7264bb80___WEBPACK_IMPORTED_MODULE_0__["render"],
  60583. _CredentialList_vue_vue_type_template_id_7264bb80___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
  60584. false,
  60585. null,
  60586. null,
  60587. null
  60588. )
  60589. /* hot reload */
  60590. if (false) { var api; }
  60591. component.options.__file = "resources/js/components/CredentialList.vue"
  60592. /* harmony default export */ __webpack_exports__["default"] = (component.exports);
  60593. /***/ }),
  60594. /***/ "./resources/js/components/CredentialList.vue?vue&type=script&lang=js&":
  60595. /*!*****************************************************************************!*\
  60596. !*** ./resources/js/components/CredentialList.vue?vue&type=script&lang=js& ***!
  60597. \*****************************************************************************/
  60598. /*! exports provided: default */
  60599. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60600. "use strict";
  60601. __webpack_require__.r(__webpack_exports__);
  60602. /* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_CredentialList_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib??ref--4-0!../../../node_modules/vue-loader/lib??vue-loader-options!./CredentialList.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/CredentialList.vue?vue&type=script&lang=js&");
  60603. /* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_CredentialList_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]);
  60604. /***/ }),
  60605. /***/ "./resources/js/components/CredentialList.vue?vue&type=template&id=7264bb80&":
  60606. /*!***********************************************************************************!*\
  60607. !*** ./resources/js/components/CredentialList.vue?vue&type=template&id=7264bb80& ***!
  60608. \***********************************************************************************/
  60609. /*! exports provided: render, staticRenderFns */
  60610. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60611. "use strict";
  60612. __webpack_require__.r(__webpack_exports__);
  60613. /* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_CredentialList_vue_vue_type_template_id_7264bb80___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib??vue-loader-options!./CredentialList.vue?vue&type=template&id=7264bb80& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/CredentialList.vue?vue&type=template&id=7264bb80&");
  60614. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_CredentialList_vue_vue_type_template_id_7264bb80___WEBPACK_IMPORTED_MODULE_0__["render"]; });
  60615. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_CredentialList_vue_vue_type_template_id_7264bb80___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; });
  60616. /***/ }),
  60617. /***/ "./resources/js/components/ErrorList.vue":
  60618. /*!***********************************************!*\
  60619. !*** ./resources/js/components/ErrorList.vue ***!
  60620. \***********************************************/
  60621. /*! exports provided: default */
  60622. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60623. "use strict";
  60624. __webpack_require__.r(__webpack_exports__);
  60625. /* harmony import */ var _ErrorList_vue_vue_type_template_id_48c089eb___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ErrorList.vue?vue&type=template&id=48c089eb& */ "./resources/js/components/ErrorList.vue?vue&type=template&id=48c089eb&");
  60626. /* harmony import */ var _ErrorList_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ErrorList.vue?vue&type=script&lang=js& */ "./resources/js/components/ErrorList.vue?vue&type=script&lang=js&");
  60627. /* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js");
  60628. /* normalize component */
  60629. var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(
  60630. _ErrorList_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
  60631. _ErrorList_vue_vue_type_template_id_48c089eb___WEBPACK_IMPORTED_MODULE_0__["render"],
  60632. _ErrorList_vue_vue_type_template_id_48c089eb___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
  60633. false,
  60634. null,
  60635. null,
  60636. null
  60637. )
  60638. /* hot reload */
  60639. if (false) { var api; }
  60640. component.options.__file = "resources/js/components/ErrorList.vue"
  60641. /* harmony default export */ __webpack_exports__["default"] = (component.exports);
  60642. /***/ }),
  60643. /***/ "./resources/js/components/ErrorList.vue?vue&type=script&lang=js&":
  60644. /*!************************************************************************!*\
  60645. !*** ./resources/js/components/ErrorList.vue?vue&type=script&lang=js& ***!
  60646. \************************************************************************/
  60647. /*! exports provided: default */
  60648. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60649. "use strict";
  60650. __webpack_require__.r(__webpack_exports__);
  60651. /* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_ErrorList_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib??ref--4-0!../../../node_modules/vue-loader/lib??vue-loader-options!./ErrorList.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/ErrorList.vue?vue&type=script&lang=js&");
  60652. /* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_ErrorList_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]);
  60653. /***/ }),
  60654. /***/ "./resources/js/components/ErrorList.vue?vue&type=template&id=48c089eb&":
  60655. /*!******************************************************************************!*\
  60656. !*** ./resources/js/components/ErrorList.vue?vue&type=template&id=48c089eb& ***!
  60657. \******************************************************************************/
  60658. /*! exports provided: render, staticRenderFns */
  60659. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60660. "use strict";
  60661. __webpack_require__.r(__webpack_exports__);
  60662. /* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_ErrorList_vue_vue_type_template_id_48c089eb___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib??vue-loader-options!./ErrorList.vue?vue&type=template&id=48c089eb& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/ErrorList.vue?vue&type=template&id=48c089eb&");
  60663. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_ErrorList_vue_vue_type_template_id_48c089eb___WEBPACK_IMPORTED_MODULE_0__["render"]; });
  60664. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_ErrorList_vue_vue_type_template_id_48c089eb___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; });
  60665. /***/ }),
  60666. /***/ "./resources/js/components/Modal.vue":
  60667. /*!*******************************************!*\
  60668. !*** ./resources/js/components/Modal.vue ***!
  60669. \*******************************************/
  60670. /*! exports provided: default */
  60671. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60672. "use strict";
  60673. __webpack_require__.r(__webpack_exports__);
  60674. /* harmony import */ var _Modal_vue_vue_type_template_id_53ab54d2___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Modal.vue?vue&type=template&id=53ab54d2& */ "./resources/js/components/Modal.vue?vue&type=template&id=53ab54d2&");
  60675. /* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js");
  60676. var script = {}
  60677. /* normalize component */
  60678. var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_1__["default"])(
  60679. script,
  60680. _Modal_vue_vue_type_template_id_53ab54d2___WEBPACK_IMPORTED_MODULE_0__["render"],
  60681. _Modal_vue_vue_type_template_id_53ab54d2___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
  60682. false,
  60683. null,
  60684. null,
  60685. null
  60686. )
  60687. /* hot reload */
  60688. if (false) { var api; }
  60689. component.options.__file = "resources/js/components/Modal.vue"
  60690. /* harmony default export */ __webpack_exports__["default"] = (component.exports);
  60691. /***/ }),
  60692. /***/ "./resources/js/components/Modal.vue?vue&type=template&id=53ab54d2&":
  60693. /*!**************************************************************************!*\
  60694. !*** ./resources/js/components/Modal.vue?vue&type=template&id=53ab54d2& ***!
  60695. \**************************************************************************/
  60696. /*! exports provided: render, staticRenderFns */
  60697. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60698. "use strict";
  60699. __webpack_require__.r(__webpack_exports__);
  60700. /* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Modal_vue_vue_type_template_id_53ab54d2___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib??vue-loader-options!./Modal.vue?vue&type=template&id=53ab54d2& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/Modal.vue?vue&type=template&id=53ab54d2&");
  60701. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Modal_vue_vue_type_template_id_53ab54d2___WEBPACK_IMPORTED_MODULE_0__["render"]; });
  60702. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Modal_vue_vue_type_template_id_53ab54d2___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; });
  60703. /***/ }),
  60704. /***/ "./resources/js/components/NoteFormModal.vue":
  60705. /*!***************************************************!*\
  60706. !*** ./resources/js/components/NoteFormModal.vue ***!
  60707. \***************************************************/
  60708. /*! exports provided: default */
  60709. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60710. "use strict";
  60711. __webpack_require__.r(__webpack_exports__);
  60712. /* harmony import */ var _NoteFormModal_vue_vue_type_template_id_1391a09c___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./NoteFormModal.vue?vue&type=template&id=1391a09c& */ "./resources/js/components/NoteFormModal.vue?vue&type=template&id=1391a09c&");
  60713. /* harmony import */ var _NoteFormModal_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./NoteFormModal.vue?vue&type=script&lang=js& */ "./resources/js/components/NoteFormModal.vue?vue&type=script&lang=js&");
  60714. /* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js");
  60715. /* normalize component */
  60716. var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(
  60717. _NoteFormModal_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
  60718. _NoteFormModal_vue_vue_type_template_id_1391a09c___WEBPACK_IMPORTED_MODULE_0__["render"],
  60719. _NoteFormModal_vue_vue_type_template_id_1391a09c___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
  60720. false,
  60721. null,
  60722. null,
  60723. null
  60724. )
  60725. /* hot reload */
  60726. if (false) { var api; }
  60727. component.options.__file = "resources/js/components/NoteFormModal.vue"
  60728. /* harmony default export */ __webpack_exports__["default"] = (component.exports);
  60729. /***/ }),
  60730. /***/ "./resources/js/components/NoteFormModal.vue?vue&type=script&lang=js&":
  60731. /*!****************************************************************************!*\
  60732. !*** ./resources/js/components/NoteFormModal.vue?vue&type=script&lang=js& ***!
  60733. \****************************************************************************/
  60734. /*! exports provided: default */
  60735. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60736. "use strict";
  60737. __webpack_require__.r(__webpack_exports__);
  60738. /* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_NoteFormModal_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib??ref--4-0!../../../node_modules/vue-loader/lib??vue-loader-options!./NoteFormModal.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/NoteFormModal.vue?vue&type=script&lang=js&");
  60739. /* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_NoteFormModal_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]);
  60740. /***/ }),
  60741. /***/ "./resources/js/components/NoteFormModal.vue?vue&type=template&id=1391a09c&":
  60742. /*!**********************************************************************************!*\
  60743. !*** ./resources/js/components/NoteFormModal.vue?vue&type=template&id=1391a09c& ***!
  60744. \**********************************************************************************/
  60745. /*! exports provided: render, staticRenderFns */
  60746. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60747. "use strict";
  60748. __webpack_require__.r(__webpack_exports__);
  60749. /* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_NoteFormModal_vue_vue_type_template_id_1391a09c___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib??vue-loader-options!./NoteFormModal.vue?vue&type=template&id=1391a09c& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/NoteFormModal.vue?vue&type=template&id=1391a09c&");
  60750. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_NoteFormModal_vue_vue_type_template_id_1391a09c___WEBPACK_IMPORTED_MODULE_0__["render"]; });
  60751. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_NoteFormModal_vue_vue_type_template_id_1391a09c___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; });
  60752. /***/ }),
  60753. /***/ "./resources/js/components/Notes.vue":
  60754. /*!*******************************************!*\
  60755. !*** ./resources/js/components/Notes.vue ***!
  60756. \*******************************************/
  60757. /*! exports provided: default */
  60758. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60759. "use strict";
  60760. __webpack_require__.r(__webpack_exports__);
  60761. /* harmony import */ var _Notes_vue_vue_type_template_id_3d897ee6___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Notes.vue?vue&type=template&id=3d897ee6& */ "./resources/js/components/Notes.vue?vue&type=template&id=3d897ee6&");
  60762. /* harmony import */ var _Notes_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Notes.vue?vue&type=script&lang=js& */ "./resources/js/components/Notes.vue?vue&type=script&lang=js&");
  60763. /* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js");
  60764. /* normalize component */
  60765. var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(
  60766. _Notes_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
  60767. _Notes_vue_vue_type_template_id_3d897ee6___WEBPACK_IMPORTED_MODULE_0__["render"],
  60768. _Notes_vue_vue_type_template_id_3d897ee6___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
  60769. false,
  60770. null,
  60771. null,
  60772. null
  60773. )
  60774. /* hot reload */
  60775. if (false) { var api; }
  60776. component.options.__file = "resources/js/components/Notes.vue"
  60777. /* harmony default export */ __webpack_exports__["default"] = (component.exports);
  60778. /***/ }),
  60779. /***/ "./resources/js/components/Notes.vue?vue&type=script&lang=js&":
  60780. /*!********************************************************************!*\
  60781. !*** ./resources/js/components/Notes.vue?vue&type=script&lang=js& ***!
  60782. \********************************************************************/
  60783. /*! exports provided: default */
  60784. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60785. "use strict";
  60786. __webpack_require__.r(__webpack_exports__);
  60787. /* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Notes_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib??ref--4-0!../../../node_modules/vue-loader/lib??vue-loader-options!./Notes.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/Notes.vue?vue&type=script&lang=js&");
  60788. /* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Notes_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]);
  60789. /***/ }),
  60790. /***/ "./resources/js/components/Notes.vue?vue&type=template&id=3d897ee6&":
  60791. /*!**************************************************************************!*\
  60792. !*** ./resources/js/components/Notes.vue?vue&type=template&id=3d897ee6& ***!
  60793. \**************************************************************************/
  60794. /*! exports provided: render, staticRenderFns */
  60795. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60796. "use strict";
  60797. __webpack_require__.r(__webpack_exports__);
  60798. /* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Notes_vue_vue_type_template_id_3d897ee6___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib??vue-loader-options!./Notes.vue?vue&type=template&id=3d897ee6& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/Notes.vue?vue&type=template&id=3d897ee6&");
  60799. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Notes_vue_vue_type_template_id_3d897ee6___WEBPACK_IMPORTED_MODULE_0__["render"]; });
  60800. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Notes_vue_vue_type_template_id_3d897ee6___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; });
  60801. /***/ }),
  60802. /***/ "./resources/js/components/WoInfoEditModal.vue":
  60803. /*!*****************************************************!*\
  60804. !*** ./resources/js/components/WoInfoEditModal.vue ***!
  60805. \*****************************************************/
  60806. /*! exports provided: default */
  60807. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60808. "use strict";
  60809. __webpack_require__.r(__webpack_exports__);
  60810. /* harmony import */ var _WoInfoEditModal_vue_vue_type_template_id_352dd7a2___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./WoInfoEditModal.vue?vue&type=template&id=352dd7a2& */ "./resources/js/components/WoInfoEditModal.vue?vue&type=template&id=352dd7a2&");
  60811. /* harmony import */ var _WoInfoEditModal_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./WoInfoEditModal.vue?vue&type=script&lang=js& */ "./resources/js/components/WoInfoEditModal.vue?vue&type=script&lang=js&");
  60812. /* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js");
  60813. /* normalize component */
  60814. var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(
  60815. _WoInfoEditModal_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
  60816. _WoInfoEditModal_vue_vue_type_template_id_352dd7a2___WEBPACK_IMPORTED_MODULE_0__["render"],
  60817. _WoInfoEditModal_vue_vue_type_template_id_352dd7a2___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
  60818. false,
  60819. null,
  60820. null,
  60821. null
  60822. )
  60823. /* hot reload */
  60824. if (false) { var api; }
  60825. component.options.__file = "resources/js/components/WoInfoEditModal.vue"
  60826. /* harmony default export */ __webpack_exports__["default"] = (component.exports);
  60827. /***/ }),
  60828. /***/ "./resources/js/components/WoInfoEditModal.vue?vue&type=script&lang=js&":
  60829. /*!******************************************************************************!*\
  60830. !*** ./resources/js/components/WoInfoEditModal.vue?vue&type=script&lang=js& ***!
  60831. \******************************************************************************/
  60832. /*! exports provided: default */
  60833. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60834. "use strict";
  60835. __webpack_require__.r(__webpack_exports__);
  60836. /* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_WoInfoEditModal_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib??ref--4-0!../../../node_modules/vue-loader/lib??vue-loader-options!./WoInfoEditModal.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/WoInfoEditModal.vue?vue&type=script&lang=js&");
  60837. /* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_WoInfoEditModal_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]);
  60838. /***/ }),
  60839. /***/ "./resources/js/components/WoInfoEditModal.vue?vue&type=template&id=352dd7a2&":
  60840. /*!************************************************************************************!*\
  60841. !*** ./resources/js/components/WoInfoEditModal.vue?vue&type=template&id=352dd7a2& ***!
  60842. \************************************************************************************/
  60843. /*! exports provided: render, staticRenderFns */
  60844. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60845. "use strict";
  60846. __webpack_require__.r(__webpack_exports__);
  60847. /* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_WoInfoEditModal_vue_vue_type_template_id_352dd7a2___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib??vue-loader-options!./WoInfoEditModal.vue?vue&type=template&id=352dd7a2& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/WoInfoEditModal.vue?vue&type=template&id=352dd7a2&");
  60848. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_WoInfoEditModal_vue_vue_type_template_id_352dd7a2___WEBPACK_IMPORTED_MODULE_0__["render"]; });
  60849. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_WoInfoEditModal_vue_vue_type_template_id_352dd7a2___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; });
  60850. /***/ }),
  60851. /***/ "./resources/js/components/WorkOrderInfo.vue":
  60852. /*!***************************************************!*\
  60853. !*** ./resources/js/components/WorkOrderInfo.vue ***!
  60854. \***************************************************/
  60855. /*! exports provided: default */
  60856. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60857. "use strict";
  60858. __webpack_require__.r(__webpack_exports__);
  60859. /* harmony import */ var _WorkOrderInfo_vue_vue_type_template_id_50116330___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./WorkOrderInfo.vue?vue&type=template&id=50116330& */ "./resources/js/components/WorkOrderInfo.vue?vue&type=template&id=50116330&");
  60860. /* harmony import */ var _WorkOrderInfo_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./WorkOrderInfo.vue?vue&type=script&lang=js& */ "./resources/js/components/WorkOrderInfo.vue?vue&type=script&lang=js&");
  60861. /* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js");
  60862. /* normalize component */
  60863. var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(
  60864. _WorkOrderInfo_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
  60865. _WorkOrderInfo_vue_vue_type_template_id_50116330___WEBPACK_IMPORTED_MODULE_0__["render"],
  60866. _WorkOrderInfo_vue_vue_type_template_id_50116330___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
  60867. false,
  60868. null,
  60869. null,
  60870. null
  60871. )
  60872. /* hot reload */
  60873. if (false) { var api; }
  60874. component.options.__file = "resources/js/components/WorkOrderInfo.vue"
  60875. /* harmony default export */ __webpack_exports__["default"] = (component.exports);
  60876. /***/ }),
  60877. /***/ "./resources/js/components/WorkOrderInfo.vue?vue&type=script&lang=js&":
  60878. /*!****************************************************************************!*\
  60879. !*** ./resources/js/components/WorkOrderInfo.vue?vue&type=script&lang=js& ***!
  60880. \****************************************************************************/
  60881. /*! exports provided: default */
  60882. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60883. "use strict";
  60884. __webpack_require__.r(__webpack_exports__);
  60885. /* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_WorkOrderInfo_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib??ref--4-0!../../../node_modules/vue-loader/lib??vue-loader-options!./WorkOrderInfo.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/WorkOrderInfo.vue?vue&type=script&lang=js&");
  60886. /* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_WorkOrderInfo_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]);
  60887. /***/ }),
  60888. /***/ "./resources/js/components/WorkOrderInfo.vue?vue&type=template&id=50116330&":
  60889. /*!**********************************************************************************!*\
  60890. !*** ./resources/js/components/WorkOrderInfo.vue?vue&type=template&id=50116330& ***!
  60891. \**********************************************************************************/
  60892. /*! exports provided: render, staticRenderFns */
  60893. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60894. "use strict";
  60895. __webpack_require__.r(__webpack_exports__);
  60896. /* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_WorkOrderInfo_vue_vue_type_template_id_50116330___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib??vue-loader-options!./WorkOrderInfo.vue?vue&type=template&id=50116330& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/WorkOrderInfo.vue?vue&type=template&id=50116330&");
  60897. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_WorkOrderInfo_vue_vue_type_template_id_50116330___WEBPACK_IMPORTED_MODULE_0__["render"]; });
  60898. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_WorkOrderInfo_vue_vue_type_template_id_50116330___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; });
  60899. /***/ }),
  60900. /***/ "./resources/js/mixins/dateMixin.js":
  60901. /*!******************************************!*\
  60902. !*** ./resources/js/mixins/dateMixin.js ***!
  60903. \******************************************/
  60904. /*! exports provided: default */
  60905. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60906. "use strict";
  60907. __webpack_require__.r(__webpack_exports__);
  60908. /* harmony default export */ __webpack_exports__["default"] = ({
  60909. methods: {
  60910. treatAsUTC: function treatAsUTC(date) {
  60911. var result = new Date(date);
  60912. result.setMinutes(result.getMinutes() - result.getTimezoneOffset());
  60913. return result;
  60914. },
  60915. daysSinceToday: function daysSinceToday(date) {
  60916. var currentDate = new Date();
  60917. var millisecondsPerDay = 24 * 60 * 60 * 1000;
  60918. return (this.treatAsUTC(currentDate) - this.treatAsUTC(date)) / millisecondsPerDay;
  60919. },
  60920. getHRDate: function getHRDate(dateString) {
  60921. var date = new Date(dateString);
  60922. return date.toLocaleString('default', {
  60923. month: 'short',
  60924. day: 'numeric',
  60925. year: 'numeric',
  60926. hour: 'numeric',
  60927. minute: 'numeric'
  60928. });
  60929. },
  60930. isZero: function isZero(dateString) {
  60931. return dateString === '0000-00-00 00:00:00';
  60932. }
  60933. }
  60934. });
  60935. /***/ }),
  60936. /***/ "./resources/js/notify.min.js":
  60937. /*!************************************!*\
  60938. !*** ./resources/js/notify.min.js ***!
  60939. \************************************/
  60940. /*! no static exports found */
  60941. /***/ (function(module, exports, __webpack_require__) {
  60942. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  60943. (function (e) {
  60944. true ? !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (e),
  60945. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  60946. (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
  60947. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : undefined;
  60948. })(function (e) {
  60949. function A(t, n, i) {
  60950. typeof i == "string" && (i = {
  60951. className: i
  60952. }), this.options = E(w, e.isPlainObject(i) ? i : {}), this.loadHTML(), this.wrapper = e(h.html), this.options.clickToHide && this.wrapper.addClass(r + "-hidable"), this.wrapper.data(r, this), this.arrow = this.wrapper.find("." + r + "-arrow"), this.container = this.wrapper.find("." + r + "-container"), this.container.append(this.userContainer), t && t.length && (this.elementType = t.attr("type"), this.originalElement = t, this.elem = N(t), this.elem.data(r, this), this.elem.before(this.wrapper)), this.container.hide(), this.run(n);
  60953. }
  60954. var t = [].indexOf || function (e) {
  60955. for (var t = 0, n = this.length; t < n; t++) {
  60956. if (t in this && this[t] === e) return t;
  60957. }
  60958. return -1;
  60959. },
  60960. n = "notify",
  60961. r = n + "js",
  60962. i = n + "!blank",
  60963. s = {
  60964. t: "top",
  60965. m: "middle",
  60966. b: "bottom",
  60967. l: "left",
  60968. c: "center",
  60969. r: "right"
  60970. },
  60971. o = ["l", "c", "r"],
  60972. u = ["t", "m", "b"],
  60973. a = ["t", "b", "l", "r"],
  60974. f = {
  60975. t: "b",
  60976. m: null,
  60977. b: "t",
  60978. l: "r",
  60979. c: null,
  60980. r: "l"
  60981. },
  60982. l = function l(t) {
  60983. var n;
  60984. return n = [], e.each(t.split(/\W+/), function (e, t) {
  60985. var r;
  60986. r = t.toLowerCase().charAt(0);
  60987. if (s[r]) return n.push(r);
  60988. }), n;
  60989. },
  60990. c = {},
  60991. h = {
  60992. name: "core",
  60993. html: '<div class="' + r + '-wrapper">\n <div class="' + r + '-arrow"></div>\n <div class="' + r + '-container"></div>\n</div>',
  60994. css: "." + r + "-corner {\n position: fixed;\n margin: 5px;\n z-index: 1050;\n}\n\n." + r + "-corner ." + r + "-wrapper,\n." + r + "-corner ." + r + "-container {\n position: relative;\n display: block;\n height: inherit;\n width: inherit;\n margin: 3px;\n}\n\n." + r + "-wrapper {\n z-index: 1;\n position: absolute;\n display: inline-block;\n height: 0;\n width: 0;\n}\n\n." + r + "-container {\n display: none;\n z-index: 1;\n position: absolute;\n}\n\n." + r + "-hidable {\n cursor: pointer;\n}\n\n[data-notify-text],[data-notify-html] {\n position: relative;\n}\n\n." + r + "-arrow {\n position: absolute;\n z-index: 2;\n width: 0;\n height: 0;\n}"
  60995. },
  60996. p = {
  60997. "border-radius": ["-webkit-", "-moz-"]
  60998. },
  60999. d = function d(e) {
  61000. return c[e];
  61001. },
  61002. v = function v(e) {
  61003. if (!e) throw "Missing Style name";
  61004. c[e] && delete c[e];
  61005. },
  61006. m = function m(t, i) {
  61007. if (!t) throw "Missing Style name";
  61008. if (!i) throw "Missing Style definition";
  61009. if (!i.html) throw "Missing Style HTML";
  61010. var s = c[t];
  61011. s && s.cssElem && (window.console && console.warn(n + ": overwriting style '" + t + "'"), c[t].cssElem.remove()), i.name = t, c[t] = i;
  61012. var o = "";
  61013. i.classes && e.each(i.classes, function (t, n) {
  61014. return o += "." + r + "-" + i.name + "-" + t + " {\n", e.each(n, function (t, n) {
  61015. return p[t] && e.each(p[t], function (e, r) {
  61016. return o += " " + r + t + ": " + n + ";\n";
  61017. }), o += " " + t + ": " + n + ";\n";
  61018. }), o += "}\n";
  61019. }), i.css && (o += "/* styles for " + i.name + " */\n" + i.css), o && (i.cssElem = g(o), i.cssElem.attr("id", "notify-" + i.name));
  61020. var u = {},
  61021. a = e(i.html);
  61022. y("html", a, u), y("text", a, u), i.fields = u;
  61023. },
  61024. g = function g(t) {
  61025. var n, r, i;
  61026. r = x("style"), r.attr("type", "text/css"), e("head").append(r);
  61027. try {
  61028. r.html(t);
  61029. } catch (s) {
  61030. r[0].styleSheet.cssText = t;
  61031. }
  61032. return r;
  61033. },
  61034. y = function y(t, n, r) {
  61035. var s;
  61036. return t !== "html" && (t = "text"), s = "data-notify-" + t, b(n, "[" + s + "]").each(function () {
  61037. var n;
  61038. n = e(this).attr(s), n || (n = i), r[n] = t;
  61039. });
  61040. },
  61041. b = function b(e, t) {
  61042. return e.is(t) ? e : e.find(t);
  61043. },
  61044. w = {
  61045. clickToHide: !0,
  61046. autoHide: !0,
  61047. autoHideDelay: 5e3,
  61048. arrowShow: !0,
  61049. arrowSize: 5,
  61050. breakNewLines: !0,
  61051. elementPosition: "bottom",
  61052. globalPosition: "top right",
  61053. style: "bootstrap",
  61054. className: "error",
  61055. showAnimation: "slideDown",
  61056. showDuration: 400,
  61057. hideAnimation: "slideUp",
  61058. hideDuration: 200,
  61059. gap: 5
  61060. },
  61061. E = function E(t, n) {
  61062. var r;
  61063. return r = function r() {}, r.prototype = t, e.extend(!0, new r(), n);
  61064. },
  61065. S = function S(t) {
  61066. return e.extend(w, t);
  61067. },
  61068. x = function x(t) {
  61069. return e("<" + t + "></" + t + ">");
  61070. },
  61071. T = {},
  61072. N = function N(t) {
  61073. var n;
  61074. return t.is("[type=radio]") && (n = t.parents("form:first").find("[type=radio]").filter(function (n, r) {
  61075. return e(r).attr("name") === t.attr("name");
  61076. }), t = n.first()), t;
  61077. },
  61078. C = function C(e, t, n) {
  61079. var r, i;
  61080. if (typeof n == "string") n = parseInt(n, 10);else if (typeof n != "number") return;
  61081. if (isNaN(n)) return;
  61082. return r = s[f[t.charAt(0)]], i = t, e[r] !== undefined && (t = s[r.charAt(0)], n = -n), e[t] === undefined ? e[t] = n : e[t] += n, null;
  61083. },
  61084. k = function k(e, t, n) {
  61085. if (e === "l" || e === "t") return 0;
  61086. if (e === "c" || e === "m") return n / 2 - t / 2;
  61087. if (e === "r" || e === "b") return n - t;
  61088. throw "Invalid alignment";
  61089. },
  61090. L = function L(e) {
  61091. return L.e = L.e || x("div"), L.e.text(e).html();
  61092. };
  61093. A.prototype.loadHTML = function () {
  61094. var t;
  61095. t = this.getStyle(), this.userContainer = e(t.html), this.userFields = t.fields;
  61096. }, A.prototype.show = function (e, t) {
  61097. var n, r, i, s, o;
  61098. r = function (n) {
  61099. return function () {
  61100. !e && !n.elem && n.destroy();
  61101. if (t) return t();
  61102. };
  61103. }(this), o = this.container.parent().parents(":hidden").length > 0, i = this.container.add(this.arrow), n = [];
  61104. if (o && e) s = "show";else if (o && !e) s = "hide";else if (!o && e) s = this.options.showAnimation, n.push(this.options.showDuration);else {
  61105. if (!!o || !!e) return r();
  61106. s = this.options.hideAnimation, n.push(this.options.hideDuration);
  61107. }
  61108. return n.push(r), i[s].apply(i, n);
  61109. }, A.prototype.setGlobalPosition = function () {
  61110. var t = this.getPosition(),
  61111. n = t[0],
  61112. i = t[1],
  61113. o = s[n],
  61114. u = s[i],
  61115. a = n + "|" + i,
  61116. f = T[a];
  61117. if (!f || !document.body.contains(f[0])) {
  61118. f = T[a] = x("div");
  61119. var l = {};
  61120. l[o] = 0, u === "middle" ? l.top = "45%" : u === "center" ? l.left = "45%" : l[u] = 0, f.css(l).addClass(r + "-corner"), e("body").append(f);
  61121. }
  61122. return f.prepend(this.wrapper);
  61123. }, A.prototype.setElementPosition = function () {
  61124. var n, r, i, l, c, h, p, d, v, m, g, y, b, w, E, S, x, T, N, L, A, O, M, _, D, P, H, B, j;
  61125. H = this.getPosition(), _ = H[0], O = H[1], M = H[2], g = this.elem.position(), d = this.elem.outerHeight(), y = this.elem.outerWidth(), v = this.elem.innerHeight(), m = this.elem.innerWidth(), j = this.wrapper.position(), c = this.container.height(), h = this.container.width(), T = s[_], L = f[_], A = s[L], p = {}, p[A] = _ === "b" ? d : _ === "r" ? y : 0, C(p, "top", g.top - j.top), C(p, "left", g.left - j.left), B = ["top", "left"];
  61126. for (w = 0, S = B.length; w < S; w++) {
  61127. D = B[w], N = parseInt(this.elem.css("margin-" + D), 10), N && C(p, D, N);
  61128. }
  61129. b = Math.max(0, this.options.gap - (this.options.arrowShow ? i : 0)), C(p, A, b);
  61130. if (!this.options.arrowShow) this.arrow.hide();else {
  61131. i = this.options.arrowSize, r = e.extend({}, p), n = this.userContainer.css("border-color") || this.userContainer.css("border-top-color") || this.userContainer.css("background-color") || "white";
  61132. for (E = 0, x = a.length; E < x; E++) {
  61133. D = a[E], P = s[D];
  61134. if (D === L) continue;
  61135. l = P === T ? n : "transparent", r["border-" + P] = i + "px solid " + l;
  61136. }
  61137. C(p, s[L], i), t.call(a, O) >= 0 && C(r, s[O], i * 2);
  61138. }
  61139. t.call(u, _) >= 0 ? (C(p, "left", k(O, h, y)), r && C(r, "left", k(O, i, m))) : t.call(o, _) >= 0 && (C(p, "top", k(O, c, d)), r && C(r, "top", k(O, i, v))), this.container.is(":visible") && (p.display = "block"), this.container.removeAttr("style").css(p);
  61140. if (r) return this.arrow.removeAttr("style").css(r);
  61141. }, A.prototype.getPosition = function () {
  61142. var e, n, r, i, s, f, c, h;
  61143. h = this.options.position || (this.elem ? this.options.elementPosition : this.options.globalPosition), e = l(h), e.length === 0 && (e[0] = "b");
  61144. if (n = e[0], t.call(a, n) < 0) throw "Must be one of [" + a + "]";
  61145. if (e.length === 1 || (r = e[0], t.call(u, r) >= 0) && (i = e[1], t.call(o, i) < 0) || (s = e[0], t.call(o, s) >= 0) && (f = e[1], t.call(u, f) < 0)) e[1] = (c = e[0], t.call(o, c) >= 0) ? "m" : "l";
  61146. return e.length === 2 && (e[2] = e[1]), e;
  61147. }, A.prototype.getStyle = function (e) {
  61148. var t;
  61149. e || (e = this.options.style), e || (e = "default"), t = c[e];
  61150. if (!t) throw "Missing style: " + e;
  61151. return t;
  61152. }, A.prototype.updateClasses = function () {
  61153. var t, n;
  61154. return t = ["base"], e.isArray(this.options.className) ? t = t.concat(this.options.className) : this.options.className && t.push(this.options.className), n = this.getStyle(), t = e.map(t, function (e) {
  61155. return r + "-" + n.name + "-" + e;
  61156. }).join(" "), this.userContainer.attr("class", t);
  61157. }, A.prototype.run = function (t, n) {
  61158. var r, s, o, u, a;
  61159. e.isPlainObject(n) ? e.extend(this.options, n) : e.type(n) === "string" && (this.options.className = n);
  61160. if (this.container && !t) {
  61161. this.show(!1);
  61162. return;
  61163. }
  61164. if (!this.container && !t) return;
  61165. s = {}, e.isPlainObject(t) ? s = t : s[i] = t;
  61166. for (o in s) {
  61167. r = s[o], u = this.userFields[o];
  61168. if (!u) continue;
  61169. u === "text" && (r = L(r), this.options.breakNewLines && (r = r.replace(/\n/g, "<br/>"))), a = o === i ? "" : "=" + o, b(this.userContainer, "[data-notify-" + u + a + "]").html(r);
  61170. }
  61171. this.updateClasses(), this.elem ? this.setElementPosition() : this.setGlobalPosition(), this.show(!0), this.options.autoHide && (clearTimeout(this.autohideTimer), this.autohideTimer = setTimeout(this.show.bind(this, !1), this.options.autoHideDelay));
  61172. }, A.prototype.destroy = function () {
  61173. this.wrapper.data(r, null), this.wrapper.remove();
  61174. }, e[n] = function (t, r, i) {
  61175. return t && t.nodeName || t.jquery ? e(t)[n](r, i) : (i = r, r = t, new A(null, r, i)), t;
  61176. }, e.fn[n] = function (t, n) {
  61177. return e(this).each(function () {
  61178. var i = N(e(this)).data(r);
  61179. i && i.destroy();
  61180. var s = new A(e(this), t, n);
  61181. }), this;
  61182. }, e.extend(e[n], {
  61183. defaults: S,
  61184. addStyle: m,
  61185. removeStyle: v,
  61186. pluginOptions: w,
  61187. getStyle: d,
  61188. insertCSS: g
  61189. }), m("bootstrap", {
  61190. html: "<div>\n<span data-notify-text></span>\n</div>",
  61191. classes: {
  61192. base: {
  61193. "font-weight": "bold",
  61194. padding: "8px 15px 8px 14px",
  61195. "text-shadow": "0 1px 0 rgba(255, 255, 255, 0.5)",
  61196. "background-color": "#fcf8e3",
  61197. border: "1px solid #fbeed5",
  61198. "border-radius": "4px",
  61199. "white-space": "nowrap",
  61200. "padding-left": "25px",
  61201. "background-repeat": "no-repeat",
  61202. "background-position": "3px 7px"
  61203. },
  61204. error: {
  61205. color: "#B94A48",
  61206. "background-color": "#F2DEDE",
  61207. "border-color": "#EED3D7",
  61208. "background-image": "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAtRJREFUeNqkVc1u00AQHq+dOD+0poIQfkIjalW0SEGqRMuRnHos3DjwAH0ArlyQeANOOSMeAA5VjyBxKBQhgSpVUKKQNGloFdw4cWw2jtfMOna6JOUArDTazXi/b3dm55socPqQhFka++aHBsI8GsopRJERNFlY88FCEk9Yiwf8RhgRyaHFQpPHCDmZG5oX2ui2yilkcTT1AcDsbYC1NMAyOi7zTX2Agx7A9luAl88BauiiQ/cJaZQfIpAlngDcvZZMrl8vFPK5+XktrWlx3/ehZ5r9+t6e+WVnp1pxnNIjgBe4/6dAysQc8dsmHwPcW9C0h3fW1hans1ltwJhy0GxK7XZbUlMp5Ww2eyan6+ft/f2FAqXGK4CvQk5HueFz7D6GOZtIrK+srupdx1GRBBqNBtzc2AiMr7nPplRdKhb1q6q6zjFhrklEFOUutoQ50xcX86ZlqaZpQrfbBdu2R6/G19zX6XSgh6RX5ubyHCM8nqSID6ICrGiZjGYYxojEsiw4PDwMSL5VKsC8Yf4VRYFzMzMaxwjlJSlCyAQ9l0CW44PBADzXhe7xMdi9HtTrdYjFYkDQL0cn4Xdq2/EAE+InCnvADTf2eah4Sx9vExQjkqXT6aAERICMewd/UAp/IeYANM2joxt+q5VI+ieq2i0Wg3l6DNzHwTERPgo1ko7XBXj3vdlsT2F+UuhIhYkp7u7CarkcrFOCtR3H5JiwbAIeImjT/YQKKBtGjRFCU5IUgFRe7fF4cCNVIPMYo3VKqxwjyNAXNepuopyqnld602qVsfRpEkkz+GFL1wPj6ySXBpJtWVa5xlhpcyhBNwpZHmtX8AGgfIExo0ZpzkWVTBGiXCSEaHh62/PoR0p/vHaczxXGnj4bSo+G78lELU80h1uogBwWLf5YlsPmgDEd4M236xjm+8nm4IuE/9u+/PH2JXZfbwz4zw1WbO+SQPpXfwG/BBgAhCNZiSb/pOQAAAAASUVORK5CYII=)"
  61209. },
  61210. success: {
  61211. color: "#468847",
  61212. "background-color": "#DFF0D8",
  61213. "border-color": "#D6E9C6",
  61214. "background-image": "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAutJREFUeNq0lctPE0Ecx38zu/RFS1EryqtgJFA08YCiMZIAQQ4eRG8eDGdPJiYeTIwHTfwPiAcvXIwXLwoXPaDxkWgQ6islKlJLSQWLUraPLTv7Gme32zoF9KSTfLO7v53vZ3d/M7/fIth+IO6INt2jjoA7bjHCJoAlzCRw59YwHYjBnfMPqAKWQYKjGkfCJqAF0xwZjipQtA3MxeSG87VhOOYegVrUCy7UZM9S6TLIdAamySTclZdYhFhRHloGYg7mgZv1Zzztvgud7V1tbQ2twYA34LJmF4p5dXF1KTufnE+SxeJtuCZNsLDCQU0+RyKTF27Unw101l8e6hns3u0PBalORVVVkcaEKBJDgV3+cGM4tKKmI+ohlIGnygKX00rSBfszz/n2uXv81wd6+rt1orsZCHRdr1Imk2F2Kob3hutSxW8thsd8AXNaln9D7CTfA6O+0UgkMuwVvEFFUbbAcrkcTA8+AtOk8E6KiQiDmMFSDqZItAzEVQviRkdDdaFgPp8HSZKAEAL5Qh7Sq2lIJBJwv2scUqkUnKoZgNhcDKhKg5aH+1IkcouCAdFGAQsuWZYhOjwFHQ96oagWgRoUov1T9kRBEODAwxM2QtEUl+Wp+Ln9VRo6BcMw4ErHRYjH4/B26AlQoQQTRdHWwcd9AH57+UAXddvDD37DmrBBV34WfqiXPl61g+vr6xA9zsGeM9gOdsNXkgpEtTwVvwOklXLKm6+/p5ezwk4B+j6droBs2CsGa/gNs6RIxazl4Tc25mpTgw/apPR1LYlNRFAzgsOxkyXYLIM1V8NMwyAkJSctD1eGVKiq5wWjSPdjmeTkiKvVW4f2YPHWl3GAVq6ymcyCTgovM3FzyRiDe2TaKcEKsLpJvNHjZgPNqEtyi6mZIm4SRFyLMUsONSSdkPeFtY1n0mczoY3BHTLhwPRy9/lzcziCw9ACI+yql0VLzcGAZbYSM5CCSZg1/9oc/nn7+i8N9p/8An4JMADxhH+xHfuiKwAAAABJRU5ErkJggg==)"
  61215. },
  61216. info: {
  61217. color: "#3A87AD",
  61218. "background-color": "#D9EDF7",
  61219. "border-color": "#BCE8F1",
  61220. "background-image": "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3QYFAhkSsdes/QAAA8dJREFUOMvVlGtMW2UYx//POaWHXg6lLaW0ypAtw1UCgbniNOLcVOLmAjHZolOYlxmTGXVZdAnRfXQm+7SoU4mXaOaiZsEpC9FkiQs6Z6bdCnNYruM6KNBw6YWewzl9z+sHImEWv+vz7XmT95f/+3/+7wP814v+efDOV3/SoX3lHAA+6ODeUFfMfjOWMADgdk+eEKz0pF7aQdMAcOKLLjrcVMVX3xdWN29/GhYP7SvnP0cWfS8caSkfHZsPE9Fgnt02JNutQ0QYHB2dDz9/pKX8QjjuO9xUxd/66HdxTeCHZ3rojQObGQBcuNjfplkD3b19Y/6MrimSaKgSMmpGU5WevmE/swa6Oy73tQHA0Rdr2Mmv/6A1n9w9suQ7097Z9lM4FlTgTDrzZTu4StXVfpiI48rVcUDM5cmEksrFnHxfpTtU/3BFQzCQF/2bYVoNbH7zmItbSoMj40JSzmMyX5qDvriA7QdrIIpA+3cdsMpu0nXI8cV0MtKXCPZev+gCEM1S2NHPvWfP/hL+7FSr3+0p5RBEyhEN5JCKYr8XnASMT0xBNyzQGQeI8fjsGD39RMPk7se2bd5ZtTyoFYXftF6y37gx7NeUtJJOTFlAHDZLDuILU3j3+H5oOrD3yWbIztugaAzgnBKJuBLpGfQrS8wO4FZgV+c1IxaLgWVU0tMLEETCos4xMzEIv9cJXQcyagIwigDGwJgOAtHAwAhisQUjy0ORGERiELgG4iakkzo4MYAxcM5hAMi1WWG1yYCJIcMUaBkVRLdGeSU2995TLWzcUAzONJ7J6FBVBYIggMzmFbvdBV44Corg8vjhzC+EJEl8U1kJtgYrhCzgc/vvTwXKSib1paRFVRVORDAJAsw5FuTaJEhWM2SHB3mOAlhkNxwuLzeJsGwqWzf5TFNdKgtY5qHp6ZFf67Y/sAVadCaVY5YACDDb3Oi4NIjLnWMw2QthCBIsVhsUTU9tvXsjeq9+X1d75/KEs4LNOfcdf/+HthMnvwxOD0wmHaXr7ZItn2wuH2SnBzbZAbPJwpPx+VQuzcm7dgRCB57a1uBzUDRL4bfnI0RE0eaXd9W89mpjqHZnUI5Hh2l2dkZZUhOqpi2qSmpOmZ64Tuu9qlz/SEXo6MEHa3wOip46F1n7633eekV8ds8Wxjn37Wl63VVa+ej5oeEZ/82ZBETJjpJ1Rbij2D3Z/1trXUvLsblCK0XfOx0SX2kMsn9dX+d+7Kf6h8o4AIykuffjT8L20LU+w4AZd5VvEPY+XpWqLV327HR7DzXuDnD8r+ovkBehJ8i+y8YAAAAASUVORK5CYII=)"
  61221. },
  61222. warn: {
  61223. color: "#C09853",
  61224. "background-color": "#FCF8E3",
  61225. "border-color": "#FBEED5",
  61226. "background-image": "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAMAAAC6V+0/AAABJlBMVEXr6eb/2oD/wi7/xjr/0mP/ykf/tQD/vBj/3o7/uQ//vyL/twebhgD/4pzX1K3z8e349vK6tHCilCWbiQymn0jGworr6dXQza3HxcKkn1vWvV/5uRfk4dXZ1bD18+/52YebiAmyr5S9mhCzrWq5t6ufjRH54aLs0oS+qD751XqPhAybhwXsujG3sm+Zk0PTwG6Shg+PhhObhwOPgQL4zV2nlyrf27uLfgCPhRHu7OmLgAafkyiWkD3l49ibiAfTs0C+lgCniwD4sgDJxqOilzDWowWFfAH08uebig6qpFHBvH/aw26FfQTQzsvy8OyEfz20r3jAvaKbhgG9q0nc2LbZxXanoUu/u5WSggCtp1anpJKdmFz/zlX/1nGJiYmuq5Dx7+sAAADoPUZSAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfdBgUBGhh4aah5AAAAlklEQVQY02NgoBIIE8EUcwn1FkIXM1Tj5dDUQhPU502Mi7XXQxGz5uVIjGOJUUUW81HnYEyMi2HVcUOICQZzMMYmxrEyMylJwgUt5BljWRLjmJm4pI1hYp5SQLGYxDgmLnZOVxuooClIDKgXKMbN5ggV1ACLJcaBxNgcoiGCBiZwdWxOETBDrTyEFey0jYJ4eHjMGWgEAIpRFRCUt08qAAAAAElFTkSuQmCC)"
  61227. }
  61228. }
  61229. }), e(function () {
  61230. g(h.css).attr("id", "core-notify"), e(document).on("click", "." + r + "-hidable", function (t) {
  61231. e(this).trigger("notify-hide");
  61232. }), e(document).on("notify-hide", "." + r + "-wrapper", function (t) {
  61233. var n = e(this).data(r);
  61234. n && n.show(!1);
  61235. });
  61236. });
  61237. });
  61238. /***/ }),
  61239. /***/ "./resources/js/views/App.vue":
  61240. /*!************************************!*\
  61241. !*** ./resources/js/views/App.vue ***!
  61242. \************************************/
  61243. /*! exports provided: default */
  61244. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61245. "use strict";
  61246. __webpack_require__.r(__webpack_exports__);
  61247. /* harmony import */ var _App_vue_vue_type_template_id_91ac6b5c___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./App.vue?vue&type=template&id=91ac6b5c& */ "./resources/js/views/App.vue?vue&type=template&id=91ac6b5c&");
  61248. /* harmony import */ var _App_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./App.vue?vue&type=script&lang=js& */ "./resources/js/views/App.vue?vue&type=script&lang=js&");
  61249. /* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js");
  61250. /* normalize component */
  61251. var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(
  61252. _App_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
  61253. _App_vue_vue_type_template_id_91ac6b5c___WEBPACK_IMPORTED_MODULE_0__["render"],
  61254. _App_vue_vue_type_template_id_91ac6b5c___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
  61255. false,
  61256. null,
  61257. null,
  61258. null
  61259. )
  61260. /* hot reload */
  61261. if (false) { var api; }
  61262. component.options.__file = "resources/js/views/App.vue"
  61263. /* harmony default export */ __webpack_exports__["default"] = (component.exports);
  61264. /***/ }),
  61265. /***/ "./resources/js/views/App.vue?vue&type=script&lang=js&":
  61266. /*!*************************************************************!*\
  61267. !*** ./resources/js/views/App.vue?vue&type=script&lang=js& ***!
  61268. \*************************************************************/
  61269. /*! exports provided: default */
  61270. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61271. "use strict";
  61272. __webpack_require__.r(__webpack_exports__);
  61273. /* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_App_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib??ref--4-0!../../../node_modules/vue-loader/lib??vue-loader-options!./App.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/views/App.vue?vue&type=script&lang=js&");
  61274. /* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_App_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]);
  61275. /***/ }),
  61276. /***/ "./resources/js/views/App.vue?vue&type=template&id=91ac6b5c&":
  61277. /*!*******************************************************************!*\
  61278. !*** ./resources/js/views/App.vue?vue&type=template&id=91ac6b5c& ***!
  61279. \*******************************************************************/
  61280. /*! exports provided: render, staticRenderFns */
  61281. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61282. "use strict";
  61283. __webpack_require__.r(__webpack_exports__);
  61284. /* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_App_vue_vue_type_template_id_91ac6b5c___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib??vue-loader-options!./App.vue?vue&type=template&id=91ac6b5c& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/views/App.vue?vue&type=template&id=91ac6b5c&");
  61285. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_App_vue_vue_type_template_id_91ac6b5c___WEBPACK_IMPORTED_MODULE_0__["render"]; });
  61286. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_App_vue_vue_type_template_id_91ac6b5c___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; });
  61287. /***/ }),
  61288. /***/ "./resources/js/views/Dashboard.vue":
  61289. /*!******************************************!*\
  61290. !*** ./resources/js/views/Dashboard.vue ***!
  61291. \******************************************/
  61292. /*! exports provided: default */
  61293. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61294. "use strict";
  61295. __webpack_require__.r(__webpack_exports__);
  61296. /* harmony import */ var _Dashboard_vue_vue_type_template_id_1f79daf6___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Dashboard.vue?vue&type=template&id=1f79daf6& */ "./resources/js/views/Dashboard.vue?vue&type=template&id=1f79daf6&");
  61297. /* harmony import */ var _Dashboard_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Dashboard.vue?vue&type=script&lang=js& */ "./resources/js/views/Dashboard.vue?vue&type=script&lang=js&");
  61298. /* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js");
  61299. /* normalize component */
  61300. var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(
  61301. _Dashboard_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
  61302. _Dashboard_vue_vue_type_template_id_1f79daf6___WEBPACK_IMPORTED_MODULE_0__["render"],
  61303. _Dashboard_vue_vue_type_template_id_1f79daf6___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
  61304. false,
  61305. null,
  61306. null,
  61307. null
  61308. )
  61309. /* hot reload */
  61310. if (false) { var api; }
  61311. component.options.__file = "resources/js/views/Dashboard.vue"
  61312. /* harmony default export */ __webpack_exports__["default"] = (component.exports);
  61313. /***/ }),
  61314. /***/ "./resources/js/views/Dashboard.vue?vue&type=script&lang=js&":
  61315. /*!*******************************************************************!*\
  61316. !*** ./resources/js/views/Dashboard.vue?vue&type=script&lang=js& ***!
  61317. \*******************************************************************/
  61318. /*! exports provided: default */
  61319. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61320. "use strict";
  61321. __webpack_require__.r(__webpack_exports__);
  61322. /* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Dashboard_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib??ref--4-0!../../../node_modules/vue-loader/lib??vue-loader-options!./Dashboard.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/views/Dashboard.vue?vue&type=script&lang=js&");
  61323. /* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Dashboard_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]);
  61324. /***/ }),
  61325. /***/ "./resources/js/views/Dashboard.vue?vue&type=template&id=1f79daf6&":
  61326. /*!*************************************************************************!*\
  61327. !*** ./resources/js/views/Dashboard.vue?vue&type=template&id=1f79daf6& ***!
  61328. \*************************************************************************/
  61329. /*! exports provided: render, staticRenderFns */
  61330. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61331. "use strict";
  61332. __webpack_require__.r(__webpack_exports__);
  61333. /* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Dashboard_vue_vue_type_template_id_1f79daf6___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib??vue-loader-options!./Dashboard.vue?vue&type=template&id=1f79daf6& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/views/Dashboard.vue?vue&type=template&id=1f79daf6&");
  61334. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Dashboard_vue_vue_type_template_id_1f79daf6___WEBPACK_IMPORTED_MODULE_0__["render"]; });
  61335. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Dashboard_vue_vue_type_template_id_1f79daf6___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; });
  61336. /***/ }),
  61337. /***/ "./resources/js/views/Login.vue":
  61338. /*!**************************************!*\
  61339. !*** ./resources/js/views/Login.vue ***!
  61340. \**************************************/
  61341. /*! exports provided: default */
  61342. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61343. "use strict";
  61344. __webpack_require__.r(__webpack_exports__);
  61345. /* harmony import */ var _Login_vue_vue_type_template_id_12f5395a___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Login.vue?vue&type=template&id=12f5395a& */ "./resources/js/views/Login.vue?vue&type=template&id=12f5395a&");
  61346. /* harmony import */ var _Login_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Login.vue?vue&type=script&lang=js& */ "./resources/js/views/Login.vue?vue&type=script&lang=js&");
  61347. /* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js");
  61348. /* normalize component */
  61349. var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(
  61350. _Login_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
  61351. _Login_vue_vue_type_template_id_12f5395a___WEBPACK_IMPORTED_MODULE_0__["render"],
  61352. _Login_vue_vue_type_template_id_12f5395a___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
  61353. false,
  61354. null,
  61355. null,
  61356. null
  61357. )
  61358. /* hot reload */
  61359. if (false) { var api; }
  61360. component.options.__file = "resources/js/views/Login.vue"
  61361. /* harmony default export */ __webpack_exports__["default"] = (component.exports);
  61362. /***/ }),
  61363. /***/ "./resources/js/views/Login.vue?vue&type=script&lang=js&":
  61364. /*!***************************************************************!*\
  61365. !*** ./resources/js/views/Login.vue?vue&type=script&lang=js& ***!
  61366. \***************************************************************/
  61367. /*! exports provided: default */
  61368. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61369. "use strict";
  61370. __webpack_require__.r(__webpack_exports__);
  61371. /* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Login_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib??ref--4-0!../../../node_modules/vue-loader/lib??vue-loader-options!./Login.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/views/Login.vue?vue&type=script&lang=js&");
  61372. /* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Login_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]);
  61373. /***/ }),
  61374. /***/ "./resources/js/views/Login.vue?vue&type=template&id=12f5395a&":
  61375. /*!*********************************************************************!*\
  61376. !*** ./resources/js/views/Login.vue?vue&type=template&id=12f5395a& ***!
  61377. \*********************************************************************/
  61378. /*! exports provided: render, staticRenderFns */
  61379. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61380. "use strict";
  61381. __webpack_require__.r(__webpack_exports__);
  61382. /* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Login_vue_vue_type_template_id_12f5395a___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib??vue-loader-options!./Login.vue?vue&type=template&id=12f5395a& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/views/Login.vue?vue&type=template&id=12f5395a&");
  61383. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Login_vue_vue_type_template_id_12f5395a___WEBPACK_IMPORTED_MODULE_0__["render"]; });
  61384. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Login_vue_vue_type_template_id_12f5395a___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; });
  61385. /***/ }),
  61386. /***/ "./resources/js/views/Welcome.vue":
  61387. /*!****************************************!*\
  61388. !*** ./resources/js/views/Welcome.vue ***!
  61389. \****************************************/
  61390. /*! exports provided: default */
  61391. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61392. "use strict";
  61393. __webpack_require__.r(__webpack_exports__);
  61394. /* harmony import */ var _Welcome_vue_vue_type_template_id_1ae8ae93_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Welcome.vue?vue&type=template&id=1ae8ae93&scoped=true& */ "./resources/js/views/Welcome.vue?vue&type=template&id=1ae8ae93&scoped=true&");
  61395. /* harmony import */ var _Welcome_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Welcome.vue?vue&type=script&lang=js& */ "./resources/js/views/Welcome.vue?vue&type=script&lang=js&");
  61396. /* empty/unused harmony star reexport *//* harmony import */ var _Welcome_vue_vue_type_style_index_0_id_1ae8ae93_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Welcome.vue?vue&type=style&index=0&id=1ae8ae93&scoped=true&lang=css& */ "./resources/js/views/Welcome.vue?vue&type=style&index=0&id=1ae8ae93&scoped=true&lang=css&");
  61397. /* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js");
  61398. /* normalize component */
  61399. var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__["default"])(
  61400. _Welcome_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
  61401. _Welcome_vue_vue_type_template_id_1ae8ae93_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"],
  61402. _Welcome_vue_vue_type_template_id_1ae8ae93_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
  61403. false,
  61404. null,
  61405. "1ae8ae93",
  61406. null
  61407. )
  61408. /* hot reload */
  61409. if (false) { var api; }
  61410. component.options.__file = "resources/js/views/Welcome.vue"
  61411. /* harmony default export */ __webpack_exports__["default"] = (component.exports);
  61412. /***/ }),
  61413. /***/ "./resources/js/views/Welcome.vue?vue&type=script&lang=js&":
  61414. /*!*****************************************************************!*\
  61415. !*** ./resources/js/views/Welcome.vue?vue&type=script&lang=js& ***!
  61416. \*****************************************************************/
  61417. /*! exports provided: default */
  61418. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61419. "use strict";
  61420. __webpack_require__.r(__webpack_exports__);
  61421. /* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Welcome_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib??ref--4-0!../../../node_modules/vue-loader/lib??vue-loader-options!./Welcome.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/views/Welcome.vue?vue&type=script&lang=js&");
  61422. /* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Welcome_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]);
  61423. /***/ }),
  61424. /***/ "./resources/js/views/Welcome.vue?vue&type=style&index=0&id=1ae8ae93&scoped=true&lang=css&":
  61425. /*!*************************************************************************************************!*\
  61426. !*** ./resources/js/views/Welcome.vue?vue&type=style&index=0&id=1ae8ae93&scoped=true&lang=css& ***!
  61427. \*************************************************************************************************/
  61428. /*! no static exports found */
  61429. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61430. "use strict";
  61431. __webpack_require__.r(__webpack_exports__);
  61432. /* harmony import */ var _node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_6_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_2_node_modules_vue_loader_lib_index_js_vue_loader_options_Welcome_vue_vue_type_style_index_0_id_1ae8ae93_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader!../../../node_modules/css-loader??ref--6-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src??ref--6-2!../../../node_modules/vue-loader/lib??vue-loader-options!./Welcome.vue?vue&type=style&index=0&id=1ae8ae93&scoped=true&lang=css& */ "./node_modules/style-loader/index.js!./node_modules/css-loader/index.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/views/Welcome.vue?vue&type=style&index=0&id=1ae8ae93&scoped=true&lang=css&");
  61433. /* harmony import */ var _node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_6_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_2_node_modules_vue_loader_lib_index_js_vue_loader_options_Welcome_vue_vue_type_style_index_0_id_1ae8ae93_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_6_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_2_node_modules_vue_loader_lib_index_js_vue_loader_options_Welcome_vue_vue_type_style_index_0_id_1ae8ae93_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__);
  61434. /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_6_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_2_node_modules_vue_loader_lib_index_js_vue_loader_options_Welcome_vue_vue_type_style_index_0_id_1ae8ae93_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_6_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_2_node_modules_vue_loader_lib_index_js_vue_loader_options_Welcome_vue_vue_type_style_index_0_id_1ae8ae93_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  61435. /* harmony default export */ __webpack_exports__["default"] = (_node_modules_style_loader_index_js_node_modules_css_loader_index_js_ref_6_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_2_node_modules_vue_loader_lib_index_js_vue_loader_options_Welcome_vue_vue_type_style_index_0_id_1ae8ae93_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a);
  61436. /***/ }),
  61437. /***/ "./resources/js/views/Welcome.vue?vue&type=template&id=1ae8ae93&scoped=true&":
  61438. /*!***********************************************************************************!*\
  61439. !*** ./resources/js/views/Welcome.vue?vue&type=template&id=1ae8ae93&scoped=true& ***!
  61440. \***********************************************************************************/
  61441. /*! exports provided: render, staticRenderFns */
  61442. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61443. "use strict";
  61444. __webpack_require__.r(__webpack_exports__);
  61445. /* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Welcome_vue_vue_type_template_id_1ae8ae93_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib??vue-loader-options!./Welcome.vue?vue&type=template&id=1ae8ae93&scoped=true& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/views/Welcome.vue?vue&type=template&id=1ae8ae93&scoped=true&");
  61446. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Welcome_vue_vue_type_template_id_1ae8ae93_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"]; });
  61447. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_Welcome_vue_vue_type_template_id_1ae8ae93_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; });
  61448. /***/ }),
  61449. /***/ "./resources/js/views/WorkOrder.vue":
  61450. /*!******************************************!*\
  61451. !*** ./resources/js/views/WorkOrder.vue ***!
  61452. \******************************************/
  61453. /*! exports provided: default */
  61454. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61455. "use strict";
  61456. __webpack_require__.r(__webpack_exports__);
  61457. /* harmony import */ var _WorkOrder_vue_vue_type_template_id_17837e2e___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./WorkOrder.vue?vue&type=template&id=17837e2e& */ "./resources/js/views/WorkOrder.vue?vue&type=template&id=17837e2e&");
  61458. /* harmony import */ var _WorkOrder_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./WorkOrder.vue?vue&type=script&lang=js& */ "./resources/js/views/WorkOrder.vue?vue&type=script&lang=js&");
  61459. /* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js");
  61460. /* normalize component */
  61461. var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(
  61462. _WorkOrder_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
  61463. _WorkOrder_vue_vue_type_template_id_17837e2e___WEBPACK_IMPORTED_MODULE_0__["render"],
  61464. _WorkOrder_vue_vue_type_template_id_17837e2e___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
  61465. false,
  61466. null,
  61467. null,
  61468. null
  61469. )
  61470. /* hot reload */
  61471. if (false) { var api; }
  61472. component.options.__file = "resources/js/views/WorkOrder.vue"
  61473. /* harmony default export */ __webpack_exports__["default"] = (component.exports);
  61474. /***/ }),
  61475. /***/ "./resources/js/views/WorkOrder.vue?vue&type=script&lang=js&":
  61476. /*!*******************************************************************!*\
  61477. !*** ./resources/js/views/WorkOrder.vue?vue&type=script&lang=js& ***!
  61478. \*******************************************************************/
  61479. /*! exports provided: default */
  61480. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61481. "use strict";
  61482. __webpack_require__.r(__webpack_exports__);
  61483. /* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_WorkOrder_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib??ref--4-0!../../../node_modules/vue-loader/lib??vue-loader-options!./WorkOrder.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/views/WorkOrder.vue?vue&type=script&lang=js&");
  61484. /* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_WorkOrder_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]);
  61485. /***/ }),
  61486. /***/ "./resources/js/views/WorkOrder.vue?vue&type=template&id=17837e2e&":
  61487. /*!*************************************************************************!*\
  61488. !*** ./resources/js/views/WorkOrder.vue?vue&type=template&id=17837e2e& ***!
  61489. \*************************************************************************/
  61490. /*! exports provided: render, staticRenderFns */
  61491. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61492. "use strict";
  61493. __webpack_require__.r(__webpack_exports__);
  61494. /* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_WorkOrder_vue_vue_type_template_id_17837e2e___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../node_modules/vue-loader/lib??vue-loader-options!./WorkOrder.vue?vue&type=template&id=17837e2e& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/views/WorkOrder.vue?vue&type=template&id=17837e2e&");
  61495. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_WorkOrder_vue_vue_type_template_id_17837e2e___WEBPACK_IMPORTED_MODULE_0__["render"]; });
  61496. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_WorkOrder_vue_vue_type_template_id_17837e2e___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; });
  61497. /***/ }),
  61498. /***/ "./resources/sass/app.scss":
  61499. /*!*********************************!*\
  61500. !*** ./resources/sass/app.scss ***!
  61501. \*********************************/
  61502. /*! no static exports found */
  61503. /***/ (function(module, exports) {
  61504. // removed by extract-text-webpack-plugin
  61505. /***/ }),
  61506. /***/ 0:
  61507. /*!*************************************************************!*\
  61508. !*** multi ./resources/js/app.js ./resources/sass/app.scss ***!
  61509. \*************************************************************/
  61510. /*! no static exports found */
  61511. /***/ (function(module, exports, __webpack_require__) {
  61512. __webpack_require__(/*! /home/vagrant/upccrt/resources/js/app.js */"./resources/js/app.js");
  61513. module.exports = __webpack_require__(/*! /home/vagrant/upccrt/resources/sass/app.scss */"./resources/sass/app.scss");
  61514. /***/ })
  61515. /******/ });