app.js 2.0 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194521955219652197521985219952200522015220252203522045220552206522075220852209522105221152212522135221452215522165221752218522195222052221522225222352224522255222652227522285222952230522315223252233522345223552236522375223852239522405224152242522435224452245522465224752248522495225052251522525225352254522555225652257522585225952260522615226252263522645226552266522675226852269522705227152272522735227452275522765227752278522795228052281522825228352284522855228652287522885228952290522915229252293522945229552296522975229852299523005230152302523035230452305523065230752308523095231052311523125231352314523155231652317523185231952320523215232252323523245232552326523275232852329523305233152332523335233452335523365233752338523395234052341523425234352344523455234652347523485234952350523515235252353523545235552356523575235852359523605236152362523635236452365523665236752368523695237052371523725237352374523755237652377523785237952380523815238252383523845238552386523875238852389523905239152392523935239452395523965239752398523995240052401524025240352404524055240652407524085240952410524115241252413524145241552416524175241852419524205242152422524235242452425524265242752428524295243052431524325243352434524355243652437524385243952440524415244252443524445244552446524475244852449524505245152452524535245452455524565245752458524595246052461524625246352464524655246652467524685246952470524715247252473524745247552476524775247852479524805248152482524835248452485524865248752488524895249052491524925249352494524955249652497524985249952500525015250252503525045250552506525075250852509525105251152512525135251452515525165251752518525195252052521525225252352524525255252652527525285252952530525315253252533525345253552536525375253852539525405254152542525435254452545525465254752548525495255052551525525255352554525555255652557525585255952560525615256252563525645256552566525675256852569525705257152572525735257452575525765257752578525795258052581525825258352584525855258652587525885258952590525915259252593525945259552596525975259852599526005260152602526035260452605526065260752608526095261052611526125261352614526155261652617526185261952620526215262252623526245262552626526275262852629526305263152632526335263452635526365263752638526395264052641526425264352644526455264652647526485264952650526515265252653526545265552656526575265852659526605266152662526635266452665526665266752668526695267052671526725267352674526755267652677526785267952680526815268252683526845268552686526875268852689526905269152692526935269452695526965269752698526995270052701527025270352704527055270652707527085270952710527115271252713527145271552716527175271852719527205272152722527235272452725527265272752728527295273052731527325273352734527355273652737527385273952740527415274252743527445274552746527475274852749527505275152752527535275452755527565275752758527595276052761527625276352764527655276652767527685276952770527715277252773527745277552776527775277852779527805278152782527835278452785527865278752788527895279052791527925279352794527955279652797527985279952800528015280252803528045280552806528075280852809528105281152812528135281452815528165281752818528195282052821528225282352824528255282652827528285282952830528315283252833528345283552836528375283852839528405284152842528435284452845528465284752848528495285052851528525285352854528555285652857528585285952860528615286252863528645286552866528675286852869528705287152872528735287452875528765287752878528795288052881528825288352884528855288652887528885288952890528915289252893528945289552896528975289852899529005290152902529035290452905529065290752908529095291052911529125291352914529155291652917529185291952920529215292252923529245292552926529275292852929529305293152932529335293452935529365293752938529395294052941529425294352944529455294652947529485294952950529515295252953529545295552956529575295852959529605296152962529635296452965529665296752968529695297052971529725297352974529755297652977529785297952980529815298252983529845298552986529875298852989529905299152992529935299452995529965299752998529995300053001530025300353004530055300653007530085300953010530115301253013530145301553016530175301853019530205302153022530235302453025530265302753028530295303053031530325303353034530355303653037530385303953040530415304253043530445304553046530475304853049530505305153052530535305453055530565305753058530595306053061530625306353064530655306653067530685306953070530715307253073530745307553076530775307853079530805308153082530835308453085530865308753088530895309053091530925309353094530955309653097530985309953100531015310253103531045310553106531075310853109531105311153112531135311453115531165311753118531195312053121531225312353124531255312653127531285312953130531315313253133531345313553136531375313853139531405314153142531435314453145531465314753148531495315053151531525315353154531555315653157531585315953160531615316253163531645316553166531675316853169531705317153172531735317453175531765317753178531795318053181531825318353184531855318653187531885318953190531915319253193531945319553196531975319853199532005320153202532035320453205532065320753208532095321053211532125321353214532155321653217532185321953220532215322253223532245322553226532275322853229532305323153232532335323453235532365323753238532395324053241532425324353244532455324653247532485324953250532515325253253532545325553256532575325853259532605326153262532635326453265532665326753268532695327053271532725327353274532755327653277532785327953280532815328253283532845328553286532875328853289532905329153292532935329453295532965329753298532995330053301533025330353304533055330653307533085330953310533115331253313533145331553316533175331853319533205332153322533235332453325533265332753328533295333053331533325333353334533355333653337533385333953340533415334253343533445334553346533475334853349533505335153352533535335453355533565335753358533595336053361533625336353364533655336653367533685336953370533715337253373533745337553376533775337853379533805338153382533835338453385533865338753388533895339053391533925339353394533955339653397533985339953400534015340253403534045340553406534075340853409534105341153412534135341453415534165341753418534195342053421534225342353424534255342653427534285342953430534315343253433534345343553436534375343853439534405344153442534435344453445534465344753448534495345053451534525345353454534555345653457534585345953460534615346253463534645346553466534675346853469534705347153472534735347453475534765347753478534795348053481534825348353484534855348653487534885348953490534915349253493534945349553496534975349853499535005350153502535035350453505535065350753508535095351053511535125351353514535155351653517535185351953520535215352253523535245352553526535275352853529535305353153532535335353453535535365353753538535395354053541535425354353544535455354653547535485354953550535515355253553535545355553556535575355853559535605356153562535635356453565535665356753568535695357053571535725357353574535755357653577535785357953580535815358253583535845358553586535875358853589535905359153592535935359453595535965359753598535995360053601536025360353604536055360653607536085360953610536115361253613536145361553616536175361853619536205362153622536235362453625536265362753628536295363053631536325363353634536355363653637536385363953640536415364253643536445364553646536475364853649536505365153652536535365453655536565365753658536595366053661536625366353664536655366653667536685366953670536715367253673536745367553676536775367853679536805368153682536835368453685536865368753688536895369053691536925369353694536955369653697536985369953700537015370253703537045370553706537075370853709537105371153712537135371453715537165371753718537195372053721537225372353724537255372653727537285372953730537315373253733537345373553736537375373853739537405374153742537435374453745537465374753748537495375053751537525375353754537555375653757537585375953760537615376253763537645376553766537675376853769537705377153772537735377453775537765377753778537795378053781537825378353784537855378653787537885378953790537915379253793537945379553796537975379853799538005380153802538035380453805538065380753808538095381053811538125381353814538155381653817538185381953820538215382253823538245382553826538275382853829538305383153832538335383453835538365383753838538395384053841538425384353844538455384653847538485384953850538515385253853538545385553856538575385853859538605386153862538635386453865538665386753868538695387053871538725387353874538755387653877538785387953880538815388253883538845388553886538875388853889538905389153892538935389453895538965389753898538995390053901539025390353904539055390653907539085390953910539115391253913539145391553916539175391853919539205392153922539235392453925539265392753928539295393053931539325393353934539355393653937539385393953940539415394253943539445394553946539475394853949539505395153952539535395453955539565395753958539595396053961539625396353964539655396653967539685396953970539715397253973539745397553976539775397853979539805398153982539835398453985539865398753988539895399053991539925399353994539955399653997539985399954000540015400254003540045400554006540075400854009540105401154012540135401454015540165401754018540195402054021540225402354024540255402654027540285402954030540315403254033540345403554036540375403854039540405404154042540435404454045540465404754048540495405054051540525405354054540555405654057540585405954060540615406254063540645406554066540675406854069540705407154072540735407454075540765407754078540795408054081540825408354084540855408654087540885408954090540915409254093540945409554096540975409854099541005410154102541035410454105541065410754108541095411054111541125411354114541155411654117541185411954120541215412254123541245412554126541275412854129541305413154132541335413454135541365413754138541395414054141541425414354144541455414654147541485414954150541515415254153541545415554156541575415854159541605416154162541635416454165541665416754168541695417054171541725417354174541755417654177541785417954180541815418254183541845418554186541875418854189541905419154192541935419454195541965419754198541995420054201542025420354204542055420654207542085420954210542115421254213542145421554216542175421854219542205422154222542235422454225542265422754228542295423054231542325423354234542355423654237542385423954240542415424254243542445424554246542475424854249542505425154252542535425454255542565425754258542595426054261542625426354264542655426654267542685426954270542715427254273542745427554276542775427854279542805428154282542835428454285542865428754288542895429054291542925429354294542955429654297542985429954300543015430254303543045430554306543075430854309543105431154312543135431454315543165431754318543195432054321543225432354324543255432654327543285432954330543315433254333543345433554336543375433854339543405434154342543435434454345543465434754348543495435054351543525435354354543555435654357543585435954360543615436254363543645436554366543675436854369543705437154372543735437454375543765437754378543795438054381543825438354384543855438654387543885438954390543915439254393543945439554396543975439854399544005440154402544035440454405544065440754408544095441054411544125441354414544155441654417544185441954420544215442254423544245442554426544275442854429544305443154432544335443454435544365443754438544395444054441544425444354444544455444654447544485444954450544515445254453544545445554456544575445854459544605446154462544635446454465544665446754468544695447054471544725447354474544755447654477544785447954480544815448254483544845448554486544875448854489544905449154492544935449454495544965449754498544995450054501545025450354504545055450654507545085450954510545115451254513545145451554516545175451854519545205452154522545235452454525545265452754528545295453054531545325453354534545355453654537545385453954540545415454254543545445454554546545475454854549545505455154552545535455454555545565455754558545595456054561545625456354564545655456654567545685456954570545715457254573545745457554576545775457854579545805458154582545835458454585545865458754588545895459054591545925459354594545955459654597545985459954600546015460254603546045460554606546075460854609546105461154612546135461454615546165461754618546195462054621546225462354624546255462654627546285462954630546315463254633546345463554636546375463854639546405464154642546435464454645546465464754648546495465054651546525465354654546555465654657546585465954660546615466254663546645466554666546675466854669546705467154672546735467454675546765467754678546795468054681546825468354684546855468654687546885468954690546915469254693546945469554696546975469854699547005470154702547035470454705547065470754708547095471054711547125471354714547155471654717547185471954720547215472254723547245472554726547275472854729547305473154732547335473454735547365473754738547395474054741547425474354744547455474654747547485474954750547515475254753547545475554756547575475854759547605476154762547635476454765547665476754768547695477054771547725477354774547755477654777547785477954780547815478254783547845478554786547875478854789547905479154792547935479454795547965479754798547995480054801548025480354804548055480654807548085480954810548115481254813548145481554816548175481854819548205482154822548235482454825548265482754828548295483054831548325483354834548355483654837548385483954840548415484254843548445484554846548475484854849548505485154852548535485454855548565485754858548595486054861548625486354864548655486654867548685486954870548715487254873548745487554876548775487854879548805488154882548835488454885548865488754888548895489054891548925489354894548955489654897548985489954900549015490254903549045490554906549075490854909549105491154912549135491454915549165491754918549195492054921549225492354924549255492654927549285492954930549315493254933549345493554936549375493854939549405494154942549435494454945549465494754948549495495054951549525495354954549555495654957549585495954960549615496254963549645496554966549675496854969549705497154972549735497454975549765497754978549795498054981549825498354984549855498654987549885498954990549915499254993549945499554996549975499854999550005500155002550035500455005550065500755008550095501055011550125501355014550155501655017550185501955020550215502255023550245502555026550275502855029550305503155032550335503455035550365503755038550395504055041550425504355044550455504655047550485504955050550515505255053550545505555056550575505855059550605506155062550635506455065550665506755068550695507055071550725507355074550755507655077550785507955080550815508255083550845508555086550875508855089550905509155092550935509455095550965509755098550995510055101551025510355104551055510655107551085510955110551115511255113551145511555116551175511855119551205512155122551235512455125551265512755128551295513055131551325513355134551355513655137551385513955140551415514255143551445514555146551475514855149551505515155152551535515455155551565515755158551595516055161551625516355164551655516655167551685516955170551715517255173551745517555176551775517855179551805518155182551835518455185551865518755188551895519055191551925519355194551955519655197551985519955200552015520255203552045520555206552075520855209552105521155212552135521455215552165521755218552195522055221552225522355224552255522655227552285522955230552315523255233552345523555236552375523855239552405524155242552435524455245552465524755248552495525055251552525525355254552555525655257552585525955260552615526255263552645526555266552675526855269552705527155272552735527455275552765527755278552795528055281552825528355284552855528655287552885528955290552915529255293552945529555296552975529855299553005530155302553035530455305553065530755308553095531055311553125531355314553155531655317553185531955320553215532255323553245532555326553275532855329553305533155332553335533455335553365533755338553395534055341553425534355344553455534655347553485534955350553515535255353553545535555356553575535855359553605536155362553635536455365553665536755368553695537055371553725537355374553755537655377553785537955380553815538255383553845538555386553875538855389553905539155392553935539455395553965539755398553995540055401554025540355404554055540655407554085540955410554115541255413554145541555416554175541855419554205542155422554235542455425554265542755428554295543055431554325543355434554355543655437554385543955440554415544255443554445544555446554475544855449554505545155452554535545455455554565545755458554595546055461554625546355464554655546655467554685546955470554715547255473554745547555476554775547855479554805548155482554835548455485554865548755488554895549055491554925549355494554955549655497554985549955500555015550255503555045550555506555075550855509555105551155512555135551455515555165551755518555195552055521555225552355524555255552655527555285552955530555315553255533555345553555536555375553855539555405554155542555435554455545555465554755548555495555055551555525555355554555555555655557555585555955560555615556255563555645556555566555675556855569555705557155572555735557455575555765557755578555795558055581555825558355584555855558655587555885558955590555915559255593555945559555596555975559855599556005560155602556035560455605556065560755608556095561055611556125561355614556155561655617556185561955620556215562255623556245562555626556275562855629556305563155632556335563455635556365563755638556395564055641556425564355644556455564655647556485564955650556515565255653556545565555656556575565855659556605566155662556635566455665556665566755668556695567055671556725567355674556755567655677556785567955680556815568255683556845568555686556875568855689556905569155692556935569455695556965569755698556995570055701557025570355704557055570655707557085570955710557115571255713557145571555716557175571855719557205572155722557235572455725557265572755728557295573055731557325573355734557355573655737557385573955740557415574255743557445574555746557475574855749557505575155752557535575455755557565575755758557595576055761557625576355764557655576655767557685576955770557715577255773557745577555776557775577855779557805578155782557835578455785557865578755788557895579055791557925579355794557955579655797557985579955800558015580255803558045580555806558075580855809558105581155812558135581455815558165581755818558195582055821558225582355824558255582655827558285582955830558315583255833558345583555836558375583855839558405584155842558435584455845558465584755848558495585055851558525585355854558555585655857558585585955860558615586255863558645586555866558675586855869558705587155872558735587455875558765587755878558795588055881558825588355884558855588655887558885588955890558915589255893558945589555896558975589855899559005590155902559035590455905559065590755908559095591055911559125591355914559155591655917559185591955920559215592255923559245592555926559275592855929559305593155932559335593455935559365593755938559395594055941559425594355944559455594655947559485594955950559515595255953559545595555956559575595855959559605596155962559635596455965559665596755968559695597055971559725597355974559755597655977559785597955980559815598255983559845598555986559875598855989559905599155992559935599455995559965599755998559995600056001560025600356004560055600656007560085600956010560115601256013560145601556016560175601856019560205602156022560235602456025560265602756028560295603056031560325603356034560355603656037560385603956040560415604256043560445604556046560475604856049560505605156052560535605456055560565605756058560595606056061560625606356064560655606656067560685606956070560715607256073560745607556076560775607856079560805608156082560835608456085560865608756088560895609056091560925609356094560955609656097560985609956100561015610256103561045610556106561075610856109561105611156112561135611456115561165611756118561195612056121561225612356124561255612656127561285612956130561315613256133561345613556136561375613856139561405614156142561435614456145561465614756148561495615056151561525615356154561555615656157561585615956160561615616256163561645616556166561675616856169561705617156172561735617456175561765617756178561795618056181561825618356184561855618656187561885618956190561915619256193561945619556196561975619856199562005620156202562035620456205562065620756208562095621056211562125621356214562155621656217562185621956220562215622256223562245622556226562275622856229562305623156232562335623456235562365623756238562395624056241562425624356244562455624656247562485624956250562515625256253562545625556256562575625856259562605626156262562635626456265562665626756268562695627056271562725627356274562755627656277562785627956280562815628256283562845628556286562875628856289562905629156292562935629456295562965629756298562995630056301563025630356304563055630656307563085630956310563115631256313563145631556316563175631856319563205632156322563235632456325563265632756328563295633056331563325633356334563355633656337563385633956340563415634256343563445634556346563475634856349563505635156352563535635456355563565635756358563595636056361563625636356364563655636656367563685636956370563715637256373563745637556376563775637856379563805638156382563835638456385563865638756388563895639056391563925639356394563955639656397563985639956400564015640256403564045640556406564075640856409564105641156412564135641456415564165641756418564195642056421564225642356424564255642656427564285642956430564315643256433564345643556436564375643856439564405644156442564435644456445564465644756448564495645056451564525645356454564555645656457564585645956460564615646256463564645646556466564675646856469564705647156472564735647456475564765647756478564795648056481564825648356484564855648656487564885648956490564915649256493564945649556496564975649856499565005650156502565035650456505565065650756508565095651056511565125651356514565155651656517565185651956520565215652256523565245652556526565275652856529565305653156532565335653456535565365653756538565395654056541565425654356544565455654656547565485654956550565515655256553565545655556556565575655856559565605656156562565635656456565565665656756568565695657056571565725657356574565755657656577565785657956580565815658256583565845658556586565875658856589565905659156592565935659456595565965659756598565995660056601566025660356604566055660656607566085660956610566115661256613566145661556616566175661856619566205662156622566235662456625566265662756628566295663056631566325663356634566355663656637566385663956640566415664256643566445664556646566475664856649566505665156652566535665456655566565665756658566595666056661566625666356664566655666656667566685666956670566715667256673566745667556676566775667856679566805668156682566835668456685566865668756688566895669056691566925669356694566955669656697566985669956700567015670256703567045670556706567075670856709567105671156712567135671456715567165671756718567195672056721567225672356724567255672656727567285672956730567315673256733567345673556736567375673856739567405674156742567435674456745567465674756748567495675056751567525675356754567555675656757567585675956760567615676256763567645676556766567675676856769567705677156772567735677456775567765677756778567795678056781567825678356784567855678656787567885678956790567915679256793567945679556796567975679856799568005680156802568035680456805568065680756808568095681056811568125681356814568155681656817568185681956820568215682256823568245682556826568275682856829568305683156832568335683456835568365683756838568395684056841568425684356844568455684656847568485684956850568515685256853568545685556856568575685856859568605686156862568635686456865568665686756868568695687056871568725687356874568755687656877568785687956880568815688256883568845688556886568875688856889568905689156892568935689456895568965689756898568995690056901569025690356904569055690656907569085690956910569115691256913569145691556916569175691856919569205692156922569235692456925569265692756928569295693056931569325693356934569355693656937569385693956940569415694256943569445694556946569475694856949569505695156952569535695456955569565695756958569595696056961569625696356964569655696656967569685696956970569715697256973569745697556976569775697856979569805698156982569835698456985569865698756988569895699056991569925699356994569955699656997569985699957000570015700257003570045700557006570075700857009570105701157012570135701457015570165701757018570195702057021570225702357024570255702657027570285702957030570315703257033570345703557036570375703857039570405704157042570435704457045570465704757048570495705057051570525705357054570555705657057570585705957060570615706257063570645706557066570675706857069570705707157072570735707457075570765707757078570795708057081570825708357084570855708657087570885708957090570915709257093570945709557096570975709857099571005710157102571035710457105571065710757108571095711057111571125711357114571155711657117571185711957120571215712257123571245712557126571275712857129571305713157132571335713457135571365713757138571395714057141571425714357144571455714657147571485714957150571515715257153571545715557156571575715857159571605716157162571635716457165571665716757168571695717057171571725717357174571755717657177571785717957180571815718257183571845718557186571875718857189571905719157192571935719457195571965719757198571995720057201572025720357204572055720657207572085720957210572115721257213572145721557216572175721857219572205722157222572235722457225572265722757228572295723057231572325723357234572355723657237572385723957240572415724257243572445724557246572475724857249572505725157252572535725457255572565725757258572595726057261572625726357264572655726657267572685726957270572715727257273572745727557276572775727857279572805728157282572835728457285572865728757288572895729057291572925729357294572955729657297572985729957300573015730257303573045730557306573075730857309573105731157312573135731457315573165731757318573195732057321573225732357324573255732657327573285732957330573315733257333573345733557336573375733857339573405734157342573435734457345573465734757348573495735057351573525735357354573555735657357573585735957360573615736257363573645736557366573675736857369573705737157372573735737457375573765737757378573795738057381573825738357384573855738657387573885738957390573915739257393573945739557396573975739857399574005740157402574035740457405574065740757408574095741057411574125741357414574155741657417574185741957420574215742257423574245742557426574275742857429574305743157432574335743457435574365743757438574395744057441574425744357444574455744657447574485744957450574515745257453574545745557456574575745857459574605746157462574635746457465574665746757468574695747057471574725747357474574755747657477574785747957480574815748257483574845748557486574875748857489574905749157492574935749457495574965749757498574995750057501575025750357504575055750657507575085750957510575115751257513575145751557516575175751857519575205752157522575235752457525575265752757528575295753057531575325753357534575355753657537575385753957540575415754257543575445754557546575475754857549575505755157552575535755457555575565755757558575595756057561575625756357564575655756657567575685756957570575715757257573575745757557576575775757857579575805758157582575835758457585575865758757588575895759057591575925759357594575955759657597575985759957600576015760257603576045760557606576075760857609576105761157612576135761457615576165761757618576195762057621576225762357624576255762657627576285762957630576315763257633576345763557636576375763857639576405764157642576435764457645576465764757648576495765057651576525765357654576555765657657576585765957660576615766257663576645766557666576675766857669576705767157672576735767457675576765767757678576795768057681576825768357684576855768657687576885768957690576915769257693576945769557696576975769857699577005770157702577035770457705577065770757708577095771057711577125771357714577155771657717577185771957720577215772257723577245772557726577275772857729577305773157732577335773457735577365773757738577395774057741577425774357744577455774657747577485774957750577515775257753577545775557756577575775857759577605776157762577635776457765577665776757768577695777057771577725777357774577755777657777577785777957780577815778257783577845778557786577875778857789577905779157792577935779457795577965779757798577995780057801578025780357804578055780657807578085780957810578115781257813578145781557816578175781857819578205782157822578235782457825578265782757828578295783057831578325783357834578355783657837578385783957840578415784257843578445784557846578475784857849578505785157852578535785457855578565785757858578595786057861578625786357864578655786657867578685786957870578715787257873578745787557876578775787857879578805788157882578835788457885578865788757888578895789057891578925789357894578955789657897578985789957900579015790257903579045790557906579075790857909579105791157912579135791457915579165791757918579195792057921579225792357924579255792657927579285792957930579315793257933579345793557936579375793857939579405794157942579435794457945579465794757948579495795057951579525795357954579555795657957579585795957960579615796257963579645796557966579675796857969579705797157972579735797457975579765797757978579795798057981579825798357984579855798657987579885798957990579915799257993579945799557996579975799857999580005800158002580035800458005580065800758008580095801058011580125801358014580155801658017580185801958020580215802258023580245802558026580275802858029580305803158032580335803458035580365803758038580395804058041580425804358044580455804658047580485804958050580515805258053580545805558056580575805858059580605806158062580635806458065580665806758068580695807058071580725807358074580755807658077580785807958080580815808258083580845808558086580875808858089580905809158092580935809458095580965809758098580995810058101581025810358104581055810658107581085810958110581115811258113581145811558116581175811858119581205812158122581235812458125581265812758128581295813058131581325813358134581355813658137581385813958140581415814258143581445814558146581475814858149581505815158152581535815458155581565815758158581595816058161581625816358164581655816658167581685816958170581715817258173581745817558176581775817858179581805818158182581835818458185581865818758188581895819058191581925819358194581955819658197581985819958200582015820258203582045820558206582075820858209582105821158212582135821458215582165821758218582195822058221582225822358224582255822658227582285822958230582315823258233582345823558236582375823858239582405824158242582435824458245582465824758248582495825058251582525825358254582555825658257582585825958260582615826258263582645826558266582675826858269582705827158272582735827458275582765827758278582795828058281582825828358284582855828658287582885828958290582915829258293582945829558296582975829858299583005830158302583035830458305583065830758308583095831058311583125831358314583155831658317583185831958320583215832258323583245832558326583275832858329583305833158332583335833458335583365833758338583395834058341583425834358344583455834658347583485834958350583515835258353583545835558356583575835858359583605836158362583635836458365583665836758368583695837058371583725837358374583755837658377583785837958380583815838258383583845838558386583875838858389583905839158392583935839458395583965839758398583995840058401584025840358404584055840658407584085840958410584115841258413584145841558416584175841858419584205842158422584235842458425584265842758428584295843058431584325843358434584355843658437584385843958440584415844258443584445844558446584475844858449584505845158452584535845458455584565845758458584595846058461584625846358464584655846658467584685846958470584715847258473584745847558476584775847858479584805848158482584835848458485584865848758488584895849058491584925849358494584955849658497584985849958500585015850258503585045850558506585075850858509585105851158512585135851458515585165851758518585195852058521585225852358524585255852658527585285852958530585315853258533585345853558536585375853858539585405854158542585435854458545585465854758548585495855058551585525855358554585555855658557585585855958560585615856258563585645856558566585675856858569585705857158572585735857458575585765857758578585795858058581585825858358584585855858658587585885858958590585915859258593585945859558596585975859858599586005860158602586035860458605586065860758608586095861058611586125861358614586155861658617586185861958620586215862258623586245862558626586275862858629586305863158632586335863458635586365863758638586395864058641586425864358644586455864658647586485864958650586515865258653586545865558656586575865858659586605866158662586635866458665586665866758668586695867058671586725867358674586755867658677586785867958680586815868258683586845868558686586875868858689586905869158692586935869458695586965869758698586995870058701587025870358704587055870658707587085870958710587115871258713587145871558716587175871858719587205872158722587235872458725587265872758728587295873058731587325873358734587355873658737587385873958740587415874258743587445874558746587475874858749587505875158752587535875458755587565875758758587595876058761587625876358764587655876658767587685876958770587715877258773587745877558776587775877858779587805878158782587835878458785587865878758788587895879058791587925879358794587955879658797587985879958800588015880258803588045880558806588075880858809588105881158812588135881458815588165881758818588195882058821588225882358824588255882658827588285882958830588315883258833588345883558836588375883858839588405884158842588435884458845588465884758848588495885058851588525885358854588555885658857588585885958860588615886258863588645886558866588675886858869588705887158872588735887458875588765887758878588795888058881588825888358884588855888658887588885888958890588915889258893588945889558896588975889858899589005890158902589035890458905589065890758908589095891058911589125891358914589155891658917589185891958920589215892258923589245892558926589275892858929589305893158932589335893458935589365893758938589395894058941589425894358944589455894658947589485894958950589515895258953589545895558956589575895858959589605896158962589635896458965589665896758968589695897058971589725897358974589755897658977589785897958980589815898258983589845898558986589875898858989589905899158992589935899458995589965899758998589995900059001590025900359004590055900659007590085900959010590115901259013590145901559016590175901859019590205902159022590235902459025590265902759028590295903059031590325903359034590355903659037590385903959040590415904259043590445904559046590475904859049590505905159052590535905459055590565905759058590595906059061590625906359064590655906659067590685906959070590715907259073590745907559076590775907859079590805908159082590835908459085590865908759088590895909059091590925909359094590955909659097590985909959100591015910259103591045910559106591075910859109591105911159112591135911459115591165911759118591195912059121591225912359124591255912659127591285912959130591315913259133591345913559136591375913859139591405914159142591435914459145591465914759148591495915059151591525915359154591555915659157591585915959160591615916259163591645916559166591675916859169591705917159172591735917459175591765917759178591795918059181591825918359184591855918659187591885918959190591915919259193591945919559196591975919859199592005920159202592035920459205592065920759208592095921059211592125921359214592155921659217592185921959220592215922259223592245922559226592275922859229592305923159232592335923459235592365923759238592395924059241592425924359244592455924659247592485924959250592515925259253592545925559256592575925859259592605926159262592635926459265592665926759268592695927059271592725927359274592755927659277592785927959280592815928259283592845928559286592875928859289592905929159292592935929459295592965929759298592995930059301593025930359304593055930659307593085930959310593115931259313593145931559316593175931859319593205932159322593235932459325593265932759328593295933059331593325933359334593355933659337593385933959340593415934259343593445934559346593475934859349593505935159352593535935459355593565935759358593595936059361593625936359364593655936659367593685936959370593715937259373593745937559376593775937859379593805938159382593835938459385593865938759388593895939059391593925939359394593955939659397593985939959400594015940259403594045940559406594075940859409594105941159412594135941459415594165941759418594195942059421594225942359424594255942659427594285942959430594315943259433594345943559436594375943859439594405944159442594435944459445594465944759448594495945059451594525945359454594555945659457594585945959460594615946259463594645946559466594675946859469594705947159472594735947459475594765947759478594795948059481594825948359484594855948659487594885948959490594915949259493594945949559496594975949859499595005950159502595035950459505595065950759508595095951059511595125951359514595155951659517595185951959520595215952259523595245952559526595275952859529595305953159532595335953459535595365953759538595395954059541595425954359544595455954659547595485954959550595515955259553595545955559556595575955859559595605956159562595635956459565595665956759568595695957059571595725957359574595755957659577595785957959580595815958259583595845958559586595875958859589595905959159592595935959459595595965959759598595995960059601596025960359604596055960659607596085960959610596115961259613596145961559616596175961859619596205962159622596235962459625596265962759628596295963059631596325963359634596355963659637596385963959640596415964259643596445964559646596475964859649596505965159652596535965459655596565965759658596595966059661596625966359664596655966659667596685966959670596715967259673596745967559676596775967859679596805968159682596835968459685596865968759688596895969059691596925969359694596955969659697596985969959700597015970259703597045970559706597075970859709597105971159712597135971459715597165971759718597195972059721597225972359724597255972659727597285972959730597315973259733597345973559736597375973859739597405974159742597435974459745597465974759748597495975059751597525975359754597555975659757597585975959760597615976259763597645976559766597675976859769597705977159772597735977459775597765977759778597795978059781597825978359784597855978659787597885978959790597915979259793597945979559796597975979859799598005980159802598035980459805598065980759808598095981059811598125981359814598155981659817598185981959820598215982259823598245982559826598275982859829598305983159832598335983459835598365983759838598395984059841598425984359844598455984659847598485984959850598515985259853598545985559856598575985859859598605986159862598635986459865598665986759868598695987059871598725987359874598755987659877598785987959880598815988259883598845988559886598875988859889598905989159892598935989459895598965989759898598995990059901599025990359904599055990659907599085990959910599115991259913599145991559916599175991859919599205992159922599235992459925599265992759928599295993059931599325993359934599355993659937599385993959940599415994259943599445994559946599475994859949599505995159952599535995459955599565995759958599595996059961599625996359964599655996659967599685996959970599715997259973599745997559976599775997859979599805998159982599835998459985599865998759988599895999059991599925999359994599955999659997599985999960000600016000260003600046000560006600076000860009600106001160012600136001460015600166001760018600196002060021600226002360024600256002660027600286002960030600316003260033600346003560036600376003860039600406004160042600436004460045600466004760048600496005060051600526005360054600556005660057600586005960060600616006260063600646006560066600676006860069600706007160072600736007460075600766007760078600796008060081600826008360084600856008660087600886008960090600916009260093600946009560096600976009860099601006010160102601036010460105601066010760108601096011060111601126011360114601156011660117601186011960120601216012260123601246012560126601276012860129601306013160132601336013460135601366013760138601396014060141601426014360144601456014660147601486014960150601516015260153601546015560156601576015860159601606016160162601636016460165601666016760168601696017060171601726017360174601756017660177601786017960180601816018260183601846018560186601876018860189601906019160192601936019460195601966019760198601996020060201602026020360204602056020660207602086020960210602116021260213602146021560216602176021860219602206022160222602236022460225602266022760228602296023060231602326023360234602356023660237602386023960240602416024260243602446024560246602476024860249602506025160252602536025460255602566025760258602596026060261602626026360264602656026660267602686026960270602716027260273602746027560276602776027860279602806028160282602836028460285602866028760288602896029060291602926029360294602956029660297602986029960300603016030260303603046030560306603076030860309603106031160312603136031460315603166031760318603196032060321603226032360324603256032660327603286032960330603316033260333603346033560336603376033860339603406034160342603436034460345603466034760348603496035060351603526035360354603556035660357603586035960360603616036260363603646036560366603676036860369603706037160372603736037460375603766037760378603796038060381603826038360384603856038660387603886038960390603916039260393603946039560396603976039860399604006040160402604036040460405604066040760408604096041060411604126041360414604156041660417604186041960420604216042260423604246042560426604276042860429604306043160432604336043460435604366043760438604396044060441604426044360444604456044660447604486044960450604516045260453604546045560456604576045860459604606046160462604636046460465604666046760468604696047060471604726047360474604756047660477604786047960480604816048260483604846048560486604876048860489604906049160492604936049460495604966049760498604996050060501605026050360504605056050660507605086050960510605116051260513605146051560516605176051860519605206052160522605236052460525605266052760528605296053060531605326053360534605356053660537605386053960540605416054260543605446054560546605476054860549605506055160552605536055460555605566055760558605596056060561605626056360564605656056660567605686056960570605716057260573605746057560576605776057860579605806058160582605836058460585605866058760588605896059060591605926059360594605956059660597605986059960600606016060260603606046060560606606076060860609606106061160612606136061460615606166061760618606196062060621606226062360624606256062660627606286062960630606316063260633606346063560636606376063860639606406064160642606436064460645606466064760648606496065060651606526065360654606556065660657606586065960660606616066260663606646066560666606676066860669606706067160672606736067460675606766067760678606796068060681606826068360684606856068660687606886068960690606916069260693606946069560696606976069860699607006070160702607036070460705607066070760708607096071060711607126071360714607156071660717607186071960720607216072260723607246072560726607276072860729607306073160732607336073460735607366073760738607396074060741607426074360744607456074660747607486074960750607516075260753607546075560756607576075860759607606076160762607636076460765607666076760768607696077060771607726077360774607756077660777607786077960780607816078260783607846078560786607876078860789607906079160792607936079460795607966079760798607996080060801608026080360804608056080660807608086080960810608116081260813608146081560816608176081860819608206082160822608236082460825608266082760828608296083060831608326083360834608356083660837608386083960840608416084260843608446084560846608476084860849608506085160852608536085460855608566085760858608596086060861608626086360864608656086660867608686086960870608716087260873608746087560876608776087860879608806088160882608836088460885608866088760888608896089060891608926089360894608956089660897608986089960900609016090260903609046090560906609076090860909609106091160912609136091460915609166091760918609196092060921609226092360924609256092660927609286092960930609316093260933609346093560936609376093860939609406094160942609436094460945609466094760948609496095060951609526095360954609556095660957609586095960960609616096260963609646096560966609676096860969609706097160972609736097460975609766097760978609796098060981609826098360984609856098660987609886098960990609916099260993609946099560996609976099860999610006100161002610036100461005610066100761008610096101061011610126101361014610156101661017610186101961020610216102261023610246102561026610276102861029610306103161032610336103461035610366103761038610396104061041610426104361044610456104661047610486104961050610516105261053610546105561056610576105861059610606106161062610636106461065610666106761068610696107061071610726107361074610756107661077610786107961080610816108261083610846108561086610876108861089610906109161092610936109461095610966109761098610996110061101611026110361104611056110661107611086110961110611116111261113611146111561116611176111861119611206112161122611236112461125611266112761128611296113061131611326113361134611356113661137611386113961140611416114261143611446114561146611476114861149611506115161152611536115461155611566115761158611596116061161611626116361164611656116661167611686116961170611716117261173611746117561176611776117861179611806118161182611836118461185611866118761188611896119061191611926119361194611956119661197611986119961200612016120261203612046120561206612076120861209612106121161212612136121461215612166121761218612196122061221612226122361224612256122661227612286122961230612316123261233612346123561236612376123861239612406124161242612436124461245612466124761248612496125061251612526125361254612556125661257612586125961260612616126261263612646126561266612676126861269612706127161272612736127461275612766127761278612796128061281612826128361284612856128661287612886128961290612916129261293612946129561296612976129861299613006130161302613036130461305613066130761308613096131061311613126131361314613156131661317613186131961320613216132261323613246132561326613276132861329613306133161332613336133461335613366133761338613396134061341613426134361344613456134661347613486134961350613516135261353613546135561356613576135861359613606136161362613636136461365613666136761368613696137061371613726137361374613756137661377613786137961380613816138261383613846138561386613876138861389613906139161392613936139461395613966139761398613996140061401614026140361404614056140661407614086140961410614116141261413614146141561416614176141861419614206142161422614236142461425614266142761428614296143061431614326143361434614356143661437614386143961440614416144261443614446144561446614476144861449614506145161452614536145461455614566145761458614596146061461614626146361464614656146661467614686146961470614716147261473614746147561476614776147861479614806148161482614836148461485614866148761488614896149061491614926149361494614956149661497614986149961500615016150261503615046150561506615076150861509615106151161512615136151461515615166151761518615196152061521615226152361524615256152661527615286152961530615316153261533615346153561536615376153861539615406154161542615436154461545615466154761548615496155061551615526155361554615556155661557615586155961560615616156261563615646156561566615676156861569615706157161572615736157461575615766157761578615796158061581615826158361584615856158661587615886158961590615916159261593615946159561596615976159861599616006160161602616036160461605616066160761608616096161061611616126161361614616156161661617616186161961620616216162261623616246162561626616276162861629616306163161632616336163461635616366163761638616396164061641616426164361644616456164661647616486164961650616516165261653616546165561656616576165861659616606166161662616636166461665616666166761668616696167061671616726167361674616756167661677616786167961680616816168261683616846168561686616876168861689616906169161692616936169461695616966169761698616996170061701617026170361704617056170661707617086170961710617116171261713617146171561716617176171861719617206172161722617236172461725617266172761728617296173061731617326173361734617356173661737617386173961740617416174261743617446174561746617476174861749617506175161752617536175461755617566175761758617596176061761617626176361764617656176661767617686176961770617716177261773617746177561776617776177861779617806178161782617836178461785617866178761788617896179061791617926179361794617956179661797617986179961800618016180261803618046180561806618076180861809618106181161812618136181461815618166181761818618196182061821618226182361824618256182661827618286182961830618316183261833618346183561836618376183861839618406184161842618436184461845618466184761848618496185061851618526185361854618556185661857618586185961860618616186261863618646186561866618676186861869618706187161872618736187461875618766187761878618796188061881618826188361884618856188661887618886188961890618916189261893618946189561896618976189861899619006190161902619036190461905619066190761908619096191061911619126191361914619156191661917619186191961920619216192261923619246192561926619276192861929619306193161932619336193461935619366193761938619396194061941619426194361944619456194661947619486194961950619516195261953619546195561956619576195861959619606196161962619636196461965619666196761968619696197061971619726197361974619756197661977619786197961980619816198261983619846198561986619876198861989619906199161992619936199461995619966199761998619996200062001620026200362004620056200662007620086200962010620116201262013620146201562016620176201862019620206202162022620236202462025620266202762028620296203062031620326203362034620356203662037620386203962040620416204262043620446204562046620476204862049620506205162052620536205462055620566205762058620596206062061620626206362064620656206662067620686206962070620716207262073620746207562076620776207862079620806208162082620836208462085620866208762088620896209062091620926209362094620956209662097620986209962100621016210262103621046210562106621076210862109621106211162112621136211462115621166211762118621196212062121621226212362124621256212662127621286212962130621316213262133621346213562136621376213862139621406214162142621436214462145621466214762148621496215062151621526215362154621556215662157621586215962160621616216262163621646216562166621676216862169621706217162172621736217462175621766217762178621796218062181621826218362184621856218662187621886218962190621916219262193621946219562196621976219862199622006220162202622036220462205622066220762208622096221062211622126221362214622156221662217622186221962220622216222262223622246222562226622276222862229622306223162232622336223462235622366223762238622396224062241622426224362244622456224662247622486224962250622516225262253622546225562256622576225862259622606226162262622636226462265622666226762268622696227062271622726227362274622756227662277622786227962280622816228262283622846228562286622876228862289622906229162292622936229462295622966229762298622996230062301623026230362304623056230662307623086230962310623116231262313623146231562316623176231862319623206232162322623236232462325623266232762328623296233062331623326233362334623356233662337623386233962340623416234262343623446234562346623476234862349623506235162352623536235462355623566235762358623596236062361623626236362364623656236662367623686236962370623716237262373623746237562376623776237862379623806238162382623836238462385623866238762388623896239062391623926239362394623956239662397623986239962400624016240262403624046240562406624076240862409624106241162412624136241462415624166241762418624196242062421624226242362424624256242662427624286242962430624316243262433624346243562436624376243862439624406244162442624436244462445624466244762448624496245062451624526245362454624556245662457624586245962460624616246262463624646246562466624676246862469624706247162472624736247462475624766247762478624796248062481624826248362484624856248662487624886248962490624916249262493624946249562496624976249862499625006250162502625036250462505625066250762508625096251062511625126251362514625156251662517625186251962520625216252262523625246252562526625276252862529625306253162532625336253462535625366253762538625396254062541625426254362544625456254662547625486254962550625516255262553625546255562556625576255862559625606256162562625636256462565625666256762568625696257062571625726257362574625756257662577625786257962580625816258262583625846258562586625876258862589625906259162592625936259462595625966259762598625996260062601626026260362604626056260662607626086260962610626116261262613626146261562616626176261862619626206262162622626236262462625626266262762628626296263062631626326263362634626356263662637626386263962640626416264262643626446264562646626476264862649626506265162652626536265462655626566265762658626596266062661626626266362664626656266662667626686266962670626716267262673626746267562676626776267862679626806268162682626836268462685626866268762688626896269062691626926269362694626956269662697626986269962700627016270262703627046270562706627076270862709627106271162712627136271462715627166271762718627196272062721627226272362724627256272662727627286272962730627316273262733627346273562736627376273862739627406274162742627436274462745627466274762748627496275062751627526275362754627556275662757627586275962760627616276262763627646276562766627676276862769627706277162772627736277462775627766277762778627796278062781627826278362784627856278662787627886278962790627916279262793627946279562796627976279862799628006280162802628036280462805628066280762808628096281062811628126281362814628156281662817628186281962820628216282262823628246282562826628276282862829628306283162832628336283462835628366283762838628396284062841628426284362844628456284662847628486284962850628516285262853628546285562856628576285862859628606286162862628636286462865628666286762868628696287062871628726287362874628756287662877628786287962880628816288262883628846288562886628876288862889628906289162892628936289462895628966289762898628996290062901629026290362904629056290662907629086290962910629116291262913629146291562916629176291862919629206292162922629236292462925629266292762928629296293062931629326293362934629356293662937629386293962940629416294262943629446294562946629476294862949629506295162952629536295462955629566295762958629596296062961629626296362964629656296662967629686296962970629716297262973629746297562976629776297862979629806298162982629836298462985629866298762988629896299062991629926299362994629956299662997629986299963000630016300263003630046300563006630076300863009630106301163012630136301463015630166301763018630196302063021630226302363024630256302663027630286302963030630316303263033630346303563036630376303863039630406304163042630436304463045630466304763048630496305063051630526305363054630556305663057630586305963060630616306263063630646306563066630676306863069630706307163072630736307463075630766307763078630796308063081630826308363084630856308663087630886308963090630916309263093630946309563096630976309863099631006310163102631036310463105631066310763108631096311063111631126311363114631156311663117631186311963120631216312263123631246312563126631276312863129631306313163132631336313463135631366313763138631396314063141631426314363144631456314663147631486314963150631516315263153631546315563156631576315863159631606316163162631636316463165631666316763168631696317063171631726317363174631756317663177631786317963180631816318263183631846318563186631876318863189631906319163192631936319463195631966319763198631996320063201632026320363204632056320663207632086320963210632116321263213632146321563216632176321863219632206322163222632236322463225632266322763228632296323063231632326323363234632356323663237632386323963240632416324263243632446324563246632476324863249632506325163252632536325463255632566325763258632596326063261632626326363264632656326663267632686326963270632716327263273632746327563276632776327863279632806328163282632836328463285632866328763288632896329063291632926329363294632956329663297632986329963300633016330263303633046330563306633076330863309633106331163312633136331463315633166331763318633196332063321633226332363324633256332663327633286332963330633316333263333633346333563336633376333863339633406334163342633436334463345633466334763348633496335063351633526335363354633556335663357633586335963360633616336263363633646336563366633676336863369633706337163372633736337463375633766337763378633796338063381633826338363384633856338663387633886338963390633916339263393633946339563396633976339863399634006340163402634036340463405634066340763408634096341063411634126341363414634156341663417634186341963420634216342263423634246342563426634276342863429634306343163432634336343463435634366343763438634396344063441634426344363444634456344663447634486344963450634516345263453634546345563456634576345863459634606346163462634636346463465634666346763468634696347063471634726347363474634756347663477634786347963480634816348263483634846348563486634876348863489634906349163492634936349463495634966349763498634996350063501635026350363504635056350663507635086350963510635116351263513635146351563516635176351863519635206352163522635236352463525635266352763528635296353063531635326353363534635356353663537635386353963540635416354263543635446354563546635476354863549635506355163552635536355463555635566355763558635596356063561635626356363564635656356663567635686356963570635716357263573635746357563576635776357863579635806358163582635836358463585635866358763588635896359063591635926359363594635956359663597635986359963600636016360263603636046360563606636076360863609636106361163612636136361463615636166361763618636196362063621636226362363624636256362663627636286362963630636316363263633636346363563636636376363863639636406364163642636436364463645636466364763648636496365063651636526365363654636556365663657636586365963660636616366263663636646366563666636676366863669636706367163672636736367463675636766367763678636796368063681636826368363684636856368663687636886368963690636916369263693636946369563696636976369863699637006370163702637036370463705637066370763708637096371063711637126371363714637156371663717637186371963720637216372263723637246372563726637276372863729637306373163732637336373463735637366373763738637396374063741637426374363744637456374663747637486374963750637516375263753637546375563756637576375863759637606376163762637636376463765637666376763768637696377063771637726377363774637756377663777637786377963780637816378263783637846378563786637876378863789637906379163792637936379463795637966379763798637996380063801638026380363804638056380663807638086380963810638116381263813638146381563816638176381863819638206382163822638236382463825638266382763828638296383063831638326383363834638356383663837638386383963840638416384263843638446384563846638476384863849638506385163852638536385463855638566385763858638596386063861638626386363864638656386663867638686386963870638716387263873638746387563876638776387863879638806388163882638836388463885638866388763888638896389063891638926389363894638956389663897638986389963900639016390263903639046390563906639076390863909639106391163912639136391463915639166391763918639196392063921639226392363924639256392663927639286392963930639316393263933639346393563936639376393863939639406394163942639436394463945639466394763948639496395063951639526395363954639556395663957639586395963960639616396263963639646396563966639676396863969639706397163972639736397463975639766397763978639796398063981639826398363984639856398663987639886398963990639916399263993639946399563996639976399863999640006400164002640036400464005640066400764008640096401064011640126401364014640156401664017640186401964020640216402264023640246402564026640276402864029640306403164032640336403464035640366403764038640396404064041640426404364044640456404664047640486404964050640516405264053640546405564056640576405864059640606406164062640636406464065640666406764068640696407064071640726407364074640756407664077640786407964080640816408264083640846408564086640876408864089640906409164092640936409464095640966409764098640996410064101641026410364104641056410664107641086410964110641116411264113641146411564116641176411864119641206412164122641236412464125641266412764128641296413064131641326413364134641356413664137641386413964140641416414264143641446414564146641476414864149641506415164152641536415464155641566415764158641596416064161641626416364164641656416664167641686416964170641716417264173641746417564176641776417864179641806418164182641836418464185641866418764188641896419064191641926419364194641956419664197641986419964200642016420264203642046420564206642076420864209642106421164212642136421464215642166421764218642196422064221642226422364224642256422664227642286422964230642316423264233642346423564236642376423864239642406424164242642436424464245642466424764248642496425064251642526425364254642556425664257642586425964260642616426264263642646426564266642676426864269642706427164272642736427464275642766427764278642796428064281642826428364284642856428664287642886428964290642916429264293642946429564296642976429864299643006430164302643036430464305643066430764308643096431064311643126431364314643156431664317643186431964320643216432264323643246432564326643276432864329643306433164332643336433464335643366433764338643396434064341643426434364344643456434664347643486434964350643516435264353643546435564356643576435864359643606436164362643636436464365643666436764368643696437064371643726437364374643756437664377643786437964380643816438264383643846438564386643876438864389643906439164392643936439464395643966439764398643996440064401644026440364404644056440664407644086440964410644116441264413644146441564416644176441864419644206442164422644236442464425644266442764428644296443064431644326443364434644356443664437644386443964440644416444264443644446444564446644476444864449644506445164452644536445464455644566445764458644596446064461644626446364464644656446664467644686446964470644716447264473644746447564476644776447864479644806448164482644836448464485644866448764488644896449064491644926449364494644956449664497644986449964500645016450264503645046450564506645076450864509645106451164512645136451464515645166451764518645196452064521645226452364524645256452664527645286452964530645316453264533645346453564536645376453864539645406454164542645436454464545645466454764548645496455064551645526455364554645556455664557645586455964560645616456264563645646456564566645676456864569645706457164572645736457464575645766457764578645796458064581645826458364584645856458664587645886458964590645916459264593645946459564596645976459864599646006460164602646036460464605646066460764608646096461064611646126461364614646156461664617646186461964620646216462264623646246462564626646276462864629646306463164632646336463464635646366463764638646396464064641646426464364644646456464664647646486464964650646516465264653646546465564656646576465864659646606466164662646636466464665646666466764668646696467064671646726467364674646756467664677646786467964680646816468264683646846468564686646876468864689646906469164692646936469464695646966469764698646996470064701647026470364704647056470664707647086470964710647116471264713647146471564716647176471864719647206472164722647236472464725647266472764728647296473064731647326473364734647356473664737647386473964740647416474264743647446474564746647476474864749647506475164752647536475464755647566475764758647596476064761647626476364764647656476664767647686476964770647716477264773647746477564776647776477864779647806478164782647836478464785647866478764788647896479064791647926479364794647956479664797647986479964800648016480264803648046480564806648076480864809648106481164812648136481464815648166481764818648196482064821648226482364824648256482664827648286482964830648316483264833648346483564836648376483864839648406484164842648436484464845648466484764848648496485064851648526485364854648556485664857648586485964860648616486264863648646486564866648676486864869648706487164872648736487464875648766487764878648796488064881648826488364884648856488664887648886488964890648916489264893648946489564896648976489864899649006490164902649036490464905649066490764908649096491064911649126491364914649156491664917649186491964920649216492264923649246492564926649276492864929649306493164932649336493464935649366493764938649396494064941649426494364944649456494664947649486494964950649516495264953649546495564956649576495864959649606496164962649636496464965649666496764968649696497064971649726497364974649756497664977649786497964980649816498264983649846498564986649876498864989649906499164992649936499464995649966499764998649996500065001650026500365004650056500665007650086500965010650116501265013650146501565016650176501865019650206502165022650236502465025650266502765028650296503065031650326503365034650356503665037650386503965040650416504265043650446504565046650476504865049650506505165052650536505465055650566505765058650596506065061650626506365064650656506665067650686506965070650716507265073650746507565076650776507865079650806508165082650836508465085650866508765088650896509065091650926509365094650956509665097650986509965100651016510265103651046510565106651076510865109651106511165112651136511465115651166511765118651196512065121651226512365124651256512665127651286512965130651316513265133651346513565136651376513865139651406514165142651436514465145651466514765148651496515065151651526515365154651556515665157651586515965160651616516265163651646516565166651676516865169651706517165172651736517465175651766517765178651796518065181651826518365184651856518665187651886518965190651916519265193651946519565196651976519865199652006520165202652036520465205652066520765208652096521065211652126521365214652156521665217652186521965220652216522265223652246522565226652276522865229652306523165232652336523465235652366523765238652396524065241652426524365244652456524665247652486524965250652516525265253652546525565256652576525865259652606526165262652636526465265652666526765268652696527065271652726527365274652756527665277652786527965280652816528265283652846528565286652876528865289652906529165292652936529465295652966529765298652996530065301653026530365304653056530665307653086530965310653116531265313653146531565316653176531865319653206532165322653236532465325653266532765328653296533065331653326533365334653356533665337653386533965340653416534265343653446534565346653476534865349653506535165352653536535465355653566535765358653596536065361653626536365364653656536665367653686536965370653716537265373653746537565376653776537865379653806538165382653836538465385653866538765388653896539065391653926539365394653956539665397653986539965400654016540265403654046540565406654076540865409654106541165412654136541465415654166541765418654196542065421654226542365424654256542665427654286542965430654316543265433654346543565436654376543865439654406544165442654436544465445654466544765448654496545065451654526545365454654556545665457654586545965460654616546265463654646546565466654676546865469654706547165472654736547465475654766547765478654796548065481654826548365484654856548665487654886548965490654916549265493654946549565496654976549865499655006550165502655036550465505655066550765508655096551065511655126551365514655156551665517655186551965520655216552265523655246552565526655276552865529655306553165532655336553465535655366553765538655396554065541655426554365544655456554665547655486554965550655516555265553655546555565556655576555865559655606556165562655636556465565655666556765568655696557065571655726557365574655756557665577655786557965580655816558265583655846558565586655876558865589655906559165592655936559465595655966559765598655996560065601656026560365604656056560665607656086560965610656116561265613656146561565616656176561865619656206562165622656236562465625656266562765628656296563065631656326563365634656356563665637656386563965640656416564265643656446564565646656476564865649656506565165652656536565465655656566565765658656596566065661656626566365664656656566665667656686566965670656716567265673656746567565676656776567865679656806568165682656836568465685656866568765688656896569065691656926569365694656956569665697656986569965700657016570265703657046570565706657076570865709657106571165712657136571465715657166571765718657196572065721657226572365724657256572665727657286572965730657316573265733657346573565736657376573865739657406574165742657436574465745657466574765748657496575065751657526575365754657556575665757657586575965760657616576265763657646576565766657676576865769657706577165772657736577465775657766577765778657796578065781657826578365784657856578665787657886578965790657916579265793657946579565796657976579865799658006580165802658036580465805658066580765808658096581065811658126581365814658156581665817658186581965820658216582265823658246582565826658276582865829658306583165832658336583465835658366583765838658396584065841658426584365844658456584665847658486584965850658516585265853658546585565856658576585865859658606586165862658636586465865658666586765868658696587065871658726587365874658756587665877658786587965880658816588265883658846588565886658876588865889658906589165892658936589465895658966589765898658996590065901659026590365904659056590665907659086590965910659116591265913659146591565916659176591865919659206592165922659236592465925659266592765928659296593065931659326593365934659356593665937659386593965940659416594265943659446594565946659476594865949659506595165952659536595465955659566595765958659596596065961659626596365964659656596665967659686596965970659716597265973659746597565976659776597865979659806598165982659836598465985659866598765988659896599065991659926599365994659956599665997659986599966000660016600266003660046600566006660076600866009660106601166012660136601466015660166601766018660196602066021660226602366024660256602666027660286602966030660316603266033660346603566036660376603866039660406604166042660436604466045660466604766048660496605066051660526605366054660556605666057660586605966060660616606266063660646606566066660676606866069660706607166072660736607466075660766607766078660796608066081660826608366084660856608666087660886608966090660916609266093660946609566096660976609866099661006610166102661036610466105661066610766108661096611066111661126611366114661156611666117661186611966120661216612266123661246612566126661276612866129661306613166132661336613466135661366613766138661396614066141661426614366144661456614666147661486614966150661516615266153661546615566156661576615866159661606616166162661636616466165661666616766168661696617066171661726617366174661756617666177661786617966180661816618266183661846618566186661876618866189661906619166192661936619466195661966619766198661996620066201662026620366204662056620666207662086620966210662116621266213662146621566216662176621866219662206622166222662236622466225662266622766228662296623066231662326623366234662356623666237662386623966240662416624266243662446624566246662476624866249662506625166252662536625466255662566625766258662596626066261662626626366264662656626666267662686626966270662716627266273662746627566276662776627866279662806628166282662836628466285662866628766288662896629066291662926629366294662956629666297662986629966300663016630266303663046630566306663076630866309663106631166312663136631466315663166631766318663196632066321663226632366324663256632666327663286632966330663316633266333663346633566336663376633866339663406634166342663436634466345663466634766348663496635066351663526635366354663556635666357663586635966360663616636266363663646636566366663676636866369663706637166372663736637466375663766637766378663796638066381663826638366384663856638666387663886638966390663916639266393663946639566396663976639866399664006640166402664036640466405664066640766408664096641066411664126641366414664156641666417664186641966420664216642266423664246642566426664276642866429664306643166432664336643466435664366643766438664396644066441664426644366444664456644666447664486644966450664516645266453664546645566456664576645866459664606646166462664636646466465664666646766468664696647066471664726647366474664756647666477664786647966480664816648266483664846648566486664876648866489664906649166492664936649466495664966649766498664996650066501665026650366504665056650666507665086650966510665116651266513665146651566516665176651866519665206652166522665236652466525665266652766528665296653066531665326653366534665356653666537665386653966540665416654266543665446654566546665476654866549665506655166552665536655466555665566655766558665596656066561665626656366564665656656666567665686656966570665716657266573665746657566576665776657866579665806658166582665836658466585665866658766588665896659066591665926659366594665956659666597665986659966600666016660266603666046660566606666076660866609666106661166612666136661466615666166661766618666196662066621666226662366624666256662666627666286662966630666316663266633666346663566636666376663866639666406664166642666436664466645666466664766648666496665066651666526665366654666556665666657666586665966660666616666266663666646666566666666676666866669666706667166672666736667466675666766667766678666796668066681666826668366684666856668666687666886668966690666916669266693666946669566696666976669866699667006670166702667036670466705667066670766708667096671066711667126671366714667156671666717667186671966720667216672266723667246672566726667276672866729667306673166732667336673466735667366673766738667396674066741667426674366744667456674666747667486674966750667516675266753667546675566756667576675866759667606676166762667636676466765667666676766768667696677066771667726677366774667756677666777667786677966780667816678266783667846678566786667876678866789667906679166792667936679466795667966679766798667996680066801668026680366804668056680666807668086680966810668116681266813668146681566816668176681866819668206682166822668236682466825668266682766828668296683066831668326683366834668356683666837668386683966840668416684266843668446684566846668476684866849668506685166852668536685466855668566685766858668596686066861668626686366864668656686666867668686686966870668716687266873668746687566876668776687866879668806688166882668836688466885668866688766888668896689066891668926689366894668956689666897668986689966900669016690266903669046690566906669076690866909669106691166912669136691466915669166691766918669196692066921669226692366924669256692666927669286692966930669316693266933669346693566936669376693866939669406694166942669436694466945669466694766948669496695066951669526695366954669556695666957669586695966960669616696266963669646696566966669676696866969669706697166972669736697466975669766697766978669796698066981669826698366984669856698666987669886698966990669916699266993669946699566996669976699866999670006700167002670036700467005670066700767008670096701067011670126701367014670156701667017670186701967020670216702267023670246702567026670276702867029670306703167032670336703467035670366703767038670396704067041670426704367044670456704667047670486704967050670516705267053670546705567056670576705867059670606706167062670636706467065670666706767068670696707067071670726707367074670756707667077670786707967080670816708267083670846708567086670876708867089670906709167092670936709467095670966709767098670996710067101671026710367104671056710667107671086710967110671116711267113671146711567116671176711867119671206712167122671236712467125671266712767128671296713067131671326713367134671356713667137671386713967140671416714267143671446714567146671476714867149671506715167152671536715467155671566715767158671596716067161671626716367164671656716667167671686716967170671716717267173671746717567176671776717867179671806718167182671836718467185671866718767188671896719067191671926719367194671956719667197671986719967200672016720267203672046720567206672076720867209672106721167212672136721467215672166721767218672196722067221672226722367224672256722667227672286722967230672316723267233672346723567236672376723867239672406724167242672436724467245672466724767248672496725067251672526725367254672556725667257672586725967260672616726267263672646726567266672676726867269672706727167272672736727467275672766727767278672796728067281672826728367284672856728667287672886728967290672916729267293672946729567296672976729867299673006730167302673036730467305673066730767308673096731067311673126731367314673156731667317673186731967320673216732267323673246732567326673276732867329673306733167332673336733467335673366733767338673396734067341673426734367344673456734667347673486734967350673516735267353673546735567356673576735867359673606736167362673636736467365673666736767368673696737067371673726737367374673756737667377673786737967380673816738267383673846738567386673876738867389673906739167392673936739467395673966739767398673996740067401674026740367404674056740667407674086740967410674116741267413674146741567416674176741867419674206742167422674236742467425674266742767428674296743067431674326743367434674356743667437674386743967440674416744267443674446744567446674476744867449674506745167452674536745467455674566745767458674596746067461674626746367464674656746667467674686746967470674716747267473674746747567476674776747867479674806748167482674836748467485674866748767488674896749067491674926749367494674956749667497674986749967500675016750267503675046750567506675076750867509675106751167512675136751467515675166751767518675196752067521675226752367524675256752667527675286752967530675316753267533675346753567536675376753867539675406754167542675436754467545675466754767548675496755067551675526755367554675556755667557675586755967560675616756267563675646756567566675676756867569675706757167572675736757467575675766757767578675796758067581675826758367584675856758667587675886758967590675916759267593675946759567596675976759867599676006760167602676036760467605676066760767608676096761067611676126761367614676156761667617676186761967620676216762267623676246762567626676276762867629676306763167632676336763467635676366763767638676396764067641676426764367644676456764667647676486764967650676516765267653676546765567656676576765867659676606766167662676636766467665676666766767668676696767067671676726767367674676756767667677676786767967680676816768267683676846768567686676876768867689676906769167692676936769467695676966769767698676996770067701677026770367704677056770667707677086770967710677116771267713677146771567716677176771867719677206772167722677236772467725677266772767728677296773067731677326773367734677356773667737677386773967740677416774267743677446774567746677476774867749677506775167752677536775467755677566775767758677596776067761677626776367764677656776667767677686776967770677716777267773677746777567776677776777867779677806778167782677836778467785677866778767788677896779067791677926779367794677956779667797677986779967800678016780267803678046780567806678076780867809678106781167812678136781467815678166781767818678196782067821678226782367824678256782667827678286782967830678316783267833678346783567836678376783867839678406784167842678436784467845678466784767848678496785067851678526785367854678556785667857678586785967860678616786267863678646786567866678676786867869678706787167872678736787467875678766787767878678796788067881678826788367884678856788667887678886788967890678916789267893678946789567896678976789867899679006790167902679036790467905679066790767908679096791067911679126791367914679156791667917679186791967920679216792267923679246792567926679276792867929679306793167932679336793467935679366793767938679396794067941679426794367944679456794667947679486794967950679516795267953679546795567956679576795867959679606796167962679636796467965679666796767968679696797067971679726797367974679756797667977679786797967980679816798267983679846798567986679876798867989679906799167992679936799467995679966799767998679996800068001680026800368004680056800668007680086800968010680116801268013680146801568016680176801868019680206802168022680236802468025680266802768028680296803068031680326803368034680356803668037680386803968040680416804268043680446804568046680476804868049680506805168052680536805468055680566805768058680596806068061680626806368064680656806668067680686806968070680716807268073680746807568076680776807868079680806808168082680836808468085680866808768088680896809068091680926809368094680956809668097680986809968100681016810268103681046810568106681076810868109681106811168112681136811468115681166811768118681196812068121681226812368124681256812668127681286812968130681316813268133681346813568136681376813868139681406814168142681436814468145681466814768148681496815068151681526815368154681556815668157681586815968160681616816268163681646816568166681676816868169681706817168172681736817468175681766817768178681796818068181681826818368184681856818668187681886818968190681916819268193681946819568196681976819868199682006820168202682036820468205682066820768208682096821068211682126821368214682156821668217682186821968220682216822268223682246822568226682276822868229682306823168232682336823468235682366823768238682396824068241682426824368244682456824668247682486824968250682516825268253682546825568256682576825868259682606826168262682636826468265682666826768268682696827068271682726827368274682756827668277682786827968280682816828268283682846828568286682876828868289682906829168292682936829468295682966829768298682996830068301683026830368304683056830668307683086830968310683116831268313683146831568316683176831868319683206832168322683236832468325683266832768328683296833068331683326833368334683356833668337683386833968340683416834268343683446834568346683476834868349683506835168352683536835468355683566835768358683596836068361683626836368364683656836668367683686836968370683716837268373683746837568376683776837868379683806838168382683836838468385683866838768388683896839068391683926839368394683956839668397683986839968400684016840268403684046840568406684076840868409684106841168412684136841468415684166841768418684196842068421684226842368424684256842668427684286842968430684316843268433684346843568436684376843868439684406844168442684436844468445684466844768448684496845068451684526845368454684556845668457684586845968460684616846268463684646846568466684676846868469684706847168472684736847468475684766847768478684796848068481684826848368484684856848668487684886848968490684916849268493684946849568496684976849868499685006850168502685036850468505685066850768508685096851068511685126851368514685156851668517685186851968520685216852268523685246852568526685276852868529685306853168532685336853468535685366853768538685396854068541685426854368544685456854668547685486854968550685516855268553685546855568556685576855868559685606856168562685636856468565685666856768568685696857068571685726857368574685756857668577685786857968580685816858268583685846858568586685876858868589685906859168592685936859468595685966859768598685996860068601686026860368604686056860668607686086860968610686116861268613686146861568616686176861868619686206862168622686236862468625686266862768628686296863068631686326863368634686356863668637686386863968640686416864268643686446864568646686476864868649686506865168652686536865468655686566865768658686596866068661686626866368664686656866668667686686866968670686716867268673686746867568676686776867868679686806868168682686836868468685686866868768688686896869068691686926869368694686956869668697686986869968700687016870268703687046870568706687076870868709687106871168712687136871468715687166871768718687196872068721687226872368724687256872668727687286872968730687316873268733687346873568736687376873868739687406874168742687436874468745687466874768748687496875068751687526875368754687556875668757687586875968760687616876268763687646876568766687676876868769687706877168772687736877468775687766877768778687796878068781687826878368784687856878668787687886878968790687916879268793687946879568796687976879868799688006880168802688036880468805688066880768808688096881068811688126881368814688156881668817688186881968820688216882268823688246882568826688276882868829688306883168832688336883468835688366883768838688396884068841688426884368844688456884668847688486884968850688516885268853688546885568856688576885868859688606886168862688636886468865688666886768868688696887068871688726887368874688756887668877688786887968880688816888268883688846888568886688876888868889688906889168892688936889468895688966889768898688996890068901689026890368904689056890668907689086890968910689116891268913689146891568916689176891868919689206892168922689236892468925689266892768928689296893068931689326893368934689356893668937689386893968940689416894268943689446894568946689476894868949689506895168952689536895468955689566895768958689596896068961689626896368964689656896668967689686896968970689716897268973689746897568976689776897868979689806898168982689836898468985689866898768988689896899068991689926899368994689956899668997689986899969000690016900269003690046900569006690076900869009690106901169012690136901469015690166901769018690196902069021690226902369024690256902669027690286902969030690316903269033690346903569036690376903869039690406904169042690436904469045690466904769048690496905069051690526905369054690556905669057690586905969060690616906269063690646906569066690676906869069690706907169072690736907469075690766907769078690796908069081690826908369084690856908669087690886908969090690916909269093690946909569096690976909869099691006910169102691036910469105691066910769108691096911069111691126911369114691156911669117691186911969120691216912269123691246912569126691276912869129691306913169132691336913469135691366913769138691396914069141691426914369144691456914669147691486914969150691516915269153691546915569156691576915869159691606916169162691636916469165691666916769168691696917069171691726917369174691756917669177691786917969180691816918269183691846918569186691876918869189691906919169192691936919469195691966919769198691996920069201692026920369204692056920669207692086920969210692116921269213692146921569216692176921869219692206922169222692236922469225692266922769228692296923069231692326923369234692356923669237692386923969240692416924269243692446924569246692476924869249692506925169252692536925469255692566925769258692596926069261692626926369264692656926669267692686926969270692716927269273692746927569276692776927869279692806928169282692836928469285692866928769288692896929069291692926929369294692956929669297692986929969300693016930269303693046930569306693076930869309693106931169312693136931469315693166931769318693196932069321693226932369324693256932669327693286932969330693316933269333693346933569336693376933869339693406934169342693436934469345693466934769348693496935069351693526935369354693556935669357693586935969360693616936269363693646936569366693676936869369693706937169372693736937469375693766937769378693796938069381693826938369384693856938669387693886938969390693916939269393693946939569396693976939869399694006940169402694036940469405694066940769408694096941069411694126941369414694156941669417694186941969420694216942269423694246942569426694276942869429694306943169432694336943469435694366943769438694396944069441694426944369444694456944669447694486944969450694516945269453694546945569456694576945869459694606946169462694636946469465694666946769468694696947069471694726947369474694756947669477694786947969480694816948269483694846948569486694876948869489694906949169492694936949469495694966949769498694996950069501695026950369504695056950669507695086950969510695116951269513695146951569516695176951869519695206952169522695236952469525695266952769528695296953069531695326953369534695356953669537695386953969540695416954269543695446954569546695476954869549695506955169552695536955469555695566955769558695596956069561695626956369564695656956669567695686956969570695716957269573695746957569576695776957869579695806958169582695836958469585695866958769588695896959069591695926959369594695956959669597695986959969600696016960269603696046960569606696076960869609696106961169612696136961469615696166961769618696196962069621696226962369624696256962669627696286962969630696316963269633696346963569636696376963869639696406964169642696436964469645696466964769648696496965069651696526965369654696556965669657696586965969660696616966269663696646966569666696676966869669696706967169672696736967469675696766967769678696796968069681696826968369684696856968669687696886968969690696916969269693696946969569696
  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: Number,
  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. /* harmony import */ var _components_CircleSpinner_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../components/CircleSpinner.vue */ "./resources/js/components/CircleSpinner.vue");
  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. //
  2426. /* harmony default export */ __webpack_exports__["default"] = ({
  2427. components: {
  2428. Modal: _components_Modal_vue__WEBPACK_IMPORTED_MODULE_0__["default"],
  2429. AutocompleteCustomDropdown: _components_AutocompleteCustomDropdown_vue__WEBPACK_IMPORTED_MODULE_1__["default"],
  2430. ErrorList: _components_ErrorList_vue__WEBPACK_IMPORTED_MODULE_2__["default"],
  2431. CircleSpinner: _components_CircleSpinner_vue__WEBPACK_IMPORTED_MODULE_3__["default"]
  2432. },
  2433. props: {
  2434. populateWith: {
  2435. type: Object,
  2436. required: true
  2437. },
  2438. storeList: {
  2439. type: Object,
  2440. required: true
  2441. },
  2442. modalId: {
  2443. type: String,
  2444. required: true
  2445. }
  2446. },
  2447. data: function data() {
  2448. return {
  2449. // Copies object from prop, so it doesn't mutate the object
  2450. // from the parent component. Parent component will be updated via
  2451. // Websocket if updateWorkOrder is successful.
  2452. data: JSON.parse(JSON.stringify(this.populateWith)),
  2453. id: this.modalId,
  2454. store: {},
  2455. errors: [],
  2456. woInfoSaving: false
  2457. };
  2458. },
  2459. methods: {
  2460. updateWorkOrder: function updateWorkOrder() {
  2461. var _this = this;
  2462. this.woInfoSaving = true;
  2463. this.data.storeid = this.store.id;
  2464. axios.put('/api/workorders/' + this.data.woid, this.data).then(function (response) {
  2465. _this.woInfoSaving = false;
  2466. $('#workordereditModal').modal('hide');
  2467. })["catch"](function (error) {
  2468. _this.woInfoSaving = false;
  2469. _this.errors = JSON.parse(error.response.request.response).errors;
  2470. });
  2471. }
  2472. },
  2473. mounted: function mounted() {
  2474. this.store = {
  2475. 'id': this.data.storeid,
  2476. 'name': this.storeList[this.data.storeid]
  2477. };
  2478. },
  2479. // This was originally here because the populateWith info would originally
  2480. // not necessarily be loaded when this component was mounted. That is no
  2481. // longer the case as I now don't render the parent component until the
  2482. // ajax request is finised. The watch statements are still here to cover
  2483. // the case where someone else updates the populateWith values while
  2484. // someone is editing, although it probably should be edited so it doesn't
  2485. // immediately overwrite the unsaved edits of the current user.
  2486. watch: {
  2487. populateWith: function populateWith(value) {
  2488. this.data = JSON.parse(JSON.stringify(this.populateWith));
  2489. this.store = {
  2490. 'id': this.data.storeid,
  2491. 'name': this.storeList[this.data.storeid]
  2492. };
  2493. },
  2494. storeList: function storeList(value) {
  2495. this.store = {
  2496. 'id': this.data.storeid,
  2497. 'name': this.storeList[this.data.storeid]
  2498. };
  2499. }
  2500. }
  2501. });
  2502. /***/ }),
  2503. /***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/WorkOrderInfo.vue?vue&type=script&lang=js&":
  2504. /*!************************************************************************************************************************************************************************!*\
  2505. !*** ./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& ***!
  2506. \************************************************************************************************************************************************************************/
  2507. /*! exports provided: default */
  2508. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2509. "use strict";
  2510. __webpack_require__.r(__webpack_exports__);
  2511. /* harmony import */ var _mixins_dateMixin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../mixins/dateMixin */ "./resources/js/mixins/dateMixin.js");
  2512. /* harmony import */ var _components_WoInfoEditModal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/WoInfoEditModal */ "./resources/js/components/WoInfoEditModal.vue");
  2513. //
  2514. //
  2515. //
  2516. //
  2517. //
  2518. //
  2519. //
  2520. //
  2521. //
  2522. //
  2523. //
  2524. //
  2525. //
  2526. //
  2527. //
  2528. //
  2529. //
  2530. //
  2531. //
  2532. //
  2533. /* harmony default export */ __webpack_exports__["default"] = ({
  2534. components: {
  2535. WoInfoEditModal: _components_WoInfoEditModal__WEBPACK_IMPORTED_MODULE_1__["default"]
  2536. },
  2537. mixins: [_mixins_dateMixin__WEBPACK_IMPORTED_MODULE_0__["default"]],
  2538. props: ['workOrder', 'stores'],
  2539. computed: {
  2540. storeList: function storeList() {
  2541. var list = {};
  2542. Object.values(this.stores).map(function (val) {
  2543. list[val.storeid] = val.storesname;
  2544. });
  2545. return list;
  2546. }
  2547. }
  2548. });
  2549. /***/ }),
  2550. /***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/views/App.vue?vue&type=script&lang=js&":
  2551. /*!*********************************************************************************************************************************************************!*\
  2552. !*** ./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& ***!
  2553. \*********************************************************************************************************************************************************/
  2554. /*! exports provided: default */
  2555. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2556. "use strict";
  2557. __webpack_require__.r(__webpack_exports__);
  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. //
  2628. //
  2629. /* harmony default export */ __webpack_exports__["default"] = ({
  2630. data: function data() {
  2631. return {
  2632. isLoggedIn: null,
  2633. username: null
  2634. };
  2635. },
  2636. mounted: function mounted() {
  2637. this.isLoggedIn = localStorage.getItem('jwt');
  2638. this.username = localStorage.getItem('user');
  2639. }
  2640. });
  2641. /***/ }),
  2642. /***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/views/Dashboard.vue?vue&type=script&lang=js&":
  2643. /*!***************************************************************************************************************************************************************!*\
  2644. !*** ./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& ***!
  2645. \***************************************************************************************************************************************************************/
  2646. /*! exports provided: default */
  2647. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2648. "use strict";
  2649. __webpack_require__.r(__webpack_exports__);
  2650. /* harmony import */ var _components_CircleSpinner_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../components/CircleSpinner.vue */ "./resources/js/components/CircleSpinner.vue");
  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. //
  2676. //
  2677. /* harmony default export */ __webpack_exports__["default"] = ({
  2678. components: {
  2679. CircleSpinner: _components_CircleSpinner_vue__WEBPACK_IMPORTED_MODULE_0__["default"]
  2680. },
  2681. data: function data() {
  2682. return {
  2683. workOrders: [],
  2684. isLoading: true
  2685. };
  2686. },
  2687. mounted: function mounted() {
  2688. var _this = this;
  2689. var token = localStorage.getItem('jwt');
  2690. var user = localStorage.getItem('user');
  2691. axios.defaults.headers.common['Content-Type'] = 'application/json';
  2692. axios.defaults.headers.common['Authorization'] = 'Bearer ' + token;
  2693. axios.get('api/users/' + user + '/workorders').then(function (response) {
  2694. _this.workOrders = response.data;
  2695. _this.isLoading = false;
  2696. })["catch"](function (error) {
  2697. console.log(error);
  2698. });
  2699. },
  2700. beforeRouteEnter: function beforeRouteEnter(to, from, next) {
  2701. if (!localStorage.getItem('jwt')) {
  2702. return next('login');
  2703. }
  2704. next();
  2705. }
  2706. });
  2707. /***/ }),
  2708. /***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/views/Login.vue?vue&type=script&lang=js&":
  2709. /*!***********************************************************************************************************************************************************!*\
  2710. !*** ./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& ***!
  2711. \***********************************************************************************************************************************************************/
  2712. /*! exports provided: default */
  2713. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2714. "use strict";
  2715. __webpack_require__.r(__webpack_exports__);
  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. //
  2754. //
  2755. /* harmony default export */ __webpack_exports__["default"] = ({
  2756. data: function data() {
  2757. return {
  2758. username: "",
  2759. password: ""
  2760. };
  2761. },
  2762. methods: {
  2763. handleSubmit: function handleSubmit(e) {
  2764. var _this = this;
  2765. e.preventDefault();
  2766. if (this.password.length > 0) {
  2767. axios.post('api/login', {
  2768. username: this.username,
  2769. password: this.password
  2770. }).then(function (response) {
  2771. localStorage.setItem('user', response.data.success.username);
  2772. localStorage.setItem('jwt', response.data.success.token);
  2773. if (localStorage.getItem('jwt') != null) {
  2774. _this.$router.go('/dashboard');
  2775. }
  2776. })["catch"](function (error) {
  2777. console.error(error);
  2778. });
  2779. }
  2780. }
  2781. },
  2782. beforeRouteEnter: function beforeRouteEnter(to, from, next) {
  2783. if (localStorage.getItem('jwt')) {
  2784. return next('dashboard');
  2785. }
  2786. next();
  2787. }
  2788. });
  2789. /***/ }),
  2790. /***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/views/Welcome.vue?vue&type=script&lang=js&":
  2791. /*!*************************************************************************************************************************************************************!*\
  2792. !*** ./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& ***!
  2793. \*************************************************************************************************************************************************************/
  2794. /*! exports provided: default */
  2795. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2796. "use strict";
  2797. __webpack_require__.r(__webpack_exports__);
  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. //
  2848. //
  2849. /* harmony default export */ __webpack_exports__["default"] = ({});
  2850. /***/ }),
  2851. /***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/views/WorkOrder.vue?vue&type=script&lang=js&":
  2852. /*!***************************************************************************************************************************************************************!*\
  2853. !*** ./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& ***!
  2854. \***************************************************************************************************************************************************************/
  2855. /*! exports provided: default */
  2856. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2857. "use strict";
  2858. __webpack_require__.r(__webpack_exports__);
  2859. /* harmony import */ var _components_WorkOrderInfo_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../components/WorkOrderInfo.vue */ "./resources/js/components/WorkOrderInfo.vue");
  2860. /* harmony import */ var _components_AssetInfo_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/AssetInfo.vue */ "./resources/js/components/AssetInfo.vue");
  2861. /* harmony import */ var _components_CircleSpinner_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../components/CircleSpinner.vue */ "./resources/js/components/CircleSpinner.vue");
  2862. /* harmony import */ var _components_CredentialList_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../components/CredentialList.vue */ "./resources/js/components/CredentialList.vue");
  2863. /* harmony import */ var _components_Notes_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../components/Notes.vue */ "./resources/js/components/Notes.vue");
  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. //
  2964. //
  2965. /* harmony default export */ __webpack_exports__["default"] = ({
  2966. components: {
  2967. WorkOrderInfo: _components_WorkOrderInfo_vue__WEBPACK_IMPORTED_MODULE_0__["default"],
  2968. AssetInfo: _components_AssetInfo_vue__WEBPACK_IMPORTED_MODULE_1__["default"],
  2969. CircleSpinner: _components_CircleSpinner_vue__WEBPACK_IMPORTED_MODULE_2__["default"],
  2970. CredentialList: _components_CredentialList_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  2971. Notes: _components_Notes_vue__WEBPACK_IMPORTED_MODULE_4__["default"]
  2972. },
  2973. props: {
  2974. id: {
  2975. type: String,
  2976. required: true
  2977. }
  2978. },
  2979. data: function data() {
  2980. return {
  2981. workOrder: {},
  2982. asset: {},
  2983. stores: {},
  2984. credentials: {},
  2985. credentialDescriptions: {},
  2986. workOrderNotes: [],
  2987. woLoading: true,
  2988. assetLoading: true,
  2989. storesLoading: true,
  2990. credentialsLoading: true,
  2991. credentialDescriptionsLoading: true,
  2992. workOrderNotesLoading: true,
  2993. authUser: localStorage.getItem('user')
  2994. };
  2995. },
  2996. computed: {
  2997. publicNotes: function publicNotes() {
  2998. var notes = [];
  2999. notes = this.workOrderNotes.filter(function (note) {
  3000. return note.notetype === 0;
  3001. });
  3002. return notes;
  3003. },
  3004. privateNotes: function privateNotes() {
  3005. var notes = [];
  3006. notes = this.workOrderNotes.filter(function (note) {
  3007. return note.notetype === 1;
  3008. });
  3009. return notes;
  3010. }
  3011. },
  3012. mounted: function mounted() {
  3013. var _this = this;
  3014. // Get authentication info from current user from local storage
  3015. var token = localStorage.getItem('jwt');
  3016. var user = localStorage.getItem('user'); // Set some axios config options for Content-Type and Authentication.
  3017. axios.defaults.headers.common['Content-Type'] = 'application/json';
  3018. axios.defaults.headers.common['Authorization'] = 'Bearer ' + token; // Get WorkOrder from API
  3019. axios.get('/api/workorders/' + this.id).then(function (response) {
  3020. _this.workOrder = response.data;
  3021. _this.woLoading = false;
  3022. })["catch"](function (error) {
  3023. console.log(error);
  3024. }); // Get list of stores from API
  3025. axios.get('/api/stores/').then(function (response) {
  3026. _this.stores = response.data;
  3027. _this.storesLoading = false;
  3028. })["catch"](function (error) {
  3029. console.log(error);
  3030. }); // Get Asset from API (will most likely be replaced with list of assets
  3031. // in the future. Current each WO can only have one but that is likely
  3032. // to change)
  3033. axios.get("/api/workorders/".concat(this.id, "/asset")).then(function (response) {
  3034. _this.asset = response.data;
  3035. _this.assetLoading = false; // Get Credentials for this asset. May be relocated to be part of asset
  3036. // Component when WOs can have more than one asset.
  3037. axios.get("/api/assets/".concat(_this.asset.pcid, "/credentials")).then(function (response) {
  3038. _this.credentials = response.data;
  3039. _this.credentialsLoading = false;
  3040. })["catch"](function (error) {
  3041. console.log(error);
  3042. }); // Get default list of Credential Descriptions. May be relocated along with
  3043. // the above.
  3044. axios.get('/api/credentials/descriptions').then(function (response) {
  3045. _this.credentialDescriptions = response.data;
  3046. _this.credentialDescriptionsLoading = false;
  3047. })["catch"](function (error) {
  3048. console.log(error);
  3049. });
  3050. })["catch"](function (error) {
  3051. console.log(error);
  3052. });
  3053. axios.get("/api/workorders/".concat(this.id, "/notes")).then(function (response) {
  3054. _this.workOrderNotes = response.data;
  3055. _this.workOrderNotesLoading = false;
  3056. })["catch"](function (error) {
  3057. console.log(error);
  3058. });
  3059. Echo.channel('work-order.' + this.id).listen('WorkOrderUpdated', function (e) {
  3060. _this.workOrder = e.data;
  3061. });
  3062. Echo.channel('wonotes.' + this.id).listen('WorkOrderNoteAdded', function (e) {
  3063. _this.workOrderNotes.push(e.note);
  3064. }).listen('WorkOrderNoteUpdated', function (e) {
  3065. var index = _this.workOrderNotes.findIndex(function (note) {
  3066. return note.noteid === e.note.noteid;
  3067. }); // Note has to be edited this way, or else Vue cannot
  3068. // see it to recompute the computed values.
  3069. _this.workOrderNotes.splice(index, 1, e.note);
  3070. }).listen('WorkOrderNoteDeleted', function (e) {
  3071. var index = _this.notes.findIndex(function (note) {
  3072. return note.noteid === e.noteid;
  3073. });
  3074. _this.notes.splice(index, 1);
  3075. });
  3076. }
  3077. });
  3078. /***/ }),
  3079. /***/ "./node_modules/base64-js/index.js":
  3080. /*!*****************************************!*\
  3081. !*** ./node_modules/base64-js/index.js ***!
  3082. \*****************************************/
  3083. /*! no static exports found */
  3084. /***/ (function(module, exports, __webpack_require__) {
  3085. "use strict";
  3086. exports.byteLength = byteLength
  3087. exports.toByteArray = toByteArray
  3088. exports.fromByteArray = fromByteArray
  3089. var lookup = []
  3090. var revLookup = []
  3091. var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
  3092. var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
  3093. for (var i = 0, len = code.length; i < len; ++i) {
  3094. lookup[i] = code[i]
  3095. revLookup[code.charCodeAt(i)] = i
  3096. }
  3097. // Support decoding URL-safe base64 strings, as Node.js does.
  3098. // See: https://en.wikipedia.org/wiki/Base64#URL_applications
  3099. revLookup['-'.charCodeAt(0)] = 62
  3100. revLookup['_'.charCodeAt(0)] = 63
  3101. function getLens (b64) {
  3102. var len = b64.length
  3103. if (len % 4 > 0) {
  3104. throw new Error('Invalid string. Length must be a multiple of 4')
  3105. }
  3106. // Trim off extra bytes after placeholder bytes are found
  3107. // See: https://github.com/beatgammit/base64-js/issues/42
  3108. var validLen = b64.indexOf('=')
  3109. if (validLen === -1) validLen = len
  3110. var placeHoldersLen = validLen === len
  3111. ? 0
  3112. : 4 - (validLen % 4)
  3113. return [validLen, placeHoldersLen]
  3114. }
  3115. // base64 is 4/3 + up to two characters of the original data
  3116. function byteLength (b64) {
  3117. var lens = getLens(b64)
  3118. var validLen = lens[0]
  3119. var placeHoldersLen = lens[1]
  3120. return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
  3121. }
  3122. function _byteLength (b64, validLen, placeHoldersLen) {
  3123. return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
  3124. }
  3125. function toByteArray (b64) {
  3126. var tmp
  3127. var lens = getLens(b64)
  3128. var validLen = lens[0]
  3129. var placeHoldersLen = lens[1]
  3130. var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
  3131. var curByte = 0
  3132. // if there are placeholders, only get up to the last complete 4 chars
  3133. var len = placeHoldersLen > 0
  3134. ? validLen - 4
  3135. : validLen
  3136. var i
  3137. for (i = 0; i < len; i += 4) {
  3138. tmp =
  3139. (revLookup[b64.charCodeAt(i)] << 18) |
  3140. (revLookup[b64.charCodeAt(i + 1)] << 12) |
  3141. (revLookup[b64.charCodeAt(i + 2)] << 6) |
  3142. revLookup[b64.charCodeAt(i + 3)]
  3143. arr[curByte++] = (tmp >> 16) & 0xFF
  3144. arr[curByte++] = (tmp >> 8) & 0xFF
  3145. arr[curByte++] = tmp & 0xFF
  3146. }
  3147. if (placeHoldersLen === 2) {
  3148. tmp =
  3149. (revLookup[b64.charCodeAt(i)] << 2) |
  3150. (revLookup[b64.charCodeAt(i + 1)] >> 4)
  3151. arr[curByte++] = tmp & 0xFF
  3152. }
  3153. if (placeHoldersLen === 1) {
  3154. tmp =
  3155. (revLookup[b64.charCodeAt(i)] << 10) |
  3156. (revLookup[b64.charCodeAt(i + 1)] << 4) |
  3157. (revLookup[b64.charCodeAt(i + 2)] >> 2)
  3158. arr[curByte++] = (tmp >> 8) & 0xFF
  3159. arr[curByte++] = tmp & 0xFF
  3160. }
  3161. return arr
  3162. }
  3163. function tripletToBase64 (num) {
  3164. return lookup[num >> 18 & 0x3F] +
  3165. lookup[num >> 12 & 0x3F] +
  3166. lookup[num >> 6 & 0x3F] +
  3167. lookup[num & 0x3F]
  3168. }
  3169. function encodeChunk (uint8, start, end) {
  3170. var tmp
  3171. var output = []
  3172. for (var i = start; i < end; i += 3) {
  3173. tmp =
  3174. ((uint8[i] << 16) & 0xFF0000) +
  3175. ((uint8[i + 1] << 8) & 0xFF00) +
  3176. (uint8[i + 2] & 0xFF)
  3177. output.push(tripletToBase64(tmp))
  3178. }
  3179. return output.join('')
  3180. }
  3181. function fromByteArray (uint8) {
  3182. var tmp
  3183. var len = uint8.length
  3184. var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
  3185. var parts = []
  3186. var maxChunkLength = 16383 // must be multiple of 3
  3187. // go through the array every three bytes, we'll deal with trailing stuff later
  3188. for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
  3189. parts.push(encodeChunk(
  3190. uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)
  3191. ))
  3192. }
  3193. // pad the end with zeros, but make sure to not forget the extra bytes
  3194. if (extraBytes === 1) {
  3195. tmp = uint8[len - 1]
  3196. parts.push(
  3197. lookup[tmp >> 2] +
  3198. lookup[(tmp << 4) & 0x3F] +
  3199. '=='
  3200. )
  3201. } else if (extraBytes === 2) {
  3202. tmp = (uint8[len - 2] << 8) + uint8[len - 1]
  3203. parts.push(
  3204. lookup[tmp >> 10] +
  3205. lookup[(tmp >> 4) & 0x3F] +
  3206. lookup[(tmp << 2) & 0x3F] +
  3207. '='
  3208. )
  3209. }
  3210. return parts.join('')
  3211. }
  3212. /***/ }),
  3213. /***/ "./node_modules/bootstrap/dist/js/bootstrap.js":
  3214. /*!*****************************************************!*\
  3215. !*** ./node_modules/bootstrap/dist/js/bootstrap.js ***!
  3216. \*****************************************************/
  3217. /*! no static exports found */
  3218. /***/ (function(module, exports, __webpack_require__) {
  3219. /*!
  3220. * Bootstrap v4.4.1 (https://getbootstrap.com/)
  3221. * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
  3222. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  3223. */
  3224. (function (global, factory) {
  3225. true ? factory(exports, __webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js"), __webpack_require__(/*! popper.js */ "./node_modules/popper.js/dist/esm/popper.js")) :
  3226. undefined;
  3227. }(this, (function (exports, $, Popper) { 'use strict';
  3228. $ = $ && $.hasOwnProperty('default') ? $['default'] : $;
  3229. Popper = Popper && Popper.hasOwnProperty('default') ? Popper['default'] : Popper;
  3230. function _defineProperties(target, props) {
  3231. for (var i = 0; i < props.length; i++) {
  3232. var descriptor = props[i];
  3233. descriptor.enumerable = descriptor.enumerable || false;
  3234. descriptor.configurable = true;
  3235. if ("value" in descriptor) descriptor.writable = true;
  3236. Object.defineProperty(target, descriptor.key, descriptor);
  3237. }
  3238. }
  3239. function _createClass(Constructor, protoProps, staticProps) {
  3240. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  3241. if (staticProps) _defineProperties(Constructor, staticProps);
  3242. return Constructor;
  3243. }
  3244. function _defineProperty(obj, key, value) {
  3245. if (key in obj) {
  3246. Object.defineProperty(obj, key, {
  3247. value: value,
  3248. enumerable: true,
  3249. configurable: true,
  3250. writable: true
  3251. });
  3252. } else {
  3253. obj[key] = value;
  3254. }
  3255. return obj;
  3256. }
  3257. function ownKeys(object, enumerableOnly) {
  3258. var keys = Object.keys(object);
  3259. if (Object.getOwnPropertySymbols) {
  3260. var symbols = Object.getOwnPropertySymbols(object);
  3261. if (enumerableOnly) symbols = symbols.filter(function (sym) {
  3262. return Object.getOwnPropertyDescriptor(object, sym).enumerable;
  3263. });
  3264. keys.push.apply(keys, symbols);
  3265. }
  3266. return keys;
  3267. }
  3268. function _objectSpread2(target) {
  3269. for (var i = 1; i < arguments.length; i++) {
  3270. var source = arguments[i] != null ? arguments[i] : {};
  3271. if (i % 2) {
  3272. ownKeys(Object(source), true).forEach(function (key) {
  3273. _defineProperty(target, key, source[key]);
  3274. });
  3275. } else if (Object.getOwnPropertyDescriptors) {
  3276. Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
  3277. } else {
  3278. ownKeys(Object(source)).forEach(function (key) {
  3279. Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
  3280. });
  3281. }
  3282. }
  3283. return target;
  3284. }
  3285. function _inheritsLoose(subClass, superClass) {
  3286. subClass.prototype = Object.create(superClass.prototype);
  3287. subClass.prototype.constructor = subClass;
  3288. subClass.__proto__ = superClass;
  3289. }
  3290. /**
  3291. * --------------------------------------------------------------------------
  3292. * Bootstrap (v4.4.1): util.js
  3293. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  3294. * --------------------------------------------------------------------------
  3295. */
  3296. /**
  3297. * ------------------------------------------------------------------------
  3298. * Private TransitionEnd Helpers
  3299. * ------------------------------------------------------------------------
  3300. */
  3301. var TRANSITION_END = 'transitionend';
  3302. var MAX_UID = 1000000;
  3303. var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
  3304. function toType(obj) {
  3305. return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
  3306. }
  3307. function getSpecialTransitionEndEvent() {
  3308. return {
  3309. bindType: TRANSITION_END,
  3310. delegateType: TRANSITION_END,
  3311. handle: function handle(event) {
  3312. if ($(event.target).is(this)) {
  3313. return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params
  3314. }
  3315. return undefined; // eslint-disable-line no-undefined
  3316. }
  3317. };
  3318. }
  3319. function transitionEndEmulator(duration) {
  3320. var _this = this;
  3321. var called = false;
  3322. $(this).one(Util.TRANSITION_END, function () {
  3323. called = true;
  3324. });
  3325. setTimeout(function () {
  3326. if (!called) {
  3327. Util.triggerTransitionEnd(_this);
  3328. }
  3329. }, duration);
  3330. return this;
  3331. }
  3332. function setTransitionEndSupport() {
  3333. $.fn.emulateTransitionEnd = transitionEndEmulator;
  3334. $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();
  3335. }
  3336. /**
  3337. * --------------------------------------------------------------------------
  3338. * Public Util Api
  3339. * --------------------------------------------------------------------------
  3340. */
  3341. var Util = {
  3342. TRANSITION_END: 'bsTransitionEnd',
  3343. getUID: function getUID(prefix) {
  3344. do {
  3345. // eslint-disable-next-line no-bitwise
  3346. prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here
  3347. } while (document.getElementById(prefix));
  3348. return prefix;
  3349. },
  3350. getSelectorFromElement: function getSelectorFromElement(element) {
  3351. var selector = element.getAttribute('data-target');
  3352. if (!selector || selector === '#') {
  3353. var hrefAttr = element.getAttribute('href');
  3354. selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : '';
  3355. }
  3356. try {
  3357. return document.querySelector(selector) ? selector : null;
  3358. } catch (err) {
  3359. return null;
  3360. }
  3361. },
  3362. getTransitionDurationFromElement: function getTransitionDurationFromElement(element) {
  3363. if (!element) {
  3364. return 0;
  3365. } // Get transition-duration of the element
  3366. var transitionDuration = $(element).css('transition-duration');
  3367. var transitionDelay = $(element).css('transition-delay');
  3368. var floatTransitionDuration = parseFloat(transitionDuration);
  3369. var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
  3370. if (!floatTransitionDuration && !floatTransitionDelay) {
  3371. return 0;
  3372. } // If multiple durations are defined, take the first
  3373. transitionDuration = transitionDuration.split(',')[0];
  3374. transitionDelay = transitionDelay.split(',')[0];
  3375. return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
  3376. },
  3377. reflow: function reflow(element) {
  3378. return element.offsetHeight;
  3379. },
  3380. triggerTransitionEnd: function triggerTransitionEnd(element) {
  3381. $(element).trigger(TRANSITION_END);
  3382. },
  3383. // TODO: Remove in v5
  3384. supportsTransitionEnd: function supportsTransitionEnd() {
  3385. return Boolean(TRANSITION_END);
  3386. },
  3387. isElement: function isElement(obj) {
  3388. return (obj[0] || obj).nodeType;
  3389. },
  3390. typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) {
  3391. for (var property in configTypes) {
  3392. if (Object.prototype.hasOwnProperty.call(configTypes, property)) {
  3393. var expectedTypes = configTypes[property];
  3394. var value = config[property];
  3395. var valueType = value && Util.isElement(value) ? 'element' : toType(value);
  3396. if (!new RegExp(expectedTypes).test(valueType)) {
  3397. throw new Error(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\"."));
  3398. }
  3399. }
  3400. }
  3401. },
  3402. findShadowRoot: function findShadowRoot(element) {
  3403. if (!document.documentElement.attachShadow) {
  3404. return null;
  3405. } // Can find the shadow root otherwise it'll return the document
  3406. if (typeof element.getRootNode === 'function') {
  3407. var root = element.getRootNode();
  3408. return root instanceof ShadowRoot ? root : null;
  3409. }
  3410. if (element instanceof ShadowRoot) {
  3411. return element;
  3412. } // when we don't find a shadow root
  3413. if (!element.parentNode) {
  3414. return null;
  3415. }
  3416. return Util.findShadowRoot(element.parentNode);
  3417. },
  3418. jQueryDetection: function jQueryDetection() {
  3419. if (typeof $ === 'undefined') {
  3420. throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.');
  3421. }
  3422. var version = $.fn.jquery.split(' ')[0].split('.');
  3423. var minMajor = 1;
  3424. var ltMajor = 2;
  3425. var minMinor = 9;
  3426. var minPatch = 1;
  3427. var maxMajor = 4;
  3428. if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) {
  3429. throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0');
  3430. }
  3431. }
  3432. };
  3433. Util.jQueryDetection();
  3434. setTransitionEndSupport();
  3435. /**
  3436. * ------------------------------------------------------------------------
  3437. * Constants
  3438. * ------------------------------------------------------------------------
  3439. */
  3440. var NAME = 'alert';
  3441. var VERSION = '4.4.1';
  3442. var DATA_KEY = 'bs.alert';
  3443. var EVENT_KEY = "." + DATA_KEY;
  3444. var DATA_API_KEY = '.data-api';
  3445. var JQUERY_NO_CONFLICT = $.fn[NAME];
  3446. var Selector = {
  3447. DISMISS: '[data-dismiss="alert"]'
  3448. };
  3449. var Event = {
  3450. CLOSE: "close" + EVENT_KEY,
  3451. CLOSED: "closed" + EVENT_KEY,
  3452. CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
  3453. };
  3454. var ClassName = {
  3455. ALERT: 'alert',
  3456. FADE: 'fade',
  3457. SHOW: 'show'
  3458. };
  3459. /**
  3460. * ------------------------------------------------------------------------
  3461. * Class Definition
  3462. * ------------------------------------------------------------------------
  3463. */
  3464. var Alert =
  3465. /*#__PURE__*/
  3466. function () {
  3467. function Alert(element) {
  3468. this._element = element;
  3469. } // Getters
  3470. var _proto = Alert.prototype;
  3471. // Public
  3472. _proto.close = function close(element) {
  3473. var rootElement = this._element;
  3474. if (element) {
  3475. rootElement = this._getRootElement(element);
  3476. }
  3477. var customEvent = this._triggerCloseEvent(rootElement);
  3478. if (customEvent.isDefaultPrevented()) {
  3479. return;
  3480. }
  3481. this._removeElement(rootElement);
  3482. };
  3483. _proto.dispose = function dispose() {
  3484. $.removeData(this._element, DATA_KEY);
  3485. this._element = null;
  3486. } // Private
  3487. ;
  3488. _proto._getRootElement = function _getRootElement(element) {
  3489. var selector = Util.getSelectorFromElement(element);
  3490. var parent = false;
  3491. if (selector) {
  3492. parent = document.querySelector(selector);
  3493. }
  3494. if (!parent) {
  3495. parent = $(element).closest("." + ClassName.ALERT)[0];
  3496. }
  3497. return parent;
  3498. };
  3499. _proto._triggerCloseEvent = function _triggerCloseEvent(element) {
  3500. var closeEvent = $.Event(Event.CLOSE);
  3501. $(element).trigger(closeEvent);
  3502. return closeEvent;
  3503. };
  3504. _proto._removeElement = function _removeElement(element) {
  3505. var _this = this;
  3506. $(element).removeClass(ClassName.SHOW);
  3507. if (!$(element).hasClass(ClassName.FADE)) {
  3508. this._destroyElement(element);
  3509. return;
  3510. }
  3511. var transitionDuration = Util.getTransitionDurationFromElement(element);
  3512. $(element).one(Util.TRANSITION_END, function (event) {
  3513. return _this._destroyElement(element, event);
  3514. }).emulateTransitionEnd(transitionDuration);
  3515. };
  3516. _proto._destroyElement = function _destroyElement(element) {
  3517. $(element).detach().trigger(Event.CLOSED).remove();
  3518. } // Static
  3519. ;
  3520. Alert._jQueryInterface = function _jQueryInterface(config) {
  3521. return this.each(function () {
  3522. var $element = $(this);
  3523. var data = $element.data(DATA_KEY);
  3524. if (!data) {
  3525. data = new Alert(this);
  3526. $element.data(DATA_KEY, data);
  3527. }
  3528. if (config === 'close') {
  3529. data[config](this);
  3530. }
  3531. });
  3532. };
  3533. Alert._handleDismiss = function _handleDismiss(alertInstance) {
  3534. return function (event) {
  3535. if (event) {
  3536. event.preventDefault();
  3537. }
  3538. alertInstance.close(this);
  3539. };
  3540. };
  3541. _createClass(Alert, null, [{
  3542. key: "VERSION",
  3543. get: function get() {
  3544. return VERSION;
  3545. }
  3546. }]);
  3547. return Alert;
  3548. }();
  3549. /**
  3550. * ------------------------------------------------------------------------
  3551. * Data Api implementation
  3552. * ------------------------------------------------------------------------
  3553. */
  3554. $(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert()));
  3555. /**
  3556. * ------------------------------------------------------------------------
  3557. * jQuery
  3558. * ------------------------------------------------------------------------
  3559. */
  3560. $.fn[NAME] = Alert._jQueryInterface;
  3561. $.fn[NAME].Constructor = Alert;
  3562. $.fn[NAME].noConflict = function () {
  3563. $.fn[NAME] = JQUERY_NO_CONFLICT;
  3564. return Alert._jQueryInterface;
  3565. };
  3566. /**
  3567. * ------------------------------------------------------------------------
  3568. * Constants
  3569. * ------------------------------------------------------------------------
  3570. */
  3571. var NAME$1 = 'button';
  3572. var VERSION$1 = '4.4.1';
  3573. var DATA_KEY$1 = 'bs.button';
  3574. var EVENT_KEY$1 = "." + DATA_KEY$1;
  3575. var DATA_API_KEY$1 = '.data-api';
  3576. var JQUERY_NO_CONFLICT$1 = $.fn[NAME$1];
  3577. var ClassName$1 = {
  3578. ACTIVE: 'active',
  3579. BUTTON: 'btn',
  3580. FOCUS: 'focus'
  3581. };
  3582. var Selector$1 = {
  3583. DATA_TOGGLE_CARROT: '[data-toggle^="button"]',
  3584. DATA_TOGGLES: '[data-toggle="buttons"]',
  3585. DATA_TOGGLE: '[data-toggle="button"]',
  3586. DATA_TOGGLES_BUTTONS: '[data-toggle="buttons"] .btn',
  3587. INPUT: 'input:not([type="hidden"])',
  3588. ACTIVE: '.active',
  3589. BUTTON: '.btn'
  3590. };
  3591. var Event$1 = {
  3592. CLICK_DATA_API: "click" + EVENT_KEY$1 + DATA_API_KEY$1,
  3593. FOCUS_BLUR_DATA_API: "focus" + EVENT_KEY$1 + DATA_API_KEY$1 + " " + ("blur" + EVENT_KEY$1 + DATA_API_KEY$1),
  3594. LOAD_DATA_API: "load" + EVENT_KEY$1 + DATA_API_KEY$1
  3595. };
  3596. /**
  3597. * ------------------------------------------------------------------------
  3598. * Class Definition
  3599. * ------------------------------------------------------------------------
  3600. */
  3601. var Button =
  3602. /*#__PURE__*/
  3603. function () {
  3604. function Button(element) {
  3605. this._element = element;
  3606. } // Getters
  3607. var _proto = Button.prototype;
  3608. // Public
  3609. _proto.toggle = function toggle() {
  3610. var triggerChangeEvent = true;
  3611. var addAriaPressed = true;
  3612. var rootElement = $(this._element).closest(Selector$1.DATA_TOGGLES)[0];
  3613. if (rootElement) {
  3614. var input = this._element.querySelector(Selector$1.INPUT);
  3615. if (input) {
  3616. if (input.type === 'radio') {
  3617. if (input.checked && this._element.classList.contains(ClassName$1.ACTIVE)) {
  3618. triggerChangeEvent = false;
  3619. } else {
  3620. var activeElement = rootElement.querySelector(Selector$1.ACTIVE);
  3621. if (activeElement) {
  3622. $(activeElement).removeClass(ClassName$1.ACTIVE);
  3623. }
  3624. }
  3625. } else if (input.type === 'checkbox') {
  3626. if (this._element.tagName === 'LABEL' && input.checked === this._element.classList.contains(ClassName$1.ACTIVE)) {
  3627. triggerChangeEvent = false;
  3628. }
  3629. } else {
  3630. // if it's not a radio button or checkbox don't add a pointless/invalid checked property to the input
  3631. triggerChangeEvent = false;
  3632. }
  3633. if (triggerChangeEvent) {
  3634. input.checked = !this._element.classList.contains(ClassName$1.ACTIVE);
  3635. $(input).trigger('change');
  3636. }
  3637. input.focus();
  3638. addAriaPressed = false;
  3639. }
  3640. }
  3641. if (!(this._element.hasAttribute('disabled') || this._element.classList.contains('disabled'))) {
  3642. if (addAriaPressed) {
  3643. this._element.setAttribute('aria-pressed', !this._element.classList.contains(ClassName$1.ACTIVE));
  3644. }
  3645. if (triggerChangeEvent) {
  3646. $(this._element).toggleClass(ClassName$1.ACTIVE);
  3647. }
  3648. }
  3649. };
  3650. _proto.dispose = function dispose() {
  3651. $.removeData(this._element, DATA_KEY$1);
  3652. this._element = null;
  3653. } // Static
  3654. ;
  3655. Button._jQueryInterface = function _jQueryInterface(config) {
  3656. return this.each(function () {
  3657. var data = $(this).data(DATA_KEY$1);
  3658. if (!data) {
  3659. data = new Button(this);
  3660. $(this).data(DATA_KEY$1, data);
  3661. }
  3662. if (config === 'toggle') {
  3663. data[config]();
  3664. }
  3665. });
  3666. };
  3667. _createClass(Button, null, [{
  3668. key: "VERSION",
  3669. get: function get() {
  3670. return VERSION$1;
  3671. }
  3672. }]);
  3673. return Button;
  3674. }();
  3675. /**
  3676. * ------------------------------------------------------------------------
  3677. * Data Api implementation
  3678. * ------------------------------------------------------------------------
  3679. */
  3680. $(document).on(Event$1.CLICK_DATA_API, Selector$1.DATA_TOGGLE_CARROT, function (event) {
  3681. var button = event.target;
  3682. if (!$(button).hasClass(ClassName$1.BUTTON)) {
  3683. button = $(button).closest(Selector$1.BUTTON)[0];
  3684. }
  3685. if (!button || button.hasAttribute('disabled') || button.classList.contains('disabled')) {
  3686. event.preventDefault(); // work around Firefox bug #1540995
  3687. } else {
  3688. var inputBtn = button.querySelector(Selector$1.INPUT);
  3689. if (inputBtn && (inputBtn.hasAttribute('disabled') || inputBtn.classList.contains('disabled'))) {
  3690. event.preventDefault(); // work around Firefox bug #1540995
  3691. return;
  3692. }
  3693. Button._jQueryInterface.call($(button), 'toggle');
  3694. }
  3695. }).on(Event$1.FOCUS_BLUR_DATA_API, Selector$1.DATA_TOGGLE_CARROT, function (event) {
  3696. var button = $(event.target).closest(Selector$1.BUTTON)[0];
  3697. $(button).toggleClass(ClassName$1.FOCUS, /^focus(in)?$/.test(event.type));
  3698. });
  3699. $(window).on(Event$1.LOAD_DATA_API, function () {
  3700. // ensure correct active class is set to match the controls' actual values/states
  3701. // find all checkboxes/readio buttons inside data-toggle groups
  3702. var buttons = [].slice.call(document.querySelectorAll(Selector$1.DATA_TOGGLES_BUTTONS));
  3703. for (var i = 0, len = buttons.length; i < len; i++) {
  3704. var button = buttons[i];
  3705. var input = button.querySelector(Selector$1.INPUT);
  3706. if (input.checked || input.hasAttribute('checked')) {
  3707. button.classList.add(ClassName$1.ACTIVE);
  3708. } else {
  3709. button.classList.remove(ClassName$1.ACTIVE);
  3710. }
  3711. } // find all button toggles
  3712. buttons = [].slice.call(document.querySelectorAll(Selector$1.DATA_TOGGLE));
  3713. for (var _i = 0, _len = buttons.length; _i < _len; _i++) {
  3714. var _button = buttons[_i];
  3715. if (_button.getAttribute('aria-pressed') === 'true') {
  3716. _button.classList.add(ClassName$1.ACTIVE);
  3717. } else {
  3718. _button.classList.remove(ClassName$1.ACTIVE);
  3719. }
  3720. }
  3721. });
  3722. /**
  3723. * ------------------------------------------------------------------------
  3724. * jQuery
  3725. * ------------------------------------------------------------------------
  3726. */
  3727. $.fn[NAME$1] = Button._jQueryInterface;
  3728. $.fn[NAME$1].Constructor = Button;
  3729. $.fn[NAME$1].noConflict = function () {
  3730. $.fn[NAME$1] = JQUERY_NO_CONFLICT$1;
  3731. return Button._jQueryInterface;
  3732. };
  3733. /**
  3734. * ------------------------------------------------------------------------
  3735. * Constants
  3736. * ------------------------------------------------------------------------
  3737. */
  3738. var NAME$2 = 'carousel';
  3739. var VERSION$2 = '4.4.1';
  3740. var DATA_KEY$2 = 'bs.carousel';
  3741. var EVENT_KEY$2 = "." + DATA_KEY$2;
  3742. var DATA_API_KEY$2 = '.data-api';
  3743. var JQUERY_NO_CONFLICT$2 = $.fn[NAME$2];
  3744. var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key
  3745. var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key
  3746. var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch
  3747. var SWIPE_THRESHOLD = 40;
  3748. var Default = {
  3749. interval: 5000,
  3750. keyboard: true,
  3751. slide: false,
  3752. pause: 'hover',
  3753. wrap: true,
  3754. touch: true
  3755. };
  3756. var DefaultType = {
  3757. interval: '(number|boolean)',
  3758. keyboard: 'boolean',
  3759. slide: '(boolean|string)',
  3760. pause: '(string|boolean)',
  3761. wrap: 'boolean',
  3762. touch: 'boolean'
  3763. };
  3764. var Direction = {
  3765. NEXT: 'next',
  3766. PREV: 'prev',
  3767. LEFT: 'left',
  3768. RIGHT: 'right'
  3769. };
  3770. var Event$2 = {
  3771. SLIDE: "slide" + EVENT_KEY$2,
  3772. SLID: "slid" + EVENT_KEY$2,
  3773. KEYDOWN: "keydown" + EVENT_KEY$2,
  3774. MOUSEENTER: "mouseenter" + EVENT_KEY$2,
  3775. MOUSELEAVE: "mouseleave" + EVENT_KEY$2,
  3776. TOUCHSTART: "touchstart" + EVENT_KEY$2,
  3777. TOUCHMOVE: "touchmove" + EVENT_KEY$2,
  3778. TOUCHEND: "touchend" + EVENT_KEY$2,
  3779. POINTERDOWN: "pointerdown" + EVENT_KEY$2,
  3780. POINTERUP: "pointerup" + EVENT_KEY$2,
  3781. DRAG_START: "dragstart" + EVENT_KEY$2,
  3782. LOAD_DATA_API: "load" + EVENT_KEY$2 + DATA_API_KEY$2,
  3783. CLICK_DATA_API: "click" + EVENT_KEY$2 + DATA_API_KEY$2
  3784. };
  3785. var ClassName$2 = {
  3786. CAROUSEL: 'carousel',
  3787. ACTIVE: 'active',
  3788. SLIDE: 'slide',
  3789. RIGHT: 'carousel-item-right',
  3790. LEFT: 'carousel-item-left',
  3791. NEXT: 'carousel-item-next',
  3792. PREV: 'carousel-item-prev',
  3793. ITEM: 'carousel-item',
  3794. POINTER_EVENT: 'pointer-event'
  3795. };
  3796. var Selector$2 = {
  3797. ACTIVE: '.active',
  3798. ACTIVE_ITEM: '.active.carousel-item',
  3799. ITEM: '.carousel-item',
  3800. ITEM_IMG: '.carousel-item img',
  3801. NEXT_PREV: '.carousel-item-next, .carousel-item-prev',
  3802. INDICATORS: '.carousel-indicators',
  3803. DATA_SLIDE: '[data-slide], [data-slide-to]',
  3804. DATA_RIDE: '[data-ride="carousel"]'
  3805. };
  3806. var PointerType = {
  3807. TOUCH: 'touch',
  3808. PEN: 'pen'
  3809. };
  3810. /**
  3811. * ------------------------------------------------------------------------
  3812. * Class Definition
  3813. * ------------------------------------------------------------------------
  3814. */
  3815. var Carousel =
  3816. /*#__PURE__*/
  3817. function () {
  3818. function Carousel(element, config) {
  3819. this._items = null;
  3820. this._interval = null;
  3821. this._activeElement = null;
  3822. this._isPaused = false;
  3823. this._isSliding = false;
  3824. this.touchTimeout = null;
  3825. this.touchStartX = 0;
  3826. this.touchDeltaX = 0;
  3827. this._config = this._getConfig(config);
  3828. this._element = element;
  3829. this._indicatorsElement = this._element.querySelector(Selector$2.INDICATORS);
  3830. this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0;
  3831. this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent);
  3832. this._addEventListeners();
  3833. } // Getters
  3834. var _proto = Carousel.prototype;
  3835. // Public
  3836. _proto.next = function next() {
  3837. if (!this._isSliding) {
  3838. this._slide(Direction.NEXT);
  3839. }
  3840. };
  3841. _proto.nextWhenVisible = function nextWhenVisible() {
  3842. // Don't call next when the page isn't visible
  3843. // or the carousel or its parent isn't visible
  3844. if (!document.hidden && $(this._element).is(':visible') && $(this._element).css('visibility') !== 'hidden') {
  3845. this.next();
  3846. }
  3847. };
  3848. _proto.prev = function prev() {
  3849. if (!this._isSliding) {
  3850. this._slide(Direction.PREV);
  3851. }
  3852. };
  3853. _proto.pause = function pause(event) {
  3854. if (!event) {
  3855. this._isPaused = true;
  3856. }
  3857. if (this._element.querySelector(Selector$2.NEXT_PREV)) {
  3858. Util.triggerTransitionEnd(this._element);
  3859. this.cycle(true);
  3860. }
  3861. clearInterval(this._interval);
  3862. this._interval = null;
  3863. };
  3864. _proto.cycle = function cycle(event) {
  3865. if (!event) {
  3866. this._isPaused = false;
  3867. }
  3868. if (this._interval) {
  3869. clearInterval(this._interval);
  3870. this._interval = null;
  3871. }
  3872. if (this._config.interval && !this._isPaused) {
  3873. this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval);
  3874. }
  3875. };
  3876. _proto.to = function to(index) {
  3877. var _this = this;
  3878. this._activeElement = this._element.querySelector(Selector$2.ACTIVE_ITEM);
  3879. var activeIndex = this._getItemIndex(this._activeElement);
  3880. if (index > this._items.length - 1 || index < 0) {
  3881. return;
  3882. }
  3883. if (this._isSliding) {
  3884. $(this._element).one(Event$2.SLID, function () {
  3885. return _this.to(index);
  3886. });
  3887. return;
  3888. }
  3889. if (activeIndex === index) {
  3890. this.pause();
  3891. this.cycle();
  3892. return;
  3893. }
  3894. var direction = index > activeIndex ? Direction.NEXT : Direction.PREV;
  3895. this._slide(direction, this._items[index]);
  3896. };
  3897. _proto.dispose = function dispose() {
  3898. $(this._element).off(EVENT_KEY$2);
  3899. $.removeData(this._element, DATA_KEY$2);
  3900. this._items = null;
  3901. this._config = null;
  3902. this._element = null;
  3903. this._interval = null;
  3904. this._isPaused = null;
  3905. this._isSliding = null;
  3906. this._activeElement = null;
  3907. this._indicatorsElement = null;
  3908. } // Private
  3909. ;
  3910. _proto._getConfig = function _getConfig(config) {
  3911. config = _objectSpread2({}, Default, {}, config);
  3912. Util.typeCheckConfig(NAME$2, config, DefaultType);
  3913. return config;
  3914. };
  3915. _proto._handleSwipe = function _handleSwipe() {
  3916. var absDeltax = Math.abs(this.touchDeltaX);
  3917. if (absDeltax <= SWIPE_THRESHOLD) {
  3918. return;
  3919. }
  3920. var direction = absDeltax / this.touchDeltaX;
  3921. this.touchDeltaX = 0; // swipe left
  3922. if (direction > 0) {
  3923. this.prev();
  3924. } // swipe right
  3925. if (direction < 0) {
  3926. this.next();
  3927. }
  3928. };
  3929. _proto._addEventListeners = function _addEventListeners() {
  3930. var _this2 = this;
  3931. if (this._config.keyboard) {
  3932. $(this._element).on(Event$2.KEYDOWN, function (event) {
  3933. return _this2._keydown(event);
  3934. });
  3935. }
  3936. if (this._config.pause === 'hover') {
  3937. $(this._element).on(Event$2.MOUSEENTER, function (event) {
  3938. return _this2.pause(event);
  3939. }).on(Event$2.MOUSELEAVE, function (event) {
  3940. return _this2.cycle(event);
  3941. });
  3942. }
  3943. if (this._config.touch) {
  3944. this._addTouchEventListeners();
  3945. }
  3946. };
  3947. _proto._addTouchEventListeners = function _addTouchEventListeners() {
  3948. var _this3 = this;
  3949. if (!this._touchSupported) {
  3950. return;
  3951. }
  3952. var start = function start(event) {
  3953. if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {
  3954. _this3.touchStartX = event.originalEvent.clientX;
  3955. } else if (!_this3._pointerEvent) {
  3956. _this3.touchStartX = event.originalEvent.touches[0].clientX;
  3957. }
  3958. };
  3959. var move = function move(event) {
  3960. // ensure swiping with one touch and not pinching
  3961. if (event.originalEvent.touches && event.originalEvent.touches.length > 1) {
  3962. _this3.touchDeltaX = 0;
  3963. } else {
  3964. _this3.touchDeltaX = event.originalEvent.touches[0].clientX - _this3.touchStartX;
  3965. }
  3966. };
  3967. var end = function end(event) {
  3968. if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {
  3969. _this3.touchDeltaX = event.originalEvent.clientX - _this3.touchStartX;
  3970. }
  3971. _this3._handleSwipe();
  3972. if (_this3._config.pause === 'hover') {
  3973. // If it's a touch-enabled device, mouseenter/leave are fired as
  3974. // part of the mouse compatibility events on first tap - the carousel
  3975. // would stop cycling until user tapped out of it;
  3976. // here, we listen for touchend, explicitly pause the carousel
  3977. // (as if it's the second time we tap on it, mouseenter compat event
  3978. // is NOT fired) and after a timeout (to allow for mouse compatibility
  3979. // events to fire) we explicitly restart cycling
  3980. _this3.pause();
  3981. if (_this3.touchTimeout) {
  3982. clearTimeout(_this3.touchTimeout);
  3983. }
  3984. _this3.touchTimeout = setTimeout(function (event) {
  3985. return _this3.cycle(event);
  3986. }, TOUCHEVENT_COMPAT_WAIT + _this3._config.interval);
  3987. }
  3988. };
  3989. $(this._element.querySelectorAll(Selector$2.ITEM_IMG)).on(Event$2.DRAG_START, function (e) {
  3990. return e.preventDefault();
  3991. });
  3992. if (this._pointerEvent) {
  3993. $(this._element).on(Event$2.POINTERDOWN, function (event) {
  3994. return start(event);
  3995. });
  3996. $(this._element).on(Event$2.POINTERUP, function (event) {
  3997. return end(event);
  3998. });
  3999. this._element.classList.add(ClassName$2.POINTER_EVENT);
  4000. } else {
  4001. $(this._element).on(Event$2.TOUCHSTART, function (event) {
  4002. return start(event);
  4003. });
  4004. $(this._element).on(Event$2.TOUCHMOVE, function (event) {
  4005. return move(event);
  4006. });
  4007. $(this._element).on(Event$2.TOUCHEND, function (event) {
  4008. return end(event);
  4009. });
  4010. }
  4011. };
  4012. _proto._keydown = function _keydown(event) {
  4013. if (/input|textarea/i.test(event.target.tagName)) {
  4014. return;
  4015. }
  4016. switch (event.which) {
  4017. case ARROW_LEFT_KEYCODE:
  4018. event.preventDefault();
  4019. this.prev();
  4020. break;
  4021. case ARROW_RIGHT_KEYCODE:
  4022. event.preventDefault();
  4023. this.next();
  4024. break;
  4025. }
  4026. };
  4027. _proto._getItemIndex = function _getItemIndex(element) {
  4028. this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(Selector$2.ITEM)) : [];
  4029. return this._items.indexOf(element);
  4030. };
  4031. _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) {
  4032. var isNextDirection = direction === Direction.NEXT;
  4033. var isPrevDirection = direction === Direction.PREV;
  4034. var activeIndex = this._getItemIndex(activeElement);
  4035. var lastItemIndex = this._items.length - 1;
  4036. var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex;
  4037. if (isGoingToWrap && !this._config.wrap) {
  4038. return activeElement;
  4039. }
  4040. var delta = direction === Direction.PREV ? -1 : 1;
  4041. var itemIndex = (activeIndex + delta) % this._items.length;
  4042. return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];
  4043. };
  4044. _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) {
  4045. var targetIndex = this._getItemIndex(relatedTarget);
  4046. var fromIndex = this._getItemIndex(this._element.querySelector(Selector$2.ACTIVE_ITEM));
  4047. var slideEvent = $.Event(Event$2.SLIDE, {
  4048. relatedTarget: relatedTarget,
  4049. direction: eventDirectionName,
  4050. from: fromIndex,
  4051. to: targetIndex
  4052. });
  4053. $(this._element).trigger(slideEvent);
  4054. return slideEvent;
  4055. };
  4056. _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) {
  4057. if (this._indicatorsElement) {
  4058. var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(Selector$2.ACTIVE));
  4059. $(indicators).removeClass(ClassName$2.ACTIVE);
  4060. var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)];
  4061. if (nextIndicator) {
  4062. $(nextIndicator).addClass(ClassName$2.ACTIVE);
  4063. }
  4064. }
  4065. };
  4066. _proto._slide = function _slide(direction, element) {
  4067. var _this4 = this;
  4068. var activeElement = this._element.querySelector(Selector$2.ACTIVE_ITEM);
  4069. var activeElementIndex = this._getItemIndex(activeElement);
  4070. var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement);
  4071. var nextElementIndex = this._getItemIndex(nextElement);
  4072. var isCycling = Boolean(this._interval);
  4073. var directionalClassName;
  4074. var orderClassName;
  4075. var eventDirectionName;
  4076. if (direction === Direction.NEXT) {
  4077. directionalClassName = ClassName$2.LEFT;
  4078. orderClassName = ClassName$2.NEXT;
  4079. eventDirectionName = Direction.LEFT;
  4080. } else {
  4081. directionalClassName = ClassName$2.RIGHT;
  4082. orderClassName = ClassName$2.PREV;
  4083. eventDirectionName = Direction.RIGHT;
  4084. }
  4085. if (nextElement && $(nextElement).hasClass(ClassName$2.ACTIVE)) {
  4086. this._isSliding = false;
  4087. return;
  4088. }
  4089. var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName);
  4090. if (slideEvent.isDefaultPrevented()) {
  4091. return;
  4092. }
  4093. if (!activeElement || !nextElement) {
  4094. // Some weirdness is happening, so we bail
  4095. return;
  4096. }
  4097. this._isSliding = true;
  4098. if (isCycling) {
  4099. this.pause();
  4100. }
  4101. this._setActiveIndicatorElement(nextElement);
  4102. var slidEvent = $.Event(Event$2.SLID, {
  4103. relatedTarget: nextElement,
  4104. direction: eventDirectionName,
  4105. from: activeElementIndex,
  4106. to: nextElementIndex
  4107. });
  4108. if ($(this._element).hasClass(ClassName$2.SLIDE)) {
  4109. $(nextElement).addClass(orderClassName);
  4110. Util.reflow(nextElement);
  4111. $(activeElement).addClass(directionalClassName);
  4112. $(nextElement).addClass(directionalClassName);
  4113. var nextElementInterval = parseInt(nextElement.getAttribute('data-interval'), 10);
  4114. if (nextElementInterval) {
  4115. this._config.defaultInterval = this._config.defaultInterval || this._config.interval;
  4116. this._config.interval = nextElementInterval;
  4117. } else {
  4118. this._config.interval = this._config.defaultInterval || this._config.interval;
  4119. }
  4120. var transitionDuration = Util.getTransitionDurationFromElement(activeElement);
  4121. $(activeElement).one(Util.TRANSITION_END, function () {
  4122. $(nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(ClassName$2.ACTIVE);
  4123. $(activeElement).removeClass(ClassName$2.ACTIVE + " " + orderClassName + " " + directionalClassName);
  4124. _this4._isSliding = false;
  4125. setTimeout(function () {
  4126. return $(_this4._element).trigger(slidEvent);
  4127. }, 0);
  4128. }).emulateTransitionEnd(transitionDuration);
  4129. } else {
  4130. $(activeElement).removeClass(ClassName$2.ACTIVE);
  4131. $(nextElement).addClass(ClassName$2.ACTIVE);
  4132. this._isSliding = false;
  4133. $(this._element).trigger(slidEvent);
  4134. }
  4135. if (isCycling) {
  4136. this.cycle();
  4137. }
  4138. } // Static
  4139. ;
  4140. Carousel._jQueryInterface = function _jQueryInterface(config) {
  4141. return this.each(function () {
  4142. var data = $(this).data(DATA_KEY$2);
  4143. var _config = _objectSpread2({}, Default, {}, $(this).data());
  4144. if (typeof config === 'object') {
  4145. _config = _objectSpread2({}, _config, {}, config);
  4146. }
  4147. var action = typeof config === 'string' ? config : _config.slide;
  4148. if (!data) {
  4149. data = new Carousel(this, _config);
  4150. $(this).data(DATA_KEY$2, data);
  4151. }
  4152. if (typeof config === 'number') {
  4153. data.to(config);
  4154. } else if (typeof action === 'string') {
  4155. if (typeof data[action] === 'undefined') {
  4156. throw new TypeError("No method named \"" + action + "\"");
  4157. }
  4158. data[action]();
  4159. } else if (_config.interval && _config.ride) {
  4160. data.pause();
  4161. data.cycle();
  4162. }
  4163. });
  4164. };
  4165. Carousel._dataApiClickHandler = function _dataApiClickHandler(event) {
  4166. var selector = Util.getSelectorFromElement(this);
  4167. if (!selector) {
  4168. return;
  4169. }
  4170. var target = $(selector)[0];
  4171. if (!target || !$(target).hasClass(ClassName$2.CAROUSEL)) {
  4172. return;
  4173. }
  4174. var config = _objectSpread2({}, $(target).data(), {}, $(this).data());
  4175. var slideIndex = this.getAttribute('data-slide-to');
  4176. if (slideIndex) {
  4177. config.interval = false;
  4178. }
  4179. Carousel._jQueryInterface.call($(target), config);
  4180. if (slideIndex) {
  4181. $(target).data(DATA_KEY$2).to(slideIndex);
  4182. }
  4183. event.preventDefault();
  4184. };
  4185. _createClass(Carousel, null, [{
  4186. key: "VERSION",
  4187. get: function get() {
  4188. return VERSION$2;
  4189. }
  4190. }, {
  4191. key: "Default",
  4192. get: function get() {
  4193. return Default;
  4194. }
  4195. }]);
  4196. return Carousel;
  4197. }();
  4198. /**
  4199. * ------------------------------------------------------------------------
  4200. * Data Api implementation
  4201. * ------------------------------------------------------------------------
  4202. */
  4203. $(document).on(Event$2.CLICK_DATA_API, Selector$2.DATA_SLIDE, Carousel._dataApiClickHandler);
  4204. $(window).on(Event$2.LOAD_DATA_API, function () {
  4205. var carousels = [].slice.call(document.querySelectorAll(Selector$2.DATA_RIDE));
  4206. for (var i = 0, len = carousels.length; i < len; i++) {
  4207. var $carousel = $(carousels[i]);
  4208. Carousel._jQueryInterface.call($carousel, $carousel.data());
  4209. }
  4210. });
  4211. /**
  4212. * ------------------------------------------------------------------------
  4213. * jQuery
  4214. * ------------------------------------------------------------------------
  4215. */
  4216. $.fn[NAME$2] = Carousel._jQueryInterface;
  4217. $.fn[NAME$2].Constructor = Carousel;
  4218. $.fn[NAME$2].noConflict = function () {
  4219. $.fn[NAME$2] = JQUERY_NO_CONFLICT$2;
  4220. return Carousel._jQueryInterface;
  4221. };
  4222. /**
  4223. * ------------------------------------------------------------------------
  4224. * Constants
  4225. * ------------------------------------------------------------------------
  4226. */
  4227. var NAME$3 = 'collapse';
  4228. var VERSION$3 = '4.4.1';
  4229. var DATA_KEY$3 = 'bs.collapse';
  4230. var EVENT_KEY$3 = "." + DATA_KEY$3;
  4231. var DATA_API_KEY$3 = '.data-api';
  4232. var JQUERY_NO_CONFLICT$3 = $.fn[NAME$3];
  4233. var Default$1 = {
  4234. toggle: true,
  4235. parent: ''
  4236. };
  4237. var DefaultType$1 = {
  4238. toggle: 'boolean',
  4239. parent: '(string|element)'
  4240. };
  4241. var Event$3 = {
  4242. SHOW: "show" + EVENT_KEY$3,
  4243. SHOWN: "shown" + EVENT_KEY$3,
  4244. HIDE: "hide" + EVENT_KEY$3,
  4245. HIDDEN: "hidden" + EVENT_KEY$3,
  4246. CLICK_DATA_API: "click" + EVENT_KEY$3 + DATA_API_KEY$3
  4247. };
  4248. var ClassName$3 = {
  4249. SHOW: 'show',
  4250. COLLAPSE: 'collapse',
  4251. COLLAPSING: 'collapsing',
  4252. COLLAPSED: 'collapsed'
  4253. };
  4254. var Dimension = {
  4255. WIDTH: 'width',
  4256. HEIGHT: 'height'
  4257. };
  4258. var Selector$3 = {
  4259. ACTIVES: '.show, .collapsing',
  4260. DATA_TOGGLE: '[data-toggle="collapse"]'
  4261. };
  4262. /**
  4263. * ------------------------------------------------------------------------
  4264. * Class Definition
  4265. * ------------------------------------------------------------------------
  4266. */
  4267. var Collapse =
  4268. /*#__PURE__*/
  4269. function () {
  4270. function Collapse(element, config) {
  4271. this._isTransitioning = false;
  4272. this._element = element;
  4273. this._config = this._getConfig(config);
  4274. this._triggerArray = [].slice.call(document.querySelectorAll("[data-toggle=\"collapse\"][href=\"#" + element.id + "\"]," + ("[data-toggle=\"collapse\"][data-target=\"#" + element.id + "\"]")));
  4275. var toggleList = [].slice.call(document.querySelectorAll(Selector$3.DATA_TOGGLE));
  4276. for (var i = 0, len = toggleList.length; i < len; i++) {
  4277. var elem = toggleList[i];
  4278. var selector = Util.getSelectorFromElement(elem);
  4279. var filterElement = [].slice.call(document.querySelectorAll(selector)).filter(function (foundElem) {
  4280. return foundElem === element;
  4281. });
  4282. if (selector !== null && filterElement.length > 0) {
  4283. this._selector = selector;
  4284. this._triggerArray.push(elem);
  4285. }
  4286. }
  4287. this._parent = this._config.parent ? this._getParent() : null;
  4288. if (!this._config.parent) {
  4289. this._addAriaAndCollapsedClass(this._element, this._triggerArray);
  4290. }
  4291. if (this._config.toggle) {
  4292. this.toggle();
  4293. }
  4294. } // Getters
  4295. var _proto = Collapse.prototype;
  4296. // Public
  4297. _proto.toggle = function toggle() {
  4298. if ($(this._element).hasClass(ClassName$3.SHOW)) {
  4299. this.hide();
  4300. } else {
  4301. this.show();
  4302. }
  4303. };
  4304. _proto.show = function show() {
  4305. var _this = this;
  4306. if (this._isTransitioning || $(this._element).hasClass(ClassName$3.SHOW)) {
  4307. return;
  4308. }
  4309. var actives;
  4310. var activesData;
  4311. if (this._parent) {
  4312. actives = [].slice.call(this._parent.querySelectorAll(Selector$3.ACTIVES)).filter(function (elem) {
  4313. if (typeof _this._config.parent === 'string') {
  4314. return elem.getAttribute('data-parent') === _this._config.parent;
  4315. }
  4316. return elem.classList.contains(ClassName$3.COLLAPSE);
  4317. });
  4318. if (actives.length === 0) {
  4319. actives = null;
  4320. }
  4321. }
  4322. if (actives) {
  4323. activesData = $(actives).not(this._selector).data(DATA_KEY$3);
  4324. if (activesData && activesData._isTransitioning) {
  4325. return;
  4326. }
  4327. }
  4328. var startEvent = $.Event(Event$3.SHOW);
  4329. $(this._element).trigger(startEvent);
  4330. if (startEvent.isDefaultPrevented()) {
  4331. return;
  4332. }
  4333. if (actives) {
  4334. Collapse._jQueryInterface.call($(actives).not(this._selector), 'hide');
  4335. if (!activesData) {
  4336. $(actives).data(DATA_KEY$3, null);
  4337. }
  4338. }
  4339. var dimension = this._getDimension();
  4340. $(this._element).removeClass(ClassName$3.COLLAPSE).addClass(ClassName$3.COLLAPSING);
  4341. this._element.style[dimension] = 0;
  4342. if (this._triggerArray.length) {
  4343. $(this._triggerArray).removeClass(ClassName$3.COLLAPSED).attr('aria-expanded', true);
  4344. }
  4345. this.setTransitioning(true);
  4346. var complete = function complete() {
  4347. $(_this._element).removeClass(ClassName$3.COLLAPSING).addClass(ClassName$3.COLLAPSE).addClass(ClassName$3.SHOW);
  4348. _this._element.style[dimension] = '';
  4349. _this.setTransitioning(false);
  4350. $(_this._element).trigger(Event$3.SHOWN);
  4351. };
  4352. var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
  4353. var scrollSize = "scroll" + capitalizedDimension;
  4354. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  4355. $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  4356. this._element.style[dimension] = this._element[scrollSize] + "px";
  4357. };
  4358. _proto.hide = function hide() {
  4359. var _this2 = this;
  4360. if (this._isTransitioning || !$(this._element).hasClass(ClassName$3.SHOW)) {
  4361. return;
  4362. }
  4363. var startEvent = $.Event(Event$3.HIDE);
  4364. $(this._element).trigger(startEvent);
  4365. if (startEvent.isDefaultPrevented()) {
  4366. return;
  4367. }
  4368. var dimension = this._getDimension();
  4369. this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px";
  4370. Util.reflow(this._element);
  4371. $(this._element).addClass(ClassName$3.COLLAPSING).removeClass(ClassName$3.COLLAPSE).removeClass(ClassName$3.SHOW);
  4372. var triggerArrayLength = this._triggerArray.length;
  4373. if (triggerArrayLength > 0) {
  4374. for (var i = 0; i < triggerArrayLength; i++) {
  4375. var trigger = this._triggerArray[i];
  4376. var selector = Util.getSelectorFromElement(trigger);
  4377. if (selector !== null) {
  4378. var $elem = $([].slice.call(document.querySelectorAll(selector)));
  4379. if (!$elem.hasClass(ClassName$3.SHOW)) {
  4380. $(trigger).addClass(ClassName$3.COLLAPSED).attr('aria-expanded', false);
  4381. }
  4382. }
  4383. }
  4384. }
  4385. this.setTransitioning(true);
  4386. var complete = function complete() {
  4387. _this2.setTransitioning(false);
  4388. $(_this2._element).removeClass(ClassName$3.COLLAPSING).addClass(ClassName$3.COLLAPSE).trigger(Event$3.HIDDEN);
  4389. };
  4390. this._element.style[dimension] = '';
  4391. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  4392. $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  4393. };
  4394. _proto.setTransitioning = function setTransitioning(isTransitioning) {
  4395. this._isTransitioning = isTransitioning;
  4396. };
  4397. _proto.dispose = function dispose() {
  4398. $.removeData(this._element, DATA_KEY$3);
  4399. this._config = null;
  4400. this._parent = null;
  4401. this._element = null;
  4402. this._triggerArray = null;
  4403. this._isTransitioning = null;
  4404. } // Private
  4405. ;
  4406. _proto._getConfig = function _getConfig(config) {
  4407. config = _objectSpread2({}, Default$1, {}, config);
  4408. config.toggle = Boolean(config.toggle); // Coerce string values
  4409. Util.typeCheckConfig(NAME$3, config, DefaultType$1);
  4410. return config;
  4411. };
  4412. _proto._getDimension = function _getDimension() {
  4413. var hasWidth = $(this._element).hasClass(Dimension.WIDTH);
  4414. return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT;
  4415. };
  4416. _proto._getParent = function _getParent() {
  4417. var _this3 = this;
  4418. var parent;
  4419. if (Util.isElement(this._config.parent)) {
  4420. parent = this._config.parent; // It's a jQuery object
  4421. if (typeof this._config.parent.jquery !== 'undefined') {
  4422. parent = this._config.parent[0];
  4423. }
  4424. } else {
  4425. parent = document.querySelector(this._config.parent);
  4426. }
  4427. var selector = "[data-toggle=\"collapse\"][data-parent=\"" + this._config.parent + "\"]";
  4428. var children = [].slice.call(parent.querySelectorAll(selector));
  4429. $(children).each(function (i, element) {
  4430. _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]);
  4431. });
  4432. return parent;
  4433. };
  4434. _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {
  4435. var isOpen = $(element).hasClass(ClassName$3.SHOW);
  4436. if (triggerArray.length) {
  4437. $(triggerArray).toggleClass(ClassName$3.COLLAPSED, !isOpen).attr('aria-expanded', isOpen);
  4438. }
  4439. } // Static
  4440. ;
  4441. Collapse._getTargetFromElement = function _getTargetFromElement(element) {
  4442. var selector = Util.getSelectorFromElement(element);
  4443. return selector ? document.querySelector(selector) : null;
  4444. };
  4445. Collapse._jQueryInterface = function _jQueryInterface(config) {
  4446. return this.each(function () {
  4447. var $this = $(this);
  4448. var data = $this.data(DATA_KEY$3);
  4449. var _config = _objectSpread2({}, Default$1, {}, $this.data(), {}, typeof config === 'object' && config ? config : {});
  4450. if (!data && _config.toggle && /show|hide/.test(config)) {
  4451. _config.toggle = false;
  4452. }
  4453. if (!data) {
  4454. data = new Collapse(this, _config);
  4455. $this.data(DATA_KEY$3, data);
  4456. }
  4457. if (typeof config === 'string') {
  4458. if (typeof data[config] === 'undefined') {
  4459. throw new TypeError("No method named \"" + config + "\"");
  4460. }
  4461. data[config]();
  4462. }
  4463. });
  4464. };
  4465. _createClass(Collapse, null, [{
  4466. key: "VERSION",
  4467. get: function get() {
  4468. return VERSION$3;
  4469. }
  4470. }, {
  4471. key: "Default",
  4472. get: function get() {
  4473. return Default$1;
  4474. }
  4475. }]);
  4476. return Collapse;
  4477. }();
  4478. /**
  4479. * ------------------------------------------------------------------------
  4480. * Data Api implementation
  4481. * ------------------------------------------------------------------------
  4482. */
  4483. $(document).on(Event$3.CLICK_DATA_API, Selector$3.DATA_TOGGLE, function (event) {
  4484. // preventDefault only for <a> elements (which change the URL) not inside the collapsible element
  4485. if (event.currentTarget.tagName === 'A') {
  4486. event.preventDefault();
  4487. }
  4488. var $trigger = $(this);
  4489. var selector = Util.getSelectorFromElement(this);
  4490. var selectors = [].slice.call(document.querySelectorAll(selector));
  4491. $(selectors).each(function () {
  4492. var $target = $(this);
  4493. var data = $target.data(DATA_KEY$3);
  4494. var config = data ? 'toggle' : $trigger.data();
  4495. Collapse._jQueryInterface.call($target, config);
  4496. });
  4497. });
  4498. /**
  4499. * ------------------------------------------------------------------------
  4500. * jQuery
  4501. * ------------------------------------------------------------------------
  4502. */
  4503. $.fn[NAME$3] = Collapse._jQueryInterface;
  4504. $.fn[NAME$3].Constructor = Collapse;
  4505. $.fn[NAME$3].noConflict = function () {
  4506. $.fn[NAME$3] = JQUERY_NO_CONFLICT$3;
  4507. return Collapse._jQueryInterface;
  4508. };
  4509. /**
  4510. * ------------------------------------------------------------------------
  4511. * Constants
  4512. * ------------------------------------------------------------------------
  4513. */
  4514. var NAME$4 = 'dropdown';
  4515. var VERSION$4 = '4.4.1';
  4516. var DATA_KEY$4 = 'bs.dropdown';
  4517. var EVENT_KEY$4 = "." + DATA_KEY$4;
  4518. var DATA_API_KEY$4 = '.data-api';
  4519. var JQUERY_NO_CONFLICT$4 = $.fn[NAME$4];
  4520. var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
  4521. var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key
  4522. var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key
  4523. var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key
  4524. var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key
  4525. var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse)
  4526. var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + "|" + ARROW_DOWN_KEYCODE + "|" + ESCAPE_KEYCODE);
  4527. var Event$4 = {
  4528. HIDE: "hide" + EVENT_KEY$4,
  4529. HIDDEN: "hidden" + EVENT_KEY$4,
  4530. SHOW: "show" + EVENT_KEY$4,
  4531. SHOWN: "shown" + EVENT_KEY$4,
  4532. CLICK: "click" + EVENT_KEY$4,
  4533. CLICK_DATA_API: "click" + EVENT_KEY$4 + DATA_API_KEY$4,
  4534. KEYDOWN_DATA_API: "keydown" + EVENT_KEY$4 + DATA_API_KEY$4,
  4535. KEYUP_DATA_API: "keyup" + EVENT_KEY$4 + DATA_API_KEY$4
  4536. };
  4537. var ClassName$4 = {
  4538. DISABLED: 'disabled',
  4539. SHOW: 'show',
  4540. DROPUP: 'dropup',
  4541. DROPRIGHT: 'dropright',
  4542. DROPLEFT: 'dropleft',
  4543. MENURIGHT: 'dropdown-menu-right',
  4544. MENULEFT: 'dropdown-menu-left',
  4545. POSITION_STATIC: 'position-static'
  4546. };
  4547. var Selector$4 = {
  4548. DATA_TOGGLE: '[data-toggle="dropdown"]',
  4549. FORM_CHILD: '.dropdown form',
  4550. MENU: '.dropdown-menu',
  4551. NAVBAR_NAV: '.navbar-nav',
  4552. VISIBLE_ITEMS: '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'
  4553. };
  4554. var AttachmentMap = {
  4555. TOP: 'top-start',
  4556. TOPEND: 'top-end',
  4557. BOTTOM: 'bottom-start',
  4558. BOTTOMEND: 'bottom-end',
  4559. RIGHT: 'right-start',
  4560. RIGHTEND: 'right-end',
  4561. LEFT: 'left-start',
  4562. LEFTEND: 'left-end'
  4563. };
  4564. var Default$2 = {
  4565. offset: 0,
  4566. flip: true,
  4567. boundary: 'scrollParent',
  4568. reference: 'toggle',
  4569. display: 'dynamic',
  4570. popperConfig: null
  4571. };
  4572. var DefaultType$2 = {
  4573. offset: '(number|string|function)',
  4574. flip: 'boolean',
  4575. boundary: '(string|element)',
  4576. reference: '(string|element)',
  4577. display: 'string',
  4578. popperConfig: '(null|object)'
  4579. };
  4580. /**
  4581. * ------------------------------------------------------------------------
  4582. * Class Definition
  4583. * ------------------------------------------------------------------------
  4584. */
  4585. var Dropdown =
  4586. /*#__PURE__*/
  4587. function () {
  4588. function Dropdown(element, config) {
  4589. this._element = element;
  4590. this._popper = null;
  4591. this._config = this._getConfig(config);
  4592. this._menu = this._getMenuElement();
  4593. this._inNavbar = this._detectNavbar();
  4594. this._addEventListeners();
  4595. } // Getters
  4596. var _proto = Dropdown.prototype;
  4597. // Public
  4598. _proto.toggle = function toggle() {
  4599. if (this._element.disabled || $(this._element).hasClass(ClassName$4.DISABLED)) {
  4600. return;
  4601. }
  4602. var isActive = $(this._menu).hasClass(ClassName$4.SHOW);
  4603. Dropdown._clearMenus();
  4604. if (isActive) {
  4605. return;
  4606. }
  4607. this.show(true);
  4608. };
  4609. _proto.show = function show(usePopper) {
  4610. if (usePopper === void 0) {
  4611. usePopper = false;
  4612. }
  4613. if (this._element.disabled || $(this._element).hasClass(ClassName$4.DISABLED) || $(this._menu).hasClass(ClassName$4.SHOW)) {
  4614. return;
  4615. }
  4616. var relatedTarget = {
  4617. relatedTarget: this._element
  4618. };
  4619. var showEvent = $.Event(Event$4.SHOW, relatedTarget);
  4620. var parent = Dropdown._getParentFromElement(this._element);
  4621. $(parent).trigger(showEvent);
  4622. if (showEvent.isDefaultPrevented()) {
  4623. return;
  4624. } // Disable totally Popper.js for Dropdown in Navbar
  4625. if (!this._inNavbar && usePopper) {
  4626. /**
  4627. * Check for Popper dependency
  4628. * Popper - https://popper.js.org
  4629. */
  4630. if (typeof Popper === 'undefined') {
  4631. throw new TypeError('Bootstrap\'s dropdowns require Popper.js (https://popper.js.org/)');
  4632. }
  4633. var referenceElement = this._element;
  4634. if (this._config.reference === 'parent') {
  4635. referenceElement = parent;
  4636. } else if (Util.isElement(this._config.reference)) {
  4637. referenceElement = this._config.reference; // Check if it's jQuery element
  4638. if (typeof this._config.reference.jquery !== 'undefined') {
  4639. referenceElement = this._config.reference[0];
  4640. }
  4641. } // If boundary is not `scrollParent`, then set position to `static`
  4642. // to allow the menu to "escape" the scroll parent's boundaries
  4643. // https://github.com/twbs/bootstrap/issues/24251
  4644. if (this._config.boundary !== 'scrollParent') {
  4645. $(parent).addClass(ClassName$4.POSITION_STATIC);
  4646. }
  4647. this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig());
  4648. } // If this is a touch-enabled device we add extra
  4649. // empty mouseover listeners to the body's immediate children;
  4650. // only needed because of broken event delegation on iOS
  4651. // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
  4652. if ('ontouchstart' in document.documentElement && $(parent).closest(Selector$4.NAVBAR_NAV).length === 0) {
  4653. $(document.body).children().on('mouseover', null, $.noop);
  4654. }
  4655. this._element.focus();
  4656. this._element.setAttribute('aria-expanded', true);
  4657. $(this._menu).toggleClass(ClassName$4.SHOW);
  4658. $(parent).toggleClass(ClassName$4.SHOW).trigger($.Event(Event$4.SHOWN, relatedTarget));
  4659. };
  4660. _proto.hide = function hide() {
  4661. if (this._element.disabled || $(this._element).hasClass(ClassName$4.DISABLED) || !$(this._menu).hasClass(ClassName$4.SHOW)) {
  4662. return;
  4663. }
  4664. var relatedTarget = {
  4665. relatedTarget: this._element
  4666. };
  4667. var hideEvent = $.Event(Event$4.HIDE, relatedTarget);
  4668. var parent = Dropdown._getParentFromElement(this._element);
  4669. $(parent).trigger(hideEvent);
  4670. if (hideEvent.isDefaultPrevented()) {
  4671. return;
  4672. }
  4673. if (this._popper) {
  4674. this._popper.destroy();
  4675. }
  4676. $(this._menu).toggleClass(ClassName$4.SHOW);
  4677. $(parent).toggleClass(ClassName$4.SHOW).trigger($.Event(Event$4.HIDDEN, relatedTarget));
  4678. };
  4679. _proto.dispose = function dispose() {
  4680. $.removeData(this._element, DATA_KEY$4);
  4681. $(this._element).off(EVENT_KEY$4);
  4682. this._element = null;
  4683. this._menu = null;
  4684. if (this._popper !== null) {
  4685. this._popper.destroy();
  4686. this._popper = null;
  4687. }
  4688. };
  4689. _proto.update = function update() {
  4690. this._inNavbar = this._detectNavbar();
  4691. if (this._popper !== null) {
  4692. this._popper.scheduleUpdate();
  4693. }
  4694. } // Private
  4695. ;
  4696. _proto._addEventListeners = function _addEventListeners() {
  4697. var _this = this;
  4698. $(this._element).on(Event$4.CLICK, function (event) {
  4699. event.preventDefault();
  4700. event.stopPropagation();
  4701. _this.toggle();
  4702. });
  4703. };
  4704. _proto._getConfig = function _getConfig(config) {
  4705. config = _objectSpread2({}, this.constructor.Default, {}, $(this._element).data(), {}, config);
  4706. Util.typeCheckConfig(NAME$4, config, this.constructor.DefaultType);
  4707. return config;
  4708. };
  4709. _proto._getMenuElement = function _getMenuElement() {
  4710. if (!this._menu) {
  4711. var parent = Dropdown._getParentFromElement(this._element);
  4712. if (parent) {
  4713. this._menu = parent.querySelector(Selector$4.MENU);
  4714. }
  4715. }
  4716. return this._menu;
  4717. };
  4718. _proto._getPlacement = function _getPlacement() {
  4719. var $parentDropdown = $(this._element.parentNode);
  4720. var placement = AttachmentMap.BOTTOM; // Handle dropup
  4721. if ($parentDropdown.hasClass(ClassName$4.DROPUP)) {
  4722. placement = AttachmentMap.TOP;
  4723. if ($(this._menu).hasClass(ClassName$4.MENURIGHT)) {
  4724. placement = AttachmentMap.TOPEND;
  4725. }
  4726. } else if ($parentDropdown.hasClass(ClassName$4.DROPRIGHT)) {
  4727. placement = AttachmentMap.RIGHT;
  4728. } else if ($parentDropdown.hasClass(ClassName$4.DROPLEFT)) {
  4729. placement = AttachmentMap.LEFT;
  4730. } else if ($(this._menu).hasClass(ClassName$4.MENURIGHT)) {
  4731. placement = AttachmentMap.BOTTOMEND;
  4732. }
  4733. return placement;
  4734. };
  4735. _proto._detectNavbar = function _detectNavbar() {
  4736. return $(this._element).closest('.navbar').length > 0;
  4737. };
  4738. _proto._getOffset = function _getOffset() {
  4739. var _this2 = this;
  4740. var offset = {};
  4741. if (typeof this._config.offset === 'function') {
  4742. offset.fn = function (data) {
  4743. data.offsets = _objectSpread2({}, data.offsets, {}, _this2._config.offset(data.offsets, _this2._element) || {});
  4744. return data;
  4745. };
  4746. } else {
  4747. offset.offset = this._config.offset;
  4748. }
  4749. return offset;
  4750. };
  4751. _proto._getPopperConfig = function _getPopperConfig() {
  4752. var popperConfig = {
  4753. placement: this._getPlacement(),
  4754. modifiers: {
  4755. offset: this._getOffset(),
  4756. flip: {
  4757. enabled: this._config.flip
  4758. },
  4759. preventOverflow: {
  4760. boundariesElement: this._config.boundary
  4761. }
  4762. }
  4763. }; // Disable Popper.js if we have a static display
  4764. if (this._config.display === 'static') {
  4765. popperConfig.modifiers.applyStyle = {
  4766. enabled: false
  4767. };
  4768. }
  4769. return _objectSpread2({}, popperConfig, {}, this._config.popperConfig);
  4770. } // Static
  4771. ;
  4772. Dropdown._jQueryInterface = function _jQueryInterface(config) {
  4773. return this.each(function () {
  4774. var data = $(this).data(DATA_KEY$4);
  4775. var _config = typeof config === 'object' ? config : null;
  4776. if (!data) {
  4777. data = new Dropdown(this, _config);
  4778. $(this).data(DATA_KEY$4, data);
  4779. }
  4780. if (typeof config === 'string') {
  4781. if (typeof data[config] === 'undefined') {
  4782. throw new TypeError("No method named \"" + config + "\"");
  4783. }
  4784. data[config]();
  4785. }
  4786. });
  4787. };
  4788. Dropdown._clearMenus = function _clearMenus(event) {
  4789. if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) {
  4790. return;
  4791. }
  4792. var toggles = [].slice.call(document.querySelectorAll(Selector$4.DATA_TOGGLE));
  4793. for (var i = 0, len = toggles.length; i < len; i++) {
  4794. var parent = Dropdown._getParentFromElement(toggles[i]);
  4795. var context = $(toggles[i]).data(DATA_KEY$4);
  4796. var relatedTarget = {
  4797. relatedTarget: toggles[i]
  4798. };
  4799. if (event && event.type === 'click') {
  4800. relatedTarget.clickEvent = event;
  4801. }
  4802. if (!context) {
  4803. continue;
  4804. }
  4805. var dropdownMenu = context._menu;
  4806. if (!$(parent).hasClass(ClassName$4.SHOW)) {
  4807. continue;
  4808. }
  4809. if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $.contains(parent, event.target)) {
  4810. continue;
  4811. }
  4812. var hideEvent = $.Event(Event$4.HIDE, relatedTarget);
  4813. $(parent).trigger(hideEvent);
  4814. if (hideEvent.isDefaultPrevented()) {
  4815. continue;
  4816. } // If this is a touch-enabled device we remove the extra
  4817. // empty mouseover listeners we added for iOS support
  4818. if ('ontouchstart' in document.documentElement) {
  4819. $(document.body).children().off('mouseover', null, $.noop);
  4820. }
  4821. toggles[i].setAttribute('aria-expanded', 'false');
  4822. if (context._popper) {
  4823. context._popper.destroy();
  4824. }
  4825. $(dropdownMenu).removeClass(ClassName$4.SHOW);
  4826. $(parent).removeClass(ClassName$4.SHOW).trigger($.Event(Event$4.HIDDEN, relatedTarget));
  4827. }
  4828. };
  4829. Dropdown._getParentFromElement = function _getParentFromElement(element) {
  4830. var parent;
  4831. var selector = Util.getSelectorFromElement(element);
  4832. if (selector) {
  4833. parent = document.querySelector(selector);
  4834. }
  4835. return parent || element.parentNode;
  4836. } // eslint-disable-next-line complexity
  4837. ;
  4838. Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) {
  4839. // If not input/textarea:
  4840. // - And not a key in REGEXP_KEYDOWN => not a dropdown command
  4841. // If input/textarea:
  4842. // - If space key => not a dropdown command
  4843. // - If key is other than escape
  4844. // - If key is not up or down => not a dropdown command
  4845. // - If trigger inside the menu => not a dropdown command
  4846. 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)) {
  4847. return;
  4848. }
  4849. event.preventDefault();
  4850. event.stopPropagation();
  4851. if (this.disabled || $(this).hasClass(ClassName$4.DISABLED)) {
  4852. return;
  4853. }
  4854. var parent = Dropdown._getParentFromElement(this);
  4855. var isActive = $(parent).hasClass(ClassName$4.SHOW);
  4856. if (!isActive && event.which === ESCAPE_KEYCODE) {
  4857. return;
  4858. }
  4859. if (!isActive || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {
  4860. if (event.which === ESCAPE_KEYCODE) {
  4861. var toggle = parent.querySelector(Selector$4.DATA_TOGGLE);
  4862. $(toggle).trigger('focus');
  4863. }
  4864. $(this).trigger('click');
  4865. return;
  4866. }
  4867. var items = [].slice.call(parent.querySelectorAll(Selector$4.VISIBLE_ITEMS)).filter(function (item) {
  4868. return $(item).is(':visible');
  4869. });
  4870. if (items.length === 0) {
  4871. return;
  4872. }
  4873. var index = items.indexOf(event.target);
  4874. if (event.which === ARROW_UP_KEYCODE && index > 0) {
  4875. // Up
  4876. index--;
  4877. }
  4878. if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) {
  4879. // Down
  4880. index++;
  4881. }
  4882. if (index < 0) {
  4883. index = 0;
  4884. }
  4885. items[index].focus();
  4886. };
  4887. _createClass(Dropdown, null, [{
  4888. key: "VERSION",
  4889. get: function get() {
  4890. return VERSION$4;
  4891. }
  4892. }, {
  4893. key: "Default",
  4894. get: function get() {
  4895. return Default$2;
  4896. }
  4897. }, {
  4898. key: "DefaultType",
  4899. get: function get() {
  4900. return DefaultType$2;
  4901. }
  4902. }]);
  4903. return Dropdown;
  4904. }();
  4905. /**
  4906. * ------------------------------------------------------------------------
  4907. * Data Api implementation
  4908. * ------------------------------------------------------------------------
  4909. */
  4910. $(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) {
  4911. event.preventDefault();
  4912. event.stopPropagation();
  4913. Dropdown._jQueryInterface.call($(this), 'toggle');
  4914. }).on(Event$4.CLICK_DATA_API, Selector$4.FORM_CHILD, function (e) {
  4915. e.stopPropagation();
  4916. });
  4917. /**
  4918. * ------------------------------------------------------------------------
  4919. * jQuery
  4920. * ------------------------------------------------------------------------
  4921. */
  4922. $.fn[NAME$4] = Dropdown._jQueryInterface;
  4923. $.fn[NAME$4].Constructor = Dropdown;
  4924. $.fn[NAME$4].noConflict = function () {
  4925. $.fn[NAME$4] = JQUERY_NO_CONFLICT$4;
  4926. return Dropdown._jQueryInterface;
  4927. };
  4928. /**
  4929. * ------------------------------------------------------------------------
  4930. * Constants
  4931. * ------------------------------------------------------------------------
  4932. */
  4933. var NAME$5 = 'modal';
  4934. var VERSION$5 = '4.4.1';
  4935. var DATA_KEY$5 = 'bs.modal';
  4936. var EVENT_KEY$5 = "." + DATA_KEY$5;
  4937. var DATA_API_KEY$5 = '.data-api';
  4938. var JQUERY_NO_CONFLICT$5 = $.fn[NAME$5];
  4939. var ESCAPE_KEYCODE$1 = 27; // KeyboardEvent.which value for Escape (Esc) key
  4940. var Default$3 = {
  4941. backdrop: true,
  4942. keyboard: true,
  4943. focus: true,
  4944. show: true
  4945. };
  4946. var DefaultType$3 = {
  4947. backdrop: '(boolean|string)',
  4948. keyboard: 'boolean',
  4949. focus: 'boolean',
  4950. show: 'boolean'
  4951. };
  4952. var Event$5 = {
  4953. HIDE: "hide" + EVENT_KEY$5,
  4954. HIDE_PREVENTED: "hidePrevented" + EVENT_KEY$5,
  4955. HIDDEN: "hidden" + EVENT_KEY$5,
  4956. SHOW: "show" + EVENT_KEY$5,
  4957. SHOWN: "shown" + EVENT_KEY$5,
  4958. FOCUSIN: "focusin" + EVENT_KEY$5,
  4959. RESIZE: "resize" + EVENT_KEY$5,
  4960. CLICK_DISMISS: "click.dismiss" + EVENT_KEY$5,
  4961. KEYDOWN_DISMISS: "keydown.dismiss" + EVENT_KEY$5,
  4962. MOUSEUP_DISMISS: "mouseup.dismiss" + EVENT_KEY$5,
  4963. MOUSEDOWN_DISMISS: "mousedown.dismiss" + EVENT_KEY$5,
  4964. CLICK_DATA_API: "click" + EVENT_KEY$5 + DATA_API_KEY$5
  4965. };
  4966. var ClassName$5 = {
  4967. SCROLLABLE: 'modal-dialog-scrollable',
  4968. SCROLLBAR_MEASURER: 'modal-scrollbar-measure',
  4969. BACKDROP: 'modal-backdrop',
  4970. OPEN: 'modal-open',
  4971. FADE: 'fade',
  4972. SHOW: 'show',
  4973. STATIC: 'modal-static'
  4974. };
  4975. var Selector$5 = {
  4976. DIALOG: '.modal-dialog',
  4977. MODAL_BODY: '.modal-body',
  4978. DATA_TOGGLE: '[data-toggle="modal"]',
  4979. DATA_DISMISS: '[data-dismiss="modal"]',
  4980. FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top',
  4981. STICKY_CONTENT: '.sticky-top'
  4982. };
  4983. /**
  4984. * ------------------------------------------------------------------------
  4985. * Class Definition
  4986. * ------------------------------------------------------------------------
  4987. */
  4988. var Modal =
  4989. /*#__PURE__*/
  4990. function () {
  4991. function Modal(element, config) {
  4992. this._config = this._getConfig(config);
  4993. this._element = element;
  4994. this._dialog = element.querySelector(Selector$5.DIALOG);
  4995. this._backdrop = null;
  4996. this._isShown = false;
  4997. this._isBodyOverflowing = false;
  4998. this._ignoreBackdropClick = false;
  4999. this._isTransitioning = false;
  5000. this._scrollbarWidth = 0;
  5001. } // Getters
  5002. var _proto = Modal.prototype;
  5003. // Public
  5004. _proto.toggle = function toggle(relatedTarget) {
  5005. return this._isShown ? this.hide() : this.show(relatedTarget);
  5006. };
  5007. _proto.show = function show(relatedTarget) {
  5008. var _this = this;
  5009. if (this._isShown || this._isTransitioning) {
  5010. return;
  5011. }
  5012. if ($(this._element).hasClass(ClassName$5.FADE)) {
  5013. this._isTransitioning = true;
  5014. }
  5015. var showEvent = $.Event(Event$5.SHOW, {
  5016. relatedTarget: relatedTarget
  5017. });
  5018. $(this._element).trigger(showEvent);
  5019. if (this._isShown || showEvent.isDefaultPrevented()) {
  5020. return;
  5021. }
  5022. this._isShown = true;
  5023. this._checkScrollbar();
  5024. this._setScrollbar();
  5025. this._adjustDialog();
  5026. this._setEscapeEvent();
  5027. this._setResizeEvent();
  5028. $(this._element).on(Event$5.CLICK_DISMISS, Selector$5.DATA_DISMISS, function (event) {
  5029. return _this.hide(event);
  5030. });
  5031. $(this._dialog).on(Event$5.MOUSEDOWN_DISMISS, function () {
  5032. $(_this._element).one(Event$5.MOUSEUP_DISMISS, function (event) {
  5033. if ($(event.target).is(_this._element)) {
  5034. _this._ignoreBackdropClick = true;
  5035. }
  5036. });
  5037. });
  5038. this._showBackdrop(function () {
  5039. return _this._showElement(relatedTarget);
  5040. });
  5041. };
  5042. _proto.hide = function hide(event) {
  5043. var _this2 = this;
  5044. if (event) {
  5045. event.preventDefault();
  5046. }
  5047. if (!this._isShown || this._isTransitioning) {
  5048. return;
  5049. }
  5050. var hideEvent = $.Event(Event$5.HIDE);
  5051. $(this._element).trigger(hideEvent);
  5052. if (!this._isShown || hideEvent.isDefaultPrevented()) {
  5053. return;
  5054. }
  5055. this._isShown = false;
  5056. var transition = $(this._element).hasClass(ClassName$5.FADE);
  5057. if (transition) {
  5058. this._isTransitioning = true;
  5059. }
  5060. this._setEscapeEvent();
  5061. this._setResizeEvent();
  5062. $(document).off(Event$5.FOCUSIN);
  5063. $(this._element).removeClass(ClassName$5.SHOW);
  5064. $(this._element).off(Event$5.CLICK_DISMISS);
  5065. $(this._dialog).off(Event$5.MOUSEDOWN_DISMISS);
  5066. if (transition) {
  5067. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  5068. $(this._element).one(Util.TRANSITION_END, function (event) {
  5069. return _this2._hideModal(event);
  5070. }).emulateTransitionEnd(transitionDuration);
  5071. } else {
  5072. this._hideModal();
  5073. }
  5074. };
  5075. _proto.dispose = function dispose() {
  5076. [window, this._element, this._dialog].forEach(function (htmlElement) {
  5077. return $(htmlElement).off(EVENT_KEY$5);
  5078. });
  5079. /**
  5080. * `document` has 2 events `Event.FOCUSIN` and `Event.CLICK_DATA_API`
  5081. * Do not move `document` in `htmlElements` array
  5082. * It will remove `Event.CLICK_DATA_API` event that should remain
  5083. */
  5084. $(document).off(Event$5.FOCUSIN);
  5085. $.removeData(this._element, DATA_KEY$5);
  5086. this._config = null;
  5087. this._element = null;
  5088. this._dialog = null;
  5089. this._backdrop = null;
  5090. this._isShown = null;
  5091. this._isBodyOverflowing = null;
  5092. this._ignoreBackdropClick = null;
  5093. this._isTransitioning = null;
  5094. this._scrollbarWidth = null;
  5095. };
  5096. _proto.handleUpdate = function handleUpdate() {
  5097. this._adjustDialog();
  5098. } // Private
  5099. ;
  5100. _proto._getConfig = function _getConfig(config) {
  5101. config = _objectSpread2({}, Default$3, {}, config);
  5102. Util.typeCheckConfig(NAME$5, config, DefaultType$3);
  5103. return config;
  5104. };
  5105. _proto._triggerBackdropTransition = function _triggerBackdropTransition() {
  5106. var _this3 = this;
  5107. if (this._config.backdrop === 'static') {
  5108. var hideEventPrevented = $.Event(Event$5.HIDE_PREVENTED);
  5109. $(this._element).trigger(hideEventPrevented);
  5110. if (hideEventPrevented.defaultPrevented) {
  5111. return;
  5112. }
  5113. this._element.classList.add(ClassName$5.STATIC);
  5114. var modalTransitionDuration = Util.getTransitionDurationFromElement(this._element);
  5115. $(this._element).one(Util.TRANSITION_END, function () {
  5116. _this3._element.classList.remove(ClassName$5.STATIC);
  5117. }).emulateTransitionEnd(modalTransitionDuration);
  5118. this._element.focus();
  5119. } else {
  5120. this.hide();
  5121. }
  5122. };
  5123. _proto._showElement = function _showElement(relatedTarget) {
  5124. var _this4 = this;
  5125. var transition = $(this._element).hasClass(ClassName$5.FADE);
  5126. var modalBody = this._dialog ? this._dialog.querySelector(Selector$5.MODAL_BODY) : null;
  5127. if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
  5128. // Don't move modal's DOM position
  5129. document.body.appendChild(this._element);
  5130. }
  5131. this._element.style.display = 'block';
  5132. this._element.removeAttribute('aria-hidden');
  5133. this._element.setAttribute('aria-modal', true);
  5134. if ($(this._dialog).hasClass(ClassName$5.SCROLLABLE) && modalBody) {
  5135. modalBody.scrollTop = 0;
  5136. } else {
  5137. this._element.scrollTop = 0;
  5138. }
  5139. if (transition) {
  5140. Util.reflow(this._element);
  5141. }
  5142. $(this._element).addClass(ClassName$5.SHOW);
  5143. if (this._config.focus) {
  5144. this._enforceFocus();
  5145. }
  5146. var shownEvent = $.Event(Event$5.SHOWN, {
  5147. relatedTarget: relatedTarget
  5148. });
  5149. var transitionComplete = function transitionComplete() {
  5150. if (_this4._config.focus) {
  5151. _this4._element.focus();
  5152. }
  5153. _this4._isTransitioning = false;
  5154. $(_this4._element).trigger(shownEvent);
  5155. };
  5156. if (transition) {
  5157. var transitionDuration = Util.getTransitionDurationFromElement(this._dialog);
  5158. $(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration);
  5159. } else {
  5160. transitionComplete();
  5161. }
  5162. };
  5163. _proto._enforceFocus = function _enforceFocus() {
  5164. var _this5 = this;
  5165. $(document).off(Event$5.FOCUSIN) // Guard against infinite focus loop
  5166. .on(Event$5.FOCUSIN, function (event) {
  5167. if (document !== event.target && _this5._element !== event.target && $(_this5._element).has(event.target).length === 0) {
  5168. _this5._element.focus();
  5169. }
  5170. });
  5171. };
  5172. _proto._setEscapeEvent = function _setEscapeEvent() {
  5173. var _this6 = this;
  5174. if (this._isShown && this._config.keyboard) {
  5175. $(this._element).on(Event$5.KEYDOWN_DISMISS, function (event) {
  5176. if (event.which === ESCAPE_KEYCODE$1) {
  5177. _this6._triggerBackdropTransition();
  5178. }
  5179. });
  5180. } else if (!this._isShown) {
  5181. $(this._element).off(Event$5.KEYDOWN_DISMISS);
  5182. }
  5183. };
  5184. _proto._setResizeEvent = function _setResizeEvent() {
  5185. var _this7 = this;
  5186. if (this._isShown) {
  5187. $(window).on(Event$5.RESIZE, function (event) {
  5188. return _this7.handleUpdate(event);
  5189. });
  5190. } else {
  5191. $(window).off(Event$5.RESIZE);
  5192. }
  5193. };
  5194. _proto._hideModal = function _hideModal() {
  5195. var _this8 = this;
  5196. this._element.style.display = 'none';
  5197. this._element.setAttribute('aria-hidden', true);
  5198. this._element.removeAttribute('aria-modal');
  5199. this._isTransitioning = false;
  5200. this._showBackdrop(function () {
  5201. $(document.body).removeClass(ClassName$5.OPEN);
  5202. _this8._resetAdjustments();
  5203. _this8._resetScrollbar();
  5204. $(_this8._element).trigger(Event$5.HIDDEN);
  5205. });
  5206. };
  5207. _proto._removeBackdrop = function _removeBackdrop() {
  5208. if (this._backdrop) {
  5209. $(this._backdrop).remove();
  5210. this._backdrop = null;
  5211. }
  5212. };
  5213. _proto._showBackdrop = function _showBackdrop(callback) {
  5214. var _this9 = this;
  5215. var animate = $(this._element).hasClass(ClassName$5.FADE) ? ClassName$5.FADE : '';
  5216. if (this._isShown && this._config.backdrop) {
  5217. this._backdrop = document.createElement('div');
  5218. this._backdrop.className = ClassName$5.BACKDROP;
  5219. if (animate) {
  5220. this._backdrop.classList.add(animate);
  5221. }
  5222. $(this._backdrop).appendTo(document.body);
  5223. $(this._element).on(Event$5.CLICK_DISMISS, function (event) {
  5224. if (_this9._ignoreBackdropClick) {
  5225. _this9._ignoreBackdropClick = false;
  5226. return;
  5227. }
  5228. if (event.target !== event.currentTarget) {
  5229. return;
  5230. }
  5231. _this9._triggerBackdropTransition();
  5232. });
  5233. if (animate) {
  5234. Util.reflow(this._backdrop);
  5235. }
  5236. $(this._backdrop).addClass(ClassName$5.SHOW);
  5237. if (!callback) {
  5238. return;
  5239. }
  5240. if (!animate) {
  5241. callback();
  5242. return;
  5243. }
  5244. var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
  5245. $(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration);
  5246. } else if (!this._isShown && this._backdrop) {
  5247. $(this._backdrop).removeClass(ClassName$5.SHOW);
  5248. var callbackRemove = function callbackRemove() {
  5249. _this9._removeBackdrop();
  5250. if (callback) {
  5251. callback();
  5252. }
  5253. };
  5254. if ($(this._element).hasClass(ClassName$5.FADE)) {
  5255. var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
  5256. $(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration);
  5257. } else {
  5258. callbackRemove();
  5259. }
  5260. } else if (callback) {
  5261. callback();
  5262. }
  5263. } // ----------------------------------------------------------------------
  5264. // the following methods are used to handle overflowing modals
  5265. // todo (fat): these should probably be refactored out of modal.js
  5266. // ----------------------------------------------------------------------
  5267. ;
  5268. _proto._adjustDialog = function _adjustDialog() {
  5269. var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
  5270. if (!this._isBodyOverflowing && isModalOverflowing) {
  5271. this._element.style.paddingLeft = this._scrollbarWidth + "px";
  5272. }
  5273. if (this._isBodyOverflowing && !isModalOverflowing) {
  5274. this._element.style.paddingRight = this._scrollbarWidth + "px";
  5275. }
  5276. };
  5277. _proto._resetAdjustments = function _resetAdjustments() {
  5278. this._element.style.paddingLeft = '';
  5279. this._element.style.paddingRight = '';
  5280. };
  5281. _proto._checkScrollbar = function _checkScrollbar() {
  5282. var rect = document.body.getBoundingClientRect();
  5283. this._isBodyOverflowing = rect.left + rect.right < window.innerWidth;
  5284. this._scrollbarWidth = this._getScrollbarWidth();
  5285. };
  5286. _proto._setScrollbar = function _setScrollbar() {
  5287. var _this10 = this;
  5288. if (this._isBodyOverflowing) {
  5289. // Note: DOMNode.style.paddingRight returns the actual value or '' if not set
  5290. // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set
  5291. var fixedContent = [].slice.call(document.querySelectorAll(Selector$5.FIXED_CONTENT));
  5292. var stickyContent = [].slice.call(document.querySelectorAll(Selector$5.STICKY_CONTENT)); // Adjust fixed content padding
  5293. $(fixedContent).each(function (index, element) {
  5294. var actualPadding = element.style.paddingRight;
  5295. var calculatedPadding = $(element).css('padding-right');
  5296. $(element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this10._scrollbarWidth + "px");
  5297. }); // Adjust sticky content margin
  5298. $(stickyContent).each(function (index, element) {
  5299. var actualMargin = element.style.marginRight;
  5300. var calculatedMargin = $(element).css('margin-right');
  5301. $(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this10._scrollbarWidth + "px");
  5302. }); // Adjust body padding
  5303. var actualPadding = document.body.style.paddingRight;
  5304. var calculatedPadding = $(document.body).css('padding-right');
  5305. $(document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + "px");
  5306. }
  5307. $(document.body).addClass(ClassName$5.OPEN);
  5308. };
  5309. _proto._resetScrollbar = function _resetScrollbar() {
  5310. // Restore fixed content padding
  5311. var fixedContent = [].slice.call(document.querySelectorAll(Selector$5.FIXED_CONTENT));
  5312. $(fixedContent).each(function (index, element) {
  5313. var padding = $(element).data('padding-right');
  5314. $(element).removeData('padding-right');
  5315. element.style.paddingRight = padding ? padding : '';
  5316. }); // Restore sticky content
  5317. var elements = [].slice.call(document.querySelectorAll("" + Selector$5.STICKY_CONTENT));
  5318. $(elements).each(function (index, element) {
  5319. var margin = $(element).data('margin-right');
  5320. if (typeof margin !== 'undefined') {
  5321. $(element).css('margin-right', margin).removeData('margin-right');
  5322. }
  5323. }); // Restore body padding
  5324. var padding = $(document.body).data('padding-right');
  5325. $(document.body).removeData('padding-right');
  5326. document.body.style.paddingRight = padding ? padding : '';
  5327. };
  5328. _proto._getScrollbarWidth = function _getScrollbarWidth() {
  5329. // thx d.walsh
  5330. var scrollDiv = document.createElement('div');
  5331. scrollDiv.className = ClassName$5.SCROLLBAR_MEASURER;
  5332. document.body.appendChild(scrollDiv);
  5333. var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth;
  5334. document.body.removeChild(scrollDiv);
  5335. return scrollbarWidth;
  5336. } // Static
  5337. ;
  5338. Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) {
  5339. return this.each(function () {
  5340. var data = $(this).data(DATA_KEY$5);
  5341. var _config = _objectSpread2({}, Default$3, {}, $(this).data(), {}, typeof config === 'object' && config ? config : {});
  5342. if (!data) {
  5343. data = new Modal(this, _config);
  5344. $(this).data(DATA_KEY$5, data);
  5345. }
  5346. if (typeof config === 'string') {
  5347. if (typeof data[config] === 'undefined') {
  5348. throw new TypeError("No method named \"" + config + "\"");
  5349. }
  5350. data[config](relatedTarget);
  5351. } else if (_config.show) {
  5352. data.show(relatedTarget);
  5353. }
  5354. });
  5355. };
  5356. _createClass(Modal, null, [{
  5357. key: "VERSION",
  5358. get: function get() {
  5359. return VERSION$5;
  5360. }
  5361. }, {
  5362. key: "Default",
  5363. get: function get() {
  5364. return Default$3;
  5365. }
  5366. }]);
  5367. return Modal;
  5368. }();
  5369. /**
  5370. * ------------------------------------------------------------------------
  5371. * Data Api implementation
  5372. * ------------------------------------------------------------------------
  5373. */
  5374. $(document).on(Event$5.CLICK_DATA_API, Selector$5.DATA_TOGGLE, function (event) {
  5375. var _this11 = this;
  5376. var target;
  5377. var selector = Util.getSelectorFromElement(this);
  5378. if (selector) {
  5379. target = document.querySelector(selector);
  5380. }
  5381. var config = $(target).data(DATA_KEY$5) ? 'toggle' : _objectSpread2({}, $(target).data(), {}, $(this).data());
  5382. if (this.tagName === 'A' || this.tagName === 'AREA') {
  5383. event.preventDefault();
  5384. }
  5385. var $target = $(target).one(Event$5.SHOW, function (showEvent) {
  5386. if (showEvent.isDefaultPrevented()) {
  5387. // Only register focus restorer if modal will actually get shown
  5388. return;
  5389. }
  5390. $target.one(Event$5.HIDDEN, function () {
  5391. if ($(_this11).is(':visible')) {
  5392. _this11.focus();
  5393. }
  5394. });
  5395. });
  5396. Modal._jQueryInterface.call($(target), config, this);
  5397. });
  5398. /**
  5399. * ------------------------------------------------------------------------
  5400. * jQuery
  5401. * ------------------------------------------------------------------------
  5402. */
  5403. $.fn[NAME$5] = Modal._jQueryInterface;
  5404. $.fn[NAME$5].Constructor = Modal;
  5405. $.fn[NAME$5].noConflict = function () {
  5406. $.fn[NAME$5] = JQUERY_NO_CONFLICT$5;
  5407. return Modal._jQueryInterface;
  5408. };
  5409. /**
  5410. * --------------------------------------------------------------------------
  5411. * Bootstrap (v4.4.1): tools/sanitizer.js
  5412. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  5413. * --------------------------------------------------------------------------
  5414. */
  5415. var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href'];
  5416. var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
  5417. var DefaultWhitelist = {
  5418. // Global attributes allowed on any supplied element below.
  5419. '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
  5420. a: ['target', 'href', 'title', 'rel'],
  5421. area: [],
  5422. b: [],
  5423. br: [],
  5424. col: [],
  5425. code: [],
  5426. div: [],
  5427. em: [],
  5428. hr: [],
  5429. h1: [],
  5430. h2: [],
  5431. h3: [],
  5432. h4: [],
  5433. h5: [],
  5434. h6: [],
  5435. i: [],
  5436. img: ['src', 'alt', 'title', 'width', 'height'],
  5437. li: [],
  5438. ol: [],
  5439. p: [],
  5440. pre: [],
  5441. s: [],
  5442. small: [],
  5443. span: [],
  5444. sub: [],
  5445. sup: [],
  5446. strong: [],
  5447. u: [],
  5448. ul: []
  5449. };
  5450. /**
  5451. * A pattern that recognizes a commonly useful subset of URLs that are safe.
  5452. *
  5453. * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
  5454. */
  5455. var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi;
  5456. /**
  5457. * A pattern that matches safe data URLs. Only matches image, video and audio types.
  5458. *
  5459. * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
  5460. */
  5461. 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;
  5462. function allowedAttribute(attr, allowedAttributeList) {
  5463. var attrName = attr.nodeName.toLowerCase();
  5464. if (allowedAttributeList.indexOf(attrName) !== -1) {
  5465. if (uriAttrs.indexOf(attrName) !== -1) {
  5466. return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN));
  5467. }
  5468. return true;
  5469. }
  5470. var regExp = allowedAttributeList.filter(function (attrRegex) {
  5471. return attrRegex instanceof RegExp;
  5472. }); // Check if a regular expression validates the attribute.
  5473. for (var i = 0, l = regExp.length; i < l; i++) {
  5474. if (attrName.match(regExp[i])) {
  5475. return true;
  5476. }
  5477. }
  5478. return false;
  5479. }
  5480. function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
  5481. if (unsafeHtml.length === 0) {
  5482. return unsafeHtml;
  5483. }
  5484. if (sanitizeFn && typeof sanitizeFn === 'function') {
  5485. return sanitizeFn(unsafeHtml);
  5486. }
  5487. var domParser = new window.DOMParser();
  5488. var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
  5489. var whitelistKeys = Object.keys(whiteList);
  5490. var elements = [].slice.call(createdDocument.body.querySelectorAll('*'));
  5491. var _loop = function _loop(i, len) {
  5492. var el = elements[i];
  5493. var elName = el.nodeName.toLowerCase();
  5494. if (whitelistKeys.indexOf(el.nodeName.toLowerCase()) === -1) {
  5495. el.parentNode.removeChild(el);
  5496. return "continue";
  5497. }
  5498. var attributeList = [].slice.call(el.attributes);
  5499. var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []);
  5500. attributeList.forEach(function (attr) {
  5501. if (!allowedAttribute(attr, whitelistedAttributes)) {
  5502. el.removeAttribute(attr.nodeName);
  5503. }
  5504. });
  5505. };
  5506. for (var i = 0, len = elements.length; i < len; i++) {
  5507. var _ret = _loop(i);
  5508. if (_ret === "continue") continue;
  5509. }
  5510. return createdDocument.body.innerHTML;
  5511. }
  5512. /**
  5513. * ------------------------------------------------------------------------
  5514. * Constants
  5515. * ------------------------------------------------------------------------
  5516. */
  5517. var NAME$6 = 'tooltip';
  5518. var VERSION$6 = '4.4.1';
  5519. var DATA_KEY$6 = 'bs.tooltip';
  5520. var EVENT_KEY$6 = "." + DATA_KEY$6;
  5521. var JQUERY_NO_CONFLICT$6 = $.fn[NAME$6];
  5522. var CLASS_PREFIX = 'bs-tooltip';
  5523. var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
  5524. var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn'];
  5525. var DefaultType$4 = {
  5526. animation: 'boolean',
  5527. template: 'string',
  5528. title: '(string|element|function)',
  5529. trigger: 'string',
  5530. delay: '(number|object)',
  5531. html: 'boolean',
  5532. selector: '(string|boolean)',
  5533. placement: '(string|function)',
  5534. offset: '(number|string|function)',
  5535. container: '(string|element|boolean)',
  5536. fallbackPlacement: '(string|array)',
  5537. boundary: '(string|element)',
  5538. sanitize: 'boolean',
  5539. sanitizeFn: '(null|function)',
  5540. whiteList: 'object',
  5541. popperConfig: '(null|object)'
  5542. };
  5543. var AttachmentMap$1 = {
  5544. AUTO: 'auto',
  5545. TOP: 'top',
  5546. RIGHT: 'right',
  5547. BOTTOM: 'bottom',
  5548. LEFT: 'left'
  5549. };
  5550. var Default$4 = {
  5551. animation: true,
  5552. template: '<div class="tooltip" role="tooltip">' + '<div class="arrow"></div>' + '<div class="tooltip-inner"></div></div>',
  5553. trigger: 'hover focus',
  5554. title: '',
  5555. delay: 0,
  5556. html: false,
  5557. selector: false,
  5558. placement: 'top',
  5559. offset: 0,
  5560. container: false,
  5561. fallbackPlacement: 'flip',
  5562. boundary: 'scrollParent',
  5563. sanitize: true,
  5564. sanitizeFn: null,
  5565. whiteList: DefaultWhitelist,
  5566. popperConfig: null
  5567. };
  5568. var HoverState = {
  5569. SHOW: 'show',
  5570. OUT: 'out'
  5571. };
  5572. var Event$6 = {
  5573. HIDE: "hide" + EVENT_KEY$6,
  5574. HIDDEN: "hidden" + EVENT_KEY$6,
  5575. SHOW: "show" + EVENT_KEY$6,
  5576. SHOWN: "shown" + EVENT_KEY$6,
  5577. INSERTED: "inserted" + EVENT_KEY$6,
  5578. CLICK: "click" + EVENT_KEY$6,
  5579. FOCUSIN: "focusin" + EVENT_KEY$6,
  5580. FOCUSOUT: "focusout" + EVENT_KEY$6,
  5581. MOUSEENTER: "mouseenter" + EVENT_KEY$6,
  5582. MOUSELEAVE: "mouseleave" + EVENT_KEY$6
  5583. };
  5584. var ClassName$6 = {
  5585. FADE: 'fade',
  5586. SHOW: 'show'
  5587. };
  5588. var Selector$6 = {
  5589. TOOLTIP: '.tooltip',
  5590. TOOLTIP_INNER: '.tooltip-inner',
  5591. ARROW: '.arrow'
  5592. };
  5593. var Trigger = {
  5594. HOVER: 'hover',
  5595. FOCUS: 'focus',
  5596. CLICK: 'click',
  5597. MANUAL: 'manual'
  5598. };
  5599. /**
  5600. * ------------------------------------------------------------------------
  5601. * Class Definition
  5602. * ------------------------------------------------------------------------
  5603. */
  5604. var Tooltip =
  5605. /*#__PURE__*/
  5606. function () {
  5607. function Tooltip(element, config) {
  5608. if (typeof Popper === 'undefined') {
  5609. throw new TypeError('Bootstrap\'s tooltips require Popper.js (https://popper.js.org/)');
  5610. } // private
  5611. this._isEnabled = true;
  5612. this._timeout = 0;
  5613. this._hoverState = '';
  5614. this._activeTrigger = {};
  5615. this._popper = null; // Protected
  5616. this.element = element;
  5617. this.config = this._getConfig(config);
  5618. this.tip = null;
  5619. this._setListeners();
  5620. } // Getters
  5621. var _proto = Tooltip.prototype;
  5622. // Public
  5623. _proto.enable = function enable() {
  5624. this._isEnabled = true;
  5625. };
  5626. _proto.disable = function disable() {
  5627. this._isEnabled = false;
  5628. };
  5629. _proto.toggleEnabled = function toggleEnabled() {
  5630. this._isEnabled = !this._isEnabled;
  5631. };
  5632. _proto.toggle = function toggle(event) {
  5633. if (!this._isEnabled) {
  5634. return;
  5635. }
  5636. if (event) {
  5637. var dataKey = this.constructor.DATA_KEY;
  5638. var context = $(event.currentTarget).data(dataKey);
  5639. if (!context) {
  5640. context = new this.constructor(event.currentTarget, this._getDelegateConfig());
  5641. $(event.currentTarget).data(dataKey, context);
  5642. }
  5643. context._activeTrigger.click = !context._activeTrigger.click;
  5644. if (context._isWithActiveTrigger()) {
  5645. context._enter(null, context);
  5646. } else {
  5647. context._leave(null, context);
  5648. }
  5649. } else {
  5650. if ($(this.getTipElement()).hasClass(ClassName$6.SHOW)) {
  5651. this._leave(null, this);
  5652. return;
  5653. }
  5654. this._enter(null, this);
  5655. }
  5656. };
  5657. _proto.dispose = function dispose() {
  5658. clearTimeout(this._timeout);
  5659. $.removeData(this.element, this.constructor.DATA_KEY);
  5660. $(this.element).off(this.constructor.EVENT_KEY);
  5661. $(this.element).closest('.modal').off('hide.bs.modal', this._hideModalHandler);
  5662. if (this.tip) {
  5663. $(this.tip).remove();
  5664. }
  5665. this._isEnabled = null;
  5666. this._timeout = null;
  5667. this._hoverState = null;
  5668. this._activeTrigger = null;
  5669. if (this._popper) {
  5670. this._popper.destroy();
  5671. }
  5672. this._popper = null;
  5673. this.element = null;
  5674. this.config = null;
  5675. this.tip = null;
  5676. };
  5677. _proto.show = function show() {
  5678. var _this = this;
  5679. if ($(this.element).css('display') === 'none') {
  5680. throw new Error('Please use show on visible elements');
  5681. }
  5682. var showEvent = $.Event(this.constructor.Event.SHOW);
  5683. if (this.isWithContent() && this._isEnabled) {
  5684. $(this.element).trigger(showEvent);
  5685. var shadowRoot = Util.findShadowRoot(this.element);
  5686. var isInTheDom = $.contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element);
  5687. if (showEvent.isDefaultPrevented() || !isInTheDom) {
  5688. return;
  5689. }
  5690. var tip = this.getTipElement();
  5691. var tipId = Util.getUID(this.constructor.NAME);
  5692. tip.setAttribute('id', tipId);
  5693. this.element.setAttribute('aria-describedby', tipId);
  5694. this.setContent();
  5695. if (this.config.animation) {
  5696. $(tip).addClass(ClassName$6.FADE);
  5697. }
  5698. var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
  5699. var attachment = this._getAttachment(placement);
  5700. this.addAttachmentClass(attachment);
  5701. var container = this._getContainer();
  5702. $(tip).data(this.constructor.DATA_KEY, this);
  5703. if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) {
  5704. $(tip).appendTo(container);
  5705. }
  5706. $(this.element).trigger(this.constructor.Event.INSERTED);
  5707. this._popper = new Popper(this.element, tip, this._getPopperConfig(attachment));
  5708. $(tip).addClass(ClassName$6.SHOW); // If this is a touch-enabled device we add extra
  5709. // empty mouseover listeners to the body's immediate children;
  5710. // only needed because of broken event delegation on iOS
  5711. // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
  5712. if ('ontouchstart' in document.documentElement) {
  5713. $(document.body).children().on('mouseover', null, $.noop);
  5714. }
  5715. var complete = function complete() {
  5716. if (_this.config.animation) {
  5717. _this._fixTransition();
  5718. }
  5719. var prevHoverState = _this._hoverState;
  5720. _this._hoverState = null;
  5721. $(_this.element).trigger(_this.constructor.Event.SHOWN);
  5722. if (prevHoverState === HoverState.OUT) {
  5723. _this._leave(null, _this);
  5724. }
  5725. };
  5726. if ($(this.tip).hasClass(ClassName$6.FADE)) {
  5727. var transitionDuration = Util.getTransitionDurationFromElement(this.tip);
  5728. $(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  5729. } else {
  5730. complete();
  5731. }
  5732. }
  5733. };
  5734. _proto.hide = function hide(callback) {
  5735. var _this2 = this;
  5736. var tip = this.getTipElement();
  5737. var hideEvent = $.Event(this.constructor.Event.HIDE);
  5738. var complete = function complete() {
  5739. if (_this2._hoverState !== HoverState.SHOW && tip.parentNode) {
  5740. tip.parentNode.removeChild(tip);
  5741. }
  5742. _this2._cleanTipClass();
  5743. _this2.element.removeAttribute('aria-describedby');
  5744. $(_this2.element).trigger(_this2.constructor.Event.HIDDEN);
  5745. if (_this2._popper !== null) {
  5746. _this2._popper.destroy();
  5747. }
  5748. if (callback) {
  5749. callback();
  5750. }
  5751. };
  5752. $(this.element).trigger(hideEvent);
  5753. if (hideEvent.isDefaultPrevented()) {
  5754. return;
  5755. }
  5756. $(tip).removeClass(ClassName$6.SHOW); // If this is a touch-enabled device we remove the extra
  5757. // empty mouseover listeners we added for iOS support
  5758. if ('ontouchstart' in document.documentElement) {
  5759. $(document.body).children().off('mouseover', null, $.noop);
  5760. }
  5761. this._activeTrigger[Trigger.CLICK] = false;
  5762. this._activeTrigger[Trigger.FOCUS] = false;
  5763. this._activeTrigger[Trigger.HOVER] = false;
  5764. if ($(this.tip).hasClass(ClassName$6.FADE)) {
  5765. var transitionDuration = Util.getTransitionDurationFromElement(tip);
  5766. $(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  5767. } else {
  5768. complete();
  5769. }
  5770. this._hoverState = '';
  5771. };
  5772. _proto.update = function update() {
  5773. if (this._popper !== null) {
  5774. this._popper.scheduleUpdate();
  5775. }
  5776. } // Protected
  5777. ;
  5778. _proto.isWithContent = function isWithContent() {
  5779. return Boolean(this.getTitle());
  5780. };
  5781. _proto.addAttachmentClass = function addAttachmentClass(attachment) {
  5782. $(this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
  5783. };
  5784. _proto.getTipElement = function getTipElement() {
  5785. this.tip = this.tip || $(this.config.template)[0];
  5786. return this.tip;
  5787. };
  5788. _proto.setContent = function setContent() {
  5789. var tip = this.getTipElement();
  5790. this.setElementContent($(tip.querySelectorAll(Selector$6.TOOLTIP_INNER)), this.getTitle());
  5791. $(tip).removeClass(ClassName$6.FADE + " " + ClassName$6.SHOW);
  5792. };
  5793. _proto.setElementContent = function setElementContent($element, content) {
  5794. if (typeof content === 'object' && (content.nodeType || content.jquery)) {
  5795. // Content is a DOM node or a jQuery
  5796. if (this.config.html) {
  5797. if (!$(content).parent().is($element)) {
  5798. $element.empty().append(content);
  5799. }
  5800. } else {
  5801. $element.text($(content).text());
  5802. }
  5803. return;
  5804. }
  5805. if (this.config.html) {
  5806. if (this.config.sanitize) {
  5807. content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn);
  5808. }
  5809. $element.html(content);
  5810. } else {
  5811. $element.text(content);
  5812. }
  5813. };
  5814. _proto.getTitle = function getTitle() {
  5815. var title = this.element.getAttribute('data-original-title');
  5816. if (!title) {
  5817. title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;
  5818. }
  5819. return title;
  5820. } // Private
  5821. ;
  5822. _proto._getPopperConfig = function _getPopperConfig(attachment) {
  5823. var _this3 = this;
  5824. var defaultBsConfig = {
  5825. placement: attachment,
  5826. modifiers: {
  5827. offset: this._getOffset(),
  5828. flip: {
  5829. behavior: this.config.fallbackPlacement
  5830. },
  5831. arrow: {
  5832. element: Selector$6.ARROW
  5833. },
  5834. preventOverflow: {
  5835. boundariesElement: this.config.boundary
  5836. }
  5837. },
  5838. onCreate: function onCreate(data) {
  5839. if (data.originalPlacement !== data.placement) {
  5840. _this3._handlePopperPlacementChange(data);
  5841. }
  5842. },
  5843. onUpdate: function onUpdate(data) {
  5844. return _this3._handlePopperPlacementChange(data);
  5845. }
  5846. };
  5847. return _objectSpread2({}, defaultBsConfig, {}, this.config.popperConfig);
  5848. };
  5849. _proto._getOffset = function _getOffset() {
  5850. var _this4 = this;
  5851. var offset = {};
  5852. if (typeof this.config.offset === 'function') {
  5853. offset.fn = function (data) {
  5854. data.offsets = _objectSpread2({}, data.offsets, {}, _this4.config.offset(data.offsets, _this4.element) || {});
  5855. return data;
  5856. };
  5857. } else {
  5858. offset.offset = this.config.offset;
  5859. }
  5860. return offset;
  5861. };
  5862. _proto._getContainer = function _getContainer() {
  5863. if (this.config.container === false) {
  5864. return document.body;
  5865. }
  5866. if (Util.isElement(this.config.container)) {
  5867. return $(this.config.container);
  5868. }
  5869. return $(document).find(this.config.container);
  5870. };
  5871. _proto._getAttachment = function _getAttachment(placement) {
  5872. return AttachmentMap$1[placement.toUpperCase()];
  5873. };
  5874. _proto._setListeners = function _setListeners() {
  5875. var _this5 = this;
  5876. var triggers = this.config.trigger.split(' ');
  5877. triggers.forEach(function (trigger) {
  5878. if (trigger === 'click') {
  5879. $(_this5.element).on(_this5.constructor.Event.CLICK, _this5.config.selector, function (event) {
  5880. return _this5.toggle(event);
  5881. });
  5882. } else if (trigger !== Trigger.MANUAL) {
  5883. var eventIn = trigger === Trigger.HOVER ? _this5.constructor.Event.MOUSEENTER : _this5.constructor.Event.FOCUSIN;
  5884. var eventOut = trigger === Trigger.HOVER ? _this5.constructor.Event.MOUSELEAVE : _this5.constructor.Event.FOCUSOUT;
  5885. $(_this5.element).on(eventIn, _this5.config.selector, function (event) {
  5886. return _this5._enter(event);
  5887. }).on(eventOut, _this5.config.selector, function (event) {
  5888. return _this5._leave(event);
  5889. });
  5890. }
  5891. });
  5892. this._hideModalHandler = function () {
  5893. if (_this5.element) {
  5894. _this5.hide();
  5895. }
  5896. };
  5897. $(this.element).closest('.modal').on('hide.bs.modal', this._hideModalHandler);
  5898. if (this.config.selector) {
  5899. this.config = _objectSpread2({}, this.config, {
  5900. trigger: 'manual',
  5901. selector: ''
  5902. });
  5903. } else {
  5904. this._fixTitle();
  5905. }
  5906. };
  5907. _proto._fixTitle = function _fixTitle() {
  5908. var titleType = typeof this.element.getAttribute('data-original-title');
  5909. if (this.element.getAttribute('title') || titleType !== 'string') {
  5910. this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');
  5911. this.element.setAttribute('title', '');
  5912. }
  5913. };
  5914. _proto._enter = function _enter(event, context) {
  5915. var dataKey = this.constructor.DATA_KEY;
  5916. context = context || $(event.currentTarget).data(dataKey);
  5917. if (!context) {
  5918. context = new this.constructor(event.currentTarget, this._getDelegateConfig());
  5919. $(event.currentTarget).data(dataKey, context);
  5920. }
  5921. if (event) {
  5922. context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true;
  5923. }
  5924. if ($(context.getTipElement()).hasClass(ClassName$6.SHOW) || context._hoverState === HoverState.SHOW) {
  5925. context._hoverState = HoverState.SHOW;
  5926. return;
  5927. }
  5928. clearTimeout(context._timeout);
  5929. context._hoverState = HoverState.SHOW;
  5930. if (!context.config.delay || !context.config.delay.show) {
  5931. context.show();
  5932. return;
  5933. }
  5934. context._timeout = setTimeout(function () {
  5935. if (context._hoverState === HoverState.SHOW) {
  5936. context.show();
  5937. }
  5938. }, context.config.delay.show);
  5939. };
  5940. _proto._leave = function _leave(event, context) {
  5941. var dataKey = this.constructor.DATA_KEY;
  5942. context = context || $(event.currentTarget).data(dataKey);
  5943. if (!context) {
  5944. context = new this.constructor(event.currentTarget, this._getDelegateConfig());
  5945. $(event.currentTarget).data(dataKey, context);
  5946. }
  5947. if (event) {
  5948. context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false;
  5949. }
  5950. if (context._isWithActiveTrigger()) {
  5951. return;
  5952. }
  5953. clearTimeout(context._timeout);
  5954. context._hoverState = HoverState.OUT;
  5955. if (!context.config.delay || !context.config.delay.hide) {
  5956. context.hide();
  5957. return;
  5958. }
  5959. context._timeout = setTimeout(function () {
  5960. if (context._hoverState === HoverState.OUT) {
  5961. context.hide();
  5962. }
  5963. }, context.config.delay.hide);
  5964. };
  5965. _proto._isWithActiveTrigger = function _isWithActiveTrigger() {
  5966. for (var trigger in this._activeTrigger) {
  5967. if (this._activeTrigger[trigger]) {
  5968. return true;
  5969. }
  5970. }
  5971. return false;
  5972. };
  5973. _proto._getConfig = function _getConfig(config) {
  5974. var dataAttributes = $(this.element).data();
  5975. Object.keys(dataAttributes).forEach(function (dataAttr) {
  5976. if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) {
  5977. delete dataAttributes[dataAttr];
  5978. }
  5979. });
  5980. config = _objectSpread2({}, this.constructor.Default, {}, dataAttributes, {}, typeof config === 'object' && config ? config : {});
  5981. if (typeof config.delay === 'number') {
  5982. config.delay = {
  5983. show: config.delay,
  5984. hide: config.delay
  5985. };
  5986. }
  5987. if (typeof config.title === 'number') {
  5988. config.title = config.title.toString();
  5989. }
  5990. if (typeof config.content === 'number') {
  5991. config.content = config.content.toString();
  5992. }
  5993. Util.typeCheckConfig(NAME$6, config, this.constructor.DefaultType);
  5994. if (config.sanitize) {
  5995. config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn);
  5996. }
  5997. return config;
  5998. };
  5999. _proto._getDelegateConfig = function _getDelegateConfig() {
  6000. var config = {};
  6001. if (this.config) {
  6002. for (var key in this.config) {
  6003. if (this.constructor.Default[key] !== this.config[key]) {
  6004. config[key] = this.config[key];
  6005. }
  6006. }
  6007. }
  6008. return config;
  6009. };
  6010. _proto._cleanTipClass = function _cleanTipClass() {
  6011. var $tip = $(this.getTipElement());
  6012. var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
  6013. if (tabClass !== null && tabClass.length) {
  6014. $tip.removeClass(tabClass.join(''));
  6015. }
  6016. };
  6017. _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
  6018. var popperInstance = popperData.instance;
  6019. this.tip = popperInstance.popper;
  6020. this._cleanTipClass();
  6021. this.addAttachmentClass(this._getAttachment(popperData.placement));
  6022. };
  6023. _proto._fixTransition = function _fixTransition() {
  6024. var tip = this.getTipElement();
  6025. var initConfigAnimation = this.config.animation;
  6026. if (tip.getAttribute('x-placement') !== null) {
  6027. return;
  6028. }
  6029. $(tip).removeClass(ClassName$6.FADE);
  6030. this.config.animation = false;
  6031. this.hide();
  6032. this.show();
  6033. this.config.animation = initConfigAnimation;
  6034. } // Static
  6035. ;
  6036. Tooltip._jQueryInterface = function _jQueryInterface(config) {
  6037. return this.each(function () {
  6038. var data = $(this).data(DATA_KEY$6);
  6039. var _config = typeof config === 'object' && config;
  6040. if (!data && /dispose|hide/.test(config)) {
  6041. return;
  6042. }
  6043. if (!data) {
  6044. data = new Tooltip(this, _config);
  6045. $(this).data(DATA_KEY$6, data);
  6046. }
  6047. if (typeof config === 'string') {
  6048. if (typeof data[config] === 'undefined') {
  6049. throw new TypeError("No method named \"" + config + "\"");
  6050. }
  6051. data[config]();
  6052. }
  6053. });
  6054. };
  6055. _createClass(Tooltip, null, [{
  6056. key: "VERSION",
  6057. get: function get() {
  6058. return VERSION$6;
  6059. }
  6060. }, {
  6061. key: "Default",
  6062. get: function get() {
  6063. return Default$4;
  6064. }
  6065. }, {
  6066. key: "NAME",
  6067. get: function get() {
  6068. return NAME$6;
  6069. }
  6070. }, {
  6071. key: "DATA_KEY",
  6072. get: function get() {
  6073. return DATA_KEY$6;
  6074. }
  6075. }, {
  6076. key: "Event",
  6077. get: function get() {
  6078. return Event$6;
  6079. }
  6080. }, {
  6081. key: "EVENT_KEY",
  6082. get: function get() {
  6083. return EVENT_KEY$6;
  6084. }
  6085. }, {
  6086. key: "DefaultType",
  6087. get: function get() {
  6088. return DefaultType$4;
  6089. }
  6090. }]);
  6091. return Tooltip;
  6092. }();
  6093. /**
  6094. * ------------------------------------------------------------------------
  6095. * jQuery
  6096. * ------------------------------------------------------------------------
  6097. */
  6098. $.fn[NAME$6] = Tooltip._jQueryInterface;
  6099. $.fn[NAME$6].Constructor = Tooltip;
  6100. $.fn[NAME$6].noConflict = function () {
  6101. $.fn[NAME$6] = JQUERY_NO_CONFLICT$6;
  6102. return Tooltip._jQueryInterface;
  6103. };
  6104. /**
  6105. * ------------------------------------------------------------------------
  6106. * Constants
  6107. * ------------------------------------------------------------------------
  6108. */
  6109. var NAME$7 = 'popover';
  6110. var VERSION$7 = '4.4.1';
  6111. var DATA_KEY$7 = 'bs.popover';
  6112. var EVENT_KEY$7 = "." + DATA_KEY$7;
  6113. var JQUERY_NO_CONFLICT$7 = $.fn[NAME$7];
  6114. var CLASS_PREFIX$1 = 'bs-popover';
  6115. var BSCLS_PREFIX_REGEX$1 = new RegExp("(^|\\s)" + CLASS_PREFIX$1 + "\\S+", 'g');
  6116. var Default$5 = _objectSpread2({}, Tooltip.Default, {
  6117. placement: 'right',
  6118. trigger: 'click',
  6119. content: '',
  6120. template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>'
  6121. });
  6122. var DefaultType$5 = _objectSpread2({}, Tooltip.DefaultType, {
  6123. content: '(string|element|function)'
  6124. });
  6125. var ClassName$7 = {
  6126. FADE: 'fade',
  6127. SHOW: 'show'
  6128. };
  6129. var Selector$7 = {
  6130. TITLE: '.popover-header',
  6131. CONTENT: '.popover-body'
  6132. };
  6133. var Event$7 = {
  6134. HIDE: "hide" + EVENT_KEY$7,
  6135. HIDDEN: "hidden" + EVENT_KEY$7,
  6136. SHOW: "show" + EVENT_KEY$7,
  6137. SHOWN: "shown" + EVENT_KEY$7,
  6138. INSERTED: "inserted" + EVENT_KEY$7,
  6139. CLICK: "click" + EVENT_KEY$7,
  6140. FOCUSIN: "focusin" + EVENT_KEY$7,
  6141. FOCUSOUT: "focusout" + EVENT_KEY$7,
  6142. MOUSEENTER: "mouseenter" + EVENT_KEY$7,
  6143. MOUSELEAVE: "mouseleave" + EVENT_KEY$7
  6144. };
  6145. /**
  6146. * ------------------------------------------------------------------------
  6147. * Class Definition
  6148. * ------------------------------------------------------------------------
  6149. */
  6150. var Popover =
  6151. /*#__PURE__*/
  6152. function (_Tooltip) {
  6153. _inheritsLoose(Popover, _Tooltip);
  6154. function Popover() {
  6155. return _Tooltip.apply(this, arguments) || this;
  6156. }
  6157. var _proto = Popover.prototype;
  6158. // Overrides
  6159. _proto.isWithContent = function isWithContent() {
  6160. return this.getTitle() || this._getContent();
  6161. };
  6162. _proto.addAttachmentClass = function addAttachmentClass(attachment) {
  6163. $(this.getTipElement()).addClass(CLASS_PREFIX$1 + "-" + attachment);
  6164. };
  6165. _proto.getTipElement = function getTipElement() {
  6166. this.tip = this.tip || $(this.config.template)[0];
  6167. return this.tip;
  6168. };
  6169. _proto.setContent = function setContent() {
  6170. var $tip = $(this.getTipElement()); // We use append for html objects to maintain js events
  6171. this.setElementContent($tip.find(Selector$7.TITLE), this.getTitle());
  6172. var content = this._getContent();
  6173. if (typeof content === 'function') {
  6174. content = content.call(this.element);
  6175. }
  6176. this.setElementContent($tip.find(Selector$7.CONTENT), content);
  6177. $tip.removeClass(ClassName$7.FADE + " " + ClassName$7.SHOW);
  6178. } // Private
  6179. ;
  6180. _proto._getContent = function _getContent() {
  6181. return this.element.getAttribute('data-content') || this.config.content;
  6182. };
  6183. _proto._cleanTipClass = function _cleanTipClass() {
  6184. var $tip = $(this.getTipElement());
  6185. var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX$1);
  6186. if (tabClass !== null && tabClass.length > 0) {
  6187. $tip.removeClass(tabClass.join(''));
  6188. }
  6189. } // Static
  6190. ;
  6191. Popover._jQueryInterface = function _jQueryInterface(config) {
  6192. return this.each(function () {
  6193. var data = $(this).data(DATA_KEY$7);
  6194. var _config = typeof config === 'object' ? config : null;
  6195. if (!data && /dispose|hide/.test(config)) {
  6196. return;
  6197. }
  6198. if (!data) {
  6199. data = new Popover(this, _config);
  6200. $(this).data(DATA_KEY$7, data);
  6201. }
  6202. if (typeof config === 'string') {
  6203. if (typeof data[config] === 'undefined') {
  6204. throw new TypeError("No method named \"" + config + "\"");
  6205. }
  6206. data[config]();
  6207. }
  6208. });
  6209. };
  6210. _createClass(Popover, null, [{
  6211. key: "VERSION",
  6212. // Getters
  6213. get: function get() {
  6214. return VERSION$7;
  6215. }
  6216. }, {
  6217. key: "Default",
  6218. get: function get() {
  6219. return Default$5;
  6220. }
  6221. }, {
  6222. key: "NAME",
  6223. get: function get() {
  6224. return NAME$7;
  6225. }
  6226. }, {
  6227. key: "DATA_KEY",
  6228. get: function get() {
  6229. return DATA_KEY$7;
  6230. }
  6231. }, {
  6232. key: "Event",
  6233. get: function get() {
  6234. return Event$7;
  6235. }
  6236. }, {
  6237. key: "EVENT_KEY",
  6238. get: function get() {
  6239. return EVENT_KEY$7;
  6240. }
  6241. }, {
  6242. key: "DefaultType",
  6243. get: function get() {
  6244. return DefaultType$5;
  6245. }
  6246. }]);
  6247. return Popover;
  6248. }(Tooltip);
  6249. /**
  6250. * ------------------------------------------------------------------------
  6251. * jQuery
  6252. * ------------------------------------------------------------------------
  6253. */
  6254. $.fn[NAME$7] = Popover._jQueryInterface;
  6255. $.fn[NAME$7].Constructor = Popover;
  6256. $.fn[NAME$7].noConflict = function () {
  6257. $.fn[NAME$7] = JQUERY_NO_CONFLICT$7;
  6258. return Popover._jQueryInterface;
  6259. };
  6260. /**
  6261. * ------------------------------------------------------------------------
  6262. * Constants
  6263. * ------------------------------------------------------------------------
  6264. */
  6265. var NAME$8 = 'scrollspy';
  6266. var VERSION$8 = '4.4.1';
  6267. var DATA_KEY$8 = 'bs.scrollspy';
  6268. var EVENT_KEY$8 = "." + DATA_KEY$8;
  6269. var DATA_API_KEY$6 = '.data-api';
  6270. var JQUERY_NO_CONFLICT$8 = $.fn[NAME$8];
  6271. var Default$6 = {
  6272. offset: 10,
  6273. method: 'auto',
  6274. target: ''
  6275. };
  6276. var DefaultType$6 = {
  6277. offset: 'number',
  6278. method: 'string',
  6279. target: '(string|element)'
  6280. };
  6281. var Event$8 = {
  6282. ACTIVATE: "activate" + EVENT_KEY$8,
  6283. SCROLL: "scroll" + EVENT_KEY$8,
  6284. LOAD_DATA_API: "load" + EVENT_KEY$8 + DATA_API_KEY$6
  6285. };
  6286. var ClassName$8 = {
  6287. DROPDOWN_ITEM: 'dropdown-item',
  6288. DROPDOWN_MENU: 'dropdown-menu',
  6289. ACTIVE: 'active'
  6290. };
  6291. var Selector$8 = {
  6292. DATA_SPY: '[data-spy="scroll"]',
  6293. ACTIVE: '.active',
  6294. NAV_LIST_GROUP: '.nav, .list-group',
  6295. NAV_LINKS: '.nav-link',
  6296. NAV_ITEMS: '.nav-item',
  6297. LIST_ITEMS: '.list-group-item',
  6298. DROPDOWN: '.dropdown',
  6299. DROPDOWN_ITEMS: '.dropdown-item',
  6300. DROPDOWN_TOGGLE: '.dropdown-toggle'
  6301. };
  6302. var OffsetMethod = {
  6303. OFFSET: 'offset',
  6304. POSITION: 'position'
  6305. };
  6306. /**
  6307. * ------------------------------------------------------------------------
  6308. * Class Definition
  6309. * ------------------------------------------------------------------------
  6310. */
  6311. var ScrollSpy =
  6312. /*#__PURE__*/
  6313. function () {
  6314. function ScrollSpy(element, config) {
  6315. var _this = this;
  6316. this._element = element;
  6317. this._scrollElement = element.tagName === 'BODY' ? window : element;
  6318. this._config = this._getConfig(config);
  6319. this._selector = this._config.target + " " + Selector$8.NAV_LINKS + "," + (this._config.target + " " + Selector$8.LIST_ITEMS + ",") + (this._config.target + " " + Selector$8.DROPDOWN_ITEMS);
  6320. this._offsets = [];
  6321. this._targets = [];
  6322. this._activeTarget = null;
  6323. this._scrollHeight = 0;
  6324. $(this._scrollElement).on(Event$8.SCROLL, function (event) {
  6325. return _this._process(event);
  6326. });
  6327. this.refresh();
  6328. this._process();
  6329. } // Getters
  6330. var _proto = ScrollSpy.prototype;
  6331. // Public
  6332. _proto.refresh = function refresh() {
  6333. var _this2 = this;
  6334. var autoMethod = this._scrollElement === this._scrollElement.window ? OffsetMethod.OFFSET : OffsetMethod.POSITION;
  6335. var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;
  6336. var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0;
  6337. this._offsets = [];
  6338. this._targets = [];
  6339. this._scrollHeight = this._getScrollHeight();
  6340. var targets = [].slice.call(document.querySelectorAll(this._selector));
  6341. targets.map(function (element) {
  6342. var target;
  6343. var targetSelector = Util.getSelectorFromElement(element);
  6344. if (targetSelector) {
  6345. target = document.querySelector(targetSelector);
  6346. }
  6347. if (target) {
  6348. var targetBCR = target.getBoundingClientRect();
  6349. if (targetBCR.width || targetBCR.height) {
  6350. // TODO (fat): remove sketch reliance on jQuery position/offset
  6351. return [$(target)[offsetMethod]().top + offsetBase, targetSelector];
  6352. }
  6353. }
  6354. return null;
  6355. }).filter(function (item) {
  6356. return item;
  6357. }).sort(function (a, b) {
  6358. return a[0] - b[0];
  6359. }).forEach(function (item) {
  6360. _this2._offsets.push(item[0]);
  6361. _this2._targets.push(item[1]);
  6362. });
  6363. };
  6364. _proto.dispose = function dispose() {
  6365. $.removeData(this._element, DATA_KEY$8);
  6366. $(this._scrollElement).off(EVENT_KEY$8);
  6367. this._element = null;
  6368. this._scrollElement = null;
  6369. this._config = null;
  6370. this._selector = null;
  6371. this._offsets = null;
  6372. this._targets = null;
  6373. this._activeTarget = null;
  6374. this._scrollHeight = null;
  6375. } // Private
  6376. ;
  6377. _proto._getConfig = function _getConfig(config) {
  6378. config = _objectSpread2({}, Default$6, {}, typeof config === 'object' && config ? config : {});
  6379. if (typeof config.target !== 'string') {
  6380. var id = $(config.target).attr('id');
  6381. if (!id) {
  6382. id = Util.getUID(NAME$8);
  6383. $(config.target).attr('id', id);
  6384. }
  6385. config.target = "#" + id;
  6386. }
  6387. Util.typeCheckConfig(NAME$8, config, DefaultType$6);
  6388. return config;
  6389. };
  6390. _proto._getScrollTop = function _getScrollTop() {
  6391. return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop;
  6392. };
  6393. _proto._getScrollHeight = function _getScrollHeight() {
  6394. return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
  6395. };
  6396. _proto._getOffsetHeight = function _getOffsetHeight() {
  6397. return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height;
  6398. };
  6399. _proto._process = function _process() {
  6400. var scrollTop = this._getScrollTop() + this._config.offset;
  6401. var scrollHeight = this._getScrollHeight();
  6402. var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();
  6403. if (this._scrollHeight !== scrollHeight) {
  6404. this.refresh();
  6405. }
  6406. if (scrollTop >= maxScroll) {
  6407. var target = this._targets[this._targets.length - 1];
  6408. if (this._activeTarget !== target) {
  6409. this._activate(target);
  6410. }
  6411. return;
  6412. }
  6413. if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {
  6414. this._activeTarget = null;
  6415. this._clear();
  6416. return;
  6417. }
  6418. var offsetLength = this._offsets.length;
  6419. for (var i = offsetLength; i--;) {
  6420. var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]);
  6421. if (isActiveTarget) {
  6422. this._activate(this._targets[i]);
  6423. }
  6424. }
  6425. };
  6426. _proto._activate = function _activate(target) {
  6427. this._activeTarget = target;
  6428. this._clear();
  6429. var queries = this._selector.split(',').map(function (selector) {
  6430. return selector + "[data-target=\"" + target + "\"]," + selector + "[href=\"" + target + "\"]";
  6431. });
  6432. var $link = $([].slice.call(document.querySelectorAll(queries.join(','))));
  6433. if ($link.hasClass(ClassName$8.DROPDOWN_ITEM)) {
  6434. $link.closest(Selector$8.DROPDOWN).find(Selector$8.DROPDOWN_TOGGLE).addClass(ClassName$8.ACTIVE);
  6435. $link.addClass(ClassName$8.ACTIVE);
  6436. } else {
  6437. // Set triggered link as active
  6438. $link.addClass(ClassName$8.ACTIVE); // Set triggered links parents as active
  6439. // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor
  6440. $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
  6441. $link.parents(Selector$8.NAV_LIST_GROUP).prev(Selector$8.NAV_ITEMS).children(Selector$8.NAV_LINKS).addClass(ClassName$8.ACTIVE);
  6442. }
  6443. $(this._scrollElement).trigger(Event$8.ACTIVATE, {
  6444. relatedTarget: target
  6445. });
  6446. };
  6447. _proto._clear = function _clear() {
  6448. [].slice.call(document.querySelectorAll(this._selector)).filter(function (node) {
  6449. return node.classList.contains(ClassName$8.ACTIVE);
  6450. }).forEach(function (node) {
  6451. return node.classList.remove(ClassName$8.ACTIVE);
  6452. });
  6453. } // Static
  6454. ;
  6455. ScrollSpy._jQueryInterface = function _jQueryInterface(config) {
  6456. return this.each(function () {
  6457. var data = $(this).data(DATA_KEY$8);
  6458. var _config = typeof config === 'object' && config;
  6459. if (!data) {
  6460. data = new ScrollSpy(this, _config);
  6461. $(this).data(DATA_KEY$8, data);
  6462. }
  6463. if (typeof config === 'string') {
  6464. if (typeof data[config] === 'undefined') {
  6465. throw new TypeError("No method named \"" + config + "\"");
  6466. }
  6467. data[config]();
  6468. }
  6469. });
  6470. };
  6471. _createClass(ScrollSpy, null, [{
  6472. key: "VERSION",
  6473. get: function get() {
  6474. return VERSION$8;
  6475. }
  6476. }, {
  6477. key: "Default",
  6478. get: function get() {
  6479. return Default$6;
  6480. }
  6481. }]);
  6482. return ScrollSpy;
  6483. }();
  6484. /**
  6485. * ------------------------------------------------------------------------
  6486. * Data Api implementation
  6487. * ------------------------------------------------------------------------
  6488. */
  6489. $(window).on(Event$8.LOAD_DATA_API, function () {
  6490. var scrollSpys = [].slice.call(document.querySelectorAll(Selector$8.DATA_SPY));
  6491. var scrollSpysLength = scrollSpys.length;
  6492. for (var i = scrollSpysLength; i--;) {
  6493. var $spy = $(scrollSpys[i]);
  6494. ScrollSpy._jQueryInterface.call($spy, $spy.data());
  6495. }
  6496. });
  6497. /**
  6498. * ------------------------------------------------------------------------
  6499. * jQuery
  6500. * ------------------------------------------------------------------------
  6501. */
  6502. $.fn[NAME$8] = ScrollSpy._jQueryInterface;
  6503. $.fn[NAME$8].Constructor = ScrollSpy;
  6504. $.fn[NAME$8].noConflict = function () {
  6505. $.fn[NAME$8] = JQUERY_NO_CONFLICT$8;
  6506. return ScrollSpy._jQueryInterface;
  6507. };
  6508. /**
  6509. * ------------------------------------------------------------------------
  6510. * Constants
  6511. * ------------------------------------------------------------------------
  6512. */
  6513. var NAME$9 = 'tab';
  6514. var VERSION$9 = '4.4.1';
  6515. var DATA_KEY$9 = 'bs.tab';
  6516. var EVENT_KEY$9 = "." + DATA_KEY$9;
  6517. var DATA_API_KEY$7 = '.data-api';
  6518. var JQUERY_NO_CONFLICT$9 = $.fn[NAME$9];
  6519. var Event$9 = {
  6520. HIDE: "hide" + EVENT_KEY$9,
  6521. HIDDEN: "hidden" + EVENT_KEY$9,
  6522. SHOW: "show" + EVENT_KEY$9,
  6523. SHOWN: "shown" + EVENT_KEY$9,
  6524. CLICK_DATA_API: "click" + EVENT_KEY$9 + DATA_API_KEY$7
  6525. };
  6526. var ClassName$9 = {
  6527. DROPDOWN_MENU: 'dropdown-menu',
  6528. ACTIVE: 'active',
  6529. DISABLED: 'disabled',
  6530. FADE: 'fade',
  6531. SHOW: 'show'
  6532. };
  6533. var Selector$9 = {
  6534. DROPDOWN: '.dropdown',
  6535. NAV_LIST_GROUP: '.nav, .list-group',
  6536. ACTIVE: '.active',
  6537. ACTIVE_UL: '> li > .active',
  6538. DATA_TOGGLE: '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',
  6539. DROPDOWN_TOGGLE: '.dropdown-toggle',
  6540. DROPDOWN_ACTIVE_CHILD: '> .dropdown-menu .active'
  6541. };
  6542. /**
  6543. * ------------------------------------------------------------------------
  6544. * Class Definition
  6545. * ------------------------------------------------------------------------
  6546. */
  6547. var Tab =
  6548. /*#__PURE__*/
  6549. function () {
  6550. function Tab(element) {
  6551. this._element = element;
  6552. } // Getters
  6553. var _proto = Tab.prototype;
  6554. // Public
  6555. _proto.show = function show() {
  6556. var _this = this;
  6557. if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $(this._element).hasClass(ClassName$9.ACTIVE) || $(this._element).hasClass(ClassName$9.DISABLED)) {
  6558. return;
  6559. }
  6560. var target;
  6561. var previous;
  6562. var listElement = $(this._element).closest(Selector$9.NAV_LIST_GROUP)[0];
  6563. var selector = Util.getSelectorFromElement(this._element);
  6564. if (listElement) {
  6565. var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? Selector$9.ACTIVE_UL : Selector$9.ACTIVE;
  6566. previous = $.makeArray($(listElement).find(itemSelector));
  6567. previous = previous[previous.length - 1];
  6568. }
  6569. var hideEvent = $.Event(Event$9.HIDE, {
  6570. relatedTarget: this._element
  6571. });
  6572. var showEvent = $.Event(Event$9.SHOW, {
  6573. relatedTarget: previous
  6574. });
  6575. if (previous) {
  6576. $(previous).trigger(hideEvent);
  6577. }
  6578. $(this._element).trigger(showEvent);
  6579. if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) {
  6580. return;
  6581. }
  6582. if (selector) {
  6583. target = document.querySelector(selector);
  6584. }
  6585. this._activate(this._element, listElement);
  6586. var complete = function complete() {
  6587. var hiddenEvent = $.Event(Event$9.HIDDEN, {
  6588. relatedTarget: _this._element
  6589. });
  6590. var shownEvent = $.Event(Event$9.SHOWN, {
  6591. relatedTarget: previous
  6592. });
  6593. $(previous).trigger(hiddenEvent);
  6594. $(_this._element).trigger(shownEvent);
  6595. };
  6596. if (target) {
  6597. this._activate(target, target.parentNode, complete);
  6598. } else {
  6599. complete();
  6600. }
  6601. };
  6602. _proto.dispose = function dispose() {
  6603. $.removeData(this._element, DATA_KEY$9);
  6604. this._element = null;
  6605. } // Private
  6606. ;
  6607. _proto._activate = function _activate(element, container, callback) {
  6608. var _this2 = this;
  6609. var activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? $(container).find(Selector$9.ACTIVE_UL) : $(container).children(Selector$9.ACTIVE);
  6610. var active = activeElements[0];
  6611. var isTransitioning = callback && active && $(active).hasClass(ClassName$9.FADE);
  6612. var complete = function complete() {
  6613. return _this2._transitionComplete(element, active, callback);
  6614. };
  6615. if (active && isTransitioning) {
  6616. var transitionDuration = Util.getTransitionDurationFromElement(active);
  6617. $(active).removeClass(ClassName$9.SHOW).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  6618. } else {
  6619. complete();
  6620. }
  6621. };
  6622. _proto._transitionComplete = function _transitionComplete(element, active, callback) {
  6623. if (active) {
  6624. $(active).removeClass(ClassName$9.ACTIVE);
  6625. var dropdownChild = $(active.parentNode).find(Selector$9.DROPDOWN_ACTIVE_CHILD)[0];
  6626. if (dropdownChild) {
  6627. $(dropdownChild).removeClass(ClassName$9.ACTIVE);
  6628. }
  6629. if (active.getAttribute('role') === 'tab') {
  6630. active.setAttribute('aria-selected', false);
  6631. }
  6632. }
  6633. $(element).addClass(ClassName$9.ACTIVE);
  6634. if (element.getAttribute('role') === 'tab') {
  6635. element.setAttribute('aria-selected', true);
  6636. }
  6637. Util.reflow(element);
  6638. if (element.classList.contains(ClassName$9.FADE)) {
  6639. element.classList.add(ClassName$9.SHOW);
  6640. }
  6641. if (element.parentNode && $(element.parentNode).hasClass(ClassName$9.DROPDOWN_MENU)) {
  6642. var dropdownElement = $(element).closest(Selector$9.DROPDOWN)[0];
  6643. if (dropdownElement) {
  6644. var dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(Selector$9.DROPDOWN_TOGGLE));
  6645. $(dropdownToggleList).addClass(ClassName$9.ACTIVE);
  6646. }
  6647. element.setAttribute('aria-expanded', true);
  6648. }
  6649. if (callback) {
  6650. callback();
  6651. }
  6652. } // Static
  6653. ;
  6654. Tab._jQueryInterface = function _jQueryInterface(config) {
  6655. return this.each(function () {
  6656. var $this = $(this);
  6657. var data = $this.data(DATA_KEY$9);
  6658. if (!data) {
  6659. data = new Tab(this);
  6660. $this.data(DATA_KEY$9, data);
  6661. }
  6662. if (typeof config === 'string') {
  6663. if (typeof data[config] === 'undefined') {
  6664. throw new TypeError("No method named \"" + config + "\"");
  6665. }
  6666. data[config]();
  6667. }
  6668. });
  6669. };
  6670. _createClass(Tab, null, [{
  6671. key: "VERSION",
  6672. get: function get() {
  6673. return VERSION$9;
  6674. }
  6675. }]);
  6676. return Tab;
  6677. }();
  6678. /**
  6679. * ------------------------------------------------------------------------
  6680. * Data Api implementation
  6681. * ------------------------------------------------------------------------
  6682. */
  6683. $(document).on(Event$9.CLICK_DATA_API, Selector$9.DATA_TOGGLE, function (event) {
  6684. event.preventDefault();
  6685. Tab._jQueryInterface.call($(this), 'show');
  6686. });
  6687. /**
  6688. * ------------------------------------------------------------------------
  6689. * jQuery
  6690. * ------------------------------------------------------------------------
  6691. */
  6692. $.fn[NAME$9] = Tab._jQueryInterface;
  6693. $.fn[NAME$9].Constructor = Tab;
  6694. $.fn[NAME$9].noConflict = function () {
  6695. $.fn[NAME$9] = JQUERY_NO_CONFLICT$9;
  6696. return Tab._jQueryInterface;
  6697. };
  6698. /**
  6699. * ------------------------------------------------------------------------
  6700. * Constants
  6701. * ------------------------------------------------------------------------
  6702. */
  6703. var NAME$a = 'toast';
  6704. var VERSION$a = '4.4.1';
  6705. var DATA_KEY$a = 'bs.toast';
  6706. var EVENT_KEY$a = "." + DATA_KEY$a;
  6707. var JQUERY_NO_CONFLICT$a = $.fn[NAME$a];
  6708. var Event$a = {
  6709. CLICK_DISMISS: "click.dismiss" + EVENT_KEY$a,
  6710. HIDE: "hide" + EVENT_KEY$a,
  6711. HIDDEN: "hidden" + EVENT_KEY$a,
  6712. SHOW: "show" + EVENT_KEY$a,
  6713. SHOWN: "shown" + EVENT_KEY$a
  6714. };
  6715. var ClassName$a = {
  6716. FADE: 'fade',
  6717. HIDE: 'hide',
  6718. SHOW: 'show',
  6719. SHOWING: 'showing'
  6720. };
  6721. var DefaultType$7 = {
  6722. animation: 'boolean',
  6723. autohide: 'boolean',
  6724. delay: 'number'
  6725. };
  6726. var Default$7 = {
  6727. animation: true,
  6728. autohide: true,
  6729. delay: 500
  6730. };
  6731. var Selector$a = {
  6732. DATA_DISMISS: '[data-dismiss="toast"]'
  6733. };
  6734. /**
  6735. * ------------------------------------------------------------------------
  6736. * Class Definition
  6737. * ------------------------------------------------------------------------
  6738. */
  6739. var Toast =
  6740. /*#__PURE__*/
  6741. function () {
  6742. function Toast(element, config) {
  6743. this._element = element;
  6744. this._config = this._getConfig(config);
  6745. this._timeout = null;
  6746. this._setListeners();
  6747. } // Getters
  6748. var _proto = Toast.prototype;
  6749. // Public
  6750. _proto.show = function show() {
  6751. var _this = this;
  6752. var showEvent = $.Event(Event$a.SHOW);
  6753. $(this._element).trigger(showEvent);
  6754. if (showEvent.isDefaultPrevented()) {
  6755. return;
  6756. }
  6757. if (this._config.animation) {
  6758. this._element.classList.add(ClassName$a.FADE);
  6759. }
  6760. var complete = function complete() {
  6761. _this._element.classList.remove(ClassName$a.SHOWING);
  6762. _this._element.classList.add(ClassName$a.SHOW);
  6763. $(_this._element).trigger(Event$a.SHOWN);
  6764. if (_this._config.autohide) {
  6765. _this._timeout = setTimeout(function () {
  6766. _this.hide();
  6767. }, _this._config.delay);
  6768. }
  6769. };
  6770. this._element.classList.remove(ClassName$a.HIDE);
  6771. Util.reflow(this._element);
  6772. this._element.classList.add(ClassName$a.SHOWING);
  6773. if (this._config.animation) {
  6774. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  6775. $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  6776. } else {
  6777. complete();
  6778. }
  6779. };
  6780. _proto.hide = function hide() {
  6781. if (!this._element.classList.contains(ClassName$a.SHOW)) {
  6782. return;
  6783. }
  6784. var hideEvent = $.Event(Event$a.HIDE);
  6785. $(this._element).trigger(hideEvent);
  6786. if (hideEvent.isDefaultPrevented()) {
  6787. return;
  6788. }
  6789. this._close();
  6790. };
  6791. _proto.dispose = function dispose() {
  6792. clearTimeout(this._timeout);
  6793. this._timeout = null;
  6794. if (this._element.classList.contains(ClassName$a.SHOW)) {
  6795. this._element.classList.remove(ClassName$a.SHOW);
  6796. }
  6797. $(this._element).off(Event$a.CLICK_DISMISS);
  6798. $.removeData(this._element, DATA_KEY$a);
  6799. this._element = null;
  6800. this._config = null;
  6801. } // Private
  6802. ;
  6803. _proto._getConfig = function _getConfig(config) {
  6804. config = _objectSpread2({}, Default$7, {}, $(this._element).data(), {}, typeof config === 'object' && config ? config : {});
  6805. Util.typeCheckConfig(NAME$a, config, this.constructor.DefaultType);
  6806. return config;
  6807. };
  6808. _proto._setListeners = function _setListeners() {
  6809. var _this2 = this;
  6810. $(this._element).on(Event$a.CLICK_DISMISS, Selector$a.DATA_DISMISS, function () {
  6811. return _this2.hide();
  6812. });
  6813. };
  6814. _proto._close = function _close() {
  6815. var _this3 = this;
  6816. var complete = function complete() {
  6817. _this3._element.classList.add(ClassName$a.HIDE);
  6818. $(_this3._element).trigger(Event$a.HIDDEN);
  6819. };
  6820. this._element.classList.remove(ClassName$a.SHOW);
  6821. if (this._config.animation) {
  6822. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  6823. $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  6824. } else {
  6825. complete();
  6826. }
  6827. } // Static
  6828. ;
  6829. Toast._jQueryInterface = function _jQueryInterface(config) {
  6830. return this.each(function () {
  6831. var $element = $(this);
  6832. var data = $element.data(DATA_KEY$a);
  6833. var _config = typeof config === 'object' && config;
  6834. if (!data) {
  6835. data = new Toast(this, _config);
  6836. $element.data(DATA_KEY$a, data);
  6837. }
  6838. if (typeof config === 'string') {
  6839. if (typeof data[config] === 'undefined') {
  6840. throw new TypeError("No method named \"" + config + "\"");
  6841. }
  6842. data[config](this);
  6843. }
  6844. });
  6845. };
  6846. _createClass(Toast, null, [{
  6847. key: "VERSION",
  6848. get: function get() {
  6849. return VERSION$a;
  6850. }
  6851. }, {
  6852. key: "DefaultType",
  6853. get: function get() {
  6854. return DefaultType$7;
  6855. }
  6856. }, {
  6857. key: "Default",
  6858. get: function get() {
  6859. return Default$7;
  6860. }
  6861. }]);
  6862. return Toast;
  6863. }();
  6864. /**
  6865. * ------------------------------------------------------------------------
  6866. * jQuery
  6867. * ------------------------------------------------------------------------
  6868. */
  6869. $.fn[NAME$a] = Toast._jQueryInterface;
  6870. $.fn[NAME$a].Constructor = Toast;
  6871. $.fn[NAME$a].noConflict = function () {
  6872. $.fn[NAME$a] = JQUERY_NO_CONFLICT$a;
  6873. return Toast._jQueryInterface;
  6874. };
  6875. exports.Alert = Alert;
  6876. exports.Button = Button;
  6877. exports.Carousel = Carousel;
  6878. exports.Collapse = Collapse;
  6879. exports.Dropdown = Dropdown;
  6880. exports.Modal = Modal;
  6881. exports.Popover = Popover;
  6882. exports.Scrollspy = ScrollSpy;
  6883. exports.Tab = Tab;
  6884. exports.Toast = Toast;
  6885. exports.Tooltip = Tooltip;
  6886. exports.Util = Util;
  6887. Object.defineProperty(exports, '__esModule', { value: true });
  6888. })));
  6889. //# sourceMappingURL=bootstrap.js.map
  6890. /***/ }),
  6891. /***/ "./node_modules/buffer/index.js":
  6892. /*!**************************************!*\
  6893. !*** ./node_modules/buffer/index.js ***!
  6894. \**************************************/
  6895. /*! no static exports found */
  6896. /***/ (function(module, exports, __webpack_require__) {
  6897. "use strict";
  6898. /* WEBPACK VAR INJECTION */(function(global) {/*!
  6899. * The buffer module from node.js, for the browser.
  6900. *
  6901. * @author Feross Aboukhadijeh <http://feross.org>
  6902. * @license MIT
  6903. */
  6904. /* eslint-disable no-proto */
  6905. var base64 = __webpack_require__(/*! base64-js */ "./node_modules/base64-js/index.js")
  6906. var ieee754 = __webpack_require__(/*! ieee754 */ "./node_modules/ieee754/index.js")
  6907. var isArray = __webpack_require__(/*! isarray */ "./node_modules/isarray/index.js")
  6908. exports.Buffer = Buffer
  6909. exports.SlowBuffer = SlowBuffer
  6910. exports.INSPECT_MAX_BYTES = 50
  6911. /**
  6912. * If `Buffer.TYPED_ARRAY_SUPPORT`:
  6913. * === true Use Uint8Array implementation (fastest)
  6914. * === false Use Object implementation (most compatible, even IE6)
  6915. *
  6916. * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
  6917. * Opera 11.6+, iOS 4.2+.
  6918. *
  6919. * Due to various browser bugs, sometimes the Object implementation will be used even
  6920. * when the browser supports typed arrays.
  6921. *
  6922. * Note:
  6923. *
  6924. * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
  6925. * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
  6926. *
  6927. * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
  6928. *
  6929. * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
  6930. * incorrect length in some situations.
  6931. * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
  6932. * get the Object implementation, which is slower but behaves correctly.
  6933. */
  6934. Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined
  6935. ? global.TYPED_ARRAY_SUPPORT
  6936. : typedArraySupport()
  6937. /*
  6938. * Export kMaxLength after typed array support is determined.
  6939. */
  6940. exports.kMaxLength = kMaxLength()
  6941. function typedArraySupport () {
  6942. try {
  6943. var arr = new Uint8Array(1)
  6944. arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
  6945. return arr.foo() === 42 && // typed array instances can be augmented
  6946. typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
  6947. arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
  6948. } catch (e) {
  6949. return false
  6950. }
  6951. }
  6952. function kMaxLength () {
  6953. return Buffer.TYPED_ARRAY_SUPPORT
  6954. ? 0x7fffffff
  6955. : 0x3fffffff
  6956. }
  6957. function createBuffer (that, length) {
  6958. if (kMaxLength() < length) {
  6959. throw new RangeError('Invalid typed array length')
  6960. }
  6961. if (Buffer.TYPED_ARRAY_SUPPORT) {
  6962. // Return an augmented `Uint8Array` instance, for best performance
  6963. that = new Uint8Array(length)
  6964. that.__proto__ = Buffer.prototype
  6965. } else {
  6966. // Fallback: Return an object instance of the Buffer class
  6967. if (that === null) {
  6968. that = new Buffer(length)
  6969. }
  6970. that.length = length
  6971. }
  6972. return that
  6973. }
  6974. /**
  6975. * The Buffer constructor returns instances of `Uint8Array` that have their
  6976. * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
  6977. * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
  6978. * and the `Uint8Array` methods. Square bracket notation works as expected -- it
  6979. * returns a single octet.
  6980. *
  6981. * The `Uint8Array` prototype remains unmodified.
  6982. */
  6983. function Buffer (arg, encodingOrOffset, length) {
  6984. if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
  6985. return new Buffer(arg, encodingOrOffset, length)
  6986. }
  6987. // Common case.
  6988. if (typeof arg === 'number') {
  6989. if (typeof encodingOrOffset === 'string') {
  6990. throw new Error(
  6991. 'If encoding is specified then the first argument must be a string'
  6992. )
  6993. }
  6994. return allocUnsafe(this, arg)
  6995. }
  6996. return from(this, arg, encodingOrOffset, length)
  6997. }
  6998. Buffer.poolSize = 8192 // not used by this implementation
  6999. // TODO: Legacy, not needed anymore. Remove in next major version.
  7000. Buffer._augment = function (arr) {
  7001. arr.__proto__ = Buffer.prototype
  7002. return arr
  7003. }
  7004. function from (that, value, encodingOrOffset, length) {
  7005. if (typeof value === 'number') {
  7006. throw new TypeError('"value" argument must not be a number')
  7007. }
  7008. if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
  7009. return fromArrayBuffer(that, value, encodingOrOffset, length)
  7010. }
  7011. if (typeof value === 'string') {
  7012. return fromString(that, value, encodingOrOffset)
  7013. }
  7014. return fromObject(that, value)
  7015. }
  7016. /**
  7017. * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
  7018. * if value is a number.
  7019. * Buffer.from(str[, encoding])
  7020. * Buffer.from(array)
  7021. * Buffer.from(buffer)
  7022. * Buffer.from(arrayBuffer[, byteOffset[, length]])
  7023. **/
  7024. Buffer.from = function (value, encodingOrOffset, length) {
  7025. return from(null, value, encodingOrOffset, length)
  7026. }
  7027. if (Buffer.TYPED_ARRAY_SUPPORT) {
  7028. Buffer.prototype.__proto__ = Uint8Array.prototype
  7029. Buffer.__proto__ = Uint8Array
  7030. if (typeof Symbol !== 'undefined' && Symbol.species &&
  7031. Buffer[Symbol.species] === Buffer) {
  7032. // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
  7033. Object.defineProperty(Buffer, Symbol.species, {
  7034. value: null,
  7035. configurable: true
  7036. })
  7037. }
  7038. }
  7039. function assertSize (size) {
  7040. if (typeof size !== 'number') {
  7041. throw new TypeError('"size" argument must be a number')
  7042. } else if (size < 0) {
  7043. throw new RangeError('"size" argument must not be negative')
  7044. }
  7045. }
  7046. function alloc (that, size, fill, encoding) {
  7047. assertSize(size)
  7048. if (size <= 0) {
  7049. return createBuffer(that, size)
  7050. }
  7051. if (fill !== undefined) {
  7052. // Only pay attention to encoding if it's a string. This
  7053. // prevents accidentally sending in a number that would
  7054. // be interpretted as a start offset.
  7055. return typeof encoding === 'string'
  7056. ? createBuffer(that, size).fill(fill, encoding)
  7057. : createBuffer(that, size).fill(fill)
  7058. }
  7059. return createBuffer(that, size)
  7060. }
  7061. /**
  7062. * Creates a new filled Buffer instance.
  7063. * alloc(size[, fill[, encoding]])
  7064. **/
  7065. Buffer.alloc = function (size, fill, encoding) {
  7066. return alloc(null, size, fill, encoding)
  7067. }
  7068. function allocUnsafe (that, size) {
  7069. assertSize(size)
  7070. that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)
  7071. if (!Buffer.TYPED_ARRAY_SUPPORT) {
  7072. for (var i = 0; i < size; ++i) {
  7073. that[i] = 0
  7074. }
  7075. }
  7076. return that
  7077. }
  7078. /**
  7079. * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
  7080. * */
  7081. Buffer.allocUnsafe = function (size) {
  7082. return allocUnsafe(null, size)
  7083. }
  7084. /**
  7085. * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
  7086. */
  7087. Buffer.allocUnsafeSlow = function (size) {
  7088. return allocUnsafe(null, size)
  7089. }
  7090. function fromString (that, string, encoding) {
  7091. if (typeof encoding !== 'string' || encoding === '') {
  7092. encoding = 'utf8'
  7093. }
  7094. if (!Buffer.isEncoding(encoding)) {
  7095. throw new TypeError('"encoding" must be a valid string encoding')
  7096. }
  7097. var length = byteLength(string, encoding) | 0
  7098. that = createBuffer(that, length)
  7099. var actual = that.write(string, encoding)
  7100. if (actual !== length) {
  7101. // Writing a hex string, for example, that contains invalid characters will
  7102. // cause everything after the first invalid character to be ignored. (e.g.
  7103. // 'abxxcd' will be treated as 'ab')
  7104. that = that.slice(0, actual)
  7105. }
  7106. return that
  7107. }
  7108. function fromArrayLike (that, array) {
  7109. var length = array.length < 0 ? 0 : checked(array.length) | 0
  7110. that = createBuffer(that, length)
  7111. for (var i = 0; i < length; i += 1) {
  7112. that[i] = array[i] & 255
  7113. }
  7114. return that
  7115. }
  7116. function fromArrayBuffer (that, array, byteOffset, length) {
  7117. array.byteLength // this throws if `array` is not a valid ArrayBuffer
  7118. if (byteOffset < 0 || array.byteLength < byteOffset) {
  7119. throw new RangeError('\'offset\' is out of bounds')
  7120. }
  7121. if (array.byteLength < byteOffset + (length || 0)) {
  7122. throw new RangeError('\'length\' is out of bounds')
  7123. }
  7124. if (byteOffset === undefined && length === undefined) {
  7125. array = new Uint8Array(array)
  7126. } else if (length === undefined) {
  7127. array = new Uint8Array(array, byteOffset)
  7128. } else {
  7129. array = new Uint8Array(array, byteOffset, length)
  7130. }
  7131. if (Buffer.TYPED_ARRAY_SUPPORT) {
  7132. // Return an augmented `Uint8Array` instance, for best performance
  7133. that = array
  7134. that.__proto__ = Buffer.prototype
  7135. } else {
  7136. // Fallback: Return an object instance of the Buffer class
  7137. that = fromArrayLike(that, array)
  7138. }
  7139. return that
  7140. }
  7141. function fromObject (that, obj) {
  7142. if (Buffer.isBuffer(obj)) {
  7143. var len = checked(obj.length) | 0
  7144. that = createBuffer(that, len)
  7145. if (that.length === 0) {
  7146. return that
  7147. }
  7148. obj.copy(that, 0, 0, len)
  7149. return that
  7150. }
  7151. if (obj) {
  7152. if ((typeof ArrayBuffer !== 'undefined' &&
  7153. obj.buffer instanceof ArrayBuffer) || 'length' in obj) {
  7154. if (typeof obj.length !== 'number' || isnan(obj.length)) {
  7155. return createBuffer(that, 0)
  7156. }
  7157. return fromArrayLike(that, obj)
  7158. }
  7159. if (obj.type === 'Buffer' && isArray(obj.data)) {
  7160. return fromArrayLike(that, obj.data)
  7161. }
  7162. }
  7163. throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
  7164. }
  7165. function checked (length) {
  7166. // Note: cannot use `length < kMaxLength()` here because that fails when
  7167. // length is NaN (which is otherwise coerced to zero.)
  7168. if (length >= kMaxLength()) {
  7169. throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
  7170. 'size: 0x' + kMaxLength().toString(16) + ' bytes')
  7171. }
  7172. return length | 0
  7173. }
  7174. function SlowBuffer (length) {
  7175. if (+length != length) { // eslint-disable-line eqeqeq
  7176. length = 0
  7177. }
  7178. return Buffer.alloc(+length)
  7179. }
  7180. Buffer.isBuffer = function isBuffer (b) {
  7181. return !!(b != null && b._isBuffer)
  7182. }
  7183. Buffer.compare = function compare (a, b) {
  7184. if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
  7185. throw new TypeError('Arguments must be Buffers')
  7186. }
  7187. if (a === b) return 0
  7188. var x = a.length
  7189. var y = b.length
  7190. for (var i = 0, len = Math.min(x, y); i < len; ++i) {
  7191. if (a[i] !== b[i]) {
  7192. x = a[i]
  7193. y = b[i]
  7194. break
  7195. }
  7196. }
  7197. if (x < y) return -1
  7198. if (y < x) return 1
  7199. return 0
  7200. }
  7201. Buffer.isEncoding = function isEncoding (encoding) {
  7202. switch (String(encoding).toLowerCase()) {
  7203. case 'hex':
  7204. case 'utf8':
  7205. case 'utf-8':
  7206. case 'ascii':
  7207. case 'latin1':
  7208. case 'binary':
  7209. case 'base64':
  7210. case 'ucs2':
  7211. case 'ucs-2':
  7212. case 'utf16le':
  7213. case 'utf-16le':
  7214. return true
  7215. default:
  7216. return false
  7217. }
  7218. }
  7219. Buffer.concat = function concat (list, length) {
  7220. if (!isArray(list)) {
  7221. throw new TypeError('"list" argument must be an Array of Buffers')
  7222. }
  7223. if (list.length === 0) {
  7224. return Buffer.alloc(0)
  7225. }
  7226. var i
  7227. if (length === undefined) {
  7228. length = 0
  7229. for (i = 0; i < list.length; ++i) {
  7230. length += list[i].length
  7231. }
  7232. }
  7233. var buffer = Buffer.allocUnsafe(length)
  7234. var pos = 0
  7235. for (i = 0; i < list.length; ++i) {
  7236. var buf = list[i]
  7237. if (!Buffer.isBuffer(buf)) {
  7238. throw new TypeError('"list" argument must be an Array of Buffers')
  7239. }
  7240. buf.copy(buffer, pos)
  7241. pos += buf.length
  7242. }
  7243. return buffer
  7244. }
  7245. function byteLength (string, encoding) {
  7246. if (Buffer.isBuffer(string)) {
  7247. return string.length
  7248. }
  7249. if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&
  7250. (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
  7251. return string.byteLength
  7252. }
  7253. if (typeof string !== 'string') {
  7254. string = '' + string
  7255. }
  7256. var len = string.length
  7257. if (len === 0) return 0
  7258. // Use a for loop to avoid recursion
  7259. var loweredCase = false
  7260. for (;;) {
  7261. switch (encoding) {
  7262. case 'ascii':
  7263. case 'latin1':
  7264. case 'binary':
  7265. return len
  7266. case 'utf8':
  7267. case 'utf-8':
  7268. case undefined:
  7269. return utf8ToBytes(string).length
  7270. case 'ucs2':
  7271. case 'ucs-2':
  7272. case 'utf16le':
  7273. case 'utf-16le':
  7274. return len * 2
  7275. case 'hex':
  7276. return len >>> 1
  7277. case 'base64':
  7278. return base64ToBytes(string).length
  7279. default:
  7280. if (loweredCase) return utf8ToBytes(string).length // assume utf8
  7281. encoding = ('' + encoding).toLowerCase()
  7282. loweredCase = true
  7283. }
  7284. }
  7285. }
  7286. Buffer.byteLength = byteLength
  7287. function slowToString (encoding, start, end) {
  7288. var loweredCase = false
  7289. // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
  7290. // property of a typed array.
  7291. // This behaves neither like String nor Uint8Array in that we set start/end
  7292. // to their upper/lower bounds if the value passed is out of range.
  7293. // undefined is handled specially as per ECMA-262 6th Edition,
  7294. // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
  7295. if (start === undefined || start < 0) {
  7296. start = 0
  7297. }
  7298. // Return early if start > this.length. Done here to prevent potential uint32
  7299. // coercion fail below.
  7300. if (start > this.length) {
  7301. return ''
  7302. }
  7303. if (end === undefined || end > this.length) {
  7304. end = this.length
  7305. }
  7306. if (end <= 0) {
  7307. return ''
  7308. }
  7309. // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
  7310. end >>>= 0
  7311. start >>>= 0
  7312. if (end <= start) {
  7313. return ''
  7314. }
  7315. if (!encoding) encoding = 'utf8'
  7316. while (true) {
  7317. switch (encoding) {
  7318. case 'hex':
  7319. return hexSlice(this, start, end)
  7320. case 'utf8':
  7321. case 'utf-8':
  7322. return utf8Slice(this, start, end)
  7323. case 'ascii':
  7324. return asciiSlice(this, start, end)
  7325. case 'latin1':
  7326. case 'binary':
  7327. return latin1Slice(this, start, end)
  7328. case 'base64':
  7329. return base64Slice(this, start, end)
  7330. case 'ucs2':
  7331. case 'ucs-2':
  7332. case 'utf16le':
  7333. case 'utf-16le':
  7334. return utf16leSlice(this, start, end)
  7335. default:
  7336. if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
  7337. encoding = (encoding + '').toLowerCase()
  7338. loweredCase = true
  7339. }
  7340. }
  7341. }
  7342. // The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
  7343. // Buffer instances.
  7344. Buffer.prototype._isBuffer = true
  7345. function swap (b, n, m) {
  7346. var i = b[n]
  7347. b[n] = b[m]
  7348. b[m] = i
  7349. }
  7350. Buffer.prototype.swap16 = function swap16 () {
  7351. var len = this.length
  7352. if (len % 2 !== 0) {
  7353. throw new RangeError('Buffer size must be a multiple of 16-bits')
  7354. }
  7355. for (var i = 0; i < len; i += 2) {
  7356. swap(this, i, i + 1)
  7357. }
  7358. return this
  7359. }
  7360. Buffer.prototype.swap32 = function swap32 () {
  7361. var len = this.length
  7362. if (len % 4 !== 0) {
  7363. throw new RangeError('Buffer size must be a multiple of 32-bits')
  7364. }
  7365. for (var i = 0; i < len; i += 4) {
  7366. swap(this, i, i + 3)
  7367. swap(this, i + 1, i + 2)
  7368. }
  7369. return this
  7370. }
  7371. Buffer.prototype.swap64 = function swap64 () {
  7372. var len = this.length
  7373. if (len % 8 !== 0) {
  7374. throw new RangeError('Buffer size must be a multiple of 64-bits')
  7375. }
  7376. for (var i = 0; i < len; i += 8) {
  7377. swap(this, i, i + 7)
  7378. swap(this, i + 1, i + 6)
  7379. swap(this, i + 2, i + 5)
  7380. swap(this, i + 3, i + 4)
  7381. }
  7382. return this
  7383. }
  7384. Buffer.prototype.toString = function toString () {
  7385. var length = this.length | 0
  7386. if (length === 0) return ''
  7387. if (arguments.length === 0) return utf8Slice(this, 0, length)
  7388. return slowToString.apply(this, arguments)
  7389. }
  7390. Buffer.prototype.equals = function equals (b) {
  7391. if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
  7392. if (this === b) return true
  7393. return Buffer.compare(this, b) === 0
  7394. }
  7395. Buffer.prototype.inspect = function inspect () {
  7396. var str = ''
  7397. var max = exports.INSPECT_MAX_BYTES
  7398. if (this.length > 0) {
  7399. str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
  7400. if (this.length > max) str += ' ... '
  7401. }
  7402. return '<Buffer ' + str + '>'
  7403. }
  7404. Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
  7405. if (!Buffer.isBuffer(target)) {
  7406. throw new TypeError('Argument must be a Buffer')
  7407. }
  7408. if (start === undefined) {
  7409. start = 0
  7410. }
  7411. if (end === undefined) {
  7412. end = target ? target.length : 0
  7413. }
  7414. if (thisStart === undefined) {
  7415. thisStart = 0
  7416. }
  7417. if (thisEnd === undefined) {
  7418. thisEnd = this.length
  7419. }
  7420. if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
  7421. throw new RangeError('out of range index')
  7422. }
  7423. if (thisStart >= thisEnd && start >= end) {
  7424. return 0
  7425. }
  7426. if (thisStart >= thisEnd) {
  7427. return -1
  7428. }
  7429. if (start >= end) {
  7430. return 1
  7431. }
  7432. start >>>= 0
  7433. end >>>= 0
  7434. thisStart >>>= 0
  7435. thisEnd >>>= 0
  7436. if (this === target) return 0
  7437. var x = thisEnd - thisStart
  7438. var y = end - start
  7439. var len = Math.min(x, y)
  7440. var thisCopy = this.slice(thisStart, thisEnd)
  7441. var targetCopy = target.slice(start, end)
  7442. for (var i = 0; i < len; ++i) {
  7443. if (thisCopy[i] !== targetCopy[i]) {
  7444. x = thisCopy[i]
  7445. y = targetCopy[i]
  7446. break
  7447. }
  7448. }
  7449. if (x < y) return -1
  7450. if (y < x) return 1
  7451. return 0
  7452. }
  7453. // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
  7454. // OR the last index of `val` in `buffer` at offset <= `byteOffset`.
  7455. //
  7456. // Arguments:
  7457. // - buffer - a Buffer to search
  7458. // - val - a string, Buffer, or number
  7459. // - byteOffset - an index into `buffer`; will be clamped to an int32
  7460. // - encoding - an optional encoding, relevant is val is a string
  7461. // - dir - true for indexOf, false for lastIndexOf
  7462. function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
  7463. // Empty buffer means no match
  7464. if (buffer.length === 0) return -1
  7465. // Normalize byteOffset
  7466. if (typeof byteOffset === 'string') {
  7467. encoding = byteOffset
  7468. byteOffset = 0
  7469. } else if (byteOffset > 0x7fffffff) {
  7470. byteOffset = 0x7fffffff
  7471. } else if (byteOffset < -0x80000000) {
  7472. byteOffset = -0x80000000
  7473. }
  7474. byteOffset = +byteOffset // Coerce to Number.
  7475. if (isNaN(byteOffset)) {
  7476. // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
  7477. byteOffset = dir ? 0 : (buffer.length - 1)
  7478. }
  7479. // Normalize byteOffset: negative offsets start from the end of the buffer
  7480. if (byteOffset < 0) byteOffset = buffer.length + byteOffset
  7481. if (byteOffset >= buffer.length) {
  7482. if (dir) return -1
  7483. else byteOffset = buffer.length - 1
  7484. } else if (byteOffset < 0) {
  7485. if (dir) byteOffset = 0
  7486. else return -1
  7487. }
  7488. // Normalize val
  7489. if (typeof val === 'string') {
  7490. val = Buffer.from(val, encoding)
  7491. }
  7492. // Finally, search either indexOf (if dir is true) or lastIndexOf
  7493. if (Buffer.isBuffer(val)) {
  7494. // Special case: looking for empty string/buffer always fails
  7495. if (val.length === 0) {
  7496. return -1
  7497. }
  7498. return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
  7499. } else if (typeof val === 'number') {
  7500. val = val & 0xFF // Search for a byte value [0-255]
  7501. if (Buffer.TYPED_ARRAY_SUPPORT &&
  7502. typeof Uint8Array.prototype.indexOf === 'function') {
  7503. if (dir) {
  7504. return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
  7505. } else {
  7506. return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
  7507. }
  7508. }
  7509. return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
  7510. }
  7511. throw new TypeError('val must be string, number or Buffer')
  7512. }
  7513. function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
  7514. var indexSize = 1
  7515. var arrLength = arr.length
  7516. var valLength = val.length
  7517. if (encoding !== undefined) {
  7518. encoding = String(encoding).toLowerCase()
  7519. if (encoding === 'ucs2' || encoding === 'ucs-2' ||
  7520. encoding === 'utf16le' || encoding === 'utf-16le') {
  7521. if (arr.length < 2 || val.length < 2) {
  7522. return -1
  7523. }
  7524. indexSize = 2
  7525. arrLength /= 2
  7526. valLength /= 2
  7527. byteOffset /= 2
  7528. }
  7529. }
  7530. function read (buf, i) {
  7531. if (indexSize === 1) {
  7532. return buf[i]
  7533. } else {
  7534. return buf.readUInt16BE(i * indexSize)
  7535. }
  7536. }
  7537. var i
  7538. if (dir) {
  7539. var foundIndex = -1
  7540. for (i = byteOffset; i < arrLength; i++) {
  7541. if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
  7542. if (foundIndex === -1) foundIndex = i
  7543. if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
  7544. } else {
  7545. if (foundIndex !== -1) i -= i - foundIndex
  7546. foundIndex = -1
  7547. }
  7548. }
  7549. } else {
  7550. if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
  7551. for (i = byteOffset; i >= 0; i--) {
  7552. var found = true
  7553. for (var j = 0; j < valLength; j++) {
  7554. if (read(arr, i + j) !== read(val, j)) {
  7555. found = false
  7556. break
  7557. }
  7558. }
  7559. if (found) return i
  7560. }
  7561. }
  7562. return -1
  7563. }
  7564. Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
  7565. return this.indexOf(val, byteOffset, encoding) !== -1
  7566. }
  7567. Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
  7568. return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
  7569. }
  7570. Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
  7571. return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
  7572. }
  7573. function hexWrite (buf, string, offset, length) {
  7574. offset = Number(offset) || 0
  7575. var remaining = buf.length - offset
  7576. if (!length) {
  7577. length = remaining
  7578. } else {
  7579. length = Number(length)
  7580. if (length > remaining) {
  7581. length = remaining
  7582. }
  7583. }
  7584. // must be an even number of digits
  7585. var strLen = string.length
  7586. if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
  7587. if (length > strLen / 2) {
  7588. length = strLen / 2
  7589. }
  7590. for (var i = 0; i < length; ++i) {
  7591. var parsed = parseInt(string.substr(i * 2, 2), 16)
  7592. if (isNaN(parsed)) return i
  7593. buf[offset + i] = parsed
  7594. }
  7595. return i
  7596. }
  7597. function utf8Write (buf, string, offset, length) {
  7598. return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
  7599. }
  7600. function asciiWrite (buf, string, offset, length) {
  7601. return blitBuffer(asciiToBytes(string), buf, offset, length)
  7602. }
  7603. function latin1Write (buf, string, offset, length) {
  7604. return asciiWrite(buf, string, offset, length)
  7605. }
  7606. function base64Write (buf, string, offset, length) {
  7607. return blitBuffer(base64ToBytes(string), buf, offset, length)
  7608. }
  7609. function ucs2Write (buf, string, offset, length) {
  7610. return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
  7611. }
  7612. Buffer.prototype.write = function write (string, offset, length, encoding) {
  7613. // Buffer#write(string)
  7614. if (offset === undefined) {
  7615. encoding = 'utf8'
  7616. length = this.length
  7617. offset = 0
  7618. // Buffer#write(string, encoding)
  7619. } else if (length === undefined && typeof offset === 'string') {
  7620. encoding = offset
  7621. length = this.length
  7622. offset = 0
  7623. // Buffer#write(string, offset[, length][, encoding])
  7624. } else if (isFinite(offset)) {
  7625. offset = offset | 0
  7626. if (isFinite(length)) {
  7627. length = length | 0
  7628. if (encoding === undefined) encoding = 'utf8'
  7629. } else {
  7630. encoding = length
  7631. length = undefined
  7632. }
  7633. // legacy write(string, encoding, offset, length) - remove in v0.13
  7634. } else {
  7635. throw new Error(
  7636. 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
  7637. )
  7638. }
  7639. var remaining = this.length - offset
  7640. if (length === undefined || length > remaining) length = remaining
  7641. if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
  7642. throw new RangeError('Attempt to write outside buffer bounds')
  7643. }
  7644. if (!encoding) encoding = 'utf8'
  7645. var loweredCase = false
  7646. for (;;) {
  7647. switch (encoding) {
  7648. case 'hex':
  7649. return hexWrite(this, string, offset, length)
  7650. case 'utf8':
  7651. case 'utf-8':
  7652. return utf8Write(this, string, offset, length)
  7653. case 'ascii':
  7654. return asciiWrite(this, string, offset, length)
  7655. case 'latin1':
  7656. case 'binary':
  7657. return latin1Write(this, string, offset, length)
  7658. case 'base64':
  7659. // Warning: maxLength not taken into account in base64Write
  7660. return base64Write(this, string, offset, length)
  7661. case 'ucs2':
  7662. case 'ucs-2':
  7663. case 'utf16le':
  7664. case 'utf-16le':
  7665. return ucs2Write(this, string, offset, length)
  7666. default:
  7667. if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
  7668. encoding = ('' + encoding).toLowerCase()
  7669. loweredCase = true
  7670. }
  7671. }
  7672. }
  7673. Buffer.prototype.toJSON = function toJSON () {
  7674. return {
  7675. type: 'Buffer',
  7676. data: Array.prototype.slice.call(this._arr || this, 0)
  7677. }
  7678. }
  7679. function base64Slice (buf, start, end) {
  7680. if (start === 0 && end === buf.length) {
  7681. return base64.fromByteArray(buf)
  7682. } else {
  7683. return base64.fromByteArray(buf.slice(start, end))
  7684. }
  7685. }
  7686. function utf8Slice (buf, start, end) {
  7687. end = Math.min(buf.length, end)
  7688. var res = []
  7689. var i = start
  7690. while (i < end) {
  7691. var firstByte = buf[i]
  7692. var codePoint = null
  7693. var bytesPerSequence = (firstByte > 0xEF) ? 4
  7694. : (firstByte > 0xDF) ? 3
  7695. : (firstByte > 0xBF) ? 2
  7696. : 1
  7697. if (i + bytesPerSequence <= end) {
  7698. var secondByte, thirdByte, fourthByte, tempCodePoint
  7699. switch (bytesPerSequence) {
  7700. case 1:
  7701. if (firstByte < 0x80) {
  7702. codePoint = firstByte
  7703. }
  7704. break
  7705. case 2:
  7706. secondByte = buf[i + 1]
  7707. if ((secondByte & 0xC0) === 0x80) {
  7708. tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
  7709. if (tempCodePoint > 0x7F) {
  7710. codePoint = tempCodePoint
  7711. }
  7712. }
  7713. break
  7714. case 3:
  7715. secondByte = buf[i + 1]
  7716. thirdByte = buf[i + 2]
  7717. if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
  7718. tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
  7719. if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
  7720. codePoint = tempCodePoint
  7721. }
  7722. }
  7723. break
  7724. case 4:
  7725. secondByte = buf[i + 1]
  7726. thirdByte = buf[i + 2]
  7727. fourthByte = buf[i + 3]
  7728. if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
  7729. tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
  7730. if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
  7731. codePoint = tempCodePoint
  7732. }
  7733. }
  7734. }
  7735. }
  7736. if (codePoint === null) {
  7737. // we did not generate a valid codePoint so insert a
  7738. // replacement char (U+FFFD) and advance only 1 byte
  7739. codePoint = 0xFFFD
  7740. bytesPerSequence = 1
  7741. } else if (codePoint > 0xFFFF) {
  7742. // encode to utf16 (surrogate pair dance)
  7743. codePoint -= 0x10000
  7744. res.push(codePoint >>> 10 & 0x3FF | 0xD800)
  7745. codePoint = 0xDC00 | codePoint & 0x3FF
  7746. }
  7747. res.push(codePoint)
  7748. i += bytesPerSequence
  7749. }
  7750. return decodeCodePointsArray(res)
  7751. }
  7752. // Based on http://stackoverflow.com/a/22747272/680742, the browser with
  7753. // the lowest limit is Chrome, with 0x10000 args.
  7754. // We go 1 magnitude less, for safety
  7755. var MAX_ARGUMENTS_LENGTH = 0x1000
  7756. function decodeCodePointsArray (codePoints) {
  7757. var len = codePoints.length
  7758. if (len <= MAX_ARGUMENTS_LENGTH) {
  7759. return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
  7760. }
  7761. // Decode in chunks to avoid "call stack size exceeded".
  7762. var res = ''
  7763. var i = 0
  7764. while (i < len) {
  7765. res += String.fromCharCode.apply(
  7766. String,
  7767. codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
  7768. )
  7769. }
  7770. return res
  7771. }
  7772. function asciiSlice (buf, start, end) {
  7773. var ret = ''
  7774. end = Math.min(buf.length, end)
  7775. for (var i = start; i < end; ++i) {
  7776. ret += String.fromCharCode(buf[i] & 0x7F)
  7777. }
  7778. return ret
  7779. }
  7780. function latin1Slice (buf, start, end) {
  7781. var ret = ''
  7782. end = Math.min(buf.length, end)
  7783. for (var i = start; i < end; ++i) {
  7784. ret += String.fromCharCode(buf[i])
  7785. }
  7786. return ret
  7787. }
  7788. function hexSlice (buf, start, end) {
  7789. var len = buf.length
  7790. if (!start || start < 0) start = 0
  7791. if (!end || end < 0 || end > len) end = len
  7792. var out = ''
  7793. for (var i = start; i < end; ++i) {
  7794. out += toHex(buf[i])
  7795. }
  7796. return out
  7797. }
  7798. function utf16leSlice (buf, start, end) {
  7799. var bytes = buf.slice(start, end)
  7800. var res = ''
  7801. for (var i = 0; i < bytes.length; i += 2) {
  7802. res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
  7803. }
  7804. return res
  7805. }
  7806. Buffer.prototype.slice = function slice (start, end) {
  7807. var len = this.length
  7808. start = ~~start
  7809. end = end === undefined ? len : ~~end
  7810. if (start < 0) {
  7811. start += len
  7812. if (start < 0) start = 0
  7813. } else if (start > len) {
  7814. start = len
  7815. }
  7816. if (end < 0) {
  7817. end += len
  7818. if (end < 0) end = 0
  7819. } else if (end > len) {
  7820. end = len
  7821. }
  7822. if (end < start) end = start
  7823. var newBuf
  7824. if (Buffer.TYPED_ARRAY_SUPPORT) {
  7825. newBuf = this.subarray(start, end)
  7826. newBuf.__proto__ = Buffer.prototype
  7827. } else {
  7828. var sliceLen = end - start
  7829. newBuf = new Buffer(sliceLen, undefined)
  7830. for (var i = 0; i < sliceLen; ++i) {
  7831. newBuf[i] = this[i + start]
  7832. }
  7833. }
  7834. return newBuf
  7835. }
  7836. /*
  7837. * Need to make sure that buffer isn't trying to write out of bounds.
  7838. */
  7839. function checkOffset (offset, ext, length) {
  7840. if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
  7841. if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
  7842. }
  7843. Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
  7844. offset = offset | 0
  7845. byteLength = byteLength | 0
  7846. if (!noAssert) checkOffset(offset, byteLength, this.length)
  7847. var val = this[offset]
  7848. var mul = 1
  7849. var i = 0
  7850. while (++i < byteLength && (mul *= 0x100)) {
  7851. val += this[offset + i] * mul
  7852. }
  7853. return val
  7854. }
  7855. Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
  7856. offset = offset | 0
  7857. byteLength = byteLength | 0
  7858. if (!noAssert) {
  7859. checkOffset(offset, byteLength, this.length)
  7860. }
  7861. var val = this[offset + --byteLength]
  7862. var mul = 1
  7863. while (byteLength > 0 && (mul *= 0x100)) {
  7864. val += this[offset + --byteLength] * mul
  7865. }
  7866. return val
  7867. }
  7868. Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
  7869. if (!noAssert) checkOffset(offset, 1, this.length)
  7870. return this[offset]
  7871. }
  7872. Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
  7873. if (!noAssert) checkOffset(offset, 2, this.length)
  7874. return this[offset] | (this[offset + 1] << 8)
  7875. }
  7876. Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
  7877. if (!noAssert) checkOffset(offset, 2, this.length)
  7878. return (this[offset] << 8) | this[offset + 1]
  7879. }
  7880. Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
  7881. if (!noAssert) checkOffset(offset, 4, this.length)
  7882. return ((this[offset]) |
  7883. (this[offset + 1] << 8) |
  7884. (this[offset + 2] << 16)) +
  7885. (this[offset + 3] * 0x1000000)
  7886. }
  7887. Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
  7888. if (!noAssert) checkOffset(offset, 4, this.length)
  7889. return (this[offset] * 0x1000000) +
  7890. ((this[offset + 1] << 16) |
  7891. (this[offset + 2] << 8) |
  7892. this[offset + 3])
  7893. }
  7894. Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
  7895. offset = offset | 0
  7896. byteLength = byteLength | 0
  7897. if (!noAssert) checkOffset(offset, byteLength, this.length)
  7898. var val = this[offset]
  7899. var mul = 1
  7900. var i = 0
  7901. while (++i < byteLength && (mul *= 0x100)) {
  7902. val += this[offset + i] * mul
  7903. }
  7904. mul *= 0x80
  7905. if (val >= mul) val -= Math.pow(2, 8 * byteLength)
  7906. return val
  7907. }
  7908. Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
  7909. offset = offset | 0
  7910. byteLength = byteLength | 0
  7911. if (!noAssert) checkOffset(offset, byteLength, this.length)
  7912. var i = byteLength
  7913. var mul = 1
  7914. var val = this[offset + --i]
  7915. while (i > 0 && (mul *= 0x100)) {
  7916. val += this[offset + --i] * mul
  7917. }
  7918. mul *= 0x80
  7919. if (val >= mul) val -= Math.pow(2, 8 * byteLength)
  7920. return val
  7921. }
  7922. Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
  7923. if (!noAssert) checkOffset(offset, 1, this.length)
  7924. if (!(this[offset] & 0x80)) return (this[offset])
  7925. return ((0xff - this[offset] + 1) * -1)
  7926. }
  7927. Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
  7928. if (!noAssert) checkOffset(offset, 2, this.length)
  7929. var val = this[offset] | (this[offset + 1] << 8)
  7930. return (val & 0x8000) ? val | 0xFFFF0000 : val
  7931. }
  7932. Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
  7933. if (!noAssert) checkOffset(offset, 2, this.length)
  7934. var val = this[offset + 1] | (this[offset] << 8)
  7935. return (val & 0x8000) ? val | 0xFFFF0000 : val
  7936. }
  7937. Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
  7938. if (!noAssert) checkOffset(offset, 4, this.length)
  7939. return (this[offset]) |
  7940. (this[offset + 1] << 8) |
  7941. (this[offset + 2] << 16) |
  7942. (this[offset + 3] << 24)
  7943. }
  7944. Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
  7945. if (!noAssert) checkOffset(offset, 4, this.length)
  7946. return (this[offset] << 24) |
  7947. (this[offset + 1] << 16) |
  7948. (this[offset + 2] << 8) |
  7949. (this[offset + 3])
  7950. }
  7951. Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
  7952. if (!noAssert) checkOffset(offset, 4, this.length)
  7953. return ieee754.read(this, offset, true, 23, 4)
  7954. }
  7955. Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
  7956. if (!noAssert) checkOffset(offset, 4, this.length)
  7957. return ieee754.read(this, offset, false, 23, 4)
  7958. }
  7959. Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
  7960. if (!noAssert) checkOffset(offset, 8, this.length)
  7961. return ieee754.read(this, offset, true, 52, 8)
  7962. }
  7963. Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
  7964. if (!noAssert) checkOffset(offset, 8, this.length)
  7965. return ieee754.read(this, offset, false, 52, 8)
  7966. }
  7967. function checkInt (buf, value, offset, ext, max, min) {
  7968. if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
  7969. if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
  7970. if (offset + ext > buf.length) throw new RangeError('Index out of range')
  7971. }
  7972. Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
  7973. value = +value
  7974. offset = offset | 0
  7975. byteLength = byteLength | 0
  7976. if (!noAssert) {
  7977. var maxBytes = Math.pow(2, 8 * byteLength) - 1
  7978. checkInt(this, value, offset, byteLength, maxBytes, 0)
  7979. }
  7980. var mul = 1
  7981. var i = 0
  7982. this[offset] = value & 0xFF
  7983. while (++i < byteLength && (mul *= 0x100)) {
  7984. this[offset + i] = (value / mul) & 0xFF
  7985. }
  7986. return offset + byteLength
  7987. }
  7988. Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
  7989. value = +value
  7990. offset = offset | 0
  7991. byteLength = byteLength | 0
  7992. if (!noAssert) {
  7993. var maxBytes = Math.pow(2, 8 * byteLength) - 1
  7994. checkInt(this, value, offset, byteLength, maxBytes, 0)
  7995. }
  7996. var i = byteLength - 1
  7997. var mul = 1
  7998. this[offset + i] = value & 0xFF
  7999. while (--i >= 0 && (mul *= 0x100)) {
  8000. this[offset + i] = (value / mul) & 0xFF
  8001. }
  8002. return offset + byteLength
  8003. }
  8004. Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
  8005. value = +value
  8006. offset = offset | 0
  8007. if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
  8008. if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
  8009. this[offset] = (value & 0xff)
  8010. return offset + 1
  8011. }
  8012. function objectWriteUInt16 (buf, value, offset, littleEndian) {
  8013. if (value < 0) value = 0xffff + value + 1
  8014. for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
  8015. buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
  8016. (littleEndian ? i : 1 - i) * 8
  8017. }
  8018. }
  8019. Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
  8020. value = +value
  8021. offset = offset | 0
  8022. if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  8023. if (Buffer.TYPED_ARRAY_SUPPORT) {
  8024. this[offset] = (value & 0xff)
  8025. this[offset + 1] = (value >>> 8)
  8026. } else {
  8027. objectWriteUInt16(this, value, offset, true)
  8028. }
  8029. return offset + 2
  8030. }
  8031. Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
  8032. value = +value
  8033. offset = offset | 0
  8034. if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  8035. if (Buffer.TYPED_ARRAY_SUPPORT) {
  8036. this[offset] = (value >>> 8)
  8037. this[offset + 1] = (value & 0xff)
  8038. } else {
  8039. objectWriteUInt16(this, value, offset, false)
  8040. }
  8041. return offset + 2
  8042. }
  8043. function objectWriteUInt32 (buf, value, offset, littleEndian) {
  8044. if (value < 0) value = 0xffffffff + value + 1
  8045. for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
  8046. buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
  8047. }
  8048. }
  8049. Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
  8050. value = +value
  8051. offset = offset | 0
  8052. if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  8053. if (Buffer.TYPED_ARRAY_SUPPORT) {
  8054. this[offset + 3] = (value >>> 24)
  8055. this[offset + 2] = (value >>> 16)
  8056. this[offset + 1] = (value >>> 8)
  8057. this[offset] = (value & 0xff)
  8058. } else {
  8059. objectWriteUInt32(this, value, offset, true)
  8060. }
  8061. return offset + 4
  8062. }
  8063. Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
  8064. value = +value
  8065. offset = offset | 0
  8066. if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  8067. if (Buffer.TYPED_ARRAY_SUPPORT) {
  8068. this[offset] = (value >>> 24)
  8069. this[offset + 1] = (value >>> 16)
  8070. this[offset + 2] = (value >>> 8)
  8071. this[offset + 3] = (value & 0xff)
  8072. } else {
  8073. objectWriteUInt32(this, value, offset, false)
  8074. }
  8075. return offset + 4
  8076. }
  8077. Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
  8078. value = +value
  8079. offset = offset | 0
  8080. if (!noAssert) {
  8081. var limit = Math.pow(2, 8 * byteLength - 1)
  8082. checkInt(this, value, offset, byteLength, limit - 1, -limit)
  8083. }
  8084. var i = 0
  8085. var mul = 1
  8086. var sub = 0
  8087. this[offset] = value & 0xFF
  8088. while (++i < byteLength && (mul *= 0x100)) {
  8089. if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
  8090. sub = 1
  8091. }
  8092. this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  8093. }
  8094. return offset + byteLength
  8095. }
  8096. Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
  8097. value = +value
  8098. offset = offset | 0
  8099. if (!noAssert) {
  8100. var limit = Math.pow(2, 8 * byteLength - 1)
  8101. checkInt(this, value, offset, byteLength, limit - 1, -limit)
  8102. }
  8103. var i = byteLength - 1
  8104. var mul = 1
  8105. var sub = 0
  8106. this[offset + i] = value & 0xFF
  8107. while (--i >= 0 && (mul *= 0x100)) {
  8108. if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
  8109. sub = 1
  8110. }
  8111. this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  8112. }
  8113. return offset + byteLength
  8114. }
  8115. Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
  8116. value = +value
  8117. offset = offset | 0
  8118. if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
  8119. if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
  8120. if (value < 0) value = 0xff + value + 1
  8121. this[offset] = (value & 0xff)
  8122. return offset + 1
  8123. }
  8124. Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
  8125. value = +value
  8126. offset = offset | 0
  8127. if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  8128. if (Buffer.TYPED_ARRAY_SUPPORT) {
  8129. this[offset] = (value & 0xff)
  8130. this[offset + 1] = (value >>> 8)
  8131. } else {
  8132. objectWriteUInt16(this, value, offset, true)
  8133. }
  8134. return offset + 2
  8135. }
  8136. Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
  8137. value = +value
  8138. offset = offset | 0
  8139. if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  8140. if (Buffer.TYPED_ARRAY_SUPPORT) {
  8141. this[offset] = (value >>> 8)
  8142. this[offset + 1] = (value & 0xff)
  8143. } else {
  8144. objectWriteUInt16(this, value, offset, false)
  8145. }
  8146. return offset + 2
  8147. }
  8148. Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
  8149. value = +value
  8150. offset = offset | 0
  8151. if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  8152. if (Buffer.TYPED_ARRAY_SUPPORT) {
  8153. this[offset] = (value & 0xff)
  8154. this[offset + 1] = (value >>> 8)
  8155. this[offset + 2] = (value >>> 16)
  8156. this[offset + 3] = (value >>> 24)
  8157. } else {
  8158. objectWriteUInt32(this, value, offset, true)
  8159. }
  8160. return offset + 4
  8161. }
  8162. Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
  8163. value = +value
  8164. offset = offset | 0
  8165. if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  8166. if (value < 0) value = 0xffffffff + value + 1
  8167. if (Buffer.TYPED_ARRAY_SUPPORT) {
  8168. this[offset] = (value >>> 24)
  8169. this[offset + 1] = (value >>> 16)
  8170. this[offset + 2] = (value >>> 8)
  8171. this[offset + 3] = (value & 0xff)
  8172. } else {
  8173. objectWriteUInt32(this, value, offset, false)
  8174. }
  8175. return offset + 4
  8176. }
  8177. function checkIEEE754 (buf, value, offset, ext, max, min) {
  8178. if (offset + ext > buf.length) throw new RangeError('Index out of range')
  8179. if (offset < 0) throw new RangeError('Index out of range')
  8180. }
  8181. function writeFloat (buf, value, offset, littleEndian, noAssert) {
  8182. if (!noAssert) {
  8183. checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
  8184. }
  8185. ieee754.write(buf, value, offset, littleEndian, 23, 4)
  8186. return offset + 4
  8187. }
  8188. Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
  8189. return writeFloat(this, value, offset, true, noAssert)
  8190. }
  8191. Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
  8192. return writeFloat(this, value, offset, false, noAssert)
  8193. }
  8194. function writeDouble (buf, value, offset, littleEndian, noAssert) {
  8195. if (!noAssert) {
  8196. checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
  8197. }
  8198. ieee754.write(buf, value, offset, littleEndian, 52, 8)
  8199. return offset + 8
  8200. }
  8201. Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
  8202. return writeDouble(this, value, offset, true, noAssert)
  8203. }
  8204. Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
  8205. return writeDouble(this, value, offset, false, noAssert)
  8206. }
  8207. // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
  8208. Buffer.prototype.copy = function copy (target, targetStart, start, end) {
  8209. if (!start) start = 0
  8210. if (!end && end !== 0) end = this.length
  8211. if (targetStart >= target.length) targetStart = target.length
  8212. if (!targetStart) targetStart = 0
  8213. if (end > 0 && end < start) end = start
  8214. // Copy 0 bytes; we're done
  8215. if (end === start) return 0
  8216. if (target.length === 0 || this.length === 0) return 0
  8217. // Fatal error conditions
  8218. if (targetStart < 0) {
  8219. throw new RangeError('targetStart out of bounds')
  8220. }
  8221. if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
  8222. if (end < 0) throw new RangeError('sourceEnd out of bounds')
  8223. // Are we oob?
  8224. if (end > this.length) end = this.length
  8225. if (target.length - targetStart < end - start) {
  8226. end = target.length - targetStart + start
  8227. }
  8228. var len = end - start
  8229. var i
  8230. if (this === target && start < targetStart && targetStart < end) {
  8231. // descending copy from end
  8232. for (i = len - 1; i >= 0; --i) {
  8233. target[i + targetStart] = this[i + start]
  8234. }
  8235. } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
  8236. // ascending copy from start
  8237. for (i = 0; i < len; ++i) {
  8238. target[i + targetStart] = this[i + start]
  8239. }
  8240. } else {
  8241. Uint8Array.prototype.set.call(
  8242. target,
  8243. this.subarray(start, start + len),
  8244. targetStart
  8245. )
  8246. }
  8247. return len
  8248. }
  8249. // Usage:
  8250. // buffer.fill(number[, offset[, end]])
  8251. // buffer.fill(buffer[, offset[, end]])
  8252. // buffer.fill(string[, offset[, end]][, encoding])
  8253. Buffer.prototype.fill = function fill (val, start, end, encoding) {
  8254. // Handle string cases:
  8255. if (typeof val === 'string') {
  8256. if (typeof start === 'string') {
  8257. encoding = start
  8258. start = 0
  8259. end = this.length
  8260. } else if (typeof end === 'string') {
  8261. encoding = end
  8262. end = this.length
  8263. }
  8264. if (val.length === 1) {
  8265. var code = val.charCodeAt(0)
  8266. if (code < 256) {
  8267. val = code
  8268. }
  8269. }
  8270. if (encoding !== undefined && typeof encoding !== 'string') {
  8271. throw new TypeError('encoding must be a string')
  8272. }
  8273. if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
  8274. throw new TypeError('Unknown encoding: ' + encoding)
  8275. }
  8276. } else if (typeof val === 'number') {
  8277. val = val & 255
  8278. }
  8279. // Invalid ranges are not set to a default, so can range check early.
  8280. if (start < 0 || this.length < start || this.length < end) {
  8281. throw new RangeError('Out of range index')
  8282. }
  8283. if (end <= start) {
  8284. return this
  8285. }
  8286. start = start >>> 0
  8287. end = end === undefined ? this.length : end >>> 0
  8288. if (!val) val = 0
  8289. var i
  8290. if (typeof val === 'number') {
  8291. for (i = start; i < end; ++i) {
  8292. this[i] = val
  8293. }
  8294. } else {
  8295. var bytes = Buffer.isBuffer(val)
  8296. ? val
  8297. : utf8ToBytes(new Buffer(val, encoding).toString())
  8298. var len = bytes.length
  8299. for (i = 0; i < end - start; ++i) {
  8300. this[i + start] = bytes[i % len]
  8301. }
  8302. }
  8303. return this
  8304. }
  8305. // HELPER FUNCTIONS
  8306. // ================
  8307. var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g
  8308. function base64clean (str) {
  8309. // Node strips out invalid characters like \n and \t from the string, base64-js does not
  8310. str = stringtrim(str).replace(INVALID_BASE64_RE, '')
  8311. // Node converts strings with length < 2 to ''
  8312. if (str.length < 2) return ''
  8313. // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
  8314. while (str.length % 4 !== 0) {
  8315. str = str + '='
  8316. }
  8317. return str
  8318. }
  8319. function stringtrim (str) {
  8320. if (str.trim) return str.trim()
  8321. return str.replace(/^\s+|\s+$/g, '')
  8322. }
  8323. function toHex (n) {
  8324. if (n < 16) return '0' + n.toString(16)
  8325. return n.toString(16)
  8326. }
  8327. function utf8ToBytes (string, units) {
  8328. units = units || Infinity
  8329. var codePoint
  8330. var length = string.length
  8331. var leadSurrogate = null
  8332. var bytes = []
  8333. for (var i = 0; i < length; ++i) {
  8334. codePoint = string.charCodeAt(i)
  8335. // is surrogate component
  8336. if (codePoint > 0xD7FF && codePoint < 0xE000) {
  8337. // last char was a lead
  8338. if (!leadSurrogate) {
  8339. // no lead yet
  8340. if (codePoint > 0xDBFF) {
  8341. // unexpected trail
  8342. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  8343. continue
  8344. } else if (i + 1 === length) {
  8345. // unpaired lead
  8346. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  8347. continue
  8348. }
  8349. // valid lead
  8350. leadSurrogate = codePoint
  8351. continue
  8352. }
  8353. // 2 leads in a row
  8354. if (codePoint < 0xDC00) {
  8355. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  8356. leadSurrogate = codePoint
  8357. continue
  8358. }
  8359. // valid surrogate pair
  8360. codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
  8361. } else if (leadSurrogate) {
  8362. // valid bmp char, but last char was a lead
  8363. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  8364. }
  8365. leadSurrogate = null
  8366. // encode utf8
  8367. if (codePoint < 0x80) {
  8368. if ((units -= 1) < 0) break
  8369. bytes.push(codePoint)
  8370. } else if (codePoint < 0x800) {
  8371. if ((units -= 2) < 0) break
  8372. bytes.push(
  8373. codePoint >> 0x6 | 0xC0,
  8374. codePoint & 0x3F | 0x80
  8375. )
  8376. } else if (codePoint < 0x10000) {
  8377. if ((units -= 3) < 0) break
  8378. bytes.push(
  8379. codePoint >> 0xC | 0xE0,
  8380. codePoint >> 0x6 & 0x3F | 0x80,
  8381. codePoint & 0x3F | 0x80
  8382. )
  8383. } else if (codePoint < 0x110000) {
  8384. if ((units -= 4) < 0) break
  8385. bytes.push(
  8386. codePoint >> 0x12 | 0xF0,
  8387. codePoint >> 0xC & 0x3F | 0x80,
  8388. codePoint >> 0x6 & 0x3F | 0x80,
  8389. codePoint & 0x3F | 0x80
  8390. )
  8391. } else {
  8392. throw new Error('Invalid code point')
  8393. }
  8394. }
  8395. return bytes
  8396. }
  8397. function asciiToBytes (str) {
  8398. var byteArray = []
  8399. for (var i = 0; i < str.length; ++i) {
  8400. // Node's code seems to be doing this and not & 0x7F..
  8401. byteArray.push(str.charCodeAt(i) & 0xFF)
  8402. }
  8403. return byteArray
  8404. }
  8405. function utf16leToBytes (str, units) {
  8406. var c, hi, lo
  8407. var byteArray = []
  8408. for (var i = 0; i < str.length; ++i) {
  8409. if ((units -= 2) < 0) break
  8410. c = str.charCodeAt(i)
  8411. hi = c >> 8
  8412. lo = c % 256
  8413. byteArray.push(lo)
  8414. byteArray.push(hi)
  8415. }
  8416. return byteArray
  8417. }
  8418. function base64ToBytes (str) {
  8419. return base64.toByteArray(base64clean(str))
  8420. }
  8421. function blitBuffer (src, dst, offset, length) {
  8422. for (var i = 0; i < length; ++i) {
  8423. if ((i + offset >= dst.length) || (i >= src.length)) break
  8424. dst[i + offset] = src[i]
  8425. }
  8426. return i
  8427. }
  8428. function isnan (val) {
  8429. return val !== val // eslint-disable-line no-self-compare
  8430. }
  8431. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  8432. /***/ }),
  8433. /***/ "./node_modules/clipboard/dist/clipboard.js":
  8434. /*!**************************************************!*\
  8435. !*** ./node_modules/clipboard/dist/clipboard.js ***!
  8436. \**************************************************/
  8437. /*! no static exports found */
  8438. /***/ (function(module, exports, __webpack_require__) {
  8439. /*!
  8440. * clipboard.js v2.0.4
  8441. * https://zenorocha.github.io/clipboard.js
  8442. *
  8443. * Licensed MIT © Zeno Rocha
  8444. */
  8445. (function webpackUniversalModuleDefinition(root, factory) {
  8446. if(true)
  8447. module.exports = factory();
  8448. else {}
  8449. })(this, function() {
  8450. return /******/ (function(modules) { // webpackBootstrap
  8451. /******/ // The module cache
  8452. /******/ var installedModules = {};
  8453. /******/
  8454. /******/ // The require function
  8455. /******/ function __webpack_require__(moduleId) {
  8456. /******/
  8457. /******/ // Check if module is in cache
  8458. /******/ if(installedModules[moduleId]) {
  8459. /******/ return installedModules[moduleId].exports;
  8460. /******/ }
  8461. /******/ // Create a new module (and put it into the cache)
  8462. /******/ var module = installedModules[moduleId] = {
  8463. /******/ i: moduleId,
  8464. /******/ l: false,
  8465. /******/ exports: {}
  8466. /******/ };
  8467. /******/
  8468. /******/ // Execute the module function
  8469. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  8470. /******/
  8471. /******/ // Flag the module as loaded
  8472. /******/ module.l = true;
  8473. /******/
  8474. /******/ // Return the exports of the module
  8475. /******/ return module.exports;
  8476. /******/ }
  8477. /******/
  8478. /******/
  8479. /******/ // expose the modules object (__webpack_modules__)
  8480. /******/ __webpack_require__.m = modules;
  8481. /******/
  8482. /******/ // expose the module cache
  8483. /******/ __webpack_require__.c = installedModules;
  8484. /******/
  8485. /******/ // define getter function for harmony exports
  8486. /******/ __webpack_require__.d = function(exports, name, getter) {
  8487. /******/ if(!__webpack_require__.o(exports, name)) {
  8488. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  8489. /******/ }
  8490. /******/ };
  8491. /******/
  8492. /******/ // define __esModule on exports
  8493. /******/ __webpack_require__.r = function(exports) {
  8494. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  8495. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  8496. /******/ }
  8497. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  8498. /******/ };
  8499. /******/
  8500. /******/ // create a fake namespace object
  8501. /******/ // mode & 1: value is a module id, require it
  8502. /******/ // mode & 2: merge all properties of value into the ns
  8503. /******/ // mode & 4: return value when already ns object
  8504. /******/ // mode & 8|1: behave like require
  8505. /******/ __webpack_require__.t = function(value, mode) {
  8506. /******/ if(mode & 1) value = __webpack_require__(value);
  8507. /******/ if(mode & 8) return value;
  8508. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  8509. /******/ var ns = Object.create(null);
  8510. /******/ __webpack_require__.r(ns);
  8511. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  8512. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  8513. /******/ return ns;
  8514. /******/ };
  8515. /******/
  8516. /******/ // getDefaultExport function for compatibility with non-harmony modules
  8517. /******/ __webpack_require__.n = function(module) {
  8518. /******/ var getter = module && module.__esModule ?
  8519. /******/ function getDefault() { return module['default']; } :
  8520. /******/ function getModuleExports() { return module; };
  8521. /******/ __webpack_require__.d(getter, 'a', getter);
  8522. /******/ return getter;
  8523. /******/ };
  8524. /******/
  8525. /******/ // Object.prototype.hasOwnProperty.call
  8526. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  8527. /******/
  8528. /******/ // __webpack_public_path__
  8529. /******/ __webpack_require__.p = "";
  8530. /******/
  8531. /******/
  8532. /******/ // Load entry module and return exports
  8533. /******/ return __webpack_require__(__webpack_require__.s = 0);
  8534. /******/ })
  8535. /************************************************************************/
  8536. /******/ ([
  8537. /* 0 */
  8538. /***/ (function(module, exports, __webpack_require__) {
  8539. "use strict";
  8540. 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; };
  8541. 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; }; }();
  8542. var _clipboardAction = __webpack_require__(1);
  8543. var _clipboardAction2 = _interopRequireDefault(_clipboardAction);
  8544. var _tinyEmitter = __webpack_require__(3);
  8545. var _tinyEmitter2 = _interopRequireDefault(_tinyEmitter);
  8546. var _goodListener = __webpack_require__(4);
  8547. var _goodListener2 = _interopRequireDefault(_goodListener);
  8548. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  8549. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8550. 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; }
  8551. 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; }
  8552. /**
  8553. * Base class which takes one or more elements, adds event listeners to them,
  8554. * and instantiates a new `ClipboardAction` on each click.
  8555. */
  8556. var Clipboard = function (_Emitter) {
  8557. _inherits(Clipboard, _Emitter);
  8558. /**
  8559. * @param {String|HTMLElement|HTMLCollection|NodeList} trigger
  8560. * @param {Object} options
  8561. */
  8562. function Clipboard(trigger, options) {
  8563. _classCallCheck(this, Clipboard);
  8564. var _this = _possibleConstructorReturn(this, (Clipboard.__proto__ || Object.getPrototypeOf(Clipboard)).call(this));
  8565. _this.resolveOptions(options);
  8566. _this.listenClick(trigger);
  8567. return _this;
  8568. }
  8569. /**
  8570. * Defines if attributes would be resolved using internal setter functions
  8571. * or custom functions that were passed in the constructor.
  8572. * @param {Object} options
  8573. */
  8574. _createClass(Clipboard, [{
  8575. key: 'resolveOptions',
  8576. value: function resolveOptions() {
  8577. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  8578. this.action = typeof options.action === 'function' ? options.action : this.defaultAction;
  8579. this.target = typeof options.target === 'function' ? options.target : this.defaultTarget;
  8580. this.text = typeof options.text === 'function' ? options.text : this.defaultText;
  8581. this.container = _typeof(options.container) === 'object' ? options.container : document.body;
  8582. }
  8583. /**
  8584. * Adds a click event listener to the passed trigger.
  8585. * @param {String|HTMLElement|HTMLCollection|NodeList} trigger
  8586. */
  8587. }, {
  8588. key: 'listenClick',
  8589. value: function listenClick(trigger) {
  8590. var _this2 = this;
  8591. this.listener = (0, _goodListener2.default)(trigger, 'click', function (e) {
  8592. return _this2.onClick(e);
  8593. });
  8594. }
  8595. /**
  8596. * Defines a new `ClipboardAction` on each click event.
  8597. * @param {Event} e
  8598. */
  8599. }, {
  8600. key: 'onClick',
  8601. value: function onClick(e) {
  8602. var trigger = e.delegateTarget || e.currentTarget;
  8603. if (this.clipboardAction) {
  8604. this.clipboardAction = null;
  8605. }
  8606. this.clipboardAction = new _clipboardAction2.default({
  8607. action: this.action(trigger),
  8608. target: this.target(trigger),
  8609. text: this.text(trigger),
  8610. container: this.container,
  8611. trigger: trigger,
  8612. emitter: this
  8613. });
  8614. }
  8615. /**
  8616. * Default `action` lookup function.
  8617. * @param {Element} trigger
  8618. */
  8619. }, {
  8620. key: 'defaultAction',
  8621. value: function defaultAction(trigger) {
  8622. return getAttributeValue('action', trigger);
  8623. }
  8624. /**
  8625. * Default `target` lookup function.
  8626. * @param {Element} trigger
  8627. */
  8628. }, {
  8629. key: 'defaultTarget',
  8630. value: function defaultTarget(trigger) {
  8631. var selector = getAttributeValue('target', trigger);
  8632. if (selector) {
  8633. return document.querySelector(selector);
  8634. }
  8635. }
  8636. /**
  8637. * Returns the support of the given action, or all actions if no action is
  8638. * given.
  8639. * @param {String} [action]
  8640. */
  8641. }, {
  8642. key: 'defaultText',
  8643. /**
  8644. * Default `text` lookup function.
  8645. * @param {Element} trigger
  8646. */
  8647. value: function defaultText(trigger) {
  8648. return getAttributeValue('text', trigger);
  8649. }
  8650. /**
  8651. * Destroy lifecycle.
  8652. */
  8653. }, {
  8654. key: 'destroy',
  8655. value: function destroy() {
  8656. this.listener.destroy();
  8657. if (this.clipboardAction) {
  8658. this.clipboardAction.destroy();
  8659. this.clipboardAction = null;
  8660. }
  8661. }
  8662. }], [{
  8663. key: 'isSupported',
  8664. value: function isSupported() {
  8665. var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['copy', 'cut'];
  8666. var actions = typeof action === 'string' ? [action] : action;
  8667. var support = !!document.queryCommandSupported;
  8668. actions.forEach(function (action) {
  8669. support = support && !!document.queryCommandSupported(action);
  8670. });
  8671. return support;
  8672. }
  8673. }]);
  8674. return Clipboard;
  8675. }(_tinyEmitter2.default);
  8676. /**
  8677. * Helper function to retrieve attribute value.
  8678. * @param {String} suffix
  8679. * @param {Element} element
  8680. */
  8681. function getAttributeValue(suffix, element) {
  8682. var attribute = 'data-clipboard-' + suffix;
  8683. if (!element.hasAttribute(attribute)) {
  8684. return;
  8685. }
  8686. return element.getAttribute(attribute);
  8687. }
  8688. module.exports = Clipboard;
  8689. /***/ }),
  8690. /* 1 */
  8691. /***/ (function(module, exports, __webpack_require__) {
  8692. "use strict";
  8693. 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; };
  8694. 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; }; }();
  8695. var _select = __webpack_require__(2);
  8696. var _select2 = _interopRequireDefault(_select);
  8697. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  8698. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8699. /**
  8700. * Inner class which performs selection from either `text` or `target`
  8701. * properties and then executes copy or cut operations.
  8702. */
  8703. var ClipboardAction = function () {
  8704. /**
  8705. * @param {Object} options
  8706. */
  8707. function ClipboardAction(options) {
  8708. _classCallCheck(this, ClipboardAction);
  8709. this.resolveOptions(options);
  8710. this.initSelection();
  8711. }
  8712. /**
  8713. * Defines base properties passed from constructor.
  8714. * @param {Object} options
  8715. */
  8716. _createClass(ClipboardAction, [{
  8717. key: 'resolveOptions',
  8718. value: function resolveOptions() {
  8719. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  8720. this.action = options.action;
  8721. this.container = options.container;
  8722. this.emitter = options.emitter;
  8723. this.target = options.target;
  8724. this.text = options.text;
  8725. this.trigger = options.trigger;
  8726. this.selectedText = '';
  8727. }
  8728. /**
  8729. * Decides which selection strategy is going to be applied based
  8730. * on the existence of `text` and `target` properties.
  8731. */
  8732. }, {
  8733. key: 'initSelection',
  8734. value: function initSelection() {
  8735. if (this.text) {
  8736. this.selectFake();
  8737. } else if (this.target) {
  8738. this.selectTarget();
  8739. }
  8740. }
  8741. /**
  8742. * Creates a fake textarea element, sets its value from `text` property,
  8743. * and makes a selection on it.
  8744. */
  8745. }, {
  8746. key: 'selectFake',
  8747. value: function selectFake() {
  8748. var _this = this;
  8749. var isRTL = document.documentElement.getAttribute('dir') == 'rtl';
  8750. this.removeFake();
  8751. this.fakeHandlerCallback = function () {
  8752. return _this.removeFake();
  8753. };
  8754. this.fakeHandler = this.container.addEventListener('click', this.fakeHandlerCallback) || true;
  8755. this.fakeElem = document.createElement('textarea');
  8756. // Prevent zooming on iOS
  8757. this.fakeElem.style.fontSize = '12pt';
  8758. // Reset box model
  8759. this.fakeElem.style.border = '0';
  8760. this.fakeElem.style.padding = '0';
  8761. this.fakeElem.style.margin = '0';
  8762. // Move element out of screen horizontally
  8763. this.fakeElem.style.position = 'absolute';
  8764. this.fakeElem.style[isRTL ? 'right' : 'left'] = '-9999px';
  8765. // Move element to the same position vertically
  8766. var yPosition = window.pageYOffset || document.documentElement.scrollTop;
  8767. this.fakeElem.style.top = yPosition + 'px';
  8768. this.fakeElem.setAttribute('readonly', '');
  8769. this.fakeElem.value = this.text;
  8770. this.container.appendChild(this.fakeElem);
  8771. this.selectedText = (0, _select2.default)(this.fakeElem);
  8772. this.copyText();
  8773. }
  8774. /**
  8775. * Only removes the fake element after another click event, that way
  8776. * a user can hit `Ctrl+C` to copy because selection still exists.
  8777. */
  8778. }, {
  8779. key: 'removeFake',
  8780. value: function removeFake() {
  8781. if (this.fakeHandler) {
  8782. this.container.removeEventListener('click', this.fakeHandlerCallback);
  8783. this.fakeHandler = null;
  8784. this.fakeHandlerCallback = null;
  8785. }
  8786. if (this.fakeElem) {
  8787. this.container.removeChild(this.fakeElem);
  8788. this.fakeElem = null;
  8789. }
  8790. }
  8791. /**
  8792. * Selects the content from element passed on `target` property.
  8793. */
  8794. }, {
  8795. key: 'selectTarget',
  8796. value: function selectTarget() {
  8797. this.selectedText = (0, _select2.default)(this.target);
  8798. this.copyText();
  8799. }
  8800. /**
  8801. * Executes the copy operation based on the current selection.
  8802. */
  8803. }, {
  8804. key: 'copyText',
  8805. value: function copyText() {
  8806. var succeeded = void 0;
  8807. try {
  8808. succeeded = document.execCommand(this.action);
  8809. } catch (err) {
  8810. succeeded = false;
  8811. }
  8812. this.handleResult(succeeded);
  8813. }
  8814. /**
  8815. * Fires an event based on the copy operation result.
  8816. * @param {Boolean} succeeded
  8817. */
  8818. }, {
  8819. key: 'handleResult',
  8820. value: function handleResult(succeeded) {
  8821. this.emitter.emit(succeeded ? 'success' : 'error', {
  8822. action: this.action,
  8823. text: this.selectedText,
  8824. trigger: this.trigger,
  8825. clearSelection: this.clearSelection.bind(this)
  8826. });
  8827. }
  8828. /**
  8829. * Moves focus away from `target` and back to the trigger, removes current selection.
  8830. */
  8831. }, {
  8832. key: 'clearSelection',
  8833. value: function clearSelection() {
  8834. if (this.trigger) {
  8835. this.trigger.focus();
  8836. }
  8837. window.getSelection().removeAllRanges();
  8838. }
  8839. /**
  8840. * Sets the `action` to be performed which can be either 'copy' or 'cut'.
  8841. * @param {String} action
  8842. */
  8843. }, {
  8844. key: 'destroy',
  8845. /**
  8846. * Destroy lifecycle.
  8847. */
  8848. value: function destroy() {
  8849. this.removeFake();
  8850. }
  8851. }, {
  8852. key: 'action',
  8853. set: function set() {
  8854. var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'copy';
  8855. this._action = action;
  8856. if (this._action !== 'copy' && this._action !== 'cut') {
  8857. throw new Error('Invalid "action" value, use either "copy" or "cut"');
  8858. }
  8859. }
  8860. /**
  8861. * Gets the `action` property.
  8862. * @return {String}
  8863. */
  8864. ,
  8865. get: function get() {
  8866. return this._action;
  8867. }
  8868. /**
  8869. * Sets the `target` property using an element
  8870. * that will be have its content copied.
  8871. * @param {Element} target
  8872. */
  8873. }, {
  8874. key: 'target',
  8875. set: function set(target) {
  8876. if (target !== undefined) {
  8877. if (target && (typeof target === 'undefined' ? 'undefined' : _typeof(target)) === 'object' && target.nodeType === 1) {
  8878. if (this.action === 'copy' && target.hasAttribute('disabled')) {
  8879. throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');
  8880. }
  8881. if (this.action === 'cut' && (target.hasAttribute('readonly') || target.hasAttribute('disabled'))) {
  8882. throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');
  8883. }
  8884. this._target = target;
  8885. } else {
  8886. throw new Error('Invalid "target" value, use a valid Element');
  8887. }
  8888. }
  8889. }
  8890. /**
  8891. * Gets the `target` property.
  8892. * @return {String|HTMLElement}
  8893. */
  8894. ,
  8895. get: function get() {
  8896. return this._target;
  8897. }
  8898. }]);
  8899. return ClipboardAction;
  8900. }();
  8901. module.exports = ClipboardAction;
  8902. /***/ }),
  8903. /* 2 */
  8904. /***/ (function(module, exports) {
  8905. function select(element) {
  8906. var selectedText;
  8907. if (element.nodeName === 'SELECT') {
  8908. element.focus();
  8909. selectedText = element.value;
  8910. }
  8911. else if (element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA') {
  8912. var isReadOnly = element.hasAttribute('readonly');
  8913. if (!isReadOnly) {
  8914. element.setAttribute('readonly', '');
  8915. }
  8916. element.select();
  8917. element.setSelectionRange(0, element.value.length);
  8918. if (!isReadOnly) {
  8919. element.removeAttribute('readonly');
  8920. }
  8921. selectedText = element.value;
  8922. }
  8923. else {
  8924. if (element.hasAttribute('contenteditable')) {
  8925. element.focus();
  8926. }
  8927. var selection = window.getSelection();
  8928. var range = document.createRange();
  8929. range.selectNodeContents(element);
  8930. selection.removeAllRanges();
  8931. selection.addRange(range);
  8932. selectedText = selection.toString();
  8933. }
  8934. return selectedText;
  8935. }
  8936. module.exports = select;
  8937. /***/ }),
  8938. /* 3 */
  8939. /***/ (function(module, exports) {
  8940. function E () {
  8941. // Keep this empty so it's easier to inherit from
  8942. // (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
  8943. }
  8944. E.prototype = {
  8945. on: function (name, callback, ctx) {
  8946. var e = this.e || (this.e = {});
  8947. (e[name] || (e[name] = [])).push({
  8948. fn: callback,
  8949. ctx: ctx
  8950. });
  8951. return this;
  8952. },
  8953. once: function (name, callback, ctx) {
  8954. var self = this;
  8955. function listener () {
  8956. self.off(name, listener);
  8957. callback.apply(ctx, arguments);
  8958. };
  8959. listener._ = callback
  8960. return this.on(name, listener, ctx);
  8961. },
  8962. emit: function (name) {
  8963. var data = [].slice.call(arguments, 1);
  8964. var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
  8965. var i = 0;
  8966. var len = evtArr.length;
  8967. for (i; i < len; i++) {
  8968. evtArr[i].fn.apply(evtArr[i].ctx, data);
  8969. }
  8970. return this;
  8971. },
  8972. off: function (name, callback) {
  8973. var e = this.e || (this.e = {});
  8974. var evts = e[name];
  8975. var liveEvents = [];
  8976. if (evts && callback) {
  8977. for (var i = 0, len = evts.length; i < len; i++) {
  8978. if (evts[i].fn !== callback && evts[i].fn._ !== callback)
  8979. liveEvents.push(evts[i]);
  8980. }
  8981. }
  8982. // Remove event from queue to prevent memory leak
  8983. // Suggested by https://github.com/lazd
  8984. // Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
  8985. (liveEvents.length)
  8986. ? e[name] = liveEvents
  8987. : delete e[name];
  8988. return this;
  8989. }
  8990. };
  8991. module.exports = E;
  8992. /***/ }),
  8993. /* 4 */
  8994. /***/ (function(module, exports, __webpack_require__) {
  8995. var is = __webpack_require__(5);
  8996. var delegate = __webpack_require__(6);
  8997. /**
  8998. * Validates all params and calls the right
  8999. * listener function based on its target type.
  9000. *
  9001. * @param {String|HTMLElement|HTMLCollection|NodeList} target
  9002. * @param {String} type
  9003. * @param {Function} callback
  9004. * @return {Object}
  9005. */
  9006. function listen(target, type, callback) {
  9007. if (!target && !type && !callback) {
  9008. throw new Error('Missing required arguments');
  9009. }
  9010. if (!is.string(type)) {
  9011. throw new TypeError('Second argument must be a String');
  9012. }
  9013. if (!is.fn(callback)) {
  9014. throw new TypeError('Third argument must be a Function');
  9015. }
  9016. if (is.node(target)) {
  9017. return listenNode(target, type, callback);
  9018. }
  9019. else if (is.nodeList(target)) {
  9020. return listenNodeList(target, type, callback);
  9021. }
  9022. else if (is.string(target)) {
  9023. return listenSelector(target, type, callback);
  9024. }
  9025. else {
  9026. throw new TypeError('First argument must be a String, HTMLElement, HTMLCollection, or NodeList');
  9027. }
  9028. }
  9029. /**
  9030. * Adds an event listener to a HTML element
  9031. * and returns a remove listener function.
  9032. *
  9033. * @param {HTMLElement} node
  9034. * @param {String} type
  9035. * @param {Function} callback
  9036. * @return {Object}
  9037. */
  9038. function listenNode(node, type, callback) {
  9039. node.addEventListener(type, callback);
  9040. return {
  9041. destroy: function() {
  9042. node.removeEventListener(type, callback);
  9043. }
  9044. }
  9045. }
  9046. /**
  9047. * Add an event listener to a list of HTML elements
  9048. * and returns a remove listener function.
  9049. *
  9050. * @param {NodeList|HTMLCollection} nodeList
  9051. * @param {String} type
  9052. * @param {Function} callback
  9053. * @return {Object}
  9054. */
  9055. function listenNodeList(nodeList, type, callback) {
  9056. Array.prototype.forEach.call(nodeList, function(node) {
  9057. node.addEventListener(type, callback);
  9058. });
  9059. return {
  9060. destroy: function() {
  9061. Array.prototype.forEach.call(nodeList, function(node) {
  9062. node.removeEventListener(type, callback);
  9063. });
  9064. }
  9065. }
  9066. }
  9067. /**
  9068. * Add an event listener to a selector
  9069. * and returns a remove listener function.
  9070. *
  9071. * @param {String} selector
  9072. * @param {String} type
  9073. * @param {Function} callback
  9074. * @return {Object}
  9075. */
  9076. function listenSelector(selector, type, callback) {
  9077. return delegate(document.body, selector, type, callback);
  9078. }
  9079. module.exports = listen;
  9080. /***/ }),
  9081. /* 5 */
  9082. /***/ (function(module, exports) {
  9083. /**
  9084. * Check if argument is a HTML element.
  9085. *
  9086. * @param {Object} value
  9087. * @return {Boolean}
  9088. */
  9089. exports.node = function(value) {
  9090. return value !== undefined
  9091. && value instanceof HTMLElement
  9092. && value.nodeType === 1;
  9093. };
  9094. /**
  9095. * Check if argument is a list of HTML elements.
  9096. *
  9097. * @param {Object} value
  9098. * @return {Boolean}
  9099. */
  9100. exports.nodeList = function(value) {
  9101. var type = Object.prototype.toString.call(value);
  9102. return value !== undefined
  9103. && (type === '[object NodeList]' || type === '[object HTMLCollection]')
  9104. && ('length' in value)
  9105. && (value.length === 0 || exports.node(value[0]));
  9106. };
  9107. /**
  9108. * Check if argument is a string.
  9109. *
  9110. * @param {Object} value
  9111. * @return {Boolean}
  9112. */
  9113. exports.string = function(value) {
  9114. return typeof value === 'string'
  9115. || value instanceof String;
  9116. };
  9117. /**
  9118. * Check if argument is a function.
  9119. *
  9120. * @param {Object} value
  9121. * @return {Boolean}
  9122. */
  9123. exports.fn = function(value) {
  9124. var type = Object.prototype.toString.call(value);
  9125. return type === '[object Function]';
  9126. };
  9127. /***/ }),
  9128. /* 6 */
  9129. /***/ (function(module, exports, __webpack_require__) {
  9130. var closest = __webpack_require__(7);
  9131. /**
  9132. * Delegates event to a selector.
  9133. *
  9134. * @param {Element} element
  9135. * @param {String} selector
  9136. * @param {String} type
  9137. * @param {Function} callback
  9138. * @param {Boolean} useCapture
  9139. * @return {Object}
  9140. */
  9141. function _delegate(element, selector, type, callback, useCapture) {
  9142. var listenerFn = listener.apply(this, arguments);
  9143. element.addEventListener(type, listenerFn, useCapture);
  9144. return {
  9145. destroy: function() {
  9146. element.removeEventListener(type, listenerFn, useCapture);
  9147. }
  9148. }
  9149. }
  9150. /**
  9151. * Delegates event to a selector.
  9152. *
  9153. * @param {Element|String|Array} [elements]
  9154. * @param {String} selector
  9155. * @param {String} type
  9156. * @param {Function} callback
  9157. * @param {Boolean} useCapture
  9158. * @return {Object}
  9159. */
  9160. function delegate(elements, selector, type, callback, useCapture) {
  9161. // Handle the regular Element usage
  9162. if (typeof elements.addEventListener === 'function') {
  9163. return _delegate.apply(null, arguments);
  9164. }
  9165. // Handle Element-less usage, it defaults to global delegation
  9166. if (typeof type === 'function') {
  9167. // Use `document` as the first parameter, then apply arguments
  9168. // This is a short way to .unshift `arguments` without running into deoptimizations
  9169. return _delegate.bind(null, document).apply(null, arguments);
  9170. }
  9171. // Handle Selector-based usage
  9172. if (typeof elements === 'string') {
  9173. elements = document.querySelectorAll(elements);
  9174. }
  9175. // Handle Array-like based usage
  9176. return Array.prototype.map.call(elements, function (element) {
  9177. return _delegate(element, selector, type, callback, useCapture);
  9178. });
  9179. }
  9180. /**
  9181. * Finds closest match and invokes callback.
  9182. *
  9183. * @param {Element} element
  9184. * @param {String} selector
  9185. * @param {String} type
  9186. * @param {Function} callback
  9187. * @return {Function}
  9188. */
  9189. function listener(element, selector, type, callback) {
  9190. return function(e) {
  9191. e.delegateTarget = closest(e.target, selector);
  9192. if (e.delegateTarget) {
  9193. callback.call(element, e);
  9194. }
  9195. }
  9196. }
  9197. module.exports = delegate;
  9198. /***/ }),
  9199. /* 7 */
  9200. /***/ (function(module, exports) {
  9201. var DOCUMENT_NODE_TYPE = 9;
  9202. /**
  9203. * A polyfill for Element.matches()
  9204. */
  9205. if (typeof Element !== 'undefined' && !Element.prototype.matches) {
  9206. var proto = Element.prototype;
  9207. proto.matches = proto.matchesSelector ||
  9208. proto.mozMatchesSelector ||
  9209. proto.msMatchesSelector ||
  9210. proto.oMatchesSelector ||
  9211. proto.webkitMatchesSelector;
  9212. }
  9213. /**
  9214. * Finds the closest parent that matches a selector.
  9215. *
  9216. * @param {Element} element
  9217. * @param {String} selector
  9218. * @return {Function}
  9219. */
  9220. function closest (element, selector) {
  9221. while (element && element.nodeType !== DOCUMENT_NODE_TYPE) {
  9222. if (typeof element.matches === 'function' &&
  9223. element.matches(selector)) {
  9224. return element;
  9225. }
  9226. element = element.parentNode;
  9227. }
  9228. }
  9229. module.exports = closest;
  9230. /***/ })
  9231. /******/ ]);
  9232. });
  9233. /***/ }),
  9234. /***/ "./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&":
  9235. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************!*\
  9236. !*** ./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& ***!
  9237. \*******************************************************************************************************************************************************************************************************************************************************************************************************/
  9238. /*! no static exports found */
  9239. /***/ (function(module, exports, __webpack_require__) {
  9240. exports = module.exports = __webpack_require__(/*! ../../../node_modules/css-loader/lib/css-base.js */ "./node_modules/css-loader/lib/css-base.js")(false);
  9241. // imports
  9242. // module
  9243. 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", ""]);
  9244. // exports
  9245. /***/ }),
  9246. /***/ "./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&":
  9247. /*!********************************************************************************************************************************************************************************************************************************************************************************************!*\
  9248. !*** ./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& ***!
  9249. \********************************************************************************************************************************************************************************************************************************************************************************************/
  9250. /*! no static exports found */
  9251. /***/ (function(module, exports, __webpack_require__) {
  9252. exports = module.exports = __webpack_require__(/*! ../../../node_modules/css-loader/lib/css-base.js */ "./node_modules/css-loader/lib/css-base.js")(false);
  9253. // imports
  9254. // module
  9255. 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", ""]);
  9256. // exports
  9257. /***/ }),
  9258. /***/ "./node_modules/css-loader/lib/css-base.js":
  9259. /*!*************************************************!*\
  9260. !*** ./node_modules/css-loader/lib/css-base.js ***!
  9261. \*************************************************/
  9262. /*! no static exports found */
  9263. /***/ (function(module, exports) {
  9264. /*
  9265. MIT License http://www.opensource.org/licenses/mit-license.php
  9266. Author Tobias Koppers @sokra
  9267. */
  9268. // css base code, injected by the css-loader
  9269. module.exports = function(useSourceMap) {
  9270. var list = [];
  9271. // return the list of modules as css string
  9272. list.toString = function toString() {
  9273. return this.map(function (item) {
  9274. var content = cssWithMappingToString(item, useSourceMap);
  9275. if(item[2]) {
  9276. return "@media " + item[2] + "{" + content + "}";
  9277. } else {
  9278. return content;
  9279. }
  9280. }).join("");
  9281. };
  9282. // import a list of modules into the list
  9283. list.i = function(modules, mediaQuery) {
  9284. if(typeof modules === "string")
  9285. modules = [[null, modules, ""]];
  9286. var alreadyImportedModules = {};
  9287. for(var i = 0; i < this.length; i++) {
  9288. var id = this[i][0];
  9289. if(typeof id === "number")
  9290. alreadyImportedModules[id] = true;
  9291. }
  9292. for(i = 0; i < modules.length; i++) {
  9293. var item = modules[i];
  9294. // skip already imported module
  9295. // this implementation is not 100% perfect for weird media query combinations
  9296. // when a module is imported multiple times with different media queries.
  9297. // I hope this will never occur (Hey this way we have smaller bundles)
  9298. if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) {
  9299. if(mediaQuery && !item[2]) {
  9300. item[2] = mediaQuery;
  9301. } else if(mediaQuery) {
  9302. item[2] = "(" + item[2] + ") and (" + mediaQuery + ")";
  9303. }
  9304. list.push(item);
  9305. }
  9306. }
  9307. };
  9308. return list;
  9309. };
  9310. function cssWithMappingToString(item, useSourceMap) {
  9311. var content = item[1] || '';
  9312. var cssMapping = item[3];
  9313. if (!cssMapping) {
  9314. return content;
  9315. }
  9316. if (useSourceMap && typeof btoa === 'function') {
  9317. var sourceMapping = toComment(cssMapping);
  9318. var sourceURLs = cssMapping.sources.map(function (source) {
  9319. return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'
  9320. });
  9321. return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
  9322. }
  9323. return [content].join('\n');
  9324. }
  9325. // Adapted from convert-source-map (MIT)
  9326. function toComment(sourceMap) {
  9327. // eslint-disable-next-line no-undef
  9328. var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
  9329. var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;
  9330. return '/*# ' + data + ' */';
  9331. }
  9332. /***/ }),
  9333. /***/ "./node_modules/ieee754/index.js":
  9334. /*!***************************************!*\
  9335. !*** ./node_modules/ieee754/index.js ***!
  9336. \***************************************/
  9337. /*! no static exports found */
  9338. /***/ (function(module, exports) {
  9339. exports.read = function (buffer, offset, isLE, mLen, nBytes) {
  9340. var e, m
  9341. var eLen = (nBytes * 8) - mLen - 1
  9342. var eMax = (1 << eLen) - 1
  9343. var eBias = eMax >> 1
  9344. var nBits = -7
  9345. var i = isLE ? (nBytes - 1) : 0
  9346. var d = isLE ? -1 : 1
  9347. var s = buffer[offset + i]
  9348. i += d
  9349. e = s & ((1 << (-nBits)) - 1)
  9350. s >>= (-nBits)
  9351. nBits += eLen
  9352. for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}
  9353. m = e & ((1 << (-nBits)) - 1)
  9354. e >>= (-nBits)
  9355. nBits += mLen
  9356. for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}
  9357. if (e === 0) {
  9358. e = 1 - eBias
  9359. } else if (e === eMax) {
  9360. return m ? NaN : ((s ? -1 : 1) * Infinity)
  9361. } else {
  9362. m = m + Math.pow(2, mLen)
  9363. e = e - eBias
  9364. }
  9365. return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
  9366. }
  9367. exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
  9368. var e, m, c
  9369. var eLen = (nBytes * 8) - mLen - 1
  9370. var eMax = (1 << eLen) - 1
  9371. var eBias = eMax >> 1
  9372. var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
  9373. var i = isLE ? 0 : (nBytes - 1)
  9374. var d = isLE ? 1 : -1
  9375. var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
  9376. value = Math.abs(value)
  9377. if (isNaN(value) || value === Infinity) {
  9378. m = isNaN(value) ? 1 : 0
  9379. e = eMax
  9380. } else {
  9381. e = Math.floor(Math.log(value) / Math.LN2)
  9382. if (value * (c = Math.pow(2, -e)) < 1) {
  9383. e--
  9384. c *= 2
  9385. }
  9386. if (e + eBias >= 1) {
  9387. value += rt / c
  9388. } else {
  9389. value += rt * Math.pow(2, 1 - eBias)
  9390. }
  9391. if (value * c >= 2) {
  9392. e++
  9393. c /= 2
  9394. }
  9395. if (e + eBias >= eMax) {
  9396. m = 0
  9397. e = eMax
  9398. } else if (e + eBias >= 1) {
  9399. m = ((value * c) - 1) * Math.pow(2, mLen)
  9400. e = e + eBias
  9401. } else {
  9402. m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
  9403. e = 0
  9404. }
  9405. }
  9406. for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
  9407. e = (e << mLen) | m
  9408. eLen += mLen
  9409. for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
  9410. buffer[offset + i - d] |= s * 128
  9411. }
  9412. /***/ }),
  9413. /***/ "./node_modules/isarray/index.js":
  9414. /*!***************************************!*\
  9415. !*** ./node_modules/isarray/index.js ***!
  9416. \***************************************/
  9417. /*! no static exports found */
  9418. /***/ (function(module, exports) {
  9419. var toString = {}.toString;
  9420. module.exports = Array.isArray || function (arr) {
  9421. return toString.call(arr) == '[object Array]';
  9422. };
  9423. /***/ }),
  9424. /***/ "./node_modules/jquery/dist/jquery.js":
  9425. /*!********************************************!*\
  9426. !*** ./node_modules/jquery/dist/jquery.js ***!
  9427. \********************************************/
  9428. /*! no static exports found */
  9429. /***/ (function(module, exports, __webpack_require__) {
  9430. var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
  9431. * jQuery JavaScript Library v3.4.1
  9432. * https://jquery.com/
  9433. *
  9434. * Includes Sizzle.js
  9435. * https://sizzlejs.com/
  9436. *
  9437. * Copyright JS Foundation and other contributors
  9438. * Released under the MIT license
  9439. * https://jquery.org/license
  9440. *
  9441. * Date: 2019-05-01T21:04Z
  9442. */
  9443. ( function( global, factory ) {
  9444. "use strict";
  9445. if ( true && typeof module.exports === "object" ) {
  9446. // For CommonJS and CommonJS-like environments where a proper `window`
  9447. // is present, execute the factory and get jQuery.
  9448. // For environments that do not have a `window` with a `document`
  9449. // (such as Node.js), expose a factory as module.exports.
  9450. // This accentuates the need for the creation of a real `window`.
  9451. // e.g. var jQuery = require("jquery")(window);
  9452. // See ticket #14549 for more info.
  9453. module.exports = global.document ?
  9454. factory( global, true ) :
  9455. function( w ) {
  9456. if ( !w.document ) {
  9457. throw new Error( "jQuery requires a window with a document" );
  9458. }
  9459. return factory( w );
  9460. };
  9461. } else {
  9462. factory( global );
  9463. }
  9464. // Pass this if window is not defined yet
  9465. } )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
  9466. // Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1
  9467. // throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode
  9468. // arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common
  9469. // enough that all such attempts are guarded in a try block.
  9470. "use strict";
  9471. var arr = [];
  9472. var document = window.document;
  9473. var getProto = Object.getPrototypeOf;
  9474. var slice = arr.slice;
  9475. var concat = arr.concat;
  9476. var push = arr.push;
  9477. var indexOf = arr.indexOf;
  9478. var class2type = {};
  9479. var toString = class2type.toString;
  9480. var hasOwn = class2type.hasOwnProperty;
  9481. var fnToString = hasOwn.toString;
  9482. var ObjectFunctionString = fnToString.call( Object );
  9483. var support = {};
  9484. var isFunction = function isFunction( obj ) {
  9485. // Support: Chrome <=57, Firefox <=52
  9486. // In some browsers, typeof returns "function" for HTML <object> elements
  9487. // (i.e., `typeof document.createElement( "object" ) === "function"`).
  9488. // We don't want to classify *any* DOM node as a function.
  9489. return typeof obj === "function" && typeof obj.nodeType !== "number";
  9490. };
  9491. var isWindow = function isWindow( obj ) {
  9492. return obj != null && obj === obj.window;
  9493. };
  9494. var preservedScriptAttributes = {
  9495. type: true,
  9496. src: true,
  9497. nonce: true,
  9498. noModule: true
  9499. };
  9500. function DOMEval( code, node, doc ) {
  9501. doc = doc || document;
  9502. var i, val,
  9503. script = doc.createElement( "script" );
  9504. script.text = code;
  9505. if ( node ) {
  9506. for ( i in preservedScriptAttributes ) {
  9507. // Support: Firefox 64+, Edge 18+
  9508. // Some browsers don't support the "nonce" property on scripts.
  9509. // On the other hand, just using `getAttribute` is not enough as
  9510. // the `nonce` attribute is reset to an empty string whenever it
  9511. // becomes browsing-context connected.
  9512. // See https://github.com/whatwg/html/issues/2369
  9513. // See https://html.spec.whatwg.org/#nonce-attributes
  9514. // The `node.getAttribute` check was added for the sake of
  9515. // `jQuery.globalEval` so that it can fake a nonce-containing node
  9516. // via an object.
  9517. val = node[ i ] || node.getAttribute && node.getAttribute( i );
  9518. if ( val ) {
  9519. script.setAttribute( i, val );
  9520. }
  9521. }
  9522. }
  9523. doc.head.appendChild( script ).parentNode.removeChild( script );
  9524. }
  9525. function toType( obj ) {
  9526. if ( obj == null ) {
  9527. return obj + "";
  9528. }
  9529. // Support: Android <=2.3 only (functionish RegExp)
  9530. return typeof obj === "object" || typeof obj === "function" ?
  9531. class2type[ toString.call( obj ) ] || "object" :
  9532. typeof obj;
  9533. }
  9534. /* global Symbol */
  9535. // Defining this global in .eslintrc.json would create a danger of using the global
  9536. // unguarded in another place, it seems safer to define global only for this module
  9537. var
  9538. version = "3.4.1",
  9539. // Define a local copy of jQuery
  9540. jQuery = function( selector, context ) {
  9541. // The jQuery object is actually just the init constructor 'enhanced'
  9542. // Need init if jQuery is called (just allow error to be thrown if not included)
  9543. return new jQuery.fn.init( selector, context );
  9544. },
  9545. // Support: Android <=4.0 only
  9546. // Make sure we trim BOM and NBSP
  9547. rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
  9548. jQuery.fn = jQuery.prototype = {
  9549. // The current version of jQuery being used
  9550. jquery: version,
  9551. constructor: jQuery,
  9552. // The default length of a jQuery object is 0
  9553. length: 0,
  9554. toArray: function() {
  9555. return slice.call( this );
  9556. },
  9557. // Get the Nth element in the matched element set OR
  9558. // Get the whole matched element set as a clean array
  9559. get: function( num ) {
  9560. // Return all the elements in a clean array
  9561. if ( num == null ) {
  9562. return slice.call( this );
  9563. }
  9564. // Return just the one element from the set
  9565. return num < 0 ? this[ num + this.length ] : this[ num ];
  9566. },
  9567. // Take an array of elements and push it onto the stack
  9568. // (returning the new matched element set)
  9569. pushStack: function( elems ) {
  9570. // Build a new jQuery matched element set
  9571. var ret = jQuery.merge( this.constructor(), elems );
  9572. // Add the old object onto the stack (as a reference)
  9573. ret.prevObject = this;
  9574. // Return the newly-formed element set
  9575. return ret;
  9576. },
  9577. // Execute a callback for every element in the matched set.
  9578. each: function( callback ) {
  9579. return jQuery.each( this, callback );
  9580. },
  9581. map: function( callback ) {
  9582. return this.pushStack( jQuery.map( this, function( elem, i ) {
  9583. return callback.call( elem, i, elem );
  9584. } ) );
  9585. },
  9586. slice: function() {
  9587. return this.pushStack( slice.apply( this, arguments ) );
  9588. },
  9589. first: function() {
  9590. return this.eq( 0 );
  9591. },
  9592. last: function() {
  9593. return this.eq( -1 );
  9594. },
  9595. eq: function( i ) {
  9596. var len = this.length,
  9597. j = +i + ( i < 0 ? len : 0 );
  9598. return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
  9599. },
  9600. end: function() {
  9601. return this.prevObject || this.constructor();
  9602. },
  9603. // For internal use only.
  9604. // Behaves like an Array's method, not like a jQuery method.
  9605. push: push,
  9606. sort: arr.sort,
  9607. splice: arr.splice
  9608. };
  9609. jQuery.extend = jQuery.fn.extend = function() {
  9610. var options, name, src, copy, copyIsArray, clone,
  9611. target = arguments[ 0 ] || {},
  9612. i = 1,
  9613. length = arguments.length,
  9614. deep = false;
  9615. // Handle a deep copy situation
  9616. if ( typeof target === "boolean" ) {
  9617. deep = target;
  9618. // Skip the boolean and the target
  9619. target = arguments[ i ] || {};
  9620. i++;
  9621. }
  9622. // Handle case when target is a string or something (possible in deep copy)
  9623. if ( typeof target !== "object" && !isFunction( target ) ) {
  9624. target = {};
  9625. }
  9626. // Extend jQuery itself if only one argument is passed
  9627. if ( i === length ) {
  9628. target = this;
  9629. i--;
  9630. }
  9631. for ( ; i < length; i++ ) {
  9632. // Only deal with non-null/undefined values
  9633. if ( ( options = arguments[ i ] ) != null ) {
  9634. // Extend the base object
  9635. for ( name in options ) {
  9636. copy = options[ name ];
  9637. // Prevent Object.prototype pollution
  9638. // Prevent never-ending loop
  9639. if ( name === "__proto__" || target === copy ) {
  9640. continue;
  9641. }
  9642. // Recurse if we're merging plain objects or arrays
  9643. if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
  9644. ( copyIsArray = Array.isArray( copy ) ) ) ) {
  9645. src = target[ name ];
  9646. // Ensure proper type for the source value
  9647. if ( copyIsArray && !Array.isArray( src ) ) {
  9648. clone = [];
  9649. } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) {
  9650. clone = {};
  9651. } else {
  9652. clone = src;
  9653. }
  9654. copyIsArray = false;
  9655. // Never move original objects, clone them
  9656. target[ name ] = jQuery.extend( deep, clone, copy );
  9657. // Don't bring in undefined values
  9658. } else if ( copy !== undefined ) {
  9659. target[ name ] = copy;
  9660. }
  9661. }
  9662. }
  9663. }
  9664. // Return the modified object
  9665. return target;
  9666. };
  9667. jQuery.extend( {
  9668. // Unique for each copy of jQuery on the page
  9669. expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
  9670. // Assume jQuery is ready without the ready module
  9671. isReady: true,
  9672. error: function( msg ) {
  9673. throw new Error( msg );
  9674. },
  9675. noop: function() {},
  9676. isPlainObject: function( obj ) {
  9677. var proto, Ctor;
  9678. // Detect obvious negatives
  9679. // Use toString instead of jQuery.type to catch host objects
  9680. if ( !obj || toString.call( obj ) !== "[object Object]" ) {
  9681. return false;
  9682. }
  9683. proto = getProto( obj );
  9684. // Objects with no prototype (e.g., `Object.create( null )`) are plain
  9685. if ( !proto ) {
  9686. return true;
  9687. }
  9688. // Objects with prototype are plain iff they were constructed by a global Object function
  9689. Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor;
  9690. return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString;
  9691. },
  9692. isEmptyObject: function( obj ) {
  9693. var name;
  9694. for ( name in obj ) {
  9695. return false;
  9696. }
  9697. return true;
  9698. },
  9699. // Evaluates a script in a global context
  9700. globalEval: function( code, options ) {
  9701. DOMEval( code, { nonce: options && options.nonce } );
  9702. },
  9703. each: function( obj, callback ) {
  9704. var length, i = 0;
  9705. if ( isArrayLike( obj ) ) {
  9706. length = obj.length;
  9707. for ( ; i < length; i++ ) {
  9708. if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
  9709. break;
  9710. }
  9711. }
  9712. } else {
  9713. for ( i in obj ) {
  9714. if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
  9715. break;
  9716. }
  9717. }
  9718. }
  9719. return obj;
  9720. },
  9721. // Support: Android <=4.0 only
  9722. trim: function( text ) {
  9723. return text == null ?
  9724. "" :
  9725. ( text + "" ).replace( rtrim, "" );
  9726. },
  9727. // results is for internal usage only
  9728. makeArray: function( arr, results ) {
  9729. var ret = results || [];
  9730. if ( arr != null ) {
  9731. if ( isArrayLike( Object( arr ) ) ) {
  9732. jQuery.merge( ret,
  9733. typeof arr === "string" ?
  9734. [ arr ] : arr
  9735. );
  9736. } else {
  9737. push.call( ret, arr );
  9738. }
  9739. }
  9740. return ret;
  9741. },
  9742. inArray: function( elem, arr, i ) {
  9743. return arr == null ? -1 : indexOf.call( arr, elem, i );
  9744. },
  9745. // Support: Android <=4.0 only, PhantomJS 1 only
  9746. // push.apply(_, arraylike) throws on ancient WebKit
  9747. merge: function( first, second ) {
  9748. var len = +second.length,
  9749. j = 0,
  9750. i = first.length;
  9751. for ( ; j < len; j++ ) {
  9752. first[ i++ ] = second[ j ];
  9753. }
  9754. first.length = i;
  9755. return first;
  9756. },
  9757. grep: function( elems, callback, invert ) {
  9758. var callbackInverse,
  9759. matches = [],
  9760. i = 0,
  9761. length = elems.length,
  9762. callbackExpect = !invert;
  9763. // Go through the array, only saving the items
  9764. // that pass the validator function
  9765. for ( ; i < length; i++ ) {
  9766. callbackInverse = !callback( elems[ i ], i );
  9767. if ( callbackInverse !== callbackExpect ) {
  9768. matches.push( elems[ i ] );
  9769. }
  9770. }
  9771. return matches;
  9772. },
  9773. // arg is for internal usage only
  9774. map: function( elems, callback, arg ) {
  9775. var length, value,
  9776. i = 0,
  9777. ret = [];
  9778. // Go through the array, translating each of the items to their new values
  9779. if ( isArrayLike( elems ) ) {
  9780. length = elems.length;
  9781. for ( ; i < length; i++ ) {
  9782. value = callback( elems[ i ], i, arg );
  9783. if ( value != null ) {
  9784. ret.push( value );
  9785. }
  9786. }
  9787. // Go through every key on the object,
  9788. } else {
  9789. for ( i in elems ) {
  9790. value = callback( elems[ i ], i, arg );
  9791. if ( value != null ) {
  9792. ret.push( value );
  9793. }
  9794. }
  9795. }
  9796. // Flatten any nested arrays
  9797. return concat.apply( [], ret );
  9798. },
  9799. // A global GUID counter for objects
  9800. guid: 1,
  9801. // jQuery.support is not used in Core but other projects attach their
  9802. // properties to it so it needs to exist.
  9803. support: support
  9804. } );
  9805. if ( typeof Symbol === "function" ) {
  9806. jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
  9807. }
  9808. // Populate the class2type map
  9809. jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
  9810. function( i, name ) {
  9811. class2type[ "[object " + name + "]" ] = name.toLowerCase();
  9812. } );
  9813. function isArrayLike( obj ) {
  9814. // Support: real iOS 8.2 only (not reproducible in simulator)
  9815. // `in` check used to prevent JIT error (gh-2145)
  9816. // hasOwn isn't used here due to false negatives
  9817. // regarding Nodelist length in IE
  9818. var length = !!obj && "length" in obj && obj.length,
  9819. type = toType( obj );
  9820. if ( isFunction( obj ) || isWindow( obj ) ) {
  9821. return false;
  9822. }
  9823. return type === "array" || length === 0 ||
  9824. typeof length === "number" && length > 0 && ( length - 1 ) in obj;
  9825. }
  9826. var Sizzle =
  9827. /*!
  9828. * Sizzle CSS Selector Engine v2.3.4
  9829. * https://sizzlejs.com/
  9830. *
  9831. * Copyright JS Foundation and other contributors
  9832. * Released under the MIT license
  9833. * https://js.foundation/
  9834. *
  9835. * Date: 2019-04-08
  9836. */
  9837. (function( window ) {
  9838. var i,
  9839. support,
  9840. Expr,
  9841. getText,
  9842. isXML,
  9843. tokenize,
  9844. compile,
  9845. select,
  9846. outermostContext,
  9847. sortInput,
  9848. hasDuplicate,
  9849. // Local document vars
  9850. setDocument,
  9851. document,
  9852. docElem,
  9853. documentIsHTML,
  9854. rbuggyQSA,
  9855. rbuggyMatches,
  9856. matches,
  9857. contains,
  9858. // Instance-specific data
  9859. expando = "sizzle" + 1 * new Date(),
  9860. preferredDoc = window.document,
  9861. dirruns = 0,
  9862. done = 0,
  9863. classCache = createCache(),
  9864. tokenCache = createCache(),
  9865. compilerCache = createCache(),
  9866. nonnativeSelectorCache = createCache(),
  9867. sortOrder = function( a, b ) {
  9868. if ( a === b ) {
  9869. hasDuplicate = true;
  9870. }
  9871. return 0;
  9872. },
  9873. // Instance methods
  9874. hasOwn = ({}).hasOwnProperty,
  9875. arr = [],
  9876. pop = arr.pop,
  9877. push_native = arr.push,
  9878. push = arr.push,
  9879. slice = arr.slice,
  9880. // Use a stripped-down indexOf as it's faster than native
  9881. // https://jsperf.com/thor-indexof-vs-for/5
  9882. indexOf = function( list, elem ) {
  9883. var i = 0,
  9884. len = list.length;
  9885. for ( ; i < len; i++ ) {
  9886. if ( list[i] === elem ) {
  9887. return i;
  9888. }
  9889. }
  9890. return -1;
  9891. },
  9892. booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
  9893. // Regular expressions
  9894. // http://www.w3.org/TR/css3-selectors/#whitespace
  9895. whitespace = "[\\x20\\t\\r\\n\\f]",
  9896. // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
  9897. identifier = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+",
  9898. // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
  9899. attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
  9900. // Operator (capture 2)
  9901. "*([*^$|!~]?=)" + whitespace +
  9902. // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
  9903. "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
  9904. "*\\]",
  9905. pseudos = ":(" + identifier + ")(?:\\((" +
  9906. // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
  9907. // 1. quoted (capture 3; capture 4 or capture 5)
  9908. "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
  9909. // 2. simple (capture 6)
  9910. "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
  9911. // 3. anything else (capture 2)
  9912. ".*" +
  9913. ")\\)|)",
  9914. // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
  9915. rwhitespace = new RegExp( whitespace + "+", "g" ),
  9916. rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
  9917. rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
  9918. rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
  9919. rdescend = new RegExp( whitespace + "|>" ),
  9920. rpseudo = new RegExp( pseudos ),
  9921. ridentifier = new RegExp( "^" + identifier + "$" ),
  9922. matchExpr = {
  9923. "ID": new RegExp( "^#(" + identifier + ")" ),
  9924. "CLASS": new RegExp( "^\\.(" + identifier + ")" ),
  9925. "TAG": new RegExp( "^(" + identifier + "|[*])" ),
  9926. "ATTR": new RegExp( "^" + attributes ),
  9927. "PSEUDO": new RegExp( "^" + pseudos ),
  9928. "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
  9929. "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
  9930. "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
  9931. "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
  9932. // For use in libraries implementing .is()
  9933. // We use this for POS matching in `select`
  9934. "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
  9935. whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
  9936. },
  9937. rhtml = /HTML$/i,
  9938. rinputs = /^(?:input|select|textarea|button)$/i,
  9939. rheader = /^h\d$/i,
  9940. rnative = /^[^{]+\{\s*\[native \w/,
  9941. // Easily-parseable/retrievable ID or TAG or CLASS selectors
  9942. rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
  9943. rsibling = /[+~]/,
  9944. // CSS escapes
  9945. // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
  9946. runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
  9947. funescape = function( _, escaped, escapedWhitespace ) {
  9948. var high = "0x" + escaped - 0x10000;
  9949. // NaN means non-codepoint
  9950. // Support: Firefox<24
  9951. // Workaround erroneous numeric interpretation of +"0x"
  9952. return high !== high || escapedWhitespace ?
  9953. escaped :
  9954. high < 0 ?
  9955. // BMP codepoint
  9956. String.fromCharCode( high + 0x10000 ) :
  9957. // Supplemental Plane codepoint (surrogate pair)
  9958. String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
  9959. },
  9960. // CSS string/identifier serialization
  9961. // https://drafts.csswg.org/cssom/#common-serializing-idioms
  9962. rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,
  9963. fcssescape = function( ch, asCodePoint ) {
  9964. if ( asCodePoint ) {
  9965. // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
  9966. if ( ch === "\0" ) {
  9967. return "\uFFFD";
  9968. }
  9969. // Control characters and (dependent upon position) numbers get escaped as code points
  9970. return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
  9971. }
  9972. // Other potentially-special ASCII characters get backslash-escaped
  9973. return "\\" + ch;
  9974. },
  9975. // Used for iframes
  9976. // See setDocument()
  9977. // Removing the function wrapper causes a "Permission Denied"
  9978. // error in IE
  9979. unloadHandler = function() {
  9980. setDocument();
  9981. },
  9982. inDisabledFieldset = addCombinator(
  9983. function( elem ) {
  9984. return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset";
  9985. },
  9986. { dir: "parentNode", next: "legend" }
  9987. );
  9988. // Optimize for push.apply( _, NodeList )
  9989. try {
  9990. push.apply(
  9991. (arr = slice.call( preferredDoc.childNodes )),
  9992. preferredDoc.childNodes
  9993. );
  9994. // Support: Android<4.0
  9995. // Detect silently failing push.apply
  9996. arr[ preferredDoc.childNodes.length ].nodeType;
  9997. } catch ( e ) {
  9998. push = { apply: arr.length ?
  9999. // Leverage slice if possible
  10000. function( target, els ) {
  10001. push_native.apply( target, slice.call(els) );
  10002. } :
  10003. // Support: IE<9
  10004. // Otherwise append directly
  10005. function( target, els ) {
  10006. var j = target.length,
  10007. i = 0;
  10008. // Can't trust NodeList.length
  10009. while ( (target[j++] = els[i++]) ) {}
  10010. target.length = j - 1;
  10011. }
  10012. };
  10013. }
  10014. function Sizzle( selector, context, results, seed ) {
  10015. var m, i, elem, nid, match, groups, newSelector,
  10016. newContext = context && context.ownerDocument,
  10017. // nodeType defaults to 9, since context defaults to document
  10018. nodeType = context ? context.nodeType : 9;
  10019. results = results || [];
  10020. // Return early from calls with invalid selector or context
  10021. if ( typeof selector !== "string" || !selector ||
  10022. nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
  10023. return results;
  10024. }
  10025. // Try to shortcut find operations (as opposed to filters) in HTML documents
  10026. if ( !seed ) {
  10027. if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
  10028. setDocument( context );
  10029. }
  10030. context = context || document;
  10031. if ( documentIsHTML ) {
  10032. // If the selector is sufficiently simple, try using a "get*By*" DOM method
  10033. // (excepting DocumentFragment context, where the methods don't exist)
  10034. if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
  10035. // ID selector
  10036. if ( (m = match[1]) ) {
  10037. // Document context
  10038. if ( nodeType === 9 ) {
  10039. if ( (elem = context.getElementById( m )) ) {
  10040. // Support: IE, Opera, Webkit
  10041. // TODO: identify versions
  10042. // getElementById can match elements by name instead of ID
  10043. if ( elem.id === m ) {
  10044. results.push( elem );
  10045. return results;
  10046. }
  10047. } else {
  10048. return results;
  10049. }
  10050. // Element context
  10051. } else {
  10052. // Support: IE, Opera, Webkit
  10053. // TODO: identify versions
  10054. // getElementById can match elements by name instead of ID
  10055. if ( newContext && (elem = newContext.getElementById( m )) &&
  10056. contains( context, elem ) &&
  10057. elem.id === m ) {
  10058. results.push( elem );
  10059. return results;
  10060. }
  10061. }
  10062. // Type selector
  10063. } else if ( match[2] ) {
  10064. push.apply( results, context.getElementsByTagName( selector ) );
  10065. return results;
  10066. // Class selector
  10067. } else if ( (m = match[3]) && support.getElementsByClassName &&
  10068. context.getElementsByClassName ) {
  10069. push.apply( results, context.getElementsByClassName( m ) );
  10070. return results;
  10071. }
  10072. }
  10073. // Take advantage of querySelectorAll
  10074. if ( support.qsa &&
  10075. !nonnativeSelectorCache[ selector + " " ] &&
  10076. (!rbuggyQSA || !rbuggyQSA.test( selector )) &&
  10077. // Support: IE 8 only
  10078. // Exclude object elements
  10079. (nodeType !== 1 || context.nodeName.toLowerCase() !== "object") ) {
  10080. newSelector = selector;
  10081. newContext = context;
  10082. // qSA considers elements outside a scoping root when evaluating child or
  10083. // descendant combinators, which is not what we want.
  10084. // In such cases, we work around the behavior by prefixing every selector in the
  10085. // list with an ID selector referencing the scope context.
  10086. // Thanks to Andrew Dupont for this technique.
  10087. if ( nodeType === 1 && rdescend.test( selector ) ) {
  10088. // Capture the context ID, setting it first if necessary
  10089. if ( (nid = context.getAttribute( "id" )) ) {
  10090. nid = nid.replace( rcssescape, fcssescape );
  10091. } else {
  10092. context.setAttribute( "id", (nid = expando) );
  10093. }
  10094. // Prefix every selector in the list
  10095. groups = tokenize( selector );
  10096. i = groups.length;
  10097. while ( i-- ) {
  10098. groups[i] = "#" + nid + " " + toSelector( groups[i] );
  10099. }
  10100. newSelector = groups.join( "," );
  10101. // Expand context for sibling selectors
  10102. newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
  10103. context;
  10104. }
  10105. try {
  10106. push.apply( results,
  10107. newContext.querySelectorAll( newSelector )
  10108. );
  10109. return results;
  10110. } catch ( qsaError ) {
  10111. nonnativeSelectorCache( selector, true );
  10112. } finally {
  10113. if ( nid === expando ) {
  10114. context.removeAttribute( "id" );
  10115. }
  10116. }
  10117. }
  10118. }
  10119. }
  10120. // All others
  10121. return select( selector.replace( rtrim, "$1" ), context, results, seed );
  10122. }
  10123. /**
  10124. * Create key-value caches of limited size
  10125. * @returns {function(string, object)} Returns the Object data after storing it on itself with
  10126. * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
  10127. * deleting the oldest entry
  10128. */
  10129. function createCache() {
  10130. var keys = [];
  10131. function cache( key, value ) {
  10132. // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
  10133. if ( keys.push( key + " " ) > Expr.cacheLength ) {
  10134. // Only keep the most recent entries
  10135. delete cache[ keys.shift() ];
  10136. }
  10137. return (cache[ key + " " ] = value);
  10138. }
  10139. return cache;
  10140. }
  10141. /**
  10142. * Mark a function for special use by Sizzle
  10143. * @param {Function} fn The function to mark
  10144. */
  10145. function markFunction( fn ) {
  10146. fn[ expando ] = true;
  10147. return fn;
  10148. }
  10149. /**
  10150. * Support testing using an element
  10151. * @param {Function} fn Passed the created element and returns a boolean result
  10152. */
  10153. function assert( fn ) {
  10154. var el = document.createElement("fieldset");
  10155. try {
  10156. return !!fn( el );
  10157. } catch (e) {
  10158. return false;
  10159. } finally {
  10160. // Remove from its parent by default
  10161. if ( el.parentNode ) {
  10162. el.parentNode.removeChild( el );
  10163. }
  10164. // release memory in IE
  10165. el = null;
  10166. }
  10167. }
  10168. /**
  10169. * Adds the same handler for all of the specified attrs
  10170. * @param {String} attrs Pipe-separated list of attributes
  10171. * @param {Function} handler The method that will be applied
  10172. */
  10173. function addHandle( attrs, handler ) {
  10174. var arr = attrs.split("|"),
  10175. i = arr.length;
  10176. while ( i-- ) {
  10177. Expr.attrHandle[ arr[i] ] = handler;
  10178. }
  10179. }
  10180. /**
  10181. * Checks document order of two siblings
  10182. * @param {Element} a
  10183. * @param {Element} b
  10184. * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
  10185. */
  10186. function siblingCheck( a, b ) {
  10187. var cur = b && a,
  10188. diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
  10189. a.sourceIndex - b.sourceIndex;
  10190. // Use IE sourceIndex if available on both nodes
  10191. if ( diff ) {
  10192. return diff;
  10193. }
  10194. // Check if b follows a
  10195. if ( cur ) {
  10196. while ( (cur = cur.nextSibling) ) {
  10197. if ( cur === b ) {
  10198. return -1;
  10199. }
  10200. }
  10201. }
  10202. return a ? 1 : -1;
  10203. }
  10204. /**
  10205. * Returns a function to use in pseudos for input types
  10206. * @param {String} type
  10207. */
  10208. function createInputPseudo( type ) {
  10209. return function( elem ) {
  10210. var name = elem.nodeName.toLowerCase();
  10211. return name === "input" && elem.type === type;
  10212. };
  10213. }
  10214. /**
  10215. * Returns a function to use in pseudos for buttons
  10216. * @param {String} type
  10217. */
  10218. function createButtonPseudo( type ) {
  10219. return function( elem ) {
  10220. var name = elem.nodeName.toLowerCase();
  10221. return (name === "input" || name === "button") && elem.type === type;
  10222. };
  10223. }
  10224. /**
  10225. * Returns a function to use in pseudos for :enabled/:disabled
  10226. * @param {Boolean} disabled true for :disabled; false for :enabled
  10227. */
  10228. function createDisabledPseudo( disabled ) {
  10229. // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable
  10230. return function( elem ) {
  10231. // Only certain elements can match :enabled or :disabled
  10232. // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled
  10233. // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled
  10234. if ( "form" in elem ) {
  10235. // Check for inherited disabledness on relevant non-disabled elements:
  10236. // * listed form-associated elements in a disabled fieldset
  10237. // https://html.spec.whatwg.org/multipage/forms.html#category-listed
  10238. // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled
  10239. // * option elements in a disabled optgroup
  10240. // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled
  10241. // All such elements have a "form" property.
  10242. if ( elem.parentNode && elem.disabled === false ) {
  10243. // Option elements defer to a parent optgroup if present
  10244. if ( "label" in elem ) {
  10245. if ( "label" in elem.parentNode ) {
  10246. return elem.parentNode.disabled === disabled;
  10247. } else {
  10248. return elem.disabled === disabled;
  10249. }
  10250. }
  10251. // Support: IE 6 - 11
  10252. // Use the isDisabled shortcut property to check for disabled fieldset ancestors
  10253. return elem.isDisabled === disabled ||
  10254. // Where there is no isDisabled, check manually
  10255. /* jshint -W018 */
  10256. elem.isDisabled !== !disabled &&
  10257. inDisabledFieldset( elem ) === disabled;
  10258. }
  10259. return elem.disabled === disabled;
  10260. // Try to winnow out elements that can't be disabled before trusting the disabled property.
  10261. // Some victims get caught in our net (label, legend, menu, track), but it shouldn't
  10262. // even exist on them, let alone have a boolean value.
  10263. } else if ( "label" in elem ) {
  10264. return elem.disabled === disabled;
  10265. }
  10266. // Remaining elements are neither :enabled nor :disabled
  10267. return false;
  10268. };
  10269. }
  10270. /**
  10271. * Returns a function to use in pseudos for positionals
  10272. * @param {Function} fn
  10273. */
  10274. function createPositionalPseudo( fn ) {
  10275. return markFunction(function( argument ) {
  10276. argument = +argument;
  10277. return markFunction(function( seed, matches ) {
  10278. var j,
  10279. matchIndexes = fn( [], seed.length, argument ),
  10280. i = matchIndexes.length;
  10281. // Match elements found at the specified indexes
  10282. while ( i-- ) {
  10283. if ( seed[ (j = matchIndexes[i]) ] ) {
  10284. seed[j] = !(matches[j] = seed[j]);
  10285. }
  10286. }
  10287. });
  10288. });
  10289. }
  10290. /**
  10291. * Checks a node for validity as a Sizzle context
  10292. * @param {Element|Object=} context
  10293. * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
  10294. */
  10295. function testContext( context ) {
  10296. return context && typeof context.getElementsByTagName !== "undefined" && context;
  10297. }
  10298. // Expose support vars for convenience
  10299. support = Sizzle.support = {};
  10300. /**
  10301. * Detects XML nodes
  10302. * @param {Element|Object} elem An element or a document
  10303. * @returns {Boolean} True iff elem is a non-HTML XML node
  10304. */
  10305. isXML = Sizzle.isXML = function( elem ) {
  10306. var namespace = elem.namespaceURI,
  10307. docElem = (elem.ownerDocument || elem).documentElement;
  10308. // Support: IE <=8
  10309. // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes
  10310. // https://bugs.jquery.com/ticket/4833
  10311. return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" );
  10312. };
  10313. /**
  10314. * Sets document-related variables once based on the current document
  10315. * @param {Element|Object} [doc] An element or document object to use to set the document
  10316. * @returns {Object} Returns the current document
  10317. */
  10318. setDocument = Sizzle.setDocument = function( node ) {
  10319. var hasCompare, subWindow,
  10320. doc = node ? node.ownerDocument || node : preferredDoc;
  10321. // Return early if doc is invalid or already selected
  10322. if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
  10323. return document;
  10324. }
  10325. // Update global variables
  10326. document = doc;
  10327. docElem = document.documentElement;
  10328. documentIsHTML = !isXML( document );
  10329. // Support: IE 9-11, Edge
  10330. // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
  10331. if ( preferredDoc !== document &&
  10332. (subWindow = document.defaultView) && subWindow.top !== subWindow ) {
  10333. // Support: IE 11, Edge
  10334. if ( subWindow.addEventListener ) {
  10335. subWindow.addEventListener( "unload", unloadHandler, false );
  10336. // Support: IE 9 - 10 only
  10337. } else if ( subWindow.attachEvent ) {
  10338. subWindow.attachEvent( "onunload", unloadHandler );
  10339. }
  10340. }
  10341. /* Attributes
  10342. ---------------------------------------------------------------------- */
  10343. // Support: IE<8
  10344. // Verify that getAttribute really returns attributes and not properties
  10345. // (excepting IE8 booleans)
  10346. support.attributes = assert(function( el ) {
  10347. el.className = "i";
  10348. return !el.getAttribute("className");
  10349. });
  10350. /* getElement(s)By*
  10351. ---------------------------------------------------------------------- */
  10352. // Check if getElementsByTagName("*") returns only elements
  10353. support.getElementsByTagName = assert(function( el ) {
  10354. el.appendChild( document.createComment("") );
  10355. return !el.getElementsByTagName("*").length;
  10356. });
  10357. // Support: IE<9
  10358. support.getElementsByClassName = rnative.test( document.getElementsByClassName );
  10359. // Support: IE<10
  10360. // Check if getElementById returns elements by name
  10361. // The broken getElementById methods don't pick up programmatically-set names,
  10362. // so use a roundabout getElementsByName test
  10363. support.getById = assert(function( el ) {
  10364. docElem.appendChild( el ).id = expando;
  10365. return !document.getElementsByName || !document.getElementsByName( expando ).length;
  10366. });
  10367. // ID filter and find
  10368. if ( support.getById ) {
  10369. Expr.filter["ID"] = function( id ) {
  10370. var attrId = id.replace( runescape, funescape );
  10371. return function( elem ) {
  10372. return elem.getAttribute("id") === attrId;
  10373. };
  10374. };
  10375. Expr.find["ID"] = function( id, context ) {
  10376. if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
  10377. var elem = context.getElementById( id );
  10378. return elem ? [ elem ] : [];
  10379. }
  10380. };
  10381. } else {
  10382. Expr.filter["ID"] = function( id ) {
  10383. var attrId = id.replace( runescape, funescape );
  10384. return function( elem ) {
  10385. var node = typeof elem.getAttributeNode !== "undefined" &&
  10386. elem.getAttributeNode("id");
  10387. return node && node.value === attrId;
  10388. };
  10389. };
  10390. // Support: IE 6 - 7 only
  10391. // getElementById is not reliable as a find shortcut
  10392. Expr.find["ID"] = function( id, context ) {
  10393. if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
  10394. var node, i, elems,
  10395. elem = context.getElementById( id );
  10396. if ( elem ) {
  10397. // Verify the id attribute
  10398. node = elem.getAttributeNode("id");
  10399. if ( node && node.value === id ) {
  10400. return [ elem ];
  10401. }
  10402. // Fall back on getElementsByName
  10403. elems = context.getElementsByName( id );
  10404. i = 0;
  10405. while ( (elem = elems[i++]) ) {
  10406. node = elem.getAttributeNode("id");
  10407. if ( node && node.value === id ) {
  10408. return [ elem ];
  10409. }
  10410. }
  10411. }
  10412. return [];
  10413. }
  10414. };
  10415. }
  10416. // Tag
  10417. Expr.find["TAG"] = support.getElementsByTagName ?
  10418. function( tag, context ) {
  10419. if ( typeof context.getElementsByTagName !== "undefined" ) {
  10420. return context.getElementsByTagName( tag );
  10421. // DocumentFragment nodes don't have gEBTN
  10422. } else if ( support.qsa ) {
  10423. return context.querySelectorAll( tag );
  10424. }
  10425. } :
  10426. function( tag, context ) {
  10427. var elem,
  10428. tmp = [],
  10429. i = 0,
  10430. // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
  10431. results = context.getElementsByTagName( tag );
  10432. // Filter out possible comments
  10433. if ( tag === "*" ) {
  10434. while ( (elem = results[i++]) ) {
  10435. if ( elem.nodeType === 1 ) {
  10436. tmp.push( elem );
  10437. }
  10438. }
  10439. return tmp;
  10440. }
  10441. return results;
  10442. };
  10443. // Class
  10444. Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
  10445. if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
  10446. return context.getElementsByClassName( className );
  10447. }
  10448. };
  10449. /* QSA/matchesSelector
  10450. ---------------------------------------------------------------------- */
  10451. // QSA and matchesSelector support
  10452. // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
  10453. rbuggyMatches = [];
  10454. // qSa(:focus) reports false when true (Chrome 21)
  10455. // We allow this because of a bug in IE8/9 that throws an error
  10456. // whenever `document.activeElement` is accessed on an iframe
  10457. // So, we allow :focus to pass through QSA all the time to avoid the IE error
  10458. // See https://bugs.jquery.com/ticket/13378
  10459. rbuggyQSA = [];
  10460. if ( (support.qsa = rnative.test( document.querySelectorAll )) ) {
  10461. // Build QSA regex
  10462. // Regex strategy adopted from Diego Perini
  10463. assert(function( el ) {
  10464. // Select is set to empty string on purpose
  10465. // This is to test IE's treatment of not explicitly
  10466. // setting a boolean content attribute,
  10467. // since its presence should be enough
  10468. // https://bugs.jquery.com/ticket/12359
  10469. docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" +
  10470. "<select id='" + expando + "-\r\\' msallowcapture=''>" +
  10471. "<option selected=''></option></select>";
  10472. // Support: IE8, Opera 11-12.16
  10473. // Nothing should be selected when empty strings follow ^= or $= or *=
  10474. // The test attribute must be unknown in Opera but "safe" for WinRT
  10475. // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
  10476. if ( el.querySelectorAll("[msallowcapture^='']").length ) {
  10477. rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
  10478. }
  10479. // Support: IE8
  10480. // Boolean attributes and "value" are not treated correctly
  10481. if ( !el.querySelectorAll("[selected]").length ) {
  10482. rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
  10483. }
  10484. // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+
  10485. if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
  10486. rbuggyQSA.push("~=");
  10487. }
  10488. // Webkit/Opera - :checked should return selected option elements
  10489. // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
  10490. // IE8 throws error here and will not see later tests
  10491. if ( !el.querySelectorAll(":checked").length ) {
  10492. rbuggyQSA.push(":checked");
  10493. }
  10494. // Support: Safari 8+, iOS 8+
  10495. // https://bugs.webkit.org/show_bug.cgi?id=136851
  10496. // In-page `selector#id sibling-combinator selector` fails
  10497. if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {
  10498. rbuggyQSA.push(".#.+[+~]");
  10499. }
  10500. });
  10501. assert(function( el ) {
  10502. el.innerHTML = "<a href='' disabled='disabled'></a>" +
  10503. "<select disabled='disabled'><option/></select>";
  10504. // Support: Windows 8 Native Apps
  10505. // The type and name attributes are restricted during .innerHTML assignment
  10506. var input = document.createElement("input");
  10507. input.setAttribute( "type", "hidden" );
  10508. el.appendChild( input ).setAttribute( "name", "D" );
  10509. // Support: IE8
  10510. // Enforce case-sensitivity of name attribute
  10511. if ( el.querySelectorAll("[name=d]").length ) {
  10512. rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
  10513. }
  10514. // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
  10515. // IE8 throws error here and will not see later tests
  10516. if ( el.querySelectorAll(":enabled").length !== 2 ) {
  10517. rbuggyQSA.push( ":enabled", ":disabled" );
  10518. }
  10519. // Support: IE9-11+
  10520. // IE's :disabled selector does not pick up the children of disabled fieldsets
  10521. docElem.appendChild( el ).disabled = true;
  10522. if ( el.querySelectorAll(":disabled").length !== 2 ) {
  10523. rbuggyQSA.push( ":enabled", ":disabled" );
  10524. }
  10525. // Opera 10-11 does not throw on post-comma invalid pseudos
  10526. el.querySelectorAll("*,:x");
  10527. rbuggyQSA.push(",.*:");
  10528. });
  10529. }
  10530. if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
  10531. docElem.webkitMatchesSelector ||
  10532. docElem.mozMatchesSelector ||
  10533. docElem.oMatchesSelector ||
  10534. docElem.msMatchesSelector) )) ) {
  10535. assert(function( el ) {
  10536. // Check to see if it's possible to do matchesSelector
  10537. // on a disconnected node (IE 9)
  10538. support.disconnectedMatch = matches.call( el, "*" );
  10539. // This should fail with an exception
  10540. // Gecko does not error, returns false instead
  10541. matches.call( el, "[s!='']:x" );
  10542. rbuggyMatches.push( "!=", pseudos );
  10543. });
  10544. }
  10545. rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
  10546. rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
  10547. /* Contains
  10548. ---------------------------------------------------------------------- */
  10549. hasCompare = rnative.test( docElem.compareDocumentPosition );
  10550. // Element contains another
  10551. // Purposefully self-exclusive
  10552. // As in, an element does not contain itself
  10553. contains = hasCompare || rnative.test( docElem.contains ) ?
  10554. function( a, b ) {
  10555. var adown = a.nodeType === 9 ? a.documentElement : a,
  10556. bup = b && b.parentNode;
  10557. return a === bup || !!( bup && bup.nodeType === 1 && (
  10558. adown.contains ?
  10559. adown.contains( bup ) :
  10560. a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
  10561. ));
  10562. } :
  10563. function( a, b ) {
  10564. if ( b ) {
  10565. while ( (b = b.parentNode) ) {
  10566. if ( b === a ) {
  10567. return true;
  10568. }
  10569. }
  10570. }
  10571. return false;
  10572. };
  10573. /* Sorting
  10574. ---------------------------------------------------------------------- */
  10575. // Document order sorting
  10576. sortOrder = hasCompare ?
  10577. function( a, b ) {
  10578. // Flag for duplicate removal
  10579. if ( a === b ) {
  10580. hasDuplicate = true;
  10581. return 0;
  10582. }
  10583. // Sort on method existence if only one input has compareDocumentPosition
  10584. var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
  10585. if ( compare ) {
  10586. return compare;
  10587. }
  10588. // Calculate position if both inputs belong to the same document
  10589. compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
  10590. a.compareDocumentPosition( b ) :
  10591. // Otherwise we know they are disconnected
  10592. 1;
  10593. // Disconnected nodes
  10594. if ( compare & 1 ||
  10595. (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
  10596. // Choose the first element that is related to our preferred document
  10597. if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
  10598. return -1;
  10599. }
  10600. if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
  10601. return 1;
  10602. }
  10603. // Maintain original order
  10604. return sortInput ?
  10605. ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
  10606. 0;
  10607. }
  10608. return compare & 4 ? -1 : 1;
  10609. } :
  10610. function( a, b ) {
  10611. // Exit early if the nodes are identical
  10612. if ( a === b ) {
  10613. hasDuplicate = true;
  10614. return 0;
  10615. }
  10616. var cur,
  10617. i = 0,
  10618. aup = a.parentNode,
  10619. bup = b.parentNode,
  10620. ap = [ a ],
  10621. bp = [ b ];
  10622. // Parentless nodes are either documents or disconnected
  10623. if ( !aup || !bup ) {
  10624. return a === document ? -1 :
  10625. b === document ? 1 :
  10626. aup ? -1 :
  10627. bup ? 1 :
  10628. sortInput ?
  10629. ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
  10630. 0;
  10631. // If the nodes are siblings, we can do a quick check
  10632. } else if ( aup === bup ) {
  10633. return siblingCheck( a, b );
  10634. }
  10635. // Otherwise we need full lists of their ancestors for comparison
  10636. cur = a;
  10637. while ( (cur = cur.parentNode) ) {
  10638. ap.unshift( cur );
  10639. }
  10640. cur = b;
  10641. while ( (cur = cur.parentNode) ) {
  10642. bp.unshift( cur );
  10643. }
  10644. // Walk down the tree looking for a discrepancy
  10645. while ( ap[i] === bp[i] ) {
  10646. i++;
  10647. }
  10648. return i ?
  10649. // Do a sibling check if the nodes have a common ancestor
  10650. siblingCheck( ap[i], bp[i] ) :
  10651. // Otherwise nodes in our document sort first
  10652. ap[i] === preferredDoc ? -1 :
  10653. bp[i] === preferredDoc ? 1 :
  10654. 0;
  10655. };
  10656. return document;
  10657. };
  10658. Sizzle.matches = function( expr, elements ) {
  10659. return Sizzle( expr, null, null, elements );
  10660. };
  10661. Sizzle.matchesSelector = function( elem, expr ) {
  10662. // Set document vars if needed
  10663. if ( ( elem.ownerDocument || elem ) !== document ) {
  10664. setDocument( elem );
  10665. }
  10666. if ( support.matchesSelector && documentIsHTML &&
  10667. !nonnativeSelectorCache[ expr + " " ] &&
  10668. ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
  10669. ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
  10670. try {
  10671. var ret = matches.call( elem, expr );
  10672. // IE 9's matchesSelector returns false on disconnected nodes
  10673. if ( ret || support.disconnectedMatch ||
  10674. // As well, disconnected nodes are said to be in a document
  10675. // fragment in IE 9
  10676. elem.document && elem.document.nodeType !== 11 ) {
  10677. return ret;
  10678. }
  10679. } catch (e) {
  10680. nonnativeSelectorCache( expr, true );
  10681. }
  10682. }
  10683. return Sizzle( expr, document, null, [ elem ] ).length > 0;
  10684. };
  10685. Sizzle.contains = function( context, elem ) {
  10686. // Set document vars if needed
  10687. if ( ( context.ownerDocument || context ) !== document ) {
  10688. setDocument( context );
  10689. }
  10690. return contains( context, elem );
  10691. };
  10692. Sizzle.attr = function( elem, name ) {
  10693. // Set document vars if needed
  10694. if ( ( elem.ownerDocument || elem ) !== document ) {
  10695. setDocument( elem );
  10696. }
  10697. var fn = Expr.attrHandle[ name.toLowerCase() ],
  10698. // Don't get fooled by Object.prototype properties (jQuery #13807)
  10699. val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
  10700. fn( elem, name, !documentIsHTML ) :
  10701. undefined;
  10702. return val !== undefined ?
  10703. val :
  10704. support.attributes || !documentIsHTML ?
  10705. elem.getAttribute( name ) :
  10706. (val = elem.getAttributeNode(name)) && val.specified ?
  10707. val.value :
  10708. null;
  10709. };
  10710. Sizzle.escape = function( sel ) {
  10711. return (sel + "").replace( rcssescape, fcssescape );
  10712. };
  10713. Sizzle.error = function( msg ) {
  10714. throw new Error( "Syntax error, unrecognized expression: " + msg );
  10715. };
  10716. /**
  10717. * Document sorting and removing duplicates
  10718. * @param {ArrayLike} results
  10719. */
  10720. Sizzle.uniqueSort = function( results ) {
  10721. var elem,
  10722. duplicates = [],
  10723. j = 0,
  10724. i = 0;
  10725. // Unless we *know* we can detect duplicates, assume their presence
  10726. hasDuplicate = !support.detectDuplicates;
  10727. sortInput = !support.sortStable && results.slice( 0 );
  10728. results.sort( sortOrder );
  10729. if ( hasDuplicate ) {
  10730. while ( (elem = results[i++]) ) {
  10731. if ( elem === results[ i ] ) {
  10732. j = duplicates.push( i );
  10733. }
  10734. }
  10735. while ( j-- ) {
  10736. results.splice( duplicates[ j ], 1 );
  10737. }
  10738. }
  10739. // Clear input after sorting to release objects
  10740. // See https://github.com/jquery/sizzle/pull/225
  10741. sortInput = null;
  10742. return results;
  10743. };
  10744. /**
  10745. * Utility function for retrieving the text value of an array of DOM nodes
  10746. * @param {Array|Element} elem
  10747. */
  10748. getText = Sizzle.getText = function( elem ) {
  10749. var node,
  10750. ret = "",
  10751. i = 0,
  10752. nodeType = elem.nodeType;
  10753. if ( !nodeType ) {
  10754. // If no nodeType, this is expected to be an array
  10755. while ( (node = elem[i++]) ) {
  10756. // Do not traverse comment nodes
  10757. ret += getText( node );
  10758. }
  10759. } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
  10760. // Use textContent for elements
  10761. // innerText usage removed for consistency of new lines (jQuery #11153)
  10762. if ( typeof elem.textContent === "string" ) {
  10763. return elem.textContent;
  10764. } else {
  10765. // Traverse its children
  10766. for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
  10767. ret += getText( elem );
  10768. }
  10769. }
  10770. } else if ( nodeType === 3 || nodeType === 4 ) {
  10771. return elem.nodeValue;
  10772. }
  10773. // Do not include comment or processing instruction nodes
  10774. return ret;
  10775. };
  10776. Expr = Sizzle.selectors = {
  10777. // Can be adjusted by the user
  10778. cacheLength: 50,
  10779. createPseudo: markFunction,
  10780. match: matchExpr,
  10781. attrHandle: {},
  10782. find: {},
  10783. relative: {
  10784. ">": { dir: "parentNode", first: true },
  10785. " ": { dir: "parentNode" },
  10786. "+": { dir: "previousSibling", first: true },
  10787. "~": { dir: "previousSibling" }
  10788. },
  10789. preFilter: {
  10790. "ATTR": function( match ) {
  10791. match[1] = match[1].replace( runescape, funescape );
  10792. // Move the given value to match[3] whether quoted or unquoted
  10793. match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
  10794. if ( match[2] === "~=" ) {
  10795. match[3] = " " + match[3] + " ";
  10796. }
  10797. return match.slice( 0, 4 );
  10798. },
  10799. "CHILD": function( match ) {
  10800. /* matches from matchExpr["CHILD"]
  10801. 1 type (only|nth|...)
  10802. 2 what (child|of-type)
  10803. 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
  10804. 4 xn-component of xn+y argument ([+-]?\d*n|)
  10805. 5 sign of xn-component
  10806. 6 x of xn-component
  10807. 7 sign of y-component
  10808. 8 y of y-component
  10809. */
  10810. match[1] = match[1].toLowerCase();
  10811. if ( match[1].slice( 0, 3 ) === "nth" ) {
  10812. // nth-* requires argument
  10813. if ( !match[3] ) {
  10814. Sizzle.error( match[0] );
  10815. }
  10816. // numeric x and y parameters for Expr.filter.CHILD
  10817. // remember that false/true cast respectively to 0/1
  10818. match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
  10819. match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
  10820. // other types prohibit arguments
  10821. } else if ( match[3] ) {
  10822. Sizzle.error( match[0] );
  10823. }
  10824. return match;
  10825. },
  10826. "PSEUDO": function( match ) {
  10827. var excess,
  10828. unquoted = !match[6] && match[2];
  10829. if ( matchExpr["CHILD"].test( match[0] ) ) {
  10830. return null;
  10831. }
  10832. // Accept quoted arguments as-is
  10833. if ( match[3] ) {
  10834. match[2] = match[4] || match[5] || "";
  10835. // Strip excess characters from unquoted arguments
  10836. } else if ( unquoted && rpseudo.test( unquoted ) &&
  10837. // Get excess from tokenize (recursively)
  10838. (excess = tokenize( unquoted, true )) &&
  10839. // advance to the next closing parenthesis
  10840. (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
  10841. // excess is a negative index
  10842. match[0] = match[0].slice( 0, excess );
  10843. match[2] = unquoted.slice( 0, excess );
  10844. }
  10845. // Return only captures needed by the pseudo filter method (type and argument)
  10846. return match.slice( 0, 3 );
  10847. }
  10848. },
  10849. filter: {
  10850. "TAG": function( nodeNameSelector ) {
  10851. var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
  10852. return nodeNameSelector === "*" ?
  10853. function() { return true; } :
  10854. function( elem ) {
  10855. return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
  10856. };
  10857. },
  10858. "CLASS": function( className ) {
  10859. var pattern = classCache[ className + " " ];
  10860. return pattern ||
  10861. (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
  10862. classCache( className, function( elem ) {
  10863. return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );
  10864. });
  10865. },
  10866. "ATTR": function( name, operator, check ) {
  10867. return function( elem ) {
  10868. var result = Sizzle.attr( elem, name );
  10869. if ( result == null ) {
  10870. return operator === "!=";
  10871. }
  10872. if ( !operator ) {
  10873. return true;
  10874. }
  10875. result += "";
  10876. return operator === "=" ? result === check :
  10877. operator === "!=" ? result !== check :
  10878. operator === "^=" ? check && result.indexOf( check ) === 0 :
  10879. operator === "*=" ? check && result.indexOf( check ) > -1 :
  10880. operator === "$=" ? check && result.slice( -check.length ) === check :
  10881. operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
  10882. operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
  10883. false;
  10884. };
  10885. },
  10886. "CHILD": function( type, what, argument, first, last ) {
  10887. var simple = type.slice( 0, 3 ) !== "nth",
  10888. forward = type.slice( -4 ) !== "last",
  10889. ofType = what === "of-type";
  10890. return first === 1 && last === 0 ?
  10891. // Shortcut for :nth-*(n)
  10892. function( elem ) {
  10893. return !!elem.parentNode;
  10894. } :
  10895. function( elem, context, xml ) {
  10896. var cache, uniqueCache, outerCache, node, nodeIndex, start,
  10897. dir = simple !== forward ? "nextSibling" : "previousSibling",
  10898. parent = elem.parentNode,
  10899. name = ofType && elem.nodeName.toLowerCase(),
  10900. useCache = !xml && !ofType,
  10901. diff = false;
  10902. if ( parent ) {
  10903. // :(first|last|only)-(child|of-type)
  10904. if ( simple ) {
  10905. while ( dir ) {
  10906. node = elem;
  10907. while ( (node = node[ dir ]) ) {
  10908. if ( ofType ?
  10909. node.nodeName.toLowerCase() === name :
  10910. node.nodeType === 1 ) {
  10911. return false;
  10912. }
  10913. }
  10914. // Reverse direction for :only-* (if we haven't yet done so)
  10915. start = dir = type === "only" && !start && "nextSibling";
  10916. }
  10917. return true;
  10918. }
  10919. start = [ forward ? parent.firstChild : parent.lastChild ];
  10920. // non-xml :nth-child(...) stores cache data on `parent`
  10921. if ( forward && useCache ) {
  10922. // Seek `elem` from a previously-cached index
  10923. // ...in a gzip-friendly way
  10924. node = parent;
  10925. outerCache = node[ expando ] || (node[ expando ] = {});
  10926. // Support: IE <9 only
  10927. // Defend against cloned attroperties (jQuery gh-1709)
  10928. uniqueCache = outerCache[ node.uniqueID ] ||
  10929. (outerCache[ node.uniqueID ] = {});
  10930. cache = uniqueCache[ type ] || [];
  10931. nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
  10932. diff = nodeIndex && cache[ 2 ];
  10933. node = nodeIndex && parent.childNodes[ nodeIndex ];
  10934. while ( (node = ++nodeIndex && node && node[ dir ] ||
  10935. // Fallback to seeking `elem` from the start
  10936. (diff = nodeIndex = 0) || start.pop()) ) {
  10937. // When found, cache indexes on `parent` and break
  10938. if ( node.nodeType === 1 && ++diff && node === elem ) {
  10939. uniqueCache[ type ] = [ dirruns, nodeIndex, diff ];
  10940. break;
  10941. }
  10942. }
  10943. } else {
  10944. // Use previously-cached element index if available
  10945. if ( useCache ) {
  10946. // ...in a gzip-friendly way
  10947. node = elem;
  10948. outerCache = node[ expando ] || (node[ expando ] = {});
  10949. // Support: IE <9 only
  10950. // Defend against cloned attroperties (jQuery gh-1709)
  10951. uniqueCache = outerCache[ node.uniqueID ] ||
  10952. (outerCache[ node.uniqueID ] = {});
  10953. cache = uniqueCache[ type ] || [];
  10954. nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
  10955. diff = nodeIndex;
  10956. }
  10957. // xml :nth-child(...)
  10958. // or :nth-last-child(...) or :nth(-last)?-of-type(...)
  10959. if ( diff === false ) {
  10960. // Use the same loop as above to seek `elem` from the start
  10961. while ( (node = ++nodeIndex && node && node[ dir ] ||
  10962. (diff = nodeIndex = 0) || start.pop()) ) {
  10963. if ( ( ofType ?
  10964. node.nodeName.toLowerCase() === name :
  10965. node.nodeType === 1 ) &&
  10966. ++diff ) {
  10967. // Cache the index of each encountered element
  10968. if ( useCache ) {
  10969. outerCache = node[ expando ] || (node[ expando ] = {});
  10970. // Support: IE <9 only
  10971. // Defend against cloned attroperties (jQuery gh-1709)
  10972. uniqueCache = outerCache[ node.uniqueID ] ||
  10973. (outerCache[ node.uniqueID ] = {});
  10974. uniqueCache[ type ] = [ dirruns, diff ];
  10975. }
  10976. if ( node === elem ) {
  10977. break;
  10978. }
  10979. }
  10980. }
  10981. }
  10982. }
  10983. // Incorporate the offset, then check against cycle size
  10984. diff -= last;
  10985. return diff === first || ( diff % first === 0 && diff / first >= 0 );
  10986. }
  10987. };
  10988. },
  10989. "PSEUDO": function( pseudo, argument ) {
  10990. // pseudo-class names are case-insensitive
  10991. // http://www.w3.org/TR/selectors/#pseudo-classes
  10992. // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
  10993. // Remember that setFilters inherits from pseudos
  10994. var args,
  10995. fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
  10996. Sizzle.error( "unsupported pseudo: " + pseudo );
  10997. // The user may use createPseudo to indicate that
  10998. // arguments are needed to create the filter function
  10999. // just as Sizzle does
  11000. if ( fn[ expando ] ) {
  11001. return fn( argument );
  11002. }
  11003. // But maintain support for old signatures
  11004. if ( fn.length > 1 ) {
  11005. args = [ pseudo, pseudo, "", argument ];
  11006. return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
  11007. markFunction(function( seed, matches ) {
  11008. var idx,
  11009. matched = fn( seed, argument ),
  11010. i = matched.length;
  11011. while ( i-- ) {
  11012. idx = indexOf( seed, matched[i] );
  11013. seed[ idx ] = !( matches[ idx ] = matched[i] );
  11014. }
  11015. }) :
  11016. function( elem ) {
  11017. return fn( elem, 0, args );
  11018. };
  11019. }
  11020. return fn;
  11021. }
  11022. },
  11023. pseudos: {
  11024. // Potentially complex pseudos
  11025. "not": markFunction(function( selector ) {
  11026. // Trim the selector passed to compile
  11027. // to avoid treating leading and trailing
  11028. // spaces as combinators
  11029. var input = [],
  11030. results = [],
  11031. matcher = compile( selector.replace( rtrim, "$1" ) );
  11032. return matcher[ expando ] ?
  11033. markFunction(function( seed, matches, context, xml ) {
  11034. var elem,
  11035. unmatched = matcher( seed, null, xml, [] ),
  11036. i = seed.length;
  11037. // Match elements unmatched by `matcher`
  11038. while ( i-- ) {
  11039. if ( (elem = unmatched[i]) ) {
  11040. seed[i] = !(matches[i] = elem);
  11041. }
  11042. }
  11043. }) :
  11044. function( elem, context, xml ) {
  11045. input[0] = elem;
  11046. matcher( input, null, xml, results );
  11047. // Don't keep the element (issue #299)
  11048. input[0] = null;
  11049. return !results.pop();
  11050. };
  11051. }),
  11052. "has": markFunction(function( selector ) {
  11053. return function( elem ) {
  11054. return Sizzle( selector, elem ).length > 0;
  11055. };
  11056. }),
  11057. "contains": markFunction(function( text ) {
  11058. text = text.replace( runescape, funescape );
  11059. return function( elem ) {
  11060. return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1;
  11061. };
  11062. }),
  11063. // "Whether an element is represented by a :lang() selector
  11064. // is based solely on the element's language value
  11065. // being equal to the identifier C,
  11066. // or beginning with the identifier C immediately followed by "-".
  11067. // The matching of C against the element's language value is performed case-insensitively.
  11068. // The identifier C does not have to be a valid language name."
  11069. // http://www.w3.org/TR/selectors/#lang-pseudo
  11070. "lang": markFunction( function( lang ) {
  11071. // lang value must be a valid identifier
  11072. if ( !ridentifier.test(lang || "") ) {
  11073. Sizzle.error( "unsupported lang: " + lang );
  11074. }
  11075. lang = lang.replace( runescape, funescape ).toLowerCase();
  11076. return function( elem ) {
  11077. var elemLang;
  11078. do {
  11079. if ( (elemLang = documentIsHTML ?
  11080. elem.lang :
  11081. elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
  11082. elemLang = elemLang.toLowerCase();
  11083. return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
  11084. }
  11085. } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
  11086. return false;
  11087. };
  11088. }),
  11089. // Miscellaneous
  11090. "target": function( elem ) {
  11091. var hash = window.location && window.location.hash;
  11092. return hash && hash.slice( 1 ) === elem.id;
  11093. },
  11094. "root": function( elem ) {
  11095. return elem === docElem;
  11096. },
  11097. "focus": function( elem ) {
  11098. return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
  11099. },
  11100. // Boolean properties
  11101. "enabled": createDisabledPseudo( false ),
  11102. "disabled": createDisabledPseudo( true ),
  11103. "checked": function( elem ) {
  11104. // In CSS3, :checked should return both checked and selected elements
  11105. // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
  11106. var nodeName = elem.nodeName.toLowerCase();
  11107. return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
  11108. },
  11109. "selected": function( elem ) {
  11110. // Accessing this property makes selected-by-default
  11111. // options in Safari work properly
  11112. if ( elem.parentNode ) {
  11113. elem.parentNode.selectedIndex;
  11114. }
  11115. return elem.selected === true;
  11116. },
  11117. // Contents
  11118. "empty": function( elem ) {
  11119. // http://www.w3.org/TR/selectors/#empty-pseudo
  11120. // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
  11121. // but not by others (comment: 8; processing instruction: 7; etc.)
  11122. // nodeType < 6 works because attributes (2) do not appear as children
  11123. for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
  11124. if ( elem.nodeType < 6 ) {
  11125. return false;
  11126. }
  11127. }
  11128. return true;
  11129. },
  11130. "parent": function( elem ) {
  11131. return !Expr.pseudos["empty"]( elem );
  11132. },
  11133. // Element/input types
  11134. "header": function( elem ) {
  11135. return rheader.test( elem.nodeName );
  11136. },
  11137. "input": function( elem ) {
  11138. return rinputs.test( elem.nodeName );
  11139. },
  11140. "button": function( elem ) {
  11141. var name = elem.nodeName.toLowerCase();
  11142. return name === "input" && elem.type === "button" || name === "button";
  11143. },
  11144. "text": function( elem ) {
  11145. var attr;
  11146. return elem.nodeName.toLowerCase() === "input" &&
  11147. elem.type === "text" &&
  11148. // Support: IE<8
  11149. // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
  11150. ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
  11151. },
  11152. // Position-in-collection
  11153. "first": createPositionalPseudo(function() {
  11154. return [ 0 ];
  11155. }),
  11156. "last": createPositionalPseudo(function( matchIndexes, length ) {
  11157. return [ length - 1 ];
  11158. }),
  11159. "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
  11160. return [ argument < 0 ? argument + length : argument ];
  11161. }),
  11162. "even": createPositionalPseudo(function( matchIndexes, length ) {
  11163. var i = 0;
  11164. for ( ; i < length; i += 2 ) {
  11165. matchIndexes.push( i );
  11166. }
  11167. return matchIndexes;
  11168. }),
  11169. "odd": createPositionalPseudo(function( matchIndexes, length ) {
  11170. var i = 1;
  11171. for ( ; i < length; i += 2 ) {
  11172. matchIndexes.push( i );
  11173. }
  11174. return matchIndexes;
  11175. }),
  11176. "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
  11177. var i = argument < 0 ?
  11178. argument + length :
  11179. argument > length ?
  11180. length :
  11181. argument;
  11182. for ( ; --i >= 0; ) {
  11183. matchIndexes.push( i );
  11184. }
  11185. return matchIndexes;
  11186. }),
  11187. "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
  11188. var i = argument < 0 ? argument + length : argument;
  11189. for ( ; ++i < length; ) {
  11190. matchIndexes.push( i );
  11191. }
  11192. return matchIndexes;
  11193. })
  11194. }
  11195. };
  11196. Expr.pseudos["nth"] = Expr.pseudos["eq"];
  11197. // Add button/input type pseudos
  11198. for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
  11199. Expr.pseudos[ i ] = createInputPseudo( i );
  11200. }
  11201. for ( i in { submit: true, reset: true } ) {
  11202. Expr.pseudos[ i ] = createButtonPseudo( i );
  11203. }
  11204. // Easy API for creating new setFilters
  11205. function setFilters() {}
  11206. setFilters.prototype = Expr.filters = Expr.pseudos;
  11207. Expr.setFilters = new setFilters();
  11208. tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
  11209. var matched, match, tokens, type,
  11210. soFar, groups, preFilters,
  11211. cached = tokenCache[ selector + " " ];
  11212. if ( cached ) {
  11213. return parseOnly ? 0 : cached.slice( 0 );
  11214. }
  11215. soFar = selector;
  11216. groups = [];
  11217. preFilters = Expr.preFilter;
  11218. while ( soFar ) {
  11219. // Comma and first run
  11220. if ( !matched || (match = rcomma.exec( soFar )) ) {
  11221. if ( match ) {
  11222. // Don't consume trailing commas as valid
  11223. soFar = soFar.slice( match[0].length ) || soFar;
  11224. }
  11225. groups.push( (tokens = []) );
  11226. }
  11227. matched = false;
  11228. // Combinators
  11229. if ( (match = rcombinators.exec( soFar )) ) {
  11230. matched = match.shift();
  11231. tokens.push({
  11232. value: matched,
  11233. // Cast descendant combinators to space
  11234. type: match[0].replace( rtrim, " " )
  11235. });
  11236. soFar = soFar.slice( matched.length );
  11237. }
  11238. // Filters
  11239. for ( type in Expr.filter ) {
  11240. if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
  11241. (match = preFilters[ type ]( match ))) ) {
  11242. matched = match.shift();
  11243. tokens.push({
  11244. value: matched,
  11245. type: type,
  11246. matches: match
  11247. });
  11248. soFar = soFar.slice( matched.length );
  11249. }
  11250. }
  11251. if ( !matched ) {
  11252. break;
  11253. }
  11254. }
  11255. // Return the length of the invalid excess
  11256. // if we're just parsing
  11257. // Otherwise, throw an error or return tokens
  11258. return parseOnly ?
  11259. soFar.length :
  11260. soFar ?
  11261. Sizzle.error( selector ) :
  11262. // Cache the tokens
  11263. tokenCache( selector, groups ).slice( 0 );
  11264. };
  11265. function toSelector( tokens ) {
  11266. var i = 0,
  11267. len = tokens.length,
  11268. selector = "";
  11269. for ( ; i < len; i++ ) {
  11270. selector += tokens[i].value;
  11271. }
  11272. return selector;
  11273. }
  11274. function addCombinator( matcher, combinator, base ) {
  11275. var dir = combinator.dir,
  11276. skip = combinator.next,
  11277. key = skip || dir,
  11278. checkNonElements = base && key === "parentNode",
  11279. doneName = done++;
  11280. return combinator.first ?
  11281. // Check against closest ancestor/preceding element
  11282. function( elem, context, xml ) {
  11283. while ( (elem = elem[ dir ]) ) {
  11284. if ( elem.nodeType === 1 || checkNonElements ) {
  11285. return matcher( elem, context, xml );
  11286. }
  11287. }
  11288. return false;
  11289. } :
  11290. // Check against all ancestor/preceding elements
  11291. function( elem, context, xml ) {
  11292. var oldCache, uniqueCache, outerCache,
  11293. newCache = [ dirruns, doneName ];
  11294. // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
  11295. if ( xml ) {
  11296. while ( (elem = elem[ dir ]) ) {
  11297. if ( elem.nodeType === 1 || checkNonElements ) {
  11298. if ( matcher( elem, context, xml ) ) {
  11299. return true;
  11300. }
  11301. }
  11302. }
  11303. } else {
  11304. while ( (elem = elem[ dir ]) ) {
  11305. if ( elem.nodeType === 1 || checkNonElements ) {
  11306. outerCache = elem[ expando ] || (elem[ expando ] = {});
  11307. // Support: IE <9 only
  11308. // Defend against cloned attroperties (jQuery gh-1709)
  11309. uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {});
  11310. if ( skip && skip === elem.nodeName.toLowerCase() ) {
  11311. elem = elem[ dir ] || elem;
  11312. } else if ( (oldCache = uniqueCache[ key ]) &&
  11313. oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
  11314. // Assign to newCache so results back-propagate to previous elements
  11315. return (newCache[ 2 ] = oldCache[ 2 ]);
  11316. } else {
  11317. // Reuse newcache so results back-propagate to previous elements
  11318. uniqueCache[ key ] = newCache;
  11319. // A match means we're done; a fail means we have to keep checking
  11320. if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
  11321. return true;
  11322. }
  11323. }
  11324. }
  11325. }
  11326. }
  11327. return false;
  11328. };
  11329. }
  11330. function elementMatcher( matchers ) {
  11331. return matchers.length > 1 ?
  11332. function( elem, context, xml ) {
  11333. var i = matchers.length;
  11334. while ( i-- ) {
  11335. if ( !matchers[i]( elem, context, xml ) ) {
  11336. return false;
  11337. }
  11338. }
  11339. return true;
  11340. } :
  11341. matchers[0];
  11342. }
  11343. function multipleContexts( selector, contexts, results ) {
  11344. var i = 0,
  11345. len = contexts.length;
  11346. for ( ; i < len; i++ ) {
  11347. Sizzle( selector, contexts[i], results );
  11348. }
  11349. return results;
  11350. }
  11351. function condense( unmatched, map, filter, context, xml ) {
  11352. var elem,
  11353. newUnmatched = [],
  11354. i = 0,
  11355. len = unmatched.length,
  11356. mapped = map != null;
  11357. for ( ; i < len; i++ ) {
  11358. if ( (elem = unmatched[i]) ) {
  11359. if ( !filter || filter( elem, context, xml ) ) {
  11360. newUnmatched.push( elem );
  11361. if ( mapped ) {
  11362. map.push( i );
  11363. }
  11364. }
  11365. }
  11366. }
  11367. return newUnmatched;
  11368. }
  11369. function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
  11370. if ( postFilter && !postFilter[ expando ] ) {
  11371. postFilter = setMatcher( postFilter );
  11372. }
  11373. if ( postFinder && !postFinder[ expando ] ) {
  11374. postFinder = setMatcher( postFinder, postSelector );
  11375. }
  11376. return markFunction(function( seed, results, context, xml ) {
  11377. var temp, i, elem,
  11378. preMap = [],
  11379. postMap = [],
  11380. preexisting = results.length,
  11381. // Get initial elements from seed or context
  11382. elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
  11383. // Prefilter to get matcher input, preserving a map for seed-results synchronization
  11384. matcherIn = preFilter && ( seed || !selector ) ?
  11385. condense( elems, preMap, preFilter, context, xml ) :
  11386. elems,
  11387. matcherOut = matcher ?
  11388. // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
  11389. postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
  11390. // ...intermediate processing is necessary
  11391. [] :
  11392. // ...otherwise use results directly
  11393. results :
  11394. matcherIn;
  11395. // Find primary matches
  11396. if ( matcher ) {
  11397. matcher( matcherIn, matcherOut, context, xml );
  11398. }
  11399. // Apply postFilter
  11400. if ( postFilter ) {
  11401. temp = condense( matcherOut, postMap );
  11402. postFilter( temp, [], context, xml );
  11403. // Un-match failing elements by moving them back to matcherIn
  11404. i = temp.length;
  11405. while ( i-- ) {
  11406. if ( (elem = temp[i]) ) {
  11407. matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
  11408. }
  11409. }
  11410. }
  11411. if ( seed ) {
  11412. if ( postFinder || preFilter ) {
  11413. if ( postFinder ) {
  11414. // Get the final matcherOut by condensing this intermediate into postFinder contexts
  11415. temp = [];
  11416. i = matcherOut.length;
  11417. while ( i-- ) {
  11418. if ( (elem = matcherOut[i]) ) {
  11419. // Restore matcherIn since elem is not yet a final match
  11420. temp.push( (matcherIn[i] = elem) );
  11421. }
  11422. }
  11423. postFinder( null, (matcherOut = []), temp, xml );
  11424. }
  11425. // Move matched elements from seed to results to keep them synchronized
  11426. i = matcherOut.length;
  11427. while ( i-- ) {
  11428. if ( (elem = matcherOut[i]) &&
  11429. (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
  11430. seed[temp] = !(results[temp] = elem);
  11431. }
  11432. }
  11433. }
  11434. // Add elements to results, through postFinder if defined
  11435. } else {
  11436. matcherOut = condense(
  11437. matcherOut === results ?
  11438. matcherOut.splice( preexisting, matcherOut.length ) :
  11439. matcherOut
  11440. );
  11441. if ( postFinder ) {
  11442. postFinder( null, results, matcherOut, xml );
  11443. } else {
  11444. push.apply( results, matcherOut );
  11445. }
  11446. }
  11447. });
  11448. }
  11449. function matcherFromTokens( tokens ) {
  11450. var checkContext, matcher, j,
  11451. len = tokens.length,
  11452. leadingRelative = Expr.relative[ tokens[0].type ],
  11453. implicitRelative = leadingRelative || Expr.relative[" "],
  11454. i = leadingRelative ? 1 : 0,
  11455. // The foundational matcher ensures that elements are reachable from top-level context(s)
  11456. matchContext = addCombinator( function( elem ) {
  11457. return elem === checkContext;
  11458. }, implicitRelative, true ),
  11459. matchAnyContext = addCombinator( function( elem ) {
  11460. return indexOf( checkContext, elem ) > -1;
  11461. }, implicitRelative, true ),
  11462. matchers = [ function( elem, context, xml ) {
  11463. var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
  11464. (checkContext = context).nodeType ?
  11465. matchContext( elem, context, xml ) :
  11466. matchAnyContext( elem, context, xml ) );
  11467. // Avoid hanging onto element (issue #299)
  11468. checkContext = null;
  11469. return ret;
  11470. } ];
  11471. for ( ; i < len; i++ ) {
  11472. if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
  11473. matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
  11474. } else {
  11475. matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
  11476. // Return special upon seeing a positional matcher
  11477. if ( matcher[ expando ] ) {
  11478. // Find the next relative operator (if any) for proper handling
  11479. j = ++i;
  11480. for ( ; j < len; j++ ) {
  11481. if ( Expr.relative[ tokens[j].type ] ) {
  11482. break;
  11483. }
  11484. }
  11485. return setMatcher(
  11486. i > 1 && elementMatcher( matchers ),
  11487. i > 1 && toSelector(
  11488. // If the preceding token was a descendant combinator, insert an implicit any-element `*`
  11489. tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
  11490. ).replace( rtrim, "$1" ),
  11491. matcher,
  11492. i < j && matcherFromTokens( tokens.slice( i, j ) ),
  11493. j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
  11494. j < len && toSelector( tokens )
  11495. );
  11496. }
  11497. matchers.push( matcher );
  11498. }
  11499. }
  11500. return elementMatcher( matchers );
  11501. }
  11502. function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
  11503. var bySet = setMatchers.length > 0,
  11504. byElement = elementMatchers.length > 0,
  11505. superMatcher = function( seed, context, xml, results, outermost ) {
  11506. var elem, j, matcher,
  11507. matchedCount = 0,
  11508. i = "0",
  11509. unmatched = seed && [],
  11510. setMatched = [],
  11511. contextBackup = outermostContext,
  11512. // We must always have either seed elements or outermost context
  11513. elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
  11514. // Use integer dirruns iff this is the outermost matcher
  11515. dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
  11516. len = elems.length;
  11517. if ( outermost ) {
  11518. outermostContext = context === document || context || outermost;
  11519. }
  11520. // Add elements passing elementMatchers directly to results
  11521. // Support: IE<9, Safari
  11522. // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
  11523. for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
  11524. if ( byElement && elem ) {
  11525. j = 0;
  11526. if ( !context && elem.ownerDocument !== document ) {
  11527. setDocument( elem );
  11528. xml = !documentIsHTML;
  11529. }
  11530. while ( (matcher = elementMatchers[j++]) ) {
  11531. if ( matcher( elem, context || document, xml) ) {
  11532. results.push( elem );
  11533. break;
  11534. }
  11535. }
  11536. if ( outermost ) {
  11537. dirruns = dirrunsUnique;
  11538. }
  11539. }
  11540. // Track unmatched elements for set filters
  11541. if ( bySet ) {
  11542. // They will have gone through all possible matchers
  11543. if ( (elem = !matcher && elem) ) {
  11544. matchedCount--;
  11545. }
  11546. // Lengthen the array for every element, matched or not
  11547. if ( seed ) {
  11548. unmatched.push( elem );
  11549. }
  11550. }
  11551. }
  11552. // `i` is now the count of elements visited above, and adding it to `matchedCount`
  11553. // makes the latter nonnegative.
  11554. matchedCount += i;
  11555. // Apply set filters to unmatched elements
  11556. // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`
  11557. // equals `i`), unless we didn't visit _any_ elements in the above loop because we have
  11558. // no element matchers and no seed.
  11559. // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that
  11560. // case, which will result in a "00" `matchedCount` that differs from `i` but is also
  11561. // numerically zero.
  11562. if ( bySet && i !== matchedCount ) {
  11563. j = 0;
  11564. while ( (matcher = setMatchers[j++]) ) {
  11565. matcher( unmatched, setMatched, context, xml );
  11566. }
  11567. if ( seed ) {
  11568. // Reintegrate element matches to eliminate the need for sorting
  11569. if ( matchedCount > 0 ) {
  11570. while ( i-- ) {
  11571. if ( !(unmatched[i] || setMatched[i]) ) {
  11572. setMatched[i] = pop.call( results );
  11573. }
  11574. }
  11575. }
  11576. // Discard index placeholder values to get only actual matches
  11577. setMatched = condense( setMatched );
  11578. }
  11579. // Add matches to results
  11580. push.apply( results, setMatched );
  11581. // Seedless set matches succeeding multiple successful matchers stipulate sorting
  11582. if ( outermost && !seed && setMatched.length > 0 &&
  11583. ( matchedCount + setMatchers.length ) > 1 ) {
  11584. Sizzle.uniqueSort( results );
  11585. }
  11586. }
  11587. // Override manipulation of globals by nested matchers
  11588. if ( outermost ) {
  11589. dirruns = dirrunsUnique;
  11590. outermostContext = contextBackup;
  11591. }
  11592. return unmatched;
  11593. };
  11594. return bySet ?
  11595. markFunction( superMatcher ) :
  11596. superMatcher;
  11597. }
  11598. compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
  11599. var i,
  11600. setMatchers = [],
  11601. elementMatchers = [],
  11602. cached = compilerCache[ selector + " " ];
  11603. if ( !cached ) {
  11604. // Generate a function of recursive functions that can be used to check each element
  11605. if ( !match ) {
  11606. match = tokenize( selector );
  11607. }
  11608. i = match.length;
  11609. while ( i-- ) {
  11610. cached = matcherFromTokens( match[i] );
  11611. if ( cached[ expando ] ) {
  11612. setMatchers.push( cached );
  11613. } else {
  11614. elementMatchers.push( cached );
  11615. }
  11616. }
  11617. // Cache the compiled function
  11618. cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
  11619. // Save selector and tokenization
  11620. cached.selector = selector;
  11621. }
  11622. return cached;
  11623. };
  11624. /**
  11625. * A low-level selection function that works with Sizzle's compiled
  11626. * selector functions
  11627. * @param {String|Function} selector A selector or a pre-compiled
  11628. * selector function built with Sizzle.compile
  11629. * @param {Element} context
  11630. * @param {Array} [results]
  11631. * @param {Array} [seed] A set of elements to match against
  11632. */
  11633. select = Sizzle.select = function( selector, context, results, seed ) {
  11634. var i, tokens, token, type, find,
  11635. compiled = typeof selector === "function" && selector,
  11636. match = !seed && tokenize( (selector = compiled.selector || selector) );
  11637. results = results || [];
  11638. // Try to minimize operations if there is only one selector in the list and no seed
  11639. // (the latter of which guarantees us context)
  11640. if ( match.length === 1 ) {
  11641. // Reduce context if the leading compound selector is an ID
  11642. tokens = match[0] = match[0].slice( 0 );
  11643. if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
  11644. context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) {
  11645. context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
  11646. if ( !context ) {
  11647. return results;
  11648. // Precompiled matchers will still verify ancestry, so step up a level
  11649. } else if ( compiled ) {
  11650. context = context.parentNode;
  11651. }
  11652. selector = selector.slice( tokens.shift().value.length );
  11653. }
  11654. // Fetch a seed set for right-to-left matching
  11655. i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
  11656. while ( i-- ) {
  11657. token = tokens[i];
  11658. // Abort if we hit a combinator
  11659. if ( Expr.relative[ (type = token.type) ] ) {
  11660. break;
  11661. }
  11662. if ( (find = Expr.find[ type ]) ) {
  11663. // Search, expanding context for leading sibling combinators
  11664. if ( (seed = find(
  11665. token.matches[0].replace( runescape, funescape ),
  11666. rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
  11667. )) ) {
  11668. // If seed is empty or no tokens remain, we can return early
  11669. tokens.splice( i, 1 );
  11670. selector = seed.length && toSelector( tokens );
  11671. if ( !selector ) {
  11672. push.apply( results, seed );
  11673. return results;
  11674. }
  11675. break;
  11676. }
  11677. }
  11678. }
  11679. }
  11680. // Compile and execute a filtering function if one is not provided
  11681. // Provide `match` to avoid retokenization if we modified the selector above
  11682. ( compiled || compile( selector, match ) )(
  11683. seed,
  11684. context,
  11685. !documentIsHTML,
  11686. results,
  11687. !context || rsibling.test( selector ) && testContext( context.parentNode ) || context
  11688. );
  11689. return results;
  11690. };
  11691. // One-time assignments
  11692. // Sort stability
  11693. support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
  11694. // Support: Chrome 14-35+
  11695. // Always assume duplicates if they aren't passed to the comparison function
  11696. support.detectDuplicates = !!hasDuplicate;
  11697. // Initialize against the default document
  11698. setDocument();
  11699. // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
  11700. // Detached nodes confoundingly follow *each other*
  11701. support.sortDetached = assert(function( el ) {
  11702. // Should return 1, but returns 4 (following)
  11703. return el.compareDocumentPosition( document.createElement("fieldset") ) & 1;
  11704. });
  11705. // Support: IE<8
  11706. // Prevent attribute/property "interpolation"
  11707. // https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
  11708. if ( !assert(function( el ) {
  11709. el.innerHTML = "<a href='#'></a>";
  11710. return el.firstChild.getAttribute("href") === "#" ;
  11711. }) ) {
  11712. addHandle( "type|href|height|width", function( elem, name, isXML ) {
  11713. if ( !isXML ) {
  11714. return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
  11715. }
  11716. });
  11717. }
  11718. // Support: IE<9
  11719. // Use defaultValue in place of getAttribute("value")
  11720. if ( !support.attributes || !assert(function( el ) {
  11721. el.innerHTML = "<input/>";
  11722. el.firstChild.setAttribute( "value", "" );
  11723. return el.firstChild.getAttribute( "value" ) === "";
  11724. }) ) {
  11725. addHandle( "value", function( elem, name, isXML ) {
  11726. if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
  11727. return elem.defaultValue;
  11728. }
  11729. });
  11730. }
  11731. // Support: IE<9
  11732. // Use getAttributeNode to fetch booleans when getAttribute lies
  11733. if ( !assert(function( el ) {
  11734. return el.getAttribute("disabled") == null;
  11735. }) ) {
  11736. addHandle( booleans, function( elem, name, isXML ) {
  11737. var val;
  11738. if ( !isXML ) {
  11739. return elem[ name ] === true ? name.toLowerCase() :
  11740. (val = elem.getAttributeNode( name )) && val.specified ?
  11741. val.value :
  11742. null;
  11743. }
  11744. });
  11745. }
  11746. return Sizzle;
  11747. })( window );
  11748. jQuery.find = Sizzle;
  11749. jQuery.expr = Sizzle.selectors;
  11750. // Deprecated
  11751. jQuery.expr[ ":" ] = jQuery.expr.pseudos;
  11752. jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;
  11753. jQuery.text = Sizzle.getText;
  11754. jQuery.isXMLDoc = Sizzle.isXML;
  11755. jQuery.contains = Sizzle.contains;
  11756. jQuery.escapeSelector = Sizzle.escape;
  11757. var dir = function( elem, dir, until ) {
  11758. var matched = [],
  11759. truncate = until !== undefined;
  11760. while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {
  11761. if ( elem.nodeType === 1 ) {
  11762. if ( truncate && jQuery( elem ).is( until ) ) {
  11763. break;
  11764. }
  11765. matched.push( elem );
  11766. }
  11767. }
  11768. return matched;
  11769. };
  11770. var siblings = function( n, elem ) {
  11771. var matched = [];
  11772. for ( ; n; n = n.nextSibling ) {
  11773. if ( n.nodeType === 1 && n !== elem ) {
  11774. matched.push( n );
  11775. }
  11776. }
  11777. return matched;
  11778. };
  11779. var rneedsContext = jQuery.expr.match.needsContext;
  11780. function nodeName( elem, name ) {
  11781. return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
  11782. };
  11783. var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i );
  11784. // Implement the identical functionality for filter and not
  11785. function winnow( elements, qualifier, not ) {
  11786. if ( isFunction( qualifier ) ) {
  11787. return jQuery.grep( elements, function( elem, i ) {
  11788. return !!qualifier.call( elem, i, elem ) !== not;
  11789. } );
  11790. }
  11791. // Single element
  11792. if ( qualifier.nodeType ) {
  11793. return jQuery.grep( elements, function( elem ) {
  11794. return ( elem === qualifier ) !== not;
  11795. } );
  11796. }
  11797. // Arraylike of elements (jQuery, arguments, Array)
  11798. if ( typeof qualifier !== "string" ) {
  11799. return jQuery.grep( elements, function( elem ) {
  11800. return ( indexOf.call( qualifier, elem ) > -1 ) !== not;
  11801. } );
  11802. }
  11803. // Filtered directly for both simple and complex selectors
  11804. return jQuery.filter( qualifier, elements, not );
  11805. }
  11806. jQuery.filter = function( expr, elems, not ) {
  11807. var elem = elems[ 0 ];
  11808. if ( not ) {
  11809. expr = ":not(" + expr + ")";
  11810. }
  11811. if ( elems.length === 1 && elem.nodeType === 1 ) {
  11812. return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];
  11813. }
  11814. return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
  11815. return elem.nodeType === 1;
  11816. } ) );
  11817. };
  11818. jQuery.fn.extend( {
  11819. find: function( selector ) {
  11820. var i, ret,
  11821. len = this.length,
  11822. self = this;
  11823. if ( typeof selector !== "string" ) {
  11824. return this.pushStack( jQuery( selector ).filter( function() {
  11825. for ( i = 0; i < len; i++ ) {
  11826. if ( jQuery.contains( self[ i ], this ) ) {
  11827. return true;
  11828. }
  11829. }
  11830. } ) );
  11831. }
  11832. ret = this.pushStack( [] );
  11833. for ( i = 0; i < len; i++ ) {
  11834. jQuery.find( selector, self[ i ], ret );
  11835. }
  11836. return len > 1 ? jQuery.uniqueSort( ret ) : ret;
  11837. },
  11838. filter: function( selector ) {
  11839. return this.pushStack( winnow( this, selector || [], false ) );
  11840. },
  11841. not: function( selector ) {
  11842. return this.pushStack( winnow( this, selector || [], true ) );
  11843. },
  11844. is: function( selector ) {
  11845. return !!winnow(
  11846. this,
  11847. // If this is a positional/relative selector, check membership in the returned set
  11848. // so $("p:first").is("p:last") won't return true for a doc with two "p".
  11849. typeof selector === "string" && rneedsContext.test( selector ) ?
  11850. jQuery( selector ) :
  11851. selector || [],
  11852. false
  11853. ).length;
  11854. }
  11855. } );
  11856. // Initialize a jQuery object
  11857. // A central reference to the root jQuery(document)
  11858. var rootjQuery,
  11859. // A simple way to check for HTML strings
  11860. // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
  11861. // Strict HTML recognition (#11290: must start with <)
  11862. // Shortcut simple #id case for speed
  11863. rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
  11864. init = jQuery.fn.init = function( selector, context, root ) {
  11865. var match, elem;
  11866. // HANDLE: $(""), $(null), $(undefined), $(false)
  11867. if ( !selector ) {
  11868. return this;
  11869. }
  11870. // Method init() accepts an alternate rootjQuery
  11871. // so migrate can support jQuery.sub (gh-2101)
  11872. root = root || rootjQuery;
  11873. // Handle HTML strings
  11874. if ( typeof selector === "string" ) {
  11875. if ( selector[ 0 ] === "<" &&
  11876. selector[ selector.length - 1 ] === ">" &&
  11877. selector.length >= 3 ) {
  11878. // Assume that strings that start and end with <> are HTML and skip the regex check
  11879. match = [ null, selector, null ];
  11880. } else {
  11881. match = rquickExpr.exec( selector );
  11882. }
  11883. // Match html or make sure no context is specified for #id
  11884. if ( match && ( match[ 1 ] || !context ) ) {
  11885. // HANDLE: $(html) -> $(array)
  11886. if ( match[ 1 ] ) {
  11887. context = context instanceof jQuery ? context[ 0 ] : context;
  11888. // Option to run scripts is true for back-compat
  11889. // Intentionally let the error be thrown if parseHTML is not present
  11890. jQuery.merge( this, jQuery.parseHTML(
  11891. match[ 1 ],
  11892. context && context.nodeType ? context.ownerDocument || context : document,
  11893. true
  11894. ) );
  11895. // HANDLE: $(html, props)
  11896. if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {
  11897. for ( match in context ) {
  11898. // Properties of context are called as methods if possible
  11899. if ( isFunction( this[ match ] ) ) {
  11900. this[ match ]( context[ match ] );
  11901. // ...and otherwise set as attributes
  11902. } else {
  11903. this.attr( match, context[ match ] );
  11904. }
  11905. }
  11906. }
  11907. return this;
  11908. // HANDLE: $(#id)
  11909. } else {
  11910. elem = document.getElementById( match[ 2 ] );
  11911. if ( elem ) {
  11912. // Inject the element directly into the jQuery object
  11913. this[ 0 ] = elem;
  11914. this.length = 1;
  11915. }
  11916. return this;
  11917. }
  11918. // HANDLE: $(expr, $(...))
  11919. } else if ( !context || context.jquery ) {
  11920. return ( context || root ).find( selector );
  11921. // HANDLE: $(expr, context)
  11922. // (which is just equivalent to: $(context).find(expr)
  11923. } else {
  11924. return this.constructor( context ).find( selector );
  11925. }
  11926. // HANDLE: $(DOMElement)
  11927. } else if ( selector.nodeType ) {
  11928. this[ 0 ] = selector;
  11929. this.length = 1;
  11930. return this;
  11931. // HANDLE: $(function)
  11932. // Shortcut for document ready
  11933. } else if ( isFunction( selector ) ) {
  11934. return root.ready !== undefined ?
  11935. root.ready( selector ) :
  11936. // Execute immediately if ready is not present
  11937. selector( jQuery );
  11938. }
  11939. return jQuery.makeArray( selector, this );
  11940. };
  11941. // Give the init function the jQuery prototype for later instantiation
  11942. init.prototype = jQuery.fn;
  11943. // Initialize central reference
  11944. rootjQuery = jQuery( document );
  11945. var rparentsprev = /^(?:parents|prev(?:Until|All))/,
  11946. // Methods guaranteed to produce a unique set when starting from a unique set
  11947. guaranteedUnique = {
  11948. children: true,
  11949. contents: true,
  11950. next: true,
  11951. prev: true
  11952. };
  11953. jQuery.fn.extend( {
  11954. has: function( target ) {
  11955. var targets = jQuery( target, this ),
  11956. l = targets.length;
  11957. return this.filter( function() {
  11958. var i = 0;
  11959. for ( ; i < l; i++ ) {
  11960. if ( jQuery.contains( this, targets[ i ] ) ) {
  11961. return true;
  11962. }
  11963. }
  11964. } );
  11965. },
  11966. closest: function( selectors, context ) {
  11967. var cur,
  11968. i = 0,
  11969. l = this.length,
  11970. matched = [],
  11971. targets = typeof selectors !== "string" && jQuery( selectors );
  11972. // Positional selectors never match, since there's no _selection_ context
  11973. if ( !rneedsContext.test( selectors ) ) {
  11974. for ( ; i < l; i++ ) {
  11975. for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {
  11976. // Always skip document fragments
  11977. if ( cur.nodeType < 11 && ( targets ?
  11978. targets.index( cur ) > -1 :
  11979. // Don't pass non-elements to Sizzle
  11980. cur.nodeType === 1 &&
  11981. jQuery.find.matchesSelector( cur, selectors ) ) ) {
  11982. matched.push( cur );
  11983. break;
  11984. }
  11985. }
  11986. }
  11987. }
  11988. return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );
  11989. },
  11990. // Determine the position of an element within the set
  11991. index: function( elem ) {
  11992. // No argument, return index in parent
  11993. if ( !elem ) {
  11994. return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
  11995. }
  11996. // Index in selector
  11997. if ( typeof elem === "string" ) {
  11998. return indexOf.call( jQuery( elem ), this[ 0 ] );
  11999. }
  12000. // Locate the position of the desired element
  12001. return indexOf.call( this,
  12002. // If it receives a jQuery object, the first element is used
  12003. elem.jquery ? elem[ 0 ] : elem
  12004. );
  12005. },
  12006. add: function( selector, context ) {
  12007. return this.pushStack(
  12008. jQuery.uniqueSort(
  12009. jQuery.merge( this.get(), jQuery( selector, context ) )
  12010. )
  12011. );
  12012. },
  12013. addBack: function( selector ) {
  12014. return this.add( selector == null ?
  12015. this.prevObject : this.prevObject.filter( selector )
  12016. );
  12017. }
  12018. } );
  12019. function sibling( cur, dir ) {
  12020. while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}
  12021. return cur;
  12022. }
  12023. jQuery.each( {
  12024. parent: function( elem ) {
  12025. var parent = elem.parentNode;
  12026. return parent && parent.nodeType !== 11 ? parent : null;
  12027. },
  12028. parents: function( elem ) {
  12029. return dir( elem, "parentNode" );
  12030. },
  12031. parentsUntil: function( elem, i, until ) {
  12032. return dir( elem, "parentNode", until );
  12033. },
  12034. next: function( elem ) {
  12035. return sibling( elem, "nextSibling" );
  12036. },
  12037. prev: function( elem ) {
  12038. return sibling( elem, "previousSibling" );
  12039. },
  12040. nextAll: function( elem ) {
  12041. return dir( elem, "nextSibling" );
  12042. },
  12043. prevAll: function( elem ) {
  12044. return dir( elem, "previousSibling" );
  12045. },
  12046. nextUntil: function( elem, i, until ) {
  12047. return dir( elem, "nextSibling", until );
  12048. },
  12049. prevUntil: function( elem, i, until ) {
  12050. return dir( elem, "previousSibling", until );
  12051. },
  12052. siblings: function( elem ) {
  12053. return siblings( ( elem.parentNode || {} ).firstChild, elem );
  12054. },
  12055. children: function( elem ) {
  12056. return siblings( elem.firstChild );
  12057. },
  12058. contents: function( elem ) {
  12059. if ( typeof elem.contentDocument !== "undefined" ) {
  12060. return elem.contentDocument;
  12061. }
  12062. // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only
  12063. // Treat the template element as a regular one in browsers that
  12064. // don't support it.
  12065. if ( nodeName( elem, "template" ) ) {
  12066. elem = elem.content || elem;
  12067. }
  12068. return jQuery.merge( [], elem.childNodes );
  12069. }
  12070. }, function( name, fn ) {
  12071. jQuery.fn[ name ] = function( until, selector ) {
  12072. var matched = jQuery.map( this, fn, until );
  12073. if ( name.slice( -5 ) !== "Until" ) {
  12074. selector = until;
  12075. }
  12076. if ( selector && typeof selector === "string" ) {
  12077. matched = jQuery.filter( selector, matched );
  12078. }
  12079. if ( this.length > 1 ) {
  12080. // Remove duplicates
  12081. if ( !guaranteedUnique[ name ] ) {
  12082. jQuery.uniqueSort( matched );
  12083. }
  12084. // Reverse order for parents* and prev-derivatives
  12085. if ( rparentsprev.test( name ) ) {
  12086. matched.reverse();
  12087. }
  12088. }
  12089. return this.pushStack( matched );
  12090. };
  12091. } );
  12092. var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g );
  12093. // Convert String-formatted options into Object-formatted ones
  12094. function createOptions( options ) {
  12095. var object = {};
  12096. jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {
  12097. object[ flag ] = true;
  12098. } );
  12099. return object;
  12100. }
  12101. /*
  12102. * Create a callback list using the following parameters:
  12103. *
  12104. * options: an optional list of space-separated options that will change how
  12105. * the callback list behaves or a more traditional option object
  12106. *
  12107. * By default a callback list will act like an event callback list and can be
  12108. * "fired" multiple times.
  12109. *
  12110. * Possible options:
  12111. *
  12112. * once: will ensure the callback list can only be fired once (like a Deferred)
  12113. *
  12114. * memory: will keep track of previous values and will call any callback added
  12115. * after the list has been fired right away with the latest "memorized"
  12116. * values (like a Deferred)
  12117. *
  12118. * unique: will ensure a callback can only be added once (no duplicate in the list)
  12119. *
  12120. * stopOnFalse: interrupt callings when a callback returns false
  12121. *
  12122. */
  12123. jQuery.Callbacks = function( options ) {
  12124. // Convert options from String-formatted to Object-formatted if needed
  12125. // (we check in cache first)
  12126. options = typeof options === "string" ?
  12127. createOptions( options ) :
  12128. jQuery.extend( {}, options );
  12129. var // Flag to know if list is currently firing
  12130. firing,
  12131. // Last fire value for non-forgettable lists
  12132. memory,
  12133. // Flag to know if list was already fired
  12134. fired,
  12135. // Flag to prevent firing
  12136. locked,
  12137. // Actual callback list
  12138. list = [],
  12139. // Queue of execution data for repeatable lists
  12140. queue = [],
  12141. // Index of currently firing callback (modified by add/remove as needed)
  12142. firingIndex = -1,
  12143. // Fire callbacks
  12144. fire = function() {
  12145. // Enforce single-firing
  12146. locked = locked || options.once;
  12147. // Execute callbacks for all pending executions,
  12148. // respecting firingIndex overrides and runtime changes
  12149. fired = firing = true;
  12150. for ( ; queue.length; firingIndex = -1 ) {
  12151. memory = queue.shift();
  12152. while ( ++firingIndex < list.length ) {
  12153. // Run callback and check for early termination
  12154. if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&
  12155. options.stopOnFalse ) {
  12156. // Jump to end and forget the data so .add doesn't re-fire
  12157. firingIndex = list.length;
  12158. memory = false;
  12159. }
  12160. }
  12161. }
  12162. // Forget the data if we're done with it
  12163. if ( !options.memory ) {
  12164. memory = false;
  12165. }
  12166. firing = false;
  12167. // Clean up if we're done firing for good
  12168. if ( locked ) {
  12169. // Keep an empty list if we have data for future add calls
  12170. if ( memory ) {
  12171. list = [];
  12172. // Otherwise, this object is spent
  12173. } else {
  12174. list = "";
  12175. }
  12176. }
  12177. },
  12178. // Actual Callbacks object
  12179. self = {
  12180. // Add a callback or a collection of callbacks to the list
  12181. add: function() {
  12182. if ( list ) {
  12183. // If we have memory from a past run, we should fire after adding
  12184. if ( memory && !firing ) {
  12185. firingIndex = list.length - 1;
  12186. queue.push( memory );
  12187. }
  12188. ( function add( args ) {
  12189. jQuery.each( args, function( _, arg ) {
  12190. if ( isFunction( arg ) ) {
  12191. if ( !options.unique || !self.has( arg ) ) {
  12192. list.push( arg );
  12193. }
  12194. } else if ( arg && arg.length && toType( arg ) !== "string" ) {
  12195. // Inspect recursively
  12196. add( arg );
  12197. }
  12198. } );
  12199. } )( arguments );
  12200. if ( memory && !firing ) {
  12201. fire();
  12202. }
  12203. }
  12204. return this;
  12205. },
  12206. // Remove a callback from the list
  12207. remove: function() {
  12208. jQuery.each( arguments, function( _, arg ) {
  12209. var index;
  12210. while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
  12211. list.splice( index, 1 );
  12212. // Handle firing indexes
  12213. if ( index <= firingIndex ) {
  12214. firingIndex--;
  12215. }
  12216. }
  12217. } );
  12218. return this;
  12219. },
  12220. // Check if a given callback is in the list.
  12221. // If no argument is given, return whether or not list has callbacks attached.
  12222. has: function( fn ) {
  12223. return fn ?
  12224. jQuery.inArray( fn, list ) > -1 :
  12225. list.length > 0;
  12226. },
  12227. // Remove all callbacks from the list
  12228. empty: function() {
  12229. if ( list ) {
  12230. list = [];
  12231. }
  12232. return this;
  12233. },
  12234. // Disable .fire and .add
  12235. // Abort any current/pending executions
  12236. // Clear all callbacks and values
  12237. disable: function() {
  12238. locked = queue = [];
  12239. list = memory = "";
  12240. return this;
  12241. },
  12242. disabled: function() {
  12243. return !list;
  12244. },
  12245. // Disable .fire
  12246. // Also disable .add unless we have memory (since it would have no effect)
  12247. // Abort any pending executions
  12248. lock: function() {
  12249. locked = queue = [];
  12250. if ( !memory && !firing ) {
  12251. list = memory = "";
  12252. }
  12253. return this;
  12254. },
  12255. locked: function() {
  12256. return !!locked;
  12257. },
  12258. // Call all callbacks with the given context and arguments
  12259. fireWith: function( context, args ) {
  12260. if ( !locked ) {
  12261. args = args || [];
  12262. args = [ context, args.slice ? args.slice() : args ];
  12263. queue.push( args );
  12264. if ( !firing ) {
  12265. fire();
  12266. }
  12267. }
  12268. return this;
  12269. },
  12270. // Call all the callbacks with the given arguments
  12271. fire: function() {
  12272. self.fireWith( this, arguments );
  12273. return this;
  12274. },
  12275. // To know if the callbacks have already been called at least once
  12276. fired: function() {
  12277. return !!fired;
  12278. }
  12279. };
  12280. return self;
  12281. };
  12282. function Identity( v ) {
  12283. return v;
  12284. }
  12285. function Thrower( ex ) {
  12286. throw ex;
  12287. }
  12288. function adoptValue( value, resolve, reject, noValue ) {
  12289. var method;
  12290. try {
  12291. // Check for promise aspect first to privilege synchronous behavior
  12292. if ( value && isFunction( ( method = value.promise ) ) ) {
  12293. method.call( value ).done( resolve ).fail( reject );
  12294. // Other thenables
  12295. } else if ( value && isFunction( ( method = value.then ) ) ) {
  12296. method.call( value, resolve, reject );
  12297. // Other non-thenables
  12298. } else {
  12299. // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer:
  12300. // * false: [ value ].slice( 0 ) => resolve( value )
  12301. // * true: [ value ].slice( 1 ) => resolve()
  12302. resolve.apply( undefined, [ value ].slice( noValue ) );
  12303. }
  12304. // For Promises/A+, convert exceptions into rejections
  12305. // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in
  12306. // Deferred#then to conditionally suppress rejection.
  12307. } catch ( value ) {
  12308. // Support: Android 4.0 only
  12309. // Strict mode functions invoked without .call/.apply get global-object context
  12310. reject.apply( undefined, [ value ] );
  12311. }
  12312. }
  12313. jQuery.extend( {
  12314. Deferred: function( func ) {
  12315. var tuples = [
  12316. // action, add listener, callbacks,
  12317. // ... .then handlers, argument index, [final state]
  12318. [ "notify", "progress", jQuery.Callbacks( "memory" ),
  12319. jQuery.Callbacks( "memory" ), 2 ],
  12320. [ "resolve", "done", jQuery.Callbacks( "once memory" ),
  12321. jQuery.Callbacks( "once memory" ), 0, "resolved" ],
  12322. [ "reject", "fail", jQuery.Callbacks( "once memory" ),
  12323. jQuery.Callbacks( "once memory" ), 1, "rejected" ]
  12324. ],
  12325. state = "pending",
  12326. promise = {
  12327. state: function() {
  12328. return state;
  12329. },
  12330. always: function() {
  12331. deferred.done( arguments ).fail( arguments );
  12332. return this;
  12333. },
  12334. "catch": function( fn ) {
  12335. return promise.then( null, fn );
  12336. },
  12337. // Keep pipe for back-compat
  12338. pipe: function( /* fnDone, fnFail, fnProgress */ ) {
  12339. var fns = arguments;
  12340. return jQuery.Deferred( function( newDefer ) {
  12341. jQuery.each( tuples, function( i, tuple ) {
  12342. // Map tuples (progress, done, fail) to arguments (done, fail, progress)
  12343. var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];
  12344. // deferred.progress(function() { bind to newDefer or newDefer.notify })
  12345. // deferred.done(function() { bind to newDefer or newDefer.resolve })
  12346. // deferred.fail(function() { bind to newDefer or newDefer.reject })
  12347. deferred[ tuple[ 1 ] ]( function() {
  12348. var returned = fn && fn.apply( this, arguments );
  12349. if ( returned && isFunction( returned.promise ) ) {
  12350. returned.promise()
  12351. .progress( newDefer.notify )
  12352. .done( newDefer.resolve )
  12353. .fail( newDefer.reject );
  12354. } else {
  12355. newDefer[ tuple[ 0 ] + "With" ](
  12356. this,
  12357. fn ? [ returned ] : arguments
  12358. );
  12359. }
  12360. } );
  12361. } );
  12362. fns = null;
  12363. } ).promise();
  12364. },
  12365. then: function( onFulfilled, onRejected, onProgress ) {
  12366. var maxDepth = 0;
  12367. function resolve( depth, deferred, handler, special ) {
  12368. return function() {
  12369. var that = this,
  12370. args = arguments,
  12371. mightThrow = function() {
  12372. var returned, then;
  12373. // Support: Promises/A+ section 2.3.3.3.3
  12374. // https://promisesaplus.com/#point-59
  12375. // Ignore double-resolution attempts
  12376. if ( depth < maxDepth ) {
  12377. return;
  12378. }
  12379. returned = handler.apply( that, args );
  12380. // Support: Promises/A+ section 2.3.1
  12381. // https://promisesaplus.com/#point-48
  12382. if ( returned === deferred.promise() ) {
  12383. throw new TypeError( "Thenable self-resolution" );
  12384. }
  12385. // Support: Promises/A+ sections 2.3.3.1, 3.5
  12386. // https://promisesaplus.com/#point-54
  12387. // https://promisesaplus.com/#point-75
  12388. // Retrieve `then` only once
  12389. then = returned &&
  12390. // Support: Promises/A+ section 2.3.4
  12391. // https://promisesaplus.com/#point-64
  12392. // Only check objects and functions for thenability
  12393. ( typeof returned === "object" ||
  12394. typeof returned === "function" ) &&
  12395. returned.then;
  12396. // Handle a returned thenable
  12397. if ( isFunction( then ) ) {
  12398. // Special processors (notify) just wait for resolution
  12399. if ( special ) {
  12400. then.call(
  12401. returned,
  12402. resolve( maxDepth, deferred, Identity, special ),
  12403. resolve( maxDepth, deferred, Thrower, special )
  12404. );
  12405. // Normal processors (resolve) also hook into progress
  12406. } else {
  12407. // ...and disregard older resolution values
  12408. maxDepth++;
  12409. then.call(
  12410. returned,
  12411. resolve( maxDepth, deferred, Identity, special ),
  12412. resolve( maxDepth, deferred, Thrower, special ),
  12413. resolve( maxDepth, deferred, Identity,
  12414. deferred.notifyWith )
  12415. );
  12416. }
  12417. // Handle all other returned values
  12418. } else {
  12419. // Only substitute handlers pass on context
  12420. // and multiple values (non-spec behavior)
  12421. if ( handler !== Identity ) {
  12422. that = undefined;
  12423. args = [ returned ];
  12424. }
  12425. // Process the value(s)
  12426. // Default process is resolve
  12427. ( special || deferred.resolveWith )( that, args );
  12428. }
  12429. },
  12430. // Only normal processors (resolve) catch and reject exceptions
  12431. process = special ?
  12432. mightThrow :
  12433. function() {
  12434. try {
  12435. mightThrow();
  12436. } catch ( e ) {
  12437. if ( jQuery.Deferred.exceptionHook ) {
  12438. jQuery.Deferred.exceptionHook( e,
  12439. process.stackTrace );
  12440. }
  12441. // Support: Promises/A+ section 2.3.3.3.4.1
  12442. // https://promisesaplus.com/#point-61
  12443. // Ignore post-resolution exceptions
  12444. if ( depth + 1 >= maxDepth ) {
  12445. // Only substitute handlers pass on context
  12446. // and multiple values (non-spec behavior)
  12447. if ( handler !== Thrower ) {
  12448. that = undefined;
  12449. args = [ e ];
  12450. }
  12451. deferred.rejectWith( that, args );
  12452. }
  12453. }
  12454. };
  12455. // Support: Promises/A+ section 2.3.3.3.1
  12456. // https://promisesaplus.com/#point-57
  12457. // Re-resolve promises immediately to dodge false rejection from
  12458. // subsequent errors
  12459. if ( depth ) {
  12460. process();
  12461. } else {
  12462. // Call an optional hook to record the stack, in case of exception
  12463. // since it's otherwise lost when execution goes async
  12464. if ( jQuery.Deferred.getStackHook ) {
  12465. process.stackTrace = jQuery.Deferred.getStackHook();
  12466. }
  12467. window.setTimeout( process );
  12468. }
  12469. };
  12470. }
  12471. return jQuery.Deferred( function( newDefer ) {
  12472. // progress_handlers.add( ... )
  12473. tuples[ 0 ][ 3 ].add(
  12474. resolve(
  12475. 0,
  12476. newDefer,
  12477. isFunction( onProgress ) ?
  12478. onProgress :
  12479. Identity,
  12480. newDefer.notifyWith
  12481. )
  12482. );
  12483. // fulfilled_handlers.add( ... )
  12484. tuples[ 1 ][ 3 ].add(
  12485. resolve(
  12486. 0,
  12487. newDefer,
  12488. isFunction( onFulfilled ) ?
  12489. onFulfilled :
  12490. Identity
  12491. )
  12492. );
  12493. // rejected_handlers.add( ... )
  12494. tuples[ 2 ][ 3 ].add(
  12495. resolve(
  12496. 0,
  12497. newDefer,
  12498. isFunction( onRejected ) ?
  12499. onRejected :
  12500. Thrower
  12501. )
  12502. );
  12503. } ).promise();
  12504. },
  12505. // Get a promise for this deferred
  12506. // If obj is provided, the promise aspect is added to the object
  12507. promise: function( obj ) {
  12508. return obj != null ? jQuery.extend( obj, promise ) : promise;
  12509. }
  12510. },
  12511. deferred = {};
  12512. // Add list-specific methods
  12513. jQuery.each( tuples, function( i, tuple ) {
  12514. var list = tuple[ 2 ],
  12515. stateString = tuple[ 5 ];
  12516. // promise.progress = list.add
  12517. // promise.done = list.add
  12518. // promise.fail = list.add
  12519. promise[ tuple[ 1 ] ] = list.add;
  12520. // Handle state
  12521. if ( stateString ) {
  12522. list.add(
  12523. function() {
  12524. // state = "resolved" (i.e., fulfilled)
  12525. // state = "rejected"
  12526. state = stateString;
  12527. },
  12528. // rejected_callbacks.disable
  12529. // fulfilled_callbacks.disable
  12530. tuples[ 3 - i ][ 2 ].disable,
  12531. // rejected_handlers.disable
  12532. // fulfilled_handlers.disable
  12533. tuples[ 3 - i ][ 3 ].disable,
  12534. // progress_callbacks.lock
  12535. tuples[ 0 ][ 2 ].lock,
  12536. // progress_handlers.lock
  12537. tuples[ 0 ][ 3 ].lock
  12538. );
  12539. }
  12540. // progress_handlers.fire
  12541. // fulfilled_handlers.fire
  12542. // rejected_handlers.fire
  12543. list.add( tuple[ 3 ].fire );
  12544. // deferred.notify = function() { deferred.notifyWith(...) }
  12545. // deferred.resolve = function() { deferred.resolveWith(...) }
  12546. // deferred.reject = function() { deferred.rejectWith(...) }
  12547. deferred[ tuple[ 0 ] ] = function() {
  12548. deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments );
  12549. return this;
  12550. };
  12551. // deferred.notifyWith = list.fireWith
  12552. // deferred.resolveWith = list.fireWith
  12553. // deferred.rejectWith = list.fireWith
  12554. deferred[ tuple[ 0 ] + "With" ] = list.fireWith;
  12555. } );
  12556. // Make the deferred a promise
  12557. promise.promise( deferred );
  12558. // Call given func if any
  12559. if ( func ) {
  12560. func.call( deferred, deferred );
  12561. }
  12562. // All done!
  12563. return deferred;
  12564. },
  12565. // Deferred helper
  12566. when: function( singleValue ) {
  12567. var
  12568. // count of uncompleted subordinates
  12569. remaining = arguments.length,
  12570. // count of unprocessed arguments
  12571. i = remaining,
  12572. // subordinate fulfillment data
  12573. resolveContexts = Array( i ),
  12574. resolveValues = slice.call( arguments ),
  12575. // the master Deferred
  12576. master = jQuery.Deferred(),
  12577. // subordinate callback factory
  12578. updateFunc = function( i ) {
  12579. return function( value ) {
  12580. resolveContexts[ i ] = this;
  12581. resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
  12582. if ( !( --remaining ) ) {
  12583. master.resolveWith( resolveContexts, resolveValues );
  12584. }
  12585. };
  12586. };
  12587. // Single- and empty arguments are adopted like Promise.resolve
  12588. if ( remaining <= 1 ) {
  12589. adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject,
  12590. !remaining );
  12591. // Use .then() to unwrap secondary thenables (cf. gh-3000)
  12592. if ( master.state() === "pending" ||
  12593. isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {
  12594. return master.then();
  12595. }
  12596. }
  12597. // Multiple arguments are aggregated like Promise.all array elements
  12598. while ( i-- ) {
  12599. adoptValue( resolveValues[ i ], updateFunc( i ), master.reject );
  12600. }
  12601. return master.promise();
  12602. }
  12603. } );
  12604. // These usually indicate a programmer mistake during development,
  12605. // warn about them ASAP rather than swallowing them by default.
  12606. var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
  12607. jQuery.Deferred.exceptionHook = function( error, stack ) {
  12608. // Support: IE 8 - 9 only
  12609. // Console exists when dev tools are open, which can happen at any time
  12610. if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {
  12611. window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack );
  12612. }
  12613. };
  12614. jQuery.readyException = function( error ) {
  12615. window.setTimeout( function() {
  12616. throw error;
  12617. } );
  12618. };
  12619. // The deferred used on DOM ready
  12620. var readyList = jQuery.Deferred();
  12621. jQuery.fn.ready = function( fn ) {
  12622. readyList
  12623. .then( fn )
  12624. // Wrap jQuery.readyException in a function so that the lookup
  12625. // happens at the time of error handling instead of callback
  12626. // registration.
  12627. .catch( function( error ) {
  12628. jQuery.readyException( error );
  12629. } );
  12630. return this;
  12631. };
  12632. jQuery.extend( {
  12633. // Is the DOM ready to be used? Set to true once it occurs.
  12634. isReady: false,
  12635. // A counter to track how many items to wait for before
  12636. // the ready event fires. See #6781
  12637. readyWait: 1,
  12638. // Handle when the DOM is ready
  12639. ready: function( wait ) {
  12640. // Abort if there are pending holds or we're already ready
  12641. if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
  12642. return;
  12643. }
  12644. // Remember that the DOM is ready
  12645. jQuery.isReady = true;
  12646. // If a normal DOM Ready event fired, decrement, and wait if need be
  12647. if ( wait !== true && --jQuery.readyWait > 0 ) {
  12648. return;
  12649. }
  12650. // If there are functions bound, to execute
  12651. readyList.resolveWith( document, [ jQuery ] );
  12652. }
  12653. } );
  12654. jQuery.ready.then = readyList.then;
  12655. // The ready event handler and self cleanup method
  12656. function completed() {
  12657. document.removeEventListener( "DOMContentLoaded", completed );
  12658. window.removeEventListener( "load", completed );
  12659. jQuery.ready();
  12660. }
  12661. // Catch cases where $(document).ready() is called
  12662. // after the browser event has already occurred.
  12663. // Support: IE <=9 - 10 only
  12664. // Older IE sometimes signals "interactive" too soon
  12665. if ( document.readyState === "complete" ||
  12666. ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {
  12667. // Handle it asynchronously to allow scripts the opportunity to delay ready
  12668. window.setTimeout( jQuery.ready );
  12669. } else {
  12670. // Use the handy event callback
  12671. document.addEventListener( "DOMContentLoaded", completed );
  12672. // A fallback to window.onload, that will always work
  12673. window.addEventListener( "load", completed );
  12674. }
  12675. // Multifunctional method to get and set values of a collection
  12676. // The value/s can optionally be executed if it's a function
  12677. var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
  12678. var i = 0,
  12679. len = elems.length,
  12680. bulk = key == null;
  12681. // Sets many values
  12682. if ( toType( key ) === "object" ) {
  12683. chainable = true;
  12684. for ( i in key ) {
  12685. access( elems, fn, i, key[ i ], true, emptyGet, raw );
  12686. }
  12687. // Sets one value
  12688. } else if ( value !== undefined ) {
  12689. chainable = true;
  12690. if ( !isFunction( value ) ) {
  12691. raw = true;
  12692. }
  12693. if ( bulk ) {
  12694. // Bulk operations run against the entire set
  12695. if ( raw ) {
  12696. fn.call( elems, value );
  12697. fn = null;
  12698. // ...except when executing function values
  12699. } else {
  12700. bulk = fn;
  12701. fn = function( elem, key, value ) {
  12702. return bulk.call( jQuery( elem ), value );
  12703. };
  12704. }
  12705. }
  12706. if ( fn ) {
  12707. for ( ; i < len; i++ ) {
  12708. fn(
  12709. elems[ i ], key, raw ?
  12710. value :
  12711. value.call( elems[ i ], i, fn( elems[ i ], key ) )
  12712. );
  12713. }
  12714. }
  12715. }
  12716. if ( chainable ) {
  12717. return elems;
  12718. }
  12719. // Gets
  12720. if ( bulk ) {
  12721. return fn.call( elems );
  12722. }
  12723. return len ? fn( elems[ 0 ], key ) : emptyGet;
  12724. };
  12725. // Matches dashed string for camelizing
  12726. var rmsPrefix = /^-ms-/,
  12727. rdashAlpha = /-([a-z])/g;
  12728. // Used by camelCase as callback to replace()
  12729. function fcamelCase( all, letter ) {
  12730. return letter.toUpperCase();
  12731. }
  12732. // Convert dashed to camelCase; used by the css and data modules
  12733. // Support: IE <=9 - 11, Edge 12 - 15
  12734. // Microsoft forgot to hump their vendor prefix (#9572)
  12735. function camelCase( string ) {
  12736. return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
  12737. }
  12738. var acceptData = function( owner ) {
  12739. // Accepts only:
  12740. // - Node
  12741. // - Node.ELEMENT_NODE
  12742. // - Node.DOCUMENT_NODE
  12743. // - Object
  12744. // - Any
  12745. return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
  12746. };
  12747. function Data() {
  12748. this.expando = jQuery.expando + Data.uid++;
  12749. }
  12750. Data.uid = 1;
  12751. Data.prototype = {
  12752. cache: function( owner ) {
  12753. // Check if the owner object already has a cache
  12754. var value = owner[ this.expando ];
  12755. // If not, create one
  12756. if ( !value ) {
  12757. value = {};
  12758. // We can accept data for non-element nodes in modern browsers,
  12759. // but we should not, see #8335.
  12760. // Always return an empty object.
  12761. if ( acceptData( owner ) ) {
  12762. // If it is a node unlikely to be stringify-ed or looped over
  12763. // use plain assignment
  12764. if ( owner.nodeType ) {
  12765. owner[ this.expando ] = value;
  12766. // Otherwise secure it in a non-enumerable property
  12767. // configurable must be true to allow the property to be
  12768. // deleted when data is removed
  12769. } else {
  12770. Object.defineProperty( owner, this.expando, {
  12771. value: value,
  12772. configurable: true
  12773. } );
  12774. }
  12775. }
  12776. }
  12777. return value;
  12778. },
  12779. set: function( owner, data, value ) {
  12780. var prop,
  12781. cache = this.cache( owner );
  12782. // Handle: [ owner, key, value ] args
  12783. // Always use camelCase key (gh-2257)
  12784. if ( typeof data === "string" ) {
  12785. cache[ camelCase( data ) ] = value;
  12786. // Handle: [ owner, { properties } ] args
  12787. } else {
  12788. // Copy the properties one-by-one to the cache object
  12789. for ( prop in data ) {
  12790. cache[ camelCase( prop ) ] = data[ prop ];
  12791. }
  12792. }
  12793. return cache;
  12794. },
  12795. get: function( owner, key ) {
  12796. return key === undefined ?
  12797. this.cache( owner ) :
  12798. // Always use camelCase key (gh-2257)
  12799. owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ];
  12800. },
  12801. access: function( owner, key, value ) {
  12802. // In cases where either:
  12803. //
  12804. // 1. No key was specified
  12805. // 2. A string key was specified, but no value provided
  12806. //
  12807. // Take the "read" path and allow the get method to determine
  12808. // which value to return, respectively either:
  12809. //
  12810. // 1. The entire cache object
  12811. // 2. The data stored at the key
  12812. //
  12813. if ( key === undefined ||
  12814. ( ( key && typeof key === "string" ) && value === undefined ) ) {
  12815. return this.get( owner, key );
  12816. }
  12817. // When the key is not a string, or both a key and value
  12818. // are specified, set or extend (existing objects) with either:
  12819. //
  12820. // 1. An object of properties
  12821. // 2. A key and value
  12822. //
  12823. this.set( owner, key, value );
  12824. // Since the "set" path can have two possible entry points
  12825. // return the expected data based on which path was taken[*]
  12826. return value !== undefined ? value : key;
  12827. },
  12828. remove: function( owner, key ) {
  12829. var i,
  12830. cache = owner[ this.expando ];
  12831. if ( cache === undefined ) {
  12832. return;
  12833. }
  12834. if ( key !== undefined ) {
  12835. // Support array or space separated string of keys
  12836. if ( Array.isArray( key ) ) {
  12837. // If key is an array of keys...
  12838. // We always set camelCase keys, so remove that.
  12839. key = key.map( camelCase );
  12840. } else {
  12841. key = camelCase( key );
  12842. // If a key with the spaces exists, use it.
  12843. // Otherwise, create an array by matching non-whitespace
  12844. key = key in cache ?
  12845. [ key ] :
  12846. ( key.match( rnothtmlwhite ) || [] );
  12847. }
  12848. i = key.length;
  12849. while ( i-- ) {
  12850. delete cache[ key[ i ] ];
  12851. }
  12852. }
  12853. // Remove the expando if there's no more data
  12854. if ( key === undefined || jQuery.isEmptyObject( cache ) ) {
  12855. // Support: Chrome <=35 - 45
  12856. // Webkit & Blink performance suffers when deleting properties
  12857. // from DOM nodes, so set to undefined instead
  12858. // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)
  12859. if ( owner.nodeType ) {
  12860. owner[ this.expando ] = undefined;
  12861. } else {
  12862. delete owner[ this.expando ];
  12863. }
  12864. }
  12865. },
  12866. hasData: function( owner ) {
  12867. var cache = owner[ this.expando ];
  12868. return cache !== undefined && !jQuery.isEmptyObject( cache );
  12869. }
  12870. };
  12871. var dataPriv = new Data();
  12872. var dataUser = new Data();
  12873. // Implementation Summary
  12874. //
  12875. // 1. Enforce API surface and semantic compatibility with 1.9.x branch
  12876. // 2. Improve the module's maintainability by reducing the storage
  12877. // paths to a single mechanism.
  12878. // 3. Use the same single mechanism to support "private" and "user" data.
  12879. // 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
  12880. // 5. Avoid exposing implementation details on user objects (eg. expando properties)
  12881. // 6. Provide a clear path for implementation upgrade to WeakMap in 2014
  12882. var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
  12883. rmultiDash = /[A-Z]/g;
  12884. function getData( data ) {
  12885. if ( data === "true" ) {
  12886. return true;
  12887. }
  12888. if ( data === "false" ) {
  12889. return false;
  12890. }
  12891. if ( data === "null" ) {
  12892. return null;
  12893. }
  12894. // Only convert to a number if it doesn't change the string
  12895. if ( data === +data + "" ) {
  12896. return +data;
  12897. }
  12898. if ( rbrace.test( data ) ) {
  12899. return JSON.parse( data );
  12900. }
  12901. return data;
  12902. }
  12903. function dataAttr( elem, key, data ) {
  12904. var name;
  12905. // If nothing was found internally, try to fetch any
  12906. // data from the HTML5 data-* attribute
  12907. if ( data === undefined && elem.nodeType === 1 ) {
  12908. name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase();
  12909. data = elem.getAttribute( name );
  12910. if ( typeof data === "string" ) {
  12911. try {
  12912. data = getData( data );
  12913. } catch ( e ) {}
  12914. // Make sure we set the data so it isn't changed later
  12915. dataUser.set( elem, key, data );
  12916. } else {
  12917. data = undefined;
  12918. }
  12919. }
  12920. return data;
  12921. }
  12922. jQuery.extend( {
  12923. hasData: function( elem ) {
  12924. return dataUser.hasData( elem ) || dataPriv.hasData( elem );
  12925. },
  12926. data: function( elem, name, data ) {
  12927. return dataUser.access( elem, name, data );
  12928. },
  12929. removeData: function( elem, name ) {
  12930. dataUser.remove( elem, name );
  12931. },
  12932. // TODO: Now that all calls to _data and _removeData have been replaced
  12933. // with direct calls to dataPriv methods, these can be deprecated.
  12934. _data: function( elem, name, data ) {
  12935. return dataPriv.access( elem, name, data );
  12936. },
  12937. _removeData: function( elem, name ) {
  12938. dataPriv.remove( elem, name );
  12939. }
  12940. } );
  12941. jQuery.fn.extend( {
  12942. data: function( key, value ) {
  12943. var i, name, data,
  12944. elem = this[ 0 ],
  12945. attrs = elem && elem.attributes;
  12946. // Gets all values
  12947. if ( key === undefined ) {
  12948. if ( this.length ) {
  12949. data = dataUser.get( elem );
  12950. if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) {
  12951. i = attrs.length;
  12952. while ( i-- ) {
  12953. // Support: IE 11 only
  12954. // The attrs elements can be null (#14894)
  12955. if ( attrs[ i ] ) {
  12956. name = attrs[ i ].name;
  12957. if ( name.indexOf( "data-" ) === 0 ) {
  12958. name = camelCase( name.slice( 5 ) );
  12959. dataAttr( elem, name, data[ name ] );
  12960. }
  12961. }
  12962. }
  12963. dataPriv.set( elem, "hasDataAttrs", true );
  12964. }
  12965. }
  12966. return data;
  12967. }
  12968. // Sets multiple values
  12969. if ( typeof key === "object" ) {
  12970. return this.each( function() {
  12971. dataUser.set( this, key );
  12972. } );
  12973. }
  12974. return access( this, function( value ) {
  12975. var data;
  12976. // The calling jQuery object (element matches) is not empty
  12977. // (and therefore has an element appears at this[ 0 ]) and the
  12978. // `value` parameter was not undefined. An empty jQuery object
  12979. // will result in `undefined` for elem = this[ 0 ] which will
  12980. // throw an exception if an attempt to read a data cache is made.
  12981. if ( elem && value === undefined ) {
  12982. // Attempt to get data from the cache
  12983. // The key will always be camelCased in Data
  12984. data = dataUser.get( elem, key );
  12985. if ( data !== undefined ) {
  12986. return data;
  12987. }
  12988. // Attempt to "discover" the data in
  12989. // HTML5 custom data-* attrs
  12990. data = dataAttr( elem, key );
  12991. if ( data !== undefined ) {
  12992. return data;
  12993. }
  12994. // We tried really hard, but the data doesn't exist.
  12995. return;
  12996. }
  12997. // Set the data...
  12998. this.each( function() {
  12999. // We always store the camelCased key
  13000. dataUser.set( this, key, value );
  13001. } );
  13002. }, null, value, arguments.length > 1, null, true );
  13003. },
  13004. removeData: function( key ) {
  13005. return this.each( function() {
  13006. dataUser.remove( this, key );
  13007. } );
  13008. }
  13009. } );
  13010. jQuery.extend( {
  13011. queue: function( elem, type, data ) {
  13012. var queue;
  13013. if ( elem ) {
  13014. type = ( type || "fx" ) + "queue";
  13015. queue = dataPriv.get( elem, type );
  13016. // Speed up dequeue by getting out quickly if this is just a lookup
  13017. if ( data ) {
  13018. if ( !queue || Array.isArray( data ) ) {
  13019. queue = dataPriv.access( elem, type, jQuery.makeArray( data ) );
  13020. } else {
  13021. queue.push( data );
  13022. }
  13023. }
  13024. return queue || [];
  13025. }
  13026. },
  13027. dequeue: function( elem, type ) {
  13028. type = type || "fx";
  13029. var queue = jQuery.queue( elem, type ),
  13030. startLength = queue.length,
  13031. fn = queue.shift(),
  13032. hooks = jQuery._queueHooks( elem, type ),
  13033. next = function() {
  13034. jQuery.dequeue( elem, type );
  13035. };
  13036. // If the fx queue is dequeued, always remove the progress sentinel
  13037. if ( fn === "inprogress" ) {
  13038. fn = queue.shift();
  13039. startLength--;
  13040. }
  13041. if ( fn ) {
  13042. // Add a progress sentinel to prevent the fx queue from being
  13043. // automatically dequeued
  13044. if ( type === "fx" ) {
  13045. queue.unshift( "inprogress" );
  13046. }
  13047. // Clear up the last queue stop function
  13048. delete hooks.stop;
  13049. fn.call( elem, next, hooks );
  13050. }
  13051. if ( !startLength && hooks ) {
  13052. hooks.empty.fire();
  13053. }
  13054. },
  13055. // Not public - generate a queueHooks object, or return the current one
  13056. _queueHooks: function( elem, type ) {
  13057. var key = type + "queueHooks";
  13058. return dataPriv.get( elem, key ) || dataPriv.access( elem, key, {
  13059. empty: jQuery.Callbacks( "once memory" ).add( function() {
  13060. dataPriv.remove( elem, [ type + "queue", key ] );
  13061. } )
  13062. } );
  13063. }
  13064. } );
  13065. jQuery.fn.extend( {
  13066. queue: function( type, data ) {
  13067. var setter = 2;
  13068. if ( typeof type !== "string" ) {
  13069. data = type;
  13070. type = "fx";
  13071. setter--;
  13072. }
  13073. if ( arguments.length < setter ) {
  13074. return jQuery.queue( this[ 0 ], type );
  13075. }
  13076. return data === undefined ?
  13077. this :
  13078. this.each( function() {
  13079. var queue = jQuery.queue( this, type, data );
  13080. // Ensure a hooks for this queue
  13081. jQuery._queueHooks( this, type );
  13082. if ( type === "fx" && queue[ 0 ] !== "inprogress" ) {
  13083. jQuery.dequeue( this, type );
  13084. }
  13085. } );
  13086. },
  13087. dequeue: function( type ) {
  13088. return this.each( function() {
  13089. jQuery.dequeue( this, type );
  13090. } );
  13091. },
  13092. clearQueue: function( type ) {
  13093. return this.queue( type || "fx", [] );
  13094. },
  13095. // Get a promise resolved when queues of a certain type
  13096. // are emptied (fx is the type by default)
  13097. promise: function( type, obj ) {
  13098. var tmp,
  13099. count = 1,
  13100. defer = jQuery.Deferred(),
  13101. elements = this,
  13102. i = this.length,
  13103. resolve = function() {
  13104. if ( !( --count ) ) {
  13105. defer.resolveWith( elements, [ elements ] );
  13106. }
  13107. };
  13108. if ( typeof type !== "string" ) {
  13109. obj = type;
  13110. type = undefined;
  13111. }
  13112. type = type || "fx";
  13113. while ( i-- ) {
  13114. tmp = dataPriv.get( elements[ i ], type + "queueHooks" );
  13115. if ( tmp && tmp.empty ) {
  13116. count++;
  13117. tmp.empty.add( resolve );
  13118. }
  13119. }
  13120. resolve();
  13121. return defer.promise( obj );
  13122. }
  13123. } );
  13124. var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;
  13125. var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );
  13126. var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
  13127. var documentElement = document.documentElement;
  13128. var isAttached = function( elem ) {
  13129. return jQuery.contains( elem.ownerDocument, elem );
  13130. },
  13131. composed = { composed: true };
  13132. // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only
  13133. // Check attachment across shadow DOM boundaries when possible (gh-3504)
  13134. // Support: iOS 10.0-10.2 only
  13135. // Early iOS 10 versions support `attachShadow` but not `getRootNode`,
  13136. // leading to errors. We need to check for `getRootNode`.
  13137. if ( documentElement.getRootNode ) {
  13138. isAttached = function( elem ) {
  13139. return jQuery.contains( elem.ownerDocument, elem ) ||
  13140. elem.getRootNode( composed ) === elem.ownerDocument;
  13141. };
  13142. }
  13143. var isHiddenWithinTree = function( elem, el ) {
  13144. // isHiddenWithinTree might be called from jQuery#filter function;
  13145. // in that case, element will be second argument
  13146. elem = el || elem;
  13147. // Inline style trumps all
  13148. return elem.style.display === "none" ||
  13149. elem.style.display === "" &&
  13150. // Otherwise, check computed style
  13151. // Support: Firefox <=43 - 45
  13152. // Disconnected elements can have computed display: none, so first confirm that elem is
  13153. // in the document.
  13154. isAttached( elem ) &&
  13155. jQuery.css( elem, "display" ) === "none";
  13156. };
  13157. var swap = function( elem, options, callback, args ) {
  13158. var ret, name,
  13159. old = {};
  13160. // Remember the old values, and insert the new ones
  13161. for ( name in options ) {
  13162. old[ name ] = elem.style[ name ];
  13163. elem.style[ name ] = options[ name ];
  13164. }
  13165. ret = callback.apply( elem, args || [] );
  13166. // Revert the old values
  13167. for ( name in options ) {
  13168. elem.style[ name ] = old[ name ];
  13169. }
  13170. return ret;
  13171. };
  13172. function adjustCSS( elem, prop, valueParts, tween ) {
  13173. var adjusted, scale,
  13174. maxIterations = 20,
  13175. currentValue = tween ?
  13176. function() {
  13177. return tween.cur();
  13178. } :
  13179. function() {
  13180. return jQuery.css( elem, prop, "" );
  13181. },
  13182. initial = currentValue(),
  13183. unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
  13184. // Starting value computation is required for potential unit mismatches
  13185. initialInUnit = elem.nodeType &&
  13186. ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
  13187. rcssNum.exec( jQuery.css( elem, prop ) );
  13188. if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
  13189. // Support: Firefox <=54
  13190. // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144)
  13191. initial = initial / 2;
  13192. // Trust units reported by jQuery.css
  13193. unit = unit || initialInUnit[ 3 ];
  13194. // Iteratively approximate from a nonzero starting point
  13195. initialInUnit = +initial || 1;
  13196. while ( maxIterations-- ) {
  13197. // Evaluate and update our best guess (doubling guesses that zero out).
  13198. // Finish if the scale equals or crosses 1 (making the old*new product non-positive).
  13199. jQuery.style( elem, prop, initialInUnit + unit );
  13200. if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) {
  13201. maxIterations = 0;
  13202. }
  13203. initialInUnit = initialInUnit / scale;
  13204. }
  13205. initialInUnit = initialInUnit * 2;
  13206. jQuery.style( elem, prop, initialInUnit + unit );
  13207. // Make sure we update the tween properties later on
  13208. valueParts = valueParts || [];
  13209. }
  13210. if ( valueParts ) {
  13211. initialInUnit = +initialInUnit || +initial || 0;
  13212. // Apply relative offset (+=/-=) if specified
  13213. adjusted = valueParts[ 1 ] ?
  13214. initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :
  13215. +valueParts[ 2 ];
  13216. if ( tween ) {
  13217. tween.unit = unit;
  13218. tween.start = initialInUnit;
  13219. tween.end = adjusted;
  13220. }
  13221. }
  13222. return adjusted;
  13223. }
  13224. var defaultDisplayMap = {};
  13225. function getDefaultDisplay( elem ) {
  13226. var temp,
  13227. doc = elem.ownerDocument,
  13228. nodeName = elem.nodeName,
  13229. display = defaultDisplayMap[ nodeName ];
  13230. if ( display ) {
  13231. return display;
  13232. }
  13233. temp = doc.body.appendChild( doc.createElement( nodeName ) );
  13234. display = jQuery.css( temp, "display" );
  13235. temp.parentNode.removeChild( temp );
  13236. if ( display === "none" ) {
  13237. display = "block";
  13238. }
  13239. defaultDisplayMap[ nodeName ] = display;
  13240. return display;
  13241. }
  13242. function showHide( elements, show ) {
  13243. var display, elem,
  13244. values = [],
  13245. index = 0,
  13246. length = elements.length;
  13247. // Determine new display value for elements that need to change
  13248. for ( ; index < length; index++ ) {
  13249. elem = elements[ index ];
  13250. if ( !elem.style ) {
  13251. continue;
  13252. }
  13253. display = elem.style.display;
  13254. if ( show ) {
  13255. // Since we force visibility upon cascade-hidden elements, an immediate (and slow)
  13256. // check is required in this first loop unless we have a nonempty display value (either
  13257. // inline or about-to-be-restored)
  13258. if ( display === "none" ) {
  13259. values[ index ] = dataPriv.get( elem, "display" ) || null;
  13260. if ( !values[ index ] ) {
  13261. elem.style.display = "";
  13262. }
  13263. }
  13264. if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) {
  13265. values[ index ] = getDefaultDisplay( elem );
  13266. }
  13267. } else {
  13268. if ( display !== "none" ) {
  13269. values[ index ] = "none";
  13270. // Remember what we're overwriting
  13271. dataPriv.set( elem, "display", display );
  13272. }
  13273. }
  13274. }
  13275. // Set the display of the elements in a second loop to avoid constant reflow
  13276. for ( index = 0; index < length; index++ ) {
  13277. if ( values[ index ] != null ) {
  13278. elements[ index ].style.display = values[ index ];
  13279. }
  13280. }
  13281. return elements;
  13282. }
  13283. jQuery.fn.extend( {
  13284. show: function() {
  13285. return showHide( this, true );
  13286. },
  13287. hide: function() {
  13288. return showHide( this );
  13289. },
  13290. toggle: function( state ) {
  13291. if ( typeof state === "boolean" ) {
  13292. return state ? this.show() : this.hide();
  13293. }
  13294. return this.each( function() {
  13295. if ( isHiddenWithinTree( this ) ) {
  13296. jQuery( this ).show();
  13297. } else {
  13298. jQuery( this ).hide();
  13299. }
  13300. } );
  13301. }
  13302. } );
  13303. var rcheckableType = ( /^(?:checkbox|radio)$/i );
  13304. var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i );
  13305. var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i );
  13306. // We have to close these tags to support XHTML (#13200)
  13307. var wrapMap = {
  13308. // Support: IE <=9 only
  13309. option: [ 1, "<select multiple='multiple'>", "</select>" ],
  13310. // XHTML parsers do not magically insert elements in the
  13311. // same way that tag soup parsers do. So we cannot shorten
  13312. // this by omitting <tbody> or other required elements.
  13313. thead: [ 1, "<table>", "</table>" ],
  13314. col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
  13315. tr: [ 2, "<table><tbody>", "</tbody></table>" ],
  13316. td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
  13317. _default: [ 0, "", "" ]
  13318. };
  13319. // Support: IE <=9 only
  13320. wrapMap.optgroup = wrapMap.option;
  13321. wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
  13322. wrapMap.th = wrapMap.td;
  13323. function getAll( context, tag ) {
  13324. // Support: IE <=9 - 11 only
  13325. // Use typeof to avoid zero-argument method invocation on host objects (#15151)
  13326. var ret;
  13327. if ( typeof context.getElementsByTagName !== "undefined" ) {
  13328. ret = context.getElementsByTagName( tag || "*" );
  13329. } else if ( typeof context.querySelectorAll !== "undefined" ) {
  13330. ret = context.querySelectorAll( tag || "*" );
  13331. } else {
  13332. ret = [];
  13333. }
  13334. if ( tag === undefined || tag && nodeName( context, tag ) ) {
  13335. return jQuery.merge( [ context ], ret );
  13336. }
  13337. return ret;
  13338. }
  13339. // Mark scripts as having already been evaluated
  13340. function setGlobalEval( elems, refElements ) {
  13341. var i = 0,
  13342. l = elems.length;
  13343. for ( ; i < l; i++ ) {
  13344. dataPriv.set(
  13345. elems[ i ],
  13346. "globalEval",
  13347. !refElements || dataPriv.get( refElements[ i ], "globalEval" )
  13348. );
  13349. }
  13350. }
  13351. var rhtml = /<|&#?\w+;/;
  13352. function buildFragment( elems, context, scripts, selection, ignored ) {
  13353. var elem, tmp, tag, wrap, attached, j,
  13354. fragment = context.createDocumentFragment(),
  13355. nodes = [],
  13356. i = 0,
  13357. l = elems.length;
  13358. for ( ; i < l; i++ ) {
  13359. elem = elems[ i ];
  13360. if ( elem || elem === 0 ) {
  13361. // Add nodes directly
  13362. if ( toType( elem ) === "object" ) {
  13363. // Support: Android <=4.0 only, PhantomJS 1 only
  13364. // push.apply(_, arraylike) throws on ancient WebKit
  13365. jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
  13366. // Convert non-html into a text node
  13367. } else if ( !rhtml.test( elem ) ) {
  13368. nodes.push( context.createTextNode( elem ) );
  13369. // Convert html into DOM nodes
  13370. } else {
  13371. tmp = tmp || fragment.appendChild( context.createElement( "div" ) );
  13372. // Deserialize a standard representation
  13373. tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
  13374. wrap = wrapMap[ tag ] || wrapMap._default;
  13375. tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];
  13376. // Descend through wrappers to the right content
  13377. j = wrap[ 0 ];
  13378. while ( j-- ) {
  13379. tmp = tmp.lastChild;
  13380. }
  13381. // Support: Android <=4.0 only, PhantomJS 1 only
  13382. // push.apply(_, arraylike) throws on ancient WebKit
  13383. jQuery.merge( nodes, tmp.childNodes );
  13384. // Remember the top-level container
  13385. tmp = fragment.firstChild;
  13386. // Ensure the created nodes are orphaned (#12392)
  13387. tmp.textContent = "";
  13388. }
  13389. }
  13390. }
  13391. // Remove wrapper from fragment
  13392. fragment.textContent = "";
  13393. i = 0;
  13394. while ( ( elem = nodes[ i++ ] ) ) {
  13395. // Skip elements already in the context collection (trac-4087)
  13396. if ( selection && jQuery.inArray( elem, selection ) > -1 ) {
  13397. if ( ignored ) {
  13398. ignored.push( elem );
  13399. }
  13400. continue;
  13401. }
  13402. attached = isAttached( elem );
  13403. // Append to fragment
  13404. tmp = getAll( fragment.appendChild( elem ), "script" );
  13405. // Preserve script evaluation history
  13406. if ( attached ) {
  13407. setGlobalEval( tmp );
  13408. }
  13409. // Capture executables
  13410. if ( scripts ) {
  13411. j = 0;
  13412. while ( ( elem = tmp[ j++ ] ) ) {
  13413. if ( rscriptType.test( elem.type || "" ) ) {
  13414. scripts.push( elem );
  13415. }
  13416. }
  13417. }
  13418. }
  13419. return fragment;
  13420. }
  13421. ( function() {
  13422. var fragment = document.createDocumentFragment(),
  13423. div = fragment.appendChild( document.createElement( "div" ) ),
  13424. input = document.createElement( "input" );
  13425. // Support: Android 4.0 - 4.3 only
  13426. // Check state lost if the name is set (#11217)
  13427. // Support: Windows Web Apps (WWA)
  13428. // `name` and `type` must use .setAttribute for WWA (#14901)
  13429. input.setAttribute( "type", "radio" );
  13430. input.setAttribute( "checked", "checked" );
  13431. input.setAttribute( "name", "t" );
  13432. div.appendChild( input );
  13433. // Support: Android <=4.1 only
  13434. // Older WebKit doesn't clone checked state correctly in fragments
  13435. support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
  13436. // Support: IE <=11 only
  13437. // Make sure textarea (and checkbox) defaultValue is properly cloned
  13438. div.innerHTML = "<textarea>x</textarea>";
  13439. support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
  13440. } )();
  13441. var
  13442. rkeyEvent = /^key/,
  13443. rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
  13444. rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
  13445. function returnTrue() {
  13446. return true;
  13447. }
  13448. function returnFalse() {
  13449. return false;
  13450. }
  13451. // Support: IE <=9 - 11+
  13452. // focus() and blur() are asynchronous, except when they are no-op.
  13453. // So expect focus to be synchronous when the element is already active,
  13454. // and blur to be synchronous when the element is not already active.
  13455. // (focus and blur are always synchronous in other supported browsers,
  13456. // this just defines when we can count on it).
  13457. function expectSync( elem, type ) {
  13458. return ( elem === safeActiveElement() ) === ( type === "focus" );
  13459. }
  13460. // Support: IE <=9 only
  13461. // Accessing document.activeElement can throw unexpectedly
  13462. // https://bugs.jquery.com/ticket/13393
  13463. function safeActiveElement() {
  13464. try {
  13465. return document.activeElement;
  13466. } catch ( err ) { }
  13467. }
  13468. function on( elem, types, selector, data, fn, one ) {
  13469. var origFn, type;
  13470. // Types can be a map of types/handlers
  13471. if ( typeof types === "object" ) {
  13472. // ( types-Object, selector, data )
  13473. if ( typeof selector !== "string" ) {
  13474. // ( types-Object, data )
  13475. data = data || selector;
  13476. selector = undefined;
  13477. }
  13478. for ( type in types ) {
  13479. on( elem, type, selector, data, types[ type ], one );
  13480. }
  13481. return elem;
  13482. }
  13483. if ( data == null && fn == null ) {
  13484. // ( types, fn )
  13485. fn = selector;
  13486. data = selector = undefined;
  13487. } else if ( fn == null ) {
  13488. if ( typeof selector === "string" ) {
  13489. // ( types, selector, fn )
  13490. fn = data;
  13491. data = undefined;
  13492. } else {
  13493. // ( types, data, fn )
  13494. fn = data;
  13495. data = selector;
  13496. selector = undefined;
  13497. }
  13498. }
  13499. if ( fn === false ) {
  13500. fn = returnFalse;
  13501. } else if ( !fn ) {
  13502. return elem;
  13503. }
  13504. if ( one === 1 ) {
  13505. origFn = fn;
  13506. fn = function( event ) {
  13507. // Can use an empty set, since event contains the info
  13508. jQuery().off( event );
  13509. return origFn.apply( this, arguments );
  13510. };
  13511. // Use same guid so caller can remove using origFn
  13512. fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
  13513. }
  13514. return elem.each( function() {
  13515. jQuery.event.add( this, types, fn, data, selector );
  13516. } );
  13517. }
  13518. /*
  13519. * Helper functions for managing events -- not part of the public interface.
  13520. * Props to Dean Edwards' addEvent library for many of the ideas.
  13521. */
  13522. jQuery.event = {
  13523. global: {},
  13524. add: function( elem, types, handler, data, selector ) {
  13525. var handleObjIn, eventHandle, tmp,
  13526. events, t, handleObj,
  13527. special, handlers, type, namespaces, origType,
  13528. elemData = dataPriv.get( elem );
  13529. // Don't attach events to noData or text/comment nodes (but allow plain objects)
  13530. if ( !elemData ) {
  13531. return;
  13532. }
  13533. // Caller can pass in an object of custom data in lieu of the handler
  13534. if ( handler.handler ) {
  13535. handleObjIn = handler;
  13536. handler = handleObjIn.handler;
  13537. selector = handleObjIn.selector;
  13538. }
  13539. // Ensure that invalid selectors throw exceptions at attach time
  13540. // Evaluate against documentElement in case elem is a non-element node (e.g., document)
  13541. if ( selector ) {
  13542. jQuery.find.matchesSelector( documentElement, selector );
  13543. }
  13544. // Make sure that the handler has a unique ID, used to find/remove it later
  13545. if ( !handler.guid ) {
  13546. handler.guid = jQuery.guid++;
  13547. }
  13548. // Init the element's event structure and main handler, if this is the first
  13549. if ( !( events = elemData.events ) ) {
  13550. events = elemData.events = {};
  13551. }
  13552. if ( !( eventHandle = elemData.handle ) ) {
  13553. eventHandle = elemData.handle = function( e ) {
  13554. // Discard the second event of a jQuery.event.trigger() and
  13555. // when an event is called after a page has unloaded
  13556. return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ?
  13557. jQuery.event.dispatch.apply( elem, arguments ) : undefined;
  13558. };
  13559. }
  13560. // Handle multiple events separated by a space
  13561. types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
  13562. t = types.length;
  13563. while ( t-- ) {
  13564. tmp = rtypenamespace.exec( types[ t ] ) || [];
  13565. type = origType = tmp[ 1 ];
  13566. namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
  13567. // There *must* be a type, no attaching namespace-only handlers
  13568. if ( !type ) {
  13569. continue;
  13570. }
  13571. // If event changes its type, use the special event handlers for the changed type
  13572. special = jQuery.event.special[ type ] || {};
  13573. // If selector defined, determine special event api type, otherwise given type
  13574. type = ( selector ? special.delegateType : special.bindType ) || type;
  13575. // Update special based on newly reset type
  13576. special = jQuery.event.special[ type ] || {};
  13577. // handleObj is passed to all event handlers
  13578. handleObj = jQuery.extend( {
  13579. type: type,
  13580. origType: origType,
  13581. data: data,
  13582. handler: handler,
  13583. guid: handler.guid,
  13584. selector: selector,
  13585. needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
  13586. namespace: namespaces.join( "." )
  13587. }, handleObjIn );
  13588. // Init the event handler queue if we're the first
  13589. if ( !( handlers = events[ type ] ) ) {
  13590. handlers = events[ type ] = [];
  13591. handlers.delegateCount = 0;
  13592. // Only use addEventListener if the special events handler returns false
  13593. if ( !special.setup ||
  13594. special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
  13595. if ( elem.addEventListener ) {
  13596. elem.addEventListener( type, eventHandle );
  13597. }
  13598. }
  13599. }
  13600. if ( special.add ) {
  13601. special.add.call( elem, handleObj );
  13602. if ( !handleObj.handler.guid ) {
  13603. handleObj.handler.guid = handler.guid;
  13604. }
  13605. }
  13606. // Add to the element's handler list, delegates in front
  13607. if ( selector ) {
  13608. handlers.splice( handlers.delegateCount++, 0, handleObj );
  13609. } else {
  13610. handlers.push( handleObj );
  13611. }
  13612. // Keep track of which events have ever been used, for event optimization
  13613. jQuery.event.global[ type ] = true;
  13614. }
  13615. },
  13616. // Detach an event or set of events from an element
  13617. remove: function( elem, types, handler, selector, mappedTypes ) {
  13618. var j, origCount, tmp,
  13619. events, t, handleObj,
  13620. special, handlers, type, namespaces, origType,
  13621. elemData = dataPriv.hasData( elem ) && dataPriv.get( elem );
  13622. if ( !elemData || !( events = elemData.events ) ) {
  13623. return;
  13624. }
  13625. // Once for each type.namespace in types; type may be omitted
  13626. types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
  13627. t = types.length;
  13628. while ( t-- ) {
  13629. tmp = rtypenamespace.exec( types[ t ] ) || [];
  13630. type = origType = tmp[ 1 ];
  13631. namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
  13632. // Unbind all events (on this namespace, if provided) for the element
  13633. if ( !type ) {
  13634. for ( type in events ) {
  13635. jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
  13636. }
  13637. continue;
  13638. }
  13639. special = jQuery.event.special[ type ] || {};
  13640. type = ( selector ? special.delegateType : special.bindType ) || type;
  13641. handlers = events[ type ] || [];
  13642. tmp = tmp[ 2 ] &&
  13643. new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" );
  13644. // Remove matching events
  13645. origCount = j = handlers.length;
  13646. while ( j-- ) {
  13647. handleObj = handlers[ j ];
  13648. if ( ( mappedTypes || origType === handleObj.origType ) &&
  13649. ( !handler || handler.guid === handleObj.guid ) &&
  13650. ( !tmp || tmp.test( handleObj.namespace ) ) &&
  13651. ( !selector || selector === handleObj.selector ||
  13652. selector === "**" && handleObj.selector ) ) {
  13653. handlers.splice( j, 1 );
  13654. if ( handleObj.selector ) {
  13655. handlers.delegateCount--;
  13656. }
  13657. if ( special.remove ) {
  13658. special.remove.call( elem, handleObj );
  13659. }
  13660. }
  13661. }
  13662. // Remove generic event handler if we removed something and no more handlers exist
  13663. // (avoids potential for endless recursion during removal of special event handlers)
  13664. if ( origCount && !handlers.length ) {
  13665. if ( !special.teardown ||
  13666. special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
  13667. jQuery.removeEvent( elem, type, elemData.handle );
  13668. }
  13669. delete events[ type ];
  13670. }
  13671. }
  13672. // Remove data and the expando if it's no longer used
  13673. if ( jQuery.isEmptyObject( events ) ) {
  13674. dataPriv.remove( elem, "handle events" );
  13675. }
  13676. },
  13677. dispatch: function( nativeEvent ) {
  13678. // Make a writable jQuery.Event from the native event object
  13679. var event = jQuery.event.fix( nativeEvent );
  13680. var i, j, ret, matched, handleObj, handlerQueue,
  13681. args = new Array( arguments.length ),
  13682. handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [],
  13683. special = jQuery.event.special[ event.type ] || {};
  13684. // Use the fix-ed jQuery.Event rather than the (read-only) native event
  13685. args[ 0 ] = event;
  13686. for ( i = 1; i < arguments.length; i++ ) {
  13687. args[ i ] = arguments[ i ];
  13688. }
  13689. event.delegateTarget = this;
  13690. // Call the preDispatch hook for the mapped type, and let it bail if desired
  13691. if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
  13692. return;
  13693. }
  13694. // Determine handlers
  13695. handlerQueue = jQuery.event.handlers.call( this, event, handlers );
  13696. // Run delegates first; they may want to stop propagation beneath us
  13697. i = 0;
  13698. while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {
  13699. event.currentTarget = matched.elem;
  13700. j = 0;
  13701. while ( ( handleObj = matched.handlers[ j++ ] ) &&
  13702. !event.isImmediatePropagationStopped() ) {
  13703. // If the event is namespaced, then each handler is only invoked if it is
  13704. // specially universal or its namespaces are a superset of the event's.
  13705. if ( !event.rnamespace || handleObj.namespace === false ||
  13706. event.rnamespace.test( handleObj.namespace ) ) {
  13707. event.handleObj = handleObj;
  13708. event.data = handleObj.data;
  13709. ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||
  13710. handleObj.handler ).apply( matched.elem, args );
  13711. if ( ret !== undefined ) {
  13712. if ( ( event.result = ret ) === false ) {
  13713. event.preventDefault();
  13714. event.stopPropagation();
  13715. }
  13716. }
  13717. }
  13718. }
  13719. }
  13720. // Call the postDispatch hook for the mapped type
  13721. if ( special.postDispatch ) {
  13722. special.postDispatch.call( this, event );
  13723. }
  13724. return event.result;
  13725. },
  13726. handlers: function( event, handlers ) {
  13727. var i, handleObj, sel, matchedHandlers, matchedSelectors,
  13728. handlerQueue = [],
  13729. delegateCount = handlers.delegateCount,
  13730. cur = event.target;
  13731. // Find delegate handlers
  13732. if ( delegateCount &&
  13733. // Support: IE <=9
  13734. // Black-hole SVG <use> instance trees (trac-13180)
  13735. cur.nodeType &&
  13736. // Support: Firefox <=42
  13737. // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)
  13738. // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click
  13739. // Support: IE 11 only
  13740. // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343)
  13741. !( event.type === "click" && event.button >= 1 ) ) {
  13742. for ( ; cur !== this; cur = cur.parentNode || this ) {
  13743. // Don't check non-elements (#13208)
  13744. // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
  13745. if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) {
  13746. matchedHandlers = [];
  13747. matchedSelectors = {};
  13748. for ( i = 0; i < delegateCount; i++ ) {
  13749. handleObj = handlers[ i ];
  13750. // Don't conflict with Object.prototype properties (#13203)
  13751. sel = handleObj.selector + " ";
  13752. if ( matchedSelectors[ sel ] === undefined ) {
  13753. matchedSelectors[ sel ] = handleObj.needsContext ?
  13754. jQuery( sel, this ).index( cur ) > -1 :
  13755. jQuery.find( sel, this, null, [ cur ] ).length;
  13756. }
  13757. if ( matchedSelectors[ sel ] ) {
  13758. matchedHandlers.push( handleObj );
  13759. }
  13760. }
  13761. if ( matchedHandlers.length ) {
  13762. handlerQueue.push( { elem: cur, handlers: matchedHandlers } );
  13763. }
  13764. }
  13765. }
  13766. }
  13767. // Add the remaining (directly-bound) handlers
  13768. cur = this;
  13769. if ( delegateCount < handlers.length ) {
  13770. handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );
  13771. }
  13772. return handlerQueue;
  13773. },
  13774. addProp: function( name, hook ) {
  13775. Object.defineProperty( jQuery.Event.prototype, name, {
  13776. enumerable: true,
  13777. configurable: true,
  13778. get: isFunction( hook ) ?
  13779. function() {
  13780. if ( this.originalEvent ) {
  13781. return hook( this.originalEvent );
  13782. }
  13783. } :
  13784. function() {
  13785. if ( this.originalEvent ) {
  13786. return this.originalEvent[ name ];
  13787. }
  13788. },
  13789. set: function( value ) {
  13790. Object.defineProperty( this, name, {
  13791. enumerable: true,
  13792. configurable: true,
  13793. writable: true,
  13794. value: value
  13795. } );
  13796. }
  13797. } );
  13798. },
  13799. fix: function( originalEvent ) {
  13800. return originalEvent[ jQuery.expando ] ?
  13801. originalEvent :
  13802. new jQuery.Event( originalEvent );
  13803. },
  13804. special: {
  13805. load: {
  13806. // Prevent triggered image.load events from bubbling to window.load
  13807. noBubble: true
  13808. },
  13809. click: {
  13810. // Utilize native event to ensure correct state for checkable inputs
  13811. setup: function( data ) {
  13812. // For mutual compressibility with _default, replace `this` access with a local var.
  13813. // `|| data` is dead code meant only to preserve the variable through minification.
  13814. var el = this || data;
  13815. // Claim the first handler
  13816. if ( rcheckableType.test( el.type ) &&
  13817. el.click && nodeName( el, "input" ) ) {
  13818. // dataPriv.set( el, "click", ... )
  13819. leverageNative( el, "click", returnTrue );
  13820. }
  13821. // Return false to allow normal processing in the caller
  13822. return false;
  13823. },
  13824. trigger: function( data ) {
  13825. // For mutual compressibility with _default, replace `this` access with a local var.
  13826. // `|| data` is dead code meant only to preserve the variable through minification.
  13827. var el = this || data;
  13828. // Force setup before triggering a click
  13829. if ( rcheckableType.test( el.type ) &&
  13830. el.click && nodeName( el, "input" ) ) {
  13831. leverageNative( el, "click" );
  13832. }
  13833. // Return non-false to allow normal event-path propagation
  13834. return true;
  13835. },
  13836. // For cross-browser consistency, suppress native .click() on links
  13837. // Also prevent it if we're currently inside a leveraged native-event stack
  13838. _default: function( event ) {
  13839. var target = event.target;
  13840. return rcheckableType.test( target.type ) &&
  13841. target.click && nodeName( target, "input" ) &&
  13842. dataPriv.get( target, "click" ) ||
  13843. nodeName( target, "a" );
  13844. }
  13845. },
  13846. beforeunload: {
  13847. postDispatch: function( event ) {
  13848. // Support: Firefox 20+
  13849. // Firefox doesn't alert if the returnValue field is not set.
  13850. if ( event.result !== undefined && event.originalEvent ) {
  13851. event.originalEvent.returnValue = event.result;
  13852. }
  13853. }
  13854. }
  13855. }
  13856. };
  13857. // Ensure the presence of an event listener that handles manually-triggered
  13858. // synthetic events by interrupting progress until reinvoked in response to
  13859. // *native* events that it fires directly, ensuring that state changes have
  13860. // already occurred before other listeners are invoked.
  13861. function leverageNative( el, type, expectSync ) {
  13862. // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add
  13863. if ( !expectSync ) {
  13864. if ( dataPriv.get( el, type ) === undefined ) {
  13865. jQuery.event.add( el, type, returnTrue );
  13866. }
  13867. return;
  13868. }
  13869. // Register the controller as a special universal handler for all event namespaces
  13870. dataPriv.set( el, type, false );
  13871. jQuery.event.add( el, type, {
  13872. namespace: false,
  13873. handler: function( event ) {
  13874. var notAsync, result,
  13875. saved = dataPriv.get( this, type );
  13876. if ( ( event.isTrigger & 1 ) && this[ type ] ) {
  13877. // Interrupt processing of the outer synthetic .trigger()ed event
  13878. // Saved data should be false in such cases, but might be a leftover capture object
  13879. // from an async native handler (gh-4350)
  13880. if ( !saved.length ) {
  13881. // Store arguments for use when handling the inner native event
  13882. // There will always be at least one argument (an event object), so this array
  13883. // will not be confused with a leftover capture object.
  13884. saved = slice.call( arguments );
  13885. dataPriv.set( this, type, saved );
  13886. // Trigger the native event and capture its result
  13887. // Support: IE <=9 - 11+
  13888. // focus() and blur() are asynchronous
  13889. notAsync = expectSync( this, type );
  13890. this[ type ]();
  13891. result = dataPriv.get( this, type );
  13892. if ( saved !== result || notAsync ) {
  13893. dataPriv.set( this, type, false );
  13894. } else {
  13895. result = {};
  13896. }
  13897. if ( saved !== result ) {
  13898. // Cancel the outer synthetic event
  13899. event.stopImmediatePropagation();
  13900. event.preventDefault();
  13901. return result.value;
  13902. }
  13903. // If this is an inner synthetic event for an event with a bubbling surrogate
  13904. // (focus or blur), assume that the surrogate already propagated from triggering the
  13905. // native event and prevent that from happening again here.
  13906. // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the
  13907. // bubbling surrogate propagates *after* the non-bubbling base), but that seems
  13908. // less bad than duplication.
  13909. } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) {
  13910. event.stopPropagation();
  13911. }
  13912. // If this is a native event triggered above, everything is now in order
  13913. // Fire an inner synthetic event with the original arguments
  13914. } else if ( saved.length ) {
  13915. // ...and capture the result
  13916. dataPriv.set( this, type, {
  13917. value: jQuery.event.trigger(
  13918. // Support: IE <=9 - 11+
  13919. // Extend with the prototype to reset the above stopImmediatePropagation()
  13920. jQuery.extend( saved[ 0 ], jQuery.Event.prototype ),
  13921. saved.slice( 1 ),
  13922. this
  13923. )
  13924. } );
  13925. // Abort handling of the native event
  13926. event.stopImmediatePropagation();
  13927. }
  13928. }
  13929. } );
  13930. }
  13931. jQuery.removeEvent = function( elem, type, handle ) {
  13932. // This "if" is needed for plain objects
  13933. if ( elem.removeEventListener ) {
  13934. elem.removeEventListener( type, handle );
  13935. }
  13936. };
  13937. jQuery.Event = function( src, props ) {
  13938. // Allow instantiation without the 'new' keyword
  13939. if ( !( this instanceof jQuery.Event ) ) {
  13940. return new jQuery.Event( src, props );
  13941. }
  13942. // Event object
  13943. if ( src && src.type ) {
  13944. this.originalEvent = src;
  13945. this.type = src.type;
  13946. // Events bubbling up the document may have been marked as prevented
  13947. // by a handler lower down the tree; reflect the correct value.
  13948. this.isDefaultPrevented = src.defaultPrevented ||
  13949. src.defaultPrevented === undefined &&
  13950. // Support: Android <=2.3 only
  13951. src.returnValue === false ?
  13952. returnTrue :
  13953. returnFalse;
  13954. // Create target properties
  13955. // Support: Safari <=6 - 7 only
  13956. // Target should not be a text node (#504, #13143)
  13957. this.target = ( src.target && src.target.nodeType === 3 ) ?
  13958. src.target.parentNode :
  13959. src.target;
  13960. this.currentTarget = src.currentTarget;
  13961. this.relatedTarget = src.relatedTarget;
  13962. // Event type
  13963. } else {
  13964. this.type = src;
  13965. }
  13966. // Put explicitly provided properties onto the event object
  13967. if ( props ) {
  13968. jQuery.extend( this, props );
  13969. }
  13970. // Create a timestamp if incoming event doesn't have one
  13971. this.timeStamp = src && src.timeStamp || Date.now();
  13972. // Mark it as fixed
  13973. this[ jQuery.expando ] = true;
  13974. };
  13975. // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
  13976. // https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
  13977. jQuery.Event.prototype = {
  13978. constructor: jQuery.Event,
  13979. isDefaultPrevented: returnFalse,
  13980. isPropagationStopped: returnFalse,
  13981. isImmediatePropagationStopped: returnFalse,
  13982. isSimulated: false,
  13983. preventDefault: function() {
  13984. var e = this.originalEvent;
  13985. this.isDefaultPrevented = returnTrue;
  13986. if ( e && !this.isSimulated ) {
  13987. e.preventDefault();
  13988. }
  13989. },
  13990. stopPropagation: function() {
  13991. var e = this.originalEvent;
  13992. this.isPropagationStopped = returnTrue;
  13993. if ( e && !this.isSimulated ) {
  13994. e.stopPropagation();
  13995. }
  13996. },
  13997. stopImmediatePropagation: function() {
  13998. var e = this.originalEvent;
  13999. this.isImmediatePropagationStopped = returnTrue;
  14000. if ( e && !this.isSimulated ) {
  14001. e.stopImmediatePropagation();
  14002. }
  14003. this.stopPropagation();
  14004. }
  14005. };
  14006. // Includes all common event props including KeyEvent and MouseEvent specific props
  14007. jQuery.each( {
  14008. altKey: true,
  14009. bubbles: true,
  14010. cancelable: true,
  14011. changedTouches: true,
  14012. ctrlKey: true,
  14013. detail: true,
  14014. eventPhase: true,
  14015. metaKey: true,
  14016. pageX: true,
  14017. pageY: true,
  14018. shiftKey: true,
  14019. view: true,
  14020. "char": true,
  14021. code: true,
  14022. charCode: true,
  14023. key: true,
  14024. keyCode: true,
  14025. button: true,
  14026. buttons: true,
  14027. clientX: true,
  14028. clientY: true,
  14029. offsetX: true,
  14030. offsetY: true,
  14031. pointerId: true,
  14032. pointerType: true,
  14033. screenX: true,
  14034. screenY: true,
  14035. targetTouches: true,
  14036. toElement: true,
  14037. touches: true,
  14038. which: function( event ) {
  14039. var button = event.button;
  14040. // Add which for key events
  14041. if ( event.which == null && rkeyEvent.test( event.type ) ) {
  14042. return event.charCode != null ? event.charCode : event.keyCode;
  14043. }
  14044. // Add which for click: 1 === left; 2 === middle; 3 === right
  14045. if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) {
  14046. if ( button & 1 ) {
  14047. return 1;
  14048. }
  14049. if ( button & 2 ) {
  14050. return 3;
  14051. }
  14052. if ( button & 4 ) {
  14053. return 2;
  14054. }
  14055. return 0;
  14056. }
  14057. return event.which;
  14058. }
  14059. }, jQuery.event.addProp );
  14060. jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) {
  14061. jQuery.event.special[ type ] = {
  14062. // Utilize native event if possible so blur/focus sequence is correct
  14063. setup: function() {
  14064. // Claim the first handler
  14065. // dataPriv.set( this, "focus", ... )
  14066. // dataPriv.set( this, "blur", ... )
  14067. leverageNative( this, type, expectSync );
  14068. // Return false to allow normal processing in the caller
  14069. return false;
  14070. },
  14071. trigger: function() {
  14072. // Force setup before trigger
  14073. leverageNative( this, type );
  14074. // Return non-false to allow normal event-path propagation
  14075. return true;
  14076. },
  14077. delegateType: delegateType
  14078. };
  14079. } );
  14080. // Create mouseenter/leave events using mouseover/out and event-time checks
  14081. // so that event delegation works in jQuery.
  14082. // Do the same for pointerenter/pointerleave and pointerover/pointerout
  14083. //
  14084. // Support: Safari 7 only
  14085. // Safari sends mouseenter too often; see:
  14086. // https://bugs.chromium.org/p/chromium/issues/detail?id=470258
  14087. // for the description of the bug (it existed in older Chrome versions as well).
  14088. jQuery.each( {
  14089. mouseenter: "mouseover",
  14090. mouseleave: "mouseout",
  14091. pointerenter: "pointerover",
  14092. pointerleave: "pointerout"
  14093. }, function( orig, fix ) {
  14094. jQuery.event.special[ orig ] = {
  14095. delegateType: fix,
  14096. bindType: fix,
  14097. handle: function( event ) {
  14098. var ret,
  14099. target = this,
  14100. related = event.relatedTarget,
  14101. handleObj = event.handleObj;
  14102. // For mouseenter/leave call the handler if related is outside the target.
  14103. // NB: No relatedTarget if the mouse left/entered the browser window
  14104. if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {
  14105. event.type = handleObj.origType;
  14106. ret = handleObj.handler.apply( this, arguments );
  14107. event.type = fix;
  14108. }
  14109. return ret;
  14110. }
  14111. };
  14112. } );
  14113. jQuery.fn.extend( {
  14114. on: function( types, selector, data, fn ) {
  14115. return on( this, types, selector, data, fn );
  14116. },
  14117. one: function( types, selector, data, fn ) {
  14118. return on( this, types, selector, data, fn, 1 );
  14119. },
  14120. off: function( types, selector, fn ) {
  14121. var handleObj, type;
  14122. if ( types && types.preventDefault && types.handleObj ) {
  14123. // ( event ) dispatched jQuery.Event
  14124. handleObj = types.handleObj;
  14125. jQuery( types.delegateTarget ).off(
  14126. handleObj.namespace ?
  14127. handleObj.origType + "." + handleObj.namespace :
  14128. handleObj.origType,
  14129. handleObj.selector,
  14130. handleObj.handler
  14131. );
  14132. return this;
  14133. }
  14134. if ( typeof types === "object" ) {
  14135. // ( types-object [, selector] )
  14136. for ( type in types ) {
  14137. this.off( type, selector, types[ type ] );
  14138. }
  14139. return this;
  14140. }
  14141. if ( selector === false || typeof selector === "function" ) {
  14142. // ( types [, fn] )
  14143. fn = selector;
  14144. selector = undefined;
  14145. }
  14146. if ( fn === false ) {
  14147. fn = returnFalse;
  14148. }
  14149. return this.each( function() {
  14150. jQuery.event.remove( this, types, fn, selector );
  14151. } );
  14152. }
  14153. } );
  14154. var
  14155. /* eslint-disable max-len */
  14156. // See https://github.com/eslint/eslint/issues/3229
  14157. rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,
  14158. /* eslint-enable */
  14159. // Support: IE <=10 - 11, Edge 12 - 13 only
  14160. // In IE/Edge using regex groups here causes severe slowdowns.
  14161. // See https://connect.microsoft.com/IE/feedback/details/1736512/
  14162. rnoInnerhtml = /<script|<style|<link/i,
  14163. // checked="checked" or checked
  14164. rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
  14165. rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
  14166. // Prefer a tbody over its parent table for containing new rows
  14167. function manipulationTarget( elem, content ) {
  14168. if ( nodeName( elem, "table" ) &&
  14169. nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) {
  14170. return jQuery( elem ).children( "tbody" )[ 0 ] || elem;
  14171. }
  14172. return elem;
  14173. }
  14174. // Replace/restore the type attribute of script elements for safe DOM manipulation
  14175. function disableScript( elem ) {
  14176. elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type;
  14177. return elem;
  14178. }
  14179. function restoreScript( elem ) {
  14180. if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) {
  14181. elem.type = elem.type.slice( 5 );
  14182. } else {
  14183. elem.removeAttribute( "type" );
  14184. }
  14185. return elem;
  14186. }
  14187. function cloneCopyEvent( src, dest ) {
  14188. var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;
  14189. if ( dest.nodeType !== 1 ) {
  14190. return;
  14191. }
  14192. // 1. Copy private data: events, handlers, etc.
  14193. if ( dataPriv.hasData( src ) ) {
  14194. pdataOld = dataPriv.access( src );
  14195. pdataCur = dataPriv.set( dest, pdataOld );
  14196. events = pdataOld.events;
  14197. if ( events ) {
  14198. delete pdataCur.handle;
  14199. pdataCur.events = {};
  14200. for ( type in events ) {
  14201. for ( i = 0, l = events[ type ].length; i < l; i++ ) {
  14202. jQuery.event.add( dest, type, events[ type ][ i ] );
  14203. }
  14204. }
  14205. }
  14206. }
  14207. // 2. Copy user data
  14208. if ( dataUser.hasData( src ) ) {
  14209. udataOld = dataUser.access( src );
  14210. udataCur = jQuery.extend( {}, udataOld );
  14211. dataUser.set( dest, udataCur );
  14212. }
  14213. }
  14214. // Fix IE bugs, see support tests
  14215. function fixInput( src, dest ) {
  14216. var nodeName = dest.nodeName.toLowerCase();
  14217. // Fails to persist the checked state of a cloned checkbox or radio button.
  14218. if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
  14219. dest.checked = src.checked;
  14220. // Fails to return the selected option to the default selected state when cloning options
  14221. } else if ( nodeName === "input" || nodeName === "textarea" ) {
  14222. dest.defaultValue = src.defaultValue;
  14223. }
  14224. }
  14225. function domManip( collection, args, callback, ignored ) {
  14226. // Flatten any nested arrays
  14227. args = concat.apply( [], args );
  14228. var fragment, first, scripts, hasScripts, node, doc,
  14229. i = 0,
  14230. l = collection.length,
  14231. iNoClone = l - 1,
  14232. value = args[ 0 ],
  14233. valueIsFunction = isFunction( value );
  14234. // We can't cloneNode fragments that contain checked, in WebKit
  14235. if ( valueIsFunction ||
  14236. ( l > 1 && typeof value === "string" &&
  14237. !support.checkClone && rchecked.test( value ) ) ) {
  14238. return collection.each( function( index ) {
  14239. var self = collection.eq( index );
  14240. if ( valueIsFunction ) {
  14241. args[ 0 ] = value.call( this, index, self.html() );
  14242. }
  14243. domManip( self, args, callback, ignored );
  14244. } );
  14245. }
  14246. if ( l ) {
  14247. fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );
  14248. first = fragment.firstChild;
  14249. if ( fragment.childNodes.length === 1 ) {
  14250. fragment = first;
  14251. }
  14252. // Require either new content or an interest in ignored elements to invoke the callback
  14253. if ( first || ignored ) {
  14254. scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
  14255. hasScripts = scripts.length;
  14256. // Use the original fragment for the last item
  14257. // instead of the first because it can end up
  14258. // being emptied incorrectly in certain situations (#8070).
  14259. for ( ; i < l; i++ ) {
  14260. node = fragment;
  14261. if ( i !== iNoClone ) {
  14262. node = jQuery.clone( node, true, true );
  14263. // Keep references to cloned scripts for later restoration
  14264. if ( hasScripts ) {
  14265. // Support: Android <=4.0 only, PhantomJS 1 only
  14266. // push.apply(_, arraylike) throws on ancient WebKit
  14267. jQuery.merge( scripts, getAll( node, "script" ) );
  14268. }
  14269. }
  14270. callback.call( collection[ i ], node, i );
  14271. }
  14272. if ( hasScripts ) {
  14273. doc = scripts[ scripts.length - 1 ].ownerDocument;
  14274. // Reenable scripts
  14275. jQuery.map( scripts, restoreScript );
  14276. // Evaluate executable scripts on first document insertion
  14277. for ( i = 0; i < hasScripts; i++ ) {
  14278. node = scripts[ i ];
  14279. if ( rscriptType.test( node.type || "" ) &&
  14280. !dataPriv.access( node, "globalEval" ) &&
  14281. jQuery.contains( doc, node ) ) {
  14282. if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) {
  14283. // Optional AJAX dependency, but won't run scripts if not present
  14284. if ( jQuery._evalUrl && !node.noModule ) {
  14285. jQuery._evalUrl( node.src, {
  14286. nonce: node.nonce || node.getAttribute( "nonce" )
  14287. } );
  14288. }
  14289. } else {
  14290. DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc );
  14291. }
  14292. }
  14293. }
  14294. }
  14295. }
  14296. }
  14297. return collection;
  14298. }
  14299. function remove( elem, selector, keepData ) {
  14300. var node,
  14301. nodes = selector ? jQuery.filter( selector, elem ) : elem,
  14302. i = 0;
  14303. for ( ; ( node = nodes[ i ] ) != null; i++ ) {
  14304. if ( !keepData && node.nodeType === 1 ) {
  14305. jQuery.cleanData( getAll( node ) );
  14306. }
  14307. if ( node.parentNode ) {
  14308. if ( keepData && isAttached( node ) ) {
  14309. setGlobalEval( getAll( node, "script" ) );
  14310. }
  14311. node.parentNode.removeChild( node );
  14312. }
  14313. }
  14314. return elem;
  14315. }
  14316. jQuery.extend( {
  14317. htmlPrefilter: function( html ) {
  14318. return html.replace( rxhtmlTag, "<$1></$2>" );
  14319. },
  14320. clone: function( elem, dataAndEvents, deepDataAndEvents ) {
  14321. var i, l, srcElements, destElements,
  14322. clone = elem.cloneNode( true ),
  14323. inPage = isAttached( elem );
  14324. // Fix IE cloning issues
  14325. if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
  14326. !jQuery.isXMLDoc( elem ) ) {
  14327. // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2
  14328. destElements = getAll( clone );
  14329. srcElements = getAll( elem );
  14330. for ( i = 0, l = srcElements.length; i < l; i++ ) {
  14331. fixInput( srcElements[ i ], destElements[ i ] );
  14332. }
  14333. }
  14334. // Copy the events from the original to the clone
  14335. if ( dataAndEvents ) {
  14336. if ( deepDataAndEvents ) {
  14337. srcElements = srcElements || getAll( elem );
  14338. destElements = destElements || getAll( clone );
  14339. for ( i = 0, l = srcElements.length; i < l; i++ ) {
  14340. cloneCopyEvent( srcElements[ i ], destElements[ i ] );
  14341. }
  14342. } else {
  14343. cloneCopyEvent( elem, clone );
  14344. }
  14345. }
  14346. // Preserve script evaluation history
  14347. destElements = getAll( clone, "script" );
  14348. if ( destElements.length > 0 ) {
  14349. setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
  14350. }
  14351. // Return the cloned set
  14352. return clone;
  14353. },
  14354. cleanData: function( elems ) {
  14355. var data, elem, type,
  14356. special = jQuery.event.special,
  14357. i = 0;
  14358. for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {
  14359. if ( acceptData( elem ) ) {
  14360. if ( ( data = elem[ dataPriv.expando ] ) ) {
  14361. if ( data.events ) {
  14362. for ( type in data.events ) {
  14363. if ( special[ type ] ) {
  14364. jQuery.event.remove( elem, type );
  14365. // This is a shortcut to avoid jQuery.event.remove's overhead
  14366. } else {
  14367. jQuery.removeEvent( elem, type, data.handle );
  14368. }
  14369. }
  14370. }
  14371. // Support: Chrome <=35 - 45+
  14372. // Assign undefined instead of using delete, see Data#remove
  14373. elem[ dataPriv.expando ] = undefined;
  14374. }
  14375. if ( elem[ dataUser.expando ] ) {
  14376. // Support: Chrome <=35 - 45+
  14377. // Assign undefined instead of using delete, see Data#remove
  14378. elem[ dataUser.expando ] = undefined;
  14379. }
  14380. }
  14381. }
  14382. }
  14383. } );
  14384. jQuery.fn.extend( {
  14385. detach: function( selector ) {
  14386. return remove( this, selector, true );
  14387. },
  14388. remove: function( selector ) {
  14389. return remove( this, selector );
  14390. },
  14391. text: function( value ) {
  14392. return access( this, function( value ) {
  14393. return value === undefined ?
  14394. jQuery.text( this ) :
  14395. this.empty().each( function() {
  14396. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  14397. this.textContent = value;
  14398. }
  14399. } );
  14400. }, null, value, arguments.length );
  14401. },
  14402. append: function() {
  14403. return domManip( this, arguments, function( elem ) {
  14404. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  14405. var target = manipulationTarget( this, elem );
  14406. target.appendChild( elem );
  14407. }
  14408. } );
  14409. },
  14410. prepend: function() {
  14411. return domManip( this, arguments, function( elem ) {
  14412. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  14413. var target = manipulationTarget( this, elem );
  14414. target.insertBefore( elem, target.firstChild );
  14415. }
  14416. } );
  14417. },
  14418. before: function() {
  14419. return domManip( this, arguments, function( elem ) {
  14420. if ( this.parentNode ) {
  14421. this.parentNode.insertBefore( elem, this );
  14422. }
  14423. } );
  14424. },
  14425. after: function() {
  14426. return domManip( this, arguments, function( elem ) {
  14427. if ( this.parentNode ) {
  14428. this.parentNode.insertBefore( elem, this.nextSibling );
  14429. }
  14430. } );
  14431. },
  14432. empty: function() {
  14433. var elem,
  14434. i = 0;
  14435. for ( ; ( elem = this[ i ] ) != null; i++ ) {
  14436. if ( elem.nodeType === 1 ) {
  14437. // Prevent memory leaks
  14438. jQuery.cleanData( getAll( elem, false ) );
  14439. // Remove any remaining nodes
  14440. elem.textContent = "";
  14441. }
  14442. }
  14443. return this;
  14444. },
  14445. clone: function( dataAndEvents, deepDataAndEvents ) {
  14446. dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
  14447. deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
  14448. return this.map( function() {
  14449. return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
  14450. } );
  14451. },
  14452. html: function( value ) {
  14453. return access( this, function( value ) {
  14454. var elem = this[ 0 ] || {},
  14455. i = 0,
  14456. l = this.length;
  14457. if ( value === undefined && elem.nodeType === 1 ) {
  14458. return elem.innerHTML;
  14459. }
  14460. // See if we can take a shortcut and just use innerHTML
  14461. if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
  14462. !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
  14463. value = jQuery.htmlPrefilter( value );
  14464. try {
  14465. for ( ; i < l; i++ ) {
  14466. elem = this[ i ] || {};
  14467. // Remove element nodes and prevent memory leaks
  14468. if ( elem.nodeType === 1 ) {
  14469. jQuery.cleanData( getAll( elem, false ) );
  14470. elem.innerHTML = value;
  14471. }
  14472. }
  14473. elem = 0;
  14474. // If using innerHTML throws an exception, use the fallback method
  14475. } catch ( e ) {}
  14476. }
  14477. if ( elem ) {
  14478. this.empty().append( value );
  14479. }
  14480. }, null, value, arguments.length );
  14481. },
  14482. replaceWith: function() {
  14483. var ignored = [];
  14484. // Make the changes, replacing each non-ignored context element with the new content
  14485. return domManip( this, arguments, function( elem ) {
  14486. var parent = this.parentNode;
  14487. if ( jQuery.inArray( this, ignored ) < 0 ) {
  14488. jQuery.cleanData( getAll( this ) );
  14489. if ( parent ) {
  14490. parent.replaceChild( elem, this );
  14491. }
  14492. }
  14493. // Force callback invocation
  14494. }, ignored );
  14495. }
  14496. } );
  14497. jQuery.each( {
  14498. appendTo: "append",
  14499. prependTo: "prepend",
  14500. insertBefore: "before",
  14501. insertAfter: "after",
  14502. replaceAll: "replaceWith"
  14503. }, function( name, original ) {
  14504. jQuery.fn[ name ] = function( selector ) {
  14505. var elems,
  14506. ret = [],
  14507. insert = jQuery( selector ),
  14508. last = insert.length - 1,
  14509. i = 0;
  14510. for ( ; i <= last; i++ ) {
  14511. elems = i === last ? this : this.clone( true );
  14512. jQuery( insert[ i ] )[ original ]( elems );
  14513. // Support: Android <=4.0 only, PhantomJS 1 only
  14514. // .get() because push.apply(_, arraylike) throws on ancient WebKit
  14515. push.apply( ret, elems.get() );
  14516. }
  14517. return this.pushStack( ret );
  14518. };
  14519. } );
  14520. var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
  14521. var getStyles = function( elem ) {
  14522. // Support: IE <=11 only, Firefox <=30 (#15098, #14150)
  14523. // IE throws on elements created in popups
  14524. // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
  14525. var view = elem.ownerDocument.defaultView;
  14526. if ( !view || !view.opener ) {
  14527. view = window;
  14528. }
  14529. return view.getComputedStyle( elem );
  14530. };
  14531. var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
  14532. ( function() {
  14533. // Executing both pixelPosition & boxSizingReliable tests require only one layout
  14534. // so they're executed at the same time to save the second computation.
  14535. function computeStyleTests() {
  14536. // This is a singleton, we need to execute it only once
  14537. if ( !div ) {
  14538. return;
  14539. }
  14540. container.style.cssText = "position:absolute;left:-11111px;width:60px;" +
  14541. "margin-top:1px;padding:0;border:0";
  14542. div.style.cssText =
  14543. "position:relative;display:block;box-sizing:border-box;overflow:scroll;" +
  14544. "margin:auto;border:1px;padding:1px;" +
  14545. "width:60%;top:1%";
  14546. documentElement.appendChild( container ).appendChild( div );
  14547. var divStyle = window.getComputedStyle( div );
  14548. pixelPositionVal = divStyle.top !== "1%";
  14549. // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44
  14550. reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;
  14551. // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3
  14552. // Some styles come back with percentage values, even though they shouldn't
  14553. div.style.right = "60%";
  14554. pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;
  14555. // Support: IE 9 - 11 only
  14556. // Detect misreporting of content dimensions for box-sizing:border-box elements
  14557. boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;
  14558. // Support: IE 9 only
  14559. // Detect overflow:scroll screwiness (gh-3699)
  14560. // Support: Chrome <=64
  14561. // Don't get tricked when zoom affects offsetWidth (gh-4029)
  14562. div.style.position = "absolute";
  14563. scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;
  14564. documentElement.removeChild( container );
  14565. // Nullify the div so it wouldn't be stored in the memory and
  14566. // it will also be a sign that checks already performed
  14567. div = null;
  14568. }
  14569. function roundPixelMeasures( measure ) {
  14570. return Math.round( parseFloat( measure ) );
  14571. }
  14572. var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal,
  14573. reliableMarginLeftVal,
  14574. container = document.createElement( "div" ),
  14575. div = document.createElement( "div" );
  14576. // Finish early in limited (non-browser) environments
  14577. if ( !div.style ) {
  14578. return;
  14579. }
  14580. // Support: IE <=9 - 11 only
  14581. // Style of cloned element affects source element cloned (#8908)
  14582. div.style.backgroundClip = "content-box";
  14583. div.cloneNode( true ).style.backgroundClip = "";
  14584. support.clearCloneStyle = div.style.backgroundClip === "content-box";
  14585. jQuery.extend( support, {
  14586. boxSizingReliable: function() {
  14587. computeStyleTests();
  14588. return boxSizingReliableVal;
  14589. },
  14590. pixelBoxStyles: function() {
  14591. computeStyleTests();
  14592. return pixelBoxStylesVal;
  14593. },
  14594. pixelPosition: function() {
  14595. computeStyleTests();
  14596. return pixelPositionVal;
  14597. },
  14598. reliableMarginLeft: function() {
  14599. computeStyleTests();
  14600. return reliableMarginLeftVal;
  14601. },
  14602. scrollboxSize: function() {
  14603. computeStyleTests();
  14604. return scrollboxSizeVal;
  14605. }
  14606. } );
  14607. } )();
  14608. function curCSS( elem, name, computed ) {
  14609. var width, minWidth, maxWidth, ret,
  14610. // Support: Firefox 51+
  14611. // Retrieving style before computed somehow
  14612. // fixes an issue with getting wrong values
  14613. // on detached elements
  14614. style = elem.style;
  14615. computed = computed || getStyles( elem );
  14616. // getPropertyValue is needed for:
  14617. // .css('filter') (IE 9 only, #12537)
  14618. // .css('--customProperty) (#3144)
  14619. if ( computed ) {
  14620. ret = computed.getPropertyValue( name ) || computed[ name ];
  14621. if ( ret === "" && !isAttached( elem ) ) {
  14622. ret = jQuery.style( elem, name );
  14623. }
  14624. // A tribute to the "awesome hack by Dean Edwards"
  14625. // Android Browser returns percentage for some values,
  14626. // but width seems to be reliably pixels.
  14627. // This is against the CSSOM draft spec:
  14628. // https://drafts.csswg.org/cssom/#resolved-values
  14629. if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) {
  14630. // Remember the original values
  14631. width = style.width;
  14632. minWidth = style.minWidth;
  14633. maxWidth = style.maxWidth;
  14634. // Put in the new values to get a computed value out
  14635. style.minWidth = style.maxWidth = style.width = ret;
  14636. ret = computed.width;
  14637. // Revert the changed values
  14638. style.width = width;
  14639. style.minWidth = minWidth;
  14640. style.maxWidth = maxWidth;
  14641. }
  14642. }
  14643. return ret !== undefined ?
  14644. // Support: IE <=9 - 11 only
  14645. // IE returns zIndex value as an integer.
  14646. ret + "" :
  14647. ret;
  14648. }
  14649. function addGetHookIf( conditionFn, hookFn ) {
  14650. // Define the hook, we'll check on the first run if it's really needed.
  14651. return {
  14652. get: function() {
  14653. if ( conditionFn() ) {
  14654. // Hook not needed (or it's not possible to use it due
  14655. // to missing dependency), remove it.
  14656. delete this.get;
  14657. return;
  14658. }
  14659. // Hook needed; redefine it so that the support test is not executed again.
  14660. return ( this.get = hookFn ).apply( this, arguments );
  14661. }
  14662. };
  14663. }
  14664. var cssPrefixes = [ "Webkit", "Moz", "ms" ],
  14665. emptyStyle = document.createElement( "div" ).style,
  14666. vendorProps = {};
  14667. // Return a vendor-prefixed property or undefined
  14668. function vendorPropName( name ) {
  14669. // Check for vendor prefixed names
  14670. var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),
  14671. i = cssPrefixes.length;
  14672. while ( i-- ) {
  14673. name = cssPrefixes[ i ] + capName;
  14674. if ( name in emptyStyle ) {
  14675. return name;
  14676. }
  14677. }
  14678. }
  14679. // Return a potentially-mapped jQuery.cssProps or vendor prefixed property
  14680. function finalPropName( name ) {
  14681. var final = jQuery.cssProps[ name ] || vendorProps[ name ];
  14682. if ( final ) {
  14683. return final;
  14684. }
  14685. if ( name in emptyStyle ) {
  14686. return name;
  14687. }
  14688. return vendorProps[ name ] = vendorPropName( name ) || name;
  14689. }
  14690. var
  14691. // Swappable if display is none or starts with table
  14692. // except "table", "table-cell", or "table-caption"
  14693. // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
  14694. rdisplayswap = /^(none|table(?!-c[ea]).+)/,
  14695. rcustomProp = /^--/,
  14696. cssShow = { position: "absolute", visibility: "hidden", display: "block" },
  14697. cssNormalTransform = {
  14698. letterSpacing: "0",
  14699. fontWeight: "400"
  14700. };
  14701. function setPositiveNumber( elem, value, subtract ) {
  14702. // Any relative (+/-) values have already been
  14703. // normalized at this point
  14704. var matches = rcssNum.exec( value );
  14705. return matches ?
  14706. // Guard against undefined "subtract", e.g., when used as in cssHooks
  14707. Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) :
  14708. value;
  14709. }
  14710. function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) {
  14711. var i = dimension === "width" ? 1 : 0,
  14712. extra = 0,
  14713. delta = 0;
  14714. // Adjustment may not be necessary
  14715. if ( box === ( isBorderBox ? "border" : "content" ) ) {
  14716. return 0;
  14717. }
  14718. for ( ; i < 4; i += 2 ) {
  14719. // Both box models exclude margin
  14720. if ( box === "margin" ) {
  14721. delta += jQuery.css( elem, box + cssExpand[ i ], true, styles );
  14722. }
  14723. // If we get here with a content-box, we're seeking "padding" or "border" or "margin"
  14724. if ( !isBorderBox ) {
  14725. // Add padding
  14726. delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
  14727. // For "border" or "margin", add border
  14728. if ( box !== "padding" ) {
  14729. delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  14730. // But still keep track of it otherwise
  14731. } else {
  14732. extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  14733. }
  14734. // If we get here with a border-box (content + padding + border), we're seeking "content" or
  14735. // "padding" or "margin"
  14736. } else {
  14737. // For "content", subtract padding
  14738. if ( box === "content" ) {
  14739. delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
  14740. }
  14741. // For "content" or "padding", subtract border
  14742. if ( box !== "margin" ) {
  14743. delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  14744. }
  14745. }
  14746. }
  14747. // Account for positive content-box scroll gutter when requested by providing computedVal
  14748. if ( !isBorderBox && computedVal >= 0 ) {
  14749. // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border
  14750. // Assuming integer scroll gutter, subtract the rest and round down
  14751. delta += Math.max( 0, Math.ceil(
  14752. elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -
  14753. computedVal -
  14754. delta -
  14755. extra -
  14756. 0.5
  14757. // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter
  14758. // Use an explicit zero to avoid NaN (gh-3964)
  14759. ) ) || 0;
  14760. }
  14761. return delta;
  14762. }
  14763. function getWidthOrHeight( elem, dimension, extra ) {
  14764. // Start with computed style
  14765. var styles = getStyles( elem ),
  14766. // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322).
  14767. // Fake content-box until we know it's needed to know the true value.
  14768. boxSizingNeeded = !support.boxSizingReliable() || extra,
  14769. isBorderBox = boxSizingNeeded &&
  14770. jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
  14771. valueIsBorderBox = isBorderBox,
  14772. val = curCSS( elem, dimension, styles ),
  14773. offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 );
  14774. // Support: Firefox <=54
  14775. // Return a confounding non-pixel value or feign ignorance, as appropriate.
  14776. if ( rnumnonpx.test( val ) ) {
  14777. if ( !extra ) {
  14778. return val;
  14779. }
  14780. val = "auto";
  14781. }
  14782. // Fall back to offsetWidth/offsetHeight when value is "auto"
  14783. // This happens for inline elements with no explicit setting (gh-3571)
  14784. // Support: Android <=4.1 - 4.3 only
  14785. // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602)
  14786. // Support: IE 9-11 only
  14787. // Also use offsetWidth/offsetHeight for when box sizing is unreliable
  14788. // We use getClientRects() to check for hidden/disconnected.
  14789. // In those cases, the computed value can be trusted to be border-box
  14790. if ( ( !support.boxSizingReliable() && isBorderBox ||
  14791. val === "auto" ||
  14792. !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) &&
  14793. elem.getClientRects().length ) {
  14794. isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
  14795. // Where available, offsetWidth/offsetHeight approximate border box dimensions.
  14796. // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the
  14797. // retrieved value as a content box dimension.
  14798. valueIsBorderBox = offsetProp in elem;
  14799. if ( valueIsBorderBox ) {
  14800. val = elem[ offsetProp ];
  14801. }
  14802. }
  14803. // Normalize "" and auto
  14804. val = parseFloat( val ) || 0;
  14805. // Adjust for the element's box model
  14806. return ( val +
  14807. boxModelAdjustment(
  14808. elem,
  14809. dimension,
  14810. extra || ( isBorderBox ? "border" : "content" ),
  14811. valueIsBorderBox,
  14812. styles,
  14813. // Provide the current computed size to request scroll gutter calculation (gh-3589)
  14814. val
  14815. )
  14816. ) + "px";
  14817. }
  14818. jQuery.extend( {
  14819. // Add in style property hooks for overriding the default
  14820. // behavior of getting and setting a style property
  14821. cssHooks: {
  14822. opacity: {
  14823. get: function( elem, computed ) {
  14824. if ( computed ) {
  14825. // We should always get a number back from opacity
  14826. var ret = curCSS( elem, "opacity" );
  14827. return ret === "" ? "1" : ret;
  14828. }
  14829. }
  14830. }
  14831. },
  14832. // Don't automatically add "px" to these possibly-unitless properties
  14833. cssNumber: {
  14834. "animationIterationCount": true,
  14835. "columnCount": true,
  14836. "fillOpacity": true,
  14837. "flexGrow": true,
  14838. "flexShrink": true,
  14839. "fontWeight": true,
  14840. "gridArea": true,
  14841. "gridColumn": true,
  14842. "gridColumnEnd": true,
  14843. "gridColumnStart": true,
  14844. "gridRow": true,
  14845. "gridRowEnd": true,
  14846. "gridRowStart": true,
  14847. "lineHeight": true,
  14848. "opacity": true,
  14849. "order": true,
  14850. "orphans": true,
  14851. "widows": true,
  14852. "zIndex": true,
  14853. "zoom": true
  14854. },
  14855. // Add in properties whose names you wish to fix before
  14856. // setting or getting the value
  14857. cssProps: {},
  14858. // Get and set the style property on a DOM Node
  14859. style: function( elem, name, value, extra ) {
  14860. // Don't set styles on text and comment nodes
  14861. if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
  14862. return;
  14863. }
  14864. // Make sure that we're working with the right name
  14865. var ret, type, hooks,
  14866. origName = camelCase( name ),
  14867. isCustomProp = rcustomProp.test( name ),
  14868. style = elem.style;
  14869. // Make sure that we're working with the right name. We don't
  14870. // want to query the value if it is a CSS custom property
  14871. // since they are user-defined.
  14872. if ( !isCustomProp ) {
  14873. name = finalPropName( origName );
  14874. }
  14875. // Gets hook for the prefixed version, then unprefixed version
  14876. hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
  14877. // Check if we're setting a value
  14878. if ( value !== undefined ) {
  14879. type = typeof value;
  14880. // Convert "+=" or "-=" to relative numbers (#7345)
  14881. if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {
  14882. value = adjustCSS( elem, name, ret );
  14883. // Fixes bug #9237
  14884. type = "number";
  14885. }
  14886. // Make sure that null and NaN values aren't set (#7116)
  14887. if ( value == null || value !== value ) {
  14888. return;
  14889. }
  14890. // If a number was passed in, add the unit (except for certain CSS properties)
  14891. // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append
  14892. // "px" to a few hardcoded values.
  14893. if ( type === "number" && !isCustomProp ) {
  14894. value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" );
  14895. }
  14896. // background-* props affect original clone's values
  14897. if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
  14898. style[ name ] = "inherit";
  14899. }
  14900. // If a hook was provided, use that value, otherwise just set the specified value
  14901. if ( !hooks || !( "set" in hooks ) ||
  14902. ( value = hooks.set( elem, value, extra ) ) !== undefined ) {
  14903. if ( isCustomProp ) {
  14904. style.setProperty( name, value );
  14905. } else {
  14906. style[ name ] = value;
  14907. }
  14908. }
  14909. } else {
  14910. // If a hook was provided get the non-computed value from there
  14911. if ( hooks && "get" in hooks &&
  14912. ( ret = hooks.get( elem, false, extra ) ) !== undefined ) {
  14913. return ret;
  14914. }
  14915. // Otherwise just get the value from the style object
  14916. return style[ name ];
  14917. }
  14918. },
  14919. css: function( elem, name, extra, styles ) {
  14920. var val, num, hooks,
  14921. origName = camelCase( name ),
  14922. isCustomProp = rcustomProp.test( name );
  14923. // Make sure that we're working with the right name. We don't
  14924. // want to modify the value if it is a CSS custom property
  14925. // since they are user-defined.
  14926. if ( !isCustomProp ) {
  14927. name = finalPropName( origName );
  14928. }
  14929. // Try prefixed name followed by the unprefixed name
  14930. hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
  14931. // If a hook was provided get the computed value from there
  14932. if ( hooks && "get" in hooks ) {
  14933. val = hooks.get( elem, true, extra );
  14934. }
  14935. // Otherwise, if a way to get the computed value exists, use that
  14936. if ( val === undefined ) {
  14937. val = curCSS( elem, name, styles );
  14938. }
  14939. // Convert "normal" to computed value
  14940. if ( val === "normal" && name in cssNormalTransform ) {
  14941. val = cssNormalTransform[ name ];
  14942. }
  14943. // Make numeric if forced or a qualifier was provided and val looks numeric
  14944. if ( extra === "" || extra ) {
  14945. num = parseFloat( val );
  14946. return extra === true || isFinite( num ) ? num || 0 : val;
  14947. }
  14948. return val;
  14949. }
  14950. } );
  14951. jQuery.each( [ "height", "width" ], function( i, dimension ) {
  14952. jQuery.cssHooks[ dimension ] = {
  14953. get: function( elem, computed, extra ) {
  14954. if ( computed ) {
  14955. // Certain elements can have dimension info if we invisibly show them
  14956. // but it must have a current display style that would benefit
  14957. return rdisplayswap.test( jQuery.css( elem, "display" ) ) &&
  14958. // Support: Safari 8+
  14959. // Table columns in Safari have non-zero offsetWidth & zero
  14960. // getBoundingClientRect().width unless display is changed.
  14961. // Support: IE <=11 only
  14962. // Running getBoundingClientRect on a disconnected node
  14963. // in IE throws an error.
  14964. ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?
  14965. swap( elem, cssShow, function() {
  14966. return getWidthOrHeight( elem, dimension, extra );
  14967. } ) :
  14968. getWidthOrHeight( elem, dimension, extra );
  14969. }
  14970. },
  14971. set: function( elem, value, extra ) {
  14972. var matches,
  14973. styles = getStyles( elem ),
  14974. // Only read styles.position if the test has a chance to fail
  14975. // to avoid forcing a reflow.
  14976. scrollboxSizeBuggy = !support.scrollboxSize() &&
  14977. styles.position === "absolute",
  14978. // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991)
  14979. boxSizingNeeded = scrollboxSizeBuggy || extra,
  14980. isBorderBox = boxSizingNeeded &&
  14981. jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
  14982. subtract = extra ?
  14983. boxModelAdjustment(
  14984. elem,
  14985. dimension,
  14986. extra,
  14987. isBorderBox,
  14988. styles
  14989. ) :
  14990. 0;
  14991. // Account for unreliable border-box dimensions by comparing offset* to computed and
  14992. // faking a content-box to get border and padding (gh-3699)
  14993. if ( isBorderBox && scrollboxSizeBuggy ) {
  14994. subtract -= Math.ceil(
  14995. elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -
  14996. parseFloat( styles[ dimension ] ) -
  14997. boxModelAdjustment( elem, dimension, "border", false, styles ) -
  14998. 0.5
  14999. );
  15000. }
  15001. // Convert to pixels if value adjustment is needed
  15002. if ( subtract && ( matches = rcssNum.exec( value ) ) &&
  15003. ( matches[ 3 ] || "px" ) !== "px" ) {
  15004. elem.style[ dimension ] = value;
  15005. value = jQuery.css( elem, dimension );
  15006. }
  15007. return setPositiveNumber( elem, value, subtract );
  15008. }
  15009. };
  15010. } );
  15011. jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,
  15012. function( elem, computed ) {
  15013. if ( computed ) {
  15014. return ( parseFloat( curCSS( elem, "marginLeft" ) ) ||
  15015. elem.getBoundingClientRect().left -
  15016. swap( elem, { marginLeft: 0 }, function() {
  15017. return elem.getBoundingClientRect().left;
  15018. } )
  15019. ) + "px";
  15020. }
  15021. }
  15022. );
  15023. // These hooks are used by animate to expand properties
  15024. jQuery.each( {
  15025. margin: "",
  15026. padding: "",
  15027. border: "Width"
  15028. }, function( prefix, suffix ) {
  15029. jQuery.cssHooks[ prefix + suffix ] = {
  15030. expand: function( value ) {
  15031. var i = 0,
  15032. expanded = {},
  15033. // Assumes a single number if not a string
  15034. parts = typeof value === "string" ? value.split( " " ) : [ value ];
  15035. for ( ; i < 4; i++ ) {
  15036. expanded[ prefix + cssExpand[ i ] + suffix ] =
  15037. parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
  15038. }
  15039. return expanded;
  15040. }
  15041. };
  15042. if ( prefix !== "margin" ) {
  15043. jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
  15044. }
  15045. } );
  15046. jQuery.fn.extend( {
  15047. css: function( name, value ) {
  15048. return access( this, function( elem, name, value ) {
  15049. var styles, len,
  15050. map = {},
  15051. i = 0;
  15052. if ( Array.isArray( name ) ) {
  15053. styles = getStyles( elem );
  15054. len = name.length;
  15055. for ( ; i < len; i++ ) {
  15056. map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
  15057. }
  15058. return map;
  15059. }
  15060. return value !== undefined ?
  15061. jQuery.style( elem, name, value ) :
  15062. jQuery.css( elem, name );
  15063. }, name, value, arguments.length > 1 );
  15064. }
  15065. } );
  15066. function Tween( elem, options, prop, end, easing ) {
  15067. return new Tween.prototype.init( elem, options, prop, end, easing );
  15068. }
  15069. jQuery.Tween = Tween;
  15070. Tween.prototype = {
  15071. constructor: Tween,
  15072. init: function( elem, options, prop, end, easing, unit ) {
  15073. this.elem = elem;
  15074. this.prop = prop;
  15075. this.easing = easing || jQuery.easing._default;
  15076. this.options = options;
  15077. this.start = this.now = this.cur();
  15078. this.end = end;
  15079. this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
  15080. },
  15081. cur: function() {
  15082. var hooks = Tween.propHooks[ this.prop ];
  15083. return hooks && hooks.get ?
  15084. hooks.get( this ) :
  15085. Tween.propHooks._default.get( this );
  15086. },
  15087. run: function( percent ) {
  15088. var eased,
  15089. hooks = Tween.propHooks[ this.prop ];
  15090. if ( this.options.duration ) {
  15091. this.pos = eased = jQuery.easing[ this.easing ](
  15092. percent, this.options.duration * percent, 0, 1, this.options.duration
  15093. );
  15094. } else {
  15095. this.pos = eased = percent;
  15096. }
  15097. this.now = ( this.end - this.start ) * eased + this.start;
  15098. if ( this.options.step ) {
  15099. this.options.step.call( this.elem, this.now, this );
  15100. }
  15101. if ( hooks && hooks.set ) {
  15102. hooks.set( this );
  15103. } else {
  15104. Tween.propHooks._default.set( this );
  15105. }
  15106. return this;
  15107. }
  15108. };
  15109. Tween.prototype.init.prototype = Tween.prototype;
  15110. Tween.propHooks = {
  15111. _default: {
  15112. get: function( tween ) {
  15113. var result;
  15114. // Use a property on the element directly when it is not a DOM element,
  15115. // or when there is no matching style property that exists.
  15116. if ( tween.elem.nodeType !== 1 ||
  15117. tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {
  15118. return tween.elem[ tween.prop ];
  15119. }
  15120. // Passing an empty string as a 3rd parameter to .css will automatically
  15121. // attempt a parseFloat and fallback to a string if the parse fails.
  15122. // Simple values such as "10px" are parsed to Float;
  15123. // complex values such as "rotate(1rad)" are returned as-is.
  15124. result = jQuery.css( tween.elem, tween.prop, "" );
  15125. // Empty strings, null, undefined and "auto" are converted to 0.
  15126. return !result || result === "auto" ? 0 : result;
  15127. },
  15128. set: function( tween ) {
  15129. // Use step hook for back compat.
  15130. // Use cssHook if its there.
  15131. // Use .style if available and use plain properties where available.
  15132. if ( jQuery.fx.step[ tween.prop ] ) {
  15133. jQuery.fx.step[ tween.prop ]( tween );
  15134. } else if ( tween.elem.nodeType === 1 && (
  15135. jQuery.cssHooks[ tween.prop ] ||
  15136. tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) {
  15137. jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
  15138. } else {
  15139. tween.elem[ tween.prop ] = tween.now;
  15140. }
  15141. }
  15142. }
  15143. };
  15144. // Support: IE <=9 only
  15145. // Panic based approach to setting things on disconnected nodes
  15146. Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
  15147. set: function( tween ) {
  15148. if ( tween.elem.nodeType && tween.elem.parentNode ) {
  15149. tween.elem[ tween.prop ] = tween.now;
  15150. }
  15151. }
  15152. };
  15153. jQuery.easing = {
  15154. linear: function( p ) {
  15155. return p;
  15156. },
  15157. swing: function( p ) {
  15158. return 0.5 - Math.cos( p * Math.PI ) / 2;
  15159. },
  15160. _default: "swing"
  15161. };
  15162. jQuery.fx = Tween.prototype.init;
  15163. // Back compat <1.8 extension point
  15164. jQuery.fx.step = {};
  15165. var
  15166. fxNow, inProgress,
  15167. rfxtypes = /^(?:toggle|show|hide)$/,
  15168. rrun = /queueHooks$/;
  15169. function schedule() {
  15170. if ( inProgress ) {
  15171. if ( document.hidden === false && window.requestAnimationFrame ) {
  15172. window.requestAnimationFrame( schedule );
  15173. } else {
  15174. window.setTimeout( schedule, jQuery.fx.interval );
  15175. }
  15176. jQuery.fx.tick();
  15177. }
  15178. }
  15179. // Animations created synchronously will run synchronously
  15180. function createFxNow() {
  15181. window.setTimeout( function() {
  15182. fxNow = undefined;
  15183. } );
  15184. return ( fxNow = Date.now() );
  15185. }
  15186. // Generate parameters to create a standard animation
  15187. function genFx( type, includeWidth ) {
  15188. var which,
  15189. i = 0,
  15190. attrs = { height: type };
  15191. // If we include width, step value is 1 to do all cssExpand values,
  15192. // otherwise step value is 2 to skip over Left and Right
  15193. includeWidth = includeWidth ? 1 : 0;
  15194. for ( ; i < 4; i += 2 - includeWidth ) {
  15195. which = cssExpand[ i ];
  15196. attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
  15197. }
  15198. if ( includeWidth ) {
  15199. attrs.opacity = attrs.width = type;
  15200. }
  15201. return attrs;
  15202. }
  15203. function createTween( value, prop, animation ) {
  15204. var tween,
  15205. collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ),
  15206. index = 0,
  15207. length = collection.length;
  15208. for ( ; index < length; index++ ) {
  15209. if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {
  15210. // We're done with this property
  15211. return tween;
  15212. }
  15213. }
  15214. }
  15215. function defaultPrefilter( elem, props, opts ) {
  15216. var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,
  15217. isBox = "width" in props || "height" in props,
  15218. anim = this,
  15219. orig = {},
  15220. style = elem.style,
  15221. hidden = elem.nodeType && isHiddenWithinTree( elem ),
  15222. dataShow = dataPriv.get( elem, "fxshow" );
  15223. // Queue-skipping animations hijack the fx hooks
  15224. if ( !opts.queue ) {
  15225. hooks = jQuery._queueHooks( elem, "fx" );
  15226. if ( hooks.unqueued == null ) {
  15227. hooks.unqueued = 0;
  15228. oldfire = hooks.empty.fire;
  15229. hooks.empty.fire = function() {
  15230. if ( !hooks.unqueued ) {
  15231. oldfire();
  15232. }
  15233. };
  15234. }
  15235. hooks.unqueued++;
  15236. anim.always( function() {
  15237. // Ensure the complete handler is called before this completes
  15238. anim.always( function() {
  15239. hooks.unqueued--;
  15240. if ( !jQuery.queue( elem, "fx" ).length ) {
  15241. hooks.empty.fire();
  15242. }
  15243. } );
  15244. } );
  15245. }
  15246. // Detect show/hide animations
  15247. for ( prop in props ) {
  15248. value = props[ prop ];
  15249. if ( rfxtypes.test( value ) ) {
  15250. delete props[ prop ];
  15251. toggle = toggle || value === "toggle";
  15252. if ( value === ( hidden ? "hide" : "show" ) ) {
  15253. // Pretend to be hidden if this is a "show" and
  15254. // there is still data from a stopped show/hide
  15255. if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
  15256. hidden = true;
  15257. // Ignore all other no-op show/hide data
  15258. } else {
  15259. continue;
  15260. }
  15261. }
  15262. orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
  15263. }
  15264. }
  15265. // Bail out if this is a no-op like .hide().hide()
  15266. propTween = !jQuery.isEmptyObject( props );
  15267. if ( !propTween && jQuery.isEmptyObject( orig ) ) {
  15268. return;
  15269. }
  15270. // Restrict "overflow" and "display" styles during box animations
  15271. if ( isBox && elem.nodeType === 1 ) {
  15272. // Support: IE <=9 - 11, Edge 12 - 15
  15273. // Record all 3 overflow attributes because IE does not infer the shorthand
  15274. // from identically-valued overflowX and overflowY and Edge just mirrors
  15275. // the overflowX value there.
  15276. opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
  15277. // Identify a display type, preferring old show/hide data over the CSS cascade
  15278. restoreDisplay = dataShow && dataShow.display;
  15279. if ( restoreDisplay == null ) {
  15280. restoreDisplay = dataPriv.get( elem, "display" );
  15281. }
  15282. display = jQuery.css( elem, "display" );
  15283. if ( display === "none" ) {
  15284. if ( restoreDisplay ) {
  15285. display = restoreDisplay;
  15286. } else {
  15287. // Get nonempty value(s) by temporarily forcing visibility
  15288. showHide( [ elem ], true );
  15289. restoreDisplay = elem.style.display || restoreDisplay;
  15290. display = jQuery.css( elem, "display" );
  15291. showHide( [ elem ] );
  15292. }
  15293. }
  15294. // Animate inline elements as inline-block
  15295. if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) {
  15296. if ( jQuery.css( elem, "float" ) === "none" ) {
  15297. // Restore the original display value at the end of pure show/hide animations
  15298. if ( !propTween ) {
  15299. anim.done( function() {
  15300. style.display = restoreDisplay;
  15301. } );
  15302. if ( restoreDisplay == null ) {
  15303. display = style.display;
  15304. restoreDisplay = display === "none" ? "" : display;
  15305. }
  15306. }
  15307. style.display = "inline-block";
  15308. }
  15309. }
  15310. }
  15311. if ( opts.overflow ) {
  15312. style.overflow = "hidden";
  15313. anim.always( function() {
  15314. style.overflow = opts.overflow[ 0 ];
  15315. style.overflowX = opts.overflow[ 1 ];
  15316. style.overflowY = opts.overflow[ 2 ];
  15317. } );
  15318. }
  15319. // Implement show/hide animations
  15320. propTween = false;
  15321. for ( prop in orig ) {
  15322. // General show/hide setup for this element animation
  15323. if ( !propTween ) {
  15324. if ( dataShow ) {
  15325. if ( "hidden" in dataShow ) {
  15326. hidden = dataShow.hidden;
  15327. }
  15328. } else {
  15329. dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } );
  15330. }
  15331. // Store hidden/visible for toggle so `.stop().toggle()` "reverses"
  15332. if ( toggle ) {
  15333. dataShow.hidden = !hidden;
  15334. }
  15335. // Show elements before animating them
  15336. if ( hidden ) {
  15337. showHide( [ elem ], true );
  15338. }
  15339. /* eslint-disable no-loop-func */
  15340. anim.done( function() {
  15341. /* eslint-enable no-loop-func */
  15342. // The final step of a "hide" animation is actually hiding the element
  15343. if ( !hidden ) {
  15344. showHide( [ elem ] );
  15345. }
  15346. dataPriv.remove( elem, "fxshow" );
  15347. for ( prop in orig ) {
  15348. jQuery.style( elem, prop, orig[ prop ] );
  15349. }
  15350. } );
  15351. }
  15352. // Per-property setup
  15353. propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
  15354. if ( !( prop in dataShow ) ) {
  15355. dataShow[ prop ] = propTween.start;
  15356. if ( hidden ) {
  15357. propTween.end = propTween.start;
  15358. propTween.start = 0;
  15359. }
  15360. }
  15361. }
  15362. }
  15363. function propFilter( props, specialEasing ) {
  15364. var index, name, easing, value, hooks;
  15365. // camelCase, specialEasing and expand cssHook pass
  15366. for ( index in props ) {
  15367. name = camelCase( index );
  15368. easing = specialEasing[ name ];
  15369. value = props[ index ];
  15370. if ( Array.isArray( value ) ) {
  15371. easing = value[ 1 ];
  15372. value = props[ index ] = value[ 0 ];
  15373. }
  15374. if ( index !== name ) {
  15375. props[ name ] = value;
  15376. delete props[ index ];
  15377. }
  15378. hooks = jQuery.cssHooks[ name ];
  15379. if ( hooks && "expand" in hooks ) {
  15380. value = hooks.expand( value );
  15381. delete props[ name ];
  15382. // Not quite $.extend, this won't overwrite existing keys.
  15383. // Reusing 'index' because we have the correct "name"
  15384. for ( index in value ) {
  15385. if ( !( index in props ) ) {
  15386. props[ index ] = value[ index ];
  15387. specialEasing[ index ] = easing;
  15388. }
  15389. }
  15390. } else {
  15391. specialEasing[ name ] = easing;
  15392. }
  15393. }
  15394. }
  15395. function Animation( elem, properties, options ) {
  15396. var result,
  15397. stopped,
  15398. index = 0,
  15399. length = Animation.prefilters.length,
  15400. deferred = jQuery.Deferred().always( function() {
  15401. // Don't match elem in the :animated selector
  15402. delete tick.elem;
  15403. } ),
  15404. tick = function() {
  15405. if ( stopped ) {
  15406. return false;
  15407. }
  15408. var currentTime = fxNow || createFxNow(),
  15409. remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
  15410. // Support: Android 2.3 only
  15411. // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
  15412. temp = remaining / animation.duration || 0,
  15413. percent = 1 - temp,
  15414. index = 0,
  15415. length = animation.tweens.length;
  15416. for ( ; index < length; index++ ) {
  15417. animation.tweens[ index ].run( percent );
  15418. }
  15419. deferred.notifyWith( elem, [ animation, percent, remaining ] );
  15420. // If there's more to do, yield
  15421. if ( percent < 1 && length ) {
  15422. return remaining;
  15423. }
  15424. // If this was an empty animation, synthesize a final progress notification
  15425. if ( !length ) {
  15426. deferred.notifyWith( elem, [ animation, 1, 0 ] );
  15427. }
  15428. // Resolve the animation and report its conclusion
  15429. deferred.resolveWith( elem, [ animation ] );
  15430. return false;
  15431. },
  15432. animation = deferred.promise( {
  15433. elem: elem,
  15434. props: jQuery.extend( {}, properties ),
  15435. opts: jQuery.extend( true, {
  15436. specialEasing: {},
  15437. easing: jQuery.easing._default
  15438. }, options ),
  15439. originalProperties: properties,
  15440. originalOptions: options,
  15441. startTime: fxNow || createFxNow(),
  15442. duration: options.duration,
  15443. tweens: [],
  15444. createTween: function( prop, end ) {
  15445. var tween = jQuery.Tween( elem, animation.opts, prop, end,
  15446. animation.opts.specialEasing[ prop ] || animation.opts.easing );
  15447. animation.tweens.push( tween );
  15448. return tween;
  15449. },
  15450. stop: function( gotoEnd ) {
  15451. var index = 0,
  15452. // If we are going to the end, we want to run all the tweens
  15453. // otherwise we skip this part
  15454. length = gotoEnd ? animation.tweens.length : 0;
  15455. if ( stopped ) {
  15456. return this;
  15457. }
  15458. stopped = true;
  15459. for ( ; index < length; index++ ) {
  15460. animation.tweens[ index ].run( 1 );
  15461. }
  15462. // Resolve when we played the last frame; otherwise, reject
  15463. if ( gotoEnd ) {
  15464. deferred.notifyWith( elem, [ animation, 1, 0 ] );
  15465. deferred.resolveWith( elem, [ animation, gotoEnd ] );
  15466. } else {
  15467. deferred.rejectWith( elem, [ animation, gotoEnd ] );
  15468. }
  15469. return this;
  15470. }
  15471. } ),
  15472. props = animation.props;
  15473. propFilter( props, animation.opts.specialEasing );
  15474. for ( ; index < length; index++ ) {
  15475. result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );
  15476. if ( result ) {
  15477. if ( isFunction( result.stop ) ) {
  15478. jQuery._queueHooks( animation.elem, animation.opts.queue ).stop =
  15479. result.stop.bind( result );
  15480. }
  15481. return result;
  15482. }
  15483. }
  15484. jQuery.map( props, createTween, animation );
  15485. if ( isFunction( animation.opts.start ) ) {
  15486. animation.opts.start.call( elem, animation );
  15487. }
  15488. // Attach callbacks from options
  15489. animation
  15490. .progress( animation.opts.progress )
  15491. .done( animation.opts.done, animation.opts.complete )
  15492. .fail( animation.opts.fail )
  15493. .always( animation.opts.always );
  15494. jQuery.fx.timer(
  15495. jQuery.extend( tick, {
  15496. elem: elem,
  15497. anim: animation,
  15498. queue: animation.opts.queue
  15499. } )
  15500. );
  15501. return animation;
  15502. }
  15503. jQuery.Animation = jQuery.extend( Animation, {
  15504. tweeners: {
  15505. "*": [ function( prop, value ) {
  15506. var tween = this.createTween( prop, value );
  15507. adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );
  15508. return tween;
  15509. } ]
  15510. },
  15511. tweener: function( props, callback ) {
  15512. if ( isFunction( props ) ) {
  15513. callback = props;
  15514. props = [ "*" ];
  15515. } else {
  15516. props = props.match( rnothtmlwhite );
  15517. }
  15518. var prop,
  15519. index = 0,
  15520. length = props.length;
  15521. for ( ; index < length; index++ ) {
  15522. prop = props[ index ];
  15523. Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];
  15524. Animation.tweeners[ prop ].unshift( callback );
  15525. }
  15526. },
  15527. prefilters: [ defaultPrefilter ],
  15528. prefilter: function( callback, prepend ) {
  15529. if ( prepend ) {
  15530. Animation.prefilters.unshift( callback );
  15531. } else {
  15532. Animation.prefilters.push( callback );
  15533. }
  15534. }
  15535. } );
  15536. jQuery.speed = function( speed, easing, fn ) {
  15537. var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
  15538. complete: fn || !fn && easing ||
  15539. isFunction( speed ) && speed,
  15540. duration: speed,
  15541. easing: fn && easing || easing && !isFunction( easing ) && easing
  15542. };
  15543. // Go to the end state if fx are off
  15544. if ( jQuery.fx.off ) {
  15545. opt.duration = 0;
  15546. } else {
  15547. if ( typeof opt.duration !== "number" ) {
  15548. if ( opt.duration in jQuery.fx.speeds ) {
  15549. opt.duration = jQuery.fx.speeds[ opt.duration ];
  15550. } else {
  15551. opt.duration = jQuery.fx.speeds._default;
  15552. }
  15553. }
  15554. }
  15555. // Normalize opt.queue - true/undefined/null -> "fx"
  15556. if ( opt.queue == null || opt.queue === true ) {
  15557. opt.queue = "fx";
  15558. }
  15559. // Queueing
  15560. opt.old = opt.complete;
  15561. opt.complete = function() {
  15562. if ( isFunction( opt.old ) ) {
  15563. opt.old.call( this );
  15564. }
  15565. if ( opt.queue ) {
  15566. jQuery.dequeue( this, opt.queue );
  15567. }
  15568. };
  15569. return opt;
  15570. };
  15571. jQuery.fn.extend( {
  15572. fadeTo: function( speed, to, easing, callback ) {
  15573. // Show any hidden elements after setting opacity to 0
  15574. return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show()
  15575. // Animate to the value specified
  15576. .end().animate( { opacity: to }, speed, easing, callback );
  15577. },
  15578. animate: function( prop, speed, easing, callback ) {
  15579. var empty = jQuery.isEmptyObject( prop ),
  15580. optall = jQuery.speed( speed, easing, callback ),
  15581. doAnimation = function() {
  15582. // Operate on a copy of prop so per-property easing won't be lost
  15583. var anim = Animation( this, jQuery.extend( {}, prop ), optall );
  15584. // Empty animations, or finishing resolves immediately
  15585. if ( empty || dataPriv.get( this, "finish" ) ) {
  15586. anim.stop( true );
  15587. }
  15588. };
  15589. doAnimation.finish = doAnimation;
  15590. return empty || optall.queue === false ?
  15591. this.each( doAnimation ) :
  15592. this.queue( optall.queue, doAnimation );
  15593. },
  15594. stop: function( type, clearQueue, gotoEnd ) {
  15595. var stopQueue = function( hooks ) {
  15596. var stop = hooks.stop;
  15597. delete hooks.stop;
  15598. stop( gotoEnd );
  15599. };
  15600. if ( typeof type !== "string" ) {
  15601. gotoEnd = clearQueue;
  15602. clearQueue = type;
  15603. type = undefined;
  15604. }
  15605. if ( clearQueue && type !== false ) {
  15606. this.queue( type || "fx", [] );
  15607. }
  15608. return this.each( function() {
  15609. var dequeue = true,
  15610. index = type != null && type + "queueHooks",
  15611. timers = jQuery.timers,
  15612. data = dataPriv.get( this );
  15613. if ( index ) {
  15614. if ( data[ index ] && data[ index ].stop ) {
  15615. stopQueue( data[ index ] );
  15616. }
  15617. } else {
  15618. for ( index in data ) {
  15619. if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
  15620. stopQueue( data[ index ] );
  15621. }
  15622. }
  15623. }
  15624. for ( index = timers.length; index--; ) {
  15625. if ( timers[ index ].elem === this &&
  15626. ( type == null || timers[ index ].queue === type ) ) {
  15627. timers[ index ].anim.stop( gotoEnd );
  15628. dequeue = false;
  15629. timers.splice( index, 1 );
  15630. }
  15631. }
  15632. // Start the next in the queue if the last step wasn't forced.
  15633. // Timers currently will call their complete callbacks, which
  15634. // will dequeue but only if they were gotoEnd.
  15635. if ( dequeue || !gotoEnd ) {
  15636. jQuery.dequeue( this, type );
  15637. }
  15638. } );
  15639. },
  15640. finish: function( type ) {
  15641. if ( type !== false ) {
  15642. type = type || "fx";
  15643. }
  15644. return this.each( function() {
  15645. var index,
  15646. data = dataPriv.get( this ),
  15647. queue = data[ type + "queue" ],
  15648. hooks = data[ type + "queueHooks" ],
  15649. timers = jQuery.timers,
  15650. length = queue ? queue.length : 0;
  15651. // Enable finishing flag on private data
  15652. data.finish = true;
  15653. // Empty the queue first
  15654. jQuery.queue( this, type, [] );
  15655. if ( hooks && hooks.stop ) {
  15656. hooks.stop.call( this, true );
  15657. }
  15658. // Look for any active animations, and finish them
  15659. for ( index = timers.length; index--; ) {
  15660. if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
  15661. timers[ index ].anim.stop( true );
  15662. timers.splice( index, 1 );
  15663. }
  15664. }
  15665. // Look for any animations in the old queue and finish them
  15666. for ( index = 0; index < length; index++ ) {
  15667. if ( queue[ index ] && queue[ index ].finish ) {
  15668. queue[ index ].finish.call( this );
  15669. }
  15670. }
  15671. // Turn off finishing flag
  15672. delete data.finish;
  15673. } );
  15674. }
  15675. } );
  15676. jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) {
  15677. var cssFn = jQuery.fn[ name ];
  15678. jQuery.fn[ name ] = function( speed, easing, callback ) {
  15679. return speed == null || typeof speed === "boolean" ?
  15680. cssFn.apply( this, arguments ) :
  15681. this.animate( genFx( name, true ), speed, easing, callback );
  15682. };
  15683. } );
  15684. // Generate shortcuts for custom animations
  15685. jQuery.each( {
  15686. slideDown: genFx( "show" ),
  15687. slideUp: genFx( "hide" ),
  15688. slideToggle: genFx( "toggle" ),
  15689. fadeIn: { opacity: "show" },
  15690. fadeOut: { opacity: "hide" },
  15691. fadeToggle: { opacity: "toggle" }
  15692. }, function( name, props ) {
  15693. jQuery.fn[ name ] = function( speed, easing, callback ) {
  15694. return this.animate( props, speed, easing, callback );
  15695. };
  15696. } );
  15697. jQuery.timers = [];
  15698. jQuery.fx.tick = function() {
  15699. var timer,
  15700. i = 0,
  15701. timers = jQuery.timers;
  15702. fxNow = Date.now();
  15703. for ( ; i < timers.length; i++ ) {
  15704. timer = timers[ i ];
  15705. // Run the timer and safely remove it when done (allowing for external removal)
  15706. if ( !timer() && timers[ i ] === timer ) {
  15707. timers.splice( i--, 1 );
  15708. }
  15709. }
  15710. if ( !timers.length ) {
  15711. jQuery.fx.stop();
  15712. }
  15713. fxNow = undefined;
  15714. };
  15715. jQuery.fx.timer = function( timer ) {
  15716. jQuery.timers.push( timer );
  15717. jQuery.fx.start();
  15718. };
  15719. jQuery.fx.interval = 13;
  15720. jQuery.fx.start = function() {
  15721. if ( inProgress ) {
  15722. return;
  15723. }
  15724. inProgress = true;
  15725. schedule();
  15726. };
  15727. jQuery.fx.stop = function() {
  15728. inProgress = null;
  15729. };
  15730. jQuery.fx.speeds = {
  15731. slow: 600,
  15732. fast: 200,
  15733. // Default speed
  15734. _default: 400
  15735. };
  15736. // Based off of the plugin by Clint Helfers, with permission.
  15737. // https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/
  15738. jQuery.fn.delay = function( time, type ) {
  15739. time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
  15740. type = type || "fx";
  15741. return this.queue( type, function( next, hooks ) {
  15742. var timeout = window.setTimeout( next, time );
  15743. hooks.stop = function() {
  15744. window.clearTimeout( timeout );
  15745. };
  15746. } );
  15747. };
  15748. ( function() {
  15749. var input = document.createElement( "input" ),
  15750. select = document.createElement( "select" ),
  15751. opt = select.appendChild( document.createElement( "option" ) );
  15752. input.type = "checkbox";
  15753. // Support: Android <=4.3 only
  15754. // Default value for a checkbox should be "on"
  15755. support.checkOn = input.value !== "";
  15756. // Support: IE <=11 only
  15757. // Must access selectedIndex to make default options select
  15758. support.optSelected = opt.selected;
  15759. // Support: IE <=11 only
  15760. // An input loses its value after becoming a radio
  15761. input = document.createElement( "input" );
  15762. input.value = "t";
  15763. input.type = "radio";
  15764. support.radioValue = input.value === "t";
  15765. } )();
  15766. var boolHook,
  15767. attrHandle = jQuery.expr.attrHandle;
  15768. jQuery.fn.extend( {
  15769. attr: function( name, value ) {
  15770. return access( this, jQuery.attr, name, value, arguments.length > 1 );
  15771. },
  15772. removeAttr: function( name ) {
  15773. return this.each( function() {
  15774. jQuery.removeAttr( this, name );
  15775. } );
  15776. }
  15777. } );
  15778. jQuery.extend( {
  15779. attr: function( elem, name, value ) {
  15780. var ret, hooks,
  15781. nType = elem.nodeType;
  15782. // Don't get/set attributes on text, comment and attribute nodes
  15783. if ( nType === 3 || nType === 8 || nType === 2 ) {
  15784. return;
  15785. }
  15786. // Fallback to prop when attributes are not supported
  15787. if ( typeof elem.getAttribute === "undefined" ) {
  15788. return jQuery.prop( elem, name, value );
  15789. }
  15790. // Attribute hooks are determined by the lowercase version
  15791. // Grab necessary hook if one is defined
  15792. if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
  15793. hooks = jQuery.attrHooks[ name.toLowerCase() ] ||
  15794. ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );
  15795. }
  15796. if ( value !== undefined ) {
  15797. if ( value === null ) {
  15798. jQuery.removeAttr( elem, name );
  15799. return;
  15800. }
  15801. if ( hooks && "set" in hooks &&
  15802. ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
  15803. return ret;
  15804. }
  15805. elem.setAttribute( name, value + "" );
  15806. return value;
  15807. }
  15808. if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
  15809. return ret;
  15810. }
  15811. ret = jQuery.find.attr( elem, name );
  15812. // Non-existent attributes return null, we normalize to undefined
  15813. return ret == null ? undefined : ret;
  15814. },
  15815. attrHooks: {
  15816. type: {
  15817. set: function( elem, value ) {
  15818. if ( !support.radioValue && value === "radio" &&
  15819. nodeName( elem, "input" ) ) {
  15820. var val = elem.value;
  15821. elem.setAttribute( "type", value );
  15822. if ( val ) {
  15823. elem.value = val;
  15824. }
  15825. return value;
  15826. }
  15827. }
  15828. }
  15829. },
  15830. removeAttr: function( elem, value ) {
  15831. var name,
  15832. i = 0,
  15833. // Attribute names can contain non-HTML whitespace characters
  15834. // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
  15835. attrNames = value && value.match( rnothtmlwhite );
  15836. if ( attrNames && elem.nodeType === 1 ) {
  15837. while ( ( name = attrNames[ i++ ] ) ) {
  15838. elem.removeAttribute( name );
  15839. }
  15840. }
  15841. }
  15842. } );
  15843. // Hooks for boolean attributes
  15844. boolHook = {
  15845. set: function( elem, value, name ) {
  15846. if ( value === false ) {
  15847. // Remove boolean attributes when set to false
  15848. jQuery.removeAttr( elem, name );
  15849. } else {
  15850. elem.setAttribute( name, name );
  15851. }
  15852. return name;
  15853. }
  15854. };
  15855. jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
  15856. var getter = attrHandle[ name ] || jQuery.find.attr;
  15857. attrHandle[ name ] = function( elem, name, isXML ) {
  15858. var ret, handle,
  15859. lowercaseName = name.toLowerCase();
  15860. if ( !isXML ) {
  15861. // Avoid an infinite loop by temporarily removing this function from the getter
  15862. handle = attrHandle[ lowercaseName ];
  15863. attrHandle[ lowercaseName ] = ret;
  15864. ret = getter( elem, name, isXML ) != null ?
  15865. lowercaseName :
  15866. null;
  15867. attrHandle[ lowercaseName ] = handle;
  15868. }
  15869. return ret;
  15870. };
  15871. } );
  15872. var rfocusable = /^(?:input|select|textarea|button)$/i,
  15873. rclickable = /^(?:a|area)$/i;
  15874. jQuery.fn.extend( {
  15875. prop: function( name, value ) {
  15876. return access( this, jQuery.prop, name, value, arguments.length > 1 );
  15877. },
  15878. removeProp: function( name ) {
  15879. return this.each( function() {
  15880. delete this[ jQuery.propFix[ name ] || name ];
  15881. } );
  15882. }
  15883. } );
  15884. jQuery.extend( {
  15885. prop: function( elem, name, value ) {
  15886. var ret, hooks,
  15887. nType = elem.nodeType;
  15888. // Don't get/set properties on text, comment and attribute nodes
  15889. if ( nType === 3 || nType === 8 || nType === 2 ) {
  15890. return;
  15891. }
  15892. if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
  15893. // Fix name and attach hooks
  15894. name = jQuery.propFix[ name ] || name;
  15895. hooks = jQuery.propHooks[ name ];
  15896. }
  15897. if ( value !== undefined ) {
  15898. if ( hooks && "set" in hooks &&
  15899. ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
  15900. return ret;
  15901. }
  15902. return ( elem[ name ] = value );
  15903. }
  15904. if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
  15905. return ret;
  15906. }
  15907. return elem[ name ];
  15908. },
  15909. propHooks: {
  15910. tabIndex: {
  15911. get: function( elem ) {
  15912. // Support: IE <=9 - 11 only
  15913. // elem.tabIndex doesn't always return the
  15914. // correct value when it hasn't been explicitly set
  15915. // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
  15916. // Use proper attribute retrieval(#12072)
  15917. var tabindex = jQuery.find.attr( elem, "tabindex" );
  15918. if ( tabindex ) {
  15919. return parseInt( tabindex, 10 );
  15920. }
  15921. if (
  15922. rfocusable.test( elem.nodeName ) ||
  15923. rclickable.test( elem.nodeName ) &&
  15924. elem.href
  15925. ) {
  15926. return 0;
  15927. }
  15928. return -1;
  15929. }
  15930. }
  15931. },
  15932. propFix: {
  15933. "for": "htmlFor",
  15934. "class": "className"
  15935. }
  15936. } );
  15937. // Support: IE <=11 only
  15938. // Accessing the selectedIndex property
  15939. // forces the browser to respect setting selected
  15940. // on the option
  15941. // The getter ensures a default option is selected
  15942. // when in an optgroup
  15943. // eslint rule "no-unused-expressions" is disabled for this code
  15944. // since it considers such accessions noop
  15945. if ( !support.optSelected ) {
  15946. jQuery.propHooks.selected = {
  15947. get: function( elem ) {
  15948. /* eslint no-unused-expressions: "off" */
  15949. var parent = elem.parentNode;
  15950. if ( parent && parent.parentNode ) {
  15951. parent.parentNode.selectedIndex;
  15952. }
  15953. return null;
  15954. },
  15955. set: function( elem ) {
  15956. /* eslint no-unused-expressions: "off" */
  15957. var parent = elem.parentNode;
  15958. if ( parent ) {
  15959. parent.selectedIndex;
  15960. if ( parent.parentNode ) {
  15961. parent.parentNode.selectedIndex;
  15962. }
  15963. }
  15964. }
  15965. };
  15966. }
  15967. jQuery.each( [
  15968. "tabIndex",
  15969. "readOnly",
  15970. "maxLength",
  15971. "cellSpacing",
  15972. "cellPadding",
  15973. "rowSpan",
  15974. "colSpan",
  15975. "useMap",
  15976. "frameBorder",
  15977. "contentEditable"
  15978. ], function() {
  15979. jQuery.propFix[ this.toLowerCase() ] = this;
  15980. } );
  15981. // Strip and collapse whitespace according to HTML spec
  15982. // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace
  15983. function stripAndCollapse( value ) {
  15984. var tokens = value.match( rnothtmlwhite ) || [];
  15985. return tokens.join( " " );
  15986. }
  15987. function getClass( elem ) {
  15988. return elem.getAttribute && elem.getAttribute( "class" ) || "";
  15989. }
  15990. function classesToArray( value ) {
  15991. if ( Array.isArray( value ) ) {
  15992. return value;
  15993. }
  15994. if ( typeof value === "string" ) {
  15995. return value.match( rnothtmlwhite ) || [];
  15996. }
  15997. return [];
  15998. }
  15999. jQuery.fn.extend( {
  16000. addClass: function( value ) {
  16001. var classes, elem, cur, curValue, clazz, j, finalValue,
  16002. i = 0;
  16003. if ( isFunction( value ) ) {
  16004. return this.each( function( j ) {
  16005. jQuery( this ).addClass( value.call( this, j, getClass( this ) ) );
  16006. } );
  16007. }
  16008. classes = classesToArray( value );
  16009. if ( classes.length ) {
  16010. while ( ( elem = this[ i++ ] ) ) {
  16011. curValue = getClass( elem );
  16012. cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
  16013. if ( cur ) {
  16014. j = 0;
  16015. while ( ( clazz = classes[ j++ ] ) ) {
  16016. if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
  16017. cur += clazz + " ";
  16018. }
  16019. }
  16020. // Only assign if different to avoid unneeded rendering.
  16021. finalValue = stripAndCollapse( cur );
  16022. if ( curValue !== finalValue ) {
  16023. elem.setAttribute( "class", finalValue );
  16024. }
  16025. }
  16026. }
  16027. }
  16028. return this;
  16029. },
  16030. removeClass: function( value ) {
  16031. var classes, elem, cur, curValue, clazz, j, finalValue,
  16032. i = 0;
  16033. if ( isFunction( value ) ) {
  16034. return this.each( function( j ) {
  16035. jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );
  16036. } );
  16037. }
  16038. if ( !arguments.length ) {
  16039. return this.attr( "class", "" );
  16040. }
  16041. classes = classesToArray( value );
  16042. if ( classes.length ) {
  16043. while ( ( elem = this[ i++ ] ) ) {
  16044. curValue = getClass( elem );
  16045. // This expression is here for better compressibility (see addClass)
  16046. cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
  16047. if ( cur ) {
  16048. j = 0;
  16049. while ( ( clazz = classes[ j++ ] ) ) {
  16050. // Remove *all* instances
  16051. while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
  16052. cur = cur.replace( " " + clazz + " ", " " );
  16053. }
  16054. }
  16055. // Only assign if different to avoid unneeded rendering.
  16056. finalValue = stripAndCollapse( cur );
  16057. if ( curValue !== finalValue ) {
  16058. elem.setAttribute( "class", finalValue );
  16059. }
  16060. }
  16061. }
  16062. }
  16063. return this;
  16064. },
  16065. toggleClass: function( value, stateVal ) {
  16066. var type = typeof value,
  16067. isValidValue = type === "string" || Array.isArray( value );
  16068. if ( typeof stateVal === "boolean" && isValidValue ) {
  16069. return stateVal ? this.addClass( value ) : this.removeClass( value );
  16070. }
  16071. if ( isFunction( value ) ) {
  16072. return this.each( function( i ) {
  16073. jQuery( this ).toggleClass(
  16074. value.call( this, i, getClass( this ), stateVal ),
  16075. stateVal
  16076. );
  16077. } );
  16078. }
  16079. return this.each( function() {
  16080. var className, i, self, classNames;
  16081. if ( isValidValue ) {
  16082. // Toggle individual class names
  16083. i = 0;
  16084. self = jQuery( this );
  16085. classNames = classesToArray( value );
  16086. while ( ( className = classNames[ i++ ] ) ) {
  16087. // Check each className given, space separated list
  16088. if ( self.hasClass( className ) ) {
  16089. self.removeClass( className );
  16090. } else {
  16091. self.addClass( className );
  16092. }
  16093. }
  16094. // Toggle whole class name
  16095. } else if ( value === undefined || type === "boolean" ) {
  16096. className = getClass( this );
  16097. if ( className ) {
  16098. // Store className if set
  16099. dataPriv.set( this, "__className__", className );
  16100. }
  16101. // If the element has a class name or if we're passed `false`,
  16102. // then remove the whole classname (if there was one, the above saved it).
  16103. // Otherwise bring back whatever was previously saved (if anything),
  16104. // falling back to the empty string if nothing was stored.
  16105. if ( this.setAttribute ) {
  16106. this.setAttribute( "class",
  16107. className || value === false ?
  16108. "" :
  16109. dataPriv.get( this, "__className__" ) || ""
  16110. );
  16111. }
  16112. }
  16113. } );
  16114. },
  16115. hasClass: function( selector ) {
  16116. var className, elem,
  16117. i = 0;
  16118. className = " " + selector + " ";
  16119. while ( ( elem = this[ i++ ] ) ) {
  16120. if ( elem.nodeType === 1 &&
  16121. ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) {
  16122. return true;
  16123. }
  16124. }
  16125. return false;
  16126. }
  16127. } );
  16128. var rreturn = /\r/g;
  16129. jQuery.fn.extend( {
  16130. val: function( value ) {
  16131. var hooks, ret, valueIsFunction,
  16132. elem = this[ 0 ];
  16133. if ( !arguments.length ) {
  16134. if ( elem ) {
  16135. hooks = jQuery.valHooks[ elem.type ] ||
  16136. jQuery.valHooks[ elem.nodeName.toLowerCase() ];
  16137. if ( hooks &&
  16138. "get" in hooks &&
  16139. ( ret = hooks.get( elem, "value" ) ) !== undefined
  16140. ) {
  16141. return ret;
  16142. }
  16143. ret = elem.value;
  16144. // Handle most common string cases
  16145. if ( typeof ret === "string" ) {
  16146. return ret.replace( rreturn, "" );
  16147. }
  16148. // Handle cases where value is null/undef or number
  16149. return ret == null ? "" : ret;
  16150. }
  16151. return;
  16152. }
  16153. valueIsFunction = isFunction( value );
  16154. return this.each( function( i ) {
  16155. var val;
  16156. if ( this.nodeType !== 1 ) {
  16157. return;
  16158. }
  16159. if ( valueIsFunction ) {
  16160. val = value.call( this, i, jQuery( this ).val() );
  16161. } else {
  16162. val = value;
  16163. }
  16164. // Treat null/undefined as ""; convert numbers to string
  16165. if ( val == null ) {
  16166. val = "";
  16167. } else if ( typeof val === "number" ) {
  16168. val += "";
  16169. } else if ( Array.isArray( val ) ) {
  16170. val = jQuery.map( val, function( value ) {
  16171. return value == null ? "" : value + "";
  16172. } );
  16173. }
  16174. hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
  16175. // If set returns undefined, fall back to normal setting
  16176. if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) {
  16177. this.value = val;
  16178. }
  16179. } );
  16180. }
  16181. } );
  16182. jQuery.extend( {
  16183. valHooks: {
  16184. option: {
  16185. get: function( elem ) {
  16186. var val = jQuery.find.attr( elem, "value" );
  16187. return val != null ?
  16188. val :
  16189. // Support: IE <=10 - 11 only
  16190. // option.text throws exceptions (#14686, #14858)
  16191. // Strip and collapse whitespace
  16192. // https://html.spec.whatwg.org/#strip-and-collapse-whitespace
  16193. stripAndCollapse( jQuery.text( elem ) );
  16194. }
  16195. },
  16196. select: {
  16197. get: function( elem ) {
  16198. var value, option, i,
  16199. options = elem.options,
  16200. index = elem.selectedIndex,
  16201. one = elem.type === "select-one",
  16202. values = one ? null : [],
  16203. max = one ? index + 1 : options.length;
  16204. if ( index < 0 ) {
  16205. i = max;
  16206. } else {
  16207. i = one ? index : 0;
  16208. }
  16209. // Loop through all the selected options
  16210. for ( ; i < max; i++ ) {
  16211. option = options[ i ];
  16212. // Support: IE <=9 only
  16213. // IE8-9 doesn't update selected after form reset (#2551)
  16214. if ( ( option.selected || i === index ) &&
  16215. // Don't return options that are disabled or in a disabled optgroup
  16216. !option.disabled &&
  16217. ( !option.parentNode.disabled ||
  16218. !nodeName( option.parentNode, "optgroup" ) ) ) {
  16219. // Get the specific value for the option
  16220. value = jQuery( option ).val();
  16221. // We don't need an array for one selects
  16222. if ( one ) {
  16223. return value;
  16224. }
  16225. // Multi-Selects return an array
  16226. values.push( value );
  16227. }
  16228. }
  16229. return values;
  16230. },
  16231. set: function( elem, value ) {
  16232. var optionSet, option,
  16233. options = elem.options,
  16234. values = jQuery.makeArray( value ),
  16235. i = options.length;
  16236. while ( i-- ) {
  16237. option = options[ i ];
  16238. /* eslint-disable no-cond-assign */
  16239. if ( option.selected =
  16240. jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1
  16241. ) {
  16242. optionSet = true;
  16243. }
  16244. /* eslint-enable no-cond-assign */
  16245. }
  16246. // Force browsers to behave consistently when non-matching value is set
  16247. if ( !optionSet ) {
  16248. elem.selectedIndex = -1;
  16249. }
  16250. return values;
  16251. }
  16252. }
  16253. }
  16254. } );
  16255. // Radios and checkboxes getter/setter
  16256. jQuery.each( [ "radio", "checkbox" ], function() {
  16257. jQuery.valHooks[ this ] = {
  16258. set: function( elem, value ) {
  16259. if ( Array.isArray( value ) ) {
  16260. return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );
  16261. }
  16262. }
  16263. };
  16264. if ( !support.checkOn ) {
  16265. jQuery.valHooks[ this ].get = function( elem ) {
  16266. return elem.getAttribute( "value" ) === null ? "on" : elem.value;
  16267. };
  16268. }
  16269. } );
  16270. // Return jQuery for attributes-only inclusion
  16271. support.focusin = "onfocusin" in window;
  16272. var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
  16273. stopPropagationCallback = function( e ) {
  16274. e.stopPropagation();
  16275. };
  16276. jQuery.extend( jQuery.event, {
  16277. trigger: function( event, data, elem, onlyHandlers ) {
  16278. var i, cur, tmp, bubbleType, ontype, handle, special, lastElement,
  16279. eventPath = [ elem || document ],
  16280. type = hasOwn.call( event, "type" ) ? event.type : event,
  16281. namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : [];
  16282. cur = lastElement = tmp = elem = elem || document;
  16283. // Don't do events on text and comment nodes
  16284. if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
  16285. return;
  16286. }
  16287. // focus/blur morphs to focusin/out; ensure we're not firing them right now
  16288. if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
  16289. return;
  16290. }
  16291. if ( type.indexOf( "." ) > -1 ) {
  16292. // Namespaced trigger; create a regexp to match event type in handle()
  16293. namespaces = type.split( "." );
  16294. type = namespaces.shift();
  16295. namespaces.sort();
  16296. }
  16297. ontype = type.indexOf( ":" ) < 0 && "on" + type;
  16298. // Caller can pass in a jQuery.Event object, Object, or just an event type string
  16299. event = event[ jQuery.expando ] ?
  16300. event :
  16301. new jQuery.Event( type, typeof event === "object" && event );
  16302. // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
  16303. event.isTrigger = onlyHandlers ? 2 : 3;
  16304. event.namespace = namespaces.join( "." );
  16305. event.rnamespace = event.namespace ?
  16306. new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) :
  16307. null;
  16308. // Clean up the event in case it is being reused
  16309. event.result = undefined;
  16310. if ( !event.target ) {
  16311. event.target = elem;
  16312. }
  16313. // Clone any incoming data and prepend the event, creating the handler arg list
  16314. data = data == null ?
  16315. [ event ] :
  16316. jQuery.makeArray( data, [ event ] );
  16317. // Allow special events to draw outside the lines
  16318. special = jQuery.event.special[ type ] || {};
  16319. if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
  16320. return;
  16321. }
  16322. // Determine event propagation path in advance, per W3C events spec (#9951)
  16323. // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
  16324. if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) {
  16325. bubbleType = special.delegateType || type;
  16326. if ( !rfocusMorph.test( bubbleType + type ) ) {
  16327. cur = cur.parentNode;
  16328. }
  16329. for ( ; cur; cur = cur.parentNode ) {
  16330. eventPath.push( cur );
  16331. tmp = cur;
  16332. }
  16333. // Only add window if we got to document (e.g., not plain obj or detached DOM)
  16334. if ( tmp === ( elem.ownerDocument || document ) ) {
  16335. eventPath.push( tmp.defaultView || tmp.parentWindow || window );
  16336. }
  16337. }
  16338. // Fire handlers on the event path
  16339. i = 0;
  16340. while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {
  16341. lastElement = cur;
  16342. event.type = i > 1 ?
  16343. bubbleType :
  16344. special.bindType || type;
  16345. // jQuery handler
  16346. handle = ( dataPriv.get( cur, "events" ) || {} )[ event.type ] &&
  16347. dataPriv.get( cur, "handle" );
  16348. if ( handle ) {
  16349. handle.apply( cur, data );
  16350. }
  16351. // Native handler
  16352. handle = ontype && cur[ ontype ];
  16353. if ( handle && handle.apply && acceptData( cur ) ) {
  16354. event.result = handle.apply( cur, data );
  16355. if ( event.result === false ) {
  16356. event.preventDefault();
  16357. }
  16358. }
  16359. }
  16360. event.type = type;
  16361. // If nobody prevented the default action, do it now
  16362. if ( !onlyHandlers && !event.isDefaultPrevented() ) {
  16363. if ( ( !special._default ||
  16364. special._default.apply( eventPath.pop(), data ) === false ) &&
  16365. acceptData( elem ) ) {
  16366. // Call a native DOM method on the target with the same name as the event.
  16367. // Don't do default actions on window, that's where global variables be (#6170)
  16368. if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) {
  16369. // Don't re-trigger an onFOO event when we call its FOO() method
  16370. tmp = elem[ ontype ];
  16371. if ( tmp ) {
  16372. elem[ ontype ] = null;
  16373. }
  16374. // Prevent re-triggering of the same event, since we already bubbled it above
  16375. jQuery.event.triggered = type;
  16376. if ( event.isPropagationStopped() ) {
  16377. lastElement.addEventListener( type, stopPropagationCallback );
  16378. }
  16379. elem[ type ]();
  16380. if ( event.isPropagationStopped() ) {
  16381. lastElement.removeEventListener( type, stopPropagationCallback );
  16382. }
  16383. jQuery.event.triggered = undefined;
  16384. if ( tmp ) {
  16385. elem[ ontype ] = tmp;
  16386. }
  16387. }
  16388. }
  16389. }
  16390. return event.result;
  16391. },
  16392. // Piggyback on a donor event to simulate a different one
  16393. // Used only for `focus(in | out)` events
  16394. simulate: function( type, elem, event ) {
  16395. var e = jQuery.extend(
  16396. new jQuery.Event(),
  16397. event,
  16398. {
  16399. type: type,
  16400. isSimulated: true
  16401. }
  16402. );
  16403. jQuery.event.trigger( e, null, elem );
  16404. }
  16405. } );
  16406. jQuery.fn.extend( {
  16407. trigger: function( type, data ) {
  16408. return this.each( function() {
  16409. jQuery.event.trigger( type, data, this );
  16410. } );
  16411. },
  16412. triggerHandler: function( type, data ) {
  16413. var elem = this[ 0 ];
  16414. if ( elem ) {
  16415. return jQuery.event.trigger( type, data, elem, true );
  16416. }
  16417. }
  16418. } );
  16419. // Support: Firefox <=44
  16420. // Firefox doesn't have focus(in | out) events
  16421. // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
  16422. //
  16423. // Support: Chrome <=48 - 49, Safari <=9.0 - 9.1
  16424. // focus(in | out) events fire after focus & blur events,
  16425. // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
  16426. // Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857
  16427. if ( !support.focusin ) {
  16428. jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) {
  16429. // Attach a single capturing handler on the document while someone wants focusin/focusout
  16430. var handler = function( event ) {
  16431. jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );
  16432. };
  16433. jQuery.event.special[ fix ] = {
  16434. setup: function() {
  16435. var doc = this.ownerDocument || this,
  16436. attaches = dataPriv.access( doc, fix );
  16437. if ( !attaches ) {
  16438. doc.addEventListener( orig, handler, true );
  16439. }
  16440. dataPriv.access( doc, fix, ( attaches || 0 ) + 1 );
  16441. },
  16442. teardown: function() {
  16443. var doc = this.ownerDocument || this,
  16444. attaches = dataPriv.access( doc, fix ) - 1;
  16445. if ( !attaches ) {
  16446. doc.removeEventListener( orig, handler, true );
  16447. dataPriv.remove( doc, fix );
  16448. } else {
  16449. dataPriv.access( doc, fix, attaches );
  16450. }
  16451. }
  16452. };
  16453. } );
  16454. }
  16455. var location = window.location;
  16456. var nonce = Date.now();
  16457. var rquery = ( /\?/ );
  16458. // Cross-browser xml parsing
  16459. jQuery.parseXML = function( data ) {
  16460. var xml;
  16461. if ( !data || typeof data !== "string" ) {
  16462. return null;
  16463. }
  16464. // Support: IE 9 - 11 only
  16465. // IE throws on parseFromString with invalid input.
  16466. try {
  16467. xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
  16468. } catch ( e ) {
  16469. xml = undefined;
  16470. }
  16471. if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
  16472. jQuery.error( "Invalid XML: " + data );
  16473. }
  16474. return xml;
  16475. };
  16476. var
  16477. rbracket = /\[\]$/,
  16478. rCRLF = /\r?\n/g,
  16479. rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
  16480. rsubmittable = /^(?:input|select|textarea|keygen)/i;
  16481. function buildParams( prefix, obj, traditional, add ) {
  16482. var name;
  16483. if ( Array.isArray( obj ) ) {
  16484. // Serialize array item.
  16485. jQuery.each( obj, function( i, v ) {
  16486. if ( traditional || rbracket.test( prefix ) ) {
  16487. // Treat each array item as a scalar.
  16488. add( prefix, v );
  16489. } else {
  16490. // Item is non-scalar (array or object), encode its numeric index.
  16491. buildParams(
  16492. prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]",
  16493. v,
  16494. traditional,
  16495. add
  16496. );
  16497. }
  16498. } );
  16499. } else if ( !traditional && toType( obj ) === "object" ) {
  16500. // Serialize object item.
  16501. for ( name in obj ) {
  16502. buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
  16503. }
  16504. } else {
  16505. // Serialize scalar item.
  16506. add( prefix, obj );
  16507. }
  16508. }
  16509. // Serialize an array of form elements or a set of
  16510. // key/values into a query string
  16511. jQuery.param = function( a, traditional ) {
  16512. var prefix,
  16513. s = [],
  16514. add = function( key, valueOrFunction ) {
  16515. // If value is a function, invoke it and use its return value
  16516. var value = isFunction( valueOrFunction ) ?
  16517. valueOrFunction() :
  16518. valueOrFunction;
  16519. s[ s.length ] = encodeURIComponent( key ) + "=" +
  16520. encodeURIComponent( value == null ? "" : value );
  16521. };
  16522. if ( a == null ) {
  16523. return "";
  16524. }
  16525. // If an array was passed in, assume that it is an array of form elements.
  16526. if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
  16527. // Serialize the form elements
  16528. jQuery.each( a, function() {
  16529. add( this.name, this.value );
  16530. } );
  16531. } else {
  16532. // If traditional, encode the "old" way (the way 1.3.2 or older
  16533. // did it), otherwise encode params recursively.
  16534. for ( prefix in a ) {
  16535. buildParams( prefix, a[ prefix ], traditional, add );
  16536. }
  16537. }
  16538. // Return the resulting serialization
  16539. return s.join( "&" );
  16540. };
  16541. jQuery.fn.extend( {
  16542. serialize: function() {
  16543. return jQuery.param( this.serializeArray() );
  16544. },
  16545. serializeArray: function() {
  16546. return this.map( function() {
  16547. // Can add propHook for "elements" to filter or add form elements
  16548. var elements = jQuery.prop( this, "elements" );
  16549. return elements ? jQuery.makeArray( elements ) : this;
  16550. } )
  16551. .filter( function() {
  16552. var type = this.type;
  16553. // Use .is( ":disabled" ) so that fieldset[disabled] works
  16554. return this.name && !jQuery( this ).is( ":disabled" ) &&
  16555. rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
  16556. ( this.checked || !rcheckableType.test( type ) );
  16557. } )
  16558. .map( function( i, elem ) {
  16559. var val = jQuery( this ).val();
  16560. if ( val == null ) {
  16561. return null;
  16562. }
  16563. if ( Array.isArray( val ) ) {
  16564. return jQuery.map( val, function( val ) {
  16565. return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  16566. } );
  16567. }
  16568. return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  16569. } ).get();
  16570. }
  16571. } );
  16572. var
  16573. r20 = /%20/g,
  16574. rhash = /#.*$/,
  16575. rantiCache = /([?&])_=[^&]*/,
  16576. rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
  16577. // #7653, #8125, #8152: local protocol detection
  16578. rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
  16579. rnoContent = /^(?:GET|HEAD)$/,
  16580. rprotocol = /^\/\//,
  16581. /* Prefilters
  16582. * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
  16583. * 2) These are called:
  16584. * - BEFORE asking for a transport
  16585. * - AFTER param serialization (s.data is a string if s.processData is true)
  16586. * 3) key is the dataType
  16587. * 4) the catchall symbol "*" can be used
  16588. * 5) execution will start with transport dataType and THEN continue down to "*" if needed
  16589. */
  16590. prefilters = {},
  16591. /* Transports bindings
  16592. * 1) key is the dataType
  16593. * 2) the catchall symbol "*" can be used
  16594. * 3) selection will start with transport dataType and THEN go to "*" if needed
  16595. */
  16596. transports = {},
  16597. // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
  16598. allTypes = "*/".concat( "*" ),
  16599. // Anchor tag for parsing the document origin
  16600. originAnchor = document.createElement( "a" );
  16601. originAnchor.href = location.href;
  16602. // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
  16603. function addToPrefiltersOrTransports( structure ) {
  16604. // dataTypeExpression is optional and defaults to "*"
  16605. return function( dataTypeExpression, func ) {
  16606. if ( typeof dataTypeExpression !== "string" ) {
  16607. func = dataTypeExpression;
  16608. dataTypeExpression = "*";
  16609. }
  16610. var dataType,
  16611. i = 0,
  16612. dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || [];
  16613. if ( isFunction( func ) ) {
  16614. // For each dataType in the dataTypeExpression
  16615. while ( ( dataType = dataTypes[ i++ ] ) ) {
  16616. // Prepend if requested
  16617. if ( dataType[ 0 ] === "+" ) {
  16618. dataType = dataType.slice( 1 ) || "*";
  16619. ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );
  16620. // Otherwise append
  16621. } else {
  16622. ( structure[ dataType ] = structure[ dataType ] || [] ).push( func );
  16623. }
  16624. }
  16625. }
  16626. };
  16627. }
  16628. // Base inspection function for prefilters and transports
  16629. function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
  16630. var inspected = {},
  16631. seekingTransport = ( structure === transports );
  16632. function inspect( dataType ) {
  16633. var selected;
  16634. inspected[ dataType ] = true;
  16635. jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
  16636. var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
  16637. if ( typeof dataTypeOrTransport === "string" &&
  16638. !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
  16639. options.dataTypes.unshift( dataTypeOrTransport );
  16640. inspect( dataTypeOrTransport );
  16641. return false;
  16642. } else if ( seekingTransport ) {
  16643. return !( selected = dataTypeOrTransport );
  16644. }
  16645. } );
  16646. return selected;
  16647. }
  16648. return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
  16649. }
  16650. // A special extend for ajax options
  16651. // that takes "flat" options (not to be deep extended)
  16652. // Fixes #9887
  16653. function ajaxExtend( target, src ) {
  16654. var key, deep,
  16655. flatOptions = jQuery.ajaxSettings.flatOptions || {};
  16656. for ( key in src ) {
  16657. if ( src[ key ] !== undefined ) {
  16658. ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
  16659. }
  16660. }
  16661. if ( deep ) {
  16662. jQuery.extend( true, target, deep );
  16663. }
  16664. return target;
  16665. }
  16666. /* Handles responses to an ajax request:
  16667. * - finds the right dataType (mediates between content-type and expected dataType)
  16668. * - returns the corresponding response
  16669. */
  16670. function ajaxHandleResponses( s, jqXHR, responses ) {
  16671. var ct, type, finalDataType, firstDataType,
  16672. contents = s.contents,
  16673. dataTypes = s.dataTypes;
  16674. // Remove auto dataType and get content-type in the process
  16675. while ( dataTypes[ 0 ] === "*" ) {
  16676. dataTypes.shift();
  16677. if ( ct === undefined ) {
  16678. ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" );
  16679. }
  16680. }
  16681. // Check if we're dealing with a known content-type
  16682. if ( ct ) {
  16683. for ( type in contents ) {
  16684. if ( contents[ type ] && contents[ type ].test( ct ) ) {
  16685. dataTypes.unshift( type );
  16686. break;
  16687. }
  16688. }
  16689. }
  16690. // Check to see if we have a response for the expected dataType
  16691. if ( dataTypes[ 0 ] in responses ) {
  16692. finalDataType = dataTypes[ 0 ];
  16693. } else {
  16694. // Try convertible dataTypes
  16695. for ( type in responses ) {
  16696. if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) {
  16697. finalDataType = type;
  16698. break;
  16699. }
  16700. if ( !firstDataType ) {
  16701. firstDataType = type;
  16702. }
  16703. }
  16704. // Or just use first one
  16705. finalDataType = finalDataType || firstDataType;
  16706. }
  16707. // If we found a dataType
  16708. // We add the dataType to the list if needed
  16709. // and return the corresponding response
  16710. if ( finalDataType ) {
  16711. if ( finalDataType !== dataTypes[ 0 ] ) {
  16712. dataTypes.unshift( finalDataType );
  16713. }
  16714. return responses[ finalDataType ];
  16715. }
  16716. }
  16717. /* Chain conversions given the request and the original response
  16718. * Also sets the responseXXX fields on the jqXHR instance
  16719. */
  16720. function ajaxConvert( s, response, jqXHR, isSuccess ) {
  16721. var conv2, current, conv, tmp, prev,
  16722. converters = {},
  16723. // Work with a copy of dataTypes in case we need to modify it for conversion
  16724. dataTypes = s.dataTypes.slice();
  16725. // Create converters map with lowercased keys
  16726. if ( dataTypes[ 1 ] ) {
  16727. for ( conv in s.converters ) {
  16728. converters[ conv.toLowerCase() ] = s.converters[ conv ];
  16729. }
  16730. }
  16731. current = dataTypes.shift();
  16732. // Convert to each sequential dataType
  16733. while ( current ) {
  16734. if ( s.responseFields[ current ] ) {
  16735. jqXHR[ s.responseFields[ current ] ] = response;
  16736. }
  16737. // Apply the dataFilter if provided
  16738. if ( !prev && isSuccess && s.dataFilter ) {
  16739. response = s.dataFilter( response, s.dataType );
  16740. }
  16741. prev = current;
  16742. current = dataTypes.shift();
  16743. if ( current ) {
  16744. // There's only work to do if current dataType is non-auto
  16745. if ( current === "*" ) {
  16746. current = prev;
  16747. // Convert response if prev dataType is non-auto and differs from current
  16748. } else if ( prev !== "*" && prev !== current ) {
  16749. // Seek a direct converter
  16750. conv = converters[ prev + " " + current ] || converters[ "* " + current ];
  16751. // If none found, seek a pair
  16752. if ( !conv ) {
  16753. for ( conv2 in converters ) {
  16754. // If conv2 outputs current
  16755. tmp = conv2.split( " " );
  16756. if ( tmp[ 1 ] === current ) {
  16757. // If prev can be converted to accepted input
  16758. conv = converters[ prev + " " + tmp[ 0 ] ] ||
  16759. converters[ "* " + tmp[ 0 ] ];
  16760. if ( conv ) {
  16761. // Condense equivalence converters
  16762. if ( conv === true ) {
  16763. conv = converters[ conv2 ];
  16764. // Otherwise, insert the intermediate dataType
  16765. } else if ( converters[ conv2 ] !== true ) {
  16766. current = tmp[ 0 ];
  16767. dataTypes.unshift( tmp[ 1 ] );
  16768. }
  16769. break;
  16770. }
  16771. }
  16772. }
  16773. }
  16774. // Apply converter (if not an equivalence)
  16775. if ( conv !== true ) {
  16776. // Unless errors are allowed to bubble, catch and return them
  16777. if ( conv && s.throws ) {
  16778. response = conv( response );
  16779. } else {
  16780. try {
  16781. response = conv( response );
  16782. } catch ( e ) {
  16783. return {
  16784. state: "parsererror",
  16785. error: conv ? e : "No conversion from " + prev + " to " + current
  16786. };
  16787. }
  16788. }
  16789. }
  16790. }
  16791. }
  16792. }
  16793. return { state: "success", data: response };
  16794. }
  16795. jQuery.extend( {
  16796. // Counter for holding the number of active queries
  16797. active: 0,
  16798. // Last-Modified header cache for next request
  16799. lastModified: {},
  16800. etag: {},
  16801. ajaxSettings: {
  16802. url: location.href,
  16803. type: "GET",
  16804. isLocal: rlocalProtocol.test( location.protocol ),
  16805. global: true,
  16806. processData: true,
  16807. async: true,
  16808. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  16809. /*
  16810. timeout: 0,
  16811. data: null,
  16812. dataType: null,
  16813. username: null,
  16814. password: null,
  16815. cache: null,
  16816. throws: false,
  16817. traditional: false,
  16818. headers: {},
  16819. */
  16820. accepts: {
  16821. "*": allTypes,
  16822. text: "text/plain",
  16823. html: "text/html",
  16824. xml: "application/xml, text/xml",
  16825. json: "application/json, text/javascript"
  16826. },
  16827. contents: {
  16828. xml: /\bxml\b/,
  16829. html: /\bhtml/,
  16830. json: /\bjson\b/
  16831. },
  16832. responseFields: {
  16833. xml: "responseXML",
  16834. text: "responseText",
  16835. json: "responseJSON"
  16836. },
  16837. // Data converters
  16838. // Keys separate source (or catchall "*") and destination types with a single space
  16839. converters: {
  16840. // Convert anything to text
  16841. "* text": String,
  16842. // Text to html (true = no transformation)
  16843. "text html": true,
  16844. // Evaluate text as a json expression
  16845. "text json": JSON.parse,
  16846. // Parse text as xml
  16847. "text xml": jQuery.parseXML
  16848. },
  16849. // For options that shouldn't be deep extended:
  16850. // you can add your own custom options here if
  16851. // and when you create one that shouldn't be
  16852. // deep extended (see ajaxExtend)
  16853. flatOptions: {
  16854. url: true,
  16855. context: true
  16856. }
  16857. },
  16858. // Creates a full fledged settings object into target
  16859. // with both ajaxSettings and settings fields.
  16860. // If target is omitted, writes into ajaxSettings.
  16861. ajaxSetup: function( target, settings ) {
  16862. return settings ?
  16863. // Building a settings object
  16864. ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
  16865. // Extending ajaxSettings
  16866. ajaxExtend( jQuery.ajaxSettings, target );
  16867. },
  16868. ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
  16869. ajaxTransport: addToPrefiltersOrTransports( transports ),
  16870. // Main method
  16871. ajax: function( url, options ) {
  16872. // If url is an object, simulate pre-1.5 signature
  16873. if ( typeof url === "object" ) {
  16874. options = url;
  16875. url = undefined;
  16876. }
  16877. // Force options to be an object
  16878. options = options || {};
  16879. var transport,
  16880. // URL without anti-cache param
  16881. cacheURL,
  16882. // Response headers
  16883. responseHeadersString,
  16884. responseHeaders,
  16885. // timeout handle
  16886. timeoutTimer,
  16887. // Url cleanup var
  16888. urlAnchor,
  16889. // Request state (becomes false upon send and true upon completion)
  16890. completed,
  16891. // To know if global events are to be dispatched
  16892. fireGlobals,
  16893. // Loop variable
  16894. i,
  16895. // uncached part of the url
  16896. uncached,
  16897. // Create the final options object
  16898. s = jQuery.ajaxSetup( {}, options ),
  16899. // Callbacks context
  16900. callbackContext = s.context || s,
  16901. // Context for global events is callbackContext if it is a DOM node or jQuery collection
  16902. globalEventContext = s.context &&
  16903. ( callbackContext.nodeType || callbackContext.jquery ) ?
  16904. jQuery( callbackContext ) :
  16905. jQuery.event,
  16906. // Deferreds
  16907. deferred = jQuery.Deferred(),
  16908. completeDeferred = jQuery.Callbacks( "once memory" ),
  16909. // Status-dependent callbacks
  16910. statusCode = s.statusCode || {},
  16911. // Headers (they are sent all at once)
  16912. requestHeaders = {},
  16913. requestHeadersNames = {},
  16914. // Default abort message
  16915. strAbort = "canceled",
  16916. // Fake xhr
  16917. jqXHR = {
  16918. readyState: 0,
  16919. // Builds headers hashtable if needed
  16920. getResponseHeader: function( key ) {
  16921. var match;
  16922. if ( completed ) {
  16923. if ( !responseHeaders ) {
  16924. responseHeaders = {};
  16925. while ( ( match = rheaders.exec( responseHeadersString ) ) ) {
  16926. responseHeaders[ match[ 1 ].toLowerCase() + " " ] =
  16927. ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] )
  16928. .concat( match[ 2 ] );
  16929. }
  16930. }
  16931. match = responseHeaders[ key.toLowerCase() + " " ];
  16932. }
  16933. return match == null ? null : match.join( ", " );
  16934. },
  16935. // Raw string
  16936. getAllResponseHeaders: function() {
  16937. return completed ? responseHeadersString : null;
  16938. },
  16939. // Caches the header
  16940. setRequestHeader: function( name, value ) {
  16941. if ( completed == null ) {
  16942. name = requestHeadersNames[ name.toLowerCase() ] =
  16943. requestHeadersNames[ name.toLowerCase() ] || name;
  16944. requestHeaders[ name ] = value;
  16945. }
  16946. return this;
  16947. },
  16948. // Overrides response content-type header
  16949. overrideMimeType: function( type ) {
  16950. if ( completed == null ) {
  16951. s.mimeType = type;
  16952. }
  16953. return this;
  16954. },
  16955. // Status-dependent callbacks
  16956. statusCode: function( map ) {
  16957. var code;
  16958. if ( map ) {
  16959. if ( completed ) {
  16960. // Execute the appropriate callbacks
  16961. jqXHR.always( map[ jqXHR.status ] );
  16962. } else {
  16963. // Lazy-add the new callbacks in a way that preserves old ones
  16964. for ( code in map ) {
  16965. statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
  16966. }
  16967. }
  16968. }
  16969. return this;
  16970. },
  16971. // Cancel the request
  16972. abort: function( statusText ) {
  16973. var finalText = statusText || strAbort;
  16974. if ( transport ) {
  16975. transport.abort( finalText );
  16976. }
  16977. done( 0, finalText );
  16978. return this;
  16979. }
  16980. };
  16981. // Attach deferreds
  16982. deferred.promise( jqXHR );
  16983. // Add protocol if not provided (prefilters might expect it)
  16984. // Handle falsy url in the settings object (#10093: consistency with old signature)
  16985. // We also use the url parameter if available
  16986. s.url = ( ( url || s.url || location.href ) + "" )
  16987. .replace( rprotocol, location.protocol + "//" );
  16988. // Alias method option to type as per ticket #12004
  16989. s.type = options.method || options.type || s.method || s.type;
  16990. // Extract dataTypes list
  16991. s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ];
  16992. // A cross-domain request is in order when the origin doesn't match the current origin.
  16993. if ( s.crossDomain == null ) {
  16994. urlAnchor = document.createElement( "a" );
  16995. // Support: IE <=8 - 11, Edge 12 - 15
  16996. // IE throws exception on accessing the href property if url is malformed,
  16997. // e.g. http://example.com:80x/
  16998. try {
  16999. urlAnchor.href = s.url;
  17000. // Support: IE <=8 - 11 only
  17001. // Anchor's host property isn't correctly set when s.url is relative
  17002. urlAnchor.href = urlAnchor.href;
  17003. s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !==
  17004. urlAnchor.protocol + "//" + urlAnchor.host;
  17005. } catch ( e ) {
  17006. // If there is an error parsing the URL, assume it is crossDomain,
  17007. // it can be rejected by the transport if it is invalid
  17008. s.crossDomain = true;
  17009. }
  17010. }
  17011. // Convert data if not already a string
  17012. if ( s.data && s.processData && typeof s.data !== "string" ) {
  17013. s.data = jQuery.param( s.data, s.traditional );
  17014. }
  17015. // Apply prefilters
  17016. inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
  17017. // If request was aborted inside a prefilter, stop there
  17018. if ( completed ) {
  17019. return jqXHR;
  17020. }
  17021. // We can fire global events as of now if asked to
  17022. // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
  17023. fireGlobals = jQuery.event && s.global;
  17024. // Watch for a new set of requests
  17025. if ( fireGlobals && jQuery.active++ === 0 ) {
  17026. jQuery.event.trigger( "ajaxStart" );
  17027. }
  17028. // Uppercase the type
  17029. s.type = s.type.toUpperCase();
  17030. // Determine if request has content
  17031. s.hasContent = !rnoContent.test( s.type );
  17032. // Save the URL in case we're toying with the If-Modified-Since
  17033. // and/or If-None-Match header later on
  17034. // Remove hash to simplify url manipulation
  17035. cacheURL = s.url.replace( rhash, "" );
  17036. // More options handling for requests with no content
  17037. if ( !s.hasContent ) {
  17038. // Remember the hash so we can put it back
  17039. uncached = s.url.slice( cacheURL.length );
  17040. // If data is available and should be processed, append data to url
  17041. if ( s.data && ( s.processData || typeof s.data === "string" ) ) {
  17042. cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data;
  17043. // #9682: remove data so that it's not used in an eventual retry
  17044. delete s.data;
  17045. }
  17046. // Add or update anti-cache param if needed
  17047. if ( s.cache === false ) {
  17048. cacheURL = cacheURL.replace( rantiCache, "$1" );
  17049. uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce++ ) + uncached;
  17050. }
  17051. // Put hash and anti-cache on the URL that will be requested (gh-1732)
  17052. s.url = cacheURL + uncached;
  17053. // Change '%20' to '+' if this is encoded form body content (gh-2658)
  17054. } else if ( s.data && s.processData &&
  17055. ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) {
  17056. s.data = s.data.replace( r20, "+" );
  17057. }
  17058. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  17059. if ( s.ifModified ) {
  17060. if ( jQuery.lastModified[ cacheURL ] ) {
  17061. jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
  17062. }
  17063. if ( jQuery.etag[ cacheURL ] ) {
  17064. jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
  17065. }
  17066. }
  17067. // Set the correct header, if data is being sent
  17068. if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
  17069. jqXHR.setRequestHeader( "Content-Type", s.contentType );
  17070. }
  17071. // Set the Accepts header for the server, depending on the dataType
  17072. jqXHR.setRequestHeader(
  17073. "Accept",
  17074. s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?
  17075. s.accepts[ s.dataTypes[ 0 ] ] +
  17076. ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
  17077. s.accepts[ "*" ]
  17078. );
  17079. // Check for headers option
  17080. for ( i in s.headers ) {
  17081. jqXHR.setRequestHeader( i, s.headers[ i ] );
  17082. }
  17083. // Allow custom headers/mimetypes and early abort
  17084. if ( s.beforeSend &&
  17085. ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) {
  17086. // Abort if not done already and return
  17087. return jqXHR.abort();
  17088. }
  17089. // Aborting is no longer a cancellation
  17090. strAbort = "abort";
  17091. // Install callbacks on deferreds
  17092. completeDeferred.add( s.complete );
  17093. jqXHR.done( s.success );
  17094. jqXHR.fail( s.error );
  17095. // Get transport
  17096. transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
  17097. // If no transport, we auto-abort
  17098. if ( !transport ) {
  17099. done( -1, "No Transport" );
  17100. } else {
  17101. jqXHR.readyState = 1;
  17102. // Send global event
  17103. if ( fireGlobals ) {
  17104. globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
  17105. }
  17106. // If request was aborted inside ajaxSend, stop there
  17107. if ( completed ) {
  17108. return jqXHR;
  17109. }
  17110. // Timeout
  17111. if ( s.async && s.timeout > 0 ) {
  17112. timeoutTimer = window.setTimeout( function() {
  17113. jqXHR.abort( "timeout" );
  17114. }, s.timeout );
  17115. }
  17116. try {
  17117. completed = false;
  17118. transport.send( requestHeaders, done );
  17119. } catch ( e ) {
  17120. // Rethrow post-completion exceptions
  17121. if ( completed ) {
  17122. throw e;
  17123. }
  17124. // Propagate others as results
  17125. done( -1, e );
  17126. }
  17127. }
  17128. // Callback for when everything is done
  17129. function done( status, nativeStatusText, responses, headers ) {
  17130. var isSuccess, success, error, response, modified,
  17131. statusText = nativeStatusText;
  17132. // Ignore repeat invocations
  17133. if ( completed ) {
  17134. return;
  17135. }
  17136. completed = true;
  17137. // Clear timeout if it exists
  17138. if ( timeoutTimer ) {
  17139. window.clearTimeout( timeoutTimer );
  17140. }
  17141. // Dereference transport for early garbage collection
  17142. // (no matter how long the jqXHR object will be used)
  17143. transport = undefined;
  17144. // Cache response headers
  17145. responseHeadersString = headers || "";
  17146. // Set readyState
  17147. jqXHR.readyState = status > 0 ? 4 : 0;
  17148. // Determine if successful
  17149. isSuccess = status >= 200 && status < 300 || status === 304;
  17150. // Get response data
  17151. if ( responses ) {
  17152. response = ajaxHandleResponses( s, jqXHR, responses );
  17153. }
  17154. // Convert no matter what (that way responseXXX fields are always set)
  17155. response = ajaxConvert( s, response, jqXHR, isSuccess );
  17156. // If successful, handle type chaining
  17157. if ( isSuccess ) {
  17158. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  17159. if ( s.ifModified ) {
  17160. modified = jqXHR.getResponseHeader( "Last-Modified" );
  17161. if ( modified ) {
  17162. jQuery.lastModified[ cacheURL ] = modified;
  17163. }
  17164. modified = jqXHR.getResponseHeader( "etag" );
  17165. if ( modified ) {
  17166. jQuery.etag[ cacheURL ] = modified;
  17167. }
  17168. }
  17169. // if no content
  17170. if ( status === 204 || s.type === "HEAD" ) {
  17171. statusText = "nocontent";
  17172. // if not modified
  17173. } else if ( status === 304 ) {
  17174. statusText = "notmodified";
  17175. // If we have data, let's convert it
  17176. } else {
  17177. statusText = response.state;
  17178. success = response.data;
  17179. error = response.error;
  17180. isSuccess = !error;
  17181. }
  17182. } else {
  17183. // Extract error from statusText and normalize for non-aborts
  17184. error = statusText;
  17185. if ( status || !statusText ) {
  17186. statusText = "error";
  17187. if ( status < 0 ) {
  17188. status = 0;
  17189. }
  17190. }
  17191. }
  17192. // Set data for the fake xhr object
  17193. jqXHR.status = status;
  17194. jqXHR.statusText = ( nativeStatusText || statusText ) + "";
  17195. // Success/Error
  17196. if ( isSuccess ) {
  17197. deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
  17198. } else {
  17199. deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
  17200. }
  17201. // Status-dependent callbacks
  17202. jqXHR.statusCode( statusCode );
  17203. statusCode = undefined;
  17204. if ( fireGlobals ) {
  17205. globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
  17206. [ jqXHR, s, isSuccess ? success : error ] );
  17207. }
  17208. // Complete
  17209. completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
  17210. if ( fireGlobals ) {
  17211. globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
  17212. // Handle the global AJAX counter
  17213. if ( !( --jQuery.active ) ) {
  17214. jQuery.event.trigger( "ajaxStop" );
  17215. }
  17216. }
  17217. }
  17218. return jqXHR;
  17219. },
  17220. getJSON: function( url, data, callback ) {
  17221. return jQuery.get( url, data, callback, "json" );
  17222. },
  17223. getScript: function( url, callback ) {
  17224. return jQuery.get( url, undefined, callback, "script" );
  17225. }
  17226. } );
  17227. jQuery.each( [ "get", "post" ], function( i, method ) {
  17228. jQuery[ method ] = function( url, data, callback, type ) {
  17229. // Shift arguments if data argument was omitted
  17230. if ( isFunction( data ) ) {
  17231. type = type || callback;
  17232. callback = data;
  17233. data = undefined;
  17234. }
  17235. // The url can be an options object (which then must have .url)
  17236. return jQuery.ajax( jQuery.extend( {
  17237. url: url,
  17238. type: method,
  17239. dataType: type,
  17240. data: data,
  17241. success: callback
  17242. }, jQuery.isPlainObject( url ) && url ) );
  17243. };
  17244. } );
  17245. jQuery._evalUrl = function( url, options ) {
  17246. return jQuery.ajax( {
  17247. url: url,
  17248. // Make this explicit, since user can override this through ajaxSetup (#11264)
  17249. type: "GET",
  17250. dataType: "script",
  17251. cache: true,
  17252. async: false,
  17253. global: false,
  17254. // Only evaluate the response if it is successful (gh-4126)
  17255. // dataFilter is not invoked for failure responses, so using it instead
  17256. // of the default converter is kludgy but it works.
  17257. converters: {
  17258. "text script": function() {}
  17259. },
  17260. dataFilter: function( response ) {
  17261. jQuery.globalEval( response, options );
  17262. }
  17263. } );
  17264. };
  17265. jQuery.fn.extend( {
  17266. wrapAll: function( html ) {
  17267. var wrap;
  17268. if ( this[ 0 ] ) {
  17269. if ( isFunction( html ) ) {
  17270. html = html.call( this[ 0 ] );
  17271. }
  17272. // The elements to wrap the target around
  17273. wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
  17274. if ( this[ 0 ].parentNode ) {
  17275. wrap.insertBefore( this[ 0 ] );
  17276. }
  17277. wrap.map( function() {
  17278. var elem = this;
  17279. while ( elem.firstElementChild ) {
  17280. elem = elem.firstElementChild;
  17281. }
  17282. return elem;
  17283. } ).append( this );
  17284. }
  17285. return this;
  17286. },
  17287. wrapInner: function( html ) {
  17288. if ( isFunction( html ) ) {
  17289. return this.each( function( i ) {
  17290. jQuery( this ).wrapInner( html.call( this, i ) );
  17291. } );
  17292. }
  17293. return this.each( function() {
  17294. var self = jQuery( this ),
  17295. contents = self.contents();
  17296. if ( contents.length ) {
  17297. contents.wrapAll( html );
  17298. } else {
  17299. self.append( html );
  17300. }
  17301. } );
  17302. },
  17303. wrap: function( html ) {
  17304. var htmlIsFunction = isFunction( html );
  17305. return this.each( function( i ) {
  17306. jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html );
  17307. } );
  17308. },
  17309. unwrap: function( selector ) {
  17310. this.parent( selector ).not( "body" ).each( function() {
  17311. jQuery( this ).replaceWith( this.childNodes );
  17312. } );
  17313. return this;
  17314. }
  17315. } );
  17316. jQuery.expr.pseudos.hidden = function( elem ) {
  17317. return !jQuery.expr.pseudos.visible( elem );
  17318. };
  17319. jQuery.expr.pseudos.visible = function( elem ) {
  17320. return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );
  17321. };
  17322. jQuery.ajaxSettings.xhr = function() {
  17323. try {
  17324. return new window.XMLHttpRequest();
  17325. } catch ( e ) {}
  17326. };
  17327. var xhrSuccessStatus = {
  17328. // File protocol always yields status code 0, assume 200
  17329. 0: 200,
  17330. // Support: IE <=9 only
  17331. // #1450: sometimes IE returns 1223 when it should be 204
  17332. 1223: 204
  17333. },
  17334. xhrSupported = jQuery.ajaxSettings.xhr();
  17335. support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
  17336. support.ajax = xhrSupported = !!xhrSupported;
  17337. jQuery.ajaxTransport( function( options ) {
  17338. var callback, errorCallback;
  17339. // Cross domain only allowed if supported through XMLHttpRequest
  17340. if ( support.cors || xhrSupported && !options.crossDomain ) {
  17341. return {
  17342. send: function( headers, complete ) {
  17343. var i,
  17344. xhr = options.xhr();
  17345. xhr.open(
  17346. options.type,
  17347. options.url,
  17348. options.async,
  17349. options.username,
  17350. options.password
  17351. );
  17352. // Apply custom fields if provided
  17353. if ( options.xhrFields ) {
  17354. for ( i in options.xhrFields ) {
  17355. xhr[ i ] = options.xhrFields[ i ];
  17356. }
  17357. }
  17358. // Override mime type if needed
  17359. if ( options.mimeType && xhr.overrideMimeType ) {
  17360. xhr.overrideMimeType( options.mimeType );
  17361. }
  17362. // X-Requested-With header
  17363. // For cross-domain requests, seeing as conditions for a preflight are
  17364. // akin to a jigsaw puzzle, we simply never set it to be sure.
  17365. // (it can always be set on a per-request basis or even using ajaxSetup)
  17366. // For same-domain requests, won't change header if already provided.
  17367. if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) {
  17368. headers[ "X-Requested-With" ] = "XMLHttpRequest";
  17369. }
  17370. // Set headers
  17371. for ( i in headers ) {
  17372. xhr.setRequestHeader( i, headers[ i ] );
  17373. }
  17374. // Callback
  17375. callback = function( type ) {
  17376. return function() {
  17377. if ( callback ) {
  17378. callback = errorCallback = xhr.onload =
  17379. xhr.onerror = xhr.onabort = xhr.ontimeout =
  17380. xhr.onreadystatechange = null;
  17381. if ( type === "abort" ) {
  17382. xhr.abort();
  17383. } else if ( type === "error" ) {
  17384. // Support: IE <=9 only
  17385. // On a manual native abort, IE9 throws
  17386. // errors on any property access that is not readyState
  17387. if ( typeof xhr.status !== "number" ) {
  17388. complete( 0, "error" );
  17389. } else {
  17390. complete(
  17391. // File: protocol always yields status 0; see #8605, #14207
  17392. xhr.status,
  17393. xhr.statusText
  17394. );
  17395. }
  17396. } else {
  17397. complete(
  17398. xhrSuccessStatus[ xhr.status ] || xhr.status,
  17399. xhr.statusText,
  17400. // Support: IE <=9 only
  17401. // IE9 has no XHR2 but throws on binary (trac-11426)
  17402. // For XHR2 non-text, let the caller handle it (gh-2498)
  17403. ( xhr.responseType || "text" ) !== "text" ||
  17404. typeof xhr.responseText !== "string" ?
  17405. { binary: xhr.response } :
  17406. { text: xhr.responseText },
  17407. xhr.getAllResponseHeaders()
  17408. );
  17409. }
  17410. }
  17411. };
  17412. };
  17413. // Listen to events
  17414. xhr.onload = callback();
  17415. errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" );
  17416. // Support: IE 9 only
  17417. // Use onreadystatechange to replace onabort
  17418. // to handle uncaught aborts
  17419. if ( xhr.onabort !== undefined ) {
  17420. xhr.onabort = errorCallback;
  17421. } else {
  17422. xhr.onreadystatechange = function() {
  17423. // Check readyState before timeout as it changes
  17424. if ( xhr.readyState === 4 ) {
  17425. // Allow onerror to be called first,
  17426. // but that will not handle a native abort
  17427. // Also, save errorCallback to a variable
  17428. // as xhr.onerror cannot be accessed
  17429. window.setTimeout( function() {
  17430. if ( callback ) {
  17431. errorCallback();
  17432. }
  17433. } );
  17434. }
  17435. };
  17436. }
  17437. // Create the abort callback
  17438. callback = callback( "abort" );
  17439. try {
  17440. // Do send the request (this may raise an exception)
  17441. xhr.send( options.hasContent && options.data || null );
  17442. } catch ( e ) {
  17443. // #14683: Only rethrow if this hasn't been notified as an error yet
  17444. if ( callback ) {
  17445. throw e;
  17446. }
  17447. }
  17448. },
  17449. abort: function() {
  17450. if ( callback ) {
  17451. callback();
  17452. }
  17453. }
  17454. };
  17455. }
  17456. } );
  17457. // Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)
  17458. jQuery.ajaxPrefilter( function( s ) {
  17459. if ( s.crossDomain ) {
  17460. s.contents.script = false;
  17461. }
  17462. } );
  17463. // Install script dataType
  17464. jQuery.ajaxSetup( {
  17465. accepts: {
  17466. script: "text/javascript, application/javascript, " +
  17467. "application/ecmascript, application/x-ecmascript"
  17468. },
  17469. contents: {
  17470. script: /\b(?:java|ecma)script\b/
  17471. },
  17472. converters: {
  17473. "text script": function( text ) {
  17474. jQuery.globalEval( text );
  17475. return text;
  17476. }
  17477. }
  17478. } );
  17479. // Handle cache's special case and crossDomain
  17480. jQuery.ajaxPrefilter( "script", function( s ) {
  17481. if ( s.cache === undefined ) {
  17482. s.cache = false;
  17483. }
  17484. if ( s.crossDomain ) {
  17485. s.type = "GET";
  17486. }
  17487. } );
  17488. // Bind script tag hack transport
  17489. jQuery.ajaxTransport( "script", function( s ) {
  17490. // This transport only deals with cross domain or forced-by-attrs requests
  17491. if ( s.crossDomain || s.scriptAttrs ) {
  17492. var script, callback;
  17493. return {
  17494. send: function( _, complete ) {
  17495. script = jQuery( "<script>" )
  17496. .attr( s.scriptAttrs || {} )
  17497. .prop( { charset: s.scriptCharset, src: s.url } )
  17498. .on( "load error", callback = function( evt ) {
  17499. script.remove();
  17500. callback = null;
  17501. if ( evt ) {
  17502. complete( evt.type === "error" ? 404 : 200, evt.type );
  17503. }
  17504. } );
  17505. // Use native DOM manipulation to avoid our domManip AJAX trickery
  17506. document.head.appendChild( script[ 0 ] );
  17507. },
  17508. abort: function() {
  17509. if ( callback ) {
  17510. callback();
  17511. }
  17512. }
  17513. };
  17514. }
  17515. } );
  17516. var oldCallbacks = [],
  17517. rjsonp = /(=)\?(?=&|$)|\?\?/;
  17518. // Default jsonp settings
  17519. jQuery.ajaxSetup( {
  17520. jsonp: "callback",
  17521. jsonpCallback: function() {
  17522. var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
  17523. this[ callback ] = true;
  17524. return callback;
  17525. }
  17526. } );
  17527. // Detect, normalize options and install callbacks for jsonp requests
  17528. jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
  17529. var callbackName, overwritten, responseContainer,
  17530. jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
  17531. "url" :
  17532. typeof s.data === "string" &&
  17533. ( s.contentType || "" )
  17534. .indexOf( "application/x-www-form-urlencoded" ) === 0 &&
  17535. rjsonp.test( s.data ) && "data"
  17536. );
  17537. // Handle iff the expected data type is "jsonp" or we have a parameter to set
  17538. if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
  17539. // Get callback name, remembering preexisting value associated with it
  17540. callbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ?
  17541. s.jsonpCallback() :
  17542. s.jsonpCallback;
  17543. // Insert callback into url or form data
  17544. if ( jsonProp ) {
  17545. s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
  17546. } else if ( s.jsonp !== false ) {
  17547. s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
  17548. }
  17549. // Use data converter to retrieve json after script execution
  17550. s.converters[ "script json" ] = function() {
  17551. if ( !responseContainer ) {
  17552. jQuery.error( callbackName + " was not called" );
  17553. }
  17554. return responseContainer[ 0 ];
  17555. };
  17556. // Force json dataType
  17557. s.dataTypes[ 0 ] = "json";
  17558. // Install callback
  17559. overwritten = window[ callbackName ];
  17560. window[ callbackName ] = function() {
  17561. responseContainer = arguments;
  17562. };
  17563. // Clean-up function (fires after converters)
  17564. jqXHR.always( function() {
  17565. // If previous value didn't exist - remove it
  17566. if ( overwritten === undefined ) {
  17567. jQuery( window ).removeProp( callbackName );
  17568. // Otherwise restore preexisting value
  17569. } else {
  17570. window[ callbackName ] = overwritten;
  17571. }
  17572. // Save back as free
  17573. if ( s[ callbackName ] ) {
  17574. // Make sure that re-using the options doesn't screw things around
  17575. s.jsonpCallback = originalSettings.jsonpCallback;
  17576. // Save the callback name for future use
  17577. oldCallbacks.push( callbackName );
  17578. }
  17579. // Call if it was a function and we have a response
  17580. if ( responseContainer && isFunction( overwritten ) ) {
  17581. overwritten( responseContainer[ 0 ] );
  17582. }
  17583. responseContainer = overwritten = undefined;
  17584. } );
  17585. // Delegate to script
  17586. return "script";
  17587. }
  17588. } );
  17589. // Support: Safari 8 only
  17590. // In Safari 8 documents created via document.implementation.createHTMLDocument
  17591. // collapse sibling forms: the second one becomes a child of the first one.
  17592. // Because of that, this security measure has to be disabled in Safari 8.
  17593. // https://bugs.webkit.org/show_bug.cgi?id=137337
  17594. support.createHTMLDocument = ( function() {
  17595. var body = document.implementation.createHTMLDocument( "" ).body;
  17596. body.innerHTML = "<form></form><form></form>";
  17597. return body.childNodes.length === 2;
  17598. } )();
  17599. // Argument "data" should be string of html
  17600. // context (optional): If specified, the fragment will be created in this context,
  17601. // defaults to document
  17602. // keepScripts (optional): If true, will include scripts passed in the html string
  17603. jQuery.parseHTML = function( data, context, keepScripts ) {
  17604. if ( typeof data !== "string" ) {
  17605. return [];
  17606. }
  17607. if ( typeof context === "boolean" ) {
  17608. keepScripts = context;
  17609. context = false;
  17610. }
  17611. var base, parsed, scripts;
  17612. if ( !context ) {
  17613. // Stop scripts or inline event handlers from being executed immediately
  17614. // by using document.implementation
  17615. if ( support.createHTMLDocument ) {
  17616. context = document.implementation.createHTMLDocument( "" );
  17617. // Set the base href for the created document
  17618. // so any parsed elements with URLs
  17619. // are based on the document's URL (gh-2965)
  17620. base = context.createElement( "base" );
  17621. base.href = document.location.href;
  17622. context.head.appendChild( base );
  17623. } else {
  17624. context = document;
  17625. }
  17626. }
  17627. parsed = rsingleTag.exec( data );
  17628. scripts = !keepScripts && [];
  17629. // Single tag
  17630. if ( parsed ) {
  17631. return [ context.createElement( parsed[ 1 ] ) ];
  17632. }
  17633. parsed = buildFragment( [ data ], context, scripts );
  17634. if ( scripts && scripts.length ) {
  17635. jQuery( scripts ).remove();
  17636. }
  17637. return jQuery.merge( [], parsed.childNodes );
  17638. };
  17639. /**
  17640. * Load a url into a page
  17641. */
  17642. jQuery.fn.load = function( url, params, callback ) {
  17643. var selector, type, response,
  17644. self = this,
  17645. off = url.indexOf( " " );
  17646. if ( off > -1 ) {
  17647. selector = stripAndCollapse( url.slice( off ) );
  17648. url = url.slice( 0, off );
  17649. }
  17650. // If it's a function
  17651. if ( isFunction( params ) ) {
  17652. // We assume that it's the callback
  17653. callback = params;
  17654. params = undefined;
  17655. // Otherwise, build a param string
  17656. } else if ( params && typeof params === "object" ) {
  17657. type = "POST";
  17658. }
  17659. // If we have elements to modify, make the request
  17660. if ( self.length > 0 ) {
  17661. jQuery.ajax( {
  17662. url: url,
  17663. // If "type" variable is undefined, then "GET" method will be used.
  17664. // Make value of this field explicit since
  17665. // user can override it through ajaxSetup method
  17666. type: type || "GET",
  17667. dataType: "html",
  17668. data: params
  17669. } ).done( function( responseText ) {
  17670. // Save response for use in complete callback
  17671. response = arguments;
  17672. self.html( selector ?
  17673. // If a selector was specified, locate the right elements in a dummy div
  17674. // Exclude scripts to avoid IE 'Permission Denied' errors
  17675. jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :
  17676. // Otherwise use the full result
  17677. responseText );
  17678. // If the request succeeds, this function gets "data", "status", "jqXHR"
  17679. // but they are ignored because response was set above.
  17680. // If it fails, this function gets "jqXHR", "status", "error"
  17681. } ).always( callback && function( jqXHR, status ) {
  17682. self.each( function() {
  17683. callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );
  17684. } );
  17685. } );
  17686. }
  17687. return this;
  17688. };
  17689. // Attach a bunch of functions for handling common AJAX events
  17690. jQuery.each( [
  17691. "ajaxStart",
  17692. "ajaxStop",
  17693. "ajaxComplete",
  17694. "ajaxError",
  17695. "ajaxSuccess",
  17696. "ajaxSend"
  17697. ], function( i, type ) {
  17698. jQuery.fn[ type ] = function( fn ) {
  17699. return this.on( type, fn );
  17700. };
  17701. } );
  17702. jQuery.expr.pseudos.animated = function( elem ) {
  17703. return jQuery.grep( jQuery.timers, function( fn ) {
  17704. return elem === fn.elem;
  17705. } ).length;
  17706. };
  17707. jQuery.offset = {
  17708. setOffset: function( elem, options, i ) {
  17709. var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
  17710. position = jQuery.css( elem, "position" ),
  17711. curElem = jQuery( elem ),
  17712. props = {};
  17713. // Set position first, in-case top/left are set even on static elem
  17714. if ( position === "static" ) {
  17715. elem.style.position = "relative";
  17716. }
  17717. curOffset = curElem.offset();
  17718. curCSSTop = jQuery.css( elem, "top" );
  17719. curCSSLeft = jQuery.css( elem, "left" );
  17720. calculatePosition = ( position === "absolute" || position === "fixed" ) &&
  17721. ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1;
  17722. // Need to be able to calculate position if either
  17723. // top or left is auto and position is either absolute or fixed
  17724. if ( calculatePosition ) {
  17725. curPosition = curElem.position();
  17726. curTop = curPosition.top;
  17727. curLeft = curPosition.left;
  17728. } else {
  17729. curTop = parseFloat( curCSSTop ) || 0;
  17730. curLeft = parseFloat( curCSSLeft ) || 0;
  17731. }
  17732. if ( isFunction( options ) ) {
  17733. // Use jQuery.extend here to allow modification of coordinates argument (gh-1848)
  17734. options = options.call( elem, i, jQuery.extend( {}, curOffset ) );
  17735. }
  17736. if ( options.top != null ) {
  17737. props.top = ( options.top - curOffset.top ) + curTop;
  17738. }
  17739. if ( options.left != null ) {
  17740. props.left = ( options.left - curOffset.left ) + curLeft;
  17741. }
  17742. if ( "using" in options ) {
  17743. options.using.call( elem, props );
  17744. } else {
  17745. curElem.css( props );
  17746. }
  17747. }
  17748. };
  17749. jQuery.fn.extend( {
  17750. // offset() relates an element's border box to the document origin
  17751. offset: function( options ) {
  17752. // Preserve chaining for setter
  17753. if ( arguments.length ) {
  17754. return options === undefined ?
  17755. this :
  17756. this.each( function( i ) {
  17757. jQuery.offset.setOffset( this, options, i );
  17758. } );
  17759. }
  17760. var rect, win,
  17761. elem = this[ 0 ];
  17762. if ( !elem ) {
  17763. return;
  17764. }
  17765. // Return zeros for disconnected and hidden (display: none) elements (gh-2310)
  17766. // Support: IE <=11 only
  17767. // Running getBoundingClientRect on a
  17768. // disconnected node in IE throws an error
  17769. if ( !elem.getClientRects().length ) {
  17770. return { top: 0, left: 0 };
  17771. }
  17772. // Get document-relative position by adding viewport scroll to viewport-relative gBCR
  17773. rect = elem.getBoundingClientRect();
  17774. win = elem.ownerDocument.defaultView;
  17775. return {
  17776. top: rect.top + win.pageYOffset,
  17777. left: rect.left + win.pageXOffset
  17778. };
  17779. },
  17780. // position() relates an element's margin box to its offset parent's padding box
  17781. // This corresponds to the behavior of CSS absolute positioning
  17782. position: function() {
  17783. if ( !this[ 0 ] ) {
  17784. return;
  17785. }
  17786. var offsetParent, offset, doc,
  17787. elem = this[ 0 ],
  17788. parentOffset = { top: 0, left: 0 };
  17789. // position:fixed elements are offset from the viewport, which itself always has zero offset
  17790. if ( jQuery.css( elem, "position" ) === "fixed" ) {
  17791. // Assume position:fixed implies availability of getBoundingClientRect
  17792. offset = elem.getBoundingClientRect();
  17793. } else {
  17794. offset = this.offset();
  17795. // Account for the *real* offset parent, which can be the document or its root element
  17796. // when a statically positioned element is identified
  17797. doc = elem.ownerDocument;
  17798. offsetParent = elem.offsetParent || doc.documentElement;
  17799. while ( offsetParent &&
  17800. ( offsetParent === doc.body || offsetParent === doc.documentElement ) &&
  17801. jQuery.css( offsetParent, "position" ) === "static" ) {
  17802. offsetParent = offsetParent.parentNode;
  17803. }
  17804. if ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) {
  17805. // Incorporate borders into its offset, since they are outside its content origin
  17806. parentOffset = jQuery( offsetParent ).offset();
  17807. parentOffset.top += jQuery.css( offsetParent, "borderTopWidth", true );
  17808. parentOffset.left += jQuery.css( offsetParent, "borderLeftWidth", true );
  17809. }
  17810. }
  17811. // Subtract parent offsets and element margins
  17812. return {
  17813. top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
  17814. left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
  17815. };
  17816. },
  17817. // This method will return documentElement in the following cases:
  17818. // 1) For the element inside the iframe without offsetParent, this method will return
  17819. // documentElement of the parent window
  17820. // 2) For the hidden or detached element
  17821. // 3) For body or html element, i.e. in case of the html node - it will return itself
  17822. //
  17823. // but those exceptions were never presented as a real life use-cases
  17824. // and might be considered as more preferable results.
  17825. //
  17826. // This logic, however, is not guaranteed and can change at any point in the future
  17827. offsetParent: function() {
  17828. return this.map( function() {
  17829. var offsetParent = this.offsetParent;
  17830. while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) {
  17831. offsetParent = offsetParent.offsetParent;
  17832. }
  17833. return offsetParent || documentElement;
  17834. } );
  17835. }
  17836. } );
  17837. // Create scrollLeft and scrollTop methods
  17838. jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
  17839. var top = "pageYOffset" === prop;
  17840. jQuery.fn[ method ] = function( val ) {
  17841. return access( this, function( elem, method, val ) {
  17842. // Coalesce documents and windows
  17843. var win;
  17844. if ( isWindow( elem ) ) {
  17845. win = elem;
  17846. } else if ( elem.nodeType === 9 ) {
  17847. win = elem.defaultView;
  17848. }
  17849. if ( val === undefined ) {
  17850. return win ? win[ prop ] : elem[ method ];
  17851. }
  17852. if ( win ) {
  17853. win.scrollTo(
  17854. !top ? val : win.pageXOffset,
  17855. top ? val : win.pageYOffset
  17856. );
  17857. } else {
  17858. elem[ method ] = val;
  17859. }
  17860. }, method, val, arguments.length );
  17861. };
  17862. } );
  17863. // Support: Safari <=7 - 9.1, Chrome <=37 - 49
  17864. // Add the top/left cssHooks using jQuery.fn.position
  17865. // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
  17866. // Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347
  17867. // getComputedStyle returns percent when specified for top/left/bottom/right;
  17868. // rather than make the css module depend on the offset module, just check for it here
  17869. jQuery.each( [ "top", "left" ], function( i, prop ) {
  17870. jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
  17871. function( elem, computed ) {
  17872. if ( computed ) {
  17873. computed = curCSS( elem, prop );
  17874. // If curCSS returns percentage, fallback to offset
  17875. return rnumnonpx.test( computed ) ?
  17876. jQuery( elem ).position()[ prop ] + "px" :
  17877. computed;
  17878. }
  17879. }
  17880. );
  17881. } );
  17882. // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
  17883. jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
  17884. jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name },
  17885. function( defaultExtra, funcName ) {
  17886. // Margin is only for outerHeight, outerWidth
  17887. jQuery.fn[ funcName ] = function( margin, value ) {
  17888. var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
  17889. extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
  17890. return access( this, function( elem, type, value ) {
  17891. var doc;
  17892. if ( isWindow( elem ) ) {
  17893. // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)
  17894. return funcName.indexOf( "outer" ) === 0 ?
  17895. elem[ "inner" + name ] :
  17896. elem.document.documentElement[ "client" + name ];
  17897. }
  17898. // Get document width or height
  17899. if ( elem.nodeType === 9 ) {
  17900. doc = elem.documentElement;
  17901. // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
  17902. // whichever is greatest
  17903. return Math.max(
  17904. elem.body[ "scroll" + name ], doc[ "scroll" + name ],
  17905. elem.body[ "offset" + name ], doc[ "offset" + name ],
  17906. doc[ "client" + name ]
  17907. );
  17908. }
  17909. return value === undefined ?
  17910. // Get width or height on the element, requesting but not forcing parseFloat
  17911. jQuery.css( elem, type, extra ) :
  17912. // Set width or height on the element
  17913. jQuery.style( elem, type, value, extra );
  17914. }, type, chainable ? margin : undefined, chainable );
  17915. };
  17916. } );
  17917. } );
  17918. jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " +
  17919. "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
  17920. "change select submit keydown keypress keyup contextmenu" ).split( " " ),
  17921. function( i, name ) {
  17922. // Handle event binding
  17923. jQuery.fn[ name ] = function( data, fn ) {
  17924. return arguments.length > 0 ?
  17925. this.on( name, null, data, fn ) :
  17926. this.trigger( name );
  17927. };
  17928. } );
  17929. jQuery.fn.extend( {
  17930. hover: function( fnOver, fnOut ) {
  17931. return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
  17932. }
  17933. } );
  17934. jQuery.fn.extend( {
  17935. bind: function( types, data, fn ) {
  17936. return this.on( types, null, data, fn );
  17937. },
  17938. unbind: function( types, fn ) {
  17939. return this.off( types, null, fn );
  17940. },
  17941. delegate: function( selector, types, data, fn ) {
  17942. return this.on( types, selector, data, fn );
  17943. },
  17944. undelegate: function( selector, types, fn ) {
  17945. // ( namespace ) or ( selector, types [, fn] )
  17946. return arguments.length === 1 ?
  17947. this.off( selector, "**" ) :
  17948. this.off( types, selector || "**", fn );
  17949. }
  17950. } );
  17951. // Bind a function to a context, optionally partially applying any
  17952. // arguments.
  17953. // jQuery.proxy is deprecated to promote standards (specifically Function#bind)
  17954. // However, it is not slated for removal any time soon
  17955. jQuery.proxy = function( fn, context ) {
  17956. var tmp, args, proxy;
  17957. if ( typeof context === "string" ) {
  17958. tmp = fn[ context ];
  17959. context = fn;
  17960. fn = tmp;
  17961. }
  17962. // Quick check to determine if target is callable, in the spec
  17963. // this throws a TypeError, but we will just return undefined.
  17964. if ( !isFunction( fn ) ) {
  17965. return undefined;
  17966. }
  17967. // Simulated bind
  17968. args = slice.call( arguments, 2 );
  17969. proxy = function() {
  17970. return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
  17971. };
  17972. // Set the guid of unique handler to the same of original handler, so it can be removed
  17973. proxy.guid = fn.guid = fn.guid || jQuery.guid++;
  17974. return proxy;
  17975. };
  17976. jQuery.holdReady = function( hold ) {
  17977. if ( hold ) {
  17978. jQuery.readyWait++;
  17979. } else {
  17980. jQuery.ready( true );
  17981. }
  17982. };
  17983. jQuery.isArray = Array.isArray;
  17984. jQuery.parseJSON = JSON.parse;
  17985. jQuery.nodeName = nodeName;
  17986. jQuery.isFunction = isFunction;
  17987. jQuery.isWindow = isWindow;
  17988. jQuery.camelCase = camelCase;
  17989. jQuery.type = toType;
  17990. jQuery.now = Date.now;
  17991. jQuery.isNumeric = function( obj ) {
  17992. // As of jQuery 3.0, isNumeric is limited to
  17993. // strings and numbers (primitives or objects)
  17994. // that can be coerced to finite numbers (gh-2662)
  17995. var type = jQuery.type( obj );
  17996. return ( type === "number" || type === "string" ) &&
  17997. // parseFloat NaNs numeric-cast false positives ("")
  17998. // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
  17999. // subtraction forces infinities to NaN
  18000. !isNaN( obj - parseFloat( obj ) );
  18001. };
  18002. // Register as a named AMD module, since jQuery can be concatenated with other
  18003. // files that may use define, but not via a proper concatenation script that
  18004. // understands anonymous AMD modules. A named AMD is safest and most robust
  18005. // way to register. Lowercase jquery is used because AMD module names are
  18006. // derived from file names, and jQuery is normally delivered in a lowercase
  18007. // file name. Do this after creating the global so that if an AMD module wants
  18008. // to call noConflict to hide this version of jQuery, it will work.
  18009. // Note that for maximum portability, libraries that are not jQuery should
  18010. // declare themselves as anonymous modules, and avoid setting a global if an
  18011. // AMD loader is present. jQuery is a special case. For more information, see
  18012. // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
  18013. if ( true ) {
  18014. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  18015. return jQuery;
  18016. }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
  18017. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  18018. }
  18019. var
  18020. // Map over jQuery in case of overwrite
  18021. _jQuery = window.jQuery,
  18022. // Map over the $ in case of overwrite
  18023. _$ = window.$;
  18024. jQuery.noConflict = function( deep ) {
  18025. if ( window.$ === jQuery ) {
  18026. window.$ = _$;
  18027. }
  18028. if ( deep && window.jQuery === jQuery ) {
  18029. window.jQuery = _jQuery;
  18030. }
  18031. return jQuery;
  18032. };
  18033. // Expose jQuery and $ identifiers, even in AMD
  18034. // (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
  18035. // and CommonJS for browser emulators (#13566)
  18036. if ( !noGlobal ) {
  18037. window.jQuery = window.$ = jQuery;
  18038. }
  18039. return jQuery;
  18040. } );
  18041. /***/ }),
  18042. /***/ "./node_modules/laravel-echo/dist/echo.js":
  18043. /*!************************************************!*\
  18044. !*** ./node_modules/laravel-echo/dist/echo.js ***!
  18045. \************************************************/
  18046. /*! exports provided: default */
  18047. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18048. "use strict";
  18049. __webpack_require__.r(__webpack_exports__);
  18050. var classCallCheck = function (instance, Constructor) {
  18051. if (!(instance instanceof Constructor)) {
  18052. throw new TypeError("Cannot call a class as a function");
  18053. }
  18054. };
  18055. var createClass = function () {
  18056. function defineProperties(target, props) {
  18057. for (var i = 0; i < props.length; i++) {
  18058. var descriptor = props[i];
  18059. descriptor.enumerable = descriptor.enumerable || false;
  18060. descriptor.configurable = true;
  18061. if ("value" in descriptor) descriptor.writable = true;
  18062. Object.defineProperty(target, descriptor.key, descriptor);
  18063. }
  18064. }
  18065. return function (Constructor, protoProps, staticProps) {
  18066. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  18067. if (staticProps) defineProperties(Constructor, staticProps);
  18068. return Constructor;
  18069. };
  18070. }();
  18071. var _extends = Object.assign || function (target) {
  18072. for (var i = 1; i < arguments.length; i++) {
  18073. var source = arguments[i];
  18074. for (var key in source) {
  18075. if (Object.prototype.hasOwnProperty.call(source, key)) {
  18076. target[key] = source[key];
  18077. }
  18078. }
  18079. }
  18080. return target;
  18081. };
  18082. var inherits = function (subClass, superClass) {
  18083. if (typeof superClass !== "function" && superClass !== null) {
  18084. throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  18085. }
  18086. subClass.prototype = Object.create(superClass && superClass.prototype, {
  18087. constructor: {
  18088. value: subClass,
  18089. enumerable: false,
  18090. writable: true,
  18091. configurable: true
  18092. }
  18093. });
  18094. if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  18095. };
  18096. var possibleConstructorReturn = function (self, call) {
  18097. if (!self) {
  18098. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  18099. }
  18100. return call && (typeof call === "object" || typeof call === "function") ? call : self;
  18101. };
  18102. var Connector = function () {
  18103. /**
  18104. * Create a new class instance.
  18105. */
  18106. function Connector(options) {
  18107. classCallCheck(this, Connector);
  18108. /**
  18109. * Default connector options.
  18110. */
  18111. this._defaultOptions = {
  18112. auth: {
  18113. headers: {}
  18114. },
  18115. authEndpoint: '/broadcasting/auth',
  18116. broadcaster: 'pusher',
  18117. csrfToken: null,
  18118. host: null,
  18119. key: null,
  18120. namespace: 'App.Events'
  18121. };
  18122. this.setOptions(options);
  18123. this.connect();
  18124. }
  18125. /**
  18126. * Merge the custom options with the defaults.
  18127. */
  18128. createClass(Connector, [{
  18129. key: 'setOptions',
  18130. value: function setOptions(options) {
  18131. this.options = _extends(this._defaultOptions, options);
  18132. if (this.csrfToken()) {
  18133. this.options.auth.headers['X-CSRF-TOKEN'] = this.csrfToken();
  18134. }
  18135. return options;
  18136. }
  18137. /**
  18138. * Extract the CSRF token from the page.
  18139. */
  18140. }, {
  18141. key: 'csrfToken',
  18142. value: function csrfToken() {
  18143. var selector = void 0;
  18144. if (typeof window !== 'undefined' && window['Laravel'] && window['Laravel'].csrfToken) {
  18145. return window['Laravel'].csrfToken;
  18146. } else if (this.options.csrfToken) {
  18147. return this.options.csrfToken;
  18148. } else if (typeof document !== 'undefined' && typeof document.querySelector === 'function' && (selector = document.querySelector('meta[name="csrf-token"]'))) {
  18149. return selector.getAttribute('content');
  18150. }
  18151. return null;
  18152. }
  18153. }]);
  18154. return Connector;
  18155. }();
  18156. /**
  18157. * This class represents a basic channel.
  18158. */
  18159. var Channel = function () {
  18160. function Channel() {
  18161. classCallCheck(this, Channel);
  18162. }
  18163. createClass(Channel, [{
  18164. key: 'listenForWhisper',
  18165. /**
  18166. * Listen for a whisper event on the channel instance.
  18167. */
  18168. value: function listenForWhisper(event, callback) {
  18169. return this.listen('.client-' + event, callback);
  18170. }
  18171. /**
  18172. * Listen for an event on the channel instance.
  18173. */
  18174. }, {
  18175. key: 'notification',
  18176. value: function notification(callback) {
  18177. return this.listen('.Illuminate\\Notifications\\Events\\BroadcastNotificationCreated', callback);
  18178. }
  18179. /**
  18180. * Stop listening for a whispser event on the channel instance.
  18181. */
  18182. }, {
  18183. key: 'stopListeningForWhisper',
  18184. value: function stopListeningForWhisper(event) {
  18185. return this.stopListening('.client-' + event);
  18186. }
  18187. }]);
  18188. return Channel;
  18189. }();
  18190. /**
  18191. * Event name formatter
  18192. */
  18193. var EventFormatter = function () {
  18194. /**
  18195. * Create a new class instance.
  18196. */
  18197. function EventFormatter(namespace) {
  18198. classCallCheck(this, EventFormatter);
  18199. this.setNamespace(namespace);
  18200. }
  18201. /**
  18202. * Format the given event name.
  18203. */
  18204. createClass(EventFormatter, [{
  18205. key: 'format',
  18206. value: function format(event) {
  18207. if (event.charAt(0) === '.' || event.charAt(0) === '\\') {
  18208. return event.substr(1);
  18209. } else if (this.namespace) {
  18210. event = this.namespace + '.' + event;
  18211. }
  18212. return event.replace(/\./g, '\\');
  18213. }
  18214. /**
  18215. * Set the event namespace.
  18216. */
  18217. }, {
  18218. key: 'setNamespace',
  18219. value: function setNamespace(value) {
  18220. this.namespace = value;
  18221. }
  18222. }]);
  18223. return EventFormatter;
  18224. }();
  18225. /**
  18226. * This class represents a Pusher channel.
  18227. */
  18228. var PusherChannel = function (_Channel) {
  18229. inherits(PusherChannel, _Channel);
  18230. /**
  18231. * Create a new class instance.
  18232. */
  18233. function PusherChannel(pusher, name, options) {
  18234. classCallCheck(this, PusherChannel);
  18235. var _this = possibleConstructorReturn(this, (PusherChannel.__proto__ || Object.getPrototypeOf(PusherChannel)).call(this));
  18236. _this.name = name;
  18237. _this.pusher = pusher;
  18238. _this.options = options;
  18239. _this.eventFormatter = new EventFormatter(_this.options.namespace);
  18240. _this.subscribe();
  18241. return _this;
  18242. }
  18243. /**
  18244. * Subscribe to a Pusher channel.
  18245. */
  18246. createClass(PusherChannel, [{
  18247. key: 'subscribe',
  18248. value: function subscribe() {
  18249. this.subscription = this.pusher.subscribe(this.name);
  18250. }
  18251. /**
  18252. * Unsubscribe from a Pusher channel.
  18253. */
  18254. }, {
  18255. key: 'unsubscribe',
  18256. value: function unsubscribe() {
  18257. this.pusher.unsubscribe(this.name);
  18258. }
  18259. /**
  18260. * Listen for an event on the channel instance.
  18261. */
  18262. }, {
  18263. key: 'listen',
  18264. value: function listen(event, callback) {
  18265. this.on(this.eventFormatter.format(event), callback);
  18266. return this;
  18267. }
  18268. /**
  18269. * Stop listening for an event on the channel instance.
  18270. */
  18271. }, {
  18272. key: 'stopListening',
  18273. value: function stopListening(event) {
  18274. this.subscription.unbind(this.eventFormatter.format(event));
  18275. return this;
  18276. }
  18277. /**
  18278. * Bind a channel to an event.
  18279. */
  18280. }, {
  18281. key: 'on',
  18282. value: function on(event, callback) {
  18283. this.subscription.bind(event, callback);
  18284. return this;
  18285. }
  18286. }]);
  18287. return PusherChannel;
  18288. }(Channel);
  18289. /**
  18290. * This class represents a Pusher private channel.
  18291. */
  18292. var PusherPrivateChannel = function (_PusherChannel) {
  18293. inherits(PusherPrivateChannel, _PusherChannel);
  18294. function PusherPrivateChannel() {
  18295. classCallCheck(this, PusherPrivateChannel);
  18296. return possibleConstructorReturn(this, (PusherPrivateChannel.__proto__ || Object.getPrototypeOf(PusherPrivateChannel)).apply(this, arguments));
  18297. }
  18298. createClass(PusherPrivateChannel, [{
  18299. key: 'whisper',
  18300. /**
  18301. * Trigger client event on the channel.
  18302. */
  18303. value: function whisper(eventName, data) {
  18304. this.pusher.channels.channels[this.name].trigger('client-' + eventName, data);
  18305. return this;
  18306. }
  18307. }]);
  18308. return PusherPrivateChannel;
  18309. }(PusherChannel);
  18310. /**
  18311. * This class represents a Pusher presence channel.
  18312. */
  18313. var PusherPresenceChannel = function (_PusherChannel) {
  18314. inherits(PusherPresenceChannel, _PusherChannel);
  18315. function PusherPresenceChannel() {
  18316. classCallCheck(this, PusherPresenceChannel);
  18317. return possibleConstructorReturn(this, (PusherPresenceChannel.__proto__ || Object.getPrototypeOf(PusherPresenceChannel)).apply(this, arguments));
  18318. }
  18319. createClass(PusherPresenceChannel, [{
  18320. key: 'here',
  18321. /**
  18322. * Register a callback to be called anytime the member list changes.
  18323. */
  18324. value: function here(callback) {
  18325. this.on('pusher:subscription_succeeded', function (data) {
  18326. callback(Object.keys(data.members).map(function (k) {
  18327. return data.members[k];
  18328. }));
  18329. });
  18330. return this;
  18331. }
  18332. /**
  18333. * Listen for someone joining the channel.
  18334. */
  18335. }, {
  18336. key: 'joining',
  18337. value: function joining(callback) {
  18338. this.on('pusher:member_added', function (member) {
  18339. callback(member.info);
  18340. });
  18341. return this;
  18342. }
  18343. /**
  18344. * Listen for someone leaving the channel.
  18345. */
  18346. }, {
  18347. key: 'leaving',
  18348. value: function leaving(callback) {
  18349. this.on('pusher:member_removed', function (member) {
  18350. callback(member.info);
  18351. });
  18352. return this;
  18353. }
  18354. /**
  18355. * Trigger client event on the channel.
  18356. */
  18357. }, {
  18358. key: 'whisper',
  18359. value: function whisper(eventName, data) {
  18360. this.pusher.channels.channels[this.name].trigger('client-' + eventName, data);
  18361. return this;
  18362. }
  18363. }]);
  18364. return PusherPresenceChannel;
  18365. }(PusherChannel);
  18366. /**
  18367. * This class represents a Socket.io channel.
  18368. */
  18369. var SocketIoChannel = function (_Channel) {
  18370. inherits(SocketIoChannel, _Channel);
  18371. /**
  18372. * Create a new class instance.
  18373. */
  18374. function SocketIoChannel(socket, name, options) {
  18375. classCallCheck(this, SocketIoChannel);
  18376. /**
  18377. * The event callbacks applied to the channel.
  18378. */
  18379. var _this = possibleConstructorReturn(this, (SocketIoChannel.__proto__ || Object.getPrototypeOf(SocketIoChannel)).call(this));
  18380. _this.events = {};
  18381. _this.name = name;
  18382. _this.socket = socket;
  18383. _this.options = options;
  18384. _this.eventFormatter = new EventFormatter(_this.options.namespace);
  18385. _this.subscribe();
  18386. _this.configureReconnector();
  18387. return _this;
  18388. }
  18389. /**
  18390. * Subscribe to a Socket.io channel.
  18391. */
  18392. createClass(SocketIoChannel, [{
  18393. key: 'subscribe',
  18394. value: function subscribe() {
  18395. this.socket.emit('subscribe', {
  18396. channel: this.name,
  18397. auth: this.options.auth || {}
  18398. });
  18399. }
  18400. /**
  18401. * Unsubscribe from channel and ubind event callbacks.
  18402. */
  18403. }, {
  18404. key: 'unsubscribe',
  18405. value: function unsubscribe() {
  18406. this.unbind();
  18407. this.socket.emit('unsubscribe', {
  18408. channel: this.name,
  18409. auth: this.options.auth || {}
  18410. });
  18411. }
  18412. /**
  18413. * Listen for an event on the channel instance.
  18414. */
  18415. }, {
  18416. key: 'listen',
  18417. value: function listen(event, callback) {
  18418. this.on(this.eventFormatter.format(event), callback);
  18419. return this;
  18420. }
  18421. /**
  18422. * Stop listening for an event on the channel instance.
  18423. */
  18424. }, {
  18425. key: 'stopListening',
  18426. value: function stopListening(event) {
  18427. var name = this.eventFormatter.format(event);
  18428. this.socket.removeListener(name);
  18429. delete this.events[name];
  18430. return this;
  18431. }
  18432. /**
  18433. * Bind the channel's socket to an event and store the callback.
  18434. */
  18435. }, {
  18436. key: 'on',
  18437. value: function on(event, callback) {
  18438. var _this2 = this;
  18439. var listener = function listener(channel, data) {
  18440. if (_this2.name == channel) {
  18441. callback(data);
  18442. }
  18443. };
  18444. this.socket.on(event, listener);
  18445. this.bind(event, listener);
  18446. }
  18447. /**
  18448. * Attach a 'reconnect' listener and bind the event.
  18449. */
  18450. }, {
  18451. key: 'configureReconnector',
  18452. value: function configureReconnector() {
  18453. var _this3 = this;
  18454. var listener = function listener() {
  18455. _this3.subscribe();
  18456. };
  18457. this.socket.on('reconnect', listener);
  18458. this.bind('reconnect', listener);
  18459. }
  18460. /**
  18461. * Bind the channel's socket to an event and store the callback.
  18462. */
  18463. }, {
  18464. key: 'bind',
  18465. value: function bind(event, callback) {
  18466. this.events[event] = this.events[event] || [];
  18467. this.events[event].push(callback);
  18468. }
  18469. /**
  18470. * Unbind the channel's socket from all stored event callbacks.
  18471. */
  18472. }, {
  18473. key: 'unbind',
  18474. value: function unbind() {
  18475. var _this4 = this;
  18476. Object.keys(this.events).forEach(function (event) {
  18477. _this4.events[event].forEach(function (callback) {
  18478. _this4.socket.removeListener(event, callback);
  18479. });
  18480. delete _this4.events[event];
  18481. });
  18482. }
  18483. }]);
  18484. return SocketIoChannel;
  18485. }(Channel);
  18486. /**
  18487. * This class represents a Socket.io presence channel.
  18488. */
  18489. var SocketIoPrivateChannel = function (_SocketIoChannel) {
  18490. inherits(SocketIoPrivateChannel, _SocketIoChannel);
  18491. function SocketIoPrivateChannel() {
  18492. classCallCheck(this, SocketIoPrivateChannel);
  18493. return possibleConstructorReturn(this, (SocketIoPrivateChannel.__proto__ || Object.getPrototypeOf(SocketIoPrivateChannel)).apply(this, arguments));
  18494. }
  18495. createClass(SocketIoPrivateChannel, [{
  18496. key: 'whisper',
  18497. /**
  18498. * Trigger client event on the channel.
  18499. */
  18500. value: function whisper(eventName, data) {
  18501. this.socket.emit('client event', {
  18502. channel: this.name,
  18503. event: 'client-' + eventName,
  18504. data: data
  18505. });
  18506. return this;
  18507. }
  18508. }]);
  18509. return SocketIoPrivateChannel;
  18510. }(SocketIoChannel);
  18511. /**
  18512. * This class represents a Socket.io presence channel.
  18513. */
  18514. var SocketIoPresenceChannel = function (_SocketIoPrivateChann) {
  18515. inherits(SocketIoPresenceChannel, _SocketIoPrivateChann);
  18516. function SocketIoPresenceChannel() {
  18517. classCallCheck(this, SocketIoPresenceChannel);
  18518. return possibleConstructorReturn(this, (SocketIoPresenceChannel.__proto__ || Object.getPrototypeOf(SocketIoPresenceChannel)).apply(this, arguments));
  18519. }
  18520. createClass(SocketIoPresenceChannel, [{
  18521. key: 'here',
  18522. /**
  18523. * Register a callback to be called anytime the member list changes.
  18524. */
  18525. value: function here(callback) {
  18526. this.on('presence:subscribed', function (members) {
  18527. callback(members.map(function (m) {
  18528. return m.user_info;
  18529. }));
  18530. });
  18531. return this;
  18532. }
  18533. /**
  18534. * Listen for someone joining the channel.
  18535. */
  18536. }, {
  18537. key: 'joining',
  18538. value: function joining(callback) {
  18539. this.on('presence:joining', function (member) {
  18540. return callback(member.user_info);
  18541. });
  18542. return this;
  18543. }
  18544. /**
  18545. * Listen for someone leaving the channel.
  18546. */
  18547. }, {
  18548. key: 'leaving',
  18549. value: function leaving(callback) {
  18550. this.on('presence:leaving', function (member) {
  18551. return callback(member.user_info);
  18552. });
  18553. return this;
  18554. }
  18555. }]);
  18556. return SocketIoPresenceChannel;
  18557. }(SocketIoPrivateChannel);
  18558. /**
  18559. * This class represents a null channel.
  18560. */
  18561. var NullChannel = function (_Channel) {
  18562. inherits(NullChannel, _Channel);
  18563. function NullChannel() {
  18564. classCallCheck(this, NullChannel);
  18565. return possibleConstructorReturn(this, (NullChannel.__proto__ || Object.getPrototypeOf(NullChannel)).apply(this, arguments));
  18566. }
  18567. createClass(NullChannel, [{
  18568. key: 'subscribe',
  18569. /**
  18570. * Subscribe to a channel.
  18571. */
  18572. value: function subscribe() {}
  18573. //
  18574. /**
  18575. * Unsubscribe from a channel.
  18576. */
  18577. }, {
  18578. key: 'unsubscribe',
  18579. value: function unsubscribe() {}
  18580. //
  18581. /**
  18582. * Listen for an event on the channel instance.
  18583. */
  18584. }, {
  18585. key: 'listen',
  18586. value: function listen(event, callback) {
  18587. return this;
  18588. }
  18589. /**
  18590. * Stop listening for an event on the channel instance.
  18591. */
  18592. }, {
  18593. key: 'stopListening',
  18594. value: function stopListening(event) {
  18595. return this;
  18596. }
  18597. /**
  18598. * Bind a channel to an event.
  18599. */
  18600. }, {
  18601. key: 'on',
  18602. value: function on(event, callback) {
  18603. return this;
  18604. }
  18605. }]);
  18606. return NullChannel;
  18607. }(Channel);
  18608. /**
  18609. * This class represents a null private channel.
  18610. */
  18611. var NullPrivateChannel = function (_NullChannel) {
  18612. inherits(NullPrivateChannel, _NullChannel);
  18613. function NullPrivateChannel() {
  18614. classCallCheck(this, NullPrivateChannel);
  18615. return possibleConstructorReturn(this, (NullPrivateChannel.__proto__ || Object.getPrototypeOf(NullPrivateChannel)).apply(this, arguments));
  18616. }
  18617. createClass(NullPrivateChannel, [{
  18618. key: 'whisper',
  18619. /**
  18620. * Trigger client event on the channel.
  18621. */
  18622. value: function whisper(eventName, data) {
  18623. return this;
  18624. }
  18625. }]);
  18626. return NullPrivateChannel;
  18627. }(NullChannel);
  18628. /**
  18629. * This class represents a null presence channel.
  18630. */
  18631. var NullPresenceChannel = function (_NullChannel) {
  18632. inherits(NullPresenceChannel, _NullChannel);
  18633. function NullPresenceChannel() {
  18634. classCallCheck(this, NullPresenceChannel);
  18635. return possibleConstructorReturn(this, (NullPresenceChannel.__proto__ || Object.getPrototypeOf(NullPresenceChannel)).apply(this, arguments));
  18636. }
  18637. createClass(NullPresenceChannel, [{
  18638. key: 'here',
  18639. /**
  18640. * Register a callback to be called anytime the member list changes.
  18641. */
  18642. value: function here(callback) {
  18643. return this;
  18644. }
  18645. /**
  18646. * Listen for someone joining the channel.
  18647. */
  18648. }, {
  18649. key: 'joining',
  18650. value: function joining(callback) {
  18651. return this;
  18652. }
  18653. /**
  18654. * Listen for someone leaving the channel.
  18655. */
  18656. }, {
  18657. key: 'leaving',
  18658. value: function leaving(callback) {
  18659. return this;
  18660. }
  18661. /**
  18662. * Trigger client event on the channel.
  18663. */
  18664. }, {
  18665. key: 'whisper',
  18666. value: function whisper(eventName, data) {
  18667. return this;
  18668. }
  18669. }]);
  18670. return NullPresenceChannel;
  18671. }(NullChannel);
  18672. /**
  18673. * This class creates a connector to Pusher.
  18674. */
  18675. var PusherConnector = function (_Connector) {
  18676. inherits(PusherConnector, _Connector);
  18677. function PusherConnector() {
  18678. classCallCheck(this, PusherConnector);
  18679. /**
  18680. * All of the subscribed channel names.
  18681. */
  18682. var _this = possibleConstructorReturn(this, (PusherConnector.__proto__ || Object.getPrototypeOf(PusherConnector)).apply(this, arguments));
  18683. _this.channels = {};
  18684. return _this;
  18685. }
  18686. /**
  18687. * Create a fresh Pusher connection.
  18688. */
  18689. createClass(PusherConnector, [{
  18690. key: 'connect',
  18691. value: function connect() {
  18692. if (typeof this.options.client !== 'undefined') {
  18693. this.pusher = this.options.client;
  18694. } else {
  18695. this.pusher = new Pusher(this.options.key, this.options);
  18696. }
  18697. }
  18698. /**
  18699. * Listen for an event on a channel instance.
  18700. */
  18701. }, {
  18702. key: 'listen',
  18703. value: function listen(name, event, callback) {
  18704. return this.channel(name).listen(event, callback);
  18705. }
  18706. /**
  18707. * Get a channel instance by name.
  18708. */
  18709. }, {
  18710. key: 'channel',
  18711. value: function channel(name) {
  18712. if (!this.channels[name]) {
  18713. this.channels[name] = new PusherChannel(this.pusher, name, this.options);
  18714. }
  18715. return this.channels[name];
  18716. }
  18717. /**
  18718. * Get a private channel instance by name.
  18719. */
  18720. }, {
  18721. key: 'privateChannel',
  18722. value: function privateChannel(name) {
  18723. if (!this.channels['private-' + name]) {
  18724. this.channels['private-' + name] = new PusherPrivateChannel(this.pusher, 'private-' + name, this.options);
  18725. }
  18726. return this.channels['private-' + name];
  18727. }
  18728. /**
  18729. * Get a presence channel instance by name.
  18730. */
  18731. }, {
  18732. key: 'presenceChannel',
  18733. value: function presenceChannel(name) {
  18734. if (!this.channels['presence-' + name]) {
  18735. this.channels['presence-' + name] = new PusherPresenceChannel(this.pusher, 'presence-' + name, this.options);
  18736. }
  18737. return this.channels['presence-' + name];
  18738. }
  18739. /**
  18740. * Leave the given channel, as well as its private and presence variants.
  18741. */
  18742. }, {
  18743. key: 'leave',
  18744. value: function leave(name) {
  18745. var _this2 = this;
  18746. var channels = [name, 'private-' + name, 'presence-' + name];
  18747. channels.forEach(function (name, index) {
  18748. _this2.leaveChannel(name);
  18749. });
  18750. }
  18751. /**
  18752. * Leave the given channel.
  18753. */
  18754. }, {
  18755. key: 'leaveChannel',
  18756. value: function leaveChannel(name) {
  18757. if (this.channels[name]) {
  18758. this.channels[name].unsubscribe();
  18759. delete this.channels[name];
  18760. }
  18761. }
  18762. /**
  18763. * Get the socket ID for the connection.
  18764. */
  18765. }, {
  18766. key: 'socketId',
  18767. value: function socketId() {
  18768. return this.pusher.connection.socket_id;
  18769. }
  18770. /**
  18771. * Disconnect Pusher connection.
  18772. */
  18773. }, {
  18774. key: 'disconnect',
  18775. value: function disconnect() {
  18776. this.pusher.disconnect();
  18777. }
  18778. }]);
  18779. return PusherConnector;
  18780. }(Connector);
  18781. /**
  18782. * This class creates a connnector to a Socket.io server.
  18783. */
  18784. var SocketIoConnector = function (_Connector) {
  18785. inherits(SocketIoConnector, _Connector);
  18786. function SocketIoConnector() {
  18787. classCallCheck(this, SocketIoConnector);
  18788. /**
  18789. * All of the subscribed channel names.
  18790. */
  18791. var _this = possibleConstructorReturn(this, (SocketIoConnector.__proto__ || Object.getPrototypeOf(SocketIoConnector)).apply(this, arguments));
  18792. _this.channels = {};
  18793. return _this;
  18794. }
  18795. /**
  18796. * Create a fresh Socket.io connection.
  18797. */
  18798. createClass(SocketIoConnector, [{
  18799. key: 'connect',
  18800. value: function connect() {
  18801. var io = this.getSocketIO();
  18802. this.socket = io(this.options.host, this.options);
  18803. return this.socket;
  18804. }
  18805. /**
  18806. * Get socket.io module from global scope or options.
  18807. */
  18808. }, {
  18809. key: 'getSocketIO',
  18810. value: function getSocketIO() {
  18811. if (typeof this.options.client !== 'undefined') {
  18812. return this.options.client;
  18813. }
  18814. if (typeof io !== 'undefined') {
  18815. return io;
  18816. }
  18817. throw new Error('Socket.io client not found. Should be globally available or passed via options.client');
  18818. }
  18819. /**
  18820. * Listen for an event on a channel instance.
  18821. */
  18822. }, {
  18823. key: 'listen',
  18824. value: function listen(name, event, callback) {
  18825. return this.channel(name).listen(event, callback);
  18826. }
  18827. /**
  18828. * Get a channel instance by name.
  18829. */
  18830. }, {
  18831. key: 'channel',
  18832. value: function channel(name) {
  18833. if (!this.channels[name]) {
  18834. this.channels[name] = new SocketIoChannel(this.socket, name, this.options);
  18835. }
  18836. return this.channels[name];
  18837. }
  18838. /**
  18839. * Get a private channel instance by name.
  18840. */
  18841. }, {
  18842. key: 'privateChannel',
  18843. value: function privateChannel(name) {
  18844. if (!this.channels['private-' + name]) {
  18845. this.channels['private-' + name] = new SocketIoPrivateChannel(this.socket, 'private-' + name, this.options);
  18846. }
  18847. return this.channels['private-' + name];
  18848. }
  18849. /**
  18850. * Get a presence channel instance by name.
  18851. */
  18852. }, {
  18853. key: 'presenceChannel',
  18854. value: function presenceChannel(name) {
  18855. if (!this.channels['presence-' + name]) {
  18856. this.channels['presence-' + name] = new SocketIoPresenceChannel(this.socket, 'presence-' + name, this.options);
  18857. }
  18858. return this.channels['presence-' + name];
  18859. }
  18860. /**
  18861. * Leave the given channel, as well as its private and presence variants.
  18862. */
  18863. }, {
  18864. key: 'leave',
  18865. value: function leave(name) {
  18866. var _this2 = this;
  18867. var channels = [name, 'private-' + name, 'presence-' + name];
  18868. channels.forEach(function (name) {
  18869. _this2.leaveChannel(name);
  18870. });
  18871. }
  18872. /**
  18873. * Leave the given channel.
  18874. */
  18875. }, {
  18876. key: 'leaveChannel',
  18877. value: function leaveChannel(name) {
  18878. if (this.channels[name]) {
  18879. this.channels[name].unsubscribe();
  18880. delete this.channels[name];
  18881. }
  18882. }
  18883. /**
  18884. * Get the socket ID for the connection.
  18885. */
  18886. }, {
  18887. key: 'socketId',
  18888. value: function socketId() {
  18889. return this.socket.id;
  18890. }
  18891. /**
  18892. * Disconnect Socketio connection.
  18893. */
  18894. }, {
  18895. key: 'disconnect',
  18896. value: function disconnect() {
  18897. this.socket.disconnect();
  18898. }
  18899. }]);
  18900. return SocketIoConnector;
  18901. }(Connector);
  18902. /**
  18903. * This class creates a null connector.
  18904. */
  18905. var NullConnector = function (_Connector) {
  18906. inherits(NullConnector, _Connector);
  18907. function NullConnector() {
  18908. classCallCheck(this, NullConnector);
  18909. /**
  18910. * All of the subscribed channel names.
  18911. */
  18912. var _this = possibleConstructorReturn(this, (NullConnector.__proto__ || Object.getPrototypeOf(NullConnector)).apply(this, arguments));
  18913. _this.channels = {};
  18914. return _this;
  18915. }
  18916. /**
  18917. * Create a fresh connection.
  18918. */
  18919. createClass(NullConnector, [{
  18920. key: 'connect',
  18921. value: function connect() {}
  18922. //
  18923. /**
  18924. * Listen for an event on a channel instance.
  18925. */
  18926. }, {
  18927. key: 'listen',
  18928. value: function listen(name, event, callback) {
  18929. return new NullChannel();
  18930. }
  18931. /**
  18932. * Get a channel instance by name.
  18933. */
  18934. }, {
  18935. key: 'channel',
  18936. value: function channel(name) {
  18937. return new NullChannel();
  18938. }
  18939. /**
  18940. * Get a private channel instance by name.
  18941. */
  18942. }, {
  18943. key: 'privateChannel',
  18944. value: function privateChannel(name) {
  18945. return new NullPrivateChannel();
  18946. }
  18947. /**
  18948. * Get a presence channel instance by name.
  18949. */
  18950. }, {
  18951. key: 'presenceChannel',
  18952. value: function presenceChannel(name) {
  18953. return new NullPresenceChannel();
  18954. }
  18955. /**
  18956. * Leave the given channel, as well as its private and presence variants.
  18957. */
  18958. }, {
  18959. key: 'leave',
  18960. value: function leave(name) {}
  18961. //
  18962. /**
  18963. * Leave the given channel.
  18964. */
  18965. }, {
  18966. key: 'leaveChannel',
  18967. value: function leaveChannel(name) {}
  18968. //
  18969. /**
  18970. * Get the socket ID for the connection.
  18971. */
  18972. }, {
  18973. key: 'socketId',
  18974. value: function socketId() {
  18975. return 'fake-socket-id';
  18976. }
  18977. /**
  18978. * Disconnect the connection.
  18979. */
  18980. }, {
  18981. key: 'disconnect',
  18982. value: function disconnect() {
  18983. //
  18984. }
  18985. }]);
  18986. return NullConnector;
  18987. }(Connector);
  18988. /**
  18989. * This class is the primary API for interacting with broadcasting.
  18990. */
  18991. var Echo = function () {
  18992. /**
  18993. * Create a new class instance.
  18994. */
  18995. function Echo(options) {
  18996. classCallCheck(this, Echo);
  18997. this.options = options;
  18998. this.connect();
  18999. if (!this.options.withoutInterceptors) {
  19000. this.registerInterceptors();
  19001. }
  19002. }
  19003. /**
  19004. * Get a channel instance by name.
  19005. */
  19006. createClass(Echo, [{
  19007. key: 'channel',
  19008. value: function channel(_channel) {
  19009. return this.connector.channel(_channel);
  19010. }
  19011. /**
  19012. * Create a new connection.
  19013. */
  19014. }, {
  19015. key: 'connect',
  19016. value: function connect() {
  19017. if (this.options.broadcaster == 'pusher') {
  19018. this.connector = new PusherConnector(this.options);
  19019. } else if (this.options.broadcaster == 'socket.io') {
  19020. this.connector = new SocketIoConnector(this.options);
  19021. } else if (this.options.broadcaster == 'null') {
  19022. this.connector = new NullConnector(this.options);
  19023. } else if (typeof this.options.broadcaster == 'function') {
  19024. this.connector = new this.options.broadcaster(this.options);
  19025. }
  19026. }
  19027. /**
  19028. * Disconnect from the Echo server.
  19029. */
  19030. }, {
  19031. key: 'disconnect',
  19032. value: function disconnect() {
  19033. this.connector.disconnect();
  19034. }
  19035. /**
  19036. * Get a presence channel instance by name.
  19037. */
  19038. }, {
  19039. key: 'join',
  19040. value: function join(channel) {
  19041. return this.connector.presenceChannel(channel);
  19042. }
  19043. /**
  19044. * Leave the given channel, as well as its private and presence variants.
  19045. */
  19046. }, {
  19047. key: 'leave',
  19048. value: function leave(channel) {
  19049. this.connector.leave(channel);
  19050. }
  19051. /**
  19052. * Leave the given channel.
  19053. */
  19054. }, {
  19055. key: 'leaveChannel',
  19056. value: function leaveChannel(channel) {
  19057. this.connector.leaveChannel(channel);
  19058. }
  19059. /**
  19060. * Listen for an event on a channel instance.
  19061. */
  19062. }, {
  19063. key: 'listen',
  19064. value: function listen(channel, event, callback) {
  19065. return this.connector.listen(channel, event, callback);
  19066. }
  19067. /**
  19068. * Get a private channel instance by name.
  19069. */
  19070. }, {
  19071. key: 'private',
  19072. value: function _private(channel) {
  19073. return this.connector.privateChannel(channel);
  19074. }
  19075. /**
  19076. * Get the Socket ID for the connection.
  19077. */
  19078. }, {
  19079. key: 'socketId',
  19080. value: function socketId() {
  19081. return this.connector.socketId();
  19082. }
  19083. /**
  19084. * Register 3rd party request interceptiors. These are used to automatically
  19085. * send a connections socket id to a Laravel app with a X-Socket-Id header.
  19086. */
  19087. }, {
  19088. key: 'registerInterceptors',
  19089. value: function registerInterceptors() {
  19090. if (typeof Vue === 'function' && Vue.http) {
  19091. this.registerVueRequestInterceptor();
  19092. }
  19093. if (typeof axios === 'function') {
  19094. this.registerAxiosRequestInterceptor();
  19095. }
  19096. if (typeof jQuery === 'function') {
  19097. this.registerjQueryAjaxSetup();
  19098. }
  19099. }
  19100. /**
  19101. * Register a Vue HTTP interceptor to add the X-Socket-ID header.
  19102. */
  19103. }, {
  19104. key: 'registerVueRequestInterceptor',
  19105. value: function registerVueRequestInterceptor() {
  19106. var _this = this;
  19107. Vue.http.interceptors.push(function (request, next) {
  19108. if (_this.socketId()) {
  19109. request.headers.set('X-Socket-ID', _this.socketId());
  19110. }
  19111. next();
  19112. });
  19113. }
  19114. /**
  19115. * Register an Axios HTTP interceptor to add the X-Socket-ID header.
  19116. */
  19117. }, {
  19118. key: 'registerAxiosRequestInterceptor',
  19119. value: function registerAxiosRequestInterceptor() {
  19120. var _this2 = this;
  19121. axios.interceptors.request.use(function (config) {
  19122. if (_this2.socketId()) {
  19123. config.headers['X-Socket-Id'] = _this2.socketId();
  19124. }
  19125. return config;
  19126. });
  19127. }
  19128. /**
  19129. * Register jQuery AjaxPrefilter to add the X-Socket-ID header.
  19130. */
  19131. }, {
  19132. key: 'registerjQueryAjaxSetup',
  19133. value: function registerjQueryAjaxSetup() {
  19134. var _this3 = this;
  19135. if (typeof jQuery.ajax != 'undefined') {
  19136. jQuery.ajaxPrefilter(function (options, originalOptions, xhr) {
  19137. if (_this3.socketId()) {
  19138. xhr.setRequestHeader('X-Socket-Id', _this3.socketId());
  19139. }
  19140. });
  19141. }
  19142. }
  19143. }]);
  19144. return Echo;
  19145. }();
  19146. /* harmony default export */ __webpack_exports__["default"] = (Echo);
  19147. /***/ }),
  19148. /***/ "./node_modules/lodash/lodash.js":
  19149. /*!***************************************!*\
  19150. !*** ./node_modules/lodash/lodash.js ***!
  19151. \***************************************/
  19152. /*! no static exports found */
  19153. /***/ (function(module, exports, __webpack_require__) {
  19154. /* WEBPACK VAR INJECTION */(function(global, module) {var __WEBPACK_AMD_DEFINE_RESULT__;/**
  19155. * @license
  19156. * Lodash <https://lodash.com/>
  19157. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  19158. * Released under MIT license <https://lodash.com/license>
  19159. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  19160. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  19161. */
  19162. ;(function() {
  19163. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  19164. var undefined;
  19165. /** Used as the semantic version number. */
  19166. var VERSION = '4.17.15';
  19167. /** Used as the size to enable large array optimizations. */
  19168. var LARGE_ARRAY_SIZE = 200;
  19169. /** Error message constants. */
  19170. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  19171. FUNC_ERROR_TEXT = 'Expected a function';
  19172. /** Used to stand-in for `undefined` hash values. */
  19173. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  19174. /** Used as the maximum memoize cache size. */
  19175. var MAX_MEMOIZE_SIZE = 500;
  19176. /** Used as the internal argument placeholder. */
  19177. var PLACEHOLDER = '__lodash_placeholder__';
  19178. /** Used to compose bitmasks for cloning. */
  19179. var CLONE_DEEP_FLAG = 1,
  19180. CLONE_FLAT_FLAG = 2,
  19181. CLONE_SYMBOLS_FLAG = 4;
  19182. /** Used to compose bitmasks for value comparisons. */
  19183. var COMPARE_PARTIAL_FLAG = 1,
  19184. COMPARE_UNORDERED_FLAG = 2;
  19185. /** Used to compose bitmasks for function metadata. */
  19186. var WRAP_BIND_FLAG = 1,
  19187. WRAP_BIND_KEY_FLAG = 2,
  19188. WRAP_CURRY_BOUND_FLAG = 4,
  19189. WRAP_CURRY_FLAG = 8,
  19190. WRAP_CURRY_RIGHT_FLAG = 16,
  19191. WRAP_PARTIAL_FLAG = 32,
  19192. WRAP_PARTIAL_RIGHT_FLAG = 64,
  19193. WRAP_ARY_FLAG = 128,
  19194. WRAP_REARG_FLAG = 256,
  19195. WRAP_FLIP_FLAG = 512;
  19196. /** Used as default options for `_.truncate`. */
  19197. var DEFAULT_TRUNC_LENGTH = 30,
  19198. DEFAULT_TRUNC_OMISSION = '...';
  19199. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  19200. var HOT_COUNT = 800,
  19201. HOT_SPAN = 16;
  19202. /** Used to indicate the type of lazy iteratees. */
  19203. var LAZY_FILTER_FLAG = 1,
  19204. LAZY_MAP_FLAG = 2,
  19205. LAZY_WHILE_FLAG = 3;
  19206. /** Used as references for various `Number` constants. */
  19207. var INFINITY = 1 / 0,
  19208. MAX_SAFE_INTEGER = 9007199254740991,
  19209. MAX_INTEGER = 1.7976931348623157e+308,
  19210. NAN = 0 / 0;
  19211. /** Used as references for the maximum length and index of an array. */
  19212. var MAX_ARRAY_LENGTH = 4294967295,
  19213. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  19214. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  19215. /** Used to associate wrap methods with their bit flags. */
  19216. var wrapFlags = [
  19217. ['ary', WRAP_ARY_FLAG],
  19218. ['bind', WRAP_BIND_FLAG],
  19219. ['bindKey', WRAP_BIND_KEY_FLAG],
  19220. ['curry', WRAP_CURRY_FLAG],
  19221. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  19222. ['flip', WRAP_FLIP_FLAG],
  19223. ['partial', WRAP_PARTIAL_FLAG],
  19224. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  19225. ['rearg', WRAP_REARG_FLAG]
  19226. ];
  19227. /** `Object#toString` result references. */
  19228. var argsTag = '[object Arguments]',
  19229. arrayTag = '[object Array]',
  19230. asyncTag = '[object AsyncFunction]',
  19231. boolTag = '[object Boolean]',
  19232. dateTag = '[object Date]',
  19233. domExcTag = '[object DOMException]',
  19234. errorTag = '[object Error]',
  19235. funcTag = '[object Function]',
  19236. genTag = '[object GeneratorFunction]',
  19237. mapTag = '[object Map]',
  19238. numberTag = '[object Number]',
  19239. nullTag = '[object Null]',
  19240. objectTag = '[object Object]',
  19241. promiseTag = '[object Promise]',
  19242. proxyTag = '[object Proxy]',
  19243. regexpTag = '[object RegExp]',
  19244. setTag = '[object Set]',
  19245. stringTag = '[object String]',
  19246. symbolTag = '[object Symbol]',
  19247. undefinedTag = '[object Undefined]',
  19248. weakMapTag = '[object WeakMap]',
  19249. weakSetTag = '[object WeakSet]';
  19250. var arrayBufferTag = '[object ArrayBuffer]',
  19251. dataViewTag = '[object DataView]',
  19252. float32Tag = '[object Float32Array]',
  19253. float64Tag = '[object Float64Array]',
  19254. int8Tag = '[object Int8Array]',
  19255. int16Tag = '[object Int16Array]',
  19256. int32Tag = '[object Int32Array]',
  19257. uint8Tag = '[object Uint8Array]',
  19258. uint8ClampedTag = '[object Uint8ClampedArray]',
  19259. uint16Tag = '[object Uint16Array]',
  19260. uint32Tag = '[object Uint32Array]';
  19261. /** Used to match empty string literals in compiled template source. */
  19262. var reEmptyStringLeading = /\b__p \+= '';/g,
  19263. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  19264. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  19265. /** Used to match HTML entities and HTML characters. */
  19266. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  19267. reUnescapedHtml = /[&<>"']/g,
  19268. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  19269. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  19270. /** Used to match template delimiters. */
  19271. var reEscape = /<%-([\s\S]+?)%>/g,
  19272. reEvaluate = /<%([\s\S]+?)%>/g,
  19273. reInterpolate = /<%=([\s\S]+?)%>/g;
  19274. /** Used to match property names within property paths. */
  19275. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  19276. reIsPlainProp = /^\w*$/,
  19277. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  19278. /**
  19279. * Used to match `RegExp`
  19280. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  19281. */
  19282. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  19283. reHasRegExpChar = RegExp(reRegExpChar.source);
  19284. /** Used to match leading and trailing whitespace. */
  19285. var reTrim = /^\s+|\s+$/g,
  19286. reTrimStart = /^\s+/,
  19287. reTrimEnd = /\s+$/;
  19288. /** Used to match wrap detail comments. */
  19289. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  19290. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  19291. reSplitDetails = /,? & /;
  19292. /** Used to match words composed of alphanumeric characters. */
  19293. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  19294. /** Used to match backslashes in property paths. */
  19295. var reEscapeChar = /\\(\\)?/g;
  19296. /**
  19297. * Used to match
  19298. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  19299. */
  19300. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  19301. /** Used to match `RegExp` flags from their coerced string values. */
  19302. var reFlags = /\w*$/;
  19303. /** Used to detect bad signed hexadecimal string values. */
  19304. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  19305. /** Used to detect binary string values. */
  19306. var reIsBinary = /^0b[01]+$/i;
  19307. /** Used to detect host constructors (Safari). */
  19308. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  19309. /** Used to detect octal string values. */
  19310. var reIsOctal = /^0o[0-7]+$/i;
  19311. /** Used to detect unsigned integer values. */
  19312. var reIsUint = /^(?:0|[1-9]\d*)$/;
  19313. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  19314. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  19315. /** Used to ensure capturing order of template delimiters. */
  19316. var reNoMatch = /($^)/;
  19317. /** Used to match unescaped characters in compiled string literals. */
  19318. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  19319. /** Used to compose unicode character classes. */
  19320. var rsAstralRange = '\\ud800-\\udfff',
  19321. rsComboMarksRange = '\\u0300-\\u036f',
  19322. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  19323. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  19324. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  19325. rsDingbatRange = '\\u2700-\\u27bf',
  19326. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  19327. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  19328. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  19329. rsPunctuationRange = '\\u2000-\\u206f',
  19330. 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',
  19331. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  19332. rsVarRange = '\\ufe0e\\ufe0f',
  19333. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  19334. /** Used to compose unicode capture groups. */
  19335. var rsApos = "['\u2019]",
  19336. rsAstral = '[' + rsAstralRange + ']',
  19337. rsBreak = '[' + rsBreakRange + ']',
  19338. rsCombo = '[' + rsComboRange + ']',
  19339. rsDigits = '\\d+',
  19340. rsDingbat = '[' + rsDingbatRange + ']',
  19341. rsLower = '[' + rsLowerRange + ']',
  19342. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  19343. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  19344. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  19345. rsNonAstral = '[^' + rsAstralRange + ']',
  19346. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  19347. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  19348. rsUpper = '[' + rsUpperRange + ']',
  19349. rsZWJ = '\\u200d';
  19350. /** Used to compose unicode regexes. */
  19351. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  19352. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  19353. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  19354. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  19355. reOptMod = rsModifier + '?',
  19356. rsOptVar = '[' + rsVarRange + ']?',
  19357. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  19358. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  19359. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  19360. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  19361. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  19362. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  19363. /** Used to match apostrophes. */
  19364. var reApos = RegExp(rsApos, 'g');
  19365. /**
  19366. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  19367. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  19368. */
  19369. var reComboMark = RegExp(rsCombo, 'g');
  19370. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  19371. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  19372. /** Used to match complex or compound words. */
  19373. var reUnicodeWord = RegExp([
  19374. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  19375. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  19376. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  19377. rsUpper + '+' + rsOptContrUpper,
  19378. rsOrdUpper,
  19379. rsOrdLower,
  19380. rsDigits,
  19381. rsEmoji
  19382. ].join('|'), 'g');
  19383. /** 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/). */
  19384. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  19385. /** Used to detect strings that need a more robust regexp to match words. */
  19386. 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 ]/;
  19387. /** Used to assign default `context` object properties. */
  19388. var contextProps = [
  19389. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  19390. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  19391. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  19392. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  19393. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  19394. ];
  19395. /** Used to make template sourceURLs easier to identify. */
  19396. var templateCounter = -1;
  19397. /** Used to identify `toStringTag` values of typed arrays. */
  19398. var typedArrayTags = {};
  19399. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  19400. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  19401. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  19402. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  19403. typedArrayTags[uint32Tag] = true;
  19404. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  19405. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  19406. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  19407. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  19408. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  19409. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  19410. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  19411. typedArrayTags[weakMapTag] = false;
  19412. /** Used to identify `toStringTag` values supported by `_.clone`. */
  19413. var cloneableTags = {};
  19414. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  19415. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  19416. cloneableTags[boolTag] = cloneableTags[dateTag] =
  19417. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  19418. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  19419. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  19420. cloneableTags[numberTag] = cloneableTags[objectTag] =
  19421. cloneableTags[regexpTag] = cloneableTags[setTag] =
  19422. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  19423. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  19424. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  19425. cloneableTags[errorTag] = cloneableTags[funcTag] =
  19426. cloneableTags[weakMapTag] = false;
  19427. /** Used to map Latin Unicode letters to basic Latin letters. */
  19428. var deburredLetters = {
  19429. // Latin-1 Supplement block.
  19430. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  19431. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  19432. '\xc7': 'C', '\xe7': 'c',
  19433. '\xd0': 'D', '\xf0': 'd',
  19434. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  19435. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  19436. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  19437. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  19438. '\xd1': 'N', '\xf1': 'n',
  19439. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  19440. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  19441. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  19442. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  19443. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  19444. '\xc6': 'Ae', '\xe6': 'ae',
  19445. '\xde': 'Th', '\xfe': 'th',
  19446. '\xdf': 'ss',
  19447. // Latin Extended-A block.
  19448. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  19449. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  19450. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  19451. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  19452. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  19453. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  19454. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  19455. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  19456. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  19457. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  19458. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  19459. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  19460. '\u0134': 'J', '\u0135': 'j',
  19461. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  19462. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  19463. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  19464. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  19465. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  19466. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  19467. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  19468. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  19469. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  19470. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  19471. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  19472. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  19473. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  19474. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  19475. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  19476. '\u0174': 'W', '\u0175': 'w',
  19477. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  19478. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  19479. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  19480. '\u0132': 'IJ', '\u0133': 'ij',
  19481. '\u0152': 'Oe', '\u0153': 'oe',
  19482. '\u0149': "'n", '\u017f': 's'
  19483. };
  19484. /** Used to map characters to HTML entities. */
  19485. var htmlEscapes = {
  19486. '&': '&amp;',
  19487. '<': '&lt;',
  19488. '>': '&gt;',
  19489. '"': '&quot;',
  19490. "'": '&#39;'
  19491. };
  19492. /** Used to map HTML entities to characters. */
  19493. var htmlUnescapes = {
  19494. '&amp;': '&',
  19495. '&lt;': '<',
  19496. '&gt;': '>',
  19497. '&quot;': '"',
  19498. '&#39;': "'"
  19499. };
  19500. /** Used to escape characters for inclusion in compiled string literals. */
  19501. var stringEscapes = {
  19502. '\\': '\\',
  19503. "'": "'",
  19504. '\n': 'n',
  19505. '\r': 'r',
  19506. '\u2028': 'u2028',
  19507. '\u2029': 'u2029'
  19508. };
  19509. /** Built-in method references without a dependency on `root`. */
  19510. var freeParseFloat = parseFloat,
  19511. freeParseInt = parseInt;
  19512. /** Detect free variable `global` from Node.js. */
  19513. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  19514. /** Detect free variable `self`. */
  19515. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  19516. /** Used as a reference to the global object. */
  19517. var root = freeGlobal || freeSelf || Function('return this')();
  19518. /** Detect free variable `exports`. */
  19519. var freeExports = true && exports && !exports.nodeType && exports;
  19520. /** Detect free variable `module`. */
  19521. var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
  19522. /** Detect the popular CommonJS extension `module.exports`. */
  19523. var moduleExports = freeModule && freeModule.exports === freeExports;
  19524. /** Detect free variable `process` from Node.js. */
  19525. var freeProcess = moduleExports && freeGlobal.process;
  19526. /** Used to access faster Node.js helpers. */
  19527. var nodeUtil = (function() {
  19528. try {
  19529. // Use `util.types` for Node.js 10+.
  19530. var types = freeModule && freeModule.require && freeModule.require('util').types;
  19531. if (types) {
  19532. return types;
  19533. }
  19534. // Legacy `process.binding('util')` for Node.js < 10.
  19535. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  19536. } catch (e) {}
  19537. }());
  19538. /* Node.js helper references. */
  19539. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  19540. nodeIsDate = nodeUtil && nodeUtil.isDate,
  19541. nodeIsMap = nodeUtil && nodeUtil.isMap,
  19542. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  19543. nodeIsSet = nodeUtil && nodeUtil.isSet,
  19544. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  19545. /*--------------------------------------------------------------------------*/
  19546. /**
  19547. * A faster alternative to `Function#apply`, this function invokes `func`
  19548. * with the `this` binding of `thisArg` and the arguments of `args`.
  19549. *
  19550. * @private
  19551. * @param {Function} func The function to invoke.
  19552. * @param {*} thisArg The `this` binding of `func`.
  19553. * @param {Array} args The arguments to invoke `func` with.
  19554. * @returns {*} Returns the result of `func`.
  19555. */
  19556. function apply(func, thisArg, args) {
  19557. switch (args.length) {
  19558. case 0: return func.call(thisArg);
  19559. case 1: return func.call(thisArg, args[0]);
  19560. case 2: return func.call(thisArg, args[0], args[1]);
  19561. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  19562. }
  19563. return func.apply(thisArg, args);
  19564. }
  19565. /**
  19566. * A specialized version of `baseAggregator` for arrays.
  19567. *
  19568. * @private
  19569. * @param {Array} [array] The array to iterate over.
  19570. * @param {Function} setter The function to set `accumulator` values.
  19571. * @param {Function} iteratee The iteratee to transform keys.
  19572. * @param {Object} accumulator The initial aggregated object.
  19573. * @returns {Function} Returns `accumulator`.
  19574. */
  19575. function arrayAggregator(array, setter, iteratee, accumulator) {
  19576. var index = -1,
  19577. length = array == null ? 0 : array.length;
  19578. while (++index < length) {
  19579. var value = array[index];
  19580. setter(accumulator, value, iteratee(value), array);
  19581. }
  19582. return accumulator;
  19583. }
  19584. /**
  19585. * A specialized version of `_.forEach` for arrays without support for
  19586. * iteratee shorthands.
  19587. *
  19588. * @private
  19589. * @param {Array} [array] The array to iterate over.
  19590. * @param {Function} iteratee The function invoked per iteration.
  19591. * @returns {Array} Returns `array`.
  19592. */
  19593. function arrayEach(array, iteratee) {
  19594. var index = -1,
  19595. length = array == null ? 0 : array.length;
  19596. while (++index < length) {
  19597. if (iteratee(array[index], index, array) === false) {
  19598. break;
  19599. }
  19600. }
  19601. return array;
  19602. }
  19603. /**
  19604. * A specialized version of `_.forEachRight` for arrays without support for
  19605. * iteratee shorthands.
  19606. *
  19607. * @private
  19608. * @param {Array} [array] The array to iterate over.
  19609. * @param {Function} iteratee The function invoked per iteration.
  19610. * @returns {Array} Returns `array`.
  19611. */
  19612. function arrayEachRight(array, iteratee) {
  19613. var length = array == null ? 0 : array.length;
  19614. while (length--) {
  19615. if (iteratee(array[length], length, array) === false) {
  19616. break;
  19617. }
  19618. }
  19619. return array;
  19620. }
  19621. /**
  19622. * A specialized version of `_.every` for arrays without support for
  19623. * iteratee shorthands.
  19624. *
  19625. * @private
  19626. * @param {Array} [array] The array to iterate over.
  19627. * @param {Function} predicate The function invoked per iteration.
  19628. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  19629. * else `false`.
  19630. */
  19631. function arrayEvery(array, predicate) {
  19632. var index = -1,
  19633. length = array == null ? 0 : array.length;
  19634. while (++index < length) {
  19635. if (!predicate(array[index], index, array)) {
  19636. return false;
  19637. }
  19638. }
  19639. return true;
  19640. }
  19641. /**
  19642. * A specialized version of `_.filter` for arrays without support for
  19643. * iteratee shorthands.
  19644. *
  19645. * @private
  19646. * @param {Array} [array] The array to iterate over.
  19647. * @param {Function} predicate The function invoked per iteration.
  19648. * @returns {Array} Returns the new filtered array.
  19649. */
  19650. function arrayFilter(array, predicate) {
  19651. var index = -1,
  19652. length = array == null ? 0 : array.length,
  19653. resIndex = 0,
  19654. result = [];
  19655. while (++index < length) {
  19656. var value = array[index];
  19657. if (predicate(value, index, array)) {
  19658. result[resIndex++] = value;
  19659. }
  19660. }
  19661. return result;
  19662. }
  19663. /**
  19664. * A specialized version of `_.includes` for arrays without support for
  19665. * specifying an index to search from.
  19666. *
  19667. * @private
  19668. * @param {Array} [array] The array to inspect.
  19669. * @param {*} target The value to search for.
  19670. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  19671. */
  19672. function arrayIncludes(array, value) {
  19673. var length = array == null ? 0 : array.length;
  19674. return !!length && baseIndexOf(array, value, 0) > -1;
  19675. }
  19676. /**
  19677. * This function is like `arrayIncludes` except that it accepts a comparator.
  19678. *
  19679. * @private
  19680. * @param {Array} [array] The array to inspect.
  19681. * @param {*} target The value to search for.
  19682. * @param {Function} comparator The comparator invoked per element.
  19683. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  19684. */
  19685. function arrayIncludesWith(array, value, comparator) {
  19686. var index = -1,
  19687. length = array == null ? 0 : array.length;
  19688. while (++index < length) {
  19689. if (comparator(value, array[index])) {
  19690. return true;
  19691. }
  19692. }
  19693. return false;
  19694. }
  19695. /**
  19696. * A specialized version of `_.map` for arrays without support for iteratee
  19697. * shorthands.
  19698. *
  19699. * @private
  19700. * @param {Array} [array] The array to iterate over.
  19701. * @param {Function} iteratee The function invoked per iteration.
  19702. * @returns {Array} Returns the new mapped array.
  19703. */
  19704. function arrayMap(array, iteratee) {
  19705. var index = -1,
  19706. length = array == null ? 0 : array.length,
  19707. result = Array(length);
  19708. while (++index < length) {
  19709. result[index] = iteratee(array[index], index, array);
  19710. }
  19711. return result;
  19712. }
  19713. /**
  19714. * Appends the elements of `values` to `array`.
  19715. *
  19716. * @private
  19717. * @param {Array} array The array to modify.
  19718. * @param {Array} values The values to append.
  19719. * @returns {Array} Returns `array`.
  19720. */
  19721. function arrayPush(array, values) {
  19722. var index = -1,
  19723. length = values.length,
  19724. offset = array.length;
  19725. while (++index < length) {
  19726. array[offset + index] = values[index];
  19727. }
  19728. return array;
  19729. }
  19730. /**
  19731. * A specialized version of `_.reduce` for arrays without support for
  19732. * iteratee shorthands.
  19733. *
  19734. * @private
  19735. * @param {Array} [array] The array to iterate over.
  19736. * @param {Function} iteratee The function invoked per iteration.
  19737. * @param {*} [accumulator] The initial value.
  19738. * @param {boolean} [initAccum] Specify using the first element of `array` as
  19739. * the initial value.
  19740. * @returns {*} Returns the accumulated value.
  19741. */
  19742. function arrayReduce(array, iteratee, accumulator, initAccum) {
  19743. var index = -1,
  19744. length = array == null ? 0 : array.length;
  19745. if (initAccum && length) {
  19746. accumulator = array[++index];
  19747. }
  19748. while (++index < length) {
  19749. accumulator = iteratee(accumulator, array[index], index, array);
  19750. }
  19751. return accumulator;
  19752. }
  19753. /**
  19754. * A specialized version of `_.reduceRight` for arrays without support for
  19755. * iteratee shorthands.
  19756. *
  19757. * @private
  19758. * @param {Array} [array] The array to iterate over.
  19759. * @param {Function} iteratee The function invoked per iteration.
  19760. * @param {*} [accumulator] The initial value.
  19761. * @param {boolean} [initAccum] Specify using the last element of `array` as
  19762. * the initial value.
  19763. * @returns {*} Returns the accumulated value.
  19764. */
  19765. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  19766. var length = array == null ? 0 : array.length;
  19767. if (initAccum && length) {
  19768. accumulator = array[--length];
  19769. }
  19770. while (length--) {
  19771. accumulator = iteratee(accumulator, array[length], length, array);
  19772. }
  19773. return accumulator;
  19774. }
  19775. /**
  19776. * A specialized version of `_.some` for arrays without support for iteratee
  19777. * shorthands.
  19778. *
  19779. * @private
  19780. * @param {Array} [array] The array to iterate over.
  19781. * @param {Function} predicate The function invoked per iteration.
  19782. * @returns {boolean} Returns `true` if any element passes the predicate check,
  19783. * else `false`.
  19784. */
  19785. function arraySome(array, predicate) {
  19786. var index = -1,
  19787. length = array == null ? 0 : array.length;
  19788. while (++index < length) {
  19789. if (predicate(array[index], index, array)) {
  19790. return true;
  19791. }
  19792. }
  19793. return false;
  19794. }
  19795. /**
  19796. * Gets the size of an ASCII `string`.
  19797. *
  19798. * @private
  19799. * @param {string} string The string inspect.
  19800. * @returns {number} Returns the string size.
  19801. */
  19802. var asciiSize = baseProperty('length');
  19803. /**
  19804. * Converts an ASCII `string` to an array.
  19805. *
  19806. * @private
  19807. * @param {string} string The string to convert.
  19808. * @returns {Array} Returns the converted array.
  19809. */
  19810. function asciiToArray(string) {
  19811. return string.split('');
  19812. }
  19813. /**
  19814. * Splits an ASCII `string` into an array of its words.
  19815. *
  19816. * @private
  19817. * @param {string} The string to inspect.
  19818. * @returns {Array} Returns the words of `string`.
  19819. */
  19820. function asciiWords(string) {
  19821. return string.match(reAsciiWord) || [];
  19822. }
  19823. /**
  19824. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  19825. * without support for iteratee shorthands, which iterates over `collection`
  19826. * using `eachFunc`.
  19827. *
  19828. * @private
  19829. * @param {Array|Object} collection The collection to inspect.
  19830. * @param {Function} predicate The function invoked per iteration.
  19831. * @param {Function} eachFunc The function to iterate over `collection`.
  19832. * @returns {*} Returns the found element or its key, else `undefined`.
  19833. */
  19834. function baseFindKey(collection, predicate, eachFunc) {
  19835. var result;
  19836. eachFunc(collection, function(value, key, collection) {
  19837. if (predicate(value, key, collection)) {
  19838. result = key;
  19839. return false;
  19840. }
  19841. });
  19842. return result;
  19843. }
  19844. /**
  19845. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  19846. * support for iteratee shorthands.
  19847. *
  19848. * @private
  19849. * @param {Array} array The array to inspect.
  19850. * @param {Function} predicate The function invoked per iteration.
  19851. * @param {number} fromIndex The index to search from.
  19852. * @param {boolean} [fromRight] Specify iterating from right to left.
  19853. * @returns {number} Returns the index of the matched value, else `-1`.
  19854. */
  19855. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  19856. var length = array.length,
  19857. index = fromIndex + (fromRight ? 1 : -1);
  19858. while ((fromRight ? index-- : ++index < length)) {
  19859. if (predicate(array[index], index, array)) {
  19860. return index;
  19861. }
  19862. }
  19863. return -1;
  19864. }
  19865. /**
  19866. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  19867. *
  19868. * @private
  19869. * @param {Array} array The array to inspect.
  19870. * @param {*} value The value to search for.
  19871. * @param {number} fromIndex The index to search from.
  19872. * @returns {number} Returns the index of the matched value, else `-1`.
  19873. */
  19874. function baseIndexOf(array, value, fromIndex) {
  19875. return value === value
  19876. ? strictIndexOf(array, value, fromIndex)
  19877. : baseFindIndex(array, baseIsNaN, fromIndex);
  19878. }
  19879. /**
  19880. * This function is like `baseIndexOf` except that it accepts a comparator.
  19881. *
  19882. * @private
  19883. * @param {Array} array The array to inspect.
  19884. * @param {*} value The value to search for.
  19885. * @param {number} fromIndex The index to search from.
  19886. * @param {Function} comparator The comparator invoked per element.
  19887. * @returns {number} Returns the index of the matched value, else `-1`.
  19888. */
  19889. function baseIndexOfWith(array, value, fromIndex, comparator) {
  19890. var index = fromIndex - 1,
  19891. length = array.length;
  19892. while (++index < length) {
  19893. if (comparator(array[index], value)) {
  19894. return index;
  19895. }
  19896. }
  19897. return -1;
  19898. }
  19899. /**
  19900. * The base implementation of `_.isNaN` without support for number objects.
  19901. *
  19902. * @private
  19903. * @param {*} value The value to check.
  19904. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  19905. */
  19906. function baseIsNaN(value) {
  19907. return value !== value;
  19908. }
  19909. /**
  19910. * The base implementation of `_.mean` and `_.meanBy` without support for
  19911. * iteratee shorthands.
  19912. *
  19913. * @private
  19914. * @param {Array} array The array to iterate over.
  19915. * @param {Function} iteratee The function invoked per iteration.
  19916. * @returns {number} Returns the mean.
  19917. */
  19918. function baseMean(array, iteratee) {
  19919. var length = array == null ? 0 : array.length;
  19920. return length ? (baseSum(array, iteratee) / length) : NAN;
  19921. }
  19922. /**
  19923. * The base implementation of `_.property` without support for deep paths.
  19924. *
  19925. * @private
  19926. * @param {string} key The key of the property to get.
  19927. * @returns {Function} Returns the new accessor function.
  19928. */
  19929. function baseProperty(key) {
  19930. return function(object) {
  19931. return object == null ? undefined : object[key];
  19932. };
  19933. }
  19934. /**
  19935. * The base implementation of `_.propertyOf` without support for deep paths.
  19936. *
  19937. * @private
  19938. * @param {Object} object The object to query.
  19939. * @returns {Function} Returns the new accessor function.
  19940. */
  19941. function basePropertyOf(object) {
  19942. return function(key) {
  19943. return object == null ? undefined : object[key];
  19944. };
  19945. }
  19946. /**
  19947. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  19948. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  19949. *
  19950. * @private
  19951. * @param {Array|Object} collection The collection to iterate over.
  19952. * @param {Function} iteratee The function invoked per iteration.
  19953. * @param {*} accumulator The initial value.
  19954. * @param {boolean} initAccum Specify using the first or last element of
  19955. * `collection` as the initial value.
  19956. * @param {Function} eachFunc The function to iterate over `collection`.
  19957. * @returns {*} Returns the accumulated value.
  19958. */
  19959. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  19960. eachFunc(collection, function(value, index, collection) {
  19961. accumulator = initAccum
  19962. ? (initAccum = false, value)
  19963. : iteratee(accumulator, value, index, collection);
  19964. });
  19965. return accumulator;
  19966. }
  19967. /**
  19968. * The base implementation of `_.sortBy` which uses `comparer` to define the
  19969. * sort order of `array` and replaces criteria objects with their corresponding
  19970. * values.
  19971. *
  19972. * @private
  19973. * @param {Array} array The array to sort.
  19974. * @param {Function} comparer The function to define sort order.
  19975. * @returns {Array} Returns `array`.
  19976. */
  19977. function baseSortBy(array, comparer) {
  19978. var length = array.length;
  19979. array.sort(comparer);
  19980. while (length--) {
  19981. array[length] = array[length].value;
  19982. }
  19983. return array;
  19984. }
  19985. /**
  19986. * The base implementation of `_.sum` and `_.sumBy` without support for
  19987. * iteratee shorthands.
  19988. *
  19989. * @private
  19990. * @param {Array} array The array to iterate over.
  19991. * @param {Function} iteratee The function invoked per iteration.
  19992. * @returns {number} Returns the sum.
  19993. */
  19994. function baseSum(array, iteratee) {
  19995. var result,
  19996. index = -1,
  19997. length = array.length;
  19998. while (++index < length) {
  19999. var current = iteratee(array[index]);
  20000. if (current !== undefined) {
  20001. result = result === undefined ? current : (result + current);
  20002. }
  20003. }
  20004. return result;
  20005. }
  20006. /**
  20007. * The base implementation of `_.times` without support for iteratee shorthands
  20008. * or max array length checks.
  20009. *
  20010. * @private
  20011. * @param {number} n The number of times to invoke `iteratee`.
  20012. * @param {Function} iteratee The function invoked per iteration.
  20013. * @returns {Array} Returns the array of results.
  20014. */
  20015. function baseTimes(n, iteratee) {
  20016. var index = -1,
  20017. result = Array(n);
  20018. while (++index < n) {
  20019. result[index] = iteratee(index);
  20020. }
  20021. return result;
  20022. }
  20023. /**
  20024. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  20025. * of key-value pairs for `object` corresponding to the property names of `props`.
  20026. *
  20027. * @private
  20028. * @param {Object} object The object to query.
  20029. * @param {Array} props The property names to get values for.
  20030. * @returns {Object} Returns the key-value pairs.
  20031. */
  20032. function baseToPairs(object, props) {
  20033. return arrayMap(props, function(key) {
  20034. return [key, object[key]];
  20035. });
  20036. }
  20037. /**
  20038. * The base implementation of `_.unary` without support for storing metadata.
  20039. *
  20040. * @private
  20041. * @param {Function} func The function to cap arguments for.
  20042. * @returns {Function} Returns the new capped function.
  20043. */
  20044. function baseUnary(func) {
  20045. return function(value) {
  20046. return func(value);
  20047. };
  20048. }
  20049. /**
  20050. * The base implementation of `_.values` and `_.valuesIn` which creates an
  20051. * array of `object` property values corresponding to the property names
  20052. * of `props`.
  20053. *
  20054. * @private
  20055. * @param {Object} object The object to query.
  20056. * @param {Array} props The property names to get values for.
  20057. * @returns {Object} Returns the array of property values.
  20058. */
  20059. function baseValues(object, props) {
  20060. return arrayMap(props, function(key) {
  20061. return object[key];
  20062. });
  20063. }
  20064. /**
  20065. * Checks if a `cache` value for `key` exists.
  20066. *
  20067. * @private
  20068. * @param {Object} cache The cache to query.
  20069. * @param {string} key The key of the entry to check.
  20070. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  20071. */
  20072. function cacheHas(cache, key) {
  20073. return cache.has(key);
  20074. }
  20075. /**
  20076. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  20077. * that is not found in the character symbols.
  20078. *
  20079. * @private
  20080. * @param {Array} strSymbols The string symbols to inspect.
  20081. * @param {Array} chrSymbols The character symbols to find.
  20082. * @returns {number} Returns the index of the first unmatched string symbol.
  20083. */
  20084. function charsStartIndex(strSymbols, chrSymbols) {
  20085. var index = -1,
  20086. length = strSymbols.length;
  20087. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  20088. return index;
  20089. }
  20090. /**
  20091. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  20092. * that is not found in the character symbols.
  20093. *
  20094. * @private
  20095. * @param {Array} strSymbols The string symbols to inspect.
  20096. * @param {Array} chrSymbols The character symbols to find.
  20097. * @returns {number} Returns the index of the last unmatched string symbol.
  20098. */
  20099. function charsEndIndex(strSymbols, chrSymbols) {
  20100. var index = strSymbols.length;
  20101. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  20102. return index;
  20103. }
  20104. /**
  20105. * Gets the number of `placeholder` occurrences in `array`.
  20106. *
  20107. * @private
  20108. * @param {Array} array The array to inspect.
  20109. * @param {*} placeholder The placeholder to search for.
  20110. * @returns {number} Returns the placeholder count.
  20111. */
  20112. function countHolders(array, placeholder) {
  20113. var length = array.length,
  20114. result = 0;
  20115. while (length--) {
  20116. if (array[length] === placeholder) {
  20117. ++result;
  20118. }
  20119. }
  20120. return result;
  20121. }
  20122. /**
  20123. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  20124. * letters to basic Latin letters.
  20125. *
  20126. * @private
  20127. * @param {string} letter The matched letter to deburr.
  20128. * @returns {string} Returns the deburred letter.
  20129. */
  20130. var deburrLetter = basePropertyOf(deburredLetters);
  20131. /**
  20132. * Used by `_.escape` to convert characters to HTML entities.
  20133. *
  20134. * @private
  20135. * @param {string} chr The matched character to escape.
  20136. * @returns {string} Returns the escaped character.
  20137. */
  20138. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  20139. /**
  20140. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  20141. *
  20142. * @private
  20143. * @param {string} chr The matched character to escape.
  20144. * @returns {string} Returns the escaped character.
  20145. */
  20146. function escapeStringChar(chr) {
  20147. return '\\' + stringEscapes[chr];
  20148. }
  20149. /**
  20150. * Gets the value at `key` of `object`.
  20151. *
  20152. * @private
  20153. * @param {Object} [object] The object to query.
  20154. * @param {string} key The key of the property to get.
  20155. * @returns {*} Returns the property value.
  20156. */
  20157. function getValue(object, key) {
  20158. return object == null ? undefined : object[key];
  20159. }
  20160. /**
  20161. * Checks if `string` contains Unicode symbols.
  20162. *
  20163. * @private
  20164. * @param {string} string The string to inspect.
  20165. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  20166. */
  20167. function hasUnicode(string) {
  20168. return reHasUnicode.test(string);
  20169. }
  20170. /**
  20171. * Checks if `string` contains a word composed of Unicode symbols.
  20172. *
  20173. * @private
  20174. * @param {string} string The string to inspect.
  20175. * @returns {boolean} Returns `true` if a word is found, else `false`.
  20176. */
  20177. function hasUnicodeWord(string) {
  20178. return reHasUnicodeWord.test(string);
  20179. }
  20180. /**
  20181. * Converts `iterator` to an array.
  20182. *
  20183. * @private
  20184. * @param {Object} iterator The iterator to convert.
  20185. * @returns {Array} Returns the converted array.
  20186. */
  20187. function iteratorToArray(iterator) {
  20188. var data,
  20189. result = [];
  20190. while (!(data = iterator.next()).done) {
  20191. result.push(data.value);
  20192. }
  20193. return result;
  20194. }
  20195. /**
  20196. * Converts `map` to its key-value pairs.
  20197. *
  20198. * @private
  20199. * @param {Object} map The map to convert.
  20200. * @returns {Array} Returns the key-value pairs.
  20201. */
  20202. function mapToArray(map) {
  20203. var index = -1,
  20204. result = Array(map.size);
  20205. map.forEach(function(value, key) {
  20206. result[++index] = [key, value];
  20207. });
  20208. return result;
  20209. }
  20210. /**
  20211. * Creates a unary function that invokes `func` with its argument transformed.
  20212. *
  20213. * @private
  20214. * @param {Function} func The function to wrap.
  20215. * @param {Function} transform The argument transform.
  20216. * @returns {Function} Returns the new function.
  20217. */
  20218. function overArg(func, transform) {
  20219. return function(arg) {
  20220. return func(transform(arg));
  20221. };
  20222. }
  20223. /**
  20224. * Replaces all `placeholder` elements in `array` with an internal placeholder
  20225. * and returns an array of their indexes.
  20226. *
  20227. * @private
  20228. * @param {Array} array The array to modify.
  20229. * @param {*} placeholder The placeholder to replace.
  20230. * @returns {Array} Returns the new array of placeholder indexes.
  20231. */
  20232. function replaceHolders(array, placeholder) {
  20233. var index = -1,
  20234. length = array.length,
  20235. resIndex = 0,
  20236. result = [];
  20237. while (++index < length) {
  20238. var value = array[index];
  20239. if (value === placeholder || value === PLACEHOLDER) {
  20240. array[index] = PLACEHOLDER;
  20241. result[resIndex++] = index;
  20242. }
  20243. }
  20244. return result;
  20245. }
  20246. /**
  20247. * Converts `set` to an array of its values.
  20248. *
  20249. * @private
  20250. * @param {Object} set The set to convert.
  20251. * @returns {Array} Returns the values.
  20252. */
  20253. function setToArray(set) {
  20254. var index = -1,
  20255. result = Array(set.size);
  20256. set.forEach(function(value) {
  20257. result[++index] = value;
  20258. });
  20259. return result;
  20260. }
  20261. /**
  20262. * Converts `set` to its value-value pairs.
  20263. *
  20264. * @private
  20265. * @param {Object} set The set to convert.
  20266. * @returns {Array} Returns the value-value pairs.
  20267. */
  20268. function setToPairs(set) {
  20269. var index = -1,
  20270. result = Array(set.size);
  20271. set.forEach(function(value) {
  20272. result[++index] = [value, value];
  20273. });
  20274. return result;
  20275. }
  20276. /**
  20277. * A specialized version of `_.indexOf` which performs strict equality
  20278. * comparisons of values, i.e. `===`.
  20279. *
  20280. * @private
  20281. * @param {Array} array The array to inspect.
  20282. * @param {*} value The value to search for.
  20283. * @param {number} fromIndex The index to search from.
  20284. * @returns {number} Returns the index of the matched value, else `-1`.
  20285. */
  20286. function strictIndexOf(array, value, fromIndex) {
  20287. var index = fromIndex - 1,
  20288. length = array.length;
  20289. while (++index < length) {
  20290. if (array[index] === value) {
  20291. return index;
  20292. }
  20293. }
  20294. return -1;
  20295. }
  20296. /**
  20297. * A specialized version of `_.lastIndexOf` which performs strict equality
  20298. * comparisons of values, i.e. `===`.
  20299. *
  20300. * @private
  20301. * @param {Array} array The array to inspect.
  20302. * @param {*} value The value to search for.
  20303. * @param {number} fromIndex The index to search from.
  20304. * @returns {number} Returns the index of the matched value, else `-1`.
  20305. */
  20306. function strictLastIndexOf(array, value, fromIndex) {
  20307. var index = fromIndex + 1;
  20308. while (index--) {
  20309. if (array[index] === value) {
  20310. return index;
  20311. }
  20312. }
  20313. return index;
  20314. }
  20315. /**
  20316. * Gets the number of symbols in `string`.
  20317. *
  20318. * @private
  20319. * @param {string} string The string to inspect.
  20320. * @returns {number} Returns the string size.
  20321. */
  20322. function stringSize(string) {
  20323. return hasUnicode(string)
  20324. ? unicodeSize(string)
  20325. : asciiSize(string);
  20326. }
  20327. /**
  20328. * Converts `string` to an array.
  20329. *
  20330. * @private
  20331. * @param {string} string The string to convert.
  20332. * @returns {Array} Returns the converted array.
  20333. */
  20334. function stringToArray(string) {
  20335. return hasUnicode(string)
  20336. ? unicodeToArray(string)
  20337. : asciiToArray(string);
  20338. }
  20339. /**
  20340. * Used by `_.unescape` to convert HTML entities to characters.
  20341. *
  20342. * @private
  20343. * @param {string} chr The matched character to unescape.
  20344. * @returns {string} Returns the unescaped character.
  20345. */
  20346. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  20347. /**
  20348. * Gets the size of a Unicode `string`.
  20349. *
  20350. * @private
  20351. * @param {string} string The string inspect.
  20352. * @returns {number} Returns the string size.
  20353. */
  20354. function unicodeSize(string) {
  20355. var result = reUnicode.lastIndex = 0;
  20356. while (reUnicode.test(string)) {
  20357. ++result;
  20358. }
  20359. return result;
  20360. }
  20361. /**
  20362. * Converts a Unicode `string` to an array.
  20363. *
  20364. * @private
  20365. * @param {string} string The string to convert.
  20366. * @returns {Array} Returns the converted array.
  20367. */
  20368. function unicodeToArray(string) {
  20369. return string.match(reUnicode) || [];
  20370. }
  20371. /**
  20372. * Splits a Unicode `string` into an array of its words.
  20373. *
  20374. * @private
  20375. * @param {string} The string to inspect.
  20376. * @returns {Array} Returns the words of `string`.
  20377. */
  20378. function unicodeWords(string) {
  20379. return string.match(reUnicodeWord) || [];
  20380. }
  20381. /*--------------------------------------------------------------------------*/
  20382. /**
  20383. * Create a new pristine `lodash` function using the `context` object.
  20384. *
  20385. * @static
  20386. * @memberOf _
  20387. * @since 1.1.0
  20388. * @category Util
  20389. * @param {Object} [context=root] The context object.
  20390. * @returns {Function} Returns a new `lodash` function.
  20391. * @example
  20392. *
  20393. * _.mixin({ 'foo': _.constant('foo') });
  20394. *
  20395. * var lodash = _.runInContext();
  20396. * lodash.mixin({ 'bar': lodash.constant('bar') });
  20397. *
  20398. * _.isFunction(_.foo);
  20399. * // => true
  20400. * _.isFunction(_.bar);
  20401. * // => false
  20402. *
  20403. * lodash.isFunction(lodash.foo);
  20404. * // => false
  20405. * lodash.isFunction(lodash.bar);
  20406. * // => true
  20407. *
  20408. * // Create a suped-up `defer` in Node.js.
  20409. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  20410. */
  20411. var runInContext = (function runInContext(context) {
  20412. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  20413. /** Built-in constructor references. */
  20414. var Array = context.Array,
  20415. Date = context.Date,
  20416. Error = context.Error,
  20417. Function = context.Function,
  20418. Math = context.Math,
  20419. Object = context.Object,
  20420. RegExp = context.RegExp,
  20421. String = context.String,
  20422. TypeError = context.TypeError;
  20423. /** Used for built-in method references. */
  20424. var arrayProto = Array.prototype,
  20425. funcProto = Function.prototype,
  20426. objectProto = Object.prototype;
  20427. /** Used to detect overreaching core-js shims. */
  20428. var coreJsData = context['__core-js_shared__'];
  20429. /** Used to resolve the decompiled source of functions. */
  20430. var funcToString = funcProto.toString;
  20431. /** Used to check objects for own properties. */
  20432. var hasOwnProperty = objectProto.hasOwnProperty;
  20433. /** Used to generate unique IDs. */
  20434. var idCounter = 0;
  20435. /** Used to detect methods masquerading as native. */
  20436. var maskSrcKey = (function() {
  20437. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  20438. return uid ? ('Symbol(src)_1.' + uid) : '';
  20439. }());
  20440. /**
  20441. * Used to resolve the
  20442. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  20443. * of values.
  20444. */
  20445. var nativeObjectToString = objectProto.toString;
  20446. /** Used to infer the `Object` constructor. */
  20447. var objectCtorString = funcToString.call(Object);
  20448. /** Used to restore the original `_` reference in `_.noConflict`. */
  20449. var oldDash = root._;
  20450. /** Used to detect if a method is native. */
  20451. var reIsNative = RegExp('^' +
  20452. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  20453. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  20454. );
  20455. /** Built-in value references. */
  20456. var Buffer = moduleExports ? context.Buffer : undefined,
  20457. Symbol = context.Symbol,
  20458. Uint8Array = context.Uint8Array,
  20459. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  20460. getPrototype = overArg(Object.getPrototypeOf, Object),
  20461. objectCreate = Object.create,
  20462. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  20463. splice = arrayProto.splice,
  20464. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  20465. symIterator = Symbol ? Symbol.iterator : undefined,
  20466. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  20467. var defineProperty = (function() {
  20468. try {
  20469. var func = getNative(Object, 'defineProperty');
  20470. func({}, '', {});
  20471. return func;
  20472. } catch (e) {}
  20473. }());
  20474. /** Mocked built-ins. */
  20475. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  20476. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  20477. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  20478. /* Built-in method references for those with the same name as other `lodash` methods. */
  20479. var nativeCeil = Math.ceil,
  20480. nativeFloor = Math.floor,
  20481. nativeGetSymbols = Object.getOwnPropertySymbols,
  20482. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  20483. nativeIsFinite = context.isFinite,
  20484. nativeJoin = arrayProto.join,
  20485. nativeKeys = overArg(Object.keys, Object),
  20486. nativeMax = Math.max,
  20487. nativeMin = Math.min,
  20488. nativeNow = Date.now,
  20489. nativeParseInt = context.parseInt,
  20490. nativeRandom = Math.random,
  20491. nativeReverse = arrayProto.reverse;
  20492. /* Built-in method references that are verified to be native. */
  20493. var DataView = getNative(context, 'DataView'),
  20494. Map = getNative(context, 'Map'),
  20495. Promise = getNative(context, 'Promise'),
  20496. Set = getNative(context, 'Set'),
  20497. WeakMap = getNative(context, 'WeakMap'),
  20498. nativeCreate = getNative(Object, 'create');
  20499. /** Used to store function metadata. */
  20500. var metaMap = WeakMap && new WeakMap;
  20501. /** Used to lookup unminified function names. */
  20502. var realNames = {};
  20503. /** Used to detect maps, sets, and weakmaps. */
  20504. var dataViewCtorString = toSource(DataView),
  20505. mapCtorString = toSource(Map),
  20506. promiseCtorString = toSource(Promise),
  20507. setCtorString = toSource(Set),
  20508. weakMapCtorString = toSource(WeakMap);
  20509. /** Used to convert symbols to primitives and strings. */
  20510. var symbolProto = Symbol ? Symbol.prototype : undefined,
  20511. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  20512. symbolToString = symbolProto ? symbolProto.toString : undefined;
  20513. /*------------------------------------------------------------------------*/
  20514. /**
  20515. * Creates a `lodash` object which wraps `value` to enable implicit method
  20516. * chain sequences. Methods that operate on and return arrays, collections,
  20517. * and functions can be chained together. Methods that retrieve a single value
  20518. * or may return a primitive value will automatically end the chain sequence
  20519. * and return the unwrapped value. Otherwise, the value must be unwrapped
  20520. * with `_#value`.
  20521. *
  20522. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  20523. * enabled using `_.chain`.
  20524. *
  20525. * The execution of chained methods is lazy, that is, it's deferred until
  20526. * `_#value` is implicitly or explicitly called.
  20527. *
  20528. * Lazy evaluation allows several methods to support shortcut fusion.
  20529. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  20530. * the creation of intermediate arrays and can greatly reduce the number of
  20531. * iteratee executions. Sections of a chain sequence qualify for shortcut
  20532. * fusion if the section is applied to an array and iteratees accept only
  20533. * one argument. The heuristic for whether a section qualifies for shortcut
  20534. * fusion is subject to change.
  20535. *
  20536. * Chaining is supported in custom builds as long as the `_#value` method is
  20537. * directly or indirectly included in the build.
  20538. *
  20539. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  20540. *
  20541. * The wrapper `Array` methods are:
  20542. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  20543. *
  20544. * The wrapper `String` methods are:
  20545. * `replace` and `split`
  20546. *
  20547. * The wrapper methods that support shortcut fusion are:
  20548. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  20549. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  20550. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  20551. *
  20552. * The chainable wrapper methods are:
  20553. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  20554. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  20555. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  20556. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  20557. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  20558. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  20559. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  20560. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  20561. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  20562. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  20563. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  20564. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  20565. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  20566. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  20567. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  20568. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  20569. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  20570. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  20571. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  20572. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  20573. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  20574. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  20575. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  20576. * `zipObject`, `zipObjectDeep`, and `zipWith`
  20577. *
  20578. * The wrapper methods that are **not** chainable by default are:
  20579. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  20580. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  20581. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  20582. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  20583. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  20584. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  20585. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  20586. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  20587. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  20588. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  20589. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  20590. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  20591. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  20592. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  20593. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  20594. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  20595. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  20596. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  20597. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  20598. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  20599. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  20600. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  20601. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  20602. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  20603. * `upperFirst`, `value`, and `words`
  20604. *
  20605. * @name _
  20606. * @constructor
  20607. * @category Seq
  20608. * @param {*} value The value to wrap in a `lodash` instance.
  20609. * @returns {Object} Returns the new `lodash` wrapper instance.
  20610. * @example
  20611. *
  20612. * function square(n) {
  20613. * return n * n;
  20614. * }
  20615. *
  20616. * var wrapped = _([1, 2, 3]);
  20617. *
  20618. * // Returns an unwrapped value.
  20619. * wrapped.reduce(_.add);
  20620. * // => 6
  20621. *
  20622. * // Returns a wrapped value.
  20623. * var squares = wrapped.map(square);
  20624. *
  20625. * _.isArray(squares);
  20626. * // => false
  20627. *
  20628. * _.isArray(squares.value());
  20629. * // => true
  20630. */
  20631. function lodash(value) {
  20632. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  20633. if (value instanceof LodashWrapper) {
  20634. return value;
  20635. }
  20636. if (hasOwnProperty.call(value, '__wrapped__')) {
  20637. return wrapperClone(value);
  20638. }
  20639. }
  20640. return new LodashWrapper(value);
  20641. }
  20642. /**
  20643. * The base implementation of `_.create` without support for assigning
  20644. * properties to the created object.
  20645. *
  20646. * @private
  20647. * @param {Object} proto The object to inherit from.
  20648. * @returns {Object} Returns the new object.
  20649. */
  20650. var baseCreate = (function() {
  20651. function object() {}
  20652. return function(proto) {
  20653. if (!isObject(proto)) {
  20654. return {};
  20655. }
  20656. if (objectCreate) {
  20657. return objectCreate(proto);
  20658. }
  20659. object.prototype = proto;
  20660. var result = new object;
  20661. object.prototype = undefined;
  20662. return result;
  20663. };
  20664. }());
  20665. /**
  20666. * The function whose prototype chain sequence wrappers inherit from.
  20667. *
  20668. * @private
  20669. */
  20670. function baseLodash() {
  20671. // No operation performed.
  20672. }
  20673. /**
  20674. * The base constructor for creating `lodash` wrapper objects.
  20675. *
  20676. * @private
  20677. * @param {*} value The value to wrap.
  20678. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  20679. */
  20680. function LodashWrapper(value, chainAll) {
  20681. this.__wrapped__ = value;
  20682. this.__actions__ = [];
  20683. this.__chain__ = !!chainAll;
  20684. this.__index__ = 0;
  20685. this.__values__ = undefined;
  20686. }
  20687. /**
  20688. * By default, the template delimiters used by lodash are like those in
  20689. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  20690. * following template settings to use alternative delimiters.
  20691. *
  20692. * @static
  20693. * @memberOf _
  20694. * @type {Object}
  20695. */
  20696. lodash.templateSettings = {
  20697. /**
  20698. * Used to detect `data` property values to be HTML-escaped.
  20699. *
  20700. * @memberOf _.templateSettings
  20701. * @type {RegExp}
  20702. */
  20703. 'escape': reEscape,
  20704. /**
  20705. * Used to detect code to be evaluated.
  20706. *
  20707. * @memberOf _.templateSettings
  20708. * @type {RegExp}
  20709. */
  20710. 'evaluate': reEvaluate,
  20711. /**
  20712. * Used to detect `data` property values to inject.
  20713. *
  20714. * @memberOf _.templateSettings
  20715. * @type {RegExp}
  20716. */
  20717. 'interpolate': reInterpolate,
  20718. /**
  20719. * Used to reference the data object in the template text.
  20720. *
  20721. * @memberOf _.templateSettings
  20722. * @type {string}
  20723. */
  20724. 'variable': '',
  20725. /**
  20726. * Used to import variables into the compiled template.
  20727. *
  20728. * @memberOf _.templateSettings
  20729. * @type {Object}
  20730. */
  20731. 'imports': {
  20732. /**
  20733. * A reference to the `lodash` function.
  20734. *
  20735. * @memberOf _.templateSettings.imports
  20736. * @type {Function}
  20737. */
  20738. '_': lodash
  20739. }
  20740. };
  20741. // Ensure wrappers are instances of `baseLodash`.
  20742. lodash.prototype = baseLodash.prototype;
  20743. lodash.prototype.constructor = lodash;
  20744. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  20745. LodashWrapper.prototype.constructor = LodashWrapper;
  20746. /*------------------------------------------------------------------------*/
  20747. /**
  20748. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  20749. *
  20750. * @private
  20751. * @constructor
  20752. * @param {*} value The value to wrap.
  20753. */
  20754. function LazyWrapper(value) {
  20755. this.__wrapped__ = value;
  20756. this.__actions__ = [];
  20757. this.__dir__ = 1;
  20758. this.__filtered__ = false;
  20759. this.__iteratees__ = [];
  20760. this.__takeCount__ = MAX_ARRAY_LENGTH;
  20761. this.__views__ = [];
  20762. }
  20763. /**
  20764. * Creates a clone of the lazy wrapper object.
  20765. *
  20766. * @private
  20767. * @name clone
  20768. * @memberOf LazyWrapper
  20769. * @returns {Object} Returns the cloned `LazyWrapper` object.
  20770. */
  20771. function lazyClone() {
  20772. var result = new LazyWrapper(this.__wrapped__);
  20773. result.__actions__ = copyArray(this.__actions__);
  20774. result.__dir__ = this.__dir__;
  20775. result.__filtered__ = this.__filtered__;
  20776. result.__iteratees__ = copyArray(this.__iteratees__);
  20777. result.__takeCount__ = this.__takeCount__;
  20778. result.__views__ = copyArray(this.__views__);
  20779. return result;
  20780. }
  20781. /**
  20782. * Reverses the direction of lazy iteration.
  20783. *
  20784. * @private
  20785. * @name reverse
  20786. * @memberOf LazyWrapper
  20787. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  20788. */
  20789. function lazyReverse() {
  20790. if (this.__filtered__) {
  20791. var result = new LazyWrapper(this);
  20792. result.__dir__ = -1;
  20793. result.__filtered__ = true;
  20794. } else {
  20795. result = this.clone();
  20796. result.__dir__ *= -1;
  20797. }
  20798. return result;
  20799. }
  20800. /**
  20801. * Extracts the unwrapped value from its lazy wrapper.
  20802. *
  20803. * @private
  20804. * @name value
  20805. * @memberOf LazyWrapper
  20806. * @returns {*} Returns the unwrapped value.
  20807. */
  20808. function lazyValue() {
  20809. var array = this.__wrapped__.value(),
  20810. dir = this.__dir__,
  20811. isArr = isArray(array),
  20812. isRight = dir < 0,
  20813. arrLength = isArr ? array.length : 0,
  20814. view = getView(0, arrLength, this.__views__),
  20815. start = view.start,
  20816. end = view.end,
  20817. length = end - start,
  20818. index = isRight ? end : (start - 1),
  20819. iteratees = this.__iteratees__,
  20820. iterLength = iteratees.length,
  20821. resIndex = 0,
  20822. takeCount = nativeMin(length, this.__takeCount__);
  20823. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  20824. return baseWrapperValue(array, this.__actions__);
  20825. }
  20826. var result = [];
  20827. outer:
  20828. while (length-- && resIndex < takeCount) {
  20829. index += dir;
  20830. var iterIndex = -1,
  20831. value = array[index];
  20832. while (++iterIndex < iterLength) {
  20833. var data = iteratees[iterIndex],
  20834. iteratee = data.iteratee,
  20835. type = data.type,
  20836. computed = iteratee(value);
  20837. if (type == LAZY_MAP_FLAG) {
  20838. value = computed;
  20839. } else if (!computed) {
  20840. if (type == LAZY_FILTER_FLAG) {
  20841. continue outer;
  20842. } else {
  20843. break outer;
  20844. }
  20845. }
  20846. }
  20847. result[resIndex++] = value;
  20848. }
  20849. return result;
  20850. }
  20851. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  20852. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  20853. LazyWrapper.prototype.constructor = LazyWrapper;
  20854. /*------------------------------------------------------------------------*/
  20855. /**
  20856. * Creates a hash object.
  20857. *
  20858. * @private
  20859. * @constructor
  20860. * @param {Array} [entries] The key-value pairs to cache.
  20861. */
  20862. function Hash(entries) {
  20863. var index = -1,
  20864. length = entries == null ? 0 : entries.length;
  20865. this.clear();
  20866. while (++index < length) {
  20867. var entry = entries[index];
  20868. this.set(entry[0], entry[1]);
  20869. }
  20870. }
  20871. /**
  20872. * Removes all key-value entries from the hash.
  20873. *
  20874. * @private
  20875. * @name clear
  20876. * @memberOf Hash
  20877. */
  20878. function hashClear() {
  20879. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  20880. this.size = 0;
  20881. }
  20882. /**
  20883. * Removes `key` and its value from the hash.
  20884. *
  20885. * @private
  20886. * @name delete
  20887. * @memberOf Hash
  20888. * @param {Object} hash The hash to modify.
  20889. * @param {string} key The key of the value to remove.
  20890. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  20891. */
  20892. function hashDelete(key) {
  20893. var result = this.has(key) && delete this.__data__[key];
  20894. this.size -= result ? 1 : 0;
  20895. return result;
  20896. }
  20897. /**
  20898. * Gets the hash value for `key`.
  20899. *
  20900. * @private
  20901. * @name get
  20902. * @memberOf Hash
  20903. * @param {string} key The key of the value to get.
  20904. * @returns {*} Returns the entry value.
  20905. */
  20906. function hashGet(key) {
  20907. var data = this.__data__;
  20908. if (nativeCreate) {
  20909. var result = data[key];
  20910. return result === HASH_UNDEFINED ? undefined : result;
  20911. }
  20912. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  20913. }
  20914. /**
  20915. * Checks if a hash value for `key` exists.
  20916. *
  20917. * @private
  20918. * @name has
  20919. * @memberOf Hash
  20920. * @param {string} key The key of the entry to check.
  20921. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  20922. */
  20923. function hashHas(key) {
  20924. var data = this.__data__;
  20925. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  20926. }
  20927. /**
  20928. * Sets the hash `key` to `value`.
  20929. *
  20930. * @private
  20931. * @name set
  20932. * @memberOf Hash
  20933. * @param {string} key The key of the value to set.
  20934. * @param {*} value The value to set.
  20935. * @returns {Object} Returns the hash instance.
  20936. */
  20937. function hashSet(key, value) {
  20938. var data = this.__data__;
  20939. this.size += this.has(key) ? 0 : 1;
  20940. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  20941. return this;
  20942. }
  20943. // Add methods to `Hash`.
  20944. Hash.prototype.clear = hashClear;
  20945. Hash.prototype['delete'] = hashDelete;
  20946. Hash.prototype.get = hashGet;
  20947. Hash.prototype.has = hashHas;
  20948. Hash.prototype.set = hashSet;
  20949. /*------------------------------------------------------------------------*/
  20950. /**
  20951. * Creates an list cache object.
  20952. *
  20953. * @private
  20954. * @constructor
  20955. * @param {Array} [entries] The key-value pairs to cache.
  20956. */
  20957. function ListCache(entries) {
  20958. var index = -1,
  20959. length = entries == null ? 0 : entries.length;
  20960. this.clear();
  20961. while (++index < length) {
  20962. var entry = entries[index];
  20963. this.set(entry[0], entry[1]);
  20964. }
  20965. }
  20966. /**
  20967. * Removes all key-value entries from the list cache.
  20968. *
  20969. * @private
  20970. * @name clear
  20971. * @memberOf ListCache
  20972. */
  20973. function listCacheClear() {
  20974. this.__data__ = [];
  20975. this.size = 0;
  20976. }
  20977. /**
  20978. * Removes `key` and its value from the list cache.
  20979. *
  20980. * @private
  20981. * @name delete
  20982. * @memberOf ListCache
  20983. * @param {string} key The key of the value to remove.
  20984. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  20985. */
  20986. function listCacheDelete(key) {
  20987. var data = this.__data__,
  20988. index = assocIndexOf(data, key);
  20989. if (index < 0) {
  20990. return false;
  20991. }
  20992. var lastIndex = data.length - 1;
  20993. if (index == lastIndex) {
  20994. data.pop();
  20995. } else {
  20996. splice.call(data, index, 1);
  20997. }
  20998. --this.size;
  20999. return true;
  21000. }
  21001. /**
  21002. * Gets the list cache value for `key`.
  21003. *
  21004. * @private
  21005. * @name get
  21006. * @memberOf ListCache
  21007. * @param {string} key The key of the value to get.
  21008. * @returns {*} Returns the entry value.
  21009. */
  21010. function listCacheGet(key) {
  21011. var data = this.__data__,
  21012. index = assocIndexOf(data, key);
  21013. return index < 0 ? undefined : data[index][1];
  21014. }
  21015. /**
  21016. * Checks if a list cache value for `key` exists.
  21017. *
  21018. * @private
  21019. * @name has
  21020. * @memberOf ListCache
  21021. * @param {string} key The key of the entry to check.
  21022. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  21023. */
  21024. function listCacheHas(key) {
  21025. return assocIndexOf(this.__data__, key) > -1;
  21026. }
  21027. /**
  21028. * Sets the list cache `key` to `value`.
  21029. *
  21030. * @private
  21031. * @name set
  21032. * @memberOf ListCache
  21033. * @param {string} key The key of the value to set.
  21034. * @param {*} value The value to set.
  21035. * @returns {Object} Returns the list cache instance.
  21036. */
  21037. function listCacheSet(key, value) {
  21038. var data = this.__data__,
  21039. index = assocIndexOf(data, key);
  21040. if (index < 0) {
  21041. ++this.size;
  21042. data.push([key, value]);
  21043. } else {
  21044. data[index][1] = value;
  21045. }
  21046. return this;
  21047. }
  21048. // Add methods to `ListCache`.
  21049. ListCache.prototype.clear = listCacheClear;
  21050. ListCache.prototype['delete'] = listCacheDelete;
  21051. ListCache.prototype.get = listCacheGet;
  21052. ListCache.prototype.has = listCacheHas;
  21053. ListCache.prototype.set = listCacheSet;
  21054. /*------------------------------------------------------------------------*/
  21055. /**
  21056. * Creates a map cache object to store key-value pairs.
  21057. *
  21058. * @private
  21059. * @constructor
  21060. * @param {Array} [entries] The key-value pairs to cache.
  21061. */
  21062. function MapCache(entries) {
  21063. var index = -1,
  21064. length = entries == null ? 0 : entries.length;
  21065. this.clear();
  21066. while (++index < length) {
  21067. var entry = entries[index];
  21068. this.set(entry[0], entry[1]);
  21069. }
  21070. }
  21071. /**
  21072. * Removes all key-value entries from the map.
  21073. *
  21074. * @private
  21075. * @name clear
  21076. * @memberOf MapCache
  21077. */
  21078. function mapCacheClear() {
  21079. this.size = 0;
  21080. this.__data__ = {
  21081. 'hash': new Hash,
  21082. 'map': new (Map || ListCache),
  21083. 'string': new Hash
  21084. };
  21085. }
  21086. /**
  21087. * Removes `key` and its value from the map.
  21088. *
  21089. * @private
  21090. * @name delete
  21091. * @memberOf MapCache
  21092. * @param {string} key The key of the value to remove.
  21093. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  21094. */
  21095. function mapCacheDelete(key) {
  21096. var result = getMapData(this, key)['delete'](key);
  21097. this.size -= result ? 1 : 0;
  21098. return result;
  21099. }
  21100. /**
  21101. * Gets the map value for `key`.
  21102. *
  21103. * @private
  21104. * @name get
  21105. * @memberOf MapCache
  21106. * @param {string} key The key of the value to get.
  21107. * @returns {*} Returns the entry value.
  21108. */
  21109. function mapCacheGet(key) {
  21110. return getMapData(this, key).get(key);
  21111. }
  21112. /**
  21113. * Checks if a map value for `key` exists.
  21114. *
  21115. * @private
  21116. * @name has
  21117. * @memberOf MapCache
  21118. * @param {string} key The key of the entry to check.
  21119. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  21120. */
  21121. function mapCacheHas(key) {
  21122. return getMapData(this, key).has(key);
  21123. }
  21124. /**
  21125. * Sets the map `key` to `value`.
  21126. *
  21127. * @private
  21128. * @name set
  21129. * @memberOf MapCache
  21130. * @param {string} key The key of the value to set.
  21131. * @param {*} value The value to set.
  21132. * @returns {Object} Returns the map cache instance.
  21133. */
  21134. function mapCacheSet(key, value) {
  21135. var data = getMapData(this, key),
  21136. size = data.size;
  21137. data.set(key, value);
  21138. this.size += data.size == size ? 0 : 1;
  21139. return this;
  21140. }
  21141. // Add methods to `MapCache`.
  21142. MapCache.prototype.clear = mapCacheClear;
  21143. MapCache.prototype['delete'] = mapCacheDelete;
  21144. MapCache.prototype.get = mapCacheGet;
  21145. MapCache.prototype.has = mapCacheHas;
  21146. MapCache.prototype.set = mapCacheSet;
  21147. /*------------------------------------------------------------------------*/
  21148. /**
  21149. *
  21150. * Creates an array cache object to store unique values.
  21151. *
  21152. * @private
  21153. * @constructor
  21154. * @param {Array} [values] The values to cache.
  21155. */
  21156. function SetCache(values) {
  21157. var index = -1,
  21158. length = values == null ? 0 : values.length;
  21159. this.__data__ = new MapCache;
  21160. while (++index < length) {
  21161. this.add(values[index]);
  21162. }
  21163. }
  21164. /**
  21165. * Adds `value` to the array cache.
  21166. *
  21167. * @private
  21168. * @name add
  21169. * @memberOf SetCache
  21170. * @alias push
  21171. * @param {*} value The value to cache.
  21172. * @returns {Object} Returns the cache instance.
  21173. */
  21174. function setCacheAdd(value) {
  21175. this.__data__.set(value, HASH_UNDEFINED);
  21176. return this;
  21177. }
  21178. /**
  21179. * Checks if `value` is in the array cache.
  21180. *
  21181. * @private
  21182. * @name has
  21183. * @memberOf SetCache
  21184. * @param {*} value The value to search for.
  21185. * @returns {number} Returns `true` if `value` is found, else `false`.
  21186. */
  21187. function setCacheHas(value) {
  21188. return this.__data__.has(value);
  21189. }
  21190. // Add methods to `SetCache`.
  21191. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  21192. SetCache.prototype.has = setCacheHas;
  21193. /*------------------------------------------------------------------------*/
  21194. /**
  21195. * Creates a stack cache object to store key-value pairs.
  21196. *
  21197. * @private
  21198. * @constructor
  21199. * @param {Array} [entries] The key-value pairs to cache.
  21200. */
  21201. function Stack(entries) {
  21202. var data = this.__data__ = new ListCache(entries);
  21203. this.size = data.size;
  21204. }
  21205. /**
  21206. * Removes all key-value entries from the stack.
  21207. *
  21208. * @private
  21209. * @name clear
  21210. * @memberOf Stack
  21211. */
  21212. function stackClear() {
  21213. this.__data__ = new ListCache;
  21214. this.size = 0;
  21215. }
  21216. /**
  21217. * Removes `key` and its value from the stack.
  21218. *
  21219. * @private
  21220. * @name delete
  21221. * @memberOf Stack
  21222. * @param {string} key The key of the value to remove.
  21223. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  21224. */
  21225. function stackDelete(key) {
  21226. var data = this.__data__,
  21227. result = data['delete'](key);
  21228. this.size = data.size;
  21229. return result;
  21230. }
  21231. /**
  21232. * Gets the stack value for `key`.
  21233. *
  21234. * @private
  21235. * @name get
  21236. * @memberOf Stack
  21237. * @param {string} key The key of the value to get.
  21238. * @returns {*} Returns the entry value.
  21239. */
  21240. function stackGet(key) {
  21241. return this.__data__.get(key);
  21242. }
  21243. /**
  21244. * Checks if a stack value for `key` exists.
  21245. *
  21246. * @private
  21247. * @name has
  21248. * @memberOf Stack
  21249. * @param {string} key The key of the entry to check.
  21250. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  21251. */
  21252. function stackHas(key) {
  21253. return this.__data__.has(key);
  21254. }
  21255. /**
  21256. * Sets the stack `key` to `value`.
  21257. *
  21258. * @private
  21259. * @name set
  21260. * @memberOf Stack
  21261. * @param {string} key The key of the value to set.
  21262. * @param {*} value The value to set.
  21263. * @returns {Object} Returns the stack cache instance.
  21264. */
  21265. function stackSet(key, value) {
  21266. var data = this.__data__;
  21267. if (data instanceof ListCache) {
  21268. var pairs = data.__data__;
  21269. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  21270. pairs.push([key, value]);
  21271. this.size = ++data.size;
  21272. return this;
  21273. }
  21274. data = this.__data__ = new MapCache(pairs);
  21275. }
  21276. data.set(key, value);
  21277. this.size = data.size;
  21278. return this;
  21279. }
  21280. // Add methods to `Stack`.
  21281. Stack.prototype.clear = stackClear;
  21282. Stack.prototype['delete'] = stackDelete;
  21283. Stack.prototype.get = stackGet;
  21284. Stack.prototype.has = stackHas;
  21285. Stack.prototype.set = stackSet;
  21286. /*------------------------------------------------------------------------*/
  21287. /**
  21288. * Creates an array of the enumerable property names of the array-like `value`.
  21289. *
  21290. * @private
  21291. * @param {*} value The value to query.
  21292. * @param {boolean} inherited Specify returning inherited property names.
  21293. * @returns {Array} Returns the array of property names.
  21294. */
  21295. function arrayLikeKeys(value, inherited) {
  21296. var isArr = isArray(value),
  21297. isArg = !isArr && isArguments(value),
  21298. isBuff = !isArr && !isArg && isBuffer(value),
  21299. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  21300. skipIndexes = isArr || isArg || isBuff || isType,
  21301. result = skipIndexes ? baseTimes(value.length, String) : [],
  21302. length = result.length;
  21303. for (var key in value) {
  21304. if ((inherited || hasOwnProperty.call(value, key)) &&
  21305. !(skipIndexes && (
  21306. // Safari 9 has enumerable `arguments.length` in strict mode.
  21307. key == 'length' ||
  21308. // Node.js 0.10 has enumerable non-index properties on buffers.
  21309. (isBuff && (key == 'offset' || key == 'parent')) ||
  21310. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  21311. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  21312. // Skip index properties.
  21313. isIndex(key, length)
  21314. ))) {
  21315. result.push(key);
  21316. }
  21317. }
  21318. return result;
  21319. }
  21320. /**
  21321. * A specialized version of `_.sample` for arrays.
  21322. *
  21323. * @private
  21324. * @param {Array} array The array to sample.
  21325. * @returns {*} Returns the random element.
  21326. */
  21327. function arraySample(array) {
  21328. var length = array.length;
  21329. return length ? array[baseRandom(0, length - 1)] : undefined;
  21330. }
  21331. /**
  21332. * A specialized version of `_.sampleSize` for arrays.
  21333. *
  21334. * @private
  21335. * @param {Array} array The array to sample.
  21336. * @param {number} n The number of elements to sample.
  21337. * @returns {Array} Returns the random elements.
  21338. */
  21339. function arraySampleSize(array, n) {
  21340. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  21341. }
  21342. /**
  21343. * A specialized version of `_.shuffle` for arrays.
  21344. *
  21345. * @private
  21346. * @param {Array} array The array to shuffle.
  21347. * @returns {Array} Returns the new shuffled array.
  21348. */
  21349. function arrayShuffle(array) {
  21350. return shuffleSelf(copyArray(array));
  21351. }
  21352. /**
  21353. * This function is like `assignValue` except that it doesn't assign
  21354. * `undefined` values.
  21355. *
  21356. * @private
  21357. * @param {Object} object The object to modify.
  21358. * @param {string} key The key of the property to assign.
  21359. * @param {*} value The value to assign.
  21360. */
  21361. function assignMergeValue(object, key, value) {
  21362. if ((value !== undefined && !eq(object[key], value)) ||
  21363. (value === undefined && !(key in object))) {
  21364. baseAssignValue(object, key, value);
  21365. }
  21366. }
  21367. /**
  21368. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  21369. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  21370. * for equality comparisons.
  21371. *
  21372. * @private
  21373. * @param {Object} object The object to modify.
  21374. * @param {string} key The key of the property to assign.
  21375. * @param {*} value The value to assign.
  21376. */
  21377. function assignValue(object, key, value) {
  21378. var objValue = object[key];
  21379. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  21380. (value === undefined && !(key in object))) {
  21381. baseAssignValue(object, key, value);
  21382. }
  21383. }
  21384. /**
  21385. * Gets the index at which the `key` is found in `array` of key-value pairs.
  21386. *
  21387. * @private
  21388. * @param {Array} array The array to inspect.
  21389. * @param {*} key The key to search for.
  21390. * @returns {number} Returns the index of the matched value, else `-1`.
  21391. */
  21392. function assocIndexOf(array, key) {
  21393. var length = array.length;
  21394. while (length--) {
  21395. if (eq(array[length][0], key)) {
  21396. return length;
  21397. }
  21398. }
  21399. return -1;
  21400. }
  21401. /**
  21402. * Aggregates elements of `collection` on `accumulator` with keys transformed
  21403. * by `iteratee` and values set by `setter`.
  21404. *
  21405. * @private
  21406. * @param {Array|Object} collection The collection to iterate over.
  21407. * @param {Function} setter The function to set `accumulator` values.
  21408. * @param {Function} iteratee The iteratee to transform keys.
  21409. * @param {Object} accumulator The initial aggregated object.
  21410. * @returns {Function} Returns `accumulator`.
  21411. */
  21412. function baseAggregator(collection, setter, iteratee, accumulator) {
  21413. baseEach(collection, function(value, key, collection) {
  21414. setter(accumulator, value, iteratee(value), collection);
  21415. });
  21416. return accumulator;
  21417. }
  21418. /**
  21419. * The base implementation of `_.assign` without support for multiple sources
  21420. * or `customizer` functions.
  21421. *
  21422. * @private
  21423. * @param {Object} object The destination object.
  21424. * @param {Object} source The source object.
  21425. * @returns {Object} Returns `object`.
  21426. */
  21427. function baseAssign(object, source) {
  21428. return object && copyObject(source, keys(source), object);
  21429. }
  21430. /**
  21431. * The base implementation of `_.assignIn` without support for multiple sources
  21432. * or `customizer` functions.
  21433. *
  21434. * @private
  21435. * @param {Object} object The destination object.
  21436. * @param {Object} source The source object.
  21437. * @returns {Object} Returns `object`.
  21438. */
  21439. function baseAssignIn(object, source) {
  21440. return object && copyObject(source, keysIn(source), object);
  21441. }
  21442. /**
  21443. * The base implementation of `assignValue` and `assignMergeValue` without
  21444. * value checks.
  21445. *
  21446. * @private
  21447. * @param {Object} object The object to modify.
  21448. * @param {string} key The key of the property to assign.
  21449. * @param {*} value The value to assign.
  21450. */
  21451. function baseAssignValue(object, key, value) {
  21452. if (key == '__proto__' && defineProperty) {
  21453. defineProperty(object, key, {
  21454. 'configurable': true,
  21455. 'enumerable': true,
  21456. 'value': value,
  21457. 'writable': true
  21458. });
  21459. } else {
  21460. object[key] = value;
  21461. }
  21462. }
  21463. /**
  21464. * The base implementation of `_.at` without support for individual paths.
  21465. *
  21466. * @private
  21467. * @param {Object} object The object to iterate over.
  21468. * @param {string[]} paths The property paths to pick.
  21469. * @returns {Array} Returns the picked elements.
  21470. */
  21471. function baseAt(object, paths) {
  21472. var index = -1,
  21473. length = paths.length,
  21474. result = Array(length),
  21475. skip = object == null;
  21476. while (++index < length) {
  21477. result[index] = skip ? undefined : get(object, paths[index]);
  21478. }
  21479. return result;
  21480. }
  21481. /**
  21482. * The base implementation of `_.clamp` which doesn't coerce arguments.
  21483. *
  21484. * @private
  21485. * @param {number} number The number to clamp.
  21486. * @param {number} [lower] The lower bound.
  21487. * @param {number} upper The upper bound.
  21488. * @returns {number} Returns the clamped number.
  21489. */
  21490. function baseClamp(number, lower, upper) {
  21491. if (number === number) {
  21492. if (upper !== undefined) {
  21493. number = number <= upper ? number : upper;
  21494. }
  21495. if (lower !== undefined) {
  21496. number = number >= lower ? number : lower;
  21497. }
  21498. }
  21499. return number;
  21500. }
  21501. /**
  21502. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  21503. * traversed objects.
  21504. *
  21505. * @private
  21506. * @param {*} value The value to clone.
  21507. * @param {boolean} bitmask The bitmask flags.
  21508. * 1 - Deep clone
  21509. * 2 - Flatten inherited properties
  21510. * 4 - Clone symbols
  21511. * @param {Function} [customizer] The function to customize cloning.
  21512. * @param {string} [key] The key of `value`.
  21513. * @param {Object} [object] The parent object of `value`.
  21514. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  21515. * @returns {*} Returns the cloned value.
  21516. */
  21517. function baseClone(value, bitmask, customizer, key, object, stack) {
  21518. var result,
  21519. isDeep = bitmask & CLONE_DEEP_FLAG,
  21520. isFlat = bitmask & CLONE_FLAT_FLAG,
  21521. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  21522. if (customizer) {
  21523. result = object ? customizer(value, key, object, stack) : customizer(value);
  21524. }
  21525. if (result !== undefined) {
  21526. return result;
  21527. }
  21528. if (!isObject(value)) {
  21529. return value;
  21530. }
  21531. var isArr = isArray(value);
  21532. if (isArr) {
  21533. result = initCloneArray(value);
  21534. if (!isDeep) {
  21535. return copyArray(value, result);
  21536. }
  21537. } else {
  21538. var tag = getTag(value),
  21539. isFunc = tag == funcTag || tag == genTag;
  21540. if (isBuffer(value)) {
  21541. return cloneBuffer(value, isDeep);
  21542. }
  21543. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  21544. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  21545. if (!isDeep) {
  21546. return isFlat
  21547. ? copySymbolsIn(value, baseAssignIn(result, value))
  21548. : copySymbols(value, baseAssign(result, value));
  21549. }
  21550. } else {
  21551. if (!cloneableTags[tag]) {
  21552. return object ? value : {};
  21553. }
  21554. result = initCloneByTag(value, tag, isDeep);
  21555. }
  21556. }
  21557. // Check for circular references and return its corresponding clone.
  21558. stack || (stack = new Stack);
  21559. var stacked = stack.get(value);
  21560. if (stacked) {
  21561. return stacked;
  21562. }
  21563. stack.set(value, result);
  21564. if (isSet(value)) {
  21565. value.forEach(function(subValue) {
  21566. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  21567. });
  21568. } else if (isMap(value)) {
  21569. value.forEach(function(subValue, key) {
  21570. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  21571. });
  21572. }
  21573. var keysFunc = isFull
  21574. ? (isFlat ? getAllKeysIn : getAllKeys)
  21575. : (isFlat ? keysIn : keys);
  21576. var props = isArr ? undefined : keysFunc(value);
  21577. arrayEach(props || value, function(subValue, key) {
  21578. if (props) {
  21579. key = subValue;
  21580. subValue = value[key];
  21581. }
  21582. // Recursively populate clone (susceptible to call stack limits).
  21583. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  21584. });
  21585. return result;
  21586. }
  21587. /**
  21588. * The base implementation of `_.conforms` which doesn't clone `source`.
  21589. *
  21590. * @private
  21591. * @param {Object} source The object of property predicates to conform to.
  21592. * @returns {Function} Returns the new spec function.
  21593. */
  21594. function baseConforms(source) {
  21595. var props = keys(source);
  21596. return function(object) {
  21597. return baseConformsTo(object, source, props);
  21598. };
  21599. }
  21600. /**
  21601. * The base implementation of `_.conformsTo` which accepts `props` to check.
  21602. *
  21603. * @private
  21604. * @param {Object} object The object to inspect.
  21605. * @param {Object} source The object of property predicates to conform to.
  21606. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  21607. */
  21608. function baseConformsTo(object, source, props) {
  21609. var length = props.length;
  21610. if (object == null) {
  21611. return !length;
  21612. }
  21613. object = Object(object);
  21614. while (length--) {
  21615. var key = props[length],
  21616. predicate = source[key],
  21617. value = object[key];
  21618. if ((value === undefined && !(key in object)) || !predicate(value)) {
  21619. return false;
  21620. }
  21621. }
  21622. return true;
  21623. }
  21624. /**
  21625. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  21626. * to provide to `func`.
  21627. *
  21628. * @private
  21629. * @param {Function} func The function to delay.
  21630. * @param {number} wait The number of milliseconds to delay invocation.
  21631. * @param {Array} args The arguments to provide to `func`.
  21632. * @returns {number|Object} Returns the timer id or timeout object.
  21633. */
  21634. function baseDelay(func, wait, args) {
  21635. if (typeof func != 'function') {
  21636. throw new TypeError(FUNC_ERROR_TEXT);
  21637. }
  21638. return setTimeout(function() { func.apply(undefined, args); }, wait);
  21639. }
  21640. /**
  21641. * The base implementation of methods like `_.difference` without support
  21642. * for excluding multiple arrays or iteratee shorthands.
  21643. *
  21644. * @private
  21645. * @param {Array} array The array to inspect.
  21646. * @param {Array} values The values to exclude.
  21647. * @param {Function} [iteratee] The iteratee invoked per element.
  21648. * @param {Function} [comparator] The comparator invoked per element.
  21649. * @returns {Array} Returns the new array of filtered values.
  21650. */
  21651. function baseDifference(array, values, iteratee, comparator) {
  21652. var index = -1,
  21653. includes = arrayIncludes,
  21654. isCommon = true,
  21655. length = array.length,
  21656. result = [],
  21657. valuesLength = values.length;
  21658. if (!length) {
  21659. return result;
  21660. }
  21661. if (iteratee) {
  21662. values = arrayMap(values, baseUnary(iteratee));
  21663. }
  21664. if (comparator) {
  21665. includes = arrayIncludesWith;
  21666. isCommon = false;
  21667. }
  21668. else if (values.length >= LARGE_ARRAY_SIZE) {
  21669. includes = cacheHas;
  21670. isCommon = false;
  21671. values = new SetCache(values);
  21672. }
  21673. outer:
  21674. while (++index < length) {
  21675. var value = array[index],
  21676. computed = iteratee == null ? value : iteratee(value);
  21677. value = (comparator || value !== 0) ? value : 0;
  21678. if (isCommon && computed === computed) {
  21679. var valuesIndex = valuesLength;
  21680. while (valuesIndex--) {
  21681. if (values[valuesIndex] === computed) {
  21682. continue outer;
  21683. }
  21684. }
  21685. result.push(value);
  21686. }
  21687. else if (!includes(values, computed, comparator)) {
  21688. result.push(value);
  21689. }
  21690. }
  21691. return result;
  21692. }
  21693. /**
  21694. * The base implementation of `_.forEach` without support for iteratee shorthands.
  21695. *
  21696. * @private
  21697. * @param {Array|Object} collection The collection to iterate over.
  21698. * @param {Function} iteratee The function invoked per iteration.
  21699. * @returns {Array|Object} Returns `collection`.
  21700. */
  21701. var baseEach = createBaseEach(baseForOwn);
  21702. /**
  21703. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  21704. *
  21705. * @private
  21706. * @param {Array|Object} collection The collection to iterate over.
  21707. * @param {Function} iteratee The function invoked per iteration.
  21708. * @returns {Array|Object} Returns `collection`.
  21709. */
  21710. var baseEachRight = createBaseEach(baseForOwnRight, true);
  21711. /**
  21712. * The base implementation of `_.every` without support for iteratee shorthands.
  21713. *
  21714. * @private
  21715. * @param {Array|Object} collection The collection to iterate over.
  21716. * @param {Function} predicate The function invoked per iteration.
  21717. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  21718. * else `false`
  21719. */
  21720. function baseEvery(collection, predicate) {
  21721. var result = true;
  21722. baseEach(collection, function(value, index, collection) {
  21723. result = !!predicate(value, index, collection);
  21724. return result;
  21725. });
  21726. return result;
  21727. }
  21728. /**
  21729. * The base implementation of methods like `_.max` and `_.min` which accepts a
  21730. * `comparator` to determine the extremum value.
  21731. *
  21732. * @private
  21733. * @param {Array} array The array to iterate over.
  21734. * @param {Function} iteratee The iteratee invoked per iteration.
  21735. * @param {Function} comparator The comparator used to compare values.
  21736. * @returns {*} Returns the extremum value.
  21737. */
  21738. function baseExtremum(array, iteratee, comparator) {
  21739. var index = -1,
  21740. length = array.length;
  21741. while (++index < length) {
  21742. var value = array[index],
  21743. current = iteratee(value);
  21744. if (current != null && (computed === undefined
  21745. ? (current === current && !isSymbol(current))
  21746. : comparator(current, computed)
  21747. )) {
  21748. var computed = current,
  21749. result = value;
  21750. }
  21751. }
  21752. return result;
  21753. }
  21754. /**
  21755. * The base implementation of `_.fill` without an iteratee call guard.
  21756. *
  21757. * @private
  21758. * @param {Array} array The array to fill.
  21759. * @param {*} value The value to fill `array` with.
  21760. * @param {number} [start=0] The start position.
  21761. * @param {number} [end=array.length] The end position.
  21762. * @returns {Array} Returns `array`.
  21763. */
  21764. function baseFill(array, value, start, end) {
  21765. var length = array.length;
  21766. start = toInteger(start);
  21767. if (start < 0) {
  21768. start = -start > length ? 0 : (length + start);
  21769. }
  21770. end = (end === undefined || end > length) ? length : toInteger(end);
  21771. if (end < 0) {
  21772. end += length;
  21773. }
  21774. end = start > end ? 0 : toLength(end);
  21775. while (start < end) {
  21776. array[start++] = value;
  21777. }
  21778. return array;
  21779. }
  21780. /**
  21781. * The base implementation of `_.filter` without support for iteratee shorthands.
  21782. *
  21783. * @private
  21784. * @param {Array|Object} collection The collection to iterate over.
  21785. * @param {Function} predicate The function invoked per iteration.
  21786. * @returns {Array} Returns the new filtered array.
  21787. */
  21788. function baseFilter(collection, predicate) {
  21789. var result = [];
  21790. baseEach(collection, function(value, index, collection) {
  21791. if (predicate(value, index, collection)) {
  21792. result.push(value);
  21793. }
  21794. });
  21795. return result;
  21796. }
  21797. /**
  21798. * The base implementation of `_.flatten` with support for restricting flattening.
  21799. *
  21800. * @private
  21801. * @param {Array} array The array to flatten.
  21802. * @param {number} depth The maximum recursion depth.
  21803. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  21804. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  21805. * @param {Array} [result=[]] The initial result value.
  21806. * @returns {Array} Returns the new flattened array.
  21807. */
  21808. function baseFlatten(array, depth, predicate, isStrict, result) {
  21809. var index = -1,
  21810. length = array.length;
  21811. predicate || (predicate = isFlattenable);
  21812. result || (result = []);
  21813. while (++index < length) {
  21814. var value = array[index];
  21815. if (depth > 0 && predicate(value)) {
  21816. if (depth > 1) {
  21817. // Recursively flatten arrays (susceptible to call stack limits).
  21818. baseFlatten(value, depth - 1, predicate, isStrict, result);
  21819. } else {
  21820. arrayPush(result, value);
  21821. }
  21822. } else if (!isStrict) {
  21823. result[result.length] = value;
  21824. }
  21825. }
  21826. return result;
  21827. }
  21828. /**
  21829. * The base implementation of `baseForOwn` which iterates over `object`
  21830. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  21831. * Iteratee functions may exit iteration early by explicitly returning `false`.
  21832. *
  21833. * @private
  21834. * @param {Object} object The object to iterate over.
  21835. * @param {Function} iteratee The function invoked per iteration.
  21836. * @param {Function} keysFunc The function to get the keys of `object`.
  21837. * @returns {Object} Returns `object`.
  21838. */
  21839. var baseFor = createBaseFor();
  21840. /**
  21841. * This function is like `baseFor` except that it iterates over properties
  21842. * in the opposite order.
  21843. *
  21844. * @private
  21845. * @param {Object} object The object to iterate over.
  21846. * @param {Function} iteratee The function invoked per iteration.
  21847. * @param {Function} keysFunc The function to get the keys of `object`.
  21848. * @returns {Object} Returns `object`.
  21849. */
  21850. var baseForRight = createBaseFor(true);
  21851. /**
  21852. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  21853. *
  21854. * @private
  21855. * @param {Object} object The object to iterate over.
  21856. * @param {Function} iteratee The function invoked per iteration.
  21857. * @returns {Object} Returns `object`.
  21858. */
  21859. function baseForOwn(object, iteratee) {
  21860. return object && baseFor(object, iteratee, keys);
  21861. }
  21862. /**
  21863. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  21864. *
  21865. * @private
  21866. * @param {Object} object The object to iterate over.
  21867. * @param {Function} iteratee The function invoked per iteration.
  21868. * @returns {Object} Returns `object`.
  21869. */
  21870. function baseForOwnRight(object, iteratee) {
  21871. return object && baseForRight(object, iteratee, keys);
  21872. }
  21873. /**
  21874. * The base implementation of `_.functions` which creates an array of
  21875. * `object` function property names filtered from `props`.
  21876. *
  21877. * @private
  21878. * @param {Object} object The object to inspect.
  21879. * @param {Array} props The property names to filter.
  21880. * @returns {Array} Returns the function names.
  21881. */
  21882. function baseFunctions(object, props) {
  21883. return arrayFilter(props, function(key) {
  21884. return isFunction(object[key]);
  21885. });
  21886. }
  21887. /**
  21888. * The base implementation of `_.get` without support for default values.
  21889. *
  21890. * @private
  21891. * @param {Object} object The object to query.
  21892. * @param {Array|string} path The path of the property to get.
  21893. * @returns {*} Returns the resolved value.
  21894. */
  21895. function baseGet(object, path) {
  21896. path = castPath(path, object);
  21897. var index = 0,
  21898. length = path.length;
  21899. while (object != null && index < length) {
  21900. object = object[toKey(path[index++])];
  21901. }
  21902. return (index && index == length) ? object : undefined;
  21903. }
  21904. /**
  21905. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  21906. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  21907. * symbols of `object`.
  21908. *
  21909. * @private
  21910. * @param {Object} object The object to query.
  21911. * @param {Function} keysFunc The function to get the keys of `object`.
  21912. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  21913. * @returns {Array} Returns the array of property names and symbols.
  21914. */
  21915. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  21916. var result = keysFunc(object);
  21917. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  21918. }
  21919. /**
  21920. * The base implementation of `getTag` without fallbacks for buggy environments.
  21921. *
  21922. * @private
  21923. * @param {*} value The value to query.
  21924. * @returns {string} Returns the `toStringTag`.
  21925. */
  21926. function baseGetTag(value) {
  21927. if (value == null) {
  21928. return value === undefined ? undefinedTag : nullTag;
  21929. }
  21930. return (symToStringTag && symToStringTag in Object(value))
  21931. ? getRawTag(value)
  21932. : objectToString(value);
  21933. }
  21934. /**
  21935. * The base implementation of `_.gt` which doesn't coerce arguments.
  21936. *
  21937. * @private
  21938. * @param {*} value The value to compare.
  21939. * @param {*} other The other value to compare.
  21940. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  21941. * else `false`.
  21942. */
  21943. function baseGt(value, other) {
  21944. return value > other;
  21945. }
  21946. /**
  21947. * The base implementation of `_.has` without support for deep paths.
  21948. *
  21949. * @private
  21950. * @param {Object} [object] The object to query.
  21951. * @param {Array|string} key The key to check.
  21952. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  21953. */
  21954. function baseHas(object, key) {
  21955. return object != null && hasOwnProperty.call(object, key);
  21956. }
  21957. /**
  21958. * The base implementation of `_.hasIn` without support for deep paths.
  21959. *
  21960. * @private
  21961. * @param {Object} [object] The object to query.
  21962. * @param {Array|string} key The key to check.
  21963. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  21964. */
  21965. function baseHasIn(object, key) {
  21966. return object != null && key in Object(object);
  21967. }
  21968. /**
  21969. * The base implementation of `_.inRange` which doesn't coerce arguments.
  21970. *
  21971. * @private
  21972. * @param {number} number The number to check.
  21973. * @param {number} start The start of the range.
  21974. * @param {number} end The end of the range.
  21975. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  21976. */
  21977. function baseInRange(number, start, end) {
  21978. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  21979. }
  21980. /**
  21981. * The base implementation of methods like `_.intersection`, without support
  21982. * for iteratee shorthands, that accepts an array of arrays to inspect.
  21983. *
  21984. * @private
  21985. * @param {Array} arrays The arrays to inspect.
  21986. * @param {Function} [iteratee] The iteratee invoked per element.
  21987. * @param {Function} [comparator] The comparator invoked per element.
  21988. * @returns {Array} Returns the new array of shared values.
  21989. */
  21990. function baseIntersection(arrays, iteratee, comparator) {
  21991. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  21992. length = arrays[0].length,
  21993. othLength = arrays.length,
  21994. othIndex = othLength,
  21995. caches = Array(othLength),
  21996. maxLength = Infinity,
  21997. result = [];
  21998. while (othIndex--) {
  21999. var array = arrays[othIndex];
  22000. if (othIndex && iteratee) {
  22001. array = arrayMap(array, baseUnary(iteratee));
  22002. }
  22003. maxLength = nativeMin(array.length, maxLength);
  22004. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  22005. ? new SetCache(othIndex && array)
  22006. : undefined;
  22007. }
  22008. array = arrays[0];
  22009. var index = -1,
  22010. seen = caches[0];
  22011. outer:
  22012. while (++index < length && result.length < maxLength) {
  22013. var value = array[index],
  22014. computed = iteratee ? iteratee(value) : value;
  22015. value = (comparator || value !== 0) ? value : 0;
  22016. if (!(seen
  22017. ? cacheHas(seen, computed)
  22018. : includes(result, computed, comparator)
  22019. )) {
  22020. othIndex = othLength;
  22021. while (--othIndex) {
  22022. var cache = caches[othIndex];
  22023. if (!(cache
  22024. ? cacheHas(cache, computed)
  22025. : includes(arrays[othIndex], computed, comparator))
  22026. ) {
  22027. continue outer;
  22028. }
  22029. }
  22030. if (seen) {
  22031. seen.push(computed);
  22032. }
  22033. result.push(value);
  22034. }
  22035. }
  22036. return result;
  22037. }
  22038. /**
  22039. * The base implementation of `_.invert` and `_.invertBy` which inverts
  22040. * `object` with values transformed by `iteratee` and set by `setter`.
  22041. *
  22042. * @private
  22043. * @param {Object} object The object to iterate over.
  22044. * @param {Function} setter The function to set `accumulator` values.
  22045. * @param {Function} iteratee The iteratee to transform values.
  22046. * @param {Object} accumulator The initial inverted object.
  22047. * @returns {Function} Returns `accumulator`.
  22048. */
  22049. function baseInverter(object, setter, iteratee, accumulator) {
  22050. baseForOwn(object, function(value, key, object) {
  22051. setter(accumulator, iteratee(value), key, object);
  22052. });
  22053. return accumulator;
  22054. }
  22055. /**
  22056. * The base implementation of `_.invoke` without support for individual
  22057. * method arguments.
  22058. *
  22059. * @private
  22060. * @param {Object} object The object to query.
  22061. * @param {Array|string} path The path of the method to invoke.
  22062. * @param {Array} args The arguments to invoke the method with.
  22063. * @returns {*} Returns the result of the invoked method.
  22064. */
  22065. function baseInvoke(object, path, args) {
  22066. path = castPath(path, object);
  22067. object = parent(object, path);
  22068. var func = object == null ? object : object[toKey(last(path))];
  22069. return func == null ? undefined : apply(func, object, args);
  22070. }
  22071. /**
  22072. * The base implementation of `_.isArguments`.
  22073. *
  22074. * @private
  22075. * @param {*} value The value to check.
  22076. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  22077. */
  22078. function baseIsArguments(value) {
  22079. return isObjectLike(value) && baseGetTag(value) == argsTag;
  22080. }
  22081. /**
  22082. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  22083. *
  22084. * @private
  22085. * @param {*} value The value to check.
  22086. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  22087. */
  22088. function baseIsArrayBuffer(value) {
  22089. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  22090. }
  22091. /**
  22092. * The base implementation of `_.isDate` without Node.js optimizations.
  22093. *
  22094. * @private
  22095. * @param {*} value The value to check.
  22096. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  22097. */
  22098. function baseIsDate(value) {
  22099. return isObjectLike(value) && baseGetTag(value) == dateTag;
  22100. }
  22101. /**
  22102. * The base implementation of `_.isEqual` which supports partial comparisons
  22103. * and tracks traversed objects.
  22104. *
  22105. * @private
  22106. * @param {*} value The value to compare.
  22107. * @param {*} other The other value to compare.
  22108. * @param {boolean} bitmask The bitmask flags.
  22109. * 1 - Unordered comparison
  22110. * 2 - Partial comparison
  22111. * @param {Function} [customizer] The function to customize comparisons.
  22112. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  22113. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  22114. */
  22115. function baseIsEqual(value, other, bitmask, customizer, stack) {
  22116. if (value === other) {
  22117. return true;
  22118. }
  22119. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  22120. return value !== value && other !== other;
  22121. }
  22122. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  22123. }
  22124. /**
  22125. * A specialized version of `baseIsEqual` for arrays and objects which performs
  22126. * deep comparisons and tracks traversed objects enabling objects with circular
  22127. * references to be compared.
  22128. *
  22129. * @private
  22130. * @param {Object} object The object to compare.
  22131. * @param {Object} other The other object to compare.
  22132. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  22133. * @param {Function} customizer The function to customize comparisons.
  22134. * @param {Function} equalFunc The function to determine equivalents of values.
  22135. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  22136. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  22137. */
  22138. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  22139. var objIsArr = isArray(object),
  22140. othIsArr = isArray(other),
  22141. objTag = objIsArr ? arrayTag : getTag(object),
  22142. othTag = othIsArr ? arrayTag : getTag(other);
  22143. objTag = objTag == argsTag ? objectTag : objTag;
  22144. othTag = othTag == argsTag ? objectTag : othTag;
  22145. var objIsObj = objTag == objectTag,
  22146. othIsObj = othTag == objectTag,
  22147. isSameTag = objTag == othTag;
  22148. if (isSameTag && isBuffer(object)) {
  22149. if (!isBuffer(other)) {
  22150. return false;
  22151. }
  22152. objIsArr = true;
  22153. objIsObj = false;
  22154. }
  22155. if (isSameTag && !objIsObj) {
  22156. stack || (stack = new Stack);
  22157. return (objIsArr || isTypedArray(object))
  22158. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  22159. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  22160. }
  22161. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  22162. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  22163. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  22164. if (objIsWrapped || othIsWrapped) {
  22165. var objUnwrapped = objIsWrapped ? object.value() : object,
  22166. othUnwrapped = othIsWrapped ? other.value() : other;
  22167. stack || (stack = new Stack);
  22168. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  22169. }
  22170. }
  22171. if (!isSameTag) {
  22172. return false;
  22173. }
  22174. stack || (stack = new Stack);
  22175. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  22176. }
  22177. /**
  22178. * The base implementation of `_.isMap` without Node.js optimizations.
  22179. *
  22180. * @private
  22181. * @param {*} value The value to check.
  22182. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  22183. */
  22184. function baseIsMap(value) {
  22185. return isObjectLike(value) && getTag(value) == mapTag;
  22186. }
  22187. /**
  22188. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  22189. *
  22190. * @private
  22191. * @param {Object} object The object to inspect.
  22192. * @param {Object} source The object of property values to match.
  22193. * @param {Array} matchData The property names, values, and compare flags to match.
  22194. * @param {Function} [customizer] The function to customize comparisons.
  22195. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  22196. */
  22197. function baseIsMatch(object, source, matchData, customizer) {
  22198. var index = matchData.length,
  22199. length = index,
  22200. noCustomizer = !customizer;
  22201. if (object == null) {
  22202. return !length;
  22203. }
  22204. object = Object(object);
  22205. while (index--) {
  22206. var data = matchData[index];
  22207. if ((noCustomizer && data[2])
  22208. ? data[1] !== object[data[0]]
  22209. : !(data[0] in object)
  22210. ) {
  22211. return false;
  22212. }
  22213. }
  22214. while (++index < length) {
  22215. data = matchData[index];
  22216. var key = data[0],
  22217. objValue = object[key],
  22218. srcValue = data[1];
  22219. if (noCustomizer && data[2]) {
  22220. if (objValue === undefined && !(key in object)) {
  22221. return false;
  22222. }
  22223. } else {
  22224. var stack = new Stack;
  22225. if (customizer) {
  22226. var result = customizer(objValue, srcValue, key, object, source, stack);
  22227. }
  22228. if (!(result === undefined
  22229. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  22230. : result
  22231. )) {
  22232. return false;
  22233. }
  22234. }
  22235. }
  22236. return true;
  22237. }
  22238. /**
  22239. * The base implementation of `_.isNative` without bad shim checks.
  22240. *
  22241. * @private
  22242. * @param {*} value The value to check.
  22243. * @returns {boolean} Returns `true` if `value` is a native function,
  22244. * else `false`.
  22245. */
  22246. function baseIsNative(value) {
  22247. if (!isObject(value) || isMasked(value)) {
  22248. return false;
  22249. }
  22250. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  22251. return pattern.test(toSource(value));
  22252. }
  22253. /**
  22254. * The base implementation of `_.isRegExp` without Node.js optimizations.
  22255. *
  22256. * @private
  22257. * @param {*} value The value to check.
  22258. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  22259. */
  22260. function baseIsRegExp(value) {
  22261. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  22262. }
  22263. /**
  22264. * The base implementation of `_.isSet` without Node.js optimizations.
  22265. *
  22266. * @private
  22267. * @param {*} value The value to check.
  22268. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  22269. */
  22270. function baseIsSet(value) {
  22271. return isObjectLike(value) && getTag(value) == setTag;
  22272. }
  22273. /**
  22274. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  22275. *
  22276. * @private
  22277. * @param {*} value The value to check.
  22278. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  22279. */
  22280. function baseIsTypedArray(value) {
  22281. return isObjectLike(value) &&
  22282. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  22283. }
  22284. /**
  22285. * The base implementation of `_.iteratee`.
  22286. *
  22287. * @private
  22288. * @param {*} [value=_.identity] The value to convert to an iteratee.
  22289. * @returns {Function} Returns the iteratee.
  22290. */
  22291. function baseIteratee(value) {
  22292. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  22293. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  22294. if (typeof value == 'function') {
  22295. return value;
  22296. }
  22297. if (value == null) {
  22298. return identity;
  22299. }
  22300. if (typeof value == 'object') {
  22301. return isArray(value)
  22302. ? baseMatchesProperty(value[0], value[1])
  22303. : baseMatches(value);
  22304. }
  22305. return property(value);
  22306. }
  22307. /**
  22308. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  22309. *
  22310. * @private
  22311. * @param {Object} object The object to query.
  22312. * @returns {Array} Returns the array of property names.
  22313. */
  22314. function baseKeys(object) {
  22315. if (!isPrototype(object)) {
  22316. return nativeKeys(object);
  22317. }
  22318. var result = [];
  22319. for (var key in Object(object)) {
  22320. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  22321. result.push(key);
  22322. }
  22323. }
  22324. return result;
  22325. }
  22326. /**
  22327. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  22328. *
  22329. * @private
  22330. * @param {Object} object The object to query.
  22331. * @returns {Array} Returns the array of property names.
  22332. */
  22333. function baseKeysIn(object) {
  22334. if (!isObject(object)) {
  22335. return nativeKeysIn(object);
  22336. }
  22337. var isProto = isPrototype(object),
  22338. result = [];
  22339. for (var key in object) {
  22340. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  22341. result.push(key);
  22342. }
  22343. }
  22344. return result;
  22345. }
  22346. /**
  22347. * The base implementation of `_.lt` which doesn't coerce arguments.
  22348. *
  22349. * @private
  22350. * @param {*} value The value to compare.
  22351. * @param {*} other The other value to compare.
  22352. * @returns {boolean} Returns `true` if `value` is less than `other`,
  22353. * else `false`.
  22354. */
  22355. function baseLt(value, other) {
  22356. return value < other;
  22357. }
  22358. /**
  22359. * The base implementation of `_.map` without support for iteratee shorthands.
  22360. *
  22361. * @private
  22362. * @param {Array|Object} collection The collection to iterate over.
  22363. * @param {Function} iteratee The function invoked per iteration.
  22364. * @returns {Array} Returns the new mapped array.
  22365. */
  22366. function baseMap(collection, iteratee) {
  22367. var index = -1,
  22368. result = isArrayLike(collection) ? Array(collection.length) : [];
  22369. baseEach(collection, function(value, key, collection) {
  22370. result[++index] = iteratee(value, key, collection);
  22371. });
  22372. return result;
  22373. }
  22374. /**
  22375. * The base implementation of `_.matches` which doesn't clone `source`.
  22376. *
  22377. * @private
  22378. * @param {Object} source The object of property values to match.
  22379. * @returns {Function} Returns the new spec function.
  22380. */
  22381. function baseMatches(source) {
  22382. var matchData = getMatchData(source);
  22383. if (matchData.length == 1 && matchData[0][2]) {
  22384. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  22385. }
  22386. return function(object) {
  22387. return object === source || baseIsMatch(object, source, matchData);
  22388. };
  22389. }
  22390. /**
  22391. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  22392. *
  22393. * @private
  22394. * @param {string} path The path of the property to get.
  22395. * @param {*} srcValue The value to match.
  22396. * @returns {Function} Returns the new spec function.
  22397. */
  22398. function baseMatchesProperty(path, srcValue) {
  22399. if (isKey(path) && isStrictComparable(srcValue)) {
  22400. return matchesStrictComparable(toKey(path), srcValue);
  22401. }
  22402. return function(object) {
  22403. var objValue = get(object, path);
  22404. return (objValue === undefined && objValue === srcValue)
  22405. ? hasIn(object, path)
  22406. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  22407. };
  22408. }
  22409. /**
  22410. * The base implementation of `_.merge` without support for multiple sources.
  22411. *
  22412. * @private
  22413. * @param {Object} object The destination object.
  22414. * @param {Object} source The source object.
  22415. * @param {number} srcIndex The index of `source`.
  22416. * @param {Function} [customizer] The function to customize merged values.
  22417. * @param {Object} [stack] Tracks traversed source values and their merged
  22418. * counterparts.
  22419. */
  22420. function baseMerge(object, source, srcIndex, customizer, stack) {
  22421. if (object === source) {
  22422. return;
  22423. }
  22424. baseFor(source, function(srcValue, key) {
  22425. stack || (stack = new Stack);
  22426. if (isObject(srcValue)) {
  22427. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  22428. }
  22429. else {
  22430. var newValue = customizer
  22431. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  22432. : undefined;
  22433. if (newValue === undefined) {
  22434. newValue = srcValue;
  22435. }
  22436. assignMergeValue(object, key, newValue);
  22437. }
  22438. }, keysIn);
  22439. }
  22440. /**
  22441. * A specialized version of `baseMerge` for arrays and objects which performs
  22442. * deep merges and tracks traversed objects enabling objects with circular
  22443. * references to be merged.
  22444. *
  22445. * @private
  22446. * @param {Object} object The destination object.
  22447. * @param {Object} source The source object.
  22448. * @param {string} key The key of the value to merge.
  22449. * @param {number} srcIndex The index of `source`.
  22450. * @param {Function} mergeFunc The function to merge values.
  22451. * @param {Function} [customizer] The function to customize assigned values.
  22452. * @param {Object} [stack] Tracks traversed source values and their merged
  22453. * counterparts.
  22454. */
  22455. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  22456. var objValue = safeGet(object, key),
  22457. srcValue = safeGet(source, key),
  22458. stacked = stack.get(srcValue);
  22459. if (stacked) {
  22460. assignMergeValue(object, key, stacked);
  22461. return;
  22462. }
  22463. var newValue = customizer
  22464. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  22465. : undefined;
  22466. var isCommon = newValue === undefined;
  22467. if (isCommon) {
  22468. var isArr = isArray(srcValue),
  22469. isBuff = !isArr && isBuffer(srcValue),
  22470. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  22471. newValue = srcValue;
  22472. if (isArr || isBuff || isTyped) {
  22473. if (isArray(objValue)) {
  22474. newValue = objValue;
  22475. }
  22476. else if (isArrayLikeObject(objValue)) {
  22477. newValue = copyArray(objValue);
  22478. }
  22479. else if (isBuff) {
  22480. isCommon = false;
  22481. newValue = cloneBuffer(srcValue, true);
  22482. }
  22483. else if (isTyped) {
  22484. isCommon = false;
  22485. newValue = cloneTypedArray(srcValue, true);
  22486. }
  22487. else {
  22488. newValue = [];
  22489. }
  22490. }
  22491. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  22492. newValue = objValue;
  22493. if (isArguments(objValue)) {
  22494. newValue = toPlainObject(objValue);
  22495. }
  22496. else if (!isObject(objValue) || isFunction(objValue)) {
  22497. newValue = initCloneObject(srcValue);
  22498. }
  22499. }
  22500. else {
  22501. isCommon = false;
  22502. }
  22503. }
  22504. if (isCommon) {
  22505. // Recursively merge objects and arrays (susceptible to call stack limits).
  22506. stack.set(srcValue, newValue);
  22507. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  22508. stack['delete'](srcValue);
  22509. }
  22510. assignMergeValue(object, key, newValue);
  22511. }
  22512. /**
  22513. * The base implementation of `_.nth` which doesn't coerce arguments.
  22514. *
  22515. * @private
  22516. * @param {Array} array The array to query.
  22517. * @param {number} n The index of the element to return.
  22518. * @returns {*} Returns the nth element of `array`.
  22519. */
  22520. function baseNth(array, n) {
  22521. var length = array.length;
  22522. if (!length) {
  22523. return;
  22524. }
  22525. n += n < 0 ? length : 0;
  22526. return isIndex(n, length) ? array[n] : undefined;
  22527. }
  22528. /**
  22529. * The base implementation of `_.orderBy` without param guards.
  22530. *
  22531. * @private
  22532. * @param {Array|Object} collection The collection to iterate over.
  22533. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  22534. * @param {string[]} orders The sort orders of `iteratees`.
  22535. * @returns {Array} Returns the new sorted array.
  22536. */
  22537. function baseOrderBy(collection, iteratees, orders) {
  22538. var index = -1;
  22539. iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(getIteratee()));
  22540. var result = baseMap(collection, function(value, key, collection) {
  22541. var criteria = arrayMap(iteratees, function(iteratee) {
  22542. return iteratee(value);
  22543. });
  22544. return { 'criteria': criteria, 'index': ++index, 'value': value };
  22545. });
  22546. return baseSortBy(result, function(object, other) {
  22547. return compareMultiple(object, other, orders);
  22548. });
  22549. }
  22550. /**
  22551. * The base implementation of `_.pick` without support for individual
  22552. * property identifiers.
  22553. *
  22554. * @private
  22555. * @param {Object} object The source object.
  22556. * @param {string[]} paths The property paths to pick.
  22557. * @returns {Object} Returns the new object.
  22558. */
  22559. function basePick(object, paths) {
  22560. return basePickBy(object, paths, function(value, path) {
  22561. return hasIn(object, path);
  22562. });
  22563. }
  22564. /**
  22565. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  22566. *
  22567. * @private
  22568. * @param {Object} object The source object.
  22569. * @param {string[]} paths The property paths to pick.
  22570. * @param {Function} predicate The function invoked per property.
  22571. * @returns {Object} Returns the new object.
  22572. */
  22573. function basePickBy(object, paths, predicate) {
  22574. var index = -1,
  22575. length = paths.length,
  22576. result = {};
  22577. while (++index < length) {
  22578. var path = paths[index],
  22579. value = baseGet(object, path);
  22580. if (predicate(value, path)) {
  22581. baseSet(result, castPath(path, object), value);
  22582. }
  22583. }
  22584. return result;
  22585. }
  22586. /**
  22587. * A specialized version of `baseProperty` which supports deep paths.
  22588. *
  22589. * @private
  22590. * @param {Array|string} path The path of the property to get.
  22591. * @returns {Function} Returns the new accessor function.
  22592. */
  22593. function basePropertyDeep(path) {
  22594. return function(object) {
  22595. return baseGet(object, path);
  22596. };
  22597. }
  22598. /**
  22599. * The base implementation of `_.pullAllBy` without support for iteratee
  22600. * shorthands.
  22601. *
  22602. * @private
  22603. * @param {Array} array The array to modify.
  22604. * @param {Array} values The values to remove.
  22605. * @param {Function} [iteratee] The iteratee invoked per element.
  22606. * @param {Function} [comparator] The comparator invoked per element.
  22607. * @returns {Array} Returns `array`.
  22608. */
  22609. function basePullAll(array, values, iteratee, comparator) {
  22610. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  22611. index = -1,
  22612. length = values.length,
  22613. seen = array;
  22614. if (array === values) {
  22615. values = copyArray(values);
  22616. }
  22617. if (iteratee) {
  22618. seen = arrayMap(array, baseUnary(iteratee));
  22619. }
  22620. while (++index < length) {
  22621. var fromIndex = 0,
  22622. value = values[index],
  22623. computed = iteratee ? iteratee(value) : value;
  22624. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  22625. if (seen !== array) {
  22626. splice.call(seen, fromIndex, 1);
  22627. }
  22628. splice.call(array, fromIndex, 1);
  22629. }
  22630. }
  22631. return array;
  22632. }
  22633. /**
  22634. * The base implementation of `_.pullAt` without support for individual
  22635. * indexes or capturing the removed elements.
  22636. *
  22637. * @private
  22638. * @param {Array} array The array to modify.
  22639. * @param {number[]} indexes The indexes of elements to remove.
  22640. * @returns {Array} Returns `array`.
  22641. */
  22642. function basePullAt(array, indexes) {
  22643. var length = array ? indexes.length : 0,
  22644. lastIndex = length - 1;
  22645. while (length--) {
  22646. var index = indexes[length];
  22647. if (length == lastIndex || index !== previous) {
  22648. var previous = index;
  22649. if (isIndex(index)) {
  22650. splice.call(array, index, 1);
  22651. } else {
  22652. baseUnset(array, index);
  22653. }
  22654. }
  22655. }
  22656. return array;
  22657. }
  22658. /**
  22659. * The base implementation of `_.random` without support for returning
  22660. * floating-point numbers.
  22661. *
  22662. * @private
  22663. * @param {number} lower The lower bound.
  22664. * @param {number} upper The upper bound.
  22665. * @returns {number} Returns the random number.
  22666. */
  22667. function baseRandom(lower, upper) {
  22668. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  22669. }
  22670. /**
  22671. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  22672. * coerce arguments.
  22673. *
  22674. * @private
  22675. * @param {number} start The start of the range.
  22676. * @param {number} end The end of the range.
  22677. * @param {number} step The value to increment or decrement by.
  22678. * @param {boolean} [fromRight] Specify iterating from right to left.
  22679. * @returns {Array} Returns the range of numbers.
  22680. */
  22681. function baseRange(start, end, step, fromRight) {
  22682. var index = -1,
  22683. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  22684. result = Array(length);
  22685. while (length--) {
  22686. result[fromRight ? length : ++index] = start;
  22687. start += step;
  22688. }
  22689. return result;
  22690. }
  22691. /**
  22692. * The base implementation of `_.repeat` which doesn't coerce arguments.
  22693. *
  22694. * @private
  22695. * @param {string} string The string to repeat.
  22696. * @param {number} n The number of times to repeat the string.
  22697. * @returns {string} Returns the repeated string.
  22698. */
  22699. function baseRepeat(string, n) {
  22700. var result = '';
  22701. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  22702. return result;
  22703. }
  22704. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  22705. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  22706. do {
  22707. if (n % 2) {
  22708. result += string;
  22709. }
  22710. n = nativeFloor(n / 2);
  22711. if (n) {
  22712. string += string;
  22713. }
  22714. } while (n);
  22715. return result;
  22716. }
  22717. /**
  22718. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  22719. *
  22720. * @private
  22721. * @param {Function} func The function to apply a rest parameter to.
  22722. * @param {number} [start=func.length-1] The start position of the rest parameter.
  22723. * @returns {Function} Returns the new function.
  22724. */
  22725. function baseRest(func, start) {
  22726. return setToString(overRest(func, start, identity), func + '');
  22727. }
  22728. /**
  22729. * The base implementation of `_.sample`.
  22730. *
  22731. * @private
  22732. * @param {Array|Object} collection The collection to sample.
  22733. * @returns {*} Returns the random element.
  22734. */
  22735. function baseSample(collection) {
  22736. return arraySample(values(collection));
  22737. }
  22738. /**
  22739. * The base implementation of `_.sampleSize` without param guards.
  22740. *
  22741. * @private
  22742. * @param {Array|Object} collection The collection to sample.
  22743. * @param {number} n The number of elements to sample.
  22744. * @returns {Array} Returns the random elements.
  22745. */
  22746. function baseSampleSize(collection, n) {
  22747. var array = values(collection);
  22748. return shuffleSelf(array, baseClamp(n, 0, array.length));
  22749. }
  22750. /**
  22751. * The base implementation of `_.set`.
  22752. *
  22753. * @private
  22754. * @param {Object} object The object to modify.
  22755. * @param {Array|string} path The path of the property to set.
  22756. * @param {*} value The value to set.
  22757. * @param {Function} [customizer] The function to customize path creation.
  22758. * @returns {Object} Returns `object`.
  22759. */
  22760. function baseSet(object, path, value, customizer) {
  22761. if (!isObject(object)) {
  22762. return object;
  22763. }
  22764. path = castPath(path, object);
  22765. var index = -1,
  22766. length = path.length,
  22767. lastIndex = length - 1,
  22768. nested = object;
  22769. while (nested != null && ++index < length) {
  22770. var key = toKey(path[index]),
  22771. newValue = value;
  22772. if (index != lastIndex) {
  22773. var objValue = nested[key];
  22774. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  22775. if (newValue === undefined) {
  22776. newValue = isObject(objValue)
  22777. ? objValue
  22778. : (isIndex(path[index + 1]) ? [] : {});
  22779. }
  22780. }
  22781. assignValue(nested, key, newValue);
  22782. nested = nested[key];
  22783. }
  22784. return object;
  22785. }
  22786. /**
  22787. * The base implementation of `setData` without support for hot loop shorting.
  22788. *
  22789. * @private
  22790. * @param {Function} func The function to associate metadata with.
  22791. * @param {*} data The metadata.
  22792. * @returns {Function} Returns `func`.
  22793. */
  22794. var baseSetData = !metaMap ? identity : function(func, data) {
  22795. metaMap.set(func, data);
  22796. return func;
  22797. };
  22798. /**
  22799. * The base implementation of `setToString` without support for hot loop shorting.
  22800. *
  22801. * @private
  22802. * @param {Function} func The function to modify.
  22803. * @param {Function} string The `toString` result.
  22804. * @returns {Function} Returns `func`.
  22805. */
  22806. var baseSetToString = !defineProperty ? identity : function(func, string) {
  22807. return defineProperty(func, 'toString', {
  22808. 'configurable': true,
  22809. 'enumerable': false,
  22810. 'value': constant(string),
  22811. 'writable': true
  22812. });
  22813. };
  22814. /**
  22815. * The base implementation of `_.shuffle`.
  22816. *
  22817. * @private
  22818. * @param {Array|Object} collection The collection to shuffle.
  22819. * @returns {Array} Returns the new shuffled array.
  22820. */
  22821. function baseShuffle(collection) {
  22822. return shuffleSelf(values(collection));
  22823. }
  22824. /**
  22825. * The base implementation of `_.slice` without an iteratee call guard.
  22826. *
  22827. * @private
  22828. * @param {Array} array The array to slice.
  22829. * @param {number} [start=0] The start position.
  22830. * @param {number} [end=array.length] The end position.
  22831. * @returns {Array} Returns the slice of `array`.
  22832. */
  22833. function baseSlice(array, start, end) {
  22834. var index = -1,
  22835. length = array.length;
  22836. if (start < 0) {
  22837. start = -start > length ? 0 : (length + start);
  22838. }
  22839. end = end > length ? length : end;
  22840. if (end < 0) {
  22841. end += length;
  22842. }
  22843. length = start > end ? 0 : ((end - start) >>> 0);
  22844. start >>>= 0;
  22845. var result = Array(length);
  22846. while (++index < length) {
  22847. result[index] = array[index + start];
  22848. }
  22849. return result;
  22850. }
  22851. /**
  22852. * The base implementation of `_.some` without support for iteratee shorthands.
  22853. *
  22854. * @private
  22855. * @param {Array|Object} collection The collection to iterate over.
  22856. * @param {Function} predicate The function invoked per iteration.
  22857. * @returns {boolean} Returns `true` if any element passes the predicate check,
  22858. * else `false`.
  22859. */
  22860. function baseSome(collection, predicate) {
  22861. var result;
  22862. baseEach(collection, function(value, index, collection) {
  22863. result = predicate(value, index, collection);
  22864. return !result;
  22865. });
  22866. return !!result;
  22867. }
  22868. /**
  22869. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  22870. * performs a binary search of `array` to determine the index at which `value`
  22871. * should be inserted into `array` in order to maintain its sort order.
  22872. *
  22873. * @private
  22874. * @param {Array} array The sorted array to inspect.
  22875. * @param {*} value The value to evaluate.
  22876. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  22877. * @returns {number} Returns the index at which `value` should be inserted
  22878. * into `array`.
  22879. */
  22880. function baseSortedIndex(array, value, retHighest) {
  22881. var low = 0,
  22882. high = array == null ? low : array.length;
  22883. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  22884. while (low < high) {
  22885. var mid = (low + high) >>> 1,
  22886. computed = array[mid];
  22887. if (computed !== null && !isSymbol(computed) &&
  22888. (retHighest ? (computed <= value) : (computed < value))) {
  22889. low = mid + 1;
  22890. } else {
  22891. high = mid;
  22892. }
  22893. }
  22894. return high;
  22895. }
  22896. return baseSortedIndexBy(array, value, identity, retHighest);
  22897. }
  22898. /**
  22899. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  22900. * which invokes `iteratee` for `value` and each element of `array` to compute
  22901. * their sort ranking. The iteratee is invoked with one argument; (value).
  22902. *
  22903. * @private
  22904. * @param {Array} array The sorted array to inspect.
  22905. * @param {*} value The value to evaluate.
  22906. * @param {Function} iteratee The iteratee invoked per element.
  22907. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  22908. * @returns {number} Returns the index at which `value` should be inserted
  22909. * into `array`.
  22910. */
  22911. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  22912. value = iteratee(value);
  22913. var low = 0,
  22914. high = array == null ? 0 : array.length,
  22915. valIsNaN = value !== value,
  22916. valIsNull = value === null,
  22917. valIsSymbol = isSymbol(value),
  22918. valIsUndefined = value === undefined;
  22919. while (low < high) {
  22920. var mid = nativeFloor((low + high) / 2),
  22921. computed = iteratee(array[mid]),
  22922. othIsDefined = computed !== undefined,
  22923. othIsNull = computed === null,
  22924. othIsReflexive = computed === computed,
  22925. othIsSymbol = isSymbol(computed);
  22926. if (valIsNaN) {
  22927. var setLow = retHighest || othIsReflexive;
  22928. } else if (valIsUndefined) {
  22929. setLow = othIsReflexive && (retHighest || othIsDefined);
  22930. } else if (valIsNull) {
  22931. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  22932. } else if (valIsSymbol) {
  22933. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  22934. } else if (othIsNull || othIsSymbol) {
  22935. setLow = false;
  22936. } else {
  22937. setLow = retHighest ? (computed <= value) : (computed < value);
  22938. }
  22939. if (setLow) {
  22940. low = mid + 1;
  22941. } else {
  22942. high = mid;
  22943. }
  22944. }
  22945. return nativeMin(high, MAX_ARRAY_INDEX);
  22946. }
  22947. /**
  22948. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  22949. * support for iteratee shorthands.
  22950. *
  22951. * @private
  22952. * @param {Array} array The array to inspect.
  22953. * @param {Function} [iteratee] The iteratee invoked per element.
  22954. * @returns {Array} Returns the new duplicate free array.
  22955. */
  22956. function baseSortedUniq(array, iteratee) {
  22957. var index = -1,
  22958. length = array.length,
  22959. resIndex = 0,
  22960. result = [];
  22961. while (++index < length) {
  22962. var value = array[index],
  22963. computed = iteratee ? iteratee(value) : value;
  22964. if (!index || !eq(computed, seen)) {
  22965. var seen = computed;
  22966. result[resIndex++] = value === 0 ? 0 : value;
  22967. }
  22968. }
  22969. return result;
  22970. }
  22971. /**
  22972. * The base implementation of `_.toNumber` which doesn't ensure correct
  22973. * conversions of binary, hexadecimal, or octal string values.
  22974. *
  22975. * @private
  22976. * @param {*} value The value to process.
  22977. * @returns {number} Returns the number.
  22978. */
  22979. function baseToNumber(value) {
  22980. if (typeof value == 'number') {
  22981. return value;
  22982. }
  22983. if (isSymbol(value)) {
  22984. return NAN;
  22985. }
  22986. return +value;
  22987. }
  22988. /**
  22989. * The base implementation of `_.toString` which doesn't convert nullish
  22990. * values to empty strings.
  22991. *
  22992. * @private
  22993. * @param {*} value The value to process.
  22994. * @returns {string} Returns the string.
  22995. */
  22996. function baseToString(value) {
  22997. // Exit early for strings to avoid a performance hit in some environments.
  22998. if (typeof value == 'string') {
  22999. return value;
  23000. }
  23001. if (isArray(value)) {
  23002. // Recursively convert values (susceptible to call stack limits).
  23003. return arrayMap(value, baseToString) + '';
  23004. }
  23005. if (isSymbol(value)) {
  23006. return symbolToString ? symbolToString.call(value) : '';
  23007. }
  23008. var result = (value + '');
  23009. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  23010. }
  23011. /**
  23012. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  23013. *
  23014. * @private
  23015. * @param {Array} array The array to inspect.
  23016. * @param {Function} [iteratee] The iteratee invoked per element.
  23017. * @param {Function} [comparator] The comparator invoked per element.
  23018. * @returns {Array} Returns the new duplicate free array.
  23019. */
  23020. function baseUniq(array, iteratee, comparator) {
  23021. var index = -1,
  23022. includes = arrayIncludes,
  23023. length = array.length,
  23024. isCommon = true,
  23025. result = [],
  23026. seen = result;
  23027. if (comparator) {
  23028. isCommon = false;
  23029. includes = arrayIncludesWith;
  23030. }
  23031. else if (length >= LARGE_ARRAY_SIZE) {
  23032. var set = iteratee ? null : createSet(array);
  23033. if (set) {
  23034. return setToArray(set);
  23035. }
  23036. isCommon = false;
  23037. includes = cacheHas;
  23038. seen = new SetCache;
  23039. }
  23040. else {
  23041. seen = iteratee ? [] : result;
  23042. }
  23043. outer:
  23044. while (++index < length) {
  23045. var value = array[index],
  23046. computed = iteratee ? iteratee(value) : value;
  23047. value = (comparator || value !== 0) ? value : 0;
  23048. if (isCommon && computed === computed) {
  23049. var seenIndex = seen.length;
  23050. while (seenIndex--) {
  23051. if (seen[seenIndex] === computed) {
  23052. continue outer;
  23053. }
  23054. }
  23055. if (iteratee) {
  23056. seen.push(computed);
  23057. }
  23058. result.push(value);
  23059. }
  23060. else if (!includes(seen, computed, comparator)) {
  23061. if (seen !== result) {
  23062. seen.push(computed);
  23063. }
  23064. result.push(value);
  23065. }
  23066. }
  23067. return result;
  23068. }
  23069. /**
  23070. * The base implementation of `_.unset`.
  23071. *
  23072. * @private
  23073. * @param {Object} object The object to modify.
  23074. * @param {Array|string} path The property path to unset.
  23075. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  23076. */
  23077. function baseUnset(object, path) {
  23078. path = castPath(path, object);
  23079. object = parent(object, path);
  23080. return object == null || delete object[toKey(last(path))];
  23081. }
  23082. /**
  23083. * The base implementation of `_.update`.
  23084. *
  23085. * @private
  23086. * @param {Object} object The object to modify.
  23087. * @param {Array|string} path The path of the property to update.
  23088. * @param {Function} updater The function to produce the updated value.
  23089. * @param {Function} [customizer] The function to customize path creation.
  23090. * @returns {Object} Returns `object`.
  23091. */
  23092. function baseUpdate(object, path, updater, customizer) {
  23093. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  23094. }
  23095. /**
  23096. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  23097. * without support for iteratee shorthands.
  23098. *
  23099. * @private
  23100. * @param {Array} array The array to query.
  23101. * @param {Function} predicate The function invoked per iteration.
  23102. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  23103. * @param {boolean} [fromRight] Specify iterating from right to left.
  23104. * @returns {Array} Returns the slice of `array`.
  23105. */
  23106. function baseWhile(array, predicate, isDrop, fromRight) {
  23107. var length = array.length,
  23108. index = fromRight ? length : -1;
  23109. while ((fromRight ? index-- : ++index < length) &&
  23110. predicate(array[index], index, array)) {}
  23111. return isDrop
  23112. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  23113. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  23114. }
  23115. /**
  23116. * The base implementation of `wrapperValue` which returns the result of
  23117. * performing a sequence of actions on the unwrapped `value`, where each
  23118. * successive action is supplied the return value of the previous.
  23119. *
  23120. * @private
  23121. * @param {*} value The unwrapped value.
  23122. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  23123. * @returns {*} Returns the resolved value.
  23124. */
  23125. function baseWrapperValue(value, actions) {
  23126. var result = value;
  23127. if (result instanceof LazyWrapper) {
  23128. result = result.value();
  23129. }
  23130. return arrayReduce(actions, function(result, action) {
  23131. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  23132. }, result);
  23133. }
  23134. /**
  23135. * The base implementation of methods like `_.xor`, without support for
  23136. * iteratee shorthands, that accepts an array of arrays to inspect.
  23137. *
  23138. * @private
  23139. * @param {Array} arrays The arrays to inspect.
  23140. * @param {Function} [iteratee] The iteratee invoked per element.
  23141. * @param {Function} [comparator] The comparator invoked per element.
  23142. * @returns {Array} Returns the new array of values.
  23143. */
  23144. function baseXor(arrays, iteratee, comparator) {
  23145. var length = arrays.length;
  23146. if (length < 2) {
  23147. return length ? baseUniq(arrays[0]) : [];
  23148. }
  23149. var index = -1,
  23150. result = Array(length);
  23151. while (++index < length) {
  23152. var array = arrays[index],
  23153. othIndex = -1;
  23154. while (++othIndex < length) {
  23155. if (othIndex != index) {
  23156. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  23157. }
  23158. }
  23159. }
  23160. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  23161. }
  23162. /**
  23163. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  23164. *
  23165. * @private
  23166. * @param {Array} props The property identifiers.
  23167. * @param {Array} values The property values.
  23168. * @param {Function} assignFunc The function to assign values.
  23169. * @returns {Object} Returns the new object.
  23170. */
  23171. function baseZipObject(props, values, assignFunc) {
  23172. var index = -1,
  23173. length = props.length,
  23174. valsLength = values.length,
  23175. result = {};
  23176. while (++index < length) {
  23177. var value = index < valsLength ? values[index] : undefined;
  23178. assignFunc(result, props[index], value);
  23179. }
  23180. return result;
  23181. }
  23182. /**
  23183. * Casts `value` to an empty array if it's not an array like object.
  23184. *
  23185. * @private
  23186. * @param {*} value The value to inspect.
  23187. * @returns {Array|Object} Returns the cast array-like object.
  23188. */
  23189. function castArrayLikeObject(value) {
  23190. return isArrayLikeObject(value) ? value : [];
  23191. }
  23192. /**
  23193. * Casts `value` to `identity` if it's not a function.
  23194. *
  23195. * @private
  23196. * @param {*} value The value to inspect.
  23197. * @returns {Function} Returns cast function.
  23198. */
  23199. function castFunction(value) {
  23200. return typeof value == 'function' ? value : identity;
  23201. }
  23202. /**
  23203. * Casts `value` to a path array if it's not one.
  23204. *
  23205. * @private
  23206. * @param {*} value The value to inspect.
  23207. * @param {Object} [object] The object to query keys on.
  23208. * @returns {Array} Returns the cast property path array.
  23209. */
  23210. function castPath(value, object) {
  23211. if (isArray(value)) {
  23212. return value;
  23213. }
  23214. return isKey(value, object) ? [value] : stringToPath(toString(value));
  23215. }
  23216. /**
  23217. * A `baseRest` alias which can be replaced with `identity` by module
  23218. * replacement plugins.
  23219. *
  23220. * @private
  23221. * @type {Function}
  23222. * @param {Function} func The function to apply a rest parameter to.
  23223. * @returns {Function} Returns the new function.
  23224. */
  23225. var castRest = baseRest;
  23226. /**
  23227. * Casts `array` to a slice if it's needed.
  23228. *
  23229. * @private
  23230. * @param {Array} array The array to inspect.
  23231. * @param {number} start The start position.
  23232. * @param {number} [end=array.length] The end position.
  23233. * @returns {Array} Returns the cast slice.
  23234. */
  23235. function castSlice(array, start, end) {
  23236. var length = array.length;
  23237. end = end === undefined ? length : end;
  23238. return (!start && end >= length) ? array : baseSlice(array, start, end);
  23239. }
  23240. /**
  23241. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  23242. *
  23243. * @private
  23244. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  23245. */
  23246. var clearTimeout = ctxClearTimeout || function(id) {
  23247. return root.clearTimeout(id);
  23248. };
  23249. /**
  23250. * Creates a clone of `buffer`.
  23251. *
  23252. * @private
  23253. * @param {Buffer} buffer The buffer to clone.
  23254. * @param {boolean} [isDeep] Specify a deep clone.
  23255. * @returns {Buffer} Returns the cloned buffer.
  23256. */
  23257. function cloneBuffer(buffer, isDeep) {
  23258. if (isDeep) {
  23259. return buffer.slice();
  23260. }
  23261. var length = buffer.length,
  23262. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  23263. buffer.copy(result);
  23264. return result;
  23265. }
  23266. /**
  23267. * Creates a clone of `arrayBuffer`.
  23268. *
  23269. * @private
  23270. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  23271. * @returns {ArrayBuffer} Returns the cloned array buffer.
  23272. */
  23273. function cloneArrayBuffer(arrayBuffer) {
  23274. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  23275. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  23276. return result;
  23277. }
  23278. /**
  23279. * Creates a clone of `dataView`.
  23280. *
  23281. * @private
  23282. * @param {Object} dataView The data view to clone.
  23283. * @param {boolean} [isDeep] Specify a deep clone.
  23284. * @returns {Object} Returns the cloned data view.
  23285. */
  23286. function cloneDataView(dataView, isDeep) {
  23287. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  23288. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  23289. }
  23290. /**
  23291. * Creates a clone of `regexp`.
  23292. *
  23293. * @private
  23294. * @param {Object} regexp The regexp to clone.
  23295. * @returns {Object} Returns the cloned regexp.
  23296. */
  23297. function cloneRegExp(regexp) {
  23298. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  23299. result.lastIndex = regexp.lastIndex;
  23300. return result;
  23301. }
  23302. /**
  23303. * Creates a clone of the `symbol` object.
  23304. *
  23305. * @private
  23306. * @param {Object} symbol The symbol object to clone.
  23307. * @returns {Object} Returns the cloned symbol object.
  23308. */
  23309. function cloneSymbol(symbol) {
  23310. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  23311. }
  23312. /**
  23313. * Creates a clone of `typedArray`.
  23314. *
  23315. * @private
  23316. * @param {Object} typedArray The typed array to clone.
  23317. * @param {boolean} [isDeep] Specify a deep clone.
  23318. * @returns {Object} Returns the cloned typed array.
  23319. */
  23320. function cloneTypedArray(typedArray, isDeep) {
  23321. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  23322. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  23323. }
  23324. /**
  23325. * Compares values to sort them in ascending order.
  23326. *
  23327. * @private
  23328. * @param {*} value The value to compare.
  23329. * @param {*} other The other value to compare.
  23330. * @returns {number} Returns the sort order indicator for `value`.
  23331. */
  23332. function compareAscending(value, other) {
  23333. if (value !== other) {
  23334. var valIsDefined = value !== undefined,
  23335. valIsNull = value === null,
  23336. valIsReflexive = value === value,
  23337. valIsSymbol = isSymbol(value);
  23338. var othIsDefined = other !== undefined,
  23339. othIsNull = other === null,
  23340. othIsReflexive = other === other,
  23341. othIsSymbol = isSymbol(other);
  23342. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  23343. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  23344. (valIsNull && othIsDefined && othIsReflexive) ||
  23345. (!valIsDefined && othIsReflexive) ||
  23346. !valIsReflexive) {
  23347. return 1;
  23348. }
  23349. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  23350. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  23351. (othIsNull && valIsDefined && valIsReflexive) ||
  23352. (!othIsDefined && valIsReflexive) ||
  23353. !othIsReflexive) {
  23354. return -1;
  23355. }
  23356. }
  23357. return 0;
  23358. }
  23359. /**
  23360. * Used by `_.orderBy` to compare multiple properties of a value to another
  23361. * and stable sort them.
  23362. *
  23363. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  23364. * specify an order of "desc" for descending or "asc" for ascending sort order
  23365. * of corresponding values.
  23366. *
  23367. * @private
  23368. * @param {Object} object The object to compare.
  23369. * @param {Object} other The other object to compare.
  23370. * @param {boolean[]|string[]} orders The order to sort by for each property.
  23371. * @returns {number} Returns the sort order indicator for `object`.
  23372. */
  23373. function compareMultiple(object, other, orders) {
  23374. var index = -1,
  23375. objCriteria = object.criteria,
  23376. othCriteria = other.criteria,
  23377. length = objCriteria.length,
  23378. ordersLength = orders.length;
  23379. while (++index < length) {
  23380. var result = compareAscending(objCriteria[index], othCriteria[index]);
  23381. if (result) {
  23382. if (index >= ordersLength) {
  23383. return result;
  23384. }
  23385. var order = orders[index];
  23386. return result * (order == 'desc' ? -1 : 1);
  23387. }
  23388. }
  23389. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  23390. // that causes it, under certain circumstances, to provide the same value for
  23391. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  23392. // for more details.
  23393. //
  23394. // This also ensures a stable sort in V8 and other engines.
  23395. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  23396. return object.index - other.index;
  23397. }
  23398. /**
  23399. * Creates an array that is the composition of partially applied arguments,
  23400. * placeholders, and provided arguments into a single array of arguments.
  23401. *
  23402. * @private
  23403. * @param {Array} args The provided arguments.
  23404. * @param {Array} partials The arguments to prepend to those provided.
  23405. * @param {Array} holders The `partials` placeholder indexes.
  23406. * @params {boolean} [isCurried] Specify composing for a curried function.
  23407. * @returns {Array} Returns the new array of composed arguments.
  23408. */
  23409. function composeArgs(args, partials, holders, isCurried) {
  23410. var argsIndex = -1,
  23411. argsLength = args.length,
  23412. holdersLength = holders.length,
  23413. leftIndex = -1,
  23414. leftLength = partials.length,
  23415. rangeLength = nativeMax(argsLength - holdersLength, 0),
  23416. result = Array(leftLength + rangeLength),
  23417. isUncurried = !isCurried;
  23418. while (++leftIndex < leftLength) {
  23419. result[leftIndex] = partials[leftIndex];
  23420. }
  23421. while (++argsIndex < holdersLength) {
  23422. if (isUncurried || argsIndex < argsLength) {
  23423. result[holders[argsIndex]] = args[argsIndex];
  23424. }
  23425. }
  23426. while (rangeLength--) {
  23427. result[leftIndex++] = args[argsIndex++];
  23428. }
  23429. return result;
  23430. }
  23431. /**
  23432. * This function is like `composeArgs` except that the arguments composition
  23433. * is tailored for `_.partialRight`.
  23434. *
  23435. * @private
  23436. * @param {Array} args The provided arguments.
  23437. * @param {Array} partials The arguments to append to those provided.
  23438. * @param {Array} holders The `partials` placeholder indexes.
  23439. * @params {boolean} [isCurried] Specify composing for a curried function.
  23440. * @returns {Array} Returns the new array of composed arguments.
  23441. */
  23442. function composeArgsRight(args, partials, holders, isCurried) {
  23443. var argsIndex = -1,
  23444. argsLength = args.length,
  23445. holdersIndex = -1,
  23446. holdersLength = holders.length,
  23447. rightIndex = -1,
  23448. rightLength = partials.length,
  23449. rangeLength = nativeMax(argsLength - holdersLength, 0),
  23450. result = Array(rangeLength + rightLength),
  23451. isUncurried = !isCurried;
  23452. while (++argsIndex < rangeLength) {
  23453. result[argsIndex] = args[argsIndex];
  23454. }
  23455. var offset = argsIndex;
  23456. while (++rightIndex < rightLength) {
  23457. result[offset + rightIndex] = partials[rightIndex];
  23458. }
  23459. while (++holdersIndex < holdersLength) {
  23460. if (isUncurried || argsIndex < argsLength) {
  23461. result[offset + holders[holdersIndex]] = args[argsIndex++];
  23462. }
  23463. }
  23464. return result;
  23465. }
  23466. /**
  23467. * Copies the values of `source` to `array`.
  23468. *
  23469. * @private
  23470. * @param {Array} source The array to copy values from.
  23471. * @param {Array} [array=[]] The array to copy values to.
  23472. * @returns {Array} Returns `array`.
  23473. */
  23474. function copyArray(source, array) {
  23475. var index = -1,
  23476. length = source.length;
  23477. array || (array = Array(length));
  23478. while (++index < length) {
  23479. array[index] = source[index];
  23480. }
  23481. return array;
  23482. }
  23483. /**
  23484. * Copies properties of `source` to `object`.
  23485. *
  23486. * @private
  23487. * @param {Object} source The object to copy properties from.
  23488. * @param {Array} props The property identifiers to copy.
  23489. * @param {Object} [object={}] The object to copy properties to.
  23490. * @param {Function} [customizer] The function to customize copied values.
  23491. * @returns {Object} Returns `object`.
  23492. */
  23493. function copyObject(source, props, object, customizer) {
  23494. var isNew = !object;
  23495. object || (object = {});
  23496. var index = -1,
  23497. length = props.length;
  23498. while (++index < length) {
  23499. var key = props[index];
  23500. var newValue = customizer
  23501. ? customizer(object[key], source[key], key, object, source)
  23502. : undefined;
  23503. if (newValue === undefined) {
  23504. newValue = source[key];
  23505. }
  23506. if (isNew) {
  23507. baseAssignValue(object, key, newValue);
  23508. } else {
  23509. assignValue(object, key, newValue);
  23510. }
  23511. }
  23512. return object;
  23513. }
  23514. /**
  23515. * Copies own symbols of `source` to `object`.
  23516. *
  23517. * @private
  23518. * @param {Object} source The object to copy symbols from.
  23519. * @param {Object} [object={}] The object to copy symbols to.
  23520. * @returns {Object} Returns `object`.
  23521. */
  23522. function copySymbols(source, object) {
  23523. return copyObject(source, getSymbols(source), object);
  23524. }
  23525. /**
  23526. * Copies own and inherited symbols of `source` to `object`.
  23527. *
  23528. * @private
  23529. * @param {Object} source The object to copy symbols from.
  23530. * @param {Object} [object={}] The object to copy symbols to.
  23531. * @returns {Object} Returns `object`.
  23532. */
  23533. function copySymbolsIn(source, object) {
  23534. return copyObject(source, getSymbolsIn(source), object);
  23535. }
  23536. /**
  23537. * Creates a function like `_.groupBy`.
  23538. *
  23539. * @private
  23540. * @param {Function} setter The function to set accumulator values.
  23541. * @param {Function} [initializer] The accumulator object initializer.
  23542. * @returns {Function} Returns the new aggregator function.
  23543. */
  23544. function createAggregator(setter, initializer) {
  23545. return function(collection, iteratee) {
  23546. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  23547. accumulator = initializer ? initializer() : {};
  23548. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  23549. };
  23550. }
  23551. /**
  23552. * Creates a function like `_.assign`.
  23553. *
  23554. * @private
  23555. * @param {Function} assigner The function to assign values.
  23556. * @returns {Function} Returns the new assigner function.
  23557. */
  23558. function createAssigner(assigner) {
  23559. return baseRest(function(object, sources) {
  23560. var index = -1,
  23561. length = sources.length,
  23562. customizer = length > 1 ? sources[length - 1] : undefined,
  23563. guard = length > 2 ? sources[2] : undefined;
  23564. customizer = (assigner.length > 3 && typeof customizer == 'function')
  23565. ? (length--, customizer)
  23566. : undefined;
  23567. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  23568. customizer = length < 3 ? undefined : customizer;
  23569. length = 1;
  23570. }
  23571. object = Object(object);
  23572. while (++index < length) {
  23573. var source = sources[index];
  23574. if (source) {
  23575. assigner(object, source, index, customizer);
  23576. }
  23577. }
  23578. return object;
  23579. });
  23580. }
  23581. /**
  23582. * Creates a `baseEach` or `baseEachRight` function.
  23583. *
  23584. * @private
  23585. * @param {Function} eachFunc The function to iterate over a collection.
  23586. * @param {boolean} [fromRight] Specify iterating from right to left.
  23587. * @returns {Function} Returns the new base function.
  23588. */
  23589. function createBaseEach(eachFunc, fromRight) {
  23590. return function(collection, iteratee) {
  23591. if (collection == null) {
  23592. return collection;
  23593. }
  23594. if (!isArrayLike(collection)) {
  23595. return eachFunc(collection, iteratee);
  23596. }
  23597. var length = collection.length,
  23598. index = fromRight ? length : -1,
  23599. iterable = Object(collection);
  23600. while ((fromRight ? index-- : ++index < length)) {
  23601. if (iteratee(iterable[index], index, iterable) === false) {
  23602. break;
  23603. }
  23604. }
  23605. return collection;
  23606. };
  23607. }
  23608. /**
  23609. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  23610. *
  23611. * @private
  23612. * @param {boolean} [fromRight] Specify iterating from right to left.
  23613. * @returns {Function} Returns the new base function.
  23614. */
  23615. function createBaseFor(fromRight) {
  23616. return function(object, iteratee, keysFunc) {
  23617. var index = -1,
  23618. iterable = Object(object),
  23619. props = keysFunc(object),
  23620. length = props.length;
  23621. while (length--) {
  23622. var key = props[fromRight ? length : ++index];
  23623. if (iteratee(iterable[key], key, iterable) === false) {
  23624. break;
  23625. }
  23626. }
  23627. return object;
  23628. };
  23629. }
  23630. /**
  23631. * Creates a function that wraps `func` to invoke it with the optional `this`
  23632. * binding of `thisArg`.
  23633. *
  23634. * @private
  23635. * @param {Function} func The function to wrap.
  23636. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  23637. * @param {*} [thisArg] The `this` binding of `func`.
  23638. * @returns {Function} Returns the new wrapped function.
  23639. */
  23640. function createBind(func, bitmask, thisArg) {
  23641. var isBind = bitmask & WRAP_BIND_FLAG,
  23642. Ctor = createCtor(func);
  23643. function wrapper() {
  23644. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  23645. return fn.apply(isBind ? thisArg : this, arguments);
  23646. }
  23647. return wrapper;
  23648. }
  23649. /**
  23650. * Creates a function like `_.lowerFirst`.
  23651. *
  23652. * @private
  23653. * @param {string} methodName The name of the `String` case method to use.
  23654. * @returns {Function} Returns the new case function.
  23655. */
  23656. function createCaseFirst(methodName) {
  23657. return function(string) {
  23658. string = toString(string);
  23659. var strSymbols = hasUnicode(string)
  23660. ? stringToArray(string)
  23661. : undefined;
  23662. var chr = strSymbols
  23663. ? strSymbols[0]
  23664. : string.charAt(0);
  23665. var trailing = strSymbols
  23666. ? castSlice(strSymbols, 1).join('')
  23667. : string.slice(1);
  23668. return chr[methodName]() + trailing;
  23669. };
  23670. }
  23671. /**
  23672. * Creates a function like `_.camelCase`.
  23673. *
  23674. * @private
  23675. * @param {Function} callback The function to combine each word.
  23676. * @returns {Function} Returns the new compounder function.
  23677. */
  23678. function createCompounder(callback) {
  23679. return function(string) {
  23680. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  23681. };
  23682. }
  23683. /**
  23684. * Creates a function that produces an instance of `Ctor` regardless of
  23685. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  23686. *
  23687. * @private
  23688. * @param {Function} Ctor The constructor to wrap.
  23689. * @returns {Function} Returns the new wrapped function.
  23690. */
  23691. function createCtor(Ctor) {
  23692. return function() {
  23693. // Use a `switch` statement to work with class constructors. See
  23694. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  23695. // for more details.
  23696. var args = arguments;
  23697. switch (args.length) {
  23698. case 0: return new Ctor;
  23699. case 1: return new Ctor(args[0]);
  23700. case 2: return new Ctor(args[0], args[1]);
  23701. case 3: return new Ctor(args[0], args[1], args[2]);
  23702. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  23703. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  23704. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  23705. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  23706. }
  23707. var thisBinding = baseCreate(Ctor.prototype),
  23708. result = Ctor.apply(thisBinding, args);
  23709. // Mimic the constructor's `return` behavior.
  23710. // See https://es5.github.io/#x13.2.2 for more details.
  23711. return isObject(result) ? result : thisBinding;
  23712. };
  23713. }
  23714. /**
  23715. * Creates a function that wraps `func` to enable currying.
  23716. *
  23717. * @private
  23718. * @param {Function} func The function to wrap.
  23719. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  23720. * @param {number} arity The arity of `func`.
  23721. * @returns {Function} Returns the new wrapped function.
  23722. */
  23723. function createCurry(func, bitmask, arity) {
  23724. var Ctor = createCtor(func);
  23725. function wrapper() {
  23726. var length = arguments.length,
  23727. args = Array(length),
  23728. index = length,
  23729. placeholder = getHolder(wrapper);
  23730. while (index--) {
  23731. args[index] = arguments[index];
  23732. }
  23733. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  23734. ? []
  23735. : replaceHolders(args, placeholder);
  23736. length -= holders.length;
  23737. if (length < arity) {
  23738. return createRecurry(
  23739. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  23740. args, holders, undefined, undefined, arity - length);
  23741. }
  23742. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  23743. return apply(fn, this, args);
  23744. }
  23745. return wrapper;
  23746. }
  23747. /**
  23748. * Creates a `_.find` or `_.findLast` function.
  23749. *
  23750. * @private
  23751. * @param {Function} findIndexFunc The function to find the collection index.
  23752. * @returns {Function} Returns the new find function.
  23753. */
  23754. function createFind(findIndexFunc) {
  23755. return function(collection, predicate, fromIndex) {
  23756. var iterable = Object(collection);
  23757. if (!isArrayLike(collection)) {
  23758. var iteratee = getIteratee(predicate, 3);
  23759. collection = keys(collection);
  23760. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  23761. }
  23762. var index = findIndexFunc(collection, predicate, fromIndex);
  23763. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  23764. };
  23765. }
  23766. /**
  23767. * Creates a `_.flow` or `_.flowRight` function.
  23768. *
  23769. * @private
  23770. * @param {boolean} [fromRight] Specify iterating from right to left.
  23771. * @returns {Function} Returns the new flow function.
  23772. */
  23773. function createFlow(fromRight) {
  23774. return flatRest(function(funcs) {
  23775. var length = funcs.length,
  23776. index = length,
  23777. prereq = LodashWrapper.prototype.thru;
  23778. if (fromRight) {
  23779. funcs.reverse();
  23780. }
  23781. while (index--) {
  23782. var func = funcs[index];
  23783. if (typeof func != 'function') {
  23784. throw new TypeError(FUNC_ERROR_TEXT);
  23785. }
  23786. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  23787. var wrapper = new LodashWrapper([], true);
  23788. }
  23789. }
  23790. index = wrapper ? index : length;
  23791. while (++index < length) {
  23792. func = funcs[index];
  23793. var funcName = getFuncName(func),
  23794. data = funcName == 'wrapper' ? getData(func) : undefined;
  23795. if (data && isLaziable(data[0]) &&
  23796. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  23797. !data[4].length && data[9] == 1
  23798. ) {
  23799. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  23800. } else {
  23801. wrapper = (func.length == 1 && isLaziable(func))
  23802. ? wrapper[funcName]()
  23803. : wrapper.thru(func);
  23804. }
  23805. }
  23806. return function() {
  23807. var args = arguments,
  23808. value = args[0];
  23809. if (wrapper && args.length == 1 && isArray(value)) {
  23810. return wrapper.plant(value).value();
  23811. }
  23812. var index = 0,
  23813. result = length ? funcs[index].apply(this, args) : value;
  23814. while (++index < length) {
  23815. result = funcs[index].call(this, result);
  23816. }
  23817. return result;
  23818. };
  23819. });
  23820. }
  23821. /**
  23822. * Creates a function that wraps `func` to invoke it with optional `this`
  23823. * binding of `thisArg`, partial application, and currying.
  23824. *
  23825. * @private
  23826. * @param {Function|string} func The function or method name to wrap.
  23827. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  23828. * @param {*} [thisArg] The `this` binding of `func`.
  23829. * @param {Array} [partials] The arguments to prepend to those provided to
  23830. * the new function.
  23831. * @param {Array} [holders] The `partials` placeholder indexes.
  23832. * @param {Array} [partialsRight] The arguments to append to those provided
  23833. * to the new function.
  23834. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  23835. * @param {Array} [argPos] The argument positions of the new function.
  23836. * @param {number} [ary] The arity cap of `func`.
  23837. * @param {number} [arity] The arity of `func`.
  23838. * @returns {Function} Returns the new wrapped function.
  23839. */
  23840. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  23841. var isAry = bitmask & WRAP_ARY_FLAG,
  23842. isBind = bitmask & WRAP_BIND_FLAG,
  23843. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  23844. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  23845. isFlip = bitmask & WRAP_FLIP_FLAG,
  23846. Ctor = isBindKey ? undefined : createCtor(func);
  23847. function wrapper() {
  23848. var length = arguments.length,
  23849. args = Array(length),
  23850. index = length;
  23851. while (index--) {
  23852. args[index] = arguments[index];
  23853. }
  23854. if (isCurried) {
  23855. var placeholder = getHolder(wrapper),
  23856. holdersCount = countHolders(args, placeholder);
  23857. }
  23858. if (partials) {
  23859. args = composeArgs(args, partials, holders, isCurried);
  23860. }
  23861. if (partialsRight) {
  23862. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  23863. }
  23864. length -= holdersCount;
  23865. if (isCurried && length < arity) {
  23866. var newHolders = replaceHolders(args, placeholder);
  23867. return createRecurry(
  23868. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  23869. args, newHolders, argPos, ary, arity - length
  23870. );
  23871. }
  23872. var thisBinding = isBind ? thisArg : this,
  23873. fn = isBindKey ? thisBinding[func] : func;
  23874. length = args.length;
  23875. if (argPos) {
  23876. args = reorder(args, argPos);
  23877. } else if (isFlip && length > 1) {
  23878. args.reverse();
  23879. }
  23880. if (isAry && ary < length) {
  23881. args.length = ary;
  23882. }
  23883. if (this && this !== root && this instanceof wrapper) {
  23884. fn = Ctor || createCtor(fn);
  23885. }
  23886. return fn.apply(thisBinding, args);
  23887. }
  23888. return wrapper;
  23889. }
  23890. /**
  23891. * Creates a function like `_.invertBy`.
  23892. *
  23893. * @private
  23894. * @param {Function} setter The function to set accumulator values.
  23895. * @param {Function} toIteratee The function to resolve iteratees.
  23896. * @returns {Function} Returns the new inverter function.
  23897. */
  23898. function createInverter(setter, toIteratee) {
  23899. return function(object, iteratee) {
  23900. return baseInverter(object, setter, toIteratee(iteratee), {});
  23901. };
  23902. }
  23903. /**
  23904. * Creates a function that performs a mathematical operation on two values.
  23905. *
  23906. * @private
  23907. * @param {Function} operator The function to perform the operation.
  23908. * @param {number} [defaultValue] The value used for `undefined` arguments.
  23909. * @returns {Function} Returns the new mathematical operation function.
  23910. */
  23911. function createMathOperation(operator, defaultValue) {
  23912. return function(value, other) {
  23913. var result;
  23914. if (value === undefined && other === undefined) {
  23915. return defaultValue;
  23916. }
  23917. if (value !== undefined) {
  23918. result = value;
  23919. }
  23920. if (other !== undefined) {
  23921. if (result === undefined) {
  23922. return other;
  23923. }
  23924. if (typeof value == 'string' || typeof other == 'string') {
  23925. value = baseToString(value);
  23926. other = baseToString(other);
  23927. } else {
  23928. value = baseToNumber(value);
  23929. other = baseToNumber(other);
  23930. }
  23931. result = operator(value, other);
  23932. }
  23933. return result;
  23934. };
  23935. }
  23936. /**
  23937. * Creates a function like `_.over`.
  23938. *
  23939. * @private
  23940. * @param {Function} arrayFunc The function to iterate over iteratees.
  23941. * @returns {Function} Returns the new over function.
  23942. */
  23943. function createOver(arrayFunc) {
  23944. return flatRest(function(iteratees) {
  23945. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  23946. return baseRest(function(args) {
  23947. var thisArg = this;
  23948. return arrayFunc(iteratees, function(iteratee) {
  23949. return apply(iteratee, thisArg, args);
  23950. });
  23951. });
  23952. });
  23953. }
  23954. /**
  23955. * Creates the padding for `string` based on `length`. The `chars` string
  23956. * is truncated if the number of characters exceeds `length`.
  23957. *
  23958. * @private
  23959. * @param {number} length The padding length.
  23960. * @param {string} [chars=' '] The string used as padding.
  23961. * @returns {string} Returns the padding for `string`.
  23962. */
  23963. function createPadding(length, chars) {
  23964. chars = chars === undefined ? ' ' : baseToString(chars);
  23965. var charsLength = chars.length;
  23966. if (charsLength < 2) {
  23967. return charsLength ? baseRepeat(chars, length) : chars;
  23968. }
  23969. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  23970. return hasUnicode(chars)
  23971. ? castSlice(stringToArray(result), 0, length).join('')
  23972. : result.slice(0, length);
  23973. }
  23974. /**
  23975. * Creates a function that wraps `func` to invoke it with the `this` binding
  23976. * of `thisArg` and `partials` prepended to the arguments it receives.
  23977. *
  23978. * @private
  23979. * @param {Function} func The function to wrap.
  23980. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  23981. * @param {*} thisArg The `this` binding of `func`.
  23982. * @param {Array} partials The arguments to prepend to those provided to
  23983. * the new function.
  23984. * @returns {Function} Returns the new wrapped function.
  23985. */
  23986. function createPartial(func, bitmask, thisArg, partials) {
  23987. var isBind = bitmask & WRAP_BIND_FLAG,
  23988. Ctor = createCtor(func);
  23989. function wrapper() {
  23990. var argsIndex = -1,
  23991. argsLength = arguments.length,
  23992. leftIndex = -1,
  23993. leftLength = partials.length,
  23994. args = Array(leftLength + argsLength),
  23995. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  23996. while (++leftIndex < leftLength) {
  23997. args[leftIndex] = partials[leftIndex];
  23998. }
  23999. while (argsLength--) {
  24000. args[leftIndex++] = arguments[++argsIndex];
  24001. }
  24002. return apply(fn, isBind ? thisArg : this, args);
  24003. }
  24004. return wrapper;
  24005. }
  24006. /**
  24007. * Creates a `_.range` or `_.rangeRight` function.
  24008. *
  24009. * @private
  24010. * @param {boolean} [fromRight] Specify iterating from right to left.
  24011. * @returns {Function} Returns the new range function.
  24012. */
  24013. function createRange(fromRight) {
  24014. return function(start, end, step) {
  24015. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  24016. end = step = undefined;
  24017. }
  24018. // Ensure the sign of `-0` is preserved.
  24019. start = toFinite(start);
  24020. if (end === undefined) {
  24021. end = start;
  24022. start = 0;
  24023. } else {
  24024. end = toFinite(end);
  24025. }
  24026. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  24027. return baseRange(start, end, step, fromRight);
  24028. };
  24029. }
  24030. /**
  24031. * Creates a function that performs a relational operation on two values.
  24032. *
  24033. * @private
  24034. * @param {Function} operator The function to perform the operation.
  24035. * @returns {Function} Returns the new relational operation function.
  24036. */
  24037. function createRelationalOperation(operator) {
  24038. return function(value, other) {
  24039. if (!(typeof value == 'string' && typeof other == 'string')) {
  24040. value = toNumber(value);
  24041. other = toNumber(other);
  24042. }
  24043. return operator(value, other);
  24044. };
  24045. }
  24046. /**
  24047. * Creates a function that wraps `func` to continue currying.
  24048. *
  24049. * @private
  24050. * @param {Function} func The function to wrap.
  24051. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  24052. * @param {Function} wrapFunc The function to create the `func` wrapper.
  24053. * @param {*} placeholder The placeholder value.
  24054. * @param {*} [thisArg] The `this` binding of `func`.
  24055. * @param {Array} [partials] The arguments to prepend to those provided to
  24056. * the new function.
  24057. * @param {Array} [holders] The `partials` placeholder indexes.
  24058. * @param {Array} [argPos] The argument positions of the new function.
  24059. * @param {number} [ary] The arity cap of `func`.
  24060. * @param {number} [arity] The arity of `func`.
  24061. * @returns {Function} Returns the new wrapped function.
  24062. */
  24063. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  24064. var isCurry = bitmask & WRAP_CURRY_FLAG,
  24065. newHolders = isCurry ? holders : undefined,
  24066. newHoldersRight = isCurry ? undefined : holders,
  24067. newPartials = isCurry ? partials : undefined,
  24068. newPartialsRight = isCurry ? undefined : partials;
  24069. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  24070. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  24071. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  24072. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  24073. }
  24074. var newData = [
  24075. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  24076. newHoldersRight, argPos, ary, arity
  24077. ];
  24078. var result = wrapFunc.apply(undefined, newData);
  24079. if (isLaziable(func)) {
  24080. setData(result, newData);
  24081. }
  24082. result.placeholder = placeholder;
  24083. return setWrapToString(result, func, bitmask);
  24084. }
  24085. /**
  24086. * Creates a function like `_.round`.
  24087. *
  24088. * @private
  24089. * @param {string} methodName The name of the `Math` method to use when rounding.
  24090. * @returns {Function} Returns the new round function.
  24091. */
  24092. function createRound(methodName) {
  24093. var func = Math[methodName];
  24094. return function(number, precision) {
  24095. number = toNumber(number);
  24096. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  24097. if (precision && nativeIsFinite(number)) {
  24098. // Shift with exponential notation to avoid floating-point issues.
  24099. // See [MDN](https://mdn.io/round#Examples) for more details.
  24100. var pair = (toString(number) + 'e').split('e'),
  24101. value = func(pair[0] + 'e' + (+pair[1] + precision));
  24102. pair = (toString(value) + 'e').split('e');
  24103. return +(pair[0] + 'e' + (+pair[1] - precision));
  24104. }
  24105. return func(number);
  24106. };
  24107. }
  24108. /**
  24109. * Creates a set object of `values`.
  24110. *
  24111. * @private
  24112. * @param {Array} values The values to add to the set.
  24113. * @returns {Object} Returns the new set.
  24114. */
  24115. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  24116. return new Set(values);
  24117. };
  24118. /**
  24119. * Creates a `_.toPairs` or `_.toPairsIn` function.
  24120. *
  24121. * @private
  24122. * @param {Function} keysFunc The function to get the keys of a given object.
  24123. * @returns {Function} Returns the new pairs function.
  24124. */
  24125. function createToPairs(keysFunc) {
  24126. return function(object) {
  24127. var tag = getTag(object);
  24128. if (tag == mapTag) {
  24129. return mapToArray(object);
  24130. }
  24131. if (tag == setTag) {
  24132. return setToPairs(object);
  24133. }
  24134. return baseToPairs(object, keysFunc(object));
  24135. };
  24136. }
  24137. /**
  24138. * Creates a function that either curries or invokes `func` with optional
  24139. * `this` binding and partially applied arguments.
  24140. *
  24141. * @private
  24142. * @param {Function|string} func The function or method name to wrap.
  24143. * @param {number} bitmask The bitmask flags.
  24144. * 1 - `_.bind`
  24145. * 2 - `_.bindKey`
  24146. * 4 - `_.curry` or `_.curryRight` of a bound function
  24147. * 8 - `_.curry`
  24148. * 16 - `_.curryRight`
  24149. * 32 - `_.partial`
  24150. * 64 - `_.partialRight`
  24151. * 128 - `_.rearg`
  24152. * 256 - `_.ary`
  24153. * 512 - `_.flip`
  24154. * @param {*} [thisArg] The `this` binding of `func`.
  24155. * @param {Array} [partials] The arguments to be partially applied.
  24156. * @param {Array} [holders] The `partials` placeholder indexes.
  24157. * @param {Array} [argPos] The argument positions of the new function.
  24158. * @param {number} [ary] The arity cap of `func`.
  24159. * @param {number} [arity] The arity of `func`.
  24160. * @returns {Function} Returns the new wrapped function.
  24161. */
  24162. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  24163. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  24164. if (!isBindKey && typeof func != 'function') {
  24165. throw new TypeError(FUNC_ERROR_TEXT);
  24166. }
  24167. var length = partials ? partials.length : 0;
  24168. if (!length) {
  24169. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  24170. partials = holders = undefined;
  24171. }
  24172. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  24173. arity = arity === undefined ? arity : toInteger(arity);
  24174. length -= holders ? holders.length : 0;
  24175. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  24176. var partialsRight = partials,
  24177. holdersRight = holders;
  24178. partials = holders = undefined;
  24179. }
  24180. var data = isBindKey ? undefined : getData(func);
  24181. var newData = [
  24182. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  24183. argPos, ary, arity
  24184. ];
  24185. if (data) {
  24186. mergeData(newData, data);
  24187. }
  24188. func = newData[0];
  24189. bitmask = newData[1];
  24190. thisArg = newData[2];
  24191. partials = newData[3];
  24192. holders = newData[4];
  24193. arity = newData[9] = newData[9] === undefined
  24194. ? (isBindKey ? 0 : func.length)
  24195. : nativeMax(newData[9] - length, 0);
  24196. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  24197. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  24198. }
  24199. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  24200. var result = createBind(func, bitmask, thisArg);
  24201. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  24202. result = createCurry(func, bitmask, arity);
  24203. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  24204. result = createPartial(func, bitmask, thisArg, partials);
  24205. } else {
  24206. result = createHybrid.apply(undefined, newData);
  24207. }
  24208. var setter = data ? baseSetData : setData;
  24209. return setWrapToString(setter(result, newData), func, bitmask);
  24210. }
  24211. /**
  24212. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  24213. * of source objects to the destination object for all destination properties
  24214. * that resolve to `undefined`.
  24215. *
  24216. * @private
  24217. * @param {*} objValue The destination value.
  24218. * @param {*} srcValue The source value.
  24219. * @param {string} key The key of the property to assign.
  24220. * @param {Object} object The parent object of `objValue`.
  24221. * @returns {*} Returns the value to assign.
  24222. */
  24223. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  24224. if (objValue === undefined ||
  24225. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  24226. return srcValue;
  24227. }
  24228. return objValue;
  24229. }
  24230. /**
  24231. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  24232. * objects into destination objects that are passed thru.
  24233. *
  24234. * @private
  24235. * @param {*} objValue The destination value.
  24236. * @param {*} srcValue The source value.
  24237. * @param {string} key The key of the property to merge.
  24238. * @param {Object} object The parent object of `objValue`.
  24239. * @param {Object} source The parent object of `srcValue`.
  24240. * @param {Object} [stack] Tracks traversed source values and their merged
  24241. * counterparts.
  24242. * @returns {*} Returns the value to assign.
  24243. */
  24244. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  24245. if (isObject(objValue) && isObject(srcValue)) {
  24246. // Recursively merge objects and arrays (susceptible to call stack limits).
  24247. stack.set(srcValue, objValue);
  24248. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  24249. stack['delete'](srcValue);
  24250. }
  24251. return objValue;
  24252. }
  24253. /**
  24254. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  24255. * objects.
  24256. *
  24257. * @private
  24258. * @param {*} value The value to inspect.
  24259. * @param {string} key The key of the property to inspect.
  24260. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  24261. */
  24262. function customOmitClone(value) {
  24263. return isPlainObject(value) ? undefined : value;
  24264. }
  24265. /**
  24266. * A specialized version of `baseIsEqualDeep` for arrays with support for
  24267. * partial deep comparisons.
  24268. *
  24269. * @private
  24270. * @param {Array} array The array to compare.
  24271. * @param {Array} other The other array to compare.
  24272. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  24273. * @param {Function} customizer The function to customize comparisons.
  24274. * @param {Function} equalFunc The function to determine equivalents of values.
  24275. * @param {Object} stack Tracks traversed `array` and `other` objects.
  24276. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  24277. */
  24278. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  24279. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  24280. arrLength = array.length,
  24281. othLength = other.length;
  24282. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  24283. return false;
  24284. }
  24285. // Assume cyclic values are equal.
  24286. var stacked = stack.get(array);
  24287. if (stacked && stack.get(other)) {
  24288. return stacked == other;
  24289. }
  24290. var index = -1,
  24291. result = true,
  24292. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  24293. stack.set(array, other);
  24294. stack.set(other, array);
  24295. // Ignore non-index properties.
  24296. while (++index < arrLength) {
  24297. var arrValue = array[index],
  24298. othValue = other[index];
  24299. if (customizer) {
  24300. var compared = isPartial
  24301. ? customizer(othValue, arrValue, index, other, array, stack)
  24302. : customizer(arrValue, othValue, index, array, other, stack);
  24303. }
  24304. if (compared !== undefined) {
  24305. if (compared) {
  24306. continue;
  24307. }
  24308. result = false;
  24309. break;
  24310. }
  24311. // Recursively compare arrays (susceptible to call stack limits).
  24312. if (seen) {
  24313. if (!arraySome(other, function(othValue, othIndex) {
  24314. if (!cacheHas(seen, othIndex) &&
  24315. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  24316. return seen.push(othIndex);
  24317. }
  24318. })) {
  24319. result = false;
  24320. break;
  24321. }
  24322. } else if (!(
  24323. arrValue === othValue ||
  24324. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  24325. )) {
  24326. result = false;
  24327. break;
  24328. }
  24329. }
  24330. stack['delete'](array);
  24331. stack['delete'](other);
  24332. return result;
  24333. }
  24334. /**
  24335. * A specialized version of `baseIsEqualDeep` for comparing objects of
  24336. * the same `toStringTag`.
  24337. *
  24338. * **Note:** This function only supports comparing values with tags of
  24339. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  24340. *
  24341. * @private
  24342. * @param {Object} object The object to compare.
  24343. * @param {Object} other The other object to compare.
  24344. * @param {string} tag The `toStringTag` of the objects to compare.
  24345. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  24346. * @param {Function} customizer The function to customize comparisons.
  24347. * @param {Function} equalFunc The function to determine equivalents of values.
  24348. * @param {Object} stack Tracks traversed `object` and `other` objects.
  24349. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  24350. */
  24351. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  24352. switch (tag) {
  24353. case dataViewTag:
  24354. if ((object.byteLength != other.byteLength) ||
  24355. (object.byteOffset != other.byteOffset)) {
  24356. return false;
  24357. }
  24358. object = object.buffer;
  24359. other = other.buffer;
  24360. case arrayBufferTag:
  24361. if ((object.byteLength != other.byteLength) ||
  24362. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  24363. return false;
  24364. }
  24365. return true;
  24366. case boolTag:
  24367. case dateTag:
  24368. case numberTag:
  24369. // Coerce booleans to `1` or `0` and dates to milliseconds.
  24370. // Invalid dates are coerced to `NaN`.
  24371. return eq(+object, +other);
  24372. case errorTag:
  24373. return object.name == other.name && object.message == other.message;
  24374. case regexpTag:
  24375. case stringTag:
  24376. // Coerce regexes to strings and treat strings, primitives and objects,
  24377. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  24378. // for more details.
  24379. return object == (other + '');
  24380. case mapTag:
  24381. var convert = mapToArray;
  24382. case setTag:
  24383. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  24384. convert || (convert = setToArray);
  24385. if (object.size != other.size && !isPartial) {
  24386. return false;
  24387. }
  24388. // Assume cyclic values are equal.
  24389. var stacked = stack.get(object);
  24390. if (stacked) {
  24391. return stacked == other;
  24392. }
  24393. bitmask |= COMPARE_UNORDERED_FLAG;
  24394. // Recursively compare objects (susceptible to call stack limits).
  24395. stack.set(object, other);
  24396. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  24397. stack['delete'](object);
  24398. return result;
  24399. case symbolTag:
  24400. if (symbolValueOf) {
  24401. return symbolValueOf.call(object) == symbolValueOf.call(other);
  24402. }
  24403. }
  24404. return false;
  24405. }
  24406. /**
  24407. * A specialized version of `baseIsEqualDeep` for objects with support for
  24408. * partial deep comparisons.
  24409. *
  24410. * @private
  24411. * @param {Object} object The object to compare.
  24412. * @param {Object} other The other object to compare.
  24413. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  24414. * @param {Function} customizer The function to customize comparisons.
  24415. * @param {Function} equalFunc The function to determine equivalents of values.
  24416. * @param {Object} stack Tracks traversed `object` and `other` objects.
  24417. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  24418. */
  24419. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  24420. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  24421. objProps = getAllKeys(object),
  24422. objLength = objProps.length,
  24423. othProps = getAllKeys(other),
  24424. othLength = othProps.length;
  24425. if (objLength != othLength && !isPartial) {
  24426. return false;
  24427. }
  24428. var index = objLength;
  24429. while (index--) {
  24430. var key = objProps[index];
  24431. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  24432. return false;
  24433. }
  24434. }
  24435. // Assume cyclic values are equal.
  24436. var stacked = stack.get(object);
  24437. if (stacked && stack.get(other)) {
  24438. return stacked == other;
  24439. }
  24440. var result = true;
  24441. stack.set(object, other);
  24442. stack.set(other, object);
  24443. var skipCtor = isPartial;
  24444. while (++index < objLength) {
  24445. key = objProps[index];
  24446. var objValue = object[key],
  24447. othValue = other[key];
  24448. if (customizer) {
  24449. var compared = isPartial
  24450. ? customizer(othValue, objValue, key, other, object, stack)
  24451. : customizer(objValue, othValue, key, object, other, stack);
  24452. }
  24453. // Recursively compare objects (susceptible to call stack limits).
  24454. if (!(compared === undefined
  24455. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  24456. : compared
  24457. )) {
  24458. result = false;
  24459. break;
  24460. }
  24461. skipCtor || (skipCtor = key == 'constructor');
  24462. }
  24463. if (result && !skipCtor) {
  24464. var objCtor = object.constructor,
  24465. othCtor = other.constructor;
  24466. // Non `Object` object instances with different constructors are not equal.
  24467. if (objCtor != othCtor &&
  24468. ('constructor' in object && 'constructor' in other) &&
  24469. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  24470. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  24471. result = false;
  24472. }
  24473. }
  24474. stack['delete'](object);
  24475. stack['delete'](other);
  24476. return result;
  24477. }
  24478. /**
  24479. * A specialized version of `baseRest` which flattens the rest array.
  24480. *
  24481. * @private
  24482. * @param {Function} func The function to apply a rest parameter to.
  24483. * @returns {Function} Returns the new function.
  24484. */
  24485. function flatRest(func) {
  24486. return setToString(overRest(func, undefined, flatten), func + '');
  24487. }
  24488. /**
  24489. * Creates an array of own enumerable property names and symbols of `object`.
  24490. *
  24491. * @private
  24492. * @param {Object} object The object to query.
  24493. * @returns {Array} Returns the array of property names and symbols.
  24494. */
  24495. function getAllKeys(object) {
  24496. return baseGetAllKeys(object, keys, getSymbols);
  24497. }
  24498. /**
  24499. * Creates an array of own and inherited enumerable property names and
  24500. * symbols of `object`.
  24501. *
  24502. * @private
  24503. * @param {Object} object The object to query.
  24504. * @returns {Array} Returns the array of property names and symbols.
  24505. */
  24506. function getAllKeysIn(object) {
  24507. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  24508. }
  24509. /**
  24510. * Gets metadata for `func`.
  24511. *
  24512. * @private
  24513. * @param {Function} func The function to query.
  24514. * @returns {*} Returns the metadata for `func`.
  24515. */
  24516. var getData = !metaMap ? noop : function(func) {
  24517. return metaMap.get(func);
  24518. };
  24519. /**
  24520. * Gets the name of `func`.
  24521. *
  24522. * @private
  24523. * @param {Function} func The function to query.
  24524. * @returns {string} Returns the function name.
  24525. */
  24526. function getFuncName(func) {
  24527. var result = (func.name + ''),
  24528. array = realNames[result],
  24529. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  24530. while (length--) {
  24531. var data = array[length],
  24532. otherFunc = data.func;
  24533. if (otherFunc == null || otherFunc == func) {
  24534. return data.name;
  24535. }
  24536. }
  24537. return result;
  24538. }
  24539. /**
  24540. * Gets the argument placeholder value for `func`.
  24541. *
  24542. * @private
  24543. * @param {Function} func The function to inspect.
  24544. * @returns {*} Returns the placeholder value.
  24545. */
  24546. function getHolder(func) {
  24547. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  24548. return object.placeholder;
  24549. }
  24550. /**
  24551. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  24552. * this function returns the custom method, otherwise it returns `baseIteratee`.
  24553. * If arguments are provided, the chosen function is invoked with them and
  24554. * its result is returned.
  24555. *
  24556. * @private
  24557. * @param {*} [value] The value to convert to an iteratee.
  24558. * @param {number} [arity] The arity of the created iteratee.
  24559. * @returns {Function} Returns the chosen function or its result.
  24560. */
  24561. function getIteratee() {
  24562. var result = lodash.iteratee || iteratee;
  24563. result = result === iteratee ? baseIteratee : result;
  24564. return arguments.length ? result(arguments[0], arguments[1]) : result;
  24565. }
  24566. /**
  24567. * Gets the data for `map`.
  24568. *
  24569. * @private
  24570. * @param {Object} map The map to query.
  24571. * @param {string} key The reference key.
  24572. * @returns {*} Returns the map data.
  24573. */
  24574. function getMapData(map, key) {
  24575. var data = map.__data__;
  24576. return isKeyable(key)
  24577. ? data[typeof key == 'string' ? 'string' : 'hash']
  24578. : data.map;
  24579. }
  24580. /**
  24581. * Gets the property names, values, and compare flags of `object`.
  24582. *
  24583. * @private
  24584. * @param {Object} object The object to query.
  24585. * @returns {Array} Returns the match data of `object`.
  24586. */
  24587. function getMatchData(object) {
  24588. var result = keys(object),
  24589. length = result.length;
  24590. while (length--) {
  24591. var key = result[length],
  24592. value = object[key];
  24593. result[length] = [key, value, isStrictComparable(value)];
  24594. }
  24595. return result;
  24596. }
  24597. /**
  24598. * Gets the native function at `key` of `object`.
  24599. *
  24600. * @private
  24601. * @param {Object} object The object to query.
  24602. * @param {string} key The key of the method to get.
  24603. * @returns {*} Returns the function if it's native, else `undefined`.
  24604. */
  24605. function getNative(object, key) {
  24606. var value = getValue(object, key);
  24607. return baseIsNative(value) ? value : undefined;
  24608. }
  24609. /**
  24610. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  24611. *
  24612. * @private
  24613. * @param {*} value The value to query.
  24614. * @returns {string} Returns the raw `toStringTag`.
  24615. */
  24616. function getRawTag(value) {
  24617. var isOwn = hasOwnProperty.call(value, symToStringTag),
  24618. tag = value[symToStringTag];
  24619. try {
  24620. value[symToStringTag] = undefined;
  24621. var unmasked = true;
  24622. } catch (e) {}
  24623. var result = nativeObjectToString.call(value);
  24624. if (unmasked) {
  24625. if (isOwn) {
  24626. value[symToStringTag] = tag;
  24627. } else {
  24628. delete value[symToStringTag];
  24629. }
  24630. }
  24631. return result;
  24632. }
  24633. /**
  24634. * Creates an array of the own enumerable symbols of `object`.
  24635. *
  24636. * @private
  24637. * @param {Object} object The object to query.
  24638. * @returns {Array} Returns the array of symbols.
  24639. */
  24640. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  24641. if (object == null) {
  24642. return [];
  24643. }
  24644. object = Object(object);
  24645. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  24646. return propertyIsEnumerable.call(object, symbol);
  24647. });
  24648. };
  24649. /**
  24650. * Creates an array of the own and inherited enumerable symbols of `object`.
  24651. *
  24652. * @private
  24653. * @param {Object} object The object to query.
  24654. * @returns {Array} Returns the array of symbols.
  24655. */
  24656. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  24657. var result = [];
  24658. while (object) {
  24659. arrayPush(result, getSymbols(object));
  24660. object = getPrototype(object);
  24661. }
  24662. return result;
  24663. };
  24664. /**
  24665. * Gets the `toStringTag` of `value`.
  24666. *
  24667. * @private
  24668. * @param {*} value The value to query.
  24669. * @returns {string} Returns the `toStringTag`.
  24670. */
  24671. var getTag = baseGetTag;
  24672. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  24673. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  24674. (Map && getTag(new Map) != mapTag) ||
  24675. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  24676. (Set && getTag(new Set) != setTag) ||
  24677. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  24678. getTag = function(value) {
  24679. var result = baseGetTag(value),
  24680. Ctor = result == objectTag ? value.constructor : undefined,
  24681. ctorString = Ctor ? toSource(Ctor) : '';
  24682. if (ctorString) {
  24683. switch (ctorString) {
  24684. case dataViewCtorString: return dataViewTag;
  24685. case mapCtorString: return mapTag;
  24686. case promiseCtorString: return promiseTag;
  24687. case setCtorString: return setTag;
  24688. case weakMapCtorString: return weakMapTag;
  24689. }
  24690. }
  24691. return result;
  24692. };
  24693. }
  24694. /**
  24695. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  24696. *
  24697. * @private
  24698. * @param {number} start The start of the view.
  24699. * @param {number} end The end of the view.
  24700. * @param {Array} transforms The transformations to apply to the view.
  24701. * @returns {Object} Returns an object containing the `start` and `end`
  24702. * positions of the view.
  24703. */
  24704. function getView(start, end, transforms) {
  24705. var index = -1,
  24706. length = transforms.length;
  24707. while (++index < length) {
  24708. var data = transforms[index],
  24709. size = data.size;
  24710. switch (data.type) {
  24711. case 'drop': start += size; break;
  24712. case 'dropRight': end -= size; break;
  24713. case 'take': end = nativeMin(end, start + size); break;
  24714. case 'takeRight': start = nativeMax(start, end - size); break;
  24715. }
  24716. }
  24717. return { 'start': start, 'end': end };
  24718. }
  24719. /**
  24720. * Extracts wrapper details from the `source` body comment.
  24721. *
  24722. * @private
  24723. * @param {string} source The source to inspect.
  24724. * @returns {Array} Returns the wrapper details.
  24725. */
  24726. function getWrapDetails(source) {
  24727. var match = source.match(reWrapDetails);
  24728. return match ? match[1].split(reSplitDetails) : [];
  24729. }
  24730. /**
  24731. * Checks if `path` exists on `object`.
  24732. *
  24733. * @private
  24734. * @param {Object} object The object to query.
  24735. * @param {Array|string} path The path to check.
  24736. * @param {Function} hasFunc The function to check properties.
  24737. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  24738. */
  24739. function hasPath(object, path, hasFunc) {
  24740. path = castPath(path, object);
  24741. var index = -1,
  24742. length = path.length,
  24743. result = false;
  24744. while (++index < length) {
  24745. var key = toKey(path[index]);
  24746. if (!(result = object != null && hasFunc(object, key))) {
  24747. break;
  24748. }
  24749. object = object[key];
  24750. }
  24751. if (result || ++index != length) {
  24752. return result;
  24753. }
  24754. length = object == null ? 0 : object.length;
  24755. return !!length && isLength(length) && isIndex(key, length) &&
  24756. (isArray(object) || isArguments(object));
  24757. }
  24758. /**
  24759. * Initializes an array clone.
  24760. *
  24761. * @private
  24762. * @param {Array} array The array to clone.
  24763. * @returns {Array} Returns the initialized clone.
  24764. */
  24765. function initCloneArray(array) {
  24766. var length = array.length,
  24767. result = new array.constructor(length);
  24768. // Add properties assigned by `RegExp#exec`.
  24769. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  24770. result.index = array.index;
  24771. result.input = array.input;
  24772. }
  24773. return result;
  24774. }
  24775. /**
  24776. * Initializes an object clone.
  24777. *
  24778. * @private
  24779. * @param {Object} object The object to clone.
  24780. * @returns {Object} Returns the initialized clone.
  24781. */
  24782. function initCloneObject(object) {
  24783. return (typeof object.constructor == 'function' && !isPrototype(object))
  24784. ? baseCreate(getPrototype(object))
  24785. : {};
  24786. }
  24787. /**
  24788. * Initializes an object clone based on its `toStringTag`.
  24789. *
  24790. * **Note:** This function only supports cloning values with tags of
  24791. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  24792. *
  24793. * @private
  24794. * @param {Object} object The object to clone.
  24795. * @param {string} tag The `toStringTag` of the object to clone.
  24796. * @param {boolean} [isDeep] Specify a deep clone.
  24797. * @returns {Object} Returns the initialized clone.
  24798. */
  24799. function initCloneByTag(object, tag, isDeep) {
  24800. var Ctor = object.constructor;
  24801. switch (tag) {
  24802. case arrayBufferTag:
  24803. return cloneArrayBuffer(object);
  24804. case boolTag:
  24805. case dateTag:
  24806. return new Ctor(+object);
  24807. case dataViewTag:
  24808. return cloneDataView(object, isDeep);
  24809. case float32Tag: case float64Tag:
  24810. case int8Tag: case int16Tag: case int32Tag:
  24811. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  24812. return cloneTypedArray(object, isDeep);
  24813. case mapTag:
  24814. return new Ctor;
  24815. case numberTag:
  24816. case stringTag:
  24817. return new Ctor(object);
  24818. case regexpTag:
  24819. return cloneRegExp(object);
  24820. case setTag:
  24821. return new Ctor;
  24822. case symbolTag:
  24823. return cloneSymbol(object);
  24824. }
  24825. }
  24826. /**
  24827. * Inserts wrapper `details` in a comment at the top of the `source` body.
  24828. *
  24829. * @private
  24830. * @param {string} source The source to modify.
  24831. * @returns {Array} details The details to insert.
  24832. * @returns {string} Returns the modified source.
  24833. */
  24834. function insertWrapDetails(source, details) {
  24835. var length = details.length;
  24836. if (!length) {
  24837. return source;
  24838. }
  24839. var lastIndex = length - 1;
  24840. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  24841. details = details.join(length > 2 ? ', ' : ' ');
  24842. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  24843. }
  24844. /**
  24845. * Checks if `value` is a flattenable `arguments` object or array.
  24846. *
  24847. * @private
  24848. * @param {*} value The value to check.
  24849. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  24850. */
  24851. function isFlattenable(value) {
  24852. return isArray(value) || isArguments(value) ||
  24853. !!(spreadableSymbol && value && value[spreadableSymbol]);
  24854. }
  24855. /**
  24856. * Checks if `value` is a valid array-like index.
  24857. *
  24858. * @private
  24859. * @param {*} value The value to check.
  24860. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  24861. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  24862. */
  24863. function isIndex(value, length) {
  24864. var type = typeof value;
  24865. length = length == null ? MAX_SAFE_INTEGER : length;
  24866. return !!length &&
  24867. (type == 'number' ||
  24868. (type != 'symbol' && reIsUint.test(value))) &&
  24869. (value > -1 && value % 1 == 0 && value < length);
  24870. }
  24871. /**
  24872. * Checks if the given arguments are from an iteratee call.
  24873. *
  24874. * @private
  24875. * @param {*} value The potential iteratee value argument.
  24876. * @param {*} index The potential iteratee index or key argument.
  24877. * @param {*} object The potential iteratee object argument.
  24878. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  24879. * else `false`.
  24880. */
  24881. function isIterateeCall(value, index, object) {
  24882. if (!isObject(object)) {
  24883. return false;
  24884. }
  24885. var type = typeof index;
  24886. if (type == 'number'
  24887. ? (isArrayLike(object) && isIndex(index, object.length))
  24888. : (type == 'string' && index in object)
  24889. ) {
  24890. return eq(object[index], value);
  24891. }
  24892. return false;
  24893. }
  24894. /**
  24895. * Checks if `value` is a property name and not a property path.
  24896. *
  24897. * @private
  24898. * @param {*} value The value to check.
  24899. * @param {Object} [object] The object to query keys on.
  24900. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  24901. */
  24902. function isKey(value, object) {
  24903. if (isArray(value)) {
  24904. return false;
  24905. }
  24906. var type = typeof value;
  24907. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  24908. value == null || isSymbol(value)) {
  24909. return true;
  24910. }
  24911. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  24912. (object != null && value in Object(object));
  24913. }
  24914. /**
  24915. * Checks if `value` is suitable for use as unique object key.
  24916. *
  24917. * @private
  24918. * @param {*} value The value to check.
  24919. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  24920. */
  24921. function isKeyable(value) {
  24922. var type = typeof value;
  24923. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  24924. ? (value !== '__proto__')
  24925. : (value === null);
  24926. }
  24927. /**
  24928. * Checks if `func` has a lazy counterpart.
  24929. *
  24930. * @private
  24931. * @param {Function} func The function to check.
  24932. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  24933. * else `false`.
  24934. */
  24935. function isLaziable(func) {
  24936. var funcName = getFuncName(func),
  24937. other = lodash[funcName];
  24938. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  24939. return false;
  24940. }
  24941. if (func === other) {
  24942. return true;
  24943. }
  24944. var data = getData(other);
  24945. return !!data && func === data[0];
  24946. }
  24947. /**
  24948. * Checks if `func` has its source masked.
  24949. *
  24950. * @private
  24951. * @param {Function} func The function to check.
  24952. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  24953. */
  24954. function isMasked(func) {
  24955. return !!maskSrcKey && (maskSrcKey in func);
  24956. }
  24957. /**
  24958. * Checks if `func` is capable of being masked.
  24959. *
  24960. * @private
  24961. * @param {*} value The value to check.
  24962. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  24963. */
  24964. var isMaskable = coreJsData ? isFunction : stubFalse;
  24965. /**
  24966. * Checks if `value` is likely a prototype object.
  24967. *
  24968. * @private
  24969. * @param {*} value The value to check.
  24970. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  24971. */
  24972. function isPrototype(value) {
  24973. var Ctor = value && value.constructor,
  24974. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  24975. return value === proto;
  24976. }
  24977. /**
  24978. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  24979. *
  24980. * @private
  24981. * @param {*} value The value to check.
  24982. * @returns {boolean} Returns `true` if `value` if suitable for strict
  24983. * equality comparisons, else `false`.
  24984. */
  24985. function isStrictComparable(value) {
  24986. return value === value && !isObject(value);
  24987. }
  24988. /**
  24989. * A specialized version of `matchesProperty` for source values suitable
  24990. * for strict equality comparisons, i.e. `===`.
  24991. *
  24992. * @private
  24993. * @param {string} key The key of the property to get.
  24994. * @param {*} srcValue The value to match.
  24995. * @returns {Function} Returns the new spec function.
  24996. */
  24997. function matchesStrictComparable(key, srcValue) {
  24998. return function(object) {
  24999. if (object == null) {
  25000. return false;
  25001. }
  25002. return object[key] === srcValue &&
  25003. (srcValue !== undefined || (key in Object(object)));
  25004. };
  25005. }
  25006. /**
  25007. * A specialized version of `_.memoize` which clears the memoized function's
  25008. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  25009. *
  25010. * @private
  25011. * @param {Function} func The function to have its output memoized.
  25012. * @returns {Function} Returns the new memoized function.
  25013. */
  25014. function memoizeCapped(func) {
  25015. var result = memoize(func, function(key) {
  25016. if (cache.size === MAX_MEMOIZE_SIZE) {
  25017. cache.clear();
  25018. }
  25019. return key;
  25020. });
  25021. var cache = result.cache;
  25022. return result;
  25023. }
  25024. /**
  25025. * Merges the function metadata of `source` into `data`.
  25026. *
  25027. * Merging metadata reduces the number of wrappers used to invoke a function.
  25028. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  25029. * may be applied regardless of execution order. Methods like `_.ary` and
  25030. * `_.rearg` modify function arguments, making the order in which they are
  25031. * executed important, preventing the merging of metadata. However, we make
  25032. * an exception for a safe combined case where curried functions have `_.ary`
  25033. * and or `_.rearg` applied.
  25034. *
  25035. * @private
  25036. * @param {Array} data The destination metadata.
  25037. * @param {Array} source The source metadata.
  25038. * @returns {Array} Returns `data`.
  25039. */
  25040. function mergeData(data, source) {
  25041. var bitmask = data[1],
  25042. srcBitmask = source[1],
  25043. newBitmask = bitmask | srcBitmask,
  25044. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  25045. var isCombo =
  25046. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  25047. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  25048. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  25049. // Exit early if metadata can't be merged.
  25050. if (!(isCommon || isCombo)) {
  25051. return data;
  25052. }
  25053. // Use source `thisArg` if available.
  25054. if (srcBitmask & WRAP_BIND_FLAG) {
  25055. data[2] = source[2];
  25056. // Set when currying a bound function.
  25057. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  25058. }
  25059. // Compose partial arguments.
  25060. var value = source[3];
  25061. if (value) {
  25062. var partials = data[3];
  25063. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  25064. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  25065. }
  25066. // Compose partial right arguments.
  25067. value = source[5];
  25068. if (value) {
  25069. partials = data[5];
  25070. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  25071. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  25072. }
  25073. // Use source `argPos` if available.
  25074. value = source[7];
  25075. if (value) {
  25076. data[7] = value;
  25077. }
  25078. // Use source `ary` if it's smaller.
  25079. if (srcBitmask & WRAP_ARY_FLAG) {
  25080. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  25081. }
  25082. // Use source `arity` if one is not provided.
  25083. if (data[9] == null) {
  25084. data[9] = source[9];
  25085. }
  25086. // Use source `func` and merge bitmasks.
  25087. data[0] = source[0];
  25088. data[1] = newBitmask;
  25089. return data;
  25090. }
  25091. /**
  25092. * This function is like
  25093. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  25094. * except that it includes inherited enumerable properties.
  25095. *
  25096. * @private
  25097. * @param {Object} object The object to query.
  25098. * @returns {Array} Returns the array of property names.
  25099. */
  25100. function nativeKeysIn(object) {
  25101. var result = [];
  25102. if (object != null) {
  25103. for (var key in Object(object)) {
  25104. result.push(key);
  25105. }
  25106. }
  25107. return result;
  25108. }
  25109. /**
  25110. * Converts `value` to a string using `Object.prototype.toString`.
  25111. *
  25112. * @private
  25113. * @param {*} value The value to convert.
  25114. * @returns {string} Returns the converted string.
  25115. */
  25116. function objectToString(value) {
  25117. return nativeObjectToString.call(value);
  25118. }
  25119. /**
  25120. * A specialized version of `baseRest` which transforms the rest array.
  25121. *
  25122. * @private
  25123. * @param {Function} func The function to apply a rest parameter to.
  25124. * @param {number} [start=func.length-1] The start position of the rest parameter.
  25125. * @param {Function} transform The rest array transform.
  25126. * @returns {Function} Returns the new function.
  25127. */
  25128. function overRest(func, start, transform) {
  25129. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  25130. return function() {
  25131. var args = arguments,
  25132. index = -1,
  25133. length = nativeMax(args.length - start, 0),
  25134. array = Array(length);
  25135. while (++index < length) {
  25136. array[index] = args[start + index];
  25137. }
  25138. index = -1;
  25139. var otherArgs = Array(start + 1);
  25140. while (++index < start) {
  25141. otherArgs[index] = args[index];
  25142. }
  25143. otherArgs[start] = transform(array);
  25144. return apply(func, this, otherArgs);
  25145. };
  25146. }
  25147. /**
  25148. * Gets the parent value at `path` of `object`.
  25149. *
  25150. * @private
  25151. * @param {Object} object The object to query.
  25152. * @param {Array} path The path to get the parent value of.
  25153. * @returns {*} Returns the parent value.
  25154. */
  25155. function parent(object, path) {
  25156. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  25157. }
  25158. /**
  25159. * Reorder `array` according to the specified indexes where the element at
  25160. * the first index is assigned as the first element, the element at
  25161. * the second index is assigned as the second element, and so on.
  25162. *
  25163. * @private
  25164. * @param {Array} array The array to reorder.
  25165. * @param {Array} indexes The arranged array indexes.
  25166. * @returns {Array} Returns `array`.
  25167. */
  25168. function reorder(array, indexes) {
  25169. var arrLength = array.length,
  25170. length = nativeMin(indexes.length, arrLength),
  25171. oldArray = copyArray(array);
  25172. while (length--) {
  25173. var index = indexes[length];
  25174. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  25175. }
  25176. return array;
  25177. }
  25178. /**
  25179. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  25180. *
  25181. * @private
  25182. * @param {Object} object The object to query.
  25183. * @param {string} key The key of the property to get.
  25184. * @returns {*} Returns the property value.
  25185. */
  25186. function safeGet(object, key) {
  25187. if (key === 'constructor' && typeof object[key] === 'function') {
  25188. return;
  25189. }
  25190. if (key == '__proto__') {
  25191. return;
  25192. }
  25193. return object[key];
  25194. }
  25195. /**
  25196. * Sets metadata for `func`.
  25197. *
  25198. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  25199. * period of time, it will trip its breaker and transition to an identity
  25200. * function to avoid garbage collection pauses in V8. See
  25201. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  25202. * for more details.
  25203. *
  25204. * @private
  25205. * @param {Function} func The function to associate metadata with.
  25206. * @param {*} data The metadata.
  25207. * @returns {Function} Returns `func`.
  25208. */
  25209. var setData = shortOut(baseSetData);
  25210. /**
  25211. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  25212. *
  25213. * @private
  25214. * @param {Function} func The function to delay.
  25215. * @param {number} wait The number of milliseconds to delay invocation.
  25216. * @returns {number|Object} Returns the timer id or timeout object.
  25217. */
  25218. var setTimeout = ctxSetTimeout || function(func, wait) {
  25219. return root.setTimeout(func, wait);
  25220. };
  25221. /**
  25222. * Sets the `toString` method of `func` to return `string`.
  25223. *
  25224. * @private
  25225. * @param {Function} func The function to modify.
  25226. * @param {Function} string The `toString` result.
  25227. * @returns {Function} Returns `func`.
  25228. */
  25229. var setToString = shortOut(baseSetToString);
  25230. /**
  25231. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  25232. * with wrapper details in a comment at the top of the source body.
  25233. *
  25234. * @private
  25235. * @param {Function} wrapper The function to modify.
  25236. * @param {Function} reference The reference function.
  25237. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  25238. * @returns {Function} Returns `wrapper`.
  25239. */
  25240. function setWrapToString(wrapper, reference, bitmask) {
  25241. var source = (reference + '');
  25242. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  25243. }
  25244. /**
  25245. * Creates a function that'll short out and invoke `identity` instead
  25246. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  25247. * milliseconds.
  25248. *
  25249. * @private
  25250. * @param {Function} func The function to restrict.
  25251. * @returns {Function} Returns the new shortable function.
  25252. */
  25253. function shortOut(func) {
  25254. var count = 0,
  25255. lastCalled = 0;
  25256. return function() {
  25257. var stamp = nativeNow(),
  25258. remaining = HOT_SPAN - (stamp - lastCalled);
  25259. lastCalled = stamp;
  25260. if (remaining > 0) {
  25261. if (++count >= HOT_COUNT) {
  25262. return arguments[0];
  25263. }
  25264. } else {
  25265. count = 0;
  25266. }
  25267. return func.apply(undefined, arguments);
  25268. };
  25269. }
  25270. /**
  25271. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  25272. *
  25273. * @private
  25274. * @param {Array} array The array to shuffle.
  25275. * @param {number} [size=array.length] The size of `array`.
  25276. * @returns {Array} Returns `array`.
  25277. */
  25278. function shuffleSelf(array, size) {
  25279. var index = -1,
  25280. length = array.length,
  25281. lastIndex = length - 1;
  25282. size = size === undefined ? length : size;
  25283. while (++index < size) {
  25284. var rand = baseRandom(index, lastIndex),
  25285. value = array[rand];
  25286. array[rand] = array[index];
  25287. array[index] = value;
  25288. }
  25289. array.length = size;
  25290. return array;
  25291. }
  25292. /**
  25293. * Converts `string` to a property path array.
  25294. *
  25295. * @private
  25296. * @param {string} string The string to convert.
  25297. * @returns {Array} Returns the property path array.
  25298. */
  25299. var stringToPath = memoizeCapped(function(string) {
  25300. var result = [];
  25301. if (string.charCodeAt(0) === 46 /* . */) {
  25302. result.push('');
  25303. }
  25304. string.replace(rePropName, function(match, number, quote, subString) {
  25305. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  25306. });
  25307. return result;
  25308. });
  25309. /**
  25310. * Converts `value` to a string key if it's not a string or symbol.
  25311. *
  25312. * @private
  25313. * @param {*} value The value to inspect.
  25314. * @returns {string|symbol} Returns the key.
  25315. */
  25316. function toKey(value) {
  25317. if (typeof value == 'string' || isSymbol(value)) {
  25318. return value;
  25319. }
  25320. var result = (value + '');
  25321. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  25322. }
  25323. /**
  25324. * Converts `func` to its source code.
  25325. *
  25326. * @private
  25327. * @param {Function} func The function to convert.
  25328. * @returns {string} Returns the source code.
  25329. */
  25330. function toSource(func) {
  25331. if (func != null) {
  25332. try {
  25333. return funcToString.call(func);
  25334. } catch (e) {}
  25335. try {
  25336. return (func + '');
  25337. } catch (e) {}
  25338. }
  25339. return '';
  25340. }
  25341. /**
  25342. * Updates wrapper `details` based on `bitmask` flags.
  25343. *
  25344. * @private
  25345. * @returns {Array} details The details to modify.
  25346. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  25347. * @returns {Array} Returns `details`.
  25348. */
  25349. function updateWrapDetails(details, bitmask) {
  25350. arrayEach(wrapFlags, function(pair) {
  25351. var value = '_.' + pair[0];
  25352. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  25353. details.push(value);
  25354. }
  25355. });
  25356. return details.sort();
  25357. }
  25358. /**
  25359. * Creates a clone of `wrapper`.
  25360. *
  25361. * @private
  25362. * @param {Object} wrapper The wrapper to clone.
  25363. * @returns {Object} Returns the cloned wrapper.
  25364. */
  25365. function wrapperClone(wrapper) {
  25366. if (wrapper instanceof LazyWrapper) {
  25367. return wrapper.clone();
  25368. }
  25369. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  25370. result.__actions__ = copyArray(wrapper.__actions__);
  25371. result.__index__ = wrapper.__index__;
  25372. result.__values__ = wrapper.__values__;
  25373. return result;
  25374. }
  25375. /*------------------------------------------------------------------------*/
  25376. /**
  25377. * Creates an array of elements split into groups the length of `size`.
  25378. * If `array` can't be split evenly, the final chunk will be the remaining
  25379. * elements.
  25380. *
  25381. * @static
  25382. * @memberOf _
  25383. * @since 3.0.0
  25384. * @category Array
  25385. * @param {Array} array The array to process.
  25386. * @param {number} [size=1] The length of each chunk
  25387. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  25388. * @returns {Array} Returns the new array of chunks.
  25389. * @example
  25390. *
  25391. * _.chunk(['a', 'b', 'c', 'd'], 2);
  25392. * // => [['a', 'b'], ['c', 'd']]
  25393. *
  25394. * _.chunk(['a', 'b', 'c', 'd'], 3);
  25395. * // => [['a', 'b', 'c'], ['d']]
  25396. */
  25397. function chunk(array, size, guard) {
  25398. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  25399. size = 1;
  25400. } else {
  25401. size = nativeMax(toInteger(size), 0);
  25402. }
  25403. var length = array == null ? 0 : array.length;
  25404. if (!length || size < 1) {
  25405. return [];
  25406. }
  25407. var index = 0,
  25408. resIndex = 0,
  25409. result = Array(nativeCeil(length / size));
  25410. while (index < length) {
  25411. result[resIndex++] = baseSlice(array, index, (index += size));
  25412. }
  25413. return result;
  25414. }
  25415. /**
  25416. * Creates an array with all falsey values removed. The values `false`, `null`,
  25417. * `0`, `""`, `undefined`, and `NaN` are falsey.
  25418. *
  25419. * @static
  25420. * @memberOf _
  25421. * @since 0.1.0
  25422. * @category Array
  25423. * @param {Array} array The array to compact.
  25424. * @returns {Array} Returns the new array of filtered values.
  25425. * @example
  25426. *
  25427. * _.compact([0, 1, false, 2, '', 3]);
  25428. * // => [1, 2, 3]
  25429. */
  25430. function compact(array) {
  25431. var index = -1,
  25432. length = array == null ? 0 : array.length,
  25433. resIndex = 0,
  25434. result = [];
  25435. while (++index < length) {
  25436. var value = array[index];
  25437. if (value) {
  25438. result[resIndex++] = value;
  25439. }
  25440. }
  25441. return result;
  25442. }
  25443. /**
  25444. * Creates a new array concatenating `array` with any additional arrays
  25445. * and/or values.
  25446. *
  25447. * @static
  25448. * @memberOf _
  25449. * @since 4.0.0
  25450. * @category Array
  25451. * @param {Array} array The array to concatenate.
  25452. * @param {...*} [values] The values to concatenate.
  25453. * @returns {Array} Returns the new concatenated array.
  25454. * @example
  25455. *
  25456. * var array = [1];
  25457. * var other = _.concat(array, 2, [3], [[4]]);
  25458. *
  25459. * console.log(other);
  25460. * // => [1, 2, 3, [4]]
  25461. *
  25462. * console.log(array);
  25463. * // => [1]
  25464. */
  25465. function concat() {
  25466. var length = arguments.length;
  25467. if (!length) {
  25468. return [];
  25469. }
  25470. var args = Array(length - 1),
  25471. array = arguments[0],
  25472. index = length;
  25473. while (index--) {
  25474. args[index - 1] = arguments[index];
  25475. }
  25476. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  25477. }
  25478. /**
  25479. * Creates an array of `array` values not included in the other given arrays
  25480. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  25481. * for equality comparisons. The order and references of result values are
  25482. * determined by the first array.
  25483. *
  25484. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  25485. *
  25486. * @static
  25487. * @memberOf _
  25488. * @since 0.1.0
  25489. * @category Array
  25490. * @param {Array} array The array to inspect.
  25491. * @param {...Array} [values] The values to exclude.
  25492. * @returns {Array} Returns the new array of filtered values.
  25493. * @see _.without, _.xor
  25494. * @example
  25495. *
  25496. * _.difference([2, 1], [2, 3]);
  25497. * // => [1]
  25498. */
  25499. var difference = baseRest(function(array, values) {
  25500. return isArrayLikeObject(array)
  25501. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  25502. : [];
  25503. });
  25504. /**
  25505. * This method is like `_.difference` except that it accepts `iteratee` which
  25506. * is invoked for each element of `array` and `values` to generate the criterion
  25507. * by which they're compared. The order and references of result values are
  25508. * determined by the first array. The iteratee is invoked with one argument:
  25509. * (value).
  25510. *
  25511. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  25512. *
  25513. * @static
  25514. * @memberOf _
  25515. * @since 4.0.0
  25516. * @category Array
  25517. * @param {Array} array The array to inspect.
  25518. * @param {...Array} [values] The values to exclude.
  25519. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  25520. * @returns {Array} Returns the new array of filtered values.
  25521. * @example
  25522. *
  25523. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  25524. * // => [1.2]
  25525. *
  25526. * // The `_.property` iteratee shorthand.
  25527. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  25528. * // => [{ 'x': 2 }]
  25529. */
  25530. var differenceBy = baseRest(function(array, values) {
  25531. var iteratee = last(values);
  25532. if (isArrayLikeObject(iteratee)) {
  25533. iteratee = undefined;
  25534. }
  25535. return isArrayLikeObject(array)
  25536. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  25537. : [];
  25538. });
  25539. /**
  25540. * This method is like `_.difference` except that it accepts `comparator`
  25541. * which is invoked to compare elements of `array` to `values`. The order and
  25542. * references of result values are determined by the first array. The comparator
  25543. * is invoked with two arguments: (arrVal, othVal).
  25544. *
  25545. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  25546. *
  25547. * @static
  25548. * @memberOf _
  25549. * @since 4.0.0
  25550. * @category Array
  25551. * @param {Array} array The array to inspect.
  25552. * @param {...Array} [values] The values to exclude.
  25553. * @param {Function} [comparator] The comparator invoked per element.
  25554. * @returns {Array} Returns the new array of filtered values.
  25555. * @example
  25556. *
  25557. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  25558. *
  25559. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  25560. * // => [{ 'x': 2, 'y': 1 }]
  25561. */
  25562. var differenceWith = baseRest(function(array, values) {
  25563. var comparator = last(values);
  25564. if (isArrayLikeObject(comparator)) {
  25565. comparator = undefined;
  25566. }
  25567. return isArrayLikeObject(array)
  25568. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  25569. : [];
  25570. });
  25571. /**
  25572. * Creates a slice of `array` with `n` elements dropped from the beginning.
  25573. *
  25574. * @static
  25575. * @memberOf _
  25576. * @since 0.5.0
  25577. * @category Array
  25578. * @param {Array} array The array to query.
  25579. * @param {number} [n=1] The number of elements to drop.
  25580. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  25581. * @returns {Array} Returns the slice of `array`.
  25582. * @example
  25583. *
  25584. * _.drop([1, 2, 3]);
  25585. * // => [2, 3]
  25586. *
  25587. * _.drop([1, 2, 3], 2);
  25588. * // => [3]
  25589. *
  25590. * _.drop([1, 2, 3], 5);
  25591. * // => []
  25592. *
  25593. * _.drop([1, 2, 3], 0);
  25594. * // => [1, 2, 3]
  25595. */
  25596. function drop(array, n, guard) {
  25597. var length = array == null ? 0 : array.length;
  25598. if (!length) {
  25599. return [];
  25600. }
  25601. n = (guard || n === undefined) ? 1 : toInteger(n);
  25602. return baseSlice(array, n < 0 ? 0 : n, length);
  25603. }
  25604. /**
  25605. * Creates a slice of `array` with `n` elements dropped from the end.
  25606. *
  25607. * @static
  25608. * @memberOf _
  25609. * @since 3.0.0
  25610. * @category Array
  25611. * @param {Array} array The array to query.
  25612. * @param {number} [n=1] The number of elements to drop.
  25613. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  25614. * @returns {Array} Returns the slice of `array`.
  25615. * @example
  25616. *
  25617. * _.dropRight([1, 2, 3]);
  25618. * // => [1, 2]
  25619. *
  25620. * _.dropRight([1, 2, 3], 2);
  25621. * // => [1]
  25622. *
  25623. * _.dropRight([1, 2, 3], 5);
  25624. * // => []
  25625. *
  25626. * _.dropRight([1, 2, 3], 0);
  25627. * // => [1, 2, 3]
  25628. */
  25629. function dropRight(array, n, guard) {
  25630. var length = array == null ? 0 : array.length;
  25631. if (!length) {
  25632. return [];
  25633. }
  25634. n = (guard || n === undefined) ? 1 : toInteger(n);
  25635. n = length - n;
  25636. return baseSlice(array, 0, n < 0 ? 0 : n);
  25637. }
  25638. /**
  25639. * Creates a slice of `array` excluding elements dropped from the end.
  25640. * Elements are dropped until `predicate` returns falsey. The predicate is
  25641. * invoked with three arguments: (value, index, array).
  25642. *
  25643. * @static
  25644. * @memberOf _
  25645. * @since 3.0.0
  25646. * @category Array
  25647. * @param {Array} array The array to query.
  25648. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  25649. * @returns {Array} Returns the slice of `array`.
  25650. * @example
  25651. *
  25652. * var users = [
  25653. * { 'user': 'barney', 'active': true },
  25654. * { 'user': 'fred', 'active': false },
  25655. * { 'user': 'pebbles', 'active': false }
  25656. * ];
  25657. *
  25658. * _.dropRightWhile(users, function(o) { return !o.active; });
  25659. * // => objects for ['barney']
  25660. *
  25661. * // The `_.matches` iteratee shorthand.
  25662. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  25663. * // => objects for ['barney', 'fred']
  25664. *
  25665. * // The `_.matchesProperty` iteratee shorthand.
  25666. * _.dropRightWhile(users, ['active', false]);
  25667. * // => objects for ['barney']
  25668. *
  25669. * // The `_.property` iteratee shorthand.
  25670. * _.dropRightWhile(users, 'active');
  25671. * // => objects for ['barney', 'fred', 'pebbles']
  25672. */
  25673. function dropRightWhile(array, predicate) {
  25674. return (array && array.length)
  25675. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  25676. : [];
  25677. }
  25678. /**
  25679. * Creates a slice of `array` excluding elements dropped from the beginning.
  25680. * Elements are dropped until `predicate` returns falsey. The predicate is
  25681. * invoked with three arguments: (value, index, array).
  25682. *
  25683. * @static
  25684. * @memberOf _
  25685. * @since 3.0.0
  25686. * @category Array
  25687. * @param {Array} array The array to query.
  25688. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  25689. * @returns {Array} Returns the slice of `array`.
  25690. * @example
  25691. *
  25692. * var users = [
  25693. * { 'user': 'barney', 'active': false },
  25694. * { 'user': 'fred', 'active': false },
  25695. * { 'user': 'pebbles', 'active': true }
  25696. * ];
  25697. *
  25698. * _.dropWhile(users, function(o) { return !o.active; });
  25699. * // => objects for ['pebbles']
  25700. *
  25701. * // The `_.matches` iteratee shorthand.
  25702. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  25703. * // => objects for ['fred', 'pebbles']
  25704. *
  25705. * // The `_.matchesProperty` iteratee shorthand.
  25706. * _.dropWhile(users, ['active', false]);
  25707. * // => objects for ['pebbles']
  25708. *
  25709. * // The `_.property` iteratee shorthand.
  25710. * _.dropWhile(users, 'active');
  25711. * // => objects for ['barney', 'fred', 'pebbles']
  25712. */
  25713. function dropWhile(array, predicate) {
  25714. return (array && array.length)
  25715. ? baseWhile(array, getIteratee(predicate, 3), true)
  25716. : [];
  25717. }
  25718. /**
  25719. * Fills elements of `array` with `value` from `start` up to, but not
  25720. * including, `end`.
  25721. *
  25722. * **Note:** This method mutates `array`.
  25723. *
  25724. * @static
  25725. * @memberOf _
  25726. * @since 3.2.0
  25727. * @category Array
  25728. * @param {Array} array The array to fill.
  25729. * @param {*} value The value to fill `array` with.
  25730. * @param {number} [start=0] The start position.
  25731. * @param {number} [end=array.length] The end position.
  25732. * @returns {Array} Returns `array`.
  25733. * @example
  25734. *
  25735. * var array = [1, 2, 3];
  25736. *
  25737. * _.fill(array, 'a');
  25738. * console.log(array);
  25739. * // => ['a', 'a', 'a']
  25740. *
  25741. * _.fill(Array(3), 2);
  25742. * // => [2, 2, 2]
  25743. *
  25744. * _.fill([4, 6, 8, 10], '*', 1, 3);
  25745. * // => [4, '*', '*', 10]
  25746. */
  25747. function fill(array, value, start, end) {
  25748. var length = array == null ? 0 : array.length;
  25749. if (!length) {
  25750. return [];
  25751. }
  25752. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  25753. start = 0;
  25754. end = length;
  25755. }
  25756. return baseFill(array, value, start, end);
  25757. }
  25758. /**
  25759. * This method is like `_.find` except that it returns the index of the first
  25760. * element `predicate` returns truthy for instead of the element itself.
  25761. *
  25762. * @static
  25763. * @memberOf _
  25764. * @since 1.1.0
  25765. * @category Array
  25766. * @param {Array} array The array to inspect.
  25767. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  25768. * @param {number} [fromIndex=0] The index to search from.
  25769. * @returns {number} Returns the index of the found element, else `-1`.
  25770. * @example
  25771. *
  25772. * var users = [
  25773. * { 'user': 'barney', 'active': false },
  25774. * { 'user': 'fred', 'active': false },
  25775. * { 'user': 'pebbles', 'active': true }
  25776. * ];
  25777. *
  25778. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  25779. * // => 0
  25780. *
  25781. * // The `_.matches` iteratee shorthand.
  25782. * _.findIndex(users, { 'user': 'fred', 'active': false });
  25783. * // => 1
  25784. *
  25785. * // The `_.matchesProperty` iteratee shorthand.
  25786. * _.findIndex(users, ['active', false]);
  25787. * // => 0
  25788. *
  25789. * // The `_.property` iteratee shorthand.
  25790. * _.findIndex(users, 'active');
  25791. * // => 2
  25792. */
  25793. function findIndex(array, predicate, fromIndex) {
  25794. var length = array == null ? 0 : array.length;
  25795. if (!length) {
  25796. return -1;
  25797. }
  25798. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  25799. if (index < 0) {
  25800. index = nativeMax(length + index, 0);
  25801. }
  25802. return baseFindIndex(array, getIteratee(predicate, 3), index);
  25803. }
  25804. /**
  25805. * This method is like `_.findIndex` except that it iterates over elements
  25806. * of `collection` from right to left.
  25807. *
  25808. * @static
  25809. * @memberOf _
  25810. * @since 2.0.0
  25811. * @category Array
  25812. * @param {Array} array The array to inspect.
  25813. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  25814. * @param {number} [fromIndex=array.length-1] The index to search from.
  25815. * @returns {number} Returns the index of the found element, else `-1`.
  25816. * @example
  25817. *
  25818. * var users = [
  25819. * { 'user': 'barney', 'active': true },
  25820. * { 'user': 'fred', 'active': false },
  25821. * { 'user': 'pebbles', 'active': false }
  25822. * ];
  25823. *
  25824. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  25825. * // => 2
  25826. *
  25827. * // The `_.matches` iteratee shorthand.
  25828. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  25829. * // => 0
  25830. *
  25831. * // The `_.matchesProperty` iteratee shorthand.
  25832. * _.findLastIndex(users, ['active', false]);
  25833. * // => 2
  25834. *
  25835. * // The `_.property` iteratee shorthand.
  25836. * _.findLastIndex(users, 'active');
  25837. * // => 0
  25838. */
  25839. function findLastIndex(array, predicate, fromIndex) {
  25840. var length = array == null ? 0 : array.length;
  25841. if (!length) {
  25842. return -1;
  25843. }
  25844. var index = length - 1;
  25845. if (fromIndex !== undefined) {
  25846. index = toInteger(fromIndex);
  25847. index = fromIndex < 0
  25848. ? nativeMax(length + index, 0)
  25849. : nativeMin(index, length - 1);
  25850. }
  25851. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  25852. }
  25853. /**
  25854. * Flattens `array` a single level deep.
  25855. *
  25856. * @static
  25857. * @memberOf _
  25858. * @since 0.1.0
  25859. * @category Array
  25860. * @param {Array} array The array to flatten.
  25861. * @returns {Array} Returns the new flattened array.
  25862. * @example
  25863. *
  25864. * _.flatten([1, [2, [3, [4]], 5]]);
  25865. * // => [1, 2, [3, [4]], 5]
  25866. */
  25867. function flatten(array) {
  25868. var length = array == null ? 0 : array.length;
  25869. return length ? baseFlatten(array, 1) : [];
  25870. }
  25871. /**
  25872. * Recursively flattens `array`.
  25873. *
  25874. * @static
  25875. * @memberOf _
  25876. * @since 3.0.0
  25877. * @category Array
  25878. * @param {Array} array The array to flatten.
  25879. * @returns {Array} Returns the new flattened array.
  25880. * @example
  25881. *
  25882. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  25883. * // => [1, 2, 3, 4, 5]
  25884. */
  25885. function flattenDeep(array) {
  25886. var length = array == null ? 0 : array.length;
  25887. return length ? baseFlatten(array, INFINITY) : [];
  25888. }
  25889. /**
  25890. * Recursively flatten `array` up to `depth` times.
  25891. *
  25892. * @static
  25893. * @memberOf _
  25894. * @since 4.4.0
  25895. * @category Array
  25896. * @param {Array} array The array to flatten.
  25897. * @param {number} [depth=1] The maximum recursion depth.
  25898. * @returns {Array} Returns the new flattened array.
  25899. * @example
  25900. *
  25901. * var array = [1, [2, [3, [4]], 5]];
  25902. *
  25903. * _.flattenDepth(array, 1);
  25904. * // => [1, 2, [3, [4]], 5]
  25905. *
  25906. * _.flattenDepth(array, 2);
  25907. * // => [1, 2, 3, [4], 5]
  25908. */
  25909. function flattenDepth(array, depth) {
  25910. var length = array == null ? 0 : array.length;
  25911. if (!length) {
  25912. return [];
  25913. }
  25914. depth = depth === undefined ? 1 : toInteger(depth);
  25915. return baseFlatten(array, depth);
  25916. }
  25917. /**
  25918. * The inverse of `_.toPairs`; this method returns an object composed
  25919. * from key-value `pairs`.
  25920. *
  25921. * @static
  25922. * @memberOf _
  25923. * @since 4.0.0
  25924. * @category Array
  25925. * @param {Array} pairs The key-value pairs.
  25926. * @returns {Object} Returns the new object.
  25927. * @example
  25928. *
  25929. * _.fromPairs([['a', 1], ['b', 2]]);
  25930. * // => { 'a': 1, 'b': 2 }
  25931. */
  25932. function fromPairs(pairs) {
  25933. var index = -1,
  25934. length = pairs == null ? 0 : pairs.length,
  25935. result = {};
  25936. while (++index < length) {
  25937. var pair = pairs[index];
  25938. result[pair[0]] = pair[1];
  25939. }
  25940. return result;
  25941. }
  25942. /**
  25943. * Gets the first element of `array`.
  25944. *
  25945. * @static
  25946. * @memberOf _
  25947. * @since 0.1.0
  25948. * @alias first
  25949. * @category Array
  25950. * @param {Array} array The array to query.
  25951. * @returns {*} Returns the first element of `array`.
  25952. * @example
  25953. *
  25954. * _.head([1, 2, 3]);
  25955. * // => 1
  25956. *
  25957. * _.head([]);
  25958. * // => undefined
  25959. */
  25960. function head(array) {
  25961. return (array && array.length) ? array[0] : undefined;
  25962. }
  25963. /**
  25964. * Gets the index at which the first occurrence of `value` is found in `array`
  25965. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  25966. * for equality comparisons. If `fromIndex` is negative, it's used as the
  25967. * offset from the end of `array`.
  25968. *
  25969. * @static
  25970. * @memberOf _
  25971. * @since 0.1.0
  25972. * @category Array
  25973. * @param {Array} array The array to inspect.
  25974. * @param {*} value The value to search for.
  25975. * @param {number} [fromIndex=0] The index to search from.
  25976. * @returns {number} Returns the index of the matched value, else `-1`.
  25977. * @example
  25978. *
  25979. * _.indexOf([1, 2, 1, 2], 2);
  25980. * // => 1
  25981. *
  25982. * // Search from the `fromIndex`.
  25983. * _.indexOf([1, 2, 1, 2], 2, 2);
  25984. * // => 3
  25985. */
  25986. function indexOf(array, value, fromIndex) {
  25987. var length = array == null ? 0 : array.length;
  25988. if (!length) {
  25989. return -1;
  25990. }
  25991. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  25992. if (index < 0) {
  25993. index = nativeMax(length + index, 0);
  25994. }
  25995. return baseIndexOf(array, value, index);
  25996. }
  25997. /**
  25998. * Gets all but the last element of `array`.
  25999. *
  26000. * @static
  26001. * @memberOf _
  26002. * @since 0.1.0
  26003. * @category Array
  26004. * @param {Array} array The array to query.
  26005. * @returns {Array} Returns the slice of `array`.
  26006. * @example
  26007. *
  26008. * _.initial([1, 2, 3]);
  26009. * // => [1, 2]
  26010. */
  26011. function initial(array) {
  26012. var length = array == null ? 0 : array.length;
  26013. return length ? baseSlice(array, 0, -1) : [];
  26014. }
  26015. /**
  26016. * Creates an array of unique values that are included in all given arrays
  26017. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  26018. * for equality comparisons. The order and references of result values are
  26019. * determined by the first array.
  26020. *
  26021. * @static
  26022. * @memberOf _
  26023. * @since 0.1.0
  26024. * @category Array
  26025. * @param {...Array} [arrays] The arrays to inspect.
  26026. * @returns {Array} Returns the new array of intersecting values.
  26027. * @example
  26028. *
  26029. * _.intersection([2, 1], [2, 3]);
  26030. * // => [2]
  26031. */
  26032. var intersection = baseRest(function(arrays) {
  26033. var mapped = arrayMap(arrays, castArrayLikeObject);
  26034. return (mapped.length && mapped[0] === arrays[0])
  26035. ? baseIntersection(mapped)
  26036. : [];
  26037. });
  26038. /**
  26039. * This method is like `_.intersection` except that it accepts `iteratee`
  26040. * which is invoked for each element of each `arrays` to generate the criterion
  26041. * by which they're compared. The order and references of result values are
  26042. * determined by the first array. The iteratee is invoked with one argument:
  26043. * (value).
  26044. *
  26045. * @static
  26046. * @memberOf _
  26047. * @since 4.0.0
  26048. * @category Array
  26049. * @param {...Array} [arrays] The arrays to inspect.
  26050. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  26051. * @returns {Array} Returns the new array of intersecting values.
  26052. * @example
  26053. *
  26054. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  26055. * // => [2.1]
  26056. *
  26057. * // The `_.property` iteratee shorthand.
  26058. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  26059. * // => [{ 'x': 1 }]
  26060. */
  26061. var intersectionBy = baseRest(function(arrays) {
  26062. var iteratee = last(arrays),
  26063. mapped = arrayMap(arrays, castArrayLikeObject);
  26064. if (iteratee === last(mapped)) {
  26065. iteratee = undefined;
  26066. } else {
  26067. mapped.pop();
  26068. }
  26069. return (mapped.length && mapped[0] === arrays[0])
  26070. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  26071. : [];
  26072. });
  26073. /**
  26074. * This method is like `_.intersection` except that it accepts `comparator`
  26075. * which is invoked to compare elements of `arrays`. The order and references
  26076. * of result values are determined by the first array. The comparator is
  26077. * invoked with two arguments: (arrVal, othVal).
  26078. *
  26079. * @static
  26080. * @memberOf _
  26081. * @since 4.0.0
  26082. * @category Array
  26083. * @param {...Array} [arrays] The arrays to inspect.
  26084. * @param {Function} [comparator] The comparator invoked per element.
  26085. * @returns {Array} Returns the new array of intersecting values.
  26086. * @example
  26087. *
  26088. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  26089. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  26090. *
  26091. * _.intersectionWith(objects, others, _.isEqual);
  26092. * // => [{ 'x': 1, 'y': 2 }]
  26093. */
  26094. var intersectionWith = baseRest(function(arrays) {
  26095. var comparator = last(arrays),
  26096. mapped = arrayMap(arrays, castArrayLikeObject);
  26097. comparator = typeof comparator == 'function' ? comparator : undefined;
  26098. if (comparator) {
  26099. mapped.pop();
  26100. }
  26101. return (mapped.length && mapped[0] === arrays[0])
  26102. ? baseIntersection(mapped, undefined, comparator)
  26103. : [];
  26104. });
  26105. /**
  26106. * Converts all elements in `array` into a string separated by `separator`.
  26107. *
  26108. * @static
  26109. * @memberOf _
  26110. * @since 4.0.0
  26111. * @category Array
  26112. * @param {Array} array The array to convert.
  26113. * @param {string} [separator=','] The element separator.
  26114. * @returns {string} Returns the joined string.
  26115. * @example
  26116. *
  26117. * _.join(['a', 'b', 'c'], '~');
  26118. * // => 'a~b~c'
  26119. */
  26120. function join(array, separator) {
  26121. return array == null ? '' : nativeJoin.call(array, separator);
  26122. }
  26123. /**
  26124. * Gets the last element of `array`.
  26125. *
  26126. * @static
  26127. * @memberOf _
  26128. * @since 0.1.0
  26129. * @category Array
  26130. * @param {Array} array The array to query.
  26131. * @returns {*} Returns the last element of `array`.
  26132. * @example
  26133. *
  26134. * _.last([1, 2, 3]);
  26135. * // => 3
  26136. */
  26137. function last(array) {
  26138. var length = array == null ? 0 : array.length;
  26139. return length ? array[length - 1] : undefined;
  26140. }
  26141. /**
  26142. * This method is like `_.indexOf` except that it iterates over elements of
  26143. * `array` from right to left.
  26144. *
  26145. * @static
  26146. * @memberOf _
  26147. * @since 0.1.0
  26148. * @category Array
  26149. * @param {Array} array The array to inspect.
  26150. * @param {*} value The value to search for.
  26151. * @param {number} [fromIndex=array.length-1] The index to search from.
  26152. * @returns {number} Returns the index of the matched value, else `-1`.
  26153. * @example
  26154. *
  26155. * _.lastIndexOf([1, 2, 1, 2], 2);
  26156. * // => 3
  26157. *
  26158. * // Search from the `fromIndex`.
  26159. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  26160. * // => 1
  26161. */
  26162. function lastIndexOf(array, value, fromIndex) {
  26163. var length = array == null ? 0 : array.length;
  26164. if (!length) {
  26165. return -1;
  26166. }
  26167. var index = length;
  26168. if (fromIndex !== undefined) {
  26169. index = toInteger(fromIndex);
  26170. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  26171. }
  26172. return value === value
  26173. ? strictLastIndexOf(array, value, index)
  26174. : baseFindIndex(array, baseIsNaN, index, true);
  26175. }
  26176. /**
  26177. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  26178. * element from the end is returned.
  26179. *
  26180. * @static
  26181. * @memberOf _
  26182. * @since 4.11.0
  26183. * @category Array
  26184. * @param {Array} array The array to query.
  26185. * @param {number} [n=0] The index of the element to return.
  26186. * @returns {*} Returns the nth element of `array`.
  26187. * @example
  26188. *
  26189. * var array = ['a', 'b', 'c', 'd'];
  26190. *
  26191. * _.nth(array, 1);
  26192. * // => 'b'
  26193. *
  26194. * _.nth(array, -2);
  26195. * // => 'c';
  26196. */
  26197. function nth(array, n) {
  26198. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  26199. }
  26200. /**
  26201. * Removes all given values from `array` using
  26202. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  26203. * for equality comparisons.
  26204. *
  26205. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  26206. * to remove elements from an array by predicate.
  26207. *
  26208. * @static
  26209. * @memberOf _
  26210. * @since 2.0.0
  26211. * @category Array
  26212. * @param {Array} array The array to modify.
  26213. * @param {...*} [values] The values to remove.
  26214. * @returns {Array} Returns `array`.
  26215. * @example
  26216. *
  26217. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  26218. *
  26219. * _.pull(array, 'a', 'c');
  26220. * console.log(array);
  26221. * // => ['b', 'b']
  26222. */
  26223. var pull = baseRest(pullAll);
  26224. /**
  26225. * This method is like `_.pull` except that it accepts an array of values to remove.
  26226. *
  26227. * **Note:** Unlike `_.difference`, this method mutates `array`.
  26228. *
  26229. * @static
  26230. * @memberOf _
  26231. * @since 4.0.0
  26232. * @category Array
  26233. * @param {Array} array The array to modify.
  26234. * @param {Array} values The values to remove.
  26235. * @returns {Array} Returns `array`.
  26236. * @example
  26237. *
  26238. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  26239. *
  26240. * _.pullAll(array, ['a', 'c']);
  26241. * console.log(array);
  26242. * // => ['b', 'b']
  26243. */
  26244. function pullAll(array, values) {
  26245. return (array && array.length && values && values.length)
  26246. ? basePullAll(array, values)
  26247. : array;
  26248. }
  26249. /**
  26250. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  26251. * invoked for each element of `array` and `values` to generate the criterion
  26252. * by which they're compared. The iteratee is invoked with one argument: (value).
  26253. *
  26254. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  26255. *
  26256. * @static
  26257. * @memberOf _
  26258. * @since 4.0.0
  26259. * @category Array
  26260. * @param {Array} array The array to modify.
  26261. * @param {Array} values The values to remove.
  26262. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  26263. * @returns {Array} Returns `array`.
  26264. * @example
  26265. *
  26266. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  26267. *
  26268. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  26269. * console.log(array);
  26270. * // => [{ 'x': 2 }]
  26271. */
  26272. function pullAllBy(array, values, iteratee) {
  26273. return (array && array.length && values && values.length)
  26274. ? basePullAll(array, values, getIteratee(iteratee, 2))
  26275. : array;
  26276. }
  26277. /**
  26278. * This method is like `_.pullAll` except that it accepts `comparator` which
  26279. * is invoked to compare elements of `array` to `values`. The comparator is
  26280. * invoked with two arguments: (arrVal, othVal).
  26281. *
  26282. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  26283. *
  26284. * @static
  26285. * @memberOf _
  26286. * @since 4.6.0
  26287. * @category Array
  26288. * @param {Array} array The array to modify.
  26289. * @param {Array} values The values to remove.
  26290. * @param {Function} [comparator] The comparator invoked per element.
  26291. * @returns {Array} Returns `array`.
  26292. * @example
  26293. *
  26294. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  26295. *
  26296. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  26297. * console.log(array);
  26298. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  26299. */
  26300. function pullAllWith(array, values, comparator) {
  26301. return (array && array.length && values && values.length)
  26302. ? basePullAll(array, values, undefined, comparator)
  26303. : array;
  26304. }
  26305. /**
  26306. * Removes elements from `array` corresponding to `indexes` and returns an
  26307. * array of removed elements.
  26308. *
  26309. * **Note:** Unlike `_.at`, this method mutates `array`.
  26310. *
  26311. * @static
  26312. * @memberOf _
  26313. * @since 3.0.0
  26314. * @category Array
  26315. * @param {Array} array The array to modify.
  26316. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  26317. * @returns {Array} Returns the new array of removed elements.
  26318. * @example
  26319. *
  26320. * var array = ['a', 'b', 'c', 'd'];
  26321. * var pulled = _.pullAt(array, [1, 3]);
  26322. *
  26323. * console.log(array);
  26324. * // => ['a', 'c']
  26325. *
  26326. * console.log(pulled);
  26327. * // => ['b', 'd']
  26328. */
  26329. var pullAt = flatRest(function(array, indexes) {
  26330. var length = array == null ? 0 : array.length,
  26331. result = baseAt(array, indexes);
  26332. basePullAt(array, arrayMap(indexes, function(index) {
  26333. return isIndex(index, length) ? +index : index;
  26334. }).sort(compareAscending));
  26335. return result;
  26336. });
  26337. /**
  26338. * Removes all elements from `array` that `predicate` returns truthy for
  26339. * and returns an array of the removed elements. The predicate is invoked
  26340. * with three arguments: (value, index, array).
  26341. *
  26342. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  26343. * to pull elements from an array by value.
  26344. *
  26345. * @static
  26346. * @memberOf _
  26347. * @since 2.0.0
  26348. * @category Array
  26349. * @param {Array} array The array to modify.
  26350. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  26351. * @returns {Array} Returns the new array of removed elements.
  26352. * @example
  26353. *
  26354. * var array = [1, 2, 3, 4];
  26355. * var evens = _.remove(array, function(n) {
  26356. * return n % 2 == 0;
  26357. * });
  26358. *
  26359. * console.log(array);
  26360. * // => [1, 3]
  26361. *
  26362. * console.log(evens);
  26363. * // => [2, 4]
  26364. */
  26365. function remove(array, predicate) {
  26366. var result = [];
  26367. if (!(array && array.length)) {
  26368. return result;
  26369. }
  26370. var index = -1,
  26371. indexes = [],
  26372. length = array.length;
  26373. predicate = getIteratee(predicate, 3);
  26374. while (++index < length) {
  26375. var value = array[index];
  26376. if (predicate(value, index, array)) {
  26377. result.push(value);
  26378. indexes.push(index);
  26379. }
  26380. }
  26381. basePullAt(array, indexes);
  26382. return result;
  26383. }
  26384. /**
  26385. * Reverses `array` so that the first element becomes the last, the second
  26386. * element becomes the second to last, and so on.
  26387. *
  26388. * **Note:** This method mutates `array` and is based on
  26389. * [`Array#reverse`](https://mdn.io/Array/reverse).
  26390. *
  26391. * @static
  26392. * @memberOf _
  26393. * @since 4.0.0
  26394. * @category Array
  26395. * @param {Array} array The array to modify.
  26396. * @returns {Array} Returns `array`.
  26397. * @example
  26398. *
  26399. * var array = [1, 2, 3];
  26400. *
  26401. * _.reverse(array);
  26402. * // => [3, 2, 1]
  26403. *
  26404. * console.log(array);
  26405. * // => [3, 2, 1]
  26406. */
  26407. function reverse(array) {
  26408. return array == null ? array : nativeReverse.call(array);
  26409. }
  26410. /**
  26411. * Creates a slice of `array` from `start` up to, but not including, `end`.
  26412. *
  26413. * **Note:** This method is used instead of
  26414. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  26415. * returned.
  26416. *
  26417. * @static
  26418. * @memberOf _
  26419. * @since 3.0.0
  26420. * @category Array
  26421. * @param {Array} array The array to slice.
  26422. * @param {number} [start=0] The start position.
  26423. * @param {number} [end=array.length] The end position.
  26424. * @returns {Array} Returns the slice of `array`.
  26425. */
  26426. function slice(array, start, end) {
  26427. var length = array == null ? 0 : array.length;
  26428. if (!length) {
  26429. return [];
  26430. }
  26431. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  26432. start = 0;
  26433. end = length;
  26434. }
  26435. else {
  26436. start = start == null ? 0 : toInteger(start);
  26437. end = end === undefined ? length : toInteger(end);
  26438. }
  26439. return baseSlice(array, start, end);
  26440. }
  26441. /**
  26442. * Uses a binary search to determine the lowest index at which `value`
  26443. * should be inserted into `array` in order to maintain its sort order.
  26444. *
  26445. * @static
  26446. * @memberOf _
  26447. * @since 0.1.0
  26448. * @category Array
  26449. * @param {Array} array The sorted array to inspect.
  26450. * @param {*} value The value to evaluate.
  26451. * @returns {number} Returns the index at which `value` should be inserted
  26452. * into `array`.
  26453. * @example
  26454. *
  26455. * _.sortedIndex([30, 50], 40);
  26456. * // => 1
  26457. */
  26458. function sortedIndex(array, value) {
  26459. return baseSortedIndex(array, value);
  26460. }
  26461. /**
  26462. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  26463. * which is invoked for `value` and each element of `array` to compute their
  26464. * sort ranking. The iteratee is invoked with one argument: (value).
  26465. *
  26466. * @static
  26467. * @memberOf _
  26468. * @since 4.0.0
  26469. * @category Array
  26470. * @param {Array} array The sorted array to inspect.
  26471. * @param {*} value The value to evaluate.
  26472. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  26473. * @returns {number} Returns the index at which `value` should be inserted
  26474. * into `array`.
  26475. * @example
  26476. *
  26477. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  26478. *
  26479. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  26480. * // => 0
  26481. *
  26482. * // The `_.property` iteratee shorthand.
  26483. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  26484. * // => 0
  26485. */
  26486. function sortedIndexBy(array, value, iteratee) {
  26487. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  26488. }
  26489. /**
  26490. * This method is like `_.indexOf` except that it performs a binary
  26491. * search on a sorted `array`.
  26492. *
  26493. * @static
  26494. * @memberOf _
  26495. * @since 4.0.0
  26496. * @category Array
  26497. * @param {Array} array The array to inspect.
  26498. * @param {*} value The value to search for.
  26499. * @returns {number} Returns the index of the matched value, else `-1`.
  26500. * @example
  26501. *
  26502. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  26503. * // => 1
  26504. */
  26505. function sortedIndexOf(array, value) {
  26506. var length = array == null ? 0 : array.length;
  26507. if (length) {
  26508. var index = baseSortedIndex(array, value);
  26509. if (index < length && eq(array[index], value)) {
  26510. return index;
  26511. }
  26512. }
  26513. return -1;
  26514. }
  26515. /**
  26516. * This method is like `_.sortedIndex` except that it returns the highest
  26517. * index at which `value` should be inserted into `array` in order to
  26518. * maintain its sort order.
  26519. *
  26520. * @static
  26521. * @memberOf _
  26522. * @since 3.0.0
  26523. * @category Array
  26524. * @param {Array} array The sorted array to inspect.
  26525. * @param {*} value The value to evaluate.
  26526. * @returns {number} Returns the index at which `value` should be inserted
  26527. * into `array`.
  26528. * @example
  26529. *
  26530. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  26531. * // => 4
  26532. */
  26533. function sortedLastIndex(array, value) {
  26534. return baseSortedIndex(array, value, true);
  26535. }
  26536. /**
  26537. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  26538. * which is invoked for `value` and each element of `array` to compute their
  26539. * sort ranking. The iteratee is invoked with one argument: (value).
  26540. *
  26541. * @static
  26542. * @memberOf _
  26543. * @since 4.0.0
  26544. * @category Array
  26545. * @param {Array} array The sorted array to inspect.
  26546. * @param {*} value The value to evaluate.
  26547. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  26548. * @returns {number} Returns the index at which `value` should be inserted
  26549. * into `array`.
  26550. * @example
  26551. *
  26552. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  26553. *
  26554. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  26555. * // => 1
  26556. *
  26557. * // The `_.property` iteratee shorthand.
  26558. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  26559. * // => 1
  26560. */
  26561. function sortedLastIndexBy(array, value, iteratee) {
  26562. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  26563. }
  26564. /**
  26565. * This method is like `_.lastIndexOf` except that it performs a binary
  26566. * search on a sorted `array`.
  26567. *
  26568. * @static
  26569. * @memberOf _
  26570. * @since 4.0.0
  26571. * @category Array
  26572. * @param {Array} array The array to inspect.
  26573. * @param {*} value The value to search for.
  26574. * @returns {number} Returns the index of the matched value, else `-1`.
  26575. * @example
  26576. *
  26577. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  26578. * // => 3
  26579. */
  26580. function sortedLastIndexOf(array, value) {
  26581. var length = array == null ? 0 : array.length;
  26582. if (length) {
  26583. var index = baseSortedIndex(array, value, true) - 1;
  26584. if (eq(array[index], value)) {
  26585. return index;
  26586. }
  26587. }
  26588. return -1;
  26589. }
  26590. /**
  26591. * This method is like `_.uniq` except that it's designed and optimized
  26592. * for sorted arrays.
  26593. *
  26594. * @static
  26595. * @memberOf _
  26596. * @since 4.0.0
  26597. * @category Array
  26598. * @param {Array} array The array to inspect.
  26599. * @returns {Array} Returns the new duplicate free array.
  26600. * @example
  26601. *
  26602. * _.sortedUniq([1, 1, 2]);
  26603. * // => [1, 2]
  26604. */
  26605. function sortedUniq(array) {
  26606. return (array && array.length)
  26607. ? baseSortedUniq(array)
  26608. : [];
  26609. }
  26610. /**
  26611. * This method is like `_.uniqBy` except that it's designed and optimized
  26612. * for sorted arrays.
  26613. *
  26614. * @static
  26615. * @memberOf _
  26616. * @since 4.0.0
  26617. * @category Array
  26618. * @param {Array} array The array to inspect.
  26619. * @param {Function} [iteratee] The iteratee invoked per element.
  26620. * @returns {Array} Returns the new duplicate free array.
  26621. * @example
  26622. *
  26623. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  26624. * // => [1.1, 2.3]
  26625. */
  26626. function sortedUniqBy(array, iteratee) {
  26627. return (array && array.length)
  26628. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  26629. : [];
  26630. }
  26631. /**
  26632. * Gets all but the first element of `array`.
  26633. *
  26634. * @static
  26635. * @memberOf _
  26636. * @since 4.0.0
  26637. * @category Array
  26638. * @param {Array} array The array to query.
  26639. * @returns {Array} Returns the slice of `array`.
  26640. * @example
  26641. *
  26642. * _.tail([1, 2, 3]);
  26643. * // => [2, 3]
  26644. */
  26645. function tail(array) {
  26646. var length = array == null ? 0 : array.length;
  26647. return length ? baseSlice(array, 1, length) : [];
  26648. }
  26649. /**
  26650. * Creates a slice of `array` with `n` elements taken from the beginning.
  26651. *
  26652. * @static
  26653. * @memberOf _
  26654. * @since 0.1.0
  26655. * @category Array
  26656. * @param {Array} array The array to query.
  26657. * @param {number} [n=1] The number of elements to take.
  26658. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  26659. * @returns {Array} Returns the slice of `array`.
  26660. * @example
  26661. *
  26662. * _.take([1, 2, 3]);
  26663. * // => [1]
  26664. *
  26665. * _.take([1, 2, 3], 2);
  26666. * // => [1, 2]
  26667. *
  26668. * _.take([1, 2, 3], 5);
  26669. * // => [1, 2, 3]
  26670. *
  26671. * _.take([1, 2, 3], 0);
  26672. * // => []
  26673. */
  26674. function take(array, n, guard) {
  26675. if (!(array && array.length)) {
  26676. return [];
  26677. }
  26678. n = (guard || n === undefined) ? 1 : toInteger(n);
  26679. return baseSlice(array, 0, n < 0 ? 0 : n);
  26680. }
  26681. /**
  26682. * Creates a slice of `array` with `n` elements taken from the end.
  26683. *
  26684. * @static
  26685. * @memberOf _
  26686. * @since 3.0.0
  26687. * @category Array
  26688. * @param {Array} array The array to query.
  26689. * @param {number} [n=1] The number of elements to take.
  26690. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  26691. * @returns {Array} Returns the slice of `array`.
  26692. * @example
  26693. *
  26694. * _.takeRight([1, 2, 3]);
  26695. * // => [3]
  26696. *
  26697. * _.takeRight([1, 2, 3], 2);
  26698. * // => [2, 3]
  26699. *
  26700. * _.takeRight([1, 2, 3], 5);
  26701. * // => [1, 2, 3]
  26702. *
  26703. * _.takeRight([1, 2, 3], 0);
  26704. * // => []
  26705. */
  26706. function takeRight(array, n, guard) {
  26707. var length = array == null ? 0 : array.length;
  26708. if (!length) {
  26709. return [];
  26710. }
  26711. n = (guard || n === undefined) ? 1 : toInteger(n);
  26712. n = length - n;
  26713. return baseSlice(array, n < 0 ? 0 : n, length);
  26714. }
  26715. /**
  26716. * Creates a slice of `array` with elements taken from the end. Elements are
  26717. * taken until `predicate` returns falsey. The predicate is invoked with
  26718. * three arguments: (value, index, array).
  26719. *
  26720. * @static
  26721. * @memberOf _
  26722. * @since 3.0.0
  26723. * @category Array
  26724. * @param {Array} array The array to query.
  26725. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  26726. * @returns {Array} Returns the slice of `array`.
  26727. * @example
  26728. *
  26729. * var users = [
  26730. * { 'user': 'barney', 'active': true },
  26731. * { 'user': 'fred', 'active': false },
  26732. * { 'user': 'pebbles', 'active': false }
  26733. * ];
  26734. *
  26735. * _.takeRightWhile(users, function(o) { return !o.active; });
  26736. * // => objects for ['fred', 'pebbles']
  26737. *
  26738. * // The `_.matches` iteratee shorthand.
  26739. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  26740. * // => objects for ['pebbles']
  26741. *
  26742. * // The `_.matchesProperty` iteratee shorthand.
  26743. * _.takeRightWhile(users, ['active', false]);
  26744. * // => objects for ['fred', 'pebbles']
  26745. *
  26746. * // The `_.property` iteratee shorthand.
  26747. * _.takeRightWhile(users, 'active');
  26748. * // => []
  26749. */
  26750. function takeRightWhile(array, predicate) {
  26751. return (array && array.length)
  26752. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  26753. : [];
  26754. }
  26755. /**
  26756. * Creates a slice of `array` with elements taken from the beginning. Elements
  26757. * are taken until `predicate` returns falsey. The predicate is invoked with
  26758. * three arguments: (value, index, array).
  26759. *
  26760. * @static
  26761. * @memberOf _
  26762. * @since 3.0.0
  26763. * @category Array
  26764. * @param {Array} array The array to query.
  26765. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  26766. * @returns {Array} Returns the slice of `array`.
  26767. * @example
  26768. *
  26769. * var users = [
  26770. * { 'user': 'barney', 'active': false },
  26771. * { 'user': 'fred', 'active': false },
  26772. * { 'user': 'pebbles', 'active': true }
  26773. * ];
  26774. *
  26775. * _.takeWhile(users, function(o) { return !o.active; });
  26776. * // => objects for ['barney', 'fred']
  26777. *
  26778. * // The `_.matches` iteratee shorthand.
  26779. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  26780. * // => objects for ['barney']
  26781. *
  26782. * // The `_.matchesProperty` iteratee shorthand.
  26783. * _.takeWhile(users, ['active', false]);
  26784. * // => objects for ['barney', 'fred']
  26785. *
  26786. * // The `_.property` iteratee shorthand.
  26787. * _.takeWhile(users, 'active');
  26788. * // => []
  26789. */
  26790. function takeWhile(array, predicate) {
  26791. return (array && array.length)
  26792. ? baseWhile(array, getIteratee(predicate, 3))
  26793. : [];
  26794. }
  26795. /**
  26796. * Creates an array of unique values, in order, from all given arrays using
  26797. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  26798. * for equality comparisons.
  26799. *
  26800. * @static
  26801. * @memberOf _
  26802. * @since 0.1.0
  26803. * @category Array
  26804. * @param {...Array} [arrays] The arrays to inspect.
  26805. * @returns {Array} Returns the new array of combined values.
  26806. * @example
  26807. *
  26808. * _.union([2], [1, 2]);
  26809. * // => [2, 1]
  26810. */
  26811. var union = baseRest(function(arrays) {
  26812. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  26813. });
  26814. /**
  26815. * This method is like `_.union` except that it accepts `iteratee` which is
  26816. * invoked for each element of each `arrays` to generate the criterion by
  26817. * which uniqueness is computed. Result values are chosen from the first
  26818. * array in which the value occurs. The iteratee is invoked with one argument:
  26819. * (value).
  26820. *
  26821. * @static
  26822. * @memberOf _
  26823. * @since 4.0.0
  26824. * @category Array
  26825. * @param {...Array} [arrays] The arrays to inspect.
  26826. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  26827. * @returns {Array} Returns the new array of combined values.
  26828. * @example
  26829. *
  26830. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  26831. * // => [2.1, 1.2]
  26832. *
  26833. * // The `_.property` iteratee shorthand.
  26834. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  26835. * // => [{ 'x': 1 }, { 'x': 2 }]
  26836. */
  26837. var unionBy = baseRest(function(arrays) {
  26838. var iteratee = last(arrays);
  26839. if (isArrayLikeObject(iteratee)) {
  26840. iteratee = undefined;
  26841. }
  26842. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  26843. });
  26844. /**
  26845. * This method is like `_.union` except that it accepts `comparator` which
  26846. * is invoked to compare elements of `arrays`. Result values are chosen from
  26847. * the first array in which the value occurs. The comparator is invoked
  26848. * with two arguments: (arrVal, othVal).
  26849. *
  26850. * @static
  26851. * @memberOf _
  26852. * @since 4.0.0
  26853. * @category Array
  26854. * @param {...Array} [arrays] The arrays to inspect.
  26855. * @param {Function} [comparator] The comparator invoked per element.
  26856. * @returns {Array} Returns the new array of combined values.
  26857. * @example
  26858. *
  26859. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  26860. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  26861. *
  26862. * _.unionWith(objects, others, _.isEqual);
  26863. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  26864. */
  26865. var unionWith = baseRest(function(arrays) {
  26866. var comparator = last(arrays);
  26867. comparator = typeof comparator == 'function' ? comparator : undefined;
  26868. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  26869. });
  26870. /**
  26871. * Creates a duplicate-free version of an array, using
  26872. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  26873. * for equality comparisons, in which only the first occurrence of each element
  26874. * is kept. The order of result values is determined by the order they occur
  26875. * in the array.
  26876. *
  26877. * @static
  26878. * @memberOf _
  26879. * @since 0.1.0
  26880. * @category Array
  26881. * @param {Array} array The array to inspect.
  26882. * @returns {Array} Returns the new duplicate free array.
  26883. * @example
  26884. *
  26885. * _.uniq([2, 1, 2]);
  26886. * // => [2, 1]
  26887. */
  26888. function uniq(array) {
  26889. return (array && array.length) ? baseUniq(array) : [];
  26890. }
  26891. /**
  26892. * This method is like `_.uniq` except that it accepts `iteratee` which is
  26893. * invoked for each element in `array` to generate the criterion by which
  26894. * uniqueness is computed. The order of result values is determined by the
  26895. * order they occur in the array. The iteratee is invoked with one argument:
  26896. * (value).
  26897. *
  26898. * @static
  26899. * @memberOf _
  26900. * @since 4.0.0
  26901. * @category Array
  26902. * @param {Array} array The array to inspect.
  26903. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  26904. * @returns {Array} Returns the new duplicate free array.
  26905. * @example
  26906. *
  26907. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  26908. * // => [2.1, 1.2]
  26909. *
  26910. * // The `_.property` iteratee shorthand.
  26911. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  26912. * // => [{ 'x': 1 }, { 'x': 2 }]
  26913. */
  26914. function uniqBy(array, iteratee) {
  26915. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  26916. }
  26917. /**
  26918. * This method is like `_.uniq` except that it accepts `comparator` which
  26919. * is invoked to compare elements of `array`. The order of result values is
  26920. * determined by the order they occur in the array.The comparator is invoked
  26921. * with two arguments: (arrVal, othVal).
  26922. *
  26923. * @static
  26924. * @memberOf _
  26925. * @since 4.0.0
  26926. * @category Array
  26927. * @param {Array} array The array to inspect.
  26928. * @param {Function} [comparator] The comparator invoked per element.
  26929. * @returns {Array} Returns the new duplicate free array.
  26930. * @example
  26931. *
  26932. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  26933. *
  26934. * _.uniqWith(objects, _.isEqual);
  26935. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  26936. */
  26937. function uniqWith(array, comparator) {
  26938. comparator = typeof comparator == 'function' ? comparator : undefined;
  26939. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  26940. }
  26941. /**
  26942. * This method is like `_.zip` except that it accepts an array of grouped
  26943. * elements and creates an array regrouping the elements to their pre-zip
  26944. * configuration.
  26945. *
  26946. * @static
  26947. * @memberOf _
  26948. * @since 1.2.0
  26949. * @category Array
  26950. * @param {Array} array The array of grouped elements to process.
  26951. * @returns {Array} Returns the new array of regrouped elements.
  26952. * @example
  26953. *
  26954. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  26955. * // => [['a', 1, true], ['b', 2, false]]
  26956. *
  26957. * _.unzip(zipped);
  26958. * // => [['a', 'b'], [1, 2], [true, false]]
  26959. */
  26960. function unzip(array) {
  26961. if (!(array && array.length)) {
  26962. return [];
  26963. }
  26964. var length = 0;
  26965. array = arrayFilter(array, function(group) {
  26966. if (isArrayLikeObject(group)) {
  26967. length = nativeMax(group.length, length);
  26968. return true;
  26969. }
  26970. });
  26971. return baseTimes(length, function(index) {
  26972. return arrayMap(array, baseProperty(index));
  26973. });
  26974. }
  26975. /**
  26976. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  26977. * how regrouped values should be combined. The iteratee is invoked with the
  26978. * elements of each group: (...group).
  26979. *
  26980. * @static
  26981. * @memberOf _
  26982. * @since 3.8.0
  26983. * @category Array
  26984. * @param {Array} array The array of grouped elements to process.
  26985. * @param {Function} [iteratee=_.identity] The function to combine
  26986. * regrouped values.
  26987. * @returns {Array} Returns the new array of regrouped elements.
  26988. * @example
  26989. *
  26990. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  26991. * // => [[1, 10, 100], [2, 20, 200]]
  26992. *
  26993. * _.unzipWith(zipped, _.add);
  26994. * // => [3, 30, 300]
  26995. */
  26996. function unzipWith(array, iteratee) {
  26997. if (!(array && array.length)) {
  26998. return [];
  26999. }
  27000. var result = unzip(array);
  27001. if (iteratee == null) {
  27002. return result;
  27003. }
  27004. return arrayMap(result, function(group) {
  27005. return apply(iteratee, undefined, group);
  27006. });
  27007. }
  27008. /**
  27009. * Creates an array excluding all given values using
  27010. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  27011. * for equality comparisons.
  27012. *
  27013. * **Note:** Unlike `_.pull`, this method returns a new array.
  27014. *
  27015. * @static
  27016. * @memberOf _
  27017. * @since 0.1.0
  27018. * @category Array
  27019. * @param {Array} array The array to inspect.
  27020. * @param {...*} [values] The values to exclude.
  27021. * @returns {Array} Returns the new array of filtered values.
  27022. * @see _.difference, _.xor
  27023. * @example
  27024. *
  27025. * _.without([2, 1, 2, 3], 1, 2);
  27026. * // => [3]
  27027. */
  27028. var without = baseRest(function(array, values) {
  27029. return isArrayLikeObject(array)
  27030. ? baseDifference(array, values)
  27031. : [];
  27032. });
  27033. /**
  27034. * Creates an array of unique values that is the
  27035. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  27036. * of the given arrays. The order of result values is determined by the order
  27037. * they occur in the arrays.
  27038. *
  27039. * @static
  27040. * @memberOf _
  27041. * @since 2.4.0
  27042. * @category Array
  27043. * @param {...Array} [arrays] The arrays to inspect.
  27044. * @returns {Array} Returns the new array of filtered values.
  27045. * @see _.difference, _.without
  27046. * @example
  27047. *
  27048. * _.xor([2, 1], [2, 3]);
  27049. * // => [1, 3]
  27050. */
  27051. var xor = baseRest(function(arrays) {
  27052. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  27053. });
  27054. /**
  27055. * This method is like `_.xor` except that it accepts `iteratee` which is
  27056. * invoked for each element of each `arrays` to generate the criterion by
  27057. * which by which they're compared. The order of result values is determined
  27058. * by the order they occur in the arrays. The iteratee is invoked with one
  27059. * argument: (value).
  27060. *
  27061. * @static
  27062. * @memberOf _
  27063. * @since 4.0.0
  27064. * @category Array
  27065. * @param {...Array} [arrays] The arrays to inspect.
  27066. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  27067. * @returns {Array} Returns the new array of filtered values.
  27068. * @example
  27069. *
  27070. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  27071. * // => [1.2, 3.4]
  27072. *
  27073. * // The `_.property` iteratee shorthand.
  27074. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  27075. * // => [{ 'x': 2 }]
  27076. */
  27077. var xorBy = baseRest(function(arrays) {
  27078. var iteratee = last(arrays);
  27079. if (isArrayLikeObject(iteratee)) {
  27080. iteratee = undefined;
  27081. }
  27082. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  27083. });
  27084. /**
  27085. * This method is like `_.xor` except that it accepts `comparator` which is
  27086. * invoked to compare elements of `arrays`. The order of result values is
  27087. * determined by the order they occur in the arrays. The comparator is invoked
  27088. * with two arguments: (arrVal, othVal).
  27089. *
  27090. * @static
  27091. * @memberOf _
  27092. * @since 4.0.0
  27093. * @category Array
  27094. * @param {...Array} [arrays] The arrays to inspect.
  27095. * @param {Function} [comparator] The comparator invoked per element.
  27096. * @returns {Array} Returns the new array of filtered values.
  27097. * @example
  27098. *
  27099. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  27100. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  27101. *
  27102. * _.xorWith(objects, others, _.isEqual);
  27103. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  27104. */
  27105. var xorWith = baseRest(function(arrays) {
  27106. var comparator = last(arrays);
  27107. comparator = typeof comparator == 'function' ? comparator : undefined;
  27108. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  27109. });
  27110. /**
  27111. * Creates an array of grouped elements, the first of which contains the
  27112. * first elements of the given arrays, the second of which contains the
  27113. * second elements of the given arrays, and so on.
  27114. *
  27115. * @static
  27116. * @memberOf _
  27117. * @since 0.1.0
  27118. * @category Array
  27119. * @param {...Array} [arrays] The arrays to process.
  27120. * @returns {Array} Returns the new array of grouped elements.
  27121. * @example
  27122. *
  27123. * _.zip(['a', 'b'], [1, 2], [true, false]);
  27124. * // => [['a', 1, true], ['b', 2, false]]
  27125. */
  27126. var zip = baseRest(unzip);
  27127. /**
  27128. * This method is like `_.fromPairs` except that it accepts two arrays,
  27129. * one of property identifiers and one of corresponding values.
  27130. *
  27131. * @static
  27132. * @memberOf _
  27133. * @since 0.4.0
  27134. * @category Array
  27135. * @param {Array} [props=[]] The property identifiers.
  27136. * @param {Array} [values=[]] The property values.
  27137. * @returns {Object} Returns the new object.
  27138. * @example
  27139. *
  27140. * _.zipObject(['a', 'b'], [1, 2]);
  27141. * // => { 'a': 1, 'b': 2 }
  27142. */
  27143. function zipObject(props, values) {
  27144. return baseZipObject(props || [], values || [], assignValue);
  27145. }
  27146. /**
  27147. * This method is like `_.zipObject` except that it supports property paths.
  27148. *
  27149. * @static
  27150. * @memberOf _
  27151. * @since 4.1.0
  27152. * @category Array
  27153. * @param {Array} [props=[]] The property identifiers.
  27154. * @param {Array} [values=[]] The property values.
  27155. * @returns {Object} Returns the new object.
  27156. * @example
  27157. *
  27158. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  27159. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  27160. */
  27161. function zipObjectDeep(props, values) {
  27162. return baseZipObject(props || [], values || [], baseSet);
  27163. }
  27164. /**
  27165. * This method is like `_.zip` except that it accepts `iteratee` to specify
  27166. * how grouped values should be combined. The iteratee is invoked with the
  27167. * elements of each group: (...group).
  27168. *
  27169. * @static
  27170. * @memberOf _
  27171. * @since 3.8.0
  27172. * @category Array
  27173. * @param {...Array} [arrays] The arrays to process.
  27174. * @param {Function} [iteratee=_.identity] The function to combine
  27175. * grouped values.
  27176. * @returns {Array} Returns the new array of grouped elements.
  27177. * @example
  27178. *
  27179. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  27180. * return a + b + c;
  27181. * });
  27182. * // => [111, 222]
  27183. */
  27184. var zipWith = baseRest(function(arrays) {
  27185. var length = arrays.length,
  27186. iteratee = length > 1 ? arrays[length - 1] : undefined;
  27187. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  27188. return unzipWith(arrays, iteratee);
  27189. });
  27190. /*------------------------------------------------------------------------*/
  27191. /**
  27192. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  27193. * chain sequences enabled. The result of such sequences must be unwrapped
  27194. * with `_#value`.
  27195. *
  27196. * @static
  27197. * @memberOf _
  27198. * @since 1.3.0
  27199. * @category Seq
  27200. * @param {*} value The value to wrap.
  27201. * @returns {Object} Returns the new `lodash` wrapper instance.
  27202. * @example
  27203. *
  27204. * var users = [
  27205. * { 'user': 'barney', 'age': 36 },
  27206. * { 'user': 'fred', 'age': 40 },
  27207. * { 'user': 'pebbles', 'age': 1 }
  27208. * ];
  27209. *
  27210. * var youngest = _
  27211. * .chain(users)
  27212. * .sortBy('age')
  27213. * .map(function(o) {
  27214. * return o.user + ' is ' + o.age;
  27215. * })
  27216. * .head()
  27217. * .value();
  27218. * // => 'pebbles is 1'
  27219. */
  27220. function chain(value) {
  27221. var result = lodash(value);
  27222. result.__chain__ = true;
  27223. return result;
  27224. }
  27225. /**
  27226. * This method invokes `interceptor` and returns `value`. The interceptor
  27227. * is invoked with one argument; (value). The purpose of this method is to
  27228. * "tap into" a method chain sequence in order to modify intermediate results.
  27229. *
  27230. * @static
  27231. * @memberOf _
  27232. * @since 0.1.0
  27233. * @category Seq
  27234. * @param {*} value The value to provide to `interceptor`.
  27235. * @param {Function} interceptor The function to invoke.
  27236. * @returns {*} Returns `value`.
  27237. * @example
  27238. *
  27239. * _([1, 2, 3])
  27240. * .tap(function(array) {
  27241. * // Mutate input array.
  27242. * array.pop();
  27243. * })
  27244. * .reverse()
  27245. * .value();
  27246. * // => [2, 1]
  27247. */
  27248. function tap(value, interceptor) {
  27249. interceptor(value);
  27250. return value;
  27251. }
  27252. /**
  27253. * This method is like `_.tap` except that it returns the result of `interceptor`.
  27254. * The purpose of this method is to "pass thru" values replacing intermediate
  27255. * results in a method chain sequence.
  27256. *
  27257. * @static
  27258. * @memberOf _
  27259. * @since 3.0.0
  27260. * @category Seq
  27261. * @param {*} value The value to provide to `interceptor`.
  27262. * @param {Function} interceptor The function to invoke.
  27263. * @returns {*} Returns the result of `interceptor`.
  27264. * @example
  27265. *
  27266. * _(' abc ')
  27267. * .chain()
  27268. * .trim()
  27269. * .thru(function(value) {
  27270. * return [value];
  27271. * })
  27272. * .value();
  27273. * // => ['abc']
  27274. */
  27275. function thru(value, interceptor) {
  27276. return interceptor(value);
  27277. }
  27278. /**
  27279. * This method is the wrapper version of `_.at`.
  27280. *
  27281. * @name at
  27282. * @memberOf _
  27283. * @since 1.0.0
  27284. * @category Seq
  27285. * @param {...(string|string[])} [paths] The property paths to pick.
  27286. * @returns {Object} Returns the new `lodash` wrapper instance.
  27287. * @example
  27288. *
  27289. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  27290. *
  27291. * _(object).at(['a[0].b.c', 'a[1]']).value();
  27292. * // => [3, 4]
  27293. */
  27294. var wrapperAt = flatRest(function(paths) {
  27295. var length = paths.length,
  27296. start = length ? paths[0] : 0,
  27297. value = this.__wrapped__,
  27298. interceptor = function(object) { return baseAt(object, paths); };
  27299. if (length > 1 || this.__actions__.length ||
  27300. !(value instanceof LazyWrapper) || !isIndex(start)) {
  27301. return this.thru(interceptor);
  27302. }
  27303. value = value.slice(start, +start + (length ? 1 : 0));
  27304. value.__actions__.push({
  27305. 'func': thru,
  27306. 'args': [interceptor],
  27307. 'thisArg': undefined
  27308. });
  27309. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  27310. if (length && !array.length) {
  27311. array.push(undefined);
  27312. }
  27313. return array;
  27314. });
  27315. });
  27316. /**
  27317. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  27318. *
  27319. * @name chain
  27320. * @memberOf _
  27321. * @since 0.1.0
  27322. * @category Seq
  27323. * @returns {Object} Returns the new `lodash` wrapper instance.
  27324. * @example
  27325. *
  27326. * var users = [
  27327. * { 'user': 'barney', 'age': 36 },
  27328. * { 'user': 'fred', 'age': 40 }
  27329. * ];
  27330. *
  27331. * // A sequence without explicit chaining.
  27332. * _(users).head();
  27333. * // => { 'user': 'barney', 'age': 36 }
  27334. *
  27335. * // A sequence with explicit chaining.
  27336. * _(users)
  27337. * .chain()
  27338. * .head()
  27339. * .pick('user')
  27340. * .value();
  27341. * // => { 'user': 'barney' }
  27342. */
  27343. function wrapperChain() {
  27344. return chain(this);
  27345. }
  27346. /**
  27347. * Executes the chain sequence and returns the wrapped result.
  27348. *
  27349. * @name commit
  27350. * @memberOf _
  27351. * @since 3.2.0
  27352. * @category Seq
  27353. * @returns {Object} Returns the new `lodash` wrapper instance.
  27354. * @example
  27355. *
  27356. * var array = [1, 2];
  27357. * var wrapped = _(array).push(3);
  27358. *
  27359. * console.log(array);
  27360. * // => [1, 2]
  27361. *
  27362. * wrapped = wrapped.commit();
  27363. * console.log(array);
  27364. * // => [1, 2, 3]
  27365. *
  27366. * wrapped.last();
  27367. * // => 3
  27368. *
  27369. * console.log(array);
  27370. * // => [1, 2, 3]
  27371. */
  27372. function wrapperCommit() {
  27373. return new LodashWrapper(this.value(), this.__chain__);
  27374. }
  27375. /**
  27376. * Gets the next value on a wrapped object following the
  27377. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  27378. *
  27379. * @name next
  27380. * @memberOf _
  27381. * @since 4.0.0
  27382. * @category Seq
  27383. * @returns {Object} Returns the next iterator value.
  27384. * @example
  27385. *
  27386. * var wrapped = _([1, 2]);
  27387. *
  27388. * wrapped.next();
  27389. * // => { 'done': false, 'value': 1 }
  27390. *
  27391. * wrapped.next();
  27392. * // => { 'done': false, 'value': 2 }
  27393. *
  27394. * wrapped.next();
  27395. * // => { 'done': true, 'value': undefined }
  27396. */
  27397. function wrapperNext() {
  27398. if (this.__values__ === undefined) {
  27399. this.__values__ = toArray(this.value());
  27400. }
  27401. var done = this.__index__ >= this.__values__.length,
  27402. value = done ? undefined : this.__values__[this.__index__++];
  27403. return { 'done': done, 'value': value };
  27404. }
  27405. /**
  27406. * Enables the wrapper to be iterable.
  27407. *
  27408. * @name Symbol.iterator
  27409. * @memberOf _
  27410. * @since 4.0.0
  27411. * @category Seq
  27412. * @returns {Object} Returns the wrapper object.
  27413. * @example
  27414. *
  27415. * var wrapped = _([1, 2]);
  27416. *
  27417. * wrapped[Symbol.iterator]() === wrapped;
  27418. * // => true
  27419. *
  27420. * Array.from(wrapped);
  27421. * // => [1, 2]
  27422. */
  27423. function wrapperToIterator() {
  27424. return this;
  27425. }
  27426. /**
  27427. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  27428. *
  27429. * @name plant
  27430. * @memberOf _
  27431. * @since 3.2.0
  27432. * @category Seq
  27433. * @param {*} value The value to plant.
  27434. * @returns {Object} Returns the new `lodash` wrapper instance.
  27435. * @example
  27436. *
  27437. * function square(n) {
  27438. * return n * n;
  27439. * }
  27440. *
  27441. * var wrapped = _([1, 2]).map(square);
  27442. * var other = wrapped.plant([3, 4]);
  27443. *
  27444. * other.value();
  27445. * // => [9, 16]
  27446. *
  27447. * wrapped.value();
  27448. * // => [1, 4]
  27449. */
  27450. function wrapperPlant(value) {
  27451. var result,
  27452. parent = this;
  27453. while (parent instanceof baseLodash) {
  27454. var clone = wrapperClone(parent);
  27455. clone.__index__ = 0;
  27456. clone.__values__ = undefined;
  27457. if (result) {
  27458. previous.__wrapped__ = clone;
  27459. } else {
  27460. result = clone;
  27461. }
  27462. var previous = clone;
  27463. parent = parent.__wrapped__;
  27464. }
  27465. previous.__wrapped__ = value;
  27466. return result;
  27467. }
  27468. /**
  27469. * This method is the wrapper version of `_.reverse`.
  27470. *
  27471. * **Note:** This method mutates the wrapped array.
  27472. *
  27473. * @name reverse
  27474. * @memberOf _
  27475. * @since 0.1.0
  27476. * @category Seq
  27477. * @returns {Object} Returns the new `lodash` wrapper instance.
  27478. * @example
  27479. *
  27480. * var array = [1, 2, 3];
  27481. *
  27482. * _(array).reverse().value()
  27483. * // => [3, 2, 1]
  27484. *
  27485. * console.log(array);
  27486. * // => [3, 2, 1]
  27487. */
  27488. function wrapperReverse() {
  27489. var value = this.__wrapped__;
  27490. if (value instanceof LazyWrapper) {
  27491. var wrapped = value;
  27492. if (this.__actions__.length) {
  27493. wrapped = new LazyWrapper(this);
  27494. }
  27495. wrapped = wrapped.reverse();
  27496. wrapped.__actions__.push({
  27497. 'func': thru,
  27498. 'args': [reverse],
  27499. 'thisArg': undefined
  27500. });
  27501. return new LodashWrapper(wrapped, this.__chain__);
  27502. }
  27503. return this.thru(reverse);
  27504. }
  27505. /**
  27506. * Executes the chain sequence to resolve the unwrapped value.
  27507. *
  27508. * @name value
  27509. * @memberOf _
  27510. * @since 0.1.0
  27511. * @alias toJSON, valueOf
  27512. * @category Seq
  27513. * @returns {*} Returns the resolved unwrapped value.
  27514. * @example
  27515. *
  27516. * _([1, 2, 3]).value();
  27517. * // => [1, 2, 3]
  27518. */
  27519. function wrapperValue() {
  27520. return baseWrapperValue(this.__wrapped__, this.__actions__);
  27521. }
  27522. /*------------------------------------------------------------------------*/
  27523. /**
  27524. * Creates an object composed of keys generated from the results of running
  27525. * each element of `collection` thru `iteratee`. The corresponding value of
  27526. * each key is the number of times the key was returned by `iteratee`. The
  27527. * iteratee is invoked with one argument: (value).
  27528. *
  27529. * @static
  27530. * @memberOf _
  27531. * @since 0.5.0
  27532. * @category Collection
  27533. * @param {Array|Object} collection The collection to iterate over.
  27534. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  27535. * @returns {Object} Returns the composed aggregate object.
  27536. * @example
  27537. *
  27538. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  27539. * // => { '4': 1, '6': 2 }
  27540. *
  27541. * // The `_.property` iteratee shorthand.
  27542. * _.countBy(['one', 'two', 'three'], 'length');
  27543. * // => { '3': 2, '5': 1 }
  27544. */
  27545. var countBy = createAggregator(function(result, value, key) {
  27546. if (hasOwnProperty.call(result, key)) {
  27547. ++result[key];
  27548. } else {
  27549. baseAssignValue(result, key, 1);
  27550. }
  27551. });
  27552. /**
  27553. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  27554. * Iteration is stopped once `predicate` returns falsey. The predicate is
  27555. * invoked with three arguments: (value, index|key, collection).
  27556. *
  27557. * **Note:** This method returns `true` for
  27558. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  27559. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  27560. * elements of empty collections.
  27561. *
  27562. * @static
  27563. * @memberOf _
  27564. * @since 0.1.0
  27565. * @category Collection
  27566. * @param {Array|Object} collection The collection to iterate over.
  27567. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  27568. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  27569. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  27570. * else `false`.
  27571. * @example
  27572. *
  27573. * _.every([true, 1, null, 'yes'], Boolean);
  27574. * // => false
  27575. *
  27576. * var users = [
  27577. * { 'user': 'barney', 'age': 36, 'active': false },
  27578. * { 'user': 'fred', 'age': 40, 'active': false }
  27579. * ];
  27580. *
  27581. * // The `_.matches` iteratee shorthand.
  27582. * _.every(users, { 'user': 'barney', 'active': false });
  27583. * // => false
  27584. *
  27585. * // The `_.matchesProperty` iteratee shorthand.
  27586. * _.every(users, ['active', false]);
  27587. * // => true
  27588. *
  27589. * // The `_.property` iteratee shorthand.
  27590. * _.every(users, 'active');
  27591. * // => false
  27592. */
  27593. function every(collection, predicate, guard) {
  27594. var func = isArray(collection) ? arrayEvery : baseEvery;
  27595. if (guard && isIterateeCall(collection, predicate, guard)) {
  27596. predicate = undefined;
  27597. }
  27598. return func(collection, getIteratee(predicate, 3));
  27599. }
  27600. /**
  27601. * Iterates over elements of `collection`, returning an array of all elements
  27602. * `predicate` returns truthy for. The predicate is invoked with three
  27603. * arguments: (value, index|key, collection).
  27604. *
  27605. * **Note:** Unlike `_.remove`, this method returns a new array.
  27606. *
  27607. * @static
  27608. * @memberOf _
  27609. * @since 0.1.0
  27610. * @category Collection
  27611. * @param {Array|Object} collection The collection to iterate over.
  27612. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  27613. * @returns {Array} Returns the new filtered array.
  27614. * @see _.reject
  27615. * @example
  27616. *
  27617. * var users = [
  27618. * { 'user': 'barney', 'age': 36, 'active': true },
  27619. * { 'user': 'fred', 'age': 40, 'active': false }
  27620. * ];
  27621. *
  27622. * _.filter(users, function(o) { return !o.active; });
  27623. * // => objects for ['fred']
  27624. *
  27625. * // The `_.matches` iteratee shorthand.
  27626. * _.filter(users, { 'age': 36, 'active': true });
  27627. * // => objects for ['barney']
  27628. *
  27629. * // The `_.matchesProperty` iteratee shorthand.
  27630. * _.filter(users, ['active', false]);
  27631. * // => objects for ['fred']
  27632. *
  27633. * // The `_.property` iteratee shorthand.
  27634. * _.filter(users, 'active');
  27635. * // => objects for ['barney']
  27636. */
  27637. function filter(collection, predicate) {
  27638. var func = isArray(collection) ? arrayFilter : baseFilter;
  27639. return func(collection, getIteratee(predicate, 3));
  27640. }
  27641. /**
  27642. * Iterates over elements of `collection`, returning the first element
  27643. * `predicate` returns truthy for. The predicate is invoked with three
  27644. * arguments: (value, index|key, collection).
  27645. *
  27646. * @static
  27647. * @memberOf _
  27648. * @since 0.1.0
  27649. * @category Collection
  27650. * @param {Array|Object} collection The collection to inspect.
  27651. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  27652. * @param {number} [fromIndex=0] The index to search from.
  27653. * @returns {*} Returns the matched element, else `undefined`.
  27654. * @example
  27655. *
  27656. * var users = [
  27657. * { 'user': 'barney', 'age': 36, 'active': true },
  27658. * { 'user': 'fred', 'age': 40, 'active': false },
  27659. * { 'user': 'pebbles', 'age': 1, 'active': true }
  27660. * ];
  27661. *
  27662. * _.find(users, function(o) { return o.age < 40; });
  27663. * // => object for 'barney'
  27664. *
  27665. * // The `_.matches` iteratee shorthand.
  27666. * _.find(users, { 'age': 1, 'active': true });
  27667. * // => object for 'pebbles'
  27668. *
  27669. * // The `_.matchesProperty` iteratee shorthand.
  27670. * _.find(users, ['active', false]);
  27671. * // => object for 'fred'
  27672. *
  27673. * // The `_.property` iteratee shorthand.
  27674. * _.find(users, 'active');
  27675. * // => object for 'barney'
  27676. */
  27677. var find = createFind(findIndex);
  27678. /**
  27679. * This method is like `_.find` except that it iterates over elements of
  27680. * `collection` from right to left.
  27681. *
  27682. * @static
  27683. * @memberOf _
  27684. * @since 2.0.0
  27685. * @category Collection
  27686. * @param {Array|Object} collection The collection to inspect.
  27687. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  27688. * @param {number} [fromIndex=collection.length-1] The index to search from.
  27689. * @returns {*} Returns the matched element, else `undefined`.
  27690. * @example
  27691. *
  27692. * _.findLast([1, 2, 3, 4], function(n) {
  27693. * return n % 2 == 1;
  27694. * });
  27695. * // => 3
  27696. */
  27697. var findLast = createFind(findLastIndex);
  27698. /**
  27699. * Creates a flattened array of values by running each element in `collection`
  27700. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  27701. * with three arguments: (value, index|key, collection).
  27702. *
  27703. * @static
  27704. * @memberOf _
  27705. * @since 4.0.0
  27706. * @category Collection
  27707. * @param {Array|Object} collection The collection to iterate over.
  27708. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  27709. * @returns {Array} Returns the new flattened array.
  27710. * @example
  27711. *
  27712. * function duplicate(n) {
  27713. * return [n, n];
  27714. * }
  27715. *
  27716. * _.flatMap([1, 2], duplicate);
  27717. * // => [1, 1, 2, 2]
  27718. */
  27719. function flatMap(collection, iteratee) {
  27720. return baseFlatten(map(collection, iteratee), 1);
  27721. }
  27722. /**
  27723. * This method is like `_.flatMap` except that it recursively flattens the
  27724. * mapped results.
  27725. *
  27726. * @static
  27727. * @memberOf _
  27728. * @since 4.7.0
  27729. * @category Collection
  27730. * @param {Array|Object} collection The collection to iterate over.
  27731. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  27732. * @returns {Array} Returns the new flattened array.
  27733. * @example
  27734. *
  27735. * function duplicate(n) {
  27736. * return [[[n, n]]];
  27737. * }
  27738. *
  27739. * _.flatMapDeep([1, 2], duplicate);
  27740. * // => [1, 1, 2, 2]
  27741. */
  27742. function flatMapDeep(collection, iteratee) {
  27743. return baseFlatten(map(collection, iteratee), INFINITY);
  27744. }
  27745. /**
  27746. * This method is like `_.flatMap` except that it recursively flattens the
  27747. * mapped results up to `depth` times.
  27748. *
  27749. * @static
  27750. * @memberOf _
  27751. * @since 4.7.0
  27752. * @category Collection
  27753. * @param {Array|Object} collection The collection to iterate over.
  27754. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  27755. * @param {number} [depth=1] The maximum recursion depth.
  27756. * @returns {Array} Returns the new flattened array.
  27757. * @example
  27758. *
  27759. * function duplicate(n) {
  27760. * return [[[n, n]]];
  27761. * }
  27762. *
  27763. * _.flatMapDepth([1, 2], duplicate, 2);
  27764. * // => [[1, 1], [2, 2]]
  27765. */
  27766. function flatMapDepth(collection, iteratee, depth) {
  27767. depth = depth === undefined ? 1 : toInteger(depth);
  27768. return baseFlatten(map(collection, iteratee), depth);
  27769. }
  27770. /**
  27771. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  27772. * The iteratee is invoked with three arguments: (value, index|key, collection).
  27773. * Iteratee functions may exit iteration early by explicitly returning `false`.
  27774. *
  27775. * **Note:** As with other "Collections" methods, objects with a "length"
  27776. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  27777. * or `_.forOwn` for object iteration.
  27778. *
  27779. * @static
  27780. * @memberOf _
  27781. * @since 0.1.0
  27782. * @alias each
  27783. * @category Collection
  27784. * @param {Array|Object} collection The collection to iterate over.
  27785. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  27786. * @returns {Array|Object} Returns `collection`.
  27787. * @see _.forEachRight
  27788. * @example
  27789. *
  27790. * _.forEach([1, 2], function(value) {
  27791. * console.log(value);
  27792. * });
  27793. * // => Logs `1` then `2`.
  27794. *
  27795. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  27796. * console.log(key);
  27797. * });
  27798. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  27799. */
  27800. function forEach(collection, iteratee) {
  27801. var func = isArray(collection) ? arrayEach : baseEach;
  27802. return func(collection, getIteratee(iteratee, 3));
  27803. }
  27804. /**
  27805. * This method is like `_.forEach` except that it iterates over elements of
  27806. * `collection` from right to left.
  27807. *
  27808. * @static
  27809. * @memberOf _
  27810. * @since 2.0.0
  27811. * @alias eachRight
  27812. * @category Collection
  27813. * @param {Array|Object} collection The collection to iterate over.
  27814. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  27815. * @returns {Array|Object} Returns `collection`.
  27816. * @see _.forEach
  27817. * @example
  27818. *
  27819. * _.forEachRight([1, 2], function(value) {
  27820. * console.log(value);
  27821. * });
  27822. * // => Logs `2` then `1`.
  27823. */
  27824. function forEachRight(collection, iteratee) {
  27825. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  27826. return func(collection, getIteratee(iteratee, 3));
  27827. }
  27828. /**
  27829. * Creates an object composed of keys generated from the results of running
  27830. * each element of `collection` thru `iteratee`. The order of grouped values
  27831. * is determined by the order they occur in `collection`. The corresponding
  27832. * value of each key is an array of elements responsible for generating the
  27833. * key. The iteratee is invoked with one argument: (value).
  27834. *
  27835. * @static
  27836. * @memberOf _
  27837. * @since 0.1.0
  27838. * @category Collection
  27839. * @param {Array|Object} collection The collection to iterate over.
  27840. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  27841. * @returns {Object} Returns the composed aggregate object.
  27842. * @example
  27843. *
  27844. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  27845. * // => { '4': [4.2], '6': [6.1, 6.3] }
  27846. *
  27847. * // The `_.property` iteratee shorthand.
  27848. * _.groupBy(['one', 'two', 'three'], 'length');
  27849. * // => { '3': ['one', 'two'], '5': ['three'] }
  27850. */
  27851. var groupBy = createAggregator(function(result, value, key) {
  27852. if (hasOwnProperty.call(result, key)) {
  27853. result[key].push(value);
  27854. } else {
  27855. baseAssignValue(result, key, [value]);
  27856. }
  27857. });
  27858. /**
  27859. * Checks if `value` is in `collection`. If `collection` is a string, it's
  27860. * checked for a substring of `value`, otherwise
  27861. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  27862. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  27863. * the offset from the end of `collection`.
  27864. *
  27865. * @static
  27866. * @memberOf _
  27867. * @since 0.1.0
  27868. * @category Collection
  27869. * @param {Array|Object|string} collection The collection to inspect.
  27870. * @param {*} value The value to search for.
  27871. * @param {number} [fromIndex=0] The index to search from.
  27872. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  27873. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  27874. * @example
  27875. *
  27876. * _.includes([1, 2, 3], 1);
  27877. * // => true
  27878. *
  27879. * _.includes([1, 2, 3], 1, 2);
  27880. * // => false
  27881. *
  27882. * _.includes({ 'a': 1, 'b': 2 }, 1);
  27883. * // => true
  27884. *
  27885. * _.includes('abcd', 'bc');
  27886. * // => true
  27887. */
  27888. function includes(collection, value, fromIndex, guard) {
  27889. collection = isArrayLike(collection) ? collection : values(collection);
  27890. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  27891. var length = collection.length;
  27892. if (fromIndex < 0) {
  27893. fromIndex = nativeMax(length + fromIndex, 0);
  27894. }
  27895. return isString(collection)
  27896. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  27897. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  27898. }
  27899. /**
  27900. * Invokes the method at `path` of each element in `collection`, returning
  27901. * an array of the results of each invoked method. Any additional arguments
  27902. * are provided to each invoked method. If `path` is a function, it's invoked
  27903. * for, and `this` bound to, each element in `collection`.
  27904. *
  27905. * @static
  27906. * @memberOf _
  27907. * @since 4.0.0
  27908. * @category Collection
  27909. * @param {Array|Object} collection The collection to iterate over.
  27910. * @param {Array|Function|string} path The path of the method to invoke or
  27911. * the function invoked per iteration.
  27912. * @param {...*} [args] The arguments to invoke each method with.
  27913. * @returns {Array} Returns the array of results.
  27914. * @example
  27915. *
  27916. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  27917. * // => [[1, 5, 7], [1, 2, 3]]
  27918. *
  27919. * _.invokeMap([123, 456], String.prototype.split, '');
  27920. * // => [['1', '2', '3'], ['4', '5', '6']]
  27921. */
  27922. var invokeMap = baseRest(function(collection, path, args) {
  27923. var index = -1,
  27924. isFunc = typeof path == 'function',
  27925. result = isArrayLike(collection) ? Array(collection.length) : [];
  27926. baseEach(collection, function(value) {
  27927. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  27928. });
  27929. return result;
  27930. });
  27931. /**
  27932. * Creates an object composed of keys generated from the results of running
  27933. * each element of `collection` thru `iteratee`. The corresponding value of
  27934. * each key is the last element responsible for generating the key. The
  27935. * iteratee is invoked with one argument: (value).
  27936. *
  27937. * @static
  27938. * @memberOf _
  27939. * @since 4.0.0
  27940. * @category Collection
  27941. * @param {Array|Object} collection The collection to iterate over.
  27942. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  27943. * @returns {Object} Returns the composed aggregate object.
  27944. * @example
  27945. *
  27946. * var array = [
  27947. * { 'dir': 'left', 'code': 97 },
  27948. * { 'dir': 'right', 'code': 100 }
  27949. * ];
  27950. *
  27951. * _.keyBy(array, function(o) {
  27952. * return String.fromCharCode(o.code);
  27953. * });
  27954. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  27955. *
  27956. * _.keyBy(array, 'dir');
  27957. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  27958. */
  27959. var keyBy = createAggregator(function(result, value, key) {
  27960. baseAssignValue(result, key, value);
  27961. });
  27962. /**
  27963. * Creates an array of values by running each element in `collection` thru
  27964. * `iteratee`. The iteratee is invoked with three arguments:
  27965. * (value, index|key, collection).
  27966. *
  27967. * Many lodash methods are guarded to work as iteratees for methods like
  27968. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  27969. *
  27970. * The guarded methods are:
  27971. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  27972. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  27973. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  27974. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  27975. *
  27976. * @static
  27977. * @memberOf _
  27978. * @since 0.1.0
  27979. * @category Collection
  27980. * @param {Array|Object} collection The collection to iterate over.
  27981. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  27982. * @returns {Array} Returns the new mapped array.
  27983. * @example
  27984. *
  27985. * function square(n) {
  27986. * return n * n;
  27987. * }
  27988. *
  27989. * _.map([4, 8], square);
  27990. * // => [16, 64]
  27991. *
  27992. * _.map({ 'a': 4, 'b': 8 }, square);
  27993. * // => [16, 64] (iteration order is not guaranteed)
  27994. *
  27995. * var users = [
  27996. * { 'user': 'barney' },
  27997. * { 'user': 'fred' }
  27998. * ];
  27999. *
  28000. * // The `_.property` iteratee shorthand.
  28001. * _.map(users, 'user');
  28002. * // => ['barney', 'fred']
  28003. */
  28004. function map(collection, iteratee) {
  28005. var func = isArray(collection) ? arrayMap : baseMap;
  28006. return func(collection, getIteratee(iteratee, 3));
  28007. }
  28008. /**
  28009. * This method is like `_.sortBy` except that it allows specifying the sort
  28010. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  28011. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  28012. * descending or "asc" for ascending sort order of corresponding values.
  28013. *
  28014. * @static
  28015. * @memberOf _
  28016. * @since 4.0.0
  28017. * @category Collection
  28018. * @param {Array|Object} collection The collection to iterate over.
  28019. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  28020. * The iteratees to sort by.
  28021. * @param {string[]} [orders] The sort orders of `iteratees`.
  28022. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  28023. * @returns {Array} Returns the new sorted array.
  28024. * @example
  28025. *
  28026. * var users = [
  28027. * { 'user': 'fred', 'age': 48 },
  28028. * { 'user': 'barney', 'age': 34 },
  28029. * { 'user': 'fred', 'age': 40 },
  28030. * { 'user': 'barney', 'age': 36 }
  28031. * ];
  28032. *
  28033. * // Sort by `user` in ascending order and by `age` in descending order.
  28034. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  28035. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  28036. */
  28037. function orderBy(collection, iteratees, orders, guard) {
  28038. if (collection == null) {
  28039. return [];
  28040. }
  28041. if (!isArray(iteratees)) {
  28042. iteratees = iteratees == null ? [] : [iteratees];
  28043. }
  28044. orders = guard ? undefined : orders;
  28045. if (!isArray(orders)) {
  28046. orders = orders == null ? [] : [orders];
  28047. }
  28048. return baseOrderBy(collection, iteratees, orders);
  28049. }
  28050. /**
  28051. * Creates an array of elements split into two groups, the first of which
  28052. * contains elements `predicate` returns truthy for, the second of which
  28053. * contains elements `predicate` returns falsey for. The predicate is
  28054. * invoked with one argument: (value).
  28055. *
  28056. * @static
  28057. * @memberOf _
  28058. * @since 3.0.0
  28059. * @category Collection
  28060. * @param {Array|Object} collection The collection to iterate over.
  28061. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  28062. * @returns {Array} Returns the array of grouped elements.
  28063. * @example
  28064. *
  28065. * var users = [
  28066. * { 'user': 'barney', 'age': 36, 'active': false },
  28067. * { 'user': 'fred', 'age': 40, 'active': true },
  28068. * { 'user': 'pebbles', 'age': 1, 'active': false }
  28069. * ];
  28070. *
  28071. * _.partition(users, function(o) { return o.active; });
  28072. * // => objects for [['fred'], ['barney', 'pebbles']]
  28073. *
  28074. * // The `_.matches` iteratee shorthand.
  28075. * _.partition(users, { 'age': 1, 'active': false });
  28076. * // => objects for [['pebbles'], ['barney', 'fred']]
  28077. *
  28078. * // The `_.matchesProperty` iteratee shorthand.
  28079. * _.partition(users, ['active', false]);
  28080. * // => objects for [['barney', 'pebbles'], ['fred']]
  28081. *
  28082. * // The `_.property` iteratee shorthand.
  28083. * _.partition(users, 'active');
  28084. * // => objects for [['fred'], ['barney', 'pebbles']]
  28085. */
  28086. var partition = createAggregator(function(result, value, key) {
  28087. result[key ? 0 : 1].push(value);
  28088. }, function() { return [[], []]; });
  28089. /**
  28090. * Reduces `collection` to a value which is the accumulated result of running
  28091. * each element in `collection` thru `iteratee`, where each successive
  28092. * invocation is supplied the return value of the previous. If `accumulator`
  28093. * is not given, the first element of `collection` is used as the initial
  28094. * value. The iteratee is invoked with four arguments:
  28095. * (accumulator, value, index|key, collection).
  28096. *
  28097. * Many lodash methods are guarded to work as iteratees for methods like
  28098. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  28099. *
  28100. * The guarded methods are:
  28101. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  28102. * and `sortBy`
  28103. *
  28104. * @static
  28105. * @memberOf _
  28106. * @since 0.1.0
  28107. * @category Collection
  28108. * @param {Array|Object} collection The collection to iterate over.
  28109. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  28110. * @param {*} [accumulator] The initial value.
  28111. * @returns {*} Returns the accumulated value.
  28112. * @see _.reduceRight
  28113. * @example
  28114. *
  28115. * _.reduce([1, 2], function(sum, n) {
  28116. * return sum + n;
  28117. * }, 0);
  28118. * // => 3
  28119. *
  28120. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  28121. * (result[value] || (result[value] = [])).push(key);
  28122. * return result;
  28123. * }, {});
  28124. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  28125. */
  28126. function reduce(collection, iteratee, accumulator) {
  28127. var func = isArray(collection) ? arrayReduce : baseReduce,
  28128. initAccum = arguments.length < 3;
  28129. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  28130. }
  28131. /**
  28132. * This method is like `_.reduce` except that it iterates over elements of
  28133. * `collection` from right to left.
  28134. *
  28135. * @static
  28136. * @memberOf _
  28137. * @since 0.1.0
  28138. * @category Collection
  28139. * @param {Array|Object} collection The collection to iterate over.
  28140. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  28141. * @param {*} [accumulator] The initial value.
  28142. * @returns {*} Returns the accumulated value.
  28143. * @see _.reduce
  28144. * @example
  28145. *
  28146. * var array = [[0, 1], [2, 3], [4, 5]];
  28147. *
  28148. * _.reduceRight(array, function(flattened, other) {
  28149. * return flattened.concat(other);
  28150. * }, []);
  28151. * // => [4, 5, 2, 3, 0, 1]
  28152. */
  28153. function reduceRight(collection, iteratee, accumulator) {
  28154. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  28155. initAccum = arguments.length < 3;
  28156. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  28157. }
  28158. /**
  28159. * The opposite of `_.filter`; this method returns the elements of `collection`
  28160. * that `predicate` does **not** return truthy for.
  28161. *
  28162. * @static
  28163. * @memberOf _
  28164. * @since 0.1.0
  28165. * @category Collection
  28166. * @param {Array|Object} collection The collection to iterate over.
  28167. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  28168. * @returns {Array} Returns the new filtered array.
  28169. * @see _.filter
  28170. * @example
  28171. *
  28172. * var users = [
  28173. * { 'user': 'barney', 'age': 36, 'active': false },
  28174. * { 'user': 'fred', 'age': 40, 'active': true }
  28175. * ];
  28176. *
  28177. * _.reject(users, function(o) { return !o.active; });
  28178. * // => objects for ['fred']
  28179. *
  28180. * // The `_.matches` iteratee shorthand.
  28181. * _.reject(users, { 'age': 40, 'active': true });
  28182. * // => objects for ['barney']
  28183. *
  28184. * // The `_.matchesProperty` iteratee shorthand.
  28185. * _.reject(users, ['active', false]);
  28186. * // => objects for ['fred']
  28187. *
  28188. * // The `_.property` iteratee shorthand.
  28189. * _.reject(users, 'active');
  28190. * // => objects for ['barney']
  28191. */
  28192. function reject(collection, predicate) {
  28193. var func = isArray(collection) ? arrayFilter : baseFilter;
  28194. return func(collection, negate(getIteratee(predicate, 3)));
  28195. }
  28196. /**
  28197. * Gets a random element from `collection`.
  28198. *
  28199. * @static
  28200. * @memberOf _
  28201. * @since 2.0.0
  28202. * @category Collection
  28203. * @param {Array|Object} collection The collection to sample.
  28204. * @returns {*} Returns the random element.
  28205. * @example
  28206. *
  28207. * _.sample([1, 2, 3, 4]);
  28208. * // => 2
  28209. */
  28210. function sample(collection) {
  28211. var func = isArray(collection) ? arraySample : baseSample;
  28212. return func(collection);
  28213. }
  28214. /**
  28215. * Gets `n` random elements at unique keys from `collection` up to the
  28216. * size of `collection`.
  28217. *
  28218. * @static
  28219. * @memberOf _
  28220. * @since 4.0.0
  28221. * @category Collection
  28222. * @param {Array|Object} collection The collection to sample.
  28223. * @param {number} [n=1] The number of elements to sample.
  28224. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  28225. * @returns {Array} Returns the random elements.
  28226. * @example
  28227. *
  28228. * _.sampleSize([1, 2, 3], 2);
  28229. * // => [3, 1]
  28230. *
  28231. * _.sampleSize([1, 2, 3], 4);
  28232. * // => [2, 3, 1]
  28233. */
  28234. function sampleSize(collection, n, guard) {
  28235. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  28236. n = 1;
  28237. } else {
  28238. n = toInteger(n);
  28239. }
  28240. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  28241. return func(collection, n);
  28242. }
  28243. /**
  28244. * Creates an array of shuffled values, using a version of the
  28245. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  28246. *
  28247. * @static
  28248. * @memberOf _
  28249. * @since 0.1.0
  28250. * @category Collection
  28251. * @param {Array|Object} collection The collection to shuffle.
  28252. * @returns {Array} Returns the new shuffled array.
  28253. * @example
  28254. *
  28255. * _.shuffle([1, 2, 3, 4]);
  28256. * // => [4, 1, 3, 2]
  28257. */
  28258. function shuffle(collection) {
  28259. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  28260. return func(collection);
  28261. }
  28262. /**
  28263. * Gets the size of `collection` by returning its length for array-like
  28264. * values or the number of own enumerable string keyed properties for objects.
  28265. *
  28266. * @static
  28267. * @memberOf _
  28268. * @since 0.1.0
  28269. * @category Collection
  28270. * @param {Array|Object|string} collection The collection to inspect.
  28271. * @returns {number} Returns the collection size.
  28272. * @example
  28273. *
  28274. * _.size([1, 2, 3]);
  28275. * // => 3
  28276. *
  28277. * _.size({ 'a': 1, 'b': 2 });
  28278. * // => 2
  28279. *
  28280. * _.size('pebbles');
  28281. * // => 7
  28282. */
  28283. function size(collection) {
  28284. if (collection == null) {
  28285. return 0;
  28286. }
  28287. if (isArrayLike(collection)) {
  28288. return isString(collection) ? stringSize(collection) : collection.length;
  28289. }
  28290. var tag = getTag(collection);
  28291. if (tag == mapTag || tag == setTag) {
  28292. return collection.size;
  28293. }
  28294. return baseKeys(collection).length;
  28295. }
  28296. /**
  28297. * Checks if `predicate` returns truthy for **any** element of `collection`.
  28298. * Iteration is stopped once `predicate` returns truthy. The predicate is
  28299. * invoked with three arguments: (value, index|key, collection).
  28300. *
  28301. * @static
  28302. * @memberOf _
  28303. * @since 0.1.0
  28304. * @category Collection
  28305. * @param {Array|Object} collection The collection to iterate over.
  28306. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  28307. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  28308. * @returns {boolean} Returns `true` if any element passes the predicate check,
  28309. * else `false`.
  28310. * @example
  28311. *
  28312. * _.some([null, 0, 'yes', false], Boolean);
  28313. * // => true
  28314. *
  28315. * var users = [
  28316. * { 'user': 'barney', 'active': true },
  28317. * { 'user': 'fred', 'active': false }
  28318. * ];
  28319. *
  28320. * // The `_.matches` iteratee shorthand.
  28321. * _.some(users, { 'user': 'barney', 'active': false });
  28322. * // => false
  28323. *
  28324. * // The `_.matchesProperty` iteratee shorthand.
  28325. * _.some(users, ['active', false]);
  28326. * // => true
  28327. *
  28328. * // The `_.property` iteratee shorthand.
  28329. * _.some(users, 'active');
  28330. * // => true
  28331. */
  28332. function some(collection, predicate, guard) {
  28333. var func = isArray(collection) ? arraySome : baseSome;
  28334. if (guard && isIterateeCall(collection, predicate, guard)) {
  28335. predicate = undefined;
  28336. }
  28337. return func(collection, getIteratee(predicate, 3));
  28338. }
  28339. /**
  28340. * Creates an array of elements, sorted in ascending order by the results of
  28341. * running each element in a collection thru each iteratee. This method
  28342. * performs a stable sort, that is, it preserves the original sort order of
  28343. * equal elements. The iteratees are invoked with one argument: (value).
  28344. *
  28345. * @static
  28346. * @memberOf _
  28347. * @since 0.1.0
  28348. * @category Collection
  28349. * @param {Array|Object} collection The collection to iterate over.
  28350. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  28351. * The iteratees to sort by.
  28352. * @returns {Array} Returns the new sorted array.
  28353. * @example
  28354. *
  28355. * var users = [
  28356. * { 'user': 'fred', 'age': 48 },
  28357. * { 'user': 'barney', 'age': 36 },
  28358. * { 'user': 'fred', 'age': 40 },
  28359. * { 'user': 'barney', 'age': 34 }
  28360. * ];
  28361. *
  28362. * _.sortBy(users, [function(o) { return o.user; }]);
  28363. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  28364. *
  28365. * _.sortBy(users, ['user', 'age']);
  28366. * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]]
  28367. */
  28368. var sortBy = baseRest(function(collection, iteratees) {
  28369. if (collection == null) {
  28370. return [];
  28371. }
  28372. var length = iteratees.length;
  28373. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  28374. iteratees = [];
  28375. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  28376. iteratees = [iteratees[0]];
  28377. }
  28378. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  28379. });
  28380. /*------------------------------------------------------------------------*/
  28381. /**
  28382. * Gets the timestamp of the number of milliseconds that have elapsed since
  28383. * the Unix epoch (1 January 1970 00:00:00 UTC).
  28384. *
  28385. * @static
  28386. * @memberOf _
  28387. * @since 2.4.0
  28388. * @category Date
  28389. * @returns {number} Returns the timestamp.
  28390. * @example
  28391. *
  28392. * _.defer(function(stamp) {
  28393. * console.log(_.now() - stamp);
  28394. * }, _.now());
  28395. * // => Logs the number of milliseconds it took for the deferred invocation.
  28396. */
  28397. var now = ctxNow || function() {
  28398. return root.Date.now();
  28399. };
  28400. /*------------------------------------------------------------------------*/
  28401. /**
  28402. * The opposite of `_.before`; this method creates a function that invokes
  28403. * `func` once it's called `n` or more times.
  28404. *
  28405. * @static
  28406. * @memberOf _
  28407. * @since 0.1.0
  28408. * @category Function
  28409. * @param {number} n The number of calls before `func` is invoked.
  28410. * @param {Function} func The function to restrict.
  28411. * @returns {Function} Returns the new restricted function.
  28412. * @example
  28413. *
  28414. * var saves = ['profile', 'settings'];
  28415. *
  28416. * var done = _.after(saves.length, function() {
  28417. * console.log('done saving!');
  28418. * });
  28419. *
  28420. * _.forEach(saves, function(type) {
  28421. * asyncSave({ 'type': type, 'complete': done });
  28422. * });
  28423. * // => Logs 'done saving!' after the two async saves have completed.
  28424. */
  28425. function after(n, func) {
  28426. if (typeof func != 'function') {
  28427. throw new TypeError(FUNC_ERROR_TEXT);
  28428. }
  28429. n = toInteger(n);
  28430. return function() {
  28431. if (--n < 1) {
  28432. return func.apply(this, arguments);
  28433. }
  28434. };
  28435. }
  28436. /**
  28437. * Creates a function that invokes `func`, with up to `n` arguments,
  28438. * ignoring any additional arguments.
  28439. *
  28440. * @static
  28441. * @memberOf _
  28442. * @since 3.0.0
  28443. * @category Function
  28444. * @param {Function} func The function to cap arguments for.
  28445. * @param {number} [n=func.length] The arity cap.
  28446. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  28447. * @returns {Function} Returns the new capped function.
  28448. * @example
  28449. *
  28450. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  28451. * // => [6, 8, 10]
  28452. */
  28453. function ary(func, n, guard) {
  28454. n = guard ? undefined : n;
  28455. n = (func && n == null) ? func.length : n;
  28456. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  28457. }
  28458. /**
  28459. * Creates a function that invokes `func`, with the `this` binding and arguments
  28460. * of the created function, while it's called less than `n` times. Subsequent
  28461. * calls to the created function return the result of the last `func` invocation.
  28462. *
  28463. * @static
  28464. * @memberOf _
  28465. * @since 3.0.0
  28466. * @category Function
  28467. * @param {number} n The number of calls at which `func` is no longer invoked.
  28468. * @param {Function} func The function to restrict.
  28469. * @returns {Function} Returns the new restricted function.
  28470. * @example
  28471. *
  28472. * jQuery(element).on('click', _.before(5, addContactToList));
  28473. * // => Allows adding up to 4 contacts to the list.
  28474. */
  28475. function before(n, func) {
  28476. var result;
  28477. if (typeof func != 'function') {
  28478. throw new TypeError(FUNC_ERROR_TEXT);
  28479. }
  28480. n = toInteger(n);
  28481. return function() {
  28482. if (--n > 0) {
  28483. result = func.apply(this, arguments);
  28484. }
  28485. if (n <= 1) {
  28486. func = undefined;
  28487. }
  28488. return result;
  28489. };
  28490. }
  28491. /**
  28492. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  28493. * and `partials` prepended to the arguments it receives.
  28494. *
  28495. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  28496. * may be used as a placeholder for partially applied arguments.
  28497. *
  28498. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  28499. * property of bound functions.
  28500. *
  28501. * @static
  28502. * @memberOf _
  28503. * @since 0.1.0
  28504. * @category Function
  28505. * @param {Function} func The function to bind.
  28506. * @param {*} thisArg The `this` binding of `func`.
  28507. * @param {...*} [partials] The arguments to be partially applied.
  28508. * @returns {Function} Returns the new bound function.
  28509. * @example
  28510. *
  28511. * function greet(greeting, punctuation) {
  28512. * return greeting + ' ' + this.user + punctuation;
  28513. * }
  28514. *
  28515. * var object = { 'user': 'fred' };
  28516. *
  28517. * var bound = _.bind(greet, object, 'hi');
  28518. * bound('!');
  28519. * // => 'hi fred!'
  28520. *
  28521. * // Bound with placeholders.
  28522. * var bound = _.bind(greet, object, _, '!');
  28523. * bound('hi');
  28524. * // => 'hi fred!'
  28525. */
  28526. var bind = baseRest(function(func, thisArg, partials) {
  28527. var bitmask = WRAP_BIND_FLAG;
  28528. if (partials.length) {
  28529. var holders = replaceHolders(partials, getHolder(bind));
  28530. bitmask |= WRAP_PARTIAL_FLAG;
  28531. }
  28532. return createWrap(func, bitmask, thisArg, partials, holders);
  28533. });
  28534. /**
  28535. * Creates a function that invokes the method at `object[key]` with `partials`
  28536. * prepended to the arguments it receives.
  28537. *
  28538. * This method differs from `_.bind` by allowing bound functions to reference
  28539. * methods that may be redefined or don't yet exist. See
  28540. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  28541. * for more details.
  28542. *
  28543. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  28544. * builds, may be used as a placeholder for partially applied arguments.
  28545. *
  28546. * @static
  28547. * @memberOf _
  28548. * @since 0.10.0
  28549. * @category Function
  28550. * @param {Object} object The object to invoke the method on.
  28551. * @param {string} key The key of the method.
  28552. * @param {...*} [partials] The arguments to be partially applied.
  28553. * @returns {Function} Returns the new bound function.
  28554. * @example
  28555. *
  28556. * var object = {
  28557. * 'user': 'fred',
  28558. * 'greet': function(greeting, punctuation) {
  28559. * return greeting + ' ' + this.user + punctuation;
  28560. * }
  28561. * };
  28562. *
  28563. * var bound = _.bindKey(object, 'greet', 'hi');
  28564. * bound('!');
  28565. * // => 'hi fred!'
  28566. *
  28567. * object.greet = function(greeting, punctuation) {
  28568. * return greeting + 'ya ' + this.user + punctuation;
  28569. * };
  28570. *
  28571. * bound('!');
  28572. * // => 'hiya fred!'
  28573. *
  28574. * // Bound with placeholders.
  28575. * var bound = _.bindKey(object, 'greet', _, '!');
  28576. * bound('hi');
  28577. * // => 'hiya fred!'
  28578. */
  28579. var bindKey = baseRest(function(object, key, partials) {
  28580. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  28581. if (partials.length) {
  28582. var holders = replaceHolders(partials, getHolder(bindKey));
  28583. bitmask |= WRAP_PARTIAL_FLAG;
  28584. }
  28585. return createWrap(key, bitmask, object, partials, holders);
  28586. });
  28587. /**
  28588. * Creates a function that accepts arguments of `func` and either invokes
  28589. * `func` returning its result, if at least `arity` number of arguments have
  28590. * been provided, or returns a function that accepts the remaining `func`
  28591. * arguments, and so on. The arity of `func` may be specified if `func.length`
  28592. * is not sufficient.
  28593. *
  28594. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  28595. * may be used as a placeholder for provided arguments.
  28596. *
  28597. * **Note:** This method doesn't set the "length" property of curried functions.
  28598. *
  28599. * @static
  28600. * @memberOf _
  28601. * @since 2.0.0
  28602. * @category Function
  28603. * @param {Function} func The function to curry.
  28604. * @param {number} [arity=func.length] The arity of `func`.
  28605. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  28606. * @returns {Function} Returns the new curried function.
  28607. * @example
  28608. *
  28609. * var abc = function(a, b, c) {
  28610. * return [a, b, c];
  28611. * };
  28612. *
  28613. * var curried = _.curry(abc);
  28614. *
  28615. * curried(1)(2)(3);
  28616. * // => [1, 2, 3]
  28617. *
  28618. * curried(1, 2)(3);
  28619. * // => [1, 2, 3]
  28620. *
  28621. * curried(1, 2, 3);
  28622. * // => [1, 2, 3]
  28623. *
  28624. * // Curried with placeholders.
  28625. * curried(1)(_, 3)(2);
  28626. * // => [1, 2, 3]
  28627. */
  28628. function curry(func, arity, guard) {
  28629. arity = guard ? undefined : arity;
  28630. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  28631. result.placeholder = curry.placeholder;
  28632. return result;
  28633. }
  28634. /**
  28635. * This method is like `_.curry` except that arguments are applied to `func`
  28636. * in the manner of `_.partialRight` instead of `_.partial`.
  28637. *
  28638. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  28639. * builds, may be used as a placeholder for provided arguments.
  28640. *
  28641. * **Note:** This method doesn't set the "length" property of curried functions.
  28642. *
  28643. * @static
  28644. * @memberOf _
  28645. * @since 3.0.0
  28646. * @category Function
  28647. * @param {Function} func The function to curry.
  28648. * @param {number} [arity=func.length] The arity of `func`.
  28649. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  28650. * @returns {Function} Returns the new curried function.
  28651. * @example
  28652. *
  28653. * var abc = function(a, b, c) {
  28654. * return [a, b, c];
  28655. * };
  28656. *
  28657. * var curried = _.curryRight(abc);
  28658. *
  28659. * curried(3)(2)(1);
  28660. * // => [1, 2, 3]
  28661. *
  28662. * curried(2, 3)(1);
  28663. * // => [1, 2, 3]
  28664. *
  28665. * curried(1, 2, 3);
  28666. * // => [1, 2, 3]
  28667. *
  28668. * // Curried with placeholders.
  28669. * curried(3)(1, _)(2);
  28670. * // => [1, 2, 3]
  28671. */
  28672. function curryRight(func, arity, guard) {
  28673. arity = guard ? undefined : arity;
  28674. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  28675. result.placeholder = curryRight.placeholder;
  28676. return result;
  28677. }
  28678. /**
  28679. * Creates a debounced function that delays invoking `func` until after `wait`
  28680. * milliseconds have elapsed since the last time the debounced function was
  28681. * invoked. The debounced function comes with a `cancel` method to cancel
  28682. * delayed `func` invocations and a `flush` method to immediately invoke them.
  28683. * Provide `options` to indicate whether `func` should be invoked on the
  28684. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  28685. * with the last arguments provided to the debounced function. Subsequent
  28686. * calls to the debounced function return the result of the last `func`
  28687. * invocation.
  28688. *
  28689. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  28690. * invoked on the trailing edge of the timeout only if the debounced function
  28691. * is invoked more than once during the `wait` timeout.
  28692. *
  28693. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  28694. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  28695. *
  28696. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  28697. * for details over the differences between `_.debounce` and `_.throttle`.
  28698. *
  28699. * @static
  28700. * @memberOf _
  28701. * @since 0.1.0
  28702. * @category Function
  28703. * @param {Function} func The function to debounce.
  28704. * @param {number} [wait=0] The number of milliseconds to delay.
  28705. * @param {Object} [options={}] The options object.
  28706. * @param {boolean} [options.leading=false]
  28707. * Specify invoking on the leading edge of the timeout.
  28708. * @param {number} [options.maxWait]
  28709. * The maximum time `func` is allowed to be delayed before it's invoked.
  28710. * @param {boolean} [options.trailing=true]
  28711. * Specify invoking on the trailing edge of the timeout.
  28712. * @returns {Function} Returns the new debounced function.
  28713. * @example
  28714. *
  28715. * // Avoid costly calculations while the window size is in flux.
  28716. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  28717. *
  28718. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  28719. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  28720. * 'leading': true,
  28721. * 'trailing': false
  28722. * }));
  28723. *
  28724. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  28725. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  28726. * var source = new EventSource('/stream');
  28727. * jQuery(source).on('message', debounced);
  28728. *
  28729. * // Cancel the trailing debounced invocation.
  28730. * jQuery(window).on('popstate', debounced.cancel);
  28731. */
  28732. function debounce(func, wait, options) {
  28733. var lastArgs,
  28734. lastThis,
  28735. maxWait,
  28736. result,
  28737. timerId,
  28738. lastCallTime,
  28739. lastInvokeTime = 0,
  28740. leading = false,
  28741. maxing = false,
  28742. trailing = true;
  28743. if (typeof func != 'function') {
  28744. throw new TypeError(FUNC_ERROR_TEXT);
  28745. }
  28746. wait = toNumber(wait) || 0;
  28747. if (isObject(options)) {
  28748. leading = !!options.leading;
  28749. maxing = 'maxWait' in options;
  28750. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  28751. trailing = 'trailing' in options ? !!options.trailing : trailing;
  28752. }
  28753. function invokeFunc(time) {
  28754. var args = lastArgs,
  28755. thisArg = lastThis;
  28756. lastArgs = lastThis = undefined;
  28757. lastInvokeTime = time;
  28758. result = func.apply(thisArg, args);
  28759. return result;
  28760. }
  28761. function leadingEdge(time) {
  28762. // Reset any `maxWait` timer.
  28763. lastInvokeTime = time;
  28764. // Start the timer for the trailing edge.
  28765. timerId = setTimeout(timerExpired, wait);
  28766. // Invoke the leading edge.
  28767. return leading ? invokeFunc(time) : result;
  28768. }
  28769. function remainingWait(time) {
  28770. var timeSinceLastCall = time - lastCallTime,
  28771. timeSinceLastInvoke = time - lastInvokeTime,
  28772. timeWaiting = wait - timeSinceLastCall;
  28773. return maxing
  28774. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  28775. : timeWaiting;
  28776. }
  28777. function shouldInvoke(time) {
  28778. var timeSinceLastCall = time - lastCallTime,
  28779. timeSinceLastInvoke = time - lastInvokeTime;
  28780. // Either this is the first call, activity has stopped and we're at the
  28781. // trailing edge, the system time has gone backwards and we're treating
  28782. // it as the trailing edge, or we've hit the `maxWait` limit.
  28783. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  28784. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  28785. }
  28786. function timerExpired() {
  28787. var time = now();
  28788. if (shouldInvoke(time)) {
  28789. return trailingEdge(time);
  28790. }
  28791. // Restart the timer.
  28792. timerId = setTimeout(timerExpired, remainingWait(time));
  28793. }
  28794. function trailingEdge(time) {
  28795. timerId = undefined;
  28796. // Only invoke if we have `lastArgs` which means `func` has been
  28797. // debounced at least once.
  28798. if (trailing && lastArgs) {
  28799. return invokeFunc(time);
  28800. }
  28801. lastArgs = lastThis = undefined;
  28802. return result;
  28803. }
  28804. function cancel() {
  28805. if (timerId !== undefined) {
  28806. clearTimeout(timerId);
  28807. }
  28808. lastInvokeTime = 0;
  28809. lastArgs = lastCallTime = lastThis = timerId = undefined;
  28810. }
  28811. function flush() {
  28812. return timerId === undefined ? result : trailingEdge(now());
  28813. }
  28814. function debounced() {
  28815. var time = now(),
  28816. isInvoking = shouldInvoke(time);
  28817. lastArgs = arguments;
  28818. lastThis = this;
  28819. lastCallTime = time;
  28820. if (isInvoking) {
  28821. if (timerId === undefined) {
  28822. return leadingEdge(lastCallTime);
  28823. }
  28824. if (maxing) {
  28825. // Handle invocations in a tight loop.
  28826. clearTimeout(timerId);
  28827. timerId = setTimeout(timerExpired, wait);
  28828. return invokeFunc(lastCallTime);
  28829. }
  28830. }
  28831. if (timerId === undefined) {
  28832. timerId = setTimeout(timerExpired, wait);
  28833. }
  28834. return result;
  28835. }
  28836. debounced.cancel = cancel;
  28837. debounced.flush = flush;
  28838. return debounced;
  28839. }
  28840. /**
  28841. * Defers invoking the `func` until the current call stack has cleared. Any
  28842. * additional arguments are provided to `func` when it's invoked.
  28843. *
  28844. * @static
  28845. * @memberOf _
  28846. * @since 0.1.0
  28847. * @category Function
  28848. * @param {Function} func The function to defer.
  28849. * @param {...*} [args] The arguments to invoke `func` with.
  28850. * @returns {number} Returns the timer id.
  28851. * @example
  28852. *
  28853. * _.defer(function(text) {
  28854. * console.log(text);
  28855. * }, 'deferred');
  28856. * // => Logs 'deferred' after one millisecond.
  28857. */
  28858. var defer = baseRest(function(func, args) {
  28859. return baseDelay(func, 1, args);
  28860. });
  28861. /**
  28862. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  28863. * provided to `func` when it's invoked.
  28864. *
  28865. * @static
  28866. * @memberOf _
  28867. * @since 0.1.0
  28868. * @category Function
  28869. * @param {Function} func The function to delay.
  28870. * @param {number} wait The number of milliseconds to delay invocation.
  28871. * @param {...*} [args] The arguments to invoke `func` with.
  28872. * @returns {number} Returns the timer id.
  28873. * @example
  28874. *
  28875. * _.delay(function(text) {
  28876. * console.log(text);
  28877. * }, 1000, 'later');
  28878. * // => Logs 'later' after one second.
  28879. */
  28880. var delay = baseRest(function(func, wait, args) {
  28881. return baseDelay(func, toNumber(wait) || 0, args);
  28882. });
  28883. /**
  28884. * Creates a function that invokes `func` with arguments reversed.
  28885. *
  28886. * @static
  28887. * @memberOf _
  28888. * @since 4.0.0
  28889. * @category Function
  28890. * @param {Function} func The function to flip arguments for.
  28891. * @returns {Function} Returns the new flipped function.
  28892. * @example
  28893. *
  28894. * var flipped = _.flip(function() {
  28895. * return _.toArray(arguments);
  28896. * });
  28897. *
  28898. * flipped('a', 'b', 'c', 'd');
  28899. * // => ['d', 'c', 'b', 'a']
  28900. */
  28901. function flip(func) {
  28902. return createWrap(func, WRAP_FLIP_FLAG);
  28903. }
  28904. /**
  28905. * Creates a function that memoizes the result of `func`. If `resolver` is
  28906. * provided, it determines the cache key for storing the result based on the
  28907. * arguments provided to the memoized function. By default, the first argument
  28908. * provided to the memoized function is used as the map cache key. The `func`
  28909. * is invoked with the `this` binding of the memoized function.
  28910. *
  28911. * **Note:** The cache is exposed as the `cache` property on the memoized
  28912. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  28913. * constructor with one whose instances implement the
  28914. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  28915. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  28916. *
  28917. * @static
  28918. * @memberOf _
  28919. * @since 0.1.0
  28920. * @category Function
  28921. * @param {Function} func The function to have its output memoized.
  28922. * @param {Function} [resolver] The function to resolve the cache key.
  28923. * @returns {Function} Returns the new memoized function.
  28924. * @example
  28925. *
  28926. * var object = { 'a': 1, 'b': 2 };
  28927. * var other = { 'c': 3, 'd': 4 };
  28928. *
  28929. * var values = _.memoize(_.values);
  28930. * values(object);
  28931. * // => [1, 2]
  28932. *
  28933. * values(other);
  28934. * // => [3, 4]
  28935. *
  28936. * object.a = 2;
  28937. * values(object);
  28938. * // => [1, 2]
  28939. *
  28940. * // Modify the result cache.
  28941. * values.cache.set(object, ['a', 'b']);
  28942. * values(object);
  28943. * // => ['a', 'b']
  28944. *
  28945. * // Replace `_.memoize.Cache`.
  28946. * _.memoize.Cache = WeakMap;
  28947. */
  28948. function memoize(func, resolver) {
  28949. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  28950. throw new TypeError(FUNC_ERROR_TEXT);
  28951. }
  28952. var memoized = function() {
  28953. var args = arguments,
  28954. key = resolver ? resolver.apply(this, args) : args[0],
  28955. cache = memoized.cache;
  28956. if (cache.has(key)) {
  28957. return cache.get(key);
  28958. }
  28959. var result = func.apply(this, args);
  28960. memoized.cache = cache.set(key, result) || cache;
  28961. return result;
  28962. };
  28963. memoized.cache = new (memoize.Cache || MapCache);
  28964. return memoized;
  28965. }
  28966. // Expose `MapCache`.
  28967. memoize.Cache = MapCache;
  28968. /**
  28969. * Creates a function that negates the result of the predicate `func`. The
  28970. * `func` predicate is invoked with the `this` binding and arguments of the
  28971. * created function.
  28972. *
  28973. * @static
  28974. * @memberOf _
  28975. * @since 3.0.0
  28976. * @category Function
  28977. * @param {Function} predicate The predicate to negate.
  28978. * @returns {Function} Returns the new negated function.
  28979. * @example
  28980. *
  28981. * function isEven(n) {
  28982. * return n % 2 == 0;
  28983. * }
  28984. *
  28985. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  28986. * // => [1, 3, 5]
  28987. */
  28988. function negate(predicate) {
  28989. if (typeof predicate != 'function') {
  28990. throw new TypeError(FUNC_ERROR_TEXT);
  28991. }
  28992. return function() {
  28993. var args = arguments;
  28994. switch (args.length) {
  28995. case 0: return !predicate.call(this);
  28996. case 1: return !predicate.call(this, args[0]);
  28997. case 2: return !predicate.call(this, args[0], args[1]);
  28998. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  28999. }
  29000. return !predicate.apply(this, args);
  29001. };
  29002. }
  29003. /**
  29004. * Creates a function that is restricted to invoking `func` once. Repeat calls
  29005. * to the function return the value of the first invocation. The `func` is
  29006. * invoked with the `this` binding and arguments of the created function.
  29007. *
  29008. * @static
  29009. * @memberOf _
  29010. * @since 0.1.0
  29011. * @category Function
  29012. * @param {Function} func The function to restrict.
  29013. * @returns {Function} Returns the new restricted function.
  29014. * @example
  29015. *
  29016. * var initialize = _.once(createApplication);
  29017. * initialize();
  29018. * initialize();
  29019. * // => `createApplication` is invoked once
  29020. */
  29021. function once(func) {
  29022. return before(2, func);
  29023. }
  29024. /**
  29025. * Creates a function that invokes `func` with its arguments transformed.
  29026. *
  29027. * @static
  29028. * @since 4.0.0
  29029. * @memberOf _
  29030. * @category Function
  29031. * @param {Function} func The function to wrap.
  29032. * @param {...(Function|Function[])} [transforms=[_.identity]]
  29033. * The argument transforms.
  29034. * @returns {Function} Returns the new function.
  29035. * @example
  29036. *
  29037. * function doubled(n) {
  29038. * return n * 2;
  29039. * }
  29040. *
  29041. * function square(n) {
  29042. * return n * n;
  29043. * }
  29044. *
  29045. * var func = _.overArgs(function(x, y) {
  29046. * return [x, y];
  29047. * }, [square, doubled]);
  29048. *
  29049. * func(9, 3);
  29050. * // => [81, 6]
  29051. *
  29052. * func(10, 5);
  29053. * // => [100, 10]
  29054. */
  29055. var overArgs = castRest(function(func, transforms) {
  29056. transforms = (transforms.length == 1 && isArray(transforms[0]))
  29057. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  29058. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  29059. var funcsLength = transforms.length;
  29060. return baseRest(function(args) {
  29061. var index = -1,
  29062. length = nativeMin(args.length, funcsLength);
  29063. while (++index < length) {
  29064. args[index] = transforms[index].call(this, args[index]);
  29065. }
  29066. return apply(func, this, args);
  29067. });
  29068. });
  29069. /**
  29070. * Creates a function that invokes `func` with `partials` prepended to the
  29071. * arguments it receives. This method is like `_.bind` except it does **not**
  29072. * alter the `this` binding.
  29073. *
  29074. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  29075. * builds, may be used as a placeholder for partially applied arguments.
  29076. *
  29077. * **Note:** This method doesn't set the "length" property of partially
  29078. * applied functions.
  29079. *
  29080. * @static
  29081. * @memberOf _
  29082. * @since 0.2.0
  29083. * @category Function
  29084. * @param {Function} func The function to partially apply arguments to.
  29085. * @param {...*} [partials] The arguments to be partially applied.
  29086. * @returns {Function} Returns the new partially applied function.
  29087. * @example
  29088. *
  29089. * function greet(greeting, name) {
  29090. * return greeting + ' ' + name;
  29091. * }
  29092. *
  29093. * var sayHelloTo = _.partial(greet, 'hello');
  29094. * sayHelloTo('fred');
  29095. * // => 'hello fred'
  29096. *
  29097. * // Partially applied with placeholders.
  29098. * var greetFred = _.partial(greet, _, 'fred');
  29099. * greetFred('hi');
  29100. * // => 'hi fred'
  29101. */
  29102. var partial = baseRest(function(func, partials) {
  29103. var holders = replaceHolders(partials, getHolder(partial));
  29104. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  29105. });
  29106. /**
  29107. * This method is like `_.partial` except that partially applied arguments
  29108. * are appended to the arguments it receives.
  29109. *
  29110. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  29111. * builds, may be used as a placeholder for partially applied arguments.
  29112. *
  29113. * **Note:** This method doesn't set the "length" property of partially
  29114. * applied functions.
  29115. *
  29116. * @static
  29117. * @memberOf _
  29118. * @since 1.0.0
  29119. * @category Function
  29120. * @param {Function} func The function to partially apply arguments to.
  29121. * @param {...*} [partials] The arguments to be partially applied.
  29122. * @returns {Function} Returns the new partially applied function.
  29123. * @example
  29124. *
  29125. * function greet(greeting, name) {
  29126. * return greeting + ' ' + name;
  29127. * }
  29128. *
  29129. * var greetFred = _.partialRight(greet, 'fred');
  29130. * greetFred('hi');
  29131. * // => 'hi fred'
  29132. *
  29133. * // Partially applied with placeholders.
  29134. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  29135. * sayHelloTo('fred');
  29136. * // => 'hello fred'
  29137. */
  29138. var partialRight = baseRest(function(func, partials) {
  29139. var holders = replaceHolders(partials, getHolder(partialRight));
  29140. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  29141. });
  29142. /**
  29143. * Creates a function that invokes `func` with arguments arranged according
  29144. * to the specified `indexes` where the argument value at the first index is
  29145. * provided as the first argument, the argument value at the second index is
  29146. * provided as the second argument, and so on.
  29147. *
  29148. * @static
  29149. * @memberOf _
  29150. * @since 3.0.0
  29151. * @category Function
  29152. * @param {Function} func The function to rearrange arguments for.
  29153. * @param {...(number|number[])} indexes The arranged argument indexes.
  29154. * @returns {Function} Returns the new function.
  29155. * @example
  29156. *
  29157. * var rearged = _.rearg(function(a, b, c) {
  29158. * return [a, b, c];
  29159. * }, [2, 0, 1]);
  29160. *
  29161. * rearged('b', 'c', 'a')
  29162. * // => ['a', 'b', 'c']
  29163. */
  29164. var rearg = flatRest(function(func, indexes) {
  29165. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  29166. });
  29167. /**
  29168. * Creates a function that invokes `func` with the `this` binding of the
  29169. * created function and arguments from `start` and beyond provided as
  29170. * an array.
  29171. *
  29172. * **Note:** This method is based on the
  29173. * [rest parameter](https://mdn.io/rest_parameters).
  29174. *
  29175. * @static
  29176. * @memberOf _
  29177. * @since 4.0.0
  29178. * @category Function
  29179. * @param {Function} func The function to apply a rest parameter to.
  29180. * @param {number} [start=func.length-1] The start position of the rest parameter.
  29181. * @returns {Function} Returns the new function.
  29182. * @example
  29183. *
  29184. * var say = _.rest(function(what, names) {
  29185. * return what + ' ' + _.initial(names).join(', ') +
  29186. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  29187. * });
  29188. *
  29189. * say('hello', 'fred', 'barney', 'pebbles');
  29190. * // => 'hello fred, barney, & pebbles'
  29191. */
  29192. function rest(func, start) {
  29193. if (typeof func != 'function') {
  29194. throw new TypeError(FUNC_ERROR_TEXT);
  29195. }
  29196. start = start === undefined ? start : toInteger(start);
  29197. return baseRest(func, start);
  29198. }
  29199. /**
  29200. * Creates a function that invokes `func` with the `this` binding of the
  29201. * create function and an array of arguments much like
  29202. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  29203. *
  29204. * **Note:** This method is based on the
  29205. * [spread operator](https://mdn.io/spread_operator).
  29206. *
  29207. * @static
  29208. * @memberOf _
  29209. * @since 3.2.0
  29210. * @category Function
  29211. * @param {Function} func The function to spread arguments over.
  29212. * @param {number} [start=0] The start position of the spread.
  29213. * @returns {Function} Returns the new function.
  29214. * @example
  29215. *
  29216. * var say = _.spread(function(who, what) {
  29217. * return who + ' says ' + what;
  29218. * });
  29219. *
  29220. * say(['fred', 'hello']);
  29221. * // => 'fred says hello'
  29222. *
  29223. * var numbers = Promise.all([
  29224. * Promise.resolve(40),
  29225. * Promise.resolve(36)
  29226. * ]);
  29227. *
  29228. * numbers.then(_.spread(function(x, y) {
  29229. * return x + y;
  29230. * }));
  29231. * // => a Promise of 76
  29232. */
  29233. function spread(func, start) {
  29234. if (typeof func != 'function') {
  29235. throw new TypeError(FUNC_ERROR_TEXT);
  29236. }
  29237. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  29238. return baseRest(function(args) {
  29239. var array = args[start],
  29240. otherArgs = castSlice(args, 0, start);
  29241. if (array) {
  29242. arrayPush(otherArgs, array);
  29243. }
  29244. return apply(func, this, otherArgs);
  29245. });
  29246. }
  29247. /**
  29248. * Creates a throttled function that only invokes `func` at most once per
  29249. * every `wait` milliseconds. The throttled function comes with a `cancel`
  29250. * method to cancel delayed `func` invocations and a `flush` method to
  29251. * immediately invoke them. Provide `options` to indicate whether `func`
  29252. * should be invoked on the leading and/or trailing edge of the `wait`
  29253. * timeout. The `func` is invoked with the last arguments provided to the
  29254. * throttled function. Subsequent calls to the throttled function return the
  29255. * result of the last `func` invocation.
  29256. *
  29257. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  29258. * invoked on the trailing edge of the timeout only if the throttled function
  29259. * is invoked more than once during the `wait` timeout.
  29260. *
  29261. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  29262. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  29263. *
  29264. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  29265. * for details over the differences between `_.throttle` and `_.debounce`.
  29266. *
  29267. * @static
  29268. * @memberOf _
  29269. * @since 0.1.0
  29270. * @category Function
  29271. * @param {Function} func The function to throttle.
  29272. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  29273. * @param {Object} [options={}] The options object.
  29274. * @param {boolean} [options.leading=true]
  29275. * Specify invoking on the leading edge of the timeout.
  29276. * @param {boolean} [options.trailing=true]
  29277. * Specify invoking on the trailing edge of the timeout.
  29278. * @returns {Function} Returns the new throttled function.
  29279. * @example
  29280. *
  29281. * // Avoid excessively updating the position while scrolling.
  29282. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  29283. *
  29284. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  29285. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  29286. * jQuery(element).on('click', throttled);
  29287. *
  29288. * // Cancel the trailing throttled invocation.
  29289. * jQuery(window).on('popstate', throttled.cancel);
  29290. */
  29291. function throttle(func, wait, options) {
  29292. var leading = true,
  29293. trailing = true;
  29294. if (typeof func != 'function') {
  29295. throw new TypeError(FUNC_ERROR_TEXT);
  29296. }
  29297. if (isObject(options)) {
  29298. leading = 'leading' in options ? !!options.leading : leading;
  29299. trailing = 'trailing' in options ? !!options.trailing : trailing;
  29300. }
  29301. return debounce(func, wait, {
  29302. 'leading': leading,
  29303. 'maxWait': wait,
  29304. 'trailing': trailing
  29305. });
  29306. }
  29307. /**
  29308. * Creates a function that accepts up to one argument, ignoring any
  29309. * additional arguments.
  29310. *
  29311. * @static
  29312. * @memberOf _
  29313. * @since 4.0.0
  29314. * @category Function
  29315. * @param {Function} func The function to cap arguments for.
  29316. * @returns {Function} Returns the new capped function.
  29317. * @example
  29318. *
  29319. * _.map(['6', '8', '10'], _.unary(parseInt));
  29320. * // => [6, 8, 10]
  29321. */
  29322. function unary(func) {
  29323. return ary(func, 1);
  29324. }
  29325. /**
  29326. * Creates a function that provides `value` to `wrapper` as its first
  29327. * argument. Any additional arguments provided to the function are appended
  29328. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  29329. * binding of the created function.
  29330. *
  29331. * @static
  29332. * @memberOf _
  29333. * @since 0.1.0
  29334. * @category Function
  29335. * @param {*} value The value to wrap.
  29336. * @param {Function} [wrapper=identity] The wrapper function.
  29337. * @returns {Function} Returns the new function.
  29338. * @example
  29339. *
  29340. * var p = _.wrap(_.escape, function(func, text) {
  29341. * return '<p>' + func(text) + '</p>';
  29342. * });
  29343. *
  29344. * p('fred, barney, & pebbles');
  29345. * // => '<p>fred, barney, &amp; pebbles</p>'
  29346. */
  29347. function wrap(value, wrapper) {
  29348. return partial(castFunction(wrapper), value);
  29349. }
  29350. /*------------------------------------------------------------------------*/
  29351. /**
  29352. * Casts `value` as an array if it's not one.
  29353. *
  29354. * @static
  29355. * @memberOf _
  29356. * @since 4.4.0
  29357. * @category Lang
  29358. * @param {*} value The value to inspect.
  29359. * @returns {Array} Returns the cast array.
  29360. * @example
  29361. *
  29362. * _.castArray(1);
  29363. * // => [1]
  29364. *
  29365. * _.castArray({ 'a': 1 });
  29366. * // => [{ 'a': 1 }]
  29367. *
  29368. * _.castArray('abc');
  29369. * // => ['abc']
  29370. *
  29371. * _.castArray(null);
  29372. * // => [null]
  29373. *
  29374. * _.castArray(undefined);
  29375. * // => [undefined]
  29376. *
  29377. * _.castArray();
  29378. * // => []
  29379. *
  29380. * var array = [1, 2, 3];
  29381. * console.log(_.castArray(array) === array);
  29382. * // => true
  29383. */
  29384. function castArray() {
  29385. if (!arguments.length) {
  29386. return [];
  29387. }
  29388. var value = arguments[0];
  29389. return isArray(value) ? value : [value];
  29390. }
  29391. /**
  29392. * Creates a shallow clone of `value`.
  29393. *
  29394. * **Note:** This method is loosely based on the
  29395. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  29396. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  29397. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  29398. * arrays. The own enumerable properties of `arguments` objects are cloned
  29399. * as plain objects. An empty object is returned for uncloneable values such
  29400. * as error objects, functions, DOM nodes, and WeakMaps.
  29401. *
  29402. * @static
  29403. * @memberOf _
  29404. * @since 0.1.0
  29405. * @category Lang
  29406. * @param {*} value The value to clone.
  29407. * @returns {*} Returns the cloned value.
  29408. * @see _.cloneDeep
  29409. * @example
  29410. *
  29411. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  29412. *
  29413. * var shallow = _.clone(objects);
  29414. * console.log(shallow[0] === objects[0]);
  29415. * // => true
  29416. */
  29417. function clone(value) {
  29418. return baseClone(value, CLONE_SYMBOLS_FLAG);
  29419. }
  29420. /**
  29421. * This method is like `_.clone` except that it accepts `customizer` which
  29422. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  29423. * cloning is handled by the method instead. The `customizer` is invoked with
  29424. * up to four arguments; (value [, index|key, object, stack]).
  29425. *
  29426. * @static
  29427. * @memberOf _
  29428. * @since 4.0.0
  29429. * @category Lang
  29430. * @param {*} value The value to clone.
  29431. * @param {Function} [customizer] The function to customize cloning.
  29432. * @returns {*} Returns the cloned value.
  29433. * @see _.cloneDeepWith
  29434. * @example
  29435. *
  29436. * function customizer(value) {
  29437. * if (_.isElement(value)) {
  29438. * return value.cloneNode(false);
  29439. * }
  29440. * }
  29441. *
  29442. * var el = _.cloneWith(document.body, customizer);
  29443. *
  29444. * console.log(el === document.body);
  29445. * // => false
  29446. * console.log(el.nodeName);
  29447. * // => 'BODY'
  29448. * console.log(el.childNodes.length);
  29449. * // => 0
  29450. */
  29451. function cloneWith(value, customizer) {
  29452. customizer = typeof customizer == 'function' ? customizer : undefined;
  29453. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  29454. }
  29455. /**
  29456. * This method is like `_.clone` except that it recursively clones `value`.
  29457. *
  29458. * @static
  29459. * @memberOf _
  29460. * @since 1.0.0
  29461. * @category Lang
  29462. * @param {*} value The value to recursively clone.
  29463. * @returns {*} Returns the deep cloned value.
  29464. * @see _.clone
  29465. * @example
  29466. *
  29467. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  29468. *
  29469. * var deep = _.cloneDeep(objects);
  29470. * console.log(deep[0] === objects[0]);
  29471. * // => false
  29472. */
  29473. function cloneDeep(value) {
  29474. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  29475. }
  29476. /**
  29477. * This method is like `_.cloneWith` except that it recursively clones `value`.
  29478. *
  29479. * @static
  29480. * @memberOf _
  29481. * @since 4.0.0
  29482. * @category Lang
  29483. * @param {*} value The value to recursively clone.
  29484. * @param {Function} [customizer] The function to customize cloning.
  29485. * @returns {*} Returns the deep cloned value.
  29486. * @see _.cloneWith
  29487. * @example
  29488. *
  29489. * function customizer(value) {
  29490. * if (_.isElement(value)) {
  29491. * return value.cloneNode(true);
  29492. * }
  29493. * }
  29494. *
  29495. * var el = _.cloneDeepWith(document.body, customizer);
  29496. *
  29497. * console.log(el === document.body);
  29498. * // => false
  29499. * console.log(el.nodeName);
  29500. * // => 'BODY'
  29501. * console.log(el.childNodes.length);
  29502. * // => 20
  29503. */
  29504. function cloneDeepWith(value, customizer) {
  29505. customizer = typeof customizer == 'function' ? customizer : undefined;
  29506. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  29507. }
  29508. /**
  29509. * Checks if `object` conforms to `source` by invoking the predicate
  29510. * properties of `source` with the corresponding property values of `object`.
  29511. *
  29512. * **Note:** This method is equivalent to `_.conforms` when `source` is
  29513. * partially applied.
  29514. *
  29515. * @static
  29516. * @memberOf _
  29517. * @since 4.14.0
  29518. * @category Lang
  29519. * @param {Object} object The object to inspect.
  29520. * @param {Object} source The object of property predicates to conform to.
  29521. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  29522. * @example
  29523. *
  29524. * var object = { 'a': 1, 'b': 2 };
  29525. *
  29526. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  29527. * // => true
  29528. *
  29529. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  29530. * // => false
  29531. */
  29532. function conformsTo(object, source) {
  29533. return source == null || baseConformsTo(object, source, keys(source));
  29534. }
  29535. /**
  29536. * Performs a
  29537. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  29538. * comparison between two values to determine if they are equivalent.
  29539. *
  29540. * @static
  29541. * @memberOf _
  29542. * @since 4.0.0
  29543. * @category Lang
  29544. * @param {*} value The value to compare.
  29545. * @param {*} other The other value to compare.
  29546. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  29547. * @example
  29548. *
  29549. * var object = { 'a': 1 };
  29550. * var other = { 'a': 1 };
  29551. *
  29552. * _.eq(object, object);
  29553. * // => true
  29554. *
  29555. * _.eq(object, other);
  29556. * // => false
  29557. *
  29558. * _.eq('a', 'a');
  29559. * // => true
  29560. *
  29561. * _.eq('a', Object('a'));
  29562. * // => false
  29563. *
  29564. * _.eq(NaN, NaN);
  29565. * // => true
  29566. */
  29567. function eq(value, other) {
  29568. return value === other || (value !== value && other !== other);
  29569. }
  29570. /**
  29571. * Checks if `value` is greater than `other`.
  29572. *
  29573. * @static
  29574. * @memberOf _
  29575. * @since 3.9.0
  29576. * @category Lang
  29577. * @param {*} value The value to compare.
  29578. * @param {*} other The other value to compare.
  29579. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  29580. * else `false`.
  29581. * @see _.lt
  29582. * @example
  29583. *
  29584. * _.gt(3, 1);
  29585. * // => true
  29586. *
  29587. * _.gt(3, 3);
  29588. * // => false
  29589. *
  29590. * _.gt(1, 3);
  29591. * // => false
  29592. */
  29593. var gt = createRelationalOperation(baseGt);
  29594. /**
  29595. * Checks if `value` is greater than or equal to `other`.
  29596. *
  29597. * @static
  29598. * @memberOf _
  29599. * @since 3.9.0
  29600. * @category Lang
  29601. * @param {*} value The value to compare.
  29602. * @param {*} other The other value to compare.
  29603. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  29604. * `other`, else `false`.
  29605. * @see _.lte
  29606. * @example
  29607. *
  29608. * _.gte(3, 1);
  29609. * // => true
  29610. *
  29611. * _.gte(3, 3);
  29612. * // => true
  29613. *
  29614. * _.gte(1, 3);
  29615. * // => false
  29616. */
  29617. var gte = createRelationalOperation(function(value, other) {
  29618. return value >= other;
  29619. });
  29620. /**
  29621. * Checks if `value` is likely an `arguments` object.
  29622. *
  29623. * @static
  29624. * @memberOf _
  29625. * @since 0.1.0
  29626. * @category Lang
  29627. * @param {*} value The value to check.
  29628. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  29629. * else `false`.
  29630. * @example
  29631. *
  29632. * _.isArguments(function() { return arguments; }());
  29633. * // => true
  29634. *
  29635. * _.isArguments([1, 2, 3]);
  29636. * // => false
  29637. */
  29638. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  29639. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  29640. !propertyIsEnumerable.call(value, 'callee');
  29641. };
  29642. /**
  29643. * Checks if `value` is classified as an `Array` object.
  29644. *
  29645. * @static
  29646. * @memberOf _
  29647. * @since 0.1.0
  29648. * @category Lang
  29649. * @param {*} value The value to check.
  29650. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  29651. * @example
  29652. *
  29653. * _.isArray([1, 2, 3]);
  29654. * // => true
  29655. *
  29656. * _.isArray(document.body.children);
  29657. * // => false
  29658. *
  29659. * _.isArray('abc');
  29660. * // => false
  29661. *
  29662. * _.isArray(_.noop);
  29663. * // => false
  29664. */
  29665. var isArray = Array.isArray;
  29666. /**
  29667. * Checks if `value` is classified as an `ArrayBuffer` object.
  29668. *
  29669. * @static
  29670. * @memberOf _
  29671. * @since 4.3.0
  29672. * @category Lang
  29673. * @param {*} value The value to check.
  29674. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  29675. * @example
  29676. *
  29677. * _.isArrayBuffer(new ArrayBuffer(2));
  29678. * // => true
  29679. *
  29680. * _.isArrayBuffer(new Array(2));
  29681. * // => false
  29682. */
  29683. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  29684. /**
  29685. * Checks if `value` is array-like. A value is considered array-like if it's
  29686. * not a function and has a `value.length` that's an integer greater than or
  29687. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  29688. *
  29689. * @static
  29690. * @memberOf _
  29691. * @since 4.0.0
  29692. * @category Lang
  29693. * @param {*} value The value to check.
  29694. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  29695. * @example
  29696. *
  29697. * _.isArrayLike([1, 2, 3]);
  29698. * // => true
  29699. *
  29700. * _.isArrayLike(document.body.children);
  29701. * // => true
  29702. *
  29703. * _.isArrayLike('abc');
  29704. * // => true
  29705. *
  29706. * _.isArrayLike(_.noop);
  29707. * // => false
  29708. */
  29709. function isArrayLike(value) {
  29710. return value != null && isLength(value.length) && !isFunction(value);
  29711. }
  29712. /**
  29713. * This method is like `_.isArrayLike` except that it also checks if `value`
  29714. * is an object.
  29715. *
  29716. * @static
  29717. * @memberOf _
  29718. * @since 4.0.0
  29719. * @category Lang
  29720. * @param {*} value The value to check.
  29721. * @returns {boolean} Returns `true` if `value` is an array-like object,
  29722. * else `false`.
  29723. * @example
  29724. *
  29725. * _.isArrayLikeObject([1, 2, 3]);
  29726. * // => true
  29727. *
  29728. * _.isArrayLikeObject(document.body.children);
  29729. * // => true
  29730. *
  29731. * _.isArrayLikeObject('abc');
  29732. * // => false
  29733. *
  29734. * _.isArrayLikeObject(_.noop);
  29735. * // => false
  29736. */
  29737. function isArrayLikeObject(value) {
  29738. return isObjectLike(value) && isArrayLike(value);
  29739. }
  29740. /**
  29741. * Checks if `value` is classified as a boolean primitive or object.
  29742. *
  29743. * @static
  29744. * @memberOf _
  29745. * @since 0.1.0
  29746. * @category Lang
  29747. * @param {*} value The value to check.
  29748. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  29749. * @example
  29750. *
  29751. * _.isBoolean(false);
  29752. * // => true
  29753. *
  29754. * _.isBoolean(null);
  29755. * // => false
  29756. */
  29757. function isBoolean(value) {
  29758. return value === true || value === false ||
  29759. (isObjectLike(value) && baseGetTag(value) == boolTag);
  29760. }
  29761. /**
  29762. * Checks if `value` is a buffer.
  29763. *
  29764. * @static
  29765. * @memberOf _
  29766. * @since 4.3.0
  29767. * @category Lang
  29768. * @param {*} value The value to check.
  29769. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  29770. * @example
  29771. *
  29772. * _.isBuffer(new Buffer(2));
  29773. * // => true
  29774. *
  29775. * _.isBuffer(new Uint8Array(2));
  29776. * // => false
  29777. */
  29778. var isBuffer = nativeIsBuffer || stubFalse;
  29779. /**
  29780. * Checks if `value` is classified as a `Date` object.
  29781. *
  29782. * @static
  29783. * @memberOf _
  29784. * @since 0.1.0
  29785. * @category Lang
  29786. * @param {*} value The value to check.
  29787. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  29788. * @example
  29789. *
  29790. * _.isDate(new Date);
  29791. * // => true
  29792. *
  29793. * _.isDate('Mon April 23 2012');
  29794. * // => false
  29795. */
  29796. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  29797. /**
  29798. * Checks if `value` is likely a DOM element.
  29799. *
  29800. * @static
  29801. * @memberOf _
  29802. * @since 0.1.0
  29803. * @category Lang
  29804. * @param {*} value The value to check.
  29805. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  29806. * @example
  29807. *
  29808. * _.isElement(document.body);
  29809. * // => true
  29810. *
  29811. * _.isElement('<body>');
  29812. * // => false
  29813. */
  29814. function isElement(value) {
  29815. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  29816. }
  29817. /**
  29818. * Checks if `value` is an empty object, collection, map, or set.
  29819. *
  29820. * Objects are considered empty if they have no own enumerable string keyed
  29821. * properties.
  29822. *
  29823. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  29824. * jQuery-like collections are considered empty if they have a `length` of `0`.
  29825. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  29826. *
  29827. * @static
  29828. * @memberOf _
  29829. * @since 0.1.0
  29830. * @category Lang
  29831. * @param {*} value The value to check.
  29832. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  29833. * @example
  29834. *
  29835. * _.isEmpty(null);
  29836. * // => true
  29837. *
  29838. * _.isEmpty(true);
  29839. * // => true
  29840. *
  29841. * _.isEmpty(1);
  29842. * // => true
  29843. *
  29844. * _.isEmpty([1, 2, 3]);
  29845. * // => false
  29846. *
  29847. * _.isEmpty({ 'a': 1 });
  29848. * // => false
  29849. */
  29850. function isEmpty(value) {
  29851. if (value == null) {
  29852. return true;
  29853. }
  29854. if (isArrayLike(value) &&
  29855. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  29856. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  29857. return !value.length;
  29858. }
  29859. var tag = getTag(value);
  29860. if (tag == mapTag || tag == setTag) {
  29861. return !value.size;
  29862. }
  29863. if (isPrototype(value)) {
  29864. return !baseKeys(value).length;
  29865. }
  29866. for (var key in value) {
  29867. if (hasOwnProperty.call(value, key)) {
  29868. return false;
  29869. }
  29870. }
  29871. return true;
  29872. }
  29873. /**
  29874. * Performs a deep comparison between two values to determine if they are
  29875. * equivalent.
  29876. *
  29877. * **Note:** This method supports comparing arrays, array buffers, booleans,
  29878. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  29879. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  29880. * by their own, not inherited, enumerable properties. Functions and DOM
  29881. * nodes are compared by strict equality, i.e. `===`.
  29882. *
  29883. * @static
  29884. * @memberOf _
  29885. * @since 0.1.0
  29886. * @category Lang
  29887. * @param {*} value The value to compare.
  29888. * @param {*} other The other value to compare.
  29889. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  29890. * @example
  29891. *
  29892. * var object = { 'a': 1 };
  29893. * var other = { 'a': 1 };
  29894. *
  29895. * _.isEqual(object, other);
  29896. * // => true
  29897. *
  29898. * object === other;
  29899. * // => false
  29900. */
  29901. function isEqual(value, other) {
  29902. return baseIsEqual(value, other);
  29903. }
  29904. /**
  29905. * This method is like `_.isEqual` except that it accepts `customizer` which
  29906. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  29907. * are handled by the method instead. The `customizer` is invoked with up to
  29908. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  29909. *
  29910. * @static
  29911. * @memberOf _
  29912. * @since 4.0.0
  29913. * @category Lang
  29914. * @param {*} value The value to compare.
  29915. * @param {*} other The other value to compare.
  29916. * @param {Function} [customizer] The function to customize comparisons.
  29917. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  29918. * @example
  29919. *
  29920. * function isGreeting(value) {
  29921. * return /^h(?:i|ello)$/.test(value);
  29922. * }
  29923. *
  29924. * function customizer(objValue, othValue) {
  29925. * if (isGreeting(objValue) && isGreeting(othValue)) {
  29926. * return true;
  29927. * }
  29928. * }
  29929. *
  29930. * var array = ['hello', 'goodbye'];
  29931. * var other = ['hi', 'goodbye'];
  29932. *
  29933. * _.isEqualWith(array, other, customizer);
  29934. * // => true
  29935. */
  29936. function isEqualWith(value, other, customizer) {
  29937. customizer = typeof customizer == 'function' ? customizer : undefined;
  29938. var result = customizer ? customizer(value, other) : undefined;
  29939. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  29940. }
  29941. /**
  29942. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  29943. * `SyntaxError`, `TypeError`, or `URIError` object.
  29944. *
  29945. * @static
  29946. * @memberOf _
  29947. * @since 3.0.0
  29948. * @category Lang
  29949. * @param {*} value The value to check.
  29950. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  29951. * @example
  29952. *
  29953. * _.isError(new Error);
  29954. * // => true
  29955. *
  29956. * _.isError(Error);
  29957. * // => false
  29958. */
  29959. function isError(value) {
  29960. if (!isObjectLike(value)) {
  29961. return false;
  29962. }
  29963. var tag = baseGetTag(value);
  29964. return tag == errorTag || tag == domExcTag ||
  29965. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  29966. }
  29967. /**
  29968. * Checks if `value` is a finite primitive number.
  29969. *
  29970. * **Note:** This method is based on
  29971. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  29972. *
  29973. * @static
  29974. * @memberOf _
  29975. * @since 0.1.0
  29976. * @category Lang
  29977. * @param {*} value The value to check.
  29978. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  29979. * @example
  29980. *
  29981. * _.isFinite(3);
  29982. * // => true
  29983. *
  29984. * _.isFinite(Number.MIN_VALUE);
  29985. * // => true
  29986. *
  29987. * _.isFinite(Infinity);
  29988. * // => false
  29989. *
  29990. * _.isFinite('3');
  29991. * // => false
  29992. */
  29993. function isFinite(value) {
  29994. return typeof value == 'number' && nativeIsFinite(value);
  29995. }
  29996. /**
  29997. * Checks if `value` is classified as a `Function` object.
  29998. *
  29999. * @static
  30000. * @memberOf _
  30001. * @since 0.1.0
  30002. * @category Lang
  30003. * @param {*} value The value to check.
  30004. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  30005. * @example
  30006. *
  30007. * _.isFunction(_);
  30008. * // => true
  30009. *
  30010. * _.isFunction(/abc/);
  30011. * // => false
  30012. */
  30013. function isFunction(value) {
  30014. if (!isObject(value)) {
  30015. return false;
  30016. }
  30017. // The use of `Object#toString` avoids issues with the `typeof` operator
  30018. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  30019. var tag = baseGetTag(value);
  30020. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  30021. }
  30022. /**
  30023. * Checks if `value` is an integer.
  30024. *
  30025. * **Note:** This method is based on
  30026. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  30027. *
  30028. * @static
  30029. * @memberOf _
  30030. * @since 4.0.0
  30031. * @category Lang
  30032. * @param {*} value The value to check.
  30033. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  30034. * @example
  30035. *
  30036. * _.isInteger(3);
  30037. * // => true
  30038. *
  30039. * _.isInteger(Number.MIN_VALUE);
  30040. * // => false
  30041. *
  30042. * _.isInteger(Infinity);
  30043. * // => false
  30044. *
  30045. * _.isInteger('3');
  30046. * // => false
  30047. */
  30048. function isInteger(value) {
  30049. return typeof value == 'number' && value == toInteger(value);
  30050. }
  30051. /**
  30052. * Checks if `value` is a valid array-like length.
  30053. *
  30054. * **Note:** This method is loosely based on
  30055. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  30056. *
  30057. * @static
  30058. * @memberOf _
  30059. * @since 4.0.0
  30060. * @category Lang
  30061. * @param {*} value The value to check.
  30062. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  30063. * @example
  30064. *
  30065. * _.isLength(3);
  30066. * // => true
  30067. *
  30068. * _.isLength(Number.MIN_VALUE);
  30069. * // => false
  30070. *
  30071. * _.isLength(Infinity);
  30072. * // => false
  30073. *
  30074. * _.isLength('3');
  30075. * // => false
  30076. */
  30077. function isLength(value) {
  30078. return typeof value == 'number' &&
  30079. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  30080. }
  30081. /**
  30082. * Checks if `value` is the
  30083. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  30084. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  30085. *
  30086. * @static
  30087. * @memberOf _
  30088. * @since 0.1.0
  30089. * @category Lang
  30090. * @param {*} value The value to check.
  30091. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  30092. * @example
  30093. *
  30094. * _.isObject({});
  30095. * // => true
  30096. *
  30097. * _.isObject([1, 2, 3]);
  30098. * // => true
  30099. *
  30100. * _.isObject(_.noop);
  30101. * // => true
  30102. *
  30103. * _.isObject(null);
  30104. * // => false
  30105. */
  30106. function isObject(value) {
  30107. var type = typeof value;
  30108. return value != null && (type == 'object' || type == 'function');
  30109. }
  30110. /**
  30111. * Checks if `value` is object-like. A value is object-like if it's not `null`
  30112. * and has a `typeof` result of "object".
  30113. *
  30114. * @static
  30115. * @memberOf _
  30116. * @since 4.0.0
  30117. * @category Lang
  30118. * @param {*} value The value to check.
  30119. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  30120. * @example
  30121. *
  30122. * _.isObjectLike({});
  30123. * // => true
  30124. *
  30125. * _.isObjectLike([1, 2, 3]);
  30126. * // => true
  30127. *
  30128. * _.isObjectLike(_.noop);
  30129. * // => false
  30130. *
  30131. * _.isObjectLike(null);
  30132. * // => false
  30133. */
  30134. function isObjectLike(value) {
  30135. return value != null && typeof value == 'object';
  30136. }
  30137. /**
  30138. * Checks if `value` is classified as a `Map` object.
  30139. *
  30140. * @static
  30141. * @memberOf _
  30142. * @since 4.3.0
  30143. * @category Lang
  30144. * @param {*} value The value to check.
  30145. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  30146. * @example
  30147. *
  30148. * _.isMap(new Map);
  30149. * // => true
  30150. *
  30151. * _.isMap(new WeakMap);
  30152. * // => false
  30153. */
  30154. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  30155. /**
  30156. * Performs a partial deep comparison between `object` and `source` to
  30157. * determine if `object` contains equivalent property values.
  30158. *
  30159. * **Note:** This method is equivalent to `_.matches` when `source` is
  30160. * partially applied.
  30161. *
  30162. * Partial comparisons will match empty array and empty object `source`
  30163. * values against any array or object value, respectively. See `_.isEqual`
  30164. * for a list of supported value comparisons.
  30165. *
  30166. * @static
  30167. * @memberOf _
  30168. * @since 3.0.0
  30169. * @category Lang
  30170. * @param {Object} object The object to inspect.
  30171. * @param {Object} source The object of property values to match.
  30172. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  30173. * @example
  30174. *
  30175. * var object = { 'a': 1, 'b': 2 };
  30176. *
  30177. * _.isMatch(object, { 'b': 2 });
  30178. * // => true
  30179. *
  30180. * _.isMatch(object, { 'b': 1 });
  30181. * // => false
  30182. */
  30183. function isMatch(object, source) {
  30184. return object === source || baseIsMatch(object, source, getMatchData(source));
  30185. }
  30186. /**
  30187. * This method is like `_.isMatch` except that it accepts `customizer` which
  30188. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  30189. * are handled by the method instead. The `customizer` is invoked with five
  30190. * arguments: (objValue, srcValue, index|key, object, source).
  30191. *
  30192. * @static
  30193. * @memberOf _
  30194. * @since 4.0.0
  30195. * @category Lang
  30196. * @param {Object} object The object to inspect.
  30197. * @param {Object} source The object of property values to match.
  30198. * @param {Function} [customizer] The function to customize comparisons.
  30199. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  30200. * @example
  30201. *
  30202. * function isGreeting(value) {
  30203. * return /^h(?:i|ello)$/.test(value);
  30204. * }
  30205. *
  30206. * function customizer(objValue, srcValue) {
  30207. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  30208. * return true;
  30209. * }
  30210. * }
  30211. *
  30212. * var object = { 'greeting': 'hello' };
  30213. * var source = { 'greeting': 'hi' };
  30214. *
  30215. * _.isMatchWith(object, source, customizer);
  30216. * // => true
  30217. */
  30218. function isMatchWith(object, source, customizer) {
  30219. customizer = typeof customizer == 'function' ? customizer : undefined;
  30220. return baseIsMatch(object, source, getMatchData(source), customizer);
  30221. }
  30222. /**
  30223. * Checks if `value` is `NaN`.
  30224. *
  30225. * **Note:** This method is based on
  30226. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  30227. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  30228. * `undefined` and other non-number values.
  30229. *
  30230. * @static
  30231. * @memberOf _
  30232. * @since 0.1.0
  30233. * @category Lang
  30234. * @param {*} value The value to check.
  30235. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  30236. * @example
  30237. *
  30238. * _.isNaN(NaN);
  30239. * // => true
  30240. *
  30241. * _.isNaN(new Number(NaN));
  30242. * // => true
  30243. *
  30244. * isNaN(undefined);
  30245. * // => true
  30246. *
  30247. * _.isNaN(undefined);
  30248. * // => false
  30249. */
  30250. function isNaN(value) {
  30251. // An `NaN` primitive is the only value that is not equal to itself.
  30252. // Perform the `toStringTag` check first to avoid errors with some
  30253. // ActiveX objects in IE.
  30254. return isNumber(value) && value != +value;
  30255. }
  30256. /**
  30257. * Checks if `value` is a pristine native function.
  30258. *
  30259. * **Note:** This method can't reliably detect native functions in the presence
  30260. * of the core-js package because core-js circumvents this kind of detection.
  30261. * Despite multiple requests, the core-js maintainer has made it clear: any
  30262. * attempt to fix the detection will be obstructed. As a result, we're left
  30263. * with little choice but to throw an error. Unfortunately, this also affects
  30264. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  30265. * which rely on core-js.
  30266. *
  30267. * @static
  30268. * @memberOf _
  30269. * @since 3.0.0
  30270. * @category Lang
  30271. * @param {*} value The value to check.
  30272. * @returns {boolean} Returns `true` if `value` is a native function,
  30273. * else `false`.
  30274. * @example
  30275. *
  30276. * _.isNative(Array.prototype.push);
  30277. * // => true
  30278. *
  30279. * _.isNative(_);
  30280. * // => false
  30281. */
  30282. function isNative(value) {
  30283. if (isMaskable(value)) {
  30284. throw new Error(CORE_ERROR_TEXT);
  30285. }
  30286. return baseIsNative(value);
  30287. }
  30288. /**
  30289. * Checks if `value` is `null`.
  30290. *
  30291. * @static
  30292. * @memberOf _
  30293. * @since 0.1.0
  30294. * @category Lang
  30295. * @param {*} value The value to check.
  30296. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  30297. * @example
  30298. *
  30299. * _.isNull(null);
  30300. * // => true
  30301. *
  30302. * _.isNull(void 0);
  30303. * // => false
  30304. */
  30305. function isNull(value) {
  30306. return value === null;
  30307. }
  30308. /**
  30309. * Checks if `value` is `null` or `undefined`.
  30310. *
  30311. * @static
  30312. * @memberOf _
  30313. * @since 4.0.0
  30314. * @category Lang
  30315. * @param {*} value The value to check.
  30316. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  30317. * @example
  30318. *
  30319. * _.isNil(null);
  30320. * // => true
  30321. *
  30322. * _.isNil(void 0);
  30323. * // => true
  30324. *
  30325. * _.isNil(NaN);
  30326. * // => false
  30327. */
  30328. function isNil(value) {
  30329. return value == null;
  30330. }
  30331. /**
  30332. * Checks if `value` is classified as a `Number` primitive or object.
  30333. *
  30334. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  30335. * classified as numbers, use the `_.isFinite` method.
  30336. *
  30337. * @static
  30338. * @memberOf _
  30339. * @since 0.1.0
  30340. * @category Lang
  30341. * @param {*} value The value to check.
  30342. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  30343. * @example
  30344. *
  30345. * _.isNumber(3);
  30346. * // => true
  30347. *
  30348. * _.isNumber(Number.MIN_VALUE);
  30349. * // => true
  30350. *
  30351. * _.isNumber(Infinity);
  30352. * // => true
  30353. *
  30354. * _.isNumber('3');
  30355. * // => false
  30356. */
  30357. function isNumber(value) {
  30358. return typeof value == 'number' ||
  30359. (isObjectLike(value) && baseGetTag(value) == numberTag);
  30360. }
  30361. /**
  30362. * Checks if `value` is a plain object, that is, an object created by the
  30363. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  30364. *
  30365. * @static
  30366. * @memberOf _
  30367. * @since 0.8.0
  30368. * @category Lang
  30369. * @param {*} value The value to check.
  30370. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  30371. * @example
  30372. *
  30373. * function Foo() {
  30374. * this.a = 1;
  30375. * }
  30376. *
  30377. * _.isPlainObject(new Foo);
  30378. * // => false
  30379. *
  30380. * _.isPlainObject([1, 2, 3]);
  30381. * // => false
  30382. *
  30383. * _.isPlainObject({ 'x': 0, 'y': 0 });
  30384. * // => true
  30385. *
  30386. * _.isPlainObject(Object.create(null));
  30387. * // => true
  30388. */
  30389. function isPlainObject(value) {
  30390. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  30391. return false;
  30392. }
  30393. var proto = getPrototype(value);
  30394. if (proto === null) {
  30395. return true;
  30396. }
  30397. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  30398. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  30399. funcToString.call(Ctor) == objectCtorString;
  30400. }
  30401. /**
  30402. * Checks if `value` is classified as a `RegExp` object.
  30403. *
  30404. * @static
  30405. * @memberOf _
  30406. * @since 0.1.0
  30407. * @category Lang
  30408. * @param {*} value The value to check.
  30409. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  30410. * @example
  30411. *
  30412. * _.isRegExp(/abc/);
  30413. * // => true
  30414. *
  30415. * _.isRegExp('/abc/');
  30416. * // => false
  30417. */
  30418. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  30419. /**
  30420. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  30421. * double precision number which isn't the result of a rounded unsafe integer.
  30422. *
  30423. * **Note:** This method is based on
  30424. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  30425. *
  30426. * @static
  30427. * @memberOf _
  30428. * @since 4.0.0
  30429. * @category Lang
  30430. * @param {*} value The value to check.
  30431. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  30432. * @example
  30433. *
  30434. * _.isSafeInteger(3);
  30435. * // => true
  30436. *
  30437. * _.isSafeInteger(Number.MIN_VALUE);
  30438. * // => false
  30439. *
  30440. * _.isSafeInteger(Infinity);
  30441. * // => false
  30442. *
  30443. * _.isSafeInteger('3');
  30444. * // => false
  30445. */
  30446. function isSafeInteger(value) {
  30447. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  30448. }
  30449. /**
  30450. * Checks if `value` is classified as a `Set` object.
  30451. *
  30452. * @static
  30453. * @memberOf _
  30454. * @since 4.3.0
  30455. * @category Lang
  30456. * @param {*} value The value to check.
  30457. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  30458. * @example
  30459. *
  30460. * _.isSet(new Set);
  30461. * // => true
  30462. *
  30463. * _.isSet(new WeakSet);
  30464. * // => false
  30465. */
  30466. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  30467. /**
  30468. * Checks if `value` is classified as a `String` primitive or object.
  30469. *
  30470. * @static
  30471. * @since 0.1.0
  30472. * @memberOf _
  30473. * @category Lang
  30474. * @param {*} value The value to check.
  30475. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  30476. * @example
  30477. *
  30478. * _.isString('abc');
  30479. * // => true
  30480. *
  30481. * _.isString(1);
  30482. * // => false
  30483. */
  30484. function isString(value) {
  30485. return typeof value == 'string' ||
  30486. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  30487. }
  30488. /**
  30489. * Checks if `value` is classified as a `Symbol` primitive or object.
  30490. *
  30491. * @static
  30492. * @memberOf _
  30493. * @since 4.0.0
  30494. * @category Lang
  30495. * @param {*} value The value to check.
  30496. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  30497. * @example
  30498. *
  30499. * _.isSymbol(Symbol.iterator);
  30500. * // => true
  30501. *
  30502. * _.isSymbol('abc');
  30503. * // => false
  30504. */
  30505. function isSymbol(value) {
  30506. return typeof value == 'symbol' ||
  30507. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  30508. }
  30509. /**
  30510. * Checks if `value` is classified as a typed array.
  30511. *
  30512. * @static
  30513. * @memberOf _
  30514. * @since 3.0.0
  30515. * @category Lang
  30516. * @param {*} value The value to check.
  30517. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  30518. * @example
  30519. *
  30520. * _.isTypedArray(new Uint8Array);
  30521. * // => true
  30522. *
  30523. * _.isTypedArray([]);
  30524. * // => false
  30525. */
  30526. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  30527. /**
  30528. * Checks if `value` is `undefined`.
  30529. *
  30530. * @static
  30531. * @since 0.1.0
  30532. * @memberOf _
  30533. * @category Lang
  30534. * @param {*} value The value to check.
  30535. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  30536. * @example
  30537. *
  30538. * _.isUndefined(void 0);
  30539. * // => true
  30540. *
  30541. * _.isUndefined(null);
  30542. * // => false
  30543. */
  30544. function isUndefined(value) {
  30545. return value === undefined;
  30546. }
  30547. /**
  30548. * Checks if `value` is classified as a `WeakMap` object.
  30549. *
  30550. * @static
  30551. * @memberOf _
  30552. * @since 4.3.0
  30553. * @category Lang
  30554. * @param {*} value The value to check.
  30555. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  30556. * @example
  30557. *
  30558. * _.isWeakMap(new WeakMap);
  30559. * // => true
  30560. *
  30561. * _.isWeakMap(new Map);
  30562. * // => false
  30563. */
  30564. function isWeakMap(value) {
  30565. return isObjectLike(value) && getTag(value) == weakMapTag;
  30566. }
  30567. /**
  30568. * Checks if `value` is classified as a `WeakSet` object.
  30569. *
  30570. * @static
  30571. * @memberOf _
  30572. * @since 4.3.0
  30573. * @category Lang
  30574. * @param {*} value The value to check.
  30575. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  30576. * @example
  30577. *
  30578. * _.isWeakSet(new WeakSet);
  30579. * // => true
  30580. *
  30581. * _.isWeakSet(new Set);
  30582. * // => false
  30583. */
  30584. function isWeakSet(value) {
  30585. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  30586. }
  30587. /**
  30588. * Checks if `value` is less than `other`.
  30589. *
  30590. * @static
  30591. * @memberOf _
  30592. * @since 3.9.0
  30593. * @category Lang
  30594. * @param {*} value The value to compare.
  30595. * @param {*} other The other value to compare.
  30596. * @returns {boolean} Returns `true` if `value` is less than `other`,
  30597. * else `false`.
  30598. * @see _.gt
  30599. * @example
  30600. *
  30601. * _.lt(1, 3);
  30602. * // => true
  30603. *
  30604. * _.lt(3, 3);
  30605. * // => false
  30606. *
  30607. * _.lt(3, 1);
  30608. * // => false
  30609. */
  30610. var lt = createRelationalOperation(baseLt);
  30611. /**
  30612. * Checks if `value` is less than or equal to `other`.
  30613. *
  30614. * @static
  30615. * @memberOf _
  30616. * @since 3.9.0
  30617. * @category Lang
  30618. * @param {*} value The value to compare.
  30619. * @param {*} other The other value to compare.
  30620. * @returns {boolean} Returns `true` if `value` is less than or equal to
  30621. * `other`, else `false`.
  30622. * @see _.gte
  30623. * @example
  30624. *
  30625. * _.lte(1, 3);
  30626. * // => true
  30627. *
  30628. * _.lte(3, 3);
  30629. * // => true
  30630. *
  30631. * _.lte(3, 1);
  30632. * // => false
  30633. */
  30634. var lte = createRelationalOperation(function(value, other) {
  30635. return value <= other;
  30636. });
  30637. /**
  30638. * Converts `value` to an array.
  30639. *
  30640. * @static
  30641. * @since 0.1.0
  30642. * @memberOf _
  30643. * @category Lang
  30644. * @param {*} value The value to convert.
  30645. * @returns {Array} Returns the converted array.
  30646. * @example
  30647. *
  30648. * _.toArray({ 'a': 1, 'b': 2 });
  30649. * // => [1, 2]
  30650. *
  30651. * _.toArray('abc');
  30652. * // => ['a', 'b', 'c']
  30653. *
  30654. * _.toArray(1);
  30655. * // => []
  30656. *
  30657. * _.toArray(null);
  30658. * // => []
  30659. */
  30660. function toArray(value) {
  30661. if (!value) {
  30662. return [];
  30663. }
  30664. if (isArrayLike(value)) {
  30665. return isString(value) ? stringToArray(value) : copyArray(value);
  30666. }
  30667. if (symIterator && value[symIterator]) {
  30668. return iteratorToArray(value[symIterator]());
  30669. }
  30670. var tag = getTag(value),
  30671. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  30672. return func(value);
  30673. }
  30674. /**
  30675. * Converts `value` to a finite number.
  30676. *
  30677. * @static
  30678. * @memberOf _
  30679. * @since 4.12.0
  30680. * @category Lang
  30681. * @param {*} value The value to convert.
  30682. * @returns {number} Returns the converted number.
  30683. * @example
  30684. *
  30685. * _.toFinite(3.2);
  30686. * // => 3.2
  30687. *
  30688. * _.toFinite(Number.MIN_VALUE);
  30689. * // => 5e-324
  30690. *
  30691. * _.toFinite(Infinity);
  30692. * // => 1.7976931348623157e+308
  30693. *
  30694. * _.toFinite('3.2');
  30695. * // => 3.2
  30696. */
  30697. function toFinite(value) {
  30698. if (!value) {
  30699. return value === 0 ? value : 0;
  30700. }
  30701. value = toNumber(value);
  30702. if (value === INFINITY || value === -INFINITY) {
  30703. var sign = (value < 0 ? -1 : 1);
  30704. return sign * MAX_INTEGER;
  30705. }
  30706. return value === value ? value : 0;
  30707. }
  30708. /**
  30709. * Converts `value` to an integer.
  30710. *
  30711. * **Note:** This method is loosely based on
  30712. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  30713. *
  30714. * @static
  30715. * @memberOf _
  30716. * @since 4.0.0
  30717. * @category Lang
  30718. * @param {*} value The value to convert.
  30719. * @returns {number} Returns the converted integer.
  30720. * @example
  30721. *
  30722. * _.toInteger(3.2);
  30723. * // => 3
  30724. *
  30725. * _.toInteger(Number.MIN_VALUE);
  30726. * // => 0
  30727. *
  30728. * _.toInteger(Infinity);
  30729. * // => 1.7976931348623157e+308
  30730. *
  30731. * _.toInteger('3.2');
  30732. * // => 3
  30733. */
  30734. function toInteger(value) {
  30735. var result = toFinite(value),
  30736. remainder = result % 1;
  30737. return result === result ? (remainder ? result - remainder : result) : 0;
  30738. }
  30739. /**
  30740. * Converts `value` to an integer suitable for use as the length of an
  30741. * array-like object.
  30742. *
  30743. * **Note:** This method is based on
  30744. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  30745. *
  30746. * @static
  30747. * @memberOf _
  30748. * @since 4.0.0
  30749. * @category Lang
  30750. * @param {*} value The value to convert.
  30751. * @returns {number} Returns the converted integer.
  30752. * @example
  30753. *
  30754. * _.toLength(3.2);
  30755. * // => 3
  30756. *
  30757. * _.toLength(Number.MIN_VALUE);
  30758. * // => 0
  30759. *
  30760. * _.toLength(Infinity);
  30761. * // => 4294967295
  30762. *
  30763. * _.toLength('3.2');
  30764. * // => 3
  30765. */
  30766. function toLength(value) {
  30767. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  30768. }
  30769. /**
  30770. * Converts `value` to a number.
  30771. *
  30772. * @static
  30773. * @memberOf _
  30774. * @since 4.0.0
  30775. * @category Lang
  30776. * @param {*} value The value to process.
  30777. * @returns {number} Returns the number.
  30778. * @example
  30779. *
  30780. * _.toNumber(3.2);
  30781. * // => 3.2
  30782. *
  30783. * _.toNumber(Number.MIN_VALUE);
  30784. * // => 5e-324
  30785. *
  30786. * _.toNumber(Infinity);
  30787. * // => Infinity
  30788. *
  30789. * _.toNumber('3.2');
  30790. * // => 3.2
  30791. */
  30792. function toNumber(value) {
  30793. if (typeof value == 'number') {
  30794. return value;
  30795. }
  30796. if (isSymbol(value)) {
  30797. return NAN;
  30798. }
  30799. if (isObject(value)) {
  30800. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  30801. value = isObject(other) ? (other + '') : other;
  30802. }
  30803. if (typeof value != 'string') {
  30804. return value === 0 ? value : +value;
  30805. }
  30806. value = value.replace(reTrim, '');
  30807. var isBinary = reIsBinary.test(value);
  30808. return (isBinary || reIsOctal.test(value))
  30809. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  30810. : (reIsBadHex.test(value) ? NAN : +value);
  30811. }
  30812. /**
  30813. * Converts `value` to a plain object flattening inherited enumerable string
  30814. * keyed properties of `value` to own properties of the plain object.
  30815. *
  30816. * @static
  30817. * @memberOf _
  30818. * @since 3.0.0
  30819. * @category Lang
  30820. * @param {*} value The value to convert.
  30821. * @returns {Object} Returns the converted plain object.
  30822. * @example
  30823. *
  30824. * function Foo() {
  30825. * this.b = 2;
  30826. * }
  30827. *
  30828. * Foo.prototype.c = 3;
  30829. *
  30830. * _.assign({ 'a': 1 }, new Foo);
  30831. * // => { 'a': 1, 'b': 2 }
  30832. *
  30833. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  30834. * // => { 'a': 1, 'b': 2, 'c': 3 }
  30835. */
  30836. function toPlainObject(value) {
  30837. return copyObject(value, keysIn(value));
  30838. }
  30839. /**
  30840. * Converts `value` to a safe integer. A safe integer can be compared and
  30841. * represented correctly.
  30842. *
  30843. * @static
  30844. * @memberOf _
  30845. * @since 4.0.0
  30846. * @category Lang
  30847. * @param {*} value The value to convert.
  30848. * @returns {number} Returns the converted integer.
  30849. * @example
  30850. *
  30851. * _.toSafeInteger(3.2);
  30852. * // => 3
  30853. *
  30854. * _.toSafeInteger(Number.MIN_VALUE);
  30855. * // => 0
  30856. *
  30857. * _.toSafeInteger(Infinity);
  30858. * // => 9007199254740991
  30859. *
  30860. * _.toSafeInteger('3.2');
  30861. * // => 3
  30862. */
  30863. function toSafeInteger(value) {
  30864. return value
  30865. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  30866. : (value === 0 ? value : 0);
  30867. }
  30868. /**
  30869. * Converts `value` to a string. An empty string is returned for `null`
  30870. * and `undefined` values. The sign of `-0` is preserved.
  30871. *
  30872. * @static
  30873. * @memberOf _
  30874. * @since 4.0.0
  30875. * @category Lang
  30876. * @param {*} value The value to convert.
  30877. * @returns {string} Returns the converted string.
  30878. * @example
  30879. *
  30880. * _.toString(null);
  30881. * // => ''
  30882. *
  30883. * _.toString(-0);
  30884. * // => '-0'
  30885. *
  30886. * _.toString([1, 2, 3]);
  30887. * // => '1,2,3'
  30888. */
  30889. function toString(value) {
  30890. return value == null ? '' : baseToString(value);
  30891. }
  30892. /*------------------------------------------------------------------------*/
  30893. /**
  30894. * Assigns own enumerable string keyed properties of source objects to the
  30895. * destination object. Source objects are applied from left to right.
  30896. * Subsequent sources overwrite property assignments of previous sources.
  30897. *
  30898. * **Note:** This method mutates `object` and is loosely based on
  30899. * [`Object.assign`](https://mdn.io/Object/assign).
  30900. *
  30901. * @static
  30902. * @memberOf _
  30903. * @since 0.10.0
  30904. * @category Object
  30905. * @param {Object} object The destination object.
  30906. * @param {...Object} [sources] The source objects.
  30907. * @returns {Object} Returns `object`.
  30908. * @see _.assignIn
  30909. * @example
  30910. *
  30911. * function Foo() {
  30912. * this.a = 1;
  30913. * }
  30914. *
  30915. * function Bar() {
  30916. * this.c = 3;
  30917. * }
  30918. *
  30919. * Foo.prototype.b = 2;
  30920. * Bar.prototype.d = 4;
  30921. *
  30922. * _.assign({ 'a': 0 }, new Foo, new Bar);
  30923. * // => { 'a': 1, 'c': 3 }
  30924. */
  30925. var assign = createAssigner(function(object, source) {
  30926. if (isPrototype(source) || isArrayLike(source)) {
  30927. copyObject(source, keys(source), object);
  30928. return;
  30929. }
  30930. for (var key in source) {
  30931. if (hasOwnProperty.call(source, key)) {
  30932. assignValue(object, key, source[key]);
  30933. }
  30934. }
  30935. });
  30936. /**
  30937. * This method is like `_.assign` except that it iterates over own and
  30938. * inherited source properties.
  30939. *
  30940. * **Note:** This method mutates `object`.
  30941. *
  30942. * @static
  30943. * @memberOf _
  30944. * @since 4.0.0
  30945. * @alias extend
  30946. * @category Object
  30947. * @param {Object} object The destination object.
  30948. * @param {...Object} [sources] The source objects.
  30949. * @returns {Object} Returns `object`.
  30950. * @see _.assign
  30951. * @example
  30952. *
  30953. * function Foo() {
  30954. * this.a = 1;
  30955. * }
  30956. *
  30957. * function Bar() {
  30958. * this.c = 3;
  30959. * }
  30960. *
  30961. * Foo.prototype.b = 2;
  30962. * Bar.prototype.d = 4;
  30963. *
  30964. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  30965. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  30966. */
  30967. var assignIn = createAssigner(function(object, source) {
  30968. copyObject(source, keysIn(source), object);
  30969. });
  30970. /**
  30971. * This method is like `_.assignIn` except that it accepts `customizer`
  30972. * which is invoked to produce the assigned values. If `customizer` returns
  30973. * `undefined`, assignment is handled by the method instead. The `customizer`
  30974. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  30975. *
  30976. * **Note:** This method mutates `object`.
  30977. *
  30978. * @static
  30979. * @memberOf _
  30980. * @since 4.0.0
  30981. * @alias extendWith
  30982. * @category Object
  30983. * @param {Object} object The destination object.
  30984. * @param {...Object} sources The source objects.
  30985. * @param {Function} [customizer] The function to customize assigned values.
  30986. * @returns {Object} Returns `object`.
  30987. * @see _.assignWith
  30988. * @example
  30989. *
  30990. * function customizer(objValue, srcValue) {
  30991. * return _.isUndefined(objValue) ? srcValue : objValue;
  30992. * }
  30993. *
  30994. * var defaults = _.partialRight(_.assignInWith, customizer);
  30995. *
  30996. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  30997. * // => { 'a': 1, 'b': 2 }
  30998. */
  30999. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  31000. copyObject(source, keysIn(source), object, customizer);
  31001. });
  31002. /**
  31003. * This method is like `_.assign` except that it accepts `customizer`
  31004. * which is invoked to produce the assigned values. If `customizer` returns
  31005. * `undefined`, assignment is handled by the method instead. The `customizer`
  31006. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  31007. *
  31008. * **Note:** This method mutates `object`.
  31009. *
  31010. * @static
  31011. * @memberOf _
  31012. * @since 4.0.0
  31013. * @category Object
  31014. * @param {Object} object The destination object.
  31015. * @param {...Object} sources The source objects.
  31016. * @param {Function} [customizer] The function to customize assigned values.
  31017. * @returns {Object} Returns `object`.
  31018. * @see _.assignInWith
  31019. * @example
  31020. *
  31021. * function customizer(objValue, srcValue) {
  31022. * return _.isUndefined(objValue) ? srcValue : objValue;
  31023. * }
  31024. *
  31025. * var defaults = _.partialRight(_.assignWith, customizer);
  31026. *
  31027. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  31028. * // => { 'a': 1, 'b': 2 }
  31029. */
  31030. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  31031. copyObject(source, keys(source), object, customizer);
  31032. });
  31033. /**
  31034. * Creates an array of values corresponding to `paths` of `object`.
  31035. *
  31036. * @static
  31037. * @memberOf _
  31038. * @since 1.0.0
  31039. * @category Object
  31040. * @param {Object} object The object to iterate over.
  31041. * @param {...(string|string[])} [paths] The property paths to pick.
  31042. * @returns {Array} Returns the picked values.
  31043. * @example
  31044. *
  31045. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  31046. *
  31047. * _.at(object, ['a[0].b.c', 'a[1]']);
  31048. * // => [3, 4]
  31049. */
  31050. var at = flatRest(baseAt);
  31051. /**
  31052. * Creates an object that inherits from the `prototype` object. If a
  31053. * `properties` object is given, its own enumerable string keyed properties
  31054. * are assigned to the created object.
  31055. *
  31056. * @static
  31057. * @memberOf _
  31058. * @since 2.3.0
  31059. * @category Object
  31060. * @param {Object} prototype The object to inherit from.
  31061. * @param {Object} [properties] The properties to assign to the object.
  31062. * @returns {Object} Returns the new object.
  31063. * @example
  31064. *
  31065. * function Shape() {
  31066. * this.x = 0;
  31067. * this.y = 0;
  31068. * }
  31069. *
  31070. * function Circle() {
  31071. * Shape.call(this);
  31072. * }
  31073. *
  31074. * Circle.prototype = _.create(Shape.prototype, {
  31075. * 'constructor': Circle
  31076. * });
  31077. *
  31078. * var circle = new Circle;
  31079. * circle instanceof Circle;
  31080. * // => true
  31081. *
  31082. * circle instanceof Shape;
  31083. * // => true
  31084. */
  31085. function create(prototype, properties) {
  31086. var result = baseCreate(prototype);
  31087. return properties == null ? result : baseAssign(result, properties);
  31088. }
  31089. /**
  31090. * Assigns own and inherited enumerable string keyed properties of source
  31091. * objects to the destination object for all destination properties that
  31092. * resolve to `undefined`. Source objects are applied from left to right.
  31093. * Once a property is set, additional values of the same property are ignored.
  31094. *
  31095. * **Note:** This method mutates `object`.
  31096. *
  31097. * @static
  31098. * @since 0.1.0
  31099. * @memberOf _
  31100. * @category Object
  31101. * @param {Object} object The destination object.
  31102. * @param {...Object} [sources] The source objects.
  31103. * @returns {Object} Returns `object`.
  31104. * @see _.defaultsDeep
  31105. * @example
  31106. *
  31107. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  31108. * // => { 'a': 1, 'b': 2 }
  31109. */
  31110. var defaults = baseRest(function(object, sources) {
  31111. object = Object(object);
  31112. var index = -1;
  31113. var length = sources.length;
  31114. var guard = length > 2 ? sources[2] : undefined;
  31115. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  31116. length = 1;
  31117. }
  31118. while (++index < length) {
  31119. var source = sources[index];
  31120. var props = keysIn(source);
  31121. var propsIndex = -1;
  31122. var propsLength = props.length;
  31123. while (++propsIndex < propsLength) {
  31124. var key = props[propsIndex];
  31125. var value = object[key];
  31126. if (value === undefined ||
  31127. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  31128. object[key] = source[key];
  31129. }
  31130. }
  31131. }
  31132. return object;
  31133. });
  31134. /**
  31135. * This method is like `_.defaults` except that it recursively assigns
  31136. * default properties.
  31137. *
  31138. * **Note:** This method mutates `object`.
  31139. *
  31140. * @static
  31141. * @memberOf _
  31142. * @since 3.10.0
  31143. * @category Object
  31144. * @param {Object} object The destination object.
  31145. * @param {...Object} [sources] The source objects.
  31146. * @returns {Object} Returns `object`.
  31147. * @see _.defaults
  31148. * @example
  31149. *
  31150. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  31151. * // => { 'a': { 'b': 2, 'c': 3 } }
  31152. */
  31153. var defaultsDeep = baseRest(function(args) {
  31154. args.push(undefined, customDefaultsMerge);
  31155. return apply(mergeWith, undefined, args);
  31156. });
  31157. /**
  31158. * This method is like `_.find` except that it returns the key of the first
  31159. * element `predicate` returns truthy for instead of the element itself.
  31160. *
  31161. * @static
  31162. * @memberOf _
  31163. * @since 1.1.0
  31164. * @category Object
  31165. * @param {Object} object The object to inspect.
  31166. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  31167. * @returns {string|undefined} Returns the key of the matched element,
  31168. * else `undefined`.
  31169. * @example
  31170. *
  31171. * var users = {
  31172. * 'barney': { 'age': 36, 'active': true },
  31173. * 'fred': { 'age': 40, 'active': false },
  31174. * 'pebbles': { 'age': 1, 'active': true }
  31175. * };
  31176. *
  31177. * _.findKey(users, function(o) { return o.age < 40; });
  31178. * // => 'barney' (iteration order is not guaranteed)
  31179. *
  31180. * // The `_.matches` iteratee shorthand.
  31181. * _.findKey(users, { 'age': 1, 'active': true });
  31182. * // => 'pebbles'
  31183. *
  31184. * // The `_.matchesProperty` iteratee shorthand.
  31185. * _.findKey(users, ['active', false]);
  31186. * // => 'fred'
  31187. *
  31188. * // The `_.property` iteratee shorthand.
  31189. * _.findKey(users, 'active');
  31190. * // => 'barney'
  31191. */
  31192. function findKey(object, predicate) {
  31193. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  31194. }
  31195. /**
  31196. * This method is like `_.findKey` except that it iterates over elements of
  31197. * a collection in the opposite order.
  31198. *
  31199. * @static
  31200. * @memberOf _
  31201. * @since 2.0.0
  31202. * @category Object
  31203. * @param {Object} object The object to inspect.
  31204. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  31205. * @returns {string|undefined} Returns the key of the matched element,
  31206. * else `undefined`.
  31207. * @example
  31208. *
  31209. * var users = {
  31210. * 'barney': { 'age': 36, 'active': true },
  31211. * 'fred': { 'age': 40, 'active': false },
  31212. * 'pebbles': { 'age': 1, 'active': true }
  31213. * };
  31214. *
  31215. * _.findLastKey(users, function(o) { return o.age < 40; });
  31216. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  31217. *
  31218. * // The `_.matches` iteratee shorthand.
  31219. * _.findLastKey(users, { 'age': 36, 'active': true });
  31220. * // => 'barney'
  31221. *
  31222. * // The `_.matchesProperty` iteratee shorthand.
  31223. * _.findLastKey(users, ['active', false]);
  31224. * // => 'fred'
  31225. *
  31226. * // The `_.property` iteratee shorthand.
  31227. * _.findLastKey(users, 'active');
  31228. * // => 'pebbles'
  31229. */
  31230. function findLastKey(object, predicate) {
  31231. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  31232. }
  31233. /**
  31234. * Iterates over own and inherited enumerable string keyed properties of an
  31235. * object and invokes `iteratee` for each property. The iteratee is invoked
  31236. * with three arguments: (value, key, object). Iteratee functions may exit
  31237. * iteration early by explicitly returning `false`.
  31238. *
  31239. * @static
  31240. * @memberOf _
  31241. * @since 0.3.0
  31242. * @category Object
  31243. * @param {Object} object The object to iterate over.
  31244. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  31245. * @returns {Object} Returns `object`.
  31246. * @see _.forInRight
  31247. * @example
  31248. *
  31249. * function Foo() {
  31250. * this.a = 1;
  31251. * this.b = 2;
  31252. * }
  31253. *
  31254. * Foo.prototype.c = 3;
  31255. *
  31256. * _.forIn(new Foo, function(value, key) {
  31257. * console.log(key);
  31258. * });
  31259. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  31260. */
  31261. function forIn(object, iteratee) {
  31262. return object == null
  31263. ? object
  31264. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  31265. }
  31266. /**
  31267. * This method is like `_.forIn` except that it iterates over properties of
  31268. * `object` in the opposite order.
  31269. *
  31270. * @static
  31271. * @memberOf _
  31272. * @since 2.0.0
  31273. * @category Object
  31274. * @param {Object} object The object to iterate over.
  31275. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  31276. * @returns {Object} Returns `object`.
  31277. * @see _.forIn
  31278. * @example
  31279. *
  31280. * function Foo() {
  31281. * this.a = 1;
  31282. * this.b = 2;
  31283. * }
  31284. *
  31285. * Foo.prototype.c = 3;
  31286. *
  31287. * _.forInRight(new Foo, function(value, key) {
  31288. * console.log(key);
  31289. * });
  31290. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  31291. */
  31292. function forInRight(object, iteratee) {
  31293. return object == null
  31294. ? object
  31295. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  31296. }
  31297. /**
  31298. * Iterates over own enumerable string keyed properties of an object and
  31299. * invokes `iteratee` for each property. The iteratee is invoked with three
  31300. * arguments: (value, key, object). Iteratee functions may exit iteration
  31301. * early by explicitly returning `false`.
  31302. *
  31303. * @static
  31304. * @memberOf _
  31305. * @since 0.3.0
  31306. * @category Object
  31307. * @param {Object} object The object to iterate over.
  31308. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  31309. * @returns {Object} Returns `object`.
  31310. * @see _.forOwnRight
  31311. * @example
  31312. *
  31313. * function Foo() {
  31314. * this.a = 1;
  31315. * this.b = 2;
  31316. * }
  31317. *
  31318. * Foo.prototype.c = 3;
  31319. *
  31320. * _.forOwn(new Foo, function(value, key) {
  31321. * console.log(key);
  31322. * });
  31323. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  31324. */
  31325. function forOwn(object, iteratee) {
  31326. return object && baseForOwn(object, getIteratee(iteratee, 3));
  31327. }
  31328. /**
  31329. * This method is like `_.forOwn` except that it iterates over properties of
  31330. * `object` in the opposite order.
  31331. *
  31332. * @static
  31333. * @memberOf _
  31334. * @since 2.0.0
  31335. * @category Object
  31336. * @param {Object} object The object to iterate over.
  31337. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  31338. * @returns {Object} Returns `object`.
  31339. * @see _.forOwn
  31340. * @example
  31341. *
  31342. * function Foo() {
  31343. * this.a = 1;
  31344. * this.b = 2;
  31345. * }
  31346. *
  31347. * Foo.prototype.c = 3;
  31348. *
  31349. * _.forOwnRight(new Foo, function(value, key) {
  31350. * console.log(key);
  31351. * });
  31352. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  31353. */
  31354. function forOwnRight(object, iteratee) {
  31355. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  31356. }
  31357. /**
  31358. * Creates an array of function property names from own enumerable properties
  31359. * of `object`.
  31360. *
  31361. * @static
  31362. * @since 0.1.0
  31363. * @memberOf _
  31364. * @category Object
  31365. * @param {Object} object The object to inspect.
  31366. * @returns {Array} Returns the function names.
  31367. * @see _.functionsIn
  31368. * @example
  31369. *
  31370. * function Foo() {
  31371. * this.a = _.constant('a');
  31372. * this.b = _.constant('b');
  31373. * }
  31374. *
  31375. * Foo.prototype.c = _.constant('c');
  31376. *
  31377. * _.functions(new Foo);
  31378. * // => ['a', 'b']
  31379. */
  31380. function functions(object) {
  31381. return object == null ? [] : baseFunctions(object, keys(object));
  31382. }
  31383. /**
  31384. * Creates an array of function property names from own and inherited
  31385. * enumerable properties of `object`.
  31386. *
  31387. * @static
  31388. * @memberOf _
  31389. * @since 4.0.0
  31390. * @category Object
  31391. * @param {Object} object The object to inspect.
  31392. * @returns {Array} Returns the function names.
  31393. * @see _.functions
  31394. * @example
  31395. *
  31396. * function Foo() {
  31397. * this.a = _.constant('a');
  31398. * this.b = _.constant('b');
  31399. * }
  31400. *
  31401. * Foo.prototype.c = _.constant('c');
  31402. *
  31403. * _.functionsIn(new Foo);
  31404. * // => ['a', 'b', 'c']
  31405. */
  31406. function functionsIn(object) {
  31407. return object == null ? [] : baseFunctions(object, keysIn(object));
  31408. }
  31409. /**
  31410. * Gets the value at `path` of `object`. If the resolved value is
  31411. * `undefined`, the `defaultValue` is returned in its place.
  31412. *
  31413. * @static
  31414. * @memberOf _
  31415. * @since 3.7.0
  31416. * @category Object
  31417. * @param {Object} object The object to query.
  31418. * @param {Array|string} path The path of the property to get.
  31419. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  31420. * @returns {*} Returns the resolved value.
  31421. * @example
  31422. *
  31423. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  31424. *
  31425. * _.get(object, 'a[0].b.c');
  31426. * // => 3
  31427. *
  31428. * _.get(object, ['a', '0', 'b', 'c']);
  31429. * // => 3
  31430. *
  31431. * _.get(object, 'a.b.c', 'default');
  31432. * // => 'default'
  31433. */
  31434. function get(object, path, defaultValue) {
  31435. var result = object == null ? undefined : baseGet(object, path);
  31436. return result === undefined ? defaultValue : result;
  31437. }
  31438. /**
  31439. * Checks if `path` is a direct property of `object`.
  31440. *
  31441. * @static
  31442. * @since 0.1.0
  31443. * @memberOf _
  31444. * @category Object
  31445. * @param {Object} object The object to query.
  31446. * @param {Array|string} path The path to check.
  31447. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  31448. * @example
  31449. *
  31450. * var object = { 'a': { 'b': 2 } };
  31451. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  31452. *
  31453. * _.has(object, 'a');
  31454. * // => true
  31455. *
  31456. * _.has(object, 'a.b');
  31457. * // => true
  31458. *
  31459. * _.has(object, ['a', 'b']);
  31460. * // => true
  31461. *
  31462. * _.has(other, 'a');
  31463. * // => false
  31464. */
  31465. function has(object, path) {
  31466. return object != null && hasPath(object, path, baseHas);
  31467. }
  31468. /**
  31469. * Checks if `path` is a direct or inherited property of `object`.
  31470. *
  31471. * @static
  31472. * @memberOf _
  31473. * @since 4.0.0
  31474. * @category Object
  31475. * @param {Object} object The object to query.
  31476. * @param {Array|string} path The path to check.
  31477. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  31478. * @example
  31479. *
  31480. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  31481. *
  31482. * _.hasIn(object, 'a');
  31483. * // => true
  31484. *
  31485. * _.hasIn(object, 'a.b');
  31486. * // => true
  31487. *
  31488. * _.hasIn(object, ['a', 'b']);
  31489. * // => true
  31490. *
  31491. * _.hasIn(object, 'b');
  31492. * // => false
  31493. */
  31494. function hasIn(object, path) {
  31495. return object != null && hasPath(object, path, baseHasIn);
  31496. }
  31497. /**
  31498. * Creates an object composed of the inverted keys and values of `object`.
  31499. * If `object` contains duplicate values, subsequent values overwrite
  31500. * property assignments of previous values.
  31501. *
  31502. * @static
  31503. * @memberOf _
  31504. * @since 0.7.0
  31505. * @category Object
  31506. * @param {Object} object The object to invert.
  31507. * @returns {Object} Returns the new inverted object.
  31508. * @example
  31509. *
  31510. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  31511. *
  31512. * _.invert(object);
  31513. * // => { '1': 'c', '2': 'b' }
  31514. */
  31515. var invert = createInverter(function(result, value, key) {
  31516. if (value != null &&
  31517. typeof value.toString != 'function') {
  31518. value = nativeObjectToString.call(value);
  31519. }
  31520. result[value] = key;
  31521. }, constant(identity));
  31522. /**
  31523. * This method is like `_.invert` except that the inverted object is generated
  31524. * from the results of running each element of `object` thru `iteratee`. The
  31525. * corresponding inverted value of each inverted key is an array of keys
  31526. * responsible for generating the inverted value. The iteratee is invoked
  31527. * with one argument: (value).
  31528. *
  31529. * @static
  31530. * @memberOf _
  31531. * @since 4.1.0
  31532. * @category Object
  31533. * @param {Object} object The object to invert.
  31534. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  31535. * @returns {Object} Returns the new inverted object.
  31536. * @example
  31537. *
  31538. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  31539. *
  31540. * _.invertBy(object);
  31541. * // => { '1': ['a', 'c'], '2': ['b'] }
  31542. *
  31543. * _.invertBy(object, function(value) {
  31544. * return 'group' + value;
  31545. * });
  31546. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  31547. */
  31548. var invertBy = createInverter(function(result, value, key) {
  31549. if (value != null &&
  31550. typeof value.toString != 'function') {
  31551. value = nativeObjectToString.call(value);
  31552. }
  31553. if (hasOwnProperty.call(result, value)) {
  31554. result[value].push(key);
  31555. } else {
  31556. result[value] = [key];
  31557. }
  31558. }, getIteratee);
  31559. /**
  31560. * Invokes the method at `path` of `object`.
  31561. *
  31562. * @static
  31563. * @memberOf _
  31564. * @since 4.0.0
  31565. * @category Object
  31566. * @param {Object} object The object to query.
  31567. * @param {Array|string} path The path of the method to invoke.
  31568. * @param {...*} [args] The arguments to invoke the method with.
  31569. * @returns {*} Returns the result of the invoked method.
  31570. * @example
  31571. *
  31572. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  31573. *
  31574. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  31575. * // => [2, 3]
  31576. */
  31577. var invoke = baseRest(baseInvoke);
  31578. /**
  31579. * Creates an array of the own enumerable property names of `object`.
  31580. *
  31581. * **Note:** Non-object values are coerced to objects. See the
  31582. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  31583. * for more details.
  31584. *
  31585. * @static
  31586. * @since 0.1.0
  31587. * @memberOf _
  31588. * @category Object
  31589. * @param {Object} object The object to query.
  31590. * @returns {Array} Returns the array of property names.
  31591. * @example
  31592. *
  31593. * function Foo() {
  31594. * this.a = 1;
  31595. * this.b = 2;
  31596. * }
  31597. *
  31598. * Foo.prototype.c = 3;
  31599. *
  31600. * _.keys(new Foo);
  31601. * // => ['a', 'b'] (iteration order is not guaranteed)
  31602. *
  31603. * _.keys('hi');
  31604. * // => ['0', '1']
  31605. */
  31606. function keys(object) {
  31607. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  31608. }
  31609. /**
  31610. * Creates an array of the own and inherited enumerable property names of `object`.
  31611. *
  31612. * **Note:** Non-object values are coerced to objects.
  31613. *
  31614. * @static
  31615. * @memberOf _
  31616. * @since 3.0.0
  31617. * @category Object
  31618. * @param {Object} object The object to query.
  31619. * @returns {Array} Returns the array of property names.
  31620. * @example
  31621. *
  31622. * function Foo() {
  31623. * this.a = 1;
  31624. * this.b = 2;
  31625. * }
  31626. *
  31627. * Foo.prototype.c = 3;
  31628. *
  31629. * _.keysIn(new Foo);
  31630. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  31631. */
  31632. function keysIn(object) {
  31633. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  31634. }
  31635. /**
  31636. * The opposite of `_.mapValues`; this method creates an object with the
  31637. * same values as `object` and keys generated by running each own enumerable
  31638. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  31639. * with three arguments: (value, key, object).
  31640. *
  31641. * @static
  31642. * @memberOf _
  31643. * @since 3.8.0
  31644. * @category Object
  31645. * @param {Object} object The object to iterate over.
  31646. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  31647. * @returns {Object} Returns the new mapped object.
  31648. * @see _.mapValues
  31649. * @example
  31650. *
  31651. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  31652. * return key + value;
  31653. * });
  31654. * // => { 'a1': 1, 'b2': 2 }
  31655. */
  31656. function mapKeys(object, iteratee) {
  31657. var result = {};
  31658. iteratee = getIteratee(iteratee, 3);
  31659. baseForOwn(object, function(value, key, object) {
  31660. baseAssignValue(result, iteratee(value, key, object), value);
  31661. });
  31662. return result;
  31663. }
  31664. /**
  31665. * Creates an object with the same keys as `object` and values generated
  31666. * by running each own enumerable string keyed property of `object` thru
  31667. * `iteratee`. The iteratee is invoked with three arguments:
  31668. * (value, key, object).
  31669. *
  31670. * @static
  31671. * @memberOf _
  31672. * @since 2.4.0
  31673. * @category Object
  31674. * @param {Object} object The object to iterate over.
  31675. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  31676. * @returns {Object} Returns the new mapped object.
  31677. * @see _.mapKeys
  31678. * @example
  31679. *
  31680. * var users = {
  31681. * 'fred': { 'user': 'fred', 'age': 40 },
  31682. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  31683. * };
  31684. *
  31685. * _.mapValues(users, function(o) { return o.age; });
  31686. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  31687. *
  31688. * // The `_.property` iteratee shorthand.
  31689. * _.mapValues(users, 'age');
  31690. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  31691. */
  31692. function mapValues(object, iteratee) {
  31693. var result = {};
  31694. iteratee = getIteratee(iteratee, 3);
  31695. baseForOwn(object, function(value, key, object) {
  31696. baseAssignValue(result, key, iteratee(value, key, object));
  31697. });
  31698. return result;
  31699. }
  31700. /**
  31701. * This method is like `_.assign` except that it recursively merges own and
  31702. * inherited enumerable string keyed properties of source objects into the
  31703. * destination object. Source properties that resolve to `undefined` are
  31704. * skipped if a destination value exists. Array and plain object properties
  31705. * are merged recursively. Other objects and value types are overridden by
  31706. * assignment. Source objects are applied from left to right. Subsequent
  31707. * sources overwrite property assignments of previous sources.
  31708. *
  31709. * **Note:** This method mutates `object`.
  31710. *
  31711. * @static
  31712. * @memberOf _
  31713. * @since 0.5.0
  31714. * @category Object
  31715. * @param {Object} object The destination object.
  31716. * @param {...Object} [sources] The source objects.
  31717. * @returns {Object} Returns `object`.
  31718. * @example
  31719. *
  31720. * var object = {
  31721. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  31722. * };
  31723. *
  31724. * var other = {
  31725. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  31726. * };
  31727. *
  31728. * _.merge(object, other);
  31729. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  31730. */
  31731. var merge = createAssigner(function(object, source, srcIndex) {
  31732. baseMerge(object, source, srcIndex);
  31733. });
  31734. /**
  31735. * This method is like `_.merge` except that it accepts `customizer` which
  31736. * is invoked to produce the merged values of the destination and source
  31737. * properties. If `customizer` returns `undefined`, merging is handled by the
  31738. * method instead. The `customizer` is invoked with six arguments:
  31739. * (objValue, srcValue, key, object, source, stack).
  31740. *
  31741. * **Note:** This method mutates `object`.
  31742. *
  31743. * @static
  31744. * @memberOf _
  31745. * @since 4.0.0
  31746. * @category Object
  31747. * @param {Object} object The destination object.
  31748. * @param {...Object} sources The source objects.
  31749. * @param {Function} customizer The function to customize assigned values.
  31750. * @returns {Object} Returns `object`.
  31751. * @example
  31752. *
  31753. * function customizer(objValue, srcValue) {
  31754. * if (_.isArray(objValue)) {
  31755. * return objValue.concat(srcValue);
  31756. * }
  31757. * }
  31758. *
  31759. * var object = { 'a': [1], 'b': [2] };
  31760. * var other = { 'a': [3], 'b': [4] };
  31761. *
  31762. * _.mergeWith(object, other, customizer);
  31763. * // => { 'a': [1, 3], 'b': [2, 4] }
  31764. */
  31765. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  31766. baseMerge(object, source, srcIndex, customizer);
  31767. });
  31768. /**
  31769. * The opposite of `_.pick`; this method creates an object composed of the
  31770. * own and inherited enumerable property paths of `object` that are not omitted.
  31771. *
  31772. * **Note:** This method is considerably slower than `_.pick`.
  31773. *
  31774. * @static
  31775. * @since 0.1.0
  31776. * @memberOf _
  31777. * @category Object
  31778. * @param {Object} object The source object.
  31779. * @param {...(string|string[])} [paths] The property paths to omit.
  31780. * @returns {Object} Returns the new object.
  31781. * @example
  31782. *
  31783. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  31784. *
  31785. * _.omit(object, ['a', 'c']);
  31786. * // => { 'b': '2' }
  31787. */
  31788. var omit = flatRest(function(object, paths) {
  31789. var result = {};
  31790. if (object == null) {
  31791. return result;
  31792. }
  31793. var isDeep = false;
  31794. paths = arrayMap(paths, function(path) {
  31795. path = castPath(path, object);
  31796. isDeep || (isDeep = path.length > 1);
  31797. return path;
  31798. });
  31799. copyObject(object, getAllKeysIn(object), result);
  31800. if (isDeep) {
  31801. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  31802. }
  31803. var length = paths.length;
  31804. while (length--) {
  31805. baseUnset(result, paths[length]);
  31806. }
  31807. return result;
  31808. });
  31809. /**
  31810. * The opposite of `_.pickBy`; this method creates an object composed of
  31811. * the own and inherited enumerable string keyed properties of `object` that
  31812. * `predicate` doesn't return truthy for. The predicate is invoked with two
  31813. * arguments: (value, key).
  31814. *
  31815. * @static
  31816. * @memberOf _
  31817. * @since 4.0.0
  31818. * @category Object
  31819. * @param {Object} object The source object.
  31820. * @param {Function} [predicate=_.identity] The function invoked per property.
  31821. * @returns {Object} Returns the new object.
  31822. * @example
  31823. *
  31824. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  31825. *
  31826. * _.omitBy(object, _.isNumber);
  31827. * // => { 'b': '2' }
  31828. */
  31829. function omitBy(object, predicate) {
  31830. return pickBy(object, negate(getIteratee(predicate)));
  31831. }
  31832. /**
  31833. * Creates an object composed of the picked `object` properties.
  31834. *
  31835. * @static
  31836. * @since 0.1.0
  31837. * @memberOf _
  31838. * @category Object
  31839. * @param {Object} object The source object.
  31840. * @param {...(string|string[])} [paths] The property paths to pick.
  31841. * @returns {Object} Returns the new object.
  31842. * @example
  31843. *
  31844. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  31845. *
  31846. * _.pick(object, ['a', 'c']);
  31847. * // => { 'a': 1, 'c': 3 }
  31848. */
  31849. var pick = flatRest(function(object, paths) {
  31850. return object == null ? {} : basePick(object, paths);
  31851. });
  31852. /**
  31853. * Creates an object composed of the `object` properties `predicate` returns
  31854. * truthy for. The predicate is invoked with two arguments: (value, key).
  31855. *
  31856. * @static
  31857. * @memberOf _
  31858. * @since 4.0.0
  31859. * @category Object
  31860. * @param {Object} object The source object.
  31861. * @param {Function} [predicate=_.identity] The function invoked per property.
  31862. * @returns {Object} Returns the new object.
  31863. * @example
  31864. *
  31865. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  31866. *
  31867. * _.pickBy(object, _.isNumber);
  31868. * // => { 'a': 1, 'c': 3 }
  31869. */
  31870. function pickBy(object, predicate) {
  31871. if (object == null) {
  31872. return {};
  31873. }
  31874. var props = arrayMap(getAllKeysIn(object), function(prop) {
  31875. return [prop];
  31876. });
  31877. predicate = getIteratee(predicate);
  31878. return basePickBy(object, props, function(value, path) {
  31879. return predicate(value, path[0]);
  31880. });
  31881. }
  31882. /**
  31883. * This method is like `_.get` except that if the resolved value is a
  31884. * function it's invoked with the `this` binding of its parent object and
  31885. * its result is returned.
  31886. *
  31887. * @static
  31888. * @since 0.1.0
  31889. * @memberOf _
  31890. * @category Object
  31891. * @param {Object} object The object to query.
  31892. * @param {Array|string} path The path of the property to resolve.
  31893. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  31894. * @returns {*} Returns the resolved value.
  31895. * @example
  31896. *
  31897. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  31898. *
  31899. * _.result(object, 'a[0].b.c1');
  31900. * // => 3
  31901. *
  31902. * _.result(object, 'a[0].b.c2');
  31903. * // => 4
  31904. *
  31905. * _.result(object, 'a[0].b.c3', 'default');
  31906. * // => 'default'
  31907. *
  31908. * _.result(object, 'a[0].b.c3', _.constant('default'));
  31909. * // => 'default'
  31910. */
  31911. function result(object, path, defaultValue) {
  31912. path = castPath(path, object);
  31913. var index = -1,
  31914. length = path.length;
  31915. // Ensure the loop is entered when path is empty.
  31916. if (!length) {
  31917. length = 1;
  31918. object = undefined;
  31919. }
  31920. while (++index < length) {
  31921. var value = object == null ? undefined : object[toKey(path[index])];
  31922. if (value === undefined) {
  31923. index = length;
  31924. value = defaultValue;
  31925. }
  31926. object = isFunction(value) ? value.call(object) : value;
  31927. }
  31928. return object;
  31929. }
  31930. /**
  31931. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  31932. * it's created. Arrays are created for missing index properties while objects
  31933. * are created for all other missing properties. Use `_.setWith` to customize
  31934. * `path` creation.
  31935. *
  31936. * **Note:** This method mutates `object`.
  31937. *
  31938. * @static
  31939. * @memberOf _
  31940. * @since 3.7.0
  31941. * @category Object
  31942. * @param {Object} object The object to modify.
  31943. * @param {Array|string} path The path of the property to set.
  31944. * @param {*} value The value to set.
  31945. * @returns {Object} Returns `object`.
  31946. * @example
  31947. *
  31948. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  31949. *
  31950. * _.set(object, 'a[0].b.c', 4);
  31951. * console.log(object.a[0].b.c);
  31952. * // => 4
  31953. *
  31954. * _.set(object, ['x', '0', 'y', 'z'], 5);
  31955. * console.log(object.x[0].y.z);
  31956. * // => 5
  31957. */
  31958. function set(object, path, value) {
  31959. return object == null ? object : baseSet(object, path, value);
  31960. }
  31961. /**
  31962. * This method is like `_.set` except that it accepts `customizer` which is
  31963. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  31964. * path creation is handled by the method instead. The `customizer` is invoked
  31965. * with three arguments: (nsValue, key, nsObject).
  31966. *
  31967. * **Note:** This method mutates `object`.
  31968. *
  31969. * @static
  31970. * @memberOf _
  31971. * @since 4.0.0
  31972. * @category Object
  31973. * @param {Object} object The object to modify.
  31974. * @param {Array|string} path The path of the property to set.
  31975. * @param {*} value The value to set.
  31976. * @param {Function} [customizer] The function to customize assigned values.
  31977. * @returns {Object} Returns `object`.
  31978. * @example
  31979. *
  31980. * var object = {};
  31981. *
  31982. * _.setWith(object, '[0][1]', 'a', Object);
  31983. * // => { '0': { '1': 'a' } }
  31984. */
  31985. function setWith(object, path, value, customizer) {
  31986. customizer = typeof customizer == 'function' ? customizer : undefined;
  31987. return object == null ? object : baseSet(object, path, value, customizer);
  31988. }
  31989. /**
  31990. * Creates an array of own enumerable string keyed-value pairs for `object`
  31991. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  31992. * entries are returned.
  31993. *
  31994. * @static
  31995. * @memberOf _
  31996. * @since 4.0.0
  31997. * @alias entries
  31998. * @category Object
  31999. * @param {Object} object The object to query.
  32000. * @returns {Array} Returns the key-value pairs.
  32001. * @example
  32002. *
  32003. * function Foo() {
  32004. * this.a = 1;
  32005. * this.b = 2;
  32006. * }
  32007. *
  32008. * Foo.prototype.c = 3;
  32009. *
  32010. * _.toPairs(new Foo);
  32011. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  32012. */
  32013. var toPairs = createToPairs(keys);
  32014. /**
  32015. * Creates an array of own and inherited enumerable string keyed-value pairs
  32016. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  32017. * or set, its entries are returned.
  32018. *
  32019. * @static
  32020. * @memberOf _
  32021. * @since 4.0.0
  32022. * @alias entriesIn
  32023. * @category Object
  32024. * @param {Object} object The object to query.
  32025. * @returns {Array} Returns the key-value pairs.
  32026. * @example
  32027. *
  32028. * function Foo() {
  32029. * this.a = 1;
  32030. * this.b = 2;
  32031. * }
  32032. *
  32033. * Foo.prototype.c = 3;
  32034. *
  32035. * _.toPairsIn(new Foo);
  32036. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  32037. */
  32038. var toPairsIn = createToPairs(keysIn);
  32039. /**
  32040. * An alternative to `_.reduce`; this method transforms `object` to a new
  32041. * `accumulator` object which is the result of running each of its own
  32042. * enumerable string keyed properties thru `iteratee`, with each invocation
  32043. * potentially mutating the `accumulator` object. If `accumulator` is not
  32044. * provided, a new object with the same `[[Prototype]]` will be used. The
  32045. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  32046. * Iteratee functions may exit iteration early by explicitly returning `false`.
  32047. *
  32048. * @static
  32049. * @memberOf _
  32050. * @since 1.3.0
  32051. * @category Object
  32052. * @param {Object} object The object to iterate over.
  32053. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  32054. * @param {*} [accumulator] The custom accumulator value.
  32055. * @returns {*} Returns the accumulated value.
  32056. * @example
  32057. *
  32058. * _.transform([2, 3, 4], function(result, n) {
  32059. * result.push(n *= n);
  32060. * return n % 2 == 0;
  32061. * }, []);
  32062. * // => [4, 9]
  32063. *
  32064. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  32065. * (result[value] || (result[value] = [])).push(key);
  32066. * }, {});
  32067. * // => { '1': ['a', 'c'], '2': ['b'] }
  32068. */
  32069. function transform(object, iteratee, accumulator) {
  32070. var isArr = isArray(object),
  32071. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  32072. iteratee = getIteratee(iteratee, 4);
  32073. if (accumulator == null) {
  32074. var Ctor = object && object.constructor;
  32075. if (isArrLike) {
  32076. accumulator = isArr ? new Ctor : [];
  32077. }
  32078. else if (isObject(object)) {
  32079. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  32080. }
  32081. else {
  32082. accumulator = {};
  32083. }
  32084. }
  32085. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  32086. return iteratee(accumulator, value, index, object);
  32087. });
  32088. return accumulator;
  32089. }
  32090. /**
  32091. * Removes the property at `path` of `object`.
  32092. *
  32093. * **Note:** This method mutates `object`.
  32094. *
  32095. * @static
  32096. * @memberOf _
  32097. * @since 4.0.0
  32098. * @category Object
  32099. * @param {Object} object The object to modify.
  32100. * @param {Array|string} path The path of the property to unset.
  32101. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  32102. * @example
  32103. *
  32104. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  32105. * _.unset(object, 'a[0].b.c');
  32106. * // => true
  32107. *
  32108. * console.log(object);
  32109. * // => { 'a': [{ 'b': {} }] };
  32110. *
  32111. * _.unset(object, ['a', '0', 'b', 'c']);
  32112. * // => true
  32113. *
  32114. * console.log(object);
  32115. * // => { 'a': [{ 'b': {} }] };
  32116. */
  32117. function unset(object, path) {
  32118. return object == null ? true : baseUnset(object, path);
  32119. }
  32120. /**
  32121. * This method is like `_.set` except that accepts `updater` to produce the
  32122. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  32123. * is invoked with one argument: (value).
  32124. *
  32125. * **Note:** This method mutates `object`.
  32126. *
  32127. * @static
  32128. * @memberOf _
  32129. * @since 4.6.0
  32130. * @category Object
  32131. * @param {Object} object The object to modify.
  32132. * @param {Array|string} path The path of the property to set.
  32133. * @param {Function} updater The function to produce the updated value.
  32134. * @returns {Object} Returns `object`.
  32135. * @example
  32136. *
  32137. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  32138. *
  32139. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  32140. * console.log(object.a[0].b.c);
  32141. * // => 9
  32142. *
  32143. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  32144. * console.log(object.x[0].y.z);
  32145. * // => 0
  32146. */
  32147. function update(object, path, updater) {
  32148. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  32149. }
  32150. /**
  32151. * This method is like `_.update` except that it accepts `customizer` which is
  32152. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  32153. * path creation is handled by the method instead. The `customizer` is invoked
  32154. * with three arguments: (nsValue, key, nsObject).
  32155. *
  32156. * **Note:** This method mutates `object`.
  32157. *
  32158. * @static
  32159. * @memberOf _
  32160. * @since 4.6.0
  32161. * @category Object
  32162. * @param {Object} object The object to modify.
  32163. * @param {Array|string} path The path of the property to set.
  32164. * @param {Function} updater The function to produce the updated value.
  32165. * @param {Function} [customizer] The function to customize assigned values.
  32166. * @returns {Object} Returns `object`.
  32167. * @example
  32168. *
  32169. * var object = {};
  32170. *
  32171. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  32172. * // => { '0': { '1': 'a' } }
  32173. */
  32174. function updateWith(object, path, updater, customizer) {
  32175. customizer = typeof customizer == 'function' ? customizer : undefined;
  32176. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  32177. }
  32178. /**
  32179. * Creates an array of the own enumerable string keyed property values of `object`.
  32180. *
  32181. * **Note:** Non-object values are coerced to objects.
  32182. *
  32183. * @static
  32184. * @since 0.1.0
  32185. * @memberOf _
  32186. * @category Object
  32187. * @param {Object} object The object to query.
  32188. * @returns {Array} Returns the array of property values.
  32189. * @example
  32190. *
  32191. * function Foo() {
  32192. * this.a = 1;
  32193. * this.b = 2;
  32194. * }
  32195. *
  32196. * Foo.prototype.c = 3;
  32197. *
  32198. * _.values(new Foo);
  32199. * // => [1, 2] (iteration order is not guaranteed)
  32200. *
  32201. * _.values('hi');
  32202. * // => ['h', 'i']
  32203. */
  32204. function values(object) {
  32205. return object == null ? [] : baseValues(object, keys(object));
  32206. }
  32207. /**
  32208. * Creates an array of the own and inherited enumerable string keyed property
  32209. * values of `object`.
  32210. *
  32211. * **Note:** Non-object values are coerced to objects.
  32212. *
  32213. * @static
  32214. * @memberOf _
  32215. * @since 3.0.0
  32216. * @category Object
  32217. * @param {Object} object The object to query.
  32218. * @returns {Array} Returns the array of property values.
  32219. * @example
  32220. *
  32221. * function Foo() {
  32222. * this.a = 1;
  32223. * this.b = 2;
  32224. * }
  32225. *
  32226. * Foo.prototype.c = 3;
  32227. *
  32228. * _.valuesIn(new Foo);
  32229. * // => [1, 2, 3] (iteration order is not guaranteed)
  32230. */
  32231. function valuesIn(object) {
  32232. return object == null ? [] : baseValues(object, keysIn(object));
  32233. }
  32234. /*------------------------------------------------------------------------*/
  32235. /**
  32236. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  32237. *
  32238. * @static
  32239. * @memberOf _
  32240. * @since 4.0.0
  32241. * @category Number
  32242. * @param {number} number The number to clamp.
  32243. * @param {number} [lower] The lower bound.
  32244. * @param {number} upper The upper bound.
  32245. * @returns {number} Returns the clamped number.
  32246. * @example
  32247. *
  32248. * _.clamp(-10, -5, 5);
  32249. * // => -5
  32250. *
  32251. * _.clamp(10, -5, 5);
  32252. * // => 5
  32253. */
  32254. function clamp(number, lower, upper) {
  32255. if (upper === undefined) {
  32256. upper = lower;
  32257. lower = undefined;
  32258. }
  32259. if (upper !== undefined) {
  32260. upper = toNumber(upper);
  32261. upper = upper === upper ? upper : 0;
  32262. }
  32263. if (lower !== undefined) {
  32264. lower = toNumber(lower);
  32265. lower = lower === lower ? lower : 0;
  32266. }
  32267. return baseClamp(toNumber(number), lower, upper);
  32268. }
  32269. /**
  32270. * Checks if `n` is between `start` and up to, but not including, `end`. If
  32271. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  32272. * If `start` is greater than `end` the params are swapped to support
  32273. * negative ranges.
  32274. *
  32275. * @static
  32276. * @memberOf _
  32277. * @since 3.3.0
  32278. * @category Number
  32279. * @param {number} number The number to check.
  32280. * @param {number} [start=0] The start of the range.
  32281. * @param {number} end The end of the range.
  32282. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  32283. * @see _.range, _.rangeRight
  32284. * @example
  32285. *
  32286. * _.inRange(3, 2, 4);
  32287. * // => true
  32288. *
  32289. * _.inRange(4, 8);
  32290. * // => true
  32291. *
  32292. * _.inRange(4, 2);
  32293. * // => false
  32294. *
  32295. * _.inRange(2, 2);
  32296. * // => false
  32297. *
  32298. * _.inRange(1.2, 2);
  32299. * // => true
  32300. *
  32301. * _.inRange(5.2, 4);
  32302. * // => false
  32303. *
  32304. * _.inRange(-3, -2, -6);
  32305. * // => true
  32306. */
  32307. function inRange(number, start, end) {
  32308. start = toFinite(start);
  32309. if (end === undefined) {
  32310. end = start;
  32311. start = 0;
  32312. } else {
  32313. end = toFinite(end);
  32314. }
  32315. number = toNumber(number);
  32316. return baseInRange(number, start, end);
  32317. }
  32318. /**
  32319. * Produces a random number between the inclusive `lower` and `upper` bounds.
  32320. * If only one argument is provided a number between `0` and the given number
  32321. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  32322. * floats, a floating-point number is returned instead of an integer.
  32323. *
  32324. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  32325. * floating-point values which can produce unexpected results.
  32326. *
  32327. * @static
  32328. * @memberOf _
  32329. * @since 0.7.0
  32330. * @category Number
  32331. * @param {number} [lower=0] The lower bound.
  32332. * @param {number} [upper=1] The upper bound.
  32333. * @param {boolean} [floating] Specify returning a floating-point number.
  32334. * @returns {number} Returns the random number.
  32335. * @example
  32336. *
  32337. * _.random(0, 5);
  32338. * // => an integer between 0 and 5
  32339. *
  32340. * _.random(5);
  32341. * // => also an integer between 0 and 5
  32342. *
  32343. * _.random(5, true);
  32344. * // => a floating-point number between 0 and 5
  32345. *
  32346. * _.random(1.2, 5.2);
  32347. * // => a floating-point number between 1.2 and 5.2
  32348. */
  32349. function random(lower, upper, floating) {
  32350. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  32351. upper = floating = undefined;
  32352. }
  32353. if (floating === undefined) {
  32354. if (typeof upper == 'boolean') {
  32355. floating = upper;
  32356. upper = undefined;
  32357. }
  32358. else if (typeof lower == 'boolean') {
  32359. floating = lower;
  32360. lower = undefined;
  32361. }
  32362. }
  32363. if (lower === undefined && upper === undefined) {
  32364. lower = 0;
  32365. upper = 1;
  32366. }
  32367. else {
  32368. lower = toFinite(lower);
  32369. if (upper === undefined) {
  32370. upper = lower;
  32371. lower = 0;
  32372. } else {
  32373. upper = toFinite(upper);
  32374. }
  32375. }
  32376. if (lower > upper) {
  32377. var temp = lower;
  32378. lower = upper;
  32379. upper = temp;
  32380. }
  32381. if (floating || lower % 1 || upper % 1) {
  32382. var rand = nativeRandom();
  32383. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  32384. }
  32385. return baseRandom(lower, upper);
  32386. }
  32387. /*------------------------------------------------------------------------*/
  32388. /**
  32389. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  32390. *
  32391. * @static
  32392. * @memberOf _
  32393. * @since 3.0.0
  32394. * @category String
  32395. * @param {string} [string=''] The string to convert.
  32396. * @returns {string} Returns the camel cased string.
  32397. * @example
  32398. *
  32399. * _.camelCase('Foo Bar');
  32400. * // => 'fooBar'
  32401. *
  32402. * _.camelCase('--foo-bar--');
  32403. * // => 'fooBar'
  32404. *
  32405. * _.camelCase('__FOO_BAR__');
  32406. * // => 'fooBar'
  32407. */
  32408. var camelCase = createCompounder(function(result, word, index) {
  32409. word = word.toLowerCase();
  32410. return result + (index ? capitalize(word) : word);
  32411. });
  32412. /**
  32413. * Converts the first character of `string` to upper case and the remaining
  32414. * to lower case.
  32415. *
  32416. * @static
  32417. * @memberOf _
  32418. * @since 3.0.0
  32419. * @category String
  32420. * @param {string} [string=''] The string to capitalize.
  32421. * @returns {string} Returns the capitalized string.
  32422. * @example
  32423. *
  32424. * _.capitalize('FRED');
  32425. * // => 'Fred'
  32426. */
  32427. function capitalize(string) {
  32428. return upperFirst(toString(string).toLowerCase());
  32429. }
  32430. /**
  32431. * Deburrs `string` by converting
  32432. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  32433. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  32434. * letters to basic Latin letters and removing
  32435. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  32436. *
  32437. * @static
  32438. * @memberOf _
  32439. * @since 3.0.0
  32440. * @category String
  32441. * @param {string} [string=''] The string to deburr.
  32442. * @returns {string} Returns the deburred string.
  32443. * @example
  32444. *
  32445. * _.deburr('déjà vu');
  32446. * // => 'deja vu'
  32447. */
  32448. function deburr(string) {
  32449. string = toString(string);
  32450. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  32451. }
  32452. /**
  32453. * Checks if `string` ends with the given target string.
  32454. *
  32455. * @static
  32456. * @memberOf _
  32457. * @since 3.0.0
  32458. * @category String
  32459. * @param {string} [string=''] The string to inspect.
  32460. * @param {string} [target] The string to search for.
  32461. * @param {number} [position=string.length] The position to search up to.
  32462. * @returns {boolean} Returns `true` if `string` ends with `target`,
  32463. * else `false`.
  32464. * @example
  32465. *
  32466. * _.endsWith('abc', 'c');
  32467. * // => true
  32468. *
  32469. * _.endsWith('abc', 'b');
  32470. * // => false
  32471. *
  32472. * _.endsWith('abc', 'b', 2);
  32473. * // => true
  32474. */
  32475. function endsWith(string, target, position) {
  32476. string = toString(string);
  32477. target = baseToString(target);
  32478. var length = string.length;
  32479. position = position === undefined
  32480. ? length
  32481. : baseClamp(toInteger(position), 0, length);
  32482. var end = position;
  32483. position -= target.length;
  32484. return position >= 0 && string.slice(position, end) == target;
  32485. }
  32486. /**
  32487. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  32488. * corresponding HTML entities.
  32489. *
  32490. * **Note:** No other characters are escaped. To escape additional
  32491. * characters use a third-party library like [_he_](https://mths.be/he).
  32492. *
  32493. * Though the ">" character is escaped for symmetry, characters like
  32494. * ">" and "/" don't need escaping in HTML and have no special meaning
  32495. * unless they're part of a tag or unquoted attribute value. See
  32496. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  32497. * (under "semi-related fun fact") for more details.
  32498. *
  32499. * When working with HTML you should always
  32500. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  32501. * XSS vectors.
  32502. *
  32503. * @static
  32504. * @since 0.1.0
  32505. * @memberOf _
  32506. * @category String
  32507. * @param {string} [string=''] The string to escape.
  32508. * @returns {string} Returns the escaped string.
  32509. * @example
  32510. *
  32511. * _.escape('fred, barney, & pebbles');
  32512. * // => 'fred, barney, &amp; pebbles'
  32513. */
  32514. function escape(string) {
  32515. string = toString(string);
  32516. return (string && reHasUnescapedHtml.test(string))
  32517. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  32518. : string;
  32519. }
  32520. /**
  32521. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  32522. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  32523. *
  32524. * @static
  32525. * @memberOf _
  32526. * @since 3.0.0
  32527. * @category String
  32528. * @param {string} [string=''] The string to escape.
  32529. * @returns {string} Returns the escaped string.
  32530. * @example
  32531. *
  32532. * _.escapeRegExp('[lodash](https://lodash.com/)');
  32533. * // => '\[lodash\]\(https://lodash\.com/\)'
  32534. */
  32535. function escapeRegExp(string) {
  32536. string = toString(string);
  32537. return (string && reHasRegExpChar.test(string))
  32538. ? string.replace(reRegExpChar, '\\$&')
  32539. : string;
  32540. }
  32541. /**
  32542. * Converts `string` to
  32543. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  32544. *
  32545. * @static
  32546. * @memberOf _
  32547. * @since 3.0.0
  32548. * @category String
  32549. * @param {string} [string=''] The string to convert.
  32550. * @returns {string} Returns the kebab cased string.
  32551. * @example
  32552. *
  32553. * _.kebabCase('Foo Bar');
  32554. * // => 'foo-bar'
  32555. *
  32556. * _.kebabCase('fooBar');
  32557. * // => 'foo-bar'
  32558. *
  32559. * _.kebabCase('__FOO_BAR__');
  32560. * // => 'foo-bar'
  32561. */
  32562. var kebabCase = createCompounder(function(result, word, index) {
  32563. return result + (index ? '-' : '') + word.toLowerCase();
  32564. });
  32565. /**
  32566. * Converts `string`, as space separated words, to lower case.
  32567. *
  32568. * @static
  32569. * @memberOf _
  32570. * @since 4.0.0
  32571. * @category String
  32572. * @param {string} [string=''] The string to convert.
  32573. * @returns {string} Returns the lower cased string.
  32574. * @example
  32575. *
  32576. * _.lowerCase('--Foo-Bar--');
  32577. * // => 'foo bar'
  32578. *
  32579. * _.lowerCase('fooBar');
  32580. * // => 'foo bar'
  32581. *
  32582. * _.lowerCase('__FOO_BAR__');
  32583. * // => 'foo bar'
  32584. */
  32585. var lowerCase = createCompounder(function(result, word, index) {
  32586. return result + (index ? ' ' : '') + word.toLowerCase();
  32587. });
  32588. /**
  32589. * Converts the first character of `string` to lower case.
  32590. *
  32591. * @static
  32592. * @memberOf _
  32593. * @since 4.0.0
  32594. * @category String
  32595. * @param {string} [string=''] The string to convert.
  32596. * @returns {string} Returns the converted string.
  32597. * @example
  32598. *
  32599. * _.lowerFirst('Fred');
  32600. * // => 'fred'
  32601. *
  32602. * _.lowerFirst('FRED');
  32603. * // => 'fRED'
  32604. */
  32605. var lowerFirst = createCaseFirst('toLowerCase');
  32606. /**
  32607. * Pads `string` on the left and right sides if it's shorter than `length`.
  32608. * Padding characters are truncated if they can't be evenly divided by `length`.
  32609. *
  32610. * @static
  32611. * @memberOf _
  32612. * @since 3.0.0
  32613. * @category String
  32614. * @param {string} [string=''] The string to pad.
  32615. * @param {number} [length=0] The padding length.
  32616. * @param {string} [chars=' '] The string used as padding.
  32617. * @returns {string} Returns the padded string.
  32618. * @example
  32619. *
  32620. * _.pad('abc', 8);
  32621. * // => ' abc '
  32622. *
  32623. * _.pad('abc', 8, '_-');
  32624. * // => '_-abc_-_'
  32625. *
  32626. * _.pad('abc', 3);
  32627. * // => 'abc'
  32628. */
  32629. function pad(string, length, chars) {
  32630. string = toString(string);
  32631. length = toInteger(length);
  32632. var strLength = length ? stringSize(string) : 0;
  32633. if (!length || strLength >= length) {
  32634. return string;
  32635. }
  32636. var mid = (length - strLength) / 2;
  32637. return (
  32638. createPadding(nativeFloor(mid), chars) +
  32639. string +
  32640. createPadding(nativeCeil(mid), chars)
  32641. );
  32642. }
  32643. /**
  32644. * Pads `string` on the right side if it's shorter than `length`. Padding
  32645. * characters are truncated if they exceed `length`.
  32646. *
  32647. * @static
  32648. * @memberOf _
  32649. * @since 4.0.0
  32650. * @category String
  32651. * @param {string} [string=''] The string to pad.
  32652. * @param {number} [length=0] The padding length.
  32653. * @param {string} [chars=' '] The string used as padding.
  32654. * @returns {string} Returns the padded string.
  32655. * @example
  32656. *
  32657. * _.padEnd('abc', 6);
  32658. * // => 'abc '
  32659. *
  32660. * _.padEnd('abc', 6, '_-');
  32661. * // => 'abc_-_'
  32662. *
  32663. * _.padEnd('abc', 3);
  32664. * // => 'abc'
  32665. */
  32666. function padEnd(string, length, chars) {
  32667. string = toString(string);
  32668. length = toInteger(length);
  32669. var strLength = length ? stringSize(string) : 0;
  32670. return (length && strLength < length)
  32671. ? (string + createPadding(length - strLength, chars))
  32672. : string;
  32673. }
  32674. /**
  32675. * Pads `string` on the left side if it's shorter than `length`. Padding
  32676. * characters are truncated if they exceed `length`.
  32677. *
  32678. * @static
  32679. * @memberOf _
  32680. * @since 4.0.0
  32681. * @category String
  32682. * @param {string} [string=''] The string to pad.
  32683. * @param {number} [length=0] The padding length.
  32684. * @param {string} [chars=' '] The string used as padding.
  32685. * @returns {string} Returns the padded string.
  32686. * @example
  32687. *
  32688. * _.padStart('abc', 6);
  32689. * // => ' abc'
  32690. *
  32691. * _.padStart('abc', 6, '_-');
  32692. * // => '_-_abc'
  32693. *
  32694. * _.padStart('abc', 3);
  32695. * // => 'abc'
  32696. */
  32697. function padStart(string, length, chars) {
  32698. string = toString(string);
  32699. length = toInteger(length);
  32700. var strLength = length ? stringSize(string) : 0;
  32701. return (length && strLength < length)
  32702. ? (createPadding(length - strLength, chars) + string)
  32703. : string;
  32704. }
  32705. /**
  32706. * Converts `string` to an integer of the specified radix. If `radix` is
  32707. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  32708. * hexadecimal, in which case a `radix` of `16` is used.
  32709. *
  32710. * **Note:** This method aligns with the
  32711. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  32712. *
  32713. * @static
  32714. * @memberOf _
  32715. * @since 1.1.0
  32716. * @category String
  32717. * @param {string} string The string to convert.
  32718. * @param {number} [radix=10] The radix to interpret `value` by.
  32719. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  32720. * @returns {number} Returns the converted integer.
  32721. * @example
  32722. *
  32723. * _.parseInt('08');
  32724. * // => 8
  32725. *
  32726. * _.map(['6', '08', '10'], _.parseInt);
  32727. * // => [6, 8, 10]
  32728. */
  32729. function parseInt(string, radix, guard) {
  32730. if (guard || radix == null) {
  32731. radix = 0;
  32732. } else if (radix) {
  32733. radix = +radix;
  32734. }
  32735. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  32736. }
  32737. /**
  32738. * Repeats the given string `n` times.
  32739. *
  32740. * @static
  32741. * @memberOf _
  32742. * @since 3.0.0
  32743. * @category String
  32744. * @param {string} [string=''] The string to repeat.
  32745. * @param {number} [n=1] The number of times to repeat the string.
  32746. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  32747. * @returns {string} Returns the repeated string.
  32748. * @example
  32749. *
  32750. * _.repeat('*', 3);
  32751. * // => '***'
  32752. *
  32753. * _.repeat('abc', 2);
  32754. * // => 'abcabc'
  32755. *
  32756. * _.repeat('abc', 0);
  32757. * // => ''
  32758. */
  32759. function repeat(string, n, guard) {
  32760. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  32761. n = 1;
  32762. } else {
  32763. n = toInteger(n);
  32764. }
  32765. return baseRepeat(toString(string), n);
  32766. }
  32767. /**
  32768. * Replaces matches for `pattern` in `string` with `replacement`.
  32769. *
  32770. * **Note:** This method is based on
  32771. * [`String#replace`](https://mdn.io/String/replace).
  32772. *
  32773. * @static
  32774. * @memberOf _
  32775. * @since 4.0.0
  32776. * @category String
  32777. * @param {string} [string=''] The string to modify.
  32778. * @param {RegExp|string} pattern The pattern to replace.
  32779. * @param {Function|string} replacement The match replacement.
  32780. * @returns {string} Returns the modified string.
  32781. * @example
  32782. *
  32783. * _.replace('Hi Fred', 'Fred', 'Barney');
  32784. * // => 'Hi Barney'
  32785. */
  32786. function replace() {
  32787. var args = arguments,
  32788. string = toString(args[0]);
  32789. return args.length < 3 ? string : string.replace(args[1], args[2]);
  32790. }
  32791. /**
  32792. * Converts `string` to
  32793. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  32794. *
  32795. * @static
  32796. * @memberOf _
  32797. * @since 3.0.0
  32798. * @category String
  32799. * @param {string} [string=''] The string to convert.
  32800. * @returns {string} Returns the snake cased string.
  32801. * @example
  32802. *
  32803. * _.snakeCase('Foo Bar');
  32804. * // => 'foo_bar'
  32805. *
  32806. * _.snakeCase('fooBar');
  32807. * // => 'foo_bar'
  32808. *
  32809. * _.snakeCase('--FOO-BAR--');
  32810. * // => 'foo_bar'
  32811. */
  32812. var snakeCase = createCompounder(function(result, word, index) {
  32813. return result + (index ? '_' : '') + word.toLowerCase();
  32814. });
  32815. /**
  32816. * Splits `string` by `separator`.
  32817. *
  32818. * **Note:** This method is based on
  32819. * [`String#split`](https://mdn.io/String/split).
  32820. *
  32821. * @static
  32822. * @memberOf _
  32823. * @since 4.0.0
  32824. * @category String
  32825. * @param {string} [string=''] The string to split.
  32826. * @param {RegExp|string} separator The separator pattern to split by.
  32827. * @param {number} [limit] The length to truncate results to.
  32828. * @returns {Array} Returns the string segments.
  32829. * @example
  32830. *
  32831. * _.split('a-b-c', '-', 2);
  32832. * // => ['a', 'b']
  32833. */
  32834. function split(string, separator, limit) {
  32835. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  32836. separator = limit = undefined;
  32837. }
  32838. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  32839. if (!limit) {
  32840. return [];
  32841. }
  32842. string = toString(string);
  32843. if (string && (
  32844. typeof separator == 'string' ||
  32845. (separator != null && !isRegExp(separator))
  32846. )) {
  32847. separator = baseToString(separator);
  32848. if (!separator && hasUnicode(string)) {
  32849. return castSlice(stringToArray(string), 0, limit);
  32850. }
  32851. }
  32852. return string.split(separator, limit);
  32853. }
  32854. /**
  32855. * Converts `string` to
  32856. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  32857. *
  32858. * @static
  32859. * @memberOf _
  32860. * @since 3.1.0
  32861. * @category String
  32862. * @param {string} [string=''] The string to convert.
  32863. * @returns {string} Returns the start cased string.
  32864. * @example
  32865. *
  32866. * _.startCase('--foo-bar--');
  32867. * // => 'Foo Bar'
  32868. *
  32869. * _.startCase('fooBar');
  32870. * // => 'Foo Bar'
  32871. *
  32872. * _.startCase('__FOO_BAR__');
  32873. * // => 'FOO BAR'
  32874. */
  32875. var startCase = createCompounder(function(result, word, index) {
  32876. return result + (index ? ' ' : '') + upperFirst(word);
  32877. });
  32878. /**
  32879. * Checks if `string` starts with the given target string.
  32880. *
  32881. * @static
  32882. * @memberOf _
  32883. * @since 3.0.0
  32884. * @category String
  32885. * @param {string} [string=''] The string to inspect.
  32886. * @param {string} [target] The string to search for.
  32887. * @param {number} [position=0] The position to search from.
  32888. * @returns {boolean} Returns `true` if `string` starts with `target`,
  32889. * else `false`.
  32890. * @example
  32891. *
  32892. * _.startsWith('abc', 'a');
  32893. * // => true
  32894. *
  32895. * _.startsWith('abc', 'b');
  32896. * // => false
  32897. *
  32898. * _.startsWith('abc', 'b', 1);
  32899. * // => true
  32900. */
  32901. function startsWith(string, target, position) {
  32902. string = toString(string);
  32903. position = position == null
  32904. ? 0
  32905. : baseClamp(toInteger(position), 0, string.length);
  32906. target = baseToString(target);
  32907. return string.slice(position, position + target.length) == target;
  32908. }
  32909. /**
  32910. * Creates a compiled template function that can interpolate data properties
  32911. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  32912. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  32913. * properties may be accessed as free variables in the template. If a setting
  32914. * object is given, it takes precedence over `_.templateSettings` values.
  32915. *
  32916. * **Note:** In the development build `_.template` utilizes
  32917. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  32918. * for easier debugging.
  32919. *
  32920. * For more information on precompiling templates see
  32921. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  32922. *
  32923. * For more information on Chrome extension sandboxes see
  32924. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  32925. *
  32926. * @static
  32927. * @since 0.1.0
  32928. * @memberOf _
  32929. * @category String
  32930. * @param {string} [string=''] The template string.
  32931. * @param {Object} [options={}] The options object.
  32932. * @param {RegExp} [options.escape=_.templateSettings.escape]
  32933. * The HTML "escape" delimiter.
  32934. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  32935. * The "evaluate" delimiter.
  32936. * @param {Object} [options.imports=_.templateSettings.imports]
  32937. * An object to import into the template as free variables.
  32938. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  32939. * The "interpolate" delimiter.
  32940. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  32941. * The sourceURL of the compiled template.
  32942. * @param {string} [options.variable='obj']
  32943. * The data object variable name.
  32944. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  32945. * @returns {Function} Returns the compiled template function.
  32946. * @example
  32947. *
  32948. * // Use the "interpolate" delimiter to create a compiled template.
  32949. * var compiled = _.template('hello <%= user %>!');
  32950. * compiled({ 'user': 'fred' });
  32951. * // => 'hello fred!'
  32952. *
  32953. * // Use the HTML "escape" delimiter to escape data property values.
  32954. * var compiled = _.template('<b><%- value %></b>');
  32955. * compiled({ 'value': '<script>' });
  32956. * // => '<b>&lt;script&gt;</b>'
  32957. *
  32958. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  32959. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  32960. * compiled({ 'users': ['fred', 'barney'] });
  32961. * // => '<li>fred</li><li>barney</li>'
  32962. *
  32963. * // Use the internal `print` function in "evaluate" delimiters.
  32964. * var compiled = _.template('<% print("hello " + user); %>!');
  32965. * compiled({ 'user': 'barney' });
  32966. * // => 'hello barney!'
  32967. *
  32968. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  32969. * // Disable support by replacing the "interpolate" delimiter.
  32970. * var compiled = _.template('hello ${ user }!');
  32971. * compiled({ 'user': 'pebbles' });
  32972. * // => 'hello pebbles!'
  32973. *
  32974. * // Use backslashes to treat delimiters as plain text.
  32975. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  32976. * compiled({ 'value': 'ignored' });
  32977. * // => '<%- value %>'
  32978. *
  32979. * // Use the `imports` option to import `jQuery` as `jq`.
  32980. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  32981. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  32982. * compiled({ 'users': ['fred', 'barney'] });
  32983. * // => '<li>fred</li><li>barney</li>'
  32984. *
  32985. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  32986. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  32987. * compiled(data);
  32988. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  32989. *
  32990. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  32991. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  32992. * compiled.source;
  32993. * // => function(data) {
  32994. * // var __t, __p = '';
  32995. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  32996. * // return __p;
  32997. * // }
  32998. *
  32999. * // Use custom template delimiters.
  33000. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  33001. * var compiled = _.template('hello {{ user }}!');
  33002. * compiled({ 'user': 'mustache' });
  33003. * // => 'hello mustache!'
  33004. *
  33005. * // Use the `source` property to inline compiled templates for meaningful
  33006. * // line numbers in error messages and stack traces.
  33007. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  33008. * var JST = {\
  33009. * "main": ' + _.template(mainText).source + '\
  33010. * };\
  33011. * ');
  33012. */
  33013. function template(string, options, guard) {
  33014. // Based on John Resig's `tmpl` implementation
  33015. // (http://ejohn.org/blog/javascript-micro-templating/)
  33016. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  33017. var settings = lodash.templateSettings;
  33018. if (guard && isIterateeCall(string, options, guard)) {
  33019. options = undefined;
  33020. }
  33021. string = toString(string);
  33022. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  33023. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  33024. importsKeys = keys(imports),
  33025. importsValues = baseValues(imports, importsKeys);
  33026. var isEscaping,
  33027. isEvaluating,
  33028. index = 0,
  33029. interpolate = options.interpolate || reNoMatch,
  33030. source = "__p += '";
  33031. // Compile the regexp to match each delimiter.
  33032. var reDelimiters = RegExp(
  33033. (options.escape || reNoMatch).source + '|' +
  33034. interpolate.source + '|' +
  33035. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  33036. (options.evaluate || reNoMatch).source + '|$'
  33037. , 'g');
  33038. // Use a sourceURL for easier debugging.
  33039. // The sourceURL gets injected into the source that's eval-ed, so be careful
  33040. // with lookup (in case of e.g. prototype pollution), and strip newlines if any.
  33041. // A newline wouldn't be a valid sourceURL anyway, and it'd enable code injection.
  33042. var sourceURL = '//# sourceURL=' +
  33043. (hasOwnProperty.call(options, 'sourceURL')
  33044. ? (options.sourceURL + '').replace(/[\r\n]/g, ' ')
  33045. : ('lodash.templateSources[' + (++templateCounter) + ']')
  33046. ) + '\n';
  33047. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  33048. interpolateValue || (interpolateValue = esTemplateValue);
  33049. // Escape characters that can't be included in string literals.
  33050. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  33051. // Replace delimiters with snippets.
  33052. if (escapeValue) {
  33053. isEscaping = true;
  33054. source += "' +\n__e(" + escapeValue + ") +\n'";
  33055. }
  33056. if (evaluateValue) {
  33057. isEvaluating = true;
  33058. source += "';\n" + evaluateValue + ";\n__p += '";
  33059. }
  33060. if (interpolateValue) {
  33061. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  33062. }
  33063. index = offset + match.length;
  33064. // The JS engine embedded in Adobe products needs `match` returned in
  33065. // order to produce the correct `offset` value.
  33066. return match;
  33067. });
  33068. source += "';\n";
  33069. // If `variable` is not specified wrap a with-statement around the generated
  33070. // code to add the data object to the top of the scope chain.
  33071. // Like with sourceURL, we take care to not check the option's prototype,
  33072. // as this configuration is a code injection vector.
  33073. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  33074. if (!variable) {
  33075. source = 'with (obj) {\n' + source + '\n}\n';
  33076. }
  33077. // Cleanup code by stripping empty strings.
  33078. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  33079. .replace(reEmptyStringMiddle, '$1')
  33080. .replace(reEmptyStringTrailing, '$1;');
  33081. // Frame code as the function body.
  33082. source = 'function(' + (variable || 'obj') + ') {\n' +
  33083. (variable
  33084. ? ''
  33085. : 'obj || (obj = {});\n'
  33086. ) +
  33087. "var __t, __p = ''" +
  33088. (isEscaping
  33089. ? ', __e = _.escape'
  33090. : ''
  33091. ) +
  33092. (isEvaluating
  33093. ? ', __j = Array.prototype.join;\n' +
  33094. "function print() { __p += __j.call(arguments, '') }\n"
  33095. : ';\n'
  33096. ) +
  33097. source +
  33098. 'return __p\n}';
  33099. var result = attempt(function() {
  33100. return Function(importsKeys, sourceURL + 'return ' + source)
  33101. .apply(undefined, importsValues);
  33102. });
  33103. // Provide the compiled function's source by its `toString` method or
  33104. // the `source` property as a convenience for inlining compiled templates.
  33105. result.source = source;
  33106. if (isError(result)) {
  33107. throw result;
  33108. }
  33109. return result;
  33110. }
  33111. /**
  33112. * Converts `string`, as a whole, to lower case just like
  33113. * [String#toLowerCase](https://mdn.io/toLowerCase).
  33114. *
  33115. * @static
  33116. * @memberOf _
  33117. * @since 4.0.0
  33118. * @category String
  33119. * @param {string} [string=''] The string to convert.
  33120. * @returns {string} Returns the lower cased string.
  33121. * @example
  33122. *
  33123. * _.toLower('--Foo-Bar--');
  33124. * // => '--foo-bar--'
  33125. *
  33126. * _.toLower('fooBar');
  33127. * // => 'foobar'
  33128. *
  33129. * _.toLower('__FOO_BAR__');
  33130. * // => '__foo_bar__'
  33131. */
  33132. function toLower(value) {
  33133. return toString(value).toLowerCase();
  33134. }
  33135. /**
  33136. * Converts `string`, as a whole, to upper case just like
  33137. * [String#toUpperCase](https://mdn.io/toUpperCase).
  33138. *
  33139. * @static
  33140. * @memberOf _
  33141. * @since 4.0.0
  33142. * @category String
  33143. * @param {string} [string=''] The string to convert.
  33144. * @returns {string} Returns the upper cased string.
  33145. * @example
  33146. *
  33147. * _.toUpper('--foo-bar--');
  33148. * // => '--FOO-BAR--'
  33149. *
  33150. * _.toUpper('fooBar');
  33151. * // => 'FOOBAR'
  33152. *
  33153. * _.toUpper('__foo_bar__');
  33154. * // => '__FOO_BAR__'
  33155. */
  33156. function toUpper(value) {
  33157. return toString(value).toUpperCase();
  33158. }
  33159. /**
  33160. * Removes leading and trailing whitespace or specified characters from `string`.
  33161. *
  33162. * @static
  33163. * @memberOf _
  33164. * @since 3.0.0
  33165. * @category String
  33166. * @param {string} [string=''] The string to trim.
  33167. * @param {string} [chars=whitespace] The characters to trim.
  33168. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  33169. * @returns {string} Returns the trimmed string.
  33170. * @example
  33171. *
  33172. * _.trim(' abc ');
  33173. * // => 'abc'
  33174. *
  33175. * _.trim('-_-abc-_-', '_-');
  33176. * // => 'abc'
  33177. *
  33178. * _.map([' foo ', ' bar '], _.trim);
  33179. * // => ['foo', 'bar']
  33180. */
  33181. function trim(string, chars, guard) {
  33182. string = toString(string);
  33183. if (string && (guard || chars === undefined)) {
  33184. return string.replace(reTrim, '');
  33185. }
  33186. if (!string || !(chars = baseToString(chars))) {
  33187. return string;
  33188. }
  33189. var strSymbols = stringToArray(string),
  33190. chrSymbols = stringToArray(chars),
  33191. start = charsStartIndex(strSymbols, chrSymbols),
  33192. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  33193. return castSlice(strSymbols, start, end).join('');
  33194. }
  33195. /**
  33196. * Removes trailing whitespace or specified characters from `string`.
  33197. *
  33198. * @static
  33199. * @memberOf _
  33200. * @since 4.0.0
  33201. * @category String
  33202. * @param {string} [string=''] The string to trim.
  33203. * @param {string} [chars=whitespace] The characters to trim.
  33204. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  33205. * @returns {string} Returns the trimmed string.
  33206. * @example
  33207. *
  33208. * _.trimEnd(' abc ');
  33209. * // => ' abc'
  33210. *
  33211. * _.trimEnd('-_-abc-_-', '_-');
  33212. * // => '-_-abc'
  33213. */
  33214. function trimEnd(string, chars, guard) {
  33215. string = toString(string);
  33216. if (string && (guard || chars === undefined)) {
  33217. return string.replace(reTrimEnd, '');
  33218. }
  33219. if (!string || !(chars = baseToString(chars))) {
  33220. return string;
  33221. }
  33222. var strSymbols = stringToArray(string),
  33223. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  33224. return castSlice(strSymbols, 0, end).join('');
  33225. }
  33226. /**
  33227. * Removes leading whitespace or specified characters from `string`.
  33228. *
  33229. * @static
  33230. * @memberOf _
  33231. * @since 4.0.0
  33232. * @category String
  33233. * @param {string} [string=''] The string to trim.
  33234. * @param {string} [chars=whitespace] The characters to trim.
  33235. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  33236. * @returns {string} Returns the trimmed string.
  33237. * @example
  33238. *
  33239. * _.trimStart(' abc ');
  33240. * // => 'abc '
  33241. *
  33242. * _.trimStart('-_-abc-_-', '_-');
  33243. * // => 'abc-_-'
  33244. */
  33245. function trimStart(string, chars, guard) {
  33246. string = toString(string);
  33247. if (string && (guard || chars === undefined)) {
  33248. return string.replace(reTrimStart, '');
  33249. }
  33250. if (!string || !(chars = baseToString(chars))) {
  33251. return string;
  33252. }
  33253. var strSymbols = stringToArray(string),
  33254. start = charsStartIndex(strSymbols, stringToArray(chars));
  33255. return castSlice(strSymbols, start).join('');
  33256. }
  33257. /**
  33258. * Truncates `string` if it's longer than the given maximum string length.
  33259. * The last characters of the truncated string are replaced with the omission
  33260. * string which defaults to "...".
  33261. *
  33262. * @static
  33263. * @memberOf _
  33264. * @since 4.0.0
  33265. * @category String
  33266. * @param {string} [string=''] The string to truncate.
  33267. * @param {Object} [options={}] The options object.
  33268. * @param {number} [options.length=30] The maximum string length.
  33269. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  33270. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  33271. * @returns {string} Returns the truncated string.
  33272. * @example
  33273. *
  33274. * _.truncate('hi-diddly-ho there, neighborino');
  33275. * // => 'hi-diddly-ho there, neighbo...'
  33276. *
  33277. * _.truncate('hi-diddly-ho there, neighborino', {
  33278. * 'length': 24,
  33279. * 'separator': ' '
  33280. * });
  33281. * // => 'hi-diddly-ho there,...'
  33282. *
  33283. * _.truncate('hi-diddly-ho there, neighborino', {
  33284. * 'length': 24,
  33285. * 'separator': /,? +/
  33286. * });
  33287. * // => 'hi-diddly-ho there...'
  33288. *
  33289. * _.truncate('hi-diddly-ho there, neighborino', {
  33290. * 'omission': ' [...]'
  33291. * });
  33292. * // => 'hi-diddly-ho there, neig [...]'
  33293. */
  33294. function truncate(string, options) {
  33295. var length = DEFAULT_TRUNC_LENGTH,
  33296. omission = DEFAULT_TRUNC_OMISSION;
  33297. if (isObject(options)) {
  33298. var separator = 'separator' in options ? options.separator : separator;
  33299. length = 'length' in options ? toInteger(options.length) : length;
  33300. omission = 'omission' in options ? baseToString(options.omission) : omission;
  33301. }
  33302. string = toString(string);
  33303. var strLength = string.length;
  33304. if (hasUnicode(string)) {
  33305. var strSymbols = stringToArray(string);
  33306. strLength = strSymbols.length;
  33307. }
  33308. if (length >= strLength) {
  33309. return string;
  33310. }
  33311. var end = length - stringSize(omission);
  33312. if (end < 1) {
  33313. return omission;
  33314. }
  33315. var result = strSymbols
  33316. ? castSlice(strSymbols, 0, end).join('')
  33317. : string.slice(0, end);
  33318. if (separator === undefined) {
  33319. return result + omission;
  33320. }
  33321. if (strSymbols) {
  33322. end += (result.length - end);
  33323. }
  33324. if (isRegExp(separator)) {
  33325. if (string.slice(end).search(separator)) {
  33326. var match,
  33327. substring = result;
  33328. if (!separator.global) {
  33329. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  33330. }
  33331. separator.lastIndex = 0;
  33332. while ((match = separator.exec(substring))) {
  33333. var newEnd = match.index;
  33334. }
  33335. result = result.slice(0, newEnd === undefined ? end : newEnd);
  33336. }
  33337. } else if (string.indexOf(baseToString(separator), end) != end) {
  33338. var index = result.lastIndexOf(separator);
  33339. if (index > -1) {
  33340. result = result.slice(0, index);
  33341. }
  33342. }
  33343. return result + omission;
  33344. }
  33345. /**
  33346. * The inverse of `_.escape`; this method converts the HTML entities
  33347. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  33348. * their corresponding characters.
  33349. *
  33350. * **Note:** No other HTML entities are unescaped. To unescape additional
  33351. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  33352. *
  33353. * @static
  33354. * @memberOf _
  33355. * @since 0.6.0
  33356. * @category String
  33357. * @param {string} [string=''] The string to unescape.
  33358. * @returns {string} Returns the unescaped string.
  33359. * @example
  33360. *
  33361. * _.unescape('fred, barney, &amp; pebbles');
  33362. * // => 'fred, barney, & pebbles'
  33363. */
  33364. function unescape(string) {
  33365. string = toString(string);
  33366. return (string && reHasEscapedHtml.test(string))
  33367. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  33368. : string;
  33369. }
  33370. /**
  33371. * Converts `string`, as space separated words, to upper case.
  33372. *
  33373. * @static
  33374. * @memberOf _
  33375. * @since 4.0.0
  33376. * @category String
  33377. * @param {string} [string=''] The string to convert.
  33378. * @returns {string} Returns the upper cased string.
  33379. * @example
  33380. *
  33381. * _.upperCase('--foo-bar');
  33382. * // => 'FOO BAR'
  33383. *
  33384. * _.upperCase('fooBar');
  33385. * // => 'FOO BAR'
  33386. *
  33387. * _.upperCase('__foo_bar__');
  33388. * // => 'FOO BAR'
  33389. */
  33390. var upperCase = createCompounder(function(result, word, index) {
  33391. return result + (index ? ' ' : '') + word.toUpperCase();
  33392. });
  33393. /**
  33394. * Converts the first character of `string` to upper case.
  33395. *
  33396. * @static
  33397. * @memberOf _
  33398. * @since 4.0.0
  33399. * @category String
  33400. * @param {string} [string=''] The string to convert.
  33401. * @returns {string} Returns the converted string.
  33402. * @example
  33403. *
  33404. * _.upperFirst('fred');
  33405. * // => 'Fred'
  33406. *
  33407. * _.upperFirst('FRED');
  33408. * // => 'FRED'
  33409. */
  33410. var upperFirst = createCaseFirst('toUpperCase');
  33411. /**
  33412. * Splits `string` into an array of its words.
  33413. *
  33414. * @static
  33415. * @memberOf _
  33416. * @since 3.0.0
  33417. * @category String
  33418. * @param {string} [string=''] The string to inspect.
  33419. * @param {RegExp|string} [pattern] The pattern to match words.
  33420. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  33421. * @returns {Array} Returns the words of `string`.
  33422. * @example
  33423. *
  33424. * _.words('fred, barney, & pebbles');
  33425. * // => ['fred', 'barney', 'pebbles']
  33426. *
  33427. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  33428. * // => ['fred', 'barney', '&', 'pebbles']
  33429. */
  33430. function words(string, pattern, guard) {
  33431. string = toString(string);
  33432. pattern = guard ? undefined : pattern;
  33433. if (pattern === undefined) {
  33434. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  33435. }
  33436. return string.match(pattern) || [];
  33437. }
  33438. /*------------------------------------------------------------------------*/
  33439. /**
  33440. * Attempts to invoke `func`, returning either the result or the caught error
  33441. * object. Any additional arguments are provided to `func` when it's invoked.
  33442. *
  33443. * @static
  33444. * @memberOf _
  33445. * @since 3.0.0
  33446. * @category Util
  33447. * @param {Function} func The function to attempt.
  33448. * @param {...*} [args] The arguments to invoke `func` with.
  33449. * @returns {*} Returns the `func` result or error object.
  33450. * @example
  33451. *
  33452. * // Avoid throwing errors for invalid selectors.
  33453. * var elements = _.attempt(function(selector) {
  33454. * return document.querySelectorAll(selector);
  33455. * }, '>_>');
  33456. *
  33457. * if (_.isError(elements)) {
  33458. * elements = [];
  33459. * }
  33460. */
  33461. var attempt = baseRest(function(func, args) {
  33462. try {
  33463. return apply(func, undefined, args);
  33464. } catch (e) {
  33465. return isError(e) ? e : new Error(e);
  33466. }
  33467. });
  33468. /**
  33469. * Binds methods of an object to the object itself, overwriting the existing
  33470. * method.
  33471. *
  33472. * **Note:** This method doesn't set the "length" property of bound functions.
  33473. *
  33474. * @static
  33475. * @since 0.1.0
  33476. * @memberOf _
  33477. * @category Util
  33478. * @param {Object} object The object to bind and assign the bound methods to.
  33479. * @param {...(string|string[])} methodNames The object method names to bind.
  33480. * @returns {Object} Returns `object`.
  33481. * @example
  33482. *
  33483. * var view = {
  33484. * 'label': 'docs',
  33485. * 'click': function() {
  33486. * console.log('clicked ' + this.label);
  33487. * }
  33488. * };
  33489. *
  33490. * _.bindAll(view, ['click']);
  33491. * jQuery(element).on('click', view.click);
  33492. * // => Logs 'clicked docs' when clicked.
  33493. */
  33494. var bindAll = flatRest(function(object, methodNames) {
  33495. arrayEach(methodNames, function(key) {
  33496. key = toKey(key);
  33497. baseAssignValue(object, key, bind(object[key], object));
  33498. });
  33499. return object;
  33500. });
  33501. /**
  33502. * Creates a function that iterates over `pairs` and invokes the corresponding
  33503. * function of the first predicate to return truthy. The predicate-function
  33504. * pairs are invoked with the `this` binding and arguments of the created
  33505. * function.
  33506. *
  33507. * @static
  33508. * @memberOf _
  33509. * @since 4.0.0
  33510. * @category Util
  33511. * @param {Array} pairs The predicate-function pairs.
  33512. * @returns {Function} Returns the new composite function.
  33513. * @example
  33514. *
  33515. * var func = _.cond([
  33516. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  33517. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  33518. * [_.stubTrue, _.constant('no match')]
  33519. * ]);
  33520. *
  33521. * func({ 'a': 1, 'b': 2 });
  33522. * // => 'matches A'
  33523. *
  33524. * func({ 'a': 0, 'b': 1 });
  33525. * // => 'matches B'
  33526. *
  33527. * func({ 'a': '1', 'b': '2' });
  33528. * // => 'no match'
  33529. */
  33530. function cond(pairs) {
  33531. var length = pairs == null ? 0 : pairs.length,
  33532. toIteratee = getIteratee();
  33533. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  33534. if (typeof pair[1] != 'function') {
  33535. throw new TypeError(FUNC_ERROR_TEXT);
  33536. }
  33537. return [toIteratee(pair[0]), pair[1]];
  33538. });
  33539. return baseRest(function(args) {
  33540. var index = -1;
  33541. while (++index < length) {
  33542. var pair = pairs[index];
  33543. if (apply(pair[0], this, args)) {
  33544. return apply(pair[1], this, args);
  33545. }
  33546. }
  33547. });
  33548. }
  33549. /**
  33550. * Creates a function that invokes the predicate properties of `source` with
  33551. * the corresponding property values of a given object, returning `true` if
  33552. * all predicates return truthy, else `false`.
  33553. *
  33554. * **Note:** The created function is equivalent to `_.conformsTo` with
  33555. * `source` partially applied.
  33556. *
  33557. * @static
  33558. * @memberOf _
  33559. * @since 4.0.0
  33560. * @category Util
  33561. * @param {Object} source The object of property predicates to conform to.
  33562. * @returns {Function} Returns the new spec function.
  33563. * @example
  33564. *
  33565. * var objects = [
  33566. * { 'a': 2, 'b': 1 },
  33567. * { 'a': 1, 'b': 2 }
  33568. * ];
  33569. *
  33570. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  33571. * // => [{ 'a': 1, 'b': 2 }]
  33572. */
  33573. function conforms(source) {
  33574. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  33575. }
  33576. /**
  33577. * Creates a function that returns `value`.
  33578. *
  33579. * @static
  33580. * @memberOf _
  33581. * @since 2.4.0
  33582. * @category Util
  33583. * @param {*} value The value to return from the new function.
  33584. * @returns {Function} Returns the new constant function.
  33585. * @example
  33586. *
  33587. * var objects = _.times(2, _.constant({ 'a': 1 }));
  33588. *
  33589. * console.log(objects);
  33590. * // => [{ 'a': 1 }, { 'a': 1 }]
  33591. *
  33592. * console.log(objects[0] === objects[1]);
  33593. * // => true
  33594. */
  33595. function constant(value) {
  33596. return function() {
  33597. return value;
  33598. };
  33599. }
  33600. /**
  33601. * Checks `value` to determine whether a default value should be returned in
  33602. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  33603. * or `undefined`.
  33604. *
  33605. * @static
  33606. * @memberOf _
  33607. * @since 4.14.0
  33608. * @category Util
  33609. * @param {*} value The value to check.
  33610. * @param {*} defaultValue The default value.
  33611. * @returns {*} Returns the resolved value.
  33612. * @example
  33613. *
  33614. * _.defaultTo(1, 10);
  33615. * // => 1
  33616. *
  33617. * _.defaultTo(undefined, 10);
  33618. * // => 10
  33619. */
  33620. function defaultTo(value, defaultValue) {
  33621. return (value == null || value !== value) ? defaultValue : value;
  33622. }
  33623. /**
  33624. * Creates a function that returns the result of invoking the given functions
  33625. * with the `this` binding of the created function, where each successive
  33626. * invocation is supplied the return value of the previous.
  33627. *
  33628. * @static
  33629. * @memberOf _
  33630. * @since 3.0.0
  33631. * @category Util
  33632. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  33633. * @returns {Function} Returns the new composite function.
  33634. * @see _.flowRight
  33635. * @example
  33636. *
  33637. * function square(n) {
  33638. * return n * n;
  33639. * }
  33640. *
  33641. * var addSquare = _.flow([_.add, square]);
  33642. * addSquare(1, 2);
  33643. * // => 9
  33644. */
  33645. var flow = createFlow();
  33646. /**
  33647. * This method is like `_.flow` except that it creates a function that
  33648. * invokes the given functions from right to left.
  33649. *
  33650. * @static
  33651. * @since 3.0.0
  33652. * @memberOf _
  33653. * @category Util
  33654. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  33655. * @returns {Function} Returns the new composite function.
  33656. * @see _.flow
  33657. * @example
  33658. *
  33659. * function square(n) {
  33660. * return n * n;
  33661. * }
  33662. *
  33663. * var addSquare = _.flowRight([square, _.add]);
  33664. * addSquare(1, 2);
  33665. * // => 9
  33666. */
  33667. var flowRight = createFlow(true);
  33668. /**
  33669. * This method returns the first argument it receives.
  33670. *
  33671. * @static
  33672. * @since 0.1.0
  33673. * @memberOf _
  33674. * @category Util
  33675. * @param {*} value Any value.
  33676. * @returns {*} Returns `value`.
  33677. * @example
  33678. *
  33679. * var object = { 'a': 1 };
  33680. *
  33681. * console.log(_.identity(object) === object);
  33682. * // => true
  33683. */
  33684. function identity(value) {
  33685. return value;
  33686. }
  33687. /**
  33688. * Creates a function that invokes `func` with the arguments of the created
  33689. * function. If `func` is a property name, the created function returns the
  33690. * property value for a given element. If `func` is an array or object, the
  33691. * created function returns `true` for elements that contain the equivalent
  33692. * source properties, otherwise it returns `false`.
  33693. *
  33694. * @static
  33695. * @since 4.0.0
  33696. * @memberOf _
  33697. * @category Util
  33698. * @param {*} [func=_.identity] The value to convert to a callback.
  33699. * @returns {Function} Returns the callback.
  33700. * @example
  33701. *
  33702. * var users = [
  33703. * { 'user': 'barney', 'age': 36, 'active': true },
  33704. * { 'user': 'fred', 'age': 40, 'active': false }
  33705. * ];
  33706. *
  33707. * // The `_.matches` iteratee shorthand.
  33708. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  33709. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  33710. *
  33711. * // The `_.matchesProperty` iteratee shorthand.
  33712. * _.filter(users, _.iteratee(['user', 'fred']));
  33713. * // => [{ 'user': 'fred', 'age': 40 }]
  33714. *
  33715. * // The `_.property` iteratee shorthand.
  33716. * _.map(users, _.iteratee('user'));
  33717. * // => ['barney', 'fred']
  33718. *
  33719. * // Create custom iteratee shorthands.
  33720. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  33721. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  33722. * return func.test(string);
  33723. * };
  33724. * });
  33725. *
  33726. * _.filter(['abc', 'def'], /ef/);
  33727. * // => ['def']
  33728. */
  33729. function iteratee(func) {
  33730. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  33731. }
  33732. /**
  33733. * Creates a function that performs a partial deep comparison between a given
  33734. * object and `source`, returning `true` if the given object has equivalent
  33735. * property values, else `false`.
  33736. *
  33737. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  33738. * partially applied.
  33739. *
  33740. * Partial comparisons will match empty array and empty object `source`
  33741. * values against any array or object value, respectively. See `_.isEqual`
  33742. * for a list of supported value comparisons.
  33743. *
  33744. * @static
  33745. * @memberOf _
  33746. * @since 3.0.0
  33747. * @category Util
  33748. * @param {Object} source The object of property values to match.
  33749. * @returns {Function} Returns the new spec function.
  33750. * @example
  33751. *
  33752. * var objects = [
  33753. * { 'a': 1, 'b': 2, 'c': 3 },
  33754. * { 'a': 4, 'b': 5, 'c': 6 }
  33755. * ];
  33756. *
  33757. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  33758. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  33759. */
  33760. function matches(source) {
  33761. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  33762. }
  33763. /**
  33764. * Creates a function that performs a partial deep comparison between the
  33765. * value at `path` of a given object to `srcValue`, returning `true` if the
  33766. * object value is equivalent, else `false`.
  33767. *
  33768. * **Note:** Partial comparisons will match empty array and empty object
  33769. * `srcValue` values against any array or object value, respectively. See
  33770. * `_.isEqual` for a list of supported value comparisons.
  33771. *
  33772. * @static
  33773. * @memberOf _
  33774. * @since 3.2.0
  33775. * @category Util
  33776. * @param {Array|string} path The path of the property to get.
  33777. * @param {*} srcValue The value to match.
  33778. * @returns {Function} Returns the new spec function.
  33779. * @example
  33780. *
  33781. * var objects = [
  33782. * { 'a': 1, 'b': 2, 'c': 3 },
  33783. * { 'a': 4, 'b': 5, 'c': 6 }
  33784. * ];
  33785. *
  33786. * _.find(objects, _.matchesProperty('a', 4));
  33787. * // => { 'a': 4, 'b': 5, 'c': 6 }
  33788. */
  33789. function matchesProperty(path, srcValue) {
  33790. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  33791. }
  33792. /**
  33793. * Creates a function that invokes the method at `path` of a given object.
  33794. * Any additional arguments are provided to the invoked method.
  33795. *
  33796. * @static
  33797. * @memberOf _
  33798. * @since 3.7.0
  33799. * @category Util
  33800. * @param {Array|string} path The path of the method to invoke.
  33801. * @param {...*} [args] The arguments to invoke the method with.
  33802. * @returns {Function} Returns the new invoker function.
  33803. * @example
  33804. *
  33805. * var objects = [
  33806. * { 'a': { 'b': _.constant(2) } },
  33807. * { 'a': { 'b': _.constant(1) } }
  33808. * ];
  33809. *
  33810. * _.map(objects, _.method('a.b'));
  33811. * // => [2, 1]
  33812. *
  33813. * _.map(objects, _.method(['a', 'b']));
  33814. * // => [2, 1]
  33815. */
  33816. var method = baseRest(function(path, args) {
  33817. return function(object) {
  33818. return baseInvoke(object, path, args);
  33819. };
  33820. });
  33821. /**
  33822. * The opposite of `_.method`; this method creates a function that invokes
  33823. * the method at a given path of `object`. Any additional arguments are
  33824. * provided to the invoked method.
  33825. *
  33826. * @static
  33827. * @memberOf _
  33828. * @since 3.7.0
  33829. * @category Util
  33830. * @param {Object} object The object to query.
  33831. * @param {...*} [args] The arguments to invoke the method with.
  33832. * @returns {Function} Returns the new invoker function.
  33833. * @example
  33834. *
  33835. * var array = _.times(3, _.constant),
  33836. * object = { 'a': array, 'b': array, 'c': array };
  33837. *
  33838. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  33839. * // => [2, 0]
  33840. *
  33841. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  33842. * // => [2, 0]
  33843. */
  33844. var methodOf = baseRest(function(object, args) {
  33845. return function(path) {
  33846. return baseInvoke(object, path, args);
  33847. };
  33848. });
  33849. /**
  33850. * Adds all own enumerable string keyed function properties of a source
  33851. * object to the destination object. If `object` is a function, then methods
  33852. * are added to its prototype as well.
  33853. *
  33854. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  33855. * avoid conflicts caused by modifying the original.
  33856. *
  33857. * @static
  33858. * @since 0.1.0
  33859. * @memberOf _
  33860. * @category Util
  33861. * @param {Function|Object} [object=lodash] The destination object.
  33862. * @param {Object} source The object of functions to add.
  33863. * @param {Object} [options={}] The options object.
  33864. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  33865. * @returns {Function|Object} Returns `object`.
  33866. * @example
  33867. *
  33868. * function vowels(string) {
  33869. * return _.filter(string, function(v) {
  33870. * return /[aeiou]/i.test(v);
  33871. * });
  33872. * }
  33873. *
  33874. * _.mixin({ 'vowels': vowels });
  33875. * _.vowels('fred');
  33876. * // => ['e']
  33877. *
  33878. * _('fred').vowels().value();
  33879. * // => ['e']
  33880. *
  33881. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  33882. * _('fred').vowels();
  33883. * // => ['e']
  33884. */
  33885. function mixin(object, source, options) {
  33886. var props = keys(source),
  33887. methodNames = baseFunctions(source, props);
  33888. if (options == null &&
  33889. !(isObject(source) && (methodNames.length || !props.length))) {
  33890. options = source;
  33891. source = object;
  33892. object = this;
  33893. methodNames = baseFunctions(source, keys(source));
  33894. }
  33895. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  33896. isFunc = isFunction(object);
  33897. arrayEach(methodNames, function(methodName) {
  33898. var func = source[methodName];
  33899. object[methodName] = func;
  33900. if (isFunc) {
  33901. object.prototype[methodName] = function() {
  33902. var chainAll = this.__chain__;
  33903. if (chain || chainAll) {
  33904. var result = object(this.__wrapped__),
  33905. actions = result.__actions__ = copyArray(this.__actions__);
  33906. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  33907. result.__chain__ = chainAll;
  33908. return result;
  33909. }
  33910. return func.apply(object, arrayPush([this.value()], arguments));
  33911. };
  33912. }
  33913. });
  33914. return object;
  33915. }
  33916. /**
  33917. * Reverts the `_` variable to its previous value and returns a reference to
  33918. * the `lodash` function.
  33919. *
  33920. * @static
  33921. * @since 0.1.0
  33922. * @memberOf _
  33923. * @category Util
  33924. * @returns {Function} Returns the `lodash` function.
  33925. * @example
  33926. *
  33927. * var lodash = _.noConflict();
  33928. */
  33929. function noConflict() {
  33930. if (root._ === this) {
  33931. root._ = oldDash;
  33932. }
  33933. return this;
  33934. }
  33935. /**
  33936. * This method returns `undefined`.
  33937. *
  33938. * @static
  33939. * @memberOf _
  33940. * @since 2.3.0
  33941. * @category Util
  33942. * @example
  33943. *
  33944. * _.times(2, _.noop);
  33945. * // => [undefined, undefined]
  33946. */
  33947. function noop() {
  33948. // No operation performed.
  33949. }
  33950. /**
  33951. * Creates a function that gets the argument at index `n`. If `n` is negative,
  33952. * the nth argument from the end is returned.
  33953. *
  33954. * @static
  33955. * @memberOf _
  33956. * @since 4.0.0
  33957. * @category Util
  33958. * @param {number} [n=0] The index of the argument to return.
  33959. * @returns {Function} Returns the new pass-thru function.
  33960. * @example
  33961. *
  33962. * var func = _.nthArg(1);
  33963. * func('a', 'b', 'c', 'd');
  33964. * // => 'b'
  33965. *
  33966. * var func = _.nthArg(-2);
  33967. * func('a', 'b', 'c', 'd');
  33968. * // => 'c'
  33969. */
  33970. function nthArg(n) {
  33971. n = toInteger(n);
  33972. return baseRest(function(args) {
  33973. return baseNth(args, n);
  33974. });
  33975. }
  33976. /**
  33977. * Creates a function that invokes `iteratees` with the arguments it receives
  33978. * and returns their results.
  33979. *
  33980. * @static
  33981. * @memberOf _
  33982. * @since 4.0.0
  33983. * @category Util
  33984. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  33985. * The iteratees to invoke.
  33986. * @returns {Function} Returns the new function.
  33987. * @example
  33988. *
  33989. * var func = _.over([Math.max, Math.min]);
  33990. *
  33991. * func(1, 2, 3, 4);
  33992. * // => [4, 1]
  33993. */
  33994. var over = createOver(arrayMap);
  33995. /**
  33996. * Creates a function that checks if **all** of the `predicates` return
  33997. * truthy when invoked with the arguments it receives.
  33998. *
  33999. * @static
  34000. * @memberOf _
  34001. * @since 4.0.0
  34002. * @category Util
  34003. * @param {...(Function|Function[])} [predicates=[_.identity]]
  34004. * The predicates to check.
  34005. * @returns {Function} Returns the new function.
  34006. * @example
  34007. *
  34008. * var func = _.overEvery([Boolean, isFinite]);
  34009. *
  34010. * func('1');
  34011. * // => true
  34012. *
  34013. * func(null);
  34014. * // => false
  34015. *
  34016. * func(NaN);
  34017. * // => false
  34018. */
  34019. var overEvery = createOver(arrayEvery);
  34020. /**
  34021. * Creates a function that checks if **any** of the `predicates` return
  34022. * truthy when invoked with the arguments it receives.
  34023. *
  34024. * @static
  34025. * @memberOf _
  34026. * @since 4.0.0
  34027. * @category Util
  34028. * @param {...(Function|Function[])} [predicates=[_.identity]]
  34029. * The predicates to check.
  34030. * @returns {Function} Returns the new function.
  34031. * @example
  34032. *
  34033. * var func = _.overSome([Boolean, isFinite]);
  34034. *
  34035. * func('1');
  34036. * // => true
  34037. *
  34038. * func(null);
  34039. * // => true
  34040. *
  34041. * func(NaN);
  34042. * // => false
  34043. */
  34044. var overSome = createOver(arraySome);
  34045. /**
  34046. * Creates a function that returns the value at `path` of a given object.
  34047. *
  34048. * @static
  34049. * @memberOf _
  34050. * @since 2.4.0
  34051. * @category Util
  34052. * @param {Array|string} path The path of the property to get.
  34053. * @returns {Function} Returns the new accessor function.
  34054. * @example
  34055. *
  34056. * var objects = [
  34057. * { 'a': { 'b': 2 } },
  34058. * { 'a': { 'b': 1 } }
  34059. * ];
  34060. *
  34061. * _.map(objects, _.property('a.b'));
  34062. * // => [2, 1]
  34063. *
  34064. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  34065. * // => [1, 2]
  34066. */
  34067. function property(path) {
  34068. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  34069. }
  34070. /**
  34071. * The opposite of `_.property`; this method creates a function that returns
  34072. * the value at a given path of `object`.
  34073. *
  34074. * @static
  34075. * @memberOf _
  34076. * @since 3.0.0
  34077. * @category Util
  34078. * @param {Object} object The object to query.
  34079. * @returns {Function} Returns the new accessor function.
  34080. * @example
  34081. *
  34082. * var array = [0, 1, 2],
  34083. * object = { 'a': array, 'b': array, 'c': array };
  34084. *
  34085. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  34086. * // => [2, 0]
  34087. *
  34088. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  34089. * // => [2, 0]
  34090. */
  34091. function propertyOf(object) {
  34092. return function(path) {
  34093. return object == null ? undefined : baseGet(object, path);
  34094. };
  34095. }
  34096. /**
  34097. * Creates an array of numbers (positive and/or negative) progressing from
  34098. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  34099. * `start` is specified without an `end` or `step`. If `end` is not specified,
  34100. * it's set to `start` with `start` then set to `0`.
  34101. *
  34102. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  34103. * floating-point values which can produce unexpected results.
  34104. *
  34105. * @static
  34106. * @since 0.1.0
  34107. * @memberOf _
  34108. * @category Util
  34109. * @param {number} [start=0] The start of the range.
  34110. * @param {number} end The end of the range.
  34111. * @param {number} [step=1] The value to increment or decrement by.
  34112. * @returns {Array} Returns the range of numbers.
  34113. * @see _.inRange, _.rangeRight
  34114. * @example
  34115. *
  34116. * _.range(4);
  34117. * // => [0, 1, 2, 3]
  34118. *
  34119. * _.range(-4);
  34120. * // => [0, -1, -2, -3]
  34121. *
  34122. * _.range(1, 5);
  34123. * // => [1, 2, 3, 4]
  34124. *
  34125. * _.range(0, 20, 5);
  34126. * // => [0, 5, 10, 15]
  34127. *
  34128. * _.range(0, -4, -1);
  34129. * // => [0, -1, -2, -3]
  34130. *
  34131. * _.range(1, 4, 0);
  34132. * // => [1, 1, 1]
  34133. *
  34134. * _.range(0);
  34135. * // => []
  34136. */
  34137. var range = createRange();
  34138. /**
  34139. * This method is like `_.range` except that it populates values in
  34140. * descending order.
  34141. *
  34142. * @static
  34143. * @memberOf _
  34144. * @since 4.0.0
  34145. * @category Util
  34146. * @param {number} [start=0] The start of the range.
  34147. * @param {number} end The end of the range.
  34148. * @param {number} [step=1] The value to increment or decrement by.
  34149. * @returns {Array} Returns the range of numbers.
  34150. * @see _.inRange, _.range
  34151. * @example
  34152. *
  34153. * _.rangeRight(4);
  34154. * // => [3, 2, 1, 0]
  34155. *
  34156. * _.rangeRight(-4);
  34157. * // => [-3, -2, -1, 0]
  34158. *
  34159. * _.rangeRight(1, 5);
  34160. * // => [4, 3, 2, 1]
  34161. *
  34162. * _.rangeRight(0, 20, 5);
  34163. * // => [15, 10, 5, 0]
  34164. *
  34165. * _.rangeRight(0, -4, -1);
  34166. * // => [-3, -2, -1, 0]
  34167. *
  34168. * _.rangeRight(1, 4, 0);
  34169. * // => [1, 1, 1]
  34170. *
  34171. * _.rangeRight(0);
  34172. * // => []
  34173. */
  34174. var rangeRight = createRange(true);
  34175. /**
  34176. * This method returns a new empty array.
  34177. *
  34178. * @static
  34179. * @memberOf _
  34180. * @since 4.13.0
  34181. * @category Util
  34182. * @returns {Array} Returns the new empty array.
  34183. * @example
  34184. *
  34185. * var arrays = _.times(2, _.stubArray);
  34186. *
  34187. * console.log(arrays);
  34188. * // => [[], []]
  34189. *
  34190. * console.log(arrays[0] === arrays[1]);
  34191. * // => false
  34192. */
  34193. function stubArray() {
  34194. return [];
  34195. }
  34196. /**
  34197. * This method returns `false`.
  34198. *
  34199. * @static
  34200. * @memberOf _
  34201. * @since 4.13.0
  34202. * @category Util
  34203. * @returns {boolean} Returns `false`.
  34204. * @example
  34205. *
  34206. * _.times(2, _.stubFalse);
  34207. * // => [false, false]
  34208. */
  34209. function stubFalse() {
  34210. return false;
  34211. }
  34212. /**
  34213. * This method returns a new empty object.
  34214. *
  34215. * @static
  34216. * @memberOf _
  34217. * @since 4.13.0
  34218. * @category Util
  34219. * @returns {Object} Returns the new empty object.
  34220. * @example
  34221. *
  34222. * var objects = _.times(2, _.stubObject);
  34223. *
  34224. * console.log(objects);
  34225. * // => [{}, {}]
  34226. *
  34227. * console.log(objects[0] === objects[1]);
  34228. * // => false
  34229. */
  34230. function stubObject() {
  34231. return {};
  34232. }
  34233. /**
  34234. * This method returns an empty string.
  34235. *
  34236. * @static
  34237. * @memberOf _
  34238. * @since 4.13.0
  34239. * @category Util
  34240. * @returns {string} Returns the empty string.
  34241. * @example
  34242. *
  34243. * _.times(2, _.stubString);
  34244. * // => ['', '']
  34245. */
  34246. function stubString() {
  34247. return '';
  34248. }
  34249. /**
  34250. * This method returns `true`.
  34251. *
  34252. * @static
  34253. * @memberOf _
  34254. * @since 4.13.0
  34255. * @category Util
  34256. * @returns {boolean} Returns `true`.
  34257. * @example
  34258. *
  34259. * _.times(2, _.stubTrue);
  34260. * // => [true, true]
  34261. */
  34262. function stubTrue() {
  34263. return true;
  34264. }
  34265. /**
  34266. * Invokes the iteratee `n` times, returning an array of the results of
  34267. * each invocation. The iteratee is invoked with one argument; (index).
  34268. *
  34269. * @static
  34270. * @since 0.1.0
  34271. * @memberOf _
  34272. * @category Util
  34273. * @param {number} n The number of times to invoke `iteratee`.
  34274. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  34275. * @returns {Array} Returns the array of results.
  34276. * @example
  34277. *
  34278. * _.times(3, String);
  34279. * // => ['0', '1', '2']
  34280. *
  34281. * _.times(4, _.constant(0));
  34282. * // => [0, 0, 0, 0]
  34283. */
  34284. function times(n, iteratee) {
  34285. n = toInteger(n);
  34286. if (n < 1 || n > MAX_SAFE_INTEGER) {
  34287. return [];
  34288. }
  34289. var index = MAX_ARRAY_LENGTH,
  34290. length = nativeMin(n, MAX_ARRAY_LENGTH);
  34291. iteratee = getIteratee(iteratee);
  34292. n -= MAX_ARRAY_LENGTH;
  34293. var result = baseTimes(length, iteratee);
  34294. while (++index < n) {
  34295. iteratee(index);
  34296. }
  34297. return result;
  34298. }
  34299. /**
  34300. * Converts `value` to a property path array.
  34301. *
  34302. * @static
  34303. * @memberOf _
  34304. * @since 4.0.0
  34305. * @category Util
  34306. * @param {*} value The value to convert.
  34307. * @returns {Array} Returns the new property path array.
  34308. * @example
  34309. *
  34310. * _.toPath('a.b.c');
  34311. * // => ['a', 'b', 'c']
  34312. *
  34313. * _.toPath('a[0].b.c');
  34314. * // => ['a', '0', 'b', 'c']
  34315. */
  34316. function toPath(value) {
  34317. if (isArray(value)) {
  34318. return arrayMap(value, toKey);
  34319. }
  34320. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  34321. }
  34322. /**
  34323. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  34324. *
  34325. * @static
  34326. * @since 0.1.0
  34327. * @memberOf _
  34328. * @category Util
  34329. * @param {string} [prefix=''] The value to prefix the ID with.
  34330. * @returns {string} Returns the unique ID.
  34331. * @example
  34332. *
  34333. * _.uniqueId('contact_');
  34334. * // => 'contact_104'
  34335. *
  34336. * _.uniqueId();
  34337. * // => '105'
  34338. */
  34339. function uniqueId(prefix) {
  34340. var id = ++idCounter;
  34341. return toString(prefix) + id;
  34342. }
  34343. /*------------------------------------------------------------------------*/
  34344. /**
  34345. * Adds two numbers.
  34346. *
  34347. * @static
  34348. * @memberOf _
  34349. * @since 3.4.0
  34350. * @category Math
  34351. * @param {number} augend The first number in an addition.
  34352. * @param {number} addend The second number in an addition.
  34353. * @returns {number} Returns the total.
  34354. * @example
  34355. *
  34356. * _.add(6, 4);
  34357. * // => 10
  34358. */
  34359. var add = createMathOperation(function(augend, addend) {
  34360. return augend + addend;
  34361. }, 0);
  34362. /**
  34363. * Computes `number` rounded up to `precision`.
  34364. *
  34365. * @static
  34366. * @memberOf _
  34367. * @since 3.10.0
  34368. * @category Math
  34369. * @param {number} number The number to round up.
  34370. * @param {number} [precision=0] The precision to round up to.
  34371. * @returns {number} Returns the rounded up number.
  34372. * @example
  34373. *
  34374. * _.ceil(4.006);
  34375. * // => 5
  34376. *
  34377. * _.ceil(6.004, 2);
  34378. * // => 6.01
  34379. *
  34380. * _.ceil(6040, -2);
  34381. * // => 6100
  34382. */
  34383. var ceil = createRound('ceil');
  34384. /**
  34385. * Divide two numbers.
  34386. *
  34387. * @static
  34388. * @memberOf _
  34389. * @since 4.7.0
  34390. * @category Math
  34391. * @param {number} dividend The first number in a division.
  34392. * @param {number} divisor The second number in a division.
  34393. * @returns {number} Returns the quotient.
  34394. * @example
  34395. *
  34396. * _.divide(6, 4);
  34397. * // => 1.5
  34398. */
  34399. var divide = createMathOperation(function(dividend, divisor) {
  34400. return dividend / divisor;
  34401. }, 1);
  34402. /**
  34403. * Computes `number` rounded down to `precision`.
  34404. *
  34405. * @static
  34406. * @memberOf _
  34407. * @since 3.10.0
  34408. * @category Math
  34409. * @param {number} number The number to round down.
  34410. * @param {number} [precision=0] The precision to round down to.
  34411. * @returns {number} Returns the rounded down number.
  34412. * @example
  34413. *
  34414. * _.floor(4.006);
  34415. * // => 4
  34416. *
  34417. * _.floor(0.046, 2);
  34418. * // => 0.04
  34419. *
  34420. * _.floor(4060, -2);
  34421. * // => 4000
  34422. */
  34423. var floor = createRound('floor');
  34424. /**
  34425. * Computes the maximum value of `array`. If `array` is empty or falsey,
  34426. * `undefined` is returned.
  34427. *
  34428. * @static
  34429. * @since 0.1.0
  34430. * @memberOf _
  34431. * @category Math
  34432. * @param {Array} array The array to iterate over.
  34433. * @returns {*} Returns the maximum value.
  34434. * @example
  34435. *
  34436. * _.max([4, 2, 8, 6]);
  34437. * // => 8
  34438. *
  34439. * _.max([]);
  34440. * // => undefined
  34441. */
  34442. function max(array) {
  34443. return (array && array.length)
  34444. ? baseExtremum(array, identity, baseGt)
  34445. : undefined;
  34446. }
  34447. /**
  34448. * This method is like `_.max` except that it accepts `iteratee` which is
  34449. * invoked for each element in `array` to generate the criterion by which
  34450. * the value is ranked. The iteratee is invoked with one argument: (value).
  34451. *
  34452. * @static
  34453. * @memberOf _
  34454. * @since 4.0.0
  34455. * @category Math
  34456. * @param {Array} array The array to iterate over.
  34457. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  34458. * @returns {*} Returns the maximum value.
  34459. * @example
  34460. *
  34461. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  34462. *
  34463. * _.maxBy(objects, function(o) { return o.n; });
  34464. * // => { 'n': 2 }
  34465. *
  34466. * // The `_.property` iteratee shorthand.
  34467. * _.maxBy(objects, 'n');
  34468. * // => { 'n': 2 }
  34469. */
  34470. function maxBy(array, iteratee) {
  34471. return (array && array.length)
  34472. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  34473. : undefined;
  34474. }
  34475. /**
  34476. * Computes the mean of the values in `array`.
  34477. *
  34478. * @static
  34479. * @memberOf _
  34480. * @since 4.0.0
  34481. * @category Math
  34482. * @param {Array} array The array to iterate over.
  34483. * @returns {number} Returns the mean.
  34484. * @example
  34485. *
  34486. * _.mean([4, 2, 8, 6]);
  34487. * // => 5
  34488. */
  34489. function mean(array) {
  34490. return baseMean(array, identity);
  34491. }
  34492. /**
  34493. * This method is like `_.mean` except that it accepts `iteratee` which is
  34494. * invoked for each element in `array` to generate the value to be averaged.
  34495. * The iteratee is invoked with one argument: (value).
  34496. *
  34497. * @static
  34498. * @memberOf _
  34499. * @since 4.7.0
  34500. * @category Math
  34501. * @param {Array} array The array to iterate over.
  34502. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  34503. * @returns {number} Returns the mean.
  34504. * @example
  34505. *
  34506. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  34507. *
  34508. * _.meanBy(objects, function(o) { return o.n; });
  34509. * // => 5
  34510. *
  34511. * // The `_.property` iteratee shorthand.
  34512. * _.meanBy(objects, 'n');
  34513. * // => 5
  34514. */
  34515. function meanBy(array, iteratee) {
  34516. return baseMean(array, getIteratee(iteratee, 2));
  34517. }
  34518. /**
  34519. * Computes the minimum value of `array`. If `array` is empty or falsey,
  34520. * `undefined` is returned.
  34521. *
  34522. * @static
  34523. * @since 0.1.0
  34524. * @memberOf _
  34525. * @category Math
  34526. * @param {Array} array The array to iterate over.
  34527. * @returns {*} Returns the minimum value.
  34528. * @example
  34529. *
  34530. * _.min([4, 2, 8, 6]);
  34531. * // => 2
  34532. *
  34533. * _.min([]);
  34534. * // => undefined
  34535. */
  34536. function min(array) {
  34537. return (array && array.length)
  34538. ? baseExtremum(array, identity, baseLt)
  34539. : undefined;
  34540. }
  34541. /**
  34542. * This method is like `_.min` except that it accepts `iteratee` which is
  34543. * invoked for each element in `array` to generate the criterion by which
  34544. * the value is ranked. The iteratee is invoked with one argument: (value).
  34545. *
  34546. * @static
  34547. * @memberOf _
  34548. * @since 4.0.0
  34549. * @category Math
  34550. * @param {Array} array The array to iterate over.
  34551. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  34552. * @returns {*} Returns the minimum value.
  34553. * @example
  34554. *
  34555. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  34556. *
  34557. * _.minBy(objects, function(o) { return o.n; });
  34558. * // => { 'n': 1 }
  34559. *
  34560. * // The `_.property` iteratee shorthand.
  34561. * _.minBy(objects, 'n');
  34562. * // => { 'n': 1 }
  34563. */
  34564. function minBy(array, iteratee) {
  34565. return (array && array.length)
  34566. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  34567. : undefined;
  34568. }
  34569. /**
  34570. * Multiply two numbers.
  34571. *
  34572. * @static
  34573. * @memberOf _
  34574. * @since 4.7.0
  34575. * @category Math
  34576. * @param {number} multiplier The first number in a multiplication.
  34577. * @param {number} multiplicand The second number in a multiplication.
  34578. * @returns {number} Returns the product.
  34579. * @example
  34580. *
  34581. * _.multiply(6, 4);
  34582. * // => 24
  34583. */
  34584. var multiply = createMathOperation(function(multiplier, multiplicand) {
  34585. return multiplier * multiplicand;
  34586. }, 1);
  34587. /**
  34588. * Computes `number` rounded to `precision`.
  34589. *
  34590. * @static
  34591. * @memberOf _
  34592. * @since 3.10.0
  34593. * @category Math
  34594. * @param {number} number The number to round.
  34595. * @param {number} [precision=0] The precision to round to.
  34596. * @returns {number} Returns the rounded number.
  34597. * @example
  34598. *
  34599. * _.round(4.006);
  34600. * // => 4
  34601. *
  34602. * _.round(4.006, 2);
  34603. * // => 4.01
  34604. *
  34605. * _.round(4060, -2);
  34606. * // => 4100
  34607. */
  34608. var round = createRound('round');
  34609. /**
  34610. * Subtract two numbers.
  34611. *
  34612. * @static
  34613. * @memberOf _
  34614. * @since 4.0.0
  34615. * @category Math
  34616. * @param {number} minuend The first number in a subtraction.
  34617. * @param {number} subtrahend The second number in a subtraction.
  34618. * @returns {number} Returns the difference.
  34619. * @example
  34620. *
  34621. * _.subtract(6, 4);
  34622. * // => 2
  34623. */
  34624. var subtract = createMathOperation(function(minuend, subtrahend) {
  34625. return minuend - subtrahend;
  34626. }, 0);
  34627. /**
  34628. * Computes the sum of the values in `array`.
  34629. *
  34630. * @static
  34631. * @memberOf _
  34632. * @since 3.4.0
  34633. * @category Math
  34634. * @param {Array} array The array to iterate over.
  34635. * @returns {number} Returns the sum.
  34636. * @example
  34637. *
  34638. * _.sum([4, 2, 8, 6]);
  34639. * // => 20
  34640. */
  34641. function sum(array) {
  34642. return (array && array.length)
  34643. ? baseSum(array, identity)
  34644. : 0;
  34645. }
  34646. /**
  34647. * This method is like `_.sum` except that it accepts `iteratee` which is
  34648. * invoked for each element in `array` to generate the value to be summed.
  34649. * The iteratee is invoked with one argument: (value).
  34650. *
  34651. * @static
  34652. * @memberOf _
  34653. * @since 4.0.0
  34654. * @category Math
  34655. * @param {Array} array The array to iterate over.
  34656. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  34657. * @returns {number} Returns the sum.
  34658. * @example
  34659. *
  34660. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  34661. *
  34662. * _.sumBy(objects, function(o) { return o.n; });
  34663. * // => 20
  34664. *
  34665. * // The `_.property` iteratee shorthand.
  34666. * _.sumBy(objects, 'n');
  34667. * // => 20
  34668. */
  34669. function sumBy(array, iteratee) {
  34670. return (array && array.length)
  34671. ? baseSum(array, getIteratee(iteratee, 2))
  34672. : 0;
  34673. }
  34674. /*------------------------------------------------------------------------*/
  34675. // Add methods that return wrapped values in chain sequences.
  34676. lodash.after = after;
  34677. lodash.ary = ary;
  34678. lodash.assign = assign;
  34679. lodash.assignIn = assignIn;
  34680. lodash.assignInWith = assignInWith;
  34681. lodash.assignWith = assignWith;
  34682. lodash.at = at;
  34683. lodash.before = before;
  34684. lodash.bind = bind;
  34685. lodash.bindAll = bindAll;
  34686. lodash.bindKey = bindKey;
  34687. lodash.castArray = castArray;
  34688. lodash.chain = chain;
  34689. lodash.chunk = chunk;
  34690. lodash.compact = compact;
  34691. lodash.concat = concat;
  34692. lodash.cond = cond;
  34693. lodash.conforms = conforms;
  34694. lodash.constant = constant;
  34695. lodash.countBy = countBy;
  34696. lodash.create = create;
  34697. lodash.curry = curry;
  34698. lodash.curryRight = curryRight;
  34699. lodash.debounce = debounce;
  34700. lodash.defaults = defaults;
  34701. lodash.defaultsDeep = defaultsDeep;
  34702. lodash.defer = defer;
  34703. lodash.delay = delay;
  34704. lodash.difference = difference;
  34705. lodash.differenceBy = differenceBy;
  34706. lodash.differenceWith = differenceWith;
  34707. lodash.drop = drop;
  34708. lodash.dropRight = dropRight;
  34709. lodash.dropRightWhile = dropRightWhile;
  34710. lodash.dropWhile = dropWhile;
  34711. lodash.fill = fill;
  34712. lodash.filter = filter;
  34713. lodash.flatMap = flatMap;
  34714. lodash.flatMapDeep = flatMapDeep;
  34715. lodash.flatMapDepth = flatMapDepth;
  34716. lodash.flatten = flatten;
  34717. lodash.flattenDeep = flattenDeep;
  34718. lodash.flattenDepth = flattenDepth;
  34719. lodash.flip = flip;
  34720. lodash.flow = flow;
  34721. lodash.flowRight = flowRight;
  34722. lodash.fromPairs = fromPairs;
  34723. lodash.functions = functions;
  34724. lodash.functionsIn = functionsIn;
  34725. lodash.groupBy = groupBy;
  34726. lodash.initial = initial;
  34727. lodash.intersection = intersection;
  34728. lodash.intersectionBy = intersectionBy;
  34729. lodash.intersectionWith = intersectionWith;
  34730. lodash.invert = invert;
  34731. lodash.invertBy = invertBy;
  34732. lodash.invokeMap = invokeMap;
  34733. lodash.iteratee = iteratee;
  34734. lodash.keyBy = keyBy;
  34735. lodash.keys = keys;
  34736. lodash.keysIn = keysIn;
  34737. lodash.map = map;
  34738. lodash.mapKeys = mapKeys;
  34739. lodash.mapValues = mapValues;
  34740. lodash.matches = matches;
  34741. lodash.matchesProperty = matchesProperty;
  34742. lodash.memoize = memoize;
  34743. lodash.merge = merge;
  34744. lodash.mergeWith = mergeWith;
  34745. lodash.method = method;
  34746. lodash.methodOf = methodOf;
  34747. lodash.mixin = mixin;
  34748. lodash.negate = negate;
  34749. lodash.nthArg = nthArg;
  34750. lodash.omit = omit;
  34751. lodash.omitBy = omitBy;
  34752. lodash.once = once;
  34753. lodash.orderBy = orderBy;
  34754. lodash.over = over;
  34755. lodash.overArgs = overArgs;
  34756. lodash.overEvery = overEvery;
  34757. lodash.overSome = overSome;
  34758. lodash.partial = partial;
  34759. lodash.partialRight = partialRight;
  34760. lodash.partition = partition;
  34761. lodash.pick = pick;
  34762. lodash.pickBy = pickBy;
  34763. lodash.property = property;
  34764. lodash.propertyOf = propertyOf;
  34765. lodash.pull = pull;
  34766. lodash.pullAll = pullAll;
  34767. lodash.pullAllBy = pullAllBy;
  34768. lodash.pullAllWith = pullAllWith;
  34769. lodash.pullAt = pullAt;
  34770. lodash.range = range;
  34771. lodash.rangeRight = rangeRight;
  34772. lodash.rearg = rearg;
  34773. lodash.reject = reject;
  34774. lodash.remove = remove;
  34775. lodash.rest = rest;
  34776. lodash.reverse = reverse;
  34777. lodash.sampleSize = sampleSize;
  34778. lodash.set = set;
  34779. lodash.setWith = setWith;
  34780. lodash.shuffle = shuffle;
  34781. lodash.slice = slice;
  34782. lodash.sortBy = sortBy;
  34783. lodash.sortedUniq = sortedUniq;
  34784. lodash.sortedUniqBy = sortedUniqBy;
  34785. lodash.split = split;
  34786. lodash.spread = spread;
  34787. lodash.tail = tail;
  34788. lodash.take = take;
  34789. lodash.takeRight = takeRight;
  34790. lodash.takeRightWhile = takeRightWhile;
  34791. lodash.takeWhile = takeWhile;
  34792. lodash.tap = tap;
  34793. lodash.throttle = throttle;
  34794. lodash.thru = thru;
  34795. lodash.toArray = toArray;
  34796. lodash.toPairs = toPairs;
  34797. lodash.toPairsIn = toPairsIn;
  34798. lodash.toPath = toPath;
  34799. lodash.toPlainObject = toPlainObject;
  34800. lodash.transform = transform;
  34801. lodash.unary = unary;
  34802. lodash.union = union;
  34803. lodash.unionBy = unionBy;
  34804. lodash.unionWith = unionWith;
  34805. lodash.uniq = uniq;
  34806. lodash.uniqBy = uniqBy;
  34807. lodash.uniqWith = uniqWith;
  34808. lodash.unset = unset;
  34809. lodash.unzip = unzip;
  34810. lodash.unzipWith = unzipWith;
  34811. lodash.update = update;
  34812. lodash.updateWith = updateWith;
  34813. lodash.values = values;
  34814. lodash.valuesIn = valuesIn;
  34815. lodash.without = without;
  34816. lodash.words = words;
  34817. lodash.wrap = wrap;
  34818. lodash.xor = xor;
  34819. lodash.xorBy = xorBy;
  34820. lodash.xorWith = xorWith;
  34821. lodash.zip = zip;
  34822. lodash.zipObject = zipObject;
  34823. lodash.zipObjectDeep = zipObjectDeep;
  34824. lodash.zipWith = zipWith;
  34825. // Add aliases.
  34826. lodash.entries = toPairs;
  34827. lodash.entriesIn = toPairsIn;
  34828. lodash.extend = assignIn;
  34829. lodash.extendWith = assignInWith;
  34830. // Add methods to `lodash.prototype`.
  34831. mixin(lodash, lodash);
  34832. /*------------------------------------------------------------------------*/
  34833. // Add methods that return unwrapped values in chain sequences.
  34834. lodash.add = add;
  34835. lodash.attempt = attempt;
  34836. lodash.camelCase = camelCase;
  34837. lodash.capitalize = capitalize;
  34838. lodash.ceil = ceil;
  34839. lodash.clamp = clamp;
  34840. lodash.clone = clone;
  34841. lodash.cloneDeep = cloneDeep;
  34842. lodash.cloneDeepWith = cloneDeepWith;
  34843. lodash.cloneWith = cloneWith;
  34844. lodash.conformsTo = conformsTo;
  34845. lodash.deburr = deburr;
  34846. lodash.defaultTo = defaultTo;
  34847. lodash.divide = divide;
  34848. lodash.endsWith = endsWith;
  34849. lodash.eq = eq;
  34850. lodash.escape = escape;
  34851. lodash.escapeRegExp = escapeRegExp;
  34852. lodash.every = every;
  34853. lodash.find = find;
  34854. lodash.findIndex = findIndex;
  34855. lodash.findKey = findKey;
  34856. lodash.findLast = findLast;
  34857. lodash.findLastIndex = findLastIndex;
  34858. lodash.findLastKey = findLastKey;
  34859. lodash.floor = floor;
  34860. lodash.forEach = forEach;
  34861. lodash.forEachRight = forEachRight;
  34862. lodash.forIn = forIn;
  34863. lodash.forInRight = forInRight;
  34864. lodash.forOwn = forOwn;
  34865. lodash.forOwnRight = forOwnRight;
  34866. lodash.get = get;
  34867. lodash.gt = gt;
  34868. lodash.gte = gte;
  34869. lodash.has = has;
  34870. lodash.hasIn = hasIn;
  34871. lodash.head = head;
  34872. lodash.identity = identity;
  34873. lodash.includes = includes;
  34874. lodash.indexOf = indexOf;
  34875. lodash.inRange = inRange;
  34876. lodash.invoke = invoke;
  34877. lodash.isArguments = isArguments;
  34878. lodash.isArray = isArray;
  34879. lodash.isArrayBuffer = isArrayBuffer;
  34880. lodash.isArrayLike = isArrayLike;
  34881. lodash.isArrayLikeObject = isArrayLikeObject;
  34882. lodash.isBoolean = isBoolean;
  34883. lodash.isBuffer = isBuffer;
  34884. lodash.isDate = isDate;
  34885. lodash.isElement = isElement;
  34886. lodash.isEmpty = isEmpty;
  34887. lodash.isEqual = isEqual;
  34888. lodash.isEqualWith = isEqualWith;
  34889. lodash.isError = isError;
  34890. lodash.isFinite = isFinite;
  34891. lodash.isFunction = isFunction;
  34892. lodash.isInteger = isInteger;
  34893. lodash.isLength = isLength;
  34894. lodash.isMap = isMap;
  34895. lodash.isMatch = isMatch;
  34896. lodash.isMatchWith = isMatchWith;
  34897. lodash.isNaN = isNaN;
  34898. lodash.isNative = isNative;
  34899. lodash.isNil = isNil;
  34900. lodash.isNull = isNull;
  34901. lodash.isNumber = isNumber;
  34902. lodash.isObject = isObject;
  34903. lodash.isObjectLike = isObjectLike;
  34904. lodash.isPlainObject = isPlainObject;
  34905. lodash.isRegExp = isRegExp;
  34906. lodash.isSafeInteger = isSafeInteger;
  34907. lodash.isSet = isSet;
  34908. lodash.isString = isString;
  34909. lodash.isSymbol = isSymbol;
  34910. lodash.isTypedArray = isTypedArray;
  34911. lodash.isUndefined = isUndefined;
  34912. lodash.isWeakMap = isWeakMap;
  34913. lodash.isWeakSet = isWeakSet;
  34914. lodash.join = join;
  34915. lodash.kebabCase = kebabCase;
  34916. lodash.last = last;
  34917. lodash.lastIndexOf = lastIndexOf;
  34918. lodash.lowerCase = lowerCase;
  34919. lodash.lowerFirst = lowerFirst;
  34920. lodash.lt = lt;
  34921. lodash.lte = lte;
  34922. lodash.max = max;
  34923. lodash.maxBy = maxBy;
  34924. lodash.mean = mean;
  34925. lodash.meanBy = meanBy;
  34926. lodash.min = min;
  34927. lodash.minBy = minBy;
  34928. lodash.stubArray = stubArray;
  34929. lodash.stubFalse = stubFalse;
  34930. lodash.stubObject = stubObject;
  34931. lodash.stubString = stubString;
  34932. lodash.stubTrue = stubTrue;
  34933. lodash.multiply = multiply;
  34934. lodash.nth = nth;
  34935. lodash.noConflict = noConflict;
  34936. lodash.noop = noop;
  34937. lodash.now = now;
  34938. lodash.pad = pad;
  34939. lodash.padEnd = padEnd;
  34940. lodash.padStart = padStart;
  34941. lodash.parseInt = parseInt;
  34942. lodash.random = random;
  34943. lodash.reduce = reduce;
  34944. lodash.reduceRight = reduceRight;
  34945. lodash.repeat = repeat;
  34946. lodash.replace = replace;
  34947. lodash.result = result;
  34948. lodash.round = round;
  34949. lodash.runInContext = runInContext;
  34950. lodash.sample = sample;
  34951. lodash.size = size;
  34952. lodash.snakeCase = snakeCase;
  34953. lodash.some = some;
  34954. lodash.sortedIndex = sortedIndex;
  34955. lodash.sortedIndexBy = sortedIndexBy;
  34956. lodash.sortedIndexOf = sortedIndexOf;
  34957. lodash.sortedLastIndex = sortedLastIndex;
  34958. lodash.sortedLastIndexBy = sortedLastIndexBy;
  34959. lodash.sortedLastIndexOf = sortedLastIndexOf;
  34960. lodash.startCase = startCase;
  34961. lodash.startsWith = startsWith;
  34962. lodash.subtract = subtract;
  34963. lodash.sum = sum;
  34964. lodash.sumBy = sumBy;
  34965. lodash.template = template;
  34966. lodash.times = times;
  34967. lodash.toFinite = toFinite;
  34968. lodash.toInteger = toInteger;
  34969. lodash.toLength = toLength;
  34970. lodash.toLower = toLower;
  34971. lodash.toNumber = toNumber;
  34972. lodash.toSafeInteger = toSafeInteger;
  34973. lodash.toString = toString;
  34974. lodash.toUpper = toUpper;
  34975. lodash.trim = trim;
  34976. lodash.trimEnd = trimEnd;
  34977. lodash.trimStart = trimStart;
  34978. lodash.truncate = truncate;
  34979. lodash.unescape = unescape;
  34980. lodash.uniqueId = uniqueId;
  34981. lodash.upperCase = upperCase;
  34982. lodash.upperFirst = upperFirst;
  34983. // Add aliases.
  34984. lodash.each = forEach;
  34985. lodash.eachRight = forEachRight;
  34986. lodash.first = head;
  34987. mixin(lodash, (function() {
  34988. var source = {};
  34989. baseForOwn(lodash, function(func, methodName) {
  34990. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  34991. source[methodName] = func;
  34992. }
  34993. });
  34994. return source;
  34995. }()), { 'chain': false });
  34996. /*------------------------------------------------------------------------*/
  34997. /**
  34998. * The semantic version number.
  34999. *
  35000. * @static
  35001. * @memberOf _
  35002. * @type {string}
  35003. */
  35004. lodash.VERSION = VERSION;
  35005. // Assign default placeholders.
  35006. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  35007. lodash[methodName].placeholder = lodash;
  35008. });
  35009. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  35010. arrayEach(['drop', 'take'], function(methodName, index) {
  35011. LazyWrapper.prototype[methodName] = function(n) {
  35012. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  35013. var result = (this.__filtered__ && !index)
  35014. ? new LazyWrapper(this)
  35015. : this.clone();
  35016. if (result.__filtered__) {
  35017. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  35018. } else {
  35019. result.__views__.push({
  35020. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  35021. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  35022. });
  35023. }
  35024. return result;
  35025. };
  35026. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  35027. return this.reverse()[methodName](n).reverse();
  35028. };
  35029. });
  35030. // Add `LazyWrapper` methods that accept an `iteratee` value.
  35031. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  35032. var type = index + 1,
  35033. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  35034. LazyWrapper.prototype[methodName] = function(iteratee) {
  35035. var result = this.clone();
  35036. result.__iteratees__.push({
  35037. 'iteratee': getIteratee(iteratee, 3),
  35038. 'type': type
  35039. });
  35040. result.__filtered__ = result.__filtered__ || isFilter;
  35041. return result;
  35042. };
  35043. });
  35044. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  35045. arrayEach(['head', 'last'], function(methodName, index) {
  35046. var takeName = 'take' + (index ? 'Right' : '');
  35047. LazyWrapper.prototype[methodName] = function() {
  35048. return this[takeName](1).value()[0];
  35049. };
  35050. });
  35051. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  35052. arrayEach(['initial', 'tail'], function(methodName, index) {
  35053. var dropName = 'drop' + (index ? '' : 'Right');
  35054. LazyWrapper.prototype[methodName] = function() {
  35055. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  35056. };
  35057. });
  35058. LazyWrapper.prototype.compact = function() {
  35059. return this.filter(identity);
  35060. };
  35061. LazyWrapper.prototype.find = function(predicate) {
  35062. return this.filter(predicate).head();
  35063. };
  35064. LazyWrapper.prototype.findLast = function(predicate) {
  35065. return this.reverse().find(predicate);
  35066. };
  35067. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  35068. if (typeof path == 'function') {
  35069. return new LazyWrapper(this);
  35070. }
  35071. return this.map(function(value) {
  35072. return baseInvoke(value, path, args);
  35073. });
  35074. });
  35075. LazyWrapper.prototype.reject = function(predicate) {
  35076. return this.filter(negate(getIteratee(predicate)));
  35077. };
  35078. LazyWrapper.prototype.slice = function(start, end) {
  35079. start = toInteger(start);
  35080. var result = this;
  35081. if (result.__filtered__ && (start > 0 || end < 0)) {
  35082. return new LazyWrapper(result);
  35083. }
  35084. if (start < 0) {
  35085. result = result.takeRight(-start);
  35086. } else if (start) {
  35087. result = result.drop(start);
  35088. }
  35089. if (end !== undefined) {
  35090. end = toInteger(end);
  35091. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  35092. }
  35093. return result;
  35094. };
  35095. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  35096. return this.reverse().takeWhile(predicate).reverse();
  35097. };
  35098. LazyWrapper.prototype.toArray = function() {
  35099. return this.take(MAX_ARRAY_LENGTH);
  35100. };
  35101. // Add `LazyWrapper` methods to `lodash.prototype`.
  35102. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  35103. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  35104. isTaker = /^(?:head|last)$/.test(methodName),
  35105. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  35106. retUnwrapped = isTaker || /^find/.test(methodName);
  35107. if (!lodashFunc) {
  35108. return;
  35109. }
  35110. lodash.prototype[methodName] = function() {
  35111. var value = this.__wrapped__,
  35112. args = isTaker ? [1] : arguments,
  35113. isLazy = value instanceof LazyWrapper,
  35114. iteratee = args[0],
  35115. useLazy = isLazy || isArray(value);
  35116. var interceptor = function(value) {
  35117. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  35118. return (isTaker && chainAll) ? result[0] : result;
  35119. };
  35120. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  35121. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  35122. isLazy = useLazy = false;
  35123. }
  35124. var chainAll = this.__chain__,
  35125. isHybrid = !!this.__actions__.length,
  35126. isUnwrapped = retUnwrapped && !chainAll,
  35127. onlyLazy = isLazy && !isHybrid;
  35128. if (!retUnwrapped && useLazy) {
  35129. value = onlyLazy ? value : new LazyWrapper(this);
  35130. var result = func.apply(value, args);
  35131. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  35132. return new LodashWrapper(result, chainAll);
  35133. }
  35134. if (isUnwrapped && onlyLazy) {
  35135. return func.apply(this, args);
  35136. }
  35137. result = this.thru(interceptor);
  35138. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  35139. };
  35140. });
  35141. // Add `Array` methods to `lodash.prototype`.
  35142. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  35143. var func = arrayProto[methodName],
  35144. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  35145. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  35146. lodash.prototype[methodName] = function() {
  35147. var args = arguments;
  35148. if (retUnwrapped && !this.__chain__) {
  35149. var value = this.value();
  35150. return func.apply(isArray(value) ? value : [], args);
  35151. }
  35152. return this[chainName](function(value) {
  35153. return func.apply(isArray(value) ? value : [], args);
  35154. });
  35155. };
  35156. });
  35157. // Map minified method names to their real names.
  35158. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  35159. var lodashFunc = lodash[methodName];
  35160. if (lodashFunc) {
  35161. var key = lodashFunc.name + '';
  35162. if (!hasOwnProperty.call(realNames, key)) {
  35163. realNames[key] = [];
  35164. }
  35165. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  35166. }
  35167. });
  35168. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  35169. 'name': 'wrapper',
  35170. 'func': undefined
  35171. }];
  35172. // Add methods to `LazyWrapper`.
  35173. LazyWrapper.prototype.clone = lazyClone;
  35174. LazyWrapper.prototype.reverse = lazyReverse;
  35175. LazyWrapper.prototype.value = lazyValue;
  35176. // Add chain sequence methods to the `lodash` wrapper.
  35177. lodash.prototype.at = wrapperAt;
  35178. lodash.prototype.chain = wrapperChain;
  35179. lodash.prototype.commit = wrapperCommit;
  35180. lodash.prototype.next = wrapperNext;
  35181. lodash.prototype.plant = wrapperPlant;
  35182. lodash.prototype.reverse = wrapperReverse;
  35183. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  35184. // Add lazy aliases.
  35185. lodash.prototype.first = lodash.prototype.head;
  35186. if (symIterator) {
  35187. lodash.prototype[symIterator] = wrapperToIterator;
  35188. }
  35189. return lodash;
  35190. });
  35191. /*--------------------------------------------------------------------------*/
  35192. // Export lodash.
  35193. var _ = runInContext();
  35194. // Some AMD build optimizers, like r.js, check for condition patterns like:
  35195. if (true) {
  35196. // Expose Lodash on the global object to prevent errors when Lodash is
  35197. // loaded by a script tag in the presence of an AMD loader.
  35198. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  35199. // Use `_.noConflict` to remove Lodash from the global object.
  35200. root._ = _;
  35201. // Define as an anonymous module so, through path mapping, it can be
  35202. // referenced as the "underscore" module.
  35203. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  35204. return _;
  35205. }).call(exports, __webpack_require__, exports, module),
  35206. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  35207. }
  35208. // Check for `exports` after `define` in case a build optimizer adds it.
  35209. else {}
  35210. }.call(this));
  35211. /* 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)))
  35212. /***/ }),
  35213. /***/ "./node_modules/popper.js/dist/esm/popper.js":
  35214. /*!***************************************************!*\
  35215. !*** ./node_modules/popper.js/dist/esm/popper.js ***!
  35216. \***************************************************/
  35217. /*! exports provided: default */
  35218. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  35219. "use strict";
  35220. __webpack_require__.r(__webpack_exports__);
  35221. /* WEBPACK VAR INJECTION */(function(global) {/**!
  35222. * @fileOverview Kickass library to create and place poppers near their reference elements.
  35223. * @version 1.16.1
  35224. * @license
  35225. * Copyright (c) 2016 Federico Zivolo and contributors
  35226. *
  35227. * Permission is hereby granted, free of charge, to any person obtaining a copy
  35228. * of this software and associated documentation files (the "Software"), to deal
  35229. * in the Software without restriction, including without limitation the rights
  35230. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  35231. * copies of the Software, and to permit persons to whom the Software is
  35232. * furnished to do so, subject to the following conditions:
  35233. *
  35234. * The above copyright notice and this permission notice shall be included in all
  35235. * copies or substantial portions of the Software.
  35236. *
  35237. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  35238. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  35239. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  35240. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  35241. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  35242. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  35243. * SOFTWARE.
  35244. */
  35245. var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined';
  35246. var timeoutDuration = function () {
  35247. var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];
  35248. for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) {
  35249. if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {
  35250. return 1;
  35251. }
  35252. }
  35253. return 0;
  35254. }();
  35255. function microtaskDebounce(fn) {
  35256. var called = false;
  35257. return function () {
  35258. if (called) {
  35259. return;
  35260. }
  35261. called = true;
  35262. window.Promise.resolve().then(function () {
  35263. called = false;
  35264. fn();
  35265. });
  35266. };
  35267. }
  35268. function taskDebounce(fn) {
  35269. var scheduled = false;
  35270. return function () {
  35271. if (!scheduled) {
  35272. scheduled = true;
  35273. setTimeout(function () {
  35274. scheduled = false;
  35275. fn();
  35276. }, timeoutDuration);
  35277. }
  35278. };
  35279. }
  35280. var supportsMicroTasks = isBrowser && window.Promise;
  35281. /**
  35282. * Create a debounced version of a method, that's asynchronously deferred
  35283. * but called in the minimum time possible.
  35284. *
  35285. * @method
  35286. * @memberof Popper.Utils
  35287. * @argument {Function} fn
  35288. * @returns {Function}
  35289. */
  35290. var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce;
  35291. /**
  35292. * Check if the given variable is a function
  35293. * @method
  35294. * @memberof Popper.Utils
  35295. * @argument {Any} functionToCheck - variable to check
  35296. * @returns {Boolean} answer to: is a function?
  35297. */
  35298. function isFunction(functionToCheck) {
  35299. var getType = {};
  35300. return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
  35301. }
  35302. /**
  35303. * Get CSS computed property of the given element
  35304. * @method
  35305. * @memberof Popper.Utils
  35306. * @argument {Eement} element
  35307. * @argument {String} property
  35308. */
  35309. function getStyleComputedProperty(element, property) {
  35310. if (element.nodeType !== 1) {
  35311. return [];
  35312. }
  35313. // NOTE: 1 DOM access here
  35314. var window = element.ownerDocument.defaultView;
  35315. var css = window.getComputedStyle(element, null);
  35316. return property ? css[property] : css;
  35317. }
  35318. /**
  35319. * Returns the parentNode or the host of the element
  35320. * @method
  35321. * @memberof Popper.Utils
  35322. * @argument {Element} element
  35323. * @returns {Element} parent
  35324. */
  35325. function getParentNode(element) {
  35326. if (element.nodeName === 'HTML') {
  35327. return element;
  35328. }
  35329. return element.parentNode || element.host;
  35330. }
  35331. /**
  35332. * Returns the scrolling parent of the given element
  35333. * @method
  35334. * @memberof Popper.Utils
  35335. * @argument {Element} element
  35336. * @returns {Element} scroll parent
  35337. */
  35338. function getScrollParent(element) {
  35339. // Return body, `getScroll` will take care to get the correct `scrollTop` from it
  35340. if (!element) {
  35341. return document.body;
  35342. }
  35343. switch (element.nodeName) {
  35344. case 'HTML':
  35345. case 'BODY':
  35346. return element.ownerDocument.body;
  35347. case '#document':
  35348. return element.body;
  35349. }
  35350. // Firefox want us to check `-x` and `-y` variations as well
  35351. var _getStyleComputedProp = getStyleComputedProperty(element),
  35352. overflow = _getStyleComputedProp.overflow,
  35353. overflowX = _getStyleComputedProp.overflowX,
  35354. overflowY = _getStyleComputedProp.overflowY;
  35355. if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {
  35356. return element;
  35357. }
  35358. return getScrollParent(getParentNode(element));
  35359. }
  35360. /**
  35361. * Returns the reference node of the reference object, or the reference object itself.
  35362. * @method
  35363. * @memberof Popper.Utils
  35364. * @param {Element|Object} reference - the reference element (the popper will be relative to this)
  35365. * @returns {Element} parent
  35366. */
  35367. function getReferenceNode(reference) {
  35368. return reference && reference.referenceNode ? reference.referenceNode : reference;
  35369. }
  35370. var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode);
  35371. var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent);
  35372. /**
  35373. * Determines if the browser is Internet Explorer
  35374. * @method
  35375. * @memberof Popper.Utils
  35376. * @param {Number} version to check
  35377. * @returns {Boolean} isIE
  35378. */
  35379. function isIE(version) {
  35380. if (version === 11) {
  35381. return isIE11;
  35382. }
  35383. if (version === 10) {
  35384. return isIE10;
  35385. }
  35386. return isIE11 || isIE10;
  35387. }
  35388. /**
  35389. * Returns the offset parent of the given element
  35390. * @method
  35391. * @memberof Popper.Utils
  35392. * @argument {Element} element
  35393. * @returns {Element} offset parent
  35394. */
  35395. function getOffsetParent(element) {
  35396. if (!element) {
  35397. return document.documentElement;
  35398. }
  35399. var noOffsetParent = isIE(10) ? document.body : null;
  35400. // NOTE: 1 DOM access here
  35401. var offsetParent = element.offsetParent || null;
  35402. // Skip hidden elements which don't have an offsetParent
  35403. while (offsetParent === noOffsetParent && element.nextElementSibling) {
  35404. offsetParent = (element = element.nextElementSibling).offsetParent;
  35405. }
  35406. var nodeName = offsetParent && offsetParent.nodeName;
  35407. if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {
  35408. return element ? element.ownerDocument.documentElement : document.documentElement;
  35409. }
  35410. // .offsetParent will return the closest TH, TD or TABLE in case
  35411. // no offsetParent is present, I hate this job...
  35412. if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') {
  35413. return getOffsetParent(offsetParent);
  35414. }
  35415. return offsetParent;
  35416. }
  35417. function isOffsetContainer(element) {
  35418. var nodeName = element.nodeName;
  35419. if (nodeName === 'BODY') {
  35420. return false;
  35421. }
  35422. return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element;
  35423. }
  35424. /**
  35425. * Finds the root node (document, shadowDOM root) of the given element
  35426. * @method
  35427. * @memberof Popper.Utils
  35428. * @argument {Element} node
  35429. * @returns {Element} root node
  35430. */
  35431. function getRoot(node) {
  35432. if (node.parentNode !== null) {
  35433. return getRoot(node.parentNode);
  35434. }
  35435. return node;
  35436. }
  35437. /**
  35438. * Finds the offset parent common to the two provided nodes
  35439. * @method
  35440. * @memberof Popper.Utils
  35441. * @argument {Element} element1
  35442. * @argument {Element} element2
  35443. * @returns {Element} common offset parent
  35444. */
  35445. function findCommonOffsetParent(element1, element2) {
  35446. // This check is needed to avoid errors in case one of the elements isn't defined for any reason
  35447. if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {
  35448. return document.documentElement;
  35449. }
  35450. // Here we make sure to give as "start" the element that comes first in the DOM
  35451. var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING;
  35452. var start = order ? element1 : element2;
  35453. var end = order ? element2 : element1;
  35454. // Get common ancestor container
  35455. var range = document.createRange();
  35456. range.setStart(start, 0);
  35457. range.setEnd(end, 0);
  35458. var commonAncestorContainer = range.commonAncestorContainer;
  35459. // Both nodes are inside #document
  35460. if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) {
  35461. if (isOffsetContainer(commonAncestorContainer)) {
  35462. return commonAncestorContainer;
  35463. }
  35464. return getOffsetParent(commonAncestorContainer);
  35465. }
  35466. // one of the nodes is inside shadowDOM, find which one
  35467. var element1root = getRoot(element1);
  35468. if (element1root.host) {
  35469. return findCommonOffsetParent(element1root.host, element2);
  35470. } else {
  35471. return findCommonOffsetParent(element1, getRoot(element2).host);
  35472. }
  35473. }
  35474. /**
  35475. * Gets the scroll value of the given element in the given side (top and left)
  35476. * @method
  35477. * @memberof Popper.Utils
  35478. * @argument {Element} element
  35479. * @argument {String} side `top` or `left`
  35480. * @returns {number} amount of scrolled pixels
  35481. */
  35482. function getScroll(element) {
  35483. var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top';
  35484. var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';
  35485. var nodeName = element.nodeName;
  35486. if (nodeName === 'BODY' || nodeName === 'HTML') {
  35487. var html = element.ownerDocument.documentElement;
  35488. var scrollingElement = element.ownerDocument.scrollingElement || html;
  35489. return scrollingElement[upperSide];
  35490. }
  35491. return element[upperSide];
  35492. }
  35493. /*
  35494. * Sum or subtract the element scroll values (left and top) from a given rect object
  35495. * @method
  35496. * @memberof Popper.Utils
  35497. * @param {Object} rect - Rect object you want to change
  35498. * @param {HTMLElement} element - The element from the function reads the scroll values
  35499. * @param {Boolean} subtract - set to true if you want to subtract the scroll values
  35500. * @return {Object} rect - The modifier rect object
  35501. */
  35502. function includeScroll(rect, element) {
  35503. var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  35504. var scrollTop = getScroll(element, 'top');
  35505. var scrollLeft = getScroll(element, 'left');
  35506. var modifier = subtract ? -1 : 1;
  35507. rect.top += scrollTop * modifier;
  35508. rect.bottom += scrollTop * modifier;
  35509. rect.left += scrollLeft * modifier;
  35510. rect.right += scrollLeft * modifier;
  35511. return rect;
  35512. }
  35513. /*
  35514. * Helper to detect borders of a given element
  35515. * @method
  35516. * @memberof Popper.Utils
  35517. * @param {CSSStyleDeclaration} styles
  35518. * Result of `getStyleComputedProperty` on the given element
  35519. * @param {String} axis - `x` or `y`
  35520. * @return {number} borders - The borders size of the given axis
  35521. */
  35522. function getBordersSize(styles, axis) {
  35523. var sideA = axis === 'x' ? 'Left' : 'Top';
  35524. var sideB = sideA === 'Left' ? 'Right' : 'Bottom';
  35525. return parseFloat(styles['border' + sideA + 'Width']) + parseFloat(styles['border' + sideB + 'Width']);
  35526. }
  35527. function getSize(axis, body, html, computedStyle) {
  35528. 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);
  35529. }
  35530. function getWindowSizes(document) {
  35531. var body = document.body;
  35532. var html = document.documentElement;
  35533. var computedStyle = isIE(10) && getComputedStyle(html);
  35534. return {
  35535. height: getSize('Height', body, html, computedStyle),
  35536. width: getSize('Width', body, html, computedStyle)
  35537. };
  35538. }
  35539. var classCallCheck = function (instance, Constructor) {
  35540. if (!(instance instanceof Constructor)) {
  35541. throw new TypeError("Cannot call a class as a function");
  35542. }
  35543. };
  35544. var createClass = function () {
  35545. function defineProperties(target, props) {
  35546. for (var i = 0; i < props.length; i++) {
  35547. var descriptor = props[i];
  35548. descriptor.enumerable = descriptor.enumerable || false;
  35549. descriptor.configurable = true;
  35550. if ("value" in descriptor) descriptor.writable = true;
  35551. Object.defineProperty(target, descriptor.key, descriptor);
  35552. }
  35553. }
  35554. return function (Constructor, protoProps, staticProps) {
  35555. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  35556. if (staticProps) defineProperties(Constructor, staticProps);
  35557. return Constructor;
  35558. };
  35559. }();
  35560. var defineProperty = function (obj, key, value) {
  35561. if (key in obj) {
  35562. Object.defineProperty(obj, key, {
  35563. value: value,
  35564. enumerable: true,
  35565. configurable: true,
  35566. writable: true
  35567. });
  35568. } else {
  35569. obj[key] = value;
  35570. }
  35571. return obj;
  35572. };
  35573. var _extends = Object.assign || function (target) {
  35574. for (var i = 1; i < arguments.length; i++) {
  35575. var source = arguments[i];
  35576. for (var key in source) {
  35577. if (Object.prototype.hasOwnProperty.call(source, key)) {
  35578. target[key] = source[key];
  35579. }
  35580. }
  35581. }
  35582. return target;
  35583. };
  35584. /**
  35585. * Given element offsets, generate an output similar to getBoundingClientRect
  35586. * @method
  35587. * @memberof Popper.Utils
  35588. * @argument {Object} offsets
  35589. * @returns {Object} ClientRect like output
  35590. */
  35591. function getClientRect(offsets) {
  35592. return _extends({}, offsets, {
  35593. right: offsets.left + offsets.width,
  35594. bottom: offsets.top + offsets.height
  35595. });
  35596. }
  35597. /**
  35598. * Get bounding client rect of given element
  35599. * @method
  35600. * @memberof Popper.Utils
  35601. * @param {HTMLElement} element
  35602. * @return {Object} client rect
  35603. */
  35604. function getBoundingClientRect(element) {
  35605. var rect = {};
  35606. // IE10 10 FIX: Please, don't ask, the element isn't
  35607. // considered in DOM in some circumstances...
  35608. // This isn't reproducible in IE10 compatibility mode of IE11
  35609. try {
  35610. if (isIE(10)) {
  35611. rect = element.getBoundingClientRect();
  35612. var scrollTop = getScroll(element, 'top');
  35613. var scrollLeft = getScroll(element, 'left');
  35614. rect.top += scrollTop;
  35615. rect.left += scrollLeft;
  35616. rect.bottom += scrollTop;
  35617. rect.right += scrollLeft;
  35618. } else {
  35619. rect = element.getBoundingClientRect();
  35620. }
  35621. } catch (e) {}
  35622. var result = {
  35623. left: rect.left,
  35624. top: rect.top,
  35625. width: rect.right - rect.left,
  35626. height: rect.bottom - rect.top
  35627. };
  35628. // subtract scrollbar size from sizes
  35629. var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {};
  35630. var width = sizes.width || element.clientWidth || result.width;
  35631. var height = sizes.height || element.clientHeight || result.height;
  35632. var horizScrollbar = element.offsetWidth - width;
  35633. var vertScrollbar = element.offsetHeight - height;
  35634. // if an hypothetical scrollbar is detected, we must be sure it's not a `border`
  35635. // we make this check conditional for performance reasons
  35636. if (horizScrollbar || vertScrollbar) {
  35637. var styles = getStyleComputedProperty(element);
  35638. horizScrollbar -= getBordersSize(styles, 'x');
  35639. vertScrollbar -= getBordersSize(styles, 'y');
  35640. result.width -= horizScrollbar;
  35641. result.height -= vertScrollbar;
  35642. }
  35643. return getClientRect(result);
  35644. }
  35645. function getOffsetRectRelativeToArbitraryNode(children, parent) {
  35646. var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  35647. var isIE10 = isIE(10);
  35648. var isHTML = parent.nodeName === 'HTML';
  35649. var childrenRect = getBoundingClientRect(children);
  35650. var parentRect = getBoundingClientRect(parent);
  35651. var scrollParent = getScrollParent(children);
  35652. var styles = getStyleComputedProperty(parent);
  35653. var borderTopWidth = parseFloat(styles.borderTopWidth);
  35654. var borderLeftWidth = parseFloat(styles.borderLeftWidth);
  35655. // In cases where the parent is fixed, we must ignore negative scroll in offset calc
  35656. if (fixedPosition && isHTML) {
  35657. parentRect.top = Math.max(parentRect.top, 0);
  35658. parentRect.left = Math.max(parentRect.left, 0);
  35659. }
  35660. var offsets = getClientRect({
  35661. top: childrenRect.top - parentRect.top - borderTopWidth,
  35662. left: childrenRect.left - parentRect.left - borderLeftWidth,
  35663. width: childrenRect.width,
  35664. height: childrenRect.height
  35665. });
  35666. offsets.marginTop = 0;
  35667. offsets.marginLeft = 0;
  35668. // Subtract margins of documentElement in case it's being used as parent
  35669. // we do this only on HTML because it's the only element that behaves
  35670. // differently when margins are applied to it. The margins are included in
  35671. // the box of the documentElement, in the other cases not.
  35672. if (!isIE10 && isHTML) {
  35673. var marginTop = parseFloat(styles.marginTop);
  35674. var marginLeft = parseFloat(styles.marginLeft);
  35675. offsets.top -= borderTopWidth - marginTop;
  35676. offsets.bottom -= borderTopWidth - marginTop;
  35677. offsets.left -= borderLeftWidth - marginLeft;
  35678. offsets.right -= borderLeftWidth - marginLeft;
  35679. // Attach marginTop and marginLeft because in some circumstances we may need them
  35680. offsets.marginTop = marginTop;
  35681. offsets.marginLeft = marginLeft;
  35682. }
  35683. if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') {
  35684. offsets = includeScroll(offsets, parent);
  35685. }
  35686. return offsets;
  35687. }
  35688. function getViewportOffsetRectRelativeToArtbitraryNode(element) {
  35689. var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  35690. var html = element.ownerDocument.documentElement;
  35691. var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);
  35692. var width = Math.max(html.clientWidth, window.innerWidth || 0);
  35693. var height = Math.max(html.clientHeight, window.innerHeight || 0);
  35694. var scrollTop = !excludeScroll ? getScroll(html) : 0;
  35695. var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0;
  35696. var offset = {
  35697. top: scrollTop - relativeOffset.top + relativeOffset.marginTop,
  35698. left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,
  35699. width: width,
  35700. height: height
  35701. };
  35702. return getClientRect(offset);
  35703. }
  35704. /**
  35705. * Check if the given element is fixed or is inside a fixed parent
  35706. * @method
  35707. * @memberof Popper.Utils
  35708. * @argument {Element} element
  35709. * @argument {Element} customContainer
  35710. * @returns {Boolean} answer to "isFixed?"
  35711. */
  35712. function isFixed(element) {
  35713. var nodeName = element.nodeName;
  35714. if (nodeName === 'BODY' || nodeName === 'HTML') {
  35715. return false;
  35716. }
  35717. if (getStyleComputedProperty(element, 'position') === 'fixed') {
  35718. return true;
  35719. }
  35720. var parentNode = getParentNode(element);
  35721. if (!parentNode) {
  35722. return false;
  35723. }
  35724. return isFixed(parentNode);
  35725. }
  35726. /**
  35727. * Finds the first parent of an element that has a transformed property defined
  35728. * @method
  35729. * @memberof Popper.Utils
  35730. * @argument {Element} element
  35731. * @returns {Element} first transformed parent or documentElement
  35732. */
  35733. function getFixedPositionOffsetParent(element) {
  35734. // This check is needed to avoid errors in case one of the elements isn't defined for any reason
  35735. if (!element || !element.parentElement || isIE()) {
  35736. return document.documentElement;
  35737. }
  35738. var el = element.parentElement;
  35739. while (el && getStyleComputedProperty(el, 'transform') === 'none') {
  35740. el = el.parentElement;
  35741. }
  35742. return el || document.documentElement;
  35743. }
  35744. /**
  35745. * Computed the boundaries limits and return them
  35746. * @method
  35747. * @memberof Popper.Utils
  35748. * @param {HTMLElement} popper
  35749. * @param {HTMLElement} reference
  35750. * @param {number} padding
  35751. * @param {HTMLElement} boundariesElement - Element used to define the boundaries
  35752. * @param {Boolean} fixedPosition - Is in fixed position mode
  35753. * @returns {Object} Coordinates of the boundaries
  35754. */
  35755. function getBoundaries(popper, reference, padding, boundariesElement) {
  35756. var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  35757. // NOTE: 1 DOM access here
  35758. var boundaries = { top: 0, left: 0 };
  35759. var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));
  35760. // Handle viewport case
  35761. if (boundariesElement === 'viewport') {
  35762. boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition);
  35763. } else {
  35764. // Handle other cases based on DOM element used as boundaries
  35765. var boundariesNode = void 0;
  35766. if (boundariesElement === 'scrollParent') {
  35767. boundariesNode = getScrollParent(getParentNode(reference));
  35768. if (boundariesNode.nodeName === 'BODY') {
  35769. boundariesNode = popper.ownerDocument.documentElement;
  35770. }
  35771. } else if (boundariesElement === 'window') {
  35772. boundariesNode = popper.ownerDocument.documentElement;
  35773. } else {
  35774. boundariesNode = boundariesElement;
  35775. }
  35776. var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition);
  35777. // In case of HTML, we need a different computation
  35778. if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {
  35779. var _getWindowSizes = getWindowSizes(popper.ownerDocument),
  35780. height = _getWindowSizes.height,
  35781. width = _getWindowSizes.width;
  35782. boundaries.top += offsets.top - offsets.marginTop;
  35783. boundaries.bottom = height + offsets.top;
  35784. boundaries.left += offsets.left - offsets.marginLeft;
  35785. boundaries.right = width + offsets.left;
  35786. } else {
  35787. // for all the other DOM elements, this one is good
  35788. boundaries = offsets;
  35789. }
  35790. }
  35791. // Add paddings
  35792. padding = padding || 0;
  35793. var isPaddingNumber = typeof padding === 'number';
  35794. boundaries.left += isPaddingNumber ? padding : padding.left || 0;
  35795. boundaries.top += isPaddingNumber ? padding : padding.top || 0;
  35796. boundaries.right -= isPaddingNumber ? padding : padding.right || 0;
  35797. boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0;
  35798. return boundaries;
  35799. }
  35800. function getArea(_ref) {
  35801. var width = _ref.width,
  35802. height = _ref.height;
  35803. return width * height;
  35804. }
  35805. /**
  35806. * Utility used to transform the `auto` placement to the placement with more
  35807. * available space.
  35808. * @method
  35809. * @memberof Popper.Utils
  35810. * @argument {Object} data - The data object generated by update method
  35811. * @argument {Object} options - Modifiers configuration and options
  35812. * @returns {Object} The data object, properly modified
  35813. */
  35814. function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) {
  35815. var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
  35816. if (placement.indexOf('auto') === -1) {
  35817. return placement;
  35818. }
  35819. var boundaries = getBoundaries(popper, reference, padding, boundariesElement);
  35820. var rects = {
  35821. top: {
  35822. width: boundaries.width,
  35823. height: refRect.top - boundaries.top
  35824. },
  35825. right: {
  35826. width: boundaries.right - refRect.right,
  35827. height: boundaries.height
  35828. },
  35829. bottom: {
  35830. width: boundaries.width,
  35831. height: boundaries.bottom - refRect.bottom
  35832. },
  35833. left: {
  35834. width: refRect.left - boundaries.left,
  35835. height: boundaries.height
  35836. }
  35837. };
  35838. var sortedAreas = Object.keys(rects).map(function (key) {
  35839. return _extends({
  35840. key: key
  35841. }, rects[key], {
  35842. area: getArea(rects[key])
  35843. });
  35844. }).sort(function (a, b) {
  35845. return b.area - a.area;
  35846. });
  35847. var filteredAreas = sortedAreas.filter(function (_ref2) {
  35848. var width = _ref2.width,
  35849. height = _ref2.height;
  35850. return width >= popper.clientWidth && height >= popper.clientHeight;
  35851. });
  35852. var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key;
  35853. var variation = placement.split('-')[1];
  35854. return computedPlacement + (variation ? '-' + variation : '');
  35855. }
  35856. /**
  35857. * Get offsets to the reference element
  35858. * @method
  35859. * @memberof Popper.Utils
  35860. * @param {Object} state
  35861. * @param {Element} popper - the popper element
  35862. * @param {Element} reference - the reference element (the popper will be relative to this)
  35863. * @param {Element} fixedPosition - is in fixed position mode
  35864. * @returns {Object} An object containing the offsets which will be applied to the popper
  35865. */
  35866. function getReferenceOffsets(state, popper, reference) {
  35867. var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
  35868. var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));
  35869. return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition);
  35870. }
  35871. /**
  35872. * Get the outer sizes of the given element (offset size + margins)
  35873. * @method
  35874. * @memberof Popper.Utils
  35875. * @argument {Element} element
  35876. * @returns {Object} object containing width and height properties
  35877. */
  35878. function getOuterSizes(element) {
  35879. var window = element.ownerDocument.defaultView;
  35880. var styles = window.getComputedStyle(element);
  35881. var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0);
  35882. var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0);
  35883. var result = {
  35884. width: element.offsetWidth + y,
  35885. height: element.offsetHeight + x
  35886. };
  35887. return result;
  35888. }
  35889. /**
  35890. * Get the opposite placement of the given one
  35891. * @method
  35892. * @memberof Popper.Utils
  35893. * @argument {String} placement
  35894. * @returns {String} flipped placement
  35895. */
  35896. function getOppositePlacement(placement) {
  35897. var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };
  35898. return placement.replace(/left|right|bottom|top/g, function (matched) {
  35899. return hash[matched];
  35900. });
  35901. }
  35902. /**
  35903. * Get offsets to the popper
  35904. * @method
  35905. * @memberof Popper.Utils
  35906. * @param {Object} position - CSS position the Popper will get applied
  35907. * @param {HTMLElement} popper - the popper element
  35908. * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)
  35909. * @param {String} placement - one of the valid placement options
  35910. * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper
  35911. */
  35912. function getPopperOffsets(popper, referenceOffsets, placement) {
  35913. placement = placement.split('-')[0];
  35914. // Get popper node sizes
  35915. var popperRect = getOuterSizes(popper);
  35916. // Add position, width and height to our offsets object
  35917. var popperOffsets = {
  35918. width: popperRect.width,
  35919. height: popperRect.height
  35920. };
  35921. // depending by the popper placement we have to compute its offsets slightly differently
  35922. var isHoriz = ['right', 'left'].indexOf(placement) !== -1;
  35923. var mainSide = isHoriz ? 'top' : 'left';
  35924. var secondarySide = isHoriz ? 'left' : 'top';
  35925. var measurement = isHoriz ? 'height' : 'width';
  35926. var secondaryMeasurement = !isHoriz ? 'height' : 'width';
  35927. popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2;
  35928. if (placement === secondarySide) {
  35929. popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];
  35930. } else {
  35931. popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)];
  35932. }
  35933. return popperOffsets;
  35934. }
  35935. /**
  35936. * Mimics the `find` method of Array
  35937. * @method
  35938. * @memberof Popper.Utils
  35939. * @argument {Array} arr
  35940. * @argument prop
  35941. * @argument value
  35942. * @returns index or -1
  35943. */
  35944. function find(arr, check) {
  35945. // use native find if supported
  35946. if (Array.prototype.find) {
  35947. return arr.find(check);
  35948. }
  35949. // use `filter` to obtain the same behavior of `find`
  35950. return arr.filter(check)[0];
  35951. }
  35952. /**
  35953. * Return the index of the matching object
  35954. * @method
  35955. * @memberof Popper.Utils
  35956. * @argument {Array} arr
  35957. * @argument prop
  35958. * @argument value
  35959. * @returns index or -1
  35960. */
  35961. function findIndex(arr, prop, value) {
  35962. // use native findIndex if supported
  35963. if (Array.prototype.findIndex) {
  35964. return arr.findIndex(function (cur) {
  35965. return cur[prop] === value;
  35966. });
  35967. }
  35968. // use `find` + `indexOf` if `findIndex` isn't supported
  35969. var match = find(arr, function (obj) {
  35970. return obj[prop] === value;
  35971. });
  35972. return arr.indexOf(match);
  35973. }
  35974. /**
  35975. * Loop trough the list of modifiers and run them in order,
  35976. * each of them will then edit the data object.
  35977. * @method
  35978. * @memberof Popper.Utils
  35979. * @param {dataObject} data
  35980. * @param {Array} modifiers
  35981. * @param {String} ends - Optional modifier name used as stopper
  35982. * @returns {dataObject}
  35983. */
  35984. function runModifiers(modifiers, data, ends) {
  35985. var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends));
  35986. modifiersToRun.forEach(function (modifier) {
  35987. if (modifier['function']) {
  35988. // eslint-disable-line dot-notation
  35989. console.warn('`modifier.function` is deprecated, use `modifier.fn`!');
  35990. }
  35991. var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation
  35992. if (modifier.enabled && isFunction(fn)) {
  35993. // Add properties to offsets to make them a complete clientRect object
  35994. // we do this before each modifier to make sure the previous one doesn't
  35995. // mess with these values
  35996. data.offsets.popper = getClientRect(data.offsets.popper);
  35997. data.offsets.reference = getClientRect(data.offsets.reference);
  35998. data = fn(data, modifier);
  35999. }
  36000. });
  36001. return data;
  36002. }
  36003. /**
  36004. * Updates the position of the popper, computing the new offsets and applying
  36005. * the new style.<br />
  36006. * Prefer `scheduleUpdate` over `update` because of performance reasons.
  36007. * @method
  36008. * @memberof Popper
  36009. */
  36010. function update() {
  36011. // if popper is destroyed, don't perform any further update
  36012. if (this.state.isDestroyed) {
  36013. return;
  36014. }
  36015. var data = {
  36016. instance: this,
  36017. styles: {},
  36018. arrowStyles: {},
  36019. attributes: {},
  36020. flipped: false,
  36021. offsets: {}
  36022. };
  36023. // compute reference element offsets
  36024. data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);
  36025. // compute auto placement, store placement inside the data object,
  36026. // modifiers will be able to edit `placement` if needed
  36027. // and refer to originalPlacement to know the original value
  36028. data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);
  36029. // store the computed placement inside `originalPlacement`
  36030. data.originalPlacement = data.placement;
  36031. data.positionFixed = this.options.positionFixed;
  36032. // compute the popper offsets
  36033. data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);
  36034. data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';
  36035. // run the modifiers
  36036. data = runModifiers(this.modifiers, data);
  36037. // the first `update` will call `onCreate` callback
  36038. // the other ones will call `onUpdate` callback
  36039. if (!this.state.isCreated) {
  36040. this.state.isCreated = true;
  36041. this.options.onCreate(data);
  36042. } else {
  36043. this.options.onUpdate(data);
  36044. }
  36045. }
  36046. /**
  36047. * Helper used to know if the given modifier is enabled.
  36048. * @method
  36049. * @memberof Popper.Utils
  36050. * @returns {Boolean}
  36051. */
  36052. function isModifierEnabled(modifiers, modifierName) {
  36053. return modifiers.some(function (_ref) {
  36054. var name = _ref.name,
  36055. enabled = _ref.enabled;
  36056. return enabled && name === modifierName;
  36057. });
  36058. }
  36059. /**
  36060. * Get the prefixed supported property name
  36061. * @method
  36062. * @memberof Popper.Utils
  36063. * @argument {String} property (camelCase)
  36064. * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix)
  36065. */
  36066. function getSupportedPropertyName(property) {
  36067. var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];
  36068. var upperProp = property.charAt(0).toUpperCase() + property.slice(1);
  36069. for (var i = 0; i < prefixes.length; i++) {
  36070. var prefix = prefixes[i];
  36071. var toCheck = prefix ? '' + prefix + upperProp : property;
  36072. if (typeof document.body.style[toCheck] !== 'undefined') {
  36073. return toCheck;
  36074. }
  36075. }
  36076. return null;
  36077. }
  36078. /**
  36079. * Destroys the popper.
  36080. * @method
  36081. * @memberof Popper
  36082. */
  36083. function destroy() {
  36084. this.state.isDestroyed = true;
  36085. // touch DOM only if `applyStyle` modifier is enabled
  36086. if (isModifierEnabled(this.modifiers, 'applyStyle')) {
  36087. this.popper.removeAttribute('x-placement');
  36088. this.popper.style.position = '';
  36089. this.popper.style.top = '';
  36090. this.popper.style.left = '';
  36091. this.popper.style.right = '';
  36092. this.popper.style.bottom = '';
  36093. this.popper.style.willChange = '';
  36094. this.popper.style[getSupportedPropertyName('transform')] = '';
  36095. }
  36096. this.disableEventListeners();
  36097. // remove the popper if user explicitly asked for the deletion on destroy
  36098. // do not use `remove` because IE11 doesn't support it
  36099. if (this.options.removeOnDestroy) {
  36100. this.popper.parentNode.removeChild(this.popper);
  36101. }
  36102. return this;
  36103. }
  36104. /**
  36105. * Get the window associated with the element
  36106. * @argument {Element} element
  36107. * @returns {Window}
  36108. */
  36109. function getWindow(element) {
  36110. var ownerDocument = element.ownerDocument;
  36111. return ownerDocument ? ownerDocument.defaultView : window;
  36112. }
  36113. function attachToScrollParents(scrollParent, event, callback, scrollParents) {
  36114. var isBody = scrollParent.nodeName === 'BODY';
  36115. var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;
  36116. target.addEventListener(event, callback, { passive: true });
  36117. if (!isBody) {
  36118. attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents);
  36119. }
  36120. scrollParents.push(target);
  36121. }
  36122. /**
  36123. * Setup needed event listeners used to update the popper position
  36124. * @method
  36125. * @memberof Popper.Utils
  36126. * @private
  36127. */
  36128. function setupEventListeners(reference, options, state, updateBound) {
  36129. // Resize event listener on window
  36130. state.updateBound = updateBound;
  36131. getWindow(reference).addEventListener('resize', state.updateBound, { passive: true });
  36132. // Scroll event listener on scroll parents
  36133. var scrollElement = getScrollParent(reference);
  36134. attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents);
  36135. state.scrollElement = scrollElement;
  36136. state.eventsEnabled = true;
  36137. return state;
  36138. }
  36139. /**
  36140. * It will add resize/scroll events and start recalculating
  36141. * position of the popper element when they are triggered.
  36142. * @method
  36143. * @memberof Popper
  36144. */
  36145. function enableEventListeners() {
  36146. if (!this.state.eventsEnabled) {
  36147. this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate);
  36148. }
  36149. }
  36150. /**
  36151. * Remove event listeners used to update the popper position
  36152. * @method
  36153. * @memberof Popper.Utils
  36154. * @private
  36155. */
  36156. function removeEventListeners(reference, state) {
  36157. // Remove resize event listener on window
  36158. getWindow(reference).removeEventListener('resize', state.updateBound);
  36159. // Remove scroll event listener on scroll parents
  36160. state.scrollParents.forEach(function (target) {
  36161. target.removeEventListener('scroll', state.updateBound);
  36162. });
  36163. // Reset state
  36164. state.updateBound = null;
  36165. state.scrollParents = [];
  36166. state.scrollElement = null;
  36167. state.eventsEnabled = false;
  36168. return state;
  36169. }
  36170. /**
  36171. * It will remove resize/scroll events and won't recalculate popper position
  36172. * when they are triggered. It also won't trigger `onUpdate` callback anymore,
  36173. * unless you call `update` method manually.
  36174. * @method
  36175. * @memberof Popper
  36176. */
  36177. function disableEventListeners() {
  36178. if (this.state.eventsEnabled) {
  36179. cancelAnimationFrame(this.scheduleUpdate);
  36180. this.state = removeEventListeners(this.reference, this.state);
  36181. }
  36182. }
  36183. /**
  36184. * Tells if a given input is a number
  36185. * @method
  36186. * @memberof Popper.Utils
  36187. * @param {*} input to check
  36188. * @return {Boolean}
  36189. */
  36190. function isNumeric(n) {
  36191. return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);
  36192. }
  36193. /**
  36194. * Set the style to the given popper
  36195. * @method
  36196. * @memberof Popper.Utils
  36197. * @argument {Element} element - Element to apply the style to
  36198. * @argument {Object} styles
  36199. * Object with a list of properties and values which will be applied to the element
  36200. */
  36201. function setStyles(element, styles) {
  36202. Object.keys(styles).forEach(function (prop) {
  36203. var unit = '';
  36204. // add unit if the value is numeric and is one of the following
  36205. if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) {
  36206. unit = 'px';
  36207. }
  36208. element.style[prop] = styles[prop] + unit;
  36209. });
  36210. }
  36211. /**
  36212. * Set the attributes to the given popper
  36213. * @method
  36214. * @memberof Popper.Utils
  36215. * @argument {Element} element - Element to apply the attributes to
  36216. * @argument {Object} styles
  36217. * Object with a list of properties and values which will be applied to the element
  36218. */
  36219. function setAttributes(element, attributes) {
  36220. Object.keys(attributes).forEach(function (prop) {
  36221. var value = attributes[prop];
  36222. if (value !== false) {
  36223. element.setAttribute(prop, attributes[prop]);
  36224. } else {
  36225. element.removeAttribute(prop);
  36226. }
  36227. });
  36228. }
  36229. /**
  36230. * @function
  36231. * @memberof Modifiers
  36232. * @argument {Object} data - The data object generated by `update` method
  36233. * @argument {Object} data.styles - List of style properties - values to apply to popper element
  36234. * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element
  36235. * @argument {Object} options - Modifiers configuration and options
  36236. * @returns {Object} The same data object
  36237. */
  36238. function applyStyle(data) {
  36239. // any property present in `data.styles` will be applied to the popper,
  36240. // in this way we can make the 3rd party modifiers add custom styles to it
  36241. // Be aware, modifiers could override the properties defined in the previous
  36242. // lines of this modifier!
  36243. setStyles(data.instance.popper, data.styles);
  36244. // any property present in `data.attributes` will be applied to the popper,
  36245. // they will be set as HTML attributes of the element
  36246. setAttributes(data.instance.popper, data.attributes);
  36247. // if arrowElement is defined and arrowStyles has some properties
  36248. if (data.arrowElement && Object.keys(data.arrowStyles).length) {
  36249. setStyles(data.arrowElement, data.arrowStyles);
  36250. }
  36251. return data;
  36252. }
  36253. /**
  36254. * Set the x-placement attribute before everything else because it could be used
  36255. * to add margins to the popper margins needs to be calculated to get the
  36256. * correct popper offsets.
  36257. * @method
  36258. * @memberof Popper.modifiers
  36259. * @param {HTMLElement} reference - The reference element used to position the popper
  36260. * @param {HTMLElement} popper - The HTML element used as popper
  36261. * @param {Object} options - Popper.js options
  36262. */
  36263. function applyStyleOnLoad(reference, popper, options, modifierOptions, state) {
  36264. // compute reference element offsets
  36265. var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed);
  36266. // compute auto placement, store placement inside the data object,
  36267. // modifiers will be able to edit `placement` if needed
  36268. // and refer to originalPlacement to know the original value
  36269. var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding);
  36270. popper.setAttribute('x-placement', placement);
  36271. // Apply `position` to popper before anything else because
  36272. // without the position applied we can't guarantee correct computations
  36273. setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' });
  36274. return options;
  36275. }
  36276. /**
  36277. * @function
  36278. * @memberof Popper.Utils
  36279. * @argument {Object} data - The data object generated by `update` method
  36280. * @argument {Boolean} shouldRound - If the offsets should be rounded at all
  36281. * @returns {Object} The popper's position offsets rounded
  36282. *
  36283. * The tale of pixel-perfect positioning. It's still not 100% perfect, but as
  36284. * good as it can be within reason.
  36285. * Discussion here: https://github.com/FezVrasta/popper.js/pull/715
  36286. *
  36287. * Low DPI screens cause a popper to be blurry if not using full pixels (Safari
  36288. * as well on High DPI screens).
  36289. *
  36290. * Firefox prefers no rounding for positioning and does not have blurriness on
  36291. * high DPI screens.
  36292. *
  36293. * Only horizontal placement and left/right values need to be considered.
  36294. */
  36295. function getRoundedOffsets(data, shouldRound) {
  36296. var _data$offsets = data.offsets,
  36297. popper = _data$offsets.popper,
  36298. reference = _data$offsets.reference;
  36299. var round = Math.round,
  36300. floor = Math.floor;
  36301. var noRound = function noRound(v) {
  36302. return v;
  36303. };
  36304. var referenceWidth = round(reference.width);
  36305. var popperWidth = round(popper.width);
  36306. var isVertical = ['left', 'right'].indexOf(data.placement) !== -1;
  36307. var isVariation = data.placement.indexOf('-') !== -1;
  36308. var sameWidthParity = referenceWidth % 2 === popperWidth % 2;
  36309. var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1;
  36310. var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor;
  36311. var verticalToInteger = !shouldRound ? noRound : round;
  36312. return {
  36313. left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left),
  36314. top: verticalToInteger(popper.top),
  36315. bottom: verticalToInteger(popper.bottom),
  36316. right: horizontalToInteger(popper.right)
  36317. };
  36318. }
  36319. var isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent);
  36320. /**
  36321. * @function
  36322. * @memberof Modifiers
  36323. * @argument {Object} data - The data object generated by `update` method
  36324. * @argument {Object} options - Modifiers configuration and options
  36325. * @returns {Object} The data object, properly modified
  36326. */
  36327. function computeStyle(data, options) {
  36328. var x = options.x,
  36329. y = options.y;
  36330. var popper = data.offsets.popper;
  36331. // Remove this legacy support in Popper.js v2
  36332. var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) {
  36333. return modifier.name === 'applyStyle';
  36334. }).gpuAcceleration;
  36335. if (legacyGpuAccelerationOption !== undefined) {
  36336. console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');
  36337. }
  36338. var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration;
  36339. var offsetParent = getOffsetParent(data.instance.popper);
  36340. var offsetParentRect = getBoundingClientRect(offsetParent);
  36341. // Styles
  36342. var styles = {
  36343. position: popper.position
  36344. };
  36345. var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox);
  36346. var sideA = x === 'bottom' ? 'top' : 'bottom';
  36347. var sideB = y === 'right' ? 'left' : 'right';
  36348. // if gpuAcceleration is set to `true` and transform is supported,
  36349. // we use `translate3d` to apply the position to the popper we
  36350. // automatically use the supported prefixed version if needed
  36351. var prefixedProperty = getSupportedPropertyName('transform');
  36352. // now, let's make a step back and look at this code closely (wtf?)
  36353. // If the content of the popper grows once it's been positioned, it
  36354. // may happen that the popper gets misplaced because of the new content
  36355. // overflowing its reference element
  36356. // To avoid this problem, we provide two options (x and y), which allow
  36357. // the consumer to define the offset origin.
  36358. // If we position a popper on top of a reference element, we can set
  36359. // `x` to `top` to make the popper grow towards its top instead of
  36360. // its bottom.
  36361. var left = void 0,
  36362. top = void 0;
  36363. if (sideA === 'bottom') {
  36364. // when offsetParent is <html> the positioning is relative to the bottom of the screen (excluding the scrollbar)
  36365. // and not the bottom of the html element
  36366. if (offsetParent.nodeName === 'HTML') {
  36367. top = -offsetParent.clientHeight + offsets.bottom;
  36368. } else {
  36369. top = -offsetParentRect.height + offsets.bottom;
  36370. }
  36371. } else {
  36372. top = offsets.top;
  36373. }
  36374. if (sideB === 'right') {
  36375. if (offsetParent.nodeName === 'HTML') {
  36376. left = -offsetParent.clientWidth + offsets.right;
  36377. } else {
  36378. left = -offsetParentRect.width + offsets.right;
  36379. }
  36380. } else {
  36381. left = offsets.left;
  36382. }
  36383. if (gpuAcceleration && prefixedProperty) {
  36384. styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';
  36385. styles[sideA] = 0;
  36386. styles[sideB] = 0;
  36387. styles.willChange = 'transform';
  36388. } else {
  36389. // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties
  36390. var invertTop = sideA === 'bottom' ? -1 : 1;
  36391. var invertLeft = sideB === 'right' ? -1 : 1;
  36392. styles[sideA] = top * invertTop;
  36393. styles[sideB] = left * invertLeft;
  36394. styles.willChange = sideA + ', ' + sideB;
  36395. }
  36396. // Attributes
  36397. var attributes = {
  36398. 'x-placement': data.placement
  36399. };
  36400. // Update `data` attributes, styles and arrowStyles
  36401. data.attributes = _extends({}, attributes, data.attributes);
  36402. data.styles = _extends({}, styles, data.styles);
  36403. data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles);
  36404. return data;
  36405. }
  36406. /**
  36407. * Helper used to know if the given modifier depends from another one.<br />
  36408. * It checks if the needed modifier is listed and enabled.
  36409. * @method
  36410. * @memberof Popper.Utils
  36411. * @param {Array} modifiers - list of modifiers
  36412. * @param {String} requestingName - name of requesting modifier
  36413. * @param {String} requestedName - name of requested modifier
  36414. * @returns {Boolean}
  36415. */
  36416. function isModifierRequired(modifiers, requestingName, requestedName) {
  36417. var requesting = find(modifiers, function (_ref) {
  36418. var name = _ref.name;
  36419. return name === requestingName;
  36420. });
  36421. var isRequired = !!requesting && modifiers.some(function (modifier) {
  36422. return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order;
  36423. });
  36424. if (!isRequired) {
  36425. var _requesting = '`' + requestingName + '`';
  36426. var requested = '`' + requestedName + '`';
  36427. console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!');
  36428. }
  36429. return isRequired;
  36430. }
  36431. /**
  36432. * @function
  36433. * @memberof Modifiers
  36434. * @argument {Object} data - The data object generated by update method
  36435. * @argument {Object} options - Modifiers configuration and options
  36436. * @returns {Object} The data object, properly modified
  36437. */
  36438. function arrow(data, options) {
  36439. var _data$offsets$arrow;
  36440. // arrow depends on keepTogether in order to work
  36441. if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {
  36442. return data;
  36443. }
  36444. var arrowElement = options.element;
  36445. // if arrowElement is a string, suppose it's a CSS selector
  36446. if (typeof arrowElement === 'string') {
  36447. arrowElement = data.instance.popper.querySelector(arrowElement);
  36448. // if arrowElement is not found, don't run the modifier
  36449. if (!arrowElement) {
  36450. return data;
  36451. }
  36452. } else {
  36453. // if the arrowElement isn't a query selector we must check that the
  36454. // provided DOM node is child of its popper node
  36455. if (!data.instance.popper.contains(arrowElement)) {
  36456. console.warn('WARNING: `arrow.element` must be child of its popper element!');
  36457. return data;
  36458. }
  36459. }
  36460. var placement = data.placement.split('-')[0];
  36461. var _data$offsets = data.offsets,
  36462. popper = _data$offsets.popper,
  36463. reference = _data$offsets.reference;
  36464. var isVertical = ['left', 'right'].indexOf(placement) !== -1;
  36465. var len = isVertical ? 'height' : 'width';
  36466. var sideCapitalized = isVertical ? 'Top' : 'Left';
  36467. var side = sideCapitalized.toLowerCase();
  36468. var altSide = isVertical ? 'left' : 'top';
  36469. var opSide = isVertical ? 'bottom' : 'right';
  36470. var arrowElementSize = getOuterSizes(arrowElement)[len];
  36471. //
  36472. // extends keepTogether behavior making sure the popper and its
  36473. // reference have enough pixels in conjunction
  36474. //
  36475. // top/left side
  36476. if (reference[opSide] - arrowElementSize < popper[side]) {
  36477. data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize);
  36478. }
  36479. // bottom/right side
  36480. if (reference[side] + arrowElementSize > popper[opSide]) {
  36481. data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide];
  36482. }
  36483. data.offsets.popper = getClientRect(data.offsets.popper);
  36484. // compute center of the popper
  36485. var center = reference[side] + reference[len] / 2 - arrowElementSize / 2;
  36486. // Compute the sideValue using the updated popper offsets
  36487. // take popper margin in account because we don't have this info available
  36488. var css = getStyleComputedProperty(data.instance.popper);
  36489. var popperMarginSide = parseFloat(css['margin' + sideCapitalized]);
  36490. var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width']);
  36491. var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide;
  36492. // prevent arrowElement from being placed not contiguously to its popper
  36493. sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);
  36494. data.arrowElement = arrowElement;
  36495. data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow);
  36496. return data;
  36497. }
  36498. /**
  36499. * Get the opposite placement variation of the given one
  36500. * @method
  36501. * @memberof Popper.Utils
  36502. * @argument {String} placement variation
  36503. * @returns {String} flipped placement variation
  36504. */
  36505. function getOppositeVariation(variation) {
  36506. if (variation === 'end') {
  36507. return 'start';
  36508. } else if (variation === 'start') {
  36509. return 'end';
  36510. }
  36511. return variation;
  36512. }
  36513. /**
  36514. * List of accepted placements to use as values of the `placement` option.<br />
  36515. * Valid placements are:
  36516. * - `auto`
  36517. * - `top`
  36518. * - `right`
  36519. * - `bottom`
  36520. * - `left`
  36521. *
  36522. * Each placement can have a variation from this list:
  36523. * - `-start`
  36524. * - `-end`
  36525. *
  36526. * Variations are interpreted easily if you think of them as the left to right
  36527. * written languages. Horizontally (`top` and `bottom`), `start` is left and `end`
  36528. * is right.<br />
  36529. * Vertically (`left` and `right`), `start` is top and `end` is bottom.
  36530. *
  36531. * Some valid examples are:
  36532. * - `top-end` (on top of reference, right aligned)
  36533. * - `right-start` (on right of reference, top aligned)
  36534. * - `bottom` (on bottom, centered)
  36535. * - `auto-end` (on the side with more space available, alignment depends by placement)
  36536. *
  36537. * @static
  36538. * @type {Array}
  36539. * @enum {String}
  36540. * @readonly
  36541. * @method placements
  36542. * @memberof Popper
  36543. */
  36544. 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'];
  36545. // Get rid of `auto` `auto-start` and `auto-end`
  36546. var validPlacements = placements.slice(3);
  36547. /**
  36548. * Given an initial placement, returns all the subsequent placements
  36549. * clockwise (or counter-clockwise).
  36550. *
  36551. * @method
  36552. * @memberof Popper.Utils
  36553. * @argument {String} placement - A valid placement (it accepts variations)
  36554. * @argument {Boolean} counter - Set to true to walk the placements counterclockwise
  36555. * @returns {Array} placements including their variations
  36556. */
  36557. function clockwise(placement) {
  36558. var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  36559. var index = validPlacements.indexOf(placement);
  36560. var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));
  36561. return counter ? arr.reverse() : arr;
  36562. }
  36563. var BEHAVIORS = {
  36564. FLIP: 'flip',
  36565. CLOCKWISE: 'clockwise',
  36566. COUNTERCLOCKWISE: 'counterclockwise'
  36567. };
  36568. /**
  36569. * @function
  36570. * @memberof Modifiers
  36571. * @argument {Object} data - The data object generated by update method
  36572. * @argument {Object} options - Modifiers configuration and options
  36573. * @returns {Object} The data object, properly modified
  36574. */
  36575. function flip(data, options) {
  36576. // if `inner` modifier is enabled, we can't use the `flip` modifier
  36577. if (isModifierEnabled(data.instance.modifiers, 'inner')) {
  36578. return data;
  36579. }
  36580. if (data.flipped && data.placement === data.originalPlacement) {
  36581. // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides
  36582. return data;
  36583. }
  36584. var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed);
  36585. var placement = data.placement.split('-')[0];
  36586. var placementOpposite = getOppositePlacement(placement);
  36587. var variation = data.placement.split('-')[1] || '';
  36588. var flipOrder = [];
  36589. switch (options.behavior) {
  36590. case BEHAVIORS.FLIP:
  36591. flipOrder = [placement, placementOpposite];
  36592. break;
  36593. case BEHAVIORS.CLOCKWISE:
  36594. flipOrder = clockwise(placement);
  36595. break;
  36596. case BEHAVIORS.COUNTERCLOCKWISE:
  36597. flipOrder = clockwise(placement, true);
  36598. break;
  36599. default:
  36600. flipOrder = options.behavior;
  36601. }
  36602. flipOrder.forEach(function (step, index) {
  36603. if (placement !== step || flipOrder.length === index + 1) {
  36604. return data;
  36605. }
  36606. placement = data.placement.split('-')[0];
  36607. placementOpposite = getOppositePlacement(placement);
  36608. var popperOffsets = data.offsets.popper;
  36609. var refOffsets = data.offsets.reference;
  36610. // using floor because the reference offsets may contain decimals we are not going to consider here
  36611. var floor = Math.floor;
  36612. 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);
  36613. var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);
  36614. var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);
  36615. var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);
  36616. var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom);
  36617. var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom;
  36618. // flip the variation if required
  36619. var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
  36620. // flips variation if reference element overflows boundaries
  36621. var flippedVariationByRef = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom);
  36622. // flips variation if popper content overflows boundaries
  36623. var flippedVariationByContent = !!options.flipVariationsByContent && (isVertical && variation === 'start' && overflowsRight || isVertical && variation === 'end' && overflowsLeft || !isVertical && variation === 'start' && overflowsBottom || !isVertical && variation === 'end' && overflowsTop);
  36624. var flippedVariation = flippedVariationByRef || flippedVariationByContent;
  36625. if (overlapsRef || overflowsBoundaries || flippedVariation) {
  36626. // this boolean to detect any flip loop
  36627. data.flipped = true;
  36628. if (overlapsRef || overflowsBoundaries) {
  36629. placement = flipOrder[index + 1];
  36630. }
  36631. if (flippedVariation) {
  36632. variation = getOppositeVariation(variation);
  36633. }
  36634. data.placement = placement + (variation ? '-' + variation : '');
  36635. // this object contains `position`, we want to preserve it along with
  36636. // any additional property we may add in the future
  36637. data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));
  36638. data = runModifiers(data.instance.modifiers, data, 'flip');
  36639. }
  36640. });
  36641. return data;
  36642. }
  36643. /**
  36644. * @function
  36645. * @memberof Modifiers
  36646. * @argument {Object} data - The data object generated by update method
  36647. * @argument {Object} options - Modifiers configuration and options
  36648. * @returns {Object} The data object, properly modified
  36649. */
  36650. function keepTogether(data) {
  36651. var _data$offsets = data.offsets,
  36652. popper = _data$offsets.popper,
  36653. reference = _data$offsets.reference;
  36654. var placement = data.placement.split('-')[0];
  36655. var floor = Math.floor;
  36656. var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
  36657. var side = isVertical ? 'right' : 'bottom';
  36658. var opSide = isVertical ? 'left' : 'top';
  36659. var measurement = isVertical ? 'width' : 'height';
  36660. if (popper[side] < floor(reference[opSide])) {
  36661. data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement];
  36662. }
  36663. if (popper[opSide] > floor(reference[side])) {
  36664. data.offsets.popper[opSide] = floor(reference[side]);
  36665. }
  36666. return data;
  36667. }
  36668. /**
  36669. * Converts a string containing value + unit into a px value number
  36670. * @function
  36671. * @memberof {modifiers~offset}
  36672. * @private
  36673. * @argument {String} str - Value + unit string
  36674. * @argument {String} measurement - `height` or `width`
  36675. * @argument {Object} popperOffsets
  36676. * @argument {Object} referenceOffsets
  36677. * @returns {Number|String}
  36678. * Value in pixels, or original string if no values were extracted
  36679. */
  36680. function toValue(str, measurement, popperOffsets, referenceOffsets) {
  36681. // separate value from unit
  36682. var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/);
  36683. var value = +split[1];
  36684. var unit = split[2];
  36685. // If it's not a number it's an operator, I guess
  36686. if (!value) {
  36687. return str;
  36688. }
  36689. if (unit.indexOf('%') === 0) {
  36690. var element = void 0;
  36691. switch (unit) {
  36692. case '%p':
  36693. element = popperOffsets;
  36694. break;
  36695. case '%':
  36696. case '%r':
  36697. default:
  36698. element = referenceOffsets;
  36699. }
  36700. var rect = getClientRect(element);
  36701. return rect[measurement] / 100 * value;
  36702. } else if (unit === 'vh' || unit === 'vw') {
  36703. // if is a vh or vw, we calculate the size based on the viewport
  36704. var size = void 0;
  36705. if (unit === 'vh') {
  36706. size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
  36707. } else {
  36708. size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
  36709. }
  36710. return size / 100 * value;
  36711. } else {
  36712. // if is an explicit pixel unit, we get rid of the unit and keep the value
  36713. // if is an implicit unit, it's px, and we return just the value
  36714. return value;
  36715. }
  36716. }
  36717. /**
  36718. * Parse an `offset` string to extrapolate `x` and `y` numeric offsets.
  36719. * @function
  36720. * @memberof {modifiers~offset}
  36721. * @private
  36722. * @argument {String} offset
  36723. * @argument {Object} popperOffsets
  36724. * @argument {Object} referenceOffsets
  36725. * @argument {String} basePlacement
  36726. * @returns {Array} a two cells array with x and y offsets in numbers
  36727. */
  36728. function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) {
  36729. var offsets = [0, 0];
  36730. // Use height if placement is left or right and index is 0 otherwise use width
  36731. // in this way the first offset will use an axis and the second one
  36732. // will use the other one
  36733. var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1;
  36734. // Split the offset string to obtain a list of values and operands
  36735. // The regex addresses values with the plus or minus sign in front (+10, -20, etc)
  36736. var fragments = offset.split(/(\+|\-)/).map(function (frag) {
  36737. return frag.trim();
  36738. });
  36739. // Detect if the offset string contains a pair of values or a single one
  36740. // they could be separated by comma or space
  36741. var divider = fragments.indexOf(find(fragments, function (frag) {
  36742. return frag.search(/,|\s/) !== -1;
  36743. }));
  36744. if (fragments[divider] && fragments[divider].indexOf(',') === -1) {
  36745. console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');
  36746. }
  36747. // If divider is found, we divide the list of values and operands to divide
  36748. // them by ofset X and Y.
  36749. var splitRegex = /\s*,\s*|\s+/;
  36750. 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];
  36751. // Convert the values with units to absolute pixels to allow our computations
  36752. ops = ops.map(function (op, index) {
  36753. // Most of the units rely on the orientation of the popper
  36754. var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width';
  36755. var mergeWithPrevious = false;
  36756. return op
  36757. // This aggregates any `+` or `-` sign that aren't considered operators
  36758. // e.g.: 10 + +5 => [10, +, +5]
  36759. .reduce(function (a, b) {
  36760. if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {
  36761. a[a.length - 1] = b;
  36762. mergeWithPrevious = true;
  36763. return a;
  36764. } else if (mergeWithPrevious) {
  36765. a[a.length - 1] += b;
  36766. mergeWithPrevious = false;
  36767. return a;
  36768. } else {
  36769. return a.concat(b);
  36770. }
  36771. }, [])
  36772. // Here we convert the string values into number values (in px)
  36773. .map(function (str) {
  36774. return toValue(str, measurement, popperOffsets, referenceOffsets);
  36775. });
  36776. });
  36777. // Loop trough the offsets arrays and execute the operations
  36778. ops.forEach(function (op, index) {
  36779. op.forEach(function (frag, index2) {
  36780. if (isNumeric(frag)) {
  36781. offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);
  36782. }
  36783. });
  36784. });
  36785. return offsets;
  36786. }
  36787. /**
  36788. * @function
  36789. * @memberof Modifiers
  36790. * @argument {Object} data - The data object generated by update method
  36791. * @argument {Object} options - Modifiers configuration and options
  36792. * @argument {Number|String} options.offset=0
  36793. * The offset value as described in the modifier description
  36794. * @returns {Object} The data object, properly modified
  36795. */
  36796. function offset(data, _ref) {
  36797. var offset = _ref.offset;
  36798. var placement = data.placement,
  36799. _data$offsets = data.offsets,
  36800. popper = _data$offsets.popper,
  36801. reference = _data$offsets.reference;
  36802. var basePlacement = placement.split('-')[0];
  36803. var offsets = void 0;
  36804. if (isNumeric(+offset)) {
  36805. offsets = [+offset, 0];
  36806. } else {
  36807. offsets = parseOffset(offset, popper, reference, basePlacement);
  36808. }
  36809. if (basePlacement === 'left') {
  36810. popper.top += offsets[0];
  36811. popper.left -= offsets[1];
  36812. } else if (basePlacement === 'right') {
  36813. popper.top += offsets[0];
  36814. popper.left += offsets[1];
  36815. } else if (basePlacement === 'top') {
  36816. popper.left += offsets[0];
  36817. popper.top -= offsets[1];
  36818. } else if (basePlacement === 'bottom') {
  36819. popper.left += offsets[0];
  36820. popper.top += offsets[1];
  36821. }
  36822. data.popper = popper;
  36823. return data;
  36824. }
  36825. /**
  36826. * @function
  36827. * @memberof Modifiers
  36828. * @argument {Object} data - The data object generated by `update` method
  36829. * @argument {Object} options - Modifiers configuration and options
  36830. * @returns {Object} The data object, properly modified
  36831. */
  36832. function preventOverflow(data, options) {
  36833. var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper);
  36834. // If offsetParent is the reference element, we really want to
  36835. // go one step up and use the next offsetParent as reference to
  36836. // avoid to make this modifier completely useless and look like broken
  36837. if (data.instance.reference === boundariesElement) {
  36838. boundariesElement = getOffsetParent(boundariesElement);
  36839. }
  36840. // NOTE: DOM access here
  36841. // resets the popper's position so that the document size can be calculated excluding
  36842. // the size of the popper element itself
  36843. var transformProp = getSupportedPropertyName('transform');
  36844. var popperStyles = data.instance.popper.style; // assignment to help minification
  36845. var top = popperStyles.top,
  36846. left = popperStyles.left,
  36847. transform = popperStyles[transformProp];
  36848. popperStyles.top = '';
  36849. popperStyles.left = '';
  36850. popperStyles[transformProp] = '';
  36851. var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed);
  36852. // NOTE: DOM access here
  36853. // restores the original style properties after the offsets have been computed
  36854. popperStyles.top = top;
  36855. popperStyles.left = left;
  36856. popperStyles[transformProp] = transform;
  36857. options.boundaries = boundaries;
  36858. var order = options.priority;
  36859. var popper = data.offsets.popper;
  36860. var check = {
  36861. primary: function primary(placement) {
  36862. var value = popper[placement];
  36863. if (popper[placement] < boundaries[placement] && !options.escapeWithReference) {
  36864. value = Math.max(popper[placement], boundaries[placement]);
  36865. }
  36866. return defineProperty({}, placement, value);
  36867. },
  36868. secondary: function secondary(placement) {
  36869. var mainSide = placement === 'right' ? 'left' : 'top';
  36870. var value = popper[mainSide];
  36871. if (popper[placement] > boundaries[placement] && !options.escapeWithReference) {
  36872. value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height));
  36873. }
  36874. return defineProperty({}, mainSide, value);
  36875. }
  36876. };
  36877. order.forEach(function (placement) {
  36878. var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';
  36879. popper = _extends({}, popper, check[side](placement));
  36880. });
  36881. data.offsets.popper = popper;
  36882. return data;
  36883. }
  36884. /**
  36885. * @function
  36886. * @memberof Modifiers
  36887. * @argument {Object} data - The data object generated by `update` method
  36888. * @argument {Object} options - Modifiers configuration and options
  36889. * @returns {Object} The data object, properly modified
  36890. */
  36891. function shift(data) {
  36892. var placement = data.placement;
  36893. var basePlacement = placement.split('-')[0];
  36894. var shiftvariation = placement.split('-')[1];
  36895. // if shift shiftvariation is specified, run the modifier
  36896. if (shiftvariation) {
  36897. var _data$offsets = data.offsets,
  36898. reference = _data$offsets.reference,
  36899. popper = _data$offsets.popper;
  36900. var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;
  36901. var side = isVertical ? 'left' : 'top';
  36902. var measurement = isVertical ? 'width' : 'height';
  36903. var shiftOffsets = {
  36904. start: defineProperty({}, side, reference[side]),
  36905. end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement])
  36906. };
  36907. data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]);
  36908. }
  36909. return data;
  36910. }
  36911. /**
  36912. * @function
  36913. * @memberof Modifiers
  36914. * @argument {Object} data - The data object generated by update method
  36915. * @argument {Object} options - Modifiers configuration and options
  36916. * @returns {Object} The data object, properly modified
  36917. */
  36918. function hide(data) {
  36919. if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {
  36920. return data;
  36921. }
  36922. var refRect = data.offsets.reference;
  36923. var bound = find(data.instance.modifiers, function (modifier) {
  36924. return modifier.name === 'preventOverflow';
  36925. }).boundaries;
  36926. if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) {
  36927. // Avoid unnecessary DOM access if visibility hasn't changed
  36928. if (data.hide === true) {
  36929. return data;
  36930. }
  36931. data.hide = true;
  36932. data.attributes['x-out-of-boundaries'] = '';
  36933. } else {
  36934. // Avoid unnecessary DOM access if visibility hasn't changed
  36935. if (data.hide === false) {
  36936. return data;
  36937. }
  36938. data.hide = false;
  36939. data.attributes['x-out-of-boundaries'] = false;
  36940. }
  36941. return data;
  36942. }
  36943. /**
  36944. * @function
  36945. * @memberof Modifiers
  36946. * @argument {Object} data - The data object generated by `update` method
  36947. * @argument {Object} options - Modifiers configuration and options
  36948. * @returns {Object} The data object, properly modified
  36949. */
  36950. function inner(data) {
  36951. var placement = data.placement;
  36952. var basePlacement = placement.split('-')[0];
  36953. var _data$offsets = data.offsets,
  36954. popper = _data$offsets.popper,
  36955. reference = _data$offsets.reference;
  36956. var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;
  36957. var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;
  36958. popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);
  36959. data.placement = getOppositePlacement(placement);
  36960. data.offsets.popper = getClientRect(popper);
  36961. return data;
  36962. }
  36963. /**
  36964. * Modifier function, each modifier can have a function of this type assigned
  36965. * to its `fn` property.<br />
  36966. * These functions will be called on each update, this means that you must
  36967. * make sure they are performant enough to avoid performance bottlenecks.
  36968. *
  36969. * @function ModifierFn
  36970. * @argument {dataObject} data - The data object generated by `update` method
  36971. * @argument {Object} options - Modifiers configuration and options
  36972. * @returns {dataObject} The data object, properly modified
  36973. */
  36974. /**
  36975. * Modifiers are plugins used to alter the behavior of your poppers.<br />
  36976. * Popper.js uses a set of 9 modifiers to provide all the basic functionalities
  36977. * needed by the library.
  36978. *
  36979. * Usually you don't want to override the `order`, `fn` and `onLoad` props.
  36980. * All the other properties are configurations that could be tweaked.
  36981. * @namespace modifiers
  36982. */
  36983. var modifiers = {
  36984. /**
  36985. * Modifier used to shift the popper on the start or end of its reference
  36986. * element.<br />
  36987. * It will read the variation of the `placement` property.<br />
  36988. * It can be one either `-end` or `-start`.
  36989. * @memberof modifiers
  36990. * @inner
  36991. */
  36992. shift: {
  36993. /** @prop {number} order=100 - Index used to define the order of execution */
  36994. order: 100,
  36995. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  36996. enabled: true,
  36997. /** @prop {ModifierFn} */
  36998. fn: shift
  36999. },
  37000. /**
  37001. * The `offset` modifier can shift your popper on both its axis.
  37002. *
  37003. * It accepts the following units:
  37004. * - `px` or unit-less, interpreted as pixels
  37005. * - `%` or `%r`, percentage relative to the length of the reference element
  37006. * - `%p`, percentage relative to the length of the popper element
  37007. * - `vw`, CSS viewport width unit
  37008. * - `vh`, CSS viewport height unit
  37009. *
  37010. * For length is intended the main axis relative to the placement of the popper.<br />
  37011. * This means that if the placement is `top` or `bottom`, the length will be the
  37012. * `width`. In case of `left` or `right`, it will be the `height`.
  37013. *
  37014. * You can provide a single value (as `Number` or `String`), or a pair of values
  37015. * as `String` divided by a comma or one (or more) white spaces.<br />
  37016. * The latter is a deprecated method because it leads to confusion and will be
  37017. * removed in v2.<br />
  37018. * Additionally, it accepts additions and subtractions between different units.
  37019. * Note that multiplications and divisions aren't supported.
  37020. *
  37021. * Valid examples are:
  37022. * ```
  37023. * 10
  37024. * '10%'
  37025. * '10, 10'
  37026. * '10%, 10'
  37027. * '10 + 10%'
  37028. * '10 - 5vh + 3%'
  37029. * '-10px + 5vh, 5px - 6%'
  37030. * ```
  37031. * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap
  37032. * > with their reference element, unfortunately, you will have to disable the `flip` modifier.
  37033. * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373).
  37034. *
  37035. * @memberof modifiers
  37036. * @inner
  37037. */
  37038. offset: {
  37039. /** @prop {number} order=200 - Index used to define the order of execution */
  37040. order: 200,
  37041. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  37042. enabled: true,
  37043. /** @prop {ModifierFn} */
  37044. fn: offset,
  37045. /** @prop {Number|String} offset=0
  37046. * The offset value as described in the modifier description
  37047. */
  37048. offset: 0
  37049. },
  37050. /**
  37051. * Modifier used to prevent the popper from being positioned outside the boundary.
  37052. *
  37053. * A scenario exists where the reference itself is not within the boundaries.<br />
  37054. * We can say it has "escaped the boundaries" — or just "escaped".<br />
  37055. * In this case we need to decide whether the popper should either:
  37056. *
  37057. * - detach from the reference and remain "trapped" in the boundaries, or
  37058. * - if it should ignore the boundary and "escape with its reference"
  37059. *
  37060. * When `escapeWithReference` is set to`true` and reference is completely
  37061. * outside its boundaries, the popper will overflow (or completely leave)
  37062. * the boundaries in order to remain attached to the edge of the reference.
  37063. *
  37064. * @memberof modifiers
  37065. * @inner
  37066. */
  37067. preventOverflow: {
  37068. /** @prop {number} order=300 - Index used to define the order of execution */
  37069. order: 300,
  37070. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  37071. enabled: true,
  37072. /** @prop {ModifierFn} */
  37073. fn: preventOverflow,
  37074. /**
  37075. * @prop {Array} [priority=['left','right','top','bottom']]
  37076. * Popper will try to prevent overflow following these priorities by default,
  37077. * then, it could overflow on the left and on top of the `boundariesElement`
  37078. */
  37079. priority: ['left', 'right', 'top', 'bottom'],
  37080. /**
  37081. * @prop {number} padding=5
  37082. * Amount of pixel used to define a minimum distance between the boundaries
  37083. * and the popper. This makes sure the popper always has a little padding
  37084. * between the edges of its container
  37085. */
  37086. padding: 5,
  37087. /**
  37088. * @prop {String|HTMLElement} boundariesElement='scrollParent'
  37089. * Boundaries used by the modifier. Can be `scrollParent`, `window`,
  37090. * `viewport` or any DOM element.
  37091. */
  37092. boundariesElement: 'scrollParent'
  37093. },
  37094. /**
  37095. * Modifier used to make sure the reference and its popper stay near each other
  37096. * without leaving any gap between the two. Especially useful when the arrow is
  37097. * enabled and you want to ensure that it points to its reference element.
  37098. * It cares only about the first axis. You can still have poppers with margin
  37099. * between the popper and its reference element.
  37100. * @memberof modifiers
  37101. * @inner
  37102. */
  37103. keepTogether: {
  37104. /** @prop {number} order=400 - Index used to define the order of execution */
  37105. order: 400,
  37106. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  37107. enabled: true,
  37108. /** @prop {ModifierFn} */
  37109. fn: keepTogether
  37110. },
  37111. /**
  37112. * This modifier is used to move the `arrowElement` of the popper to make
  37113. * sure it is positioned between the reference element and its popper element.
  37114. * It will read the outer size of the `arrowElement` node to detect how many
  37115. * pixels of conjunction are needed.
  37116. *
  37117. * It has no effect if no `arrowElement` is provided.
  37118. * @memberof modifiers
  37119. * @inner
  37120. */
  37121. arrow: {
  37122. /** @prop {number} order=500 - Index used to define the order of execution */
  37123. order: 500,
  37124. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  37125. enabled: true,
  37126. /** @prop {ModifierFn} */
  37127. fn: arrow,
  37128. /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */
  37129. element: '[x-arrow]'
  37130. },
  37131. /**
  37132. * Modifier used to flip the popper's placement when it starts to overlap its
  37133. * reference element.
  37134. *
  37135. * Requires the `preventOverflow` modifier before it in order to work.
  37136. *
  37137. * **NOTE:** this modifier will interrupt the current update cycle and will
  37138. * restart it if it detects the need to flip the placement.
  37139. * @memberof modifiers
  37140. * @inner
  37141. */
  37142. flip: {
  37143. /** @prop {number} order=600 - Index used to define the order of execution */
  37144. order: 600,
  37145. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  37146. enabled: true,
  37147. /** @prop {ModifierFn} */
  37148. fn: flip,
  37149. /**
  37150. * @prop {String|Array} behavior='flip'
  37151. * The behavior used to change the popper's placement. It can be one of
  37152. * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid
  37153. * placements (with optional variations)
  37154. */
  37155. behavior: 'flip',
  37156. /**
  37157. * @prop {number} padding=5
  37158. * The popper will flip if it hits the edges of the `boundariesElement`
  37159. */
  37160. padding: 5,
  37161. /**
  37162. * @prop {String|HTMLElement} boundariesElement='viewport'
  37163. * The element which will define the boundaries of the popper position.
  37164. * The popper will never be placed outside of the defined boundaries
  37165. * (except if `keepTogether` is enabled)
  37166. */
  37167. boundariesElement: 'viewport',
  37168. /**
  37169. * @prop {Boolean} flipVariations=false
  37170. * The popper will switch placement variation between `-start` and `-end` when
  37171. * the reference element overlaps its boundaries.
  37172. *
  37173. * The original placement should have a set variation.
  37174. */
  37175. flipVariations: false,
  37176. /**
  37177. * @prop {Boolean} flipVariationsByContent=false
  37178. * The popper will switch placement variation between `-start` and `-end` when
  37179. * the popper element overlaps its reference boundaries.
  37180. *
  37181. * The original placement should have a set variation.
  37182. */
  37183. flipVariationsByContent: false
  37184. },
  37185. /**
  37186. * Modifier used to make the popper flow toward the inner of the reference element.
  37187. * By default, when this modifier is disabled, the popper will be placed outside
  37188. * the reference element.
  37189. * @memberof modifiers
  37190. * @inner
  37191. */
  37192. inner: {
  37193. /** @prop {number} order=700 - Index used to define the order of execution */
  37194. order: 700,
  37195. /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */
  37196. enabled: false,
  37197. /** @prop {ModifierFn} */
  37198. fn: inner
  37199. },
  37200. /**
  37201. * Modifier used to hide the popper when its reference element is outside of the
  37202. * popper boundaries. It will set a `x-out-of-boundaries` attribute which can
  37203. * be used to hide with a CSS selector the popper when its reference is
  37204. * out of boundaries.
  37205. *
  37206. * Requires the `preventOverflow` modifier before it in order to work.
  37207. * @memberof modifiers
  37208. * @inner
  37209. */
  37210. hide: {
  37211. /** @prop {number} order=800 - Index used to define the order of execution */
  37212. order: 800,
  37213. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  37214. enabled: true,
  37215. /** @prop {ModifierFn} */
  37216. fn: hide
  37217. },
  37218. /**
  37219. * Computes the style that will be applied to the popper element to gets
  37220. * properly positioned.
  37221. *
  37222. * Note that this modifier will not touch the DOM, it just prepares the styles
  37223. * so that `applyStyle` modifier can apply it. This separation is useful
  37224. * in case you need to replace `applyStyle` with a custom implementation.
  37225. *
  37226. * This modifier has `850` as `order` value to maintain backward compatibility
  37227. * with previous versions of Popper.js. Expect the modifiers ordering method
  37228. * to change in future major versions of the library.
  37229. *
  37230. * @memberof modifiers
  37231. * @inner
  37232. */
  37233. computeStyle: {
  37234. /** @prop {number} order=850 - Index used to define the order of execution */
  37235. order: 850,
  37236. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  37237. enabled: true,
  37238. /** @prop {ModifierFn} */
  37239. fn: computeStyle,
  37240. /**
  37241. * @prop {Boolean} gpuAcceleration=true
  37242. * If true, it uses the CSS 3D transformation to position the popper.
  37243. * Otherwise, it will use the `top` and `left` properties
  37244. */
  37245. gpuAcceleration: true,
  37246. /**
  37247. * @prop {string} [x='bottom']
  37248. * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.
  37249. * Change this if your popper should grow in a direction different from `bottom`
  37250. */
  37251. x: 'bottom',
  37252. /**
  37253. * @prop {string} [x='left']
  37254. * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.
  37255. * Change this if your popper should grow in a direction different from `right`
  37256. */
  37257. y: 'right'
  37258. },
  37259. /**
  37260. * Applies the computed styles to the popper element.
  37261. *
  37262. * All the DOM manipulations are limited to this modifier. This is useful in case
  37263. * you want to integrate Popper.js inside a framework or view library and you
  37264. * want to delegate all the DOM manipulations to it.
  37265. *
  37266. * Note that if you disable this modifier, you must make sure the popper element
  37267. * has its position set to `absolute` before Popper.js can do its work!
  37268. *
  37269. * Just disable this modifier and define your own to achieve the desired effect.
  37270. *
  37271. * @memberof modifiers
  37272. * @inner
  37273. */
  37274. applyStyle: {
  37275. /** @prop {number} order=900 - Index used to define the order of execution */
  37276. order: 900,
  37277. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  37278. enabled: true,
  37279. /** @prop {ModifierFn} */
  37280. fn: applyStyle,
  37281. /** @prop {Function} */
  37282. onLoad: applyStyleOnLoad,
  37283. /**
  37284. * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier
  37285. * @prop {Boolean} gpuAcceleration=true
  37286. * If true, it uses the CSS 3D transformation to position the popper.
  37287. * Otherwise, it will use the `top` and `left` properties
  37288. */
  37289. gpuAcceleration: undefined
  37290. }
  37291. };
  37292. /**
  37293. * The `dataObject` is an object containing all the information used by Popper.js.
  37294. * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks.
  37295. * @name dataObject
  37296. * @property {Object} data.instance The Popper.js instance
  37297. * @property {String} data.placement Placement applied to popper
  37298. * @property {String} data.originalPlacement Placement originally defined on init
  37299. * @property {Boolean} data.flipped True if popper has been flipped by flip modifier
  37300. * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper
  37301. * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier
  37302. * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`)
  37303. * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`)
  37304. * @property {Object} data.boundaries Offsets of the popper boundaries
  37305. * @property {Object} data.offsets The measurements of popper, reference and arrow elements
  37306. * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values
  37307. * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values
  37308. * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0
  37309. */
  37310. /**
  37311. * Default options provided to Popper.js constructor.<br />
  37312. * These can be overridden using the `options` argument of Popper.js.<br />
  37313. * To override an option, simply pass an object with the same
  37314. * structure of the `options` object, as the 3rd argument. For example:
  37315. * ```
  37316. * new Popper(ref, pop, {
  37317. * modifiers: {
  37318. * preventOverflow: { enabled: false }
  37319. * }
  37320. * })
  37321. * ```
  37322. * @type {Object}
  37323. * @static
  37324. * @memberof Popper
  37325. */
  37326. var Defaults = {
  37327. /**
  37328. * Popper's placement.
  37329. * @prop {Popper.placements} placement='bottom'
  37330. */
  37331. placement: 'bottom',
  37332. /**
  37333. * Set this to true if you want popper to position it self in 'fixed' mode
  37334. * @prop {Boolean} positionFixed=false
  37335. */
  37336. positionFixed: false,
  37337. /**
  37338. * Whether events (resize, scroll) are initially enabled.
  37339. * @prop {Boolean} eventsEnabled=true
  37340. */
  37341. eventsEnabled: true,
  37342. /**
  37343. * Set to true if you want to automatically remove the popper when
  37344. * you call the `destroy` method.
  37345. * @prop {Boolean} removeOnDestroy=false
  37346. */
  37347. removeOnDestroy: false,
  37348. /**
  37349. * Callback called when the popper is created.<br />
  37350. * By default, it is set to no-op.<br />
  37351. * Access Popper.js instance with `data.instance`.
  37352. * @prop {onCreate}
  37353. */
  37354. onCreate: function onCreate() {},
  37355. /**
  37356. * Callback called when the popper is updated. This callback is not called
  37357. * on the initialization/creation of the popper, but only on subsequent
  37358. * updates.<br />
  37359. * By default, it is set to no-op.<br />
  37360. * Access Popper.js instance with `data.instance`.
  37361. * @prop {onUpdate}
  37362. */
  37363. onUpdate: function onUpdate() {},
  37364. /**
  37365. * List of modifiers used to modify the offsets before they are applied to the popper.
  37366. * They provide most of the functionalities of Popper.js.
  37367. * @prop {modifiers}
  37368. */
  37369. modifiers: modifiers
  37370. };
  37371. /**
  37372. * @callback onCreate
  37373. * @param {dataObject} data
  37374. */
  37375. /**
  37376. * @callback onUpdate
  37377. * @param {dataObject} data
  37378. */
  37379. // Utils
  37380. // Methods
  37381. var Popper = function () {
  37382. /**
  37383. * Creates a new Popper.js instance.
  37384. * @class Popper
  37385. * @param {Element|referenceObject} reference - The reference element used to position the popper
  37386. * @param {Element} popper - The HTML / XML element used as the popper
  37387. * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults)
  37388. * @return {Object} instance - The generated Popper.js instance
  37389. */
  37390. function Popper(reference, popper) {
  37391. var _this = this;
  37392. var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  37393. classCallCheck(this, Popper);
  37394. this.scheduleUpdate = function () {
  37395. return requestAnimationFrame(_this.update);
  37396. };
  37397. // make update() debounced, so that it only runs at most once-per-tick
  37398. this.update = debounce(this.update.bind(this));
  37399. // with {} we create a new object with the options inside it
  37400. this.options = _extends({}, Popper.Defaults, options);
  37401. // init state
  37402. this.state = {
  37403. isDestroyed: false,
  37404. isCreated: false,
  37405. scrollParents: []
  37406. };
  37407. // get reference and popper elements (allow jQuery wrappers)
  37408. this.reference = reference && reference.jquery ? reference[0] : reference;
  37409. this.popper = popper && popper.jquery ? popper[0] : popper;
  37410. // Deep merge modifiers options
  37411. this.options.modifiers = {};
  37412. Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) {
  37413. _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});
  37414. });
  37415. // Refactoring modifiers' list (Object => Array)
  37416. this.modifiers = Object.keys(this.options.modifiers).map(function (name) {
  37417. return _extends({
  37418. name: name
  37419. }, _this.options.modifiers[name]);
  37420. })
  37421. // sort the modifiers by order
  37422. .sort(function (a, b) {
  37423. return a.order - b.order;
  37424. });
  37425. // modifiers have the ability to execute arbitrary code when Popper.js get inited
  37426. // such code is executed in the same order of its modifier
  37427. // they could add new properties to their options configuration
  37428. // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`!
  37429. this.modifiers.forEach(function (modifierOptions) {
  37430. if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) {
  37431. modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state);
  37432. }
  37433. });
  37434. // fire the first update to position the popper in the right place
  37435. this.update();
  37436. var eventsEnabled = this.options.eventsEnabled;
  37437. if (eventsEnabled) {
  37438. // setup event listeners, they will take care of update the position in specific situations
  37439. this.enableEventListeners();
  37440. }
  37441. this.state.eventsEnabled = eventsEnabled;
  37442. }
  37443. // We can't use class properties because they don't get listed in the
  37444. // class prototype and break stuff like Sinon stubs
  37445. createClass(Popper, [{
  37446. key: 'update',
  37447. value: function update$$1() {
  37448. return update.call(this);
  37449. }
  37450. }, {
  37451. key: 'destroy',
  37452. value: function destroy$$1() {
  37453. return destroy.call(this);
  37454. }
  37455. }, {
  37456. key: 'enableEventListeners',
  37457. value: function enableEventListeners$$1() {
  37458. return enableEventListeners.call(this);
  37459. }
  37460. }, {
  37461. key: 'disableEventListeners',
  37462. value: function disableEventListeners$$1() {
  37463. return disableEventListeners.call(this);
  37464. }
  37465. /**
  37466. * Schedules an update. It will run on the next UI update available.
  37467. * @method scheduleUpdate
  37468. * @memberof Popper
  37469. */
  37470. /**
  37471. * Collection of utilities useful when writing custom modifiers.
  37472. * Starting from version 1.7, this method is available only if you
  37473. * include `popper-utils.js` before `popper.js`.
  37474. *
  37475. * **DEPRECATION**: This way to access PopperUtils is deprecated
  37476. * and will be removed in v2! Use the PopperUtils module directly instead.
  37477. * Due to the high instability of the methods contained in Utils, we can't
  37478. * guarantee them to follow semver. Use them at your own risk!
  37479. * @static
  37480. * @private
  37481. * @type {Object}
  37482. * @deprecated since version 1.8
  37483. * @member Utils
  37484. * @memberof Popper
  37485. */
  37486. }]);
  37487. return Popper;
  37488. }();
  37489. /**
  37490. * The `referenceObject` is an object that provides an interface compatible with Popper.js
  37491. * and lets you use it as replacement of a real DOM node.<br />
  37492. * You can use this method to position a popper relatively to a set of coordinates
  37493. * in case you don't have a DOM node to use as reference.
  37494. *
  37495. * ```
  37496. * new Popper(referenceObject, popperNode);
  37497. * ```
  37498. *
  37499. * NB: This feature isn't supported in Internet Explorer 10.
  37500. * @name referenceObject
  37501. * @property {Function} data.getBoundingClientRect
  37502. * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method.
  37503. * @property {number} data.clientWidth
  37504. * An ES6 getter that will return the width of the virtual reference element.
  37505. * @property {number} data.clientHeight
  37506. * An ES6 getter that will return the height of the virtual reference element.
  37507. */
  37508. Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils;
  37509. Popper.placements = placements;
  37510. Popper.Defaults = Defaults;
  37511. /* harmony default export */ __webpack_exports__["default"] = (Popper);
  37512. //# sourceMappingURL=popper.js.map
  37513. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  37514. /***/ }),
  37515. /***/ "./node_modules/process/browser.js":
  37516. /*!*****************************************!*\
  37517. !*** ./node_modules/process/browser.js ***!
  37518. \*****************************************/
  37519. /*! no static exports found */
  37520. /***/ (function(module, exports) {
  37521. // shim for using process in browser
  37522. var process = module.exports = {};
  37523. // cached from whatever global is present so that test runners that stub it
  37524. // don't break things. But we need to wrap it in a try catch in case it is
  37525. // wrapped in strict mode code which doesn't define any globals. It's inside a
  37526. // function because try/catches deoptimize in certain engines.
  37527. var cachedSetTimeout;
  37528. var cachedClearTimeout;
  37529. function defaultSetTimout() {
  37530. throw new Error('setTimeout has not been defined');
  37531. }
  37532. function defaultClearTimeout () {
  37533. throw new Error('clearTimeout has not been defined');
  37534. }
  37535. (function () {
  37536. try {
  37537. if (typeof setTimeout === 'function') {
  37538. cachedSetTimeout = setTimeout;
  37539. } else {
  37540. cachedSetTimeout = defaultSetTimout;
  37541. }
  37542. } catch (e) {
  37543. cachedSetTimeout = defaultSetTimout;
  37544. }
  37545. try {
  37546. if (typeof clearTimeout === 'function') {
  37547. cachedClearTimeout = clearTimeout;
  37548. } else {
  37549. cachedClearTimeout = defaultClearTimeout;
  37550. }
  37551. } catch (e) {
  37552. cachedClearTimeout = defaultClearTimeout;
  37553. }
  37554. } ())
  37555. function runTimeout(fun) {
  37556. if (cachedSetTimeout === setTimeout) {
  37557. //normal enviroments in sane situations
  37558. return setTimeout(fun, 0);
  37559. }
  37560. // if setTimeout wasn't available but was latter defined
  37561. if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
  37562. cachedSetTimeout = setTimeout;
  37563. return setTimeout(fun, 0);
  37564. }
  37565. try {
  37566. // when when somebody has screwed with setTimeout but no I.E. maddness
  37567. return cachedSetTimeout(fun, 0);
  37568. } catch(e){
  37569. try {
  37570. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  37571. return cachedSetTimeout.call(null, fun, 0);
  37572. } catch(e){
  37573. // 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
  37574. return cachedSetTimeout.call(this, fun, 0);
  37575. }
  37576. }
  37577. }
  37578. function runClearTimeout(marker) {
  37579. if (cachedClearTimeout === clearTimeout) {
  37580. //normal enviroments in sane situations
  37581. return clearTimeout(marker);
  37582. }
  37583. // if clearTimeout wasn't available but was latter defined
  37584. if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
  37585. cachedClearTimeout = clearTimeout;
  37586. return clearTimeout(marker);
  37587. }
  37588. try {
  37589. // when when somebody has screwed with setTimeout but no I.E. maddness
  37590. return cachedClearTimeout(marker);
  37591. } catch (e){
  37592. try {
  37593. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  37594. return cachedClearTimeout.call(null, marker);
  37595. } catch (e){
  37596. // 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.
  37597. // Some versions of I.E. have different rules for clearTimeout vs setTimeout
  37598. return cachedClearTimeout.call(this, marker);
  37599. }
  37600. }
  37601. }
  37602. var queue = [];
  37603. var draining = false;
  37604. var currentQueue;
  37605. var queueIndex = -1;
  37606. function cleanUpNextTick() {
  37607. if (!draining || !currentQueue) {
  37608. return;
  37609. }
  37610. draining = false;
  37611. if (currentQueue.length) {
  37612. queue = currentQueue.concat(queue);
  37613. } else {
  37614. queueIndex = -1;
  37615. }
  37616. if (queue.length) {
  37617. drainQueue();
  37618. }
  37619. }
  37620. function drainQueue() {
  37621. if (draining) {
  37622. return;
  37623. }
  37624. var timeout = runTimeout(cleanUpNextTick);
  37625. draining = true;
  37626. var len = queue.length;
  37627. while(len) {
  37628. currentQueue = queue;
  37629. queue = [];
  37630. while (++queueIndex < len) {
  37631. if (currentQueue) {
  37632. currentQueue[queueIndex].run();
  37633. }
  37634. }
  37635. queueIndex = -1;
  37636. len = queue.length;
  37637. }
  37638. currentQueue = null;
  37639. draining = false;
  37640. runClearTimeout(timeout);
  37641. }
  37642. process.nextTick = function (fun) {
  37643. var args = new Array(arguments.length - 1);
  37644. if (arguments.length > 1) {
  37645. for (var i = 1; i < arguments.length; i++) {
  37646. args[i - 1] = arguments[i];
  37647. }
  37648. }
  37649. queue.push(new Item(fun, args));
  37650. if (queue.length === 1 && !draining) {
  37651. runTimeout(drainQueue);
  37652. }
  37653. };
  37654. // v8 likes predictible objects
  37655. function Item(fun, array) {
  37656. this.fun = fun;
  37657. this.array = array;
  37658. }
  37659. Item.prototype.run = function () {
  37660. this.fun.apply(null, this.array);
  37661. };
  37662. process.title = 'browser';
  37663. process.browser = true;
  37664. process.env = {};
  37665. process.argv = [];
  37666. process.version = ''; // empty string to avoid regexp issues
  37667. process.versions = {};
  37668. function noop() {}
  37669. process.on = noop;
  37670. process.addListener = noop;
  37671. process.once = noop;
  37672. process.off = noop;
  37673. process.removeListener = noop;
  37674. process.removeAllListeners = noop;
  37675. process.emit = noop;
  37676. process.prependListener = noop;
  37677. process.prependOnceListener = noop;
  37678. process.listeners = function (name) { return [] }
  37679. process.binding = function (name) {
  37680. throw new Error('process.binding is not supported');
  37681. };
  37682. process.cwd = function () { return '/' };
  37683. process.chdir = function (dir) {
  37684. throw new Error('process.chdir is not supported');
  37685. };
  37686. process.umask = function() { return 0; };
  37687. /***/ }),
  37688. /***/ "./node_modules/pusher-js/dist/web/pusher.js":
  37689. /*!***************************************************!*\
  37690. !*** ./node_modules/pusher-js/dist/web/pusher.js ***!
  37691. \***************************************************/
  37692. /*! no static exports found */
  37693. /***/ (function(module, exports, __webpack_require__) {
  37694. /* WEBPACK VAR INJECTION */(function(Buffer) {/*!
  37695. * Pusher JavaScript Library v5.0.3
  37696. * https://pusher.com/
  37697. *
  37698. * Copyright 2017, Pusher
  37699. * Released under the MIT licence.
  37700. */
  37701. (function webpackUniversalModuleDefinition(root, factory) {
  37702. if(true)
  37703. module.exports = factory();
  37704. else {}
  37705. })(window, function() {
  37706. return /******/ (function(modules) { // webpackBootstrap
  37707. /******/ // The module cache
  37708. /******/ var installedModules = {};
  37709. /******/
  37710. /******/ // The require function
  37711. /******/ function __webpack_require__(moduleId) {
  37712. /******/
  37713. /******/ // Check if module is in cache
  37714. /******/ if(installedModules[moduleId]) {
  37715. /******/ return installedModules[moduleId].exports;
  37716. /******/ }
  37717. /******/ // Create a new module (and put it into the cache)
  37718. /******/ var module = installedModules[moduleId] = {
  37719. /******/ i: moduleId,
  37720. /******/ l: false,
  37721. /******/ exports: {}
  37722. /******/ };
  37723. /******/
  37724. /******/ // Execute the module function
  37725. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  37726. /******/
  37727. /******/ // Flag the module as loaded
  37728. /******/ module.l = true;
  37729. /******/
  37730. /******/ // Return the exports of the module
  37731. /******/ return module.exports;
  37732. /******/ }
  37733. /******/
  37734. /******/
  37735. /******/ // expose the modules object (__webpack_modules__)
  37736. /******/ __webpack_require__.m = modules;
  37737. /******/
  37738. /******/ // expose the module cache
  37739. /******/ __webpack_require__.c = installedModules;
  37740. /******/
  37741. /******/ // define getter function for harmony exports
  37742. /******/ __webpack_require__.d = function(exports, name, getter) {
  37743. /******/ if(!__webpack_require__.o(exports, name)) {
  37744. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  37745. /******/ }
  37746. /******/ };
  37747. /******/
  37748. /******/ // define __esModule on exports
  37749. /******/ __webpack_require__.r = function(exports) {
  37750. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  37751. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  37752. /******/ }
  37753. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  37754. /******/ };
  37755. /******/
  37756. /******/ // create a fake namespace object
  37757. /******/ // mode & 1: value is a module id, require it
  37758. /******/ // mode & 2: merge all properties of value into the ns
  37759. /******/ // mode & 4: return value when already ns object
  37760. /******/ // mode & 8|1: behave like require
  37761. /******/ __webpack_require__.t = function(value, mode) {
  37762. /******/ if(mode & 1) value = __webpack_require__(value);
  37763. /******/ if(mode & 8) return value;
  37764. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  37765. /******/ var ns = Object.create(null);
  37766. /******/ __webpack_require__.r(ns);
  37767. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  37768. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  37769. /******/ return ns;
  37770. /******/ };
  37771. /******/
  37772. /******/ // getDefaultExport function for compatibility with non-harmony modules
  37773. /******/ __webpack_require__.n = function(module) {
  37774. /******/ var getter = module && module.__esModule ?
  37775. /******/ function getDefault() { return module['default']; } :
  37776. /******/ function getModuleExports() { return module; };
  37777. /******/ __webpack_require__.d(getter, 'a', getter);
  37778. /******/ return getter;
  37779. /******/ };
  37780. /******/
  37781. /******/ // Object.prototype.hasOwnProperty.call
  37782. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  37783. /******/
  37784. /******/ // __webpack_public_path__
  37785. /******/ __webpack_require__.p = "";
  37786. /******/
  37787. /******/
  37788. /******/ // Load entry module and return exports
  37789. /******/ return __webpack_require__(__webpack_require__.s = 2);
  37790. /******/ })
  37791. /************************************************************************/
  37792. /******/ ([
  37793. /* 0 */
  37794. /***/ (function(module, exports, __webpack_require__) {
  37795. (function(nacl) {
  37796. 'use strict';
  37797. // Ported in 2014 by Dmitry Chestnykh and Devi Mandiri.
  37798. // Public domain.
  37799. //
  37800. // Implementation derived from TweetNaCl version 20140427.
  37801. // See for details: http://tweetnacl.cr.yp.to/
  37802. var gf = function(init) {
  37803. var i, r = new Float64Array(16);
  37804. if (init) for (i = 0; i < init.length; i++) r[i] = init[i];
  37805. return r;
  37806. };
  37807. // Pluggable, initialized in high-level API below.
  37808. var randombytes = function(/* x, n */) { throw new Error('no PRNG'); };
  37809. var _0 = new Uint8Array(16);
  37810. var _9 = new Uint8Array(32); _9[0] = 9;
  37811. var gf0 = gf(),
  37812. gf1 = gf([1]),
  37813. _121665 = gf([0xdb41, 1]),
  37814. D = gf([0x78a3, 0x1359, 0x4dca, 0x75eb, 0xd8ab, 0x4141, 0x0a4d, 0x0070, 0xe898, 0x7779, 0x4079, 0x8cc7, 0xfe73, 0x2b6f, 0x6cee, 0x5203]),
  37815. D2 = gf([0xf159, 0x26b2, 0x9b94, 0xebd6, 0xb156, 0x8283, 0x149a, 0x00e0, 0xd130, 0xeef3, 0x80f2, 0x198e, 0xfce7, 0x56df, 0xd9dc, 0x2406]),
  37816. X = gf([0xd51a, 0x8f25, 0x2d60, 0xc956, 0xa7b2, 0x9525, 0xc760, 0x692c, 0xdc5c, 0xfdd6, 0xe231, 0xc0a4, 0x53fe, 0xcd6e, 0x36d3, 0x2169]),
  37817. Y = gf([0x6658, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666]),
  37818. I = gf([0xa0b0, 0x4a0e, 0x1b27, 0xc4ee, 0xe478, 0xad2f, 0x1806, 0x2f43, 0xd7a7, 0x3dfb, 0x0099, 0x2b4d, 0xdf0b, 0x4fc1, 0x2480, 0x2b83]);
  37819. function ts64(x, i, h, l) {
  37820. x[i] = (h >> 24) & 0xff;
  37821. x[i+1] = (h >> 16) & 0xff;
  37822. x[i+2] = (h >> 8) & 0xff;
  37823. x[i+3] = h & 0xff;
  37824. x[i+4] = (l >> 24) & 0xff;
  37825. x[i+5] = (l >> 16) & 0xff;
  37826. x[i+6] = (l >> 8) & 0xff;
  37827. x[i+7] = l & 0xff;
  37828. }
  37829. function vn(x, xi, y, yi, n) {
  37830. var i,d = 0;
  37831. for (i = 0; i < n; i++) d |= x[xi+i]^y[yi+i];
  37832. return (1 & ((d - 1) >>> 8)) - 1;
  37833. }
  37834. function crypto_verify_16(x, xi, y, yi) {
  37835. return vn(x,xi,y,yi,16);
  37836. }
  37837. function crypto_verify_32(x, xi, y, yi) {
  37838. return vn(x,xi,y,yi,32);
  37839. }
  37840. function core_salsa20(o, p, k, c) {
  37841. var j0 = c[ 0] & 0xff | (c[ 1] & 0xff)<<8 | (c[ 2] & 0xff)<<16 | (c[ 3] & 0xff)<<24,
  37842. j1 = k[ 0] & 0xff | (k[ 1] & 0xff)<<8 | (k[ 2] & 0xff)<<16 | (k[ 3] & 0xff)<<24,
  37843. j2 = k[ 4] & 0xff | (k[ 5] & 0xff)<<8 | (k[ 6] & 0xff)<<16 | (k[ 7] & 0xff)<<24,
  37844. j3 = k[ 8] & 0xff | (k[ 9] & 0xff)<<8 | (k[10] & 0xff)<<16 | (k[11] & 0xff)<<24,
  37845. j4 = k[12] & 0xff | (k[13] & 0xff)<<8 | (k[14] & 0xff)<<16 | (k[15] & 0xff)<<24,
  37846. j5 = c[ 4] & 0xff | (c[ 5] & 0xff)<<8 | (c[ 6] & 0xff)<<16 | (c[ 7] & 0xff)<<24,
  37847. j6 = p[ 0] & 0xff | (p[ 1] & 0xff)<<8 | (p[ 2] & 0xff)<<16 | (p[ 3] & 0xff)<<24,
  37848. j7 = p[ 4] & 0xff | (p[ 5] & 0xff)<<8 | (p[ 6] & 0xff)<<16 | (p[ 7] & 0xff)<<24,
  37849. j8 = p[ 8] & 0xff | (p[ 9] & 0xff)<<8 | (p[10] & 0xff)<<16 | (p[11] & 0xff)<<24,
  37850. j9 = p[12] & 0xff | (p[13] & 0xff)<<8 | (p[14] & 0xff)<<16 | (p[15] & 0xff)<<24,
  37851. j10 = c[ 8] & 0xff | (c[ 9] & 0xff)<<8 | (c[10] & 0xff)<<16 | (c[11] & 0xff)<<24,
  37852. j11 = k[16] & 0xff | (k[17] & 0xff)<<8 | (k[18] & 0xff)<<16 | (k[19] & 0xff)<<24,
  37853. j12 = k[20] & 0xff | (k[21] & 0xff)<<8 | (k[22] & 0xff)<<16 | (k[23] & 0xff)<<24,
  37854. j13 = k[24] & 0xff | (k[25] & 0xff)<<8 | (k[26] & 0xff)<<16 | (k[27] & 0xff)<<24,
  37855. j14 = k[28] & 0xff | (k[29] & 0xff)<<8 | (k[30] & 0xff)<<16 | (k[31] & 0xff)<<24,
  37856. j15 = c[12] & 0xff | (c[13] & 0xff)<<8 | (c[14] & 0xff)<<16 | (c[15] & 0xff)<<24;
  37857. var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7,
  37858. x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14,
  37859. x15 = j15, u;
  37860. for (var i = 0; i < 20; i += 2) {
  37861. u = x0 + x12 | 0;
  37862. x4 ^= u<<7 | u>>>(32-7);
  37863. u = x4 + x0 | 0;
  37864. x8 ^= u<<9 | u>>>(32-9);
  37865. u = x8 + x4 | 0;
  37866. x12 ^= u<<13 | u>>>(32-13);
  37867. u = x12 + x8 | 0;
  37868. x0 ^= u<<18 | u>>>(32-18);
  37869. u = x5 + x1 | 0;
  37870. x9 ^= u<<7 | u>>>(32-7);
  37871. u = x9 + x5 | 0;
  37872. x13 ^= u<<9 | u>>>(32-9);
  37873. u = x13 + x9 | 0;
  37874. x1 ^= u<<13 | u>>>(32-13);
  37875. u = x1 + x13 | 0;
  37876. x5 ^= u<<18 | u>>>(32-18);
  37877. u = x10 + x6 | 0;
  37878. x14 ^= u<<7 | u>>>(32-7);
  37879. u = x14 + x10 | 0;
  37880. x2 ^= u<<9 | u>>>(32-9);
  37881. u = x2 + x14 | 0;
  37882. x6 ^= u<<13 | u>>>(32-13);
  37883. u = x6 + x2 | 0;
  37884. x10 ^= u<<18 | u>>>(32-18);
  37885. u = x15 + x11 | 0;
  37886. x3 ^= u<<7 | u>>>(32-7);
  37887. u = x3 + x15 | 0;
  37888. x7 ^= u<<9 | u>>>(32-9);
  37889. u = x7 + x3 | 0;
  37890. x11 ^= u<<13 | u>>>(32-13);
  37891. u = x11 + x7 | 0;
  37892. x15 ^= u<<18 | u>>>(32-18);
  37893. u = x0 + x3 | 0;
  37894. x1 ^= u<<7 | u>>>(32-7);
  37895. u = x1 + x0 | 0;
  37896. x2 ^= u<<9 | u>>>(32-9);
  37897. u = x2 + x1 | 0;
  37898. x3 ^= u<<13 | u>>>(32-13);
  37899. u = x3 + x2 | 0;
  37900. x0 ^= u<<18 | u>>>(32-18);
  37901. u = x5 + x4 | 0;
  37902. x6 ^= u<<7 | u>>>(32-7);
  37903. u = x6 + x5 | 0;
  37904. x7 ^= u<<9 | u>>>(32-9);
  37905. u = x7 + x6 | 0;
  37906. x4 ^= u<<13 | u>>>(32-13);
  37907. u = x4 + x7 | 0;
  37908. x5 ^= u<<18 | u>>>(32-18);
  37909. u = x10 + x9 | 0;
  37910. x11 ^= u<<7 | u>>>(32-7);
  37911. u = x11 + x10 | 0;
  37912. x8 ^= u<<9 | u>>>(32-9);
  37913. u = x8 + x11 | 0;
  37914. x9 ^= u<<13 | u>>>(32-13);
  37915. u = x9 + x8 | 0;
  37916. x10 ^= u<<18 | u>>>(32-18);
  37917. u = x15 + x14 | 0;
  37918. x12 ^= u<<7 | u>>>(32-7);
  37919. u = x12 + x15 | 0;
  37920. x13 ^= u<<9 | u>>>(32-9);
  37921. u = x13 + x12 | 0;
  37922. x14 ^= u<<13 | u>>>(32-13);
  37923. u = x14 + x13 | 0;
  37924. x15 ^= u<<18 | u>>>(32-18);
  37925. }
  37926. x0 = x0 + j0 | 0;
  37927. x1 = x1 + j1 | 0;
  37928. x2 = x2 + j2 | 0;
  37929. x3 = x3 + j3 | 0;
  37930. x4 = x4 + j4 | 0;
  37931. x5 = x5 + j5 | 0;
  37932. x6 = x6 + j6 | 0;
  37933. x7 = x7 + j7 | 0;
  37934. x8 = x8 + j8 | 0;
  37935. x9 = x9 + j9 | 0;
  37936. x10 = x10 + j10 | 0;
  37937. x11 = x11 + j11 | 0;
  37938. x12 = x12 + j12 | 0;
  37939. x13 = x13 + j13 | 0;
  37940. x14 = x14 + j14 | 0;
  37941. x15 = x15 + j15 | 0;
  37942. o[ 0] = x0 >>> 0 & 0xff;
  37943. o[ 1] = x0 >>> 8 & 0xff;
  37944. o[ 2] = x0 >>> 16 & 0xff;
  37945. o[ 3] = x0 >>> 24 & 0xff;
  37946. o[ 4] = x1 >>> 0 & 0xff;
  37947. o[ 5] = x1 >>> 8 & 0xff;
  37948. o[ 6] = x1 >>> 16 & 0xff;
  37949. o[ 7] = x1 >>> 24 & 0xff;
  37950. o[ 8] = x2 >>> 0 & 0xff;
  37951. o[ 9] = x2 >>> 8 & 0xff;
  37952. o[10] = x2 >>> 16 & 0xff;
  37953. o[11] = x2 >>> 24 & 0xff;
  37954. o[12] = x3 >>> 0 & 0xff;
  37955. o[13] = x3 >>> 8 & 0xff;
  37956. o[14] = x3 >>> 16 & 0xff;
  37957. o[15] = x3 >>> 24 & 0xff;
  37958. o[16] = x4 >>> 0 & 0xff;
  37959. o[17] = x4 >>> 8 & 0xff;
  37960. o[18] = x4 >>> 16 & 0xff;
  37961. o[19] = x4 >>> 24 & 0xff;
  37962. o[20] = x5 >>> 0 & 0xff;
  37963. o[21] = x5 >>> 8 & 0xff;
  37964. o[22] = x5 >>> 16 & 0xff;
  37965. o[23] = x5 >>> 24 & 0xff;
  37966. o[24] = x6 >>> 0 & 0xff;
  37967. o[25] = x6 >>> 8 & 0xff;
  37968. o[26] = x6 >>> 16 & 0xff;
  37969. o[27] = x6 >>> 24 & 0xff;
  37970. o[28] = x7 >>> 0 & 0xff;
  37971. o[29] = x7 >>> 8 & 0xff;
  37972. o[30] = x7 >>> 16 & 0xff;
  37973. o[31] = x7 >>> 24 & 0xff;
  37974. o[32] = x8 >>> 0 & 0xff;
  37975. o[33] = x8 >>> 8 & 0xff;
  37976. o[34] = x8 >>> 16 & 0xff;
  37977. o[35] = x8 >>> 24 & 0xff;
  37978. o[36] = x9 >>> 0 & 0xff;
  37979. o[37] = x9 >>> 8 & 0xff;
  37980. o[38] = x9 >>> 16 & 0xff;
  37981. o[39] = x9 >>> 24 & 0xff;
  37982. o[40] = x10 >>> 0 & 0xff;
  37983. o[41] = x10 >>> 8 & 0xff;
  37984. o[42] = x10 >>> 16 & 0xff;
  37985. o[43] = x10 >>> 24 & 0xff;
  37986. o[44] = x11 >>> 0 & 0xff;
  37987. o[45] = x11 >>> 8 & 0xff;
  37988. o[46] = x11 >>> 16 & 0xff;
  37989. o[47] = x11 >>> 24 & 0xff;
  37990. o[48] = x12 >>> 0 & 0xff;
  37991. o[49] = x12 >>> 8 & 0xff;
  37992. o[50] = x12 >>> 16 & 0xff;
  37993. o[51] = x12 >>> 24 & 0xff;
  37994. o[52] = x13 >>> 0 & 0xff;
  37995. o[53] = x13 >>> 8 & 0xff;
  37996. o[54] = x13 >>> 16 & 0xff;
  37997. o[55] = x13 >>> 24 & 0xff;
  37998. o[56] = x14 >>> 0 & 0xff;
  37999. o[57] = x14 >>> 8 & 0xff;
  38000. o[58] = x14 >>> 16 & 0xff;
  38001. o[59] = x14 >>> 24 & 0xff;
  38002. o[60] = x15 >>> 0 & 0xff;
  38003. o[61] = x15 >>> 8 & 0xff;
  38004. o[62] = x15 >>> 16 & 0xff;
  38005. o[63] = x15 >>> 24 & 0xff;
  38006. }
  38007. function core_hsalsa20(o,p,k,c) {
  38008. var j0 = c[ 0] & 0xff | (c[ 1] & 0xff)<<8 | (c[ 2] & 0xff)<<16 | (c[ 3] & 0xff)<<24,
  38009. j1 = k[ 0] & 0xff | (k[ 1] & 0xff)<<8 | (k[ 2] & 0xff)<<16 | (k[ 3] & 0xff)<<24,
  38010. j2 = k[ 4] & 0xff | (k[ 5] & 0xff)<<8 | (k[ 6] & 0xff)<<16 | (k[ 7] & 0xff)<<24,
  38011. j3 = k[ 8] & 0xff | (k[ 9] & 0xff)<<8 | (k[10] & 0xff)<<16 | (k[11] & 0xff)<<24,
  38012. j4 = k[12] & 0xff | (k[13] & 0xff)<<8 | (k[14] & 0xff)<<16 | (k[15] & 0xff)<<24,
  38013. j5 = c[ 4] & 0xff | (c[ 5] & 0xff)<<8 | (c[ 6] & 0xff)<<16 | (c[ 7] & 0xff)<<24,
  38014. j6 = p[ 0] & 0xff | (p[ 1] & 0xff)<<8 | (p[ 2] & 0xff)<<16 | (p[ 3] & 0xff)<<24,
  38015. j7 = p[ 4] & 0xff | (p[ 5] & 0xff)<<8 | (p[ 6] & 0xff)<<16 | (p[ 7] & 0xff)<<24,
  38016. j8 = p[ 8] & 0xff | (p[ 9] & 0xff)<<8 | (p[10] & 0xff)<<16 | (p[11] & 0xff)<<24,
  38017. j9 = p[12] & 0xff | (p[13] & 0xff)<<8 | (p[14] & 0xff)<<16 | (p[15] & 0xff)<<24,
  38018. j10 = c[ 8] & 0xff | (c[ 9] & 0xff)<<8 | (c[10] & 0xff)<<16 | (c[11] & 0xff)<<24,
  38019. j11 = k[16] & 0xff | (k[17] & 0xff)<<8 | (k[18] & 0xff)<<16 | (k[19] & 0xff)<<24,
  38020. j12 = k[20] & 0xff | (k[21] & 0xff)<<8 | (k[22] & 0xff)<<16 | (k[23] & 0xff)<<24,
  38021. j13 = k[24] & 0xff | (k[25] & 0xff)<<8 | (k[26] & 0xff)<<16 | (k[27] & 0xff)<<24,
  38022. j14 = k[28] & 0xff | (k[29] & 0xff)<<8 | (k[30] & 0xff)<<16 | (k[31] & 0xff)<<24,
  38023. j15 = c[12] & 0xff | (c[13] & 0xff)<<8 | (c[14] & 0xff)<<16 | (c[15] & 0xff)<<24;
  38024. var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7,
  38025. x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14,
  38026. x15 = j15, u;
  38027. for (var i = 0; i < 20; i += 2) {
  38028. u = x0 + x12 | 0;
  38029. x4 ^= u<<7 | u>>>(32-7);
  38030. u = x4 + x0 | 0;
  38031. x8 ^= u<<9 | u>>>(32-9);
  38032. u = x8 + x4 | 0;
  38033. x12 ^= u<<13 | u>>>(32-13);
  38034. u = x12 + x8 | 0;
  38035. x0 ^= u<<18 | u>>>(32-18);
  38036. u = x5 + x1 | 0;
  38037. x9 ^= u<<7 | u>>>(32-7);
  38038. u = x9 + x5 | 0;
  38039. x13 ^= u<<9 | u>>>(32-9);
  38040. u = x13 + x9 | 0;
  38041. x1 ^= u<<13 | u>>>(32-13);
  38042. u = x1 + x13 | 0;
  38043. x5 ^= u<<18 | u>>>(32-18);
  38044. u = x10 + x6 | 0;
  38045. x14 ^= u<<7 | u>>>(32-7);
  38046. u = x14 + x10 | 0;
  38047. x2 ^= u<<9 | u>>>(32-9);
  38048. u = x2 + x14 | 0;
  38049. x6 ^= u<<13 | u>>>(32-13);
  38050. u = x6 + x2 | 0;
  38051. x10 ^= u<<18 | u>>>(32-18);
  38052. u = x15 + x11 | 0;
  38053. x3 ^= u<<7 | u>>>(32-7);
  38054. u = x3 + x15 | 0;
  38055. x7 ^= u<<9 | u>>>(32-9);
  38056. u = x7 + x3 | 0;
  38057. x11 ^= u<<13 | u>>>(32-13);
  38058. u = x11 + x7 | 0;
  38059. x15 ^= u<<18 | u>>>(32-18);
  38060. u = x0 + x3 | 0;
  38061. x1 ^= u<<7 | u>>>(32-7);
  38062. u = x1 + x0 | 0;
  38063. x2 ^= u<<9 | u>>>(32-9);
  38064. u = x2 + x1 | 0;
  38065. x3 ^= u<<13 | u>>>(32-13);
  38066. u = x3 + x2 | 0;
  38067. x0 ^= u<<18 | u>>>(32-18);
  38068. u = x5 + x4 | 0;
  38069. x6 ^= u<<7 | u>>>(32-7);
  38070. u = x6 + x5 | 0;
  38071. x7 ^= u<<9 | u>>>(32-9);
  38072. u = x7 + x6 | 0;
  38073. x4 ^= u<<13 | u>>>(32-13);
  38074. u = x4 + x7 | 0;
  38075. x5 ^= u<<18 | u>>>(32-18);
  38076. u = x10 + x9 | 0;
  38077. x11 ^= u<<7 | u>>>(32-7);
  38078. u = x11 + x10 | 0;
  38079. x8 ^= u<<9 | u>>>(32-9);
  38080. u = x8 + x11 | 0;
  38081. x9 ^= u<<13 | u>>>(32-13);
  38082. u = x9 + x8 | 0;
  38083. x10 ^= u<<18 | u>>>(32-18);
  38084. u = x15 + x14 | 0;
  38085. x12 ^= u<<7 | u>>>(32-7);
  38086. u = x12 + x15 | 0;
  38087. x13 ^= u<<9 | u>>>(32-9);
  38088. u = x13 + x12 | 0;
  38089. x14 ^= u<<13 | u>>>(32-13);
  38090. u = x14 + x13 | 0;
  38091. x15 ^= u<<18 | u>>>(32-18);
  38092. }
  38093. o[ 0] = x0 >>> 0 & 0xff;
  38094. o[ 1] = x0 >>> 8 & 0xff;
  38095. o[ 2] = x0 >>> 16 & 0xff;
  38096. o[ 3] = x0 >>> 24 & 0xff;
  38097. o[ 4] = x5 >>> 0 & 0xff;
  38098. o[ 5] = x5 >>> 8 & 0xff;
  38099. o[ 6] = x5 >>> 16 & 0xff;
  38100. o[ 7] = x5 >>> 24 & 0xff;
  38101. o[ 8] = x10 >>> 0 & 0xff;
  38102. o[ 9] = x10 >>> 8 & 0xff;
  38103. o[10] = x10 >>> 16 & 0xff;
  38104. o[11] = x10 >>> 24 & 0xff;
  38105. o[12] = x15 >>> 0 & 0xff;
  38106. o[13] = x15 >>> 8 & 0xff;
  38107. o[14] = x15 >>> 16 & 0xff;
  38108. o[15] = x15 >>> 24 & 0xff;
  38109. o[16] = x6 >>> 0 & 0xff;
  38110. o[17] = x6 >>> 8 & 0xff;
  38111. o[18] = x6 >>> 16 & 0xff;
  38112. o[19] = x6 >>> 24 & 0xff;
  38113. o[20] = x7 >>> 0 & 0xff;
  38114. o[21] = x7 >>> 8 & 0xff;
  38115. o[22] = x7 >>> 16 & 0xff;
  38116. o[23] = x7 >>> 24 & 0xff;
  38117. o[24] = x8 >>> 0 & 0xff;
  38118. o[25] = x8 >>> 8 & 0xff;
  38119. o[26] = x8 >>> 16 & 0xff;
  38120. o[27] = x8 >>> 24 & 0xff;
  38121. o[28] = x9 >>> 0 & 0xff;
  38122. o[29] = x9 >>> 8 & 0xff;
  38123. o[30] = x9 >>> 16 & 0xff;
  38124. o[31] = x9 >>> 24 & 0xff;
  38125. }
  38126. function crypto_core_salsa20(out,inp,k,c) {
  38127. core_salsa20(out,inp,k,c);
  38128. }
  38129. function crypto_core_hsalsa20(out,inp,k,c) {
  38130. core_hsalsa20(out,inp,k,c);
  38131. }
  38132. var sigma = new Uint8Array([101, 120, 112, 97, 110, 100, 32, 51, 50, 45, 98, 121, 116, 101, 32, 107]);
  38133. // "expand 32-byte k"
  38134. function crypto_stream_salsa20_xor(c,cpos,m,mpos,b,n,k) {
  38135. var z = new Uint8Array(16), x = new Uint8Array(64);
  38136. var u, i;
  38137. for (i = 0; i < 16; i++) z[i] = 0;
  38138. for (i = 0; i < 8; i++) z[i] = n[i];
  38139. while (b >= 64) {
  38140. crypto_core_salsa20(x,z,k,sigma);
  38141. for (i = 0; i < 64; i++) c[cpos+i] = m[mpos+i] ^ x[i];
  38142. u = 1;
  38143. for (i = 8; i < 16; i++) {
  38144. u = u + (z[i] & 0xff) | 0;
  38145. z[i] = u & 0xff;
  38146. u >>>= 8;
  38147. }
  38148. b -= 64;
  38149. cpos += 64;
  38150. mpos += 64;
  38151. }
  38152. if (b > 0) {
  38153. crypto_core_salsa20(x,z,k,sigma);
  38154. for (i = 0; i < b; i++) c[cpos+i] = m[mpos+i] ^ x[i];
  38155. }
  38156. return 0;
  38157. }
  38158. function crypto_stream_salsa20(c,cpos,b,n,k) {
  38159. var z = new Uint8Array(16), x = new Uint8Array(64);
  38160. var u, i;
  38161. for (i = 0; i < 16; i++) z[i] = 0;
  38162. for (i = 0; i < 8; i++) z[i] = n[i];
  38163. while (b >= 64) {
  38164. crypto_core_salsa20(x,z,k,sigma);
  38165. for (i = 0; i < 64; i++) c[cpos+i] = x[i];
  38166. u = 1;
  38167. for (i = 8; i < 16; i++) {
  38168. u = u + (z[i] & 0xff) | 0;
  38169. z[i] = u & 0xff;
  38170. u >>>= 8;
  38171. }
  38172. b -= 64;
  38173. cpos += 64;
  38174. }
  38175. if (b > 0) {
  38176. crypto_core_salsa20(x,z,k,sigma);
  38177. for (i = 0; i < b; i++) c[cpos+i] = x[i];
  38178. }
  38179. return 0;
  38180. }
  38181. function crypto_stream(c,cpos,d,n,k) {
  38182. var s = new Uint8Array(32);
  38183. crypto_core_hsalsa20(s,n,k,sigma);
  38184. var sn = new Uint8Array(8);
  38185. for (var i = 0; i < 8; i++) sn[i] = n[i+16];
  38186. return crypto_stream_salsa20(c,cpos,d,sn,s);
  38187. }
  38188. function crypto_stream_xor(c,cpos,m,mpos,d,n,k) {
  38189. var s = new Uint8Array(32);
  38190. crypto_core_hsalsa20(s,n,k,sigma);
  38191. var sn = new Uint8Array(8);
  38192. for (var i = 0; i < 8; i++) sn[i] = n[i+16];
  38193. return crypto_stream_salsa20_xor(c,cpos,m,mpos,d,sn,s);
  38194. }
  38195. /*
  38196. * Port of Andrew Moon's Poly1305-donna-16. Public domain.
  38197. * https://github.com/floodyberry/poly1305-donna
  38198. */
  38199. var poly1305 = function(key) {
  38200. this.buffer = new Uint8Array(16);
  38201. this.r = new Uint16Array(10);
  38202. this.h = new Uint16Array(10);
  38203. this.pad = new Uint16Array(8);
  38204. this.leftover = 0;
  38205. this.fin = 0;
  38206. var t0, t1, t2, t3, t4, t5, t6, t7;
  38207. t0 = key[ 0] & 0xff | (key[ 1] & 0xff) << 8; this.r[0] = ( t0 ) & 0x1fff;
  38208. t1 = key[ 2] & 0xff | (key[ 3] & 0xff) << 8; this.r[1] = ((t0 >>> 13) | (t1 << 3)) & 0x1fff;
  38209. t2 = key[ 4] & 0xff | (key[ 5] & 0xff) << 8; this.r[2] = ((t1 >>> 10) | (t2 << 6)) & 0x1f03;
  38210. t3 = key[ 6] & 0xff | (key[ 7] & 0xff) << 8; this.r[3] = ((t2 >>> 7) | (t3 << 9)) & 0x1fff;
  38211. t4 = key[ 8] & 0xff | (key[ 9] & 0xff) << 8; this.r[4] = ((t3 >>> 4) | (t4 << 12)) & 0x00ff;
  38212. this.r[5] = ((t4 >>> 1)) & 0x1ffe;
  38213. t5 = key[10] & 0xff | (key[11] & 0xff) << 8; this.r[6] = ((t4 >>> 14) | (t5 << 2)) & 0x1fff;
  38214. t6 = key[12] & 0xff | (key[13] & 0xff) << 8; this.r[7] = ((t5 >>> 11) | (t6 << 5)) & 0x1f81;
  38215. t7 = key[14] & 0xff | (key[15] & 0xff) << 8; this.r[8] = ((t6 >>> 8) | (t7 << 8)) & 0x1fff;
  38216. this.r[9] = ((t7 >>> 5)) & 0x007f;
  38217. this.pad[0] = key[16] & 0xff | (key[17] & 0xff) << 8;
  38218. this.pad[1] = key[18] & 0xff | (key[19] & 0xff) << 8;
  38219. this.pad[2] = key[20] & 0xff | (key[21] & 0xff) << 8;
  38220. this.pad[3] = key[22] & 0xff | (key[23] & 0xff) << 8;
  38221. this.pad[4] = key[24] & 0xff | (key[25] & 0xff) << 8;
  38222. this.pad[5] = key[26] & 0xff | (key[27] & 0xff) << 8;
  38223. this.pad[6] = key[28] & 0xff | (key[29] & 0xff) << 8;
  38224. this.pad[7] = key[30] & 0xff | (key[31] & 0xff) << 8;
  38225. };
  38226. poly1305.prototype.blocks = function(m, mpos, bytes) {
  38227. var hibit = this.fin ? 0 : (1 << 11);
  38228. var t0, t1, t2, t3, t4, t5, t6, t7, c;
  38229. var d0, d1, d2, d3, d4, d5, d6, d7, d8, d9;
  38230. var h0 = this.h[0],
  38231. h1 = this.h[1],
  38232. h2 = this.h[2],
  38233. h3 = this.h[3],
  38234. h4 = this.h[4],
  38235. h5 = this.h[5],
  38236. h6 = this.h[6],
  38237. h7 = this.h[7],
  38238. h8 = this.h[8],
  38239. h9 = this.h[9];
  38240. var r0 = this.r[0],
  38241. r1 = this.r[1],
  38242. r2 = this.r[2],
  38243. r3 = this.r[3],
  38244. r4 = this.r[4],
  38245. r5 = this.r[5],
  38246. r6 = this.r[6],
  38247. r7 = this.r[7],
  38248. r8 = this.r[8],
  38249. r9 = this.r[9];
  38250. while (bytes >= 16) {
  38251. t0 = m[mpos+ 0] & 0xff | (m[mpos+ 1] & 0xff) << 8; h0 += ( t0 ) & 0x1fff;
  38252. t1 = m[mpos+ 2] & 0xff | (m[mpos+ 3] & 0xff) << 8; h1 += ((t0 >>> 13) | (t1 << 3)) & 0x1fff;
  38253. t2 = m[mpos+ 4] & 0xff | (m[mpos+ 5] & 0xff) << 8; h2 += ((t1 >>> 10) | (t2 << 6)) & 0x1fff;
  38254. t3 = m[mpos+ 6] & 0xff | (m[mpos+ 7] & 0xff) << 8; h3 += ((t2 >>> 7) | (t3 << 9)) & 0x1fff;
  38255. t4 = m[mpos+ 8] & 0xff | (m[mpos+ 9] & 0xff) << 8; h4 += ((t3 >>> 4) | (t4 << 12)) & 0x1fff;
  38256. h5 += ((t4 >>> 1)) & 0x1fff;
  38257. t5 = m[mpos+10] & 0xff | (m[mpos+11] & 0xff) << 8; h6 += ((t4 >>> 14) | (t5 << 2)) & 0x1fff;
  38258. t6 = m[mpos+12] & 0xff | (m[mpos+13] & 0xff) << 8; h7 += ((t5 >>> 11) | (t6 << 5)) & 0x1fff;
  38259. t7 = m[mpos+14] & 0xff | (m[mpos+15] & 0xff) << 8; h8 += ((t6 >>> 8) | (t7 << 8)) & 0x1fff;
  38260. h9 += ((t7 >>> 5)) | hibit;
  38261. c = 0;
  38262. d0 = c;
  38263. d0 += h0 * r0;
  38264. d0 += h1 * (5 * r9);
  38265. d0 += h2 * (5 * r8);
  38266. d0 += h3 * (5 * r7);
  38267. d0 += h4 * (5 * r6);
  38268. c = (d0 >>> 13); d0 &= 0x1fff;
  38269. d0 += h5 * (5 * r5);
  38270. d0 += h6 * (5 * r4);
  38271. d0 += h7 * (5 * r3);
  38272. d0 += h8 * (5 * r2);
  38273. d0 += h9 * (5 * r1);
  38274. c += (d0 >>> 13); d0 &= 0x1fff;
  38275. d1 = c;
  38276. d1 += h0 * r1;
  38277. d1 += h1 * r0;
  38278. d1 += h2 * (5 * r9);
  38279. d1 += h3 * (5 * r8);
  38280. d1 += h4 * (5 * r7);
  38281. c = (d1 >>> 13); d1 &= 0x1fff;
  38282. d1 += h5 * (5 * r6);
  38283. d1 += h6 * (5 * r5);
  38284. d1 += h7 * (5 * r4);
  38285. d1 += h8 * (5 * r3);
  38286. d1 += h9 * (5 * r2);
  38287. c += (d1 >>> 13); d1 &= 0x1fff;
  38288. d2 = c;
  38289. d2 += h0 * r2;
  38290. d2 += h1 * r1;
  38291. d2 += h2 * r0;
  38292. d2 += h3 * (5 * r9);
  38293. d2 += h4 * (5 * r8);
  38294. c = (d2 >>> 13); d2 &= 0x1fff;
  38295. d2 += h5 * (5 * r7);
  38296. d2 += h6 * (5 * r6);
  38297. d2 += h7 * (5 * r5);
  38298. d2 += h8 * (5 * r4);
  38299. d2 += h9 * (5 * r3);
  38300. c += (d2 >>> 13); d2 &= 0x1fff;
  38301. d3 = c;
  38302. d3 += h0 * r3;
  38303. d3 += h1 * r2;
  38304. d3 += h2 * r1;
  38305. d3 += h3 * r0;
  38306. d3 += h4 * (5 * r9);
  38307. c = (d3 >>> 13); d3 &= 0x1fff;
  38308. d3 += h5 * (5 * r8);
  38309. d3 += h6 * (5 * r7);
  38310. d3 += h7 * (5 * r6);
  38311. d3 += h8 * (5 * r5);
  38312. d3 += h9 * (5 * r4);
  38313. c += (d3 >>> 13); d3 &= 0x1fff;
  38314. d4 = c;
  38315. d4 += h0 * r4;
  38316. d4 += h1 * r3;
  38317. d4 += h2 * r2;
  38318. d4 += h3 * r1;
  38319. d4 += h4 * r0;
  38320. c = (d4 >>> 13); d4 &= 0x1fff;
  38321. d4 += h5 * (5 * r9);
  38322. d4 += h6 * (5 * r8);
  38323. d4 += h7 * (5 * r7);
  38324. d4 += h8 * (5 * r6);
  38325. d4 += h9 * (5 * r5);
  38326. c += (d4 >>> 13); d4 &= 0x1fff;
  38327. d5 = c;
  38328. d5 += h0 * r5;
  38329. d5 += h1 * r4;
  38330. d5 += h2 * r3;
  38331. d5 += h3 * r2;
  38332. d5 += h4 * r1;
  38333. c = (d5 >>> 13); d5 &= 0x1fff;
  38334. d5 += h5 * r0;
  38335. d5 += h6 * (5 * r9);
  38336. d5 += h7 * (5 * r8);
  38337. d5 += h8 * (5 * r7);
  38338. d5 += h9 * (5 * r6);
  38339. c += (d5 >>> 13); d5 &= 0x1fff;
  38340. d6 = c;
  38341. d6 += h0 * r6;
  38342. d6 += h1 * r5;
  38343. d6 += h2 * r4;
  38344. d6 += h3 * r3;
  38345. d6 += h4 * r2;
  38346. c = (d6 >>> 13); d6 &= 0x1fff;
  38347. d6 += h5 * r1;
  38348. d6 += h6 * r0;
  38349. d6 += h7 * (5 * r9);
  38350. d6 += h8 * (5 * r8);
  38351. d6 += h9 * (5 * r7);
  38352. c += (d6 >>> 13); d6 &= 0x1fff;
  38353. d7 = c;
  38354. d7 += h0 * r7;
  38355. d7 += h1 * r6;
  38356. d7 += h2 * r5;
  38357. d7 += h3 * r4;
  38358. d7 += h4 * r3;
  38359. c = (d7 >>> 13); d7 &= 0x1fff;
  38360. d7 += h5 * r2;
  38361. d7 += h6 * r1;
  38362. d7 += h7 * r0;
  38363. d7 += h8 * (5 * r9);
  38364. d7 += h9 * (5 * r8);
  38365. c += (d7 >>> 13); d7 &= 0x1fff;
  38366. d8 = c;
  38367. d8 += h0 * r8;
  38368. d8 += h1 * r7;
  38369. d8 += h2 * r6;
  38370. d8 += h3 * r5;
  38371. d8 += h4 * r4;
  38372. c = (d8 >>> 13); d8 &= 0x1fff;
  38373. d8 += h5 * r3;
  38374. d8 += h6 * r2;
  38375. d8 += h7 * r1;
  38376. d8 += h8 * r0;
  38377. d8 += h9 * (5 * r9);
  38378. c += (d8 >>> 13); d8 &= 0x1fff;
  38379. d9 = c;
  38380. d9 += h0 * r9;
  38381. d9 += h1 * r8;
  38382. d9 += h2 * r7;
  38383. d9 += h3 * r6;
  38384. d9 += h4 * r5;
  38385. c = (d9 >>> 13); d9 &= 0x1fff;
  38386. d9 += h5 * r4;
  38387. d9 += h6 * r3;
  38388. d9 += h7 * r2;
  38389. d9 += h8 * r1;
  38390. d9 += h9 * r0;
  38391. c += (d9 >>> 13); d9 &= 0x1fff;
  38392. c = (((c << 2) + c)) | 0;
  38393. c = (c + d0) | 0;
  38394. d0 = c & 0x1fff;
  38395. c = (c >>> 13);
  38396. d1 += c;
  38397. h0 = d0;
  38398. h1 = d1;
  38399. h2 = d2;
  38400. h3 = d3;
  38401. h4 = d4;
  38402. h5 = d5;
  38403. h6 = d6;
  38404. h7 = d7;
  38405. h8 = d8;
  38406. h9 = d9;
  38407. mpos += 16;
  38408. bytes -= 16;
  38409. }
  38410. this.h[0] = h0;
  38411. this.h[1] = h1;
  38412. this.h[2] = h2;
  38413. this.h[3] = h3;
  38414. this.h[4] = h4;
  38415. this.h[5] = h5;
  38416. this.h[6] = h6;
  38417. this.h[7] = h7;
  38418. this.h[8] = h8;
  38419. this.h[9] = h9;
  38420. };
  38421. poly1305.prototype.finish = function(mac, macpos) {
  38422. var g = new Uint16Array(10);
  38423. var c, mask, f, i;
  38424. if (this.leftover) {
  38425. i = this.leftover;
  38426. this.buffer[i++] = 1;
  38427. for (; i < 16; i++) this.buffer[i] = 0;
  38428. this.fin = 1;
  38429. this.blocks(this.buffer, 0, 16);
  38430. }
  38431. c = this.h[1] >>> 13;
  38432. this.h[1] &= 0x1fff;
  38433. for (i = 2; i < 10; i++) {
  38434. this.h[i] += c;
  38435. c = this.h[i] >>> 13;
  38436. this.h[i] &= 0x1fff;
  38437. }
  38438. this.h[0] += (c * 5);
  38439. c = this.h[0] >>> 13;
  38440. this.h[0] &= 0x1fff;
  38441. this.h[1] += c;
  38442. c = this.h[1] >>> 13;
  38443. this.h[1] &= 0x1fff;
  38444. this.h[2] += c;
  38445. g[0] = this.h[0] + 5;
  38446. c = g[0] >>> 13;
  38447. g[0] &= 0x1fff;
  38448. for (i = 1; i < 10; i++) {
  38449. g[i] = this.h[i] + c;
  38450. c = g[i] >>> 13;
  38451. g[i] &= 0x1fff;
  38452. }
  38453. g[9] -= (1 << 13);
  38454. mask = (c ^ 1) - 1;
  38455. for (i = 0; i < 10; i++) g[i] &= mask;
  38456. mask = ~mask;
  38457. for (i = 0; i < 10; i++) this.h[i] = (this.h[i] & mask) | g[i];
  38458. this.h[0] = ((this.h[0] ) | (this.h[1] << 13) ) & 0xffff;
  38459. this.h[1] = ((this.h[1] >>> 3) | (this.h[2] << 10) ) & 0xffff;
  38460. this.h[2] = ((this.h[2] >>> 6) | (this.h[3] << 7) ) & 0xffff;
  38461. this.h[3] = ((this.h[3] >>> 9) | (this.h[4] << 4) ) & 0xffff;
  38462. this.h[4] = ((this.h[4] >>> 12) | (this.h[5] << 1) | (this.h[6] << 14)) & 0xffff;
  38463. this.h[5] = ((this.h[6] >>> 2) | (this.h[7] << 11) ) & 0xffff;
  38464. this.h[6] = ((this.h[7] >>> 5) | (this.h[8] << 8) ) & 0xffff;
  38465. this.h[7] = ((this.h[8] >>> 8) | (this.h[9] << 5) ) & 0xffff;
  38466. f = this.h[0] + this.pad[0];
  38467. this.h[0] = f & 0xffff;
  38468. for (i = 1; i < 8; i++) {
  38469. f = (((this.h[i] + this.pad[i]) | 0) + (f >>> 16)) | 0;
  38470. this.h[i] = f & 0xffff;
  38471. }
  38472. mac[macpos+ 0] = (this.h[0] >>> 0) & 0xff;
  38473. mac[macpos+ 1] = (this.h[0] >>> 8) & 0xff;
  38474. mac[macpos+ 2] = (this.h[1] >>> 0) & 0xff;
  38475. mac[macpos+ 3] = (this.h[1] >>> 8) & 0xff;
  38476. mac[macpos+ 4] = (this.h[2] >>> 0) & 0xff;
  38477. mac[macpos+ 5] = (this.h[2] >>> 8) & 0xff;
  38478. mac[macpos+ 6] = (this.h[3] >>> 0) & 0xff;
  38479. mac[macpos+ 7] = (this.h[3] >>> 8) & 0xff;
  38480. mac[macpos+ 8] = (this.h[4] >>> 0) & 0xff;
  38481. mac[macpos+ 9] = (this.h[4] >>> 8) & 0xff;
  38482. mac[macpos+10] = (this.h[5] >>> 0) & 0xff;
  38483. mac[macpos+11] = (this.h[5] >>> 8) & 0xff;
  38484. mac[macpos+12] = (this.h[6] >>> 0) & 0xff;
  38485. mac[macpos+13] = (this.h[6] >>> 8) & 0xff;
  38486. mac[macpos+14] = (this.h[7] >>> 0) & 0xff;
  38487. mac[macpos+15] = (this.h[7] >>> 8) & 0xff;
  38488. };
  38489. poly1305.prototype.update = function(m, mpos, bytes) {
  38490. var i, want;
  38491. if (this.leftover) {
  38492. want = (16 - this.leftover);
  38493. if (want > bytes)
  38494. want = bytes;
  38495. for (i = 0; i < want; i++)
  38496. this.buffer[this.leftover + i] = m[mpos+i];
  38497. bytes -= want;
  38498. mpos += want;
  38499. this.leftover += want;
  38500. if (this.leftover < 16)
  38501. return;
  38502. this.blocks(this.buffer, 0, 16);
  38503. this.leftover = 0;
  38504. }
  38505. if (bytes >= 16) {
  38506. want = bytes - (bytes % 16);
  38507. this.blocks(m, mpos, want);
  38508. mpos += want;
  38509. bytes -= want;
  38510. }
  38511. if (bytes) {
  38512. for (i = 0; i < bytes; i++)
  38513. this.buffer[this.leftover + i] = m[mpos+i];
  38514. this.leftover += bytes;
  38515. }
  38516. };
  38517. function crypto_onetimeauth(out, outpos, m, mpos, n, k) {
  38518. var s = new poly1305(k);
  38519. s.update(m, mpos, n);
  38520. s.finish(out, outpos);
  38521. return 0;
  38522. }
  38523. function crypto_onetimeauth_verify(h, hpos, m, mpos, n, k) {
  38524. var x = new Uint8Array(16);
  38525. crypto_onetimeauth(x,0,m,mpos,n,k);
  38526. return crypto_verify_16(h,hpos,x,0);
  38527. }
  38528. function crypto_secretbox(c,m,d,n,k) {
  38529. var i;
  38530. if (d < 32) return -1;
  38531. crypto_stream_xor(c,0,m,0,d,n,k);
  38532. crypto_onetimeauth(c, 16, c, 32, d - 32, c);
  38533. for (i = 0; i < 16; i++) c[i] = 0;
  38534. return 0;
  38535. }
  38536. function crypto_secretbox_open(m,c,d,n,k) {
  38537. var i;
  38538. var x = new Uint8Array(32);
  38539. if (d < 32) return -1;
  38540. crypto_stream(x,0,32,n,k);
  38541. if (crypto_onetimeauth_verify(c, 16,c, 32,d - 32,x) !== 0) return -1;
  38542. crypto_stream_xor(m,0,c,0,d,n,k);
  38543. for (i = 0; i < 32; i++) m[i] = 0;
  38544. return 0;
  38545. }
  38546. function set25519(r, a) {
  38547. var i;
  38548. for (i = 0; i < 16; i++) r[i] = a[i]|0;
  38549. }
  38550. function car25519(o) {
  38551. var i, v, c = 1;
  38552. for (i = 0; i < 16; i++) {
  38553. v = o[i] + c + 65535;
  38554. c = Math.floor(v / 65536);
  38555. o[i] = v - c * 65536;
  38556. }
  38557. o[0] += c-1 + 37 * (c-1);
  38558. }
  38559. function sel25519(p, q, b) {
  38560. var t, c = ~(b-1);
  38561. for (var i = 0; i < 16; i++) {
  38562. t = c & (p[i] ^ q[i]);
  38563. p[i] ^= t;
  38564. q[i] ^= t;
  38565. }
  38566. }
  38567. function pack25519(o, n) {
  38568. var i, j, b;
  38569. var m = gf(), t = gf();
  38570. for (i = 0; i < 16; i++) t[i] = n[i];
  38571. car25519(t);
  38572. car25519(t);
  38573. car25519(t);
  38574. for (j = 0; j < 2; j++) {
  38575. m[0] = t[0] - 0xffed;
  38576. for (i = 1; i < 15; i++) {
  38577. m[i] = t[i] - 0xffff - ((m[i-1]>>16) & 1);
  38578. m[i-1] &= 0xffff;
  38579. }
  38580. m[15] = t[15] - 0x7fff - ((m[14]>>16) & 1);
  38581. b = (m[15]>>16) & 1;
  38582. m[14] &= 0xffff;
  38583. sel25519(t, m, 1-b);
  38584. }
  38585. for (i = 0; i < 16; i++) {
  38586. o[2*i] = t[i] & 0xff;
  38587. o[2*i+1] = t[i]>>8;
  38588. }
  38589. }
  38590. function neq25519(a, b) {
  38591. var c = new Uint8Array(32), d = new Uint8Array(32);
  38592. pack25519(c, a);
  38593. pack25519(d, b);
  38594. return crypto_verify_32(c, 0, d, 0);
  38595. }
  38596. function par25519(a) {
  38597. var d = new Uint8Array(32);
  38598. pack25519(d, a);
  38599. return d[0] & 1;
  38600. }
  38601. function unpack25519(o, n) {
  38602. var i;
  38603. for (i = 0; i < 16; i++) o[i] = n[2*i] + (n[2*i+1] << 8);
  38604. o[15] &= 0x7fff;
  38605. }
  38606. function A(o, a, b) {
  38607. for (var i = 0; i < 16; i++) o[i] = a[i] + b[i];
  38608. }
  38609. function Z(o, a, b) {
  38610. for (var i = 0; i < 16; i++) o[i] = a[i] - b[i];
  38611. }
  38612. function M(o, a, b) {
  38613. var v, c,
  38614. t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0,
  38615. t8 = 0, t9 = 0, t10 = 0, t11 = 0, t12 = 0, t13 = 0, t14 = 0, t15 = 0,
  38616. t16 = 0, t17 = 0, t18 = 0, t19 = 0, t20 = 0, t21 = 0, t22 = 0, t23 = 0,
  38617. t24 = 0, t25 = 0, t26 = 0, t27 = 0, t28 = 0, t29 = 0, t30 = 0,
  38618. b0 = b[0],
  38619. b1 = b[1],
  38620. b2 = b[2],
  38621. b3 = b[3],
  38622. b4 = b[4],
  38623. b5 = b[5],
  38624. b6 = b[6],
  38625. b7 = b[7],
  38626. b8 = b[8],
  38627. b9 = b[9],
  38628. b10 = b[10],
  38629. b11 = b[11],
  38630. b12 = b[12],
  38631. b13 = b[13],
  38632. b14 = b[14],
  38633. b15 = b[15];
  38634. v = a[0];
  38635. t0 += v * b0;
  38636. t1 += v * b1;
  38637. t2 += v * b2;
  38638. t3 += v * b3;
  38639. t4 += v * b4;
  38640. t5 += v * b5;
  38641. t6 += v * b6;
  38642. t7 += v * b7;
  38643. t8 += v * b8;
  38644. t9 += v * b9;
  38645. t10 += v * b10;
  38646. t11 += v * b11;
  38647. t12 += v * b12;
  38648. t13 += v * b13;
  38649. t14 += v * b14;
  38650. t15 += v * b15;
  38651. v = a[1];
  38652. t1 += v * b0;
  38653. t2 += v * b1;
  38654. t3 += v * b2;
  38655. t4 += v * b3;
  38656. t5 += v * b4;
  38657. t6 += v * b5;
  38658. t7 += v * b6;
  38659. t8 += v * b7;
  38660. t9 += v * b8;
  38661. t10 += v * b9;
  38662. t11 += v * b10;
  38663. t12 += v * b11;
  38664. t13 += v * b12;
  38665. t14 += v * b13;
  38666. t15 += v * b14;
  38667. t16 += v * b15;
  38668. v = a[2];
  38669. t2 += v * b0;
  38670. t3 += v * b1;
  38671. t4 += v * b2;
  38672. t5 += v * b3;
  38673. t6 += v * b4;
  38674. t7 += v * b5;
  38675. t8 += v * b6;
  38676. t9 += v * b7;
  38677. t10 += v * b8;
  38678. t11 += v * b9;
  38679. t12 += v * b10;
  38680. t13 += v * b11;
  38681. t14 += v * b12;
  38682. t15 += v * b13;
  38683. t16 += v * b14;
  38684. t17 += v * b15;
  38685. v = a[3];
  38686. t3 += v * b0;
  38687. t4 += v * b1;
  38688. t5 += v * b2;
  38689. t6 += v * b3;
  38690. t7 += v * b4;
  38691. t8 += v * b5;
  38692. t9 += v * b6;
  38693. t10 += v * b7;
  38694. t11 += v * b8;
  38695. t12 += v * b9;
  38696. t13 += v * b10;
  38697. t14 += v * b11;
  38698. t15 += v * b12;
  38699. t16 += v * b13;
  38700. t17 += v * b14;
  38701. t18 += v * b15;
  38702. v = a[4];
  38703. t4 += v * b0;
  38704. t5 += v * b1;
  38705. t6 += v * b2;
  38706. t7 += v * b3;
  38707. t8 += v * b4;
  38708. t9 += v * b5;
  38709. t10 += v * b6;
  38710. t11 += v * b7;
  38711. t12 += v * b8;
  38712. t13 += v * b9;
  38713. t14 += v * b10;
  38714. t15 += v * b11;
  38715. t16 += v * b12;
  38716. t17 += v * b13;
  38717. t18 += v * b14;
  38718. t19 += v * b15;
  38719. v = a[5];
  38720. t5 += v * b0;
  38721. t6 += v * b1;
  38722. t7 += v * b2;
  38723. t8 += v * b3;
  38724. t9 += v * b4;
  38725. t10 += v * b5;
  38726. t11 += v * b6;
  38727. t12 += v * b7;
  38728. t13 += v * b8;
  38729. t14 += v * b9;
  38730. t15 += v * b10;
  38731. t16 += v * b11;
  38732. t17 += v * b12;
  38733. t18 += v * b13;
  38734. t19 += v * b14;
  38735. t20 += v * b15;
  38736. v = a[6];
  38737. t6 += v * b0;
  38738. t7 += v * b1;
  38739. t8 += v * b2;
  38740. t9 += v * b3;
  38741. t10 += v * b4;
  38742. t11 += v * b5;
  38743. t12 += v * b6;
  38744. t13 += v * b7;
  38745. t14 += v * b8;
  38746. t15 += v * b9;
  38747. t16 += v * b10;
  38748. t17 += v * b11;
  38749. t18 += v * b12;
  38750. t19 += v * b13;
  38751. t20 += v * b14;
  38752. t21 += v * b15;
  38753. v = a[7];
  38754. t7 += v * b0;
  38755. t8 += v * b1;
  38756. t9 += v * b2;
  38757. t10 += v * b3;
  38758. t11 += v * b4;
  38759. t12 += v * b5;
  38760. t13 += v * b6;
  38761. t14 += v * b7;
  38762. t15 += v * b8;
  38763. t16 += v * b9;
  38764. t17 += v * b10;
  38765. t18 += v * b11;
  38766. t19 += v * b12;
  38767. t20 += v * b13;
  38768. t21 += v * b14;
  38769. t22 += v * b15;
  38770. v = a[8];
  38771. t8 += v * b0;
  38772. t9 += v * b1;
  38773. t10 += v * b2;
  38774. t11 += v * b3;
  38775. t12 += v * b4;
  38776. t13 += v * b5;
  38777. t14 += v * b6;
  38778. t15 += v * b7;
  38779. t16 += v * b8;
  38780. t17 += v * b9;
  38781. t18 += v * b10;
  38782. t19 += v * b11;
  38783. t20 += v * b12;
  38784. t21 += v * b13;
  38785. t22 += v * b14;
  38786. t23 += v * b15;
  38787. v = a[9];
  38788. t9 += v * b0;
  38789. t10 += v * b1;
  38790. t11 += v * b2;
  38791. t12 += v * b3;
  38792. t13 += v * b4;
  38793. t14 += v * b5;
  38794. t15 += v * b6;
  38795. t16 += v * b7;
  38796. t17 += v * b8;
  38797. t18 += v * b9;
  38798. t19 += v * b10;
  38799. t20 += v * b11;
  38800. t21 += v * b12;
  38801. t22 += v * b13;
  38802. t23 += v * b14;
  38803. t24 += v * b15;
  38804. v = a[10];
  38805. t10 += v * b0;
  38806. t11 += v * b1;
  38807. t12 += v * b2;
  38808. t13 += v * b3;
  38809. t14 += v * b4;
  38810. t15 += v * b5;
  38811. t16 += v * b6;
  38812. t17 += v * b7;
  38813. t18 += v * b8;
  38814. t19 += v * b9;
  38815. t20 += v * b10;
  38816. t21 += v * b11;
  38817. t22 += v * b12;
  38818. t23 += v * b13;
  38819. t24 += v * b14;
  38820. t25 += v * b15;
  38821. v = a[11];
  38822. t11 += v * b0;
  38823. t12 += v * b1;
  38824. t13 += v * b2;
  38825. t14 += v * b3;
  38826. t15 += v * b4;
  38827. t16 += v * b5;
  38828. t17 += v * b6;
  38829. t18 += v * b7;
  38830. t19 += v * b8;
  38831. t20 += v * b9;
  38832. t21 += v * b10;
  38833. t22 += v * b11;
  38834. t23 += v * b12;
  38835. t24 += v * b13;
  38836. t25 += v * b14;
  38837. t26 += v * b15;
  38838. v = a[12];
  38839. t12 += v * b0;
  38840. t13 += v * b1;
  38841. t14 += v * b2;
  38842. t15 += v * b3;
  38843. t16 += v * b4;
  38844. t17 += v * b5;
  38845. t18 += v * b6;
  38846. t19 += v * b7;
  38847. t20 += v * b8;
  38848. t21 += v * b9;
  38849. t22 += v * b10;
  38850. t23 += v * b11;
  38851. t24 += v * b12;
  38852. t25 += v * b13;
  38853. t26 += v * b14;
  38854. t27 += v * b15;
  38855. v = a[13];
  38856. t13 += v * b0;
  38857. t14 += v * b1;
  38858. t15 += v * b2;
  38859. t16 += v * b3;
  38860. t17 += v * b4;
  38861. t18 += v * b5;
  38862. t19 += v * b6;
  38863. t20 += v * b7;
  38864. t21 += v * b8;
  38865. t22 += v * b9;
  38866. t23 += v * b10;
  38867. t24 += v * b11;
  38868. t25 += v * b12;
  38869. t26 += v * b13;
  38870. t27 += v * b14;
  38871. t28 += v * b15;
  38872. v = a[14];
  38873. t14 += v * b0;
  38874. t15 += v * b1;
  38875. t16 += v * b2;
  38876. t17 += v * b3;
  38877. t18 += v * b4;
  38878. t19 += v * b5;
  38879. t20 += v * b6;
  38880. t21 += v * b7;
  38881. t22 += v * b8;
  38882. t23 += v * b9;
  38883. t24 += v * b10;
  38884. t25 += v * b11;
  38885. t26 += v * b12;
  38886. t27 += v * b13;
  38887. t28 += v * b14;
  38888. t29 += v * b15;
  38889. v = a[15];
  38890. t15 += v * b0;
  38891. t16 += v * b1;
  38892. t17 += v * b2;
  38893. t18 += v * b3;
  38894. t19 += v * b4;
  38895. t20 += v * b5;
  38896. t21 += v * b6;
  38897. t22 += v * b7;
  38898. t23 += v * b8;
  38899. t24 += v * b9;
  38900. t25 += v * b10;
  38901. t26 += v * b11;
  38902. t27 += v * b12;
  38903. t28 += v * b13;
  38904. t29 += v * b14;
  38905. t30 += v * b15;
  38906. t0 += 38 * t16;
  38907. t1 += 38 * t17;
  38908. t2 += 38 * t18;
  38909. t3 += 38 * t19;
  38910. t4 += 38 * t20;
  38911. t5 += 38 * t21;
  38912. t6 += 38 * t22;
  38913. t7 += 38 * t23;
  38914. t8 += 38 * t24;
  38915. t9 += 38 * t25;
  38916. t10 += 38 * t26;
  38917. t11 += 38 * t27;
  38918. t12 += 38 * t28;
  38919. t13 += 38 * t29;
  38920. t14 += 38 * t30;
  38921. // t15 left as is
  38922. // first car
  38923. c = 1;
  38924. v = t0 + c + 65535; c = Math.floor(v / 65536); t0 = v - c * 65536;
  38925. v = t1 + c + 65535; c = Math.floor(v / 65536); t1 = v - c * 65536;
  38926. v = t2 + c + 65535; c = Math.floor(v / 65536); t2 = v - c * 65536;
  38927. v = t3 + c + 65535; c = Math.floor(v / 65536); t3 = v - c * 65536;
  38928. v = t4 + c + 65535; c = Math.floor(v / 65536); t4 = v - c * 65536;
  38929. v = t5 + c + 65535; c = Math.floor(v / 65536); t5 = v - c * 65536;
  38930. v = t6 + c + 65535; c = Math.floor(v / 65536); t6 = v - c * 65536;
  38931. v = t7 + c + 65535; c = Math.floor(v / 65536); t7 = v - c * 65536;
  38932. v = t8 + c + 65535; c = Math.floor(v / 65536); t8 = v - c * 65536;
  38933. v = t9 + c + 65535; c = Math.floor(v / 65536); t9 = v - c * 65536;
  38934. v = t10 + c + 65535; c = Math.floor(v / 65536); t10 = v - c * 65536;
  38935. v = t11 + c + 65535; c = Math.floor(v / 65536); t11 = v - c * 65536;
  38936. v = t12 + c + 65535; c = Math.floor(v / 65536); t12 = v - c * 65536;
  38937. v = t13 + c + 65535; c = Math.floor(v / 65536); t13 = v - c * 65536;
  38938. v = t14 + c + 65535; c = Math.floor(v / 65536); t14 = v - c * 65536;
  38939. v = t15 + c + 65535; c = Math.floor(v / 65536); t15 = v - c * 65536;
  38940. t0 += c-1 + 37 * (c-1);
  38941. // second car
  38942. c = 1;
  38943. v = t0 + c + 65535; c = Math.floor(v / 65536); t0 = v - c * 65536;
  38944. v = t1 + c + 65535; c = Math.floor(v / 65536); t1 = v - c * 65536;
  38945. v = t2 + c + 65535; c = Math.floor(v / 65536); t2 = v - c * 65536;
  38946. v = t3 + c + 65535; c = Math.floor(v / 65536); t3 = v - c * 65536;
  38947. v = t4 + c + 65535; c = Math.floor(v / 65536); t4 = v - c * 65536;
  38948. v = t5 + c + 65535; c = Math.floor(v / 65536); t5 = v - c * 65536;
  38949. v = t6 + c + 65535; c = Math.floor(v / 65536); t6 = v - c * 65536;
  38950. v = t7 + c + 65535; c = Math.floor(v / 65536); t7 = v - c * 65536;
  38951. v = t8 + c + 65535; c = Math.floor(v / 65536); t8 = v - c * 65536;
  38952. v = t9 + c + 65535; c = Math.floor(v / 65536); t9 = v - c * 65536;
  38953. v = t10 + c + 65535; c = Math.floor(v / 65536); t10 = v - c * 65536;
  38954. v = t11 + c + 65535; c = Math.floor(v / 65536); t11 = v - c * 65536;
  38955. v = t12 + c + 65535; c = Math.floor(v / 65536); t12 = v - c * 65536;
  38956. v = t13 + c + 65535; c = Math.floor(v / 65536); t13 = v - c * 65536;
  38957. v = t14 + c + 65535; c = Math.floor(v / 65536); t14 = v - c * 65536;
  38958. v = t15 + c + 65535; c = Math.floor(v / 65536); t15 = v - c * 65536;
  38959. t0 += c-1 + 37 * (c-1);
  38960. o[ 0] = t0;
  38961. o[ 1] = t1;
  38962. o[ 2] = t2;
  38963. o[ 3] = t3;
  38964. o[ 4] = t4;
  38965. o[ 5] = t5;
  38966. o[ 6] = t6;
  38967. o[ 7] = t7;
  38968. o[ 8] = t8;
  38969. o[ 9] = t9;
  38970. o[10] = t10;
  38971. o[11] = t11;
  38972. o[12] = t12;
  38973. o[13] = t13;
  38974. o[14] = t14;
  38975. o[15] = t15;
  38976. }
  38977. function S(o, a) {
  38978. M(o, a, a);
  38979. }
  38980. function inv25519(o, i) {
  38981. var c = gf();
  38982. var a;
  38983. for (a = 0; a < 16; a++) c[a] = i[a];
  38984. for (a = 253; a >= 0; a--) {
  38985. S(c, c);
  38986. if(a !== 2 && a !== 4) M(c, c, i);
  38987. }
  38988. for (a = 0; a < 16; a++) o[a] = c[a];
  38989. }
  38990. function pow2523(o, i) {
  38991. var c = gf();
  38992. var a;
  38993. for (a = 0; a < 16; a++) c[a] = i[a];
  38994. for (a = 250; a >= 0; a--) {
  38995. S(c, c);
  38996. if(a !== 1) M(c, c, i);
  38997. }
  38998. for (a = 0; a < 16; a++) o[a] = c[a];
  38999. }
  39000. function crypto_scalarmult(q, n, p) {
  39001. var z = new Uint8Array(32);
  39002. var x = new Float64Array(80), r, i;
  39003. var a = gf(), b = gf(), c = gf(),
  39004. d = gf(), e = gf(), f = gf();
  39005. for (i = 0; i < 31; i++) z[i] = n[i];
  39006. z[31]=(n[31]&127)|64;
  39007. z[0]&=248;
  39008. unpack25519(x,p);
  39009. for (i = 0; i < 16; i++) {
  39010. b[i]=x[i];
  39011. d[i]=a[i]=c[i]=0;
  39012. }
  39013. a[0]=d[0]=1;
  39014. for (i=254; i>=0; --i) {
  39015. r=(z[i>>>3]>>>(i&7))&1;
  39016. sel25519(a,b,r);
  39017. sel25519(c,d,r);
  39018. A(e,a,c);
  39019. Z(a,a,c);
  39020. A(c,b,d);
  39021. Z(b,b,d);
  39022. S(d,e);
  39023. S(f,a);
  39024. M(a,c,a);
  39025. M(c,b,e);
  39026. A(e,a,c);
  39027. Z(a,a,c);
  39028. S(b,a);
  39029. Z(c,d,f);
  39030. M(a,c,_121665);
  39031. A(a,a,d);
  39032. M(c,c,a);
  39033. M(a,d,f);
  39034. M(d,b,x);
  39035. S(b,e);
  39036. sel25519(a,b,r);
  39037. sel25519(c,d,r);
  39038. }
  39039. for (i = 0; i < 16; i++) {
  39040. x[i+16]=a[i];
  39041. x[i+32]=c[i];
  39042. x[i+48]=b[i];
  39043. x[i+64]=d[i];
  39044. }
  39045. var x32 = x.subarray(32);
  39046. var x16 = x.subarray(16);
  39047. inv25519(x32,x32);
  39048. M(x16,x16,x32);
  39049. pack25519(q,x16);
  39050. return 0;
  39051. }
  39052. function crypto_scalarmult_base(q, n) {
  39053. return crypto_scalarmult(q, n, _9);
  39054. }
  39055. function crypto_box_keypair(y, x) {
  39056. randombytes(x, 32);
  39057. return crypto_scalarmult_base(y, x);
  39058. }
  39059. function crypto_box_beforenm(k, y, x) {
  39060. var s = new Uint8Array(32);
  39061. crypto_scalarmult(s, x, y);
  39062. return crypto_core_hsalsa20(k, _0, s, sigma);
  39063. }
  39064. var crypto_box_afternm = crypto_secretbox;
  39065. var crypto_box_open_afternm = crypto_secretbox_open;
  39066. function crypto_box(c, m, d, n, y, x) {
  39067. var k = new Uint8Array(32);
  39068. crypto_box_beforenm(k, y, x);
  39069. return crypto_box_afternm(c, m, d, n, k);
  39070. }
  39071. function crypto_box_open(m, c, d, n, y, x) {
  39072. var k = new Uint8Array(32);
  39073. crypto_box_beforenm(k, y, x);
  39074. return crypto_box_open_afternm(m, c, d, n, k);
  39075. }
  39076. var K = [
  39077. 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,
  39078. 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,
  39079. 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,
  39080. 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,
  39081. 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,
  39082. 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,
  39083. 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,
  39084. 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,
  39085. 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,
  39086. 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,
  39087. 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,
  39088. 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,
  39089. 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,
  39090. 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,
  39091. 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,
  39092. 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,
  39093. 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,
  39094. 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,
  39095. 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,
  39096. 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,
  39097. 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,
  39098. 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,
  39099. 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,
  39100. 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,
  39101. 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,
  39102. 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,
  39103. 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,
  39104. 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,
  39105. 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,
  39106. 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,
  39107. 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,
  39108. 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,
  39109. 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,
  39110. 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,
  39111. 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,
  39112. 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,
  39113. 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,
  39114. 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,
  39115. 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,
  39116. 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817
  39117. ];
  39118. function crypto_hashblocks_hl(hh, hl, m, n) {
  39119. var wh = new Int32Array(16), wl = new Int32Array(16),
  39120. bh0, bh1, bh2, bh3, bh4, bh5, bh6, bh7,
  39121. bl0, bl1, bl2, bl3, bl4, bl5, bl6, bl7,
  39122. th, tl, i, j, h, l, a, b, c, d;
  39123. var ah0 = hh[0],
  39124. ah1 = hh[1],
  39125. ah2 = hh[2],
  39126. ah3 = hh[3],
  39127. ah4 = hh[4],
  39128. ah5 = hh[5],
  39129. ah6 = hh[6],
  39130. ah7 = hh[7],
  39131. al0 = hl[0],
  39132. al1 = hl[1],
  39133. al2 = hl[2],
  39134. al3 = hl[3],
  39135. al4 = hl[4],
  39136. al5 = hl[5],
  39137. al6 = hl[6],
  39138. al7 = hl[7];
  39139. var pos = 0;
  39140. while (n >= 128) {
  39141. for (i = 0; i < 16; i++) {
  39142. j = 8 * i + pos;
  39143. wh[i] = (m[j+0] << 24) | (m[j+1] << 16) | (m[j+2] << 8) | m[j+3];
  39144. wl[i] = (m[j+4] << 24) | (m[j+5] << 16) | (m[j+6] << 8) | m[j+7];
  39145. }
  39146. for (i = 0; i < 80; i++) {
  39147. bh0 = ah0;
  39148. bh1 = ah1;
  39149. bh2 = ah2;
  39150. bh3 = ah3;
  39151. bh4 = ah4;
  39152. bh5 = ah5;
  39153. bh6 = ah6;
  39154. bh7 = ah7;
  39155. bl0 = al0;
  39156. bl1 = al1;
  39157. bl2 = al2;
  39158. bl3 = al3;
  39159. bl4 = al4;
  39160. bl5 = al5;
  39161. bl6 = al6;
  39162. bl7 = al7;
  39163. // add
  39164. h = ah7;
  39165. l = al7;
  39166. a = l & 0xffff; b = l >>> 16;
  39167. c = h & 0xffff; d = h >>> 16;
  39168. // Sigma1
  39169. h = ((ah4 >>> 14) | (al4 << (32-14))) ^ ((ah4 >>> 18) | (al4 << (32-18))) ^ ((al4 >>> (41-32)) | (ah4 << (32-(41-32))));
  39170. l = ((al4 >>> 14) | (ah4 << (32-14))) ^ ((al4 >>> 18) | (ah4 << (32-18))) ^ ((ah4 >>> (41-32)) | (al4 << (32-(41-32))));
  39171. a += l & 0xffff; b += l >>> 16;
  39172. c += h & 0xffff; d += h >>> 16;
  39173. // Ch
  39174. h = (ah4 & ah5) ^ (~ah4 & ah6);
  39175. l = (al4 & al5) ^ (~al4 & al6);
  39176. a += l & 0xffff; b += l >>> 16;
  39177. c += h & 0xffff; d += h >>> 16;
  39178. // K
  39179. h = K[i*2];
  39180. l = K[i*2+1];
  39181. a += l & 0xffff; b += l >>> 16;
  39182. c += h & 0xffff; d += h >>> 16;
  39183. // w
  39184. h = wh[i%16];
  39185. l = wl[i%16];
  39186. a += l & 0xffff; b += l >>> 16;
  39187. c += h & 0xffff; d += h >>> 16;
  39188. b += a >>> 16;
  39189. c += b >>> 16;
  39190. d += c >>> 16;
  39191. th = c & 0xffff | d << 16;
  39192. tl = a & 0xffff | b << 16;
  39193. // add
  39194. h = th;
  39195. l = tl;
  39196. a = l & 0xffff; b = l >>> 16;
  39197. c = h & 0xffff; d = h >>> 16;
  39198. // Sigma0
  39199. h = ((ah0 >>> 28) | (al0 << (32-28))) ^ ((al0 >>> (34-32)) | (ah0 << (32-(34-32)))) ^ ((al0 >>> (39-32)) | (ah0 << (32-(39-32))));
  39200. l = ((al0 >>> 28) | (ah0 << (32-28))) ^ ((ah0 >>> (34-32)) | (al0 << (32-(34-32)))) ^ ((ah0 >>> (39-32)) | (al0 << (32-(39-32))));
  39201. a += l & 0xffff; b += l >>> 16;
  39202. c += h & 0xffff; d += h >>> 16;
  39203. // Maj
  39204. h = (ah0 & ah1) ^ (ah0 & ah2) ^ (ah1 & ah2);
  39205. l = (al0 & al1) ^ (al0 & al2) ^ (al1 & al2);
  39206. a += l & 0xffff; b += l >>> 16;
  39207. c += h & 0xffff; d += h >>> 16;
  39208. b += a >>> 16;
  39209. c += b >>> 16;
  39210. d += c >>> 16;
  39211. bh7 = (c & 0xffff) | (d << 16);
  39212. bl7 = (a & 0xffff) | (b << 16);
  39213. // add
  39214. h = bh3;
  39215. l = bl3;
  39216. a = l & 0xffff; b = l >>> 16;
  39217. c = h & 0xffff; d = h >>> 16;
  39218. h = th;
  39219. l = tl;
  39220. a += l & 0xffff; b += l >>> 16;
  39221. c += h & 0xffff; d += h >>> 16;
  39222. b += a >>> 16;
  39223. c += b >>> 16;
  39224. d += c >>> 16;
  39225. bh3 = (c & 0xffff) | (d << 16);
  39226. bl3 = (a & 0xffff) | (b << 16);
  39227. ah1 = bh0;
  39228. ah2 = bh1;
  39229. ah3 = bh2;
  39230. ah4 = bh3;
  39231. ah5 = bh4;
  39232. ah6 = bh5;
  39233. ah7 = bh6;
  39234. ah0 = bh7;
  39235. al1 = bl0;
  39236. al2 = bl1;
  39237. al3 = bl2;
  39238. al4 = bl3;
  39239. al5 = bl4;
  39240. al6 = bl5;
  39241. al7 = bl6;
  39242. al0 = bl7;
  39243. if (i%16 === 15) {
  39244. for (j = 0; j < 16; j++) {
  39245. // add
  39246. h = wh[j];
  39247. l = wl[j];
  39248. a = l & 0xffff; b = l >>> 16;
  39249. c = h & 0xffff; d = h >>> 16;
  39250. h = wh[(j+9)%16];
  39251. l = wl[(j+9)%16];
  39252. a += l & 0xffff; b += l >>> 16;
  39253. c += h & 0xffff; d += h >>> 16;
  39254. // sigma0
  39255. th = wh[(j+1)%16];
  39256. tl = wl[(j+1)%16];
  39257. h = ((th >>> 1) | (tl << (32-1))) ^ ((th >>> 8) | (tl << (32-8))) ^ (th >>> 7);
  39258. l = ((tl >>> 1) | (th << (32-1))) ^ ((tl >>> 8) | (th << (32-8))) ^ ((tl >>> 7) | (th << (32-7)));
  39259. a += l & 0xffff; b += l >>> 16;
  39260. c += h & 0xffff; d += h >>> 16;
  39261. // sigma1
  39262. th = wh[(j+14)%16];
  39263. tl = wl[(j+14)%16];
  39264. h = ((th >>> 19) | (tl << (32-19))) ^ ((tl >>> (61-32)) | (th << (32-(61-32)))) ^ (th >>> 6);
  39265. l = ((tl >>> 19) | (th << (32-19))) ^ ((th >>> (61-32)) | (tl << (32-(61-32)))) ^ ((tl >>> 6) | (th << (32-6)));
  39266. a += l & 0xffff; b += l >>> 16;
  39267. c += h & 0xffff; d += h >>> 16;
  39268. b += a >>> 16;
  39269. c += b >>> 16;
  39270. d += c >>> 16;
  39271. wh[j] = (c & 0xffff) | (d << 16);
  39272. wl[j] = (a & 0xffff) | (b << 16);
  39273. }
  39274. }
  39275. }
  39276. // add
  39277. h = ah0;
  39278. l = al0;
  39279. a = l & 0xffff; b = l >>> 16;
  39280. c = h & 0xffff; d = h >>> 16;
  39281. h = hh[0];
  39282. l = hl[0];
  39283. a += l & 0xffff; b += l >>> 16;
  39284. c += h & 0xffff; d += h >>> 16;
  39285. b += a >>> 16;
  39286. c += b >>> 16;
  39287. d += c >>> 16;
  39288. hh[0] = ah0 = (c & 0xffff) | (d << 16);
  39289. hl[0] = al0 = (a & 0xffff) | (b << 16);
  39290. h = ah1;
  39291. l = al1;
  39292. a = l & 0xffff; b = l >>> 16;
  39293. c = h & 0xffff; d = h >>> 16;
  39294. h = hh[1];
  39295. l = hl[1];
  39296. a += l & 0xffff; b += l >>> 16;
  39297. c += h & 0xffff; d += h >>> 16;
  39298. b += a >>> 16;
  39299. c += b >>> 16;
  39300. d += c >>> 16;
  39301. hh[1] = ah1 = (c & 0xffff) | (d << 16);
  39302. hl[1] = al1 = (a & 0xffff) | (b << 16);
  39303. h = ah2;
  39304. l = al2;
  39305. a = l & 0xffff; b = l >>> 16;
  39306. c = h & 0xffff; d = h >>> 16;
  39307. h = hh[2];
  39308. l = hl[2];
  39309. a += l & 0xffff; b += l >>> 16;
  39310. c += h & 0xffff; d += h >>> 16;
  39311. b += a >>> 16;
  39312. c += b >>> 16;
  39313. d += c >>> 16;
  39314. hh[2] = ah2 = (c & 0xffff) | (d << 16);
  39315. hl[2] = al2 = (a & 0xffff) | (b << 16);
  39316. h = ah3;
  39317. l = al3;
  39318. a = l & 0xffff; b = l >>> 16;
  39319. c = h & 0xffff; d = h >>> 16;
  39320. h = hh[3];
  39321. l = hl[3];
  39322. a += l & 0xffff; b += l >>> 16;
  39323. c += h & 0xffff; d += h >>> 16;
  39324. b += a >>> 16;
  39325. c += b >>> 16;
  39326. d += c >>> 16;
  39327. hh[3] = ah3 = (c & 0xffff) | (d << 16);
  39328. hl[3] = al3 = (a & 0xffff) | (b << 16);
  39329. h = ah4;
  39330. l = al4;
  39331. a = l & 0xffff; b = l >>> 16;
  39332. c = h & 0xffff; d = h >>> 16;
  39333. h = hh[4];
  39334. l = hl[4];
  39335. a += l & 0xffff; b += l >>> 16;
  39336. c += h & 0xffff; d += h >>> 16;
  39337. b += a >>> 16;
  39338. c += b >>> 16;
  39339. d += c >>> 16;
  39340. hh[4] = ah4 = (c & 0xffff) | (d << 16);
  39341. hl[4] = al4 = (a & 0xffff) | (b << 16);
  39342. h = ah5;
  39343. l = al5;
  39344. a = l & 0xffff; b = l >>> 16;
  39345. c = h & 0xffff; d = h >>> 16;
  39346. h = hh[5];
  39347. l = hl[5];
  39348. a += l & 0xffff; b += l >>> 16;
  39349. c += h & 0xffff; d += h >>> 16;
  39350. b += a >>> 16;
  39351. c += b >>> 16;
  39352. d += c >>> 16;
  39353. hh[5] = ah5 = (c & 0xffff) | (d << 16);
  39354. hl[5] = al5 = (a & 0xffff) | (b << 16);
  39355. h = ah6;
  39356. l = al6;
  39357. a = l & 0xffff; b = l >>> 16;
  39358. c = h & 0xffff; d = h >>> 16;
  39359. h = hh[6];
  39360. l = hl[6];
  39361. a += l & 0xffff; b += l >>> 16;
  39362. c += h & 0xffff; d += h >>> 16;
  39363. b += a >>> 16;
  39364. c += b >>> 16;
  39365. d += c >>> 16;
  39366. hh[6] = ah6 = (c & 0xffff) | (d << 16);
  39367. hl[6] = al6 = (a & 0xffff) | (b << 16);
  39368. h = ah7;
  39369. l = al7;
  39370. a = l & 0xffff; b = l >>> 16;
  39371. c = h & 0xffff; d = h >>> 16;
  39372. h = hh[7];
  39373. l = hl[7];
  39374. a += l & 0xffff; b += l >>> 16;
  39375. c += h & 0xffff; d += h >>> 16;
  39376. b += a >>> 16;
  39377. c += b >>> 16;
  39378. d += c >>> 16;
  39379. hh[7] = ah7 = (c & 0xffff) | (d << 16);
  39380. hl[7] = al7 = (a & 0xffff) | (b << 16);
  39381. pos += 128;
  39382. n -= 128;
  39383. }
  39384. return n;
  39385. }
  39386. function crypto_hash(out, m, n) {
  39387. var hh = new Int32Array(8),
  39388. hl = new Int32Array(8),
  39389. x = new Uint8Array(256),
  39390. i, b = n;
  39391. hh[0] = 0x6a09e667;
  39392. hh[1] = 0xbb67ae85;
  39393. hh[2] = 0x3c6ef372;
  39394. hh[3] = 0xa54ff53a;
  39395. hh[4] = 0x510e527f;
  39396. hh[5] = 0x9b05688c;
  39397. hh[6] = 0x1f83d9ab;
  39398. hh[7] = 0x5be0cd19;
  39399. hl[0] = 0xf3bcc908;
  39400. hl[1] = 0x84caa73b;
  39401. hl[2] = 0xfe94f82b;
  39402. hl[3] = 0x5f1d36f1;
  39403. hl[4] = 0xade682d1;
  39404. hl[5] = 0x2b3e6c1f;
  39405. hl[6] = 0xfb41bd6b;
  39406. hl[7] = 0x137e2179;
  39407. crypto_hashblocks_hl(hh, hl, m, n);
  39408. n %= 128;
  39409. for (i = 0; i < n; i++) x[i] = m[b-n+i];
  39410. x[n] = 128;
  39411. n = 256-128*(n<112?1:0);
  39412. x[n-9] = 0;
  39413. ts64(x, n-8, (b / 0x20000000) | 0, b << 3);
  39414. crypto_hashblocks_hl(hh, hl, x, n);
  39415. for (i = 0; i < 8; i++) ts64(out, 8*i, hh[i], hl[i]);
  39416. return 0;
  39417. }
  39418. function add(p, q) {
  39419. var a = gf(), b = gf(), c = gf(),
  39420. d = gf(), e = gf(), f = gf(),
  39421. g = gf(), h = gf(), t = gf();
  39422. Z(a, p[1], p[0]);
  39423. Z(t, q[1], q[0]);
  39424. M(a, a, t);
  39425. A(b, p[0], p[1]);
  39426. A(t, q[0], q[1]);
  39427. M(b, b, t);
  39428. M(c, p[3], q[3]);
  39429. M(c, c, D2);
  39430. M(d, p[2], q[2]);
  39431. A(d, d, d);
  39432. Z(e, b, a);
  39433. Z(f, d, c);
  39434. A(g, d, c);
  39435. A(h, b, a);
  39436. M(p[0], e, f);
  39437. M(p[1], h, g);
  39438. M(p[2], g, f);
  39439. M(p[3], e, h);
  39440. }
  39441. function cswap(p, q, b) {
  39442. var i;
  39443. for (i = 0; i < 4; i++) {
  39444. sel25519(p[i], q[i], b);
  39445. }
  39446. }
  39447. function pack(r, p) {
  39448. var tx = gf(), ty = gf(), zi = gf();
  39449. inv25519(zi, p[2]);
  39450. M(tx, p[0], zi);
  39451. M(ty, p[1], zi);
  39452. pack25519(r, ty);
  39453. r[31] ^= par25519(tx) << 7;
  39454. }
  39455. function scalarmult(p, q, s) {
  39456. var b, i;
  39457. set25519(p[0], gf0);
  39458. set25519(p[1], gf1);
  39459. set25519(p[2], gf1);
  39460. set25519(p[3], gf0);
  39461. for (i = 255; i >= 0; --i) {
  39462. b = (s[(i/8)|0] >> (i&7)) & 1;
  39463. cswap(p, q, b);
  39464. add(q, p);
  39465. add(p, p);
  39466. cswap(p, q, b);
  39467. }
  39468. }
  39469. function scalarbase(p, s) {
  39470. var q = [gf(), gf(), gf(), gf()];
  39471. set25519(q[0], X);
  39472. set25519(q[1], Y);
  39473. set25519(q[2], gf1);
  39474. M(q[3], X, Y);
  39475. scalarmult(p, q, s);
  39476. }
  39477. function crypto_sign_keypair(pk, sk, seeded) {
  39478. var d = new Uint8Array(64);
  39479. var p = [gf(), gf(), gf(), gf()];
  39480. var i;
  39481. if (!seeded) randombytes(sk, 32);
  39482. crypto_hash(d, sk, 32);
  39483. d[0] &= 248;
  39484. d[31] &= 127;
  39485. d[31] |= 64;
  39486. scalarbase(p, d);
  39487. pack(pk, p);
  39488. for (i = 0; i < 32; i++) sk[i+32] = pk[i];
  39489. return 0;
  39490. }
  39491. 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]);
  39492. function modL(r, x) {
  39493. var carry, i, j, k;
  39494. for (i = 63; i >= 32; --i) {
  39495. carry = 0;
  39496. for (j = i - 32, k = i - 12; j < k; ++j) {
  39497. x[j] += carry - 16 * x[i] * L[j - (i - 32)];
  39498. carry = (x[j] + 128) >> 8;
  39499. x[j] -= carry * 256;
  39500. }
  39501. x[j] += carry;
  39502. x[i] = 0;
  39503. }
  39504. carry = 0;
  39505. for (j = 0; j < 32; j++) {
  39506. x[j] += carry - (x[31] >> 4) * L[j];
  39507. carry = x[j] >> 8;
  39508. x[j] &= 255;
  39509. }
  39510. for (j = 0; j < 32; j++) x[j] -= carry * L[j];
  39511. for (i = 0; i < 32; i++) {
  39512. x[i+1] += x[i] >> 8;
  39513. r[i] = x[i] & 255;
  39514. }
  39515. }
  39516. function reduce(r) {
  39517. var x = new Float64Array(64), i;
  39518. for (i = 0; i < 64; i++) x[i] = r[i];
  39519. for (i = 0; i < 64; i++) r[i] = 0;
  39520. modL(r, x);
  39521. }
  39522. // Note: difference from C - smlen returned, not passed as argument.
  39523. function crypto_sign(sm, m, n, sk) {
  39524. var d = new Uint8Array(64), h = new Uint8Array(64), r = new Uint8Array(64);
  39525. var i, j, x = new Float64Array(64);
  39526. var p = [gf(), gf(), gf(), gf()];
  39527. crypto_hash(d, sk, 32);
  39528. d[0] &= 248;
  39529. d[31] &= 127;
  39530. d[31] |= 64;
  39531. var smlen = n + 64;
  39532. for (i = 0; i < n; i++) sm[64 + i] = m[i];
  39533. for (i = 0; i < 32; i++) sm[32 + i] = d[32 + i];
  39534. crypto_hash(r, sm.subarray(32), n+32);
  39535. reduce(r);
  39536. scalarbase(p, r);
  39537. pack(sm, p);
  39538. for (i = 32; i < 64; i++) sm[i] = sk[i];
  39539. crypto_hash(h, sm, n + 64);
  39540. reduce(h);
  39541. for (i = 0; i < 64; i++) x[i] = 0;
  39542. for (i = 0; i < 32; i++) x[i] = r[i];
  39543. for (i = 0; i < 32; i++) {
  39544. for (j = 0; j < 32; j++) {
  39545. x[i+j] += h[i] * d[j];
  39546. }
  39547. }
  39548. modL(sm.subarray(32), x);
  39549. return smlen;
  39550. }
  39551. function unpackneg(r, p) {
  39552. var t = gf(), chk = gf(), num = gf(),
  39553. den = gf(), den2 = gf(), den4 = gf(),
  39554. den6 = gf();
  39555. set25519(r[2], gf1);
  39556. unpack25519(r[1], p);
  39557. S(num, r[1]);
  39558. M(den, num, D);
  39559. Z(num, num, r[2]);
  39560. A(den, r[2], den);
  39561. S(den2, den);
  39562. S(den4, den2);
  39563. M(den6, den4, den2);
  39564. M(t, den6, num);
  39565. M(t, t, den);
  39566. pow2523(t, t);
  39567. M(t, t, num);
  39568. M(t, t, den);
  39569. M(t, t, den);
  39570. M(r[0], t, den);
  39571. S(chk, r[0]);
  39572. M(chk, chk, den);
  39573. if (neq25519(chk, num)) M(r[0], r[0], I);
  39574. S(chk, r[0]);
  39575. M(chk, chk, den);
  39576. if (neq25519(chk, num)) return -1;
  39577. if (par25519(r[0]) === (p[31]>>7)) Z(r[0], gf0, r[0]);
  39578. M(r[3], r[0], r[1]);
  39579. return 0;
  39580. }
  39581. function crypto_sign_open(m, sm, n, pk) {
  39582. var i, mlen;
  39583. var t = new Uint8Array(32), h = new Uint8Array(64);
  39584. var p = [gf(), gf(), gf(), gf()],
  39585. q = [gf(), gf(), gf(), gf()];
  39586. mlen = -1;
  39587. if (n < 64) return -1;
  39588. if (unpackneg(q, pk)) return -1;
  39589. for (i = 0; i < n; i++) m[i] = sm[i];
  39590. for (i = 0; i < 32; i++) m[i+32] = pk[i];
  39591. crypto_hash(h, m, n);
  39592. reduce(h);
  39593. scalarmult(p, q, h);
  39594. scalarbase(q, sm.subarray(32));
  39595. add(p, q);
  39596. pack(t, p);
  39597. n -= 64;
  39598. if (crypto_verify_32(sm, 0, t, 0)) {
  39599. for (i = 0; i < n; i++) m[i] = 0;
  39600. return -1;
  39601. }
  39602. for (i = 0; i < n; i++) m[i] = sm[i + 64];
  39603. mlen = n;
  39604. return mlen;
  39605. }
  39606. var crypto_secretbox_KEYBYTES = 32,
  39607. crypto_secretbox_NONCEBYTES = 24,
  39608. crypto_secretbox_ZEROBYTES = 32,
  39609. crypto_secretbox_BOXZEROBYTES = 16,
  39610. crypto_scalarmult_BYTES = 32,
  39611. crypto_scalarmult_SCALARBYTES = 32,
  39612. crypto_box_PUBLICKEYBYTES = 32,
  39613. crypto_box_SECRETKEYBYTES = 32,
  39614. crypto_box_BEFORENMBYTES = 32,
  39615. crypto_box_NONCEBYTES = crypto_secretbox_NONCEBYTES,
  39616. crypto_box_ZEROBYTES = crypto_secretbox_ZEROBYTES,
  39617. crypto_box_BOXZEROBYTES = crypto_secretbox_BOXZEROBYTES,
  39618. crypto_sign_BYTES = 64,
  39619. crypto_sign_PUBLICKEYBYTES = 32,
  39620. crypto_sign_SECRETKEYBYTES = 64,
  39621. crypto_sign_SEEDBYTES = 32,
  39622. crypto_hash_BYTES = 64;
  39623. nacl.lowlevel = {
  39624. crypto_core_hsalsa20: crypto_core_hsalsa20,
  39625. crypto_stream_xor: crypto_stream_xor,
  39626. crypto_stream: crypto_stream,
  39627. crypto_stream_salsa20_xor: crypto_stream_salsa20_xor,
  39628. crypto_stream_salsa20: crypto_stream_salsa20,
  39629. crypto_onetimeauth: crypto_onetimeauth,
  39630. crypto_onetimeauth_verify: crypto_onetimeauth_verify,
  39631. crypto_verify_16: crypto_verify_16,
  39632. crypto_verify_32: crypto_verify_32,
  39633. crypto_secretbox: crypto_secretbox,
  39634. crypto_secretbox_open: crypto_secretbox_open,
  39635. crypto_scalarmult: crypto_scalarmult,
  39636. crypto_scalarmult_base: crypto_scalarmult_base,
  39637. crypto_box_beforenm: crypto_box_beforenm,
  39638. crypto_box_afternm: crypto_box_afternm,
  39639. crypto_box: crypto_box,
  39640. crypto_box_open: crypto_box_open,
  39641. crypto_box_keypair: crypto_box_keypair,
  39642. crypto_hash: crypto_hash,
  39643. crypto_sign: crypto_sign,
  39644. crypto_sign_keypair: crypto_sign_keypair,
  39645. crypto_sign_open: crypto_sign_open,
  39646. crypto_secretbox_KEYBYTES: crypto_secretbox_KEYBYTES,
  39647. crypto_secretbox_NONCEBYTES: crypto_secretbox_NONCEBYTES,
  39648. crypto_secretbox_ZEROBYTES: crypto_secretbox_ZEROBYTES,
  39649. crypto_secretbox_BOXZEROBYTES: crypto_secretbox_BOXZEROBYTES,
  39650. crypto_scalarmult_BYTES: crypto_scalarmult_BYTES,
  39651. crypto_scalarmult_SCALARBYTES: crypto_scalarmult_SCALARBYTES,
  39652. crypto_box_PUBLICKEYBYTES: crypto_box_PUBLICKEYBYTES,
  39653. crypto_box_SECRETKEYBYTES: crypto_box_SECRETKEYBYTES,
  39654. crypto_box_BEFORENMBYTES: crypto_box_BEFORENMBYTES,
  39655. crypto_box_NONCEBYTES: crypto_box_NONCEBYTES,
  39656. crypto_box_ZEROBYTES: crypto_box_ZEROBYTES,
  39657. crypto_box_BOXZEROBYTES: crypto_box_BOXZEROBYTES,
  39658. crypto_sign_BYTES: crypto_sign_BYTES,
  39659. crypto_sign_PUBLICKEYBYTES: crypto_sign_PUBLICKEYBYTES,
  39660. crypto_sign_SECRETKEYBYTES: crypto_sign_SECRETKEYBYTES,
  39661. crypto_sign_SEEDBYTES: crypto_sign_SEEDBYTES,
  39662. crypto_hash_BYTES: crypto_hash_BYTES
  39663. };
  39664. /* High-level API */
  39665. function checkLengths(k, n) {
  39666. if (k.length !== crypto_secretbox_KEYBYTES) throw new Error('bad key size');
  39667. if (n.length !== crypto_secretbox_NONCEBYTES) throw new Error('bad nonce size');
  39668. }
  39669. function checkBoxLengths(pk, sk) {
  39670. if (pk.length !== crypto_box_PUBLICKEYBYTES) throw new Error('bad public key size');
  39671. if (sk.length !== crypto_box_SECRETKEYBYTES) throw new Error('bad secret key size');
  39672. }
  39673. function checkArrayTypes() {
  39674. for (var i = 0; i < arguments.length; i++) {
  39675. if (!(arguments[i] instanceof Uint8Array))
  39676. throw new TypeError('unexpected type, use Uint8Array');
  39677. }
  39678. }
  39679. function cleanup(arr) {
  39680. for (var i = 0; i < arr.length; i++) arr[i] = 0;
  39681. }
  39682. nacl.randomBytes = function(n) {
  39683. var b = new Uint8Array(n);
  39684. randombytes(b, n);
  39685. return b;
  39686. };
  39687. nacl.secretbox = function(msg, nonce, key) {
  39688. checkArrayTypes(msg, nonce, key);
  39689. checkLengths(key, nonce);
  39690. var m = new Uint8Array(crypto_secretbox_ZEROBYTES + msg.length);
  39691. var c = new Uint8Array(m.length);
  39692. for (var i = 0; i < msg.length; i++) m[i+crypto_secretbox_ZEROBYTES] = msg[i];
  39693. crypto_secretbox(c, m, m.length, nonce, key);
  39694. return c.subarray(crypto_secretbox_BOXZEROBYTES);
  39695. };
  39696. nacl.secretbox.open = function(box, nonce, key) {
  39697. checkArrayTypes(box, nonce, key);
  39698. checkLengths(key, nonce);
  39699. var c = new Uint8Array(crypto_secretbox_BOXZEROBYTES + box.length);
  39700. var m = new Uint8Array(c.length);
  39701. for (var i = 0; i < box.length; i++) c[i+crypto_secretbox_BOXZEROBYTES] = box[i];
  39702. if (c.length < 32) return null;
  39703. if (crypto_secretbox_open(m, c, c.length, nonce, key) !== 0) return null;
  39704. return m.subarray(crypto_secretbox_ZEROBYTES);
  39705. };
  39706. nacl.secretbox.keyLength = crypto_secretbox_KEYBYTES;
  39707. nacl.secretbox.nonceLength = crypto_secretbox_NONCEBYTES;
  39708. nacl.secretbox.overheadLength = crypto_secretbox_BOXZEROBYTES;
  39709. nacl.scalarMult = function(n, p) {
  39710. checkArrayTypes(n, p);
  39711. if (n.length !== crypto_scalarmult_SCALARBYTES) throw new Error('bad n size');
  39712. if (p.length !== crypto_scalarmult_BYTES) throw new Error('bad p size');
  39713. var q = new Uint8Array(crypto_scalarmult_BYTES);
  39714. crypto_scalarmult(q, n, p);
  39715. return q;
  39716. };
  39717. nacl.scalarMult.base = function(n) {
  39718. checkArrayTypes(n);
  39719. if (n.length !== crypto_scalarmult_SCALARBYTES) throw new Error('bad n size');
  39720. var q = new Uint8Array(crypto_scalarmult_BYTES);
  39721. crypto_scalarmult_base(q, n);
  39722. return q;
  39723. };
  39724. nacl.scalarMult.scalarLength = crypto_scalarmult_SCALARBYTES;
  39725. nacl.scalarMult.groupElementLength = crypto_scalarmult_BYTES;
  39726. nacl.box = function(msg, nonce, publicKey, secretKey) {
  39727. var k = nacl.box.before(publicKey, secretKey);
  39728. return nacl.secretbox(msg, nonce, k);
  39729. };
  39730. nacl.box.before = function(publicKey, secretKey) {
  39731. checkArrayTypes(publicKey, secretKey);
  39732. checkBoxLengths(publicKey, secretKey);
  39733. var k = new Uint8Array(crypto_box_BEFORENMBYTES);
  39734. crypto_box_beforenm(k, publicKey, secretKey);
  39735. return k;
  39736. };
  39737. nacl.box.after = nacl.secretbox;
  39738. nacl.box.open = function(msg, nonce, publicKey, secretKey) {
  39739. var k = nacl.box.before(publicKey, secretKey);
  39740. return nacl.secretbox.open(msg, nonce, k);
  39741. };
  39742. nacl.box.open.after = nacl.secretbox.open;
  39743. nacl.box.keyPair = function() {
  39744. var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES);
  39745. var sk = new Uint8Array(crypto_box_SECRETKEYBYTES);
  39746. crypto_box_keypair(pk, sk);
  39747. return {publicKey: pk, secretKey: sk};
  39748. };
  39749. nacl.box.keyPair.fromSecretKey = function(secretKey) {
  39750. checkArrayTypes(secretKey);
  39751. if (secretKey.length !== crypto_box_SECRETKEYBYTES)
  39752. throw new Error('bad secret key size');
  39753. var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES);
  39754. crypto_scalarmult_base(pk, secretKey);
  39755. return {publicKey: pk, secretKey: new Uint8Array(secretKey)};
  39756. };
  39757. nacl.box.publicKeyLength = crypto_box_PUBLICKEYBYTES;
  39758. nacl.box.secretKeyLength = crypto_box_SECRETKEYBYTES;
  39759. nacl.box.sharedKeyLength = crypto_box_BEFORENMBYTES;
  39760. nacl.box.nonceLength = crypto_box_NONCEBYTES;
  39761. nacl.box.overheadLength = nacl.secretbox.overheadLength;
  39762. nacl.sign = function(msg, secretKey) {
  39763. checkArrayTypes(msg, secretKey);
  39764. if (secretKey.length !== crypto_sign_SECRETKEYBYTES)
  39765. throw new Error('bad secret key size');
  39766. var signedMsg = new Uint8Array(crypto_sign_BYTES+msg.length);
  39767. crypto_sign(signedMsg, msg, msg.length, secretKey);
  39768. return signedMsg;
  39769. };
  39770. nacl.sign.open = function(signedMsg, publicKey) {
  39771. checkArrayTypes(signedMsg, publicKey);
  39772. if (publicKey.length !== crypto_sign_PUBLICKEYBYTES)
  39773. throw new Error('bad public key size');
  39774. var tmp = new Uint8Array(signedMsg.length);
  39775. var mlen = crypto_sign_open(tmp, signedMsg, signedMsg.length, publicKey);
  39776. if (mlen < 0) return null;
  39777. var m = new Uint8Array(mlen);
  39778. for (var i = 0; i < m.length; i++) m[i] = tmp[i];
  39779. return m;
  39780. };
  39781. nacl.sign.detached = function(msg, secretKey) {
  39782. var signedMsg = nacl.sign(msg, secretKey);
  39783. var sig = new Uint8Array(crypto_sign_BYTES);
  39784. for (var i = 0; i < sig.length; i++) sig[i] = signedMsg[i];
  39785. return sig;
  39786. };
  39787. nacl.sign.detached.verify = function(msg, sig, publicKey) {
  39788. checkArrayTypes(msg, sig, publicKey);
  39789. if (sig.length !== crypto_sign_BYTES)
  39790. throw new Error('bad signature size');
  39791. if (publicKey.length !== crypto_sign_PUBLICKEYBYTES)
  39792. throw new Error('bad public key size');
  39793. var sm = new Uint8Array(crypto_sign_BYTES + msg.length);
  39794. var m = new Uint8Array(crypto_sign_BYTES + msg.length);
  39795. var i;
  39796. for (i = 0; i < crypto_sign_BYTES; i++) sm[i] = sig[i];
  39797. for (i = 0; i < msg.length; i++) sm[i+crypto_sign_BYTES] = msg[i];
  39798. return (crypto_sign_open(m, sm, sm.length, publicKey) >= 0);
  39799. };
  39800. nacl.sign.keyPair = function() {
  39801. var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);
  39802. var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES);
  39803. crypto_sign_keypair(pk, sk);
  39804. return {publicKey: pk, secretKey: sk};
  39805. };
  39806. nacl.sign.keyPair.fromSecretKey = function(secretKey) {
  39807. checkArrayTypes(secretKey);
  39808. if (secretKey.length !== crypto_sign_SECRETKEYBYTES)
  39809. throw new Error('bad secret key size');
  39810. var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);
  39811. for (var i = 0; i < pk.length; i++) pk[i] = secretKey[32+i];
  39812. return {publicKey: pk, secretKey: new Uint8Array(secretKey)};
  39813. };
  39814. nacl.sign.keyPair.fromSeed = function(seed) {
  39815. checkArrayTypes(seed);
  39816. if (seed.length !== crypto_sign_SEEDBYTES)
  39817. throw new Error('bad seed size');
  39818. var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);
  39819. var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES);
  39820. for (var i = 0; i < 32; i++) sk[i] = seed[i];
  39821. crypto_sign_keypair(pk, sk, true);
  39822. return {publicKey: pk, secretKey: sk};
  39823. };
  39824. nacl.sign.publicKeyLength = crypto_sign_PUBLICKEYBYTES;
  39825. nacl.sign.secretKeyLength = crypto_sign_SECRETKEYBYTES;
  39826. nacl.sign.seedLength = crypto_sign_SEEDBYTES;
  39827. nacl.sign.signatureLength = crypto_sign_BYTES;
  39828. nacl.hash = function(msg) {
  39829. checkArrayTypes(msg);
  39830. var h = new Uint8Array(crypto_hash_BYTES);
  39831. crypto_hash(h, msg, msg.length);
  39832. return h;
  39833. };
  39834. nacl.hash.hashLength = crypto_hash_BYTES;
  39835. nacl.verify = function(x, y) {
  39836. checkArrayTypes(x, y);
  39837. // Zero length arguments are considered not equal.
  39838. if (x.length === 0 || y.length === 0) return false;
  39839. if (x.length !== y.length) return false;
  39840. return (vn(x, 0, y, 0, x.length) === 0) ? true : false;
  39841. };
  39842. nacl.setPRNG = function(fn) {
  39843. randombytes = fn;
  39844. };
  39845. (function() {
  39846. // Initialize PRNG if environment provides CSPRNG.
  39847. // If not, methods calling randombytes will throw.
  39848. var crypto = typeof self !== 'undefined' ? (self.crypto || self.msCrypto) : null;
  39849. if (crypto && crypto.getRandomValues) {
  39850. // Browsers.
  39851. var QUOTA = 65536;
  39852. nacl.setPRNG(function(x, n) {
  39853. var i, v = new Uint8Array(n);
  39854. for (i = 0; i < n; i += QUOTA) {
  39855. crypto.getRandomValues(v.subarray(i, i + Math.min(n - i, QUOTA)));
  39856. }
  39857. for (i = 0; i < n; i++) x[i] = v[i];
  39858. cleanup(v);
  39859. });
  39860. } else if (true) {
  39861. // Node.js.
  39862. crypto = __webpack_require__(3);
  39863. if (crypto && crypto.randomBytes) {
  39864. nacl.setPRNG(function(x, n) {
  39865. var i, v = crypto.randomBytes(n);
  39866. for (i = 0; i < n; i++) x[i] = v[i];
  39867. cleanup(v);
  39868. });
  39869. }
  39870. }
  39871. })();
  39872. })( true && module.exports ? module.exports : (self.nacl = self.nacl || {}));
  39873. /***/ }),
  39874. /* 1 */
  39875. /***/ (function(module, exports, __webpack_require__) {
  39876. // Written in 2014-2016 by Dmitry Chestnykh and Devi Mandiri.
  39877. // Public domain.
  39878. (function(root, f) {
  39879. 'use strict';
  39880. if ( true && module.exports) module.exports = f();
  39881. else if (root.nacl) root.nacl.util = f();
  39882. else {
  39883. root.nacl = {};
  39884. root.nacl.util = f();
  39885. }
  39886. }(this, function() {
  39887. 'use strict';
  39888. var util = {};
  39889. function validateBase64(s) {
  39890. if (!(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(s))) {
  39891. throw new TypeError('invalid encoding');
  39892. }
  39893. }
  39894. util.decodeUTF8 = function(s) {
  39895. if (typeof s !== 'string') throw new TypeError('expected string');
  39896. var i, d = unescape(encodeURIComponent(s)), b = new Uint8Array(d.length);
  39897. for (i = 0; i < d.length; i++) b[i] = d.charCodeAt(i);
  39898. return b;
  39899. };
  39900. util.encodeUTF8 = function(arr) {
  39901. var i, s = [];
  39902. for (i = 0; i < arr.length; i++) s.push(String.fromCharCode(arr[i]));
  39903. return decodeURIComponent(escape(s.join('')));
  39904. };
  39905. if (typeof atob === 'undefined') {
  39906. // Node.js
  39907. if (typeof Buffer.from !== 'undefined') {
  39908. // Node v6 and later
  39909. util.encodeBase64 = function (arr) { // v6 and later
  39910. return Buffer.from(arr).toString('base64');
  39911. };
  39912. util.decodeBase64 = function (s) {
  39913. validateBase64(s);
  39914. return new Uint8Array(Array.prototype.slice.call(Buffer.from(s, 'base64'), 0));
  39915. };
  39916. } else {
  39917. // Node earlier than v6
  39918. util.encodeBase64 = function (arr) { // v6 and later
  39919. return (new Buffer(arr)).toString('base64');
  39920. };
  39921. util.decodeBase64 = function(s) {
  39922. validateBase64(s);
  39923. return new Uint8Array(Array.prototype.slice.call(new Buffer(s, 'base64'), 0));
  39924. };
  39925. }
  39926. } else {
  39927. // Browsers
  39928. util.encodeBase64 = function(arr) {
  39929. var i, s = [], len = arr.length;
  39930. for (i = 0; i < len; i++) s.push(String.fromCharCode(arr[i]));
  39931. return btoa(s.join(''));
  39932. };
  39933. util.decodeBase64 = function(s) {
  39934. validateBase64(s);
  39935. var i, d = atob(s), b = new Uint8Array(d.length);
  39936. for (i = 0; i < d.length; i++) b[i] = d.charCodeAt(i);
  39937. return b;
  39938. };
  39939. }
  39940. return util;
  39941. }));
  39942. /***/ }),
  39943. /* 2 */
  39944. /***/ (function(module, exports, __webpack_require__) {
  39945. // required so we don't have to do require('pusher').default etc.
  39946. module.exports = __webpack_require__(4).default;
  39947. /***/ }),
  39948. /* 3 */
  39949. /***/ (function(module, exports) {
  39950. /* (ignored) */
  39951. /***/ }),
  39952. /* 4 */
  39953. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39954. "use strict";
  39955. __webpack_require__.r(__webpack_exports__);
  39956. // CONCATENATED MODULE: ./src/runtimes/web/dom/script_receiver_factory.ts
  39957. var ScriptReceiverFactory = (function () {
  39958. function ScriptReceiverFactory(prefix, name) {
  39959. this.lastId = 0;
  39960. this.prefix = prefix;
  39961. this.name = name;
  39962. }
  39963. ScriptReceiverFactory.prototype.create = function (callback) {
  39964. this.lastId++;
  39965. var number = this.lastId;
  39966. var id = this.prefix + number;
  39967. var name = this.name + "[" + number + "]";
  39968. var called = false;
  39969. var callbackWrapper = function () {
  39970. if (!called) {
  39971. callback.apply(null, arguments);
  39972. called = true;
  39973. }
  39974. };
  39975. this[number] = callbackWrapper;
  39976. return { number: number, id: id, name: name, callback: callbackWrapper };
  39977. };
  39978. ScriptReceiverFactory.prototype.remove = function (receiver) {
  39979. delete this[receiver.number];
  39980. };
  39981. return ScriptReceiverFactory;
  39982. }());
  39983. var ScriptReceivers = new ScriptReceiverFactory("_pusher_script_", "Pusher.ScriptReceivers");
  39984. // CONCATENATED MODULE: ./src/core/defaults.ts
  39985. var Defaults = {
  39986. VERSION: "5.0.3",
  39987. PROTOCOL: 7,
  39988. host: 'ws.pusherapp.com',
  39989. ws_port: 80,
  39990. wss_port: 443,
  39991. ws_path: '',
  39992. sockjs_host: 'sockjs.pusher.com',
  39993. sockjs_http_port: 80,
  39994. sockjs_https_port: 443,
  39995. sockjs_path: '/pusher',
  39996. stats_host: 'stats.pusher.com',
  39997. channel_auth_endpoint: '/pusher/auth',
  39998. channel_auth_transport: 'ajax',
  39999. activity_timeout: 120000,
  40000. pong_timeout: 30000,
  40001. unavailable_timeout: 10000,
  40002. cdn_http: "http://js.pusher.com",
  40003. cdn_https: "https://js.pusher.com",
  40004. dependency_suffix: ""
  40005. };
  40006. /* harmony default export */ var defaults = (Defaults);
  40007. // CONCATENATED MODULE: ./src/runtimes/web/dom/dependency_loader.ts
  40008. var dependency_loader_DependencyLoader = (function () {
  40009. function DependencyLoader(options) {
  40010. this.options = options;
  40011. this.receivers = options.receivers || ScriptReceivers;
  40012. this.loading = {};
  40013. }
  40014. DependencyLoader.prototype.load = function (name, options, callback) {
  40015. var self = this;
  40016. if (self.loading[name] && self.loading[name].length > 0) {
  40017. self.loading[name].push(callback);
  40018. }
  40019. else {
  40020. self.loading[name] = [callback];
  40021. var request = runtime.createScriptRequest(self.getPath(name, options));
  40022. var receiver = self.receivers.create(function (error) {
  40023. self.receivers.remove(receiver);
  40024. if (self.loading[name]) {
  40025. var callbacks = self.loading[name];
  40026. delete self.loading[name];
  40027. var successCallback = function (wasSuccessful) {
  40028. if (!wasSuccessful) {
  40029. request.cleanup();
  40030. }
  40031. };
  40032. for (var i = 0; i < callbacks.length; i++) {
  40033. callbacks[i](error, successCallback);
  40034. }
  40035. }
  40036. });
  40037. request.send(receiver);
  40038. }
  40039. };
  40040. DependencyLoader.prototype.getRoot = function (options) {
  40041. var cdn;
  40042. var protocol = runtime.getDocument().location.protocol;
  40043. if ((options && options.useTLS) || protocol === "https:") {
  40044. cdn = this.options.cdn_https;
  40045. }
  40046. else {
  40047. cdn = this.options.cdn_http;
  40048. }
  40049. return cdn.replace(/\/*$/, "") + "/" + this.options.version;
  40050. };
  40051. DependencyLoader.prototype.getPath = function (name, options) {
  40052. return this.getRoot(options) + '/' + name + this.options.suffix + '.js';
  40053. };
  40054. ;
  40055. return DependencyLoader;
  40056. }());
  40057. /* harmony default export */ var dependency_loader = (dependency_loader_DependencyLoader);
  40058. // CONCATENATED MODULE: ./src/runtimes/web/dom/dependencies.ts
  40059. var DependenciesReceivers = new ScriptReceiverFactory("_pusher_dependencies", "Pusher.DependenciesReceivers");
  40060. var Dependencies = new dependency_loader({
  40061. cdn_http: defaults.cdn_http,
  40062. cdn_https: defaults.cdn_https,
  40063. version: defaults.VERSION,
  40064. suffix: defaults.dependency_suffix,
  40065. receivers: DependenciesReceivers
  40066. });
  40067. // CONCATENATED MODULE: ./src/core/base64.ts
  40068. function encode(s) {
  40069. return btoa(utob(s));
  40070. }
  40071. var fromCharCode = String.fromCharCode;
  40072. var b64chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
  40073. var b64tab = {};
  40074. for (var base64_i = 0, l = b64chars.length; base64_i < l; base64_i++) {
  40075. b64tab[b64chars.charAt(base64_i)] = base64_i;
  40076. }
  40077. var cb_utob = function (c) {
  40078. var cc = c.charCodeAt(0);
  40079. return cc < 0x80
  40080. ? c
  40081. : cc < 0x800
  40082. ? fromCharCode(0xc0 | (cc >>> 6)) + fromCharCode(0x80 | (cc & 0x3f))
  40083. : fromCharCode(0xe0 | ((cc >>> 12) & 0x0f)) +
  40084. fromCharCode(0x80 | ((cc >>> 6) & 0x3f)) +
  40085. fromCharCode(0x80 | (cc & 0x3f));
  40086. };
  40087. var utob = function (u) {
  40088. return u.replace(/[^\x00-\x7F]/g, cb_utob);
  40089. };
  40090. var cb_encode = function (ccc) {
  40091. var padlen = [0, 2, 1][ccc.length % 3];
  40092. var ord = (ccc.charCodeAt(0) << 16) |
  40093. ((ccc.length > 1 ? ccc.charCodeAt(1) : 0) << 8) |
  40094. (ccc.length > 2 ? ccc.charCodeAt(2) : 0);
  40095. var chars = [
  40096. b64chars.charAt(ord >>> 18),
  40097. b64chars.charAt((ord >>> 12) & 63),
  40098. padlen >= 2 ? '=' : b64chars.charAt((ord >>> 6) & 63),
  40099. padlen >= 1 ? '=' : b64chars.charAt(ord & 63)
  40100. ];
  40101. return chars.join('');
  40102. };
  40103. var btoa = window.btoa ||
  40104. function (b) {
  40105. return b.replace(/[\s\S]{1,3}/g, cb_encode);
  40106. };
  40107. // CONCATENATED MODULE: ./src/core/utils/timers/abstract_timer.ts
  40108. var Timer = (function () {
  40109. function Timer(set, clear, delay, callback) {
  40110. var _this = this;
  40111. this.clear = clear;
  40112. this.timer = set(function () {
  40113. if (_this.timer) {
  40114. _this.timer = callback(_this.timer);
  40115. }
  40116. }, delay);
  40117. }
  40118. Timer.prototype.isRunning = function () {
  40119. return this.timer !== null;
  40120. };
  40121. Timer.prototype.ensureAborted = function () {
  40122. if (this.timer) {
  40123. this.clear(this.timer);
  40124. this.timer = null;
  40125. }
  40126. };
  40127. return Timer;
  40128. }());
  40129. /* harmony default export */ var abstract_timer = (Timer);
  40130. // CONCATENATED MODULE: ./src/core/utils/timers/index.ts
  40131. var __extends = (undefined && undefined.__extends) || (function () {
  40132. var extendStatics = function (d, b) {
  40133. extendStatics = Object.setPrototypeOf ||
  40134. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  40135. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  40136. return extendStatics(d, b);
  40137. };
  40138. return function (d, b) {
  40139. extendStatics(d, b);
  40140. function __() { this.constructor = d; }
  40141. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  40142. };
  40143. })();
  40144. function timers_clearTimeout(timer) {
  40145. window.clearTimeout(timer);
  40146. }
  40147. function timers_clearInterval(timer) {
  40148. window.clearInterval(timer);
  40149. }
  40150. var OneOffTimer = (function (_super) {
  40151. __extends(OneOffTimer, _super);
  40152. function OneOffTimer(delay, callback) {
  40153. return _super.call(this, setTimeout, timers_clearTimeout, delay, function (timer) {
  40154. callback();
  40155. return null;
  40156. }) || this;
  40157. }
  40158. return OneOffTimer;
  40159. }(abstract_timer));
  40160. var PeriodicTimer = (function (_super) {
  40161. __extends(PeriodicTimer, _super);
  40162. function PeriodicTimer(delay, callback) {
  40163. return _super.call(this, setInterval, timers_clearInterval, delay, function (timer) {
  40164. callback();
  40165. return timer;
  40166. }) || this;
  40167. }
  40168. return PeriodicTimer;
  40169. }(abstract_timer));
  40170. // CONCATENATED MODULE: ./src/core/util.ts
  40171. var Util = {
  40172. now: function () {
  40173. if (Date.now) {
  40174. return Date.now();
  40175. }
  40176. else {
  40177. return new Date().valueOf();
  40178. }
  40179. },
  40180. defer: function (callback) {
  40181. return new OneOffTimer(0, callback);
  40182. },
  40183. method: function (name) {
  40184. var args = [];
  40185. for (var _i = 1; _i < arguments.length; _i++) {
  40186. args[_i - 1] = arguments[_i];
  40187. }
  40188. var boundArguments = Array.prototype.slice.call(arguments, 1);
  40189. return function (object) {
  40190. return object[name].apply(object, boundArguments.concat(arguments));
  40191. };
  40192. }
  40193. };
  40194. /* harmony default export */ var util = (Util);
  40195. // CONCATENATED MODULE: ./src/core/utils/collections.ts
  40196. function extend(target) {
  40197. var sources = [];
  40198. for (var _i = 1; _i < arguments.length; _i++) {
  40199. sources[_i - 1] = arguments[_i];
  40200. }
  40201. for (var i = 0; i < sources.length; i++) {
  40202. var extensions = sources[i];
  40203. for (var property in extensions) {
  40204. if (extensions[property] && extensions[property].constructor &&
  40205. extensions[property].constructor === Object) {
  40206. target[property] = extend(target[property] || {}, extensions[property]);
  40207. }
  40208. else {
  40209. target[property] = extensions[property];
  40210. }
  40211. }
  40212. }
  40213. return target;
  40214. }
  40215. function stringify() {
  40216. var m = ["Pusher"];
  40217. for (var i = 0; i < arguments.length; i++) {
  40218. if (typeof arguments[i] === "string") {
  40219. m.push(arguments[i]);
  40220. }
  40221. else {
  40222. m.push(safeJSONStringify(arguments[i]));
  40223. }
  40224. }
  40225. return m.join(" : ");
  40226. }
  40227. function arrayIndexOf(array, item) {
  40228. var nativeIndexOf = Array.prototype.indexOf;
  40229. if (array === null) {
  40230. return -1;
  40231. }
  40232. if (nativeIndexOf && array.indexOf === nativeIndexOf) {
  40233. return array.indexOf(item);
  40234. }
  40235. for (var i = 0, l = array.length; i < l; i++) {
  40236. if (array[i] === item) {
  40237. return i;
  40238. }
  40239. }
  40240. return -1;
  40241. }
  40242. function objectApply(object, f) {
  40243. for (var key in object) {
  40244. if (Object.prototype.hasOwnProperty.call(object, key)) {
  40245. f(object[key], key, object);
  40246. }
  40247. }
  40248. }
  40249. function keys(object) {
  40250. var keys = [];
  40251. objectApply(object, function (_, key) {
  40252. keys.push(key);
  40253. });
  40254. return keys;
  40255. }
  40256. function values(object) {
  40257. var values = [];
  40258. objectApply(object, function (value) {
  40259. values.push(value);
  40260. });
  40261. return values;
  40262. }
  40263. function apply(array, f, context) {
  40264. for (var i = 0; i < array.length; i++) {
  40265. f.call(context || window, array[i], i, array);
  40266. }
  40267. }
  40268. function map(array, f) {
  40269. var result = [];
  40270. for (var i = 0; i < array.length; i++) {
  40271. result.push(f(array[i], i, array, result));
  40272. }
  40273. return result;
  40274. }
  40275. function mapObject(object, f) {
  40276. var result = {};
  40277. objectApply(object, function (value, key) {
  40278. result[key] = f(value);
  40279. });
  40280. return result;
  40281. }
  40282. function filter(array, test) {
  40283. test = test || function (value) { return !!value; };
  40284. var result = [];
  40285. for (var i = 0; i < array.length; i++) {
  40286. if (test(array[i], i, array, result)) {
  40287. result.push(array[i]);
  40288. }
  40289. }
  40290. return result;
  40291. }
  40292. function filterObject(object, test) {
  40293. var result = {};
  40294. objectApply(object, function (value, key) {
  40295. if ((test && test(value, key, object, result)) || Boolean(value)) {
  40296. result[key] = value;
  40297. }
  40298. });
  40299. return result;
  40300. }
  40301. function flatten(object) {
  40302. var result = [];
  40303. objectApply(object, function (value, key) {
  40304. result.push([key, value]);
  40305. });
  40306. return result;
  40307. }
  40308. function any(array, test) {
  40309. for (var i = 0; i < array.length; i++) {
  40310. if (test(array[i], i, array)) {
  40311. return true;
  40312. }
  40313. }
  40314. return false;
  40315. }
  40316. function collections_all(array, test) {
  40317. for (var i = 0; i < array.length; i++) {
  40318. if (!test(array[i], i, array)) {
  40319. return false;
  40320. }
  40321. }
  40322. return true;
  40323. }
  40324. function encodeParamsObject(data) {
  40325. return mapObject(data, function (value) {
  40326. if (typeof value === "object") {
  40327. value = safeJSONStringify(value);
  40328. }
  40329. return encodeURIComponent(encode(value.toString()));
  40330. });
  40331. }
  40332. function buildQueryString(data) {
  40333. var params = filterObject(data, function (value) {
  40334. return value !== undefined;
  40335. });
  40336. var query = map(flatten(encodeParamsObject(params)), util.method("join", "=")).join("&");
  40337. return query;
  40338. }
  40339. function decycleObject(object) {
  40340. var objects = [], paths = [];
  40341. return (function derez(value, path) {
  40342. var i, name, nu;
  40343. switch (typeof value) {
  40344. case 'object':
  40345. if (!value) {
  40346. return null;
  40347. }
  40348. for (i = 0; i < objects.length; i += 1) {
  40349. if (objects[i] === value) {
  40350. return { $ref: paths[i] };
  40351. }
  40352. }
  40353. objects.push(value);
  40354. paths.push(path);
  40355. if (Object.prototype.toString.apply(value) === '[object Array]') {
  40356. nu = [];
  40357. for (i = 0; i < value.length; i += 1) {
  40358. nu[i] = derez(value[i], path + '[' + i + ']');
  40359. }
  40360. }
  40361. else {
  40362. nu = {};
  40363. for (name in value) {
  40364. if (Object.prototype.hasOwnProperty.call(value, name)) {
  40365. nu[name] = derez(value[name], path + '[' + JSON.stringify(name) + ']');
  40366. }
  40367. }
  40368. }
  40369. return nu;
  40370. case 'number':
  40371. case 'string':
  40372. case 'boolean':
  40373. return value;
  40374. }
  40375. }(object, '$'));
  40376. }
  40377. function safeJSONStringify(source) {
  40378. try {
  40379. return JSON.stringify(source);
  40380. }
  40381. catch (e) {
  40382. return JSON.stringify(decycleObject(source));
  40383. }
  40384. }
  40385. // CONCATENATED MODULE: ./src/core/logger.ts
  40386. var logger_Logger = (function () {
  40387. function Logger() {
  40388. this.globalLog = function (message) {
  40389. if (window.console && window.console.log) {
  40390. window.console.log(message);
  40391. }
  40392. };
  40393. }
  40394. Logger.prototype.debug = function () {
  40395. var args = [];
  40396. for (var _i = 0; _i < arguments.length; _i++) {
  40397. args[_i] = arguments[_i];
  40398. }
  40399. this.log(this.globalLog, args);
  40400. };
  40401. Logger.prototype.warn = function () {
  40402. var args = [];
  40403. for (var _i = 0; _i < arguments.length; _i++) {
  40404. args[_i] = arguments[_i];
  40405. }
  40406. this.log(this.globalLogWarn, args);
  40407. };
  40408. Logger.prototype.error = function () {
  40409. var args = [];
  40410. for (var _i = 0; _i < arguments.length; _i++) {
  40411. args[_i] = arguments[_i];
  40412. }
  40413. this.log(this.globalLogError, args);
  40414. };
  40415. Logger.prototype.globalLogWarn = function (message) {
  40416. if (window.console && window.console.warn) {
  40417. window.console.warn(message);
  40418. }
  40419. else {
  40420. this.globalLog(message);
  40421. }
  40422. };
  40423. Logger.prototype.globalLogError = function (message) {
  40424. if (window.console && window.console.error) {
  40425. window.console.error(message);
  40426. }
  40427. else {
  40428. this.globalLogWarn(message);
  40429. }
  40430. };
  40431. Logger.prototype.log = function (defaultLoggingFunction) {
  40432. var args = [];
  40433. for (var _i = 1; _i < arguments.length; _i++) {
  40434. args[_i - 1] = arguments[_i];
  40435. }
  40436. var message = stringify.apply(this, arguments);
  40437. if (core_pusher.log) {
  40438. core_pusher.log(message);
  40439. }
  40440. else if (core_pusher.logToConsole) {
  40441. var log = defaultLoggingFunction.bind(this);
  40442. log(message);
  40443. }
  40444. };
  40445. return Logger;
  40446. }());
  40447. /* harmony default export */ var logger = (new logger_Logger());
  40448. // CONCATENATED MODULE: ./src/core/utils/url_store.ts
  40449. var urlStore = {
  40450. baseUrl: "https://pusher.com",
  40451. urls: {
  40452. authenticationEndpoint: {
  40453. path: "/docs/authenticating_users",
  40454. },
  40455. javascriptQuickStart: {
  40456. path: "/docs/javascript_quick_start"
  40457. },
  40458. triggeringClientEvents: {
  40459. path: "/docs/client_api_guide/client_events#trigger-events"
  40460. }
  40461. }
  40462. };
  40463. var buildLogSuffix = function (key) {
  40464. var urlPrefix = "See:";
  40465. var urlObj = urlStore.urls[key];
  40466. if (!urlObj)
  40467. return "";
  40468. var url;
  40469. if (urlObj.fullUrl) {
  40470. url = urlObj.fullUrl;
  40471. }
  40472. else if (urlObj.path) {
  40473. url = urlStore.baseUrl + urlObj.path;
  40474. }
  40475. if (!url)
  40476. return "";
  40477. return urlPrefix + " " + url;
  40478. };
  40479. /* harmony default export */ var url_store = ({ buildLogSuffix: buildLogSuffix });
  40480. // CONCATENATED MODULE: ./src/runtimes/isomorphic/auth/xhr_auth.ts
  40481. var ajax = function (context, socketId, callback) {
  40482. var self = this, xhr;
  40483. xhr = runtime.createXHR();
  40484. xhr.open("POST", self.options.authEndpoint, true);
  40485. xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  40486. for (var headerName in this.authOptions.headers) {
  40487. xhr.setRequestHeader(headerName, this.authOptions.headers[headerName]);
  40488. }
  40489. xhr.onreadystatechange = function () {
  40490. if (xhr.readyState === 4) {
  40491. if (xhr.status === 200) {
  40492. var data, parsed = false;
  40493. try {
  40494. data = JSON.parse(xhr.responseText);
  40495. parsed = true;
  40496. }
  40497. catch (e) {
  40498. callback(true, 'JSON returned from auth endpoint was invalid, yet status code was 200. Data was: ' + xhr.responseText);
  40499. }
  40500. if (parsed) {
  40501. callback(false, data);
  40502. }
  40503. }
  40504. else {
  40505. var suffix = url_store.buildLogSuffix("authenticationEndpoint");
  40506. logger.error('Unable to retrieve auth string from auth endpoint - ' +
  40507. ("received status " + xhr.status + " from " + self.options.authEndpoint + ". ") +
  40508. ("Clients must be authenticated to join private or presence channels. " + suffix));
  40509. callback(true, xhr.status);
  40510. }
  40511. }
  40512. };
  40513. xhr.send(this.composeQuery(socketId));
  40514. return xhr;
  40515. };
  40516. /* harmony default export */ var xhr_auth = (ajax);
  40517. // CONCATENATED MODULE: ./src/runtimes/web/auth/jsonp_auth.ts
  40518. var jsonp = function (context, socketId, callback) {
  40519. if (this.authOptions.headers !== undefined) {
  40520. logger.warn('To send headers with the auth request, you must use AJAX, rather than JSONP.');
  40521. }
  40522. var callbackName = context.nextAuthCallbackID.toString();
  40523. context.nextAuthCallbackID++;
  40524. var document = context.getDocument();
  40525. var script = document.createElement("script");
  40526. context.auth_callbacks[callbackName] = function (data) {
  40527. callback(false, data);
  40528. };
  40529. var callback_name = "Pusher.auth_callbacks['" + callbackName + "']";
  40530. script.src = this.options.authEndpoint +
  40531. '?callback=' +
  40532. encodeURIComponent(callback_name) +
  40533. '&' +
  40534. this.composeQuery(socketId);
  40535. var head = document.getElementsByTagName("head")[0] || document.documentElement;
  40536. head.insertBefore(script, head.firstChild);
  40537. };
  40538. /* harmony default export */ var jsonp_auth = (jsonp);
  40539. // CONCATENATED MODULE: ./src/runtimes/web/dom/script_request.ts
  40540. var ScriptRequest = (function () {
  40541. function ScriptRequest(src) {
  40542. this.src = src;
  40543. }
  40544. ScriptRequest.prototype.send = function (receiver) {
  40545. var self = this;
  40546. var errorString = "Error loading " + self.src;
  40547. self.script = document.createElement("script");
  40548. self.script.id = receiver.id;
  40549. self.script.src = self.src;
  40550. self.script.type = "text/javascript";
  40551. self.script.charset = "UTF-8";
  40552. if (self.script.addEventListener) {
  40553. self.script.onerror = function () {
  40554. receiver.callback(errorString);
  40555. };
  40556. self.script.onload = function () {
  40557. receiver.callback(null);
  40558. };
  40559. }
  40560. else {
  40561. self.script.onreadystatechange = function () {
  40562. if (self.script.readyState === 'loaded' ||
  40563. self.script.readyState === 'complete') {
  40564. receiver.callback(null);
  40565. }
  40566. };
  40567. }
  40568. if (self.script.async === undefined && document.attachEvent &&
  40569. /opera/i.test(navigator.userAgent)) {
  40570. self.errorScript = document.createElement("script");
  40571. self.errorScript.id = receiver.id + "_error";
  40572. self.errorScript.text = receiver.name + "('" + errorString + "');";
  40573. self.script.async = self.errorScript.async = false;
  40574. }
  40575. else {
  40576. self.script.async = true;
  40577. }
  40578. var head = document.getElementsByTagName('head')[0];
  40579. head.insertBefore(self.script, head.firstChild);
  40580. if (self.errorScript) {
  40581. head.insertBefore(self.errorScript, self.script.nextSibling);
  40582. }
  40583. };
  40584. ScriptRequest.prototype.cleanup = function () {
  40585. if (this.script) {
  40586. this.script.onload = this.script.onerror = null;
  40587. this.script.onreadystatechange = null;
  40588. }
  40589. if (this.script && this.script.parentNode) {
  40590. this.script.parentNode.removeChild(this.script);
  40591. }
  40592. if (this.errorScript && this.errorScript.parentNode) {
  40593. this.errorScript.parentNode.removeChild(this.errorScript);
  40594. }
  40595. this.script = null;
  40596. this.errorScript = null;
  40597. };
  40598. return ScriptRequest;
  40599. }());
  40600. /* harmony default export */ var script_request = (ScriptRequest);
  40601. // CONCATENATED MODULE: ./src/runtimes/web/dom/jsonp_request.ts
  40602. var jsonp_request_JSONPRequest = (function () {
  40603. function JSONPRequest(url, data) {
  40604. this.url = url;
  40605. this.data = data;
  40606. }
  40607. JSONPRequest.prototype.send = function (receiver) {
  40608. if (this.request) {
  40609. return;
  40610. }
  40611. var query = buildQueryString(this.data);
  40612. var url = this.url + "/" + receiver.number + "?" + query;
  40613. this.request = runtime.createScriptRequest(url);
  40614. this.request.send(receiver);
  40615. };
  40616. JSONPRequest.prototype.cleanup = function () {
  40617. if (this.request) {
  40618. this.request.cleanup();
  40619. }
  40620. };
  40621. return JSONPRequest;
  40622. }());
  40623. /* harmony default export */ var jsonp_request = (jsonp_request_JSONPRequest);
  40624. // CONCATENATED MODULE: ./src/runtimes/web/timeline/jsonp_timeline.ts
  40625. var getAgent = function (sender, useTLS) {
  40626. return function (data, callback) {
  40627. var scheme = "http" + (useTLS ? "s" : "") + "://";
  40628. var url = scheme + (sender.host || sender.options.host) + sender.options.path;
  40629. var request = runtime.createJSONPRequest(url, data);
  40630. var receiver = runtime.ScriptReceivers.create(function (error, result) {
  40631. ScriptReceivers.remove(receiver);
  40632. request.cleanup();
  40633. if (result && result.host) {
  40634. sender.host = result.host;
  40635. }
  40636. if (callback) {
  40637. callback(error, result);
  40638. }
  40639. });
  40640. request.send(receiver);
  40641. };
  40642. };
  40643. var jsonp_timeline_jsonp = {
  40644. name: 'jsonp',
  40645. getAgent: getAgent
  40646. };
  40647. /* harmony default export */ var jsonp_timeline = (jsonp_timeline_jsonp);
  40648. // CONCATENATED MODULE: ./src/core/transports/url_schemes.ts
  40649. function getGenericURL(baseScheme, params, path) {
  40650. var scheme = baseScheme + (params.useTLS ? "s" : "");
  40651. var host = params.useTLS ? params.hostTLS : params.hostNonTLS;
  40652. return scheme + "://" + host + path;
  40653. }
  40654. function getGenericPath(key, queryString) {
  40655. var path = "/app/" + key;
  40656. var query = "?protocol=" + defaults.PROTOCOL +
  40657. "&client=js" +
  40658. "&version=" + defaults.VERSION +
  40659. (queryString ? ("&" + queryString) : "");
  40660. return path + query;
  40661. }
  40662. var ws = {
  40663. getInitial: function (key, params) {
  40664. var path = (params.httpPath || "") + getGenericPath(key, "flash=false");
  40665. return getGenericURL("ws", params, path);
  40666. }
  40667. };
  40668. var http = {
  40669. getInitial: function (key, params) {
  40670. var path = (params.httpPath || "/pusher") + getGenericPath(key);
  40671. return getGenericURL("http", params, path);
  40672. }
  40673. };
  40674. var sockjs = {
  40675. getInitial: function (key, params) {
  40676. return getGenericURL("http", params, params.httpPath || "/pusher");
  40677. },
  40678. getPath: function (key, params) {
  40679. return getGenericPath(key);
  40680. }
  40681. };
  40682. // CONCATENATED MODULE: ./src/core/events/callback_registry.ts
  40683. var callback_registry_CallbackRegistry = (function () {
  40684. function CallbackRegistry() {
  40685. this._callbacks = {};
  40686. }
  40687. CallbackRegistry.prototype.get = function (name) {
  40688. return this._callbacks[prefix(name)];
  40689. };
  40690. CallbackRegistry.prototype.add = function (name, callback, context) {
  40691. var prefixedEventName = prefix(name);
  40692. this._callbacks[prefixedEventName] = this._callbacks[prefixedEventName] || [];
  40693. this._callbacks[prefixedEventName].push({
  40694. fn: callback,
  40695. context: context
  40696. });
  40697. };
  40698. CallbackRegistry.prototype.remove = function (name, callback, context) {
  40699. if (!name && !callback && !context) {
  40700. this._callbacks = {};
  40701. return;
  40702. }
  40703. var names = name ? [prefix(name)] : keys(this._callbacks);
  40704. if (callback || context) {
  40705. this.removeCallback(names, callback, context);
  40706. }
  40707. else {
  40708. this.removeAllCallbacks(names);
  40709. }
  40710. };
  40711. CallbackRegistry.prototype.removeCallback = function (names, callback, context) {
  40712. apply(names, function (name) {
  40713. this._callbacks[name] = filter(this._callbacks[name] || [], function (binding) {
  40714. return (callback && callback !== binding.fn) ||
  40715. (context && context !== binding.context);
  40716. });
  40717. if (this._callbacks[name].length === 0) {
  40718. delete this._callbacks[name];
  40719. }
  40720. }, this);
  40721. };
  40722. CallbackRegistry.prototype.removeAllCallbacks = function (names) {
  40723. apply(names, function (name) {
  40724. delete this._callbacks[name];
  40725. }, this);
  40726. };
  40727. return CallbackRegistry;
  40728. }());
  40729. /* harmony default export */ var callback_registry = (callback_registry_CallbackRegistry);
  40730. function prefix(name) {
  40731. return "_" + name;
  40732. }
  40733. // CONCATENATED MODULE: ./src/core/events/dispatcher.ts
  40734. var dispatcher_Dispatcher = (function () {
  40735. function Dispatcher(failThrough) {
  40736. this.callbacks = new callback_registry();
  40737. this.global_callbacks = [];
  40738. this.failThrough = failThrough;
  40739. }
  40740. Dispatcher.prototype.bind = function (eventName, callback, context) {
  40741. this.callbacks.add(eventName, callback, context);
  40742. return this;
  40743. };
  40744. Dispatcher.prototype.bind_global = function (callback) {
  40745. this.global_callbacks.push(callback);
  40746. return this;
  40747. };
  40748. Dispatcher.prototype.unbind = function (eventName, callback, context) {
  40749. this.callbacks.remove(eventName, callback, context);
  40750. return this;
  40751. };
  40752. Dispatcher.prototype.unbind_global = function (callback) {
  40753. if (!callback) {
  40754. this.global_callbacks = [];
  40755. return this;
  40756. }
  40757. this.global_callbacks = filter(this.global_callbacks || [], function (c) { return c !== callback; });
  40758. return this;
  40759. };
  40760. Dispatcher.prototype.unbind_all = function () {
  40761. this.unbind();
  40762. this.unbind_global();
  40763. return this;
  40764. };
  40765. Dispatcher.prototype.emit = function (eventName, data, metadata) {
  40766. for (var i = 0; i < this.global_callbacks.length; i++) {
  40767. this.global_callbacks[i](eventName, data);
  40768. }
  40769. var callbacks = this.callbacks.get(eventName);
  40770. var args = [];
  40771. if (metadata) {
  40772. args.push(data, metadata);
  40773. }
  40774. else if (data) {
  40775. args.push(data);
  40776. }
  40777. if (callbacks && callbacks.length > 0) {
  40778. for (var i = 0; i < callbacks.length; i++) {
  40779. callbacks[i].fn.apply(callbacks[i].context || window, args);
  40780. }
  40781. }
  40782. else if (this.failThrough) {
  40783. this.failThrough(eventName, data);
  40784. }
  40785. return this;
  40786. };
  40787. return Dispatcher;
  40788. }());
  40789. /* harmony default export */ var dispatcher = (dispatcher_Dispatcher);
  40790. // CONCATENATED MODULE: ./src/core/transports/transport_connection.ts
  40791. var transport_connection_extends = (undefined && undefined.__extends) || (function () {
  40792. var extendStatics = function (d, b) {
  40793. extendStatics = Object.setPrototypeOf ||
  40794. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  40795. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  40796. return extendStatics(d, b);
  40797. };
  40798. return function (d, b) {
  40799. extendStatics(d, b);
  40800. function __() { this.constructor = d; }
  40801. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  40802. };
  40803. })();
  40804. var transport_connection_TransportConnection = (function (_super) {
  40805. transport_connection_extends(TransportConnection, _super);
  40806. function TransportConnection(hooks, name, priority, key, options) {
  40807. var _this = _super.call(this) || this;
  40808. _this.initialize = runtime.transportConnectionInitializer;
  40809. _this.hooks = hooks;
  40810. _this.name = name;
  40811. _this.priority = priority;
  40812. _this.key = key;
  40813. _this.options = options;
  40814. _this.state = "new";
  40815. _this.timeline = options.timeline;
  40816. _this.activityTimeout = options.activityTimeout;
  40817. _this.id = _this.timeline.generateUniqueID();
  40818. return _this;
  40819. }
  40820. TransportConnection.prototype.handlesActivityChecks = function () {
  40821. return Boolean(this.hooks.handlesActivityChecks);
  40822. };
  40823. TransportConnection.prototype.supportsPing = function () {
  40824. return Boolean(this.hooks.supportsPing);
  40825. };
  40826. TransportConnection.prototype.connect = function () {
  40827. var _this = this;
  40828. if (this.socket || this.state !== "initialized") {
  40829. return false;
  40830. }
  40831. var url = this.hooks.urls.getInitial(this.key, this.options);
  40832. try {
  40833. this.socket = this.hooks.getSocket(url, this.options);
  40834. }
  40835. catch (e) {
  40836. util.defer(function () {
  40837. _this.onError(e);
  40838. _this.changeState("closed");
  40839. });
  40840. return false;
  40841. }
  40842. this.bindListeners();
  40843. logger.debug("Connecting", { transport: this.name, url: url });
  40844. this.changeState("connecting");
  40845. return true;
  40846. };
  40847. TransportConnection.prototype.close = function () {
  40848. if (this.socket) {
  40849. this.socket.close();
  40850. return true;
  40851. }
  40852. else {
  40853. return false;
  40854. }
  40855. };
  40856. TransportConnection.prototype.send = function (data) {
  40857. var _this = this;
  40858. if (this.state === "open") {
  40859. util.defer(function () {
  40860. if (_this.socket) {
  40861. _this.socket.send(data);
  40862. }
  40863. });
  40864. return true;
  40865. }
  40866. else {
  40867. return false;
  40868. }
  40869. };
  40870. TransportConnection.prototype.ping = function () {
  40871. if (this.state === "open" && this.supportsPing()) {
  40872. this.socket.ping();
  40873. }
  40874. };
  40875. TransportConnection.prototype.onOpen = function () {
  40876. if (this.hooks.beforeOpen) {
  40877. this.hooks.beforeOpen(this.socket, this.hooks.urls.getPath(this.key, this.options));
  40878. }
  40879. this.changeState("open");
  40880. this.socket.onopen = undefined;
  40881. };
  40882. TransportConnection.prototype.onError = function (error) {
  40883. this.emit("error", { type: 'WebSocketError', error: error });
  40884. this.timeline.error(this.buildTimelineMessage({ error: error.toString() }));
  40885. };
  40886. TransportConnection.prototype.onClose = function (closeEvent) {
  40887. if (closeEvent) {
  40888. this.changeState("closed", {
  40889. code: closeEvent.code,
  40890. reason: closeEvent.reason,
  40891. wasClean: closeEvent.wasClean
  40892. });
  40893. }
  40894. else {
  40895. this.changeState("closed");
  40896. }
  40897. this.unbindListeners();
  40898. this.socket = undefined;
  40899. };
  40900. TransportConnection.prototype.onMessage = function (message) {
  40901. this.emit("message", message);
  40902. };
  40903. TransportConnection.prototype.onActivity = function () {
  40904. this.emit("activity");
  40905. };
  40906. TransportConnection.prototype.bindListeners = function () {
  40907. var _this = this;
  40908. this.socket.onopen = function () {
  40909. _this.onOpen();
  40910. };
  40911. this.socket.onerror = function (error) {
  40912. _this.onError(error);
  40913. };
  40914. this.socket.onclose = function (closeEvent) {
  40915. _this.onClose(closeEvent);
  40916. };
  40917. this.socket.onmessage = function (message) {
  40918. _this.onMessage(message);
  40919. };
  40920. if (this.supportsPing()) {
  40921. this.socket.onactivity = function () { _this.onActivity(); };
  40922. }
  40923. };
  40924. TransportConnection.prototype.unbindListeners = function () {
  40925. if (this.socket) {
  40926. this.socket.onopen = undefined;
  40927. this.socket.onerror = undefined;
  40928. this.socket.onclose = undefined;
  40929. this.socket.onmessage = undefined;
  40930. if (this.supportsPing()) {
  40931. this.socket.onactivity = undefined;
  40932. }
  40933. }
  40934. };
  40935. TransportConnection.prototype.changeState = function (state, params) {
  40936. this.state = state;
  40937. this.timeline.info(this.buildTimelineMessage({
  40938. state: state,
  40939. params: params
  40940. }));
  40941. this.emit(state, params);
  40942. };
  40943. TransportConnection.prototype.buildTimelineMessage = function (message) {
  40944. return extend({ cid: this.id }, message);
  40945. };
  40946. return TransportConnection;
  40947. }(dispatcher));
  40948. /* harmony default export */ var transport_connection = (transport_connection_TransportConnection);
  40949. // CONCATENATED MODULE: ./src/core/transports/transport.ts
  40950. var transport_Transport = (function () {
  40951. function Transport(hooks) {
  40952. this.hooks = hooks;
  40953. }
  40954. Transport.prototype.isSupported = function (environment) {
  40955. return this.hooks.isSupported(environment);
  40956. };
  40957. Transport.prototype.createConnection = function (name, priority, key, options) {
  40958. return new transport_connection(this.hooks, name, priority, key, options);
  40959. };
  40960. return Transport;
  40961. }());
  40962. /* harmony default export */ var transports_transport = (transport_Transport);
  40963. // CONCATENATED MODULE: ./src/runtimes/isomorphic/transports/transports.ts
  40964. var WSTransport = new transports_transport({
  40965. urls: ws,
  40966. handlesActivityChecks: false,
  40967. supportsPing: false,
  40968. isInitialized: function () {
  40969. return Boolean(runtime.getWebSocketAPI());
  40970. },
  40971. isSupported: function () {
  40972. return Boolean(runtime.getWebSocketAPI());
  40973. },
  40974. getSocket: function (url) {
  40975. return runtime.createWebSocket(url);
  40976. }
  40977. });
  40978. var httpConfiguration = {
  40979. urls: http,
  40980. handlesActivityChecks: false,
  40981. supportsPing: true,
  40982. isInitialized: function () {
  40983. return true;
  40984. }
  40985. };
  40986. var streamingConfiguration = extend({ getSocket: function (url) {
  40987. return runtime.HTTPFactory.createStreamingSocket(url);
  40988. }
  40989. }, httpConfiguration);
  40990. var pollingConfiguration = extend({ getSocket: function (url) {
  40991. return runtime.HTTPFactory.createPollingSocket(url);
  40992. }
  40993. }, httpConfiguration);
  40994. var xhrConfiguration = {
  40995. isSupported: function () {
  40996. return runtime.isXHRSupported();
  40997. }
  40998. };
  40999. var XHRStreamingTransport = new transports_transport(extend({}, streamingConfiguration, xhrConfiguration));
  41000. var XHRPollingTransport = new transports_transport(extend({}, pollingConfiguration, xhrConfiguration));
  41001. var Transports = {
  41002. ws: WSTransport,
  41003. xhr_streaming: XHRStreamingTransport,
  41004. xhr_polling: XHRPollingTransport
  41005. };
  41006. /* harmony default export */ var transports = (Transports);
  41007. // CONCATENATED MODULE: ./src/runtimes/web/transports/transports.ts
  41008. var SockJSTransport = new transports_transport({
  41009. file: "sockjs",
  41010. urls: sockjs,
  41011. handlesActivityChecks: true,
  41012. supportsPing: false,
  41013. isSupported: function () {
  41014. return true;
  41015. },
  41016. isInitialized: function () {
  41017. return window.SockJS !== undefined;
  41018. },
  41019. getSocket: function (url, options) {
  41020. return new window.SockJS(url, null, {
  41021. js_path: Dependencies.getPath("sockjs", {
  41022. useTLS: options.useTLS
  41023. }),
  41024. ignore_null_origin: options.ignoreNullOrigin
  41025. });
  41026. },
  41027. beforeOpen: function (socket, path) {
  41028. socket.send(JSON.stringify({
  41029. path: path
  41030. }));
  41031. }
  41032. });
  41033. var xdrConfiguration = {
  41034. isSupported: function (environment) {
  41035. var yes = runtime.isXDRSupported(environment.useTLS);
  41036. return yes;
  41037. }
  41038. };
  41039. var XDRStreamingTransport = new transports_transport(extend({}, streamingConfiguration, xdrConfiguration));
  41040. var XDRPollingTransport = new transports_transport(extend({}, pollingConfiguration, xdrConfiguration));
  41041. transports.xdr_streaming = XDRStreamingTransport;
  41042. transports.xdr_polling = XDRPollingTransport;
  41043. transports.sockjs = SockJSTransport;
  41044. /* harmony default export */ var transports_transports = (transports);
  41045. // CONCATENATED MODULE: ./src/runtimes/web/net_info.ts
  41046. var net_info_extends = (undefined && undefined.__extends) || (function () {
  41047. var extendStatics = function (d, b) {
  41048. extendStatics = Object.setPrototypeOf ||
  41049. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  41050. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  41051. return extendStatics(d, b);
  41052. };
  41053. return function (d, b) {
  41054. extendStatics(d, b);
  41055. function __() { this.constructor = d; }
  41056. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  41057. };
  41058. })();
  41059. var NetInfo = (function (_super) {
  41060. net_info_extends(NetInfo, _super);
  41061. function NetInfo() {
  41062. var _this = _super.call(this) || this;
  41063. var self = _this;
  41064. if (window.addEventListener !== undefined) {
  41065. window.addEventListener("online", function () {
  41066. self.emit('online');
  41067. }, false);
  41068. window.addEventListener("offline", function () {
  41069. self.emit('offline');
  41070. }, false);
  41071. }
  41072. return _this;
  41073. }
  41074. NetInfo.prototype.isOnline = function () {
  41075. if (window.navigator.onLine === undefined) {
  41076. return true;
  41077. }
  41078. else {
  41079. return window.navigator.onLine;
  41080. }
  41081. };
  41082. return NetInfo;
  41083. }(dispatcher));
  41084. var net_info_Network = new NetInfo();
  41085. // CONCATENATED MODULE: ./src/core/transports/assistant_to_the_transport_manager.ts
  41086. var assistant_to_the_transport_manager_AssistantToTheTransportManager = (function () {
  41087. function AssistantToTheTransportManager(manager, transport, options) {
  41088. this.manager = manager;
  41089. this.transport = transport;
  41090. this.minPingDelay = options.minPingDelay;
  41091. this.maxPingDelay = options.maxPingDelay;
  41092. this.pingDelay = undefined;
  41093. }
  41094. AssistantToTheTransportManager.prototype.createConnection = function (name, priority, key, options) {
  41095. var _this = this;
  41096. options = extend({}, options, {
  41097. activityTimeout: this.pingDelay
  41098. });
  41099. var connection = this.transport.createConnection(name, priority, key, options);
  41100. var openTimestamp = null;
  41101. var onOpen = function () {
  41102. connection.unbind("open", onOpen);
  41103. connection.bind("closed", onClosed);
  41104. openTimestamp = util.now();
  41105. };
  41106. var onClosed = function (closeEvent) {
  41107. connection.unbind("closed", onClosed);
  41108. if (closeEvent.code === 1002 || closeEvent.code === 1003) {
  41109. _this.manager.reportDeath();
  41110. }
  41111. else if (!closeEvent.wasClean && openTimestamp) {
  41112. var lifespan = util.now() - openTimestamp;
  41113. if (lifespan < 2 * _this.maxPingDelay) {
  41114. _this.manager.reportDeath();
  41115. _this.pingDelay = Math.max(lifespan / 2, _this.minPingDelay);
  41116. }
  41117. }
  41118. };
  41119. connection.bind("open", onOpen);
  41120. return connection;
  41121. };
  41122. AssistantToTheTransportManager.prototype.isSupported = function (environment) {
  41123. return this.manager.isAlive() && this.transport.isSupported(environment);
  41124. };
  41125. return AssistantToTheTransportManager;
  41126. }());
  41127. /* harmony default export */ var assistant_to_the_transport_manager = (assistant_to_the_transport_manager_AssistantToTheTransportManager);
  41128. // CONCATENATED MODULE: ./src/core/connection/protocol/protocol.ts
  41129. var Protocol = {
  41130. decodeMessage: function (messageEvent) {
  41131. try {
  41132. var messageData = JSON.parse(messageEvent.data);
  41133. var pusherEventData = messageData.data;
  41134. if (typeof pusherEventData === 'string') {
  41135. try {
  41136. pusherEventData = JSON.parse(messageData.data);
  41137. }
  41138. catch (e) { }
  41139. }
  41140. var pusherEvent = {
  41141. event: messageData.event,
  41142. channel: messageData.channel,
  41143. data: pusherEventData,
  41144. };
  41145. if (messageData.user_id) {
  41146. pusherEvent.user_id = messageData.user_id;
  41147. }
  41148. return pusherEvent;
  41149. }
  41150. catch (e) {
  41151. throw { type: 'MessageParseError', error: e, data: messageEvent.data };
  41152. }
  41153. },
  41154. encodeMessage: function (event) {
  41155. return JSON.stringify(event);
  41156. },
  41157. processHandshake: function (messageEvent) {
  41158. var message = Protocol.decodeMessage(messageEvent);
  41159. if (message.event === "pusher:connection_established") {
  41160. if (!message.data.activity_timeout) {
  41161. throw "No activity timeout specified in handshake";
  41162. }
  41163. return {
  41164. action: "connected",
  41165. id: message.data.socket_id,
  41166. activityTimeout: message.data.activity_timeout * 1000
  41167. };
  41168. }
  41169. else if (message.event === "pusher:error") {
  41170. return {
  41171. action: this.getCloseAction(message.data),
  41172. error: this.getCloseError(message.data)
  41173. };
  41174. }
  41175. else {
  41176. throw "Invalid handshake";
  41177. }
  41178. },
  41179. getCloseAction: function (closeEvent) {
  41180. if (closeEvent.code < 4000) {
  41181. if (closeEvent.code >= 1002 && closeEvent.code <= 1004) {
  41182. return "backoff";
  41183. }
  41184. else {
  41185. return null;
  41186. }
  41187. }
  41188. else if (closeEvent.code === 4000) {
  41189. return "tls_only";
  41190. }
  41191. else if (closeEvent.code < 4100) {
  41192. return "refused";
  41193. }
  41194. else if (closeEvent.code < 4200) {
  41195. return "backoff";
  41196. }
  41197. else if (closeEvent.code < 4300) {
  41198. return "retry";
  41199. }
  41200. else {
  41201. return "refused";
  41202. }
  41203. },
  41204. getCloseError: function (closeEvent) {
  41205. if (closeEvent.code !== 1000 && closeEvent.code !== 1001) {
  41206. return {
  41207. type: 'PusherError',
  41208. data: {
  41209. code: closeEvent.code,
  41210. message: closeEvent.reason || closeEvent.message
  41211. }
  41212. };
  41213. }
  41214. else {
  41215. return null;
  41216. }
  41217. }
  41218. };
  41219. /* harmony default export */ var protocol_protocol = (Protocol);
  41220. // CONCATENATED MODULE: ./src/core/connection/connection.ts
  41221. var connection_extends = (undefined && undefined.__extends) || (function () {
  41222. var extendStatics = function (d, b) {
  41223. extendStatics = Object.setPrototypeOf ||
  41224. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  41225. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  41226. return extendStatics(d, b);
  41227. };
  41228. return function (d, b) {
  41229. extendStatics(d, b);
  41230. function __() { this.constructor = d; }
  41231. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  41232. };
  41233. })();
  41234. var connection_Connection = (function (_super) {
  41235. connection_extends(Connection, _super);
  41236. function Connection(id, transport) {
  41237. var _this = _super.call(this) || this;
  41238. _this.id = id;
  41239. _this.transport = transport;
  41240. _this.activityTimeout = transport.activityTimeout;
  41241. _this.bindListeners();
  41242. return _this;
  41243. }
  41244. Connection.prototype.handlesActivityChecks = function () {
  41245. return this.transport.handlesActivityChecks();
  41246. };
  41247. Connection.prototype.send = function (data) {
  41248. return this.transport.send(data);
  41249. };
  41250. Connection.prototype.send_event = function (name, data, channel) {
  41251. var event = { event: name, data: data };
  41252. if (channel) {
  41253. event.channel = channel;
  41254. }
  41255. logger.debug('Event sent', event);
  41256. return this.send(protocol_protocol.encodeMessage(event));
  41257. };
  41258. Connection.prototype.ping = function () {
  41259. if (this.transport.supportsPing()) {
  41260. this.transport.ping();
  41261. }
  41262. else {
  41263. this.send_event('pusher:ping', {});
  41264. }
  41265. };
  41266. Connection.prototype.close = function () {
  41267. this.transport.close();
  41268. };
  41269. Connection.prototype.bindListeners = function () {
  41270. var _this = this;
  41271. var listeners = {
  41272. message: function (messageEvent) {
  41273. var pusherEvent;
  41274. try {
  41275. pusherEvent = protocol_protocol.decodeMessage(messageEvent);
  41276. }
  41277. catch (e) {
  41278. _this.emit('error', {
  41279. type: 'MessageParseError',
  41280. error: e,
  41281. data: messageEvent.data
  41282. });
  41283. }
  41284. if (pusherEvent !== undefined) {
  41285. logger.debug('Event recd', pusherEvent);
  41286. switch (pusherEvent.event) {
  41287. case 'pusher:error':
  41288. _this.emit('error', { type: 'PusherError', data: pusherEvent.data });
  41289. break;
  41290. case 'pusher:ping':
  41291. _this.emit("ping");
  41292. break;
  41293. case 'pusher:pong':
  41294. _this.emit("pong");
  41295. break;
  41296. }
  41297. _this.emit('message', pusherEvent);
  41298. }
  41299. },
  41300. activity: function () {
  41301. _this.emit("activity");
  41302. },
  41303. error: function (error) {
  41304. _this.emit("error", { type: "WebSocketError", error: error });
  41305. },
  41306. closed: function (closeEvent) {
  41307. unbindListeners();
  41308. if (closeEvent && closeEvent.code) {
  41309. _this.handleCloseEvent(closeEvent);
  41310. }
  41311. _this.transport = null;
  41312. _this.emit("closed");
  41313. }
  41314. };
  41315. var unbindListeners = function () {
  41316. objectApply(listeners, function (listener, event) {
  41317. _this.transport.unbind(event, listener);
  41318. });
  41319. };
  41320. objectApply(listeners, function (listener, event) {
  41321. _this.transport.bind(event, listener);
  41322. });
  41323. };
  41324. Connection.prototype.handleCloseEvent = function (closeEvent) {
  41325. var action = protocol_protocol.getCloseAction(closeEvent);
  41326. var error = protocol_protocol.getCloseError(closeEvent);
  41327. if (error) {
  41328. this.emit('error', error);
  41329. }
  41330. if (action) {
  41331. this.emit(action, { action: action, error: error });
  41332. }
  41333. };
  41334. return Connection;
  41335. }(dispatcher));
  41336. /* harmony default export */ var connection_connection = (connection_Connection);
  41337. // CONCATENATED MODULE: ./src/core/connection/handshake/index.ts
  41338. var handshake_Handshake = (function () {
  41339. function Handshake(transport, callback) {
  41340. this.transport = transport;
  41341. this.callback = callback;
  41342. this.bindListeners();
  41343. }
  41344. Handshake.prototype.close = function () {
  41345. this.unbindListeners();
  41346. this.transport.close();
  41347. };
  41348. Handshake.prototype.bindListeners = function () {
  41349. var _this = this;
  41350. this.onMessage = function (m) {
  41351. _this.unbindListeners();
  41352. var result;
  41353. try {
  41354. result = protocol_protocol.processHandshake(m);
  41355. }
  41356. catch (e) {
  41357. _this.finish("error", { error: e });
  41358. _this.transport.close();
  41359. return;
  41360. }
  41361. if (result.action === "connected") {
  41362. _this.finish("connected", {
  41363. connection: new connection_connection(result.id, _this.transport),
  41364. activityTimeout: result.activityTimeout
  41365. });
  41366. }
  41367. else {
  41368. _this.finish(result.action, { error: result.error });
  41369. _this.transport.close();
  41370. }
  41371. };
  41372. this.onClosed = function (closeEvent) {
  41373. _this.unbindListeners();
  41374. var action = protocol_protocol.getCloseAction(closeEvent) || "backoff";
  41375. var error = protocol_protocol.getCloseError(closeEvent);
  41376. _this.finish(action, { error: error });
  41377. };
  41378. this.transport.bind("message", this.onMessage);
  41379. this.transport.bind("closed", this.onClosed);
  41380. };
  41381. Handshake.prototype.unbindListeners = function () {
  41382. this.transport.unbind("message", this.onMessage);
  41383. this.transport.unbind("closed", this.onClosed);
  41384. };
  41385. Handshake.prototype.finish = function (action, params) {
  41386. this.callback(extend({ transport: this.transport, action: action }, params));
  41387. };
  41388. return Handshake;
  41389. }());
  41390. /* harmony default export */ var connection_handshake = (handshake_Handshake);
  41391. // CONCATENATED MODULE: ./src/core/auth/pusher_authorizer.ts
  41392. var pusher_authorizer_PusherAuthorizer = (function () {
  41393. function PusherAuthorizer(channel, options) {
  41394. this.channel = channel;
  41395. var authTransport = options.authTransport;
  41396. if (typeof runtime.getAuthorizers()[authTransport] === "undefined") {
  41397. throw "'" + authTransport + "' is not a recognized auth transport";
  41398. }
  41399. this.type = authTransport;
  41400. this.options = options;
  41401. this.authOptions = (options || {}).auth || {};
  41402. }
  41403. PusherAuthorizer.prototype.composeQuery = function (socketId) {
  41404. var query = 'socket_id=' + encodeURIComponent(socketId) +
  41405. '&channel_name=' + encodeURIComponent(this.channel.name);
  41406. for (var i in this.authOptions.params) {
  41407. query += "&" + encodeURIComponent(i) + "=" + encodeURIComponent(this.authOptions.params[i]);
  41408. }
  41409. return query;
  41410. };
  41411. PusherAuthorizer.prototype.authorize = function (socketId, callback) {
  41412. PusherAuthorizer.authorizers = PusherAuthorizer.authorizers || runtime.getAuthorizers();
  41413. return PusherAuthorizer.authorizers[this.type].call(this, runtime, socketId, callback);
  41414. };
  41415. return PusherAuthorizer;
  41416. }());
  41417. /* harmony default export */ var pusher_authorizer = (pusher_authorizer_PusherAuthorizer);
  41418. // CONCATENATED MODULE: ./src/core/timeline/timeline_sender.ts
  41419. var timeline_sender_TimelineSender = (function () {
  41420. function TimelineSender(timeline, options) {
  41421. this.timeline = timeline;
  41422. this.options = options || {};
  41423. }
  41424. TimelineSender.prototype.send = function (useTLS, callback) {
  41425. if (this.timeline.isEmpty()) {
  41426. return;
  41427. }
  41428. this.timeline.send(runtime.TimelineTransport.getAgent(this, useTLS), callback);
  41429. };
  41430. return TimelineSender;
  41431. }());
  41432. /* harmony default export */ var timeline_sender = (timeline_sender_TimelineSender);
  41433. // CONCATENATED MODULE: ./src/core/errors.ts
  41434. var errors_extends = (undefined && undefined.__extends) || (function () {
  41435. var extendStatics = function (d, b) {
  41436. extendStatics = Object.setPrototypeOf ||
  41437. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  41438. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  41439. return extendStatics(d, b);
  41440. };
  41441. return function (d, b) {
  41442. extendStatics(d, b);
  41443. function __() { this.constructor = d; }
  41444. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  41445. };
  41446. })();
  41447. var BadEventName = (function (_super) {
  41448. errors_extends(BadEventName, _super);
  41449. function BadEventName(msg) {
  41450. var _newTarget = this.constructor;
  41451. var _this = _super.call(this, msg) || this;
  41452. Object.setPrototypeOf(_this, _newTarget.prototype);
  41453. return _this;
  41454. }
  41455. return BadEventName;
  41456. }(Error));
  41457. var RequestTimedOut = (function (_super) {
  41458. errors_extends(RequestTimedOut, _super);
  41459. function RequestTimedOut(msg) {
  41460. var _newTarget = this.constructor;
  41461. var _this = _super.call(this, msg) || this;
  41462. Object.setPrototypeOf(_this, _newTarget.prototype);
  41463. return _this;
  41464. }
  41465. return RequestTimedOut;
  41466. }(Error));
  41467. var TransportPriorityTooLow = (function (_super) {
  41468. errors_extends(TransportPriorityTooLow, _super);
  41469. function TransportPriorityTooLow(msg) {
  41470. var _newTarget = this.constructor;
  41471. var _this = _super.call(this, msg) || this;
  41472. Object.setPrototypeOf(_this, _newTarget.prototype);
  41473. return _this;
  41474. }
  41475. return TransportPriorityTooLow;
  41476. }(Error));
  41477. var TransportClosed = (function (_super) {
  41478. errors_extends(TransportClosed, _super);
  41479. function TransportClosed(msg) {
  41480. var _newTarget = this.constructor;
  41481. var _this = _super.call(this, msg) || this;
  41482. Object.setPrototypeOf(_this, _newTarget.prototype);
  41483. return _this;
  41484. }
  41485. return TransportClosed;
  41486. }(Error));
  41487. var UnsupportedFeature = (function (_super) {
  41488. errors_extends(UnsupportedFeature, _super);
  41489. function UnsupportedFeature(msg) {
  41490. var _newTarget = this.constructor;
  41491. var _this = _super.call(this, msg) || this;
  41492. Object.setPrototypeOf(_this, _newTarget.prototype);
  41493. return _this;
  41494. }
  41495. return UnsupportedFeature;
  41496. }(Error));
  41497. var UnsupportedTransport = (function (_super) {
  41498. errors_extends(UnsupportedTransport, _super);
  41499. function UnsupportedTransport(msg) {
  41500. var _newTarget = this.constructor;
  41501. var _this = _super.call(this, msg) || this;
  41502. Object.setPrototypeOf(_this, _newTarget.prototype);
  41503. return _this;
  41504. }
  41505. return UnsupportedTransport;
  41506. }(Error));
  41507. var UnsupportedStrategy = (function (_super) {
  41508. errors_extends(UnsupportedStrategy, _super);
  41509. function UnsupportedStrategy(msg) {
  41510. var _newTarget = this.constructor;
  41511. var _this = _super.call(this, msg) || this;
  41512. Object.setPrototypeOf(_this, _newTarget.prototype);
  41513. return _this;
  41514. }
  41515. return UnsupportedStrategy;
  41516. }(Error));
  41517. // CONCATENATED MODULE: ./src/core/channels/channel.ts
  41518. var channel_extends = (undefined && undefined.__extends) || (function () {
  41519. var extendStatics = function (d, b) {
  41520. extendStatics = Object.setPrototypeOf ||
  41521. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  41522. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  41523. return extendStatics(d, b);
  41524. };
  41525. return function (d, b) {
  41526. extendStatics(d, b);
  41527. function __() { this.constructor = d; }
  41528. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  41529. };
  41530. })();
  41531. var channel_Channel = (function (_super) {
  41532. channel_extends(Channel, _super);
  41533. function Channel(name, pusher) {
  41534. var _this = _super.call(this, function (event, data) {
  41535. logger.debug('No callbacks on ' + name + ' for ' + event);
  41536. }) || this;
  41537. _this.name = name;
  41538. _this.pusher = pusher;
  41539. _this.subscribed = false;
  41540. _this.subscriptionPending = false;
  41541. _this.subscriptionCancelled = false;
  41542. return _this;
  41543. }
  41544. Channel.prototype.authorize = function (socketId, callback) {
  41545. return callback(false, {});
  41546. };
  41547. Channel.prototype.trigger = function (event, data) {
  41548. if (event.indexOf("client-") !== 0) {
  41549. throw new BadEventName("Event '" + event + "' does not start with 'client-'");
  41550. }
  41551. if (!this.subscribed) {
  41552. var suffix = url_store.buildLogSuffix("triggeringClientEvents");
  41553. logger.warn("Client event triggered before channel 'subscription_succeeded' event . " + suffix);
  41554. }
  41555. return this.pusher.send_event(event, data, this.name);
  41556. };
  41557. Channel.prototype.disconnect = function () {
  41558. this.subscribed = false;
  41559. this.subscriptionPending = false;
  41560. };
  41561. Channel.prototype.handleEvent = function (event) {
  41562. var eventName = event.event;
  41563. var data = event.data;
  41564. if (eventName === "pusher_internal:subscription_succeeded") {
  41565. this.handleSubscriptionSucceededEvent(event);
  41566. }
  41567. else if (eventName.indexOf("pusher_internal:") !== 0) {
  41568. var metadata = {};
  41569. this.emit(eventName, data, metadata);
  41570. }
  41571. };
  41572. Channel.prototype.handleSubscriptionSucceededEvent = function (event) {
  41573. this.subscriptionPending = false;
  41574. this.subscribed = true;
  41575. if (this.subscriptionCancelled) {
  41576. this.pusher.unsubscribe(this.name);
  41577. }
  41578. else {
  41579. this.emit("pusher:subscription_succeeded", event.data);
  41580. }
  41581. };
  41582. Channel.prototype.subscribe = function () {
  41583. var _this = this;
  41584. if (this.subscribed) {
  41585. return;
  41586. }
  41587. this.subscriptionPending = true;
  41588. this.subscriptionCancelled = false;
  41589. this.authorize(this.pusher.connection.socket_id, function (error, data) {
  41590. if (error) {
  41591. logger.error(data);
  41592. _this.emit('pusher:subscription_error', data);
  41593. }
  41594. else {
  41595. _this.pusher.send_event('pusher:subscribe', {
  41596. auth: data.auth,
  41597. channel_data: data.channel_data,
  41598. channel: _this.name
  41599. });
  41600. }
  41601. });
  41602. };
  41603. Channel.prototype.unsubscribe = function () {
  41604. this.subscribed = false;
  41605. this.pusher.send_event('pusher:unsubscribe', {
  41606. channel: this.name
  41607. });
  41608. };
  41609. Channel.prototype.cancelSubscription = function () {
  41610. this.subscriptionCancelled = true;
  41611. };
  41612. Channel.prototype.reinstateSubscription = function () {
  41613. this.subscriptionCancelled = false;
  41614. };
  41615. return Channel;
  41616. }(dispatcher));
  41617. /* harmony default export */ var channels_channel = (channel_Channel);
  41618. // CONCATENATED MODULE: ./src/core/channels/private_channel.ts
  41619. var private_channel_extends = (undefined && undefined.__extends) || (function () {
  41620. var extendStatics = function (d, b) {
  41621. extendStatics = Object.setPrototypeOf ||
  41622. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  41623. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  41624. return extendStatics(d, b);
  41625. };
  41626. return function (d, b) {
  41627. extendStatics(d, b);
  41628. function __() { this.constructor = d; }
  41629. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  41630. };
  41631. })();
  41632. var private_channel_PrivateChannel = (function (_super) {
  41633. private_channel_extends(PrivateChannel, _super);
  41634. function PrivateChannel() {
  41635. return _super !== null && _super.apply(this, arguments) || this;
  41636. }
  41637. PrivateChannel.prototype.authorize = function (socketId, callback) {
  41638. var authorizer = factory.createAuthorizer(this, this.pusher.config);
  41639. return authorizer.authorize(socketId, callback);
  41640. };
  41641. return PrivateChannel;
  41642. }(channels_channel));
  41643. /* harmony default export */ var private_channel = (private_channel_PrivateChannel);
  41644. // CONCATENATED MODULE: ./src/core/channels/members.ts
  41645. var members_Members = (function () {
  41646. function Members() {
  41647. this.reset();
  41648. }
  41649. Members.prototype.get = function (id) {
  41650. if (Object.prototype.hasOwnProperty.call(this.members, id)) {
  41651. return {
  41652. id: id,
  41653. info: this.members[id]
  41654. };
  41655. }
  41656. else {
  41657. return null;
  41658. }
  41659. };
  41660. Members.prototype.each = function (callback) {
  41661. var _this = this;
  41662. objectApply(this.members, function (member, id) {
  41663. callback(_this.get(id));
  41664. });
  41665. };
  41666. Members.prototype.setMyID = function (id) {
  41667. this.myID = id;
  41668. };
  41669. Members.prototype.onSubscription = function (subscriptionData) {
  41670. this.members = subscriptionData.presence.hash;
  41671. this.count = subscriptionData.presence.count;
  41672. this.me = this.get(this.myID);
  41673. };
  41674. Members.prototype.addMember = function (memberData) {
  41675. if (this.get(memberData.user_id) === null) {
  41676. this.count++;
  41677. }
  41678. this.members[memberData.user_id] = memberData.user_info;
  41679. return this.get(memberData.user_id);
  41680. };
  41681. Members.prototype.removeMember = function (memberData) {
  41682. var member = this.get(memberData.user_id);
  41683. if (member) {
  41684. delete this.members[memberData.user_id];
  41685. this.count--;
  41686. }
  41687. return member;
  41688. };
  41689. Members.prototype.reset = function () {
  41690. this.members = {};
  41691. this.count = 0;
  41692. this.myID = null;
  41693. this.me = null;
  41694. };
  41695. return Members;
  41696. }());
  41697. /* harmony default export */ var members = (members_Members);
  41698. // CONCATENATED MODULE: ./src/core/channels/presence_channel.ts
  41699. var presence_channel_extends = (undefined && undefined.__extends) || (function () {
  41700. var extendStatics = function (d, b) {
  41701. extendStatics = Object.setPrototypeOf ||
  41702. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  41703. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  41704. return extendStatics(d, b);
  41705. };
  41706. return function (d, b) {
  41707. extendStatics(d, b);
  41708. function __() { this.constructor = d; }
  41709. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  41710. };
  41711. })();
  41712. var presence_channel_PresenceChannel = (function (_super) {
  41713. presence_channel_extends(PresenceChannel, _super);
  41714. function PresenceChannel(name, pusher) {
  41715. var _this = _super.call(this, name, pusher) || this;
  41716. _this.members = new members();
  41717. return _this;
  41718. }
  41719. PresenceChannel.prototype.authorize = function (socketId, callback) {
  41720. var _this = this;
  41721. _super.prototype.authorize.call(this, socketId, function (error, authData) {
  41722. if (!error) {
  41723. if (authData.channel_data === undefined) {
  41724. var suffix = url_store.buildLogSuffix("authenticationEndpoint");
  41725. logger.error("Invalid auth response for channel '" + _this.name + "'," +
  41726. ("expected 'channel_data' field. " + suffix));
  41727. callback("Invalid auth response");
  41728. return;
  41729. }
  41730. var channelData = JSON.parse(authData.channel_data);
  41731. _this.members.setMyID(channelData.user_id);
  41732. }
  41733. callback(error, authData);
  41734. });
  41735. };
  41736. PresenceChannel.prototype.handleEvent = function (event) {
  41737. var eventName = event.event;
  41738. if (eventName.indexOf("pusher_internal:") === 0) {
  41739. this.handleInternalEvent(event);
  41740. }
  41741. else {
  41742. var data = event.data;
  41743. var metadata = {};
  41744. if (event.user_id) {
  41745. metadata.user_id = event.user_id;
  41746. }
  41747. this.emit(eventName, data, metadata);
  41748. }
  41749. };
  41750. PresenceChannel.prototype.handleInternalEvent = function (event) {
  41751. var eventName = event.event;
  41752. var data = event.data;
  41753. switch (eventName) {
  41754. case "pusher_internal:subscription_succeeded":
  41755. this.handleSubscriptionSucceededEvent(event);
  41756. break;
  41757. case "pusher_internal:member_added":
  41758. var addedMember = this.members.addMember(data);
  41759. this.emit('pusher:member_added', addedMember);
  41760. break;
  41761. case "pusher_internal:member_removed":
  41762. var removedMember = this.members.removeMember(data);
  41763. if (removedMember) {
  41764. this.emit('pusher:member_removed', removedMember);
  41765. }
  41766. break;
  41767. }
  41768. };
  41769. PresenceChannel.prototype.handleSubscriptionSucceededEvent = function (event) {
  41770. this.subscriptionPending = false;
  41771. this.subscribed = true;
  41772. if (this.subscriptionCancelled) {
  41773. this.pusher.unsubscribe(this.name);
  41774. }
  41775. else {
  41776. this.members.onSubscription(event.data);
  41777. this.emit("pusher:subscription_succeeded", this.members);
  41778. }
  41779. };
  41780. PresenceChannel.prototype.disconnect = function () {
  41781. this.members.reset();
  41782. _super.prototype.disconnect.call(this);
  41783. };
  41784. return PresenceChannel;
  41785. }(private_channel));
  41786. /* harmony default export */ var presence_channel = (presence_channel_PresenceChannel);
  41787. // EXTERNAL MODULE: ./node_modules/tweetnacl/nacl-fast.js
  41788. var nacl_fast = __webpack_require__(0);
  41789. // EXTERNAL MODULE: ./node_modules/tweetnacl-util/nacl-util.js
  41790. var nacl_util = __webpack_require__(1);
  41791. // CONCATENATED MODULE: ./src/core/channels/encrypted_channel.ts
  41792. var encrypted_channel_extends = (undefined && undefined.__extends) || (function () {
  41793. var extendStatics = function (d, b) {
  41794. extendStatics = Object.setPrototypeOf ||
  41795. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  41796. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  41797. return extendStatics(d, b);
  41798. };
  41799. return function (d, b) {
  41800. extendStatics(d, b);
  41801. function __() { this.constructor = d; }
  41802. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  41803. };
  41804. })();
  41805. var encrypted_channel_EncryptedChannel = (function (_super) {
  41806. encrypted_channel_extends(EncryptedChannel, _super);
  41807. function EncryptedChannel() {
  41808. var _this = _super !== null && _super.apply(this, arguments) || this;
  41809. _this.key = null;
  41810. return _this;
  41811. }
  41812. EncryptedChannel.prototype.authorize = function (socketId, callback) {
  41813. var _this = this;
  41814. _super.prototype.authorize.call(this, socketId, function (error, authData) {
  41815. if (error) {
  41816. callback(true, authData);
  41817. return;
  41818. }
  41819. var sharedSecret = authData["shared_secret"];
  41820. if (!sharedSecret) {
  41821. var errorMsg = "No shared_secret key in auth payload for encrypted channel: " + _this.name;
  41822. callback(true, errorMsg);
  41823. return;
  41824. }
  41825. _this.key = Object(nacl_util["decodeBase64"])(sharedSecret);
  41826. delete authData["shared_secret"];
  41827. callback(false, authData);
  41828. });
  41829. };
  41830. EncryptedChannel.prototype.trigger = function (event, data) {
  41831. throw new UnsupportedFeature('Client events are not currently supported for encrypted channels');
  41832. };
  41833. EncryptedChannel.prototype.handleEvent = function (event) {
  41834. var eventName = event.event;
  41835. var data = event.data;
  41836. if (eventName.indexOf("pusher_internal:") === 0 || eventName.indexOf("pusher:") === 0) {
  41837. _super.prototype.handleEvent.call(this, event);
  41838. return;
  41839. }
  41840. this.handleEncryptedEvent(eventName, data);
  41841. };
  41842. EncryptedChannel.prototype.handleEncryptedEvent = function (event, data) {
  41843. var _this = this;
  41844. if (!this.key) {
  41845. logger.debug('Received encrypted event before key has been retrieved from the authEndpoint');
  41846. return;
  41847. }
  41848. if (!data.ciphertext || !data.nonce) {
  41849. logger.error('Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: ' + data);
  41850. return;
  41851. }
  41852. var cipherText = Object(nacl_util["decodeBase64"])(data.ciphertext);
  41853. if (cipherText.length < nacl_fast["secretbox"].overheadLength) {
  41854. logger.error("Expected encrypted event ciphertext length to be " + nacl_fast["secretbox"].overheadLength + ", got: " + cipherText.length);
  41855. return;
  41856. }
  41857. var nonce = Object(nacl_util["decodeBase64"])(data.nonce);
  41858. if (nonce.length < nacl_fast["secretbox"].nonceLength) {
  41859. logger.error("Expected encrypted event nonce length to be " + nacl_fast["secretbox"].nonceLength + ", got: " + nonce.length);
  41860. return;
  41861. }
  41862. var bytes = nacl_fast["secretbox"].open(cipherText, nonce, this.key);
  41863. if (bytes === null) {
  41864. logger.debug('Failed to decrypt an event, probably because it was encrypted with a different key. Fetching a new key from the authEndpoint...');
  41865. this.authorize(this.pusher.connection.socket_id, function (error, authData) {
  41866. if (error) {
  41867. logger.error("Failed to make a request to the authEndpoint: " + authData + ". Unable to fetch new key, so dropping encrypted event");
  41868. return;
  41869. }
  41870. bytes = nacl_fast["secretbox"].open(cipherText, nonce, _this.key);
  41871. if (bytes === null) {
  41872. logger.error("Failed to decrypt event with new key. Dropping encrypted event");
  41873. return;
  41874. }
  41875. _this.emitJSON(event, Object(nacl_util["encodeUTF8"])(bytes));
  41876. return;
  41877. });
  41878. return;
  41879. }
  41880. this.emitJSON(event, Object(nacl_util["encodeUTF8"])(bytes));
  41881. };
  41882. EncryptedChannel.prototype.emitJSON = function (eventName, data) {
  41883. try {
  41884. this.emit(eventName, JSON.parse(data));
  41885. }
  41886. catch (e) {
  41887. this.emit(eventName, data);
  41888. }
  41889. return this;
  41890. };
  41891. return EncryptedChannel;
  41892. }(private_channel));
  41893. /* harmony default export */ var encrypted_channel = (encrypted_channel_EncryptedChannel);
  41894. // CONCATENATED MODULE: ./src/core/connection/connection_manager.ts
  41895. var connection_manager_extends = (undefined && undefined.__extends) || (function () {
  41896. var extendStatics = function (d, b) {
  41897. extendStatics = Object.setPrototypeOf ||
  41898. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  41899. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  41900. return extendStatics(d, b);
  41901. };
  41902. return function (d, b) {
  41903. extendStatics(d, b);
  41904. function __() { this.constructor = d; }
  41905. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  41906. };
  41907. })();
  41908. var connection_manager_ConnectionManager = (function (_super) {
  41909. connection_manager_extends(ConnectionManager, _super);
  41910. function ConnectionManager(key, options) {
  41911. var _this = _super.call(this) || this;
  41912. _this.key = key;
  41913. _this.options = options || {};
  41914. _this.state = "initialized";
  41915. _this.connection = null;
  41916. _this.usingTLS = !!options.useTLS;
  41917. _this.timeline = _this.options.timeline;
  41918. _this.errorCallbacks = _this.buildErrorCallbacks();
  41919. _this.connectionCallbacks = _this.buildConnectionCallbacks(_this.errorCallbacks);
  41920. _this.handshakeCallbacks = _this.buildHandshakeCallbacks(_this.errorCallbacks);
  41921. var Network = runtime.getNetwork();
  41922. Network.bind("online", function () {
  41923. _this.timeline.info({ netinfo: "online" });
  41924. if (_this.state === "connecting" || _this.state === "unavailable") {
  41925. _this.retryIn(0);
  41926. }
  41927. });
  41928. Network.bind("offline", function () {
  41929. _this.timeline.info({ netinfo: "offline" });
  41930. if (_this.connection) {
  41931. _this.sendActivityCheck();
  41932. }
  41933. });
  41934. _this.updateStrategy();
  41935. return _this;
  41936. }
  41937. ConnectionManager.prototype.connect = function () {
  41938. if (this.connection || this.runner) {
  41939. return;
  41940. }
  41941. if (!this.strategy.isSupported()) {
  41942. this.updateState("failed");
  41943. return;
  41944. }
  41945. this.updateState("connecting");
  41946. this.startConnecting();
  41947. this.setUnavailableTimer();
  41948. };
  41949. ;
  41950. ConnectionManager.prototype.send = function (data) {
  41951. if (this.connection) {
  41952. return this.connection.send(data);
  41953. }
  41954. else {
  41955. return false;
  41956. }
  41957. };
  41958. ;
  41959. ConnectionManager.prototype.send_event = function (name, data, channel) {
  41960. if (this.connection) {
  41961. return this.connection.send_event(name, data, channel);
  41962. }
  41963. else {
  41964. return false;
  41965. }
  41966. };
  41967. ;
  41968. ConnectionManager.prototype.disconnect = function () {
  41969. this.disconnectInternally();
  41970. this.updateState("disconnected");
  41971. };
  41972. ;
  41973. ConnectionManager.prototype.isUsingTLS = function () {
  41974. return this.usingTLS;
  41975. };
  41976. ;
  41977. ConnectionManager.prototype.startConnecting = function () {
  41978. var _this = this;
  41979. var callback = function (error, handshake) {
  41980. if (error) {
  41981. _this.runner = _this.strategy.connect(0, callback);
  41982. }
  41983. else {
  41984. if (handshake.action === "error") {
  41985. _this.emit("error", { type: "HandshakeError", error: handshake.error });
  41986. _this.timeline.error({ handshakeError: handshake.error });
  41987. }
  41988. else {
  41989. _this.abortConnecting();
  41990. _this.handshakeCallbacks[handshake.action](handshake);
  41991. }
  41992. }
  41993. };
  41994. this.runner = this.strategy.connect(0, callback);
  41995. };
  41996. ;
  41997. ConnectionManager.prototype.abortConnecting = function () {
  41998. if (this.runner) {
  41999. this.runner.abort();
  42000. this.runner = null;
  42001. }
  42002. };
  42003. ;
  42004. ConnectionManager.prototype.disconnectInternally = function () {
  42005. this.abortConnecting();
  42006. this.clearRetryTimer();
  42007. this.clearUnavailableTimer();
  42008. if (this.connection) {
  42009. var connection = this.abandonConnection();
  42010. connection.close();
  42011. }
  42012. };
  42013. ;
  42014. ConnectionManager.prototype.updateStrategy = function () {
  42015. this.strategy = this.options.getStrategy({
  42016. key: this.key,
  42017. timeline: this.timeline,
  42018. useTLS: this.usingTLS
  42019. });
  42020. };
  42021. ;
  42022. ConnectionManager.prototype.retryIn = function (delay) {
  42023. var _this = this;
  42024. this.timeline.info({ action: "retry", delay: delay });
  42025. if (delay > 0) {
  42026. this.emit("connecting_in", Math.round(delay / 1000));
  42027. }
  42028. this.retryTimer = new OneOffTimer(delay || 0, function () {
  42029. _this.disconnectInternally();
  42030. _this.connect();
  42031. });
  42032. };
  42033. ;
  42034. ConnectionManager.prototype.clearRetryTimer = function () {
  42035. if (this.retryTimer) {
  42036. this.retryTimer.ensureAborted();
  42037. this.retryTimer = null;
  42038. }
  42039. };
  42040. ;
  42041. ConnectionManager.prototype.setUnavailableTimer = function () {
  42042. var _this = this;
  42043. this.unavailableTimer = new OneOffTimer(this.options.unavailableTimeout, function () {
  42044. _this.updateState("unavailable");
  42045. });
  42046. };
  42047. ;
  42048. ConnectionManager.prototype.clearUnavailableTimer = function () {
  42049. if (this.unavailableTimer) {
  42050. this.unavailableTimer.ensureAborted();
  42051. }
  42052. };
  42053. ;
  42054. ConnectionManager.prototype.sendActivityCheck = function () {
  42055. var _this = this;
  42056. this.stopActivityCheck();
  42057. this.connection.ping();
  42058. this.activityTimer = new OneOffTimer(this.options.pongTimeout, function () {
  42059. _this.timeline.error({ pong_timed_out: _this.options.pongTimeout });
  42060. _this.retryIn(0);
  42061. });
  42062. };
  42063. ;
  42064. ConnectionManager.prototype.resetActivityCheck = function () {
  42065. var _this = this;
  42066. this.stopActivityCheck();
  42067. if (this.connection && !this.connection.handlesActivityChecks()) {
  42068. this.activityTimer = new OneOffTimer(this.activityTimeout, function () {
  42069. _this.sendActivityCheck();
  42070. });
  42071. }
  42072. };
  42073. ;
  42074. ConnectionManager.prototype.stopActivityCheck = function () {
  42075. if (this.activityTimer) {
  42076. this.activityTimer.ensureAborted();
  42077. }
  42078. };
  42079. ;
  42080. ConnectionManager.prototype.buildConnectionCallbacks = function (errorCallbacks) {
  42081. var _this = this;
  42082. return extend({}, errorCallbacks, {
  42083. message: function (message) {
  42084. _this.resetActivityCheck();
  42085. _this.emit('message', message);
  42086. },
  42087. ping: function () {
  42088. _this.send_event('pusher:pong', {});
  42089. },
  42090. activity: function () {
  42091. _this.resetActivityCheck();
  42092. },
  42093. error: function (error) {
  42094. _this.emit("error", { type: "WebSocketError", error: error });
  42095. },
  42096. closed: function () {
  42097. _this.abandonConnection();
  42098. if (_this.shouldRetry()) {
  42099. _this.retryIn(1000);
  42100. }
  42101. }
  42102. });
  42103. };
  42104. ;
  42105. ConnectionManager.prototype.buildHandshakeCallbacks = function (errorCallbacks) {
  42106. var _this = this;
  42107. return extend({}, errorCallbacks, {
  42108. connected: function (handshake) {
  42109. _this.activityTimeout = Math.min(_this.options.activityTimeout, handshake.activityTimeout, handshake.connection.activityTimeout || Infinity);
  42110. _this.clearUnavailableTimer();
  42111. _this.setConnection(handshake.connection);
  42112. _this.socket_id = _this.connection.id;
  42113. _this.updateState("connected", { socket_id: _this.socket_id });
  42114. }
  42115. });
  42116. };
  42117. ;
  42118. ConnectionManager.prototype.buildErrorCallbacks = function () {
  42119. var _this = this;
  42120. var withErrorEmitted = function (callback) {
  42121. return function (result) {
  42122. if (result.error) {
  42123. _this.emit("error", { type: "WebSocketError", error: result.error });
  42124. }
  42125. callback(result);
  42126. };
  42127. };
  42128. return {
  42129. tls_only: withErrorEmitted(function () {
  42130. _this.usingTLS = true;
  42131. _this.updateStrategy();
  42132. _this.retryIn(0);
  42133. }),
  42134. refused: withErrorEmitted(function () {
  42135. _this.disconnect();
  42136. }),
  42137. backoff: withErrorEmitted(function () {
  42138. _this.retryIn(1000);
  42139. }),
  42140. retry: withErrorEmitted(function () {
  42141. _this.retryIn(0);
  42142. })
  42143. };
  42144. };
  42145. ;
  42146. ConnectionManager.prototype.setConnection = function (connection) {
  42147. this.connection = connection;
  42148. for (var event in this.connectionCallbacks) {
  42149. this.connection.bind(event, this.connectionCallbacks[event]);
  42150. }
  42151. this.resetActivityCheck();
  42152. };
  42153. ;
  42154. ConnectionManager.prototype.abandonConnection = function () {
  42155. if (!this.connection) {
  42156. return;
  42157. }
  42158. this.stopActivityCheck();
  42159. for (var event in this.connectionCallbacks) {
  42160. this.connection.unbind(event, this.connectionCallbacks[event]);
  42161. }
  42162. var connection = this.connection;
  42163. this.connection = null;
  42164. return connection;
  42165. };
  42166. ConnectionManager.prototype.updateState = function (newState, data) {
  42167. var previousState = this.state;
  42168. this.state = newState;
  42169. if (previousState !== newState) {
  42170. var newStateDescription = newState;
  42171. if (newStateDescription === "connected") {
  42172. newStateDescription += " with new socket ID " + data.socket_id;
  42173. }
  42174. logger.debug('State changed', previousState + ' -> ' + newStateDescription);
  42175. this.timeline.info({ state: newState, params: data });
  42176. this.emit('state_change', { previous: previousState, current: newState });
  42177. this.emit(newState, data);
  42178. }
  42179. };
  42180. ConnectionManager.prototype.shouldRetry = function () {
  42181. return this.state === "connecting" || this.state === "connected";
  42182. };
  42183. return ConnectionManager;
  42184. }(dispatcher));
  42185. /* harmony default export */ var connection_manager = (connection_manager_ConnectionManager);
  42186. // CONCATENATED MODULE: ./src/core/channels/channels.ts
  42187. var channels_Channels = (function () {
  42188. function Channels() {
  42189. this.channels = {};
  42190. }
  42191. Channels.prototype.add = function (name, pusher) {
  42192. if (!this.channels[name]) {
  42193. this.channels[name] = createChannel(name, pusher);
  42194. }
  42195. return this.channels[name];
  42196. };
  42197. Channels.prototype.all = function () {
  42198. return values(this.channels);
  42199. };
  42200. Channels.prototype.find = function (name) {
  42201. return this.channels[name];
  42202. };
  42203. Channels.prototype.remove = function (name) {
  42204. var channel = this.channels[name];
  42205. delete this.channels[name];
  42206. return channel;
  42207. };
  42208. Channels.prototype.disconnect = function () {
  42209. objectApply(this.channels, function (channel) {
  42210. channel.disconnect();
  42211. });
  42212. };
  42213. return Channels;
  42214. }());
  42215. /* harmony default export */ var channels = (channels_Channels);
  42216. function createChannel(name, pusher) {
  42217. if (name.indexOf('private-encrypted-') === 0) {
  42218. if (false) { var errorMsg; }
  42219. return factory.createEncryptedChannel(name, pusher);
  42220. }
  42221. else if (name.indexOf('private-') === 0) {
  42222. return factory.createPrivateChannel(name, pusher);
  42223. }
  42224. else if (name.indexOf('presence-') === 0) {
  42225. return factory.createPresenceChannel(name, pusher);
  42226. }
  42227. else {
  42228. return factory.createChannel(name, pusher);
  42229. }
  42230. }
  42231. // CONCATENATED MODULE: ./src/core/utils/factory.ts
  42232. var Factory = {
  42233. createChannels: function () {
  42234. return new channels();
  42235. },
  42236. createConnectionManager: function (key, options) {
  42237. return new connection_manager(key, options);
  42238. },
  42239. createChannel: function (name, pusher) {
  42240. return new channels_channel(name, pusher);
  42241. },
  42242. createPrivateChannel: function (name, pusher) {
  42243. return new private_channel(name, pusher);
  42244. },
  42245. createPresenceChannel: function (name, pusher) {
  42246. return new presence_channel(name, pusher);
  42247. },
  42248. createEncryptedChannel: function (name, pusher) {
  42249. return new encrypted_channel(name, pusher);
  42250. },
  42251. createTimelineSender: function (timeline, options) {
  42252. return new timeline_sender(timeline, options);
  42253. },
  42254. createAuthorizer: function (channel, options) {
  42255. if (options.authorizer) {
  42256. return options.authorizer(channel, options);
  42257. }
  42258. return new pusher_authorizer(channel, options);
  42259. },
  42260. createHandshake: function (transport, callback) {
  42261. return new connection_handshake(transport, callback);
  42262. },
  42263. createAssistantToTheTransportManager: function (manager, transport, options) {
  42264. return new assistant_to_the_transport_manager(manager, transport, options);
  42265. }
  42266. };
  42267. /* harmony default export */ var factory = (Factory);
  42268. // CONCATENATED MODULE: ./src/core/transports/transport_manager.ts
  42269. var transport_manager_TransportManager = (function () {
  42270. function TransportManager(options) {
  42271. this.options = options || {};
  42272. this.livesLeft = this.options.lives || Infinity;
  42273. }
  42274. TransportManager.prototype.getAssistant = function (transport) {
  42275. return factory.createAssistantToTheTransportManager(this, transport, {
  42276. minPingDelay: this.options.minPingDelay,
  42277. maxPingDelay: this.options.maxPingDelay
  42278. });
  42279. };
  42280. TransportManager.prototype.isAlive = function () {
  42281. return this.livesLeft > 0;
  42282. };
  42283. TransportManager.prototype.reportDeath = function () {
  42284. this.livesLeft -= 1;
  42285. };
  42286. return TransportManager;
  42287. }());
  42288. /* harmony default export */ var transport_manager = (transport_manager_TransportManager);
  42289. // CONCATENATED MODULE: ./src/core/strategies/sequential_strategy.ts
  42290. var sequential_strategy_SequentialStrategy = (function () {
  42291. function SequentialStrategy(strategies, options) {
  42292. this.strategies = strategies;
  42293. this.loop = Boolean(options.loop);
  42294. this.failFast = Boolean(options.failFast);
  42295. this.timeout = options.timeout;
  42296. this.timeoutLimit = options.timeoutLimit;
  42297. }
  42298. SequentialStrategy.prototype.isSupported = function () {
  42299. return any(this.strategies, util.method("isSupported"));
  42300. };
  42301. SequentialStrategy.prototype.connect = function (minPriority, callback) {
  42302. var _this = this;
  42303. var strategies = this.strategies;
  42304. var current = 0;
  42305. var timeout = this.timeout;
  42306. var runner = null;
  42307. var tryNextStrategy = function (error, handshake) {
  42308. if (handshake) {
  42309. callback(null, handshake);
  42310. }
  42311. else {
  42312. current = current + 1;
  42313. if (_this.loop) {
  42314. current = current % strategies.length;
  42315. }
  42316. if (current < strategies.length) {
  42317. if (timeout) {
  42318. timeout = timeout * 2;
  42319. if (_this.timeoutLimit) {
  42320. timeout = Math.min(timeout, _this.timeoutLimit);
  42321. }
  42322. }
  42323. runner = _this.tryStrategy(strategies[current], minPriority, { timeout: timeout, failFast: _this.failFast }, tryNextStrategy);
  42324. }
  42325. else {
  42326. callback(true);
  42327. }
  42328. }
  42329. };
  42330. runner = this.tryStrategy(strategies[current], minPriority, { timeout: timeout, failFast: this.failFast }, tryNextStrategy);
  42331. return {
  42332. abort: function () {
  42333. runner.abort();
  42334. },
  42335. forceMinPriority: function (p) {
  42336. minPriority = p;
  42337. if (runner) {
  42338. runner.forceMinPriority(p);
  42339. }
  42340. }
  42341. };
  42342. };
  42343. SequentialStrategy.prototype.tryStrategy = function (strategy, minPriority, options, callback) {
  42344. var timer = null;
  42345. var runner = null;
  42346. if (options.timeout > 0) {
  42347. timer = new OneOffTimer(options.timeout, function () {
  42348. runner.abort();
  42349. callback(true);
  42350. });
  42351. }
  42352. runner = strategy.connect(minPriority, function (error, handshake) {
  42353. if (error && timer && timer.isRunning() && !options.failFast) {
  42354. return;
  42355. }
  42356. if (timer) {
  42357. timer.ensureAborted();
  42358. }
  42359. callback(error, handshake);
  42360. });
  42361. return {
  42362. abort: function () {
  42363. if (timer) {
  42364. timer.ensureAborted();
  42365. }
  42366. runner.abort();
  42367. },
  42368. forceMinPriority: function (p) {
  42369. runner.forceMinPriority(p);
  42370. }
  42371. };
  42372. };
  42373. return SequentialStrategy;
  42374. }());
  42375. /* harmony default export */ var sequential_strategy = (sequential_strategy_SequentialStrategy);
  42376. // CONCATENATED MODULE: ./src/core/strategies/best_connected_ever_strategy.ts
  42377. var best_connected_ever_strategy_BestConnectedEverStrategy = (function () {
  42378. function BestConnectedEverStrategy(strategies) {
  42379. this.strategies = strategies;
  42380. }
  42381. BestConnectedEverStrategy.prototype.isSupported = function () {
  42382. return any(this.strategies, util.method("isSupported"));
  42383. };
  42384. BestConnectedEverStrategy.prototype.connect = function (minPriority, callback) {
  42385. return connect(this.strategies, minPriority, function (i, runners) {
  42386. return function (error, handshake) {
  42387. runners[i].error = error;
  42388. if (error) {
  42389. if (allRunnersFailed(runners)) {
  42390. callback(true);
  42391. }
  42392. return;
  42393. }
  42394. apply(runners, function (runner) {
  42395. runner.forceMinPriority(handshake.transport.priority);
  42396. });
  42397. callback(null, handshake);
  42398. };
  42399. });
  42400. };
  42401. return BestConnectedEverStrategy;
  42402. }());
  42403. /* harmony default export */ var best_connected_ever_strategy = (best_connected_ever_strategy_BestConnectedEverStrategy);
  42404. function connect(strategies, minPriority, callbackBuilder) {
  42405. var runners = map(strategies, function (strategy, i, _, rs) {
  42406. return strategy.connect(minPriority, callbackBuilder(i, rs));
  42407. });
  42408. return {
  42409. abort: function () {
  42410. apply(runners, abortRunner);
  42411. },
  42412. forceMinPriority: function (p) {
  42413. apply(runners, function (runner) {
  42414. runner.forceMinPriority(p);
  42415. });
  42416. }
  42417. };
  42418. }
  42419. function allRunnersFailed(runners) {
  42420. return collections_all(runners, function (runner) {
  42421. return Boolean(runner.error);
  42422. });
  42423. }
  42424. function abortRunner(runner) {
  42425. if (!runner.error && !runner.aborted) {
  42426. runner.abort();
  42427. runner.aborted = true;
  42428. }
  42429. }
  42430. // CONCATENATED MODULE: ./src/core/strategies/cached_strategy.ts
  42431. var cached_strategy_CachedStrategy = (function () {
  42432. function CachedStrategy(strategy, transports, options) {
  42433. this.strategy = strategy;
  42434. this.transports = transports;
  42435. this.ttl = options.ttl || 1800 * 1000;
  42436. this.usingTLS = options.useTLS;
  42437. this.timeline = options.timeline;
  42438. }
  42439. CachedStrategy.prototype.isSupported = function () {
  42440. return this.strategy.isSupported();
  42441. };
  42442. CachedStrategy.prototype.connect = function (minPriority, callback) {
  42443. var usingTLS = this.usingTLS;
  42444. var info = fetchTransportCache(usingTLS);
  42445. var strategies = [this.strategy];
  42446. if (info && info.timestamp + this.ttl >= util.now()) {
  42447. var transport = this.transports[info.transport];
  42448. if (transport) {
  42449. this.timeline.info({
  42450. cached: true,
  42451. transport: info.transport,
  42452. latency: info.latency
  42453. });
  42454. strategies.push(new sequential_strategy([transport], {
  42455. timeout: info.latency * 2 + 1000,
  42456. failFast: true
  42457. }));
  42458. }
  42459. }
  42460. var startTimestamp = util.now();
  42461. var runner = strategies.pop().connect(minPriority, function cb(error, handshake) {
  42462. if (error) {
  42463. flushTransportCache(usingTLS);
  42464. if (strategies.length > 0) {
  42465. startTimestamp = util.now();
  42466. runner = strategies.pop().connect(minPriority, cb);
  42467. }
  42468. else {
  42469. callback(error);
  42470. }
  42471. }
  42472. else {
  42473. storeTransportCache(usingTLS, handshake.transport.name, util.now() - startTimestamp);
  42474. callback(null, handshake);
  42475. }
  42476. });
  42477. return {
  42478. abort: function () {
  42479. runner.abort();
  42480. },
  42481. forceMinPriority: function (p) {
  42482. minPriority = p;
  42483. if (runner) {
  42484. runner.forceMinPriority(p);
  42485. }
  42486. }
  42487. };
  42488. };
  42489. return CachedStrategy;
  42490. }());
  42491. /* harmony default export */ var cached_strategy = (cached_strategy_CachedStrategy);
  42492. function getTransportCacheKey(usingTLS) {
  42493. return "pusherTransport" + (usingTLS ? "TLS" : "NonTLS");
  42494. }
  42495. function fetchTransportCache(usingTLS) {
  42496. var storage = runtime.getLocalStorage();
  42497. if (storage) {
  42498. try {
  42499. var serializedCache = storage[getTransportCacheKey(usingTLS)];
  42500. if (serializedCache) {
  42501. return JSON.parse(serializedCache);
  42502. }
  42503. }
  42504. catch (e) {
  42505. flushTransportCache(usingTLS);
  42506. }
  42507. }
  42508. return null;
  42509. }
  42510. function storeTransportCache(usingTLS, transport, latency) {
  42511. var storage = runtime.getLocalStorage();
  42512. if (storage) {
  42513. try {
  42514. storage[getTransportCacheKey(usingTLS)] = safeJSONStringify({
  42515. timestamp: util.now(),
  42516. transport: transport,
  42517. latency: latency
  42518. });
  42519. }
  42520. catch (e) {
  42521. }
  42522. }
  42523. }
  42524. function flushTransportCache(usingTLS) {
  42525. var storage = runtime.getLocalStorage();
  42526. if (storage) {
  42527. try {
  42528. delete storage[getTransportCacheKey(usingTLS)];
  42529. }
  42530. catch (e) {
  42531. }
  42532. }
  42533. }
  42534. // CONCATENATED MODULE: ./src/core/strategies/delayed_strategy.ts
  42535. var delayed_strategy_DelayedStrategy = (function () {
  42536. function DelayedStrategy(strategy, _a) {
  42537. var number = _a.delay;
  42538. this.strategy = strategy;
  42539. this.options = { delay: number };
  42540. }
  42541. DelayedStrategy.prototype.isSupported = function () {
  42542. return this.strategy.isSupported();
  42543. };
  42544. DelayedStrategy.prototype.connect = function (minPriority, callback) {
  42545. var strategy = this.strategy;
  42546. var runner;
  42547. var timer = new OneOffTimer(this.options.delay, function () {
  42548. runner = strategy.connect(minPriority, callback);
  42549. });
  42550. return {
  42551. abort: function () {
  42552. timer.ensureAborted();
  42553. if (runner) {
  42554. runner.abort();
  42555. }
  42556. },
  42557. forceMinPriority: function (p) {
  42558. minPriority = p;
  42559. if (runner) {
  42560. runner.forceMinPriority(p);
  42561. }
  42562. }
  42563. };
  42564. };
  42565. return DelayedStrategy;
  42566. }());
  42567. /* harmony default export */ var delayed_strategy = (delayed_strategy_DelayedStrategy);
  42568. // CONCATENATED MODULE: ./src/core/strategies/if_strategy.ts
  42569. var IfStrategy = (function () {
  42570. function IfStrategy(test, trueBranch, falseBranch) {
  42571. this.test = test;
  42572. this.trueBranch = trueBranch;
  42573. this.falseBranch = falseBranch;
  42574. }
  42575. IfStrategy.prototype.isSupported = function () {
  42576. var branch = this.test() ? this.trueBranch : this.falseBranch;
  42577. return branch.isSupported();
  42578. };
  42579. IfStrategy.prototype.connect = function (minPriority, callback) {
  42580. var branch = this.test() ? this.trueBranch : this.falseBranch;
  42581. return branch.connect(minPriority, callback);
  42582. };
  42583. return IfStrategy;
  42584. }());
  42585. /* harmony default export */ var if_strategy = (IfStrategy);
  42586. // CONCATENATED MODULE: ./src/core/strategies/first_connected_strategy.ts
  42587. var FirstConnectedStrategy = (function () {
  42588. function FirstConnectedStrategy(strategy) {
  42589. this.strategy = strategy;
  42590. }
  42591. FirstConnectedStrategy.prototype.isSupported = function () {
  42592. return this.strategy.isSupported();
  42593. };
  42594. FirstConnectedStrategy.prototype.connect = function (minPriority, callback) {
  42595. var runner = this.strategy.connect(minPriority, function (error, handshake) {
  42596. if (handshake) {
  42597. runner.abort();
  42598. }
  42599. callback(error, handshake);
  42600. });
  42601. return runner;
  42602. };
  42603. return FirstConnectedStrategy;
  42604. }());
  42605. /* harmony default export */ var first_connected_strategy = (FirstConnectedStrategy);
  42606. // CONCATENATED MODULE: ./src/runtimes/web/default_strategy.ts
  42607. function testSupportsStrategy(strategy) {
  42608. return function () {
  42609. return strategy.isSupported();
  42610. };
  42611. }
  42612. var getDefaultStrategy = function (config, defineTransport) {
  42613. var definedTransports = {};
  42614. function defineTransportStrategy(name, type, priority, options, manager) {
  42615. var transport = defineTransport(config, name, type, priority, options, manager);
  42616. definedTransports[name] = transport;
  42617. return transport;
  42618. }
  42619. var ws_options = {
  42620. hostNonTLS: config.wsHost + ":" + config.wsPort,
  42621. hostTLS: config.wsHost + ":" + config.wssPort,
  42622. httpPath: config.wsPath
  42623. };
  42624. var wss_options = extend({}, ws_options, {
  42625. useTLS: true
  42626. });
  42627. var sockjs_options = {
  42628. hostNonTLS: config.httpHost + ":" + config.httpPort,
  42629. hostTLS: config.httpHost + ":" + config.httpsPort,
  42630. httpPath: config.httpPath
  42631. };
  42632. var timeouts = {
  42633. loop: true,
  42634. timeout: 15000,
  42635. timeoutLimit: 60000
  42636. };
  42637. var ws_manager = new transport_manager({
  42638. lives: 2,
  42639. minPingDelay: 10000,
  42640. maxPingDelay: config.activity_timeout
  42641. });
  42642. var streaming_manager = new transport_manager({
  42643. lives: 2,
  42644. minPingDelay: 10000,
  42645. maxPingDelay: config.activity_timeout
  42646. });
  42647. var ws_transport = defineTransportStrategy("ws", "ws", 3, ws_options, ws_manager);
  42648. var wss_transport = defineTransportStrategy("wss", "ws", 3, wss_options, ws_manager);
  42649. var sockjs_transport = defineTransportStrategy("sockjs", "sockjs", 1, sockjs_options);
  42650. var xhr_streaming_transport = defineTransportStrategy("xhr_streaming", "xhr_streaming", 1, sockjs_options, streaming_manager);
  42651. var xdr_streaming_transport = defineTransportStrategy("xdr_streaming", "xdr_streaming", 1, sockjs_options, streaming_manager);
  42652. var xhr_polling_transport = defineTransportStrategy("xhr_polling", "xhr_polling", 1, sockjs_options);
  42653. var xdr_polling_transport = defineTransportStrategy("xdr_polling", "xdr_polling", 1, sockjs_options);
  42654. var ws_loop = new sequential_strategy([ws_transport], timeouts);
  42655. var wss_loop = new sequential_strategy([wss_transport], timeouts);
  42656. var sockjs_loop = new sequential_strategy([sockjs_transport], timeouts);
  42657. var streaming_loop = new sequential_strategy([new if_strategy(testSupportsStrategy(xhr_streaming_transport), xhr_streaming_transport, xdr_streaming_transport)], timeouts);
  42658. var polling_loop = new sequential_strategy([new if_strategy(testSupportsStrategy(xhr_polling_transport), xhr_polling_transport, xdr_polling_transport)], timeouts);
  42659. 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);
  42660. var http_fallback_loop = new if_strategy(testSupportsStrategy(http_loop), http_loop, sockjs_loop);
  42661. var wsStrategy;
  42662. if (config.useTLS) {
  42663. wsStrategy = new best_connected_ever_strategy([ws_loop, new delayed_strategy(http_fallback_loop, { delay: 2000 })]);
  42664. }
  42665. else {
  42666. wsStrategy = new best_connected_ever_strategy([
  42667. ws_loop,
  42668. new delayed_strategy(wss_loop, { delay: 2000 }),
  42669. new delayed_strategy(http_fallback_loop, { delay: 5000 })
  42670. ]);
  42671. }
  42672. return new cached_strategy(new first_connected_strategy(new if_strategy(testSupportsStrategy(ws_transport), wsStrategy, http_fallback_loop)), definedTransports, {
  42673. ttl: 1800000,
  42674. timeline: config.timeline,
  42675. useTLS: config.useTLS
  42676. });
  42677. };
  42678. /* harmony default export */ var default_strategy = (getDefaultStrategy);
  42679. // CONCATENATED MODULE: ./src/runtimes/web/transports/transport_connection_initializer.ts
  42680. /* harmony default export */ var transport_connection_initializer = (function () {
  42681. var self = this;
  42682. self.timeline.info(self.buildTimelineMessage({
  42683. transport: self.name + (self.options.useTLS ? "s" : "")
  42684. }));
  42685. if (self.hooks.isInitialized()) {
  42686. self.changeState("initialized");
  42687. }
  42688. else if (self.hooks.file) {
  42689. self.changeState("initializing");
  42690. Dependencies.load(self.hooks.file, { useTLS: self.options.useTLS }, function (error, callback) {
  42691. if (self.hooks.isInitialized()) {
  42692. self.changeState("initialized");
  42693. callback(true);
  42694. }
  42695. else {
  42696. if (error) {
  42697. self.onError(error);
  42698. }
  42699. self.onClose();
  42700. callback(false);
  42701. }
  42702. });
  42703. }
  42704. else {
  42705. self.onClose();
  42706. }
  42707. });
  42708. // CONCATENATED MODULE: ./src/runtimes/web/http/http_xdomain_request.ts
  42709. var http_xdomain_request_hooks = {
  42710. getRequest: function (socket) {
  42711. var xdr = new window.XDomainRequest();
  42712. xdr.ontimeout = function () {
  42713. socket.emit("error", new RequestTimedOut());
  42714. socket.close();
  42715. };
  42716. xdr.onerror = function (e) {
  42717. socket.emit("error", e);
  42718. socket.close();
  42719. };
  42720. xdr.onprogress = function () {
  42721. if (xdr.responseText && xdr.responseText.length > 0) {
  42722. socket.onChunk(200, xdr.responseText);
  42723. }
  42724. };
  42725. xdr.onload = function () {
  42726. if (xdr.responseText && xdr.responseText.length > 0) {
  42727. socket.onChunk(200, xdr.responseText);
  42728. }
  42729. socket.emit("finished", 200);
  42730. socket.close();
  42731. };
  42732. return xdr;
  42733. },
  42734. abortRequest: function (xdr) {
  42735. xdr.ontimeout = xdr.onerror = xdr.onprogress = xdr.onload = null;
  42736. xdr.abort();
  42737. }
  42738. };
  42739. /* harmony default export */ var http_xdomain_request = (http_xdomain_request_hooks);
  42740. // CONCATENATED MODULE: ./src/core/http/http_request.ts
  42741. var http_request_extends = (undefined && undefined.__extends) || (function () {
  42742. var extendStatics = function (d, b) {
  42743. extendStatics = Object.setPrototypeOf ||
  42744. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  42745. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  42746. return extendStatics(d, b);
  42747. };
  42748. return function (d, b) {
  42749. extendStatics(d, b);
  42750. function __() { this.constructor = d; }
  42751. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  42752. };
  42753. })();
  42754. var MAX_BUFFER_LENGTH = 256 * 1024;
  42755. var http_request_HTTPRequest = (function (_super) {
  42756. http_request_extends(HTTPRequest, _super);
  42757. function HTTPRequest(hooks, method, url) {
  42758. var _this = _super.call(this) || this;
  42759. _this.hooks = hooks;
  42760. _this.method = method;
  42761. _this.url = url;
  42762. return _this;
  42763. }
  42764. HTTPRequest.prototype.start = function (payload) {
  42765. var _this = this;
  42766. this.position = 0;
  42767. this.xhr = this.hooks.getRequest(this);
  42768. this.unloader = function () {
  42769. _this.close();
  42770. };
  42771. runtime.addUnloadListener(this.unloader);
  42772. this.xhr.open(this.method, this.url, true);
  42773. if (this.xhr.setRequestHeader) {
  42774. this.xhr.setRequestHeader("Content-Type", "application/json");
  42775. }
  42776. this.xhr.send(payload);
  42777. };
  42778. HTTPRequest.prototype.close = function () {
  42779. if (this.unloader) {
  42780. runtime.removeUnloadListener(this.unloader);
  42781. this.unloader = null;
  42782. }
  42783. if (this.xhr) {
  42784. this.hooks.abortRequest(this.xhr);
  42785. this.xhr = null;
  42786. }
  42787. };
  42788. HTTPRequest.prototype.onChunk = function (status, data) {
  42789. while (true) {
  42790. var chunk = this.advanceBuffer(data);
  42791. if (chunk) {
  42792. this.emit("chunk", { status: status, data: chunk });
  42793. }
  42794. else {
  42795. break;
  42796. }
  42797. }
  42798. if (this.isBufferTooLong(data)) {
  42799. this.emit("buffer_too_long");
  42800. }
  42801. };
  42802. HTTPRequest.prototype.advanceBuffer = function (buffer) {
  42803. var unreadData = buffer.slice(this.position);
  42804. var endOfLinePosition = unreadData.indexOf("\n");
  42805. if (endOfLinePosition !== -1) {
  42806. this.position += endOfLinePosition + 1;
  42807. return unreadData.slice(0, endOfLinePosition);
  42808. }
  42809. else {
  42810. return null;
  42811. }
  42812. };
  42813. HTTPRequest.prototype.isBufferTooLong = function (buffer) {
  42814. return this.position === buffer.length && buffer.length > MAX_BUFFER_LENGTH;
  42815. };
  42816. return HTTPRequest;
  42817. }(dispatcher));
  42818. /* harmony default export */ var http_request = (http_request_HTTPRequest);
  42819. // CONCATENATED MODULE: ./src/core/http/state.ts
  42820. var State;
  42821. (function (State) {
  42822. State[State["CONNECTING"] = 0] = "CONNECTING";
  42823. State[State["OPEN"] = 1] = "OPEN";
  42824. State[State["CLOSED"] = 3] = "CLOSED";
  42825. })(State || (State = {}));
  42826. /* harmony default export */ var state = (State);
  42827. // CONCATENATED MODULE: ./src/core/http/http_socket.ts
  42828. var autoIncrement = 1;
  42829. var http_socket_HTTPSocket = (function () {
  42830. function HTTPSocket(hooks, url) {
  42831. this.hooks = hooks;
  42832. this.session = randomNumber(1000) + "/" + randomString(8);
  42833. this.location = getLocation(url);
  42834. this.readyState = state.CONNECTING;
  42835. this.openStream();
  42836. }
  42837. HTTPSocket.prototype.send = function (payload) {
  42838. return this.sendRaw(JSON.stringify([payload]));
  42839. };
  42840. HTTPSocket.prototype.ping = function () {
  42841. this.hooks.sendHeartbeat(this);
  42842. };
  42843. HTTPSocket.prototype.close = function (code, reason) {
  42844. this.onClose(code, reason, true);
  42845. };
  42846. HTTPSocket.prototype.sendRaw = function (payload) {
  42847. if (this.readyState === state.OPEN) {
  42848. try {
  42849. runtime.createSocketRequest("POST", getUniqueURL(getSendURL(this.location, this.session))).start(payload);
  42850. return true;
  42851. }
  42852. catch (e) {
  42853. return false;
  42854. }
  42855. }
  42856. else {
  42857. return false;
  42858. }
  42859. };
  42860. HTTPSocket.prototype.reconnect = function () {
  42861. this.closeStream();
  42862. this.openStream();
  42863. };
  42864. ;
  42865. HTTPSocket.prototype.onClose = function (code, reason, wasClean) {
  42866. this.closeStream();
  42867. this.readyState = state.CLOSED;
  42868. if (this.onclose) {
  42869. this.onclose({
  42870. code: code,
  42871. reason: reason,
  42872. wasClean: wasClean
  42873. });
  42874. }
  42875. };
  42876. HTTPSocket.prototype.onChunk = function (chunk) {
  42877. if (chunk.status !== 200) {
  42878. return;
  42879. }
  42880. if (this.readyState === state.OPEN) {
  42881. this.onActivity();
  42882. }
  42883. var payload;
  42884. var type = chunk.data.slice(0, 1);
  42885. switch (type) {
  42886. case 'o':
  42887. payload = JSON.parse(chunk.data.slice(1) || '{}');
  42888. this.onOpen(payload);
  42889. break;
  42890. case 'a':
  42891. payload = JSON.parse(chunk.data.slice(1) || '[]');
  42892. for (var i = 0; i < payload.length; i++) {
  42893. this.onEvent(payload[i]);
  42894. }
  42895. break;
  42896. case 'm':
  42897. payload = JSON.parse(chunk.data.slice(1) || 'null');
  42898. this.onEvent(payload);
  42899. break;
  42900. case 'h':
  42901. this.hooks.onHeartbeat(this);
  42902. break;
  42903. case 'c':
  42904. payload = JSON.parse(chunk.data.slice(1) || '[]');
  42905. this.onClose(payload[0], payload[1], true);
  42906. break;
  42907. }
  42908. };
  42909. HTTPSocket.prototype.onOpen = function (options) {
  42910. if (this.readyState === state.CONNECTING) {
  42911. if (options && options.hostname) {
  42912. this.location.base = replaceHost(this.location.base, options.hostname);
  42913. }
  42914. this.readyState = state.OPEN;
  42915. if (this.onopen) {
  42916. this.onopen();
  42917. }
  42918. }
  42919. else {
  42920. this.onClose(1006, "Server lost session", true);
  42921. }
  42922. };
  42923. HTTPSocket.prototype.onEvent = function (event) {
  42924. if (this.readyState === state.OPEN && this.onmessage) {
  42925. this.onmessage({ data: event });
  42926. }
  42927. };
  42928. HTTPSocket.prototype.onActivity = function () {
  42929. if (this.onactivity) {
  42930. this.onactivity();
  42931. }
  42932. };
  42933. HTTPSocket.prototype.onError = function (error) {
  42934. if (this.onerror) {
  42935. this.onerror(error);
  42936. }
  42937. };
  42938. HTTPSocket.prototype.openStream = function () {
  42939. var _this = this;
  42940. this.stream = runtime.createSocketRequest("POST", getUniqueURL(this.hooks.getReceiveURL(this.location, this.session)));
  42941. this.stream.bind("chunk", function (chunk) {
  42942. _this.onChunk(chunk);
  42943. });
  42944. this.stream.bind("finished", function (status) {
  42945. _this.hooks.onFinished(_this, status);
  42946. });
  42947. this.stream.bind("buffer_too_long", function () {
  42948. _this.reconnect();
  42949. });
  42950. try {
  42951. this.stream.start();
  42952. }
  42953. catch (error) {
  42954. util.defer(function () {
  42955. _this.onError(error);
  42956. _this.onClose(1006, "Could not start streaming", false);
  42957. });
  42958. }
  42959. };
  42960. HTTPSocket.prototype.closeStream = function () {
  42961. if (this.stream) {
  42962. this.stream.unbind_all();
  42963. this.stream.close();
  42964. this.stream = null;
  42965. }
  42966. };
  42967. return HTTPSocket;
  42968. }());
  42969. function getLocation(url) {
  42970. var parts = /([^\?]*)\/*(\??.*)/.exec(url);
  42971. return {
  42972. base: parts[1],
  42973. queryString: parts[2]
  42974. };
  42975. }
  42976. function getSendURL(url, session) {
  42977. return url.base + "/" + session + "/xhr_send";
  42978. }
  42979. function getUniqueURL(url) {
  42980. var separator = (url.indexOf('?') === -1) ? "?" : "&";
  42981. return url + separator + "t=" + (+new Date()) + "&n=" + autoIncrement++;
  42982. }
  42983. function replaceHost(url, hostname) {
  42984. var urlParts = /(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(url);
  42985. return urlParts[1] + hostname + urlParts[3];
  42986. }
  42987. function randomNumber(max) {
  42988. return Math.floor(Math.random() * max);
  42989. }
  42990. function randomString(length) {
  42991. var result = [];
  42992. for (var i = 0; i < length; i++) {
  42993. result.push(randomNumber(32).toString(32));
  42994. }
  42995. return result.join('');
  42996. }
  42997. /* harmony default export */ var http_socket = (http_socket_HTTPSocket);
  42998. // CONCATENATED MODULE: ./src/core/http/http_streaming_socket.ts
  42999. var http_streaming_socket_hooks = {
  43000. getReceiveURL: function (url, session) {
  43001. return url.base + "/" + session + "/xhr_streaming" + url.queryString;
  43002. },
  43003. onHeartbeat: function (socket) {
  43004. socket.sendRaw("[]");
  43005. },
  43006. sendHeartbeat: function (socket) {
  43007. socket.sendRaw("[]");
  43008. },
  43009. onFinished: function (socket, status) {
  43010. socket.onClose(1006, "Connection interrupted (" + status + ")", false);
  43011. }
  43012. };
  43013. /* harmony default export */ var http_streaming_socket = (http_streaming_socket_hooks);
  43014. // CONCATENATED MODULE: ./src/core/http/http_polling_socket.ts
  43015. var http_polling_socket_hooks = {
  43016. getReceiveURL: function (url, session) {
  43017. return url.base + "/" + session + "/xhr" + url.queryString;
  43018. },
  43019. onHeartbeat: function () {
  43020. },
  43021. sendHeartbeat: function (socket) {
  43022. socket.sendRaw("[]");
  43023. },
  43024. onFinished: function (socket, status) {
  43025. if (status === 200) {
  43026. socket.reconnect();
  43027. }
  43028. else {
  43029. socket.onClose(1006, "Connection interrupted (" + status + ")", false);
  43030. }
  43031. }
  43032. };
  43033. /* harmony default export */ var http_polling_socket = (http_polling_socket_hooks);
  43034. // CONCATENATED MODULE: ./src/runtimes/isomorphic/http/http_xhr_request.ts
  43035. var http_xhr_request_hooks = {
  43036. getRequest: function (socket) {
  43037. var Constructor = runtime.getXHRAPI();
  43038. var xhr = new Constructor();
  43039. xhr.onreadystatechange = xhr.onprogress = function () {
  43040. switch (xhr.readyState) {
  43041. case 3:
  43042. if (xhr.responseText && xhr.responseText.length > 0) {
  43043. socket.onChunk(xhr.status, xhr.responseText);
  43044. }
  43045. break;
  43046. case 4:
  43047. if (xhr.responseText && xhr.responseText.length > 0) {
  43048. socket.onChunk(xhr.status, xhr.responseText);
  43049. }
  43050. socket.emit("finished", xhr.status);
  43051. socket.close();
  43052. break;
  43053. }
  43054. };
  43055. return xhr;
  43056. },
  43057. abortRequest: function (xhr) {
  43058. xhr.onreadystatechange = null;
  43059. xhr.abort();
  43060. }
  43061. };
  43062. /* harmony default export */ var http_xhr_request = (http_xhr_request_hooks);
  43063. // CONCATENATED MODULE: ./src/runtimes/isomorphic/http/http.ts
  43064. var HTTP = {
  43065. createStreamingSocket: function (url) {
  43066. return this.createSocket(http_streaming_socket, url);
  43067. },
  43068. createPollingSocket: function (url) {
  43069. return this.createSocket(http_polling_socket, url);
  43070. },
  43071. createSocket: function (hooks, url) {
  43072. return new http_socket(hooks, url);
  43073. },
  43074. createXHR: function (method, url) {
  43075. return this.createRequest(http_xhr_request, method, url);
  43076. },
  43077. createRequest: function (hooks, method, url) {
  43078. return new http_request(hooks, method, url);
  43079. }
  43080. };
  43081. /* harmony default export */ var http_http = (HTTP);
  43082. // CONCATENATED MODULE: ./src/runtimes/web/http/http.ts
  43083. http_http.createXDR = function (method, url) {
  43084. return this.createRequest(http_xdomain_request, method, url);
  43085. };
  43086. /* harmony default export */ var web_http_http = (http_http);
  43087. // CONCATENATED MODULE: ./src/runtimes/web/runtime.ts
  43088. var Runtime = {
  43089. nextAuthCallbackID: 1,
  43090. auth_callbacks: {},
  43091. ScriptReceivers: ScriptReceivers,
  43092. DependenciesReceivers: DependenciesReceivers,
  43093. getDefaultStrategy: default_strategy,
  43094. Transports: transports_transports,
  43095. transportConnectionInitializer: transport_connection_initializer,
  43096. HTTPFactory: web_http_http,
  43097. TimelineTransport: jsonp_timeline,
  43098. getXHRAPI: function () {
  43099. return window.XMLHttpRequest;
  43100. },
  43101. getWebSocketAPI: function () {
  43102. return window.WebSocket || window.MozWebSocket;
  43103. },
  43104. setup: function (PusherClass) {
  43105. var _this = this;
  43106. window.Pusher = PusherClass;
  43107. var initializeOnDocumentBody = function () {
  43108. _this.onDocumentBody(PusherClass.ready);
  43109. };
  43110. if (!window.JSON) {
  43111. Dependencies.load("json2", {}, initializeOnDocumentBody);
  43112. }
  43113. else {
  43114. initializeOnDocumentBody();
  43115. }
  43116. },
  43117. getDocument: function () {
  43118. return document;
  43119. },
  43120. getProtocol: function () {
  43121. return this.getDocument().location.protocol;
  43122. },
  43123. getAuthorizers: function () {
  43124. return { ajax: xhr_auth, jsonp: jsonp_auth };
  43125. },
  43126. onDocumentBody: function (callback) {
  43127. var _this = this;
  43128. if (document.body) {
  43129. callback();
  43130. }
  43131. else {
  43132. setTimeout(function () {
  43133. _this.onDocumentBody(callback);
  43134. }, 0);
  43135. }
  43136. },
  43137. createJSONPRequest: function (url, data) {
  43138. return new jsonp_request(url, data);
  43139. },
  43140. createScriptRequest: function (src) {
  43141. return new script_request(src);
  43142. },
  43143. getLocalStorage: function () {
  43144. try {
  43145. return window.localStorage;
  43146. }
  43147. catch (e) {
  43148. return undefined;
  43149. }
  43150. },
  43151. createXHR: function () {
  43152. if (this.getXHRAPI()) {
  43153. return this.createXMLHttpRequest();
  43154. }
  43155. else {
  43156. return this.createMicrosoftXHR();
  43157. }
  43158. },
  43159. createXMLHttpRequest: function () {
  43160. var Constructor = this.getXHRAPI();
  43161. return new Constructor();
  43162. },
  43163. createMicrosoftXHR: function () {
  43164. return new ActiveXObject("Microsoft.XMLHTTP");
  43165. },
  43166. getNetwork: function () {
  43167. return net_info_Network;
  43168. },
  43169. createWebSocket: function (url) {
  43170. var Constructor = this.getWebSocketAPI();
  43171. return new Constructor(url);
  43172. },
  43173. createSocketRequest: function (method, url) {
  43174. if (this.isXHRSupported()) {
  43175. return this.HTTPFactory.createXHR(method, url);
  43176. }
  43177. else if (this.isXDRSupported(url.indexOf("https:") === 0)) {
  43178. return this.HTTPFactory.createXDR(method, url);
  43179. }
  43180. else {
  43181. throw "Cross-origin HTTP requests are not supported";
  43182. }
  43183. },
  43184. isXHRSupported: function () {
  43185. var Constructor = this.getXHRAPI();
  43186. return Boolean(Constructor) && (new Constructor()).withCredentials !== undefined;
  43187. },
  43188. isXDRSupported: function (useTLS) {
  43189. var protocol = useTLS ? "https:" : "http:";
  43190. var documentProtocol = this.getProtocol();
  43191. return Boolean((window['XDomainRequest'])) && documentProtocol === protocol;
  43192. },
  43193. addUnloadListener: function (listener) {
  43194. if (window.addEventListener !== undefined) {
  43195. window.addEventListener("unload", listener, false);
  43196. }
  43197. else if (window.attachEvent !== undefined) {
  43198. window.attachEvent("onunload", listener);
  43199. }
  43200. },
  43201. removeUnloadListener: function (listener) {
  43202. if (window.addEventListener !== undefined) {
  43203. window.removeEventListener("unload", listener, false);
  43204. }
  43205. else if (window.detachEvent !== undefined) {
  43206. window.detachEvent("onunload", listener);
  43207. }
  43208. }
  43209. };
  43210. /* harmony default export */ var runtime = (Runtime);
  43211. // CONCATENATED MODULE: ./src/core/timeline/level.ts
  43212. var TimelineLevel;
  43213. (function (TimelineLevel) {
  43214. TimelineLevel[TimelineLevel["ERROR"] = 3] = "ERROR";
  43215. TimelineLevel[TimelineLevel["INFO"] = 6] = "INFO";
  43216. TimelineLevel[TimelineLevel["DEBUG"] = 7] = "DEBUG";
  43217. })(TimelineLevel || (TimelineLevel = {}));
  43218. /* harmony default export */ var timeline_level = (TimelineLevel);
  43219. // CONCATENATED MODULE: ./src/core/timeline/timeline.ts
  43220. var timeline_Timeline = (function () {
  43221. function Timeline(key, session, options) {
  43222. this.key = key;
  43223. this.session = session;
  43224. this.events = [];
  43225. this.options = options || {};
  43226. this.sent = 0;
  43227. this.uniqueID = 0;
  43228. }
  43229. Timeline.prototype.log = function (level, event) {
  43230. if (level <= this.options.level) {
  43231. this.events.push(extend({}, event, { timestamp: util.now() }));
  43232. if (this.options.limit && this.events.length > this.options.limit) {
  43233. this.events.shift();
  43234. }
  43235. }
  43236. };
  43237. Timeline.prototype.error = function (event) {
  43238. this.log(timeline_level.ERROR, event);
  43239. };
  43240. Timeline.prototype.info = function (event) {
  43241. this.log(timeline_level.INFO, event);
  43242. };
  43243. Timeline.prototype.debug = function (event) {
  43244. this.log(timeline_level.DEBUG, event);
  43245. };
  43246. Timeline.prototype.isEmpty = function () {
  43247. return this.events.length === 0;
  43248. };
  43249. Timeline.prototype.send = function (sendfn, callback) {
  43250. var _this = this;
  43251. var data = extend({
  43252. session: this.session,
  43253. bundle: this.sent + 1,
  43254. key: this.key,
  43255. lib: "js",
  43256. version: this.options.version,
  43257. cluster: this.options.cluster,
  43258. features: this.options.features,
  43259. timeline: this.events
  43260. }, this.options.params);
  43261. this.events = [];
  43262. sendfn(data, function (error, result) {
  43263. if (!error) {
  43264. _this.sent++;
  43265. }
  43266. if (callback) {
  43267. callback(error, result);
  43268. }
  43269. });
  43270. return true;
  43271. };
  43272. Timeline.prototype.generateUniqueID = function () {
  43273. this.uniqueID++;
  43274. return this.uniqueID;
  43275. };
  43276. return Timeline;
  43277. }());
  43278. /* harmony default export */ var timeline_timeline = (timeline_Timeline);
  43279. // CONCATENATED MODULE: ./src/core/strategies/transport_strategy.ts
  43280. var transport_strategy_TransportStrategy = (function () {
  43281. function TransportStrategy(name, priority, transport, options) {
  43282. this.name = name;
  43283. this.priority = priority;
  43284. this.transport = transport;
  43285. this.options = options || {};
  43286. }
  43287. TransportStrategy.prototype.isSupported = function () {
  43288. return this.transport.isSupported({
  43289. useTLS: this.options.useTLS
  43290. });
  43291. };
  43292. TransportStrategy.prototype.connect = function (minPriority, callback) {
  43293. var _this = this;
  43294. if (!this.isSupported()) {
  43295. return failAttempt(new UnsupportedStrategy(), callback);
  43296. }
  43297. else if (this.priority < minPriority) {
  43298. return failAttempt(new TransportPriorityTooLow(), callback);
  43299. }
  43300. var connected = false;
  43301. var transport = this.transport.createConnection(this.name, this.priority, this.options.key, this.options);
  43302. var handshake = null;
  43303. var onInitialized = function () {
  43304. transport.unbind("initialized", onInitialized);
  43305. transport.connect();
  43306. };
  43307. var onOpen = function () {
  43308. handshake = factory.createHandshake(transport, function (result) {
  43309. connected = true;
  43310. unbindListeners();
  43311. callback(null, result);
  43312. });
  43313. };
  43314. var onError = function (error) {
  43315. unbindListeners();
  43316. callback(error);
  43317. };
  43318. var onClosed = function () {
  43319. unbindListeners();
  43320. var serializedTransport;
  43321. serializedTransport = safeJSONStringify(transport);
  43322. callback(new TransportClosed(serializedTransport));
  43323. };
  43324. var unbindListeners = function () {
  43325. transport.unbind("initialized", onInitialized);
  43326. transport.unbind("open", onOpen);
  43327. transport.unbind("error", onError);
  43328. transport.unbind("closed", onClosed);
  43329. };
  43330. transport.bind("initialized", onInitialized);
  43331. transport.bind("open", onOpen);
  43332. transport.bind("error", onError);
  43333. transport.bind("closed", onClosed);
  43334. transport.initialize();
  43335. return {
  43336. abort: function () {
  43337. if (connected) {
  43338. return;
  43339. }
  43340. unbindListeners();
  43341. if (handshake) {
  43342. handshake.close();
  43343. }
  43344. else {
  43345. transport.close();
  43346. }
  43347. },
  43348. forceMinPriority: function (p) {
  43349. if (connected) {
  43350. return;
  43351. }
  43352. if (_this.priority < p) {
  43353. if (handshake) {
  43354. handshake.close();
  43355. }
  43356. else {
  43357. transport.close();
  43358. }
  43359. }
  43360. }
  43361. };
  43362. };
  43363. return TransportStrategy;
  43364. }());
  43365. /* harmony default export */ var transport_strategy = (transport_strategy_TransportStrategy);
  43366. function failAttempt(error, callback) {
  43367. util.defer(function () {
  43368. callback(error);
  43369. });
  43370. return {
  43371. abort: function () { },
  43372. forceMinPriority: function () { }
  43373. };
  43374. }
  43375. // CONCATENATED MODULE: ./src/core/strategies/strategy_builder.ts
  43376. var strategy_builder_Transports = runtime.Transports;
  43377. var strategy_builder_defineTransport = function (config, name, type, priority, options, manager) {
  43378. var transportClass = strategy_builder_Transports[type];
  43379. if (!transportClass) {
  43380. throw new UnsupportedTransport(type);
  43381. }
  43382. var enabled = (!config.enabledTransports ||
  43383. arrayIndexOf(config.enabledTransports, name) !== -1) &&
  43384. (!config.disabledTransports ||
  43385. arrayIndexOf(config.disabledTransports, name) === -1);
  43386. var transport;
  43387. if (enabled) {
  43388. transport = new transport_strategy(name, priority, manager ? manager.getAssistant(transportClass) : transportClass, extend({
  43389. key: config.key,
  43390. useTLS: config.useTLS,
  43391. timeline: config.timeline,
  43392. ignoreNullOrigin: config.ignoreNullOrigin
  43393. }, options));
  43394. }
  43395. else {
  43396. transport = strategy_builder_UnsupportedStrategy;
  43397. }
  43398. return transport;
  43399. };
  43400. var strategy_builder_UnsupportedStrategy = {
  43401. isSupported: function () {
  43402. return false;
  43403. },
  43404. connect: function (_, callback) {
  43405. var deferred = util.defer(function () {
  43406. callback(new UnsupportedStrategy());
  43407. });
  43408. return {
  43409. abort: function () {
  43410. deferred.ensureAborted();
  43411. },
  43412. forceMinPriority: function () { }
  43413. };
  43414. }
  43415. };
  43416. // CONCATENATED MODULE: ./src/core/config.ts
  43417. var getGlobalConfig = function () {
  43418. return {
  43419. wsHost: defaults.host,
  43420. wsPort: defaults.ws_port,
  43421. wssPort: defaults.wss_port,
  43422. wsPath: defaults.ws_path,
  43423. httpHost: defaults.sockjs_host,
  43424. httpPort: defaults.sockjs_http_port,
  43425. httpsPort: defaults.sockjs_https_port,
  43426. httpPath: defaults.sockjs_path,
  43427. statsHost: defaults.stats_host,
  43428. authEndpoint: defaults.channel_auth_endpoint,
  43429. authTransport: defaults.channel_auth_transport,
  43430. activity_timeout: defaults.activity_timeout,
  43431. pong_timeout: defaults.pong_timeout,
  43432. unavailable_timeout: defaults.unavailable_timeout
  43433. };
  43434. };
  43435. var getClusterConfig = function (clusterName) {
  43436. return {
  43437. wsHost: 'ws-' + clusterName + '.pusher.com',
  43438. httpHost: 'sockjs-' + clusterName + '.pusher.com'
  43439. };
  43440. };
  43441. // CONCATENATED MODULE: ./src/core/pusher.ts
  43442. var pusher_Pusher = (function () {
  43443. function Pusher(app_key, options) {
  43444. var _this = this;
  43445. checkAppKey(app_key);
  43446. options = options || {};
  43447. if (!options.cluster && !(options.wsHost || options.httpHost)) {
  43448. var suffix = url_store.buildLogSuffix('javascriptQuickStart');
  43449. logger.warn("You should always specify a cluster when connecting. " + suffix);
  43450. }
  43451. this.key = app_key;
  43452. this.config = extend(getGlobalConfig(), options.cluster ? getClusterConfig(options.cluster) : {}, options);
  43453. this.channels = factory.createChannels();
  43454. this.global_emitter = new dispatcher();
  43455. this.sessionID = Math.floor(Math.random() * 1000000000);
  43456. this.timeline = new timeline_timeline(this.key, this.sessionID, {
  43457. cluster: this.config.cluster,
  43458. features: Pusher.getClientFeatures(),
  43459. params: this.config.timelineParams || {},
  43460. limit: 50,
  43461. level: timeline_level.INFO,
  43462. version: defaults.VERSION
  43463. });
  43464. if (!this.config.disableStats) {
  43465. this.timelineSender = factory.createTimelineSender(this.timeline, {
  43466. host: this.config.statsHost,
  43467. path: '/timeline/v2/' + runtime.TimelineTransport.name
  43468. });
  43469. }
  43470. var getStrategy = function (options) {
  43471. var config = extend({}, _this.config, options);
  43472. return runtime.getDefaultStrategy(config, strategy_builder_defineTransport);
  43473. };
  43474. this.connection = factory.createConnectionManager(this.key, extend({
  43475. getStrategy: getStrategy,
  43476. timeline: this.timeline,
  43477. activityTimeout: this.config.activity_timeout,
  43478. pongTimeout: this.config.pong_timeout,
  43479. unavailableTimeout: this.config.unavailable_timeout
  43480. }, this.config, { useTLS: this.shouldUseTLS() }));
  43481. this.connection.bind('connected', function () {
  43482. _this.subscribeAll();
  43483. if (_this.timelineSender) {
  43484. _this.timelineSender.send(_this.connection.isUsingTLS());
  43485. }
  43486. });
  43487. this.connection.bind('message', function (event) {
  43488. var eventName = event.event;
  43489. var internal = eventName.indexOf('pusher_internal:') === 0;
  43490. if (event.channel) {
  43491. var channel = _this.channel(event.channel);
  43492. if (channel) {
  43493. channel.handleEvent(event);
  43494. }
  43495. }
  43496. if (!internal) {
  43497. _this.global_emitter.emit(event.event, event.data);
  43498. }
  43499. });
  43500. this.connection.bind('connecting', function () {
  43501. _this.channels.disconnect();
  43502. });
  43503. this.connection.bind('disconnected', function () {
  43504. _this.channels.disconnect();
  43505. });
  43506. this.connection.bind('error', function (err) {
  43507. logger.warn(err);
  43508. });
  43509. Pusher.instances.push(this);
  43510. this.timeline.info({ instances: Pusher.instances.length });
  43511. if (Pusher.isReady) {
  43512. this.connect();
  43513. }
  43514. }
  43515. Pusher.ready = function () {
  43516. Pusher.isReady = true;
  43517. for (var i = 0, l = Pusher.instances.length; i < l; i++) {
  43518. Pusher.instances[i].connect();
  43519. }
  43520. };
  43521. Pusher.getClientFeatures = function () {
  43522. return keys(filterObject({ ws: runtime.Transports.ws }, function (t) {
  43523. return t.isSupported({});
  43524. }));
  43525. };
  43526. Pusher.prototype.channel = function (name) {
  43527. return this.channels.find(name);
  43528. };
  43529. Pusher.prototype.allChannels = function () {
  43530. return this.channels.all();
  43531. };
  43532. Pusher.prototype.connect = function () {
  43533. this.connection.connect();
  43534. if (this.timelineSender) {
  43535. if (!this.timelineSenderTimer) {
  43536. var usingTLS = this.connection.isUsingTLS();
  43537. var timelineSender = this.timelineSender;
  43538. this.timelineSenderTimer = new PeriodicTimer(60000, function () {
  43539. timelineSender.send(usingTLS);
  43540. });
  43541. }
  43542. }
  43543. };
  43544. Pusher.prototype.disconnect = function () {
  43545. this.connection.disconnect();
  43546. if (this.timelineSenderTimer) {
  43547. this.timelineSenderTimer.ensureAborted();
  43548. this.timelineSenderTimer = null;
  43549. }
  43550. };
  43551. Pusher.prototype.bind = function (event_name, callback, context) {
  43552. this.global_emitter.bind(event_name, callback, context);
  43553. return this;
  43554. };
  43555. Pusher.prototype.unbind = function (event_name, callback, context) {
  43556. this.global_emitter.unbind(event_name, callback, context);
  43557. return this;
  43558. };
  43559. Pusher.prototype.bind_global = function (callback) {
  43560. this.global_emitter.bind_global(callback);
  43561. return this;
  43562. };
  43563. Pusher.prototype.unbind_global = function (callback) {
  43564. this.global_emitter.unbind_global(callback);
  43565. return this;
  43566. };
  43567. Pusher.prototype.unbind_all = function (callback) {
  43568. this.global_emitter.unbind_all();
  43569. return this;
  43570. };
  43571. Pusher.prototype.subscribeAll = function () {
  43572. var channelName;
  43573. for (channelName in this.channels.channels) {
  43574. if (this.channels.channels.hasOwnProperty(channelName)) {
  43575. this.subscribe(channelName);
  43576. }
  43577. }
  43578. };
  43579. Pusher.prototype.subscribe = function (channel_name) {
  43580. var channel = this.channels.add(channel_name, this);
  43581. if (channel.subscriptionPending && channel.subscriptionCancelled) {
  43582. channel.reinstateSubscription();
  43583. }
  43584. else if (!channel.subscriptionPending &&
  43585. this.connection.state === 'connected') {
  43586. channel.subscribe();
  43587. }
  43588. return channel;
  43589. };
  43590. Pusher.prototype.unsubscribe = function (channel_name) {
  43591. var channel = this.channels.find(channel_name);
  43592. if (channel && channel.subscriptionPending) {
  43593. channel.cancelSubscription();
  43594. }
  43595. else {
  43596. channel = this.channels.remove(channel_name);
  43597. if (channel && this.connection.state === 'connected') {
  43598. channel.unsubscribe();
  43599. }
  43600. }
  43601. };
  43602. Pusher.prototype.send_event = function (event_name, data, channel) {
  43603. return this.connection.send_event(event_name, data, channel);
  43604. };
  43605. Pusher.prototype.shouldUseTLS = function () {
  43606. if (runtime.getProtocol() === 'https:') {
  43607. return true;
  43608. }
  43609. else if (this.config.forceTLS === true) {
  43610. return true;
  43611. }
  43612. else {
  43613. return Boolean(this.config.encrypted);
  43614. }
  43615. };
  43616. Pusher.instances = [];
  43617. Pusher.isReady = false;
  43618. Pusher.logToConsole = false;
  43619. Pusher.Runtime = runtime;
  43620. Pusher.ScriptReceivers = runtime.ScriptReceivers;
  43621. Pusher.DependenciesReceivers = runtime.DependenciesReceivers;
  43622. Pusher.auth_callbacks = runtime.auth_callbacks;
  43623. return Pusher;
  43624. }());
  43625. /* harmony default export */ var core_pusher = __webpack_exports__["default"] = (pusher_Pusher);
  43626. function checkAppKey(key) {
  43627. if (key === null || key === undefined) {
  43628. throw 'You must pass your app key when you instantiate Pusher.';
  43629. }
  43630. }
  43631. runtime.setup(pusher_Pusher);
  43632. /***/ })
  43633. /******/ ]);
  43634. });
  43635. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../buffer/index.js */ "./node_modules/buffer/index.js").Buffer))
  43636. /***/ }),
  43637. /***/ "./node_modules/setimmediate/setImmediate.js":
  43638. /*!***************************************************!*\
  43639. !*** ./node_modules/setimmediate/setImmediate.js ***!
  43640. \***************************************************/
  43641. /*! no static exports found */
  43642. /***/ (function(module, exports, __webpack_require__) {
  43643. /* WEBPACK VAR INJECTION */(function(global, process) {(function (global, undefined) {
  43644. "use strict";
  43645. if (global.setImmediate) {
  43646. return;
  43647. }
  43648. var nextHandle = 1; // Spec says greater than zero
  43649. var tasksByHandle = {};
  43650. var currentlyRunningATask = false;
  43651. var doc = global.document;
  43652. var registerImmediate;
  43653. function setImmediate(callback) {
  43654. // Callback can either be a function or a string
  43655. if (typeof callback !== "function") {
  43656. callback = new Function("" + callback);
  43657. }
  43658. // Copy function arguments
  43659. var args = new Array(arguments.length - 1);
  43660. for (var i = 0; i < args.length; i++) {
  43661. args[i] = arguments[i + 1];
  43662. }
  43663. // Store and register the task
  43664. var task = { callback: callback, args: args };
  43665. tasksByHandle[nextHandle] = task;
  43666. registerImmediate(nextHandle);
  43667. return nextHandle++;
  43668. }
  43669. function clearImmediate(handle) {
  43670. delete tasksByHandle[handle];
  43671. }
  43672. function run(task) {
  43673. var callback = task.callback;
  43674. var args = task.args;
  43675. switch (args.length) {
  43676. case 0:
  43677. callback();
  43678. break;
  43679. case 1:
  43680. callback(args[0]);
  43681. break;
  43682. case 2:
  43683. callback(args[0], args[1]);
  43684. break;
  43685. case 3:
  43686. callback(args[0], args[1], args[2]);
  43687. break;
  43688. default:
  43689. callback.apply(undefined, args);
  43690. break;
  43691. }
  43692. }
  43693. function runIfPresent(handle) {
  43694. // From the spec: "Wait until any invocations of this algorithm started before this one have completed."
  43695. // So if we're currently running a task, we'll need to delay this invocation.
  43696. if (currentlyRunningATask) {
  43697. // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a
  43698. // "too much recursion" error.
  43699. setTimeout(runIfPresent, 0, handle);
  43700. } else {
  43701. var task = tasksByHandle[handle];
  43702. if (task) {
  43703. currentlyRunningATask = true;
  43704. try {
  43705. run(task);
  43706. } finally {
  43707. clearImmediate(handle);
  43708. currentlyRunningATask = false;
  43709. }
  43710. }
  43711. }
  43712. }
  43713. function installNextTickImplementation() {
  43714. registerImmediate = function(handle) {
  43715. process.nextTick(function () { runIfPresent(handle); });
  43716. };
  43717. }
  43718. function canUsePostMessage() {
  43719. // The test against `importScripts` prevents this implementation from being installed inside a web worker,
  43720. // where `global.postMessage` means something completely different and can't be used for this purpose.
  43721. if (global.postMessage && !global.importScripts) {
  43722. var postMessageIsAsynchronous = true;
  43723. var oldOnMessage = global.onmessage;
  43724. global.onmessage = function() {
  43725. postMessageIsAsynchronous = false;
  43726. };
  43727. global.postMessage("", "*");
  43728. global.onmessage = oldOnMessage;
  43729. return postMessageIsAsynchronous;
  43730. }
  43731. }
  43732. function installPostMessageImplementation() {
  43733. // Installs an event handler on `global` for the `message` event: see
  43734. // * https://developer.mozilla.org/en/DOM/window.postMessage
  43735. // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages
  43736. var messagePrefix = "setImmediate$" + Math.random() + "$";
  43737. var onGlobalMessage = function(event) {
  43738. if (event.source === global &&
  43739. typeof event.data === "string" &&
  43740. event.data.indexOf(messagePrefix) === 0) {
  43741. runIfPresent(+event.data.slice(messagePrefix.length));
  43742. }
  43743. };
  43744. if (global.addEventListener) {
  43745. global.addEventListener("message", onGlobalMessage, false);
  43746. } else {
  43747. global.attachEvent("onmessage", onGlobalMessage);
  43748. }
  43749. registerImmediate = function(handle) {
  43750. global.postMessage(messagePrefix + handle, "*");
  43751. };
  43752. }
  43753. function installMessageChannelImplementation() {
  43754. var channel = new MessageChannel();
  43755. channel.port1.onmessage = function(event) {
  43756. var handle = event.data;
  43757. runIfPresent(handle);
  43758. };
  43759. registerImmediate = function(handle) {
  43760. channel.port2.postMessage(handle);
  43761. };
  43762. }
  43763. function installReadyStateChangeImplementation() {
  43764. var html = doc.documentElement;
  43765. registerImmediate = function(handle) {
  43766. // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted
  43767. // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.
  43768. var script = doc.createElement("script");
  43769. script.onreadystatechange = function () {
  43770. runIfPresent(handle);
  43771. script.onreadystatechange = null;
  43772. html.removeChild(script);
  43773. script = null;
  43774. };
  43775. html.appendChild(script);
  43776. };
  43777. }
  43778. function installSetTimeoutImplementation() {
  43779. registerImmediate = function(handle) {
  43780. setTimeout(runIfPresent, 0, handle);
  43781. };
  43782. }
  43783. // If supported, we should attach to the prototype of global, since that is where setTimeout et al. live.
  43784. var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global);
  43785. attachTo = attachTo && attachTo.setTimeout ? attachTo : global;
  43786. // Don't get fooled by e.g. browserify environments.
  43787. if ({}.toString.call(global.process) === "[object process]") {
  43788. // For Node.js before 0.9
  43789. installNextTickImplementation();
  43790. } else if (canUsePostMessage()) {
  43791. // For non-IE10 modern browsers
  43792. installPostMessageImplementation();
  43793. } else if (global.MessageChannel) {
  43794. // For web workers, where supported
  43795. installMessageChannelImplementation();
  43796. } else if (doc && "onreadystatechange" in doc.createElement("script")) {
  43797. // For IE 6–8
  43798. installReadyStateChangeImplementation();
  43799. } else {
  43800. // For older browsers
  43801. installSetTimeoutImplementation();
  43802. }
  43803. attachTo.setImmediate = setImmediate;
  43804. attachTo.clearImmediate = clearImmediate;
  43805. }(typeof self === "undefined" ? typeof global === "undefined" ? this : global : self));
  43806. /* 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")))
  43807. /***/ }),
  43808. /***/ "./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&":
  43809. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  43810. !*** ./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& ***!
  43811. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************/
  43812. /*! no static exports found */
  43813. /***/ (function(module, exports, __webpack_require__) {
  43814. 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&");
  43815. if(typeof content === 'string') content = [[module.i, content, '']];
  43816. var transform;
  43817. var insertInto;
  43818. var options = {"hmr":true}
  43819. options.transform = transform
  43820. options.insertInto = undefined;
  43821. var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options);
  43822. if(content.locals) module.exports = content.locals;
  43823. if(false) {}
  43824. /***/ }),
  43825. /***/ "./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&":
  43826. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  43827. !*** ./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& ***!
  43828. \************************************************************************************************************************************************************************************************************************************************************************************************************************/
  43829. /*! no static exports found */
  43830. /***/ (function(module, exports, __webpack_require__) {
  43831. 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&");
  43832. if(typeof content === 'string') content = [[module.i, content, '']];
  43833. var transform;
  43834. var insertInto;
  43835. var options = {"hmr":true}
  43836. options.transform = transform
  43837. options.insertInto = undefined;
  43838. var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options);
  43839. if(content.locals) module.exports = content.locals;
  43840. if(false) {}
  43841. /***/ }),
  43842. /***/ "./node_modules/style-loader/lib/addStyles.js":
  43843. /*!****************************************************!*\
  43844. !*** ./node_modules/style-loader/lib/addStyles.js ***!
  43845. \****************************************************/
  43846. /*! no static exports found */
  43847. /***/ (function(module, exports, __webpack_require__) {
  43848. /*
  43849. MIT License http://www.opensource.org/licenses/mit-license.php
  43850. Author Tobias Koppers @sokra
  43851. */
  43852. var stylesInDom = {};
  43853. var memoize = function (fn) {
  43854. var memo;
  43855. return function () {
  43856. if (typeof memo === "undefined") memo = fn.apply(this, arguments);
  43857. return memo;
  43858. };
  43859. };
  43860. var isOldIE = memoize(function () {
  43861. // Test for IE <= 9 as proposed by Browserhacks
  43862. // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805
  43863. // Tests for existence of standard globals is to allow style-loader
  43864. // to operate correctly into non-standard environments
  43865. // @see https://github.com/webpack-contrib/style-loader/issues/177
  43866. return window && document && document.all && !window.atob;
  43867. });
  43868. var getTarget = function (target, parent) {
  43869. if (parent){
  43870. return parent.querySelector(target);
  43871. }
  43872. return document.querySelector(target);
  43873. };
  43874. var getElement = (function (fn) {
  43875. var memo = {};
  43876. return function(target, parent) {
  43877. // If passing function in options, then use it for resolve "head" element.
  43878. // Useful for Shadow Root style i.e
  43879. // {
  43880. // insertInto: function () { return document.querySelector("#foo").shadowRoot }
  43881. // }
  43882. if (typeof target === 'function') {
  43883. return target();
  43884. }
  43885. if (typeof memo[target] === "undefined") {
  43886. var styleTarget = getTarget.call(this, target, parent);
  43887. // Special case to return head of iframe instead of iframe itself
  43888. if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
  43889. try {
  43890. // This will throw an exception if access to iframe is blocked
  43891. // due to cross-origin restrictions
  43892. styleTarget = styleTarget.contentDocument.head;
  43893. } catch(e) {
  43894. styleTarget = null;
  43895. }
  43896. }
  43897. memo[target] = styleTarget;
  43898. }
  43899. return memo[target]
  43900. };
  43901. })();
  43902. var singleton = null;
  43903. var singletonCounter = 0;
  43904. var stylesInsertedAtTop = [];
  43905. var fixUrls = __webpack_require__(/*! ./urls */ "./node_modules/style-loader/lib/urls.js");
  43906. module.exports = function(list, options) {
  43907. if (typeof DEBUG !== "undefined" && DEBUG) {
  43908. if (typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment");
  43909. }
  43910. options = options || {};
  43911. options.attrs = typeof options.attrs === "object" ? options.attrs : {};
  43912. // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
  43913. // tags it will allow on a page
  43914. if (!options.singleton && typeof options.singleton !== "boolean") options.singleton = isOldIE();
  43915. // By default, add <style> tags to the <head> element
  43916. if (!options.insertInto) options.insertInto = "head";
  43917. // By default, add <style> tags to the bottom of the target
  43918. if (!options.insertAt) options.insertAt = "bottom";
  43919. var styles = listToStyles(list, options);
  43920. addStylesToDom(styles, options);
  43921. return function update (newList) {
  43922. var mayRemove = [];
  43923. for (var i = 0; i < styles.length; i++) {
  43924. var item = styles[i];
  43925. var domStyle = stylesInDom[item.id];
  43926. domStyle.refs--;
  43927. mayRemove.push(domStyle);
  43928. }
  43929. if(newList) {
  43930. var newStyles = listToStyles(newList, options);
  43931. addStylesToDom(newStyles, options);
  43932. }
  43933. for (var i = 0; i < mayRemove.length; i++) {
  43934. var domStyle = mayRemove[i];
  43935. if(domStyle.refs === 0) {
  43936. for (var j = 0; j < domStyle.parts.length; j++) domStyle.parts[j]();
  43937. delete stylesInDom[domStyle.id];
  43938. }
  43939. }
  43940. };
  43941. };
  43942. function addStylesToDom (styles, options) {
  43943. for (var i = 0; i < styles.length; i++) {
  43944. var item = styles[i];
  43945. var domStyle = stylesInDom[item.id];
  43946. if(domStyle) {
  43947. domStyle.refs++;
  43948. for(var j = 0; j < domStyle.parts.length; j++) {
  43949. domStyle.parts[j](item.parts[j]);
  43950. }
  43951. for(; j < item.parts.length; j++) {
  43952. domStyle.parts.push(addStyle(item.parts[j], options));
  43953. }
  43954. } else {
  43955. var parts = [];
  43956. for(var j = 0; j < item.parts.length; j++) {
  43957. parts.push(addStyle(item.parts[j], options));
  43958. }
  43959. stylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};
  43960. }
  43961. }
  43962. }
  43963. function listToStyles (list, options) {
  43964. var styles = [];
  43965. var newStyles = {};
  43966. for (var i = 0; i < list.length; i++) {
  43967. var item = list[i];
  43968. var id = options.base ? item[0] + options.base : item[0];
  43969. var css = item[1];
  43970. var media = item[2];
  43971. var sourceMap = item[3];
  43972. var part = {css: css, media: media, sourceMap: sourceMap};
  43973. if(!newStyles[id]) styles.push(newStyles[id] = {id: id, parts: [part]});
  43974. else newStyles[id].parts.push(part);
  43975. }
  43976. return styles;
  43977. }
  43978. function insertStyleElement (options, style) {
  43979. var target = getElement(options.insertInto)
  43980. if (!target) {
  43981. throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");
  43982. }
  43983. var lastStyleElementInsertedAtTop = stylesInsertedAtTop[stylesInsertedAtTop.length - 1];
  43984. if (options.insertAt === "top") {
  43985. if (!lastStyleElementInsertedAtTop) {
  43986. target.insertBefore(style, target.firstChild);
  43987. } else if (lastStyleElementInsertedAtTop.nextSibling) {
  43988. target.insertBefore(style, lastStyleElementInsertedAtTop.nextSibling);
  43989. } else {
  43990. target.appendChild(style);
  43991. }
  43992. stylesInsertedAtTop.push(style);
  43993. } else if (options.insertAt === "bottom") {
  43994. target.appendChild(style);
  43995. } else if (typeof options.insertAt === "object" && options.insertAt.before) {
  43996. var nextSibling = getElement(options.insertAt.before, target);
  43997. target.insertBefore(style, nextSibling);
  43998. } else {
  43999. 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");
  44000. }
  44001. }
  44002. function removeStyleElement (style) {
  44003. if (style.parentNode === null) return false;
  44004. style.parentNode.removeChild(style);
  44005. var idx = stylesInsertedAtTop.indexOf(style);
  44006. if(idx >= 0) {
  44007. stylesInsertedAtTop.splice(idx, 1);
  44008. }
  44009. }
  44010. function createStyleElement (options) {
  44011. var style = document.createElement("style");
  44012. if(options.attrs.type === undefined) {
  44013. options.attrs.type = "text/css";
  44014. }
  44015. if(options.attrs.nonce === undefined) {
  44016. var nonce = getNonce();
  44017. if (nonce) {
  44018. options.attrs.nonce = nonce;
  44019. }
  44020. }
  44021. addAttrs(style, options.attrs);
  44022. insertStyleElement(options, style);
  44023. return style;
  44024. }
  44025. function createLinkElement (options) {
  44026. var link = document.createElement("link");
  44027. if(options.attrs.type === undefined) {
  44028. options.attrs.type = "text/css";
  44029. }
  44030. options.attrs.rel = "stylesheet";
  44031. addAttrs(link, options.attrs);
  44032. insertStyleElement(options, link);
  44033. return link;
  44034. }
  44035. function addAttrs (el, attrs) {
  44036. Object.keys(attrs).forEach(function (key) {
  44037. el.setAttribute(key, attrs[key]);
  44038. });
  44039. }
  44040. function getNonce() {
  44041. if (false) {}
  44042. return __webpack_require__.nc;
  44043. }
  44044. function addStyle (obj, options) {
  44045. var style, update, remove, result;
  44046. // If a transform function was defined, run it on the css
  44047. if (options.transform && obj.css) {
  44048. result = typeof options.transform === 'function'
  44049. ? options.transform(obj.css)
  44050. : options.transform.default(obj.css);
  44051. if (result) {
  44052. // If transform returns a value, use that instead of the original css.
  44053. // This allows running runtime transformations on the css.
  44054. obj.css = result;
  44055. } else {
  44056. // If the transform function returns a falsy value, don't add this css.
  44057. // This allows conditional loading of css
  44058. return function() {
  44059. // noop
  44060. };
  44061. }
  44062. }
  44063. if (options.singleton) {
  44064. var styleIndex = singletonCounter++;
  44065. style = singleton || (singleton = createStyleElement(options));
  44066. update = applyToSingletonTag.bind(null, style, styleIndex, false);
  44067. remove = applyToSingletonTag.bind(null, style, styleIndex, true);
  44068. } else if (
  44069. obj.sourceMap &&
  44070. typeof URL === "function" &&
  44071. typeof URL.createObjectURL === "function" &&
  44072. typeof URL.revokeObjectURL === "function" &&
  44073. typeof Blob === "function" &&
  44074. typeof btoa === "function"
  44075. ) {
  44076. style = createLinkElement(options);
  44077. update = updateLink.bind(null, style, options);
  44078. remove = function () {
  44079. removeStyleElement(style);
  44080. if(style.href) URL.revokeObjectURL(style.href);
  44081. };
  44082. } else {
  44083. style = createStyleElement(options);
  44084. update = applyToTag.bind(null, style);
  44085. remove = function () {
  44086. removeStyleElement(style);
  44087. };
  44088. }
  44089. update(obj);
  44090. return function updateStyle (newObj) {
  44091. if (newObj) {
  44092. if (
  44093. newObj.css === obj.css &&
  44094. newObj.media === obj.media &&
  44095. newObj.sourceMap === obj.sourceMap
  44096. ) {
  44097. return;
  44098. }
  44099. update(obj = newObj);
  44100. } else {
  44101. remove();
  44102. }
  44103. };
  44104. }
  44105. var replaceText = (function () {
  44106. var textStore = [];
  44107. return function (index, replacement) {
  44108. textStore[index] = replacement;
  44109. return textStore.filter(Boolean).join('\n');
  44110. };
  44111. })();
  44112. function applyToSingletonTag (style, index, remove, obj) {
  44113. var css = remove ? "" : obj.css;
  44114. if (style.styleSheet) {
  44115. style.styleSheet.cssText = replaceText(index, css);
  44116. } else {
  44117. var cssNode = document.createTextNode(css);
  44118. var childNodes = style.childNodes;
  44119. if (childNodes[index]) style.removeChild(childNodes[index]);
  44120. if (childNodes.length) {
  44121. style.insertBefore(cssNode, childNodes[index]);
  44122. } else {
  44123. style.appendChild(cssNode);
  44124. }
  44125. }
  44126. }
  44127. function applyToTag (style, obj) {
  44128. var css = obj.css;
  44129. var media = obj.media;
  44130. if(media) {
  44131. style.setAttribute("media", media)
  44132. }
  44133. if(style.styleSheet) {
  44134. style.styleSheet.cssText = css;
  44135. } else {
  44136. while(style.firstChild) {
  44137. style.removeChild(style.firstChild);
  44138. }
  44139. style.appendChild(document.createTextNode(css));
  44140. }
  44141. }
  44142. function updateLink (link, options, obj) {
  44143. var css = obj.css;
  44144. var sourceMap = obj.sourceMap;
  44145. /*
  44146. If convertToAbsoluteUrls isn't defined, but sourcemaps are enabled
  44147. and there is no publicPath defined then lets turn convertToAbsoluteUrls
  44148. on by default. Otherwise default to the convertToAbsoluteUrls option
  44149. directly
  44150. */
  44151. var autoFixUrls = options.convertToAbsoluteUrls === undefined && sourceMap;
  44152. if (options.convertToAbsoluteUrls || autoFixUrls) {
  44153. css = fixUrls(css);
  44154. }
  44155. if (sourceMap) {
  44156. // http://stackoverflow.com/a/26603875
  44157. css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */";
  44158. }
  44159. var blob = new Blob([css], { type: "text/css" });
  44160. var oldSrc = link.href;
  44161. link.href = URL.createObjectURL(blob);
  44162. if(oldSrc) URL.revokeObjectURL(oldSrc);
  44163. }
  44164. /***/ }),
  44165. /***/ "./node_modules/style-loader/lib/urls.js":
  44166. /*!***********************************************!*\
  44167. !*** ./node_modules/style-loader/lib/urls.js ***!
  44168. \***********************************************/
  44169. /*! no static exports found */
  44170. /***/ (function(module, exports) {
  44171. /**
  44172. * When source maps are enabled, `style-loader` uses a link element with a data-uri to
  44173. * embed the css on the page. This breaks all relative urls because now they are relative to a
  44174. * bundle instead of the current page.
  44175. *
  44176. * One solution is to only use full urls, but that may be impossible.
  44177. *
  44178. * Instead, this function "fixes" the relative urls to be absolute according to the current page location.
  44179. *
  44180. * A rudimentary test suite is located at `test/fixUrls.js` and can be run via the `npm test` command.
  44181. *
  44182. */
  44183. module.exports = function (css) {
  44184. // get current location
  44185. var location = typeof window !== "undefined" && window.location;
  44186. if (!location) {
  44187. throw new Error("fixUrls requires window.location");
  44188. }
  44189. // blank or null?
  44190. if (!css || typeof css !== "string") {
  44191. return css;
  44192. }
  44193. var baseUrl = location.protocol + "//" + location.host;
  44194. var currentDir = baseUrl + location.pathname.replace(/\/[^\/]*$/, "/");
  44195. // convert each url(...)
  44196. /*
  44197. This regular expression is just a way to recursively match brackets within
  44198. a string.
  44199. /url\s*\( = Match on the word "url" with any whitespace after it and then a parens
  44200. ( = Start a capturing group
  44201. (?: = Start a non-capturing group
  44202. [^)(] = Match anything that isn't a parentheses
  44203. | = OR
  44204. \( = Match a start parentheses
  44205. (?: = Start another non-capturing groups
  44206. [^)(]+ = Match anything that isn't a parentheses
  44207. | = OR
  44208. \( = Match a start parentheses
  44209. [^)(]* = Match anything that isn't a parentheses
  44210. \) = Match a end parentheses
  44211. ) = End Group
  44212. *\) = Match anything and then a close parens
  44213. ) = Close non-capturing group
  44214. * = Match anything
  44215. ) = Close capturing group
  44216. \) = Match a close parens
  44217. /gi = Get all matches, not the first. Be case insensitive.
  44218. */
  44219. var fixedCss = css.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi, function(fullMatch, origUrl) {
  44220. // strip quotes (if they exist)
  44221. var unquotedOrigUrl = origUrl
  44222. .trim()
  44223. .replace(/^"(.*)"$/, function(o, $1){ return $1; })
  44224. .replace(/^'(.*)'$/, function(o, $1){ return $1; });
  44225. // already a full url? no change
  44226. if (/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(unquotedOrigUrl)) {
  44227. return fullMatch;
  44228. }
  44229. // convert the url to a full url
  44230. var newUrl;
  44231. if (unquotedOrigUrl.indexOf("//") === 0) {
  44232. //TODO: should we add protocol?
  44233. newUrl = unquotedOrigUrl;
  44234. } else if (unquotedOrigUrl.indexOf("/") === 0) {
  44235. // path should be relative to the base url
  44236. newUrl = baseUrl + unquotedOrigUrl; // already starts with '/'
  44237. } else {
  44238. // path should be relative to current directory
  44239. newUrl = currentDir + unquotedOrigUrl.replace(/^\.\//, ""); // Strip leading './'
  44240. }
  44241. // send back the fixed url(...)
  44242. return "url(" + JSON.stringify(newUrl) + ")";
  44243. });
  44244. // send back the fixed css
  44245. return fixedCss;
  44246. };
  44247. /***/ }),
  44248. /***/ "./node_modules/timers-browserify/main.js":
  44249. /*!************************************************!*\
  44250. !*** ./node_modules/timers-browserify/main.js ***!
  44251. \************************************************/
  44252. /*! no static exports found */
  44253. /***/ (function(module, exports, __webpack_require__) {
  44254. /* WEBPACK VAR INJECTION */(function(global) {var scope = (typeof global !== "undefined" && global) ||
  44255. (typeof self !== "undefined" && self) ||
  44256. window;
  44257. var apply = Function.prototype.apply;
  44258. // DOM APIs, for completeness
  44259. exports.setTimeout = function() {
  44260. return new Timeout(apply.call(setTimeout, scope, arguments), clearTimeout);
  44261. };
  44262. exports.setInterval = function() {
  44263. return new Timeout(apply.call(setInterval, scope, arguments), clearInterval);
  44264. };
  44265. exports.clearTimeout =
  44266. exports.clearInterval = function(timeout) {
  44267. if (timeout) {
  44268. timeout.close();
  44269. }
  44270. };
  44271. function Timeout(id, clearFn) {
  44272. this._id = id;
  44273. this._clearFn = clearFn;
  44274. }
  44275. Timeout.prototype.unref = Timeout.prototype.ref = function() {};
  44276. Timeout.prototype.close = function() {
  44277. this._clearFn.call(scope, this._id);
  44278. };
  44279. // Does not start the time, just sets up the members needed.
  44280. exports.enroll = function(item, msecs) {
  44281. clearTimeout(item._idleTimeoutId);
  44282. item._idleTimeout = msecs;
  44283. };
  44284. exports.unenroll = function(item) {
  44285. clearTimeout(item._idleTimeoutId);
  44286. item._idleTimeout = -1;
  44287. };
  44288. exports._unrefActive = exports.active = function(item) {
  44289. clearTimeout(item._idleTimeoutId);
  44290. var msecs = item._idleTimeout;
  44291. if (msecs >= 0) {
  44292. item._idleTimeoutId = setTimeout(function onTimeout() {
  44293. if (item._onTimeout)
  44294. item._onTimeout();
  44295. }, msecs);
  44296. }
  44297. };
  44298. // setimmediate attaches itself to the global object
  44299. __webpack_require__(/*! setimmediate */ "./node_modules/setimmediate/setImmediate.js");
  44300. // On some exotic environments, it's not clear which object `setimmediate` was
  44301. // able to install onto. Search each possibility in the same order as the
  44302. // `setimmediate` library.
  44303. exports.setImmediate = (typeof self !== "undefined" && self.setImmediate) ||
  44304. (typeof global !== "undefined" && global.setImmediate) ||
  44305. (this && this.setImmediate);
  44306. exports.clearImmediate = (typeof self !== "undefined" && self.clearImmediate) ||
  44307. (typeof global !== "undefined" && global.clearImmediate) ||
  44308. (this && this.clearImmediate);
  44309. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  44310. /***/ }),
  44311. /***/ "./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&":
  44312. /*!************************************************************************************************************************************************************************************************************!*\
  44313. !*** ./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& ***!
  44314. \************************************************************************************************************************************************************************************************************/
  44315. /*! exports provided: render, staticRenderFns */
  44316. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  44317. "use strict";
  44318. __webpack_require__.r(__webpack_exports__);
  44319. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
  44320. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
  44321. var render = function() {
  44322. var _vm = this
  44323. var _h = _vm.$createElement
  44324. var _c = _vm._self._c || _h
  44325. return _c(
  44326. "div",
  44327. [
  44328. _c("asset-info-edit-modal", {
  44329. attrs: {
  44330. "modal-id": "asset" + _vm.asset.pcid + "editModal",
  44331. "populate-with": _vm.asset
  44332. }
  44333. }),
  44334. _vm._v(" "),
  44335. _c("h4", { staticClass: "text-center" }, [
  44336. _vm._v(
  44337. _vm._s(this.asset.pcmanu) + " " + _vm._s(this.asset.pcmake) + " - "
  44338. ),
  44339. _c("small", { staticClass: "text-muted" }, [
  44340. _vm._v(_vm._s(this.asset.pcnickname))
  44341. ])
  44342. ]),
  44343. _vm._v(" "),
  44344. _c("p", [_vm._v("OS: " + _vm._s(this.asset.pcextra[2]))]),
  44345. _vm._v(" "),
  44346. _c("p", [_vm._v("S/N: " + _vm._s(this.asset.pcextra[104]))]),
  44347. _vm._v(" "),
  44348. _c("p", [_vm._v("CPU: " + _vm._s(this.asset.pcextra[101]))]),
  44349. _vm._v(" "),
  44350. _c("p", [_vm._v("RAM: " + _vm._s(this.asset.pcextra[100]))]),
  44351. _vm._v(" "),
  44352. _c("p", [_vm._v("Graphics: " + _vm._s(this.asset.pcextra[4]))]),
  44353. _vm._v(" "),
  44354. _c(
  44355. "button",
  44356. {
  44357. staticClass: "btn btn-primary",
  44358. attrs: {
  44359. type: "button",
  44360. "data-toggle": "modal",
  44361. "data-target": "#asset" + _vm.asset.pcid + "editModal"
  44362. }
  44363. },
  44364. [_vm._v("Edit")]
  44365. )
  44366. ],
  44367. 1
  44368. )
  44369. }
  44370. var staticRenderFns = []
  44371. render._withStripped = true
  44372. /***/ }),
  44373. /***/ "./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&":
  44374. /*!*********************************************************************************************************************************************************************************************************************!*\
  44375. !*** ./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& ***!
  44376. \*********************************************************************************************************************************************************************************************************************/
  44377. /*! exports provided: render, staticRenderFns */
  44378. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  44379. "use strict";
  44380. __webpack_require__.r(__webpack_exports__);
  44381. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
  44382. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
  44383. var render = function() {
  44384. var _vm = this
  44385. var _h = _vm.$createElement
  44386. var _c = _vm._self._c || _h
  44387. return _c(
  44388. "modal",
  44389. {
  44390. attrs: {
  44391. id: _vm.modalId,
  44392. tabindex: "-1",
  44393. role: "dialog",
  44394. "aria-labelledby": _vm.modalId + "Label"
  44395. }
  44396. },
  44397. [
  44398. _c(
  44399. "h5",
  44400. {
  44401. staticClass: "modal-title",
  44402. attrs: { slot: "header", id: _vm.modalId + "Label" },
  44403. slot: "header"
  44404. },
  44405. [_vm._v("\n Edit Work Order Information\n ")]
  44406. ),
  44407. _vm._v(" "),
  44408. _c("div", { attrs: { slot: "body" }, slot: "body" }, [
  44409. _c("div", { staticClass: "form-group" }, [
  44410. _c("label", { attrs: { for: "manufacturer" } }, [
  44411. _vm._v("Manufacturer")
  44412. ]),
  44413. _vm._v(" "),
  44414. _c("input", {
  44415. directives: [
  44416. {
  44417. name: "model",
  44418. rawName: "v-model",
  44419. value: _vm.asset.pcmanu,
  44420. expression: "asset.pcmanu"
  44421. }
  44422. ],
  44423. staticClass: "form-control",
  44424. attrs: { type: "text", name: "manufacturer", id: "manufacturer" },
  44425. domProps: { value: _vm.asset.pcmanu },
  44426. on: {
  44427. input: function($event) {
  44428. if ($event.target.composing) {
  44429. return
  44430. }
  44431. _vm.$set(_vm.asset, "pcmanu", $event.target.value)
  44432. }
  44433. }
  44434. })
  44435. ]),
  44436. _vm._v(" "),
  44437. _c("div", { staticClass: "form-group" }, [
  44438. _c("label", { attrs: { for: "make" } }, [_vm._v("Make")]),
  44439. _vm._v(" "),
  44440. _c("input", {
  44441. directives: [
  44442. {
  44443. name: "model",
  44444. rawName: "v-model",
  44445. value: _vm.asset.pcmake,
  44446. expression: "asset.pcmake"
  44447. }
  44448. ],
  44449. staticClass: "form-control",
  44450. attrs: { type: "text", name: "make", id: "make" },
  44451. domProps: { value: _vm.asset.pcmake },
  44452. on: {
  44453. input: function($event) {
  44454. if ($event.target.composing) {
  44455. return
  44456. }
  44457. _vm.$set(_vm.asset, "pcmake", $event.target.value)
  44458. }
  44459. }
  44460. })
  44461. ]),
  44462. _vm._v(" "),
  44463. _c("div", { staticClass: "form-group" }, [
  44464. _c("label", { attrs: { for: "nickname" } }, [_vm._v("Nickname")]),
  44465. _vm._v(" "),
  44466. _c("input", {
  44467. directives: [
  44468. {
  44469. name: "model",
  44470. rawName: "v-model",
  44471. value: _vm.asset.pcnickname,
  44472. expression: "asset.pcnickname"
  44473. }
  44474. ],
  44475. staticClass: "form-control",
  44476. attrs: { type: "text", name: "nickname", id: "nickname" },
  44477. domProps: { value: _vm.asset.pcnickname },
  44478. on: {
  44479. input: function($event) {
  44480. if ($event.target.composing) {
  44481. return
  44482. }
  44483. _vm.$set(_vm.asset, "pcnickname", $event.target.value)
  44484. }
  44485. }
  44486. })
  44487. ]),
  44488. _vm._v(" "),
  44489. _c("div", { staticClass: "form-group" }, [
  44490. _c("label", { attrs: { for: "os" } }, [_vm._v("OS")]),
  44491. _vm._v(" "),
  44492. _c("input", {
  44493. directives: [
  44494. {
  44495. name: "model",
  44496. rawName: "v-model",
  44497. value: _vm.asset.pcextra[2],
  44498. expression: "asset.pcextra[2]"
  44499. }
  44500. ],
  44501. staticClass: "form-control",
  44502. attrs: { type: "text", name: "os", id: "os" },
  44503. domProps: { value: _vm.asset.pcextra[2] },
  44504. on: {
  44505. input: function($event) {
  44506. if ($event.target.composing) {
  44507. return
  44508. }
  44509. _vm.$set(_vm.asset.pcextra, 2, $event.target.value)
  44510. }
  44511. }
  44512. })
  44513. ]),
  44514. _vm._v(" "),
  44515. _c("div", { staticClass: "form-group" }, [
  44516. _c("label", { attrs: { for: "serial" } }, [_vm._v("Serial Number")]),
  44517. _vm._v(" "),
  44518. _c("input", {
  44519. directives: [
  44520. {
  44521. name: "model",
  44522. rawName: "v-model",
  44523. value: _vm.asset.pcextra[104],
  44524. expression: "asset.pcextra[104]"
  44525. }
  44526. ],
  44527. staticClass: "form-control",
  44528. attrs: { type: "text", id: "serial", name: "serial" },
  44529. domProps: { value: _vm.asset.pcextra[104] },
  44530. on: {
  44531. input: function($event) {
  44532. if ($event.target.composing) {
  44533. return
  44534. }
  44535. _vm.$set(_vm.asset.pcextra, 104, $event.target.value)
  44536. }
  44537. }
  44538. })
  44539. ]),
  44540. _vm._v(" "),
  44541. _c("div", { staticClass: "form-group" }, [
  44542. _c("label", { attrs: { for: "cpu" } }, [_vm._v("CPU")]),
  44543. _vm._v(" "),
  44544. _c("input", {
  44545. directives: [
  44546. {
  44547. name: "model",
  44548. rawName: "v-model",
  44549. value: _vm.asset.pcextra[101],
  44550. expression: "asset.pcextra[101]"
  44551. }
  44552. ],
  44553. staticClass: "form-control",
  44554. attrs: { type: "text", id: "cpu", name: "cpu" },
  44555. domProps: { value: _vm.asset.pcextra[101] },
  44556. on: {
  44557. input: function($event) {
  44558. if ($event.target.composing) {
  44559. return
  44560. }
  44561. _vm.$set(_vm.asset.pcextra, 101, $event.target.value)
  44562. }
  44563. }
  44564. })
  44565. ]),
  44566. _vm._v(" "),
  44567. _c("div", { staticClass: "form-group" }, [
  44568. _c("label", { attrs: { for: "ram" } }, [_vm._v("RAM")]),
  44569. _vm._v(" "),
  44570. _c("input", {
  44571. directives: [
  44572. {
  44573. name: "model",
  44574. rawName: "v-model",
  44575. value: _vm.asset.pcextra[100],
  44576. expression: "asset.pcextra[100]"
  44577. }
  44578. ],
  44579. staticClass: "form-control",
  44580. attrs: { type: "text", name: "ram", id: "ram" },
  44581. domProps: { value: _vm.asset.pcextra[100] },
  44582. on: {
  44583. input: function($event) {
  44584. if ($event.target.composing) {
  44585. return
  44586. }
  44587. _vm.$set(_vm.asset.pcextra, 100, $event.target.value)
  44588. }
  44589. }
  44590. })
  44591. ]),
  44592. _vm._v(" "),
  44593. _c("div", { staticClass: "form-group" }, [
  44594. _c("label", { attrs: { for: "graphics" } }, [_vm._v("Graphics")]),
  44595. _vm._v(" "),
  44596. _c("input", {
  44597. directives: [
  44598. {
  44599. name: "model",
  44600. rawName: "v-model",
  44601. value: _vm.asset.pcextra[4],
  44602. expression: "asset.pcextra[4]"
  44603. }
  44604. ],
  44605. staticClass: "form-control",
  44606. attrs: { type: "text", name: "graphics", id: "grapics" },
  44607. domProps: { value: _vm.asset.pcextra[4] },
  44608. on: {
  44609. input: function($event) {
  44610. if ($event.target.composing) {
  44611. return
  44612. }
  44613. _vm.$set(_vm.asset.pcextra, 4, $event.target.value)
  44614. }
  44615. }
  44616. })
  44617. ])
  44618. ]),
  44619. _vm._v(" "),
  44620. _c("div", { attrs: { slot: "footer" }, slot: "footer" }, [
  44621. _c(
  44622. "button",
  44623. {
  44624. staticClass: "btn btn-secondary",
  44625. attrs: { type: "button", "data-dismiss": "modal" }
  44626. },
  44627. [_vm._v("Close")]
  44628. ),
  44629. _vm._v(" "),
  44630. _c(
  44631. "button",
  44632. {
  44633. staticClass: "btn btn-primary",
  44634. attrs: { type: "button" },
  44635. on: {
  44636. click: function($event) {
  44637. return _vm.updateAsset()
  44638. }
  44639. }
  44640. },
  44641. [
  44642. !_vm.assetSaving
  44643. ? _c("div", [_vm._v("Save")])
  44644. : _c("circle-spinner", { attrs: { size: 2 } })
  44645. ],
  44646. 1
  44647. )
  44648. ])
  44649. ]
  44650. )
  44651. }
  44652. var staticRenderFns = []
  44653. render._withStripped = true
  44654. /***/ }),
  44655. /***/ "./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&":
  44656. /*!*****************************************************************************************************************************************************************************************************************************!*\
  44657. !*** ./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& ***!
  44658. \*****************************************************************************************************************************************************************************************************************************/
  44659. /*! exports provided: render, staticRenderFns */
  44660. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  44661. "use strict";
  44662. __webpack_require__.r(__webpack_exports__);
  44663. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
  44664. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
  44665. var render = function() {
  44666. var _vm = this
  44667. var _h = _vm.$createElement
  44668. var _c = _vm._self._c || _h
  44669. return _c("div", { staticClass: "dropdown", class: { open: _vm.open } }, [
  44670. _c("div", { staticClass: "input-group" }, [
  44671. _c("input", {
  44672. directives: [
  44673. {
  44674. name: "model",
  44675. rawName: "v-model",
  44676. value: _vm.searchText,
  44677. expression: "searchText"
  44678. }
  44679. ],
  44680. staticClass: "form-control",
  44681. attrs: { type: "text" },
  44682. domProps: { value: _vm.searchText },
  44683. on: {
  44684. input: [
  44685. function($event) {
  44686. if ($event.target.composing) {
  44687. return
  44688. }
  44689. _vm.searchText = $event.target.value
  44690. },
  44691. _vm.searchChanged
  44692. ]
  44693. }
  44694. }),
  44695. _vm._v(" "),
  44696. _c("div", { staticClass: "form-group-append" }, [
  44697. _c(
  44698. "a",
  44699. {
  44700. staticClass: "toggle input-group-text bg-primary text-light",
  44701. on: {
  44702. mousedown: function($event) {
  44703. $event.preventDefault()
  44704. },
  44705. click: function($event) {
  44706. return _vm.setOpen(!_vm.open)
  44707. }
  44708. }
  44709. },
  44710. [
  44711. _c("span", { staticClass: "arrow-up" }, [_vm._v("▲")]),
  44712. _vm._v(" "),
  44713. _c("span", { staticClass: "arrow-down" }, [_vm._v("▼")])
  44714. ]
  44715. )
  44716. ])
  44717. ]),
  44718. _vm._v(" "),
  44719. _c(
  44720. "ul",
  44721. { staticClass: "suggestion-list list-unstyled" },
  44722. _vm._l(_vm.matches, function(suggestion, index) {
  44723. return _c(
  44724. "li",
  44725. {
  44726. key: index,
  44727. on: {
  44728. mousedown: function($event) {
  44729. $event.preventDefault()
  44730. },
  44731. click: function($event) {
  44732. return _vm.suggestionSelected(suggestion)
  44733. }
  44734. }
  44735. },
  44736. [_vm._v("\n " + _vm._s(suggestion[1]) + "\n ")]
  44737. )
  44738. }),
  44739. 0
  44740. )
  44741. ])
  44742. }
  44743. var staticRenderFns = []
  44744. render._withStripped = true
  44745. /***/ }),
  44746. /***/ "./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&":
  44747. /*!****************************************************************************************************************************************************************************************************************************!*\
  44748. !*** ./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& ***!
  44749. \****************************************************************************************************************************************************************************************************************************/
  44750. /*! exports provided: render, staticRenderFns */
  44751. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  44752. "use strict";
  44753. __webpack_require__.r(__webpack_exports__);
  44754. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
  44755. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
  44756. var render = function() {
  44757. var _vm = this
  44758. var _h = _vm.$createElement
  44759. var _c = _vm._self._c || _h
  44760. return _c(
  44761. "div",
  44762. {
  44763. staticClass: "loader",
  44764. style: {
  44765. fontSize: _vm.size + "px",
  44766. borderLeft: "1.1em solid " + _vm.color
  44767. }
  44768. },
  44769. [_vm._v("Loading...")]
  44770. )
  44771. }
  44772. var staticRenderFns = []
  44773. render._withStripped = true
  44774. /***/ }),
  44775. /***/ "./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&":
  44776. /*!*************************************************************************************************************************************************************************************************************!*\
  44777. !*** ./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& ***!
  44778. \*************************************************************************************************************************************************************************************************************/
  44779. /*! exports provided: render, staticRenderFns */
  44780. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  44781. "use strict";
  44782. __webpack_require__.r(__webpack_exports__);
  44783. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
  44784. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
  44785. var render = function() {
  44786. var _vm = this
  44787. var _h = _vm.$createElement
  44788. var _c = _vm._self._c || _h
  44789. return _c(
  44790. "div",
  44791. { staticClass: "bg-lightgray m-1 p-2 border rounded container-fluid" },
  44792. [
  44793. _c("credential-form-modal", {
  44794. attrs: {
  44795. descriptions: _vm.creddescList,
  44796. "modal-id": "credential" + this.data.credid + "editModal",
  44797. populateWith: this.data
  44798. }
  44799. }),
  44800. _vm._v(" "),
  44801. _c(
  44802. "modal",
  44803. {
  44804. attrs: {
  44805. id: "credential" + this.data.credid + "deleteModal",
  44806. tabindex: "-1"
  44807. }
  44808. },
  44809. [
  44810. _c(
  44811. "h5",
  44812. {
  44813. staticClass: "modal-title",
  44814. attrs: {
  44815. slot: "header",
  44816. id: "credential" + this.data.credid + "deleteModalLabel"
  44817. },
  44818. slot: "header"
  44819. },
  44820. [_vm._v("\r\n Delete Credential\r\n ")]
  44821. ),
  44822. _vm._v(" "),
  44823. _c("div", { attrs: { slot: "body" }, slot: "body" }, [
  44824. _vm._v("\r\n Are you sure?\r\n ")
  44825. ]),
  44826. _vm._v(" "),
  44827. _c("div", { attrs: { slot: "footer" }, slot: "footer" }, [
  44828. _c(
  44829. "button",
  44830. {
  44831. staticClass: "btn btn-secondary",
  44832. attrs: { type: "button", "data-dismiss": "modal" }
  44833. },
  44834. [_vm._v("Cancel")]
  44835. ),
  44836. _vm._v(" "),
  44837. _c(
  44838. "button",
  44839. {
  44840. staticClass: "btn btn-danger",
  44841. attrs: { type: "button" },
  44842. on: {
  44843. click: function($event) {
  44844. return _vm.deleteCredential()
  44845. }
  44846. }
  44847. },
  44848. [_vm._v("Confirm")]
  44849. )
  44850. ])
  44851. ]
  44852. ),
  44853. _vm._v(" "),
  44854. _c("div", { staticClass: "row no-gutters" }, [
  44855. _c("div", { staticClass: "h5 col-3 text-left" }, [
  44856. _vm._v(_vm._s(this.data.creddesc))
  44857. ]),
  44858. _vm._v(" "),
  44859. _c("div", { staticClass: "col-9 text-right" }, [
  44860. _vm._v(_vm._s(this.data.creddate))
  44861. ])
  44862. ]),
  44863. _vm._v(" "),
  44864. _c("div", { staticClass: "row" }, [
  44865. _c("div", { staticClass: "col-lg-9" }, [
  44866. _c("div", [
  44867. _vm._m(0),
  44868. _vm._v(" "),
  44869. _c("input", {
  44870. staticClass: "border-0 credential",
  44871. attrs: {
  44872. type: "text",
  44873. id: "username" + this.data.credid,
  44874. readonly: ""
  44875. },
  44876. domProps: { value: this.data.creduser }
  44877. }),
  44878. _vm._v(" "),
  44879. _c(
  44880. "button",
  44881. {
  44882. staticClass: "btn-clip btn btn-sm btn-primary rounded-pill",
  44883. attrs: {
  44884. id: "btn-username" + this.data.credid,
  44885. "data-clipboard-target": "#username" + this.data.credid
  44886. }
  44887. },
  44888. [_c("i", { staticClass: "far fa-clone" })]
  44889. )
  44890. ]),
  44891. _vm._v(" "),
  44892. _c("div", [
  44893. _vm._m(1),
  44894. _vm._v(" "),
  44895. _c("input", {
  44896. staticClass: "border-0 credential",
  44897. attrs: {
  44898. type: "text",
  44899. id: "password" + this.data.credid,
  44900. readonly: ""
  44901. },
  44902. domProps: { value: this.data.credpass }
  44903. }),
  44904. _vm._v(" "),
  44905. _c(
  44906. "button",
  44907. {
  44908. staticClass: "btn-clip btn btn-sm btn-primary rounded-pill",
  44909. attrs: {
  44910. id: "btn-password" + this.data.credid,
  44911. "data-clipboard-target": "#password" + this.data.credid
  44912. }
  44913. },
  44914. [_c("i", { staticClass: "far fa-clone" })]
  44915. )
  44916. ])
  44917. ]),
  44918. _vm._v(" "),
  44919. _c(
  44920. "div",
  44921. {
  44922. staticClass: "btn-group col-lg-2 align-self-end w-25 w-lg-auto",
  44923. attrs: { role: "group", "aria-label": "Edit and Delete" }
  44924. },
  44925. [
  44926. _c(
  44927. "button",
  44928. {
  44929. staticClass: "btn btn-sm btn-secondary p-lg-1",
  44930. attrs: {
  44931. type: "button",
  44932. "data-toggle": "modal",
  44933. "data-target": "#credential" + this.data.credid + "editModal"
  44934. }
  44935. },
  44936. [_c("i", { staticClass: "fas fa-fw fa-edit" })]
  44937. ),
  44938. _vm._v(" "),
  44939. _c(
  44940. "button",
  44941. {
  44942. staticClass: "btn btn-sm btn-danger p-lg-1",
  44943. attrs: {
  44944. type: "button",
  44945. "data-toggle": "modal",
  44946. "data-target":
  44947. "#credential" + this.data.credid + "deleteModal"
  44948. }
  44949. },
  44950. [_c("i", { staticClass: "fas fa-fw fa-trash-alt" })]
  44951. )
  44952. ]
  44953. )
  44954. ])
  44955. ],
  44956. 1
  44957. )
  44958. }
  44959. var staticRenderFns = [
  44960. function() {
  44961. var _vm = this
  44962. var _h = _vm.$createElement
  44963. var _c = _vm._self._c || _h
  44964. return _c("label", { attrs: { for: "username" } }, [
  44965. _c("i", { staticClass: "fas fa-fw fa-user" })
  44966. ])
  44967. },
  44968. function() {
  44969. var _vm = this
  44970. var _h = _vm.$createElement
  44971. var _c = _vm._self._c || _h
  44972. return _c("label", { attrs: { for: "password" } }, [
  44973. _c("i", { staticClass: "fas fa-fw fa-key" })
  44974. ])
  44975. }
  44976. ]
  44977. render._withStripped = true
  44978. /***/ }),
  44979. /***/ "./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&":
  44980. /*!**********************************************************************************************************************************************************************************************************************!*\
  44981. !*** ./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& ***!
  44982. \**********************************************************************************************************************************************************************************************************************/
  44983. /*! exports provided: render, staticRenderFns */
  44984. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  44985. "use strict";
  44986. __webpack_require__.r(__webpack_exports__);
  44987. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
  44988. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
  44989. var render = function() {
  44990. var _vm = this
  44991. var _h = _vm.$createElement
  44992. var _c = _vm._self._c || _h
  44993. return _c(
  44994. "modal",
  44995. {
  44996. attrs: {
  44997. id: _vm.id,
  44998. tabindex: "-1",
  44999. role: "dialog",
  45000. "aria-labelledby": _vm.id + "Label"
  45001. }
  45002. },
  45003. [
  45004. _c(
  45005. "h5",
  45006. {
  45007. staticClass: "modal-title",
  45008. attrs: { slot: "header", id: _vm.id + "Label" },
  45009. slot: "header"
  45010. },
  45011. [_vm._v("\n Edit Credential\n ")]
  45012. ),
  45013. _vm._v(" "),
  45014. _c("div", { attrs: { slot: "body" }, slot: "body" }, [
  45015. _c(
  45016. "div",
  45017. { staticClass: "form" },
  45018. [
  45019. _c("autocomplete-custom-dropdown", {
  45020. attrs: {
  45021. options: _vm.descriptions,
  45022. value: _vm.creddesc,
  45023. "allow-custom": true
  45024. },
  45025. model: {
  45026. value: _vm.creddesc,
  45027. callback: function($$v) {
  45028. _vm.creddesc = $$v
  45029. },
  45030. expression: "creddesc"
  45031. }
  45032. })
  45033. ],
  45034. 1
  45035. ),
  45036. _vm._v(" "),
  45037. _c("div", { staticClass: "form-group" }, [
  45038. _c("label", { attrs: { for: "newusername" } }, [_vm._v("Username")]),
  45039. _vm._v(" "),
  45040. _c("input", {
  45041. directives: [
  45042. {
  45043. name: "model",
  45044. rawName: "v-model",
  45045. value: _vm.data.creduser,
  45046. expression: "data.creduser"
  45047. }
  45048. ],
  45049. staticClass: "form-control credential",
  45050. attrs: {
  45051. type: "text",
  45052. name: "newusername" + _vm.data.credid,
  45053. id: "newusername" + _vm.data.credid
  45054. },
  45055. domProps: { value: _vm.data.creduser },
  45056. on: {
  45057. input: function($event) {
  45058. if ($event.target.composing) {
  45059. return
  45060. }
  45061. _vm.$set(_vm.data, "creduser", $event.target.value)
  45062. }
  45063. }
  45064. })
  45065. ]),
  45066. _vm._v(" "),
  45067. _c("div", { staticClass: "form-group" }, [
  45068. _c("label", { attrs: { for: "newpassword" } }, [_vm._v("Password")]),
  45069. _vm._v(" "),
  45070. _c("input", {
  45071. directives: [
  45072. {
  45073. name: "model",
  45074. rawName: "v-model",
  45075. value: _vm.data.credpass,
  45076. expression: "data.credpass"
  45077. }
  45078. ],
  45079. staticClass: "form-control credential",
  45080. attrs: {
  45081. type: "text",
  45082. name: "newpassword" + _vm.data.credid,
  45083. id: "newpassword" + _vm.data.credid
  45084. },
  45085. domProps: { value: _vm.data.credpass },
  45086. on: {
  45087. input: function($event) {
  45088. if ($event.target.composing) {
  45089. return
  45090. }
  45091. _vm.$set(_vm.data, "credpass", $event.target.value)
  45092. }
  45093. }
  45094. }),
  45095. _vm._v(" "),
  45096. _c(
  45097. "button",
  45098. {
  45099. staticClass: "btn btn-secondary",
  45100. attrs: { type: "button" },
  45101. on: {
  45102. click: function($event) {
  45103. return _vm.getRandomPassword(_vm.data.credid)
  45104. }
  45105. }
  45106. },
  45107. [_vm._v("Generate Random")]
  45108. )
  45109. ]),
  45110. _vm._v(" "),
  45111. _c("div", { staticClass: "form-group" })
  45112. ]),
  45113. _vm._v(" "),
  45114. _c("div", { attrs: { slot: "footer" }, slot: "footer" }, [
  45115. _c(
  45116. "button",
  45117. {
  45118. staticClass: "btn btn-secondary",
  45119. attrs: { type: "button", "data-dismiss": "modal" }
  45120. },
  45121. [_vm._v("Close")]
  45122. ),
  45123. _vm._v(" "),
  45124. _c(
  45125. "button",
  45126. {
  45127. staticClass: "btn btn-primary",
  45128. attrs: { type: "button" },
  45129. on: {
  45130. click: function($event) {
  45131. return _vm.updateCredential()
  45132. }
  45133. }
  45134. },
  45135. [_vm._v("Save")]
  45136. )
  45137. ])
  45138. ]
  45139. )
  45140. }
  45141. var staticRenderFns = []
  45142. render._withStripped = true
  45143. /***/ }),
  45144. /***/ "./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&":
  45145. /*!*****************************************************************************************************************************************************************************************************************!*\
  45146. !*** ./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& ***!
  45147. \*****************************************************************************************************************************************************************************************************************/
  45148. /*! exports provided: render, staticRenderFns */
  45149. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  45150. "use strict";
  45151. __webpack_require__.r(__webpack_exports__);
  45152. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
  45153. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
  45154. var render = function() {
  45155. var _vm = this
  45156. var _h = _vm.$createElement
  45157. var _c = _vm._self._c || _h
  45158. return _c(
  45159. "div",
  45160. [
  45161. _c("credential-form-modal", {
  45162. attrs: {
  45163. "modal-id": "newCredentialModal",
  45164. descriptions: _vm.creddescList,
  45165. create: true,
  45166. pcid: _vm.pcid
  45167. }
  45168. }),
  45169. _vm._v(" "),
  45170. _c(
  45171. "button",
  45172. {
  45173. staticClass: "btn btn-primary",
  45174. attrs: {
  45175. type: "button",
  45176. "data-toggle": "modal",
  45177. "data-target": "#newCredentialModal"
  45178. }
  45179. },
  45180. [_vm._v("New Credential")]
  45181. ),
  45182. _vm._v(" "),
  45183. _vm._l(_vm.credentials, function(credential) {
  45184. return _c(
  45185. "div",
  45186. { key: credential.credid },
  45187. [
  45188. _c("credential", {
  45189. attrs: { credential: credential, descriptions: _vm.creddescList }
  45190. })
  45191. ],
  45192. 1
  45193. )
  45194. })
  45195. ],
  45196. 2
  45197. )
  45198. }
  45199. var staticRenderFns = []
  45200. render._withStripped = true
  45201. /***/ }),
  45202. /***/ "./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&":
  45203. /*!************************************************************************************************************************************************************************************************************!*\
  45204. !*** ./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& ***!
  45205. \************************************************************************************************************************************************************************************************************/
  45206. /*! exports provided: render, staticRenderFns */
  45207. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  45208. "use strict";
  45209. __webpack_require__.r(__webpack_exports__);
  45210. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
  45211. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
  45212. var render = function() {
  45213. var _vm = this
  45214. var _h = _vm.$createElement
  45215. var _c = _vm._self._c || _h
  45216. return _c(
  45217. "ul",
  45218. { staticClass: "list-unstyled" },
  45219. _vm._l(_vm.errorList, function(error) {
  45220. return _c("li", { key: error, staticClass: "text-danger" }, [
  45221. _vm._v(" " + _vm._s(error) + " ")
  45222. ])
  45223. }),
  45224. 0
  45225. )
  45226. }
  45227. var staticRenderFns = []
  45228. render._withStripped = true
  45229. /***/ }),
  45230. /***/ "./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&":
  45231. /*!********************************************************************************************************************************************************************************************************!*\
  45232. !*** ./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& ***!
  45233. \********************************************************************************************************************************************************************************************************/
  45234. /*! exports provided: render, staticRenderFns */
  45235. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  45236. "use strict";
  45237. __webpack_require__.r(__webpack_exports__);
  45238. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
  45239. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
  45240. var render = function() {
  45241. var _vm = this
  45242. var _h = _vm.$createElement
  45243. var _c = _vm._self._c || _h
  45244. return _c("div", { staticClass: "modal fade" }, [
  45245. _c(
  45246. "div",
  45247. { staticClass: "modal-dialog modal-lg", attrs: { role: "document" } },
  45248. [
  45249. _c("div", { staticClass: "modal-content" }, [
  45250. _c(
  45251. "div",
  45252. { staticClass: "modal-header" },
  45253. [_vm._m(0), _vm._v(" "), _vm._t("header")],
  45254. 2
  45255. ),
  45256. _vm._v(" "),
  45257. _c("div", { staticClass: "modal-body" }, [_vm._t("body")], 2),
  45258. _vm._v(" "),
  45259. _c("div", { staticClass: "modal-footer" }, [_vm._t("footer")], 2)
  45260. ])
  45261. ]
  45262. )
  45263. ])
  45264. }
  45265. var staticRenderFns = [
  45266. function() {
  45267. var _vm = this
  45268. var _h = _vm.$createElement
  45269. var _c = _vm._self._c || _h
  45270. return _c(
  45271. "button",
  45272. {
  45273. staticClass: "close",
  45274. attrs: {
  45275. type: "button",
  45276. "data-dismiss": "modal",
  45277. "aria-label": "Close"
  45278. }
  45279. },
  45280. [_c("span", { attrs: { "aria-hidden": "true" } }, [_vm._v("×")])]
  45281. )
  45282. }
  45283. ]
  45284. render._withStripped = true
  45285. /***/ }),
  45286. /***/ "./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&":
  45287. /*!****************************************************************************************************************************************************************************************************************!*\
  45288. !*** ./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& ***!
  45289. \****************************************************************************************************************************************************************************************************************/
  45290. /*! exports provided: render, staticRenderFns */
  45291. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  45292. "use strict";
  45293. __webpack_require__.r(__webpack_exports__);
  45294. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
  45295. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
  45296. var render = function() {
  45297. var _vm = this
  45298. var _h = _vm.$createElement
  45299. var _c = _vm._self._c || _h
  45300. return _c(
  45301. "modal",
  45302. {
  45303. attrs: {
  45304. id: _vm.modalId,
  45305. tabindex: "-1",
  45306. role: "dialog",
  45307. "aria-labelledby": _vm.modalId + "Label"
  45308. }
  45309. },
  45310. [
  45311. _c(
  45312. "h5",
  45313. {
  45314. staticClass: "modal-title",
  45315. attrs: { slot: "header", id: _vm.modalId + "Label" },
  45316. slot: "header"
  45317. },
  45318. [_vm._v("\n Edit Note\n ")]
  45319. ),
  45320. _vm._v(" "),
  45321. _c("div", { attrs: { slot: "body" }, slot: "body" }, [
  45322. _c("div", { staticClass: "form-group" }, [
  45323. _c("label", { attrs: { for: "content" } }, [_vm._v("Content")]),
  45324. _vm._v(" "),
  45325. _c("textarea", {
  45326. directives: [
  45327. {
  45328. name: "model",
  45329. rawName: "v-model",
  45330. value: _vm.note.thenote,
  45331. expression: "note.thenote"
  45332. }
  45333. ],
  45334. staticClass: "form-control",
  45335. attrs: {
  45336. name: "content" + _vm.note.noteid,
  45337. id: "content" + _vm.note.noteid
  45338. },
  45339. domProps: { value: _vm.note.thenote },
  45340. on: {
  45341. input: function($event) {
  45342. if ($event.target.composing) {
  45343. return
  45344. }
  45345. _vm.$set(_vm.note, "thenote", $event.target.value)
  45346. }
  45347. }
  45348. })
  45349. ])
  45350. ]),
  45351. _vm._v(" "),
  45352. _c("div", { attrs: { slot: "footer" }, slot: "footer" }, [
  45353. _c(
  45354. "button",
  45355. {
  45356. staticClass: "btn btn-secondary",
  45357. attrs: { type: "button", "data-dismiss": "modal" }
  45358. },
  45359. [_vm._v("Close")]
  45360. ),
  45361. _vm._v(" "),
  45362. _c(
  45363. "button",
  45364. {
  45365. staticClass: "btn btn-primary",
  45366. attrs: { type: "button" },
  45367. on: {
  45368. click: function($event) {
  45369. return _vm.updateNote(_vm.note)
  45370. }
  45371. }
  45372. },
  45373. [_vm._v("Save")]
  45374. )
  45375. ])
  45376. ]
  45377. )
  45378. }
  45379. var staticRenderFns = []
  45380. render._withStripped = true
  45381. /***/ }),
  45382. /***/ "./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&":
  45383. /*!********************************************************************************************************************************************************************************************************!*\
  45384. !*** ./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& ***!
  45385. \********************************************************************************************************************************************************************************************************/
  45386. /*! exports provided: render, staticRenderFns */
  45387. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  45388. "use strict";
  45389. __webpack_require__.r(__webpack_exports__);
  45390. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
  45391. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
  45392. var render = function() {
  45393. var _vm = this
  45394. var _h = _vm.$createElement
  45395. var _c = _vm._self._c || _h
  45396. return _c(
  45397. "ul",
  45398. { staticClass: "list-unstyled" },
  45399. [
  45400. _c("div", { staticClass: "row" }, [
  45401. _c(
  45402. "div",
  45403. {
  45404. staticClass:
  45405. "col-md-2 d-flex justify-content-center justify-content-md-start"
  45406. },
  45407. [
  45408. _c(
  45409. "button",
  45410. {
  45411. staticClass: "btn btn-primary m-2",
  45412. attrs: {
  45413. type: "button",
  45414. "data-toggle": "collapse",
  45415. "data-target": "#note" + _vm.noteType + "add"
  45416. }
  45417. },
  45418. [
  45419. _c("i", { staticClass: "fas fa-fw fa-plus" }),
  45420. _vm._v(" Add New Note")
  45421. ]
  45422. )
  45423. ]
  45424. ),
  45425. _vm._v(" "),
  45426. _c("div", { staticClass: "col-md-10" }, [
  45427. _c(
  45428. "div",
  45429. {
  45430. staticClass: "collapse",
  45431. attrs: { id: "note" + _vm.noteType + "add" }
  45432. },
  45433. [
  45434. _c(
  45435. "div",
  45436. {
  45437. staticClass:
  45438. "d-flex flex-wrap flex-md-nowrap justify-content-center"
  45439. },
  45440. [
  45441. _c("textarea", {
  45442. directives: [
  45443. {
  45444. name: "model",
  45445. rawName: "v-model",
  45446. value: _vm.newNote.thenote,
  45447. expression: "newNote.thenote"
  45448. }
  45449. ],
  45450. staticClass: "form-control",
  45451. attrs: {
  45452. name: "newnote" + _vm.noteType,
  45453. id: "newnote" + _vm.noteType
  45454. },
  45455. domProps: { value: _vm.newNote.thenote },
  45456. on: {
  45457. input: function($event) {
  45458. if ($event.target.composing) {
  45459. return
  45460. }
  45461. _vm.$set(_vm.newNote, "thenote", $event.target.value)
  45462. }
  45463. }
  45464. }),
  45465. _vm._v(" "),
  45466. _c(
  45467. "button",
  45468. {
  45469. staticClass: "btn btn-secondary m-2",
  45470. attrs: { type: "button" },
  45471. on: {
  45472. click: function($event) {
  45473. return _vm.createNote()
  45474. }
  45475. }
  45476. },
  45477. [_vm._v("Save")]
  45478. )
  45479. ]
  45480. )
  45481. ]
  45482. )
  45483. ])
  45484. ]),
  45485. _vm._v(" "),
  45486. _vm._l(this.notes, function(note, index) {
  45487. return _c(
  45488. "li",
  45489. { key: index, staticClass: "row no-gutters mb-2" },
  45490. [
  45491. _c("note-form-modal", {
  45492. attrs: {
  45493. "modal-id": "note" + note.noteid + "editModal",
  45494. "populate-with": note
  45495. }
  45496. }),
  45497. _vm._v(" "),
  45498. _c(
  45499. "div",
  45500. {
  45501. staticClass: "col-md-1 d-flex flex-column mx-md-3",
  45502. class: _vm.noteOrders[index]
  45503. },
  45504. [
  45505. _c("div", { staticClass: "text-center p-0 m-0" }, [
  45506. _vm._v(_vm._s(note.noteuser))
  45507. ]),
  45508. _vm._v(" "),
  45509. _c(
  45510. "div",
  45511. { staticClass: "text-muted text-small text-center p-0 m-0" },
  45512. [_vm._v(_vm._s(_vm.getHRDate(note.notetime)))]
  45513. ),
  45514. _vm._v(" "),
  45515. _c(
  45516. "div",
  45517. { staticClass: "btn-group justify-content-center p-0 m-0" },
  45518. [
  45519. _vm.authusername === note.noteuser ||
  45520. _vm.authusername === "admin"
  45521. ? [
  45522. _c(
  45523. "button",
  45524. {
  45525. staticClass: "btn btn-sm btn-primary m-1",
  45526. attrs: {
  45527. "data-toggle": "modal",
  45528. "data-target":
  45529. "#note" + note.noteid + "editModal"
  45530. }
  45531. },
  45532. [_c("i", { staticClass: "fas fa-fw fa-edit" })]
  45533. ),
  45534. _vm._v(" "),
  45535. _vm._m(0, true),
  45536. _vm._v(" "),
  45537. _vm._m(1, true)
  45538. ]
  45539. : _vm._e()
  45540. ],
  45541. 2
  45542. )
  45543. ]
  45544. ),
  45545. _vm._v(" "),
  45546. _c("div", { staticClass: "col-md-10" }, [
  45547. _c("div", { staticClass: "card m-2" }, [
  45548. _c("div", { staticClass: "card-body p-2" }, [
  45549. _vm._v(
  45550. "\n " +
  45551. _vm._s(note.thenote) +
  45552. "\n "
  45553. )
  45554. ])
  45555. ])
  45556. ])
  45557. ],
  45558. 1
  45559. )
  45560. })
  45561. ],
  45562. 2
  45563. )
  45564. }
  45565. var staticRenderFns = [
  45566. function() {
  45567. var _vm = this
  45568. var _h = _vm.$createElement
  45569. var _c = _vm._self._c || _h
  45570. return _c("button", { staticClass: "btn btn-sm btn-danger m-1" }, [
  45571. _c("i", { staticClass: "fas fa-fw fa-trash-alt" })
  45572. ])
  45573. },
  45574. function() {
  45575. var _vm = this
  45576. var _h = _vm.$createElement
  45577. var _c = _vm._self._c || _h
  45578. return _c("button", { staticClass: "btn btn-sm btn-primary m-1" }, [
  45579. _c("i", { staticClass: "fa fa-fw fa-random" })
  45580. ])
  45581. }
  45582. ]
  45583. render._withStripped = true
  45584. /***/ }),
  45585. /***/ "./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&":
  45586. /*!******************************************************************************************************************************************************************************************************************!*\
  45587. !*** ./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& ***!
  45588. \******************************************************************************************************************************************************************************************************************/
  45589. /*! exports provided: render, staticRenderFns */
  45590. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  45591. "use strict";
  45592. __webpack_require__.r(__webpack_exports__);
  45593. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
  45594. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
  45595. var render = function() {
  45596. var _vm = this
  45597. var _h = _vm.$createElement
  45598. var _c = _vm._self._c || _h
  45599. return _c(
  45600. "modal",
  45601. {
  45602. attrs: {
  45603. id: _vm.id,
  45604. tabindex: "-1",
  45605. role: "dialog",
  45606. "aria-labelledby": _vm.id + "Label"
  45607. }
  45608. },
  45609. [
  45610. _c(
  45611. "h5",
  45612. {
  45613. staticClass: "modal-title",
  45614. attrs: { slot: "header", id: _vm.id + "Label" },
  45615. slot: "header"
  45616. },
  45617. [_vm._v("\r\n Edit Work Order Information\r\n ")]
  45618. ),
  45619. _vm._v(" "),
  45620. _c("div", { attrs: { slot: "body" }, slot: "body" }, [
  45621. _c(
  45622. "div",
  45623. { staticClass: "form-group" },
  45624. [
  45625. _c("label", { attrs: { for: "probdesc" } }, [
  45626. _vm._v("Problem Description")
  45627. ]),
  45628. _vm._v(" "),
  45629. _c("textarea", {
  45630. directives: [
  45631. {
  45632. name: "model",
  45633. rawName: "v-model",
  45634. value: _vm.data.probdesc,
  45635. expression: "data.probdesc"
  45636. }
  45637. ],
  45638. class: {
  45639. "form-control": true,
  45640. "is-invalid": _vm.errors.probdesc
  45641. },
  45642. attrs: { id: "probdesc", name: "probdesc" },
  45643. domProps: { value: _vm.data.probdesc },
  45644. on: {
  45645. input: function($event) {
  45646. if ($event.target.composing) {
  45647. return
  45648. }
  45649. _vm.$set(_vm.data, "probdesc", $event.target.value)
  45650. }
  45651. }
  45652. }),
  45653. _vm._v(" "),
  45654. _c("error-list", { attrs: { errors: _vm.errors.probdesc } })
  45655. ],
  45656. 1
  45657. ),
  45658. _vm._v(" "),
  45659. _c(
  45660. "div",
  45661. { staticClass: "form-group" },
  45662. [
  45663. _c("label", { attrs: { for: "suggested" } }, [
  45664. _vm._v("Suggested Solution")
  45665. ]),
  45666. _vm._v(" "),
  45667. _c("textarea", {
  45668. directives: [
  45669. {
  45670. name: "model",
  45671. rawName: "v-model",
  45672. value: _vm.data.suggested,
  45673. expression: "data.suggested"
  45674. }
  45675. ],
  45676. class: {
  45677. "form-control": true,
  45678. "is-invalid": _vm.errors.suggested
  45679. },
  45680. attrs: { id: "suggested", name: "suggested" },
  45681. domProps: { value: _vm.data.suggested },
  45682. on: {
  45683. input: function($event) {
  45684. if ($event.target.composing) {
  45685. return
  45686. }
  45687. _vm.$set(_vm.data, "suggested", $event.target.value)
  45688. }
  45689. }
  45690. }),
  45691. _vm._v(" "),
  45692. _c("error-list", { attrs: { errors: _vm.errors.suggested } })
  45693. ],
  45694. 1
  45695. ),
  45696. _vm._v(" "),
  45697. _c(
  45698. "div",
  45699. { staticClass: "form-group" },
  45700. [
  45701. _c("label", { attrs: { for: "storelist" } }, [_vm._v("Store")]),
  45702. _vm._v(" "),
  45703. _c("autocomplete-custom-dropdown", {
  45704. attrs: { options: _vm.storeList, value: this.store },
  45705. model: {
  45706. value: _vm.store,
  45707. callback: function($$v) {
  45708. _vm.store = $$v
  45709. },
  45710. expression: "store"
  45711. }
  45712. })
  45713. ],
  45714. 1
  45715. )
  45716. ]),
  45717. _vm._v(" "),
  45718. _c("div", { attrs: { slot: "footer" }, slot: "footer" }, [
  45719. _c(
  45720. "button",
  45721. {
  45722. staticClass: "btn btn-secondary",
  45723. attrs: { type: "button", "data-dismiss": "modal" }
  45724. },
  45725. [_vm._v("Close")]
  45726. ),
  45727. _vm._v(" "),
  45728. _c(
  45729. "button",
  45730. {
  45731. staticClass: "btn btn-primary",
  45732. attrs: { type: "button" },
  45733. on: {
  45734. click: function($event) {
  45735. return _vm.updateWorkOrder()
  45736. }
  45737. }
  45738. },
  45739. [
  45740. !_vm.woInfoSaving
  45741. ? _c("div", [_vm._v("Save")])
  45742. : _c("circle-spinner", { attrs: { size: 2 } })
  45743. ],
  45744. 1
  45745. )
  45746. ])
  45747. ]
  45748. )
  45749. }
  45750. var staticRenderFns = []
  45751. render._withStripped = true
  45752. /***/ }),
  45753. /***/ "./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&":
  45754. /*!****************************************************************************************************************************************************************************************************************!*\
  45755. !*** ./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& ***!
  45756. \****************************************************************************************************************************************************************************************************************/
  45757. /*! exports provided: render, staticRenderFns */
  45758. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  45759. "use strict";
  45760. __webpack_require__.r(__webpack_exports__);
  45761. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
  45762. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
  45763. var render = function() {
  45764. var _vm = this
  45765. var _h = _vm.$createElement
  45766. var _c = _vm._self._c || _h
  45767. return _c(
  45768. "div",
  45769. [
  45770. _c("wo-info-edit-modal", {
  45771. attrs: {
  45772. "modal-id": "workordereditModal",
  45773. "populate-with": _vm.workOrder,
  45774. "store-list": this.storeList
  45775. }
  45776. }),
  45777. _vm._v(" "),
  45778. _c("p", [
  45779. _c("i", { staticClass: "fas fa-fw fa-info-circle" }),
  45780. _vm._v(" "),
  45781. _c("span", {
  45782. domProps: { textContent: _vm._s(_vm.workOrder.probdesc) }
  45783. })
  45784. ]),
  45785. _vm._v(" "),
  45786. _c("p", [
  45787. _c("i", { staticClass: "far fa-fw fa-lightbulb" }),
  45788. _vm._v(" "),
  45789. _c("span", {
  45790. domProps: { textContent: _vm._s(_vm.workOrder.suggested) }
  45791. })
  45792. ]),
  45793. _vm._v(" "),
  45794. _c("p", [
  45795. _c("i", { staticClass: "fas fa-fw fa-paste" }),
  45796. _vm._v(" "),
  45797. _c("span", { domProps: { textContent: _vm._s(_vm.workOrder.woid) } })
  45798. ]),
  45799. _vm._v(" "),
  45800. _c("p", [
  45801. _c("i", { staticClass: "fas fa-fw fa-building" }),
  45802. _vm._v(" "),
  45803. _c("span", [_vm._v(_vm._s(_vm.storeList[_vm.workOrder.storeid]))])
  45804. ]),
  45805. _vm._v(" "),
  45806. _c("p", [
  45807. _c("i", { staticClass: "fas fa-fw fa-sign-in-alt" }),
  45808. _vm._v(" "),
  45809. _c(
  45810. "span",
  45811. {
  45812. staticClass: "dashed-underline",
  45813. attrs: {
  45814. "data-toggle": "tooltip",
  45815. "data-placement": "bottom",
  45816. title: this.getHRDate(_vm.workOrder.dropdate)
  45817. }
  45818. },
  45819. [
  45820. _vm._v(
  45821. "\n " +
  45822. _vm._s(
  45823. Math.floor(this.daysSinceToday(_vm.workOrder.dropdate))
  45824. ) +
  45825. " days ago\n "
  45826. )
  45827. ]
  45828. )
  45829. ]),
  45830. _vm._v(" "),
  45831. _c("p", [
  45832. _c("i", { staticClass: "fas fa-sign-out-alt" }),
  45833. _vm._v(" "),
  45834. !this.isZero(_vm.workOrder.pickupdate)
  45835. ? _c(
  45836. "span",
  45837. {
  45838. staticClass: "dashed-underline",
  45839. attrs: {
  45840. "data-toggle": "tooltip",
  45841. "data-placement": "bottom",
  45842. title: this.getHRDate(_vm.workOrder.pickupdate)
  45843. }
  45844. },
  45845. [
  45846. _vm._v(
  45847. "\n " +
  45848. _vm._s(
  45849. Math.floor(this.daysSinceToday(_vm.workOrder.pickupdate))
  45850. ) +
  45851. " days ago\n "
  45852. )
  45853. ]
  45854. )
  45855. : _vm._e()
  45856. ]),
  45857. _vm._v(" "),
  45858. _c(
  45859. "button",
  45860. {
  45861. staticClass: "btn btn-primary",
  45862. attrs: {
  45863. type: "button",
  45864. "data-toggle": "modal",
  45865. "data-target": "#workordereditModal"
  45866. }
  45867. },
  45868. [_vm._v("Edit")]
  45869. )
  45870. ],
  45871. 1
  45872. )
  45873. }
  45874. var staticRenderFns = []
  45875. render._withStripped = true
  45876. /***/ }),
  45877. /***/ "./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&":
  45878. /*!*************************************************************************************************************************************************************************************************!*\
  45879. !*** ./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& ***!
  45880. \*************************************************************************************************************************************************************************************************/
  45881. /*! exports provided: render, staticRenderFns */
  45882. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  45883. "use strict";
  45884. __webpack_require__.r(__webpack_exports__);
  45885. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
  45886. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
  45887. var render = function() {
  45888. var _vm = this
  45889. var _h = _vm.$createElement
  45890. var _c = _vm._self._c || _h
  45891. return _c("div", [
  45892. _c(
  45893. "nav",
  45894. {
  45895. staticClass:
  45896. "navbar navbar-expand navbar-dark bg-primary text-light shadow-sm"
  45897. },
  45898. [
  45899. _c(
  45900. "div",
  45901. { staticClass: "container-fluid" },
  45902. [
  45903. _c(
  45904. "router-link",
  45905. { staticClass: "navbar-brand", attrs: { to: { name: "home" } } },
  45906. [_vm._v("\n UPCCRT\n ")]
  45907. ),
  45908. _vm._v(" "),
  45909. _vm._m(0),
  45910. _vm._v(" "),
  45911. _c(
  45912. "div",
  45913. {
  45914. staticClass: "collapse navbar-collapse",
  45915. attrs: { id: "navbarSupportedContent" }
  45916. },
  45917. [
  45918. _c("ul", { staticClass: "navbar-nav mr-auto text-center" }, [
  45919. _vm._m(1),
  45920. _vm._v(" "),
  45921. _vm._m(2),
  45922. _vm._v(" "),
  45923. _c(
  45924. "li",
  45925. { staticClass: "nav-item" },
  45926. [
  45927. _c(
  45928. "router-link",
  45929. {
  45930. staticClass: "nav-link",
  45931. attrs: { to: { name: "dashboard" } }
  45932. },
  45933. [
  45934. _c("i", { staticClass: "fas fa-tachometer-alt" }),
  45935. _vm._v(" "),
  45936. _c(
  45937. "span",
  45938. { staticClass: "d-none d-sm-block d-md-inline" },
  45939. [_vm._v("Dashboard")]
  45940. )
  45941. ]
  45942. )
  45943. ],
  45944. 1
  45945. ),
  45946. _vm._v(" "),
  45947. _vm._m(3)
  45948. ]),
  45949. _vm._v(" "),
  45950. _c(
  45951. "ul",
  45952. { staticClass: "navbar-nav ml-auto" },
  45953. [
  45954. !_vm.isLoggedIn
  45955. ? _c(
  45956. "router-link",
  45957. {
  45958. staticClass: "nav-link",
  45959. attrs: { to: { name: "login" } }
  45960. },
  45961. [_vm._v("Login")]
  45962. )
  45963. : _vm._e(),
  45964. _vm._v(" "),
  45965. _vm.isLoggedIn
  45966. ? _c("li", { staticClass: "nav-link" }, [
  45967. _vm._v(_vm._s(_vm.username))
  45968. ])
  45969. : _vm._e(),
  45970. _vm._v(" "),
  45971. _vm.isLoggedIn
  45972. ? _c(
  45973. "router-link",
  45974. {
  45975. staticClass: "nav-link",
  45976. attrs: { to: { name: "home" } }
  45977. },
  45978. [_vm._v("Home")]
  45979. )
  45980. : _vm._e()
  45981. ],
  45982. 1
  45983. )
  45984. ]
  45985. )
  45986. ],
  45987. 1
  45988. )
  45989. ]
  45990. ),
  45991. _vm._v(" "),
  45992. _c("main", { staticClass: "py-4" }, [_c("router-view")], 1)
  45993. ])
  45994. }
  45995. var staticRenderFns = [
  45996. function() {
  45997. var _vm = this
  45998. var _h = _vm.$createElement
  45999. var _c = _vm._self._c || _h
  46000. return _c(
  46001. "button",
  46002. {
  46003. staticClass: "navbar-toggler",
  46004. attrs: {
  46005. type: "button",
  46006. "data-toggle": "collapse",
  46007. "data-target": "#navbarSupportedContent",
  46008. "aria-controls": "navbarSupportedContent",
  46009. "aria-expanded": "false"
  46010. }
  46011. },
  46012. [_c("span", { staticClass: "navbar-toggler-icon" })]
  46013. )
  46014. },
  46015. function() {
  46016. var _vm = this
  46017. var _h = _vm.$createElement
  46018. var _c = _vm._self._c || _h
  46019. return _c("li", { staticClass: "nav-item" }, [
  46020. _c("a", { staticClass: "nav-link", attrs: { href: "#" } }, [
  46021. _c("i", { staticClass: "fas fa-sign-in-alt" }),
  46022. _vm._v(" "),
  46023. _c("span", { staticClass: "d-none d-sm-block d-md-inline" }, [
  46024. _vm._v("Check-In")
  46025. ])
  46026. ])
  46027. ])
  46028. },
  46029. function() {
  46030. var _vm = this
  46031. var _h = _vm.$createElement
  46032. var _c = _vm._self._c || _h
  46033. return _c("li", { staticClass: "nav-item" }, [
  46034. _c("a", { staticClass: "nav-link", attrs: { href: "#" } }, [
  46035. _c("i", { staticClass: "fas fa-sign-out-alt" }),
  46036. _vm._v(" "),
  46037. _c("span", { staticClass: "d-none d-sm-block d-md-inline" }, [
  46038. _vm._v("Check-Out")
  46039. ])
  46040. ])
  46041. ])
  46042. },
  46043. function() {
  46044. var _vm = this
  46045. var _h = _vm.$createElement
  46046. var _c = _vm._self._c || _h
  46047. return _c("li", { staticClass: "nav-item" }, [
  46048. _c("a", { staticClass: "nav-link", attrs: { href: "#" } }, [
  46049. _c("i", { staticClass: "fas fa-chart-bar" }),
  46050. _vm._v(" "),
  46051. _c("span", { staticClass: "d-none d-sm-block d-md-inline" }, [
  46052. _vm._v("Reports")
  46053. ])
  46054. ])
  46055. ])
  46056. }
  46057. ]
  46058. render._withStripped = true
  46059. /***/ }),
  46060. /***/ "./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&":
  46061. /*!*******************************************************************************************************************************************************************************************************!*\
  46062. !*** ./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& ***!
  46063. \*******************************************************************************************************************************************************************************************************/
  46064. /*! exports provided: render, staticRenderFns */
  46065. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  46066. "use strict";
  46067. __webpack_require__.r(__webpack_exports__);
  46068. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
  46069. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
  46070. var render = function() {
  46071. var _vm = this
  46072. var _h = _vm.$createElement
  46073. var _c = _vm._self._c || _h
  46074. return _c("div", { staticClass: "container" }, [
  46075. _c("div", { staticClass: "row justify-content-center" }, [
  46076. !_vm.isLoading
  46077. ? _c(
  46078. "div",
  46079. { staticClass: "col-md-12" },
  46080. _vm._l(_vm.workOrders, function(workOrder, index) {
  46081. return _c(
  46082. "div",
  46083. { key: workOrder.woid, staticClass: "col-md-4" },
  46084. [
  46085. _c("div", { staticClass: "card" }, [
  46086. _c(
  46087. "div",
  46088. { staticClass: "card-header" },
  46089. [
  46090. _c(
  46091. "router-link",
  46092. {
  46093. staticClass: "h4 card-title",
  46094. attrs: {
  46095. to: {
  46096. name: "workorders",
  46097. params: { id: workOrder.woid }
  46098. }
  46099. }
  46100. },
  46101. [_vm._v(_vm._s(workOrder.woid))]
  46102. )
  46103. ],
  46104. 1
  46105. ),
  46106. _vm._v(" "),
  46107. _c("div", { staticClass: "card-body card-body-dark" }, [
  46108. _c("div", [
  46109. _vm._v(
  46110. "\n " +
  46111. _vm._s(workOrder.probdesc) +
  46112. "\n "
  46113. )
  46114. ]),
  46115. _vm._v(" "),
  46116. _c("div", [
  46117. _vm._v(
  46118. "\n " +
  46119. _vm._s(workOrder.suggested) +
  46120. "\n "
  46121. )
  46122. ])
  46123. ])
  46124. ])
  46125. ]
  46126. )
  46127. }),
  46128. 0
  46129. )
  46130. : _c(
  46131. "div",
  46132. { staticClass: "col-md-12" },
  46133. [_c("circle-spinner", { attrs: { color: "#663399" } })],
  46134. 1
  46135. )
  46136. ])
  46137. ])
  46138. }
  46139. var staticRenderFns = []
  46140. render._withStripped = true
  46141. /***/ }),
  46142. /***/ "./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&":
  46143. /*!***************************************************************************************************************************************************************************************************!*\
  46144. !*** ./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& ***!
  46145. \***************************************************************************************************************************************************************************************************/
  46146. /*! exports provided: render, staticRenderFns */
  46147. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  46148. "use strict";
  46149. __webpack_require__.r(__webpack_exports__);
  46150. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
  46151. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
  46152. var render = function() {
  46153. var _vm = this
  46154. var _h = _vm.$createElement
  46155. var _c = _vm._self._c || _h
  46156. return _c("div", { staticClass: "container" }, [
  46157. _c("div", { staticClass: "row justify-content-center" }, [
  46158. _c("div", { staticClass: "col-md-8" }, [
  46159. _c("div", { staticClass: "card card-default" }, [
  46160. _c("div", { staticClass: "card-header" }, [_vm._v("Login")]),
  46161. _vm._v(" "),
  46162. _c("div", { staticClass: "card-body" }, [
  46163. _c("form", { attrs: { method: "POST", action: "/login" } }, [
  46164. _c("div", { staticClass: "form-group row" }, [
  46165. _c(
  46166. "label",
  46167. {
  46168. staticClass: "col-sm-4 col-form-label text-md-right",
  46169. attrs: { for: "username" }
  46170. },
  46171. [_vm._v("Username")]
  46172. ),
  46173. _vm._v(" "),
  46174. _c("div", { staticClass: "col-md-6" }, [
  46175. _c("input", {
  46176. directives: [
  46177. {
  46178. name: "model",
  46179. rawName: "v-model",
  46180. value: _vm.username,
  46181. expression: "username"
  46182. }
  46183. ],
  46184. staticClass: "form-control",
  46185. attrs: {
  46186. id: "username",
  46187. type: "username",
  46188. required: "",
  46189. autofocus: ""
  46190. },
  46191. domProps: { value: _vm.username },
  46192. on: {
  46193. input: function($event) {
  46194. if ($event.target.composing) {
  46195. return
  46196. }
  46197. _vm.username = $event.target.value
  46198. }
  46199. }
  46200. })
  46201. ])
  46202. ]),
  46203. _vm._v(" "),
  46204. _c("div", { staticClass: "form-group row" }, [
  46205. _c(
  46206. "label",
  46207. {
  46208. staticClass: "col-md-4 col-form-label text-md-right",
  46209. attrs: { for: "password" }
  46210. },
  46211. [_vm._v("Password")]
  46212. ),
  46213. _vm._v(" "),
  46214. _c("div", { staticClass: "col-md-6" }, [
  46215. _c("input", {
  46216. directives: [
  46217. {
  46218. name: "model",
  46219. rawName: "v-model",
  46220. value: _vm.password,
  46221. expression: "password"
  46222. }
  46223. ],
  46224. staticClass: "form-control",
  46225. attrs: { id: "password", type: "password", required: "" },
  46226. domProps: { value: _vm.password },
  46227. on: {
  46228. input: function($event) {
  46229. if ($event.target.composing) {
  46230. return
  46231. }
  46232. _vm.password = $event.target.value
  46233. }
  46234. }
  46235. })
  46236. ])
  46237. ]),
  46238. _vm._v(" "),
  46239. _c("div", { staticClass: "form-group row mb-0" }, [
  46240. _c("div", { staticClass: "col-md-8 offset-md-4" }, [
  46241. _c(
  46242. "button",
  46243. {
  46244. staticClass: "btn btn-primary",
  46245. attrs: { type: "submit" },
  46246. on: { click: _vm.handleSubmit }
  46247. },
  46248. [
  46249. _vm._v(
  46250. "\n Login\n "
  46251. )
  46252. ]
  46253. )
  46254. ])
  46255. ])
  46256. ])
  46257. ])
  46258. ])
  46259. ])
  46260. ])
  46261. ])
  46262. }
  46263. var staticRenderFns = []
  46264. render._withStripped = true
  46265. /***/ }),
  46266. /***/ "./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&":
  46267. /*!*****************************************************************************************************************************************************************************************************************!*\
  46268. !*** ./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& ***!
  46269. \*****************************************************************************************************************************************************************************************************************/
  46270. /*! exports provided: render, staticRenderFns */
  46271. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  46272. "use strict";
  46273. __webpack_require__.r(__webpack_exports__);
  46274. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
  46275. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
  46276. var render = function() {
  46277. var _vm = this
  46278. var _h = _vm.$createElement
  46279. var _c = _vm._self._c || _h
  46280. return _vm._m(0)
  46281. }
  46282. var staticRenderFns = [
  46283. function() {
  46284. var _vm = this
  46285. var _h = _vm.$createElement
  46286. var _c = _vm._self._c || _h
  46287. return _c("div", { staticClass: "flex-center position-ref full-height" }, [
  46288. _c("div", { staticClass: "content" }, [
  46289. _c("div", { staticClass: "m-b-md" }, [
  46290. _c("h2", { staticClass: "title m-b-md" }, [
  46291. _vm._v("\n UPCCRT\n ")
  46292. ]),
  46293. _vm._v(" "),
  46294. _c("h3", [
  46295. _vm._v(
  46296. "\n University PC Care Repair Tracker\n "
  46297. )
  46298. ])
  46299. ])
  46300. ])
  46301. ])
  46302. }
  46303. ]
  46304. render._withStripped = true
  46305. /***/ }),
  46306. /***/ "./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&":
  46307. /*!*******************************************************************************************************************************************************************************************************!*\
  46308. !*** ./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& ***!
  46309. \*******************************************************************************************************************************************************************************************************/
  46310. /*! exports provided: render, staticRenderFns */
  46311. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  46312. "use strict";
  46313. __webpack_require__.r(__webpack_exports__);
  46314. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
  46315. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
  46316. var render = function() {
  46317. var _vm = this
  46318. var _h = _vm.$createElement
  46319. var _c = _vm._self._c || _h
  46320. return _c("div", { staticClass: "container-fluid" }, [
  46321. _c("div", { staticClass: "row my-3" }, [
  46322. _c("div", { staticClass: "col-lg-6" }, [
  46323. _c("div", { staticClass: "card h-100" }, [
  46324. _vm._m(0),
  46325. _vm._v(" "),
  46326. _c("div", { staticClass: "card-body" }, [
  46327. _c("div", { staticClass: "tab-content" }, [
  46328. _c(
  46329. "div",
  46330. {
  46331. staticClass: "tab-pane active",
  46332. attrs: {
  46333. id: "assetinfo",
  46334. role: "tabpanel",
  46335. "aria-labelledby": "assetinfo-tab"
  46336. }
  46337. },
  46338. [
  46339. !_vm.assetLoading
  46340. ? _c("asset-info", { attrs: { asset: _vm.asset } })
  46341. : _c("circle-spinner", { attrs: { color: "#663399" } })
  46342. ],
  46343. 1
  46344. ),
  46345. _vm._v(" "),
  46346. _c(
  46347. "div",
  46348. {
  46349. staticClass: "tab-pane",
  46350. attrs: {
  46351. id: "credentials",
  46352. role: "tabpanel",
  46353. "aria-labelledby": "credentials-tab"
  46354. }
  46355. },
  46356. [
  46357. !_vm.credentialsLoading && !_vm.credentialDescriptionsLoading
  46358. ? _c("credential-list", {
  46359. attrs: {
  46360. credentials: _vm.credentials,
  46361. descriptions: _vm.credentialDescriptions,
  46362. pcid: _vm.asset.pcid
  46363. }
  46364. })
  46365. : _c("circle-spinner", { attrs: { color: "#663399" } })
  46366. ],
  46367. 1
  46368. )
  46369. ])
  46370. ])
  46371. ])
  46372. ]),
  46373. _vm._v(" "),
  46374. _c("div", { staticClass: "col-lg-6" }, [
  46375. _c("div", { staticClass: "card h-100" }, [
  46376. _vm._m(1),
  46377. _vm._v(" "),
  46378. _c("div", { staticClass: "card-body" }, [
  46379. _c("div", { staticClass: "tab-content" }, [
  46380. _c(
  46381. "div",
  46382. {
  46383. staticClass: "tab-pane active",
  46384. attrs: {
  46385. id: "workordersumm",
  46386. role: "tabpanel",
  46387. "aria-labelledby": "workordersumm-tab"
  46388. }
  46389. },
  46390. [
  46391. !_vm.woLoading && !_vm.storesLoading
  46392. ? _c("work-order-info", {
  46393. attrs: {
  46394. "work-order": _vm.workOrder,
  46395. stores: _vm.stores
  46396. }
  46397. })
  46398. : _c("circle-spinner", { attrs: { color: "#663399" } })
  46399. ],
  46400. 1
  46401. ),
  46402. _vm._v(" "),
  46403. _c(
  46404. "div",
  46405. {
  46406. staticClass: "tab-pane",
  46407. attrs: {
  46408. id: "attachments",
  46409. role: "tabpanel",
  46410. "aria-labelledby": "attachments-tab"
  46411. }
  46412. },
  46413. [
  46414. _vm._v(
  46415. "\n TODO 2\n "
  46416. )
  46417. ]
  46418. )
  46419. ])
  46420. ])
  46421. ])
  46422. ])
  46423. ]),
  46424. _vm._v(" "),
  46425. _c("div", { staticClass: "row my-3 no-gutters" }, [
  46426. _c("div", { staticClass: "col-12" }, [
  46427. _c("div", { staticClass: "card" }, [
  46428. _c(
  46429. "div",
  46430. { staticClass: "card-body" },
  46431. [
  46432. _c("h5", { staticClass: "card-title" }, [
  46433. _vm._v("Customer Notes")
  46434. ]),
  46435. _vm._v(" "),
  46436. !_vm.workOrderNotesLoading
  46437. ? _c("notes", {
  46438. attrs: {
  46439. notes: _vm.publicNotes,
  46440. authusername: _vm.authUser,
  46441. "note-type": 0,
  46442. woid: _vm.id
  46443. }
  46444. })
  46445. : _c("circle-spinner", { attrs: { color: "#663399" } })
  46446. ],
  46447. 1
  46448. )
  46449. ])
  46450. ])
  46451. ]),
  46452. _vm._v(" "),
  46453. _c("div", { staticClass: "row my-3 no-gutters" }, [
  46454. _c("div", { staticClass: "col-12" }, [
  46455. _c("div", { staticClass: "card" }, [
  46456. _c(
  46457. "div",
  46458. { staticClass: "card-body" },
  46459. [
  46460. _c("h5", { staticClass: "card-title" }, [
  46461. _vm._v("Private/Billing Notes")
  46462. ]),
  46463. _vm._v(" "),
  46464. !_vm.workOrderNotesLoading
  46465. ? _c("notes", {
  46466. attrs: {
  46467. notes: _vm.privateNotes,
  46468. authusername: _vm.authUser,
  46469. "note-type": 1,
  46470. woid: _vm.id
  46471. }
  46472. })
  46473. : _c("circle-spinner", { attrs: { color: "#663399" } })
  46474. ],
  46475. 1
  46476. )
  46477. ])
  46478. ])
  46479. ])
  46480. ])
  46481. }
  46482. var staticRenderFns = [
  46483. function() {
  46484. var _vm = this
  46485. var _h = _vm.$createElement
  46486. var _c = _vm._self._c || _h
  46487. return _c("div", { staticClass: "card-header text-right" }, [
  46488. _c(
  46489. "button",
  46490. {
  46491. staticClass: "btn btn-default xs-toggle",
  46492. attrs: {
  46493. type: "button",
  46494. "data-toggle": "collapse",
  46495. "data-target": "#assetTab"
  46496. }
  46497. },
  46498. [
  46499. _c("span", { staticClass: "sr-only" }, [_vm._v("Toggle Navigation")]),
  46500. _vm._v(" "),
  46501. _c("span", { staticClass: "icon-bar" }),
  46502. _vm._v(" "),
  46503. _c("span", { staticClass: "icon-bar" }),
  46504. _vm._v(" "),
  46505. _c("span", { staticClass: "icon-bar" })
  46506. ]
  46507. ),
  46508. _vm._v(" "),
  46509. _c(
  46510. "ul",
  46511. {
  46512. staticClass:
  46513. "nav nav-pills card-header-pills nav-justified xs-collapse collapse",
  46514. attrs: { id: "assetTab", role: "tablist" }
  46515. },
  46516. [
  46517. _c("li", { staticClass: "nav-item" }, [
  46518. _c(
  46519. "a",
  46520. {
  46521. staticClass: "nav-link active",
  46522. attrs: {
  46523. id: "assetinfo-tab",
  46524. "data-toggle": "pill",
  46525. href: "#assetinfo",
  46526. role: "tab",
  46527. "aria-controls": "assetinfo",
  46528. "aria-selected": "true"
  46529. }
  46530. },
  46531. [_vm._v("Hardware")]
  46532. )
  46533. ]),
  46534. _vm._v(" "),
  46535. _c("li", { staticClass: "nav-item" }, [
  46536. _c(
  46537. "a",
  46538. {
  46539. staticClass: "nav-link",
  46540. attrs: {
  46541. id: "credentials-tab",
  46542. "data-toggle": "pill",
  46543. href: "#credentials",
  46544. role: "tab",
  46545. "aria-controls": "credentials",
  46546. "aria-selected": "false"
  46547. }
  46548. },
  46549. [_vm._v("Credentials")]
  46550. )
  46551. ])
  46552. ]
  46553. )
  46554. ])
  46555. },
  46556. function() {
  46557. var _vm = this
  46558. var _h = _vm.$createElement
  46559. var _c = _vm._self._c || _h
  46560. return _c("div", { staticClass: "card-header text-right" }, [
  46561. _c(
  46562. "button",
  46563. {
  46564. staticClass: "btn btn-default xs-toggle",
  46565. attrs: {
  46566. type: "button",
  46567. "data-toggle": "collapse",
  46568. "data-target": "#workorderTab"
  46569. }
  46570. },
  46571. [
  46572. _c("span", { staticClass: "sr-only" }, [_vm._v("Toggle Navigation")]),
  46573. _vm._v(" "),
  46574. _c("span", { staticClass: "icon-bar" }),
  46575. _vm._v(" "),
  46576. _c("span", { staticClass: "icon-bar" }),
  46577. _vm._v(" "),
  46578. _c("span", { staticClass: "icon-bar" })
  46579. ]
  46580. ),
  46581. _vm._v(" "),
  46582. _c(
  46583. "ul",
  46584. {
  46585. staticClass:
  46586. "nav nav-pills card-header-pills nav-justified xs-collapse collapse",
  46587. attrs: { id: "workorderTab", role: "tablist" }
  46588. },
  46589. [
  46590. _c("li", { staticClass: "nav-item" }, [
  46591. _c(
  46592. "a",
  46593. {
  46594. staticClass: "nav-link active",
  46595. attrs: {
  46596. id: "workordersumm-tab",
  46597. "data-toggle": "pill",
  46598. href: "#workordersumm",
  46599. role: "tab",
  46600. "aria-controls": "workordersumm",
  46601. "aria-selected": "true"
  46602. }
  46603. },
  46604. [_vm._v("Summary")]
  46605. )
  46606. ]),
  46607. _vm._v(" "),
  46608. _c("li", { staticClass: "nav-item" }, [
  46609. _c(
  46610. "a",
  46611. {
  46612. staticClass: "nav-link",
  46613. attrs: {
  46614. id: "attachments-tab",
  46615. "data-toggle": "pill",
  46616. href: "#attachments",
  46617. role: "tab",
  46618. "aria-controls": "attachments",
  46619. "aria-selected": "false"
  46620. }
  46621. },
  46622. [_vm._v("Attachments")]
  46623. )
  46624. ])
  46625. ]
  46626. )
  46627. ])
  46628. }
  46629. ]
  46630. render._withStripped = true
  46631. /***/ }),
  46632. /***/ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js":
  46633. /*!********************************************************************!*\
  46634. !*** ./node_modules/vue-loader/lib/runtime/componentNormalizer.js ***!
  46635. \********************************************************************/
  46636. /*! exports provided: default */
  46637. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  46638. "use strict";
  46639. __webpack_require__.r(__webpack_exports__);
  46640. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  46641. /* globals __VUE_SSR_CONTEXT__ */
  46642. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  46643. // This module is a runtime utility for cleaner component module output and will
  46644. // be included in the final webpack user bundle.
  46645. function normalizeComponent (
  46646. scriptExports,
  46647. render,
  46648. staticRenderFns,
  46649. functionalTemplate,
  46650. injectStyles,
  46651. scopeId,
  46652. moduleIdentifier, /* server only */
  46653. shadowMode /* vue-cli only */
  46654. ) {
  46655. // Vue.extend constructor export interop
  46656. var options = typeof scriptExports === 'function'
  46657. ? scriptExports.options
  46658. : scriptExports
  46659. // render functions
  46660. if (render) {
  46661. options.render = render
  46662. options.staticRenderFns = staticRenderFns
  46663. options._compiled = true
  46664. }
  46665. // functional template
  46666. if (functionalTemplate) {
  46667. options.functional = true
  46668. }
  46669. // scopedId
  46670. if (scopeId) {
  46671. options._scopeId = 'data-v-' + scopeId
  46672. }
  46673. var hook
  46674. if (moduleIdentifier) { // server build
  46675. hook = function (context) {
  46676. // 2.3 injection
  46677. context =
  46678. context || // cached call
  46679. (this.$vnode && this.$vnode.ssrContext) || // stateful
  46680. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  46681. // 2.2 with runInNewContext: true
  46682. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  46683. context = __VUE_SSR_CONTEXT__
  46684. }
  46685. // inject component styles
  46686. if (injectStyles) {
  46687. injectStyles.call(this, context)
  46688. }
  46689. // register component module identifier for async chunk inferrence
  46690. if (context && context._registeredComponents) {
  46691. context._registeredComponents.add(moduleIdentifier)
  46692. }
  46693. }
  46694. // used by ssr in case component is cached and beforeCreate
  46695. // never gets called
  46696. options._ssrRegister = hook
  46697. } else if (injectStyles) {
  46698. hook = shadowMode
  46699. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  46700. : injectStyles
  46701. }
  46702. if (hook) {
  46703. if (options.functional) {
  46704. // for template-only hot-reload because in that case the render fn doesn't
  46705. // go through the normalizer
  46706. options._injectStyles = hook
  46707. // register for functioal component in vue file
  46708. var originalRender = options.render
  46709. options.render = function renderWithStyleInjection (h, context) {
  46710. hook.call(context)
  46711. return originalRender(h, context)
  46712. }
  46713. } else {
  46714. // inject component registration as beforeCreate hook
  46715. var existing = options.beforeCreate
  46716. options.beforeCreate = existing
  46717. ? [].concat(existing, hook)
  46718. : [hook]
  46719. }
  46720. }
  46721. return {
  46722. exports: scriptExports,
  46723. options: options
  46724. }
  46725. }
  46726. /***/ }),
  46727. /***/ "./node_modules/vue-router/dist/vue-router.esm.js":
  46728. /*!********************************************************!*\
  46729. !*** ./node_modules/vue-router/dist/vue-router.esm.js ***!
  46730. \********************************************************/
  46731. /*! exports provided: default */
  46732. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  46733. "use strict";
  46734. __webpack_require__.r(__webpack_exports__);
  46735. /*!
  46736. * vue-router v3.1.6
  46737. * (c) 2020 Evan You
  46738. * @license MIT
  46739. */
  46740. /* */
  46741. function assert (condition, message) {
  46742. if (!condition) {
  46743. throw new Error(("[vue-router] " + message))
  46744. }
  46745. }
  46746. function warn (condition, message) {
  46747. if ( true && !condition) {
  46748. typeof console !== 'undefined' && console.warn(("[vue-router] " + message));
  46749. }
  46750. }
  46751. function isError (err) {
  46752. return Object.prototype.toString.call(err).indexOf('Error') > -1
  46753. }
  46754. function isExtendedError (constructor, err) {
  46755. return (
  46756. err instanceof constructor ||
  46757. // _name is to support IE9 too
  46758. (err && (err.name === constructor.name || err._name === constructor._name))
  46759. )
  46760. }
  46761. function extend (a, b) {
  46762. for (var key in b) {
  46763. a[key] = b[key];
  46764. }
  46765. return a
  46766. }
  46767. var View = {
  46768. name: 'RouterView',
  46769. functional: true,
  46770. props: {
  46771. name: {
  46772. type: String,
  46773. default: 'default'
  46774. }
  46775. },
  46776. render: function render (_, ref) {
  46777. var props = ref.props;
  46778. var children = ref.children;
  46779. var parent = ref.parent;
  46780. var data = ref.data;
  46781. // used by devtools to display a router-view badge
  46782. data.routerView = true;
  46783. // directly use parent context's createElement() function
  46784. // so that components rendered by router-view can resolve named slots
  46785. var h = parent.$createElement;
  46786. var name = props.name;
  46787. var route = parent.$route;
  46788. var cache = parent._routerViewCache || (parent._routerViewCache = {});
  46789. // determine current view depth, also check to see if the tree
  46790. // has been toggled inactive but kept-alive.
  46791. var depth = 0;
  46792. var inactive = false;
  46793. while (parent && parent._routerRoot !== parent) {
  46794. var vnodeData = parent.$vnode ? parent.$vnode.data : {};
  46795. if (vnodeData.routerView) {
  46796. depth++;
  46797. }
  46798. if (vnodeData.keepAlive && parent._directInactive && parent._inactive) {
  46799. inactive = true;
  46800. }
  46801. parent = parent.$parent;
  46802. }
  46803. data.routerViewDepth = depth;
  46804. // render previous view if the tree is inactive and kept-alive
  46805. if (inactive) {
  46806. var cachedData = cache[name];
  46807. var cachedComponent = cachedData && cachedData.component;
  46808. if (cachedComponent) {
  46809. // #2301
  46810. // pass props
  46811. if (cachedData.configProps) {
  46812. fillPropsinData(cachedComponent, data, cachedData.route, cachedData.configProps);
  46813. }
  46814. return h(cachedComponent, data, children)
  46815. } else {
  46816. // render previous empty view
  46817. return h()
  46818. }
  46819. }
  46820. var matched = route.matched[depth];
  46821. var component = matched && matched.components[name];
  46822. // render empty node if no matched route or no config component
  46823. if (!matched || !component) {
  46824. cache[name] = null;
  46825. return h()
  46826. }
  46827. // cache component
  46828. cache[name] = { component: component };
  46829. // attach instance registration hook
  46830. // this will be called in the instance's injected lifecycle hooks
  46831. data.registerRouteInstance = function (vm, val) {
  46832. // val could be undefined for unregistration
  46833. var current = matched.instances[name];
  46834. if (
  46835. (val && current !== vm) ||
  46836. (!val && current === vm)
  46837. ) {
  46838. matched.instances[name] = val;
  46839. }
  46840. }
  46841. // also register instance in prepatch hook
  46842. // in case the same component instance is reused across different routes
  46843. ;(data.hook || (data.hook = {})).prepatch = function (_, vnode) {
  46844. matched.instances[name] = vnode.componentInstance;
  46845. };
  46846. // register instance in init hook
  46847. // in case kept-alive component be actived when routes changed
  46848. data.hook.init = function (vnode) {
  46849. if (vnode.data.keepAlive &&
  46850. vnode.componentInstance &&
  46851. vnode.componentInstance !== matched.instances[name]
  46852. ) {
  46853. matched.instances[name] = vnode.componentInstance;
  46854. }
  46855. };
  46856. var configProps = matched.props && matched.props[name];
  46857. // save route and configProps in cachce
  46858. if (configProps) {
  46859. extend(cache[name], {
  46860. route: route,
  46861. configProps: configProps
  46862. });
  46863. fillPropsinData(component, data, route, configProps);
  46864. }
  46865. return h(component, data, children)
  46866. }
  46867. };
  46868. function fillPropsinData (component, data, route, configProps) {
  46869. // resolve props
  46870. var propsToPass = data.props = resolveProps(route, configProps);
  46871. if (propsToPass) {
  46872. // clone to prevent mutation
  46873. propsToPass = data.props = extend({}, propsToPass);
  46874. // pass non-declared props as attrs
  46875. var attrs = data.attrs = data.attrs || {};
  46876. for (var key in propsToPass) {
  46877. if (!component.props || !(key in component.props)) {
  46878. attrs[key] = propsToPass[key];
  46879. delete propsToPass[key];
  46880. }
  46881. }
  46882. }
  46883. }
  46884. function resolveProps (route, config) {
  46885. switch (typeof config) {
  46886. case 'undefined':
  46887. return
  46888. case 'object':
  46889. return config
  46890. case 'function':
  46891. return config(route)
  46892. case 'boolean':
  46893. return config ? route.params : undefined
  46894. default:
  46895. if (true) {
  46896. warn(
  46897. false,
  46898. "props in \"" + (route.path) + "\" is a " + (typeof config) + ", " +
  46899. "expecting an object, function or boolean."
  46900. );
  46901. }
  46902. }
  46903. }
  46904. /* */
  46905. var encodeReserveRE = /[!'()*]/g;
  46906. var encodeReserveReplacer = function (c) { return '%' + c.charCodeAt(0).toString(16); };
  46907. var commaRE = /%2C/g;
  46908. // fixed encodeURIComponent which is more conformant to RFC3986:
  46909. // - escapes [!'()*]
  46910. // - preserve commas
  46911. var encode = function (str) { return encodeURIComponent(str)
  46912. .replace(encodeReserveRE, encodeReserveReplacer)
  46913. .replace(commaRE, ','); };
  46914. var decode = decodeURIComponent;
  46915. function resolveQuery (
  46916. query,
  46917. extraQuery,
  46918. _parseQuery
  46919. ) {
  46920. if ( extraQuery === void 0 ) extraQuery = {};
  46921. var parse = _parseQuery || parseQuery;
  46922. var parsedQuery;
  46923. try {
  46924. parsedQuery = parse(query || '');
  46925. } catch (e) {
  46926. true && warn(false, e.message);
  46927. parsedQuery = {};
  46928. }
  46929. for (var key in extraQuery) {
  46930. parsedQuery[key] = extraQuery[key];
  46931. }
  46932. return parsedQuery
  46933. }
  46934. function parseQuery (query) {
  46935. var res = {};
  46936. query = query.trim().replace(/^(\?|#|&)/, '');
  46937. if (!query) {
  46938. return res
  46939. }
  46940. query.split('&').forEach(function (param) {
  46941. var parts = param.replace(/\+/g, ' ').split('=');
  46942. var key = decode(parts.shift());
  46943. var val = parts.length > 0
  46944. ? decode(parts.join('='))
  46945. : null;
  46946. if (res[key] === undefined) {
  46947. res[key] = val;
  46948. } else if (Array.isArray(res[key])) {
  46949. res[key].push(val);
  46950. } else {
  46951. res[key] = [res[key], val];
  46952. }
  46953. });
  46954. return res
  46955. }
  46956. function stringifyQuery (obj) {
  46957. var res = obj ? Object.keys(obj).map(function (key) {
  46958. var val = obj[key];
  46959. if (val === undefined) {
  46960. return ''
  46961. }
  46962. if (val === null) {
  46963. return encode(key)
  46964. }
  46965. if (Array.isArray(val)) {
  46966. var result = [];
  46967. val.forEach(function (val2) {
  46968. if (val2 === undefined) {
  46969. return
  46970. }
  46971. if (val2 === null) {
  46972. result.push(encode(key));
  46973. } else {
  46974. result.push(encode(key) + '=' + encode(val2));
  46975. }
  46976. });
  46977. return result.join('&')
  46978. }
  46979. return encode(key) + '=' + encode(val)
  46980. }).filter(function (x) { return x.length > 0; }).join('&') : null;
  46981. return res ? ("?" + res) : ''
  46982. }
  46983. /* */
  46984. var trailingSlashRE = /\/?$/;
  46985. function createRoute (
  46986. record,
  46987. location,
  46988. redirectedFrom,
  46989. router
  46990. ) {
  46991. var stringifyQuery = router && router.options.stringifyQuery;
  46992. var query = location.query || {};
  46993. try {
  46994. query = clone(query);
  46995. } catch (e) {}
  46996. var route = {
  46997. name: location.name || (record && record.name),
  46998. meta: (record && record.meta) || {},
  46999. path: location.path || '/',
  47000. hash: location.hash || '',
  47001. query: query,
  47002. params: location.params || {},
  47003. fullPath: getFullPath(location, stringifyQuery),
  47004. matched: record ? formatMatch(record) : []
  47005. };
  47006. if (redirectedFrom) {
  47007. route.redirectedFrom = getFullPath(redirectedFrom, stringifyQuery);
  47008. }
  47009. return Object.freeze(route)
  47010. }
  47011. function clone (value) {
  47012. if (Array.isArray(value)) {
  47013. return value.map(clone)
  47014. } else if (value && typeof value === 'object') {
  47015. var res = {};
  47016. for (var key in value) {
  47017. res[key] = clone(value[key]);
  47018. }
  47019. return res
  47020. } else {
  47021. return value
  47022. }
  47023. }
  47024. // the starting route that represents the initial state
  47025. var START = createRoute(null, {
  47026. path: '/'
  47027. });
  47028. function formatMatch (record) {
  47029. var res = [];
  47030. while (record) {
  47031. res.unshift(record);
  47032. record = record.parent;
  47033. }
  47034. return res
  47035. }
  47036. function getFullPath (
  47037. ref,
  47038. _stringifyQuery
  47039. ) {
  47040. var path = ref.path;
  47041. var query = ref.query; if ( query === void 0 ) query = {};
  47042. var hash = ref.hash; if ( hash === void 0 ) hash = '';
  47043. var stringify = _stringifyQuery || stringifyQuery;
  47044. return (path || '/') + stringify(query) + hash
  47045. }
  47046. function isSameRoute (a, b) {
  47047. if (b === START) {
  47048. return a === b
  47049. } else if (!b) {
  47050. return false
  47051. } else if (a.path && b.path) {
  47052. return (
  47053. a.path.replace(trailingSlashRE, '') === b.path.replace(trailingSlashRE, '') &&
  47054. a.hash === b.hash &&
  47055. isObjectEqual(a.query, b.query)
  47056. )
  47057. } else if (a.name && b.name) {
  47058. return (
  47059. a.name === b.name &&
  47060. a.hash === b.hash &&
  47061. isObjectEqual(a.query, b.query) &&
  47062. isObjectEqual(a.params, b.params)
  47063. )
  47064. } else {
  47065. return false
  47066. }
  47067. }
  47068. function isObjectEqual (a, b) {
  47069. if ( a === void 0 ) a = {};
  47070. if ( b === void 0 ) b = {};
  47071. // handle null value #1566
  47072. if (!a || !b) { return a === b }
  47073. var aKeys = Object.keys(a);
  47074. var bKeys = Object.keys(b);
  47075. if (aKeys.length !== bKeys.length) {
  47076. return false
  47077. }
  47078. return aKeys.every(function (key) {
  47079. var aVal = a[key];
  47080. var bVal = b[key];
  47081. // check nested equality
  47082. if (typeof aVal === 'object' && typeof bVal === 'object') {
  47083. return isObjectEqual(aVal, bVal)
  47084. }
  47085. return String(aVal) === String(bVal)
  47086. })
  47087. }
  47088. function isIncludedRoute (current, target) {
  47089. return (
  47090. current.path.replace(trailingSlashRE, '/').indexOf(
  47091. target.path.replace(trailingSlashRE, '/')
  47092. ) === 0 &&
  47093. (!target.hash || current.hash === target.hash) &&
  47094. queryIncludes(current.query, target.query)
  47095. )
  47096. }
  47097. function queryIncludes (current, target) {
  47098. for (var key in target) {
  47099. if (!(key in current)) {
  47100. return false
  47101. }
  47102. }
  47103. return true
  47104. }
  47105. /* */
  47106. function resolvePath (
  47107. relative,
  47108. base,
  47109. append
  47110. ) {
  47111. var firstChar = relative.charAt(0);
  47112. if (firstChar === '/') {
  47113. return relative
  47114. }
  47115. if (firstChar === '?' || firstChar === '#') {
  47116. return base + relative
  47117. }
  47118. var stack = base.split('/');
  47119. // remove trailing segment if:
  47120. // - not appending
  47121. // - appending to trailing slash (last segment is empty)
  47122. if (!append || !stack[stack.length - 1]) {
  47123. stack.pop();
  47124. }
  47125. // resolve relative path
  47126. var segments = relative.replace(/^\//, '').split('/');
  47127. for (var i = 0; i < segments.length; i++) {
  47128. var segment = segments[i];
  47129. if (segment === '..') {
  47130. stack.pop();
  47131. } else if (segment !== '.') {
  47132. stack.push(segment);
  47133. }
  47134. }
  47135. // ensure leading slash
  47136. if (stack[0] !== '') {
  47137. stack.unshift('');
  47138. }
  47139. return stack.join('/')
  47140. }
  47141. function parsePath (path) {
  47142. var hash = '';
  47143. var query = '';
  47144. var hashIndex = path.indexOf('#');
  47145. if (hashIndex >= 0) {
  47146. hash = path.slice(hashIndex);
  47147. path = path.slice(0, hashIndex);
  47148. }
  47149. var queryIndex = path.indexOf('?');
  47150. if (queryIndex >= 0) {
  47151. query = path.slice(queryIndex + 1);
  47152. path = path.slice(0, queryIndex);
  47153. }
  47154. return {
  47155. path: path,
  47156. query: query,
  47157. hash: hash
  47158. }
  47159. }
  47160. function cleanPath (path) {
  47161. return path.replace(/\/\//g, '/')
  47162. }
  47163. var isarray = Array.isArray || function (arr) {
  47164. return Object.prototype.toString.call(arr) == '[object Array]';
  47165. };
  47166. /**
  47167. * Expose `pathToRegexp`.
  47168. */
  47169. var pathToRegexp_1 = pathToRegexp;
  47170. var parse_1 = parse;
  47171. var compile_1 = compile;
  47172. var tokensToFunction_1 = tokensToFunction;
  47173. var tokensToRegExp_1 = tokensToRegExp;
  47174. /**
  47175. * The main path matching regexp utility.
  47176. *
  47177. * @type {RegExp}
  47178. */
  47179. var PATH_REGEXP = new RegExp([
  47180. // Match escaped characters that would otherwise appear in future matches.
  47181. // This allows the user to escape special characters that won't transform.
  47182. '(\\\\.)',
  47183. // Match Express-style parameters and un-named parameters with a prefix
  47184. // and optional suffixes. Matches appear as:
  47185. //
  47186. // "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined]
  47187. // "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined]
  47188. // "/*" => ["/", undefined, undefined, undefined, undefined, "*"]
  47189. '([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))'
  47190. ].join('|'), 'g');
  47191. /**
  47192. * Parse a string for the raw tokens.
  47193. *
  47194. * @param {string} str
  47195. * @param {Object=} options
  47196. * @return {!Array}
  47197. */
  47198. function parse (str, options) {
  47199. var tokens = [];
  47200. var key = 0;
  47201. var index = 0;
  47202. var path = '';
  47203. var defaultDelimiter = options && options.delimiter || '/';
  47204. var res;
  47205. while ((res = PATH_REGEXP.exec(str)) != null) {
  47206. var m = res[0];
  47207. var escaped = res[1];
  47208. var offset = res.index;
  47209. path += str.slice(index, offset);
  47210. index = offset + m.length;
  47211. // Ignore already escaped sequences.
  47212. if (escaped) {
  47213. path += escaped[1];
  47214. continue
  47215. }
  47216. var next = str[index];
  47217. var prefix = res[2];
  47218. var name = res[3];
  47219. var capture = res[4];
  47220. var group = res[5];
  47221. var modifier = res[6];
  47222. var asterisk = res[7];
  47223. // Push the current path onto the tokens.
  47224. if (path) {
  47225. tokens.push(path);
  47226. path = '';
  47227. }
  47228. var partial = prefix != null && next != null && next !== prefix;
  47229. var repeat = modifier === '+' || modifier === '*';
  47230. var optional = modifier === '?' || modifier === '*';
  47231. var delimiter = res[2] || defaultDelimiter;
  47232. var pattern = capture || group;
  47233. tokens.push({
  47234. name: name || key++,
  47235. prefix: prefix || '',
  47236. delimiter: delimiter,
  47237. optional: optional,
  47238. repeat: repeat,
  47239. partial: partial,
  47240. asterisk: !!asterisk,
  47241. pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?')
  47242. });
  47243. }
  47244. // Match any characters still remaining.
  47245. if (index < str.length) {
  47246. path += str.substr(index);
  47247. }
  47248. // If the path exists, push it onto the end.
  47249. if (path) {
  47250. tokens.push(path);
  47251. }
  47252. return tokens
  47253. }
  47254. /**
  47255. * Compile a string to a template function for the path.
  47256. *
  47257. * @param {string} str
  47258. * @param {Object=} options
  47259. * @return {!function(Object=, Object=)}
  47260. */
  47261. function compile (str, options) {
  47262. return tokensToFunction(parse(str, options))
  47263. }
  47264. /**
  47265. * Prettier encoding of URI path segments.
  47266. *
  47267. * @param {string}
  47268. * @return {string}
  47269. */
  47270. function encodeURIComponentPretty (str) {
  47271. return encodeURI(str).replace(/[\/?#]/g, function (c) {
  47272. return '%' + c.charCodeAt(0).toString(16).toUpperCase()
  47273. })
  47274. }
  47275. /**
  47276. * Encode the asterisk parameter. Similar to `pretty`, but allows slashes.
  47277. *
  47278. * @param {string}
  47279. * @return {string}
  47280. */
  47281. function encodeAsterisk (str) {
  47282. return encodeURI(str).replace(/[?#]/g, function (c) {
  47283. return '%' + c.charCodeAt(0).toString(16).toUpperCase()
  47284. })
  47285. }
  47286. /**
  47287. * Expose a method for transforming tokens into the path function.
  47288. */
  47289. function tokensToFunction (tokens) {
  47290. // Compile all the tokens into regexps.
  47291. var matches = new Array(tokens.length);
  47292. // Compile all the patterns before compilation.
  47293. for (var i = 0; i < tokens.length; i++) {
  47294. if (typeof tokens[i] === 'object') {
  47295. matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$');
  47296. }
  47297. }
  47298. return function (obj, opts) {
  47299. var path = '';
  47300. var data = obj || {};
  47301. var options = opts || {};
  47302. var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent;
  47303. for (var i = 0; i < tokens.length; i++) {
  47304. var token = tokens[i];
  47305. if (typeof token === 'string') {
  47306. path += token;
  47307. continue
  47308. }
  47309. var value = data[token.name];
  47310. var segment;
  47311. if (value == null) {
  47312. if (token.optional) {
  47313. // Prepend partial segment prefixes.
  47314. if (token.partial) {
  47315. path += token.prefix;
  47316. }
  47317. continue
  47318. } else {
  47319. throw new TypeError('Expected "' + token.name + '" to be defined')
  47320. }
  47321. }
  47322. if (isarray(value)) {
  47323. if (!token.repeat) {
  47324. throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`')
  47325. }
  47326. if (value.length === 0) {
  47327. if (token.optional) {
  47328. continue
  47329. } else {
  47330. throw new TypeError('Expected "' + token.name + '" to not be empty')
  47331. }
  47332. }
  47333. for (var j = 0; j < value.length; j++) {
  47334. segment = encode(value[j]);
  47335. if (!matches[i].test(segment)) {
  47336. throw new TypeError('Expected all "' + token.name + '" to match "' + token.pattern + '", but received `' + JSON.stringify(segment) + '`')
  47337. }
  47338. path += (j === 0 ? token.prefix : token.delimiter) + segment;
  47339. }
  47340. continue
  47341. }
  47342. segment = token.asterisk ? encodeAsterisk(value) : encode(value);
  47343. if (!matches[i].test(segment)) {
  47344. throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"')
  47345. }
  47346. path += token.prefix + segment;
  47347. }
  47348. return path
  47349. }
  47350. }
  47351. /**
  47352. * Escape a regular expression string.
  47353. *
  47354. * @param {string} str
  47355. * @return {string}
  47356. */
  47357. function escapeString (str) {
  47358. return str.replace(/([.+*?=^!:${}()[\]|\/\\])/g, '\\$1')
  47359. }
  47360. /**
  47361. * Escape the capturing group by escaping special characters and meaning.
  47362. *
  47363. * @param {string} group
  47364. * @return {string}
  47365. */
  47366. function escapeGroup (group) {
  47367. return group.replace(/([=!:$\/()])/g, '\\$1')
  47368. }
  47369. /**
  47370. * Attach the keys as a property of the regexp.
  47371. *
  47372. * @param {!RegExp} re
  47373. * @param {Array} keys
  47374. * @return {!RegExp}
  47375. */
  47376. function attachKeys (re, keys) {
  47377. re.keys = keys;
  47378. return re
  47379. }
  47380. /**
  47381. * Get the flags for a regexp from the options.
  47382. *
  47383. * @param {Object} options
  47384. * @return {string}
  47385. */
  47386. function flags (options) {
  47387. return options.sensitive ? '' : 'i'
  47388. }
  47389. /**
  47390. * Pull out keys from a regexp.
  47391. *
  47392. * @param {!RegExp} path
  47393. * @param {!Array} keys
  47394. * @return {!RegExp}
  47395. */
  47396. function regexpToRegexp (path, keys) {
  47397. // Use a negative lookahead to match only capturing groups.
  47398. var groups = path.source.match(/\((?!\?)/g);
  47399. if (groups) {
  47400. for (var i = 0; i < groups.length; i++) {
  47401. keys.push({
  47402. name: i,
  47403. prefix: null,
  47404. delimiter: null,
  47405. optional: false,
  47406. repeat: false,
  47407. partial: false,
  47408. asterisk: false,
  47409. pattern: null
  47410. });
  47411. }
  47412. }
  47413. return attachKeys(path, keys)
  47414. }
  47415. /**
  47416. * Transform an array into a regexp.
  47417. *
  47418. * @param {!Array} path
  47419. * @param {Array} keys
  47420. * @param {!Object} options
  47421. * @return {!RegExp}
  47422. */
  47423. function arrayToRegexp (path, keys, options) {
  47424. var parts = [];
  47425. for (var i = 0; i < path.length; i++) {
  47426. parts.push(pathToRegexp(path[i], keys, options).source);
  47427. }
  47428. var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options));
  47429. return attachKeys(regexp, keys)
  47430. }
  47431. /**
  47432. * Create a path regexp from string input.
  47433. *
  47434. * @param {string} path
  47435. * @param {!Array} keys
  47436. * @param {!Object} options
  47437. * @return {!RegExp}
  47438. */
  47439. function stringToRegexp (path, keys, options) {
  47440. return tokensToRegExp(parse(path, options), keys, options)
  47441. }
  47442. /**
  47443. * Expose a function for taking tokens and returning a RegExp.
  47444. *
  47445. * @param {!Array} tokens
  47446. * @param {(Array|Object)=} keys
  47447. * @param {Object=} options
  47448. * @return {!RegExp}
  47449. */
  47450. function tokensToRegExp (tokens, keys, options) {
  47451. if (!isarray(keys)) {
  47452. options = /** @type {!Object} */ (keys || options);
  47453. keys = [];
  47454. }
  47455. options = options || {};
  47456. var strict = options.strict;
  47457. var end = options.end !== false;
  47458. var route = '';
  47459. // Iterate over the tokens and create our regexp string.
  47460. for (var i = 0; i < tokens.length; i++) {
  47461. var token = tokens[i];
  47462. if (typeof token === 'string') {
  47463. route += escapeString(token);
  47464. } else {
  47465. var prefix = escapeString(token.prefix);
  47466. var capture = '(?:' + token.pattern + ')';
  47467. keys.push(token);
  47468. if (token.repeat) {
  47469. capture += '(?:' + prefix + capture + ')*';
  47470. }
  47471. if (token.optional) {
  47472. if (!token.partial) {
  47473. capture = '(?:' + prefix + '(' + capture + '))?';
  47474. } else {
  47475. capture = prefix + '(' + capture + ')?';
  47476. }
  47477. } else {
  47478. capture = prefix + '(' + capture + ')';
  47479. }
  47480. route += capture;
  47481. }
  47482. }
  47483. var delimiter = escapeString(options.delimiter || '/');
  47484. var endsWithDelimiter = route.slice(-delimiter.length) === delimiter;
  47485. // In non-strict mode we allow a slash at the end of match. If the path to
  47486. // match already ends with a slash, we remove it for consistency. The slash
  47487. // is valid at the end of a path match, not in the middle. This is important
  47488. // in non-ending mode, where "/test/" shouldn't match "/test//route".
  47489. if (!strict) {
  47490. route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?';
  47491. }
  47492. if (end) {
  47493. route += '$';
  47494. } else {
  47495. // In non-ending mode, we need the capturing groups to match as much as
  47496. // possible by using a positive lookahead to the end or next path segment.
  47497. route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)';
  47498. }
  47499. return attachKeys(new RegExp('^' + route, flags(options)), keys)
  47500. }
  47501. /**
  47502. * Normalize the given path string, returning a regular expression.
  47503. *
  47504. * An empty array can be passed in for the keys, which will hold the
  47505. * placeholder key descriptions. For example, using `/user/:id`, `keys` will
  47506. * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.
  47507. *
  47508. * @param {(string|RegExp|Array)} path
  47509. * @param {(Array|Object)=} keys
  47510. * @param {Object=} options
  47511. * @return {!RegExp}
  47512. */
  47513. function pathToRegexp (path, keys, options) {
  47514. if (!isarray(keys)) {
  47515. options = /** @type {!Object} */ (keys || options);
  47516. keys = [];
  47517. }
  47518. options = options || {};
  47519. if (path instanceof RegExp) {
  47520. return regexpToRegexp(path, /** @type {!Array} */ (keys))
  47521. }
  47522. if (isarray(path)) {
  47523. return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options)
  47524. }
  47525. return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options)
  47526. }
  47527. pathToRegexp_1.parse = parse_1;
  47528. pathToRegexp_1.compile = compile_1;
  47529. pathToRegexp_1.tokensToFunction = tokensToFunction_1;
  47530. pathToRegexp_1.tokensToRegExp = tokensToRegExp_1;
  47531. /* */
  47532. // $flow-disable-line
  47533. var regexpCompileCache = Object.create(null);
  47534. function fillParams (
  47535. path,
  47536. params,
  47537. routeMsg
  47538. ) {
  47539. params = params || {};
  47540. try {
  47541. var filler =
  47542. regexpCompileCache[path] ||
  47543. (regexpCompileCache[path] = pathToRegexp_1.compile(path));
  47544. // Fix #2505 resolving asterisk routes { name: 'not-found', params: { pathMatch: '/not-found' }}
  47545. // and fix #3106 so that you can work with location descriptor object having params.pathMatch equal to empty string
  47546. if (typeof params.pathMatch === 'string') { params[0] = params.pathMatch; }
  47547. return filler(params, { pretty: true })
  47548. } catch (e) {
  47549. if (true) {
  47550. // Fix #3072 no warn if `pathMatch` is string
  47551. warn(typeof params.pathMatch === 'string', ("missing param for " + routeMsg + ": " + (e.message)));
  47552. }
  47553. return ''
  47554. } finally {
  47555. // delete the 0 if it was added
  47556. delete params[0];
  47557. }
  47558. }
  47559. /* */
  47560. function normalizeLocation (
  47561. raw,
  47562. current,
  47563. append,
  47564. router
  47565. ) {
  47566. var next = typeof raw === 'string' ? { path: raw } : raw;
  47567. // named target
  47568. if (next._normalized) {
  47569. return next
  47570. } else if (next.name) {
  47571. next = extend({}, raw);
  47572. var params = next.params;
  47573. if (params && typeof params === 'object') {
  47574. next.params = extend({}, params);
  47575. }
  47576. return next
  47577. }
  47578. // relative params
  47579. if (!next.path && next.params && current) {
  47580. next = extend({}, next);
  47581. next._normalized = true;
  47582. var params$1 = extend(extend({}, current.params), next.params);
  47583. if (current.name) {
  47584. next.name = current.name;
  47585. next.params = params$1;
  47586. } else if (current.matched.length) {
  47587. var rawPath = current.matched[current.matched.length - 1].path;
  47588. next.path = fillParams(rawPath, params$1, ("path " + (current.path)));
  47589. } else if (true) {
  47590. warn(false, "relative params navigation requires a current route.");
  47591. }
  47592. return next
  47593. }
  47594. var parsedPath = parsePath(next.path || '');
  47595. var basePath = (current && current.path) || '/';
  47596. var path = parsedPath.path
  47597. ? resolvePath(parsedPath.path, basePath, append || next.append)
  47598. : basePath;
  47599. var query = resolveQuery(
  47600. parsedPath.query,
  47601. next.query,
  47602. router && router.options.parseQuery
  47603. );
  47604. var hash = next.hash || parsedPath.hash;
  47605. if (hash && hash.charAt(0) !== '#') {
  47606. hash = "#" + hash;
  47607. }
  47608. return {
  47609. _normalized: true,
  47610. path: path,
  47611. query: query,
  47612. hash: hash
  47613. }
  47614. }
  47615. /* */
  47616. // work around weird flow bug
  47617. var toTypes = [String, Object];
  47618. var eventTypes = [String, Array];
  47619. var noop = function () {};
  47620. var Link = {
  47621. name: 'RouterLink',
  47622. props: {
  47623. to: {
  47624. type: toTypes,
  47625. required: true
  47626. },
  47627. tag: {
  47628. type: String,
  47629. default: 'a'
  47630. },
  47631. exact: Boolean,
  47632. append: Boolean,
  47633. replace: Boolean,
  47634. activeClass: String,
  47635. exactActiveClass: String,
  47636. event: {
  47637. type: eventTypes,
  47638. default: 'click'
  47639. }
  47640. },
  47641. render: function render (h) {
  47642. var this$1 = this;
  47643. var router = this.$router;
  47644. var current = this.$route;
  47645. var ref = router.resolve(
  47646. this.to,
  47647. current,
  47648. this.append
  47649. );
  47650. var location = ref.location;
  47651. var route = ref.route;
  47652. var href = ref.href;
  47653. var classes = {};
  47654. var globalActiveClass = router.options.linkActiveClass;
  47655. var globalExactActiveClass = router.options.linkExactActiveClass;
  47656. // Support global empty active class
  47657. var activeClassFallback =
  47658. globalActiveClass == null ? 'router-link-active' : globalActiveClass;
  47659. var exactActiveClassFallback =
  47660. globalExactActiveClass == null
  47661. ? 'router-link-exact-active'
  47662. : globalExactActiveClass;
  47663. var activeClass =
  47664. this.activeClass == null ? activeClassFallback : this.activeClass;
  47665. var exactActiveClass =
  47666. this.exactActiveClass == null
  47667. ? exactActiveClassFallback
  47668. : this.exactActiveClass;
  47669. var compareTarget = route.redirectedFrom
  47670. ? createRoute(null, normalizeLocation(route.redirectedFrom), null, router)
  47671. : route;
  47672. classes[exactActiveClass] = isSameRoute(current, compareTarget);
  47673. classes[activeClass] = this.exact
  47674. ? classes[exactActiveClass]
  47675. : isIncludedRoute(current, compareTarget);
  47676. var handler = function (e) {
  47677. if (guardEvent(e)) {
  47678. if (this$1.replace) {
  47679. router.replace(location, noop);
  47680. } else {
  47681. router.push(location, noop);
  47682. }
  47683. }
  47684. };
  47685. var on = { click: guardEvent };
  47686. if (Array.isArray(this.event)) {
  47687. this.event.forEach(function (e) {
  47688. on[e] = handler;
  47689. });
  47690. } else {
  47691. on[this.event] = handler;
  47692. }
  47693. var data = { class: classes };
  47694. var scopedSlot =
  47695. !this.$scopedSlots.$hasNormal &&
  47696. this.$scopedSlots.default &&
  47697. this.$scopedSlots.default({
  47698. href: href,
  47699. route: route,
  47700. navigate: handler,
  47701. isActive: classes[activeClass],
  47702. isExactActive: classes[exactActiveClass]
  47703. });
  47704. if (scopedSlot) {
  47705. if (scopedSlot.length === 1) {
  47706. return scopedSlot[0]
  47707. } else if (scopedSlot.length > 1 || !scopedSlot.length) {
  47708. if (true) {
  47709. warn(
  47710. false,
  47711. ("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.")
  47712. );
  47713. }
  47714. return scopedSlot.length === 0 ? h() : h('span', {}, scopedSlot)
  47715. }
  47716. }
  47717. if (this.tag === 'a') {
  47718. data.on = on;
  47719. data.attrs = { href: href };
  47720. } else {
  47721. // find the first <a> child and apply listener and href
  47722. var a = findAnchor(this.$slots.default);
  47723. if (a) {
  47724. // in case the <a> is a static node
  47725. a.isStatic = false;
  47726. var aData = (a.data = extend({}, a.data));
  47727. aData.on = aData.on || {};
  47728. // transform existing events in both objects into arrays so we can push later
  47729. for (var event in aData.on) {
  47730. var handler$1 = aData.on[event];
  47731. if (event in on) {
  47732. aData.on[event] = Array.isArray(handler$1) ? handler$1 : [handler$1];
  47733. }
  47734. }
  47735. // append new listeners for router-link
  47736. for (var event$1 in on) {
  47737. if (event$1 in aData.on) {
  47738. // on[event] is always a function
  47739. aData.on[event$1].push(on[event$1]);
  47740. } else {
  47741. aData.on[event$1] = handler;
  47742. }
  47743. }
  47744. var aAttrs = (a.data.attrs = extend({}, a.data.attrs));
  47745. aAttrs.href = href;
  47746. } else {
  47747. // doesn't have <a> child, apply listener to self
  47748. data.on = on;
  47749. }
  47750. }
  47751. return h(this.tag, data, this.$slots.default)
  47752. }
  47753. };
  47754. function guardEvent (e) {
  47755. // don't redirect with control keys
  47756. if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) { return }
  47757. // don't redirect when preventDefault called
  47758. if (e.defaultPrevented) { return }
  47759. // don't redirect on right click
  47760. if (e.button !== undefined && e.button !== 0) { return }
  47761. // don't redirect if `target="_blank"`
  47762. if (e.currentTarget && e.currentTarget.getAttribute) {
  47763. var target = e.currentTarget.getAttribute('target');
  47764. if (/\b_blank\b/i.test(target)) { return }
  47765. }
  47766. // this may be a Weex event which doesn't have this method
  47767. if (e.preventDefault) {
  47768. e.preventDefault();
  47769. }
  47770. return true
  47771. }
  47772. function findAnchor (children) {
  47773. if (children) {
  47774. var child;
  47775. for (var i = 0; i < children.length; i++) {
  47776. child = children[i];
  47777. if (child.tag === 'a') {
  47778. return child
  47779. }
  47780. if (child.children && (child = findAnchor(child.children))) {
  47781. return child
  47782. }
  47783. }
  47784. }
  47785. }
  47786. var _Vue;
  47787. function install (Vue) {
  47788. if (install.installed && _Vue === Vue) { return }
  47789. install.installed = true;
  47790. _Vue = Vue;
  47791. var isDef = function (v) { return v !== undefined; };
  47792. var registerInstance = function (vm, callVal) {
  47793. var i = vm.$options._parentVnode;
  47794. if (isDef(i) && isDef(i = i.data) && isDef(i = i.registerRouteInstance)) {
  47795. i(vm, callVal);
  47796. }
  47797. };
  47798. Vue.mixin({
  47799. beforeCreate: function beforeCreate () {
  47800. if (isDef(this.$options.router)) {
  47801. this._routerRoot = this;
  47802. this._router = this.$options.router;
  47803. this._router.init(this);
  47804. Vue.util.defineReactive(this, '_route', this._router.history.current);
  47805. } else {
  47806. this._routerRoot = (this.$parent && this.$parent._routerRoot) || this;
  47807. }
  47808. registerInstance(this, this);
  47809. },
  47810. destroyed: function destroyed () {
  47811. registerInstance(this);
  47812. }
  47813. });
  47814. Object.defineProperty(Vue.prototype, '$router', {
  47815. get: function get () { return this._routerRoot._router }
  47816. });
  47817. Object.defineProperty(Vue.prototype, '$route', {
  47818. get: function get () { return this._routerRoot._route }
  47819. });
  47820. Vue.component('RouterView', View);
  47821. Vue.component('RouterLink', Link);
  47822. var strats = Vue.config.optionMergeStrategies;
  47823. // use the same hook merging strategy for route hooks
  47824. strats.beforeRouteEnter = strats.beforeRouteLeave = strats.beforeRouteUpdate = strats.created;
  47825. }
  47826. /* */
  47827. var inBrowser = typeof window !== 'undefined';
  47828. /* */
  47829. function createRouteMap (
  47830. routes,
  47831. oldPathList,
  47832. oldPathMap,
  47833. oldNameMap
  47834. ) {
  47835. // the path list is used to control path matching priority
  47836. var pathList = oldPathList || [];
  47837. // $flow-disable-line
  47838. var pathMap = oldPathMap || Object.create(null);
  47839. // $flow-disable-line
  47840. var nameMap = oldNameMap || Object.create(null);
  47841. routes.forEach(function (route) {
  47842. addRouteRecord(pathList, pathMap, nameMap, route);
  47843. });
  47844. // ensure wildcard routes are always at the end
  47845. for (var i = 0, l = pathList.length; i < l; i++) {
  47846. if (pathList[i] === '*') {
  47847. pathList.push(pathList.splice(i, 1)[0]);
  47848. l--;
  47849. i--;
  47850. }
  47851. }
  47852. if (true) {
  47853. // warn if routes do not include leading slashes
  47854. var found = pathList
  47855. // check for missing leading slash
  47856. .filter(function (path) { return path && path.charAt(0) !== '*' && path.charAt(0) !== '/'; });
  47857. if (found.length > 0) {
  47858. var pathNames = found.map(function (path) { return ("- " + path); }).join('\n');
  47859. warn(false, ("Non-nested routes must include a leading slash character. Fix the following routes: \n" + pathNames));
  47860. }
  47861. }
  47862. return {
  47863. pathList: pathList,
  47864. pathMap: pathMap,
  47865. nameMap: nameMap
  47866. }
  47867. }
  47868. function addRouteRecord (
  47869. pathList,
  47870. pathMap,
  47871. nameMap,
  47872. route,
  47873. parent,
  47874. matchAs
  47875. ) {
  47876. var path = route.path;
  47877. var name = route.name;
  47878. if (true) {
  47879. assert(path != null, "\"path\" is required in a route configuration.");
  47880. assert(
  47881. typeof route.component !== 'string',
  47882. "route config \"component\" for path: " + (String(
  47883. path || name
  47884. )) + " cannot be a " + "string id. Use an actual component instead."
  47885. );
  47886. }
  47887. var pathToRegexpOptions =
  47888. route.pathToRegexpOptions || {};
  47889. var normalizedPath = normalizePath(path, parent, pathToRegexpOptions.strict);
  47890. if (typeof route.caseSensitive === 'boolean') {
  47891. pathToRegexpOptions.sensitive = route.caseSensitive;
  47892. }
  47893. var record = {
  47894. path: normalizedPath,
  47895. regex: compileRouteRegex(normalizedPath, pathToRegexpOptions),
  47896. components: route.components || { default: route.component },
  47897. instances: {},
  47898. name: name,
  47899. parent: parent,
  47900. matchAs: matchAs,
  47901. redirect: route.redirect,
  47902. beforeEnter: route.beforeEnter,
  47903. meta: route.meta || {},
  47904. props:
  47905. route.props == null
  47906. ? {}
  47907. : route.components
  47908. ? route.props
  47909. : { default: route.props }
  47910. };
  47911. if (route.children) {
  47912. // Warn if route is named, does not redirect and has a default child route.
  47913. // If users navigate to this route by name, the default child will
  47914. // not be rendered (GH Issue #629)
  47915. if (true) {
  47916. if (
  47917. route.name &&
  47918. !route.redirect &&
  47919. route.children.some(function (child) { return /^\/?$/.test(child.path); })
  47920. ) {
  47921. warn(
  47922. false,
  47923. "Named Route '" + (route.name) + "' has a default child route. " +
  47924. "When navigating to this named route (:to=\"{name: '" + (route.name) + "'\"), " +
  47925. "the default child route will not be rendered. Remove the name from " +
  47926. "this route and use the name of the default child route for named " +
  47927. "links instead."
  47928. );
  47929. }
  47930. }
  47931. route.children.forEach(function (child) {
  47932. var childMatchAs = matchAs
  47933. ? cleanPath((matchAs + "/" + (child.path)))
  47934. : undefined;
  47935. addRouteRecord(pathList, pathMap, nameMap, child, record, childMatchAs);
  47936. });
  47937. }
  47938. if (!pathMap[record.path]) {
  47939. pathList.push(record.path);
  47940. pathMap[record.path] = record;
  47941. }
  47942. if (route.alias !== undefined) {
  47943. var aliases = Array.isArray(route.alias) ? route.alias : [route.alias];
  47944. for (var i = 0; i < aliases.length; ++i) {
  47945. var alias = aliases[i];
  47946. if ( true && alias === path) {
  47947. warn(
  47948. false,
  47949. ("Found an alias with the same value as the path: \"" + path + "\". You have to remove that alias. It will be ignored in development.")
  47950. );
  47951. // skip in dev to make it work
  47952. continue
  47953. }
  47954. var aliasRoute = {
  47955. path: alias,
  47956. children: route.children
  47957. };
  47958. addRouteRecord(
  47959. pathList,
  47960. pathMap,
  47961. nameMap,
  47962. aliasRoute,
  47963. parent,
  47964. record.path || '/' // matchAs
  47965. );
  47966. }
  47967. }
  47968. if (name) {
  47969. if (!nameMap[name]) {
  47970. nameMap[name] = record;
  47971. } else if ( true && !matchAs) {
  47972. warn(
  47973. false,
  47974. "Duplicate named routes definition: " +
  47975. "{ name: \"" + name + "\", path: \"" + (record.path) + "\" }"
  47976. );
  47977. }
  47978. }
  47979. }
  47980. function compileRouteRegex (
  47981. path,
  47982. pathToRegexpOptions
  47983. ) {
  47984. var regex = pathToRegexp_1(path, [], pathToRegexpOptions);
  47985. if (true) {
  47986. var keys = Object.create(null);
  47987. regex.keys.forEach(function (key) {
  47988. warn(
  47989. !keys[key.name],
  47990. ("Duplicate param keys in route with path: \"" + path + "\"")
  47991. );
  47992. keys[key.name] = true;
  47993. });
  47994. }
  47995. return regex
  47996. }
  47997. function normalizePath (
  47998. path,
  47999. parent,
  48000. strict
  48001. ) {
  48002. if (!strict) { path = path.replace(/\/$/, ''); }
  48003. if (path[0] === '/') { return path }
  48004. if (parent == null) { return path }
  48005. return cleanPath(((parent.path) + "/" + path))
  48006. }
  48007. /* */
  48008. function createMatcher (
  48009. routes,
  48010. router
  48011. ) {
  48012. var ref = createRouteMap(routes);
  48013. var pathList = ref.pathList;
  48014. var pathMap = ref.pathMap;
  48015. var nameMap = ref.nameMap;
  48016. function addRoutes (routes) {
  48017. createRouteMap(routes, pathList, pathMap, nameMap);
  48018. }
  48019. function match (
  48020. raw,
  48021. currentRoute,
  48022. redirectedFrom
  48023. ) {
  48024. var location = normalizeLocation(raw, currentRoute, false, router);
  48025. var name = location.name;
  48026. if (name) {
  48027. var record = nameMap[name];
  48028. if (true) {
  48029. warn(record, ("Route with name '" + name + "' does not exist"));
  48030. }
  48031. if (!record) { return _createRoute(null, location) }
  48032. var paramNames = record.regex.keys
  48033. .filter(function (key) { return !key.optional; })
  48034. .map(function (key) { return key.name; });
  48035. if (typeof location.params !== 'object') {
  48036. location.params = {};
  48037. }
  48038. if (currentRoute && typeof currentRoute.params === 'object') {
  48039. for (var key in currentRoute.params) {
  48040. if (!(key in location.params) && paramNames.indexOf(key) > -1) {
  48041. location.params[key] = currentRoute.params[key];
  48042. }
  48043. }
  48044. }
  48045. location.path = fillParams(record.path, location.params, ("named route \"" + name + "\""));
  48046. return _createRoute(record, location, redirectedFrom)
  48047. } else if (location.path) {
  48048. location.params = {};
  48049. for (var i = 0; i < pathList.length; i++) {
  48050. var path = pathList[i];
  48051. var record$1 = pathMap[path];
  48052. if (matchRoute(record$1.regex, location.path, location.params)) {
  48053. return _createRoute(record$1, location, redirectedFrom)
  48054. }
  48055. }
  48056. }
  48057. // no match
  48058. return _createRoute(null, location)
  48059. }
  48060. function redirect (
  48061. record,
  48062. location
  48063. ) {
  48064. var originalRedirect = record.redirect;
  48065. var redirect = typeof originalRedirect === 'function'
  48066. ? originalRedirect(createRoute(record, location, null, router))
  48067. : originalRedirect;
  48068. if (typeof redirect === 'string') {
  48069. redirect = { path: redirect };
  48070. }
  48071. if (!redirect || typeof redirect !== 'object') {
  48072. if (true) {
  48073. warn(
  48074. false, ("invalid redirect option: " + (JSON.stringify(redirect)))
  48075. );
  48076. }
  48077. return _createRoute(null, location)
  48078. }
  48079. var re = redirect;
  48080. var name = re.name;
  48081. var path = re.path;
  48082. var query = location.query;
  48083. var hash = location.hash;
  48084. var params = location.params;
  48085. query = re.hasOwnProperty('query') ? re.query : query;
  48086. hash = re.hasOwnProperty('hash') ? re.hash : hash;
  48087. params = re.hasOwnProperty('params') ? re.params : params;
  48088. if (name) {
  48089. // resolved named direct
  48090. var targetRecord = nameMap[name];
  48091. if (true) {
  48092. assert(targetRecord, ("redirect failed: named route \"" + name + "\" not found."));
  48093. }
  48094. return match({
  48095. _normalized: true,
  48096. name: name,
  48097. query: query,
  48098. hash: hash,
  48099. params: params
  48100. }, undefined, location)
  48101. } else if (path) {
  48102. // 1. resolve relative redirect
  48103. var rawPath = resolveRecordPath(path, record);
  48104. // 2. resolve params
  48105. var resolvedPath = fillParams(rawPath, params, ("redirect route with path \"" + rawPath + "\""));
  48106. // 3. rematch with existing query and hash
  48107. return match({
  48108. _normalized: true,
  48109. path: resolvedPath,
  48110. query: query,
  48111. hash: hash
  48112. }, undefined, location)
  48113. } else {
  48114. if (true) {
  48115. warn(false, ("invalid redirect option: " + (JSON.stringify(redirect))));
  48116. }
  48117. return _createRoute(null, location)
  48118. }
  48119. }
  48120. function alias (
  48121. record,
  48122. location,
  48123. matchAs
  48124. ) {
  48125. var aliasedPath = fillParams(matchAs, location.params, ("aliased route with path \"" + matchAs + "\""));
  48126. var aliasedMatch = match({
  48127. _normalized: true,
  48128. path: aliasedPath
  48129. });
  48130. if (aliasedMatch) {
  48131. var matched = aliasedMatch.matched;
  48132. var aliasedRecord = matched[matched.length - 1];
  48133. location.params = aliasedMatch.params;
  48134. return _createRoute(aliasedRecord, location)
  48135. }
  48136. return _createRoute(null, location)
  48137. }
  48138. function _createRoute (
  48139. record,
  48140. location,
  48141. redirectedFrom
  48142. ) {
  48143. if (record && record.redirect) {
  48144. return redirect(record, redirectedFrom || location)
  48145. }
  48146. if (record && record.matchAs) {
  48147. return alias(record, location, record.matchAs)
  48148. }
  48149. return createRoute(record, location, redirectedFrom, router)
  48150. }
  48151. return {
  48152. match: match,
  48153. addRoutes: addRoutes
  48154. }
  48155. }
  48156. function matchRoute (
  48157. regex,
  48158. path,
  48159. params
  48160. ) {
  48161. var m = path.match(regex);
  48162. if (!m) {
  48163. return false
  48164. } else if (!params) {
  48165. return true
  48166. }
  48167. for (var i = 1, len = m.length; i < len; ++i) {
  48168. var key = regex.keys[i - 1];
  48169. var val = typeof m[i] === 'string' ? decodeURIComponent(m[i]) : m[i];
  48170. if (key) {
  48171. // Fix #1994: using * with props: true generates a param named 0
  48172. params[key.name || 'pathMatch'] = val;
  48173. }
  48174. }
  48175. return true
  48176. }
  48177. function resolveRecordPath (path, record) {
  48178. return resolvePath(path, record.parent ? record.parent.path : '/', true)
  48179. }
  48180. /* */
  48181. // use User Timing api (if present) for more accurate key precision
  48182. var Time =
  48183. inBrowser && window.performance && window.performance.now
  48184. ? window.performance
  48185. : Date;
  48186. function genStateKey () {
  48187. return Time.now().toFixed(3)
  48188. }
  48189. var _key = genStateKey();
  48190. function getStateKey () {
  48191. return _key
  48192. }
  48193. function setStateKey (key) {
  48194. return (_key = key)
  48195. }
  48196. /* */
  48197. var positionStore = Object.create(null);
  48198. function setupScroll () {
  48199. // Fix for #1585 for Firefox
  48200. // Fix for #2195 Add optional third attribute to workaround a bug in safari https://bugs.webkit.org/show_bug.cgi?id=182678
  48201. // Fix for #2774 Support for apps loaded from Windows file shares not mapped to network drives: replaced location.origin with
  48202. // window.location.protocol + '//' + window.location.host
  48203. // location.host contains the port and location.hostname doesn't
  48204. var protocolAndPath = window.location.protocol + '//' + window.location.host;
  48205. var absolutePath = window.location.href.replace(protocolAndPath, '');
  48206. // preserve existing history state as it could be overriden by the user
  48207. var stateCopy = extend({}, window.history.state);
  48208. stateCopy.key = getStateKey();
  48209. window.history.replaceState(stateCopy, '', absolutePath);
  48210. window.addEventListener('popstate', function (e) {
  48211. saveScrollPosition();
  48212. if (e.state && e.state.key) {
  48213. setStateKey(e.state.key);
  48214. }
  48215. });
  48216. }
  48217. function handleScroll (
  48218. router,
  48219. to,
  48220. from,
  48221. isPop
  48222. ) {
  48223. if (!router.app) {
  48224. return
  48225. }
  48226. var behavior = router.options.scrollBehavior;
  48227. if (!behavior) {
  48228. return
  48229. }
  48230. if (true) {
  48231. assert(typeof behavior === 'function', "scrollBehavior must be a function");
  48232. }
  48233. // wait until re-render finishes before scrolling
  48234. router.app.$nextTick(function () {
  48235. var position = getScrollPosition();
  48236. var shouldScroll = behavior.call(
  48237. router,
  48238. to,
  48239. from,
  48240. isPop ? position : null
  48241. );
  48242. if (!shouldScroll) {
  48243. return
  48244. }
  48245. if (typeof shouldScroll.then === 'function') {
  48246. shouldScroll
  48247. .then(function (shouldScroll) {
  48248. scrollToPosition((shouldScroll), position);
  48249. })
  48250. .catch(function (err) {
  48251. if (true) {
  48252. assert(false, err.toString());
  48253. }
  48254. });
  48255. } else {
  48256. scrollToPosition(shouldScroll, position);
  48257. }
  48258. });
  48259. }
  48260. function saveScrollPosition () {
  48261. var key = getStateKey();
  48262. if (key) {
  48263. positionStore[key] = {
  48264. x: window.pageXOffset,
  48265. y: window.pageYOffset
  48266. };
  48267. }
  48268. }
  48269. function getScrollPosition () {
  48270. var key = getStateKey();
  48271. if (key) {
  48272. return positionStore[key]
  48273. }
  48274. }
  48275. function getElementPosition (el, offset) {
  48276. var docEl = document.documentElement;
  48277. var docRect = docEl.getBoundingClientRect();
  48278. var elRect = el.getBoundingClientRect();
  48279. return {
  48280. x: elRect.left - docRect.left - offset.x,
  48281. y: elRect.top - docRect.top - offset.y
  48282. }
  48283. }
  48284. function isValidPosition (obj) {
  48285. return isNumber(obj.x) || isNumber(obj.y)
  48286. }
  48287. function normalizePosition (obj) {
  48288. return {
  48289. x: isNumber(obj.x) ? obj.x : window.pageXOffset,
  48290. y: isNumber(obj.y) ? obj.y : window.pageYOffset
  48291. }
  48292. }
  48293. function normalizeOffset (obj) {
  48294. return {
  48295. x: isNumber(obj.x) ? obj.x : 0,
  48296. y: isNumber(obj.y) ? obj.y : 0
  48297. }
  48298. }
  48299. function isNumber (v) {
  48300. return typeof v === 'number'
  48301. }
  48302. var hashStartsWithNumberRE = /^#\d/;
  48303. function scrollToPosition (shouldScroll, position) {
  48304. var isObject = typeof shouldScroll === 'object';
  48305. if (isObject && typeof shouldScroll.selector === 'string') {
  48306. // getElementById would still fail if the selector contains a more complicated query like #main[data-attr]
  48307. // but at the same time, it doesn't make much sense to select an element with an id and an extra selector
  48308. var el = hashStartsWithNumberRE.test(shouldScroll.selector) // $flow-disable-line
  48309. ? document.getElementById(shouldScroll.selector.slice(1)) // $flow-disable-line
  48310. : document.querySelector(shouldScroll.selector);
  48311. if (el) {
  48312. var offset =
  48313. shouldScroll.offset && typeof shouldScroll.offset === 'object'
  48314. ? shouldScroll.offset
  48315. : {};
  48316. offset = normalizeOffset(offset);
  48317. position = getElementPosition(el, offset);
  48318. } else if (isValidPosition(shouldScroll)) {
  48319. position = normalizePosition(shouldScroll);
  48320. }
  48321. } else if (isObject && isValidPosition(shouldScroll)) {
  48322. position = normalizePosition(shouldScroll);
  48323. }
  48324. if (position) {
  48325. window.scrollTo(position.x, position.y);
  48326. }
  48327. }
  48328. /* */
  48329. var supportsPushState =
  48330. inBrowser &&
  48331. (function () {
  48332. var ua = window.navigator.userAgent;
  48333. if (
  48334. (ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) &&
  48335. ua.indexOf('Mobile Safari') !== -1 &&
  48336. ua.indexOf('Chrome') === -1 &&
  48337. ua.indexOf('Windows Phone') === -1
  48338. ) {
  48339. return false
  48340. }
  48341. return window.history && 'pushState' in window.history
  48342. })();
  48343. function pushState (url, replace) {
  48344. saveScrollPosition();
  48345. // try...catch the pushState call to get around Safari
  48346. // DOM Exception 18 where it limits to 100 pushState calls
  48347. var history = window.history;
  48348. try {
  48349. if (replace) {
  48350. // preserve existing history state as it could be overriden by the user
  48351. var stateCopy = extend({}, history.state);
  48352. stateCopy.key = getStateKey();
  48353. history.replaceState(stateCopy, '', url);
  48354. } else {
  48355. history.pushState({ key: setStateKey(genStateKey()) }, '', url);
  48356. }
  48357. } catch (e) {
  48358. window.location[replace ? 'replace' : 'assign'](url);
  48359. }
  48360. }
  48361. function replaceState (url) {
  48362. pushState(url, true);
  48363. }
  48364. /* */
  48365. function runQueue (queue, fn, cb) {
  48366. var step = function (index) {
  48367. if (index >= queue.length) {
  48368. cb();
  48369. } else {
  48370. if (queue[index]) {
  48371. fn(queue[index], function () {
  48372. step(index + 1);
  48373. });
  48374. } else {
  48375. step(index + 1);
  48376. }
  48377. }
  48378. };
  48379. step(0);
  48380. }
  48381. /* */
  48382. function resolveAsyncComponents (matched) {
  48383. return function (to, from, next) {
  48384. var hasAsync = false;
  48385. var pending = 0;
  48386. var error = null;
  48387. flatMapComponents(matched, function (def, _, match, key) {
  48388. // if it's a function and doesn't have cid attached,
  48389. // assume it's an async component resolve function.
  48390. // we are not using Vue's default async resolving mechanism because
  48391. // we want to halt the navigation until the incoming component has been
  48392. // resolved.
  48393. if (typeof def === 'function' && def.cid === undefined) {
  48394. hasAsync = true;
  48395. pending++;
  48396. var resolve = once(function (resolvedDef) {
  48397. if (isESModule(resolvedDef)) {
  48398. resolvedDef = resolvedDef.default;
  48399. }
  48400. // save resolved on async factory in case it's used elsewhere
  48401. def.resolved = typeof resolvedDef === 'function'
  48402. ? resolvedDef
  48403. : _Vue.extend(resolvedDef);
  48404. match.components[key] = resolvedDef;
  48405. pending--;
  48406. if (pending <= 0) {
  48407. next();
  48408. }
  48409. });
  48410. var reject = once(function (reason) {
  48411. var msg = "Failed to resolve async component " + key + ": " + reason;
  48412. true && warn(false, msg);
  48413. if (!error) {
  48414. error = isError(reason)
  48415. ? reason
  48416. : new Error(msg);
  48417. next(error);
  48418. }
  48419. });
  48420. var res;
  48421. try {
  48422. res = def(resolve, reject);
  48423. } catch (e) {
  48424. reject(e);
  48425. }
  48426. if (res) {
  48427. if (typeof res.then === 'function') {
  48428. res.then(resolve, reject);
  48429. } else {
  48430. // new syntax in Vue 2.3
  48431. var comp = res.component;
  48432. if (comp && typeof comp.then === 'function') {
  48433. comp.then(resolve, reject);
  48434. }
  48435. }
  48436. }
  48437. }
  48438. });
  48439. if (!hasAsync) { next(); }
  48440. }
  48441. }
  48442. function flatMapComponents (
  48443. matched,
  48444. fn
  48445. ) {
  48446. return flatten(matched.map(function (m) {
  48447. return Object.keys(m.components).map(function (key) { return fn(
  48448. m.components[key],
  48449. m.instances[key],
  48450. m, key
  48451. ); })
  48452. }))
  48453. }
  48454. function flatten (arr) {
  48455. return Array.prototype.concat.apply([], arr)
  48456. }
  48457. var hasSymbol =
  48458. typeof Symbol === 'function' &&
  48459. typeof Symbol.toStringTag === 'symbol';
  48460. function isESModule (obj) {
  48461. return obj.__esModule || (hasSymbol && obj[Symbol.toStringTag] === 'Module')
  48462. }
  48463. // in Webpack 2, require.ensure now also returns a Promise
  48464. // so the resolve/reject functions may get called an extra time
  48465. // if the user uses an arrow function shorthand that happens to
  48466. // return that Promise.
  48467. function once (fn) {
  48468. var called = false;
  48469. return function () {
  48470. var args = [], len = arguments.length;
  48471. while ( len-- ) args[ len ] = arguments[ len ];
  48472. if (called) { return }
  48473. called = true;
  48474. return fn.apply(this, args)
  48475. }
  48476. }
  48477. var NavigationDuplicated = /*@__PURE__*/(function (Error) {
  48478. function NavigationDuplicated (normalizedLocation) {
  48479. Error.call(this);
  48480. this.name = this._name = 'NavigationDuplicated';
  48481. // passing the message to super() doesn't seem to work in the transpiled version
  48482. this.message = "Navigating to current location (\"" + (normalizedLocation.fullPath) + "\") is not allowed";
  48483. // add a stack property so services like Sentry can correctly display it
  48484. Object.defineProperty(this, 'stack', {
  48485. value: new Error().stack,
  48486. writable: true,
  48487. configurable: true
  48488. });
  48489. // we could also have used
  48490. // Error.captureStackTrace(this, this.constructor)
  48491. // but it only exists on node and chrome
  48492. }
  48493. if ( Error ) NavigationDuplicated.__proto__ = Error;
  48494. NavigationDuplicated.prototype = Object.create( Error && Error.prototype );
  48495. NavigationDuplicated.prototype.constructor = NavigationDuplicated;
  48496. return NavigationDuplicated;
  48497. }(Error));
  48498. // support IE9
  48499. NavigationDuplicated._name = 'NavigationDuplicated';
  48500. /* */
  48501. var History = function History (router, base) {
  48502. this.router = router;
  48503. this.base = normalizeBase(base);
  48504. // start with a route object that stands for "nowhere"
  48505. this.current = START;
  48506. this.pending = null;
  48507. this.ready = false;
  48508. this.readyCbs = [];
  48509. this.readyErrorCbs = [];
  48510. this.errorCbs = [];
  48511. };
  48512. History.prototype.listen = function listen (cb) {
  48513. this.cb = cb;
  48514. };
  48515. History.prototype.onReady = function onReady (cb, errorCb) {
  48516. if (this.ready) {
  48517. cb();
  48518. } else {
  48519. this.readyCbs.push(cb);
  48520. if (errorCb) {
  48521. this.readyErrorCbs.push(errorCb);
  48522. }
  48523. }
  48524. };
  48525. History.prototype.onError = function onError (errorCb) {
  48526. this.errorCbs.push(errorCb);
  48527. };
  48528. History.prototype.transitionTo = function transitionTo (
  48529. location,
  48530. onComplete,
  48531. onAbort
  48532. ) {
  48533. var this$1 = this;
  48534. var route = this.router.match(location, this.current);
  48535. this.confirmTransition(
  48536. route,
  48537. function () {
  48538. this$1.updateRoute(route);
  48539. onComplete && onComplete(route);
  48540. this$1.ensureURL();
  48541. // fire ready cbs once
  48542. if (!this$1.ready) {
  48543. this$1.ready = true;
  48544. this$1.readyCbs.forEach(function (cb) {
  48545. cb(route);
  48546. });
  48547. }
  48548. },
  48549. function (err) {
  48550. if (onAbort) {
  48551. onAbort(err);
  48552. }
  48553. if (err && !this$1.ready) {
  48554. this$1.ready = true;
  48555. this$1.readyErrorCbs.forEach(function (cb) {
  48556. cb(err);
  48557. });
  48558. }
  48559. }
  48560. );
  48561. };
  48562. History.prototype.confirmTransition = function confirmTransition (route, onComplete, onAbort) {
  48563. var this$1 = this;
  48564. var current = this.current;
  48565. var abort = function (err) {
  48566. // after merging https://github.com/vuejs/vue-router/pull/2771 we
  48567. // When the user navigates through history through back/forward buttons
  48568. // we do not want to throw the error. We only throw it if directly calling
  48569. // push/replace. That's why it's not included in isError
  48570. if (!isExtendedError(NavigationDuplicated, err) && isError(err)) {
  48571. if (this$1.errorCbs.length) {
  48572. this$1.errorCbs.forEach(function (cb) {
  48573. cb(err);
  48574. });
  48575. } else {
  48576. warn(false, 'uncaught error during route navigation:');
  48577. console.error(err);
  48578. }
  48579. }
  48580. onAbort && onAbort(err);
  48581. };
  48582. if (
  48583. isSameRoute(route, current) &&
  48584. // in the case the route map has been dynamically appended to
  48585. route.matched.length === current.matched.length
  48586. ) {
  48587. this.ensureURL();
  48588. return abort(new NavigationDuplicated(route))
  48589. }
  48590. var ref = resolveQueue(
  48591. this.current.matched,
  48592. route.matched
  48593. );
  48594. var updated = ref.updated;
  48595. var deactivated = ref.deactivated;
  48596. var activated = ref.activated;
  48597. var queue = [].concat(
  48598. // in-component leave guards
  48599. extractLeaveGuards(deactivated),
  48600. // global before hooks
  48601. this.router.beforeHooks,
  48602. // in-component update hooks
  48603. extractUpdateHooks(updated),
  48604. // in-config enter guards
  48605. activated.map(function (m) { return m.beforeEnter; }),
  48606. // async components
  48607. resolveAsyncComponents(activated)
  48608. );
  48609. this.pending = route;
  48610. var iterator = function (hook, next) {
  48611. if (this$1.pending !== route) {
  48612. return abort()
  48613. }
  48614. try {
  48615. hook(route, current, function (to) {
  48616. if (to === false || isError(to)) {
  48617. // next(false) -> abort navigation, ensure current URL
  48618. this$1.ensureURL(true);
  48619. abort(to);
  48620. } else if (
  48621. typeof to === 'string' ||
  48622. (typeof to === 'object' &&
  48623. (typeof to.path === 'string' || typeof to.name === 'string'))
  48624. ) {
  48625. // next('/') or next({ path: '/' }) -> redirect
  48626. abort();
  48627. if (typeof to === 'object' && to.replace) {
  48628. this$1.replace(to);
  48629. } else {
  48630. this$1.push(to);
  48631. }
  48632. } else {
  48633. // confirm transition and pass on the value
  48634. next(to);
  48635. }
  48636. });
  48637. } catch (e) {
  48638. abort(e);
  48639. }
  48640. };
  48641. runQueue(queue, iterator, function () {
  48642. var postEnterCbs = [];
  48643. var isValid = function () { return this$1.current === route; };
  48644. // wait until async components are resolved before
  48645. // extracting in-component enter guards
  48646. var enterGuards = extractEnterGuards(activated, postEnterCbs, isValid);
  48647. var queue = enterGuards.concat(this$1.router.resolveHooks);
  48648. runQueue(queue, iterator, function () {
  48649. if (this$1.pending !== route) {
  48650. return abort()
  48651. }
  48652. this$1.pending = null;
  48653. onComplete(route);
  48654. if (this$1.router.app) {
  48655. this$1.router.app.$nextTick(function () {
  48656. postEnterCbs.forEach(function (cb) {
  48657. cb();
  48658. });
  48659. });
  48660. }
  48661. });
  48662. });
  48663. };
  48664. History.prototype.updateRoute = function updateRoute (route) {
  48665. var prev = this.current;
  48666. this.current = route;
  48667. this.cb && this.cb(route);
  48668. this.router.afterHooks.forEach(function (hook) {
  48669. hook && hook(route, prev);
  48670. });
  48671. };
  48672. function normalizeBase (base) {
  48673. if (!base) {
  48674. if (inBrowser) {
  48675. // respect <base> tag
  48676. var baseEl = document.querySelector('base');
  48677. base = (baseEl && baseEl.getAttribute('href')) || '/';
  48678. // strip full URL origin
  48679. base = base.replace(/^https?:\/\/[^\/]+/, '');
  48680. } else {
  48681. base = '/';
  48682. }
  48683. }
  48684. // make sure there's the starting slash
  48685. if (base.charAt(0) !== '/') {
  48686. base = '/' + base;
  48687. }
  48688. // remove trailing slash
  48689. return base.replace(/\/$/, '')
  48690. }
  48691. function resolveQueue (
  48692. current,
  48693. next
  48694. ) {
  48695. var i;
  48696. var max = Math.max(current.length, next.length);
  48697. for (i = 0; i < max; i++) {
  48698. if (current[i] !== next[i]) {
  48699. break
  48700. }
  48701. }
  48702. return {
  48703. updated: next.slice(0, i),
  48704. activated: next.slice(i),
  48705. deactivated: current.slice(i)
  48706. }
  48707. }
  48708. function extractGuards (
  48709. records,
  48710. name,
  48711. bind,
  48712. reverse
  48713. ) {
  48714. var guards = flatMapComponents(records, function (def, instance, match, key) {
  48715. var guard = extractGuard(def, name);
  48716. if (guard) {
  48717. return Array.isArray(guard)
  48718. ? guard.map(function (guard) { return bind(guard, instance, match, key); })
  48719. : bind(guard, instance, match, key)
  48720. }
  48721. });
  48722. return flatten(reverse ? guards.reverse() : guards)
  48723. }
  48724. function extractGuard (
  48725. def,
  48726. key
  48727. ) {
  48728. if (typeof def !== 'function') {
  48729. // extend now so that global mixins are applied.
  48730. def = _Vue.extend(def);
  48731. }
  48732. return def.options[key]
  48733. }
  48734. function extractLeaveGuards (deactivated) {
  48735. return extractGuards(deactivated, 'beforeRouteLeave', bindGuard, true)
  48736. }
  48737. function extractUpdateHooks (updated) {
  48738. return extractGuards(updated, 'beforeRouteUpdate', bindGuard)
  48739. }
  48740. function bindGuard (guard, instance) {
  48741. if (instance) {
  48742. return function boundRouteGuard () {
  48743. return guard.apply(instance, arguments)
  48744. }
  48745. }
  48746. }
  48747. function extractEnterGuards (
  48748. activated,
  48749. cbs,
  48750. isValid
  48751. ) {
  48752. return extractGuards(
  48753. activated,
  48754. 'beforeRouteEnter',
  48755. function (guard, _, match, key) {
  48756. return bindEnterGuard(guard, match, key, cbs, isValid)
  48757. }
  48758. )
  48759. }
  48760. function bindEnterGuard (
  48761. guard,
  48762. match,
  48763. key,
  48764. cbs,
  48765. isValid
  48766. ) {
  48767. return function routeEnterGuard (to, from, next) {
  48768. return guard(to, from, function (cb) {
  48769. if (typeof cb === 'function') {
  48770. cbs.push(function () {
  48771. // #750
  48772. // if a router-view is wrapped with an out-in transition,
  48773. // the instance may not have been registered at this time.
  48774. // we will need to poll for registration until current route
  48775. // is no longer valid.
  48776. poll(cb, match.instances, key, isValid);
  48777. });
  48778. }
  48779. next(cb);
  48780. })
  48781. }
  48782. }
  48783. function poll (
  48784. cb, // somehow flow cannot infer this is a function
  48785. instances,
  48786. key,
  48787. isValid
  48788. ) {
  48789. if (
  48790. instances[key] &&
  48791. !instances[key]._isBeingDestroyed // do not reuse being destroyed instance
  48792. ) {
  48793. cb(instances[key]);
  48794. } else if (isValid()) {
  48795. setTimeout(function () {
  48796. poll(cb, instances, key, isValid);
  48797. }, 16);
  48798. }
  48799. }
  48800. /* */
  48801. var HTML5History = /*@__PURE__*/(function (History) {
  48802. function HTML5History (router, base) {
  48803. var this$1 = this;
  48804. History.call(this, router, base);
  48805. var expectScroll = router.options.scrollBehavior;
  48806. var supportsScroll = supportsPushState && expectScroll;
  48807. if (supportsScroll) {
  48808. setupScroll();
  48809. }
  48810. var initLocation = getLocation(this.base);
  48811. window.addEventListener('popstate', function (e) {
  48812. var current = this$1.current;
  48813. // Avoiding first `popstate` event dispatched in some browsers but first
  48814. // history route not updated since async guard at the same time.
  48815. var location = getLocation(this$1.base);
  48816. if (this$1.current === START && location === initLocation) {
  48817. return
  48818. }
  48819. this$1.transitionTo(location, function (route) {
  48820. if (supportsScroll) {
  48821. handleScroll(router, route, current, true);
  48822. }
  48823. });
  48824. });
  48825. }
  48826. if ( History ) HTML5History.__proto__ = History;
  48827. HTML5History.prototype = Object.create( History && History.prototype );
  48828. HTML5History.prototype.constructor = HTML5History;
  48829. HTML5History.prototype.go = function go (n) {
  48830. window.history.go(n);
  48831. };
  48832. HTML5History.prototype.push = function push (location, onComplete, onAbort) {
  48833. var this$1 = this;
  48834. var ref = this;
  48835. var fromRoute = ref.current;
  48836. this.transitionTo(location, function (route) {
  48837. pushState(cleanPath(this$1.base + route.fullPath));
  48838. handleScroll(this$1.router, route, fromRoute, false);
  48839. onComplete && onComplete(route);
  48840. }, onAbort);
  48841. };
  48842. HTML5History.prototype.replace = function replace (location, onComplete, onAbort) {
  48843. var this$1 = this;
  48844. var ref = this;
  48845. var fromRoute = ref.current;
  48846. this.transitionTo(location, function (route) {
  48847. replaceState(cleanPath(this$1.base + route.fullPath));
  48848. handleScroll(this$1.router, route, fromRoute, false);
  48849. onComplete && onComplete(route);
  48850. }, onAbort);
  48851. };
  48852. HTML5History.prototype.ensureURL = function ensureURL (push) {
  48853. if (getLocation(this.base) !== this.current.fullPath) {
  48854. var current = cleanPath(this.base + this.current.fullPath);
  48855. push ? pushState(current) : replaceState(current);
  48856. }
  48857. };
  48858. HTML5History.prototype.getCurrentLocation = function getCurrentLocation () {
  48859. return getLocation(this.base)
  48860. };
  48861. return HTML5History;
  48862. }(History));
  48863. function getLocation (base) {
  48864. var path = decodeURI(window.location.pathname);
  48865. if (base && path.indexOf(base) === 0) {
  48866. path = path.slice(base.length);
  48867. }
  48868. return (path || '/') + window.location.search + window.location.hash
  48869. }
  48870. /* */
  48871. var HashHistory = /*@__PURE__*/(function (History) {
  48872. function HashHistory (router, base, fallback) {
  48873. History.call(this, router, base);
  48874. // check history fallback deeplinking
  48875. if (fallback && checkFallback(this.base)) {
  48876. return
  48877. }
  48878. ensureSlash();
  48879. }
  48880. if ( History ) HashHistory.__proto__ = History;
  48881. HashHistory.prototype = Object.create( History && History.prototype );
  48882. HashHistory.prototype.constructor = HashHistory;
  48883. // this is delayed until the app mounts
  48884. // to avoid the hashchange listener being fired too early
  48885. HashHistory.prototype.setupListeners = function setupListeners () {
  48886. var this$1 = this;
  48887. var router = this.router;
  48888. var expectScroll = router.options.scrollBehavior;
  48889. var supportsScroll = supportsPushState && expectScroll;
  48890. if (supportsScroll) {
  48891. setupScroll();
  48892. }
  48893. window.addEventListener(
  48894. supportsPushState ? 'popstate' : 'hashchange',
  48895. function () {
  48896. var current = this$1.current;
  48897. if (!ensureSlash()) {
  48898. return
  48899. }
  48900. this$1.transitionTo(getHash(), function (route) {
  48901. if (supportsScroll) {
  48902. handleScroll(this$1.router, route, current, true);
  48903. }
  48904. if (!supportsPushState) {
  48905. replaceHash(route.fullPath);
  48906. }
  48907. });
  48908. }
  48909. );
  48910. };
  48911. HashHistory.prototype.push = function push (location, onComplete, onAbort) {
  48912. var this$1 = this;
  48913. var ref = this;
  48914. var fromRoute = ref.current;
  48915. this.transitionTo(
  48916. location,
  48917. function (route) {
  48918. pushHash(route.fullPath);
  48919. handleScroll(this$1.router, route, fromRoute, false);
  48920. onComplete && onComplete(route);
  48921. },
  48922. onAbort
  48923. );
  48924. };
  48925. HashHistory.prototype.replace = function replace (location, onComplete, onAbort) {
  48926. var this$1 = this;
  48927. var ref = this;
  48928. var fromRoute = ref.current;
  48929. this.transitionTo(
  48930. location,
  48931. function (route) {
  48932. replaceHash(route.fullPath);
  48933. handleScroll(this$1.router, route, fromRoute, false);
  48934. onComplete && onComplete(route);
  48935. },
  48936. onAbort
  48937. );
  48938. };
  48939. HashHistory.prototype.go = function go (n) {
  48940. window.history.go(n);
  48941. };
  48942. HashHistory.prototype.ensureURL = function ensureURL (push) {
  48943. var current = this.current.fullPath;
  48944. if (getHash() !== current) {
  48945. push ? pushHash(current) : replaceHash(current);
  48946. }
  48947. };
  48948. HashHistory.prototype.getCurrentLocation = function getCurrentLocation () {
  48949. return getHash()
  48950. };
  48951. return HashHistory;
  48952. }(History));
  48953. function checkFallback (base) {
  48954. var location = getLocation(base);
  48955. if (!/^\/#/.test(location)) {
  48956. window.location.replace(cleanPath(base + '/#' + location));
  48957. return true
  48958. }
  48959. }
  48960. function ensureSlash () {
  48961. var path = getHash();
  48962. if (path.charAt(0) === '/') {
  48963. return true
  48964. }
  48965. replaceHash('/' + path);
  48966. return false
  48967. }
  48968. function getHash () {
  48969. // We can't use window.location.hash here because it's not
  48970. // consistent across browsers - Firefox will pre-decode it!
  48971. var href = window.location.href;
  48972. var index = href.indexOf('#');
  48973. // empty path
  48974. if (index < 0) { return '' }
  48975. href = href.slice(index + 1);
  48976. // decode the hash but not the search or hash
  48977. // as search(query) is already decoded
  48978. // https://github.com/vuejs/vue-router/issues/2708
  48979. var searchIndex = href.indexOf('?');
  48980. if (searchIndex < 0) {
  48981. var hashIndex = href.indexOf('#');
  48982. if (hashIndex > -1) {
  48983. href = decodeURI(href.slice(0, hashIndex)) + href.slice(hashIndex);
  48984. } else { href = decodeURI(href); }
  48985. } else {
  48986. href = decodeURI(href.slice(0, searchIndex)) + href.slice(searchIndex);
  48987. }
  48988. return href
  48989. }
  48990. function getUrl (path) {
  48991. var href = window.location.href;
  48992. var i = href.indexOf('#');
  48993. var base = i >= 0 ? href.slice(0, i) : href;
  48994. return (base + "#" + path)
  48995. }
  48996. function pushHash (path) {
  48997. if (supportsPushState) {
  48998. pushState(getUrl(path));
  48999. } else {
  49000. window.location.hash = path;
  49001. }
  49002. }
  49003. function replaceHash (path) {
  49004. if (supportsPushState) {
  49005. replaceState(getUrl(path));
  49006. } else {
  49007. window.location.replace(getUrl(path));
  49008. }
  49009. }
  49010. /* */
  49011. var AbstractHistory = /*@__PURE__*/(function (History) {
  49012. function AbstractHistory (router, base) {
  49013. History.call(this, router, base);
  49014. this.stack = [];
  49015. this.index = -1;
  49016. }
  49017. if ( History ) AbstractHistory.__proto__ = History;
  49018. AbstractHistory.prototype = Object.create( History && History.prototype );
  49019. AbstractHistory.prototype.constructor = AbstractHistory;
  49020. AbstractHistory.prototype.push = function push (location, onComplete, onAbort) {
  49021. var this$1 = this;
  49022. this.transitionTo(
  49023. location,
  49024. function (route) {
  49025. this$1.stack = this$1.stack.slice(0, this$1.index + 1).concat(route);
  49026. this$1.index++;
  49027. onComplete && onComplete(route);
  49028. },
  49029. onAbort
  49030. );
  49031. };
  49032. AbstractHistory.prototype.replace = function replace (location, onComplete, onAbort) {
  49033. var this$1 = this;
  49034. this.transitionTo(
  49035. location,
  49036. function (route) {
  49037. this$1.stack = this$1.stack.slice(0, this$1.index).concat(route);
  49038. onComplete && onComplete(route);
  49039. },
  49040. onAbort
  49041. );
  49042. };
  49043. AbstractHistory.prototype.go = function go (n) {
  49044. var this$1 = this;
  49045. var targetIndex = this.index + n;
  49046. if (targetIndex < 0 || targetIndex >= this.stack.length) {
  49047. return
  49048. }
  49049. var route = this.stack[targetIndex];
  49050. this.confirmTransition(
  49051. route,
  49052. function () {
  49053. this$1.index = targetIndex;
  49054. this$1.updateRoute(route);
  49055. },
  49056. function (err) {
  49057. if (isExtendedError(NavigationDuplicated, err)) {
  49058. this$1.index = targetIndex;
  49059. }
  49060. }
  49061. );
  49062. };
  49063. AbstractHistory.prototype.getCurrentLocation = function getCurrentLocation () {
  49064. var current = this.stack[this.stack.length - 1];
  49065. return current ? current.fullPath : '/'
  49066. };
  49067. AbstractHistory.prototype.ensureURL = function ensureURL () {
  49068. // noop
  49069. };
  49070. return AbstractHistory;
  49071. }(History));
  49072. /* */
  49073. var VueRouter = function VueRouter (options) {
  49074. if ( options === void 0 ) options = {};
  49075. this.app = null;
  49076. this.apps = [];
  49077. this.options = options;
  49078. this.beforeHooks = [];
  49079. this.resolveHooks = [];
  49080. this.afterHooks = [];
  49081. this.matcher = createMatcher(options.routes || [], this);
  49082. var mode = options.mode || 'hash';
  49083. this.fallback = mode === 'history' && !supportsPushState && options.fallback !== false;
  49084. if (this.fallback) {
  49085. mode = 'hash';
  49086. }
  49087. if (!inBrowser) {
  49088. mode = 'abstract';
  49089. }
  49090. this.mode = mode;
  49091. switch (mode) {
  49092. case 'history':
  49093. this.history = new HTML5History(this, options.base);
  49094. break
  49095. case 'hash':
  49096. this.history = new HashHistory(this, options.base, this.fallback);
  49097. break
  49098. case 'abstract':
  49099. this.history = new AbstractHistory(this, options.base);
  49100. break
  49101. default:
  49102. if (true) {
  49103. assert(false, ("invalid mode: " + mode));
  49104. }
  49105. }
  49106. };
  49107. var prototypeAccessors = { currentRoute: { configurable: true } };
  49108. VueRouter.prototype.match = function match (
  49109. raw,
  49110. current,
  49111. redirectedFrom
  49112. ) {
  49113. return this.matcher.match(raw, current, redirectedFrom)
  49114. };
  49115. prototypeAccessors.currentRoute.get = function () {
  49116. return this.history && this.history.current
  49117. };
  49118. VueRouter.prototype.init = function init (app /* Vue component instance */) {
  49119. var this$1 = this;
  49120. true && assert(
  49121. install.installed,
  49122. "not installed. Make sure to call `Vue.use(VueRouter)` " +
  49123. "before creating root instance."
  49124. );
  49125. this.apps.push(app);
  49126. // set up app destroyed handler
  49127. // https://github.com/vuejs/vue-router/issues/2639
  49128. app.$once('hook:destroyed', function () {
  49129. // clean out app from this.apps array once destroyed
  49130. var index = this$1.apps.indexOf(app);
  49131. if (index > -1) { this$1.apps.splice(index, 1); }
  49132. // ensure we still have a main app or null if no apps
  49133. // we do not release the router so it can be reused
  49134. if (this$1.app === app) { this$1.app = this$1.apps[0] || null; }
  49135. });
  49136. // main app previously initialized
  49137. // return as we don't need to set up new history listener
  49138. if (this.app) {
  49139. return
  49140. }
  49141. this.app = app;
  49142. var history = this.history;
  49143. if (history instanceof HTML5History) {
  49144. history.transitionTo(history.getCurrentLocation());
  49145. } else if (history instanceof HashHistory) {
  49146. var setupHashListener = function () {
  49147. history.setupListeners();
  49148. };
  49149. history.transitionTo(
  49150. history.getCurrentLocation(),
  49151. setupHashListener,
  49152. setupHashListener
  49153. );
  49154. }
  49155. history.listen(function (route) {
  49156. this$1.apps.forEach(function (app) {
  49157. app._route = route;
  49158. });
  49159. });
  49160. };
  49161. VueRouter.prototype.beforeEach = function beforeEach (fn) {
  49162. return registerHook(this.beforeHooks, fn)
  49163. };
  49164. VueRouter.prototype.beforeResolve = function beforeResolve (fn) {
  49165. return registerHook(this.resolveHooks, fn)
  49166. };
  49167. VueRouter.prototype.afterEach = function afterEach (fn) {
  49168. return registerHook(this.afterHooks, fn)
  49169. };
  49170. VueRouter.prototype.onReady = function onReady (cb, errorCb) {
  49171. this.history.onReady(cb, errorCb);
  49172. };
  49173. VueRouter.prototype.onError = function onError (errorCb) {
  49174. this.history.onError(errorCb);
  49175. };
  49176. VueRouter.prototype.push = function push (location, onComplete, onAbort) {
  49177. var this$1 = this;
  49178. // $flow-disable-line
  49179. if (!onComplete && !onAbort && typeof Promise !== 'undefined') {
  49180. return new Promise(function (resolve, reject) {
  49181. this$1.history.push(location, resolve, reject);
  49182. })
  49183. } else {
  49184. this.history.push(location, onComplete, onAbort);
  49185. }
  49186. };
  49187. VueRouter.prototype.replace = function replace (location, onComplete, onAbort) {
  49188. var this$1 = this;
  49189. // $flow-disable-line
  49190. if (!onComplete && !onAbort && typeof Promise !== 'undefined') {
  49191. return new Promise(function (resolve, reject) {
  49192. this$1.history.replace(location, resolve, reject);
  49193. })
  49194. } else {
  49195. this.history.replace(location, onComplete, onAbort);
  49196. }
  49197. };
  49198. VueRouter.prototype.go = function go (n) {
  49199. this.history.go(n);
  49200. };
  49201. VueRouter.prototype.back = function back () {
  49202. this.go(-1);
  49203. };
  49204. VueRouter.prototype.forward = function forward () {
  49205. this.go(1);
  49206. };
  49207. VueRouter.prototype.getMatchedComponents = function getMatchedComponents (to) {
  49208. var route = to
  49209. ? to.matched
  49210. ? to
  49211. : this.resolve(to).route
  49212. : this.currentRoute;
  49213. if (!route) {
  49214. return []
  49215. }
  49216. return [].concat.apply([], route.matched.map(function (m) {
  49217. return Object.keys(m.components).map(function (key) {
  49218. return m.components[key]
  49219. })
  49220. }))
  49221. };
  49222. VueRouter.prototype.resolve = function resolve (
  49223. to,
  49224. current,
  49225. append
  49226. ) {
  49227. current = current || this.history.current;
  49228. var location = normalizeLocation(
  49229. to,
  49230. current,
  49231. append,
  49232. this
  49233. );
  49234. var route = this.match(location, current);
  49235. var fullPath = route.redirectedFrom || route.fullPath;
  49236. var base = this.history.base;
  49237. var href = createHref(base, fullPath, this.mode);
  49238. return {
  49239. location: location,
  49240. route: route,
  49241. href: href,
  49242. // for backwards compat
  49243. normalizedTo: location,
  49244. resolved: route
  49245. }
  49246. };
  49247. VueRouter.prototype.addRoutes = function addRoutes (routes) {
  49248. this.matcher.addRoutes(routes);
  49249. if (this.history.current !== START) {
  49250. this.history.transitionTo(this.history.getCurrentLocation());
  49251. }
  49252. };
  49253. Object.defineProperties( VueRouter.prototype, prototypeAccessors );
  49254. function registerHook (list, fn) {
  49255. list.push(fn);
  49256. return function () {
  49257. var i = list.indexOf(fn);
  49258. if (i > -1) { list.splice(i, 1); }
  49259. }
  49260. }
  49261. function createHref (base, fullPath, mode) {
  49262. var path = mode === 'hash' ? '#' + fullPath : fullPath;
  49263. return base ? cleanPath(base + '/' + path) : path
  49264. }
  49265. VueRouter.install = install;
  49266. VueRouter.version = '3.1.6';
  49267. if (inBrowser && window.Vue) {
  49268. window.Vue.use(VueRouter);
  49269. }
  49270. /* harmony default export */ __webpack_exports__["default"] = (VueRouter);
  49271. /***/ }),
  49272. /***/ "./node_modules/vue/dist/vue.common.dev.js":
  49273. /*!*************************************************!*\
  49274. !*** ./node_modules/vue/dist/vue.common.dev.js ***!
  49275. \*************************************************/
  49276. /*! no static exports found */
  49277. /***/ (function(module, exports, __webpack_require__) {
  49278. "use strict";
  49279. /* WEBPACK VAR INJECTION */(function(global, setImmediate) {/*!
  49280. * Vue.js v2.6.11
  49281. * (c) 2014-2019 Evan You
  49282. * Released under the MIT License.
  49283. */
  49284. /* */
  49285. var emptyObject = Object.freeze({});
  49286. // These helpers produce better VM code in JS engines due to their
  49287. // explicitness and function inlining.
  49288. function isUndef (v) {
  49289. return v === undefined || v === null
  49290. }
  49291. function isDef (v) {
  49292. return v !== undefined && v !== null
  49293. }
  49294. function isTrue (v) {
  49295. return v === true
  49296. }
  49297. function isFalse (v) {
  49298. return v === false
  49299. }
  49300. /**
  49301. * Check if value is primitive.
  49302. */
  49303. function isPrimitive (value) {
  49304. return (
  49305. typeof value === 'string' ||
  49306. typeof value === 'number' ||
  49307. // $flow-disable-line
  49308. typeof value === 'symbol' ||
  49309. typeof value === 'boolean'
  49310. )
  49311. }
  49312. /**
  49313. * Quick object check - this is primarily used to tell
  49314. * Objects from primitive values when we know the value
  49315. * is a JSON-compliant type.
  49316. */
  49317. function isObject (obj) {
  49318. return obj !== null && typeof obj === 'object'
  49319. }
  49320. /**
  49321. * Get the raw type string of a value, e.g., [object Object].
  49322. */
  49323. var _toString = Object.prototype.toString;
  49324. function toRawType (value) {
  49325. return _toString.call(value).slice(8, -1)
  49326. }
  49327. /**
  49328. * Strict object type check. Only returns true
  49329. * for plain JavaScript objects.
  49330. */
  49331. function isPlainObject (obj) {
  49332. return _toString.call(obj) === '[object Object]'
  49333. }
  49334. function isRegExp (v) {
  49335. return _toString.call(v) === '[object RegExp]'
  49336. }
  49337. /**
  49338. * Check if val is a valid array index.
  49339. */
  49340. function isValidArrayIndex (val) {
  49341. var n = parseFloat(String(val));
  49342. return n >= 0 && Math.floor(n) === n && isFinite(val)
  49343. }
  49344. function isPromise (val) {
  49345. return (
  49346. isDef(val) &&
  49347. typeof val.then === 'function' &&
  49348. typeof val.catch === 'function'
  49349. )
  49350. }
  49351. /**
  49352. * Convert a value to a string that is actually rendered.
  49353. */
  49354. function toString (val) {
  49355. return val == null
  49356. ? ''
  49357. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  49358. ? JSON.stringify(val, null, 2)
  49359. : String(val)
  49360. }
  49361. /**
  49362. * Convert an input value to a number for persistence.
  49363. * If the conversion fails, return original string.
  49364. */
  49365. function toNumber (val) {
  49366. var n = parseFloat(val);
  49367. return isNaN(n) ? val : n
  49368. }
  49369. /**
  49370. * Make a map and return a function for checking if a key
  49371. * is in that map.
  49372. */
  49373. function makeMap (
  49374. str,
  49375. expectsLowerCase
  49376. ) {
  49377. var map = Object.create(null);
  49378. var list = str.split(',');
  49379. for (var i = 0; i < list.length; i++) {
  49380. map[list[i]] = true;
  49381. }
  49382. return expectsLowerCase
  49383. ? function (val) { return map[val.toLowerCase()]; }
  49384. : function (val) { return map[val]; }
  49385. }
  49386. /**
  49387. * Check if a tag is a built-in tag.
  49388. */
  49389. var isBuiltInTag = makeMap('slot,component', true);
  49390. /**
  49391. * Check if an attribute is a reserved attribute.
  49392. */
  49393. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  49394. /**
  49395. * Remove an item from an array.
  49396. */
  49397. function remove (arr, item) {
  49398. if (arr.length) {
  49399. var index = arr.indexOf(item);
  49400. if (index > -1) {
  49401. return arr.splice(index, 1)
  49402. }
  49403. }
  49404. }
  49405. /**
  49406. * Check whether an object has the property.
  49407. */
  49408. var hasOwnProperty = Object.prototype.hasOwnProperty;
  49409. function hasOwn (obj, key) {
  49410. return hasOwnProperty.call(obj, key)
  49411. }
  49412. /**
  49413. * Create a cached version of a pure function.
  49414. */
  49415. function cached (fn) {
  49416. var cache = Object.create(null);
  49417. return (function cachedFn (str) {
  49418. var hit = cache[str];
  49419. return hit || (cache[str] = fn(str))
  49420. })
  49421. }
  49422. /**
  49423. * Camelize a hyphen-delimited string.
  49424. */
  49425. var camelizeRE = /-(\w)/g;
  49426. var camelize = cached(function (str) {
  49427. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  49428. });
  49429. /**
  49430. * Capitalize a string.
  49431. */
  49432. var capitalize = cached(function (str) {
  49433. return str.charAt(0).toUpperCase() + str.slice(1)
  49434. });
  49435. /**
  49436. * Hyphenate a camelCase string.
  49437. */
  49438. var hyphenateRE = /\B([A-Z])/g;
  49439. var hyphenate = cached(function (str) {
  49440. return str.replace(hyphenateRE, '-$1').toLowerCase()
  49441. });
  49442. /**
  49443. * Simple bind polyfill for environments that do not support it,
  49444. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  49445. * since native bind is now performant enough in most browsers.
  49446. * But removing it would mean breaking code that was able to run in
  49447. * PhantomJS 1.x, so this must be kept for backward compatibility.
  49448. */
  49449. /* istanbul ignore next */
  49450. function polyfillBind (fn, ctx) {
  49451. function boundFn (a) {
  49452. var l = arguments.length;
  49453. return l
  49454. ? l > 1
  49455. ? fn.apply(ctx, arguments)
  49456. : fn.call(ctx, a)
  49457. : fn.call(ctx)
  49458. }
  49459. boundFn._length = fn.length;
  49460. return boundFn
  49461. }
  49462. function nativeBind (fn, ctx) {
  49463. return fn.bind(ctx)
  49464. }
  49465. var bind = Function.prototype.bind
  49466. ? nativeBind
  49467. : polyfillBind;
  49468. /**
  49469. * Convert an Array-like object to a real Array.
  49470. */
  49471. function toArray (list, start) {
  49472. start = start || 0;
  49473. var i = list.length - start;
  49474. var ret = new Array(i);
  49475. while (i--) {
  49476. ret[i] = list[i + start];
  49477. }
  49478. return ret
  49479. }
  49480. /**
  49481. * Mix properties into target object.
  49482. */
  49483. function extend (to, _from) {
  49484. for (var key in _from) {
  49485. to[key] = _from[key];
  49486. }
  49487. return to
  49488. }
  49489. /**
  49490. * Merge an Array of Objects into a single Object.
  49491. */
  49492. function toObject (arr) {
  49493. var res = {};
  49494. for (var i = 0; i < arr.length; i++) {
  49495. if (arr[i]) {
  49496. extend(res, arr[i]);
  49497. }
  49498. }
  49499. return res
  49500. }
  49501. /* eslint-disable no-unused-vars */
  49502. /**
  49503. * Perform no operation.
  49504. * Stubbing args to make Flow happy without leaving useless transpiled code
  49505. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  49506. */
  49507. function noop (a, b, c) {}
  49508. /**
  49509. * Always return false.
  49510. */
  49511. var no = function (a, b, c) { return false; };
  49512. /* eslint-enable no-unused-vars */
  49513. /**
  49514. * Return the same value.
  49515. */
  49516. var identity = function (_) { return _; };
  49517. /**
  49518. * Generate a string containing static keys from compiler modules.
  49519. */
  49520. function genStaticKeys (modules) {
  49521. return modules.reduce(function (keys, m) {
  49522. return keys.concat(m.staticKeys || [])
  49523. }, []).join(',')
  49524. }
  49525. /**
  49526. * Check if two values are loosely equal - that is,
  49527. * if they are plain objects, do they have the same shape?
  49528. */
  49529. function looseEqual (a, b) {
  49530. if (a === b) { return true }
  49531. var isObjectA = isObject(a);
  49532. var isObjectB = isObject(b);
  49533. if (isObjectA && isObjectB) {
  49534. try {
  49535. var isArrayA = Array.isArray(a);
  49536. var isArrayB = Array.isArray(b);
  49537. if (isArrayA && isArrayB) {
  49538. return a.length === b.length && a.every(function (e, i) {
  49539. return looseEqual(e, b[i])
  49540. })
  49541. } else if (a instanceof Date && b instanceof Date) {
  49542. return a.getTime() === b.getTime()
  49543. } else if (!isArrayA && !isArrayB) {
  49544. var keysA = Object.keys(a);
  49545. var keysB = Object.keys(b);
  49546. return keysA.length === keysB.length && keysA.every(function (key) {
  49547. return looseEqual(a[key], b[key])
  49548. })
  49549. } else {
  49550. /* istanbul ignore next */
  49551. return false
  49552. }
  49553. } catch (e) {
  49554. /* istanbul ignore next */
  49555. return false
  49556. }
  49557. } else if (!isObjectA && !isObjectB) {
  49558. return String(a) === String(b)
  49559. } else {
  49560. return false
  49561. }
  49562. }
  49563. /**
  49564. * Return the first index at which a loosely equal value can be
  49565. * found in the array (if value is a plain object, the array must
  49566. * contain an object of the same shape), or -1 if it is not present.
  49567. */
  49568. function looseIndexOf (arr, val) {
  49569. for (var i = 0; i < arr.length; i++) {
  49570. if (looseEqual(arr[i], val)) { return i }
  49571. }
  49572. return -1
  49573. }
  49574. /**
  49575. * Ensure a function is called only once.
  49576. */
  49577. function once (fn) {
  49578. var called = false;
  49579. return function () {
  49580. if (!called) {
  49581. called = true;
  49582. fn.apply(this, arguments);
  49583. }
  49584. }
  49585. }
  49586. var SSR_ATTR = 'data-server-rendered';
  49587. var ASSET_TYPES = [
  49588. 'component',
  49589. 'directive',
  49590. 'filter'
  49591. ];
  49592. var LIFECYCLE_HOOKS = [
  49593. 'beforeCreate',
  49594. 'created',
  49595. 'beforeMount',
  49596. 'mounted',
  49597. 'beforeUpdate',
  49598. 'updated',
  49599. 'beforeDestroy',
  49600. 'destroyed',
  49601. 'activated',
  49602. 'deactivated',
  49603. 'errorCaptured',
  49604. 'serverPrefetch'
  49605. ];
  49606. /* */
  49607. var config = ({
  49608. /**
  49609. * Option merge strategies (used in core/util/options)
  49610. */
  49611. // $flow-disable-line
  49612. optionMergeStrategies: Object.create(null),
  49613. /**
  49614. * Whether to suppress warnings.
  49615. */
  49616. silent: false,
  49617. /**
  49618. * Show production mode tip message on boot?
  49619. */
  49620. productionTip: "development" !== 'production',
  49621. /**
  49622. * Whether to enable devtools
  49623. */
  49624. devtools: "development" !== 'production',
  49625. /**
  49626. * Whether to record perf
  49627. */
  49628. performance: false,
  49629. /**
  49630. * Error handler for watcher errors
  49631. */
  49632. errorHandler: null,
  49633. /**
  49634. * Warn handler for watcher warns
  49635. */
  49636. warnHandler: null,
  49637. /**
  49638. * Ignore certain custom elements
  49639. */
  49640. ignoredElements: [],
  49641. /**
  49642. * Custom user key aliases for v-on
  49643. */
  49644. // $flow-disable-line
  49645. keyCodes: Object.create(null),
  49646. /**
  49647. * Check if a tag is reserved so that it cannot be registered as a
  49648. * component. This is platform-dependent and may be overwritten.
  49649. */
  49650. isReservedTag: no,
  49651. /**
  49652. * Check if an attribute is reserved so that it cannot be used as a component
  49653. * prop. This is platform-dependent and may be overwritten.
  49654. */
  49655. isReservedAttr: no,
  49656. /**
  49657. * Check if a tag is an unknown element.
  49658. * Platform-dependent.
  49659. */
  49660. isUnknownElement: no,
  49661. /**
  49662. * Get the namespace of an element
  49663. */
  49664. getTagNamespace: noop,
  49665. /**
  49666. * Parse the real tag name for the specific platform.
  49667. */
  49668. parsePlatformTagName: identity,
  49669. /**
  49670. * Check if an attribute must be bound using property, e.g. value
  49671. * Platform-dependent.
  49672. */
  49673. mustUseProp: no,
  49674. /**
  49675. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  49676. * This will significantly reduce performance if set to false.
  49677. */
  49678. async: true,
  49679. /**
  49680. * Exposed for legacy reasons
  49681. */
  49682. _lifecycleHooks: LIFECYCLE_HOOKS
  49683. });
  49684. /* */
  49685. /**
  49686. * unicode letters used for parsing html tags, component names and property paths.
  49687. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  49688. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  49689. */
  49690. 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/;
  49691. /**
  49692. * Check if a string starts with $ or _
  49693. */
  49694. function isReserved (str) {
  49695. var c = (str + '').charCodeAt(0);
  49696. return c === 0x24 || c === 0x5F
  49697. }
  49698. /**
  49699. * Define a property.
  49700. */
  49701. function def (obj, key, val, enumerable) {
  49702. Object.defineProperty(obj, key, {
  49703. value: val,
  49704. enumerable: !!enumerable,
  49705. writable: true,
  49706. configurable: true
  49707. });
  49708. }
  49709. /**
  49710. * Parse simple path.
  49711. */
  49712. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  49713. function parsePath (path) {
  49714. if (bailRE.test(path)) {
  49715. return
  49716. }
  49717. var segments = path.split('.');
  49718. return function (obj) {
  49719. for (var i = 0; i < segments.length; i++) {
  49720. if (!obj) { return }
  49721. obj = obj[segments[i]];
  49722. }
  49723. return obj
  49724. }
  49725. }
  49726. /* */
  49727. // can we use __proto__?
  49728. var hasProto = '__proto__' in {};
  49729. // Browser environment sniffing
  49730. var inBrowser = typeof window !== 'undefined';
  49731. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  49732. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  49733. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  49734. var isIE = UA && /msie|trident/.test(UA);
  49735. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  49736. var isEdge = UA && UA.indexOf('edge/') > 0;
  49737. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  49738. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  49739. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  49740. var isPhantomJS = UA && /phantomjs/.test(UA);
  49741. var isFF = UA && UA.match(/firefox\/(\d+)/);
  49742. // Firefox has a "watch" function on Object.prototype...
  49743. var nativeWatch = ({}).watch;
  49744. var supportsPassive = false;
  49745. if (inBrowser) {
  49746. try {
  49747. var opts = {};
  49748. Object.defineProperty(opts, 'passive', ({
  49749. get: function get () {
  49750. /* istanbul ignore next */
  49751. supportsPassive = true;
  49752. }
  49753. })); // https://github.com/facebook/flow/issues/285
  49754. window.addEventListener('test-passive', null, opts);
  49755. } catch (e) {}
  49756. }
  49757. // this needs to be lazy-evaled because vue may be required before
  49758. // vue-server-renderer can set VUE_ENV
  49759. var _isServer;
  49760. var isServerRendering = function () {
  49761. if (_isServer === undefined) {
  49762. /* istanbul ignore if */
  49763. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  49764. // detect presence of vue-server-renderer and avoid
  49765. // Webpack shimming the process
  49766. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  49767. } else {
  49768. _isServer = false;
  49769. }
  49770. }
  49771. return _isServer
  49772. };
  49773. // detect devtools
  49774. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  49775. /* istanbul ignore next */
  49776. function isNative (Ctor) {
  49777. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  49778. }
  49779. var hasSymbol =
  49780. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  49781. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  49782. var _Set;
  49783. /* istanbul ignore if */ // $flow-disable-line
  49784. if (typeof Set !== 'undefined' && isNative(Set)) {
  49785. // use native Set when available.
  49786. _Set = Set;
  49787. } else {
  49788. // a non-standard Set polyfill that only works with primitive keys.
  49789. _Set = /*@__PURE__*/(function () {
  49790. function Set () {
  49791. this.set = Object.create(null);
  49792. }
  49793. Set.prototype.has = function has (key) {
  49794. return this.set[key] === true
  49795. };
  49796. Set.prototype.add = function add (key) {
  49797. this.set[key] = true;
  49798. };
  49799. Set.prototype.clear = function clear () {
  49800. this.set = Object.create(null);
  49801. };
  49802. return Set;
  49803. }());
  49804. }
  49805. /* */
  49806. var warn = noop;
  49807. var tip = noop;
  49808. var generateComponentTrace = (noop); // work around flow check
  49809. var formatComponentName = (noop);
  49810. {
  49811. var hasConsole = typeof console !== 'undefined';
  49812. var classifyRE = /(?:^|[-_])(\w)/g;
  49813. var classify = function (str) { return str
  49814. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  49815. .replace(/[-_]/g, ''); };
  49816. warn = function (msg, vm) {
  49817. var trace = vm ? generateComponentTrace(vm) : '';
  49818. if (config.warnHandler) {
  49819. config.warnHandler.call(null, msg, vm, trace);
  49820. } else if (hasConsole && (!config.silent)) {
  49821. console.error(("[Vue warn]: " + msg + trace));
  49822. }
  49823. };
  49824. tip = function (msg, vm) {
  49825. if (hasConsole && (!config.silent)) {
  49826. console.warn("[Vue tip]: " + msg + (
  49827. vm ? generateComponentTrace(vm) : ''
  49828. ));
  49829. }
  49830. };
  49831. formatComponentName = function (vm, includeFile) {
  49832. if (vm.$root === vm) {
  49833. return '<Root>'
  49834. }
  49835. var options = typeof vm === 'function' && vm.cid != null
  49836. ? vm.options
  49837. : vm._isVue
  49838. ? vm.$options || vm.constructor.options
  49839. : vm;
  49840. var name = options.name || options._componentTag;
  49841. var file = options.__file;
  49842. if (!name && file) {
  49843. var match = file.match(/([^/\\]+)\.vue$/);
  49844. name = match && match[1];
  49845. }
  49846. return (
  49847. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  49848. (file && includeFile !== false ? (" at " + file) : '')
  49849. )
  49850. };
  49851. var repeat = function (str, n) {
  49852. var res = '';
  49853. while (n) {
  49854. if (n % 2 === 1) { res += str; }
  49855. if (n > 1) { str += str; }
  49856. n >>= 1;
  49857. }
  49858. return res
  49859. };
  49860. generateComponentTrace = function (vm) {
  49861. if (vm._isVue && vm.$parent) {
  49862. var tree = [];
  49863. var currentRecursiveSequence = 0;
  49864. while (vm) {
  49865. if (tree.length > 0) {
  49866. var last = tree[tree.length - 1];
  49867. if (last.constructor === vm.constructor) {
  49868. currentRecursiveSequence++;
  49869. vm = vm.$parent;
  49870. continue
  49871. } else if (currentRecursiveSequence > 0) {
  49872. tree[tree.length - 1] = [last, currentRecursiveSequence];
  49873. currentRecursiveSequence = 0;
  49874. }
  49875. }
  49876. tree.push(vm);
  49877. vm = vm.$parent;
  49878. }
  49879. return '\n\nfound in\n\n' + tree
  49880. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  49881. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  49882. : formatComponentName(vm))); })
  49883. .join('\n')
  49884. } else {
  49885. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  49886. }
  49887. };
  49888. }
  49889. /* */
  49890. var uid = 0;
  49891. /**
  49892. * A dep is an observable that can have multiple
  49893. * directives subscribing to it.
  49894. */
  49895. var Dep = function Dep () {
  49896. this.id = uid++;
  49897. this.subs = [];
  49898. };
  49899. Dep.prototype.addSub = function addSub (sub) {
  49900. this.subs.push(sub);
  49901. };
  49902. Dep.prototype.removeSub = function removeSub (sub) {
  49903. remove(this.subs, sub);
  49904. };
  49905. Dep.prototype.depend = function depend () {
  49906. if (Dep.target) {
  49907. Dep.target.addDep(this);
  49908. }
  49909. };
  49910. Dep.prototype.notify = function notify () {
  49911. // stabilize the subscriber list first
  49912. var subs = this.subs.slice();
  49913. if (!config.async) {
  49914. // subs aren't sorted in scheduler if not running async
  49915. // we need to sort them now to make sure they fire in correct
  49916. // order
  49917. subs.sort(function (a, b) { return a.id - b.id; });
  49918. }
  49919. for (var i = 0, l = subs.length; i < l; i++) {
  49920. subs[i].update();
  49921. }
  49922. };
  49923. // The current target watcher being evaluated.
  49924. // This is globally unique because only one watcher
  49925. // can be evaluated at a time.
  49926. Dep.target = null;
  49927. var targetStack = [];
  49928. function pushTarget (target) {
  49929. targetStack.push(target);
  49930. Dep.target = target;
  49931. }
  49932. function popTarget () {
  49933. targetStack.pop();
  49934. Dep.target = targetStack[targetStack.length - 1];
  49935. }
  49936. /* */
  49937. var VNode = function VNode (
  49938. tag,
  49939. data,
  49940. children,
  49941. text,
  49942. elm,
  49943. context,
  49944. componentOptions,
  49945. asyncFactory
  49946. ) {
  49947. this.tag = tag;
  49948. this.data = data;
  49949. this.children = children;
  49950. this.text = text;
  49951. this.elm = elm;
  49952. this.ns = undefined;
  49953. this.context = context;
  49954. this.fnContext = undefined;
  49955. this.fnOptions = undefined;
  49956. this.fnScopeId = undefined;
  49957. this.key = data && data.key;
  49958. this.componentOptions = componentOptions;
  49959. this.componentInstance = undefined;
  49960. this.parent = undefined;
  49961. this.raw = false;
  49962. this.isStatic = false;
  49963. this.isRootInsert = true;
  49964. this.isComment = false;
  49965. this.isCloned = false;
  49966. this.isOnce = false;
  49967. this.asyncFactory = asyncFactory;
  49968. this.asyncMeta = undefined;
  49969. this.isAsyncPlaceholder = false;
  49970. };
  49971. var prototypeAccessors = { child: { configurable: true } };
  49972. // DEPRECATED: alias for componentInstance for backwards compat.
  49973. /* istanbul ignore next */
  49974. prototypeAccessors.child.get = function () {
  49975. return this.componentInstance
  49976. };
  49977. Object.defineProperties( VNode.prototype, prototypeAccessors );
  49978. var createEmptyVNode = function (text) {
  49979. if ( text === void 0 ) text = '';
  49980. var node = new VNode();
  49981. node.text = text;
  49982. node.isComment = true;
  49983. return node
  49984. };
  49985. function createTextVNode (val) {
  49986. return new VNode(undefined, undefined, undefined, String(val))
  49987. }
  49988. // optimized shallow clone
  49989. // used for static nodes and slot nodes because they may be reused across
  49990. // multiple renders, cloning them avoids errors when DOM manipulations rely
  49991. // on their elm reference.
  49992. function cloneVNode (vnode) {
  49993. var cloned = new VNode(
  49994. vnode.tag,
  49995. vnode.data,
  49996. // #7975
  49997. // clone children array to avoid mutating original in case of cloning
  49998. // a child.
  49999. vnode.children && vnode.children.slice(),
  50000. vnode.text,
  50001. vnode.elm,
  50002. vnode.context,
  50003. vnode.componentOptions,
  50004. vnode.asyncFactory
  50005. );
  50006. cloned.ns = vnode.ns;
  50007. cloned.isStatic = vnode.isStatic;
  50008. cloned.key = vnode.key;
  50009. cloned.isComment = vnode.isComment;
  50010. cloned.fnContext = vnode.fnContext;
  50011. cloned.fnOptions = vnode.fnOptions;
  50012. cloned.fnScopeId = vnode.fnScopeId;
  50013. cloned.asyncMeta = vnode.asyncMeta;
  50014. cloned.isCloned = true;
  50015. return cloned
  50016. }
  50017. /*
  50018. * not type checking this file because flow doesn't play well with
  50019. * dynamically accessing methods on Array prototype
  50020. */
  50021. var arrayProto = Array.prototype;
  50022. var arrayMethods = Object.create(arrayProto);
  50023. var methodsToPatch = [
  50024. 'push',
  50025. 'pop',
  50026. 'shift',
  50027. 'unshift',
  50028. 'splice',
  50029. 'sort',
  50030. 'reverse'
  50031. ];
  50032. /**
  50033. * Intercept mutating methods and emit events
  50034. */
  50035. methodsToPatch.forEach(function (method) {
  50036. // cache original method
  50037. var original = arrayProto[method];
  50038. def(arrayMethods, method, function mutator () {
  50039. var args = [], len = arguments.length;
  50040. while ( len-- ) args[ len ] = arguments[ len ];
  50041. var result = original.apply(this, args);
  50042. var ob = this.__ob__;
  50043. var inserted;
  50044. switch (method) {
  50045. case 'push':
  50046. case 'unshift':
  50047. inserted = args;
  50048. break
  50049. case 'splice':
  50050. inserted = args.slice(2);
  50051. break
  50052. }
  50053. if (inserted) { ob.observeArray(inserted); }
  50054. // notify change
  50055. ob.dep.notify();
  50056. return result
  50057. });
  50058. });
  50059. /* */
  50060. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  50061. /**
  50062. * In some cases we may want to disable observation inside a component's
  50063. * update computation.
  50064. */
  50065. var shouldObserve = true;
  50066. function toggleObserving (value) {
  50067. shouldObserve = value;
  50068. }
  50069. /**
  50070. * Observer class that is attached to each observed
  50071. * object. Once attached, the observer converts the target
  50072. * object's property keys into getter/setters that
  50073. * collect dependencies and dispatch updates.
  50074. */
  50075. var Observer = function Observer (value) {
  50076. this.value = value;
  50077. this.dep = new Dep();
  50078. this.vmCount = 0;
  50079. def(value, '__ob__', this);
  50080. if (Array.isArray(value)) {
  50081. if (hasProto) {
  50082. protoAugment(value, arrayMethods);
  50083. } else {
  50084. copyAugment(value, arrayMethods, arrayKeys);
  50085. }
  50086. this.observeArray(value);
  50087. } else {
  50088. this.walk(value);
  50089. }
  50090. };
  50091. /**
  50092. * Walk through all properties and convert them into
  50093. * getter/setters. This method should only be called when
  50094. * value type is Object.
  50095. */
  50096. Observer.prototype.walk = function walk (obj) {
  50097. var keys = Object.keys(obj);
  50098. for (var i = 0; i < keys.length; i++) {
  50099. defineReactive$$1(obj, keys[i]);
  50100. }
  50101. };
  50102. /**
  50103. * Observe a list of Array items.
  50104. */
  50105. Observer.prototype.observeArray = function observeArray (items) {
  50106. for (var i = 0, l = items.length; i < l; i++) {
  50107. observe(items[i]);
  50108. }
  50109. };
  50110. // helpers
  50111. /**
  50112. * Augment a target Object or Array by intercepting
  50113. * the prototype chain using __proto__
  50114. */
  50115. function protoAugment (target, src) {
  50116. /* eslint-disable no-proto */
  50117. target.__proto__ = src;
  50118. /* eslint-enable no-proto */
  50119. }
  50120. /**
  50121. * Augment a target Object or Array by defining
  50122. * hidden properties.
  50123. */
  50124. /* istanbul ignore next */
  50125. function copyAugment (target, src, keys) {
  50126. for (var i = 0, l = keys.length; i < l; i++) {
  50127. var key = keys[i];
  50128. def(target, key, src[key]);
  50129. }
  50130. }
  50131. /**
  50132. * Attempt to create an observer instance for a value,
  50133. * returns the new observer if successfully observed,
  50134. * or the existing observer if the value already has one.
  50135. */
  50136. function observe (value, asRootData) {
  50137. if (!isObject(value) || value instanceof VNode) {
  50138. return
  50139. }
  50140. var ob;
  50141. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  50142. ob = value.__ob__;
  50143. } else if (
  50144. shouldObserve &&
  50145. !isServerRendering() &&
  50146. (Array.isArray(value) || isPlainObject(value)) &&
  50147. Object.isExtensible(value) &&
  50148. !value._isVue
  50149. ) {
  50150. ob = new Observer(value);
  50151. }
  50152. if (asRootData && ob) {
  50153. ob.vmCount++;
  50154. }
  50155. return ob
  50156. }
  50157. /**
  50158. * Define a reactive property on an Object.
  50159. */
  50160. function defineReactive$$1 (
  50161. obj,
  50162. key,
  50163. val,
  50164. customSetter,
  50165. shallow
  50166. ) {
  50167. var dep = new Dep();
  50168. var property = Object.getOwnPropertyDescriptor(obj, key);
  50169. if (property && property.configurable === false) {
  50170. return
  50171. }
  50172. // cater for pre-defined getter/setters
  50173. var getter = property && property.get;
  50174. var setter = property && property.set;
  50175. if ((!getter || setter) && arguments.length === 2) {
  50176. val = obj[key];
  50177. }
  50178. var childOb = !shallow && observe(val);
  50179. Object.defineProperty(obj, key, {
  50180. enumerable: true,
  50181. configurable: true,
  50182. get: function reactiveGetter () {
  50183. var value = getter ? getter.call(obj) : val;
  50184. if (Dep.target) {
  50185. dep.depend();
  50186. if (childOb) {
  50187. childOb.dep.depend();
  50188. if (Array.isArray(value)) {
  50189. dependArray(value);
  50190. }
  50191. }
  50192. }
  50193. return value
  50194. },
  50195. set: function reactiveSetter (newVal) {
  50196. var value = getter ? getter.call(obj) : val;
  50197. /* eslint-disable no-self-compare */
  50198. if (newVal === value || (newVal !== newVal && value !== value)) {
  50199. return
  50200. }
  50201. /* eslint-enable no-self-compare */
  50202. if (customSetter) {
  50203. customSetter();
  50204. }
  50205. // #7981: for accessor properties without setter
  50206. if (getter && !setter) { return }
  50207. if (setter) {
  50208. setter.call(obj, newVal);
  50209. } else {
  50210. val = newVal;
  50211. }
  50212. childOb = !shallow && observe(newVal);
  50213. dep.notify();
  50214. }
  50215. });
  50216. }
  50217. /**
  50218. * Set a property on an object. Adds the new property and
  50219. * triggers change notification if the property doesn't
  50220. * already exist.
  50221. */
  50222. function set (target, key, val) {
  50223. if (isUndef(target) || isPrimitive(target)
  50224. ) {
  50225. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  50226. }
  50227. if (Array.isArray(target) && isValidArrayIndex(key)) {
  50228. target.length = Math.max(target.length, key);
  50229. target.splice(key, 1, val);
  50230. return val
  50231. }
  50232. if (key in target && !(key in Object.prototype)) {
  50233. target[key] = val;
  50234. return val
  50235. }
  50236. var ob = (target).__ob__;
  50237. if (target._isVue || (ob && ob.vmCount)) {
  50238. warn(
  50239. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  50240. 'at runtime - declare it upfront in the data option.'
  50241. );
  50242. return val
  50243. }
  50244. if (!ob) {
  50245. target[key] = val;
  50246. return val
  50247. }
  50248. defineReactive$$1(ob.value, key, val);
  50249. ob.dep.notify();
  50250. return val
  50251. }
  50252. /**
  50253. * Delete a property and trigger change if necessary.
  50254. */
  50255. function del (target, key) {
  50256. if (isUndef(target) || isPrimitive(target)
  50257. ) {
  50258. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  50259. }
  50260. if (Array.isArray(target) && isValidArrayIndex(key)) {
  50261. target.splice(key, 1);
  50262. return
  50263. }
  50264. var ob = (target).__ob__;
  50265. if (target._isVue || (ob && ob.vmCount)) {
  50266. warn(
  50267. 'Avoid deleting properties on a Vue instance or its root $data ' +
  50268. '- just set it to null.'
  50269. );
  50270. return
  50271. }
  50272. if (!hasOwn(target, key)) {
  50273. return
  50274. }
  50275. delete target[key];
  50276. if (!ob) {
  50277. return
  50278. }
  50279. ob.dep.notify();
  50280. }
  50281. /**
  50282. * Collect dependencies on array elements when the array is touched, since
  50283. * we cannot intercept array element access like property getters.
  50284. */
  50285. function dependArray (value) {
  50286. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  50287. e = value[i];
  50288. e && e.__ob__ && e.__ob__.dep.depend();
  50289. if (Array.isArray(e)) {
  50290. dependArray(e);
  50291. }
  50292. }
  50293. }
  50294. /* */
  50295. /**
  50296. * Option overwriting strategies are functions that handle
  50297. * how to merge a parent option value and a child option
  50298. * value into the final value.
  50299. */
  50300. var strats = config.optionMergeStrategies;
  50301. /**
  50302. * Options with restrictions
  50303. */
  50304. {
  50305. strats.el = strats.propsData = function (parent, child, vm, key) {
  50306. if (!vm) {
  50307. warn(
  50308. "option \"" + key + "\" can only be used during instance " +
  50309. 'creation with the `new` keyword.'
  50310. );
  50311. }
  50312. return defaultStrat(parent, child)
  50313. };
  50314. }
  50315. /**
  50316. * Helper that recursively merges two data objects together.
  50317. */
  50318. function mergeData (to, from) {
  50319. if (!from) { return to }
  50320. var key, toVal, fromVal;
  50321. var keys = hasSymbol
  50322. ? Reflect.ownKeys(from)
  50323. : Object.keys(from);
  50324. for (var i = 0; i < keys.length; i++) {
  50325. key = keys[i];
  50326. // in case the object is already observed...
  50327. if (key === '__ob__') { continue }
  50328. toVal = to[key];
  50329. fromVal = from[key];
  50330. if (!hasOwn(to, key)) {
  50331. set(to, key, fromVal);
  50332. } else if (
  50333. toVal !== fromVal &&
  50334. isPlainObject(toVal) &&
  50335. isPlainObject(fromVal)
  50336. ) {
  50337. mergeData(toVal, fromVal);
  50338. }
  50339. }
  50340. return to
  50341. }
  50342. /**
  50343. * Data
  50344. */
  50345. function mergeDataOrFn (
  50346. parentVal,
  50347. childVal,
  50348. vm
  50349. ) {
  50350. if (!vm) {
  50351. // in a Vue.extend merge, both should be functions
  50352. if (!childVal) {
  50353. return parentVal
  50354. }
  50355. if (!parentVal) {
  50356. return childVal
  50357. }
  50358. // when parentVal & childVal are both present,
  50359. // we need to return a function that returns the
  50360. // merged result of both functions... no need to
  50361. // check if parentVal is a function here because
  50362. // it has to be a function to pass previous merges.
  50363. return function mergedDataFn () {
  50364. return mergeData(
  50365. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  50366. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  50367. )
  50368. }
  50369. } else {
  50370. return function mergedInstanceDataFn () {
  50371. // instance merge
  50372. var instanceData = typeof childVal === 'function'
  50373. ? childVal.call(vm, vm)
  50374. : childVal;
  50375. var defaultData = typeof parentVal === 'function'
  50376. ? parentVal.call(vm, vm)
  50377. : parentVal;
  50378. if (instanceData) {
  50379. return mergeData(instanceData, defaultData)
  50380. } else {
  50381. return defaultData
  50382. }
  50383. }
  50384. }
  50385. }
  50386. strats.data = function (
  50387. parentVal,
  50388. childVal,
  50389. vm
  50390. ) {
  50391. if (!vm) {
  50392. if (childVal && typeof childVal !== 'function') {
  50393. warn(
  50394. 'The "data" option should be a function ' +
  50395. 'that returns a per-instance value in component ' +
  50396. 'definitions.',
  50397. vm
  50398. );
  50399. return parentVal
  50400. }
  50401. return mergeDataOrFn(parentVal, childVal)
  50402. }
  50403. return mergeDataOrFn(parentVal, childVal, vm)
  50404. };
  50405. /**
  50406. * Hooks and props are merged as arrays.
  50407. */
  50408. function mergeHook (
  50409. parentVal,
  50410. childVal
  50411. ) {
  50412. var res = childVal
  50413. ? parentVal
  50414. ? parentVal.concat(childVal)
  50415. : Array.isArray(childVal)
  50416. ? childVal
  50417. : [childVal]
  50418. : parentVal;
  50419. return res
  50420. ? dedupeHooks(res)
  50421. : res
  50422. }
  50423. function dedupeHooks (hooks) {
  50424. var res = [];
  50425. for (var i = 0; i < hooks.length; i++) {
  50426. if (res.indexOf(hooks[i]) === -1) {
  50427. res.push(hooks[i]);
  50428. }
  50429. }
  50430. return res
  50431. }
  50432. LIFECYCLE_HOOKS.forEach(function (hook) {
  50433. strats[hook] = mergeHook;
  50434. });
  50435. /**
  50436. * Assets
  50437. *
  50438. * When a vm is present (instance creation), we need to do
  50439. * a three-way merge between constructor options, instance
  50440. * options and parent options.
  50441. */
  50442. function mergeAssets (
  50443. parentVal,
  50444. childVal,
  50445. vm,
  50446. key
  50447. ) {
  50448. var res = Object.create(parentVal || null);
  50449. if (childVal) {
  50450. assertObjectType(key, childVal, vm);
  50451. return extend(res, childVal)
  50452. } else {
  50453. return res
  50454. }
  50455. }
  50456. ASSET_TYPES.forEach(function (type) {
  50457. strats[type + 's'] = mergeAssets;
  50458. });
  50459. /**
  50460. * Watchers.
  50461. *
  50462. * Watchers hashes should not overwrite one
  50463. * another, so we merge them as arrays.
  50464. */
  50465. strats.watch = function (
  50466. parentVal,
  50467. childVal,
  50468. vm,
  50469. key
  50470. ) {
  50471. // work around Firefox's Object.prototype.watch...
  50472. if (parentVal === nativeWatch) { parentVal = undefined; }
  50473. if (childVal === nativeWatch) { childVal = undefined; }
  50474. /* istanbul ignore if */
  50475. if (!childVal) { return Object.create(parentVal || null) }
  50476. {
  50477. assertObjectType(key, childVal, vm);
  50478. }
  50479. if (!parentVal) { return childVal }
  50480. var ret = {};
  50481. extend(ret, parentVal);
  50482. for (var key$1 in childVal) {
  50483. var parent = ret[key$1];
  50484. var child = childVal[key$1];
  50485. if (parent && !Array.isArray(parent)) {
  50486. parent = [parent];
  50487. }
  50488. ret[key$1] = parent
  50489. ? parent.concat(child)
  50490. : Array.isArray(child) ? child : [child];
  50491. }
  50492. return ret
  50493. };
  50494. /**
  50495. * Other object hashes.
  50496. */
  50497. strats.props =
  50498. strats.methods =
  50499. strats.inject =
  50500. strats.computed = function (
  50501. parentVal,
  50502. childVal,
  50503. vm,
  50504. key
  50505. ) {
  50506. if (childVal && "development" !== 'production') {
  50507. assertObjectType(key, childVal, vm);
  50508. }
  50509. if (!parentVal) { return childVal }
  50510. var ret = Object.create(null);
  50511. extend(ret, parentVal);
  50512. if (childVal) { extend(ret, childVal); }
  50513. return ret
  50514. };
  50515. strats.provide = mergeDataOrFn;
  50516. /**
  50517. * Default strategy.
  50518. */
  50519. var defaultStrat = function (parentVal, childVal) {
  50520. return childVal === undefined
  50521. ? parentVal
  50522. : childVal
  50523. };
  50524. /**
  50525. * Validate component names
  50526. */
  50527. function checkComponents (options) {
  50528. for (var key in options.components) {
  50529. validateComponentName(key);
  50530. }
  50531. }
  50532. function validateComponentName (name) {
  50533. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  50534. warn(
  50535. 'Invalid component name: "' + name + '". Component names ' +
  50536. 'should conform to valid custom element name in html5 specification.'
  50537. );
  50538. }
  50539. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  50540. warn(
  50541. 'Do not use built-in or reserved HTML elements as component ' +
  50542. 'id: ' + name
  50543. );
  50544. }
  50545. }
  50546. /**
  50547. * Ensure all props option syntax are normalized into the
  50548. * Object-based format.
  50549. */
  50550. function normalizeProps (options, vm) {
  50551. var props = options.props;
  50552. if (!props) { return }
  50553. var res = {};
  50554. var i, val, name;
  50555. if (Array.isArray(props)) {
  50556. i = props.length;
  50557. while (i--) {
  50558. val = props[i];
  50559. if (typeof val === 'string') {
  50560. name = camelize(val);
  50561. res[name] = { type: null };
  50562. } else {
  50563. warn('props must be strings when using array syntax.');
  50564. }
  50565. }
  50566. } else if (isPlainObject(props)) {
  50567. for (var key in props) {
  50568. val = props[key];
  50569. name = camelize(key);
  50570. res[name] = isPlainObject(val)
  50571. ? val
  50572. : { type: val };
  50573. }
  50574. } else {
  50575. warn(
  50576. "Invalid value for option \"props\": expected an Array or an Object, " +
  50577. "but got " + (toRawType(props)) + ".",
  50578. vm
  50579. );
  50580. }
  50581. options.props = res;
  50582. }
  50583. /**
  50584. * Normalize all injections into Object-based format
  50585. */
  50586. function normalizeInject (options, vm) {
  50587. var inject = options.inject;
  50588. if (!inject) { return }
  50589. var normalized = options.inject = {};
  50590. if (Array.isArray(inject)) {
  50591. for (var i = 0; i < inject.length; i++) {
  50592. normalized[inject[i]] = { from: inject[i] };
  50593. }
  50594. } else if (isPlainObject(inject)) {
  50595. for (var key in inject) {
  50596. var val = inject[key];
  50597. normalized[key] = isPlainObject(val)
  50598. ? extend({ from: key }, val)
  50599. : { from: val };
  50600. }
  50601. } else {
  50602. warn(
  50603. "Invalid value for option \"inject\": expected an Array or an Object, " +
  50604. "but got " + (toRawType(inject)) + ".",
  50605. vm
  50606. );
  50607. }
  50608. }
  50609. /**
  50610. * Normalize raw function directives into object format.
  50611. */
  50612. function normalizeDirectives (options) {
  50613. var dirs = options.directives;
  50614. if (dirs) {
  50615. for (var key in dirs) {
  50616. var def$$1 = dirs[key];
  50617. if (typeof def$$1 === 'function') {
  50618. dirs[key] = { bind: def$$1, update: def$$1 };
  50619. }
  50620. }
  50621. }
  50622. }
  50623. function assertObjectType (name, value, vm) {
  50624. if (!isPlainObject(value)) {
  50625. warn(
  50626. "Invalid value for option \"" + name + "\": expected an Object, " +
  50627. "but got " + (toRawType(value)) + ".",
  50628. vm
  50629. );
  50630. }
  50631. }
  50632. /**
  50633. * Merge two option objects into a new one.
  50634. * Core utility used in both instantiation and inheritance.
  50635. */
  50636. function mergeOptions (
  50637. parent,
  50638. child,
  50639. vm
  50640. ) {
  50641. {
  50642. checkComponents(child);
  50643. }
  50644. if (typeof child === 'function') {
  50645. child = child.options;
  50646. }
  50647. normalizeProps(child, vm);
  50648. normalizeInject(child, vm);
  50649. normalizeDirectives(child);
  50650. // Apply extends and mixins on the child options,
  50651. // but only if it is a raw options object that isn't
  50652. // the result of another mergeOptions call.
  50653. // Only merged options has the _base property.
  50654. if (!child._base) {
  50655. if (child.extends) {
  50656. parent = mergeOptions(parent, child.extends, vm);
  50657. }
  50658. if (child.mixins) {
  50659. for (var i = 0, l = child.mixins.length; i < l; i++) {
  50660. parent = mergeOptions(parent, child.mixins[i], vm);
  50661. }
  50662. }
  50663. }
  50664. var options = {};
  50665. var key;
  50666. for (key in parent) {
  50667. mergeField(key);
  50668. }
  50669. for (key in child) {
  50670. if (!hasOwn(parent, key)) {
  50671. mergeField(key);
  50672. }
  50673. }
  50674. function mergeField (key) {
  50675. var strat = strats[key] || defaultStrat;
  50676. options[key] = strat(parent[key], child[key], vm, key);
  50677. }
  50678. return options
  50679. }
  50680. /**
  50681. * Resolve an asset.
  50682. * This function is used because child instances need access
  50683. * to assets defined in its ancestor chain.
  50684. */
  50685. function resolveAsset (
  50686. options,
  50687. type,
  50688. id,
  50689. warnMissing
  50690. ) {
  50691. /* istanbul ignore if */
  50692. if (typeof id !== 'string') {
  50693. return
  50694. }
  50695. var assets = options[type];
  50696. // check local registration variations first
  50697. if (hasOwn(assets, id)) { return assets[id] }
  50698. var camelizedId = camelize(id);
  50699. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  50700. var PascalCaseId = capitalize(camelizedId);
  50701. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  50702. // fallback to prototype chain
  50703. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  50704. if (warnMissing && !res) {
  50705. warn(
  50706. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  50707. options
  50708. );
  50709. }
  50710. return res
  50711. }
  50712. /* */
  50713. function validateProp (
  50714. key,
  50715. propOptions,
  50716. propsData,
  50717. vm
  50718. ) {
  50719. var prop = propOptions[key];
  50720. var absent = !hasOwn(propsData, key);
  50721. var value = propsData[key];
  50722. // boolean casting
  50723. var booleanIndex = getTypeIndex(Boolean, prop.type);
  50724. if (booleanIndex > -1) {
  50725. if (absent && !hasOwn(prop, 'default')) {
  50726. value = false;
  50727. } else if (value === '' || value === hyphenate(key)) {
  50728. // only cast empty string / same name to boolean if
  50729. // boolean has higher priority
  50730. var stringIndex = getTypeIndex(String, prop.type);
  50731. if (stringIndex < 0 || booleanIndex < stringIndex) {
  50732. value = true;
  50733. }
  50734. }
  50735. }
  50736. // check default value
  50737. if (value === undefined) {
  50738. value = getPropDefaultValue(vm, prop, key);
  50739. // since the default value is a fresh copy,
  50740. // make sure to observe it.
  50741. var prevShouldObserve = shouldObserve;
  50742. toggleObserving(true);
  50743. observe(value);
  50744. toggleObserving(prevShouldObserve);
  50745. }
  50746. {
  50747. assertProp(prop, key, value, vm, absent);
  50748. }
  50749. return value
  50750. }
  50751. /**
  50752. * Get the default value of a prop.
  50753. */
  50754. function getPropDefaultValue (vm, prop, key) {
  50755. // no default, return undefined
  50756. if (!hasOwn(prop, 'default')) {
  50757. return undefined
  50758. }
  50759. var def = prop.default;
  50760. // warn against non-factory defaults for Object & Array
  50761. if (isObject(def)) {
  50762. warn(
  50763. 'Invalid default value for prop "' + key + '": ' +
  50764. 'Props with type Object/Array must use a factory function ' +
  50765. 'to return the default value.',
  50766. vm
  50767. );
  50768. }
  50769. // the raw prop value was also undefined from previous render,
  50770. // return previous default value to avoid unnecessary watcher trigger
  50771. if (vm && vm.$options.propsData &&
  50772. vm.$options.propsData[key] === undefined &&
  50773. vm._props[key] !== undefined
  50774. ) {
  50775. return vm._props[key]
  50776. }
  50777. // call factory function for non-Function types
  50778. // a value is Function if its prototype is function even across different execution context
  50779. return typeof def === 'function' && getType(prop.type) !== 'Function'
  50780. ? def.call(vm)
  50781. : def
  50782. }
  50783. /**
  50784. * Assert whether a prop is valid.
  50785. */
  50786. function assertProp (
  50787. prop,
  50788. name,
  50789. value,
  50790. vm,
  50791. absent
  50792. ) {
  50793. if (prop.required && absent) {
  50794. warn(
  50795. 'Missing required prop: "' + name + '"',
  50796. vm
  50797. );
  50798. return
  50799. }
  50800. if (value == null && !prop.required) {
  50801. return
  50802. }
  50803. var type = prop.type;
  50804. var valid = !type || type === true;
  50805. var expectedTypes = [];
  50806. if (type) {
  50807. if (!Array.isArray(type)) {
  50808. type = [type];
  50809. }
  50810. for (var i = 0; i < type.length && !valid; i++) {
  50811. var assertedType = assertType(value, type[i]);
  50812. expectedTypes.push(assertedType.expectedType || '');
  50813. valid = assertedType.valid;
  50814. }
  50815. }
  50816. if (!valid) {
  50817. warn(
  50818. getInvalidTypeMessage(name, value, expectedTypes),
  50819. vm
  50820. );
  50821. return
  50822. }
  50823. var validator = prop.validator;
  50824. if (validator) {
  50825. if (!validator(value)) {
  50826. warn(
  50827. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  50828. vm
  50829. );
  50830. }
  50831. }
  50832. }
  50833. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  50834. function assertType (value, type) {
  50835. var valid;
  50836. var expectedType = getType(type);
  50837. if (simpleCheckRE.test(expectedType)) {
  50838. var t = typeof value;
  50839. valid = t === expectedType.toLowerCase();
  50840. // for primitive wrapper objects
  50841. if (!valid && t === 'object') {
  50842. valid = value instanceof type;
  50843. }
  50844. } else if (expectedType === 'Object') {
  50845. valid = isPlainObject(value);
  50846. } else if (expectedType === 'Array') {
  50847. valid = Array.isArray(value);
  50848. } else {
  50849. valid = value instanceof type;
  50850. }
  50851. return {
  50852. valid: valid,
  50853. expectedType: expectedType
  50854. }
  50855. }
  50856. /**
  50857. * Use function string name to check built-in types,
  50858. * because a simple equality check will fail when running
  50859. * across different vms / iframes.
  50860. */
  50861. function getType (fn) {
  50862. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  50863. return match ? match[1] : ''
  50864. }
  50865. function isSameType (a, b) {
  50866. return getType(a) === getType(b)
  50867. }
  50868. function getTypeIndex (type, expectedTypes) {
  50869. if (!Array.isArray(expectedTypes)) {
  50870. return isSameType(expectedTypes, type) ? 0 : -1
  50871. }
  50872. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  50873. if (isSameType(expectedTypes[i], type)) {
  50874. return i
  50875. }
  50876. }
  50877. return -1
  50878. }
  50879. function getInvalidTypeMessage (name, value, expectedTypes) {
  50880. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  50881. " Expected " + (expectedTypes.map(capitalize).join(', '));
  50882. var expectedType = expectedTypes[0];
  50883. var receivedType = toRawType(value);
  50884. var expectedValue = styleValue(value, expectedType);
  50885. var receivedValue = styleValue(value, receivedType);
  50886. // check if we need to specify expected value
  50887. if (expectedTypes.length === 1 &&
  50888. isExplicable(expectedType) &&
  50889. !isBoolean(expectedType, receivedType)) {
  50890. message += " with value " + expectedValue;
  50891. }
  50892. message += ", got " + receivedType + " ";
  50893. // check if we need to specify received value
  50894. if (isExplicable(receivedType)) {
  50895. message += "with value " + receivedValue + ".";
  50896. }
  50897. return message
  50898. }
  50899. function styleValue (value, type) {
  50900. if (type === 'String') {
  50901. return ("\"" + value + "\"")
  50902. } else if (type === 'Number') {
  50903. return ("" + (Number(value)))
  50904. } else {
  50905. return ("" + value)
  50906. }
  50907. }
  50908. function isExplicable (value) {
  50909. var explicitTypes = ['string', 'number', 'boolean'];
  50910. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  50911. }
  50912. function isBoolean () {
  50913. var args = [], len = arguments.length;
  50914. while ( len-- ) args[ len ] = arguments[ len ];
  50915. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  50916. }
  50917. /* */
  50918. function handleError (err, vm, info) {
  50919. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  50920. // See: https://github.com/vuejs/vuex/issues/1505
  50921. pushTarget();
  50922. try {
  50923. if (vm) {
  50924. var cur = vm;
  50925. while ((cur = cur.$parent)) {
  50926. var hooks = cur.$options.errorCaptured;
  50927. if (hooks) {
  50928. for (var i = 0; i < hooks.length; i++) {
  50929. try {
  50930. var capture = hooks[i].call(cur, err, vm, info) === false;
  50931. if (capture) { return }
  50932. } catch (e) {
  50933. globalHandleError(e, cur, 'errorCaptured hook');
  50934. }
  50935. }
  50936. }
  50937. }
  50938. }
  50939. globalHandleError(err, vm, info);
  50940. } finally {
  50941. popTarget();
  50942. }
  50943. }
  50944. function invokeWithErrorHandling (
  50945. handler,
  50946. context,
  50947. args,
  50948. vm,
  50949. info
  50950. ) {
  50951. var res;
  50952. try {
  50953. res = args ? handler.apply(context, args) : handler.call(context);
  50954. if (res && !res._isVue && isPromise(res) && !res._handled) {
  50955. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  50956. // issue #9511
  50957. // avoid catch triggering multiple times when nested calls
  50958. res._handled = true;
  50959. }
  50960. } catch (e) {
  50961. handleError(e, vm, info);
  50962. }
  50963. return res
  50964. }
  50965. function globalHandleError (err, vm, info) {
  50966. if (config.errorHandler) {
  50967. try {
  50968. return config.errorHandler.call(null, err, vm, info)
  50969. } catch (e) {
  50970. // if the user intentionally throws the original error in the handler,
  50971. // do not log it twice
  50972. if (e !== err) {
  50973. logError(e, null, 'config.errorHandler');
  50974. }
  50975. }
  50976. }
  50977. logError(err, vm, info);
  50978. }
  50979. function logError (err, vm, info) {
  50980. {
  50981. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  50982. }
  50983. /* istanbul ignore else */
  50984. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  50985. console.error(err);
  50986. } else {
  50987. throw err
  50988. }
  50989. }
  50990. /* */
  50991. var isUsingMicroTask = false;
  50992. var callbacks = [];
  50993. var pending = false;
  50994. function flushCallbacks () {
  50995. pending = false;
  50996. var copies = callbacks.slice(0);
  50997. callbacks.length = 0;
  50998. for (var i = 0; i < copies.length; i++) {
  50999. copies[i]();
  51000. }
  51001. }
  51002. // Here we have async deferring wrappers using microtasks.
  51003. // In 2.5 we used (macro) tasks (in combination with microtasks).
  51004. // However, it has subtle problems when state is changed right before repaint
  51005. // (e.g. #6813, out-in transitions).
  51006. // Also, using (macro) tasks in event handler would cause some weird behaviors
  51007. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  51008. // So we now use microtasks everywhere, again.
  51009. // A major drawback of this tradeoff is that there are some scenarios
  51010. // where microtasks have too high a priority and fire in between supposedly
  51011. // sequential events (e.g. #4521, #6690, which have workarounds)
  51012. // or even between bubbling of the same event (#6566).
  51013. var timerFunc;
  51014. // The nextTick behavior leverages the microtask queue, which can be accessed
  51015. // via either native Promise.then or MutationObserver.
  51016. // MutationObserver has wider support, however it is seriously bugged in
  51017. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  51018. // completely stops working after triggering a few times... so, if native
  51019. // Promise is available, we will use it:
  51020. /* istanbul ignore next, $flow-disable-line */
  51021. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  51022. var p = Promise.resolve();
  51023. timerFunc = function () {
  51024. p.then(flushCallbacks);
  51025. // In problematic UIWebViews, Promise.then doesn't completely break, but
  51026. // it can get stuck in a weird state where callbacks are pushed into the
  51027. // microtask queue but the queue isn't being flushed, until the browser
  51028. // needs to do some other work, e.g. handle a timer. Therefore we can
  51029. // "force" the microtask queue to be flushed by adding an empty timer.
  51030. if (isIOS) { setTimeout(noop); }
  51031. };
  51032. isUsingMicroTask = true;
  51033. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  51034. isNative(MutationObserver) ||
  51035. // PhantomJS and iOS 7.x
  51036. MutationObserver.toString() === '[object MutationObserverConstructor]'
  51037. )) {
  51038. // Use MutationObserver where native Promise is not available,
  51039. // e.g. PhantomJS, iOS7, Android 4.4
  51040. // (#6466 MutationObserver is unreliable in IE11)
  51041. var counter = 1;
  51042. var observer = new MutationObserver(flushCallbacks);
  51043. var textNode = document.createTextNode(String(counter));
  51044. observer.observe(textNode, {
  51045. characterData: true
  51046. });
  51047. timerFunc = function () {
  51048. counter = (counter + 1) % 2;
  51049. textNode.data = String(counter);
  51050. };
  51051. isUsingMicroTask = true;
  51052. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  51053. // Fallback to setImmediate.
  51054. // Technically it leverages the (macro) task queue,
  51055. // but it is still a better choice than setTimeout.
  51056. timerFunc = function () {
  51057. setImmediate(flushCallbacks);
  51058. };
  51059. } else {
  51060. // Fallback to setTimeout.
  51061. timerFunc = function () {
  51062. setTimeout(flushCallbacks, 0);
  51063. };
  51064. }
  51065. function nextTick (cb, ctx) {
  51066. var _resolve;
  51067. callbacks.push(function () {
  51068. if (cb) {
  51069. try {
  51070. cb.call(ctx);
  51071. } catch (e) {
  51072. handleError(e, ctx, 'nextTick');
  51073. }
  51074. } else if (_resolve) {
  51075. _resolve(ctx);
  51076. }
  51077. });
  51078. if (!pending) {
  51079. pending = true;
  51080. timerFunc();
  51081. }
  51082. // $flow-disable-line
  51083. if (!cb && typeof Promise !== 'undefined') {
  51084. return new Promise(function (resolve) {
  51085. _resolve = resolve;
  51086. })
  51087. }
  51088. }
  51089. /* */
  51090. var mark;
  51091. var measure;
  51092. {
  51093. var perf = inBrowser && window.performance;
  51094. /* istanbul ignore if */
  51095. if (
  51096. perf &&
  51097. perf.mark &&
  51098. perf.measure &&
  51099. perf.clearMarks &&
  51100. perf.clearMeasures
  51101. ) {
  51102. mark = function (tag) { return perf.mark(tag); };
  51103. measure = function (name, startTag, endTag) {
  51104. perf.measure(name, startTag, endTag);
  51105. perf.clearMarks(startTag);
  51106. perf.clearMarks(endTag);
  51107. // perf.clearMeasures(name)
  51108. };
  51109. }
  51110. }
  51111. /* not type checking this file because flow doesn't play well with Proxy */
  51112. var initProxy;
  51113. {
  51114. var allowedGlobals = makeMap(
  51115. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  51116. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  51117. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  51118. 'require' // for Webpack/Browserify
  51119. );
  51120. var warnNonPresent = function (target, key) {
  51121. warn(
  51122. "Property or method \"" + key + "\" is not defined on the instance but " +
  51123. 'referenced during render. Make sure that this property is reactive, ' +
  51124. 'either in the data option, or for class-based components, by ' +
  51125. 'initializing the property. ' +
  51126. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  51127. target
  51128. );
  51129. };
  51130. var warnReservedPrefix = function (target, key) {
  51131. warn(
  51132. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  51133. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  51134. 'prevent conflicts with Vue internals. ' +
  51135. 'See: https://vuejs.org/v2/api/#data',
  51136. target
  51137. );
  51138. };
  51139. var hasProxy =
  51140. typeof Proxy !== 'undefined' && isNative(Proxy);
  51141. if (hasProxy) {
  51142. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  51143. config.keyCodes = new Proxy(config.keyCodes, {
  51144. set: function set (target, key, value) {
  51145. if (isBuiltInModifier(key)) {
  51146. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  51147. return false
  51148. } else {
  51149. target[key] = value;
  51150. return true
  51151. }
  51152. }
  51153. });
  51154. }
  51155. var hasHandler = {
  51156. has: function has (target, key) {
  51157. var has = key in target;
  51158. var isAllowed = allowedGlobals(key) ||
  51159. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  51160. if (!has && !isAllowed) {
  51161. if (key in target.$data) { warnReservedPrefix(target, key); }
  51162. else { warnNonPresent(target, key); }
  51163. }
  51164. return has || !isAllowed
  51165. }
  51166. };
  51167. var getHandler = {
  51168. get: function get (target, key) {
  51169. if (typeof key === 'string' && !(key in target)) {
  51170. if (key in target.$data) { warnReservedPrefix(target, key); }
  51171. else { warnNonPresent(target, key); }
  51172. }
  51173. return target[key]
  51174. }
  51175. };
  51176. initProxy = function initProxy (vm) {
  51177. if (hasProxy) {
  51178. // determine which proxy handler to use
  51179. var options = vm.$options;
  51180. var handlers = options.render && options.render._withStripped
  51181. ? getHandler
  51182. : hasHandler;
  51183. vm._renderProxy = new Proxy(vm, handlers);
  51184. } else {
  51185. vm._renderProxy = vm;
  51186. }
  51187. };
  51188. }
  51189. /* */
  51190. var seenObjects = new _Set();
  51191. /**
  51192. * Recursively traverse an object to evoke all converted
  51193. * getters, so that every nested property inside the object
  51194. * is collected as a "deep" dependency.
  51195. */
  51196. function traverse (val) {
  51197. _traverse(val, seenObjects);
  51198. seenObjects.clear();
  51199. }
  51200. function _traverse (val, seen) {
  51201. var i, keys;
  51202. var isA = Array.isArray(val);
  51203. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  51204. return
  51205. }
  51206. if (val.__ob__) {
  51207. var depId = val.__ob__.dep.id;
  51208. if (seen.has(depId)) {
  51209. return
  51210. }
  51211. seen.add(depId);
  51212. }
  51213. if (isA) {
  51214. i = val.length;
  51215. while (i--) { _traverse(val[i], seen); }
  51216. } else {
  51217. keys = Object.keys(val);
  51218. i = keys.length;
  51219. while (i--) { _traverse(val[keys[i]], seen); }
  51220. }
  51221. }
  51222. /* */
  51223. var normalizeEvent = cached(function (name) {
  51224. var passive = name.charAt(0) === '&';
  51225. name = passive ? name.slice(1) : name;
  51226. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  51227. name = once$$1 ? name.slice(1) : name;
  51228. var capture = name.charAt(0) === '!';
  51229. name = capture ? name.slice(1) : name;
  51230. return {
  51231. name: name,
  51232. once: once$$1,
  51233. capture: capture,
  51234. passive: passive
  51235. }
  51236. });
  51237. function createFnInvoker (fns, vm) {
  51238. function invoker () {
  51239. var arguments$1 = arguments;
  51240. var fns = invoker.fns;
  51241. if (Array.isArray(fns)) {
  51242. var cloned = fns.slice();
  51243. for (var i = 0; i < cloned.length; i++) {
  51244. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  51245. }
  51246. } else {
  51247. // return handler return value for single handlers
  51248. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  51249. }
  51250. }
  51251. invoker.fns = fns;
  51252. return invoker
  51253. }
  51254. function updateListeners (
  51255. on,
  51256. oldOn,
  51257. add,
  51258. remove$$1,
  51259. createOnceHandler,
  51260. vm
  51261. ) {
  51262. var name, def$$1, cur, old, event;
  51263. for (name in on) {
  51264. def$$1 = cur = on[name];
  51265. old = oldOn[name];
  51266. event = normalizeEvent(name);
  51267. if (isUndef(cur)) {
  51268. warn(
  51269. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  51270. vm
  51271. );
  51272. } else if (isUndef(old)) {
  51273. if (isUndef(cur.fns)) {
  51274. cur = on[name] = createFnInvoker(cur, vm);
  51275. }
  51276. if (isTrue(event.once)) {
  51277. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  51278. }
  51279. add(event.name, cur, event.capture, event.passive, event.params);
  51280. } else if (cur !== old) {
  51281. old.fns = cur;
  51282. on[name] = old;
  51283. }
  51284. }
  51285. for (name in oldOn) {
  51286. if (isUndef(on[name])) {
  51287. event = normalizeEvent(name);
  51288. remove$$1(event.name, oldOn[name], event.capture);
  51289. }
  51290. }
  51291. }
  51292. /* */
  51293. function mergeVNodeHook (def, hookKey, hook) {
  51294. if (def instanceof VNode) {
  51295. def = def.data.hook || (def.data.hook = {});
  51296. }
  51297. var invoker;
  51298. var oldHook = def[hookKey];
  51299. function wrappedHook () {
  51300. hook.apply(this, arguments);
  51301. // important: remove merged hook to ensure it's called only once
  51302. // and prevent memory leak
  51303. remove(invoker.fns, wrappedHook);
  51304. }
  51305. if (isUndef(oldHook)) {
  51306. // no existing hook
  51307. invoker = createFnInvoker([wrappedHook]);
  51308. } else {
  51309. /* istanbul ignore if */
  51310. if (isDef(oldHook.fns) && isTrue(oldHook.merged)) {
  51311. // already a merged invoker
  51312. invoker = oldHook;
  51313. invoker.fns.push(wrappedHook);
  51314. } else {
  51315. // existing plain hook
  51316. invoker = createFnInvoker([oldHook, wrappedHook]);
  51317. }
  51318. }
  51319. invoker.merged = true;
  51320. def[hookKey] = invoker;
  51321. }
  51322. /* */
  51323. function extractPropsFromVNodeData (
  51324. data,
  51325. Ctor,
  51326. tag
  51327. ) {
  51328. // we are only extracting raw values here.
  51329. // validation and default values are handled in the child
  51330. // component itself.
  51331. var propOptions = Ctor.options.props;
  51332. if (isUndef(propOptions)) {
  51333. return
  51334. }
  51335. var res = {};
  51336. var attrs = data.attrs;
  51337. var props = data.props;
  51338. if (isDef(attrs) || isDef(props)) {
  51339. for (var key in propOptions) {
  51340. var altKey = hyphenate(key);
  51341. {
  51342. var keyInLowerCase = key.toLowerCase();
  51343. if (
  51344. key !== keyInLowerCase &&
  51345. attrs && hasOwn(attrs, keyInLowerCase)
  51346. ) {
  51347. tip(
  51348. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  51349. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  51350. " \"" + key + "\". " +
  51351. "Note that HTML attributes are case-insensitive and camelCased " +
  51352. "props need to use their kebab-case equivalents when using in-DOM " +
  51353. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  51354. );
  51355. }
  51356. }
  51357. checkProp(res, props, key, altKey, true) ||
  51358. checkProp(res, attrs, key, altKey, false);
  51359. }
  51360. }
  51361. return res
  51362. }
  51363. function checkProp (
  51364. res,
  51365. hash,
  51366. key,
  51367. altKey,
  51368. preserve
  51369. ) {
  51370. if (isDef(hash)) {
  51371. if (hasOwn(hash, key)) {
  51372. res[key] = hash[key];
  51373. if (!preserve) {
  51374. delete hash[key];
  51375. }
  51376. return true
  51377. } else if (hasOwn(hash, altKey)) {
  51378. res[key] = hash[altKey];
  51379. if (!preserve) {
  51380. delete hash[altKey];
  51381. }
  51382. return true
  51383. }
  51384. }
  51385. return false
  51386. }
  51387. /* */
  51388. // The template compiler attempts to minimize the need for normalization by
  51389. // statically analyzing the template at compile time.
  51390. //
  51391. // For plain HTML markup, normalization can be completely skipped because the
  51392. // generated render function is guaranteed to return Array<VNode>. There are
  51393. // two cases where extra normalization is needed:
  51394. // 1. When the children contains components - because a functional component
  51395. // may return an Array instead of a single root. In this case, just a simple
  51396. // normalization is needed - if any child is an Array, we flatten the whole
  51397. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  51398. // because functional components already normalize their own children.
  51399. function simpleNormalizeChildren (children) {
  51400. for (var i = 0; i < children.length; i++) {
  51401. if (Array.isArray(children[i])) {
  51402. return Array.prototype.concat.apply([], children)
  51403. }
  51404. }
  51405. return children
  51406. }
  51407. // 2. When the children contains constructs that always generated nested Arrays,
  51408. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  51409. // with hand-written render functions / JSX. In such cases a full normalization
  51410. // is needed to cater to all possible types of children values.
  51411. function normalizeChildren (children) {
  51412. return isPrimitive(children)
  51413. ? [createTextVNode(children)]
  51414. : Array.isArray(children)
  51415. ? normalizeArrayChildren(children)
  51416. : undefined
  51417. }
  51418. function isTextNode (node) {
  51419. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  51420. }
  51421. function normalizeArrayChildren (children, nestedIndex) {
  51422. var res = [];
  51423. var i, c, lastIndex, last;
  51424. for (i = 0; i < children.length; i++) {
  51425. c = children[i];
  51426. if (isUndef(c) || typeof c === 'boolean') { continue }
  51427. lastIndex = res.length - 1;
  51428. last = res[lastIndex];
  51429. // nested
  51430. if (Array.isArray(c)) {
  51431. if (c.length > 0) {
  51432. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  51433. // merge adjacent text nodes
  51434. if (isTextNode(c[0]) && isTextNode(last)) {
  51435. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  51436. c.shift();
  51437. }
  51438. res.push.apply(res, c);
  51439. }
  51440. } else if (isPrimitive(c)) {
  51441. if (isTextNode(last)) {
  51442. // merge adjacent text nodes
  51443. // this is necessary for SSR hydration because text nodes are
  51444. // essentially merged when rendered to HTML strings
  51445. res[lastIndex] = createTextVNode(last.text + c);
  51446. } else if (c !== '') {
  51447. // convert primitive to vnode
  51448. res.push(createTextVNode(c));
  51449. }
  51450. } else {
  51451. if (isTextNode(c) && isTextNode(last)) {
  51452. // merge adjacent text nodes
  51453. res[lastIndex] = createTextVNode(last.text + c.text);
  51454. } else {
  51455. // default key for nested array children (likely generated by v-for)
  51456. if (isTrue(children._isVList) &&
  51457. isDef(c.tag) &&
  51458. isUndef(c.key) &&
  51459. isDef(nestedIndex)) {
  51460. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  51461. }
  51462. res.push(c);
  51463. }
  51464. }
  51465. }
  51466. return res
  51467. }
  51468. /* */
  51469. function initProvide (vm) {
  51470. var provide = vm.$options.provide;
  51471. if (provide) {
  51472. vm._provided = typeof provide === 'function'
  51473. ? provide.call(vm)
  51474. : provide;
  51475. }
  51476. }
  51477. function initInjections (vm) {
  51478. var result = resolveInject(vm.$options.inject, vm);
  51479. if (result) {
  51480. toggleObserving(false);
  51481. Object.keys(result).forEach(function (key) {
  51482. /* istanbul ignore else */
  51483. {
  51484. defineReactive$$1(vm, key, result[key], function () {
  51485. warn(
  51486. "Avoid mutating an injected value directly since the changes will be " +
  51487. "overwritten whenever the provided component re-renders. " +
  51488. "injection being mutated: \"" + key + "\"",
  51489. vm
  51490. );
  51491. });
  51492. }
  51493. });
  51494. toggleObserving(true);
  51495. }
  51496. }
  51497. function resolveInject (inject, vm) {
  51498. if (inject) {
  51499. // inject is :any because flow is not smart enough to figure out cached
  51500. var result = Object.create(null);
  51501. var keys = hasSymbol
  51502. ? Reflect.ownKeys(inject)
  51503. : Object.keys(inject);
  51504. for (var i = 0; i < keys.length; i++) {
  51505. var key = keys[i];
  51506. // #6574 in case the inject object is observed...
  51507. if (key === '__ob__') { continue }
  51508. var provideKey = inject[key].from;
  51509. var source = vm;
  51510. while (source) {
  51511. if (source._provided && hasOwn(source._provided, provideKey)) {
  51512. result[key] = source._provided[provideKey];
  51513. break
  51514. }
  51515. source = source.$parent;
  51516. }
  51517. if (!source) {
  51518. if ('default' in inject[key]) {
  51519. var provideDefault = inject[key].default;
  51520. result[key] = typeof provideDefault === 'function'
  51521. ? provideDefault.call(vm)
  51522. : provideDefault;
  51523. } else {
  51524. warn(("Injection \"" + key + "\" not found"), vm);
  51525. }
  51526. }
  51527. }
  51528. return result
  51529. }
  51530. }
  51531. /* */
  51532. /**
  51533. * Runtime helper for resolving raw children VNodes into a slot object.
  51534. */
  51535. function resolveSlots (
  51536. children,
  51537. context
  51538. ) {
  51539. if (!children || !children.length) {
  51540. return {}
  51541. }
  51542. var slots = {};
  51543. for (var i = 0, l = children.length; i < l; i++) {
  51544. var child = children[i];
  51545. var data = child.data;
  51546. // remove slot attribute if the node is resolved as a Vue slot node
  51547. if (data && data.attrs && data.attrs.slot) {
  51548. delete data.attrs.slot;
  51549. }
  51550. // named slots should only be respected if the vnode was rendered in the
  51551. // same context.
  51552. if ((child.context === context || child.fnContext === context) &&
  51553. data && data.slot != null
  51554. ) {
  51555. var name = data.slot;
  51556. var slot = (slots[name] || (slots[name] = []));
  51557. if (child.tag === 'template') {
  51558. slot.push.apply(slot, child.children || []);
  51559. } else {
  51560. slot.push(child);
  51561. }
  51562. } else {
  51563. (slots.default || (slots.default = [])).push(child);
  51564. }
  51565. }
  51566. // ignore slots that contains only whitespace
  51567. for (var name$1 in slots) {
  51568. if (slots[name$1].every(isWhitespace)) {
  51569. delete slots[name$1];
  51570. }
  51571. }
  51572. return slots
  51573. }
  51574. function isWhitespace (node) {
  51575. return (node.isComment && !node.asyncFactory) || node.text === ' '
  51576. }
  51577. /* */
  51578. function normalizeScopedSlots (
  51579. slots,
  51580. normalSlots,
  51581. prevSlots
  51582. ) {
  51583. var res;
  51584. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  51585. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  51586. var key = slots && slots.$key;
  51587. if (!slots) {
  51588. res = {};
  51589. } else if (slots._normalized) {
  51590. // fast path 1: child component re-render only, parent did not change
  51591. return slots._normalized
  51592. } else if (
  51593. isStable &&
  51594. prevSlots &&
  51595. prevSlots !== emptyObject &&
  51596. key === prevSlots.$key &&
  51597. !hasNormalSlots &&
  51598. !prevSlots.$hasNormal
  51599. ) {
  51600. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  51601. // only need to normalize once
  51602. return prevSlots
  51603. } else {
  51604. res = {};
  51605. for (var key$1 in slots) {
  51606. if (slots[key$1] && key$1[0] !== '$') {
  51607. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  51608. }
  51609. }
  51610. }
  51611. // expose normal slots on scopedSlots
  51612. for (var key$2 in normalSlots) {
  51613. if (!(key$2 in res)) {
  51614. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  51615. }
  51616. }
  51617. // avoriaz seems to mock a non-extensible $scopedSlots object
  51618. // and when that is passed down this would cause an error
  51619. if (slots && Object.isExtensible(slots)) {
  51620. (slots)._normalized = res;
  51621. }
  51622. def(res, '$stable', isStable);
  51623. def(res, '$key', key);
  51624. def(res, '$hasNormal', hasNormalSlots);
  51625. return res
  51626. }
  51627. function normalizeScopedSlot(normalSlots, key, fn) {
  51628. var normalized = function () {
  51629. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  51630. res = res && typeof res === 'object' && !Array.isArray(res)
  51631. ? [res] // single vnode
  51632. : normalizeChildren(res);
  51633. return res && (
  51634. res.length === 0 ||
  51635. (res.length === 1 && res[0].isComment) // #9658
  51636. ) ? undefined
  51637. : res
  51638. };
  51639. // this is a slot using the new v-slot syntax without scope. although it is
  51640. // compiled as a scoped slot, render fn users would expect it to be present
  51641. // on this.$slots because the usage is semantically a normal slot.
  51642. if (fn.proxy) {
  51643. Object.defineProperty(normalSlots, key, {
  51644. get: normalized,
  51645. enumerable: true,
  51646. configurable: true
  51647. });
  51648. }
  51649. return normalized
  51650. }
  51651. function proxyNormalSlot(slots, key) {
  51652. return function () { return slots[key]; }
  51653. }
  51654. /* */
  51655. /**
  51656. * Runtime helper for rendering v-for lists.
  51657. */
  51658. function renderList (
  51659. val,
  51660. render
  51661. ) {
  51662. var ret, i, l, keys, key;
  51663. if (Array.isArray(val) || typeof val === 'string') {
  51664. ret = new Array(val.length);
  51665. for (i = 0, l = val.length; i < l; i++) {
  51666. ret[i] = render(val[i], i);
  51667. }
  51668. } else if (typeof val === 'number') {
  51669. ret = new Array(val);
  51670. for (i = 0; i < val; i++) {
  51671. ret[i] = render(i + 1, i);
  51672. }
  51673. } else if (isObject(val)) {
  51674. if (hasSymbol && val[Symbol.iterator]) {
  51675. ret = [];
  51676. var iterator = val[Symbol.iterator]();
  51677. var result = iterator.next();
  51678. while (!result.done) {
  51679. ret.push(render(result.value, ret.length));
  51680. result = iterator.next();
  51681. }
  51682. } else {
  51683. keys = Object.keys(val);
  51684. ret = new Array(keys.length);
  51685. for (i = 0, l = keys.length; i < l; i++) {
  51686. key = keys[i];
  51687. ret[i] = render(val[key], key, i);
  51688. }
  51689. }
  51690. }
  51691. if (!isDef(ret)) {
  51692. ret = [];
  51693. }
  51694. (ret)._isVList = true;
  51695. return ret
  51696. }
  51697. /* */
  51698. /**
  51699. * Runtime helper for rendering <slot>
  51700. */
  51701. function renderSlot (
  51702. name,
  51703. fallback,
  51704. props,
  51705. bindObject
  51706. ) {
  51707. var scopedSlotFn = this.$scopedSlots[name];
  51708. var nodes;
  51709. if (scopedSlotFn) { // scoped slot
  51710. props = props || {};
  51711. if (bindObject) {
  51712. if (!isObject(bindObject)) {
  51713. warn(
  51714. 'slot v-bind without argument expects an Object',
  51715. this
  51716. );
  51717. }
  51718. props = extend(extend({}, bindObject), props);
  51719. }
  51720. nodes = scopedSlotFn(props) || fallback;
  51721. } else {
  51722. nodes = this.$slots[name] || fallback;
  51723. }
  51724. var target = props && props.slot;
  51725. if (target) {
  51726. return this.$createElement('template', { slot: target }, nodes)
  51727. } else {
  51728. return nodes
  51729. }
  51730. }
  51731. /* */
  51732. /**
  51733. * Runtime helper for resolving filters
  51734. */
  51735. function resolveFilter (id) {
  51736. return resolveAsset(this.$options, 'filters', id, true) || identity
  51737. }
  51738. /* */
  51739. function isKeyNotMatch (expect, actual) {
  51740. if (Array.isArray(expect)) {
  51741. return expect.indexOf(actual) === -1
  51742. } else {
  51743. return expect !== actual
  51744. }
  51745. }
  51746. /**
  51747. * Runtime helper for checking keyCodes from config.
  51748. * exposed as Vue.prototype._k
  51749. * passing in eventKeyName as last argument separately for backwards compat
  51750. */
  51751. function checkKeyCodes (
  51752. eventKeyCode,
  51753. key,
  51754. builtInKeyCode,
  51755. eventKeyName,
  51756. builtInKeyName
  51757. ) {
  51758. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  51759. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  51760. return isKeyNotMatch(builtInKeyName, eventKeyName)
  51761. } else if (mappedKeyCode) {
  51762. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  51763. } else if (eventKeyName) {
  51764. return hyphenate(eventKeyName) !== key
  51765. }
  51766. }
  51767. /* */
  51768. /**
  51769. * Runtime helper for merging v-bind="object" into a VNode's data.
  51770. */
  51771. function bindObjectProps (
  51772. data,
  51773. tag,
  51774. value,
  51775. asProp,
  51776. isSync
  51777. ) {
  51778. if (value) {
  51779. if (!isObject(value)) {
  51780. warn(
  51781. 'v-bind without argument expects an Object or Array value',
  51782. this
  51783. );
  51784. } else {
  51785. if (Array.isArray(value)) {
  51786. value = toObject(value);
  51787. }
  51788. var hash;
  51789. var loop = function ( key ) {
  51790. if (
  51791. key === 'class' ||
  51792. key === 'style' ||
  51793. isReservedAttribute(key)
  51794. ) {
  51795. hash = data;
  51796. } else {
  51797. var type = data.attrs && data.attrs.type;
  51798. hash = asProp || config.mustUseProp(tag, type, key)
  51799. ? data.domProps || (data.domProps = {})
  51800. : data.attrs || (data.attrs = {});
  51801. }
  51802. var camelizedKey = camelize(key);
  51803. var hyphenatedKey = hyphenate(key);
  51804. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  51805. hash[key] = value[key];
  51806. if (isSync) {
  51807. var on = data.on || (data.on = {});
  51808. on[("update:" + key)] = function ($event) {
  51809. value[key] = $event;
  51810. };
  51811. }
  51812. }
  51813. };
  51814. for (var key in value) loop( key );
  51815. }
  51816. }
  51817. return data
  51818. }
  51819. /* */
  51820. /**
  51821. * Runtime helper for rendering static trees.
  51822. */
  51823. function renderStatic (
  51824. index,
  51825. isInFor
  51826. ) {
  51827. var cached = this._staticTrees || (this._staticTrees = []);
  51828. var tree = cached[index];
  51829. // if has already-rendered static tree and not inside v-for,
  51830. // we can reuse the same tree.
  51831. if (tree && !isInFor) {
  51832. return tree
  51833. }
  51834. // otherwise, render a fresh tree.
  51835. tree = cached[index] = this.$options.staticRenderFns[index].call(
  51836. this._renderProxy,
  51837. null,
  51838. this // for render fns generated for functional component templates
  51839. );
  51840. markStatic(tree, ("__static__" + index), false);
  51841. return tree
  51842. }
  51843. /**
  51844. * Runtime helper for v-once.
  51845. * Effectively it means marking the node as static with a unique key.
  51846. */
  51847. function markOnce (
  51848. tree,
  51849. index,
  51850. key
  51851. ) {
  51852. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  51853. return tree
  51854. }
  51855. function markStatic (
  51856. tree,
  51857. key,
  51858. isOnce
  51859. ) {
  51860. if (Array.isArray(tree)) {
  51861. for (var i = 0; i < tree.length; i++) {
  51862. if (tree[i] && typeof tree[i] !== 'string') {
  51863. markStaticNode(tree[i], (key + "_" + i), isOnce);
  51864. }
  51865. }
  51866. } else {
  51867. markStaticNode(tree, key, isOnce);
  51868. }
  51869. }
  51870. function markStaticNode (node, key, isOnce) {
  51871. node.isStatic = true;
  51872. node.key = key;
  51873. node.isOnce = isOnce;
  51874. }
  51875. /* */
  51876. function bindObjectListeners (data, value) {
  51877. if (value) {
  51878. if (!isPlainObject(value)) {
  51879. warn(
  51880. 'v-on without argument expects an Object value',
  51881. this
  51882. );
  51883. } else {
  51884. var on = data.on = data.on ? extend({}, data.on) : {};
  51885. for (var key in value) {
  51886. var existing = on[key];
  51887. var ours = value[key];
  51888. on[key] = existing ? [].concat(existing, ours) : ours;
  51889. }
  51890. }
  51891. }
  51892. return data
  51893. }
  51894. /* */
  51895. function resolveScopedSlots (
  51896. fns, // see flow/vnode
  51897. res,
  51898. // the following are added in 2.6
  51899. hasDynamicKeys,
  51900. contentHashKey
  51901. ) {
  51902. res = res || { $stable: !hasDynamicKeys };
  51903. for (var i = 0; i < fns.length; i++) {
  51904. var slot = fns[i];
  51905. if (Array.isArray(slot)) {
  51906. resolveScopedSlots(slot, res, hasDynamicKeys);
  51907. } else if (slot) {
  51908. // marker for reverse proxying v-slot without scope on this.$slots
  51909. if (slot.proxy) {
  51910. slot.fn.proxy = true;
  51911. }
  51912. res[slot.key] = slot.fn;
  51913. }
  51914. }
  51915. if (contentHashKey) {
  51916. (res).$key = contentHashKey;
  51917. }
  51918. return res
  51919. }
  51920. /* */
  51921. function bindDynamicKeys (baseObj, values) {
  51922. for (var i = 0; i < values.length; i += 2) {
  51923. var key = values[i];
  51924. if (typeof key === 'string' && key) {
  51925. baseObj[values[i]] = values[i + 1];
  51926. } else if (key !== '' && key !== null) {
  51927. // null is a special value for explicitly removing a binding
  51928. warn(
  51929. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  51930. this
  51931. );
  51932. }
  51933. }
  51934. return baseObj
  51935. }
  51936. // helper to dynamically append modifier runtime markers to event names.
  51937. // ensure only append when value is already string, otherwise it will be cast
  51938. // to string and cause the type check to miss.
  51939. function prependModifier (value, symbol) {
  51940. return typeof value === 'string' ? symbol + value : value
  51941. }
  51942. /* */
  51943. function installRenderHelpers (target) {
  51944. target._o = markOnce;
  51945. target._n = toNumber;
  51946. target._s = toString;
  51947. target._l = renderList;
  51948. target._t = renderSlot;
  51949. target._q = looseEqual;
  51950. target._i = looseIndexOf;
  51951. target._m = renderStatic;
  51952. target._f = resolveFilter;
  51953. target._k = checkKeyCodes;
  51954. target._b = bindObjectProps;
  51955. target._v = createTextVNode;
  51956. target._e = createEmptyVNode;
  51957. target._u = resolveScopedSlots;
  51958. target._g = bindObjectListeners;
  51959. target._d = bindDynamicKeys;
  51960. target._p = prependModifier;
  51961. }
  51962. /* */
  51963. function FunctionalRenderContext (
  51964. data,
  51965. props,
  51966. children,
  51967. parent,
  51968. Ctor
  51969. ) {
  51970. var this$1 = this;
  51971. var options = Ctor.options;
  51972. // ensure the createElement function in functional components
  51973. // gets a unique context - this is necessary for correct named slot check
  51974. var contextVm;
  51975. if (hasOwn(parent, '_uid')) {
  51976. contextVm = Object.create(parent);
  51977. // $flow-disable-line
  51978. contextVm._original = parent;
  51979. } else {
  51980. // the context vm passed in is a functional context as well.
  51981. // in this case we want to make sure we are able to get a hold to the
  51982. // real context instance.
  51983. contextVm = parent;
  51984. // $flow-disable-line
  51985. parent = parent._original;
  51986. }
  51987. var isCompiled = isTrue(options._compiled);
  51988. var needNormalization = !isCompiled;
  51989. this.data = data;
  51990. this.props = props;
  51991. this.children = children;
  51992. this.parent = parent;
  51993. this.listeners = data.on || emptyObject;
  51994. this.injections = resolveInject(options.inject, parent);
  51995. this.slots = function () {
  51996. if (!this$1.$slots) {
  51997. normalizeScopedSlots(
  51998. data.scopedSlots,
  51999. this$1.$slots = resolveSlots(children, parent)
  52000. );
  52001. }
  52002. return this$1.$slots
  52003. };
  52004. Object.defineProperty(this, 'scopedSlots', ({
  52005. enumerable: true,
  52006. get: function get () {
  52007. return normalizeScopedSlots(data.scopedSlots, this.slots())
  52008. }
  52009. }));
  52010. // support for compiled functional template
  52011. if (isCompiled) {
  52012. // exposing $options for renderStatic()
  52013. this.$options = options;
  52014. // pre-resolve slots for renderSlot()
  52015. this.$slots = this.slots();
  52016. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  52017. }
  52018. if (options._scopeId) {
  52019. this._c = function (a, b, c, d) {
  52020. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  52021. if (vnode && !Array.isArray(vnode)) {
  52022. vnode.fnScopeId = options._scopeId;
  52023. vnode.fnContext = parent;
  52024. }
  52025. return vnode
  52026. };
  52027. } else {
  52028. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  52029. }
  52030. }
  52031. installRenderHelpers(FunctionalRenderContext.prototype);
  52032. function createFunctionalComponent (
  52033. Ctor,
  52034. propsData,
  52035. data,
  52036. contextVm,
  52037. children
  52038. ) {
  52039. var options = Ctor.options;
  52040. var props = {};
  52041. var propOptions = options.props;
  52042. if (isDef(propOptions)) {
  52043. for (var key in propOptions) {
  52044. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  52045. }
  52046. } else {
  52047. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  52048. if (isDef(data.props)) { mergeProps(props, data.props); }
  52049. }
  52050. var renderContext = new FunctionalRenderContext(
  52051. data,
  52052. props,
  52053. children,
  52054. contextVm,
  52055. Ctor
  52056. );
  52057. var vnode = options.render.call(null, renderContext._c, renderContext);
  52058. if (vnode instanceof VNode) {
  52059. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  52060. } else if (Array.isArray(vnode)) {
  52061. var vnodes = normalizeChildren(vnode) || [];
  52062. var res = new Array(vnodes.length);
  52063. for (var i = 0; i < vnodes.length; i++) {
  52064. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  52065. }
  52066. return res
  52067. }
  52068. }
  52069. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  52070. // #7817 clone node before setting fnContext, otherwise if the node is reused
  52071. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  52072. // that should not be matched to match.
  52073. var clone = cloneVNode(vnode);
  52074. clone.fnContext = contextVm;
  52075. clone.fnOptions = options;
  52076. {
  52077. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  52078. }
  52079. if (data.slot) {
  52080. (clone.data || (clone.data = {})).slot = data.slot;
  52081. }
  52082. return clone
  52083. }
  52084. function mergeProps (to, from) {
  52085. for (var key in from) {
  52086. to[camelize(key)] = from[key];
  52087. }
  52088. }
  52089. /* */
  52090. /* */
  52091. /* */
  52092. /* */
  52093. // inline hooks to be invoked on component VNodes during patch
  52094. var componentVNodeHooks = {
  52095. init: function init (vnode, hydrating) {
  52096. if (
  52097. vnode.componentInstance &&
  52098. !vnode.componentInstance._isDestroyed &&
  52099. vnode.data.keepAlive
  52100. ) {
  52101. // kept-alive components, treat as a patch
  52102. var mountedNode = vnode; // work around flow
  52103. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  52104. } else {
  52105. var child = vnode.componentInstance = createComponentInstanceForVnode(
  52106. vnode,
  52107. activeInstance
  52108. );
  52109. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  52110. }
  52111. },
  52112. prepatch: function prepatch (oldVnode, vnode) {
  52113. var options = vnode.componentOptions;
  52114. var child = vnode.componentInstance = oldVnode.componentInstance;
  52115. updateChildComponent(
  52116. child,
  52117. options.propsData, // updated props
  52118. options.listeners, // updated listeners
  52119. vnode, // new parent vnode
  52120. options.children // new children
  52121. );
  52122. },
  52123. insert: function insert (vnode) {
  52124. var context = vnode.context;
  52125. var componentInstance = vnode.componentInstance;
  52126. if (!componentInstance._isMounted) {
  52127. componentInstance._isMounted = true;
  52128. callHook(componentInstance, 'mounted');
  52129. }
  52130. if (vnode.data.keepAlive) {
  52131. if (context._isMounted) {
  52132. // vue-router#1212
  52133. // During updates, a kept-alive component's child components may
  52134. // change, so directly walking the tree here may call activated hooks
  52135. // on incorrect children. Instead we push them into a queue which will
  52136. // be processed after the whole patch process ended.
  52137. queueActivatedComponent(componentInstance);
  52138. } else {
  52139. activateChildComponent(componentInstance, true /* direct */);
  52140. }
  52141. }
  52142. },
  52143. destroy: function destroy (vnode) {
  52144. var componentInstance = vnode.componentInstance;
  52145. if (!componentInstance._isDestroyed) {
  52146. if (!vnode.data.keepAlive) {
  52147. componentInstance.$destroy();
  52148. } else {
  52149. deactivateChildComponent(componentInstance, true /* direct */);
  52150. }
  52151. }
  52152. }
  52153. };
  52154. var hooksToMerge = Object.keys(componentVNodeHooks);
  52155. function createComponent (
  52156. Ctor,
  52157. data,
  52158. context,
  52159. children,
  52160. tag
  52161. ) {
  52162. if (isUndef(Ctor)) {
  52163. return
  52164. }
  52165. var baseCtor = context.$options._base;
  52166. // plain options object: turn it into a constructor
  52167. if (isObject(Ctor)) {
  52168. Ctor = baseCtor.extend(Ctor);
  52169. }
  52170. // if at this stage it's not a constructor or an async component factory,
  52171. // reject.
  52172. if (typeof Ctor !== 'function') {
  52173. {
  52174. warn(("Invalid Component definition: " + (String(Ctor))), context);
  52175. }
  52176. return
  52177. }
  52178. // async component
  52179. var asyncFactory;
  52180. if (isUndef(Ctor.cid)) {
  52181. asyncFactory = Ctor;
  52182. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  52183. if (Ctor === undefined) {
  52184. // return a placeholder node for async component, which is rendered
  52185. // as a comment node but preserves all the raw information for the node.
  52186. // the information will be used for async server-rendering and hydration.
  52187. return createAsyncPlaceholder(
  52188. asyncFactory,
  52189. data,
  52190. context,
  52191. children,
  52192. tag
  52193. )
  52194. }
  52195. }
  52196. data = data || {};
  52197. // resolve constructor options in case global mixins are applied after
  52198. // component constructor creation
  52199. resolveConstructorOptions(Ctor);
  52200. // transform component v-model data into props & events
  52201. if (isDef(data.model)) {
  52202. transformModel(Ctor.options, data);
  52203. }
  52204. // extract props
  52205. var propsData = extractPropsFromVNodeData(data, Ctor, tag);
  52206. // functional component
  52207. if (isTrue(Ctor.options.functional)) {
  52208. return createFunctionalComponent(Ctor, propsData, data, context, children)
  52209. }
  52210. // extract listeners, since these needs to be treated as
  52211. // child component listeners instead of DOM listeners
  52212. var listeners = data.on;
  52213. // replace with listeners with .native modifier
  52214. // so it gets processed during parent component patch.
  52215. data.on = data.nativeOn;
  52216. if (isTrue(Ctor.options.abstract)) {
  52217. // abstract components do not keep anything
  52218. // other than props & listeners & slot
  52219. // work around flow
  52220. var slot = data.slot;
  52221. data = {};
  52222. if (slot) {
  52223. data.slot = slot;
  52224. }
  52225. }
  52226. // install component management hooks onto the placeholder node
  52227. installComponentHooks(data);
  52228. // return a placeholder vnode
  52229. var name = Ctor.options.name || tag;
  52230. var vnode = new VNode(
  52231. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  52232. data, undefined, undefined, undefined, context,
  52233. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  52234. asyncFactory
  52235. );
  52236. return vnode
  52237. }
  52238. function createComponentInstanceForVnode (
  52239. vnode, // we know it's MountedComponentVNode but flow doesn't
  52240. parent // activeInstance in lifecycle state
  52241. ) {
  52242. var options = {
  52243. _isComponent: true,
  52244. _parentVnode: vnode,
  52245. parent: parent
  52246. };
  52247. // check inline-template render functions
  52248. var inlineTemplate = vnode.data.inlineTemplate;
  52249. if (isDef(inlineTemplate)) {
  52250. options.render = inlineTemplate.render;
  52251. options.staticRenderFns = inlineTemplate.staticRenderFns;
  52252. }
  52253. return new vnode.componentOptions.Ctor(options)
  52254. }
  52255. function installComponentHooks (data) {
  52256. var hooks = data.hook || (data.hook = {});
  52257. for (var i = 0; i < hooksToMerge.length; i++) {
  52258. var key = hooksToMerge[i];
  52259. var existing = hooks[key];
  52260. var toMerge = componentVNodeHooks[key];
  52261. if (existing !== toMerge && !(existing && existing._merged)) {
  52262. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  52263. }
  52264. }
  52265. }
  52266. function mergeHook$1 (f1, f2) {
  52267. var merged = function (a, b) {
  52268. // flow complains about extra args which is why we use any
  52269. f1(a, b);
  52270. f2(a, b);
  52271. };
  52272. merged._merged = true;
  52273. return merged
  52274. }
  52275. // transform component v-model info (value and callback) into
  52276. // prop and event handler respectively.
  52277. function transformModel (options, data) {
  52278. var prop = (options.model && options.model.prop) || 'value';
  52279. var event = (options.model && options.model.event) || 'input'
  52280. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  52281. var on = data.on || (data.on = {});
  52282. var existing = on[event];
  52283. var callback = data.model.callback;
  52284. if (isDef(existing)) {
  52285. if (
  52286. Array.isArray(existing)
  52287. ? existing.indexOf(callback) === -1
  52288. : existing !== callback
  52289. ) {
  52290. on[event] = [callback].concat(existing);
  52291. }
  52292. } else {
  52293. on[event] = callback;
  52294. }
  52295. }
  52296. /* */
  52297. var SIMPLE_NORMALIZE = 1;
  52298. var ALWAYS_NORMALIZE = 2;
  52299. // wrapper function for providing a more flexible interface
  52300. // without getting yelled at by flow
  52301. function createElement (
  52302. context,
  52303. tag,
  52304. data,
  52305. children,
  52306. normalizationType,
  52307. alwaysNormalize
  52308. ) {
  52309. if (Array.isArray(data) || isPrimitive(data)) {
  52310. normalizationType = children;
  52311. children = data;
  52312. data = undefined;
  52313. }
  52314. if (isTrue(alwaysNormalize)) {
  52315. normalizationType = ALWAYS_NORMALIZE;
  52316. }
  52317. return _createElement(context, tag, data, children, normalizationType)
  52318. }
  52319. function _createElement (
  52320. context,
  52321. tag,
  52322. data,
  52323. children,
  52324. normalizationType
  52325. ) {
  52326. if (isDef(data) && isDef((data).__ob__)) {
  52327. warn(
  52328. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  52329. 'Always create fresh vnode data objects in each render!',
  52330. context
  52331. );
  52332. return createEmptyVNode()
  52333. }
  52334. // object syntax in v-bind
  52335. if (isDef(data) && isDef(data.is)) {
  52336. tag = data.is;
  52337. }
  52338. if (!tag) {
  52339. // in case of component :is set to falsy value
  52340. return createEmptyVNode()
  52341. }
  52342. // warn against non-primitive key
  52343. if (isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  52344. ) {
  52345. {
  52346. warn(
  52347. 'Avoid using non-primitive value as key, ' +
  52348. 'use string/number value instead.',
  52349. context
  52350. );
  52351. }
  52352. }
  52353. // support single function children as default scoped slot
  52354. if (Array.isArray(children) &&
  52355. typeof children[0] === 'function'
  52356. ) {
  52357. data = data || {};
  52358. data.scopedSlots = { default: children[0] };
  52359. children.length = 0;
  52360. }
  52361. if (normalizationType === ALWAYS_NORMALIZE) {
  52362. children = normalizeChildren(children);
  52363. } else if (normalizationType === SIMPLE_NORMALIZE) {
  52364. children = simpleNormalizeChildren(children);
  52365. }
  52366. var vnode, ns;
  52367. if (typeof tag === 'string') {
  52368. var Ctor;
  52369. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  52370. if (config.isReservedTag(tag)) {
  52371. // platform built-in elements
  52372. if (isDef(data) && isDef(data.nativeOn)) {
  52373. warn(
  52374. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  52375. context
  52376. );
  52377. }
  52378. vnode = new VNode(
  52379. config.parsePlatformTagName(tag), data, children,
  52380. undefined, undefined, context
  52381. );
  52382. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  52383. // component
  52384. vnode = createComponent(Ctor, data, context, children, tag);
  52385. } else {
  52386. // unknown or unlisted namespaced elements
  52387. // check at runtime because it may get assigned a namespace when its
  52388. // parent normalizes children
  52389. vnode = new VNode(
  52390. tag, data, children,
  52391. undefined, undefined, context
  52392. );
  52393. }
  52394. } else {
  52395. // direct component options / constructor
  52396. vnode = createComponent(tag, data, context, children);
  52397. }
  52398. if (Array.isArray(vnode)) {
  52399. return vnode
  52400. } else if (isDef(vnode)) {
  52401. if (isDef(ns)) { applyNS(vnode, ns); }
  52402. if (isDef(data)) { registerDeepBindings(data); }
  52403. return vnode
  52404. } else {
  52405. return createEmptyVNode()
  52406. }
  52407. }
  52408. function applyNS (vnode, ns, force) {
  52409. vnode.ns = ns;
  52410. if (vnode.tag === 'foreignObject') {
  52411. // use default namespace inside foreignObject
  52412. ns = undefined;
  52413. force = true;
  52414. }
  52415. if (isDef(vnode.children)) {
  52416. for (var i = 0, l = vnode.children.length; i < l; i++) {
  52417. var child = vnode.children[i];
  52418. if (isDef(child.tag) && (
  52419. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  52420. applyNS(child, ns, force);
  52421. }
  52422. }
  52423. }
  52424. }
  52425. // ref #5318
  52426. // necessary to ensure parent re-render when deep bindings like :style and
  52427. // :class are used on slot nodes
  52428. function registerDeepBindings (data) {
  52429. if (isObject(data.style)) {
  52430. traverse(data.style);
  52431. }
  52432. if (isObject(data.class)) {
  52433. traverse(data.class);
  52434. }
  52435. }
  52436. /* */
  52437. function initRender (vm) {
  52438. vm._vnode = null; // the root of the child tree
  52439. vm._staticTrees = null; // v-once cached trees
  52440. var options = vm.$options;
  52441. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  52442. var renderContext = parentVnode && parentVnode.context;
  52443. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  52444. vm.$scopedSlots = emptyObject;
  52445. // bind the createElement fn to this instance
  52446. // so that we get proper render context inside it.
  52447. // args order: tag, data, children, normalizationType, alwaysNormalize
  52448. // internal version is used by render functions compiled from templates
  52449. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  52450. // normalization is always applied for the public version, used in
  52451. // user-written render functions.
  52452. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  52453. // $attrs & $listeners are exposed for easier HOC creation.
  52454. // they need to be reactive so that HOCs using them are always updated
  52455. var parentData = parentVnode && parentVnode.data;
  52456. /* istanbul ignore else */
  52457. {
  52458. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  52459. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  52460. }, true);
  52461. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  52462. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  52463. }, true);
  52464. }
  52465. }
  52466. var currentRenderingInstance = null;
  52467. function renderMixin (Vue) {
  52468. // install runtime convenience helpers
  52469. installRenderHelpers(Vue.prototype);
  52470. Vue.prototype.$nextTick = function (fn) {
  52471. return nextTick(fn, this)
  52472. };
  52473. Vue.prototype._render = function () {
  52474. var vm = this;
  52475. var ref = vm.$options;
  52476. var render = ref.render;
  52477. var _parentVnode = ref._parentVnode;
  52478. if (_parentVnode) {
  52479. vm.$scopedSlots = normalizeScopedSlots(
  52480. _parentVnode.data.scopedSlots,
  52481. vm.$slots,
  52482. vm.$scopedSlots
  52483. );
  52484. }
  52485. // set parent vnode. this allows render functions to have access
  52486. // to the data on the placeholder node.
  52487. vm.$vnode = _parentVnode;
  52488. // render self
  52489. var vnode;
  52490. try {
  52491. // There's no need to maintain a stack because all render fns are called
  52492. // separately from one another. Nested component's render fns are called
  52493. // when parent component is patched.
  52494. currentRenderingInstance = vm;
  52495. vnode = render.call(vm._renderProxy, vm.$createElement);
  52496. } catch (e) {
  52497. handleError(e, vm, "render");
  52498. // return error render result,
  52499. // or previous vnode to prevent render error causing blank component
  52500. /* istanbul ignore else */
  52501. if (vm.$options.renderError) {
  52502. try {
  52503. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  52504. } catch (e) {
  52505. handleError(e, vm, "renderError");
  52506. vnode = vm._vnode;
  52507. }
  52508. } else {
  52509. vnode = vm._vnode;
  52510. }
  52511. } finally {
  52512. currentRenderingInstance = null;
  52513. }
  52514. // if the returned array contains only a single node, allow it
  52515. if (Array.isArray(vnode) && vnode.length === 1) {
  52516. vnode = vnode[0];
  52517. }
  52518. // return empty vnode in case the render function errored out
  52519. if (!(vnode instanceof VNode)) {
  52520. if (Array.isArray(vnode)) {
  52521. warn(
  52522. 'Multiple root nodes returned from render function. Render function ' +
  52523. 'should return a single root node.',
  52524. vm
  52525. );
  52526. }
  52527. vnode = createEmptyVNode();
  52528. }
  52529. // set parent
  52530. vnode.parent = _parentVnode;
  52531. return vnode
  52532. };
  52533. }
  52534. /* */
  52535. function ensureCtor (comp, base) {
  52536. if (
  52537. comp.__esModule ||
  52538. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  52539. ) {
  52540. comp = comp.default;
  52541. }
  52542. return isObject(comp)
  52543. ? base.extend(comp)
  52544. : comp
  52545. }
  52546. function createAsyncPlaceholder (
  52547. factory,
  52548. data,
  52549. context,
  52550. children,
  52551. tag
  52552. ) {
  52553. var node = createEmptyVNode();
  52554. node.asyncFactory = factory;
  52555. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  52556. return node
  52557. }
  52558. function resolveAsyncComponent (
  52559. factory,
  52560. baseCtor
  52561. ) {
  52562. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  52563. return factory.errorComp
  52564. }
  52565. if (isDef(factory.resolved)) {
  52566. return factory.resolved
  52567. }
  52568. var owner = currentRenderingInstance;
  52569. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  52570. // already pending
  52571. factory.owners.push(owner);
  52572. }
  52573. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  52574. return factory.loadingComp
  52575. }
  52576. if (owner && !isDef(factory.owners)) {
  52577. var owners = factory.owners = [owner];
  52578. var sync = true;
  52579. var timerLoading = null;
  52580. var timerTimeout = null
  52581. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  52582. var forceRender = function (renderCompleted) {
  52583. for (var i = 0, l = owners.length; i < l; i++) {
  52584. (owners[i]).$forceUpdate();
  52585. }
  52586. if (renderCompleted) {
  52587. owners.length = 0;
  52588. if (timerLoading !== null) {
  52589. clearTimeout(timerLoading);
  52590. timerLoading = null;
  52591. }
  52592. if (timerTimeout !== null) {
  52593. clearTimeout(timerTimeout);
  52594. timerTimeout = null;
  52595. }
  52596. }
  52597. };
  52598. var resolve = once(function (res) {
  52599. // cache resolved
  52600. factory.resolved = ensureCtor(res, baseCtor);
  52601. // invoke callbacks only if this is not a synchronous resolve
  52602. // (async resolves are shimmed as synchronous during SSR)
  52603. if (!sync) {
  52604. forceRender(true);
  52605. } else {
  52606. owners.length = 0;
  52607. }
  52608. });
  52609. var reject = once(function (reason) {
  52610. warn(
  52611. "Failed to resolve async component: " + (String(factory)) +
  52612. (reason ? ("\nReason: " + reason) : '')
  52613. );
  52614. if (isDef(factory.errorComp)) {
  52615. factory.error = true;
  52616. forceRender(true);
  52617. }
  52618. });
  52619. var res = factory(resolve, reject);
  52620. if (isObject(res)) {
  52621. if (isPromise(res)) {
  52622. // () => Promise
  52623. if (isUndef(factory.resolved)) {
  52624. res.then(resolve, reject);
  52625. }
  52626. } else if (isPromise(res.component)) {
  52627. res.component.then(resolve, reject);
  52628. if (isDef(res.error)) {
  52629. factory.errorComp = ensureCtor(res.error, baseCtor);
  52630. }
  52631. if (isDef(res.loading)) {
  52632. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  52633. if (res.delay === 0) {
  52634. factory.loading = true;
  52635. } else {
  52636. timerLoading = setTimeout(function () {
  52637. timerLoading = null;
  52638. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  52639. factory.loading = true;
  52640. forceRender(false);
  52641. }
  52642. }, res.delay || 200);
  52643. }
  52644. }
  52645. if (isDef(res.timeout)) {
  52646. timerTimeout = setTimeout(function () {
  52647. timerTimeout = null;
  52648. if (isUndef(factory.resolved)) {
  52649. reject(
  52650. "timeout (" + (res.timeout) + "ms)"
  52651. );
  52652. }
  52653. }, res.timeout);
  52654. }
  52655. }
  52656. }
  52657. sync = false;
  52658. // return in case resolved synchronously
  52659. return factory.loading
  52660. ? factory.loadingComp
  52661. : factory.resolved
  52662. }
  52663. }
  52664. /* */
  52665. function isAsyncPlaceholder (node) {
  52666. return node.isComment && node.asyncFactory
  52667. }
  52668. /* */
  52669. function getFirstComponentChild (children) {
  52670. if (Array.isArray(children)) {
  52671. for (var i = 0; i < children.length; i++) {
  52672. var c = children[i];
  52673. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  52674. return c
  52675. }
  52676. }
  52677. }
  52678. }
  52679. /* */
  52680. /* */
  52681. function initEvents (vm) {
  52682. vm._events = Object.create(null);
  52683. vm._hasHookEvent = false;
  52684. // init parent attached events
  52685. var listeners = vm.$options._parentListeners;
  52686. if (listeners) {
  52687. updateComponentListeners(vm, listeners);
  52688. }
  52689. }
  52690. var target;
  52691. function add (event, fn) {
  52692. target.$on(event, fn);
  52693. }
  52694. function remove$1 (event, fn) {
  52695. target.$off(event, fn);
  52696. }
  52697. function createOnceHandler (event, fn) {
  52698. var _target = target;
  52699. return function onceHandler () {
  52700. var res = fn.apply(null, arguments);
  52701. if (res !== null) {
  52702. _target.$off(event, onceHandler);
  52703. }
  52704. }
  52705. }
  52706. function updateComponentListeners (
  52707. vm,
  52708. listeners,
  52709. oldListeners
  52710. ) {
  52711. target = vm;
  52712. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  52713. target = undefined;
  52714. }
  52715. function eventsMixin (Vue) {
  52716. var hookRE = /^hook:/;
  52717. Vue.prototype.$on = function (event, fn) {
  52718. var vm = this;
  52719. if (Array.isArray(event)) {
  52720. for (var i = 0, l = event.length; i < l; i++) {
  52721. vm.$on(event[i], fn);
  52722. }
  52723. } else {
  52724. (vm._events[event] || (vm._events[event] = [])).push(fn);
  52725. // optimize hook:event cost by using a boolean flag marked at registration
  52726. // instead of a hash lookup
  52727. if (hookRE.test(event)) {
  52728. vm._hasHookEvent = true;
  52729. }
  52730. }
  52731. return vm
  52732. };
  52733. Vue.prototype.$once = function (event, fn) {
  52734. var vm = this;
  52735. function on () {
  52736. vm.$off(event, on);
  52737. fn.apply(vm, arguments);
  52738. }
  52739. on.fn = fn;
  52740. vm.$on(event, on);
  52741. return vm
  52742. };
  52743. Vue.prototype.$off = function (event, fn) {
  52744. var vm = this;
  52745. // all
  52746. if (!arguments.length) {
  52747. vm._events = Object.create(null);
  52748. return vm
  52749. }
  52750. // array of events
  52751. if (Array.isArray(event)) {
  52752. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  52753. vm.$off(event[i$1], fn);
  52754. }
  52755. return vm
  52756. }
  52757. // specific event
  52758. var cbs = vm._events[event];
  52759. if (!cbs) {
  52760. return vm
  52761. }
  52762. if (!fn) {
  52763. vm._events[event] = null;
  52764. return vm
  52765. }
  52766. // specific handler
  52767. var cb;
  52768. var i = cbs.length;
  52769. while (i--) {
  52770. cb = cbs[i];
  52771. if (cb === fn || cb.fn === fn) {
  52772. cbs.splice(i, 1);
  52773. break
  52774. }
  52775. }
  52776. return vm
  52777. };
  52778. Vue.prototype.$emit = function (event) {
  52779. var vm = this;
  52780. {
  52781. var lowerCaseEvent = event.toLowerCase();
  52782. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  52783. tip(
  52784. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  52785. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  52786. "Note that HTML attributes are case-insensitive and you cannot use " +
  52787. "v-on to listen to camelCase events when using in-DOM templates. " +
  52788. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  52789. );
  52790. }
  52791. }
  52792. var cbs = vm._events[event];
  52793. if (cbs) {
  52794. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  52795. var args = toArray(arguments, 1);
  52796. var info = "event handler for \"" + event + "\"";
  52797. for (var i = 0, l = cbs.length; i < l; i++) {
  52798. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  52799. }
  52800. }
  52801. return vm
  52802. };
  52803. }
  52804. /* */
  52805. var activeInstance = null;
  52806. var isUpdatingChildComponent = false;
  52807. function setActiveInstance(vm) {
  52808. var prevActiveInstance = activeInstance;
  52809. activeInstance = vm;
  52810. return function () {
  52811. activeInstance = prevActiveInstance;
  52812. }
  52813. }
  52814. function initLifecycle (vm) {
  52815. var options = vm.$options;
  52816. // locate first non-abstract parent
  52817. var parent = options.parent;
  52818. if (parent && !options.abstract) {
  52819. while (parent.$options.abstract && parent.$parent) {
  52820. parent = parent.$parent;
  52821. }
  52822. parent.$children.push(vm);
  52823. }
  52824. vm.$parent = parent;
  52825. vm.$root = parent ? parent.$root : vm;
  52826. vm.$children = [];
  52827. vm.$refs = {};
  52828. vm._watcher = null;
  52829. vm._inactive = null;
  52830. vm._directInactive = false;
  52831. vm._isMounted = false;
  52832. vm._isDestroyed = false;
  52833. vm._isBeingDestroyed = false;
  52834. }
  52835. function lifecycleMixin (Vue) {
  52836. Vue.prototype._update = function (vnode, hydrating) {
  52837. var vm = this;
  52838. var prevEl = vm.$el;
  52839. var prevVnode = vm._vnode;
  52840. var restoreActiveInstance = setActiveInstance(vm);
  52841. vm._vnode = vnode;
  52842. // Vue.prototype.__patch__ is injected in entry points
  52843. // based on the rendering backend used.
  52844. if (!prevVnode) {
  52845. // initial render
  52846. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  52847. } else {
  52848. // updates
  52849. vm.$el = vm.__patch__(prevVnode, vnode);
  52850. }
  52851. restoreActiveInstance();
  52852. // update __vue__ reference
  52853. if (prevEl) {
  52854. prevEl.__vue__ = null;
  52855. }
  52856. if (vm.$el) {
  52857. vm.$el.__vue__ = vm;
  52858. }
  52859. // if parent is an HOC, update its $el as well
  52860. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  52861. vm.$parent.$el = vm.$el;
  52862. }
  52863. // updated hook is called by the scheduler to ensure that children are
  52864. // updated in a parent's updated hook.
  52865. };
  52866. Vue.prototype.$forceUpdate = function () {
  52867. var vm = this;
  52868. if (vm._watcher) {
  52869. vm._watcher.update();
  52870. }
  52871. };
  52872. Vue.prototype.$destroy = function () {
  52873. var vm = this;
  52874. if (vm._isBeingDestroyed) {
  52875. return
  52876. }
  52877. callHook(vm, 'beforeDestroy');
  52878. vm._isBeingDestroyed = true;
  52879. // remove self from parent
  52880. var parent = vm.$parent;
  52881. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  52882. remove(parent.$children, vm);
  52883. }
  52884. // teardown watchers
  52885. if (vm._watcher) {
  52886. vm._watcher.teardown();
  52887. }
  52888. var i = vm._watchers.length;
  52889. while (i--) {
  52890. vm._watchers[i].teardown();
  52891. }
  52892. // remove reference from data ob
  52893. // frozen object may not have observer.
  52894. if (vm._data.__ob__) {
  52895. vm._data.__ob__.vmCount--;
  52896. }
  52897. // call the last hook...
  52898. vm._isDestroyed = true;
  52899. // invoke destroy hooks on current rendered tree
  52900. vm.__patch__(vm._vnode, null);
  52901. // fire destroyed hook
  52902. callHook(vm, 'destroyed');
  52903. // turn off all instance listeners.
  52904. vm.$off();
  52905. // remove __vue__ reference
  52906. if (vm.$el) {
  52907. vm.$el.__vue__ = null;
  52908. }
  52909. // release circular reference (#6759)
  52910. if (vm.$vnode) {
  52911. vm.$vnode.parent = null;
  52912. }
  52913. };
  52914. }
  52915. function mountComponent (
  52916. vm,
  52917. el,
  52918. hydrating
  52919. ) {
  52920. vm.$el = el;
  52921. if (!vm.$options.render) {
  52922. vm.$options.render = createEmptyVNode;
  52923. {
  52924. /* istanbul ignore if */
  52925. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  52926. vm.$options.el || el) {
  52927. warn(
  52928. 'You are using the runtime-only build of Vue where the template ' +
  52929. 'compiler is not available. Either pre-compile the templates into ' +
  52930. 'render functions, or use the compiler-included build.',
  52931. vm
  52932. );
  52933. } else {
  52934. warn(
  52935. 'Failed to mount component: template or render function not defined.',
  52936. vm
  52937. );
  52938. }
  52939. }
  52940. }
  52941. callHook(vm, 'beforeMount');
  52942. var updateComponent;
  52943. /* istanbul ignore if */
  52944. if (config.performance && mark) {
  52945. updateComponent = function () {
  52946. var name = vm._name;
  52947. var id = vm._uid;
  52948. var startTag = "vue-perf-start:" + id;
  52949. var endTag = "vue-perf-end:" + id;
  52950. mark(startTag);
  52951. var vnode = vm._render();
  52952. mark(endTag);
  52953. measure(("vue " + name + " render"), startTag, endTag);
  52954. mark(startTag);
  52955. vm._update(vnode, hydrating);
  52956. mark(endTag);
  52957. measure(("vue " + name + " patch"), startTag, endTag);
  52958. };
  52959. } else {
  52960. updateComponent = function () {
  52961. vm._update(vm._render(), hydrating);
  52962. };
  52963. }
  52964. // we set this to vm._watcher inside the watcher's constructor
  52965. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  52966. // component's mounted hook), which relies on vm._watcher being already defined
  52967. new Watcher(vm, updateComponent, noop, {
  52968. before: function before () {
  52969. if (vm._isMounted && !vm._isDestroyed) {
  52970. callHook(vm, 'beforeUpdate');
  52971. }
  52972. }
  52973. }, true /* isRenderWatcher */);
  52974. hydrating = false;
  52975. // manually mounted instance, call mounted on self
  52976. // mounted is called for render-created child components in its inserted hook
  52977. if (vm.$vnode == null) {
  52978. vm._isMounted = true;
  52979. callHook(vm, 'mounted');
  52980. }
  52981. return vm
  52982. }
  52983. function updateChildComponent (
  52984. vm,
  52985. propsData,
  52986. listeners,
  52987. parentVnode,
  52988. renderChildren
  52989. ) {
  52990. {
  52991. isUpdatingChildComponent = true;
  52992. }
  52993. // determine whether component has slot children
  52994. // we need to do this before overwriting $options._renderChildren.
  52995. // check if there are dynamic scopedSlots (hand-written or compiled but with
  52996. // dynamic slot names). Static scoped slots compiled from template has the
  52997. // "$stable" marker.
  52998. var newScopedSlots = parentVnode.data.scopedSlots;
  52999. var oldScopedSlots = vm.$scopedSlots;
  53000. var hasDynamicScopedSlot = !!(
  53001. (newScopedSlots && !newScopedSlots.$stable) ||
  53002. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  53003. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  53004. );
  53005. // Any static slot children from the parent may have changed during parent's
  53006. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  53007. // update is necessary to ensure correctness.
  53008. var needsForceUpdate = !!(
  53009. renderChildren || // has new static slots
  53010. vm.$options._renderChildren || // has old static slots
  53011. hasDynamicScopedSlot
  53012. );
  53013. vm.$options._parentVnode = parentVnode;
  53014. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  53015. if (vm._vnode) { // update child tree's parent
  53016. vm._vnode.parent = parentVnode;
  53017. }
  53018. vm.$options._renderChildren = renderChildren;
  53019. // update $attrs and $listeners hash
  53020. // these are also reactive so they may trigger child update if the child
  53021. // used them during render
  53022. vm.$attrs = parentVnode.data.attrs || emptyObject;
  53023. vm.$listeners = listeners || emptyObject;
  53024. // update props
  53025. if (propsData && vm.$options.props) {
  53026. toggleObserving(false);
  53027. var props = vm._props;
  53028. var propKeys = vm.$options._propKeys || [];
  53029. for (var i = 0; i < propKeys.length; i++) {
  53030. var key = propKeys[i];
  53031. var propOptions = vm.$options.props; // wtf flow?
  53032. props[key] = validateProp(key, propOptions, propsData, vm);
  53033. }
  53034. toggleObserving(true);
  53035. // keep a copy of raw propsData
  53036. vm.$options.propsData = propsData;
  53037. }
  53038. // update listeners
  53039. listeners = listeners || emptyObject;
  53040. var oldListeners = vm.$options._parentListeners;
  53041. vm.$options._parentListeners = listeners;
  53042. updateComponentListeners(vm, listeners, oldListeners);
  53043. // resolve slots + force update if has children
  53044. if (needsForceUpdate) {
  53045. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  53046. vm.$forceUpdate();
  53047. }
  53048. {
  53049. isUpdatingChildComponent = false;
  53050. }
  53051. }
  53052. function isInInactiveTree (vm) {
  53053. while (vm && (vm = vm.$parent)) {
  53054. if (vm._inactive) { return true }
  53055. }
  53056. return false
  53057. }
  53058. function activateChildComponent (vm, direct) {
  53059. if (direct) {
  53060. vm._directInactive = false;
  53061. if (isInInactiveTree(vm)) {
  53062. return
  53063. }
  53064. } else if (vm._directInactive) {
  53065. return
  53066. }
  53067. if (vm._inactive || vm._inactive === null) {
  53068. vm._inactive = false;
  53069. for (var i = 0; i < vm.$children.length; i++) {
  53070. activateChildComponent(vm.$children[i]);
  53071. }
  53072. callHook(vm, 'activated');
  53073. }
  53074. }
  53075. function deactivateChildComponent (vm, direct) {
  53076. if (direct) {
  53077. vm._directInactive = true;
  53078. if (isInInactiveTree(vm)) {
  53079. return
  53080. }
  53081. }
  53082. if (!vm._inactive) {
  53083. vm._inactive = true;
  53084. for (var i = 0; i < vm.$children.length; i++) {
  53085. deactivateChildComponent(vm.$children[i]);
  53086. }
  53087. callHook(vm, 'deactivated');
  53088. }
  53089. }
  53090. function callHook (vm, hook) {
  53091. // #7573 disable dep collection when invoking lifecycle hooks
  53092. pushTarget();
  53093. var handlers = vm.$options[hook];
  53094. var info = hook + " hook";
  53095. if (handlers) {
  53096. for (var i = 0, j = handlers.length; i < j; i++) {
  53097. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  53098. }
  53099. }
  53100. if (vm._hasHookEvent) {
  53101. vm.$emit('hook:' + hook);
  53102. }
  53103. popTarget();
  53104. }
  53105. /* */
  53106. var MAX_UPDATE_COUNT = 100;
  53107. var queue = [];
  53108. var activatedChildren = [];
  53109. var has = {};
  53110. var circular = {};
  53111. var waiting = false;
  53112. var flushing = false;
  53113. var index = 0;
  53114. /**
  53115. * Reset the scheduler's state.
  53116. */
  53117. function resetSchedulerState () {
  53118. index = queue.length = activatedChildren.length = 0;
  53119. has = {};
  53120. {
  53121. circular = {};
  53122. }
  53123. waiting = flushing = false;
  53124. }
  53125. // Async edge case #6566 requires saving the timestamp when event listeners are
  53126. // attached. However, calling performance.now() has a perf overhead especially
  53127. // if the page has thousands of event listeners. Instead, we take a timestamp
  53128. // every time the scheduler flushes and use that for all event listeners
  53129. // attached during that flush.
  53130. var currentFlushTimestamp = 0;
  53131. // Async edge case fix requires storing an event listener's attach timestamp.
  53132. var getNow = Date.now;
  53133. // Determine what event timestamp the browser is using. Annoyingly, the
  53134. // timestamp can either be hi-res (relative to page load) or low-res
  53135. // (relative to UNIX epoch), so in order to compare time we have to use the
  53136. // same timestamp type when saving the flush timestamp.
  53137. // All IE versions use low-res event timestamps, and have problematic clock
  53138. // implementations (#9632)
  53139. if (inBrowser && !isIE) {
  53140. var performance = window.performance;
  53141. if (
  53142. performance &&
  53143. typeof performance.now === 'function' &&
  53144. getNow() > document.createEvent('Event').timeStamp
  53145. ) {
  53146. // if the event timestamp, although evaluated AFTER the Date.now(), is
  53147. // smaller than it, it means the event is using a hi-res timestamp,
  53148. // and we need to use the hi-res version for event listener timestamps as
  53149. // well.
  53150. getNow = function () { return performance.now(); };
  53151. }
  53152. }
  53153. /**
  53154. * Flush both queues and run the watchers.
  53155. */
  53156. function flushSchedulerQueue () {
  53157. currentFlushTimestamp = getNow();
  53158. flushing = true;
  53159. var watcher, id;
  53160. // Sort queue before flush.
  53161. // This ensures that:
  53162. // 1. Components are updated from parent to child. (because parent is always
  53163. // created before the child)
  53164. // 2. A component's user watchers are run before its render watcher (because
  53165. // user watchers are created before the render watcher)
  53166. // 3. If a component is destroyed during a parent component's watcher run,
  53167. // its watchers can be skipped.
  53168. queue.sort(function (a, b) { return a.id - b.id; });
  53169. // do not cache length because more watchers might be pushed
  53170. // as we run existing watchers
  53171. for (index = 0; index < queue.length; index++) {
  53172. watcher = queue[index];
  53173. if (watcher.before) {
  53174. watcher.before();
  53175. }
  53176. id = watcher.id;
  53177. has[id] = null;
  53178. watcher.run();
  53179. // in dev build, check and stop circular updates.
  53180. if (has[id] != null) {
  53181. circular[id] = (circular[id] || 0) + 1;
  53182. if (circular[id] > MAX_UPDATE_COUNT) {
  53183. warn(
  53184. 'You may have an infinite update loop ' + (
  53185. watcher.user
  53186. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  53187. : "in a component render function."
  53188. ),
  53189. watcher.vm
  53190. );
  53191. break
  53192. }
  53193. }
  53194. }
  53195. // keep copies of post queues before resetting state
  53196. var activatedQueue = activatedChildren.slice();
  53197. var updatedQueue = queue.slice();
  53198. resetSchedulerState();
  53199. // call component updated and activated hooks
  53200. callActivatedHooks(activatedQueue);
  53201. callUpdatedHooks(updatedQueue);
  53202. // devtool hook
  53203. /* istanbul ignore if */
  53204. if (devtools && config.devtools) {
  53205. devtools.emit('flush');
  53206. }
  53207. }
  53208. function callUpdatedHooks (queue) {
  53209. var i = queue.length;
  53210. while (i--) {
  53211. var watcher = queue[i];
  53212. var vm = watcher.vm;
  53213. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  53214. callHook(vm, 'updated');
  53215. }
  53216. }
  53217. }
  53218. /**
  53219. * Queue a kept-alive component that was activated during patch.
  53220. * The queue will be processed after the entire tree has been patched.
  53221. */
  53222. function queueActivatedComponent (vm) {
  53223. // setting _inactive to false here so that a render function can
  53224. // rely on checking whether it's in an inactive tree (e.g. router-view)
  53225. vm._inactive = false;
  53226. activatedChildren.push(vm);
  53227. }
  53228. function callActivatedHooks (queue) {
  53229. for (var i = 0; i < queue.length; i++) {
  53230. queue[i]._inactive = true;
  53231. activateChildComponent(queue[i], true /* true */);
  53232. }
  53233. }
  53234. /**
  53235. * Push a watcher into the watcher queue.
  53236. * Jobs with duplicate IDs will be skipped unless it's
  53237. * pushed when the queue is being flushed.
  53238. */
  53239. function queueWatcher (watcher) {
  53240. var id = watcher.id;
  53241. if (has[id] == null) {
  53242. has[id] = true;
  53243. if (!flushing) {
  53244. queue.push(watcher);
  53245. } else {
  53246. // if already flushing, splice the watcher based on its id
  53247. // if already past its id, it will be run next immediately.
  53248. var i = queue.length - 1;
  53249. while (i > index && queue[i].id > watcher.id) {
  53250. i--;
  53251. }
  53252. queue.splice(i + 1, 0, watcher);
  53253. }
  53254. // queue the flush
  53255. if (!waiting) {
  53256. waiting = true;
  53257. if (!config.async) {
  53258. flushSchedulerQueue();
  53259. return
  53260. }
  53261. nextTick(flushSchedulerQueue);
  53262. }
  53263. }
  53264. }
  53265. /* */
  53266. var uid$2 = 0;
  53267. /**
  53268. * A watcher parses an expression, collects dependencies,
  53269. * and fires callback when the expression value changes.
  53270. * This is used for both the $watch() api and directives.
  53271. */
  53272. var Watcher = function Watcher (
  53273. vm,
  53274. expOrFn,
  53275. cb,
  53276. options,
  53277. isRenderWatcher
  53278. ) {
  53279. this.vm = vm;
  53280. if (isRenderWatcher) {
  53281. vm._watcher = this;
  53282. }
  53283. vm._watchers.push(this);
  53284. // options
  53285. if (options) {
  53286. this.deep = !!options.deep;
  53287. this.user = !!options.user;
  53288. this.lazy = !!options.lazy;
  53289. this.sync = !!options.sync;
  53290. this.before = options.before;
  53291. } else {
  53292. this.deep = this.user = this.lazy = this.sync = false;
  53293. }
  53294. this.cb = cb;
  53295. this.id = ++uid$2; // uid for batching
  53296. this.active = true;
  53297. this.dirty = this.lazy; // for lazy watchers
  53298. this.deps = [];
  53299. this.newDeps = [];
  53300. this.depIds = new _Set();
  53301. this.newDepIds = new _Set();
  53302. this.expression = expOrFn.toString();
  53303. // parse expression for getter
  53304. if (typeof expOrFn === 'function') {
  53305. this.getter = expOrFn;
  53306. } else {
  53307. this.getter = parsePath(expOrFn);
  53308. if (!this.getter) {
  53309. this.getter = noop;
  53310. warn(
  53311. "Failed watching path: \"" + expOrFn + "\" " +
  53312. 'Watcher only accepts simple dot-delimited paths. ' +
  53313. 'For full control, use a function instead.',
  53314. vm
  53315. );
  53316. }
  53317. }
  53318. this.value = this.lazy
  53319. ? undefined
  53320. : this.get();
  53321. };
  53322. /**
  53323. * Evaluate the getter, and re-collect dependencies.
  53324. */
  53325. Watcher.prototype.get = function get () {
  53326. pushTarget(this);
  53327. var value;
  53328. var vm = this.vm;
  53329. try {
  53330. value = this.getter.call(vm, vm);
  53331. } catch (e) {
  53332. if (this.user) {
  53333. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  53334. } else {
  53335. throw e
  53336. }
  53337. } finally {
  53338. // "touch" every property so they are all tracked as
  53339. // dependencies for deep watching
  53340. if (this.deep) {
  53341. traverse(value);
  53342. }
  53343. popTarget();
  53344. this.cleanupDeps();
  53345. }
  53346. return value
  53347. };
  53348. /**
  53349. * Add a dependency to this directive.
  53350. */
  53351. Watcher.prototype.addDep = function addDep (dep) {
  53352. var id = dep.id;
  53353. if (!this.newDepIds.has(id)) {
  53354. this.newDepIds.add(id);
  53355. this.newDeps.push(dep);
  53356. if (!this.depIds.has(id)) {
  53357. dep.addSub(this);
  53358. }
  53359. }
  53360. };
  53361. /**
  53362. * Clean up for dependency collection.
  53363. */
  53364. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  53365. var i = this.deps.length;
  53366. while (i--) {
  53367. var dep = this.deps[i];
  53368. if (!this.newDepIds.has(dep.id)) {
  53369. dep.removeSub(this);
  53370. }
  53371. }
  53372. var tmp = this.depIds;
  53373. this.depIds = this.newDepIds;
  53374. this.newDepIds = tmp;
  53375. this.newDepIds.clear();
  53376. tmp = this.deps;
  53377. this.deps = this.newDeps;
  53378. this.newDeps = tmp;
  53379. this.newDeps.length = 0;
  53380. };
  53381. /**
  53382. * Subscriber interface.
  53383. * Will be called when a dependency changes.
  53384. */
  53385. Watcher.prototype.update = function update () {
  53386. /* istanbul ignore else */
  53387. if (this.lazy) {
  53388. this.dirty = true;
  53389. } else if (this.sync) {
  53390. this.run();
  53391. } else {
  53392. queueWatcher(this);
  53393. }
  53394. };
  53395. /**
  53396. * Scheduler job interface.
  53397. * Will be called by the scheduler.
  53398. */
  53399. Watcher.prototype.run = function run () {
  53400. if (this.active) {
  53401. var value = this.get();
  53402. if (
  53403. value !== this.value ||
  53404. // Deep watchers and watchers on Object/Arrays should fire even
  53405. // when the value is the same, because the value may
  53406. // have mutated.
  53407. isObject(value) ||
  53408. this.deep
  53409. ) {
  53410. // set new value
  53411. var oldValue = this.value;
  53412. this.value = value;
  53413. if (this.user) {
  53414. try {
  53415. this.cb.call(this.vm, value, oldValue);
  53416. } catch (e) {
  53417. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  53418. }
  53419. } else {
  53420. this.cb.call(this.vm, value, oldValue);
  53421. }
  53422. }
  53423. }
  53424. };
  53425. /**
  53426. * Evaluate the value of the watcher.
  53427. * This only gets called for lazy watchers.
  53428. */
  53429. Watcher.prototype.evaluate = function evaluate () {
  53430. this.value = this.get();
  53431. this.dirty = false;
  53432. };
  53433. /**
  53434. * Depend on all deps collected by this watcher.
  53435. */
  53436. Watcher.prototype.depend = function depend () {
  53437. var i = this.deps.length;
  53438. while (i--) {
  53439. this.deps[i].depend();
  53440. }
  53441. };
  53442. /**
  53443. * Remove self from all dependencies' subscriber list.
  53444. */
  53445. Watcher.prototype.teardown = function teardown () {
  53446. if (this.active) {
  53447. // remove self from vm's watcher list
  53448. // this is a somewhat expensive operation so we skip it
  53449. // if the vm is being destroyed.
  53450. if (!this.vm._isBeingDestroyed) {
  53451. remove(this.vm._watchers, this);
  53452. }
  53453. var i = this.deps.length;
  53454. while (i--) {
  53455. this.deps[i].removeSub(this);
  53456. }
  53457. this.active = false;
  53458. }
  53459. };
  53460. /* */
  53461. var sharedPropertyDefinition = {
  53462. enumerable: true,
  53463. configurable: true,
  53464. get: noop,
  53465. set: noop
  53466. };
  53467. function proxy (target, sourceKey, key) {
  53468. sharedPropertyDefinition.get = function proxyGetter () {
  53469. return this[sourceKey][key]
  53470. };
  53471. sharedPropertyDefinition.set = function proxySetter (val) {
  53472. this[sourceKey][key] = val;
  53473. };
  53474. Object.defineProperty(target, key, sharedPropertyDefinition);
  53475. }
  53476. function initState (vm) {
  53477. vm._watchers = [];
  53478. var opts = vm.$options;
  53479. if (opts.props) { initProps(vm, opts.props); }
  53480. if (opts.methods) { initMethods(vm, opts.methods); }
  53481. if (opts.data) {
  53482. initData(vm);
  53483. } else {
  53484. observe(vm._data = {}, true /* asRootData */);
  53485. }
  53486. if (opts.computed) { initComputed(vm, opts.computed); }
  53487. if (opts.watch && opts.watch !== nativeWatch) {
  53488. initWatch(vm, opts.watch);
  53489. }
  53490. }
  53491. function initProps (vm, propsOptions) {
  53492. var propsData = vm.$options.propsData || {};
  53493. var props = vm._props = {};
  53494. // cache prop keys so that future props updates can iterate using Array
  53495. // instead of dynamic object key enumeration.
  53496. var keys = vm.$options._propKeys = [];
  53497. var isRoot = !vm.$parent;
  53498. // root instance props should be converted
  53499. if (!isRoot) {
  53500. toggleObserving(false);
  53501. }
  53502. var loop = function ( key ) {
  53503. keys.push(key);
  53504. var value = validateProp(key, propsOptions, propsData, vm);
  53505. /* istanbul ignore else */
  53506. {
  53507. var hyphenatedKey = hyphenate(key);
  53508. if (isReservedAttribute(hyphenatedKey) ||
  53509. config.isReservedAttr(hyphenatedKey)) {
  53510. warn(
  53511. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  53512. vm
  53513. );
  53514. }
  53515. defineReactive$$1(props, key, value, function () {
  53516. if (!isRoot && !isUpdatingChildComponent) {
  53517. warn(
  53518. "Avoid mutating a prop directly since the value will be " +
  53519. "overwritten whenever the parent component re-renders. " +
  53520. "Instead, use a data or computed property based on the prop's " +
  53521. "value. Prop being mutated: \"" + key + "\"",
  53522. vm
  53523. );
  53524. }
  53525. });
  53526. }
  53527. // static props are already proxied on the component's prototype
  53528. // during Vue.extend(). We only need to proxy props defined at
  53529. // instantiation here.
  53530. if (!(key in vm)) {
  53531. proxy(vm, "_props", key);
  53532. }
  53533. };
  53534. for (var key in propsOptions) loop( key );
  53535. toggleObserving(true);
  53536. }
  53537. function initData (vm) {
  53538. var data = vm.$options.data;
  53539. data = vm._data = typeof data === 'function'
  53540. ? getData(data, vm)
  53541. : data || {};
  53542. if (!isPlainObject(data)) {
  53543. data = {};
  53544. warn(
  53545. 'data functions should return an object:\n' +
  53546. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  53547. vm
  53548. );
  53549. }
  53550. // proxy data on instance
  53551. var keys = Object.keys(data);
  53552. var props = vm.$options.props;
  53553. var methods = vm.$options.methods;
  53554. var i = keys.length;
  53555. while (i--) {
  53556. var key = keys[i];
  53557. {
  53558. if (methods && hasOwn(methods, key)) {
  53559. warn(
  53560. ("Method \"" + key + "\" has already been defined as a data property."),
  53561. vm
  53562. );
  53563. }
  53564. }
  53565. if (props && hasOwn(props, key)) {
  53566. warn(
  53567. "The data property \"" + key + "\" is already declared as a prop. " +
  53568. "Use prop default value instead.",
  53569. vm
  53570. );
  53571. } else if (!isReserved(key)) {
  53572. proxy(vm, "_data", key);
  53573. }
  53574. }
  53575. // observe data
  53576. observe(data, true /* asRootData */);
  53577. }
  53578. function getData (data, vm) {
  53579. // #7573 disable dep collection when invoking data getters
  53580. pushTarget();
  53581. try {
  53582. return data.call(vm, vm)
  53583. } catch (e) {
  53584. handleError(e, vm, "data()");
  53585. return {}
  53586. } finally {
  53587. popTarget();
  53588. }
  53589. }
  53590. var computedWatcherOptions = { lazy: true };
  53591. function initComputed (vm, computed) {
  53592. // $flow-disable-line
  53593. var watchers = vm._computedWatchers = Object.create(null);
  53594. // computed properties are just getters during SSR
  53595. var isSSR = isServerRendering();
  53596. for (var key in computed) {
  53597. var userDef = computed[key];
  53598. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  53599. if (getter == null) {
  53600. warn(
  53601. ("Getter is missing for computed property \"" + key + "\"."),
  53602. vm
  53603. );
  53604. }
  53605. if (!isSSR) {
  53606. // create internal watcher for the computed property.
  53607. watchers[key] = new Watcher(
  53608. vm,
  53609. getter || noop,
  53610. noop,
  53611. computedWatcherOptions
  53612. );
  53613. }
  53614. // component-defined computed properties are already defined on the
  53615. // component prototype. We only need to define computed properties defined
  53616. // at instantiation here.
  53617. if (!(key in vm)) {
  53618. defineComputed(vm, key, userDef);
  53619. } else {
  53620. if (key in vm.$data) {
  53621. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  53622. } else if (vm.$options.props && key in vm.$options.props) {
  53623. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  53624. }
  53625. }
  53626. }
  53627. }
  53628. function defineComputed (
  53629. target,
  53630. key,
  53631. userDef
  53632. ) {
  53633. var shouldCache = !isServerRendering();
  53634. if (typeof userDef === 'function') {
  53635. sharedPropertyDefinition.get = shouldCache
  53636. ? createComputedGetter(key)
  53637. : createGetterInvoker(userDef);
  53638. sharedPropertyDefinition.set = noop;
  53639. } else {
  53640. sharedPropertyDefinition.get = userDef.get
  53641. ? shouldCache && userDef.cache !== false
  53642. ? createComputedGetter(key)
  53643. : createGetterInvoker(userDef.get)
  53644. : noop;
  53645. sharedPropertyDefinition.set = userDef.set || noop;
  53646. }
  53647. if (sharedPropertyDefinition.set === noop) {
  53648. sharedPropertyDefinition.set = function () {
  53649. warn(
  53650. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  53651. this
  53652. );
  53653. };
  53654. }
  53655. Object.defineProperty(target, key, sharedPropertyDefinition);
  53656. }
  53657. function createComputedGetter (key) {
  53658. return function computedGetter () {
  53659. var watcher = this._computedWatchers && this._computedWatchers[key];
  53660. if (watcher) {
  53661. if (watcher.dirty) {
  53662. watcher.evaluate();
  53663. }
  53664. if (Dep.target) {
  53665. watcher.depend();
  53666. }
  53667. return watcher.value
  53668. }
  53669. }
  53670. }
  53671. function createGetterInvoker(fn) {
  53672. return function computedGetter () {
  53673. return fn.call(this, this)
  53674. }
  53675. }
  53676. function initMethods (vm, methods) {
  53677. var props = vm.$options.props;
  53678. for (var key in methods) {
  53679. {
  53680. if (typeof methods[key] !== 'function') {
  53681. warn(
  53682. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  53683. "Did you reference the function correctly?",
  53684. vm
  53685. );
  53686. }
  53687. if (props && hasOwn(props, key)) {
  53688. warn(
  53689. ("Method \"" + key + "\" has already been defined as a prop."),
  53690. vm
  53691. );
  53692. }
  53693. if ((key in vm) && isReserved(key)) {
  53694. warn(
  53695. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  53696. "Avoid defining component methods that start with _ or $."
  53697. );
  53698. }
  53699. }
  53700. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  53701. }
  53702. }
  53703. function initWatch (vm, watch) {
  53704. for (var key in watch) {
  53705. var handler = watch[key];
  53706. if (Array.isArray(handler)) {
  53707. for (var i = 0; i < handler.length; i++) {
  53708. createWatcher(vm, key, handler[i]);
  53709. }
  53710. } else {
  53711. createWatcher(vm, key, handler);
  53712. }
  53713. }
  53714. }
  53715. function createWatcher (
  53716. vm,
  53717. expOrFn,
  53718. handler,
  53719. options
  53720. ) {
  53721. if (isPlainObject(handler)) {
  53722. options = handler;
  53723. handler = handler.handler;
  53724. }
  53725. if (typeof handler === 'string') {
  53726. handler = vm[handler];
  53727. }
  53728. return vm.$watch(expOrFn, handler, options)
  53729. }
  53730. function stateMixin (Vue) {
  53731. // flow somehow has problems with directly declared definition object
  53732. // when using Object.defineProperty, so we have to procedurally build up
  53733. // the object here.
  53734. var dataDef = {};
  53735. dataDef.get = function () { return this._data };
  53736. var propsDef = {};
  53737. propsDef.get = function () { return this._props };
  53738. {
  53739. dataDef.set = function () {
  53740. warn(
  53741. 'Avoid replacing instance root $data. ' +
  53742. 'Use nested data properties instead.',
  53743. this
  53744. );
  53745. };
  53746. propsDef.set = function () {
  53747. warn("$props is readonly.", this);
  53748. };
  53749. }
  53750. Object.defineProperty(Vue.prototype, '$data', dataDef);
  53751. Object.defineProperty(Vue.prototype, '$props', propsDef);
  53752. Vue.prototype.$set = set;
  53753. Vue.prototype.$delete = del;
  53754. Vue.prototype.$watch = function (
  53755. expOrFn,
  53756. cb,
  53757. options
  53758. ) {
  53759. var vm = this;
  53760. if (isPlainObject(cb)) {
  53761. return createWatcher(vm, expOrFn, cb, options)
  53762. }
  53763. options = options || {};
  53764. options.user = true;
  53765. var watcher = new Watcher(vm, expOrFn, cb, options);
  53766. if (options.immediate) {
  53767. try {
  53768. cb.call(vm, watcher.value);
  53769. } catch (error) {
  53770. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  53771. }
  53772. }
  53773. return function unwatchFn () {
  53774. watcher.teardown();
  53775. }
  53776. };
  53777. }
  53778. /* */
  53779. var uid$3 = 0;
  53780. function initMixin (Vue) {
  53781. Vue.prototype._init = function (options) {
  53782. var vm = this;
  53783. // a uid
  53784. vm._uid = uid$3++;
  53785. var startTag, endTag;
  53786. /* istanbul ignore if */
  53787. if (config.performance && mark) {
  53788. startTag = "vue-perf-start:" + (vm._uid);
  53789. endTag = "vue-perf-end:" + (vm._uid);
  53790. mark(startTag);
  53791. }
  53792. // a flag to avoid this being observed
  53793. vm._isVue = true;
  53794. // merge options
  53795. if (options && options._isComponent) {
  53796. // optimize internal component instantiation
  53797. // since dynamic options merging is pretty slow, and none of the
  53798. // internal component options needs special treatment.
  53799. initInternalComponent(vm, options);
  53800. } else {
  53801. vm.$options = mergeOptions(
  53802. resolveConstructorOptions(vm.constructor),
  53803. options || {},
  53804. vm
  53805. );
  53806. }
  53807. /* istanbul ignore else */
  53808. {
  53809. initProxy(vm);
  53810. }
  53811. // expose real self
  53812. vm._self = vm;
  53813. initLifecycle(vm);
  53814. initEvents(vm);
  53815. initRender(vm);
  53816. callHook(vm, 'beforeCreate');
  53817. initInjections(vm); // resolve injections before data/props
  53818. initState(vm);
  53819. initProvide(vm); // resolve provide after data/props
  53820. callHook(vm, 'created');
  53821. /* istanbul ignore if */
  53822. if (config.performance && mark) {
  53823. vm._name = formatComponentName(vm, false);
  53824. mark(endTag);
  53825. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  53826. }
  53827. if (vm.$options.el) {
  53828. vm.$mount(vm.$options.el);
  53829. }
  53830. };
  53831. }
  53832. function initInternalComponent (vm, options) {
  53833. var opts = vm.$options = Object.create(vm.constructor.options);
  53834. // doing this because it's faster than dynamic enumeration.
  53835. var parentVnode = options._parentVnode;
  53836. opts.parent = options.parent;
  53837. opts._parentVnode = parentVnode;
  53838. var vnodeComponentOptions = parentVnode.componentOptions;
  53839. opts.propsData = vnodeComponentOptions.propsData;
  53840. opts._parentListeners = vnodeComponentOptions.listeners;
  53841. opts._renderChildren = vnodeComponentOptions.children;
  53842. opts._componentTag = vnodeComponentOptions.tag;
  53843. if (options.render) {
  53844. opts.render = options.render;
  53845. opts.staticRenderFns = options.staticRenderFns;
  53846. }
  53847. }
  53848. function resolveConstructorOptions (Ctor) {
  53849. var options = Ctor.options;
  53850. if (Ctor.super) {
  53851. var superOptions = resolveConstructorOptions(Ctor.super);
  53852. var cachedSuperOptions = Ctor.superOptions;
  53853. if (superOptions !== cachedSuperOptions) {
  53854. // super option changed,
  53855. // need to resolve new options.
  53856. Ctor.superOptions = superOptions;
  53857. // check if there are any late-modified/attached options (#4976)
  53858. var modifiedOptions = resolveModifiedOptions(Ctor);
  53859. // update base extend options
  53860. if (modifiedOptions) {
  53861. extend(Ctor.extendOptions, modifiedOptions);
  53862. }
  53863. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  53864. if (options.name) {
  53865. options.components[options.name] = Ctor;
  53866. }
  53867. }
  53868. }
  53869. return options
  53870. }
  53871. function resolveModifiedOptions (Ctor) {
  53872. var modified;
  53873. var latest = Ctor.options;
  53874. var sealed = Ctor.sealedOptions;
  53875. for (var key in latest) {
  53876. if (latest[key] !== sealed[key]) {
  53877. if (!modified) { modified = {}; }
  53878. modified[key] = latest[key];
  53879. }
  53880. }
  53881. return modified
  53882. }
  53883. function Vue (options) {
  53884. if (!(this instanceof Vue)
  53885. ) {
  53886. warn('Vue is a constructor and should be called with the `new` keyword');
  53887. }
  53888. this._init(options);
  53889. }
  53890. initMixin(Vue);
  53891. stateMixin(Vue);
  53892. eventsMixin(Vue);
  53893. lifecycleMixin(Vue);
  53894. renderMixin(Vue);
  53895. /* */
  53896. function initUse (Vue) {
  53897. Vue.use = function (plugin) {
  53898. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  53899. if (installedPlugins.indexOf(plugin) > -1) {
  53900. return this
  53901. }
  53902. // additional parameters
  53903. var args = toArray(arguments, 1);
  53904. args.unshift(this);
  53905. if (typeof plugin.install === 'function') {
  53906. plugin.install.apply(plugin, args);
  53907. } else if (typeof plugin === 'function') {
  53908. plugin.apply(null, args);
  53909. }
  53910. installedPlugins.push(plugin);
  53911. return this
  53912. };
  53913. }
  53914. /* */
  53915. function initMixin$1 (Vue) {
  53916. Vue.mixin = function (mixin) {
  53917. this.options = mergeOptions(this.options, mixin);
  53918. return this
  53919. };
  53920. }
  53921. /* */
  53922. function initExtend (Vue) {
  53923. /**
  53924. * Each instance constructor, including Vue, has a unique
  53925. * cid. This enables us to create wrapped "child
  53926. * constructors" for prototypal inheritance and cache them.
  53927. */
  53928. Vue.cid = 0;
  53929. var cid = 1;
  53930. /**
  53931. * Class inheritance
  53932. */
  53933. Vue.extend = function (extendOptions) {
  53934. extendOptions = extendOptions || {};
  53935. var Super = this;
  53936. var SuperId = Super.cid;
  53937. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  53938. if (cachedCtors[SuperId]) {
  53939. return cachedCtors[SuperId]
  53940. }
  53941. var name = extendOptions.name || Super.options.name;
  53942. if (name) {
  53943. validateComponentName(name);
  53944. }
  53945. var Sub = function VueComponent (options) {
  53946. this._init(options);
  53947. };
  53948. Sub.prototype = Object.create(Super.prototype);
  53949. Sub.prototype.constructor = Sub;
  53950. Sub.cid = cid++;
  53951. Sub.options = mergeOptions(
  53952. Super.options,
  53953. extendOptions
  53954. );
  53955. Sub['super'] = Super;
  53956. // For props and computed properties, we define the proxy getters on
  53957. // the Vue instances at extension time, on the extended prototype. This
  53958. // avoids Object.defineProperty calls for each instance created.
  53959. if (Sub.options.props) {
  53960. initProps$1(Sub);
  53961. }
  53962. if (Sub.options.computed) {
  53963. initComputed$1(Sub);
  53964. }
  53965. // allow further extension/mixin/plugin usage
  53966. Sub.extend = Super.extend;
  53967. Sub.mixin = Super.mixin;
  53968. Sub.use = Super.use;
  53969. // create asset registers, so extended classes
  53970. // can have their private assets too.
  53971. ASSET_TYPES.forEach(function (type) {
  53972. Sub[type] = Super[type];
  53973. });
  53974. // enable recursive self-lookup
  53975. if (name) {
  53976. Sub.options.components[name] = Sub;
  53977. }
  53978. // keep a reference to the super options at extension time.
  53979. // later at instantiation we can check if Super's options have
  53980. // been updated.
  53981. Sub.superOptions = Super.options;
  53982. Sub.extendOptions = extendOptions;
  53983. Sub.sealedOptions = extend({}, Sub.options);
  53984. // cache constructor
  53985. cachedCtors[SuperId] = Sub;
  53986. return Sub
  53987. };
  53988. }
  53989. function initProps$1 (Comp) {
  53990. var props = Comp.options.props;
  53991. for (var key in props) {
  53992. proxy(Comp.prototype, "_props", key);
  53993. }
  53994. }
  53995. function initComputed$1 (Comp) {
  53996. var computed = Comp.options.computed;
  53997. for (var key in computed) {
  53998. defineComputed(Comp.prototype, key, computed[key]);
  53999. }
  54000. }
  54001. /* */
  54002. function initAssetRegisters (Vue) {
  54003. /**
  54004. * Create asset registration methods.
  54005. */
  54006. ASSET_TYPES.forEach(function (type) {
  54007. Vue[type] = function (
  54008. id,
  54009. definition
  54010. ) {
  54011. if (!definition) {
  54012. return this.options[type + 's'][id]
  54013. } else {
  54014. /* istanbul ignore if */
  54015. if (type === 'component') {
  54016. validateComponentName(id);
  54017. }
  54018. if (type === 'component' && isPlainObject(definition)) {
  54019. definition.name = definition.name || id;
  54020. definition = this.options._base.extend(definition);
  54021. }
  54022. if (type === 'directive' && typeof definition === 'function') {
  54023. definition = { bind: definition, update: definition };
  54024. }
  54025. this.options[type + 's'][id] = definition;
  54026. return definition
  54027. }
  54028. };
  54029. });
  54030. }
  54031. /* */
  54032. function getComponentName (opts) {
  54033. return opts && (opts.Ctor.options.name || opts.tag)
  54034. }
  54035. function matches (pattern, name) {
  54036. if (Array.isArray(pattern)) {
  54037. return pattern.indexOf(name) > -1
  54038. } else if (typeof pattern === 'string') {
  54039. return pattern.split(',').indexOf(name) > -1
  54040. } else if (isRegExp(pattern)) {
  54041. return pattern.test(name)
  54042. }
  54043. /* istanbul ignore next */
  54044. return false
  54045. }
  54046. function pruneCache (keepAliveInstance, filter) {
  54047. var cache = keepAliveInstance.cache;
  54048. var keys = keepAliveInstance.keys;
  54049. var _vnode = keepAliveInstance._vnode;
  54050. for (var key in cache) {
  54051. var cachedNode = cache[key];
  54052. if (cachedNode) {
  54053. var name = getComponentName(cachedNode.componentOptions);
  54054. if (name && !filter(name)) {
  54055. pruneCacheEntry(cache, key, keys, _vnode);
  54056. }
  54057. }
  54058. }
  54059. }
  54060. function pruneCacheEntry (
  54061. cache,
  54062. key,
  54063. keys,
  54064. current
  54065. ) {
  54066. var cached$$1 = cache[key];
  54067. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  54068. cached$$1.componentInstance.$destroy();
  54069. }
  54070. cache[key] = null;
  54071. remove(keys, key);
  54072. }
  54073. var patternTypes = [String, RegExp, Array];
  54074. var KeepAlive = {
  54075. name: 'keep-alive',
  54076. abstract: true,
  54077. props: {
  54078. include: patternTypes,
  54079. exclude: patternTypes,
  54080. max: [String, Number]
  54081. },
  54082. created: function created () {
  54083. this.cache = Object.create(null);
  54084. this.keys = [];
  54085. },
  54086. destroyed: function destroyed () {
  54087. for (var key in this.cache) {
  54088. pruneCacheEntry(this.cache, key, this.keys);
  54089. }
  54090. },
  54091. mounted: function mounted () {
  54092. var this$1 = this;
  54093. this.$watch('include', function (val) {
  54094. pruneCache(this$1, function (name) { return matches(val, name); });
  54095. });
  54096. this.$watch('exclude', function (val) {
  54097. pruneCache(this$1, function (name) { return !matches(val, name); });
  54098. });
  54099. },
  54100. render: function render () {
  54101. var slot = this.$slots.default;
  54102. var vnode = getFirstComponentChild(slot);
  54103. var componentOptions = vnode && vnode.componentOptions;
  54104. if (componentOptions) {
  54105. // check pattern
  54106. var name = getComponentName(componentOptions);
  54107. var ref = this;
  54108. var include = ref.include;
  54109. var exclude = ref.exclude;
  54110. if (
  54111. // not included
  54112. (include && (!name || !matches(include, name))) ||
  54113. // excluded
  54114. (exclude && name && matches(exclude, name))
  54115. ) {
  54116. return vnode
  54117. }
  54118. var ref$1 = this;
  54119. var cache = ref$1.cache;
  54120. var keys = ref$1.keys;
  54121. var key = vnode.key == null
  54122. // same constructor may get registered as different local components
  54123. // so cid alone is not enough (#3269)
  54124. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  54125. : vnode.key;
  54126. if (cache[key]) {
  54127. vnode.componentInstance = cache[key].componentInstance;
  54128. // make current key freshest
  54129. remove(keys, key);
  54130. keys.push(key);
  54131. } else {
  54132. cache[key] = vnode;
  54133. keys.push(key);
  54134. // prune oldest entry
  54135. if (this.max && keys.length > parseInt(this.max)) {
  54136. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  54137. }
  54138. }
  54139. vnode.data.keepAlive = true;
  54140. }
  54141. return vnode || (slot && slot[0])
  54142. }
  54143. };
  54144. var builtInComponents = {
  54145. KeepAlive: KeepAlive
  54146. };
  54147. /* */
  54148. function initGlobalAPI (Vue) {
  54149. // config
  54150. var configDef = {};
  54151. configDef.get = function () { return config; };
  54152. {
  54153. configDef.set = function () {
  54154. warn(
  54155. 'Do not replace the Vue.config object, set individual fields instead.'
  54156. );
  54157. };
  54158. }
  54159. Object.defineProperty(Vue, 'config', configDef);
  54160. // exposed util methods.
  54161. // NOTE: these are not considered part of the public API - avoid relying on
  54162. // them unless you are aware of the risk.
  54163. Vue.util = {
  54164. warn: warn,
  54165. extend: extend,
  54166. mergeOptions: mergeOptions,
  54167. defineReactive: defineReactive$$1
  54168. };
  54169. Vue.set = set;
  54170. Vue.delete = del;
  54171. Vue.nextTick = nextTick;
  54172. // 2.6 explicit observable API
  54173. Vue.observable = function (obj) {
  54174. observe(obj);
  54175. return obj
  54176. };
  54177. Vue.options = Object.create(null);
  54178. ASSET_TYPES.forEach(function (type) {
  54179. Vue.options[type + 's'] = Object.create(null);
  54180. });
  54181. // this is used to identify the "base" constructor to extend all plain-object
  54182. // components with in Weex's multi-instance scenarios.
  54183. Vue.options._base = Vue;
  54184. extend(Vue.options.components, builtInComponents);
  54185. initUse(Vue);
  54186. initMixin$1(Vue);
  54187. initExtend(Vue);
  54188. initAssetRegisters(Vue);
  54189. }
  54190. initGlobalAPI(Vue);
  54191. Object.defineProperty(Vue.prototype, '$isServer', {
  54192. get: isServerRendering
  54193. });
  54194. Object.defineProperty(Vue.prototype, '$ssrContext', {
  54195. get: function get () {
  54196. /* istanbul ignore next */
  54197. return this.$vnode && this.$vnode.ssrContext
  54198. }
  54199. });
  54200. // expose FunctionalRenderContext for ssr runtime helper installation
  54201. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  54202. value: FunctionalRenderContext
  54203. });
  54204. Vue.version = '2.6.11';
  54205. /* */
  54206. // these are reserved for web because they are directly compiled away
  54207. // during template compilation
  54208. var isReservedAttr = makeMap('style,class');
  54209. // attributes that should be using props for binding
  54210. var acceptValue = makeMap('input,textarea,option,select,progress');
  54211. var mustUseProp = function (tag, type, attr) {
  54212. return (
  54213. (attr === 'value' && acceptValue(tag)) && type !== 'button' ||
  54214. (attr === 'selected' && tag === 'option') ||
  54215. (attr === 'checked' && tag === 'input') ||
  54216. (attr === 'muted' && tag === 'video')
  54217. )
  54218. };
  54219. var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck');
  54220. var isValidContentEditableValue = makeMap('events,caret,typing,plaintext-only');
  54221. var convertEnumeratedValue = function (key, value) {
  54222. return isFalsyAttrValue(value) || value === 'false'
  54223. ? 'false'
  54224. // allow arbitrary string value for contenteditable
  54225. : key === 'contenteditable' && isValidContentEditableValue(value)
  54226. ? value
  54227. : 'true'
  54228. };
  54229. var isBooleanAttr = makeMap(
  54230. 'allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' +
  54231. 'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +
  54232. 'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +
  54233. 'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +
  54234. 'required,reversed,scoped,seamless,selected,sortable,translate,' +
  54235. 'truespeed,typemustmatch,visible'
  54236. );
  54237. var xlinkNS = 'http://www.w3.org/1999/xlink';
  54238. var isXlink = function (name) {
  54239. return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink'
  54240. };
  54241. var getXlinkProp = function (name) {
  54242. return isXlink(name) ? name.slice(6, name.length) : ''
  54243. };
  54244. var isFalsyAttrValue = function (val) {
  54245. return val == null || val === false
  54246. };
  54247. /* */
  54248. function genClassForVnode (vnode) {
  54249. var data = vnode.data;
  54250. var parentNode = vnode;
  54251. var childNode = vnode;
  54252. while (isDef(childNode.componentInstance)) {
  54253. childNode = childNode.componentInstance._vnode;
  54254. if (childNode && childNode.data) {
  54255. data = mergeClassData(childNode.data, data);
  54256. }
  54257. }
  54258. while (isDef(parentNode = parentNode.parent)) {
  54259. if (parentNode && parentNode.data) {
  54260. data = mergeClassData(data, parentNode.data);
  54261. }
  54262. }
  54263. return renderClass(data.staticClass, data.class)
  54264. }
  54265. function mergeClassData (child, parent) {
  54266. return {
  54267. staticClass: concat(child.staticClass, parent.staticClass),
  54268. class: isDef(child.class)
  54269. ? [child.class, parent.class]
  54270. : parent.class
  54271. }
  54272. }
  54273. function renderClass (
  54274. staticClass,
  54275. dynamicClass
  54276. ) {
  54277. if (isDef(staticClass) || isDef(dynamicClass)) {
  54278. return concat(staticClass, stringifyClass(dynamicClass))
  54279. }
  54280. /* istanbul ignore next */
  54281. return ''
  54282. }
  54283. function concat (a, b) {
  54284. return a ? b ? (a + ' ' + b) : a : (b || '')
  54285. }
  54286. function stringifyClass (value) {
  54287. if (Array.isArray(value)) {
  54288. return stringifyArray(value)
  54289. }
  54290. if (isObject(value)) {
  54291. return stringifyObject(value)
  54292. }
  54293. if (typeof value === 'string') {
  54294. return value
  54295. }
  54296. /* istanbul ignore next */
  54297. return ''
  54298. }
  54299. function stringifyArray (value) {
  54300. var res = '';
  54301. var stringified;
  54302. for (var i = 0, l = value.length; i < l; i++) {
  54303. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  54304. if (res) { res += ' '; }
  54305. res += stringified;
  54306. }
  54307. }
  54308. return res
  54309. }
  54310. function stringifyObject (value) {
  54311. var res = '';
  54312. for (var key in value) {
  54313. if (value[key]) {
  54314. if (res) { res += ' '; }
  54315. res += key;
  54316. }
  54317. }
  54318. return res
  54319. }
  54320. /* */
  54321. var namespaceMap = {
  54322. svg: 'http://www.w3.org/2000/svg',
  54323. math: 'http://www.w3.org/1998/Math/MathML'
  54324. };
  54325. var isHTMLTag = makeMap(
  54326. 'html,body,base,head,link,meta,style,title,' +
  54327. 'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +
  54328. 'div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,' +
  54329. 'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +
  54330. 's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' +
  54331. 'embed,object,param,source,canvas,script,noscript,del,ins,' +
  54332. 'caption,col,colgroup,table,thead,tbody,td,th,tr,' +
  54333. 'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' +
  54334. 'output,progress,select,textarea,' +
  54335. 'details,dialog,menu,menuitem,summary,' +
  54336. 'content,element,shadow,template,blockquote,iframe,tfoot'
  54337. );
  54338. // this map is intentionally selective, only covering SVG elements that may
  54339. // contain child elements.
  54340. var isSVG = makeMap(
  54341. 'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,' +
  54342. 'foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +
  54343. 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view',
  54344. true
  54345. );
  54346. var isPreTag = function (tag) { return tag === 'pre'; };
  54347. var isReservedTag = function (tag) {
  54348. return isHTMLTag(tag) || isSVG(tag)
  54349. };
  54350. function getTagNamespace (tag) {
  54351. if (isSVG(tag)) {
  54352. return 'svg'
  54353. }
  54354. // basic support for MathML
  54355. // note it doesn't support other MathML elements being component roots
  54356. if (tag === 'math') {
  54357. return 'math'
  54358. }
  54359. }
  54360. var unknownElementCache = Object.create(null);
  54361. function isUnknownElement (tag) {
  54362. /* istanbul ignore if */
  54363. if (!inBrowser) {
  54364. return true
  54365. }
  54366. if (isReservedTag(tag)) {
  54367. return false
  54368. }
  54369. tag = tag.toLowerCase();
  54370. /* istanbul ignore if */
  54371. if (unknownElementCache[tag] != null) {
  54372. return unknownElementCache[tag]
  54373. }
  54374. var el = document.createElement(tag);
  54375. if (tag.indexOf('-') > -1) {
  54376. // http://stackoverflow.com/a/28210364/1070244
  54377. return (unknownElementCache[tag] = (
  54378. el.constructor === window.HTMLUnknownElement ||
  54379. el.constructor === window.HTMLElement
  54380. ))
  54381. } else {
  54382. return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString()))
  54383. }
  54384. }
  54385. var isTextInputType = makeMap('text,number,password,search,email,tel,url');
  54386. /* */
  54387. /**
  54388. * Query an element selector if it's not an element already.
  54389. */
  54390. function query (el) {
  54391. if (typeof el === 'string') {
  54392. var selected = document.querySelector(el);
  54393. if (!selected) {
  54394. warn(
  54395. 'Cannot find element: ' + el
  54396. );
  54397. return document.createElement('div')
  54398. }
  54399. return selected
  54400. } else {
  54401. return el
  54402. }
  54403. }
  54404. /* */
  54405. function createElement$1 (tagName, vnode) {
  54406. var elm = document.createElement(tagName);
  54407. if (tagName !== 'select') {
  54408. return elm
  54409. }
  54410. // false or null will remove the attribute but undefined will not
  54411. if (vnode.data && vnode.data.attrs && vnode.data.attrs.multiple !== undefined) {
  54412. elm.setAttribute('multiple', 'multiple');
  54413. }
  54414. return elm
  54415. }
  54416. function createElementNS (namespace, tagName) {
  54417. return document.createElementNS(namespaceMap[namespace], tagName)
  54418. }
  54419. function createTextNode (text) {
  54420. return document.createTextNode(text)
  54421. }
  54422. function createComment (text) {
  54423. return document.createComment(text)
  54424. }
  54425. function insertBefore (parentNode, newNode, referenceNode) {
  54426. parentNode.insertBefore(newNode, referenceNode);
  54427. }
  54428. function removeChild (node, child) {
  54429. node.removeChild(child);
  54430. }
  54431. function appendChild (node, child) {
  54432. node.appendChild(child);
  54433. }
  54434. function parentNode (node) {
  54435. return node.parentNode
  54436. }
  54437. function nextSibling (node) {
  54438. return node.nextSibling
  54439. }
  54440. function tagName (node) {
  54441. return node.tagName
  54442. }
  54443. function setTextContent (node, text) {
  54444. node.textContent = text;
  54445. }
  54446. function setStyleScope (node, scopeId) {
  54447. node.setAttribute(scopeId, '');
  54448. }
  54449. var nodeOps = /*#__PURE__*/Object.freeze({
  54450. createElement: createElement$1,
  54451. createElementNS: createElementNS,
  54452. createTextNode: createTextNode,
  54453. createComment: createComment,
  54454. insertBefore: insertBefore,
  54455. removeChild: removeChild,
  54456. appendChild: appendChild,
  54457. parentNode: parentNode,
  54458. nextSibling: nextSibling,
  54459. tagName: tagName,
  54460. setTextContent: setTextContent,
  54461. setStyleScope: setStyleScope
  54462. });
  54463. /* */
  54464. var ref = {
  54465. create: function create (_, vnode) {
  54466. registerRef(vnode);
  54467. },
  54468. update: function update (oldVnode, vnode) {
  54469. if (oldVnode.data.ref !== vnode.data.ref) {
  54470. registerRef(oldVnode, true);
  54471. registerRef(vnode);
  54472. }
  54473. },
  54474. destroy: function destroy (vnode) {
  54475. registerRef(vnode, true);
  54476. }
  54477. };
  54478. function registerRef (vnode, isRemoval) {
  54479. var key = vnode.data.ref;
  54480. if (!isDef(key)) { return }
  54481. var vm = vnode.context;
  54482. var ref = vnode.componentInstance || vnode.elm;
  54483. var refs = vm.$refs;
  54484. if (isRemoval) {
  54485. if (Array.isArray(refs[key])) {
  54486. remove(refs[key], ref);
  54487. } else if (refs[key] === ref) {
  54488. refs[key] = undefined;
  54489. }
  54490. } else {
  54491. if (vnode.data.refInFor) {
  54492. if (!Array.isArray(refs[key])) {
  54493. refs[key] = [ref];
  54494. } else if (refs[key].indexOf(ref) < 0) {
  54495. // $flow-disable-line
  54496. refs[key].push(ref);
  54497. }
  54498. } else {
  54499. refs[key] = ref;
  54500. }
  54501. }
  54502. }
  54503. /**
  54504. * Virtual DOM patching algorithm based on Snabbdom by
  54505. * Simon Friis Vindum (@paldepind)
  54506. * Licensed under the MIT License
  54507. * https://github.com/paldepind/snabbdom/blob/master/LICENSE
  54508. *
  54509. * modified by Evan You (@yyx990803)
  54510. *
  54511. * Not type-checking this because this file is perf-critical and the cost
  54512. * of making flow understand it is not worth it.
  54513. */
  54514. var emptyNode = new VNode('', {}, []);
  54515. var hooks = ['create', 'activate', 'update', 'remove', 'destroy'];
  54516. function sameVnode (a, b) {
  54517. return (
  54518. a.key === b.key && (
  54519. (
  54520. a.tag === b.tag &&
  54521. a.isComment === b.isComment &&
  54522. isDef(a.data) === isDef(b.data) &&
  54523. sameInputType(a, b)
  54524. ) || (
  54525. isTrue(a.isAsyncPlaceholder) &&
  54526. a.asyncFactory === b.asyncFactory &&
  54527. isUndef(b.asyncFactory.error)
  54528. )
  54529. )
  54530. )
  54531. }
  54532. function sameInputType (a, b) {
  54533. if (a.tag !== 'input') { return true }
  54534. var i;
  54535. var typeA = isDef(i = a.data) && isDef(i = i.attrs) && i.type;
  54536. var typeB = isDef(i = b.data) && isDef(i = i.attrs) && i.type;
  54537. return typeA === typeB || isTextInputType(typeA) && isTextInputType(typeB)
  54538. }
  54539. function createKeyToOldIdx (children, beginIdx, endIdx) {
  54540. var i, key;
  54541. var map = {};
  54542. for (i = beginIdx; i <= endIdx; ++i) {
  54543. key = children[i].key;
  54544. if (isDef(key)) { map[key] = i; }
  54545. }
  54546. return map
  54547. }
  54548. function createPatchFunction (backend) {
  54549. var i, j;
  54550. var cbs = {};
  54551. var modules = backend.modules;
  54552. var nodeOps = backend.nodeOps;
  54553. for (i = 0; i < hooks.length; ++i) {
  54554. cbs[hooks[i]] = [];
  54555. for (j = 0; j < modules.length; ++j) {
  54556. if (isDef(modules[j][hooks[i]])) {
  54557. cbs[hooks[i]].push(modules[j][hooks[i]]);
  54558. }
  54559. }
  54560. }
  54561. function emptyNodeAt (elm) {
  54562. return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm)
  54563. }
  54564. function createRmCb (childElm, listeners) {
  54565. function remove$$1 () {
  54566. if (--remove$$1.listeners === 0) {
  54567. removeNode(childElm);
  54568. }
  54569. }
  54570. remove$$1.listeners = listeners;
  54571. return remove$$1
  54572. }
  54573. function removeNode (el) {
  54574. var parent = nodeOps.parentNode(el);
  54575. // element may have already been removed due to v-html / v-text
  54576. if (isDef(parent)) {
  54577. nodeOps.removeChild(parent, el);
  54578. }
  54579. }
  54580. function isUnknownElement$$1 (vnode, inVPre) {
  54581. return (
  54582. !inVPre &&
  54583. !vnode.ns &&
  54584. !(
  54585. config.ignoredElements.length &&
  54586. config.ignoredElements.some(function (ignore) {
  54587. return isRegExp(ignore)
  54588. ? ignore.test(vnode.tag)
  54589. : ignore === vnode.tag
  54590. })
  54591. ) &&
  54592. config.isUnknownElement(vnode.tag)
  54593. )
  54594. }
  54595. var creatingElmInVPre = 0;
  54596. function createElm (
  54597. vnode,
  54598. insertedVnodeQueue,
  54599. parentElm,
  54600. refElm,
  54601. nested,
  54602. ownerArray,
  54603. index
  54604. ) {
  54605. if (isDef(vnode.elm) && isDef(ownerArray)) {
  54606. // This vnode was used in a previous render!
  54607. // now it's used as a new node, overwriting its elm would cause
  54608. // potential patch errors down the road when it's used as an insertion
  54609. // reference node. Instead, we clone the node on-demand before creating
  54610. // associated DOM element for it.
  54611. vnode = ownerArray[index] = cloneVNode(vnode);
  54612. }
  54613. vnode.isRootInsert = !nested; // for transition enter check
  54614. if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) {
  54615. return
  54616. }
  54617. var data = vnode.data;
  54618. var children = vnode.children;
  54619. var tag = vnode.tag;
  54620. if (isDef(tag)) {
  54621. {
  54622. if (data && data.pre) {
  54623. creatingElmInVPre++;
  54624. }
  54625. if (isUnknownElement$$1(vnode, creatingElmInVPre)) {
  54626. warn(
  54627. 'Unknown custom element: <' + tag + '> - did you ' +
  54628. 'register the component correctly? For recursive components, ' +
  54629. 'make sure to provide the "name" option.',
  54630. vnode.context
  54631. );
  54632. }
  54633. }
  54634. vnode.elm = vnode.ns
  54635. ? nodeOps.createElementNS(vnode.ns, tag)
  54636. : nodeOps.createElement(tag, vnode);
  54637. setScope(vnode);
  54638. /* istanbul ignore if */
  54639. {
  54640. createChildren(vnode, children, insertedVnodeQueue);
  54641. if (isDef(data)) {
  54642. invokeCreateHooks(vnode, insertedVnodeQueue);
  54643. }
  54644. insert(parentElm, vnode.elm, refElm);
  54645. }
  54646. if (data && data.pre) {
  54647. creatingElmInVPre--;
  54648. }
  54649. } else if (isTrue(vnode.isComment)) {
  54650. vnode.elm = nodeOps.createComment(vnode.text);
  54651. insert(parentElm, vnode.elm, refElm);
  54652. } else {
  54653. vnode.elm = nodeOps.createTextNode(vnode.text);
  54654. insert(parentElm, vnode.elm, refElm);
  54655. }
  54656. }
  54657. function createComponent (vnode, insertedVnodeQueue, parentElm, refElm) {
  54658. var i = vnode.data;
  54659. if (isDef(i)) {
  54660. var isReactivated = isDef(vnode.componentInstance) && i.keepAlive;
  54661. if (isDef(i = i.hook) && isDef(i = i.init)) {
  54662. i(vnode, false /* hydrating */);
  54663. }
  54664. // after calling the init hook, if the vnode is a child component
  54665. // it should've created a child instance and mounted it. the child
  54666. // component also has set the placeholder vnode's elm.
  54667. // in that case we can just return the element and be done.
  54668. if (isDef(vnode.componentInstance)) {
  54669. initComponent(vnode, insertedVnodeQueue);
  54670. insert(parentElm, vnode.elm, refElm);
  54671. if (isTrue(isReactivated)) {
  54672. reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm);
  54673. }
  54674. return true
  54675. }
  54676. }
  54677. }
  54678. function initComponent (vnode, insertedVnodeQueue) {
  54679. if (isDef(vnode.data.pendingInsert)) {
  54680. insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert);
  54681. vnode.data.pendingInsert = null;
  54682. }
  54683. vnode.elm = vnode.componentInstance.$el;
  54684. if (isPatchable(vnode)) {
  54685. invokeCreateHooks(vnode, insertedVnodeQueue);
  54686. setScope(vnode);
  54687. } else {
  54688. // empty component root.
  54689. // skip all element-related modules except for ref (#3455)
  54690. registerRef(vnode);
  54691. // make sure to invoke the insert hook
  54692. insertedVnodeQueue.push(vnode);
  54693. }
  54694. }
  54695. function reactivateComponent (vnode, insertedVnodeQueue, parentElm, refElm) {
  54696. var i;
  54697. // hack for #4339: a reactivated component with inner transition
  54698. // does not trigger because the inner node's created hooks are not called
  54699. // again. It's not ideal to involve module-specific logic in here but
  54700. // there doesn't seem to be a better way to do it.
  54701. var innerNode = vnode;
  54702. while (innerNode.componentInstance) {
  54703. innerNode = innerNode.componentInstance._vnode;
  54704. if (isDef(i = innerNode.data) && isDef(i = i.transition)) {
  54705. for (i = 0; i < cbs.activate.length; ++i) {
  54706. cbs.activate[i](emptyNode, innerNode);
  54707. }
  54708. insertedVnodeQueue.push(innerNode);
  54709. break
  54710. }
  54711. }
  54712. // unlike a newly created component,
  54713. // a reactivated keep-alive component doesn't insert itself
  54714. insert(parentElm, vnode.elm, refElm);
  54715. }
  54716. function insert (parent, elm, ref$$1) {
  54717. if (isDef(parent)) {
  54718. if (isDef(ref$$1)) {
  54719. if (nodeOps.parentNode(ref$$1) === parent) {
  54720. nodeOps.insertBefore(parent, elm, ref$$1);
  54721. }
  54722. } else {
  54723. nodeOps.appendChild(parent, elm);
  54724. }
  54725. }
  54726. }
  54727. function createChildren (vnode, children, insertedVnodeQueue) {
  54728. if (Array.isArray(children)) {
  54729. {
  54730. checkDuplicateKeys(children);
  54731. }
  54732. for (var i = 0; i < children.length; ++i) {
  54733. createElm(children[i], insertedVnodeQueue, vnode.elm, null, true, children, i);
  54734. }
  54735. } else if (isPrimitive(vnode.text)) {
  54736. nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(String(vnode.text)));
  54737. }
  54738. }
  54739. function isPatchable (vnode) {
  54740. while (vnode.componentInstance) {
  54741. vnode = vnode.componentInstance._vnode;
  54742. }
  54743. return isDef(vnode.tag)
  54744. }
  54745. function invokeCreateHooks (vnode, insertedVnodeQueue) {
  54746. for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {
  54747. cbs.create[i$1](emptyNode, vnode);
  54748. }
  54749. i = vnode.data.hook; // Reuse variable
  54750. if (isDef(i)) {
  54751. if (isDef(i.create)) { i.create(emptyNode, vnode); }
  54752. if (isDef(i.insert)) { insertedVnodeQueue.push(vnode); }
  54753. }
  54754. }
  54755. // set scope id attribute for scoped CSS.
  54756. // this is implemented as a special case to avoid the overhead
  54757. // of going through the normal attribute patching process.
  54758. function setScope (vnode) {
  54759. var i;
  54760. if (isDef(i = vnode.fnScopeId)) {
  54761. nodeOps.setStyleScope(vnode.elm, i);
  54762. } else {
  54763. var ancestor = vnode;
  54764. while (ancestor) {
  54765. if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {
  54766. nodeOps.setStyleScope(vnode.elm, i);
  54767. }
  54768. ancestor = ancestor.parent;
  54769. }
  54770. }
  54771. // for slot content they should also get the scopeId from the host instance.
  54772. if (isDef(i = activeInstance) &&
  54773. i !== vnode.context &&
  54774. i !== vnode.fnContext &&
  54775. isDef(i = i.$options._scopeId)
  54776. ) {
  54777. nodeOps.setStyleScope(vnode.elm, i);
  54778. }
  54779. }
  54780. function addVnodes (parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) {
  54781. for (; startIdx <= endIdx; ++startIdx) {
  54782. createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm, false, vnodes, startIdx);
  54783. }
  54784. }
  54785. function invokeDestroyHook (vnode) {
  54786. var i, j;
  54787. var data = vnode.data;
  54788. if (isDef(data)) {
  54789. if (isDef(i = data.hook) && isDef(i = i.destroy)) { i(vnode); }
  54790. for (i = 0; i < cbs.destroy.length; ++i) { cbs.destroy[i](vnode); }
  54791. }
  54792. if (isDef(i = vnode.children)) {
  54793. for (j = 0; j < vnode.children.length; ++j) {
  54794. invokeDestroyHook(vnode.children[j]);
  54795. }
  54796. }
  54797. }
  54798. function removeVnodes (vnodes, startIdx, endIdx) {
  54799. for (; startIdx <= endIdx; ++startIdx) {
  54800. var ch = vnodes[startIdx];
  54801. if (isDef(ch)) {
  54802. if (isDef(ch.tag)) {
  54803. removeAndInvokeRemoveHook(ch);
  54804. invokeDestroyHook(ch);
  54805. } else { // Text node
  54806. removeNode(ch.elm);
  54807. }
  54808. }
  54809. }
  54810. }
  54811. function removeAndInvokeRemoveHook (vnode, rm) {
  54812. if (isDef(rm) || isDef(vnode.data)) {
  54813. var i;
  54814. var listeners = cbs.remove.length + 1;
  54815. if (isDef(rm)) {
  54816. // we have a recursively passed down rm callback
  54817. // increase the listeners count
  54818. rm.listeners += listeners;
  54819. } else {
  54820. // directly removing
  54821. rm = createRmCb(vnode.elm, listeners);
  54822. }
  54823. // recursively invoke hooks on child component root node
  54824. if (isDef(i = vnode.componentInstance) && isDef(i = i._vnode) && isDef(i.data)) {
  54825. removeAndInvokeRemoveHook(i, rm);
  54826. }
  54827. for (i = 0; i < cbs.remove.length; ++i) {
  54828. cbs.remove[i](vnode, rm);
  54829. }
  54830. if (isDef(i = vnode.data.hook) && isDef(i = i.remove)) {
  54831. i(vnode, rm);
  54832. } else {
  54833. rm();
  54834. }
  54835. } else {
  54836. removeNode(vnode.elm);
  54837. }
  54838. }
  54839. function updateChildren (parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) {
  54840. var oldStartIdx = 0;
  54841. var newStartIdx = 0;
  54842. var oldEndIdx = oldCh.length - 1;
  54843. var oldStartVnode = oldCh[0];
  54844. var oldEndVnode = oldCh[oldEndIdx];
  54845. var newEndIdx = newCh.length - 1;
  54846. var newStartVnode = newCh[0];
  54847. var newEndVnode = newCh[newEndIdx];
  54848. var oldKeyToIdx, idxInOld, vnodeToMove, refElm;
  54849. // removeOnly is a special flag used only by <transition-group>
  54850. // to ensure removed elements stay in correct relative positions
  54851. // during leaving transitions
  54852. var canMove = !removeOnly;
  54853. {
  54854. checkDuplicateKeys(newCh);
  54855. }
  54856. while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
  54857. if (isUndef(oldStartVnode)) {
  54858. oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left
  54859. } else if (isUndef(oldEndVnode)) {
  54860. oldEndVnode = oldCh[--oldEndIdx];
  54861. } else if (sameVnode(oldStartVnode, newStartVnode)) {
  54862. patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
  54863. oldStartVnode = oldCh[++oldStartIdx];
  54864. newStartVnode = newCh[++newStartIdx];
  54865. } else if (sameVnode(oldEndVnode, newEndVnode)) {
  54866. patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);
  54867. oldEndVnode = oldCh[--oldEndIdx];
  54868. newEndVnode = newCh[--newEndIdx];
  54869. } else if (sameVnode(oldStartVnode, newEndVnode)) { // Vnode moved right
  54870. patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);
  54871. canMove && nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm));
  54872. oldStartVnode = oldCh[++oldStartIdx];
  54873. newEndVnode = newCh[--newEndIdx];
  54874. } else if (sameVnode(oldEndVnode, newStartVnode)) { // Vnode moved left
  54875. patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
  54876. canMove && nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);
  54877. oldEndVnode = oldCh[--oldEndIdx];
  54878. newStartVnode = newCh[++newStartIdx];
  54879. } else {
  54880. if (isUndef(oldKeyToIdx)) { oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx); }
  54881. idxInOld = isDef(newStartVnode.key)
  54882. ? oldKeyToIdx[newStartVnode.key]
  54883. : findIdxInOld(newStartVnode, oldCh, oldStartIdx, oldEndIdx);
  54884. if (isUndef(idxInOld)) { // New element
  54885. createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);
  54886. } else {
  54887. vnodeToMove = oldCh[idxInOld];
  54888. if (sameVnode(vnodeToMove, newStartVnode)) {
  54889. patchVnode(vnodeToMove, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
  54890. oldCh[idxInOld] = undefined;
  54891. canMove && nodeOps.insertBefore(parentElm, vnodeToMove.elm, oldStartVnode.elm);
  54892. } else {
  54893. // same key but different element. treat as new element
  54894. createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);
  54895. }
  54896. }
  54897. newStartVnode = newCh[++newStartIdx];
  54898. }
  54899. }
  54900. if (oldStartIdx > oldEndIdx) {
  54901. refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;
  54902. addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
  54903. } else if (newStartIdx > newEndIdx) {
  54904. removeVnodes(oldCh, oldStartIdx, oldEndIdx);
  54905. }
  54906. }
  54907. function checkDuplicateKeys (children) {
  54908. var seenKeys = {};
  54909. for (var i = 0; i < children.length; i++) {
  54910. var vnode = children[i];
  54911. var key = vnode.key;
  54912. if (isDef(key)) {
  54913. if (seenKeys[key]) {
  54914. warn(
  54915. ("Duplicate keys detected: '" + key + "'. This may cause an update error."),
  54916. vnode.context
  54917. );
  54918. } else {
  54919. seenKeys[key] = true;
  54920. }
  54921. }
  54922. }
  54923. }
  54924. function findIdxInOld (node, oldCh, start, end) {
  54925. for (var i = start; i < end; i++) {
  54926. var c = oldCh[i];
  54927. if (isDef(c) && sameVnode(node, c)) { return i }
  54928. }
  54929. }
  54930. function patchVnode (
  54931. oldVnode,
  54932. vnode,
  54933. insertedVnodeQueue,
  54934. ownerArray,
  54935. index,
  54936. removeOnly
  54937. ) {
  54938. if (oldVnode === vnode) {
  54939. return
  54940. }
  54941. if (isDef(vnode.elm) && isDef(ownerArray)) {
  54942. // clone reused vnode
  54943. vnode = ownerArray[index] = cloneVNode(vnode);
  54944. }
  54945. var elm = vnode.elm = oldVnode.elm;
  54946. if (isTrue(oldVnode.isAsyncPlaceholder)) {
  54947. if (isDef(vnode.asyncFactory.resolved)) {
  54948. hydrate(oldVnode.elm, vnode, insertedVnodeQueue);
  54949. } else {
  54950. vnode.isAsyncPlaceholder = true;
  54951. }
  54952. return
  54953. }
  54954. // reuse element for static trees.
  54955. // note we only do this if the vnode is cloned -
  54956. // if the new node is not cloned it means the render functions have been
  54957. // reset by the hot-reload-api and we need to do a proper re-render.
  54958. if (isTrue(vnode.isStatic) &&
  54959. isTrue(oldVnode.isStatic) &&
  54960. vnode.key === oldVnode.key &&
  54961. (isTrue(vnode.isCloned) || isTrue(vnode.isOnce))
  54962. ) {
  54963. vnode.componentInstance = oldVnode.componentInstance;
  54964. return
  54965. }
  54966. var i;
  54967. var data = vnode.data;
  54968. if (isDef(data) && isDef(i = data.hook) && isDef(i = i.prepatch)) {
  54969. i(oldVnode, vnode);
  54970. }
  54971. var oldCh = oldVnode.children;
  54972. var ch = vnode.children;
  54973. if (isDef(data) && isPatchable(vnode)) {
  54974. for (i = 0; i < cbs.update.length; ++i) { cbs.update[i](oldVnode, vnode); }
  54975. if (isDef(i = data.hook) && isDef(i = i.update)) { i(oldVnode, vnode); }
  54976. }
  54977. if (isUndef(vnode.text)) {
  54978. if (isDef(oldCh) && isDef(ch)) {
  54979. if (oldCh !== ch) { updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly); }
  54980. } else if (isDef(ch)) {
  54981. {
  54982. checkDuplicateKeys(ch);
  54983. }
  54984. if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); }
  54985. addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
  54986. } else if (isDef(oldCh)) {
  54987. removeVnodes(oldCh, 0, oldCh.length - 1);
  54988. } else if (isDef(oldVnode.text)) {
  54989. nodeOps.setTextContent(elm, '');
  54990. }
  54991. } else if (oldVnode.text !== vnode.text) {
  54992. nodeOps.setTextContent(elm, vnode.text);
  54993. }
  54994. if (isDef(data)) {
  54995. if (isDef(i = data.hook) && isDef(i = i.postpatch)) { i(oldVnode, vnode); }
  54996. }
  54997. }
  54998. function invokeInsertHook (vnode, queue, initial) {
  54999. // delay insert hooks for component root nodes, invoke them after the
  55000. // element is really inserted
  55001. if (isTrue(initial) && isDef(vnode.parent)) {
  55002. vnode.parent.data.pendingInsert = queue;
  55003. } else {
  55004. for (var i = 0; i < queue.length; ++i) {
  55005. queue[i].data.hook.insert(queue[i]);
  55006. }
  55007. }
  55008. }
  55009. var hydrationBailed = false;
  55010. // list of modules that can skip create hook during hydration because they
  55011. // are already rendered on the client or has no need for initialization
  55012. // Note: style is excluded because it relies on initial clone for future
  55013. // deep updates (#7063).
  55014. var isRenderedModule = makeMap('attrs,class,staticClass,staticStyle,key');
  55015. // Note: this is a browser-only function so we can assume elms are DOM nodes.
  55016. function hydrate (elm, vnode, insertedVnodeQueue, inVPre) {
  55017. var i;
  55018. var tag = vnode.tag;
  55019. var data = vnode.data;
  55020. var children = vnode.children;
  55021. inVPre = inVPre || (data && data.pre);
  55022. vnode.elm = elm;
  55023. if (isTrue(vnode.isComment) && isDef(vnode.asyncFactory)) {
  55024. vnode.isAsyncPlaceholder = true;
  55025. return true
  55026. }
  55027. // assert node match
  55028. {
  55029. if (!assertNodeMatch(elm, vnode, inVPre)) {
  55030. return false
  55031. }
  55032. }
  55033. if (isDef(data)) {
  55034. if (isDef(i = data.hook) && isDef(i = i.init)) { i(vnode, true /* hydrating */); }
  55035. if (isDef(i = vnode.componentInstance)) {
  55036. // child component. it should have hydrated its own tree.
  55037. initComponent(vnode, insertedVnodeQueue);
  55038. return true
  55039. }
  55040. }
  55041. if (isDef(tag)) {
  55042. if (isDef(children)) {
  55043. // empty element, allow client to pick up and populate children
  55044. if (!elm.hasChildNodes()) {
  55045. createChildren(vnode, children, insertedVnodeQueue);
  55046. } else {
  55047. // v-html and domProps: innerHTML
  55048. if (isDef(i = data) && isDef(i = i.domProps) && isDef(i = i.innerHTML)) {
  55049. if (i !== elm.innerHTML) {
  55050. /* istanbul ignore if */
  55051. if (typeof console !== 'undefined' &&
  55052. !hydrationBailed
  55053. ) {
  55054. hydrationBailed = true;
  55055. console.warn('Parent: ', elm);
  55056. console.warn('server innerHTML: ', i);
  55057. console.warn('client innerHTML: ', elm.innerHTML);
  55058. }
  55059. return false
  55060. }
  55061. } else {
  55062. // iterate and compare children lists
  55063. var childrenMatch = true;
  55064. var childNode = elm.firstChild;
  55065. for (var i$1 = 0; i$1 < children.length; i$1++) {
  55066. if (!childNode || !hydrate(childNode, children[i$1], insertedVnodeQueue, inVPre)) {
  55067. childrenMatch = false;
  55068. break
  55069. }
  55070. childNode = childNode.nextSibling;
  55071. }
  55072. // if childNode is not null, it means the actual childNodes list is
  55073. // longer than the virtual children list.
  55074. if (!childrenMatch || childNode) {
  55075. /* istanbul ignore if */
  55076. if (typeof console !== 'undefined' &&
  55077. !hydrationBailed
  55078. ) {
  55079. hydrationBailed = true;
  55080. console.warn('Parent: ', elm);
  55081. console.warn('Mismatching childNodes vs. VNodes: ', elm.childNodes, children);
  55082. }
  55083. return false
  55084. }
  55085. }
  55086. }
  55087. }
  55088. if (isDef(data)) {
  55089. var fullInvoke = false;
  55090. for (var key in data) {
  55091. if (!isRenderedModule(key)) {
  55092. fullInvoke = true;
  55093. invokeCreateHooks(vnode, insertedVnodeQueue);
  55094. break
  55095. }
  55096. }
  55097. if (!fullInvoke && data['class']) {
  55098. // ensure collecting deps for deep class bindings for future updates
  55099. traverse(data['class']);
  55100. }
  55101. }
  55102. } else if (elm.data !== vnode.text) {
  55103. elm.data = vnode.text;
  55104. }
  55105. return true
  55106. }
  55107. function assertNodeMatch (node, vnode, inVPre) {
  55108. if (isDef(vnode.tag)) {
  55109. return vnode.tag.indexOf('vue-component') === 0 || (
  55110. !isUnknownElement$$1(vnode, inVPre) &&
  55111. vnode.tag.toLowerCase() === (node.tagName && node.tagName.toLowerCase())
  55112. )
  55113. } else {
  55114. return node.nodeType === (vnode.isComment ? 8 : 3)
  55115. }
  55116. }
  55117. return function patch (oldVnode, vnode, hydrating, removeOnly) {
  55118. if (isUndef(vnode)) {
  55119. if (isDef(oldVnode)) { invokeDestroyHook(oldVnode); }
  55120. return
  55121. }
  55122. var isInitialPatch = false;
  55123. var insertedVnodeQueue = [];
  55124. if (isUndef(oldVnode)) {
  55125. // empty mount (likely as component), create new root element
  55126. isInitialPatch = true;
  55127. createElm(vnode, insertedVnodeQueue);
  55128. } else {
  55129. var isRealElement = isDef(oldVnode.nodeType);
  55130. if (!isRealElement && sameVnode(oldVnode, vnode)) {
  55131. // patch existing root node
  55132. patchVnode(oldVnode, vnode, insertedVnodeQueue, null, null, removeOnly);
  55133. } else {
  55134. if (isRealElement) {
  55135. // mounting to a real element
  55136. // check if this is server-rendered content and if we can perform
  55137. // a successful hydration.
  55138. if (oldVnode.nodeType === 1 && oldVnode.hasAttribute(SSR_ATTR)) {
  55139. oldVnode.removeAttribute(SSR_ATTR);
  55140. hydrating = true;
  55141. }
  55142. if (isTrue(hydrating)) {
  55143. if (hydrate(oldVnode, vnode, insertedVnodeQueue)) {
  55144. invokeInsertHook(vnode, insertedVnodeQueue, true);
  55145. return oldVnode
  55146. } else {
  55147. warn(
  55148. 'The client-side rendered virtual DOM tree is not matching ' +
  55149. 'server-rendered content. This is likely caused by incorrect ' +
  55150. 'HTML markup, for example nesting block-level elements inside ' +
  55151. '<p>, or missing <tbody>. Bailing hydration and performing ' +
  55152. 'full client-side render.'
  55153. );
  55154. }
  55155. }
  55156. // either not server-rendered, or hydration failed.
  55157. // create an empty node and replace it
  55158. oldVnode = emptyNodeAt(oldVnode);
  55159. }
  55160. // replacing existing element
  55161. var oldElm = oldVnode.elm;
  55162. var parentElm = nodeOps.parentNode(oldElm);
  55163. // create new node
  55164. createElm(
  55165. vnode,
  55166. insertedVnodeQueue,
  55167. // extremely rare edge case: do not insert if old element is in a
  55168. // leaving transition. Only happens when combining transition +
  55169. // keep-alive + HOCs. (#4590)
  55170. oldElm._leaveCb ? null : parentElm,
  55171. nodeOps.nextSibling(oldElm)
  55172. );
  55173. // update parent placeholder node element, recursively
  55174. if (isDef(vnode.parent)) {
  55175. var ancestor = vnode.parent;
  55176. var patchable = isPatchable(vnode);
  55177. while (ancestor) {
  55178. for (var i = 0; i < cbs.destroy.length; ++i) {
  55179. cbs.destroy[i](ancestor);
  55180. }
  55181. ancestor.elm = vnode.elm;
  55182. if (patchable) {
  55183. for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {
  55184. cbs.create[i$1](emptyNode, ancestor);
  55185. }
  55186. // #6513
  55187. // invoke insert hooks that may have been merged by create hooks.
  55188. // e.g. for directives that uses the "inserted" hook.
  55189. var insert = ancestor.data.hook.insert;
  55190. if (insert.merged) {
  55191. // start at index 1 to avoid re-invoking component mounted hook
  55192. for (var i$2 = 1; i$2 < insert.fns.length; i$2++) {
  55193. insert.fns[i$2]();
  55194. }
  55195. }
  55196. } else {
  55197. registerRef(ancestor);
  55198. }
  55199. ancestor = ancestor.parent;
  55200. }
  55201. }
  55202. // destroy old node
  55203. if (isDef(parentElm)) {
  55204. removeVnodes([oldVnode], 0, 0);
  55205. } else if (isDef(oldVnode.tag)) {
  55206. invokeDestroyHook(oldVnode);
  55207. }
  55208. }
  55209. }
  55210. invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch);
  55211. return vnode.elm
  55212. }
  55213. }
  55214. /* */
  55215. var directives = {
  55216. create: updateDirectives,
  55217. update: updateDirectives,
  55218. destroy: function unbindDirectives (vnode) {
  55219. updateDirectives(vnode, emptyNode);
  55220. }
  55221. };
  55222. function updateDirectives (oldVnode, vnode) {
  55223. if (oldVnode.data.directives || vnode.data.directives) {
  55224. _update(oldVnode, vnode);
  55225. }
  55226. }
  55227. function _update (oldVnode, vnode) {
  55228. var isCreate = oldVnode === emptyNode;
  55229. var isDestroy = vnode === emptyNode;
  55230. var oldDirs = normalizeDirectives$1(oldVnode.data.directives, oldVnode.context);
  55231. var newDirs = normalizeDirectives$1(vnode.data.directives, vnode.context);
  55232. var dirsWithInsert = [];
  55233. var dirsWithPostpatch = [];
  55234. var key, oldDir, dir;
  55235. for (key in newDirs) {
  55236. oldDir = oldDirs[key];
  55237. dir = newDirs[key];
  55238. if (!oldDir) {
  55239. // new directive, bind
  55240. callHook$1(dir, 'bind', vnode, oldVnode);
  55241. if (dir.def && dir.def.inserted) {
  55242. dirsWithInsert.push(dir);
  55243. }
  55244. } else {
  55245. // existing directive, update
  55246. dir.oldValue = oldDir.value;
  55247. dir.oldArg = oldDir.arg;
  55248. callHook$1(dir, 'update', vnode, oldVnode);
  55249. if (dir.def && dir.def.componentUpdated) {
  55250. dirsWithPostpatch.push(dir);
  55251. }
  55252. }
  55253. }
  55254. if (dirsWithInsert.length) {
  55255. var callInsert = function () {
  55256. for (var i = 0; i < dirsWithInsert.length; i++) {
  55257. callHook$1(dirsWithInsert[i], 'inserted', vnode, oldVnode);
  55258. }
  55259. };
  55260. if (isCreate) {
  55261. mergeVNodeHook(vnode, 'insert', callInsert);
  55262. } else {
  55263. callInsert();
  55264. }
  55265. }
  55266. if (dirsWithPostpatch.length) {
  55267. mergeVNodeHook(vnode, 'postpatch', function () {
  55268. for (var i = 0; i < dirsWithPostpatch.length; i++) {
  55269. callHook$1(dirsWithPostpatch[i], 'componentUpdated', vnode, oldVnode);
  55270. }
  55271. });
  55272. }
  55273. if (!isCreate) {
  55274. for (key in oldDirs) {
  55275. if (!newDirs[key]) {
  55276. // no longer present, unbind
  55277. callHook$1(oldDirs[key], 'unbind', oldVnode, oldVnode, isDestroy);
  55278. }
  55279. }
  55280. }
  55281. }
  55282. var emptyModifiers = Object.create(null);
  55283. function normalizeDirectives$1 (
  55284. dirs,
  55285. vm
  55286. ) {
  55287. var res = Object.create(null);
  55288. if (!dirs) {
  55289. // $flow-disable-line
  55290. return res
  55291. }
  55292. var i, dir;
  55293. for (i = 0; i < dirs.length; i++) {
  55294. dir = dirs[i];
  55295. if (!dir.modifiers) {
  55296. // $flow-disable-line
  55297. dir.modifiers = emptyModifiers;
  55298. }
  55299. res[getRawDirName(dir)] = dir;
  55300. dir.def = resolveAsset(vm.$options, 'directives', dir.name, true);
  55301. }
  55302. // $flow-disable-line
  55303. return res
  55304. }
  55305. function getRawDirName (dir) {
  55306. return dir.rawName || ((dir.name) + "." + (Object.keys(dir.modifiers || {}).join('.')))
  55307. }
  55308. function callHook$1 (dir, hook, vnode, oldVnode, isDestroy) {
  55309. var fn = dir.def && dir.def[hook];
  55310. if (fn) {
  55311. try {
  55312. fn(vnode.elm, dir, vnode, oldVnode, isDestroy);
  55313. } catch (e) {
  55314. handleError(e, vnode.context, ("directive " + (dir.name) + " " + hook + " hook"));
  55315. }
  55316. }
  55317. }
  55318. var baseModules = [
  55319. ref,
  55320. directives
  55321. ];
  55322. /* */
  55323. function updateAttrs (oldVnode, vnode) {
  55324. var opts = vnode.componentOptions;
  55325. if (isDef(opts) && opts.Ctor.options.inheritAttrs === false) {
  55326. return
  55327. }
  55328. if (isUndef(oldVnode.data.attrs) && isUndef(vnode.data.attrs)) {
  55329. return
  55330. }
  55331. var key, cur, old;
  55332. var elm = vnode.elm;
  55333. var oldAttrs = oldVnode.data.attrs || {};
  55334. var attrs = vnode.data.attrs || {};
  55335. // clone observed objects, as the user probably wants to mutate it
  55336. if (isDef(attrs.__ob__)) {
  55337. attrs = vnode.data.attrs = extend({}, attrs);
  55338. }
  55339. for (key in attrs) {
  55340. cur = attrs[key];
  55341. old = oldAttrs[key];
  55342. if (old !== cur) {
  55343. setAttr(elm, key, cur);
  55344. }
  55345. }
  55346. // #4391: in IE9, setting type can reset value for input[type=radio]
  55347. // #6666: IE/Edge forces progress value down to 1 before setting a max
  55348. /* istanbul ignore if */
  55349. if ((isIE || isEdge) && attrs.value !== oldAttrs.value) {
  55350. setAttr(elm, 'value', attrs.value);
  55351. }
  55352. for (key in oldAttrs) {
  55353. if (isUndef(attrs[key])) {
  55354. if (isXlink(key)) {
  55355. elm.removeAttributeNS(xlinkNS, getXlinkProp(key));
  55356. } else if (!isEnumeratedAttr(key)) {
  55357. elm.removeAttribute(key);
  55358. }
  55359. }
  55360. }
  55361. }
  55362. function setAttr (el, key, value) {
  55363. if (el.tagName.indexOf('-') > -1) {
  55364. baseSetAttr(el, key, value);
  55365. } else if (isBooleanAttr(key)) {
  55366. // set attribute for blank value
  55367. // e.g. <option disabled>Select one</option>
  55368. if (isFalsyAttrValue(value)) {
  55369. el.removeAttribute(key);
  55370. } else {
  55371. // technically allowfullscreen is a boolean attribute for <iframe>,
  55372. // but Flash expects a value of "true" when used on <embed> tag
  55373. value = key === 'allowfullscreen' && el.tagName === 'EMBED'
  55374. ? 'true'
  55375. : key;
  55376. el.setAttribute(key, value);
  55377. }
  55378. } else if (isEnumeratedAttr(key)) {
  55379. el.setAttribute(key, convertEnumeratedValue(key, value));
  55380. } else if (isXlink(key)) {
  55381. if (isFalsyAttrValue(value)) {
  55382. el.removeAttributeNS(xlinkNS, getXlinkProp(key));
  55383. } else {
  55384. el.setAttributeNS(xlinkNS, key, value);
  55385. }
  55386. } else {
  55387. baseSetAttr(el, key, value);
  55388. }
  55389. }
  55390. function baseSetAttr (el, key, value) {
  55391. if (isFalsyAttrValue(value)) {
  55392. el.removeAttribute(key);
  55393. } else {
  55394. // #7138: IE10 & 11 fires input event when setting placeholder on
  55395. // <textarea>... block the first input event and remove the blocker
  55396. // immediately.
  55397. /* istanbul ignore if */
  55398. if (
  55399. isIE && !isIE9 &&
  55400. el.tagName === 'TEXTAREA' &&
  55401. key === 'placeholder' && value !== '' && !el.__ieph
  55402. ) {
  55403. var blocker = function (e) {
  55404. e.stopImmediatePropagation();
  55405. el.removeEventListener('input', blocker);
  55406. };
  55407. el.addEventListener('input', blocker);
  55408. // $flow-disable-line
  55409. el.__ieph = true; /* IE placeholder patched */
  55410. }
  55411. el.setAttribute(key, value);
  55412. }
  55413. }
  55414. var attrs = {
  55415. create: updateAttrs,
  55416. update: updateAttrs
  55417. };
  55418. /* */
  55419. function updateClass (oldVnode, vnode) {
  55420. var el = vnode.elm;
  55421. var data = vnode.data;
  55422. var oldData = oldVnode.data;
  55423. if (
  55424. isUndef(data.staticClass) &&
  55425. isUndef(data.class) && (
  55426. isUndef(oldData) || (
  55427. isUndef(oldData.staticClass) &&
  55428. isUndef(oldData.class)
  55429. )
  55430. )
  55431. ) {
  55432. return
  55433. }
  55434. var cls = genClassForVnode(vnode);
  55435. // handle transition classes
  55436. var transitionClass = el._transitionClasses;
  55437. if (isDef(transitionClass)) {
  55438. cls = concat(cls, stringifyClass(transitionClass));
  55439. }
  55440. // set the class
  55441. if (cls !== el._prevClass) {
  55442. el.setAttribute('class', cls);
  55443. el._prevClass = cls;
  55444. }
  55445. }
  55446. var klass = {
  55447. create: updateClass,
  55448. update: updateClass
  55449. };
  55450. /* */
  55451. var validDivisionCharRE = /[\w).+\-_$\]]/;
  55452. function parseFilters (exp) {
  55453. var inSingle = false;
  55454. var inDouble = false;
  55455. var inTemplateString = false;
  55456. var inRegex = false;
  55457. var curly = 0;
  55458. var square = 0;
  55459. var paren = 0;
  55460. var lastFilterIndex = 0;
  55461. var c, prev, i, expression, filters;
  55462. for (i = 0; i < exp.length; i++) {
  55463. prev = c;
  55464. c = exp.charCodeAt(i);
  55465. if (inSingle) {
  55466. if (c === 0x27 && prev !== 0x5C) { inSingle = false; }
  55467. } else if (inDouble) {
  55468. if (c === 0x22 && prev !== 0x5C) { inDouble = false; }
  55469. } else if (inTemplateString) {
  55470. if (c === 0x60 && prev !== 0x5C) { inTemplateString = false; }
  55471. } else if (inRegex) {
  55472. if (c === 0x2f && prev !== 0x5C) { inRegex = false; }
  55473. } else if (
  55474. c === 0x7C && // pipe
  55475. exp.charCodeAt(i + 1) !== 0x7C &&
  55476. exp.charCodeAt(i - 1) !== 0x7C &&
  55477. !curly && !square && !paren
  55478. ) {
  55479. if (expression === undefined) {
  55480. // first filter, end of expression
  55481. lastFilterIndex = i + 1;
  55482. expression = exp.slice(0, i).trim();
  55483. } else {
  55484. pushFilter();
  55485. }
  55486. } else {
  55487. switch (c) {
  55488. case 0x22: inDouble = true; break // "
  55489. case 0x27: inSingle = true; break // '
  55490. case 0x60: inTemplateString = true; break // `
  55491. case 0x28: paren++; break // (
  55492. case 0x29: paren--; break // )
  55493. case 0x5B: square++; break // [
  55494. case 0x5D: square--; break // ]
  55495. case 0x7B: curly++; break // {
  55496. case 0x7D: curly--; break // }
  55497. }
  55498. if (c === 0x2f) { // /
  55499. var j = i - 1;
  55500. var p = (void 0);
  55501. // find first non-whitespace prev char
  55502. for (; j >= 0; j--) {
  55503. p = exp.charAt(j);
  55504. if (p !== ' ') { break }
  55505. }
  55506. if (!p || !validDivisionCharRE.test(p)) {
  55507. inRegex = true;
  55508. }
  55509. }
  55510. }
  55511. }
  55512. if (expression === undefined) {
  55513. expression = exp.slice(0, i).trim();
  55514. } else if (lastFilterIndex !== 0) {
  55515. pushFilter();
  55516. }
  55517. function pushFilter () {
  55518. (filters || (filters = [])).push(exp.slice(lastFilterIndex, i).trim());
  55519. lastFilterIndex = i + 1;
  55520. }
  55521. if (filters) {
  55522. for (i = 0; i < filters.length; i++) {
  55523. expression = wrapFilter(expression, filters[i]);
  55524. }
  55525. }
  55526. return expression
  55527. }
  55528. function wrapFilter (exp, filter) {
  55529. var i = filter.indexOf('(');
  55530. if (i < 0) {
  55531. // _f: resolveFilter
  55532. return ("_f(\"" + filter + "\")(" + exp + ")")
  55533. } else {
  55534. var name = filter.slice(0, i);
  55535. var args = filter.slice(i + 1);
  55536. return ("_f(\"" + name + "\")(" + exp + (args !== ')' ? ',' + args : args))
  55537. }
  55538. }
  55539. /* */
  55540. /* eslint-disable no-unused-vars */
  55541. function baseWarn (msg, range) {
  55542. console.error(("[Vue compiler]: " + msg));
  55543. }
  55544. /* eslint-enable no-unused-vars */
  55545. function pluckModuleFunction (
  55546. modules,
  55547. key
  55548. ) {
  55549. return modules
  55550. ? modules.map(function (m) { return m[key]; }).filter(function (_) { return _; })
  55551. : []
  55552. }
  55553. function addProp (el, name, value, range, dynamic) {
  55554. (el.props || (el.props = [])).push(rangeSetItem({ name: name, value: value, dynamic: dynamic }, range));
  55555. el.plain = false;
  55556. }
  55557. function addAttr (el, name, value, range, dynamic) {
  55558. var attrs = dynamic
  55559. ? (el.dynamicAttrs || (el.dynamicAttrs = []))
  55560. : (el.attrs || (el.attrs = []));
  55561. attrs.push(rangeSetItem({ name: name, value: value, dynamic: dynamic }, range));
  55562. el.plain = false;
  55563. }
  55564. // add a raw attr (use this in preTransforms)
  55565. function addRawAttr (el, name, value, range) {
  55566. el.attrsMap[name] = value;
  55567. el.attrsList.push(rangeSetItem({ name: name, value: value }, range));
  55568. }
  55569. function addDirective (
  55570. el,
  55571. name,
  55572. rawName,
  55573. value,
  55574. arg,
  55575. isDynamicArg,
  55576. modifiers,
  55577. range
  55578. ) {
  55579. (el.directives || (el.directives = [])).push(rangeSetItem({
  55580. name: name,
  55581. rawName: rawName,
  55582. value: value,
  55583. arg: arg,
  55584. isDynamicArg: isDynamicArg,
  55585. modifiers: modifiers
  55586. }, range));
  55587. el.plain = false;
  55588. }
  55589. function prependModifierMarker (symbol, name, dynamic) {
  55590. return dynamic
  55591. ? ("_p(" + name + ",\"" + symbol + "\")")
  55592. : symbol + name // mark the event as captured
  55593. }
  55594. function addHandler (
  55595. el,
  55596. name,
  55597. value,
  55598. modifiers,
  55599. important,
  55600. warn,
  55601. range,
  55602. dynamic
  55603. ) {
  55604. modifiers = modifiers || emptyObject;
  55605. // warn prevent and passive modifier
  55606. /* istanbul ignore if */
  55607. if (
  55608. warn &&
  55609. modifiers.prevent && modifiers.passive
  55610. ) {
  55611. warn(
  55612. 'passive and prevent can\'t be used together. ' +
  55613. 'Passive handler can\'t prevent default event.',
  55614. range
  55615. );
  55616. }
  55617. // normalize click.right and click.middle since they don't actually fire
  55618. // this is technically browser-specific, but at least for now browsers are
  55619. // the only target envs that have right/middle clicks.
  55620. if (modifiers.right) {
  55621. if (dynamic) {
  55622. name = "(" + name + ")==='click'?'contextmenu':(" + name + ")";
  55623. } else if (name === 'click') {
  55624. name = 'contextmenu';
  55625. delete modifiers.right;
  55626. }
  55627. } else if (modifiers.middle) {
  55628. if (dynamic) {
  55629. name = "(" + name + ")==='click'?'mouseup':(" + name + ")";
  55630. } else if (name === 'click') {
  55631. name = 'mouseup';
  55632. }
  55633. }
  55634. // check capture modifier
  55635. if (modifiers.capture) {
  55636. delete modifiers.capture;
  55637. name = prependModifierMarker('!', name, dynamic);
  55638. }
  55639. if (modifiers.once) {
  55640. delete modifiers.once;
  55641. name = prependModifierMarker('~', name, dynamic);
  55642. }
  55643. /* istanbul ignore if */
  55644. if (modifiers.passive) {
  55645. delete modifiers.passive;
  55646. name = prependModifierMarker('&', name, dynamic);
  55647. }
  55648. var events;
  55649. if (modifiers.native) {
  55650. delete modifiers.native;
  55651. events = el.nativeEvents || (el.nativeEvents = {});
  55652. } else {
  55653. events = el.events || (el.events = {});
  55654. }
  55655. var newHandler = rangeSetItem({ value: value.trim(), dynamic: dynamic }, range);
  55656. if (modifiers !== emptyObject) {
  55657. newHandler.modifiers = modifiers;
  55658. }
  55659. var handlers = events[name];
  55660. /* istanbul ignore if */
  55661. if (Array.isArray(handlers)) {
  55662. important ? handlers.unshift(newHandler) : handlers.push(newHandler);
  55663. } else if (handlers) {
  55664. events[name] = important ? [newHandler, handlers] : [handlers, newHandler];
  55665. } else {
  55666. events[name] = newHandler;
  55667. }
  55668. el.plain = false;
  55669. }
  55670. function getRawBindingAttr (
  55671. el,
  55672. name
  55673. ) {
  55674. return el.rawAttrsMap[':' + name] ||
  55675. el.rawAttrsMap['v-bind:' + name] ||
  55676. el.rawAttrsMap[name]
  55677. }
  55678. function getBindingAttr (
  55679. el,
  55680. name,
  55681. getStatic
  55682. ) {
  55683. var dynamicValue =
  55684. getAndRemoveAttr(el, ':' + name) ||
  55685. getAndRemoveAttr(el, 'v-bind:' + name);
  55686. if (dynamicValue != null) {
  55687. return parseFilters(dynamicValue)
  55688. } else if (getStatic !== false) {
  55689. var staticValue = getAndRemoveAttr(el, name);
  55690. if (staticValue != null) {
  55691. return JSON.stringify(staticValue)
  55692. }
  55693. }
  55694. }
  55695. // note: this only removes the attr from the Array (attrsList) so that it
  55696. // doesn't get processed by processAttrs.
  55697. // By default it does NOT remove it from the map (attrsMap) because the map is
  55698. // needed during codegen.
  55699. function getAndRemoveAttr (
  55700. el,
  55701. name,
  55702. removeFromMap
  55703. ) {
  55704. var val;
  55705. if ((val = el.attrsMap[name]) != null) {
  55706. var list = el.attrsList;
  55707. for (var i = 0, l = list.length; i < l; i++) {
  55708. if (list[i].name === name) {
  55709. list.splice(i, 1);
  55710. break
  55711. }
  55712. }
  55713. }
  55714. if (removeFromMap) {
  55715. delete el.attrsMap[name];
  55716. }
  55717. return val
  55718. }
  55719. function getAndRemoveAttrByRegex (
  55720. el,
  55721. name
  55722. ) {
  55723. var list = el.attrsList;
  55724. for (var i = 0, l = list.length; i < l; i++) {
  55725. var attr = list[i];
  55726. if (name.test(attr.name)) {
  55727. list.splice(i, 1);
  55728. return attr
  55729. }
  55730. }
  55731. }
  55732. function rangeSetItem (
  55733. item,
  55734. range
  55735. ) {
  55736. if (range) {
  55737. if (range.start != null) {
  55738. item.start = range.start;
  55739. }
  55740. if (range.end != null) {
  55741. item.end = range.end;
  55742. }
  55743. }
  55744. return item
  55745. }
  55746. /* */
  55747. /**
  55748. * Cross-platform code generation for component v-model
  55749. */
  55750. function genComponentModel (
  55751. el,
  55752. value,
  55753. modifiers
  55754. ) {
  55755. var ref = modifiers || {};
  55756. var number = ref.number;
  55757. var trim = ref.trim;
  55758. var baseValueExpression = '$$v';
  55759. var valueExpression = baseValueExpression;
  55760. if (trim) {
  55761. valueExpression =
  55762. "(typeof " + baseValueExpression + " === 'string'" +
  55763. "? " + baseValueExpression + ".trim()" +
  55764. ": " + baseValueExpression + ")";
  55765. }
  55766. if (number) {
  55767. valueExpression = "_n(" + valueExpression + ")";
  55768. }
  55769. var assignment = genAssignmentCode(value, valueExpression);
  55770. el.model = {
  55771. value: ("(" + value + ")"),
  55772. expression: JSON.stringify(value),
  55773. callback: ("function (" + baseValueExpression + ") {" + assignment + "}")
  55774. };
  55775. }
  55776. /**
  55777. * Cross-platform codegen helper for generating v-model value assignment code.
  55778. */
  55779. function genAssignmentCode (
  55780. value,
  55781. assignment
  55782. ) {
  55783. var res = parseModel(value);
  55784. if (res.key === null) {
  55785. return (value + "=" + assignment)
  55786. } else {
  55787. return ("$set(" + (res.exp) + ", " + (res.key) + ", " + assignment + ")")
  55788. }
  55789. }
  55790. /**
  55791. * Parse a v-model expression into a base path and a final key segment.
  55792. * Handles both dot-path and possible square brackets.
  55793. *
  55794. * Possible cases:
  55795. *
  55796. * - test
  55797. * - test[key]
  55798. * - test[test1[key]]
  55799. * - test["a"][key]
  55800. * - xxx.test[a[a].test1[key]]
  55801. * - test.xxx.a["asa"][test1[key]]
  55802. *
  55803. */
  55804. var len, str, chr, index$1, expressionPos, expressionEndPos;
  55805. function parseModel (val) {
  55806. // Fix https://github.com/vuejs/vue/pull/7730
  55807. // allow v-model="obj.val " (trailing whitespace)
  55808. val = val.trim();
  55809. len = val.length;
  55810. if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) {
  55811. index$1 = val.lastIndexOf('.');
  55812. if (index$1 > -1) {
  55813. return {
  55814. exp: val.slice(0, index$1),
  55815. key: '"' + val.slice(index$1 + 1) + '"'
  55816. }
  55817. } else {
  55818. return {
  55819. exp: val,
  55820. key: null
  55821. }
  55822. }
  55823. }
  55824. str = val;
  55825. index$1 = expressionPos = expressionEndPos = 0;
  55826. while (!eof()) {
  55827. chr = next();
  55828. /* istanbul ignore if */
  55829. if (isStringStart(chr)) {
  55830. parseString(chr);
  55831. } else if (chr === 0x5B) {
  55832. parseBracket(chr);
  55833. }
  55834. }
  55835. return {
  55836. exp: val.slice(0, expressionPos),
  55837. key: val.slice(expressionPos + 1, expressionEndPos)
  55838. }
  55839. }
  55840. function next () {
  55841. return str.charCodeAt(++index$1)
  55842. }
  55843. function eof () {
  55844. return index$1 >= len
  55845. }
  55846. function isStringStart (chr) {
  55847. return chr === 0x22 || chr === 0x27
  55848. }
  55849. function parseBracket (chr) {
  55850. var inBracket = 1;
  55851. expressionPos = index$1;
  55852. while (!eof()) {
  55853. chr = next();
  55854. if (isStringStart(chr)) {
  55855. parseString(chr);
  55856. continue
  55857. }
  55858. if (chr === 0x5B) { inBracket++; }
  55859. if (chr === 0x5D) { inBracket--; }
  55860. if (inBracket === 0) {
  55861. expressionEndPos = index$1;
  55862. break
  55863. }
  55864. }
  55865. }
  55866. function parseString (chr) {
  55867. var stringQuote = chr;
  55868. while (!eof()) {
  55869. chr = next();
  55870. if (chr === stringQuote) {
  55871. break
  55872. }
  55873. }
  55874. }
  55875. /* */
  55876. var warn$1;
  55877. // in some cases, the event used has to be determined at runtime
  55878. // so we used some reserved tokens during compile.
  55879. var RANGE_TOKEN = '__r';
  55880. var CHECKBOX_RADIO_TOKEN = '__c';
  55881. function model (
  55882. el,
  55883. dir,
  55884. _warn
  55885. ) {
  55886. warn$1 = _warn;
  55887. var value = dir.value;
  55888. var modifiers = dir.modifiers;
  55889. var tag = el.tag;
  55890. var type = el.attrsMap.type;
  55891. {
  55892. // inputs with type="file" are read only and setting the input's
  55893. // value will throw an error.
  55894. if (tag === 'input' && type === 'file') {
  55895. warn$1(
  55896. "<" + (el.tag) + " v-model=\"" + value + "\" type=\"file\">:\n" +
  55897. "File inputs are read only. Use a v-on:change listener instead.",
  55898. el.rawAttrsMap['v-model']
  55899. );
  55900. }
  55901. }
  55902. if (el.component) {
  55903. genComponentModel(el, value, modifiers);
  55904. // component v-model doesn't need extra runtime
  55905. return false
  55906. } else if (tag === 'select') {
  55907. genSelect(el, value, modifiers);
  55908. } else if (tag === 'input' && type === 'checkbox') {
  55909. genCheckboxModel(el, value, modifiers);
  55910. } else if (tag === 'input' && type === 'radio') {
  55911. genRadioModel(el, value, modifiers);
  55912. } else if (tag === 'input' || tag === 'textarea') {
  55913. genDefaultModel(el, value, modifiers);
  55914. } else if (!config.isReservedTag(tag)) {
  55915. genComponentModel(el, value, modifiers);
  55916. // component v-model doesn't need extra runtime
  55917. return false
  55918. } else {
  55919. warn$1(
  55920. "<" + (el.tag) + " v-model=\"" + value + "\">: " +
  55921. "v-model is not supported on this element type. " +
  55922. 'If you are working with contenteditable, it\'s recommended to ' +
  55923. 'wrap a library dedicated for that purpose inside a custom component.',
  55924. el.rawAttrsMap['v-model']
  55925. );
  55926. }
  55927. // ensure runtime directive metadata
  55928. return true
  55929. }
  55930. function genCheckboxModel (
  55931. el,
  55932. value,
  55933. modifiers
  55934. ) {
  55935. var number = modifiers && modifiers.number;
  55936. var valueBinding = getBindingAttr(el, 'value') || 'null';
  55937. var trueValueBinding = getBindingAttr(el, 'true-value') || 'true';
  55938. var falseValueBinding = getBindingAttr(el, 'false-value') || 'false';
  55939. addProp(el, 'checked',
  55940. "Array.isArray(" + value + ")" +
  55941. "?_i(" + value + "," + valueBinding + ")>-1" + (
  55942. trueValueBinding === 'true'
  55943. ? (":(" + value + ")")
  55944. : (":_q(" + value + "," + trueValueBinding + ")")
  55945. )
  55946. );
  55947. addHandler(el, 'change',
  55948. "var $$a=" + value + "," +
  55949. '$$el=$event.target,' +
  55950. "$$c=$$el.checked?(" + trueValueBinding + "):(" + falseValueBinding + ");" +
  55951. 'if(Array.isArray($$a)){' +
  55952. "var $$v=" + (number ? '_n(' + valueBinding + ')' : valueBinding) + "," +
  55953. '$$i=_i($$a,$$v);' +
  55954. "if($$el.checked){$$i<0&&(" + (genAssignmentCode(value, '$$a.concat([$$v])')) + ")}" +
  55955. "else{$$i>-1&&(" + (genAssignmentCode(value, '$$a.slice(0,$$i).concat($$a.slice($$i+1))')) + ")}" +
  55956. "}else{" + (genAssignmentCode(value, '$$c')) + "}",
  55957. null, true
  55958. );
  55959. }
  55960. function genRadioModel (
  55961. el,
  55962. value,
  55963. modifiers
  55964. ) {
  55965. var number = modifiers && modifiers.number;
  55966. var valueBinding = getBindingAttr(el, 'value') || 'null';
  55967. valueBinding = number ? ("_n(" + valueBinding + ")") : valueBinding;
  55968. addProp(el, 'checked', ("_q(" + value + "," + valueBinding + ")"));
  55969. addHandler(el, 'change', genAssignmentCode(value, valueBinding), null, true);
  55970. }
  55971. function genSelect (
  55972. el,
  55973. value,
  55974. modifiers
  55975. ) {
  55976. var number = modifiers && modifiers.number;
  55977. var selectedVal = "Array.prototype.filter" +
  55978. ".call($event.target.options,function(o){return o.selected})" +
  55979. ".map(function(o){var val = \"_value\" in o ? o._value : o.value;" +
  55980. "return " + (number ? '_n(val)' : 'val') + "})";
  55981. var assignment = '$event.target.multiple ? $$selectedVal : $$selectedVal[0]';
  55982. var code = "var $$selectedVal = " + selectedVal + ";";
  55983. code = code + " " + (genAssignmentCode(value, assignment));
  55984. addHandler(el, 'change', code, null, true);
  55985. }
  55986. function genDefaultModel (
  55987. el,
  55988. value,
  55989. modifiers
  55990. ) {
  55991. var type = el.attrsMap.type;
  55992. // warn if v-bind:value conflicts with v-model
  55993. // except for inputs with v-bind:type
  55994. {
  55995. var value$1 = el.attrsMap['v-bind:value'] || el.attrsMap[':value'];
  55996. var typeBinding = el.attrsMap['v-bind:type'] || el.attrsMap[':type'];
  55997. if (value$1 && !typeBinding) {
  55998. var binding = el.attrsMap['v-bind:value'] ? 'v-bind:value' : ':value';
  55999. warn$1(
  56000. binding + "=\"" + value$1 + "\" conflicts with v-model on the same element " +
  56001. 'because the latter already expands to a value binding internally',
  56002. el.rawAttrsMap[binding]
  56003. );
  56004. }
  56005. }
  56006. var ref = modifiers || {};
  56007. var lazy = ref.lazy;
  56008. var number = ref.number;
  56009. var trim = ref.trim;
  56010. var needCompositionGuard = !lazy && type !== 'range';
  56011. var event = lazy
  56012. ? 'change'
  56013. : type === 'range'
  56014. ? RANGE_TOKEN
  56015. : 'input';
  56016. var valueExpression = '$event.target.value';
  56017. if (trim) {
  56018. valueExpression = "$event.target.value.trim()";
  56019. }
  56020. if (number) {
  56021. valueExpression = "_n(" + valueExpression + ")";
  56022. }
  56023. var code = genAssignmentCode(value, valueExpression);
  56024. if (needCompositionGuard) {
  56025. code = "if($event.target.composing)return;" + code;
  56026. }
  56027. addProp(el, 'value', ("(" + value + ")"));
  56028. addHandler(el, event, code, null, true);
  56029. if (trim || number) {
  56030. addHandler(el, 'blur', '$forceUpdate()');
  56031. }
  56032. }
  56033. /* */
  56034. // normalize v-model event tokens that can only be determined at runtime.
  56035. // it's important to place the event as the first in the array because
  56036. // the whole point is ensuring the v-model callback gets called before
  56037. // user-attached handlers.
  56038. function normalizeEvents (on) {
  56039. /* istanbul ignore if */
  56040. if (isDef(on[RANGE_TOKEN])) {
  56041. // IE input[type=range] only supports `change` event
  56042. var event = isIE ? 'change' : 'input';
  56043. on[event] = [].concat(on[RANGE_TOKEN], on[event] || []);
  56044. delete on[RANGE_TOKEN];
  56045. }
  56046. // This was originally intended to fix #4521 but no longer necessary
  56047. // after 2.5. Keeping it for backwards compat with generated code from < 2.4
  56048. /* istanbul ignore if */
  56049. if (isDef(on[CHECKBOX_RADIO_TOKEN])) {
  56050. on.change = [].concat(on[CHECKBOX_RADIO_TOKEN], on.change || []);
  56051. delete on[CHECKBOX_RADIO_TOKEN];
  56052. }
  56053. }
  56054. var target$1;
  56055. function createOnceHandler$1 (event, handler, capture) {
  56056. var _target = target$1; // save current target element in closure
  56057. return function onceHandler () {
  56058. var res = handler.apply(null, arguments);
  56059. if (res !== null) {
  56060. remove$2(event, onceHandler, capture, _target);
  56061. }
  56062. }
  56063. }
  56064. // #9446: Firefox <= 53 (in particular, ESR 52) has incorrect Event.timeStamp
  56065. // implementation and does not fire microtasks in between event propagation, so
  56066. // safe to exclude.
  56067. var useMicrotaskFix = isUsingMicroTask && !(isFF && Number(isFF[1]) <= 53);
  56068. function add$1 (
  56069. name,
  56070. handler,
  56071. capture,
  56072. passive
  56073. ) {
  56074. // async edge case #6566: inner click event triggers patch, event handler
  56075. // attached to outer element during patch, and triggered again. This
  56076. // happens because browsers fire microtask ticks between event propagation.
  56077. // the solution is simple: we save the timestamp when a handler is attached,
  56078. // and the handler would only fire if the event passed to it was fired
  56079. // AFTER it was attached.
  56080. if (useMicrotaskFix) {
  56081. var attachedTimestamp = currentFlushTimestamp;
  56082. var original = handler;
  56083. handler = original._wrapper = function (e) {
  56084. if (
  56085. // no bubbling, should always fire.
  56086. // this is just a safety net in case event.timeStamp is unreliable in
  56087. // certain weird environments...
  56088. e.target === e.currentTarget ||
  56089. // event is fired after handler attachment
  56090. e.timeStamp >= attachedTimestamp ||
  56091. // bail for environments that have buggy event.timeStamp implementations
  56092. // #9462 iOS 9 bug: event.timeStamp is 0 after history.pushState
  56093. // #9681 QtWebEngine event.timeStamp is negative value
  56094. e.timeStamp <= 0 ||
  56095. // #9448 bail if event is fired in another document in a multi-page
  56096. // electron/nw.js app, since event.timeStamp will be using a different
  56097. // starting reference
  56098. e.target.ownerDocument !== document
  56099. ) {
  56100. return original.apply(this, arguments)
  56101. }
  56102. };
  56103. }
  56104. target$1.addEventListener(
  56105. name,
  56106. handler,
  56107. supportsPassive
  56108. ? { capture: capture, passive: passive }
  56109. : capture
  56110. );
  56111. }
  56112. function remove$2 (
  56113. name,
  56114. handler,
  56115. capture,
  56116. _target
  56117. ) {
  56118. (_target || target$1).removeEventListener(
  56119. name,
  56120. handler._wrapper || handler,
  56121. capture
  56122. );
  56123. }
  56124. function updateDOMListeners (oldVnode, vnode) {
  56125. if (isUndef(oldVnode.data.on) && isUndef(vnode.data.on)) {
  56126. return
  56127. }
  56128. var on = vnode.data.on || {};
  56129. var oldOn = oldVnode.data.on || {};
  56130. target$1 = vnode.elm;
  56131. normalizeEvents(on);
  56132. updateListeners(on, oldOn, add$1, remove$2, createOnceHandler$1, vnode.context);
  56133. target$1 = undefined;
  56134. }
  56135. var events = {
  56136. create: updateDOMListeners,
  56137. update: updateDOMListeners
  56138. };
  56139. /* */
  56140. var svgContainer;
  56141. function updateDOMProps (oldVnode, vnode) {
  56142. if (isUndef(oldVnode.data.domProps) && isUndef(vnode.data.domProps)) {
  56143. return
  56144. }
  56145. var key, cur;
  56146. var elm = vnode.elm;
  56147. var oldProps = oldVnode.data.domProps || {};
  56148. var props = vnode.data.domProps || {};
  56149. // clone observed objects, as the user probably wants to mutate it
  56150. if (isDef(props.__ob__)) {
  56151. props = vnode.data.domProps = extend({}, props);
  56152. }
  56153. for (key in oldProps) {
  56154. if (!(key in props)) {
  56155. elm[key] = '';
  56156. }
  56157. }
  56158. for (key in props) {
  56159. cur = props[key];
  56160. // ignore children if the node has textContent or innerHTML,
  56161. // as these will throw away existing DOM nodes and cause removal errors
  56162. // on subsequent patches (#3360)
  56163. if (key === 'textContent' || key === 'innerHTML') {
  56164. if (vnode.children) { vnode.children.length = 0; }
  56165. if (cur === oldProps[key]) { continue }
  56166. // #6601 work around Chrome version <= 55 bug where single textNode
  56167. // replaced by innerHTML/textContent retains its parentNode property
  56168. if (elm.childNodes.length === 1) {
  56169. elm.removeChild(elm.childNodes[0]);
  56170. }
  56171. }
  56172. if (key === 'value' && elm.tagName !== 'PROGRESS') {
  56173. // store value as _value as well since
  56174. // non-string values will be stringified
  56175. elm._value = cur;
  56176. // avoid resetting cursor position when value is the same
  56177. var strCur = isUndef(cur) ? '' : String(cur);
  56178. if (shouldUpdateValue(elm, strCur)) {
  56179. elm.value = strCur;
  56180. }
  56181. } else if (key === 'innerHTML' && isSVG(elm.tagName) && isUndef(elm.innerHTML)) {
  56182. // IE doesn't support innerHTML for SVG elements
  56183. svgContainer = svgContainer || document.createElement('div');
  56184. svgContainer.innerHTML = "<svg>" + cur + "</svg>";
  56185. var svg = svgContainer.firstChild;
  56186. while (elm.firstChild) {
  56187. elm.removeChild(elm.firstChild);
  56188. }
  56189. while (svg.firstChild) {
  56190. elm.appendChild(svg.firstChild);
  56191. }
  56192. } else if (
  56193. // skip the update if old and new VDOM state is the same.
  56194. // `value` is handled separately because the DOM value may be temporarily
  56195. // out of sync with VDOM state due to focus, composition and modifiers.
  56196. // This #4521 by skipping the unnecesarry `checked` update.
  56197. cur !== oldProps[key]
  56198. ) {
  56199. // some property updates can throw
  56200. // e.g. `value` on <progress> w/ non-finite value
  56201. try {
  56202. elm[key] = cur;
  56203. } catch (e) {}
  56204. }
  56205. }
  56206. }
  56207. // check platforms/web/util/attrs.js acceptValue
  56208. function shouldUpdateValue (elm, checkVal) {
  56209. return (!elm.composing && (
  56210. elm.tagName === 'OPTION' ||
  56211. isNotInFocusAndDirty(elm, checkVal) ||
  56212. isDirtyWithModifiers(elm, checkVal)
  56213. ))
  56214. }
  56215. function isNotInFocusAndDirty (elm, checkVal) {
  56216. // return true when textbox (.number and .trim) loses focus and its value is
  56217. // not equal to the updated value
  56218. var notInFocus = true;
  56219. // #6157
  56220. // work around IE bug when accessing document.activeElement in an iframe
  56221. try { notInFocus = document.activeElement !== elm; } catch (e) {}
  56222. return notInFocus && elm.value !== checkVal
  56223. }
  56224. function isDirtyWithModifiers (elm, newVal) {
  56225. var value = elm.value;
  56226. var modifiers = elm._vModifiers; // injected by v-model runtime
  56227. if (isDef(modifiers)) {
  56228. if (modifiers.number) {
  56229. return toNumber(value) !== toNumber(newVal)
  56230. }
  56231. if (modifiers.trim) {
  56232. return value.trim() !== newVal.trim()
  56233. }
  56234. }
  56235. return value !== newVal
  56236. }
  56237. var domProps = {
  56238. create: updateDOMProps,
  56239. update: updateDOMProps
  56240. };
  56241. /* */
  56242. var parseStyleText = cached(function (cssText) {
  56243. var res = {};
  56244. var listDelimiter = /;(?![^(]*\))/g;
  56245. var propertyDelimiter = /:(.+)/;
  56246. cssText.split(listDelimiter).forEach(function (item) {
  56247. if (item) {
  56248. var tmp = item.split(propertyDelimiter);
  56249. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  56250. }
  56251. });
  56252. return res
  56253. });
  56254. // merge static and dynamic style data on the same vnode
  56255. function normalizeStyleData (data) {
  56256. var style = normalizeStyleBinding(data.style);
  56257. // static style is pre-processed into an object during compilation
  56258. // and is always a fresh object, so it's safe to merge into it
  56259. return data.staticStyle
  56260. ? extend(data.staticStyle, style)
  56261. : style
  56262. }
  56263. // normalize possible array / string values into Object
  56264. function normalizeStyleBinding (bindingStyle) {
  56265. if (Array.isArray(bindingStyle)) {
  56266. return toObject(bindingStyle)
  56267. }
  56268. if (typeof bindingStyle === 'string') {
  56269. return parseStyleText(bindingStyle)
  56270. }
  56271. return bindingStyle
  56272. }
  56273. /**
  56274. * parent component style should be after child's
  56275. * so that parent component's style could override it
  56276. */
  56277. function getStyle (vnode, checkChild) {
  56278. var res = {};
  56279. var styleData;
  56280. if (checkChild) {
  56281. var childNode = vnode;
  56282. while (childNode.componentInstance) {
  56283. childNode = childNode.componentInstance._vnode;
  56284. if (
  56285. childNode && childNode.data &&
  56286. (styleData = normalizeStyleData(childNode.data))
  56287. ) {
  56288. extend(res, styleData);
  56289. }
  56290. }
  56291. }
  56292. if ((styleData = normalizeStyleData(vnode.data))) {
  56293. extend(res, styleData);
  56294. }
  56295. var parentNode = vnode;
  56296. while ((parentNode = parentNode.parent)) {
  56297. if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {
  56298. extend(res, styleData);
  56299. }
  56300. }
  56301. return res
  56302. }
  56303. /* */
  56304. var cssVarRE = /^--/;
  56305. var importantRE = /\s*!important$/;
  56306. var setProp = function (el, name, val) {
  56307. /* istanbul ignore if */
  56308. if (cssVarRE.test(name)) {
  56309. el.style.setProperty(name, val);
  56310. } else if (importantRE.test(val)) {
  56311. el.style.setProperty(hyphenate(name), val.replace(importantRE, ''), 'important');
  56312. } else {
  56313. var normalizedName = normalize(name);
  56314. if (Array.isArray(val)) {
  56315. // Support values array created by autoprefixer, e.g.
  56316. // {display: ["-webkit-box", "-ms-flexbox", "flex"]}
  56317. // Set them one by one, and the browser will only set those it can recognize
  56318. for (var i = 0, len = val.length; i < len; i++) {
  56319. el.style[normalizedName] = val[i];
  56320. }
  56321. } else {
  56322. el.style[normalizedName] = val;
  56323. }
  56324. }
  56325. };
  56326. var vendorNames = ['Webkit', 'Moz', 'ms'];
  56327. var emptyStyle;
  56328. var normalize = cached(function (prop) {
  56329. emptyStyle = emptyStyle || document.createElement('div').style;
  56330. prop = camelize(prop);
  56331. if (prop !== 'filter' && (prop in emptyStyle)) {
  56332. return prop
  56333. }
  56334. var capName = prop.charAt(0).toUpperCase() + prop.slice(1);
  56335. for (var i = 0; i < vendorNames.length; i++) {
  56336. var name = vendorNames[i] + capName;
  56337. if (name in emptyStyle) {
  56338. return name
  56339. }
  56340. }
  56341. });
  56342. function updateStyle (oldVnode, vnode) {
  56343. var data = vnode.data;
  56344. var oldData = oldVnode.data;
  56345. if (isUndef(data.staticStyle) && isUndef(data.style) &&
  56346. isUndef(oldData.staticStyle) && isUndef(oldData.style)
  56347. ) {
  56348. return
  56349. }
  56350. var cur, name;
  56351. var el = vnode.elm;
  56352. var oldStaticStyle = oldData.staticStyle;
  56353. var oldStyleBinding = oldData.normalizedStyle || oldData.style || {};
  56354. // if static style exists, stylebinding already merged into it when doing normalizeStyleData
  56355. var oldStyle = oldStaticStyle || oldStyleBinding;
  56356. var style = normalizeStyleBinding(vnode.data.style) || {};
  56357. // store normalized style under a different key for next diff
  56358. // make sure to clone it if it's reactive, since the user likely wants
  56359. // to mutate it.
  56360. vnode.data.normalizedStyle = isDef(style.__ob__)
  56361. ? extend({}, style)
  56362. : style;
  56363. var newStyle = getStyle(vnode, true);
  56364. for (name in oldStyle) {
  56365. if (isUndef(newStyle[name])) {
  56366. setProp(el, name, '');
  56367. }
  56368. }
  56369. for (name in newStyle) {
  56370. cur = newStyle[name];
  56371. if (cur !== oldStyle[name]) {
  56372. // ie9 setting to null has no effect, must use empty string
  56373. setProp(el, name, cur == null ? '' : cur);
  56374. }
  56375. }
  56376. }
  56377. var style = {
  56378. create: updateStyle,
  56379. update: updateStyle
  56380. };
  56381. /* */
  56382. var whitespaceRE = /\s+/;
  56383. /**
  56384. * Add class with compatibility for SVG since classList is not supported on
  56385. * SVG elements in IE
  56386. */
  56387. function addClass (el, cls) {
  56388. /* istanbul ignore if */
  56389. if (!cls || !(cls = cls.trim())) {
  56390. return
  56391. }
  56392. /* istanbul ignore else */
  56393. if (el.classList) {
  56394. if (cls.indexOf(' ') > -1) {
  56395. cls.split(whitespaceRE).forEach(function (c) { return el.classList.add(c); });
  56396. } else {
  56397. el.classList.add(cls);
  56398. }
  56399. } else {
  56400. var cur = " " + (el.getAttribute('class') || '') + " ";
  56401. if (cur.indexOf(' ' + cls + ' ') < 0) {
  56402. el.setAttribute('class', (cur + cls).trim());
  56403. }
  56404. }
  56405. }
  56406. /**
  56407. * Remove class with compatibility for SVG since classList is not supported on
  56408. * SVG elements in IE
  56409. */
  56410. function removeClass (el, cls) {
  56411. /* istanbul ignore if */
  56412. if (!cls || !(cls = cls.trim())) {
  56413. return
  56414. }
  56415. /* istanbul ignore else */
  56416. if (el.classList) {
  56417. if (cls.indexOf(' ') > -1) {
  56418. cls.split(whitespaceRE).forEach(function (c) { return el.classList.remove(c); });
  56419. } else {
  56420. el.classList.remove(cls);
  56421. }
  56422. if (!el.classList.length) {
  56423. el.removeAttribute('class');
  56424. }
  56425. } else {
  56426. var cur = " " + (el.getAttribute('class') || '') + " ";
  56427. var tar = ' ' + cls + ' ';
  56428. while (cur.indexOf(tar) >= 0) {
  56429. cur = cur.replace(tar, ' ');
  56430. }
  56431. cur = cur.trim();
  56432. if (cur) {
  56433. el.setAttribute('class', cur);
  56434. } else {
  56435. el.removeAttribute('class');
  56436. }
  56437. }
  56438. }
  56439. /* */
  56440. function resolveTransition (def$$1) {
  56441. if (!def$$1) {
  56442. return
  56443. }
  56444. /* istanbul ignore else */
  56445. if (typeof def$$1 === 'object') {
  56446. var res = {};
  56447. if (def$$1.css !== false) {
  56448. extend(res, autoCssTransition(def$$1.name || 'v'));
  56449. }
  56450. extend(res, def$$1);
  56451. return res
  56452. } else if (typeof def$$1 === 'string') {
  56453. return autoCssTransition(def$$1)
  56454. }
  56455. }
  56456. var autoCssTransition = cached(function (name) {
  56457. return {
  56458. enterClass: (name + "-enter"),
  56459. enterToClass: (name + "-enter-to"),
  56460. enterActiveClass: (name + "-enter-active"),
  56461. leaveClass: (name + "-leave"),
  56462. leaveToClass: (name + "-leave-to"),
  56463. leaveActiveClass: (name + "-leave-active")
  56464. }
  56465. });
  56466. var hasTransition = inBrowser && !isIE9;
  56467. var TRANSITION = 'transition';
  56468. var ANIMATION = 'animation';
  56469. // Transition property/event sniffing
  56470. var transitionProp = 'transition';
  56471. var transitionEndEvent = 'transitionend';
  56472. var animationProp = 'animation';
  56473. var animationEndEvent = 'animationend';
  56474. if (hasTransition) {
  56475. /* istanbul ignore if */
  56476. if (window.ontransitionend === undefined &&
  56477. window.onwebkittransitionend !== undefined
  56478. ) {
  56479. transitionProp = 'WebkitTransition';
  56480. transitionEndEvent = 'webkitTransitionEnd';
  56481. }
  56482. if (window.onanimationend === undefined &&
  56483. window.onwebkitanimationend !== undefined
  56484. ) {
  56485. animationProp = 'WebkitAnimation';
  56486. animationEndEvent = 'webkitAnimationEnd';
  56487. }
  56488. }
  56489. // binding to window is necessary to make hot reload work in IE in strict mode
  56490. var raf = inBrowser
  56491. ? window.requestAnimationFrame
  56492. ? window.requestAnimationFrame.bind(window)
  56493. : setTimeout
  56494. : /* istanbul ignore next */ function (fn) { return fn(); };
  56495. function nextFrame (fn) {
  56496. raf(function () {
  56497. raf(fn);
  56498. });
  56499. }
  56500. function addTransitionClass (el, cls) {
  56501. var transitionClasses = el._transitionClasses || (el._transitionClasses = []);
  56502. if (transitionClasses.indexOf(cls) < 0) {
  56503. transitionClasses.push(cls);
  56504. addClass(el, cls);
  56505. }
  56506. }
  56507. function removeTransitionClass (el, cls) {
  56508. if (el._transitionClasses) {
  56509. remove(el._transitionClasses, cls);
  56510. }
  56511. removeClass(el, cls);
  56512. }
  56513. function whenTransitionEnds (
  56514. el,
  56515. expectedType,
  56516. cb
  56517. ) {
  56518. var ref = getTransitionInfo(el, expectedType);
  56519. var type = ref.type;
  56520. var timeout = ref.timeout;
  56521. var propCount = ref.propCount;
  56522. if (!type) { return cb() }
  56523. var event = type === TRANSITION ? transitionEndEvent : animationEndEvent;
  56524. var ended = 0;
  56525. var end = function () {
  56526. el.removeEventListener(event, onEnd);
  56527. cb();
  56528. };
  56529. var onEnd = function (e) {
  56530. if (e.target === el) {
  56531. if (++ended >= propCount) {
  56532. end();
  56533. }
  56534. }
  56535. };
  56536. setTimeout(function () {
  56537. if (ended < propCount) {
  56538. end();
  56539. }
  56540. }, timeout + 1);
  56541. el.addEventListener(event, onEnd);
  56542. }
  56543. var transformRE = /\b(transform|all)(,|$)/;
  56544. function getTransitionInfo (el, expectedType) {
  56545. var styles = window.getComputedStyle(el);
  56546. // JSDOM may return undefined for transition properties
  56547. var transitionDelays = (styles[transitionProp + 'Delay'] || '').split(', ');
  56548. var transitionDurations = (styles[transitionProp + 'Duration'] || '').split(', ');
  56549. var transitionTimeout = getTimeout(transitionDelays, transitionDurations);
  56550. var animationDelays = (styles[animationProp + 'Delay'] || '').split(', ');
  56551. var animationDurations = (styles[animationProp + 'Duration'] || '').split(', ');
  56552. var animationTimeout = getTimeout(animationDelays, animationDurations);
  56553. var type;
  56554. var timeout = 0;
  56555. var propCount = 0;
  56556. /* istanbul ignore if */
  56557. if (expectedType === TRANSITION) {
  56558. if (transitionTimeout > 0) {
  56559. type = TRANSITION;
  56560. timeout = transitionTimeout;
  56561. propCount = transitionDurations.length;
  56562. }
  56563. } else if (expectedType === ANIMATION) {
  56564. if (animationTimeout > 0) {
  56565. type = ANIMATION;
  56566. timeout = animationTimeout;
  56567. propCount = animationDurations.length;
  56568. }
  56569. } else {
  56570. timeout = Math.max(transitionTimeout, animationTimeout);
  56571. type = timeout > 0
  56572. ? transitionTimeout > animationTimeout
  56573. ? TRANSITION
  56574. : ANIMATION
  56575. : null;
  56576. propCount = type
  56577. ? type === TRANSITION
  56578. ? transitionDurations.length
  56579. : animationDurations.length
  56580. : 0;
  56581. }
  56582. var hasTransform =
  56583. type === TRANSITION &&
  56584. transformRE.test(styles[transitionProp + 'Property']);
  56585. return {
  56586. type: type,
  56587. timeout: timeout,
  56588. propCount: propCount,
  56589. hasTransform: hasTransform
  56590. }
  56591. }
  56592. function getTimeout (delays, durations) {
  56593. /* istanbul ignore next */
  56594. while (delays.length < durations.length) {
  56595. delays = delays.concat(delays);
  56596. }
  56597. return Math.max.apply(null, durations.map(function (d, i) {
  56598. return toMs(d) + toMs(delays[i])
  56599. }))
  56600. }
  56601. // Old versions of Chromium (below 61.0.3163.100) formats floating pointer numbers
  56602. // in a locale-dependent way, using a comma instead of a dot.
  56603. // If comma is not replaced with a dot, the input will be rounded down (i.e. acting
  56604. // as a floor function) causing unexpected behaviors
  56605. function toMs (s) {
  56606. return Number(s.slice(0, -1).replace(',', '.')) * 1000
  56607. }
  56608. /* */
  56609. function enter (vnode, toggleDisplay) {
  56610. var el = vnode.elm;
  56611. // call leave callback now
  56612. if (isDef(el._leaveCb)) {
  56613. el._leaveCb.cancelled = true;
  56614. el._leaveCb();
  56615. }
  56616. var data = resolveTransition(vnode.data.transition);
  56617. if (isUndef(data)) {
  56618. return
  56619. }
  56620. /* istanbul ignore if */
  56621. if (isDef(el._enterCb) || el.nodeType !== 1) {
  56622. return
  56623. }
  56624. var css = data.css;
  56625. var type = data.type;
  56626. var enterClass = data.enterClass;
  56627. var enterToClass = data.enterToClass;
  56628. var enterActiveClass = data.enterActiveClass;
  56629. var appearClass = data.appearClass;
  56630. var appearToClass = data.appearToClass;
  56631. var appearActiveClass = data.appearActiveClass;
  56632. var beforeEnter = data.beforeEnter;
  56633. var enter = data.enter;
  56634. var afterEnter = data.afterEnter;
  56635. var enterCancelled = data.enterCancelled;
  56636. var beforeAppear = data.beforeAppear;
  56637. var appear = data.appear;
  56638. var afterAppear = data.afterAppear;
  56639. var appearCancelled = data.appearCancelled;
  56640. var duration = data.duration;
  56641. // activeInstance will always be the <transition> component managing this
  56642. // transition. One edge case to check is when the <transition> is placed
  56643. // as the root node of a child component. In that case we need to check
  56644. // <transition>'s parent for appear check.
  56645. var context = activeInstance;
  56646. var transitionNode = activeInstance.$vnode;
  56647. while (transitionNode && transitionNode.parent) {
  56648. context = transitionNode.context;
  56649. transitionNode = transitionNode.parent;
  56650. }
  56651. var isAppear = !context._isMounted || !vnode.isRootInsert;
  56652. if (isAppear && !appear && appear !== '') {
  56653. return
  56654. }
  56655. var startClass = isAppear && appearClass
  56656. ? appearClass
  56657. : enterClass;
  56658. var activeClass = isAppear && appearActiveClass
  56659. ? appearActiveClass
  56660. : enterActiveClass;
  56661. var toClass = isAppear && appearToClass
  56662. ? appearToClass
  56663. : enterToClass;
  56664. var beforeEnterHook = isAppear
  56665. ? (beforeAppear || beforeEnter)
  56666. : beforeEnter;
  56667. var enterHook = isAppear
  56668. ? (typeof appear === 'function' ? appear : enter)
  56669. : enter;
  56670. var afterEnterHook = isAppear
  56671. ? (afterAppear || afterEnter)
  56672. : afterEnter;
  56673. var enterCancelledHook = isAppear
  56674. ? (appearCancelled || enterCancelled)
  56675. : enterCancelled;
  56676. var explicitEnterDuration = toNumber(
  56677. isObject(duration)
  56678. ? duration.enter
  56679. : duration
  56680. );
  56681. if (explicitEnterDuration != null) {
  56682. checkDuration(explicitEnterDuration, 'enter', vnode);
  56683. }
  56684. var expectsCSS = css !== false && !isIE9;
  56685. var userWantsControl = getHookArgumentsLength(enterHook);
  56686. var cb = el._enterCb = once(function () {
  56687. if (expectsCSS) {
  56688. removeTransitionClass(el, toClass);
  56689. removeTransitionClass(el, activeClass);
  56690. }
  56691. if (cb.cancelled) {
  56692. if (expectsCSS) {
  56693. removeTransitionClass(el, startClass);
  56694. }
  56695. enterCancelledHook && enterCancelledHook(el);
  56696. } else {
  56697. afterEnterHook && afterEnterHook(el);
  56698. }
  56699. el._enterCb = null;
  56700. });
  56701. if (!vnode.data.show) {
  56702. // remove pending leave element on enter by injecting an insert hook
  56703. mergeVNodeHook(vnode, 'insert', function () {
  56704. var parent = el.parentNode;
  56705. var pendingNode = parent && parent._pending && parent._pending[vnode.key];
  56706. if (pendingNode &&
  56707. pendingNode.tag === vnode.tag &&
  56708. pendingNode.elm._leaveCb
  56709. ) {
  56710. pendingNode.elm._leaveCb();
  56711. }
  56712. enterHook && enterHook(el, cb);
  56713. });
  56714. }
  56715. // start enter transition
  56716. beforeEnterHook && beforeEnterHook(el);
  56717. if (expectsCSS) {
  56718. addTransitionClass(el, startClass);
  56719. addTransitionClass(el, activeClass);
  56720. nextFrame(function () {
  56721. removeTransitionClass(el, startClass);
  56722. if (!cb.cancelled) {
  56723. addTransitionClass(el, toClass);
  56724. if (!userWantsControl) {
  56725. if (isValidDuration(explicitEnterDuration)) {
  56726. setTimeout(cb, explicitEnterDuration);
  56727. } else {
  56728. whenTransitionEnds(el, type, cb);
  56729. }
  56730. }
  56731. }
  56732. });
  56733. }
  56734. if (vnode.data.show) {
  56735. toggleDisplay && toggleDisplay();
  56736. enterHook && enterHook(el, cb);
  56737. }
  56738. if (!expectsCSS && !userWantsControl) {
  56739. cb();
  56740. }
  56741. }
  56742. function leave (vnode, rm) {
  56743. var el = vnode.elm;
  56744. // call enter callback now
  56745. if (isDef(el._enterCb)) {
  56746. el._enterCb.cancelled = true;
  56747. el._enterCb();
  56748. }
  56749. var data = resolveTransition(vnode.data.transition);
  56750. if (isUndef(data) || el.nodeType !== 1) {
  56751. return rm()
  56752. }
  56753. /* istanbul ignore if */
  56754. if (isDef(el._leaveCb)) {
  56755. return
  56756. }
  56757. var css = data.css;
  56758. var type = data.type;
  56759. var leaveClass = data.leaveClass;
  56760. var leaveToClass = data.leaveToClass;
  56761. var leaveActiveClass = data.leaveActiveClass;
  56762. var beforeLeave = data.beforeLeave;
  56763. var leave = data.leave;
  56764. var afterLeave = data.afterLeave;
  56765. var leaveCancelled = data.leaveCancelled;
  56766. var delayLeave = data.delayLeave;
  56767. var duration = data.duration;
  56768. var expectsCSS = css !== false && !isIE9;
  56769. var userWantsControl = getHookArgumentsLength(leave);
  56770. var explicitLeaveDuration = toNumber(
  56771. isObject(duration)
  56772. ? duration.leave
  56773. : duration
  56774. );
  56775. if (isDef(explicitLeaveDuration)) {
  56776. checkDuration(explicitLeaveDuration, 'leave', vnode);
  56777. }
  56778. var cb = el._leaveCb = once(function () {
  56779. if (el.parentNode && el.parentNode._pending) {
  56780. el.parentNode._pending[vnode.key] = null;
  56781. }
  56782. if (expectsCSS) {
  56783. removeTransitionClass(el, leaveToClass);
  56784. removeTransitionClass(el, leaveActiveClass);
  56785. }
  56786. if (cb.cancelled) {
  56787. if (expectsCSS) {
  56788. removeTransitionClass(el, leaveClass);
  56789. }
  56790. leaveCancelled && leaveCancelled(el);
  56791. } else {
  56792. rm();
  56793. afterLeave && afterLeave(el);
  56794. }
  56795. el._leaveCb = null;
  56796. });
  56797. if (delayLeave) {
  56798. delayLeave(performLeave);
  56799. } else {
  56800. performLeave();
  56801. }
  56802. function performLeave () {
  56803. // the delayed leave may have already been cancelled
  56804. if (cb.cancelled) {
  56805. return
  56806. }
  56807. // record leaving element
  56808. if (!vnode.data.show && el.parentNode) {
  56809. (el.parentNode._pending || (el.parentNode._pending = {}))[(vnode.key)] = vnode;
  56810. }
  56811. beforeLeave && beforeLeave(el);
  56812. if (expectsCSS) {
  56813. addTransitionClass(el, leaveClass);
  56814. addTransitionClass(el, leaveActiveClass);
  56815. nextFrame(function () {
  56816. removeTransitionClass(el, leaveClass);
  56817. if (!cb.cancelled) {
  56818. addTransitionClass(el, leaveToClass);
  56819. if (!userWantsControl) {
  56820. if (isValidDuration(explicitLeaveDuration)) {
  56821. setTimeout(cb, explicitLeaveDuration);
  56822. } else {
  56823. whenTransitionEnds(el, type, cb);
  56824. }
  56825. }
  56826. }
  56827. });
  56828. }
  56829. leave && leave(el, cb);
  56830. if (!expectsCSS && !userWantsControl) {
  56831. cb();
  56832. }
  56833. }
  56834. }
  56835. // only used in dev mode
  56836. function checkDuration (val, name, vnode) {
  56837. if (typeof val !== 'number') {
  56838. warn(
  56839. "<transition> explicit " + name + " duration is not a valid number - " +
  56840. "got " + (JSON.stringify(val)) + ".",
  56841. vnode.context
  56842. );
  56843. } else if (isNaN(val)) {
  56844. warn(
  56845. "<transition> explicit " + name + " duration is NaN - " +
  56846. 'the duration expression might be incorrect.',
  56847. vnode.context
  56848. );
  56849. }
  56850. }
  56851. function isValidDuration (val) {
  56852. return typeof val === 'number' && !isNaN(val)
  56853. }
  56854. /**
  56855. * Normalize a transition hook's argument length. The hook may be:
  56856. * - a merged hook (invoker) with the original in .fns
  56857. * - a wrapped component method (check ._length)
  56858. * - a plain function (.length)
  56859. */
  56860. function getHookArgumentsLength (fn) {
  56861. if (isUndef(fn)) {
  56862. return false
  56863. }
  56864. var invokerFns = fn.fns;
  56865. if (isDef(invokerFns)) {
  56866. // invoker
  56867. return getHookArgumentsLength(
  56868. Array.isArray(invokerFns)
  56869. ? invokerFns[0]
  56870. : invokerFns
  56871. )
  56872. } else {
  56873. return (fn._length || fn.length) > 1
  56874. }
  56875. }
  56876. function _enter (_, vnode) {
  56877. if (vnode.data.show !== true) {
  56878. enter(vnode);
  56879. }
  56880. }
  56881. var transition = inBrowser ? {
  56882. create: _enter,
  56883. activate: _enter,
  56884. remove: function remove$$1 (vnode, rm) {
  56885. /* istanbul ignore else */
  56886. if (vnode.data.show !== true) {
  56887. leave(vnode, rm);
  56888. } else {
  56889. rm();
  56890. }
  56891. }
  56892. } : {};
  56893. var platformModules = [
  56894. attrs,
  56895. klass,
  56896. events,
  56897. domProps,
  56898. style,
  56899. transition
  56900. ];
  56901. /* */
  56902. // the directive module should be applied last, after all
  56903. // built-in modules have been applied.
  56904. var modules = platformModules.concat(baseModules);
  56905. var patch = createPatchFunction({ nodeOps: nodeOps, modules: modules });
  56906. /**
  56907. * Not type checking this file because flow doesn't like attaching
  56908. * properties to Elements.
  56909. */
  56910. /* istanbul ignore if */
  56911. if (isIE9) {
  56912. // http://www.matts411.com/post/internet-explorer-9-oninput/
  56913. document.addEventListener('selectionchange', function () {
  56914. var el = document.activeElement;
  56915. if (el && el.vmodel) {
  56916. trigger(el, 'input');
  56917. }
  56918. });
  56919. }
  56920. var directive = {
  56921. inserted: function inserted (el, binding, vnode, oldVnode) {
  56922. if (vnode.tag === 'select') {
  56923. // #6903
  56924. if (oldVnode.elm && !oldVnode.elm._vOptions) {
  56925. mergeVNodeHook(vnode, 'postpatch', function () {
  56926. directive.componentUpdated(el, binding, vnode);
  56927. });
  56928. } else {
  56929. setSelected(el, binding, vnode.context);
  56930. }
  56931. el._vOptions = [].map.call(el.options, getValue);
  56932. } else if (vnode.tag === 'textarea' || isTextInputType(el.type)) {
  56933. el._vModifiers = binding.modifiers;
  56934. if (!binding.modifiers.lazy) {
  56935. el.addEventListener('compositionstart', onCompositionStart);
  56936. el.addEventListener('compositionend', onCompositionEnd);
  56937. // Safari < 10.2 & UIWebView doesn't fire compositionend when
  56938. // switching focus before confirming composition choice
  56939. // this also fixes the issue where some browsers e.g. iOS Chrome
  56940. // fires "change" instead of "input" on autocomplete.
  56941. el.addEventListener('change', onCompositionEnd);
  56942. /* istanbul ignore if */
  56943. if (isIE9) {
  56944. el.vmodel = true;
  56945. }
  56946. }
  56947. }
  56948. },
  56949. componentUpdated: function componentUpdated (el, binding, vnode) {
  56950. if (vnode.tag === 'select') {
  56951. setSelected(el, binding, vnode.context);
  56952. // in case the options rendered by v-for have changed,
  56953. // it's possible that the value is out-of-sync with the rendered options.
  56954. // detect such cases and filter out values that no longer has a matching
  56955. // option in the DOM.
  56956. var prevOptions = el._vOptions;
  56957. var curOptions = el._vOptions = [].map.call(el.options, getValue);
  56958. if (curOptions.some(function (o, i) { return !looseEqual(o, prevOptions[i]); })) {
  56959. // trigger change event if
  56960. // no matching option found for at least one value
  56961. var needReset = el.multiple
  56962. ? binding.value.some(function (v) { return hasNoMatchingOption(v, curOptions); })
  56963. : binding.value !== binding.oldValue && hasNoMatchingOption(binding.value, curOptions);
  56964. if (needReset) {
  56965. trigger(el, 'change');
  56966. }
  56967. }
  56968. }
  56969. }
  56970. };
  56971. function setSelected (el, binding, vm) {
  56972. actuallySetSelected(el, binding, vm);
  56973. /* istanbul ignore if */
  56974. if (isIE || isEdge) {
  56975. setTimeout(function () {
  56976. actuallySetSelected(el, binding, vm);
  56977. }, 0);
  56978. }
  56979. }
  56980. function actuallySetSelected (el, binding, vm) {
  56981. var value = binding.value;
  56982. var isMultiple = el.multiple;
  56983. if (isMultiple && !Array.isArray(value)) {
  56984. warn(
  56985. "<select multiple v-model=\"" + (binding.expression) + "\"> " +
  56986. "expects an Array value for its binding, but got " + (Object.prototype.toString.call(value).slice(8, -1)),
  56987. vm
  56988. );
  56989. return
  56990. }
  56991. var selected, option;
  56992. for (var i = 0, l = el.options.length; i < l; i++) {
  56993. option = el.options[i];
  56994. if (isMultiple) {
  56995. selected = looseIndexOf(value, getValue(option)) > -1;
  56996. if (option.selected !== selected) {
  56997. option.selected = selected;
  56998. }
  56999. } else {
  57000. if (looseEqual(getValue(option), value)) {
  57001. if (el.selectedIndex !== i) {
  57002. el.selectedIndex = i;
  57003. }
  57004. return
  57005. }
  57006. }
  57007. }
  57008. if (!isMultiple) {
  57009. el.selectedIndex = -1;
  57010. }
  57011. }
  57012. function hasNoMatchingOption (value, options) {
  57013. return options.every(function (o) { return !looseEqual(o, value); })
  57014. }
  57015. function getValue (option) {
  57016. return '_value' in option
  57017. ? option._value
  57018. : option.value
  57019. }
  57020. function onCompositionStart (e) {
  57021. e.target.composing = true;
  57022. }
  57023. function onCompositionEnd (e) {
  57024. // prevent triggering an input event for no reason
  57025. if (!e.target.composing) { return }
  57026. e.target.composing = false;
  57027. trigger(e.target, 'input');
  57028. }
  57029. function trigger (el, type) {
  57030. var e = document.createEvent('HTMLEvents');
  57031. e.initEvent(type, true, true);
  57032. el.dispatchEvent(e);
  57033. }
  57034. /* */
  57035. // recursively search for possible transition defined inside the component root
  57036. function locateNode (vnode) {
  57037. return vnode.componentInstance && (!vnode.data || !vnode.data.transition)
  57038. ? locateNode(vnode.componentInstance._vnode)
  57039. : vnode
  57040. }
  57041. var show = {
  57042. bind: function bind (el, ref, vnode) {
  57043. var value = ref.value;
  57044. vnode = locateNode(vnode);
  57045. var transition$$1 = vnode.data && vnode.data.transition;
  57046. var originalDisplay = el.__vOriginalDisplay =
  57047. el.style.display === 'none' ? '' : el.style.display;
  57048. if (value && transition$$1) {
  57049. vnode.data.show = true;
  57050. enter(vnode, function () {
  57051. el.style.display = originalDisplay;
  57052. });
  57053. } else {
  57054. el.style.display = value ? originalDisplay : 'none';
  57055. }
  57056. },
  57057. update: function update (el, ref, vnode) {
  57058. var value = ref.value;
  57059. var oldValue = ref.oldValue;
  57060. /* istanbul ignore if */
  57061. if (!value === !oldValue) { return }
  57062. vnode = locateNode(vnode);
  57063. var transition$$1 = vnode.data && vnode.data.transition;
  57064. if (transition$$1) {
  57065. vnode.data.show = true;
  57066. if (value) {
  57067. enter(vnode, function () {
  57068. el.style.display = el.__vOriginalDisplay;
  57069. });
  57070. } else {
  57071. leave(vnode, function () {
  57072. el.style.display = 'none';
  57073. });
  57074. }
  57075. } else {
  57076. el.style.display = value ? el.__vOriginalDisplay : 'none';
  57077. }
  57078. },
  57079. unbind: function unbind (
  57080. el,
  57081. binding,
  57082. vnode,
  57083. oldVnode,
  57084. isDestroy
  57085. ) {
  57086. if (!isDestroy) {
  57087. el.style.display = el.__vOriginalDisplay;
  57088. }
  57089. }
  57090. };
  57091. var platformDirectives = {
  57092. model: directive,
  57093. show: show
  57094. };
  57095. /* */
  57096. var transitionProps = {
  57097. name: String,
  57098. appear: Boolean,
  57099. css: Boolean,
  57100. mode: String,
  57101. type: String,
  57102. enterClass: String,
  57103. leaveClass: String,
  57104. enterToClass: String,
  57105. leaveToClass: String,
  57106. enterActiveClass: String,
  57107. leaveActiveClass: String,
  57108. appearClass: String,
  57109. appearActiveClass: String,
  57110. appearToClass: String,
  57111. duration: [Number, String, Object]
  57112. };
  57113. // in case the child is also an abstract component, e.g. <keep-alive>
  57114. // we want to recursively retrieve the real component to be rendered
  57115. function getRealChild (vnode) {
  57116. var compOptions = vnode && vnode.componentOptions;
  57117. if (compOptions && compOptions.Ctor.options.abstract) {
  57118. return getRealChild(getFirstComponentChild(compOptions.children))
  57119. } else {
  57120. return vnode
  57121. }
  57122. }
  57123. function extractTransitionData (comp) {
  57124. var data = {};
  57125. var options = comp.$options;
  57126. // props
  57127. for (var key in options.propsData) {
  57128. data[key] = comp[key];
  57129. }
  57130. // events.
  57131. // extract listeners and pass them directly to the transition methods
  57132. var listeners = options._parentListeners;
  57133. for (var key$1 in listeners) {
  57134. data[camelize(key$1)] = listeners[key$1];
  57135. }
  57136. return data
  57137. }
  57138. function placeholder (h, rawChild) {
  57139. if (/\d-keep-alive$/.test(rawChild.tag)) {
  57140. return h('keep-alive', {
  57141. props: rawChild.componentOptions.propsData
  57142. })
  57143. }
  57144. }
  57145. function hasParentTransition (vnode) {
  57146. while ((vnode = vnode.parent)) {
  57147. if (vnode.data.transition) {
  57148. return true
  57149. }
  57150. }
  57151. }
  57152. function isSameChild (child, oldChild) {
  57153. return oldChild.key === child.key && oldChild.tag === child.tag
  57154. }
  57155. var isNotTextNode = function (c) { return c.tag || isAsyncPlaceholder(c); };
  57156. var isVShowDirective = function (d) { return d.name === 'show'; };
  57157. var Transition = {
  57158. name: 'transition',
  57159. props: transitionProps,
  57160. abstract: true,
  57161. render: function render (h) {
  57162. var this$1 = this;
  57163. var children = this.$slots.default;
  57164. if (!children) {
  57165. return
  57166. }
  57167. // filter out text nodes (possible whitespaces)
  57168. children = children.filter(isNotTextNode);
  57169. /* istanbul ignore if */
  57170. if (!children.length) {
  57171. return
  57172. }
  57173. // warn multiple elements
  57174. if (children.length > 1) {
  57175. warn(
  57176. '<transition> can only be used on a single element. Use ' +
  57177. '<transition-group> for lists.',
  57178. this.$parent
  57179. );
  57180. }
  57181. var mode = this.mode;
  57182. // warn invalid mode
  57183. if (mode && mode !== 'in-out' && mode !== 'out-in'
  57184. ) {
  57185. warn(
  57186. 'invalid <transition> mode: ' + mode,
  57187. this.$parent
  57188. );
  57189. }
  57190. var rawChild = children[0];
  57191. // if this is a component root node and the component's
  57192. // parent container node also has transition, skip.
  57193. if (hasParentTransition(this.$vnode)) {
  57194. return rawChild
  57195. }
  57196. // apply transition data to child
  57197. // use getRealChild() to ignore abstract components e.g. keep-alive
  57198. var child = getRealChild(rawChild);
  57199. /* istanbul ignore if */
  57200. if (!child) {
  57201. return rawChild
  57202. }
  57203. if (this._leaving) {
  57204. return placeholder(h, rawChild)
  57205. }
  57206. // ensure a key that is unique to the vnode type and to this transition
  57207. // component instance. This key will be used to remove pending leaving nodes
  57208. // during entering.
  57209. var id = "__transition-" + (this._uid) + "-";
  57210. child.key = child.key == null
  57211. ? child.isComment
  57212. ? id + 'comment'
  57213. : id + child.tag
  57214. : isPrimitive(child.key)
  57215. ? (String(child.key).indexOf(id) === 0 ? child.key : id + child.key)
  57216. : child.key;
  57217. var data = (child.data || (child.data = {})).transition = extractTransitionData(this);
  57218. var oldRawChild = this._vnode;
  57219. var oldChild = getRealChild(oldRawChild);
  57220. // mark v-show
  57221. // so that the transition module can hand over the control to the directive
  57222. if (child.data.directives && child.data.directives.some(isVShowDirective)) {
  57223. child.data.show = true;
  57224. }
  57225. if (
  57226. oldChild &&
  57227. oldChild.data &&
  57228. !isSameChild(child, oldChild) &&
  57229. !isAsyncPlaceholder(oldChild) &&
  57230. // #6687 component root is a comment node
  57231. !(oldChild.componentInstance && oldChild.componentInstance._vnode.isComment)
  57232. ) {
  57233. // replace old child transition data with fresh one
  57234. // important for dynamic transitions!
  57235. var oldData = oldChild.data.transition = extend({}, data);
  57236. // handle transition mode
  57237. if (mode === 'out-in') {
  57238. // return placeholder node and queue update when leave finishes
  57239. this._leaving = true;
  57240. mergeVNodeHook(oldData, 'afterLeave', function () {
  57241. this$1._leaving = false;
  57242. this$1.$forceUpdate();
  57243. });
  57244. return placeholder(h, rawChild)
  57245. } else if (mode === 'in-out') {
  57246. if (isAsyncPlaceholder(child)) {
  57247. return oldRawChild
  57248. }
  57249. var delayedLeave;
  57250. var performLeave = function () { delayedLeave(); };
  57251. mergeVNodeHook(data, 'afterEnter', performLeave);
  57252. mergeVNodeHook(data, 'enterCancelled', performLeave);
  57253. mergeVNodeHook(oldData, 'delayLeave', function (leave) { delayedLeave = leave; });
  57254. }
  57255. }
  57256. return rawChild
  57257. }
  57258. };
  57259. /* */
  57260. var props = extend({
  57261. tag: String,
  57262. moveClass: String
  57263. }, transitionProps);
  57264. delete props.mode;
  57265. var TransitionGroup = {
  57266. props: props,
  57267. beforeMount: function beforeMount () {
  57268. var this$1 = this;
  57269. var update = this._update;
  57270. this._update = function (vnode, hydrating) {
  57271. var restoreActiveInstance = setActiveInstance(this$1);
  57272. // force removing pass
  57273. this$1.__patch__(
  57274. this$1._vnode,
  57275. this$1.kept,
  57276. false, // hydrating
  57277. true // removeOnly (!important, avoids unnecessary moves)
  57278. );
  57279. this$1._vnode = this$1.kept;
  57280. restoreActiveInstance();
  57281. update.call(this$1, vnode, hydrating);
  57282. };
  57283. },
  57284. render: function render (h) {
  57285. var tag = this.tag || this.$vnode.data.tag || 'span';
  57286. var map = Object.create(null);
  57287. var prevChildren = this.prevChildren = this.children;
  57288. var rawChildren = this.$slots.default || [];
  57289. var children = this.children = [];
  57290. var transitionData = extractTransitionData(this);
  57291. for (var i = 0; i < rawChildren.length; i++) {
  57292. var c = rawChildren[i];
  57293. if (c.tag) {
  57294. if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {
  57295. children.push(c);
  57296. map[c.key] = c
  57297. ;(c.data || (c.data = {})).transition = transitionData;
  57298. } else {
  57299. var opts = c.componentOptions;
  57300. var name = opts ? (opts.Ctor.options.name || opts.tag || '') : c.tag;
  57301. warn(("<transition-group> children must be keyed: <" + name + ">"));
  57302. }
  57303. }
  57304. }
  57305. if (prevChildren) {
  57306. var kept = [];
  57307. var removed = [];
  57308. for (var i$1 = 0; i$1 < prevChildren.length; i$1++) {
  57309. var c$1 = prevChildren[i$1];
  57310. c$1.data.transition = transitionData;
  57311. c$1.data.pos = c$1.elm.getBoundingClientRect();
  57312. if (map[c$1.key]) {
  57313. kept.push(c$1);
  57314. } else {
  57315. removed.push(c$1);
  57316. }
  57317. }
  57318. this.kept = h(tag, null, kept);
  57319. this.removed = removed;
  57320. }
  57321. return h(tag, null, children)
  57322. },
  57323. updated: function updated () {
  57324. var children = this.prevChildren;
  57325. var moveClass = this.moveClass || ((this.name || 'v') + '-move');
  57326. if (!children.length || !this.hasMove(children[0].elm, moveClass)) {
  57327. return
  57328. }
  57329. // we divide the work into three loops to avoid mixing DOM reads and writes
  57330. // in each iteration - which helps prevent layout thrashing.
  57331. children.forEach(callPendingCbs);
  57332. children.forEach(recordPosition);
  57333. children.forEach(applyTranslation);
  57334. // force reflow to put everything in position
  57335. // assign to this to avoid being removed in tree-shaking
  57336. // $flow-disable-line
  57337. this._reflow = document.body.offsetHeight;
  57338. children.forEach(function (c) {
  57339. if (c.data.moved) {
  57340. var el = c.elm;
  57341. var s = el.style;
  57342. addTransitionClass(el, moveClass);
  57343. s.transform = s.WebkitTransform = s.transitionDuration = '';
  57344. el.addEventListener(transitionEndEvent, el._moveCb = function cb (e) {
  57345. if (e && e.target !== el) {
  57346. return
  57347. }
  57348. if (!e || /transform$/.test(e.propertyName)) {
  57349. el.removeEventListener(transitionEndEvent, cb);
  57350. el._moveCb = null;
  57351. removeTransitionClass(el, moveClass);
  57352. }
  57353. });
  57354. }
  57355. });
  57356. },
  57357. methods: {
  57358. hasMove: function hasMove (el, moveClass) {
  57359. /* istanbul ignore if */
  57360. if (!hasTransition) {
  57361. return false
  57362. }
  57363. /* istanbul ignore if */
  57364. if (this._hasMove) {
  57365. return this._hasMove
  57366. }
  57367. // Detect whether an element with the move class applied has
  57368. // CSS transitions. Since the element may be inside an entering
  57369. // transition at this very moment, we make a clone of it and remove
  57370. // all other transition classes applied to ensure only the move class
  57371. // is applied.
  57372. var clone = el.cloneNode();
  57373. if (el._transitionClasses) {
  57374. el._transitionClasses.forEach(function (cls) { removeClass(clone, cls); });
  57375. }
  57376. addClass(clone, moveClass);
  57377. clone.style.display = 'none';
  57378. this.$el.appendChild(clone);
  57379. var info = getTransitionInfo(clone);
  57380. this.$el.removeChild(clone);
  57381. return (this._hasMove = info.hasTransform)
  57382. }
  57383. }
  57384. };
  57385. function callPendingCbs (c) {
  57386. /* istanbul ignore if */
  57387. if (c.elm._moveCb) {
  57388. c.elm._moveCb();
  57389. }
  57390. /* istanbul ignore if */
  57391. if (c.elm._enterCb) {
  57392. c.elm._enterCb();
  57393. }
  57394. }
  57395. function recordPosition (c) {
  57396. c.data.newPos = c.elm.getBoundingClientRect();
  57397. }
  57398. function applyTranslation (c) {
  57399. var oldPos = c.data.pos;
  57400. var newPos = c.data.newPos;
  57401. var dx = oldPos.left - newPos.left;
  57402. var dy = oldPos.top - newPos.top;
  57403. if (dx || dy) {
  57404. c.data.moved = true;
  57405. var s = c.elm.style;
  57406. s.transform = s.WebkitTransform = "translate(" + dx + "px," + dy + "px)";
  57407. s.transitionDuration = '0s';
  57408. }
  57409. }
  57410. var platformComponents = {
  57411. Transition: Transition,
  57412. TransitionGroup: TransitionGroup
  57413. };
  57414. /* */
  57415. // install platform specific utils
  57416. Vue.config.mustUseProp = mustUseProp;
  57417. Vue.config.isReservedTag = isReservedTag;
  57418. Vue.config.isReservedAttr = isReservedAttr;
  57419. Vue.config.getTagNamespace = getTagNamespace;
  57420. Vue.config.isUnknownElement = isUnknownElement;
  57421. // install platform runtime directives & components
  57422. extend(Vue.options.directives, platformDirectives);
  57423. extend(Vue.options.components, platformComponents);
  57424. // install platform patch function
  57425. Vue.prototype.__patch__ = inBrowser ? patch : noop;
  57426. // public mount method
  57427. Vue.prototype.$mount = function (
  57428. el,
  57429. hydrating
  57430. ) {
  57431. el = el && inBrowser ? query(el) : undefined;
  57432. return mountComponent(this, el, hydrating)
  57433. };
  57434. // devtools global hook
  57435. /* istanbul ignore next */
  57436. if (inBrowser) {
  57437. setTimeout(function () {
  57438. if (config.devtools) {
  57439. if (devtools) {
  57440. devtools.emit('init', Vue);
  57441. } else {
  57442. console[console.info ? 'info' : 'log'](
  57443. 'Download the Vue Devtools extension for a better development experience:\n' +
  57444. 'https://github.com/vuejs/vue-devtools'
  57445. );
  57446. }
  57447. }
  57448. if (config.productionTip !== false &&
  57449. typeof console !== 'undefined'
  57450. ) {
  57451. console[console.info ? 'info' : 'log'](
  57452. "You are running Vue in development mode.\n" +
  57453. "Make sure to turn on production mode when deploying for production.\n" +
  57454. "See more tips at https://vuejs.org/guide/deployment.html"
  57455. );
  57456. }
  57457. }, 0);
  57458. }
  57459. /* */
  57460. var defaultTagRE = /\{\{((?:.|\r?\n)+?)\}\}/g;
  57461. var regexEscapeRE = /[-.*+?^${}()|[\]\/\\]/g;
  57462. var buildRegex = cached(function (delimiters) {
  57463. var open = delimiters[0].replace(regexEscapeRE, '\\$&');
  57464. var close = delimiters[1].replace(regexEscapeRE, '\\$&');
  57465. return new RegExp(open + '((?:.|\\n)+?)' + close, 'g')
  57466. });
  57467. function parseText (
  57468. text,
  57469. delimiters
  57470. ) {
  57471. var tagRE = delimiters ? buildRegex(delimiters) : defaultTagRE;
  57472. if (!tagRE.test(text)) {
  57473. return
  57474. }
  57475. var tokens = [];
  57476. var rawTokens = [];
  57477. var lastIndex = tagRE.lastIndex = 0;
  57478. var match, index, tokenValue;
  57479. while ((match = tagRE.exec(text))) {
  57480. index = match.index;
  57481. // push text token
  57482. if (index > lastIndex) {
  57483. rawTokens.push(tokenValue = text.slice(lastIndex, index));
  57484. tokens.push(JSON.stringify(tokenValue));
  57485. }
  57486. // tag token
  57487. var exp = parseFilters(match[1].trim());
  57488. tokens.push(("_s(" + exp + ")"));
  57489. rawTokens.push({ '@binding': exp });
  57490. lastIndex = index + match[0].length;
  57491. }
  57492. if (lastIndex < text.length) {
  57493. rawTokens.push(tokenValue = text.slice(lastIndex));
  57494. tokens.push(JSON.stringify(tokenValue));
  57495. }
  57496. return {
  57497. expression: tokens.join('+'),
  57498. tokens: rawTokens
  57499. }
  57500. }
  57501. /* */
  57502. function transformNode (el, options) {
  57503. var warn = options.warn || baseWarn;
  57504. var staticClass = getAndRemoveAttr(el, 'class');
  57505. if (staticClass) {
  57506. var res = parseText(staticClass, options.delimiters);
  57507. if (res) {
  57508. warn(
  57509. "class=\"" + staticClass + "\": " +
  57510. 'Interpolation inside attributes has been removed. ' +
  57511. 'Use v-bind or the colon shorthand instead. For example, ' +
  57512. 'instead of <div class="{{ val }}">, use <div :class="val">.',
  57513. el.rawAttrsMap['class']
  57514. );
  57515. }
  57516. }
  57517. if (staticClass) {
  57518. el.staticClass = JSON.stringify(staticClass);
  57519. }
  57520. var classBinding = getBindingAttr(el, 'class', false /* getStatic */);
  57521. if (classBinding) {
  57522. el.classBinding = classBinding;
  57523. }
  57524. }
  57525. function genData (el) {
  57526. var data = '';
  57527. if (el.staticClass) {
  57528. data += "staticClass:" + (el.staticClass) + ",";
  57529. }
  57530. if (el.classBinding) {
  57531. data += "class:" + (el.classBinding) + ",";
  57532. }
  57533. return data
  57534. }
  57535. var klass$1 = {
  57536. staticKeys: ['staticClass'],
  57537. transformNode: transformNode,
  57538. genData: genData
  57539. };
  57540. /* */
  57541. function transformNode$1 (el, options) {
  57542. var warn = options.warn || baseWarn;
  57543. var staticStyle = getAndRemoveAttr(el, 'style');
  57544. if (staticStyle) {
  57545. /* istanbul ignore if */
  57546. {
  57547. var res = parseText(staticStyle, options.delimiters);
  57548. if (res) {
  57549. warn(
  57550. "style=\"" + staticStyle + "\": " +
  57551. 'Interpolation inside attributes has been removed. ' +
  57552. 'Use v-bind or the colon shorthand instead. For example, ' +
  57553. 'instead of <div style="{{ val }}">, use <div :style="val">.',
  57554. el.rawAttrsMap['style']
  57555. );
  57556. }
  57557. }
  57558. el.staticStyle = JSON.stringify(parseStyleText(staticStyle));
  57559. }
  57560. var styleBinding = getBindingAttr(el, 'style', false /* getStatic */);
  57561. if (styleBinding) {
  57562. el.styleBinding = styleBinding;
  57563. }
  57564. }
  57565. function genData$1 (el) {
  57566. var data = '';
  57567. if (el.staticStyle) {
  57568. data += "staticStyle:" + (el.staticStyle) + ",";
  57569. }
  57570. if (el.styleBinding) {
  57571. data += "style:(" + (el.styleBinding) + "),";
  57572. }
  57573. return data
  57574. }
  57575. var style$1 = {
  57576. staticKeys: ['staticStyle'],
  57577. transformNode: transformNode$1,
  57578. genData: genData$1
  57579. };
  57580. /* */
  57581. var decoder;
  57582. var he = {
  57583. decode: function decode (html) {
  57584. decoder = decoder || document.createElement('div');
  57585. decoder.innerHTML = html;
  57586. return decoder.textContent
  57587. }
  57588. };
  57589. /* */
  57590. var isUnaryTag = makeMap(
  57591. 'area,base,br,col,embed,frame,hr,img,input,isindex,keygen,' +
  57592. 'link,meta,param,source,track,wbr'
  57593. );
  57594. // Elements that you can, intentionally, leave open
  57595. // (and which close themselves)
  57596. var canBeLeftOpenTag = makeMap(
  57597. 'colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source'
  57598. );
  57599. // HTML5 tags https://html.spec.whatwg.org/multipage/indices.html#elements-3
  57600. // Phrasing Content https://html.spec.whatwg.org/multipage/dom.html#phrasing-content
  57601. var isNonPhrasingTag = makeMap(
  57602. 'address,article,aside,base,blockquote,body,caption,col,colgroup,dd,' +
  57603. 'details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,' +
  57604. 'h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,' +
  57605. 'optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,' +
  57606. 'title,tr,track'
  57607. );
  57608. /**
  57609. * Not type-checking this file because it's mostly vendor code.
  57610. */
  57611. // Regular Expressions for parsing tags and attributes
  57612. var attribute = /^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/;
  57613. var dynamicArgAttribute = /^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/;
  57614. var ncname = "[a-zA-Z_][\\-\\.0-9_a-zA-Z" + (unicodeRegExp.source) + "]*";
  57615. var qnameCapture = "((?:" + ncname + "\\:)?" + ncname + ")";
  57616. var startTagOpen = new RegExp(("^<" + qnameCapture));
  57617. var startTagClose = /^\s*(\/?)>/;
  57618. var endTag = new RegExp(("^<\\/" + qnameCapture + "[^>]*>"));
  57619. var doctype = /^<!DOCTYPE [^>]+>/i;
  57620. // #7298: escape - to avoid being passed as HTML comment when inlined in page
  57621. var comment = /^<!\--/;
  57622. var conditionalComment = /^<!\[/;
  57623. // Special Elements (can contain anything)
  57624. var isPlainTextElement = makeMap('script,style,textarea', true);
  57625. var reCache = {};
  57626. var decodingMap = {
  57627. '&lt;': '<',
  57628. '&gt;': '>',
  57629. '&quot;': '"',
  57630. '&amp;': '&',
  57631. '&#10;': '\n',
  57632. '&#9;': '\t',
  57633. '&#39;': "'"
  57634. };
  57635. var encodedAttr = /&(?:lt|gt|quot|amp|#39);/g;
  57636. var encodedAttrWithNewLines = /&(?:lt|gt|quot|amp|#39|#10|#9);/g;
  57637. // #5992
  57638. var isIgnoreNewlineTag = makeMap('pre,textarea', true);
  57639. var shouldIgnoreFirstNewline = function (tag, html) { return tag && isIgnoreNewlineTag(tag) && html[0] === '\n'; };
  57640. function decodeAttr (value, shouldDecodeNewlines) {
  57641. var re = shouldDecodeNewlines ? encodedAttrWithNewLines : encodedAttr;
  57642. return value.replace(re, function (match) { return decodingMap[match]; })
  57643. }
  57644. function parseHTML (html, options) {
  57645. var stack = [];
  57646. var expectHTML = options.expectHTML;
  57647. var isUnaryTag$$1 = options.isUnaryTag || no;
  57648. var canBeLeftOpenTag$$1 = options.canBeLeftOpenTag || no;
  57649. var index = 0;
  57650. var last, lastTag;
  57651. while (html) {
  57652. last = html;
  57653. // Make sure we're not in a plaintext content element like script/style
  57654. if (!lastTag || !isPlainTextElement(lastTag)) {
  57655. var textEnd = html.indexOf('<');
  57656. if (textEnd === 0) {
  57657. // Comment:
  57658. if (comment.test(html)) {
  57659. var commentEnd = html.indexOf('-->');
  57660. if (commentEnd >= 0) {
  57661. if (options.shouldKeepComment) {
  57662. options.comment(html.substring(4, commentEnd), index, index + commentEnd + 3);
  57663. }
  57664. advance(commentEnd + 3);
  57665. continue
  57666. }
  57667. }
  57668. // http://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment
  57669. if (conditionalComment.test(html)) {
  57670. var conditionalEnd = html.indexOf(']>');
  57671. if (conditionalEnd >= 0) {
  57672. advance(conditionalEnd + 2);
  57673. continue
  57674. }
  57675. }
  57676. // Doctype:
  57677. var doctypeMatch = html.match(doctype);
  57678. if (doctypeMatch) {
  57679. advance(doctypeMatch[0].length);
  57680. continue
  57681. }
  57682. // End tag:
  57683. var endTagMatch = html.match(endTag);
  57684. if (endTagMatch) {
  57685. var curIndex = index;
  57686. advance(endTagMatch[0].length);
  57687. parseEndTag(endTagMatch[1], curIndex, index);
  57688. continue
  57689. }
  57690. // Start tag:
  57691. var startTagMatch = parseStartTag();
  57692. if (startTagMatch) {
  57693. handleStartTag(startTagMatch);
  57694. if (shouldIgnoreFirstNewline(startTagMatch.tagName, html)) {
  57695. advance(1);
  57696. }
  57697. continue
  57698. }
  57699. }
  57700. var text = (void 0), rest = (void 0), next = (void 0);
  57701. if (textEnd >= 0) {
  57702. rest = html.slice(textEnd);
  57703. while (
  57704. !endTag.test(rest) &&
  57705. !startTagOpen.test(rest) &&
  57706. !comment.test(rest) &&
  57707. !conditionalComment.test(rest)
  57708. ) {
  57709. // < in plain text, be forgiving and treat it as text
  57710. next = rest.indexOf('<', 1);
  57711. if (next < 0) { break }
  57712. textEnd += next;
  57713. rest = html.slice(textEnd);
  57714. }
  57715. text = html.substring(0, textEnd);
  57716. }
  57717. if (textEnd < 0) {
  57718. text = html;
  57719. }
  57720. if (text) {
  57721. advance(text.length);
  57722. }
  57723. if (options.chars && text) {
  57724. options.chars(text, index - text.length, index);
  57725. }
  57726. } else {
  57727. var endTagLength = 0;
  57728. var stackedTag = lastTag.toLowerCase();
  57729. var reStackedTag = reCache[stackedTag] || (reCache[stackedTag] = new RegExp('([\\s\\S]*?)(</' + stackedTag + '[^>]*>)', 'i'));
  57730. var rest$1 = html.replace(reStackedTag, function (all, text, endTag) {
  57731. endTagLength = endTag.length;
  57732. if (!isPlainTextElement(stackedTag) && stackedTag !== 'noscript') {
  57733. text = text
  57734. .replace(/<!\--([\s\S]*?)-->/g, '$1') // #7298
  57735. .replace(/<!\[CDATA\[([\s\S]*?)]]>/g, '$1');
  57736. }
  57737. if (shouldIgnoreFirstNewline(stackedTag, text)) {
  57738. text = text.slice(1);
  57739. }
  57740. if (options.chars) {
  57741. options.chars(text);
  57742. }
  57743. return ''
  57744. });
  57745. index += html.length - rest$1.length;
  57746. html = rest$1;
  57747. parseEndTag(stackedTag, index - endTagLength, index);
  57748. }
  57749. if (html === last) {
  57750. options.chars && options.chars(html);
  57751. if (!stack.length && options.warn) {
  57752. options.warn(("Mal-formatted tag at end of template: \"" + html + "\""), { start: index + html.length });
  57753. }
  57754. break
  57755. }
  57756. }
  57757. // Clean up any remaining tags
  57758. parseEndTag();
  57759. function advance (n) {
  57760. index += n;
  57761. html = html.substring(n);
  57762. }
  57763. function parseStartTag () {
  57764. var start = html.match(startTagOpen);
  57765. if (start) {
  57766. var match = {
  57767. tagName: start[1],
  57768. attrs: [],
  57769. start: index
  57770. };
  57771. advance(start[0].length);
  57772. var end, attr;
  57773. while (!(end = html.match(startTagClose)) && (attr = html.match(dynamicArgAttribute) || html.match(attribute))) {
  57774. attr.start = index;
  57775. advance(attr[0].length);
  57776. attr.end = index;
  57777. match.attrs.push(attr);
  57778. }
  57779. if (end) {
  57780. match.unarySlash = end[1];
  57781. advance(end[0].length);
  57782. match.end = index;
  57783. return match
  57784. }
  57785. }
  57786. }
  57787. function handleStartTag (match) {
  57788. var tagName = match.tagName;
  57789. var unarySlash = match.unarySlash;
  57790. if (expectHTML) {
  57791. if (lastTag === 'p' && isNonPhrasingTag(tagName)) {
  57792. parseEndTag(lastTag);
  57793. }
  57794. if (canBeLeftOpenTag$$1(tagName) && lastTag === tagName) {
  57795. parseEndTag(tagName);
  57796. }
  57797. }
  57798. var unary = isUnaryTag$$1(tagName) || !!unarySlash;
  57799. var l = match.attrs.length;
  57800. var attrs = new Array(l);
  57801. for (var i = 0; i < l; i++) {
  57802. var args = match.attrs[i];
  57803. var value = args[3] || args[4] || args[5] || '';
  57804. var shouldDecodeNewlines = tagName === 'a' && args[1] === 'href'
  57805. ? options.shouldDecodeNewlinesForHref
  57806. : options.shouldDecodeNewlines;
  57807. attrs[i] = {
  57808. name: args[1],
  57809. value: decodeAttr(value, shouldDecodeNewlines)
  57810. };
  57811. if (options.outputSourceRange) {
  57812. attrs[i].start = args.start + args[0].match(/^\s*/).length;
  57813. attrs[i].end = args.end;
  57814. }
  57815. }
  57816. if (!unary) {
  57817. stack.push({ tag: tagName, lowerCasedTag: tagName.toLowerCase(), attrs: attrs, start: match.start, end: match.end });
  57818. lastTag = tagName;
  57819. }
  57820. if (options.start) {
  57821. options.start(tagName, attrs, unary, match.start, match.end);
  57822. }
  57823. }
  57824. function parseEndTag (tagName, start, end) {
  57825. var pos, lowerCasedTagName;
  57826. if (start == null) { start = index; }
  57827. if (end == null) { end = index; }
  57828. // Find the closest opened tag of the same type
  57829. if (tagName) {
  57830. lowerCasedTagName = tagName.toLowerCase();
  57831. for (pos = stack.length - 1; pos >= 0; pos--) {
  57832. if (stack[pos].lowerCasedTag === lowerCasedTagName) {
  57833. break
  57834. }
  57835. }
  57836. } else {
  57837. // If no tag name is provided, clean shop
  57838. pos = 0;
  57839. }
  57840. if (pos >= 0) {
  57841. // Close all the open elements, up the stack
  57842. for (var i = stack.length - 1; i >= pos; i--) {
  57843. if (i > pos || !tagName &&
  57844. options.warn
  57845. ) {
  57846. options.warn(
  57847. ("tag <" + (stack[i].tag) + "> has no matching end tag."),
  57848. { start: stack[i].start, end: stack[i].end }
  57849. );
  57850. }
  57851. if (options.end) {
  57852. options.end(stack[i].tag, start, end);
  57853. }
  57854. }
  57855. // Remove the open elements from the stack
  57856. stack.length = pos;
  57857. lastTag = pos && stack[pos - 1].tag;
  57858. } else if (lowerCasedTagName === 'br') {
  57859. if (options.start) {
  57860. options.start(tagName, [], true, start, end);
  57861. }
  57862. } else if (lowerCasedTagName === 'p') {
  57863. if (options.start) {
  57864. options.start(tagName, [], false, start, end);
  57865. }
  57866. if (options.end) {
  57867. options.end(tagName, start, end);
  57868. }
  57869. }
  57870. }
  57871. }
  57872. /* */
  57873. var onRE = /^@|^v-on:/;
  57874. var dirRE = /^v-|^@|^:|^#/;
  57875. var forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;
  57876. var forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
  57877. var stripParensRE = /^\(|\)$/g;
  57878. var dynamicArgRE = /^\[.*\]$/;
  57879. var argRE = /:(.*)$/;
  57880. var bindRE = /^:|^\.|^v-bind:/;
  57881. var modifierRE = /\.[^.\]]+(?=[^\]]*$)/g;
  57882. var slotRE = /^v-slot(:|$)|^#/;
  57883. var lineBreakRE = /[\r\n]/;
  57884. var whitespaceRE$1 = /\s+/g;
  57885. var invalidAttributeRE = /[\s"'<>\/=]/;
  57886. var decodeHTMLCached = cached(he.decode);
  57887. var emptySlotScopeToken = "_empty_";
  57888. // configurable state
  57889. var warn$2;
  57890. var delimiters;
  57891. var transforms;
  57892. var preTransforms;
  57893. var postTransforms;
  57894. var platformIsPreTag;
  57895. var platformMustUseProp;
  57896. var platformGetTagNamespace;
  57897. var maybeComponent;
  57898. function createASTElement (
  57899. tag,
  57900. attrs,
  57901. parent
  57902. ) {
  57903. return {
  57904. type: 1,
  57905. tag: tag,
  57906. attrsList: attrs,
  57907. attrsMap: makeAttrsMap(attrs),
  57908. rawAttrsMap: {},
  57909. parent: parent,
  57910. children: []
  57911. }
  57912. }
  57913. /**
  57914. * Convert HTML string to AST.
  57915. */
  57916. function parse (
  57917. template,
  57918. options
  57919. ) {
  57920. warn$2 = options.warn || baseWarn;
  57921. platformIsPreTag = options.isPreTag || no;
  57922. platformMustUseProp = options.mustUseProp || no;
  57923. platformGetTagNamespace = options.getTagNamespace || no;
  57924. var isReservedTag = options.isReservedTag || no;
  57925. maybeComponent = function (el) { return !!el.component || !isReservedTag(el.tag); };
  57926. transforms = pluckModuleFunction(options.modules, 'transformNode');
  57927. preTransforms = pluckModuleFunction(options.modules, 'preTransformNode');
  57928. postTransforms = pluckModuleFunction(options.modules, 'postTransformNode');
  57929. delimiters = options.delimiters;
  57930. var stack = [];
  57931. var preserveWhitespace = options.preserveWhitespace !== false;
  57932. var whitespaceOption = options.whitespace;
  57933. var root;
  57934. var currentParent;
  57935. var inVPre = false;
  57936. var inPre = false;
  57937. var warned = false;
  57938. function warnOnce (msg, range) {
  57939. if (!warned) {
  57940. warned = true;
  57941. warn$2(msg, range);
  57942. }
  57943. }
  57944. function closeElement (element) {
  57945. trimEndingWhitespace(element);
  57946. if (!inVPre && !element.processed) {
  57947. element = processElement(element, options);
  57948. }
  57949. // tree management
  57950. if (!stack.length && element !== root) {
  57951. // allow root elements with v-if, v-else-if and v-else
  57952. if (root.if && (element.elseif || element.else)) {
  57953. {
  57954. checkRootConstraints(element);
  57955. }
  57956. addIfCondition(root, {
  57957. exp: element.elseif,
  57958. block: element
  57959. });
  57960. } else {
  57961. warnOnce(
  57962. "Component template should contain exactly one root element. " +
  57963. "If you are using v-if on multiple elements, " +
  57964. "use v-else-if to chain them instead.",
  57965. { start: element.start }
  57966. );
  57967. }
  57968. }
  57969. if (currentParent && !element.forbidden) {
  57970. if (element.elseif || element.else) {
  57971. processIfConditions(element, currentParent);
  57972. } else {
  57973. if (element.slotScope) {
  57974. // scoped slot
  57975. // keep it in the children list so that v-else(-if) conditions can
  57976. // find it as the prev node.
  57977. var name = element.slotTarget || '"default"'
  57978. ;(currentParent.scopedSlots || (currentParent.scopedSlots = {}))[name] = element;
  57979. }
  57980. currentParent.children.push(element);
  57981. element.parent = currentParent;
  57982. }
  57983. }
  57984. // final children cleanup
  57985. // filter out scoped slots
  57986. element.children = element.children.filter(function (c) { return !(c).slotScope; });
  57987. // remove trailing whitespace node again
  57988. trimEndingWhitespace(element);
  57989. // check pre state
  57990. if (element.pre) {
  57991. inVPre = false;
  57992. }
  57993. if (platformIsPreTag(element.tag)) {
  57994. inPre = false;
  57995. }
  57996. // apply post-transforms
  57997. for (var i = 0; i < postTransforms.length; i++) {
  57998. postTransforms[i](element, options);
  57999. }
  58000. }
  58001. function trimEndingWhitespace (el) {
  58002. // remove trailing whitespace node
  58003. if (!inPre) {
  58004. var lastNode;
  58005. while (
  58006. (lastNode = el.children[el.children.length - 1]) &&
  58007. lastNode.type === 3 &&
  58008. lastNode.text === ' '
  58009. ) {
  58010. el.children.pop();
  58011. }
  58012. }
  58013. }
  58014. function checkRootConstraints (el) {
  58015. if (el.tag === 'slot' || el.tag === 'template') {
  58016. warnOnce(
  58017. "Cannot use <" + (el.tag) + "> as component root element because it may " +
  58018. 'contain multiple nodes.',
  58019. { start: el.start }
  58020. );
  58021. }
  58022. if (el.attrsMap.hasOwnProperty('v-for')) {
  58023. warnOnce(
  58024. 'Cannot use v-for on stateful component root element because ' +
  58025. 'it renders multiple elements.',
  58026. el.rawAttrsMap['v-for']
  58027. );
  58028. }
  58029. }
  58030. parseHTML(template, {
  58031. warn: warn$2,
  58032. expectHTML: options.expectHTML,
  58033. isUnaryTag: options.isUnaryTag,
  58034. canBeLeftOpenTag: options.canBeLeftOpenTag,
  58035. shouldDecodeNewlines: options.shouldDecodeNewlines,
  58036. shouldDecodeNewlinesForHref: options.shouldDecodeNewlinesForHref,
  58037. shouldKeepComment: options.comments,
  58038. outputSourceRange: options.outputSourceRange,
  58039. start: function start (tag, attrs, unary, start$1, end) {
  58040. // check namespace.
  58041. // inherit parent ns if there is one
  58042. var ns = (currentParent && currentParent.ns) || platformGetTagNamespace(tag);
  58043. // handle IE svg bug
  58044. /* istanbul ignore if */
  58045. if (isIE && ns === 'svg') {
  58046. attrs = guardIESVGBug(attrs);
  58047. }
  58048. var element = createASTElement(tag, attrs, currentParent);
  58049. if (ns) {
  58050. element.ns = ns;
  58051. }
  58052. {
  58053. if (options.outputSourceRange) {
  58054. element.start = start$1;
  58055. element.end = end;
  58056. element.rawAttrsMap = element.attrsList.reduce(function (cumulated, attr) {
  58057. cumulated[attr.name] = attr;
  58058. return cumulated
  58059. }, {});
  58060. }
  58061. attrs.forEach(function (attr) {
  58062. if (invalidAttributeRE.test(attr.name)) {
  58063. warn$2(
  58064. "Invalid dynamic argument expression: attribute names cannot contain " +
  58065. "spaces, quotes, <, >, / or =.",
  58066. {
  58067. start: attr.start + attr.name.indexOf("["),
  58068. end: attr.start + attr.name.length
  58069. }
  58070. );
  58071. }
  58072. });
  58073. }
  58074. if (isForbiddenTag(element) && !isServerRendering()) {
  58075. element.forbidden = true;
  58076. warn$2(
  58077. 'Templates should only be responsible for mapping the state to the ' +
  58078. 'UI. Avoid placing tags with side-effects in your templates, such as ' +
  58079. "<" + tag + ">" + ', as they will not be parsed.',
  58080. { start: element.start }
  58081. );
  58082. }
  58083. // apply pre-transforms
  58084. for (var i = 0; i < preTransforms.length; i++) {
  58085. element = preTransforms[i](element, options) || element;
  58086. }
  58087. if (!inVPre) {
  58088. processPre(element);
  58089. if (element.pre) {
  58090. inVPre = true;
  58091. }
  58092. }
  58093. if (platformIsPreTag(element.tag)) {
  58094. inPre = true;
  58095. }
  58096. if (inVPre) {
  58097. processRawAttrs(element);
  58098. } else if (!element.processed) {
  58099. // structural directives
  58100. processFor(element);
  58101. processIf(element);
  58102. processOnce(element);
  58103. }
  58104. if (!root) {
  58105. root = element;
  58106. {
  58107. checkRootConstraints(root);
  58108. }
  58109. }
  58110. if (!unary) {
  58111. currentParent = element;
  58112. stack.push(element);
  58113. } else {
  58114. closeElement(element);
  58115. }
  58116. },
  58117. end: function end (tag, start, end$1) {
  58118. var element = stack[stack.length - 1];
  58119. // pop stack
  58120. stack.length -= 1;
  58121. currentParent = stack[stack.length - 1];
  58122. if (options.outputSourceRange) {
  58123. element.end = end$1;
  58124. }
  58125. closeElement(element);
  58126. },
  58127. chars: function chars (text, start, end) {
  58128. if (!currentParent) {
  58129. {
  58130. if (text === template) {
  58131. warnOnce(
  58132. 'Component template requires a root element, rather than just text.',
  58133. { start: start }
  58134. );
  58135. } else if ((text = text.trim())) {
  58136. warnOnce(
  58137. ("text \"" + text + "\" outside root element will be ignored."),
  58138. { start: start }
  58139. );
  58140. }
  58141. }
  58142. return
  58143. }
  58144. // IE textarea placeholder bug
  58145. /* istanbul ignore if */
  58146. if (isIE &&
  58147. currentParent.tag === 'textarea' &&
  58148. currentParent.attrsMap.placeholder === text
  58149. ) {
  58150. return
  58151. }
  58152. var children = currentParent.children;
  58153. if (inPre || text.trim()) {
  58154. text = isTextTag(currentParent) ? text : decodeHTMLCached(text);
  58155. } else if (!children.length) {
  58156. // remove the whitespace-only node right after an opening tag
  58157. text = '';
  58158. } else if (whitespaceOption) {
  58159. if (whitespaceOption === 'condense') {
  58160. // in condense mode, remove the whitespace node if it contains
  58161. // line break, otherwise condense to a single space
  58162. text = lineBreakRE.test(text) ? '' : ' ';
  58163. } else {
  58164. text = ' ';
  58165. }
  58166. } else {
  58167. text = preserveWhitespace ? ' ' : '';
  58168. }
  58169. if (text) {
  58170. if (!inPre && whitespaceOption === 'condense') {
  58171. // condense consecutive whitespaces into single space
  58172. text = text.replace(whitespaceRE$1, ' ');
  58173. }
  58174. var res;
  58175. var child;
  58176. if (!inVPre && text !== ' ' && (res = parseText(text, delimiters))) {
  58177. child = {
  58178. type: 2,
  58179. expression: res.expression,
  58180. tokens: res.tokens,
  58181. text: text
  58182. };
  58183. } else if (text !== ' ' || !children.length || children[children.length - 1].text !== ' ') {
  58184. child = {
  58185. type: 3,
  58186. text: text
  58187. };
  58188. }
  58189. if (child) {
  58190. if (options.outputSourceRange) {
  58191. child.start = start;
  58192. child.end = end;
  58193. }
  58194. children.push(child);
  58195. }
  58196. }
  58197. },
  58198. comment: function comment (text, start, end) {
  58199. // adding anyting as a sibling to the root node is forbidden
  58200. // comments should still be allowed, but ignored
  58201. if (currentParent) {
  58202. var child = {
  58203. type: 3,
  58204. text: text,
  58205. isComment: true
  58206. };
  58207. if (options.outputSourceRange) {
  58208. child.start = start;
  58209. child.end = end;
  58210. }
  58211. currentParent.children.push(child);
  58212. }
  58213. }
  58214. });
  58215. return root
  58216. }
  58217. function processPre (el) {
  58218. if (getAndRemoveAttr(el, 'v-pre') != null) {
  58219. el.pre = true;
  58220. }
  58221. }
  58222. function processRawAttrs (el) {
  58223. var list = el.attrsList;
  58224. var len = list.length;
  58225. if (len) {
  58226. var attrs = el.attrs = new Array(len);
  58227. for (var i = 0; i < len; i++) {
  58228. attrs[i] = {
  58229. name: list[i].name,
  58230. value: JSON.stringify(list[i].value)
  58231. };
  58232. if (list[i].start != null) {
  58233. attrs[i].start = list[i].start;
  58234. attrs[i].end = list[i].end;
  58235. }
  58236. }
  58237. } else if (!el.pre) {
  58238. // non root node in pre blocks with no attributes
  58239. el.plain = true;
  58240. }
  58241. }
  58242. function processElement (
  58243. element,
  58244. options
  58245. ) {
  58246. processKey(element);
  58247. // determine whether this is a plain element after
  58248. // removing structural attributes
  58249. element.plain = (
  58250. !element.key &&
  58251. !element.scopedSlots &&
  58252. !element.attrsList.length
  58253. );
  58254. processRef(element);
  58255. processSlotContent(element);
  58256. processSlotOutlet(element);
  58257. processComponent(element);
  58258. for (var i = 0; i < transforms.length; i++) {
  58259. element = transforms[i](element, options) || element;
  58260. }
  58261. processAttrs(element);
  58262. return element
  58263. }
  58264. function processKey (el) {
  58265. var exp = getBindingAttr(el, 'key');
  58266. if (exp) {
  58267. {
  58268. if (el.tag === 'template') {
  58269. warn$2(
  58270. "<template> cannot be keyed. Place the key on real elements instead.",
  58271. getRawBindingAttr(el, 'key')
  58272. );
  58273. }
  58274. if (el.for) {
  58275. var iterator = el.iterator2 || el.iterator1;
  58276. var parent = el.parent;
  58277. if (iterator && iterator === exp && parent && parent.tag === 'transition-group') {
  58278. warn$2(
  58279. "Do not use v-for index as key on <transition-group> children, " +
  58280. "this is the same as not using keys.",
  58281. getRawBindingAttr(el, 'key'),
  58282. true /* tip */
  58283. );
  58284. }
  58285. }
  58286. }
  58287. el.key = exp;
  58288. }
  58289. }
  58290. function processRef (el) {
  58291. var ref = getBindingAttr(el, 'ref');
  58292. if (ref) {
  58293. el.ref = ref;
  58294. el.refInFor = checkInFor(el);
  58295. }
  58296. }
  58297. function processFor (el) {
  58298. var exp;
  58299. if ((exp = getAndRemoveAttr(el, 'v-for'))) {
  58300. var res = parseFor(exp);
  58301. if (res) {
  58302. extend(el, res);
  58303. } else {
  58304. warn$2(
  58305. ("Invalid v-for expression: " + exp),
  58306. el.rawAttrsMap['v-for']
  58307. );
  58308. }
  58309. }
  58310. }
  58311. function parseFor (exp) {
  58312. var inMatch = exp.match(forAliasRE);
  58313. if (!inMatch) { return }
  58314. var res = {};
  58315. res.for = inMatch[2].trim();
  58316. var alias = inMatch[1].trim().replace(stripParensRE, '');
  58317. var iteratorMatch = alias.match(forIteratorRE);
  58318. if (iteratorMatch) {
  58319. res.alias = alias.replace(forIteratorRE, '').trim();
  58320. res.iterator1 = iteratorMatch[1].trim();
  58321. if (iteratorMatch[2]) {
  58322. res.iterator2 = iteratorMatch[2].trim();
  58323. }
  58324. } else {
  58325. res.alias = alias;
  58326. }
  58327. return res
  58328. }
  58329. function processIf (el) {
  58330. var exp = getAndRemoveAttr(el, 'v-if');
  58331. if (exp) {
  58332. el.if = exp;
  58333. addIfCondition(el, {
  58334. exp: exp,
  58335. block: el
  58336. });
  58337. } else {
  58338. if (getAndRemoveAttr(el, 'v-else') != null) {
  58339. el.else = true;
  58340. }
  58341. var elseif = getAndRemoveAttr(el, 'v-else-if');
  58342. if (elseif) {
  58343. el.elseif = elseif;
  58344. }
  58345. }
  58346. }
  58347. function processIfConditions (el, parent) {
  58348. var prev = findPrevElement(parent.children);
  58349. if (prev && prev.if) {
  58350. addIfCondition(prev, {
  58351. exp: el.elseif,
  58352. block: el
  58353. });
  58354. } else {
  58355. warn$2(
  58356. "v-" + (el.elseif ? ('else-if="' + el.elseif + '"') : 'else') + " " +
  58357. "used on element <" + (el.tag) + "> without corresponding v-if.",
  58358. el.rawAttrsMap[el.elseif ? 'v-else-if' : 'v-else']
  58359. );
  58360. }
  58361. }
  58362. function findPrevElement (children) {
  58363. var i = children.length;
  58364. while (i--) {
  58365. if (children[i].type === 1) {
  58366. return children[i]
  58367. } else {
  58368. if (children[i].text !== ' ') {
  58369. warn$2(
  58370. "text \"" + (children[i].text.trim()) + "\" between v-if and v-else(-if) " +
  58371. "will be ignored.",
  58372. children[i]
  58373. );
  58374. }
  58375. children.pop();
  58376. }
  58377. }
  58378. }
  58379. function addIfCondition (el, condition) {
  58380. if (!el.ifConditions) {
  58381. el.ifConditions = [];
  58382. }
  58383. el.ifConditions.push(condition);
  58384. }
  58385. function processOnce (el) {
  58386. var once$$1 = getAndRemoveAttr(el, 'v-once');
  58387. if (once$$1 != null) {
  58388. el.once = true;
  58389. }
  58390. }
  58391. // handle content being passed to a component as slot,
  58392. // e.g. <template slot="xxx">, <div slot-scope="xxx">
  58393. function processSlotContent (el) {
  58394. var slotScope;
  58395. if (el.tag === 'template') {
  58396. slotScope = getAndRemoveAttr(el, 'scope');
  58397. /* istanbul ignore if */
  58398. if (slotScope) {
  58399. warn$2(
  58400. "the \"scope\" attribute for scoped slots have been deprecated and " +
  58401. "replaced by \"slot-scope\" since 2.5. The new \"slot-scope\" attribute " +
  58402. "can also be used on plain elements in addition to <template> to " +
  58403. "denote scoped slots.",
  58404. el.rawAttrsMap['scope'],
  58405. true
  58406. );
  58407. }
  58408. el.slotScope = slotScope || getAndRemoveAttr(el, 'slot-scope');
  58409. } else if ((slotScope = getAndRemoveAttr(el, 'slot-scope'))) {
  58410. /* istanbul ignore if */
  58411. if (el.attrsMap['v-for']) {
  58412. warn$2(
  58413. "Ambiguous combined usage of slot-scope and v-for on <" + (el.tag) + "> " +
  58414. "(v-for takes higher priority). Use a wrapper <template> for the " +
  58415. "scoped slot to make it clearer.",
  58416. el.rawAttrsMap['slot-scope'],
  58417. true
  58418. );
  58419. }
  58420. el.slotScope = slotScope;
  58421. }
  58422. // slot="xxx"
  58423. var slotTarget = getBindingAttr(el, 'slot');
  58424. if (slotTarget) {
  58425. el.slotTarget = slotTarget === '""' ? '"default"' : slotTarget;
  58426. el.slotTargetDynamic = !!(el.attrsMap[':slot'] || el.attrsMap['v-bind:slot']);
  58427. // preserve slot as an attribute for native shadow DOM compat
  58428. // only for non-scoped slots.
  58429. if (el.tag !== 'template' && !el.slotScope) {
  58430. addAttr(el, 'slot', slotTarget, getRawBindingAttr(el, 'slot'));
  58431. }
  58432. }
  58433. // 2.6 v-slot syntax
  58434. {
  58435. if (el.tag === 'template') {
  58436. // v-slot on <template>
  58437. var slotBinding = getAndRemoveAttrByRegex(el, slotRE);
  58438. if (slotBinding) {
  58439. {
  58440. if (el.slotTarget || el.slotScope) {
  58441. warn$2(
  58442. "Unexpected mixed usage of different slot syntaxes.",
  58443. el
  58444. );
  58445. }
  58446. if (el.parent && !maybeComponent(el.parent)) {
  58447. warn$2(
  58448. "<template v-slot> can only appear at the root level inside " +
  58449. "the receiving component",
  58450. el
  58451. );
  58452. }
  58453. }
  58454. var ref = getSlotName(slotBinding);
  58455. var name = ref.name;
  58456. var dynamic = ref.dynamic;
  58457. el.slotTarget = name;
  58458. el.slotTargetDynamic = dynamic;
  58459. el.slotScope = slotBinding.value || emptySlotScopeToken; // force it into a scoped slot for perf
  58460. }
  58461. } else {
  58462. // v-slot on component, denotes default slot
  58463. var slotBinding$1 = getAndRemoveAttrByRegex(el, slotRE);
  58464. if (slotBinding$1) {
  58465. {
  58466. if (!maybeComponent(el)) {
  58467. warn$2(
  58468. "v-slot can only be used on components or <template>.",
  58469. slotBinding$1
  58470. );
  58471. }
  58472. if (el.slotScope || el.slotTarget) {
  58473. warn$2(
  58474. "Unexpected mixed usage of different slot syntaxes.",
  58475. el
  58476. );
  58477. }
  58478. if (el.scopedSlots) {
  58479. warn$2(
  58480. "To avoid scope ambiguity, the default slot should also use " +
  58481. "<template> syntax when there are other named slots.",
  58482. slotBinding$1
  58483. );
  58484. }
  58485. }
  58486. // add the component's children to its default slot
  58487. var slots = el.scopedSlots || (el.scopedSlots = {});
  58488. var ref$1 = getSlotName(slotBinding$1);
  58489. var name$1 = ref$1.name;
  58490. var dynamic$1 = ref$1.dynamic;
  58491. var slotContainer = slots[name$1] = createASTElement('template', [], el);
  58492. slotContainer.slotTarget = name$1;
  58493. slotContainer.slotTargetDynamic = dynamic$1;
  58494. slotContainer.children = el.children.filter(function (c) {
  58495. if (!c.slotScope) {
  58496. c.parent = slotContainer;
  58497. return true
  58498. }
  58499. });
  58500. slotContainer.slotScope = slotBinding$1.value || emptySlotScopeToken;
  58501. // remove children as they are returned from scopedSlots now
  58502. el.children = [];
  58503. // mark el non-plain so data gets generated
  58504. el.plain = false;
  58505. }
  58506. }
  58507. }
  58508. }
  58509. function getSlotName (binding) {
  58510. var name = binding.name.replace(slotRE, '');
  58511. if (!name) {
  58512. if (binding.name[0] !== '#') {
  58513. name = 'default';
  58514. } else {
  58515. warn$2(
  58516. "v-slot shorthand syntax requires a slot name.",
  58517. binding
  58518. );
  58519. }
  58520. }
  58521. return dynamicArgRE.test(name)
  58522. // dynamic [name]
  58523. ? { name: name.slice(1, -1), dynamic: true }
  58524. // static name
  58525. : { name: ("\"" + name + "\""), dynamic: false }
  58526. }
  58527. // handle <slot/> outlets
  58528. function processSlotOutlet (el) {
  58529. if (el.tag === 'slot') {
  58530. el.slotName = getBindingAttr(el, 'name');
  58531. if (el.key) {
  58532. warn$2(
  58533. "`key` does not work on <slot> because slots are abstract outlets " +
  58534. "and can possibly expand into multiple elements. " +
  58535. "Use the key on a wrapping element instead.",
  58536. getRawBindingAttr(el, 'key')
  58537. );
  58538. }
  58539. }
  58540. }
  58541. function processComponent (el) {
  58542. var binding;
  58543. if ((binding = getBindingAttr(el, 'is'))) {
  58544. el.component = binding;
  58545. }
  58546. if (getAndRemoveAttr(el, 'inline-template') != null) {
  58547. el.inlineTemplate = true;
  58548. }
  58549. }
  58550. function processAttrs (el) {
  58551. var list = el.attrsList;
  58552. var i, l, name, rawName, value, modifiers, syncGen, isDynamic;
  58553. for (i = 0, l = list.length; i < l; i++) {
  58554. name = rawName = list[i].name;
  58555. value = list[i].value;
  58556. if (dirRE.test(name)) {
  58557. // mark element as dynamic
  58558. el.hasBindings = true;
  58559. // modifiers
  58560. modifiers = parseModifiers(name.replace(dirRE, ''));
  58561. // support .foo shorthand syntax for the .prop modifier
  58562. if (modifiers) {
  58563. name = name.replace(modifierRE, '');
  58564. }
  58565. if (bindRE.test(name)) { // v-bind
  58566. name = name.replace(bindRE, '');
  58567. value = parseFilters(value);
  58568. isDynamic = dynamicArgRE.test(name);
  58569. if (isDynamic) {
  58570. name = name.slice(1, -1);
  58571. }
  58572. if (
  58573. value.trim().length === 0
  58574. ) {
  58575. warn$2(
  58576. ("The value for a v-bind expression cannot be empty. Found in \"v-bind:" + name + "\"")
  58577. );
  58578. }
  58579. if (modifiers) {
  58580. if (modifiers.prop && !isDynamic) {
  58581. name = camelize(name);
  58582. if (name === 'innerHtml') { name = 'innerHTML'; }
  58583. }
  58584. if (modifiers.camel && !isDynamic) {
  58585. name = camelize(name);
  58586. }
  58587. if (modifiers.sync) {
  58588. syncGen = genAssignmentCode(value, "$event");
  58589. if (!isDynamic) {
  58590. addHandler(
  58591. el,
  58592. ("update:" + (camelize(name))),
  58593. syncGen,
  58594. null,
  58595. false,
  58596. warn$2,
  58597. list[i]
  58598. );
  58599. if (hyphenate(name) !== camelize(name)) {
  58600. addHandler(
  58601. el,
  58602. ("update:" + (hyphenate(name))),
  58603. syncGen,
  58604. null,
  58605. false,
  58606. warn$2,
  58607. list[i]
  58608. );
  58609. }
  58610. } else {
  58611. // handler w/ dynamic event name
  58612. addHandler(
  58613. el,
  58614. ("\"update:\"+(" + name + ")"),
  58615. syncGen,
  58616. null,
  58617. false,
  58618. warn$2,
  58619. list[i],
  58620. true // dynamic
  58621. );
  58622. }
  58623. }
  58624. }
  58625. if ((modifiers && modifiers.prop) || (
  58626. !el.component && platformMustUseProp(el.tag, el.attrsMap.type, name)
  58627. )) {
  58628. addProp(el, name, value, list[i], isDynamic);
  58629. } else {
  58630. addAttr(el, name, value, list[i], isDynamic);
  58631. }
  58632. } else if (onRE.test(name)) { // v-on
  58633. name = name.replace(onRE, '');
  58634. isDynamic = dynamicArgRE.test(name);
  58635. if (isDynamic) {
  58636. name = name.slice(1, -1);
  58637. }
  58638. addHandler(el, name, value, modifiers, false, warn$2, list[i], isDynamic);
  58639. } else { // normal directives
  58640. name = name.replace(dirRE, '');
  58641. // parse arg
  58642. var argMatch = name.match(argRE);
  58643. var arg = argMatch && argMatch[1];
  58644. isDynamic = false;
  58645. if (arg) {
  58646. name = name.slice(0, -(arg.length + 1));
  58647. if (dynamicArgRE.test(arg)) {
  58648. arg = arg.slice(1, -1);
  58649. isDynamic = true;
  58650. }
  58651. }
  58652. addDirective(el, name, rawName, value, arg, isDynamic, modifiers, list[i]);
  58653. if (name === 'model') {
  58654. checkForAliasModel(el, value);
  58655. }
  58656. }
  58657. } else {
  58658. // literal attribute
  58659. {
  58660. var res = parseText(value, delimiters);
  58661. if (res) {
  58662. warn$2(
  58663. name + "=\"" + value + "\": " +
  58664. 'Interpolation inside attributes has been removed. ' +
  58665. 'Use v-bind or the colon shorthand instead. For example, ' +
  58666. 'instead of <div id="{{ val }}">, use <div :id="val">.',
  58667. list[i]
  58668. );
  58669. }
  58670. }
  58671. addAttr(el, name, JSON.stringify(value), list[i]);
  58672. // #6887 firefox doesn't update muted state if set via attribute
  58673. // even immediately after element creation
  58674. if (!el.component &&
  58675. name === 'muted' &&
  58676. platformMustUseProp(el.tag, el.attrsMap.type, name)) {
  58677. addProp(el, name, 'true', list[i]);
  58678. }
  58679. }
  58680. }
  58681. }
  58682. function checkInFor (el) {
  58683. var parent = el;
  58684. while (parent) {
  58685. if (parent.for !== undefined) {
  58686. return true
  58687. }
  58688. parent = parent.parent;
  58689. }
  58690. return false
  58691. }
  58692. function parseModifiers (name) {
  58693. var match = name.match(modifierRE);
  58694. if (match) {
  58695. var ret = {};
  58696. match.forEach(function (m) { ret[m.slice(1)] = true; });
  58697. return ret
  58698. }
  58699. }
  58700. function makeAttrsMap (attrs) {
  58701. var map = {};
  58702. for (var i = 0, l = attrs.length; i < l; i++) {
  58703. if (
  58704. map[attrs[i].name] && !isIE && !isEdge
  58705. ) {
  58706. warn$2('duplicate attribute: ' + attrs[i].name, attrs[i]);
  58707. }
  58708. map[attrs[i].name] = attrs[i].value;
  58709. }
  58710. return map
  58711. }
  58712. // for script (e.g. type="x/template") or style, do not decode content
  58713. function isTextTag (el) {
  58714. return el.tag === 'script' || el.tag === 'style'
  58715. }
  58716. function isForbiddenTag (el) {
  58717. return (
  58718. el.tag === 'style' ||
  58719. (el.tag === 'script' && (
  58720. !el.attrsMap.type ||
  58721. el.attrsMap.type === 'text/javascript'
  58722. ))
  58723. )
  58724. }
  58725. var ieNSBug = /^xmlns:NS\d+/;
  58726. var ieNSPrefix = /^NS\d+:/;
  58727. /* istanbul ignore next */
  58728. function guardIESVGBug (attrs) {
  58729. var res = [];
  58730. for (var i = 0; i < attrs.length; i++) {
  58731. var attr = attrs[i];
  58732. if (!ieNSBug.test(attr.name)) {
  58733. attr.name = attr.name.replace(ieNSPrefix, '');
  58734. res.push(attr);
  58735. }
  58736. }
  58737. return res
  58738. }
  58739. function checkForAliasModel (el, value) {
  58740. var _el = el;
  58741. while (_el) {
  58742. if (_el.for && _el.alias === value) {
  58743. warn$2(
  58744. "<" + (el.tag) + " v-model=\"" + value + "\">: " +
  58745. "You are binding v-model directly to a v-for iteration alias. " +
  58746. "This will not be able to modify the v-for source array because " +
  58747. "writing to the alias is like modifying a function local variable. " +
  58748. "Consider using an array of objects and use v-model on an object property instead.",
  58749. el.rawAttrsMap['v-model']
  58750. );
  58751. }
  58752. _el = _el.parent;
  58753. }
  58754. }
  58755. /* */
  58756. function preTransformNode (el, options) {
  58757. if (el.tag === 'input') {
  58758. var map = el.attrsMap;
  58759. if (!map['v-model']) {
  58760. return
  58761. }
  58762. var typeBinding;
  58763. if (map[':type'] || map['v-bind:type']) {
  58764. typeBinding = getBindingAttr(el, 'type');
  58765. }
  58766. if (!map.type && !typeBinding && map['v-bind']) {
  58767. typeBinding = "(" + (map['v-bind']) + ").type";
  58768. }
  58769. if (typeBinding) {
  58770. var ifCondition = getAndRemoveAttr(el, 'v-if', true);
  58771. var ifConditionExtra = ifCondition ? ("&&(" + ifCondition + ")") : "";
  58772. var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;
  58773. var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);
  58774. // 1. checkbox
  58775. var branch0 = cloneASTElement(el);
  58776. // process for on the main node
  58777. processFor(branch0);
  58778. addRawAttr(branch0, 'type', 'checkbox');
  58779. processElement(branch0, options);
  58780. branch0.processed = true; // prevent it from double-processed
  58781. branch0.if = "(" + typeBinding + ")==='checkbox'" + ifConditionExtra;
  58782. addIfCondition(branch0, {
  58783. exp: branch0.if,
  58784. block: branch0
  58785. });
  58786. // 2. add radio else-if condition
  58787. var branch1 = cloneASTElement(el);
  58788. getAndRemoveAttr(branch1, 'v-for', true);
  58789. addRawAttr(branch1, 'type', 'radio');
  58790. processElement(branch1, options);
  58791. addIfCondition(branch0, {
  58792. exp: "(" + typeBinding + ")==='radio'" + ifConditionExtra,
  58793. block: branch1
  58794. });
  58795. // 3. other
  58796. var branch2 = cloneASTElement(el);
  58797. getAndRemoveAttr(branch2, 'v-for', true);
  58798. addRawAttr(branch2, ':type', typeBinding);
  58799. processElement(branch2, options);
  58800. addIfCondition(branch0, {
  58801. exp: ifCondition,
  58802. block: branch2
  58803. });
  58804. if (hasElse) {
  58805. branch0.else = true;
  58806. } else if (elseIfCondition) {
  58807. branch0.elseif = elseIfCondition;
  58808. }
  58809. return branch0
  58810. }
  58811. }
  58812. }
  58813. function cloneASTElement (el) {
  58814. return createASTElement(el.tag, el.attrsList.slice(), el.parent)
  58815. }
  58816. var model$1 = {
  58817. preTransformNode: preTransformNode
  58818. };
  58819. var modules$1 = [
  58820. klass$1,
  58821. style$1,
  58822. model$1
  58823. ];
  58824. /* */
  58825. function text (el, dir) {
  58826. if (dir.value) {
  58827. addProp(el, 'textContent', ("_s(" + (dir.value) + ")"), dir);
  58828. }
  58829. }
  58830. /* */
  58831. function html (el, dir) {
  58832. if (dir.value) {
  58833. addProp(el, 'innerHTML', ("_s(" + (dir.value) + ")"), dir);
  58834. }
  58835. }
  58836. var directives$1 = {
  58837. model: model,
  58838. text: text,
  58839. html: html
  58840. };
  58841. /* */
  58842. var baseOptions = {
  58843. expectHTML: true,
  58844. modules: modules$1,
  58845. directives: directives$1,
  58846. isPreTag: isPreTag,
  58847. isUnaryTag: isUnaryTag,
  58848. mustUseProp: mustUseProp,
  58849. canBeLeftOpenTag: canBeLeftOpenTag,
  58850. isReservedTag: isReservedTag,
  58851. getTagNamespace: getTagNamespace,
  58852. staticKeys: genStaticKeys(modules$1)
  58853. };
  58854. /* */
  58855. var isStaticKey;
  58856. var isPlatformReservedTag;
  58857. var genStaticKeysCached = cached(genStaticKeys$1);
  58858. /**
  58859. * Goal of the optimizer: walk the generated template AST tree
  58860. * and detect sub-trees that are purely static, i.e. parts of
  58861. * the DOM that never needs to change.
  58862. *
  58863. * Once we detect these sub-trees, we can:
  58864. *
  58865. * 1. Hoist them into constants, so that we no longer need to
  58866. * create fresh nodes for them on each re-render;
  58867. * 2. Completely skip them in the patching process.
  58868. */
  58869. function optimize (root, options) {
  58870. if (!root) { return }
  58871. isStaticKey = genStaticKeysCached(options.staticKeys || '');
  58872. isPlatformReservedTag = options.isReservedTag || no;
  58873. // first pass: mark all non-static nodes.
  58874. markStatic$1(root);
  58875. // second pass: mark static roots.
  58876. markStaticRoots(root, false);
  58877. }
  58878. function genStaticKeys$1 (keys) {
  58879. return makeMap(
  58880. 'type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap' +
  58881. (keys ? ',' + keys : '')
  58882. )
  58883. }
  58884. function markStatic$1 (node) {
  58885. node.static = isStatic(node);
  58886. if (node.type === 1) {
  58887. // do not make component slot content static. this avoids
  58888. // 1. components not able to mutate slot nodes
  58889. // 2. static slot content fails for hot-reloading
  58890. if (
  58891. !isPlatformReservedTag(node.tag) &&
  58892. node.tag !== 'slot' &&
  58893. node.attrsMap['inline-template'] == null
  58894. ) {
  58895. return
  58896. }
  58897. for (var i = 0, l = node.children.length; i < l; i++) {
  58898. var child = node.children[i];
  58899. markStatic$1(child);
  58900. if (!child.static) {
  58901. node.static = false;
  58902. }
  58903. }
  58904. if (node.ifConditions) {
  58905. for (var i$1 = 1, l$1 = node.ifConditions.length; i$1 < l$1; i$1++) {
  58906. var block = node.ifConditions[i$1].block;
  58907. markStatic$1(block);
  58908. if (!block.static) {
  58909. node.static = false;
  58910. }
  58911. }
  58912. }
  58913. }
  58914. }
  58915. function markStaticRoots (node, isInFor) {
  58916. if (node.type === 1) {
  58917. if (node.static || node.once) {
  58918. node.staticInFor = isInFor;
  58919. }
  58920. // For a node to qualify as a static root, it should have children that
  58921. // are not just static text. Otherwise the cost of hoisting out will
  58922. // outweigh the benefits and it's better off to just always render it fresh.
  58923. if (node.static && node.children.length && !(
  58924. node.children.length === 1 &&
  58925. node.children[0].type === 3
  58926. )) {
  58927. node.staticRoot = true;
  58928. return
  58929. } else {
  58930. node.staticRoot = false;
  58931. }
  58932. if (node.children) {
  58933. for (var i = 0, l = node.children.length; i < l; i++) {
  58934. markStaticRoots(node.children[i], isInFor || !!node.for);
  58935. }
  58936. }
  58937. if (node.ifConditions) {
  58938. for (var i$1 = 1, l$1 = node.ifConditions.length; i$1 < l$1; i$1++) {
  58939. markStaticRoots(node.ifConditions[i$1].block, isInFor);
  58940. }
  58941. }
  58942. }
  58943. }
  58944. function isStatic (node) {
  58945. if (node.type === 2) { // expression
  58946. return false
  58947. }
  58948. if (node.type === 3) { // text
  58949. return true
  58950. }
  58951. return !!(node.pre || (
  58952. !node.hasBindings && // no dynamic bindings
  58953. !node.if && !node.for && // not v-if or v-for or v-else
  58954. !isBuiltInTag(node.tag) && // not a built-in
  58955. isPlatformReservedTag(node.tag) && // not a component
  58956. !isDirectChildOfTemplateFor(node) &&
  58957. Object.keys(node).every(isStaticKey)
  58958. ))
  58959. }
  58960. function isDirectChildOfTemplateFor (node) {
  58961. while (node.parent) {
  58962. node = node.parent;
  58963. if (node.tag !== 'template') {
  58964. return false
  58965. }
  58966. if (node.for) {
  58967. return true
  58968. }
  58969. }
  58970. return false
  58971. }
  58972. /* */
  58973. var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function(?:\s+[\w$]+)?\s*\(/;
  58974. var fnInvokeRE = /\([^)]*?\);*$/;
  58975. var simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/;
  58976. // KeyboardEvent.keyCode aliases
  58977. var keyCodes = {
  58978. esc: 27,
  58979. tab: 9,
  58980. enter: 13,
  58981. space: 32,
  58982. up: 38,
  58983. left: 37,
  58984. right: 39,
  58985. down: 40,
  58986. 'delete': [8, 46]
  58987. };
  58988. // KeyboardEvent.key aliases
  58989. var keyNames = {
  58990. // #7880: IE11 and Edge use `Esc` for Escape key name.
  58991. esc: ['Esc', 'Escape'],
  58992. tab: 'Tab',
  58993. enter: 'Enter',
  58994. // #9112: IE11 uses `Spacebar` for Space key name.
  58995. space: [' ', 'Spacebar'],
  58996. // #7806: IE11 uses key names without `Arrow` prefix for arrow keys.
  58997. up: ['Up', 'ArrowUp'],
  58998. left: ['Left', 'ArrowLeft'],
  58999. right: ['Right', 'ArrowRight'],
  59000. down: ['Down', 'ArrowDown'],
  59001. // #9112: IE11 uses `Del` for Delete key name.
  59002. 'delete': ['Backspace', 'Delete', 'Del']
  59003. };
  59004. // #4868: modifiers that prevent the execution of the listener
  59005. // need to explicitly return null so that we can determine whether to remove
  59006. // the listener for .once
  59007. var genGuard = function (condition) { return ("if(" + condition + ")return null;"); };
  59008. var modifierCode = {
  59009. stop: '$event.stopPropagation();',
  59010. prevent: '$event.preventDefault();',
  59011. self: genGuard("$event.target !== $event.currentTarget"),
  59012. ctrl: genGuard("!$event.ctrlKey"),
  59013. shift: genGuard("!$event.shiftKey"),
  59014. alt: genGuard("!$event.altKey"),
  59015. meta: genGuard("!$event.metaKey"),
  59016. left: genGuard("'button' in $event && $event.button !== 0"),
  59017. middle: genGuard("'button' in $event && $event.button !== 1"),
  59018. right: genGuard("'button' in $event && $event.button !== 2")
  59019. };
  59020. function genHandlers (
  59021. events,
  59022. isNative
  59023. ) {
  59024. var prefix = isNative ? 'nativeOn:' : 'on:';
  59025. var staticHandlers = "";
  59026. var dynamicHandlers = "";
  59027. for (var name in events) {
  59028. var handlerCode = genHandler(events[name]);
  59029. if (events[name] && events[name].dynamic) {
  59030. dynamicHandlers += name + "," + handlerCode + ",";
  59031. } else {
  59032. staticHandlers += "\"" + name + "\":" + handlerCode + ",";
  59033. }
  59034. }
  59035. staticHandlers = "{" + (staticHandlers.slice(0, -1)) + "}";
  59036. if (dynamicHandlers) {
  59037. return prefix + "_d(" + staticHandlers + ",[" + (dynamicHandlers.slice(0, -1)) + "])"
  59038. } else {
  59039. return prefix + staticHandlers
  59040. }
  59041. }
  59042. function genHandler (handler) {
  59043. if (!handler) {
  59044. return 'function(){}'
  59045. }
  59046. if (Array.isArray(handler)) {
  59047. return ("[" + (handler.map(function (handler) { return genHandler(handler); }).join(',')) + "]")
  59048. }
  59049. var isMethodPath = simplePathRE.test(handler.value);
  59050. var isFunctionExpression = fnExpRE.test(handler.value);
  59051. var isFunctionInvocation = simplePathRE.test(handler.value.replace(fnInvokeRE, ''));
  59052. if (!handler.modifiers) {
  59053. if (isMethodPath || isFunctionExpression) {
  59054. return handler.value
  59055. }
  59056. return ("function($event){" + (isFunctionInvocation ? ("return " + (handler.value)) : handler.value) + "}") // inline statement
  59057. } else {
  59058. var code = '';
  59059. var genModifierCode = '';
  59060. var keys = [];
  59061. for (var key in handler.modifiers) {
  59062. if (modifierCode[key]) {
  59063. genModifierCode += modifierCode[key];
  59064. // left/right
  59065. if (keyCodes[key]) {
  59066. keys.push(key);
  59067. }
  59068. } else if (key === 'exact') {
  59069. var modifiers = (handler.modifiers);
  59070. genModifierCode += genGuard(
  59071. ['ctrl', 'shift', 'alt', 'meta']
  59072. .filter(function (keyModifier) { return !modifiers[keyModifier]; })
  59073. .map(function (keyModifier) { return ("$event." + keyModifier + "Key"); })
  59074. .join('||')
  59075. );
  59076. } else {
  59077. keys.push(key);
  59078. }
  59079. }
  59080. if (keys.length) {
  59081. code += genKeyFilter(keys);
  59082. }
  59083. // Make sure modifiers like prevent and stop get executed after key filtering
  59084. if (genModifierCode) {
  59085. code += genModifierCode;
  59086. }
  59087. var handlerCode = isMethodPath
  59088. ? ("return " + (handler.value) + "($event)")
  59089. : isFunctionExpression
  59090. ? ("return (" + (handler.value) + ")($event)")
  59091. : isFunctionInvocation
  59092. ? ("return " + (handler.value))
  59093. : handler.value;
  59094. return ("function($event){" + code + handlerCode + "}")
  59095. }
  59096. }
  59097. function genKeyFilter (keys) {
  59098. return (
  59099. // make sure the key filters only apply to KeyboardEvents
  59100. // #9441: can't use 'keyCode' in $event because Chrome autofill fires fake
  59101. // key events that do not have keyCode property...
  59102. "if(!$event.type.indexOf('key')&&" +
  59103. (keys.map(genFilterCode).join('&&')) + ")return null;"
  59104. )
  59105. }
  59106. function genFilterCode (key) {
  59107. var keyVal = parseInt(key, 10);
  59108. if (keyVal) {
  59109. return ("$event.keyCode!==" + keyVal)
  59110. }
  59111. var keyCode = keyCodes[key];
  59112. var keyName = keyNames[key];
  59113. return (
  59114. "_k($event.keyCode," +
  59115. (JSON.stringify(key)) + "," +
  59116. (JSON.stringify(keyCode)) + "," +
  59117. "$event.key," +
  59118. "" + (JSON.stringify(keyName)) +
  59119. ")"
  59120. )
  59121. }
  59122. /* */
  59123. function on (el, dir) {
  59124. if (dir.modifiers) {
  59125. warn("v-on without argument does not support modifiers.");
  59126. }
  59127. el.wrapListeners = function (code) { return ("_g(" + code + "," + (dir.value) + ")"); };
  59128. }
  59129. /* */
  59130. function bind$1 (el, dir) {
  59131. el.wrapData = function (code) {
  59132. return ("_b(" + code + ",'" + (el.tag) + "'," + (dir.value) + "," + (dir.modifiers && dir.modifiers.prop ? 'true' : 'false') + (dir.modifiers && dir.modifiers.sync ? ',true' : '') + ")")
  59133. };
  59134. }
  59135. /* */
  59136. var baseDirectives = {
  59137. on: on,
  59138. bind: bind$1,
  59139. cloak: noop
  59140. };
  59141. /* */
  59142. var CodegenState = function CodegenState (options) {
  59143. this.options = options;
  59144. this.warn = options.warn || baseWarn;
  59145. this.transforms = pluckModuleFunction(options.modules, 'transformCode');
  59146. this.dataGenFns = pluckModuleFunction(options.modules, 'genData');
  59147. this.directives = extend(extend({}, baseDirectives), options.directives);
  59148. var isReservedTag = options.isReservedTag || no;
  59149. this.maybeComponent = function (el) { return !!el.component || !isReservedTag(el.tag); };
  59150. this.onceId = 0;
  59151. this.staticRenderFns = [];
  59152. this.pre = false;
  59153. };
  59154. function generate (
  59155. ast,
  59156. options
  59157. ) {
  59158. var state = new CodegenState(options);
  59159. var code = ast ? genElement(ast, state) : '_c("div")';
  59160. return {
  59161. render: ("with(this){return " + code + "}"),
  59162. staticRenderFns: state.staticRenderFns
  59163. }
  59164. }
  59165. function genElement (el, state) {
  59166. if (el.parent) {
  59167. el.pre = el.pre || el.parent.pre;
  59168. }
  59169. if (el.staticRoot && !el.staticProcessed) {
  59170. return genStatic(el, state)
  59171. } else if (el.once && !el.onceProcessed) {
  59172. return genOnce(el, state)
  59173. } else if (el.for && !el.forProcessed) {
  59174. return genFor(el, state)
  59175. } else if (el.if && !el.ifProcessed) {
  59176. return genIf(el, state)
  59177. } else if (el.tag === 'template' && !el.slotTarget && !state.pre) {
  59178. return genChildren(el, state) || 'void 0'
  59179. } else if (el.tag === 'slot') {
  59180. return genSlot(el, state)
  59181. } else {
  59182. // component or element
  59183. var code;
  59184. if (el.component) {
  59185. code = genComponent(el.component, el, state);
  59186. } else {
  59187. var data;
  59188. if (!el.plain || (el.pre && state.maybeComponent(el))) {
  59189. data = genData$2(el, state);
  59190. }
  59191. var children = el.inlineTemplate ? null : genChildren(el, state, true);
  59192. code = "_c('" + (el.tag) + "'" + (data ? ("," + data) : '') + (children ? ("," + children) : '') + ")";
  59193. }
  59194. // module transforms
  59195. for (var i = 0; i < state.transforms.length; i++) {
  59196. code = state.transforms[i](el, code);
  59197. }
  59198. return code
  59199. }
  59200. }
  59201. // hoist static sub-trees out
  59202. function genStatic (el, state) {
  59203. el.staticProcessed = true;
  59204. // Some elements (templates) need to behave differently inside of a v-pre
  59205. // node. All pre nodes are static roots, so we can use this as a location to
  59206. // wrap a state change and reset it upon exiting the pre node.
  59207. var originalPreState = state.pre;
  59208. if (el.pre) {
  59209. state.pre = el.pre;
  59210. }
  59211. state.staticRenderFns.push(("with(this){return " + (genElement(el, state)) + "}"));
  59212. state.pre = originalPreState;
  59213. return ("_m(" + (state.staticRenderFns.length - 1) + (el.staticInFor ? ',true' : '') + ")")
  59214. }
  59215. // v-once
  59216. function genOnce (el, state) {
  59217. el.onceProcessed = true;
  59218. if (el.if && !el.ifProcessed) {
  59219. return genIf(el, state)
  59220. } else if (el.staticInFor) {
  59221. var key = '';
  59222. var parent = el.parent;
  59223. while (parent) {
  59224. if (parent.for) {
  59225. key = parent.key;
  59226. break
  59227. }
  59228. parent = parent.parent;
  59229. }
  59230. if (!key) {
  59231. state.warn(
  59232. "v-once can only be used inside v-for that is keyed. ",
  59233. el.rawAttrsMap['v-once']
  59234. );
  59235. return genElement(el, state)
  59236. }
  59237. return ("_o(" + (genElement(el, state)) + "," + (state.onceId++) + "," + key + ")")
  59238. } else {
  59239. return genStatic(el, state)
  59240. }
  59241. }
  59242. function genIf (
  59243. el,
  59244. state,
  59245. altGen,
  59246. altEmpty
  59247. ) {
  59248. el.ifProcessed = true; // avoid recursion
  59249. return genIfConditions(el.ifConditions.slice(), state, altGen, altEmpty)
  59250. }
  59251. function genIfConditions (
  59252. conditions,
  59253. state,
  59254. altGen,
  59255. altEmpty
  59256. ) {
  59257. if (!conditions.length) {
  59258. return altEmpty || '_e()'
  59259. }
  59260. var condition = conditions.shift();
  59261. if (condition.exp) {
  59262. return ("(" + (condition.exp) + ")?" + (genTernaryExp(condition.block)) + ":" + (genIfConditions(conditions, state, altGen, altEmpty)))
  59263. } else {
  59264. return ("" + (genTernaryExp(condition.block)))
  59265. }
  59266. // v-if with v-once should generate code like (a)?_m(0):_m(1)
  59267. function genTernaryExp (el) {
  59268. return altGen
  59269. ? altGen(el, state)
  59270. : el.once
  59271. ? genOnce(el, state)
  59272. : genElement(el, state)
  59273. }
  59274. }
  59275. function genFor (
  59276. el,
  59277. state,
  59278. altGen,
  59279. altHelper
  59280. ) {
  59281. var exp = el.for;
  59282. var alias = el.alias;
  59283. var iterator1 = el.iterator1 ? ("," + (el.iterator1)) : '';
  59284. var iterator2 = el.iterator2 ? ("," + (el.iterator2)) : '';
  59285. if (state.maybeComponent(el) &&
  59286. el.tag !== 'slot' &&
  59287. el.tag !== 'template' &&
  59288. !el.key
  59289. ) {
  59290. state.warn(
  59291. "<" + (el.tag) + " v-for=\"" + alias + " in " + exp + "\">: component lists rendered with " +
  59292. "v-for should have explicit keys. " +
  59293. "See https://vuejs.org/guide/list.html#key for more info.",
  59294. el.rawAttrsMap['v-for'],
  59295. true /* tip */
  59296. );
  59297. }
  59298. el.forProcessed = true; // avoid recursion
  59299. return (altHelper || '_l') + "((" + exp + ")," +
  59300. "function(" + alias + iterator1 + iterator2 + "){" +
  59301. "return " + ((altGen || genElement)(el, state)) +
  59302. '})'
  59303. }
  59304. function genData$2 (el, state) {
  59305. var data = '{';
  59306. // directives first.
  59307. // directives may mutate the el's other properties before they are generated.
  59308. var dirs = genDirectives(el, state);
  59309. if (dirs) { data += dirs + ','; }
  59310. // key
  59311. if (el.key) {
  59312. data += "key:" + (el.key) + ",";
  59313. }
  59314. // ref
  59315. if (el.ref) {
  59316. data += "ref:" + (el.ref) + ",";
  59317. }
  59318. if (el.refInFor) {
  59319. data += "refInFor:true,";
  59320. }
  59321. // pre
  59322. if (el.pre) {
  59323. data += "pre:true,";
  59324. }
  59325. // record original tag name for components using "is" attribute
  59326. if (el.component) {
  59327. data += "tag:\"" + (el.tag) + "\",";
  59328. }
  59329. // module data generation functions
  59330. for (var i = 0; i < state.dataGenFns.length; i++) {
  59331. data += state.dataGenFns[i](el);
  59332. }
  59333. // attributes
  59334. if (el.attrs) {
  59335. data += "attrs:" + (genProps(el.attrs)) + ",";
  59336. }
  59337. // DOM props
  59338. if (el.props) {
  59339. data += "domProps:" + (genProps(el.props)) + ",";
  59340. }
  59341. // event handlers
  59342. if (el.events) {
  59343. data += (genHandlers(el.events, false)) + ",";
  59344. }
  59345. if (el.nativeEvents) {
  59346. data += (genHandlers(el.nativeEvents, true)) + ",";
  59347. }
  59348. // slot target
  59349. // only for non-scoped slots
  59350. if (el.slotTarget && !el.slotScope) {
  59351. data += "slot:" + (el.slotTarget) + ",";
  59352. }
  59353. // scoped slots
  59354. if (el.scopedSlots) {
  59355. data += (genScopedSlots(el, el.scopedSlots, state)) + ",";
  59356. }
  59357. // component v-model
  59358. if (el.model) {
  59359. data += "model:{value:" + (el.model.value) + ",callback:" + (el.model.callback) + ",expression:" + (el.model.expression) + "},";
  59360. }
  59361. // inline-template
  59362. if (el.inlineTemplate) {
  59363. var inlineTemplate = genInlineTemplate(el, state);
  59364. if (inlineTemplate) {
  59365. data += inlineTemplate + ",";
  59366. }
  59367. }
  59368. data = data.replace(/,$/, '') + '}';
  59369. // v-bind dynamic argument wrap
  59370. // v-bind with dynamic arguments must be applied using the same v-bind object
  59371. // merge helper so that class/style/mustUseProp attrs are handled correctly.
  59372. if (el.dynamicAttrs) {
  59373. data = "_b(" + data + ",\"" + (el.tag) + "\"," + (genProps(el.dynamicAttrs)) + ")";
  59374. }
  59375. // v-bind data wrap
  59376. if (el.wrapData) {
  59377. data = el.wrapData(data);
  59378. }
  59379. // v-on data wrap
  59380. if (el.wrapListeners) {
  59381. data = el.wrapListeners(data);
  59382. }
  59383. return data
  59384. }
  59385. function genDirectives (el, state) {
  59386. var dirs = el.directives;
  59387. if (!dirs) { return }
  59388. var res = 'directives:[';
  59389. var hasRuntime = false;
  59390. var i, l, dir, needRuntime;
  59391. for (i = 0, l = dirs.length; i < l; i++) {
  59392. dir = dirs[i];
  59393. needRuntime = true;
  59394. var gen = state.directives[dir.name];
  59395. if (gen) {
  59396. // compile-time directive that manipulates AST.
  59397. // returns true if it also needs a runtime counterpart.
  59398. needRuntime = !!gen(el, dir, state.warn);
  59399. }
  59400. if (needRuntime) {
  59401. hasRuntime = true;
  59402. 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))) : '') + "},";
  59403. }
  59404. }
  59405. if (hasRuntime) {
  59406. return res.slice(0, -1) + ']'
  59407. }
  59408. }
  59409. function genInlineTemplate (el, state) {
  59410. var ast = el.children[0];
  59411. if (el.children.length !== 1 || ast.type !== 1) {
  59412. state.warn(
  59413. 'Inline-template components must have exactly one child element.',
  59414. { start: el.start }
  59415. );
  59416. }
  59417. if (ast && ast.type === 1) {
  59418. var inlineRenderFns = generate(ast, state.options);
  59419. return ("inlineTemplate:{render:function(){" + (inlineRenderFns.render) + "},staticRenderFns:[" + (inlineRenderFns.staticRenderFns.map(function (code) { return ("function(){" + code + "}"); }).join(',')) + "]}")
  59420. }
  59421. }
  59422. function genScopedSlots (
  59423. el,
  59424. slots,
  59425. state
  59426. ) {
  59427. // by default scoped slots are considered "stable", this allows child
  59428. // components with only scoped slots to skip forced updates from parent.
  59429. // but in some cases we have to bail-out of this optimization
  59430. // for example if the slot contains dynamic names, has v-if or v-for on them...
  59431. var needsForceUpdate = el.for || Object.keys(slots).some(function (key) {
  59432. var slot = slots[key];
  59433. return (
  59434. slot.slotTargetDynamic ||
  59435. slot.if ||
  59436. slot.for ||
  59437. containsSlotChild(slot) // is passing down slot from parent which may be dynamic
  59438. )
  59439. });
  59440. // #9534: if a component with scoped slots is inside a conditional branch,
  59441. // it's possible for the same component to be reused but with different
  59442. // compiled slot content. To avoid that, we generate a unique key based on
  59443. // the generated code of all the slot contents.
  59444. var needsKey = !!el.if;
  59445. // OR when it is inside another scoped slot or v-for (the reactivity may be
  59446. // disconnected due to the intermediate scope variable)
  59447. // #9438, #9506
  59448. // TODO: this can be further optimized by properly analyzing in-scope bindings
  59449. // and skip force updating ones that do not actually use scope variables.
  59450. if (!needsForceUpdate) {
  59451. var parent = el.parent;
  59452. while (parent) {
  59453. if (
  59454. (parent.slotScope && parent.slotScope !== emptySlotScopeToken) ||
  59455. parent.for
  59456. ) {
  59457. needsForceUpdate = true;
  59458. break
  59459. }
  59460. if (parent.if) {
  59461. needsKey = true;
  59462. }
  59463. parent = parent.parent;
  59464. }
  59465. }
  59466. var generatedSlots = Object.keys(slots)
  59467. .map(function (key) { return genScopedSlot(slots[key], state); })
  59468. .join(',');
  59469. return ("scopedSlots:_u([" + generatedSlots + "]" + (needsForceUpdate ? ",null,true" : "") + (!needsForceUpdate && needsKey ? (",null,false," + (hash(generatedSlots))) : "") + ")")
  59470. }
  59471. function hash(str) {
  59472. var hash = 5381;
  59473. var i = str.length;
  59474. while(i) {
  59475. hash = (hash * 33) ^ str.charCodeAt(--i);
  59476. }
  59477. return hash >>> 0
  59478. }
  59479. function containsSlotChild (el) {
  59480. if (el.type === 1) {
  59481. if (el.tag === 'slot') {
  59482. return true
  59483. }
  59484. return el.children.some(containsSlotChild)
  59485. }
  59486. return false
  59487. }
  59488. function genScopedSlot (
  59489. el,
  59490. state
  59491. ) {
  59492. var isLegacySyntax = el.attrsMap['slot-scope'];
  59493. if (el.if && !el.ifProcessed && !isLegacySyntax) {
  59494. return genIf(el, state, genScopedSlot, "null")
  59495. }
  59496. if (el.for && !el.forProcessed) {
  59497. return genFor(el, state, genScopedSlot)
  59498. }
  59499. var slotScope = el.slotScope === emptySlotScopeToken
  59500. ? ""
  59501. : String(el.slotScope);
  59502. var fn = "function(" + slotScope + "){" +
  59503. "return " + (el.tag === 'template'
  59504. ? el.if && isLegacySyntax
  59505. ? ("(" + (el.if) + ")?" + (genChildren(el, state) || 'undefined') + ":undefined")
  59506. : genChildren(el, state) || 'undefined'
  59507. : genElement(el, state)) + "}";
  59508. // reverse proxy v-slot without scope on this.$slots
  59509. var reverseProxy = slotScope ? "" : ",proxy:true";
  59510. return ("{key:" + (el.slotTarget || "\"default\"") + ",fn:" + fn + reverseProxy + "}")
  59511. }
  59512. function genChildren (
  59513. el,
  59514. state,
  59515. checkSkip,
  59516. altGenElement,
  59517. altGenNode
  59518. ) {
  59519. var children = el.children;
  59520. if (children.length) {
  59521. var el$1 = children[0];
  59522. // optimize single v-for
  59523. if (children.length === 1 &&
  59524. el$1.for &&
  59525. el$1.tag !== 'template' &&
  59526. el$1.tag !== 'slot'
  59527. ) {
  59528. var normalizationType = checkSkip
  59529. ? state.maybeComponent(el$1) ? ",1" : ",0"
  59530. : "";
  59531. return ("" + ((altGenElement || genElement)(el$1, state)) + normalizationType)
  59532. }
  59533. var normalizationType$1 = checkSkip
  59534. ? getNormalizationType(children, state.maybeComponent)
  59535. : 0;
  59536. var gen = altGenNode || genNode;
  59537. return ("[" + (children.map(function (c) { return gen(c, state); }).join(',')) + "]" + (normalizationType$1 ? ("," + normalizationType$1) : ''))
  59538. }
  59539. }
  59540. // determine the normalization needed for the children array.
  59541. // 0: no normalization needed
  59542. // 1: simple normalization needed (possible 1-level deep nested array)
  59543. // 2: full normalization needed
  59544. function getNormalizationType (
  59545. children,
  59546. maybeComponent
  59547. ) {
  59548. var res = 0;
  59549. for (var i = 0; i < children.length; i++) {
  59550. var el = children[i];
  59551. if (el.type !== 1) {
  59552. continue
  59553. }
  59554. if (needsNormalization(el) ||
  59555. (el.ifConditions && el.ifConditions.some(function (c) { return needsNormalization(c.block); }))) {
  59556. res = 2;
  59557. break
  59558. }
  59559. if (maybeComponent(el) ||
  59560. (el.ifConditions && el.ifConditions.some(function (c) { return maybeComponent(c.block); }))) {
  59561. res = 1;
  59562. }
  59563. }
  59564. return res
  59565. }
  59566. function needsNormalization (el) {
  59567. return el.for !== undefined || el.tag === 'template' || el.tag === 'slot'
  59568. }
  59569. function genNode (node, state) {
  59570. if (node.type === 1) {
  59571. return genElement(node, state)
  59572. } else if (node.type === 3 && node.isComment) {
  59573. return genComment(node)
  59574. } else {
  59575. return genText(node)
  59576. }
  59577. }
  59578. function genText (text) {
  59579. return ("_v(" + (text.type === 2
  59580. ? text.expression // no need for () because already wrapped in _s()
  59581. : transformSpecialNewlines(JSON.stringify(text.text))) + ")")
  59582. }
  59583. function genComment (comment) {
  59584. return ("_e(" + (JSON.stringify(comment.text)) + ")")
  59585. }
  59586. function genSlot (el, state) {
  59587. var slotName = el.slotName || '"default"';
  59588. var children = genChildren(el, state);
  59589. var res = "_t(" + slotName + (children ? ("," + children) : '');
  59590. var attrs = el.attrs || el.dynamicAttrs
  59591. ? genProps((el.attrs || []).concat(el.dynamicAttrs || []).map(function (attr) { return ({
  59592. // slot props are camelized
  59593. name: camelize(attr.name),
  59594. value: attr.value,
  59595. dynamic: attr.dynamic
  59596. }); }))
  59597. : null;
  59598. var bind$$1 = el.attrsMap['v-bind'];
  59599. if ((attrs || bind$$1) && !children) {
  59600. res += ",null";
  59601. }
  59602. if (attrs) {
  59603. res += "," + attrs;
  59604. }
  59605. if (bind$$1) {
  59606. res += (attrs ? '' : ',null') + "," + bind$$1;
  59607. }
  59608. return res + ')'
  59609. }
  59610. // componentName is el.component, take it as argument to shun flow's pessimistic refinement
  59611. function genComponent (
  59612. componentName,
  59613. el,
  59614. state
  59615. ) {
  59616. var children = el.inlineTemplate ? null : genChildren(el, state, true);
  59617. return ("_c(" + componentName + "," + (genData$2(el, state)) + (children ? ("," + children) : '') + ")")
  59618. }
  59619. function genProps (props) {
  59620. var staticProps = "";
  59621. var dynamicProps = "";
  59622. for (var i = 0; i < props.length; i++) {
  59623. var prop = props[i];
  59624. var value = transformSpecialNewlines(prop.value);
  59625. if (prop.dynamic) {
  59626. dynamicProps += (prop.name) + "," + value + ",";
  59627. } else {
  59628. staticProps += "\"" + (prop.name) + "\":" + value + ",";
  59629. }
  59630. }
  59631. staticProps = "{" + (staticProps.slice(0, -1)) + "}";
  59632. if (dynamicProps) {
  59633. return ("_d(" + staticProps + ",[" + (dynamicProps.slice(0, -1)) + "])")
  59634. } else {
  59635. return staticProps
  59636. }
  59637. }
  59638. // #3895, #4268
  59639. function transformSpecialNewlines (text) {
  59640. return text
  59641. .replace(/\u2028/g, '\\u2028')
  59642. .replace(/\u2029/g, '\\u2029')
  59643. }
  59644. /* */
  59645. // these keywords should not appear inside expressions, but operators like
  59646. // typeof, instanceof and in are allowed
  59647. var prohibitedKeywordRE = new RegExp('\\b' + (
  59648. 'do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' +
  59649. 'super,throw,while,yield,delete,export,import,return,switch,default,' +
  59650. 'extends,finally,continue,debugger,function,arguments'
  59651. ).split(',').join('\\b|\\b') + '\\b');
  59652. // these unary operators should not be used as property/method names
  59653. var unaryOperatorsRE = new RegExp('\\b' + (
  59654. 'delete,typeof,void'
  59655. ).split(',').join('\\s*\\([^\\)]*\\)|\\b') + '\\s*\\([^\\)]*\\)');
  59656. // strip strings in expressions
  59657. var stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;
  59658. // detect problematic expressions in a template
  59659. function detectErrors (ast, warn) {
  59660. if (ast) {
  59661. checkNode(ast, warn);
  59662. }
  59663. }
  59664. function checkNode (node, warn) {
  59665. if (node.type === 1) {
  59666. for (var name in node.attrsMap) {
  59667. if (dirRE.test(name)) {
  59668. var value = node.attrsMap[name];
  59669. if (value) {
  59670. var range = node.rawAttrsMap[name];
  59671. if (name === 'v-for') {
  59672. checkFor(node, ("v-for=\"" + value + "\""), warn, range);
  59673. } else if (name === 'v-slot' || name[0] === '#') {
  59674. checkFunctionParameterExpression(value, (name + "=\"" + value + "\""), warn, range);
  59675. } else if (onRE.test(name)) {
  59676. checkEvent(value, (name + "=\"" + value + "\""), warn, range);
  59677. } else {
  59678. checkExpression(value, (name + "=\"" + value + "\""), warn, range);
  59679. }
  59680. }
  59681. }
  59682. }
  59683. if (node.children) {
  59684. for (var i = 0; i < node.children.length; i++) {
  59685. checkNode(node.children[i], warn);
  59686. }
  59687. }
  59688. } else if (node.type === 2) {
  59689. checkExpression(node.expression, node.text, warn, node);
  59690. }
  59691. }
  59692. function checkEvent (exp, text, warn, range) {
  59693. var stripped = exp.replace(stripStringRE, '');
  59694. var keywordMatch = stripped.match(unaryOperatorsRE);
  59695. if (keywordMatch && stripped.charAt(keywordMatch.index - 1) !== '$') {
  59696. warn(
  59697. "avoid using JavaScript unary operator as property name: " +
  59698. "\"" + (keywordMatch[0]) + "\" in expression " + (text.trim()),
  59699. range
  59700. );
  59701. }
  59702. checkExpression(exp, text, warn, range);
  59703. }
  59704. function checkFor (node, text, warn, range) {
  59705. checkExpression(node.for || '', text, warn, range);
  59706. checkIdentifier(node.alias, 'v-for alias', text, warn, range);
  59707. checkIdentifier(node.iterator1, 'v-for iterator', text, warn, range);
  59708. checkIdentifier(node.iterator2, 'v-for iterator', text, warn, range);
  59709. }
  59710. function checkIdentifier (
  59711. ident,
  59712. type,
  59713. text,
  59714. warn,
  59715. range
  59716. ) {
  59717. if (typeof ident === 'string') {
  59718. try {
  59719. new Function(("var " + ident + "=_"));
  59720. } catch (e) {
  59721. warn(("invalid " + type + " \"" + ident + "\" in expression: " + (text.trim())), range);
  59722. }
  59723. }
  59724. }
  59725. function checkExpression (exp, text, warn, range) {
  59726. try {
  59727. new Function(("return " + exp));
  59728. } catch (e) {
  59729. var keywordMatch = exp.replace(stripStringRE, '').match(prohibitedKeywordRE);
  59730. if (keywordMatch) {
  59731. warn(
  59732. "avoid using JavaScript keyword as property name: " +
  59733. "\"" + (keywordMatch[0]) + "\"\n Raw expression: " + (text.trim()),
  59734. range
  59735. );
  59736. } else {
  59737. warn(
  59738. "invalid expression: " + (e.message) + " in\n\n" +
  59739. " " + exp + "\n\n" +
  59740. " Raw expression: " + (text.trim()) + "\n",
  59741. range
  59742. );
  59743. }
  59744. }
  59745. }
  59746. function checkFunctionParameterExpression (exp, text, warn, range) {
  59747. try {
  59748. new Function(exp, '');
  59749. } catch (e) {
  59750. warn(
  59751. "invalid function parameter expression: " + (e.message) + " in\n\n" +
  59752. " " + exp + "\n\n" +
  59753. " Raw expression: " + (text.trim()) + "\n",
  59754. range
  59755. );
  59756. }
  59757. }
  59758. /* */
  59759. var range = 2;
  59760. function generateCodeFrame (
  59761. source,
  59762. start,
  59763. end
  59764. ) {
  59765. if ( start === void 0 ) start = 0;
  59766. if ( end === void 0 ) end = source.length;
  59767. var lines = source.split(/\r?\n/);
  59768. var count = 0;
  59769. var res = [];
  59770. for (var i = 0; i < lines.length; i++) {
  59771. count += lines[i].length + 1;
  59772. if (count >= start) {
  59773. for (var j = i - range; j <= i + range || end > count; j++) {
  59774. if (j < 0 || j >= lines.length) { continue }
  59775. res.push(("" + (j + 1) + (repeat$1(" ", 3 - String(j + 1).length)) + "| " + (lines[j])));
  59776. var lineLength = lines[j].length;
  59777. if (j === i) {
  59778. // push underline
  59779. var pad = start - (count - lineLength) + 1;
  59780. var length = end > count ? lineLength - pad : end - start;
  59781. res.push(" | " + repeat$1(" ", pad) + repeat$1("^", length));
  59782. } else if (j > i) {
  59783. if (end > count) {
  59784. var length$1 = Math.min(end - count, lineLength);
  59785. res.push(" | " + repeat$1("^", length$1));
  59786. }
  59787. count += lineLength + 1;
  59788. }
  59789. }
  59790. break
  59791. }
  59792. }
  59793. return res.join('\n')
  59794. }
  59795. function repeat$1 (str, n) {
  59796. var result = '';
  59797. if (n > 0) {
  59798. while (true) { // eslint-disable-line
  59799. if (n & 1) { result += str; }
  59800. n >>>= 1;
  59801. if (n <= 0) { break }
  59802. str += str;
  59803. }
  59804. }
  59805. return result
  59806. }
  59807. /* */
  59808. function createFunction (code, errors) {
  59809. try {
  59810. return new Function(code)
  59811. } catch (err) {
  59812. errors.push({ err: err, code: code });
  59813. return noop
  59814. }
  59815. }
  59816. function createCompileToFunctionFn (compile) {
  59817. var cache = Object.create(null);
  59818. return function compileToFunctions (
  59819. template,
  59820. options,
  59821. vm
  59822. ) {
  59823. options = extend({}, options);
  59824. var warn$$1 = options.warn || warn;
  59825. delete options.warn;
  59826. /* istanbul ignore if */
  59827. {
  59828. // detect possible CSP restriction
  59829. try {
  59830. new Function('return 1');
  59831. } catch (e) {
  59832. if (e.toString().match(/unsafe-eval|CSP/)) {
  59833. warn$$1(
  59834. 'It seems you are using the standalone build of Vue.js in an ' +
  59835. 'environment with Content Security Policy that prohibits unsafe-eval. ' +
  59836. 'The template compiler cannot work in this environment. Consider ' +
  59837. 'relaxing the policy to allow unsafe-eval or pre-compiling your ' +
  59838. 'templates into render functions.'
  59839. );
  59840. }
  59841. }
  59842. }
  59843. // check cache
  59844. var key = options.delimiters
  59845. ? String(options.delimiters) + template
  59846. : template;
  59847. if (cache[key]) {
  59848. return cache[key]
  59849. }
  59850. // compile
  59851. var compiled = compile(template, options);
  59852. // check compilation errors/tips
  59853. {
  59854. if (compiled.errors && compiled.errors.length) {
  59855. if (options.outputSourceRange) {
  59856. compiled.errors.forEach(function (e) {
  59857. warn$$1(
  59858. "Error compiling template:\n\n" + (e.msg) + "\n\n" +
  59859. generateCodeFrame(template, e.start, e.end),
  59860. vm
  59861. );
  59862. });
  59863. } else {
  59864. warn$$1(
  59865. "Error compiling template:\n\n" + template + "\n\n" +
  59866. compiled.errors.map(function (e) { return ("- " + e); }).join('\n') + '\n',
  59867. vm
  59868. );
  59869. }
  59870. }
  59871. if (compiled.tips && compiled.tips.length) {
  59872. if (options.outputSourceRange) {
  59873. compiled.tips.forEach(function (e) { return tip(e.msg, vm); });
  59874. } else {
  59875. compiled.tips.forEach(function (msg) { return tip(msg, vm); });
  59876. }
  59877. }
  59878. }
  59879. // turn code into functions
  59880. var res = {};
  59881. var fnGenErrors = [];
  59882. res.render = createFunction(compiled.render, fnGenErrors);
  59883. res.staticRenderFns = compiled.staticRenderFns.map(function (code) {
  59884. return createFunction(code, fnGenErrors)
  59885. });
  59886. // check function generation errors.
  59887. // this should only happen if there is a bug in the compiler itself.
  59888. // mostly for codegen development use
  59889. /* istanbul ignore if */
  59890. {
  59891. if ((!compiled.errors || !compiled.errors.length) && fnGenErrors.length) {
  59892. warn$$1(
  59893. "Failed to generate render function:\n\n" +
  59894. fnGenErrors.map(function (ref) {
  59895. var err = ref.err;
  59896. var code = ref.code;
  59897. return ((err.toString()) + " in\n\n" + code + "\n");
  59898. }).join('\n'),
  59899. vm
  59900. );
  59901. }
  59902. }
  59903. return (cache[key] = res)
  59904. }
  59905. }
  59906. /* */
  59907. function createCompilerCreator (baseCompile) {
  59908. return function createCompiler (baseOptions) {
  59909. function compile (
  59910. template,
  59911. options
  59912. ) {
  59913. var finalOptions = Object.create(baseOptions);
  59914. var errors = [];
  59915. var tips = [];
  59916. var warn = function (msg, range, tip) {
  59917. (tip ? tips : errors).push(msg);
  59918. };
  59919. if (options) {
  59920. if (options.outputSourceRange) {
  59921. // $flow-disable-line
  59922. var leadingSpaceLength = template.match(/^\s*/)[0].length;
  59923. warn = function (msg, range, tip) {
  59924. var data = { msg: msg };
  59925. if (range) {
  59926. if (range.start != null) {
  59927. data.start = range.start + leadingSpaceLength;
  59928. }
  59929. if (range.end != null) {
  59930. data.end = range.end + leadingSpaceLength;
  59931. }
  59932. }
  59933. (tip ? tips : errors).push(data);
  59934. };
  59935. }
  59936. // merge custom modules
  59937. if (options.modules) {
  59938. finalOptions.modules =
  59939. (baseOptions.modules || []).concat(options.modules);
  59940. }
  59941. // merge custom directives
  59942. if (options.directives) {
  59943. finalOptions.directives = extend(
  59944. Object.create(baseOptions.directives || null),
  59945. options.directives
  59946. );
  59947. }
  59948. // copy other options
  59949. for (var key in options) {
  59950. if (key !== 'modules' && key !== 'directives') {
  59951. finalOptions[key] = options[key];
  59952. }
  59953. }
  59954. }
  59955. finalOptions.warn = warn;
  59956. var compiled = baseCompile(template.trim(), finalOptions);
  59957. {
  59958. detectErrors(compiled.ast, warn);
  59959. }
  59960. compiled.errors = errors;
  59961. compiled.tips = tips;
  59962. return compiled
  59963. }
  59964. return {
  59965. compile: compile,
  59966. compileToFunctions: createCompileToFunctionFn(compile)
  59967. }
  59968. }
  59969. }
  59970. /* */
  59971. // `createCompilerCreator` allows creating compilers that use alternative
  59972. // parser/optimizer/codegen, e.g the SSR optimizing compiler.
  59973. // Here we just export a default compiler using the default parts.
  59974. var createCompiler = createCompilerCreator(function baseCompile (
  59975. template,
  59976. options
  59977. ) {
  59978. var ast = parse(template.trim(), options);
  59979. if (options.optimize !== false) {
  59980. optimize(ast, options);
  59981. }
  59982. var code = generate(ast, options);
  59983. return {
  59984. ast: ast,
  59985. render: code.render,
  59986. staticRenderFns: code.staticRenderFns
  59987. }
  59988. });
  59989. /* */
  59990. var ref$1 = createCompiler(baseOptions);
  59991. var compile = ref$1.compile;
  59992. var compileToFunctions = ref$1.compileToFunctions;
  59993. /* */
  59994. // check whether current browser encodes a char inside attribute values
  59995. var div;
  59996. function getShouldDecode (href) {
  59997. div = div || document.createElement('div');
  59998. div.innerHTML = href ? "<a href=\"\n\"/>" : "<div a=\"\n\"/>";
  59999. return div.innerHTML.indexOf('&#10;') > 0
  60000. }
  60001. // #3663: IE encodes newlines inside attribute values while other browsers don't
  60002. var shouldDecodeNewlines = inBrowser ? getShouldDecode(false) : false;
  60003. // #6828: chrome encodes content in a[href]
  60004. var shouldDecodeNewlinesForHref = inBrowser ? getShouldDecode(true) : false;
  60005. /* */
  60006. var idToTemplate = cached(function (id) {
  60007. var el = query(id);
  60008. return el && el.innerHTML
  60009. });
  60010. var mount = Vue.prototype.$mount;
  60011. Vue.prototype.$mount = function (
  60012. el,
  60013. hydrating
  60014. ) {
  60015. el = el && query(el);
  60016. /* istanbul ignore if */
  60017. if (el === document.body || el === document.documentElement) {
  60018. warn(
  60019. "Do not mount Vue to <html> or <body> - mount to normal elements instead."
  60020. );
  60021. return this
  60022. }
  60023. var options = this.$options;
  60024. // resolve template/el and convert to render function
  60025. if (!options.render) {
  60026. var template = options.template;
  60027. if (template) {
  60028. if (typeof template === 'string') {
  60029. if (template.charAt(0) === '#') {
  60030. template = idToTemplate(template);
  60031. /* istanbul ignore if */
  60032. if (!template) {
  60033. warn(
  60034. ("Template element not found or is empty: " + (options.template)),
  60035. this
  60036. );
  60037. }
  60038. }
  60039. } else if (template.nodeType) {
  60040. template = template.innerHTML;
  60041. } else {
  60042. {
  60043. warn('invalid template option:' + template, this);
  60044. }
  60045. return this
  60046. }
  60047. } else if (el) {
  60048. template = getOuterHTML(el);
  60049. }
  60050. if (template) {
  60051. /* istanbul ignore if */
  60052. if (config.performance && mark) {
  60053. mark('compile');
  60054. }
  60055. var ref = compileToFunctions(template, {
  60056. outputSourceRange: "development" !== 'production',
  60057. shouldDecodeNewlines: shouldDecodeNewlines,
  60058. shouldDecodeNewlinesForHref: shouldDecodeNewlinesForHref,
  60059. delimiters: options.delimiters,
  60060. comments: options.comments
  60061. }, this);
  60062. var render = ref.render;
  60063. var staticRenderFns = ref.staticRenderFns;
  60064. options.render = render;
  60065. options.staticRenderFns = staticRenderFns;
  60066. /* istanbul ignore if */
  60067. if (config.performance && mark) {
  60068. mark('compile end');
  60069. measure(("vue " + (this._name) + " compile"), 'compile', 'compile end');
  60070. }
  60071. }
  60072. }
  60073. return mount.call(this, el, hydrating)
  60074. };
  60075. /**
  60076. * Get outerHTML of elements, taking care
  60077. * of SVG elements in IE as well.
  60078. */
  60079. function getOuterHTML (el) {
  60080. if (el.outerHTML) {
  60081. return el.outerHTML
  60082. } else {
  60083. var container = document.createElement('div');
  60084. container.appendChild(el.cloneNode(true));
  60085. return container.innerHTML
  60086. }
  60087. }
  60088. Vue.compile = compileToFunctions;
  60089. module.exports = Vue;
  60090. /* 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))
  60091. /***/ }),
  60092. /***/ "./node_modules/vue/dist/vue.common.js":
  60093. /*!*********************************************!*\
  60094. !*** ./node_modules/vue/dist/vue.common.js ***!
  60095. \*********************************************/
  60096. /*! no static exports found */
  60097. /***/ (function(module, exports, __webpack_require__) {
  60098. if (false) {} else {
  60099. module.exports = __webpack_require__(/*! ./vue.common.dev.js */ "./node_modules/vue/dist/vue.common.dev.js")
  60100. }
  60101. /***/ }),
  60102. /***/ "./node_modules/webpack/buildin/global.js":
  60103. /*!***********************************!*\
  60104. !*** (webpack)/buildin/global.js ***!
  60105. \***********************************/
  60106. /*! no static exports found */
  60107. /***/ (function(module, exports) {
  60108. var g;
  60109. // This works in non-strict mode
  60110. g = (function() {
  60111. return this;
  60112. })();
  60113. try {
  60114. // This works if eval is allowed (see CSP)
  60115. g = g || new Function("return this")();
  60116. } catch (e) {
  60117. // This works if the window reference is available
  60118. if (typeof window === "object") g = window;
  60119. }
  60120. // g can still be undefined, but nothing to do about it...
  60121. // We return undefined, instead of nothing here, so it's
  60122. // easier to handle this case. if(!global) { ...}
  60123. module.exports = g;
  60124. /***/ }),
  60125. /***/ "./node_modules/webpack/buildin/module.js":
  60126. /*!***********************************!*\
  60127. !*** (webpack)/buildin/module.js ***!
  60128. \***********************************/
  60129. /*! no static exports found */
  60130. /***/ (function(module, exports) {
  60131. module.exports = function(module) {
  60132. if (!module.webpackPolyfill) {
  60133. module.deprecate = function() {};
  60134. module.paths = [];
  60135. // module.parent = undefined by default
  60136. if (!module.children) module.children = [];
  60137. Object.defineProperty(module, "loaded", {
  60138. enumerable: true,
  60139. get: function() {
  60140. return module.l;
  60141. }
  60142. });
  60143. Object.defineProperty(module, "id", {
  60144. enumerable: true,
  60145. get: function() {
  60146. return module.i;
  60147. }
  60148. });
  60149. module.webpackPolyfill = 1;
  60150. }
  60151. return module;
  60152. };
  60153. /***/ }),
  60154. /***/ "./resources/js/app.js":
  60155. /*!*****************************!*\
  60156. !*** ./resources/js/app.js ***!
  60157. \*****************************/
  60158. /*! no exports provided */
  60159. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60160. "use strict";
  60161. __webpack_require__.r(__webpack_exports__);
  60162. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.common.js");
  60163. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
  60164. /* harmony import */ var vue_router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vue-router */ "./node_modules/vue-router/dist/vue-router.esm.js");
  60165. /* harmony import */ var _views_App__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./views/App */ "./resources/js/views/App.vue");
  60166. /* harmony import */ var _views_Dashboard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./views/Dashboard */ "./resources/js/views/Dashboard.vue");
  60167. /* harmony import */ var _views_WorkOrder__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./views/WorkOrder */ "./resources/js/views/WorkOrder.vue");
  60168. /* harmony import */ var _views_Login__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./views/Login */ "./resources/js/views/Login.vue");
  60169. /* harmony import */ var _views_Welcome__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./views/Welcome */ "./resources/js/views/Welcome.vue");
  60170. /**
  60171. * First we will load all of this project's JavaScript dependencies which
  60172. * includes Vue and other libraries. It is a great starting point when
  60173. * building robust, powerful web applications using Vue and Laravel.
  60174. */
  60175. __webpack_require__(/*! ./bootstrap */ "./resources/js/bootstrap.js");
  60176. window.Clipboard = __webpack_require__(/*! clipboard */ "./node_modules/clipboard/dist/clipboard.js");
  60177. __webpack_require__(/*! ./notify.min.js */ "./resources/js/notify.min.js");
  60178. vue__WEBPACK_IMPORTED_MODULE_0___default.a.use(vue_router__WEBPACK_IMPORTED_MODULE_1__["default"]);
  60179. var router = new vue_router__WEBPACK_IMPORTED_MODULE_1__["default"]({
  60180. mode: 'history',
  60181. routes: [{
  60182. path: '/',
  60183. name: 'home',
  60184. component: _views_Welcome__WEBPACK_IMPORTED_MODULE_6__["default"]
  60185. }, {
  60186. path: '/login',
  60187. name: 'login',
  60188. component: _views_Login__WEBPACK_IMPORTED_MODULE_5__["default"]
  60189. }, {
  60190. path: '/dashboard',
  60191. name: 'dashboard',
  60192. component: _views_Dashboard__WEBPACK_IMPORTED_MODULE_3__["default"]
  60193. }, {
  60194. path: '/workorders/:id',
  60195. name: 'workorders',
  60196. component: _views_WorkOrder__WEBPACK_IMPORTED_MODULE_4__["default"],
  60197. props: true
  60198. }]
  60199. });
  60200. var app = new vue__WEBPACK_IMPORTED_MODULE_0___default.a({
  60201. el: '#app',
  60202. components: {
  60203. App: _views_App__WEBPACK_IMPORTED_MODULE_2__["default"]
  60204. },
  60205. router: router
  60206. });
  60207. $(function () {
  60208. $('[data-toggle="tooltip"]').tooltip();
  60209. });
  60210. var clipboard = new Clipboard('.btn-clip');
  60211. clipboard.on('success', function (e) {
  60212. $('#' + e.trigger.getAttribute('id')).notify('Copied to Clipboard', {
  60213. position: "right",
  60214. className: 'success'
  60215. });
  60216. e.clearSelection();
  60217. });
  60218. /***/ }),
  60219. /***/ "./resources/js/bootstrap.js":
  60220. /*!***********************************!*\
  60221. !*** ./resources/js/bootstrap.js ***!
  60222. \***********************************/
  60223. /*! no exports provided */
  60224. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60225. "use strict";
  60226. __webpack_require__.r(__webpack_exports__);
  60227. /* harmony import */ var laravel_echo__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! laravel-echo */ "./node_modules/laravel-echo/dist/echo.js");
  60228. window._ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
  60229. /**
  60230. * We'll load jQuery and the Bootstrap jQuery plugin which provides support
  60231. * for JavaScript based Bootstrap features such as modals and tabs. This
  60232. * code may be modified to fit the specific needs of your application.
  60233. */
  60234. try {
  60235. window.Popper = __webpack_require__(/*! popper.js */ "./node_modules/popper.js/dist/esm/popper.js")["default"];
  60236. window.$ = window.jQuery = __webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js");
  60237. __webpack_require__(/*! bootstrap */ "./node_modules/bootstrap/dist/js/bootstrap.js");
  60238. } catch (e) {}
  60239. /**
  60240. * We'll load the axios HTTP library which allows us to easily issue requests
  60241. * to our Laravel back-end. This library automatically handles sending the
  60242. * CSRF token as a header based on the value of the "XSRF" token cookie.
  60243. */
  60244. window.axios = __webpack_require__(/*! axios */ "./node_modules/axios/index.js");
  60245. window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
  60246. /**
  60247. * Echo exposes an expressive API for subscribing to channels and listening
  60248. * for events that are broadcast by Laravel. Echo and event broadcasting
  60249. * allows your team to easily build robust real-time web applications.
  60250. */
  60251. window.Pusher = __webpack_require__(/*! pusher-js */ "./node_modules/pusher-js/dist/web/pusher.js");
  60252. window.Echo = new laravel_echo__WEBPACK_IMPORTED_MODULE_0__["default"]({
  60253. broadcaster: 'pusher',
  60254. key: "upccrt",
  60255. authEndpoint: '/broadcasting/auth',
  60256. wsHost: window.location.hostname,
  60257. wsPort: 6001,
  60258. disableStats: true
  60259. });
  60260. /***/ }),
  60261. /***/ "./resources/js/components/AssetInfo.vue":
  60262. /*!***********************************************!*\
  60263. !*** ./resources/js/components/AssetInfo.vue ***!
  60264. \***********************************************/
  60265. /*! exports provided: default */
  60266. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60267. "use strict";
  60268. __webpack_require__.r(__webpack_exports__);
  60269. /* 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&");
  60270. /* 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&");
  60271. /* 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");
  60272. /* normalize component */
  60273. var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(
  60274. _AssetInfo_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
  60275. _AssetInfo_vue_vue_type_template_id_f949323a___WEBPACK_IMPORTED_MODULE_0__["render"],
  60276. _AssetInfo_vue_vue_type_template_id_f949323a___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
  60277. false,
  60278. null,
  60279. null,
  60280. null
  60281. )
  60282. /* hot reload */
  60283. if (false) { var api; }
  60284. component.options.__file = "resources/js/components/AssetInfo.vue"
  60285. /* harmony default export */ __webpack_exports__["default"] = (component.exports);
  60286. /***/ }),
  60287. /***/ "./resources/js/components/AssetInfo.vue?vue&type=script&lang=js&":
  60288. /*!************************************************************************!*\
  60289. !*** ./resources/js/components/AssetInfo.vue?vue&type=script&lang=js& ***!
  60290. \************************************************************************/
  60291. /*! exports provided: default */
  60292. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60293. "use strict";
  60294. __webpack_require__.r(__webpack_exports__);
  60295. /* 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&");
  60296. /* 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"]);
  60297. /***/ }),
  60298. /***/ "./resources/js/components/AssetInfo.vue?vue&type=template&id=f949323a&":
  60299. /*!******************************************************************************!*\
  60300. !*** ./resources/js/components/AssetInfo.vue?vue&type=template&id=f949323a& ***!
  60301. \******************************************************************************/
  60302. /*! exports provided: render, staticRenderFns */
  60303. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60304. "use strict";
  60305. __webpack_require__.r(__webpack_exports__);
  60306. /* 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&");
  60307. /* 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"]; });
  60308. /* 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"]; });
  60309. /***/ }),
  60310. /***/ "./resources/js/components/AssetInfoEditModal.vue":
  60311. /*!********************************************************!*\
  60312. !*** ./resources/js/components/AssetInfoEditModal.vue ***!
  60313. \********************************************************/
  60314. /*! exports provided: default */
  60315. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60316. "use strict";
  60317. __webpack_require__.r(__webpack_exports__);
  60318. /* 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&");
  60319. /* 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&");
  60320. /* 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");
  60321. /* normalize component */
  60322. var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(
  60323. _AssetInfoEditModal_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
  60324. _AssetInfoEditModal_vue_vue_type_template_id_24c98bd0___WEBPACK_IMPORTED_MODULE_0__["render"],
  60325. _AssetInfoEditModal_vue_vue_type_template_id_24c98bd0___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
  60326. false,
  60327. null,
  60328. null,
  60329. null
  60330. )
  60331. /* hot reload */
  60332. if (false) { var api; }
  60333. component.options.__file = "resources/js/components/AssetInfoEditModal.vue"
  60334. /* harmony default export */ __webpack_exports__["default"] = (component.exports);
  60335. /***/ }),
  60336. /***/ "./resources/js/components/AssetInfoEditModal.vue?vue&type=script&lang=js&":
  60337. /*!*********************************************************************************!*\
  60338. !*** ./resources/js/components/AssetInfoEditModal.vue?vue&type=script&lang=js& ***!
  60339. \*********************************************************************************/
  60340. /*! exports provided: default */
  60341. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60342. "use strict";
  60343. __webpack_require__.r(__webpack_exports__);
  60344. /* 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&");
  60345. /* 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"]);
  60346. /***/ }),
  60347. /***/ "./resources/js/components/AssetInfoEditModal.vue?vue&type=template&id=24c98bd0&":
  60348. /*!***************************************************************************************!*\
  60349. !*** ./resources/js/components/AssetInfoEditModal.vue?vue&type=template&id=24c98bd0& ***!
  60350. \***************************************************************************************/
  60351. /*! exports provided: render, staticRenderFns */
  60352. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60353. "use strict";
  60354. __webpack_require__.r(__webpack_exports__);
  60355. /* 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&");
  60356. /* 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"]; });
  60357. /* 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"]; });
  60358. /***/ }),
  60359. /***/ "./resources/js/components/AutocompleteCustomDropdown.vue":
  60360. /*!****************************************************************!*\
  60361. !*** ./resources/js/components/AutocompleteCustomDropdown.vue ***!
  60362. \****************************************************************/
  60363. /*! exports provided: default */
  60364. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60365. "use strict";
  60366. __webpack_require__.r(__webpack_exports__);
  60367. /* 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&");
  60368. /* 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&");
  60369. /* 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");
  60370. /* normalize component */
  60371. var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(
  60372. _AutocompleteCustomDropdown_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
  60373. _AutocompleteCustomDropdown_vue_vue_type_template_id_5fcc8b56___WEBPACK_IMPORTED_MODULE_0__["render"],
  60374. _AutocompleteCustomDropdown_vue_vue_type_template_id_5fcc8b56___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
  60375. false,
  60376. null,
  60377. null,
  60378. null
  60379. )
  60380. /* hot reload */
  60381. if (false) { var api; }
  60382. component.options.__file = "resources/js/components/AutocompleteCustomDropdown.vue"
  60383. /* harmony default export */ __webpack_exports__["default"] = (component.exports);
  60384. /***/ }),
  60385. /***/ "./resources/js/components/AutocompleteCustomDropdown.vue?vue&type=script&lang=js&":
  60386. /*!*****************************************************************************************!*\
  60387. !*** ./resources/js/components/AutocompleteCustomDropdown.vue?vue&type=script&lang=js& ***!
  60388. \*****************************************************************************************/
  60389. /*! exports provided: default */
  60390. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60391. "use strict";
  60392. __webpack_require__.r(__webpack_exports__);
  60393. /* 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&");
  60394. /* 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"]);
  60395. /***/ }),
  60396. /***/ "./resources/js/components/AutocompleteCustomDropdown.vue?vue&type=template&id=5fcc8b56&":
  60397. /*!***********************************************************************************************!*\
  60398. !*** ./resources/js/components/AutocompleteCustomDropdown.vue?vue&type=template&id=5fcc8b56& ***!
  60399. \***********************************************************************************************/
  60400. /*! exports provided: render, staticRenderFns */
  60401. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60402. "use strict";
  60403. __webpack_require__.r(__webpack_exports__);
  60404. /* 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&");
  60405. /* 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"]; });
  60406. /* 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"]; });
  60407. /***/ }),
  60408. /***/ "./resources/js/components/CircleSpinner.vue":
  60409. /*!***************************************************!*\
  60410. !*** ./resources/js/components/CircleSpinner.vue ***!
  60411. \***************************************************/
  60412. /*! no static exports found */
  60413. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60414. "use strict";
  60415. __webpack_require__.r(__webpack_exports__);
  60416. /* 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&");
  60417. /* 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&");
  60418. /* 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__));
  60419. /* 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&");
  60420. /* 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");
  60421. /* normalize component */
  60422. var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__["default"])(
  60423. _CircleSpinner_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
  60424. _CircleSpinner_vue_vue_type_template_id_9a543b64_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"],
  60425. _CircleSpinner_vue_vue_type_template_id_9a543b64_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
  60426. false,
  60427. null,
  60428. "9a543b64",
  60429. null
  60430. )
  60431. /* hot reload */
  60432. if (false) { var api; }
  60433. component.options.__file = "resources/js/components/CircleSpinner.vue"
  60434. /* harmony default export */ __webpack_exports__["default"] = (component.exports);
  60435. /***/ }),
  60436. /***/ "./resources/js/components/CircleSpinner.vue?vue&type=script&lang=js&":
  60437. /*!****************************************************************************!*\
  60438. !*** ./resources/js/components/CircleSpinner.vue?vue&type=script&lang=js& ***!
  60439. \****************************************************************************/
  60440. /*! no static exports found */
  60441. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60442. "use strict";
  60443. __webpack_require__.r(__webpack_exports__);
  60444. /* 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&");
  60445. /* 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"]);
  60446. /***/ }),
  60447. /***/ "./resources/js/components/CircleSpinner.vue?vue&type=style&index=0&id=9a543b64&scoped=true&lang=css&":
  60448. /*!************************************************************************************************************!*\
  60449. !*** ./resources/js/components/CircleSpinner.vue?vue&type=style&index=0&id=9a543b64&scoped=true&lang=css& ***!
  60450. \************************************************************************************************************/
  60451. /*! no static exports found */
  60452. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60453. "use strict";
  60454. __webpack_require__.r(__webpack_exports__);
  60455. /* 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&");
  60456. /* 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__);
  60457. /* 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__));
  60458. /* 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);
  60459. /***/ }),
  60460. /***/ "./resources/js/components/CircleSpinner.vue?vue&type=template&id=9a543b64&scoped=true&":
  60461. /*!**********************************************************************************************!*\
  60462. !*** ./resources/js/components/CircleSpinner.vue?vue&type=template&id=9a543b64&scoped=true& ***!
  60463. \**********************************************************************************************/
  60464. /*! exports provided: render, staticRenderFns */
  60465. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60466. "use strict";
  60467. __webpack_require__.r(__webpack_exports__);
  60468. /* 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&");
  60469. /* 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"]; });
  60470. /* 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"]; });
  60471. /***/ }),
  60472. /***/ "./resources/js/components/Credential.vue":
  60473. /*!************************************************!*\
  60474. !*** ./resources/js/components/Credential.vue ***!
  60475. \************************************************/
  60476. /*! exports provided: default */
  60477. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60478. "use strict";
  60479. __webpack_require__.r(__webpack_exports__);
  60480. /* 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&");
  60481. /* 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&");
  60482. /* 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");
  60483. /* normalize component */
  60484. var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(
  60485. _Credential_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
  60486. _Credential_vue_vue_type_template_id_58b8dcfc___WEBPACK_IMPORTED_MODULE_0__["render"],
  60487. _Credential_vue_vue_type_template_id_58b8dcfc___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
  60488. false,
  60489. null,
  60490. null,
  60491. null
  60492. )
  60493. /* hot reload */
  60494. if (false) { var api; }
  60495. component.options.__file = "resources/js/components/Credential.vue"
  60496. /* harmony default export */ __webpack_exports__["default"] = (component.exports);
  60497. /***/ }),
  60498. /***/ "./resources/js/components/Credential.vue?vue&type=script&lang=js&":
  60499. /*!*************************************************************************!*\
  60500. !*** ./resources/js/components/Credential.vue?vue&type=script&lang=js& ***!
  60501. \*************************************************************************/
  60502. /*! exports provided: default */
  60503. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60504. "use strict";
  60505. __webpack_require__.r(__webpack_exports__);
  60506. /* 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&");
  60507. /* 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"]);
  60508. /***/ }),
  60509. /***/ "./resources/js/components/Credential.vue?vue&type=template&id=58b8dcfc&":
  60510. /*!*******************************************************************************!*\
  60511. !*** ./resources/js/components/Credential.vue?vue&type=template&id=58b8dcfc& ***!
  60512. \*******************************************************************************/
  60513. /*! exports provided: render, staticRenderFns */
  60514. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60515. "use strict";
  60516. __webpack_require__.r(__webpack_exports__);
  60517. /* 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&");
  60518. /* 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"]; });
  60519. /* 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"]; });
  60520. /***/ }),
  60521. /***/ "./resources/js/components/CredentialFormModal.vue":
  60522. /*!*********************************************************!*\
  60523. !*** ./resources/js/components/CredentialFormModal.vue ***!
  60524. \*********************************************************/
  60525. /*! exports provided: default */
  60526. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60527. "use strict";
  60528. __webpack_require__.r(__webpack_exports__);
  60529. /* 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&");
  60530. /* 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&");
  60531. /* 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");
  60532. /* normalize component */
  60533. var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(
  60534. _CredentialFormModal_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
  60535. _CredentialFormModal_vue_vue_type_template_id_3cdb3697___WEBPACK_IMPORTED_MODULE_0__["render"],
  60536. _CredentialFormModal_vue_vue_type_template_id_3cdb3697___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
  60537. false,
  60538. null,
  60539. null,
  60540. null
  60541. )
  60542. /* hot reload */
  60543. if (false) { var api; }
  60544. component.options.__file = "resources/js/components/CredentialFormModal.vue"
  60545. /* harmony default export */ __webpack_exports__["default"] = (component.exports);
  60546. /***/ }),
  60547. /***/ "./resources/js/components/CredentialFormModal.vue?vue&type=script&lang=js&":
  60548. /*!**********************************************************************************!*\
  60549. !*** ./resources/js/components/CredentialFormModal.vue?vue&type=script&lang=js& ***!
  60550. \**********************************************************************************/
  60551. /*! exports provided: default */
  60552. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60553. "use strict";
  60554. __webpack_require__.r(__webpack_exports__);
  60555. /* 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&");
  60556. /* 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"]);
  60557. /***/ }),
  60558. /***/ "./resources/js/components/CredentialFormModal.vue?vue&type=template&id=3cdb3697&":
  60559. /*!****************************************************************************************!*\
  60560. !*** ./resources/js/components/CredentialFormModal.vue?vue&type=template&id=3cdb3697& ***!
  60561. \****************************************************************************************/
  60562. /*! exports provided: render, staticRenderFns */
  60563. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60564. "use strict";
  60565. __webpack_require__.r(__webpack_exports__);
  60566. /* 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&");
  60567. /* 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"]; });
  60568. /* 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"]; });
  60569. /***/ }),
  60570. /***/ "./resources/js/components/CredentialList.vue":
  60571. /*!****************************************************!*\
  60572. !*** ./resources/js/components/CredentialList.vue ***!
  60573. \****************************************************/
  60574. /*! exports provided: default */
  60575. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60576. "use strict";
  60577. __webpack_require__.r(__webpack_exports__);
  60578. /* 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&");
  60579. /* 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&");
  60580. /* 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");
  60581. /* normalize component */
  60582. var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(
  60583. _CredentialList_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
  60584. _CredentialList_vue_vue_type_template_id_7264bb80___WEBPACK_IMPORTED_MODULE_0__["render"],
  60585. _CredentialList_vue_vue_type_template_id_7264bb80___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
  60586. false,
  60587. null,
  60588. null,
  60589. null
  60590. )
  60591. /* hot reload */
  60592. if (false) { var api; }
  60593. component.options.__file = "resources/js/components/CredentialList.vue"
  60594. /* harmony default export */ __webpack_exports__["default"] = (component.exports);
  60595. /***/ }),
  60596. /***/ "./resources/js/components/CredentialList.vue?vue&type=script&lang=js&":
  60597. /*!*****************************************************************************!*\
  60598. !*** ./resources/js/components/CredentialList.vue?vue&type=script&lang=js& ***!
  60599. \*****************************************************************************/
  60600. /*! exports provided: default */
  60601. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60602. "use strict";
  60603. __webpack_require__.r(__webpack_exports__);
  60604. /* 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&");
  60605. /* 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"]);
  60606. /***/ }),
  60607. /***/ "./resources/js/components/CredentialList.vue?vue&type=template&id=7264bb80&":
  60608. /*!***********************************************************************************!*\
  60609. !*** ./resources/js/components/CredentialList.vue?vue&type=template&id=7264bb80& ***!
  60610. \***********************************************************************************/
  60611. /*! exports provided: render, staticRenderFns */
  60612. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60613. "use strict";
  60614. __webpack_require__.r(__webpack_exports__);
  60615. /* 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&");
  60616. /* 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"]; });
  60617. /* 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"]; });
  60618. /***/ }),
  60619. /***/ "./resources/js/components/ErrorList.vue":
  60620. /*!***********************************************!*\
  60621. !*** ./resources/js/components/ErrorList.vue ***!
  60622. \***********************************************/
  60623. /*! exports provided: default */
  60624. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60625. "use strict";
  60626. __webpack_require__.r(__webpack_exports__);
  60627. /* 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&");
  60628. /* 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&");
  60629. /* 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");
  60630. /* normalize component */
  60631. var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(
  60632. _ErrorList_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
  60633. _ErrorList_vue_vue_type_template_id_48c089eb___WEBPACK_IMPORTED_MODULE_0__["render"],
  60634. _ErrorList_vue_vue_type_template_id_48c089eb___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
  60635. false,
  60636. null,
  60637. null,
  60638. null
  60639. )
  60640. /* hot reload */
  60641. if (false) { var api; }
  60642. component.options.__file = "resources/js/components/ErrorList.vue"
  60643. /* harmony default export */ __webpack_exports__["default"] = (component.exports);
  60644. /***/ }),
  60645. /***/ "./resources/js/components/ErrorList.vue?vue&type=script&lang=js&":
  60646. /*!************************************************************************!*\
  60647. !*** ./resources/js/components/ErrorList.vue?vue&type=script&lang=js& ***!
  60648. \************************************************************************/
  60649. /*! exports provided: default */
  60650. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60651. "use strict";
  60652. __webpack_require__.r(__webpack_exports__);
  60653. /* 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&");
  60654. /* 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"]);
  60655. /***/ }),
  60656. /***/ "./resources/js/components/ErrorList.vue?vue&type=template&id=48c089eb&":
  60657. /*!******************************************************************************!*\
  60658. !*** ./resources/js/components/ErrorList.vue?vue&type=template&id=48c089eb& ***!
  60659. \******************************************************************************/
  60660. /*! exports provided: render, staticRenderFns */
  60661. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60662. "use strict";
  60663. __webpack_require__.r(__webpack_exports__);
  60664. /* 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&");
  60665. /* 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"]; });
  60666. /* 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"]; });
  60667. /***/ }),
  60668. /***/ "./resources/js/components/Modal.vue":
  60669. /*!*******************************************!*\
  60670. !*** ./resources/js/components/Modal.vue ***!
  60671. \*******************************************/
  60672. /*! exports provided: default */
  60673. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60674. "use strict";
  60675. __webpack_require__.r(__webpack_exports__);
  60676. /* 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&");
  60677. /* 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");
  60678. var script = {}
  60679. /* normalize component */
  60680. var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_1__["default"])(
  60681. script,
  60682. _Modal_vue_vue_type_template_id_53ab54d2___WEBPACK_IMPORTED_MODULE_0__["render"],
  60683. _Modal_vue_vue_type_template_id_53ab54d2___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
  60684. false,
  60685. null,
  60686. null,
  60687. null
  60688. )
  60689. /* hot reload */
  60690. if (false) { var api; }
  60691. component.options.__file = "resources/js/components/Modal.vue"
  60692. /* harmony default export */ __webpack_exports__["default"] = (component.exports);
  60693. /***/ }),
  60694. /***/ "./resources/js/components/Modal.vue?vue&type=template&id=53ab54d2&":
  60695. /*!**************************************************************************!*\
  60696. !*** ./resources/js/components/Modal.vue?vue&type=template&id=53ab54d2& ***!
  60697. \**************************************************************************/
  60698. /*! exports provided: render, staticRenderFns */
  60699. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60700. "use strict";
  60701. __webpack_require__.r(__webpack_exports__);
  60702. /* 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&");
  60703. /* 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"]; });
  60704. /* 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"]; });
  60705. /***/ }),
  60706. /***/ "./resources/js/components/NoteFormModal.vue":
  60707. /*!***************************************************!*\
  60708. !*** ./resources/js/components/NoteFormModal.vue ***!
  60709. \***************************************************/
  60710. /*! exports provided: default */
  60711. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60712. "use strict";
  60713. __webpack_require__.r(__webpack_exports__);
  60714. /* 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&");
  60715. /* 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&");
  60716. /* 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");
  60717. /* normalize component */
  60718. var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(
  60719. _NoteFormModal_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
  60720. _NoteFormModal_vue_vue_type_template_id_1391a09c___WEBPACK_IMPORTED_MODULE_0__["render"],
  60721. _NoteFormModal_vue_vue_type_template_id_1391a09c___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
  60722. false,
  60723. null,
  60724. null,
  60725. null
  60726. )
  60727. /* hot reload */
  60728. if (false) { var api; }
  60729. component.options.__file = "resources/js/components/NoteFormModal.vue"
  60730. /* harmony default export */ __webpack_exports__["default"] = (component.exports);
  60731. /***/ }),
  60732. /***/ "./resources/js/components/NoteFormModal.vue?vue&type=script&lang=js&":
  60733. /*!****************************************************************************!*\
  60734. !*** ./resources/js/components/NoteFormModal.vue?vue&type=script&lang=js& ***!
  60735. \****************************************************************************/
  60736. /*! exports provided: default */
  60737. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60738. "use strict";
  60739. __webpack_require__.r(__webpack_exports__);
  60740. /* 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&");
  60741. /* 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"]);
  60742. /***/ }),
  60743. /***/ "./resources/js/components/NoteFormModal.vue?vue&type=template&id=1391a09c&":
  60744. /*!**********************************************************************************!*\
  60745. !*** ./resources/js/components/NoteFormModal.vue?vue&type=template&id=1391a09c& ***!
  60746. \**********************************************************************************/
  60747. /*! exports provided: render, staticRenderFns */
  60748. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60749. "use strict";
  60750. __webpack_require__.r(__webpack_exports__);
  60751. /* 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&");
  60752. /* 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"]; });
  60753. /* 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"]; });
  60754. /***/ }),
  60755. /***/ "./resources/js/components/Notes.vue":
  60756. /*!*******************************************!*\
  60757. !*** ./resources/js/components/Notes.vue ***!
  60758. \*******************************************/
  60759. /*! exports provided: default */
  60760. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60761. "use strict";
  60762. __webpack_require__.r(__webpack_exports__);
  60763. /* 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&");
  60764. /* 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&");
  60765. /* 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");
  60766. /* normalize component */
  60767. var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(
  60768. _Notes_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
  60769. _Notes_vue_vue_type_template_id_3d897ee6___WEBPACK_IMPORTED_MODULE_0__["render"],
  60770. _Notes_vue_vue_type_template_id_3d897ee6___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
  60771. false,
  60772. null,
  60773. null,
  60774. null
  60775. )
  60776. /* hot reload */
  60777. if (false) { var api; }
  60778. component.options.__file = "resources/js/components/Notes.vue"
  60779. /* harmony default export */ __webpack_exports__["default"] = (component.exports);
  60780. /***/ }),
  60781. /***/ "./resources/js/components/Notes.vue?vue&type=script&lang=js&":
  60782. /*!********************************************************************!*\
  60783. !*** ./resources/js/components/Notes.vue?vue&type=script&lang=js& ***!
  60784. \********************************************************************/
  60785. /*! exports provided: default */
  60786. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60787. "use strict";
  60788. __webpack_require__.r(__webpack_exports__);
  60789. /* 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&");
  60790. /* 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"]);
  60791. /***/ }),
  60792. /***/ "./resources/js/components/Notes.vue?vue&type=template&id=3d897ee6&":
  60793. /*!**************************************************************************!*\
  60794. !*** ./resources/js/components/Notes.vue?vue&type=template&id=3d897ee6& ***!
  60795. \**************************************************************************/
  60796. /*! exports provided: render, staticRenderFns */
  60797. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60798. "use strict";
  60799. __webpack_require__.r(__webpack_exports__);
  60800. /* 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&");
  60801. /* 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"]; });
  60802. /* 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"]; });
  60803. /***/ }),
  60804. /***/ "./resources/js/components/WoInfoEditModal.vue":
  60805. /*!*****************************************************!*\
  60806. !*** ./resources/js/components/WoInfoEditModal.vue ***!
  60807. \*****************************************************/
  60808. /*! exports provided: default */
  60809. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60810. "use strict";
  60811. __webpack_require__.r(__webpack_exports__);
  60812. /* 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&");
  60813. /* 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&");
  60814. /* 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");
  60815. /* normalize component */
  60816. var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(
  60817. _WoInfoEditModal_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
  60818. _WoInfoEditModal_vue_vue_type_template_id_352dd7a2___WEBPACK_IMPORTED_MODULE_0__["render"],
  60819. _WoInfoEditModal_vue_vue_type_template_id_352dd7a2___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
  60820. false,
  60821. null,
  60822. null,
  60823. null
  60824. )
  60825. /* hot reload */
  60826. if (false) { var api; }
  60827. component.options.__file = "resources/js/components/WoInfoEditModal.vue"
  60828. /* harmony default export */ __webpack_exports__["default"] = (component.exports);
  60829. /***/ }),
  60830. /***/ "./resources/js/components/WoInfoEditModal.vue?vue&type=script&lang=js&":
  60831. /*!******************************************************************************!*\
  60832. !*** ./resources/js/components/WoInfoEditModal.vue?vue&type=script&lang=js& ***!
  60833. \******************************************************************************/
  60834. /*! exports provided: default */
  60835. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60836. "use strict";
  60837. __webpack_require__.r(__webpack_exports__);
  60838. /* 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&");
  60839. /* 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"]);
  60840. /***/ }),
  60841. /***/ "./resources/js/components/WoInfoEditModal.vue?vue&type=template&id=352dd7a2&":
  60842. /*!************************************************************************************!*\
  60843. !*** ./resources/js/components/WoInfoEditModal.vue?vue&type=template&id=352dd7a2& ***!
  60844. \************************************************************************************/
  60845. /*! exports provided: render, staticRenderFns */
  60846. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60847. "use strict";
  60848. __webpack_require__.r(__webpack_exports__);
  60849. /* 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&");
  60850. /* 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"]; });
  60851. /* 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"]; });
  60852. /***/ }),
  60853. /***/ "./resources/js/components/WorkOrderInfo.vue":
  60854. /*!***************************************************!*\
  60855. !*** ./resources/js/components/WorkOrderInfo.vue ***!
  60856. \***************************************************/
  60857. /*! exports provided: default */
  60858. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60859. "use strict";
  60860. __webpack_require__.r(__webpack_exports__);
  60861. /* 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&");
  60862. /* 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&");
  60863. /* 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");
  60864. /* normalize component */
  60865. var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(
  60866. _WorkOrderInfo_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
  60867. _WorkOrderInfo_vue_vue_type_template_id_50116330___WEBPACK_IMPORTED_MODULE_0__["render"],
  60868. _WorkOrderInfo_vue_vue_type_template_id_50116330___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
  60869. false,
  60870. null,
  60871. null,
  60872. null
  60873. )
  60874. /* hot reload */
  60875. if (false) { var api; }
  60876. component.options.__file = "resources/js/components/WorkOrderInfo.vue"
  60877. /* harmony default export */ __webpack_exports__["default"] = (component.exports);
  60878. /***/ }),
  60879. /***/ "./resources/js/components/WorkOrderInfo.vue?vue&type=script&lang=js&":
  60880. /*!****************************************************************************!*\
  60881. !*** ./resources/js/components/WorkOrderInfo.vue?vue&type=script&lang=js& ***!
  60882. \****************************************************************************/
  60883. /*! exports provided: default */
  60884. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60885. "use strict";
  60886. __webpack_require__.r(__webpack_exports__);
  60887. /* 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&");
  60888. /* 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"]);
  60889. /***/ }),
  60890. /***/ "./resources/js/components/WorkOrderInfo.vue?vue&type=template&id=50116330&":
  60891. /*!**********************************************************************************!*\
  60892. !*** ./resources/js/components/WorkOrderInfo.vue?vue&type=template&id=50116330& ***!
  60893. \**********************************************************************************/
  60894. /*! exports provided: render, staticRenderFns */
  60895. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60896. "use strict";
  60897. __webpack_require__.r(__webpack_exports__);
  60898. /* 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&");
  60899. /* 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"]; });
  60900. /* 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"]; });
  60901. /***/ }),
  60902. /***/ "./resources/js/mixins/dateMixin.js":
  60903. /*!******************************************!*\
  60904. !*** ./resources/js/mixins/dateMixin.js ***!
  60905. \******************************************/
  60906. /*! exports provided: default */
  60907. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60908. "use strict";
  60909. __webpack_require__.r(__webpack_exports__);
  60910. /* harmony default export */ __webpack_exports__["default"] = ({
  60911. methods: {
  60912. treatAsUTC: function treatAsUTC(date) {
  60913. var result = new Date(date);
  60914. result.setMinutes(result.getMinutes() - result.getTimezoneOffset());
  60915. return result;
  60916. },
  60917. daysSinceToday: function daysSinceToday(date) {
  60918. var currentDate = new Date();
  60919. var millisecondsPerDay = 24 * 60 * 60 * 1000;
  60920. return (this.treatAsUTC(currentDate) - this.treatAsUTC(date)) / millisecondsPerDay;
  60921. },
  60922. getHRDate: function getHRDate(dateString) {
  60923. var date = new Date(dateString);
  60924. return date.toLocaleString('default', {
  60925. month: 'short',
  60926. day: 'numeric',
  60927. year: 'numeric',
  60928. hour: 'numeric',
  60929. minute: 'numeric'
  60930. });
  60931. },
  60932. isZero: function isZero(dateString) {
  60933. return dateString === '0000-00-00 00:00:00';
  60934. }
  60935. }
  60936. });
  60937. /***/ }),
  60938. /***/ "./resources/js/notify.min.js":
  60939. /*!************************************!*\
  60940. !*** ./resources/js/notify.min.js ***!
  60941. \************************************/
  60942. /*! no static exports found */
  60943. /***/ (function(module, exports, __webpack_require__) {
  60944. 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); }
  60945. (function (e) {
  60946. true ? !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (e),
  60947. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  60948. (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
  60949. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : undefined;
  60950. })(function (e) {
  60951. function A(t, n, i) {
  60952. typeof i == "string" && (i = {
  60953. className: i
  60954. }), 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);
  60955. }
  60956. var t = [].indexOf || function (e) {
  60957. for (var t = 0, n = this.length; t < n; t++) {
  60958. if (t in this && this[t] === e) return t;
  60959. }
  60960. return -1;
  60961. },
  60962. n = "notify",
  60963. r = n + "js",
  60964. i = n + "!blank",
  60965. s = {
  60966. t: "top",
  60967. m: "middle",
  60968. b: "bottom",
  60969. l: "left",
  60970. c: "center",
  60971. r: "right"
  60972. },
  60973. o = ["l", "c", "r"],
  60974. u = ["t", "m", "b"],
  60975. a = ["t", "b", "l", "r"],
  60976. f = {
  60977. t: "b",
  60978. m: null,
  60979. b: "t",
  60980. l: "r",
  60981. c: null,
  60982. r: "l"
  60983. },
  60984. l = function l(t) {
  60985. var n;
  60986. return n = [], e.each(t.split(/\W+/), function (e, t) {
  60987. var r;
  60988. r = t.toLowerCase().charAt(0);
  60989. if (s[r]) return n.push(r);
  60990. }), n;
  60991. },
  60992. c = {},
  60993. h = {
  60994. name: "core",
  60995. html: '<div class="' + r + '-wrapper">\n <div class="' + r + '-arrow"></div>\n <div class="' + r + '-container"></div>\n</div>',
  60996. 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}"
  60997. },
  60998. p = {
  60999. "border-radius": ["-webkit-", "-moz-"]
  61000. },
  61001. d = function d(e) {
  61002. return c[e];
  61003. },
  61004. v = function v(e) {
  61005. if (!e) throw "Missing Style name";
  61006. c[e] && delete c[e];
  61007. },
  61008. m = function m(t, i) {
  61009. if (!t) throw "Missing Style name";
  61010. if (!i) throw "Missing Style definition";
  61011. if (!i.html) throw "Missing Style HTML";
  61012. var s = c[t];
  61013. s && s.cssElem && (window.console && console.warn(n + ": overwriting style '" + t + "'"), c[t].cssElem.remove()), i.name = t, c[t] = i;
  61014. var o = "";
  61015. i.classes && e.each(i.classes, function (t, n) {
  61016. return o += "." + r + "-" + i.name + "-" + t + " {\n", e.each(n, function (t, n) {
  61017. return p[t] && e.each(p[t], function (e, r) {
  61018. return o += " " + r + t + ": " + n + ";\n";
  61019. }), o += " " + t + ": " + n + ";\n";
  61020. }), o += "}\n";
  61021. }), i.css && (o += "/* styles for " + i.name + " */\n" + i.css), o && (i.cssElem = g(o), i.cssElem.attr("id", "notify-" + i.name));
  61022. var u = {},
  61023. a = e(i.html);
  61024. y("html", a, u), y("text", a, u), i.fields = u;
  61025. },
  61026. g = function g(t) {
  61027. var n, r, i;
  61028. r = x("style"), r.attr("type", "text/css"), e("head").append(r);
  61029. try {
  61030. r.html(t);
  61031. } catch (s) {
  61032. r[0].styleSheet.cssText = t;
  61033. }
  61034. return r;
  61035. },
  61036. y = function y(t, n, r) {
  61037. var s;
  61038. return t !== "html" && (t = "text"), s = "data-notify-" + t, b(n, "[" + s + "]").each(function () {
  61039. var n;
  61040. n = e(this).attr(s), n || (n = i), r[n] = t;
  61041. });
  61042. },
  61043. b = function b(e, t) {
  61044. return e.is(t) ? e : e.find(t);
  61045. },
  61046. w = {
  61047. clickToHide: !0,
  61048. autoHide: !0,
  61049. autoHideDelay: 5e3,
  61050. arrowShow: !0,
  61051. arrowSize: 5,
  61052. breakNewLines: !0,
  61053. elementPosition: "bottom",
  61054. globalPosition: "top right",
  61055. style: "bootstrap",
  61056. className: "error",
  61057. showAnimation: "slideDown",
  61058. showDuration: 400,
  61059. hideAnimation: "slideUp",
  61060. hideDuration: 200,
  61061. gap: 5
  61062. },
  61063. E = function E(t, n) {
  61064. var r;
  61065. return r = function r() {}, r.prototype = t, e.extend(!0, new r(), n);
  61066. },
  61067. S = function S(t) {
  61068. return e.extend(w, t);
  61069. },
  61070. x = function x(t) {
  61071. return e("<" + t + "></" + t + ">");
  61072. },
  61073. T = {},
  61074. N = function N(t) {
  61075. var n;
  61076. return t.is("[type=radio]") && (n = t.parents("form:first").find("[type=radio]").filter(function (n, r) {
  61077. return e(r).attr("name") === t.attr("name");
  61078. }), t = n.first()), t;
  61079. },
  61080. C = function C(e, t, n) {
  61081. var r, i;
  61082. if (typeof n == "string") n = parseInt(n, 10);else if (typeof n != "number") return;
  61083. if (isNaN(n)) return;
  61084. 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;
  61085. },
  61086. k = function k(e, t, n) {
  61087. if (e === "l" || e === "t") return 0;
  61088. if (e === "c" || e === "m") return n / 2 - t / 2;
  61089. if (e === "r" || e === "b") return n - t;
  61090. throw "Invalid alignment";
  61091. },
  61092. L = function L(e) {
  61093. return L.e = L.e || x("div"), L.e.text(e).html();
  61094. };
  61095. A.prototype.loadHTML = function () {
  61096. var t;
  61097. t = this.getStyle(), this.userContainer = e(t.html), this.userFields = t.fields;
  61098. }, A.prototype.show = function (e, t) {
  61099. var n, r, i, s, o;
  61100. r = function (n) {
  61101. return function () {
  61102. !e && !n.elem && n.destroy();
  61103. if (t) return t();
  61104. };
  61105. }(this), o = this.container.parent().parents(":hidden").length > 0, i = this.container.add(this.arrow), n = [];
  61106. 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 {
  61107. if (!!o || !!e) return r();
  61108. s = this.options.hideAnimation, n.push(this.options.hideDuration);
  61109. }
  61110. return n.push(r), i[s].apply(i, n);
  61111. }, A.prototype.setGlobalPosition = function () {
  61112. var t = this.getPosition(),
  61113. n = t[0],
  61114. i = t[1],
  61115. o = s[n],
  61116. u = s[i],
  61117. a = n + "|" + i,
  61118. f = T[a];
  61119. if (!f || !document.body.contains(f[0])) {
  61120. f = T[a] = x("div");
  61121. var l = {};
  61122. 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);
  61123. }
  61124. return f.prepend(this.wrapper);
  61125. }, A.prototype.setElementPosition = function () {
  61126. 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;
  61127. 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"];
  61128. for (w = 0, S = B.length; w < S; w++) {
  61129. D = B[w], N = parseInt(this.elem.css("margin-" + D), 10), N && C(p, D, N);
  61130. }
  61131. b = Math.max(0, this.options.gap - (this.options.arrowShow ? i : 0)), C(p, A, b);
  61132. if (!this.options.arrowShow) this.arrow.hide();else {
  61133. 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";
  61134. for (E = 0, x = a.length; E < x; E++) {
  61135. D = a[E], P = s[D];
  61136. if (D === L) continue;
  61137. l = P === T ? n : "transparent", r["border-" + P] = i + "px solid " + l;
  61138. }
  61139. C(p, s[L], i), t.call(a, O) >= 0 && C(r, s[O], i * 2);
  61140. }
  61141. 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);
  61142. if (r) return this.arrow.removeAttr("style").css(r);
  61143. }, A.prototype.getPosition = function () {
  61144. var e, n, r, i, s, f, c, h;
  61145. h = this.options.position || (this.elem ? this.options.elementPosition : this.options.globalPosition), e = l(h), e.length === 0 && (e[0] = "b");
  61146. if (n = e[0], t.call(a, n) < 0) throw "Must be one of [" + a + "]";
  61147. 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";
  61148. return e.length === 2 && (e[2] = e[1]), e;
  61149. }, A.prototype.getStyle = function (e) {
  61150. var t;
  61151. e || (e = this.options.style), e || (e = "default"), t = c[e];
  61152. if (!t) throw "Missing style: " + e;
  61153. return t;
  61154. }, A.prototype.updateClasses = function () {
  61155. var t, n;
  61156. 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) {
  61157. return r + "-" + n.name + "-" + e;
  61158. }).join(" "), this.userContainer.attr("class", t);
  61159. }, A.prototype.run = function (t, n) {
  61160. var r, s, o, u, a;
  61161. e.isPlainObject(n) ? e.extend(this.options, n) : e.type(n) === "string" && (this.options.className = n);
  61162. if (this.container && !t) {
  61163. this.show(!1);
  61164. return;
  61165. }
  61166. if (!this.container && !t) return;
  61167. s = {}, e.isPlainObject(t) ? s = t : s[i] = t;
  61168. for (o in s) {
  61169. r = s[o], u = this.userFields[o];
  61170. if (!u) continue;
  61171. 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);
  61172. }
  61173. 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));
  61174. }, A.prototype.destroy = function () {
  61175. this.wrapper.data(r, null), this.wrapper.remove();
  61176. }, e[n] = function (t, r, i) {
  61177. return t && t.nodeName || t.jquery ? e(t)[n](r, i) : (i = r, r = t, new A(null, r, i)), t;
  61178. }, e.fn[n] = function (t, n) {
  61179. return e(this).each(function () {
  61180. var i = N(e(this)).data(r);
  61181. i && i.destroy();
  61182. var s = new A(e(this), t, n);
  61183. }), this;
  61184. }, e.extend(e[n], {
  61185. defaults: S,
  61186. addStyle: m,
  61187. removeStyle: v,
  61188. pluginOptions: w,
  61189. getStyle: d,
  61190. insertCSS: g
  61191. }), m("bootstrap", {
  61192. html: "<div>\n<span data-notify-text></span>\n</div>",
  61193. classes: {
  61194. base: {
  61195. "font-weight": "bold",
  61196. padding: "8px 15px 8px 14px",
  61197. "text-shadow": "0 1px 0 rgba(255, 255, 255, 0.5)",
  61198. "background-color": "#fcf8e3",
  61199. border: "1px solid #fbeed5",
  61200. "border-radius": "4px",
  61201. "white-space": "nowrap",
  61202. "padding-left": "25px",
  61203. "background-repeat": "no-repeat",
  61204. "background-position": "3px 7px"
  61205. },
  61206. error: {
  61207. color: "#B94A48",
  61208. "background-color": "#F2DEDE",
  61209. "border-color": "#EED3D7",
  61210. "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=)"
  61211. },
  61212. success: {
  61213. color: "#468847",
  61214. "background-color": "#DFF0D8",
  61215. "border-color": "#D6E9C6",
  61216. "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==)"
  61217. },
  61218. info: {
  61219. color: "#3A87AD",
  61220. "background-color": "#D9EDF7",
  61221. "border-color": "#BCE8F1",
  61222. "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=)"
  61223. },
  61224. warn: {
  61225. color: "#C09853",
  61226. "background-color": "#FCF8E3",
  61227. "border-color": "#FBEED5",
  61228. "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)"
  61229. }
  61230. }
  61231. }), e(function () {
  61232. g(h.css).attr("id", "core-notify"), e(document).on("click", "." + r + "-hidable", function (t) {
  61233. e(this).trigger("notify-hide");
  61234. }), e(document).on("notify-hide", "." + r + "-wrapper", function (t) {
  61235. var n = e(this).data(r);
  61236. n && n.show(!1);
  61237. });
  61238. });
  61239. });
  61240. /***/ }),
  61241. /***/ "./resources/js/views/App.vue":
  61242. /*!************************************!*\
  61243. !*** ./resources/js/views/App.vue ***!
  61244. \************************************/
  61245. /*! exports provided: default */
  61246. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61247. "use strict";
  61248. __webpack_require__.r(__webpack_exports__);
  61249. /* 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&");
  61250. /* 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&");
  61251. /* 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");
  61252. /* normalize component */
  61253. var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(
  61254. _App_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
  61255. _App_vue_vue_type_template_id_91ac6b5c___WEBPACK_IMPORTED_MODULE_0__["render"],
  61256. _App_vue_vue_type_template_id_91ac6b5c___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
  61257. false,
  61258. null,
  61259. null,
  61260. null
  61261. )
  61262. /* hot reload */
  61263. if (false) { var api; }
  61264. component.options.__file = "resources/js/views/App.vue"
  61265. /* harmony default export */ __webpack_exports__["default"] = (component.exports);
  61266. /***/ }),
  61267. /***/ "./resources/js/views/App.vue?vue&type=script&lang=js&":
  61268. /*!*************************************************************!*\
  61269. !*** ./resources/js/views/App.vue?vue&type=script&lang=js& ***!
  61270. \*************************************************************/
  61271. /*! exports provided: default */
  61272. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61273. "use strict";
  61274. __webpack_require__.r(__webpack_exports__);
  61275. /* 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&");
  61276. /* 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"]);
  61277. /***/ }),
  61278. /***/ "./resources/js/views/App.vue?vue&type=template&id=91ac6b5c&":
  61279. /*!*******************************************************************!*\
  61280. !*** ./resources/js/views/App.vue?vue&type=template&id=91ac6b5c& ***!
  61281. \*******************************************************************/
  61282. /*! exports provided: render, staticRenderFns */
  61283. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61284. "use strict";
  61285. __webpack_require__.r(__webpack_exports__);
  61286. /* 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&");
  61287. /* 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"]; });
  61288. /* 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"]; });
  61289. /***/ }),
  61290. /***/ "./resources/js/views/Dashboard.vue":
  61291. /*!******************************************!*\
  61292. !*** ./resources/js/views/Dashboard.vue ***!
  61293. \******************************************/
  61294. /*! exports provided: default */
  61295. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61296. "use strict";
  61297. __webpack_require__.r(__webpack_exports__);
  61298. /* 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&");
  61299. /* 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&");
  61300. /* 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");
  61301. /* normalize component */
  61302. var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(
  61303. _Dashboard_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
  61304. _Dashboard_vue_vue_type_template_id_1f79daf6___WEBPACK_IMPORTED_MODULE_0__["render"],
  61305. _Dashboard_vue_vue_type_template_id_1f79daf6___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
  61306. false,
  61307. null,
  61308. null,
  61309. null
  61310. )
  61311. /* hot reload */
  61312. if (false) { var api; }
  61313. component.options.__file = "resources/js/views/Dashboard.vue"
  61314. /* harmony default export */ __webpack_exports__["default"] = (component.exports);
  61315. /***/ }),
  61316. /***/ "./resources/js/views/Dashboard.vue?vue&type=script&lang=js&":
  61317. /*!*******************************************************************!*\
  61318. !*** ./resources/js/views/Dashboard.vue?vue&type=script&lang=js& ***!
  61319. \*******************************************************************/
  61320. /*! exports provided: default */
  61321. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61322. "use strict";
  61323. __webpack_require__.r(__webpack_exports__);
  61324. /* 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&");
  61325. /* 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"]);
  61326. /***/ }),
  61327. /***/ "./resources/js/views/Dashboard.vue?vue&type=template&id=1f79daf6&":
  61328. /*!*************************************************************************!*\
  61329. !*** ./resources/js/views/Dashboard.vue?vue&type=template&id=1f79daf6& ***!
  61330. \*************************************************************************/
  61331. /*! exports provided: render, staticRenderFns */
  61332. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61333. "use strict";
  61334. __webpack_require__.r(__webpack_exports__);
  61335. /* 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&");
  61336. /* 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"]; });
  61337. /* 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"]; });
  61338. /***/ }),
  61339. /***/ "./resources/js/views/Login.vue":
  61340. /*!**************************************!*\
  61341. !*** ./resources/js/views/Login.vue ***!
  61342. \**************************************/
  61343. /*! exports provided: default */
  61344. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61345. "use strict";
  61346. __webpack_require__.r(__webpack_exports__);
  61347. /* 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&");
  61348. /* 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&");
  61349. /* 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");
  61350. /* normalize component */
  61351. var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(
  61352. _Login_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
  61353. _Login_vue_vue_type_template_id_12f5395a___WEBPACK_IMPORTED_MODULE_0__["render"],
  61354. _Login_vue_vue_type_template_id_12f5395a___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
  61355. false,
  61356. null,
  61357. null,
  61358. null
  61359. )
  61360. /* hot reload */
  61361. if (false) { var api; }
  61362. component.options.__file = "resources/js/views/Login.vue"
  61363. /* harmony default export */ __webpack_exports__["default"] = (component.exports);
  61364. /***/ }),
  61365. /***/ "./resources/js/views/Login.vue?vue&type=script&lang=js&":
  61366. /*!***************************************************************!*\
  61367. !*** ./resources/js/views/Login.vue?vue&type=script&lang=js& ***!
  61368. \***************************************************************/
  61369. /*! exports provided: default */
  61370. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61371. "use strict";
  61372. __webpack_require__.r(__webpack_exports__);
  61373. /* 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&");
  61374. /* 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"]);
  61375. /***/ }),
  61376. /***/ "./resources/js/views/Login.vue?vue&type=template&id=12f5395a&":
  61377. /*!*********************************************************************!*\
  61378. !*** ./resources/js/views/Login.vue?vue&type=template&id=12f5395a& ***!
  61379. \*********************************************************************/
  61380. /*! exports provided: render, staticRenderFns */
  61381. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61382. "use strict";
  61383. __webpack_require__.r(__webpack_exports__);
  61384. /* 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&");
  61385. /* 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"]; });
  61386. /* 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"]; });
  61387. /***/ }),
  61388. /***/ "./resources/js/views/Welcome.vue":
  61389. /*!****************************************!*\
  61390. !*** ./resources/js/views/Welcome.vue ***!
  61391. \****************************************/
  61392. /*! exports provided: default */
  61393. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61394. "use strict";
  61395. __webpack_require__.r(__webpack_exports__);
  61396. /* 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&");
  61397. /* 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&");
  61398. /* 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&");
  61399. /* 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");
  61400. /* normalize component */
  61401. var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__["default"])(
  61402. _Welcome_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
  61403. _Welcome_vue_vue_type_template_id_1ae8ae93_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"],
  61404. _Welcome_vue_vue_type_template_id_1ae8ae93_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
  61405. false,
  61406. null,
  61407. "1ae8ae93",
  61408. null
  61409. )
  61410. /* hot reload */
  61411. if (false) { var api; }
  61412. component.options.__file = "resources/js/views/Welcome.vue"
  61413. /* harmony default export */ __webpack_exports__["default"] = (component.exports);
  61414. /***/ }),
  61415. /***/ "./resources/js/views/Welcome.vue?vue&type=script&lang=js&":
  61416. /*!*****************************************************************!*\
  61417. !*** ./resources/js/views/Welcome.vue?vue&type=script&lang=js& ***!
  61418. \*****************************************************************/
  61419. /*! exports provided: default */
  61420. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61421. "use strict";
  61422. __webpack_require__.r(__webpack_exports__);
  61423. /* 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&");
  61424. /* 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"]);
  61425. /***/ }),
  61426. /***/ "./resources/js/views/Welcome.vue?vue&type=style&index=0&id=1ae8ae93&scoped=true&lang=css&":
  61427. /*!*************************************************************************************************!*\
  61428. !*** ./resources/js/views/Welcome.vue?vue&type=style&index=0&id=1ae8ae93&scoped=true&lang=css& ***!
  61429. \*************************************************************************************************/
  61430. /*! no static exports found */
  61431. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61432. "use strict";
  61433. __webpack_require__.r(__webpack_exports__);
  61434. /* 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&");
  61435. /* 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__);
  61436. /* 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__));
  61437. /* 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);
  61438. /***/ }),
  61439. /***/ "./resources/js/views/Welcome.vue?vue&type=template&id=1ae8ae93&scoped=true&":
  61440. /*!***********************************************************************************!*\
  61441. !*** ./resources/js/views/Welcome.vue?vue&type=template&id=1ae8ae93&scoped=true& ***!
  61442. \***********************************************************************************/
  61443. /*! exports provided: render, staticRenderFns */
  61444. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61445. "use strict";
  61446. __webpack_require__.r(__webpack_exports__);
  61447. /* 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&");
  61448. /* 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"]; });
  61449. /* 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"]; });
  61450. /***/ }),
  61451. /***/ "./resources/js/views/WorkOrder.vue":
  61452. /*!******************************************!*\
  61453. !*** ./resources/js/views/WorkOrder.vue ***!
  61454. \******************************************/
  61455. /*! exports provided: default */
  61456. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61457. "use strict";
  61458. __webpack_require__.r(__webpack_exports__);
  61459. /* 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&");
  61460. /* 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&");
  61461. /* 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");
  61462. /* normalize component */
  61463. var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(
  61464. _WorkOrder_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
  61465. _WorkOrder_vue_vue_type_template_id_17837e2e___WEBPACK_IMPORTED_MODULE_0__["render"],
  61466. _WorkOrder_vue_vue_type_template_id_17837e2e___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
  61467. false,
  61468. null,
  61469. null,
  61470. null
  61471. )
  61472. /* hot reload */
  61473. if (false) { var api; }
  61474. component.options.__file = "resources/js/views/WorkOrder.vue"
  61475. /* harmony default export */ __webpack_exports__["default"] = (component.exports);
  61476. /***/ }),
  61477. /***/ "./resources/js/views/WorkOrder.vue?vue&type=script&lang=js&":
  61478. /*!*******************************************************************!*\
  61479. !*** ./resources/js/views/WorkOrder.vue?vue&type=script&lang=js& ***!
  61480. \*******************************************************************/
  61481. /*! exports provided: default */
  61482. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61483. "use strict";
  61484. __webpack_require__.r(__webpack_exports__);
  61485. /* 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&");
  61486. /* 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"]);
  61487. /***/ }),
  61488. /***/ "./resources/js/views/WorkOrder.vue?vue&type=template&id=17837e2e&":
  61489. /*!*************************************************************************!*\
  61490. !*** ./resources/js/views/WorkOrder.vue?vue&type=template&id=17837e2e& ***!
  61491. \*************************************************************************/
  61492. /*! exports provided: render, staticRenderFns */
  61493. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61494. "use strict";
  61495. __webpack_require__.r(__webpack_exports__);
  61496. /* 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&");
  61497. /* 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"]; });
  61498. /* 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"]; });
  61499. /***/ }),
  61500. /***/ "./resources/sass/app.scss":
  61501. /*!*********************************!*\
  61502. !*** ./resources/sass/app.scss ***!
  61503. \*********************************/
  61504. /*! no static exports found */
  61505. /***/ (function(module, exports) {
  61506. // removed by extract-text-webpack-plugin
  61507. /***/ }),
  61508. /***/ 0:
  61509. /*!*************************************************************!*\
  61510. !*** multi ./resources/js/app.js ./resources/sass/app.scss ***!
  61511. \*************************************************************/
  61512. /*! no static exports found */
  61513. /***/ (function(module, exports, __webpack_require__) {
  61514. __webpack_require__(/*! /home/vagrant/upccrt/resources/js/app.js */"./resources/js/app.js");
  61515. module.exports = __webpack_require__(/*! /home/vagrant/upccrt/resources/sass/app.scss */"./resources/sass/app.scss");
  61516. /***/ })
  61517. /******/ });