bootstrap-table.js 320 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539
  1. (function (global, factory) {
  2. typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery')) :
  3. typeof define === 'function' && define.amd ? define(['jquery'], factory) :
  4. (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.BootstrapTable = factory(global.jQuery));
  5. })(this, (function ($$p) { 'use strict';
  6. function _iterableToArrayLimit(r, l) {
  7. var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
  8. if (null != t) {
  9. var e,
  10. n,
  11. i,
  12. u,
  13. a = [],
  14. f = !0,
  15. o = !1;
  16. try {
  17. if (i = (t = t.call(r)).next, 0 === l) {
  18. if (Object(t) !== t) return;
  19. f = !1;
  20. } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
  21. } catch (r) {
  22. o = !0, n = r;
  23. } finally {
  24. try {
  25. if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
  26. } finally {
  27. if (o) throw n;
  28. }
  29. }
  30. return a;
  31. }
  32. }
  33. function _toPrimitive(t, r) {
  34. if ("object" != typeof t || !t) return t;
  35. var e = t[Symbol.toPrimitive];
  36. if (void 0 !== e) {
  37. var i = e.call(t, r || "default");
  38. if ("object" != typeof i) return i;
  39. throw new TypeError("@@toPrimitive must return a primitive value.");
  40. }
  41. return ("string" === r ? String : Number)(t);
  42. }
  43. function _toPropertyKey(t) {
  44. var i = _toPrimitive(t, "string");
  45. return "symbol" == typeof i ? i : String(i);
  46. }
  47. function _typeof(o) {
  48. "@babel/helpers - typeof";
  49. return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
  50. return typeof o;
  51. } : function (o) {
  52. return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
  53. }, _typeof(o);
  54. }
  55. function _classCallCheck(instance, Constructor) {
  56. if (!(instance instanceof Constructor)) {
  57. throw new TypeError("Cannot call a class as a function");
  58. }
  59. }
  60. function _defineProperties(target, props) {
  61. for (var i = 0; i < props.length; i++) {
  62. var descriptor = props[i];
  63. descriptor.enumerable = descriptor.enumerable || false;
  64. descriptor.configurable = true;
  65. if ("value" in descriptor) descriptor.writable = true;
  66. Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
  67. }
  68. }
  69. function _createClass(Constructor, protoProps, staticProps) {
  70. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  71. if (staticProps) _defineProperties(Constructor, staticProps);
  72. Object.defineProperty(Constructor, "prototype", {
  73. writable: false
  74. });
  75. return Constructor;
  76. }
  77. function _slicedToArray(arr, i) {
  78. return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
  79. }
  80. function _toConsumableArray(arr) {
  81. return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
  82. }
  83. function _arrayWithoutHoles(arr) {
  84. if (Array.isArray(arr)) return _arrayLikeToArray(arr);
  85. }
  86. function _arrayWithHoles(arr) {
  87. if (Array.isArray(arr)) return arr;
  88. }
  89. function _iterableToArray(iter) {
  90. if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  91. }
  92. function _unsupportedIterableToArray(o, minLen) {
  93. if (!o) return;
  94. if (typeof o === "string") return _arrayLikeToArray(o, minLen);
  95. var n = Object.prototype.toString.call(o).slice(8, -1);
  96. if (n === "Object" && o.constructor) n = o.constructor.name;
  97. if (n === "Map" || n === "Set") return Array.from(o);
  98. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
  99. }
  100. function _arrayLikeToArray(arr, len) {
  101. if (len == null || len > arr.length) len = arr.length;
  102. for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
  103. return arr2;
  104. }
  105. function _nonIterableSpread() {
  106. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  107. }
  108. function _nonIterableRest() {
  109. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  110. }
  111. function _createForOfIteratorHelper(o, allowArrayLike) {
  112. var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
  113. if (!it) {
  114. if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
  115. if (it) o = it;
  116. var i = 0;
  117. var F = function () {};
  118. return {
  119. s: F,
  120. n: function () {
  121. if (i >= o.length) return {
  122. done: true
  123. };
  124. return {
  125. done: false,
  126. value: o[i++]
  127. };
  128. },
  129. e: function (e) {
  130. throw e;
  131. },
  132. f: F
  133. };
  134. }
  135. throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  136. }
  137. var normalCompletion = true,
  138. didErr = false,
  139. err;
  140. return {
  141. s: function () {
  142. it = it.call(o);
  143. },
  144. n: function () {
  145. var step = it.next();
  146. normalCompletion = step.done;
  147. return step;
  148. },
  149. e: function (e) {
  150. didErr = true;
  151. err = e;
  152. },
  153. f: function () {
  154. try {
  155. if (!normalCompletion && it.return != null) it.return();
  156. } finally {
  157. if (didErr) throw err;
  158. }
  159. }
  160. };
  161. }
  162. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  163. var check = function (it) {
  164. return it && it.Math === Math && it;
  165. };
  166. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  167. var global$k =
  168. // eslint-disable-next-line es/no-global-this -- safe
  169. check(typeof globalThis == 'object' && globalThis) ||
  170. check(typeof window == 'object' && window) ||
  171. // eslint-disable-next-line no-restricted-globals -- safe
  172. check(typeof self == 'object' && self) ||
  173. check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
  174. check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
  175. // eslint-disable-next-line no-new-func -- fallback
  176. (function () { return this; })() || Function('return this')();
  177. var objectGetOwnPropertyDescriptor = {};
  178. var fails$w = function (exec) {
  179. try {
  180. return !!exec();
  181. } catch (error) {
  182. return true;
  183. }
  184. };
  185. var fails$v = fails$w;
  186. // Detect IE8's incomplete defineProperty implementation
  187. var descriptors = !fails$v(function () {
  188. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  189. return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;
  190. });
  191. var fails$u = fails$w;
  192. var functionBindNative = !fails$u(function () {
  193. // eslint-disable-next-line es/no-function-prototype-bind -- safe
  194. var test = (function () { /* empty */ }).bind();
  195. // eslint-disable-next-line no-prototype-builtins -- safe
  196. return typeof test != 'function' || test.hasOwnProperty('prototype');
  197. });
  198. var NATIVE_BIND$3 = functionBindNative;
  199. var call$f = Function.prototype.call;
  200. var functionCall = NATIVE_BIND$3 ? call$f.bind(call$f) : function () {
  201. return call$f.apply(call$f, arguments);
  202. };
  203. var objectPropertyIsEnumerable = {};
  204. var $propertyIsEnumerable$1 = {}.propertyIsEnumerable;
  205. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  206. var getOwnPropertyDescriptor$5 = Object.getOwnPropertyDescriptor;
  207. // Nashorn ~ JDK8 bug
  208. var NASHORN_BUG = getOwnPropertyDescriptor$5 && !$propertyIsEnumerable$1.call({ 1: 2 }, 1);
  209. // `Object.prototype.propertyIsEnumerable` method implementation
  210. // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
  211. objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
  212. var descriptor = getOwnPropertyDescriptor$5(this, V);
  213. return !!descriptor && descriptor.enumerable;
  214. } : $propertyIsEnumerable$1;
  215. var createPropertyDescriptor$4 = function (bitmap, value) {
  216. return {
  217. enumerable: !(bitmap & 1),
  218. configurable: !(bitmap & 2),
  219. writable: !(bitmap & 4),
  220. value: value
  221. };
  222. };
  223. var NATIVE_BIND$2 = functionBindNative;
  224. var FunctionPrototype$2 = Function.prototype;
  225. var call$e = FunctionPrototype$2.call;
  226. var uncurryThisWithBind = NATIVE_BIND$2 && FunctionPrototype$2.bind.bind(call$e, call$e);
  227. var functionUncurryThis = NATIVE_BIND$2 ? uncurryThisWithBind : function (fn) {
  228. return function () {
  229. return call$e.apply(fn, arguments);
  230. };
  231. };
  232. var uncurryThis$y = functionUncurryThis;
  233. var toString$h = uncurryThis$y({}.toString);
  234. var stringSlice$9 = uncurryThis$y(''.slice);
  235. var classofRaw$2 = function (it) {
  236. return stringSlice$9(toString$h(it), 8, -1);
  237. };
  238. var uncurryThis$x = functionUncurryThis;
  239. var fails$t = fails$w;
  240. var classof$7 = classofRaw$2;
  241. var $Object$4 = Object;
  242. var split = uncurryThis$x(''.split);
  243. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  244. var indexedObject = fails$t(function () {
  245. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  246. // eslint-disable-next-line no-prototype-builtins -- safe
  247. return !$Object$4('z').propertyIsEnumerable(0);
  248. }) ? function (it) {
  249. return classof$7(it) === 'String' ? split(it, '') : $Object$4(it);
  250. } : $Object$4;
  251. // we can't use just `it == null` since of `document.all` special case
  252. // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
  253. var isNullOrUndefined$7 = function (it) {
  254. return it === null || it === undefined;
  255. };
  256. var isNullOrUndefined$6 = isNullOrUndefined$7;
  257. var $TypeError$c = TypeError;
  258. // `RequireObjectCoercible` abstract operation
  259. // https://tc39.es/ecma262/#sec-requireobjectcoercible
  260. var requireObjectCoercible$b = function (it) {
  261. if (isNullOrUndefined$6(it)) throw new $TypeError$c("Can't call method on " + it);
  262. return it;
  263. };
  264. // toObject with fallback for non-array-like ES3 strings
  265. var IndexedObject$3 = indexedObject;
  266. var requireObjectCoercible$a = requireObjectCoercible$b;
  267. var toIndexedObject$8 = function (it) {
  268. return IndexedObject$3(requireObjectCoercible$a(it));
  269. };
  270. // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
  271. var documentAll = typeof document == 'object' && document.all;
  272. // `IsCallable` abstract operation
  273. // https://tc39.es/ecma262/#sec-iscallable
  274. // eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
  275. var isCallable$i = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) {
  276. return typeof argument == 'function' || argument === documentAll;
  277. } : function (argument) {
  278. return typeof argument == 'function';
  279. };
  280. var isCallable$h = isCallable$i;
  281. var isObject$c = function (it) {
  282. return typeof it == 'object' ? it !== null : isCallable$h(it);
  283. };
  284. var global$j = global$k;
  285. var isCallable$g = isCallable$i;
  286. var aFunction = function (argument) {
  287. return isCallable$g(argument) ? argument : undefined;
  288. };
  289. var getBuiltIn$5 = function (namespace, method) {
  290. return arguments.length < 2 ? aFunction(global$j[namespace]) : global$j[namespace] && global$j[namespace][method];
  291. };
  292. var uncurryThis$w = functionUncurryThis;
  293. var objectIsPrototypeOf = uncurryThis$w({}.isPrototypeOf);
  294. var engineUserAgent = typeof navigator != 'undefined' && String(navigator.userAgent) || '';
  295. var global$i = global$k;
  296. var userAgent$2 = engineUserAgent;
  297. var process = global$i.process;
  298. var Deno = global$i.Deno;
  299. var versions = process && process.versions || Deno && Deno.version;
  300. var v8 = versions && versions.v8;
  301. var match, version;
  302. if (v8) {
  303. match = v8.split('.');
  304. // in old Chrome, versions of V8 isn't V8 = Chrome / 10
  305. // but their correct versions are not interesting for us
  306. version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
  307. }
  308. // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
  309. // so check `userAgent` even if `.v8` exists, but 0
  310. if (!version && userAgent$2) {
  311. match = userAgent$2.match(/Edge\/(\d+)/);
  312. if (!match || match[1] >= 74) {
  313. match = userAgent$2.match(/Chrome\/(\d+)/);
  314. if (match) version = +match[1];
  315. }
  316. }
  317. var engineV8Version = version;
  318. /* eslint-disable es/no-symbol -- required for testing */
  319. var V8_VERSION$2 = engineV8Version;
  320. var fails$s = fails$w;
  321. var global$h = global$k;
  322. var $String$5 = global$h.String;
  323. // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
  324. var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$s(function () {
  325. var symbol = Symbol('symbol detection');
  326. // Chrome 38 Symbol has incorrect toString conversion
  327. // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
  328. // nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,
  329. // of course, fail.
  330. return !$String$5(symbol) || !(Object(symbol) instanceof Symbol) ||
  331. // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
  332. !Symbol.sham && V8_VERSION$2 && V8_VERSION$2 < 41;
  333. });
  334. /* eslint-disable es/no-symbol -- required for testing */
  335. var NATIVE_SYMBOL$1 = symbolConstructorDetection;
  336. var useSymbolAsUid = NATIVE_SYMBOL$1
  337. && !Symbol.sham
  338. && typeof Symbol.iterator == 'symbol';
  339. var getBuiltIn$4 = getBuiltIn$5;
  340. var isCallable$f = isCallable$i;
  341. var isPrototypeOf$3 = objectIsPrototypeOf;
  342. var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
  343. var $Object$3 = Object;
  344. var isSymbol$3 = USE_SYMBOL_AS_UID$1 ? function (it) {
  345. return typeof it == 'symbol';
  346. } : function (it) {
  347. var $Symbol = getBuiltIn$4('Symbol');
  348. return isCallable$f($Symbol) && isPrototypeOf$3($Symbol.prototype, $Object$3(it));
  349. };
  350. var $String$4 = String;
  351. var tryToString$3 = function (argument) {
  352. try {
  353. return $String$4(argument);
  354. } catch (error) {
  355. return 'Object';
  356. }
  357. };
  358. var isCallable$e = isCallable$i;
  359. var tryToString$2 = tryToString$3;
  360. var $TypeError$b = TypeError;
  361. // `Assert: IsCallable(argument) is true`
  362. var aCallable$4 = function (argument) {
  363. if (isCallable$e(argument)) return argument;
  364. throw new $TypeError$b(tryToString$2(argument) + ' is not a function');
  365. };
  366. var aCallable$3 = aCallable$4;
  367. var isNullOrUndefined$5 = isNullOrUndefined$7;
  368. // `GetMethod` abstract operation
  369. // https://tc39.es/ecma262/#sec-getmethod
  370. var getMethod$5 = function (V, P) {
  371. var func = V[P];
  372. return isNullOrUndefined$5(func) ? undefined : aCallable$3(func);
  373. };
  374. var call$d = functionCall;
  375. var isCallable$d = isCallable$i;
  376. var isObject$b = isObject$c;
  377. var $TypeError$a = TypeError;
  378. // `OrdinaryToPrimitive` abstract operation
  379. // https://tc39.es/ecma262/#sec-ordinarytoprimitive
  380. var ordinaryToPrimitive$1 = function (input, pref) {
  381. var fn, val;
  382. if (pref === 'string' && isCallable$d(fn = input.toString) && !isObject$b(val = call$d(fn, input))) return val;
  383. if (isCallable$d(fn = input.valueOf) && !isObject$b(val = call$d(fn, input))) return val;
  384. if (pref !== 'string' && isCallable$d(fn = input.toString) && !isObject$b(val = call$d(fn, input))) return val;
  385. throw new $TypeError$a("Can't convert object to primitive value");
  386. };
  387. var sharedStore = {exports: {}};
  388. var isPure = false;
  389. var global$g = global$k;
  390. // eslint-disable-next-line es/no-object-defineproperty -- safe
  391. var defineProperty$8 = Object.defineProperty;
  392. var defineGlobalProperty$3 = function (key, value) {
  393. try {
  394. defineProperty$8(global$g, key, { value: value, configurable: true, writable: true });
  395. } catch (error) {
  396. global$g[key] = value;
  397. } return value;
  398. };
  399. var globalThis$1 = global$k;
  400. var defineGlobalProperty$2 = defineGlobalProperty$3;
  401. var SHARED = '__core-js_shared__';
  402. var store$3 = sharedStore.exports = globalThis$1[SHARED] || defineGlobalProperty$2(SHARED, {});
  403. (store$3.versions || (store$3.versions = [])).push({
  404. version: '3.36.0',
  405. mode: 'global',
  406. copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)',
  407. license: 'https://github.com/zloirock/core-js/blob/v3.36.0/LICENSE',
  408. source: 'https://github.com/zloirock/core-js'
  409. });
  410. var sharedStoreExports = sharedStore.exports;
  411. var store$2 = sharedStoreExports;
  412. var shared$4 = function (key, value) {
  413. return store$2[key] || (store$2[key] = value || {});
  414. };
  415. var requireObjectCoercible$9 = requireObjectCoercible$b;
  416. var $Object$2 = Object;
  417. // `ToObject` abstract operation
  418. // https://tc39.es/ecma262/#sec-toobject
  419. var toObject$a = function (argument) {
  420. return $Object$2(requireObjectCoercible$9(argument));
  421. };
  422. var uncurryThis$v = functionUncurryThis;
  423. var toObject$9 = toObject$a;
  424. var hasOwnProperty = uncurryThis$v({}.hasOwnProperty);
  425. // `HasOwnProperty` abstract operation
  426. // https://tc39.es/ecma262/#sec-hasownproperty
  427. // eslint-disable-next-line es/no-object-hasown -- safe
  428. var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
  429. return hasOwnProperty(toObject$9(it), key);
  430. };
  431. var uncurryThis$u = functionUncurryThis;
  432. var id = 0;
  433. var postfix = Math.random();
  434. var toString$g = uncurryThis$u(1.0.toString);
  435. var uid$2 = function (key) {
  436. return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$g(++id + postfix, 36);
  437. };
  438. var global$f = global$k;
  439. var shared$3 = shared$4;
  440. var hasOwn$b = hasOwnProperty_1;
  441. var uid$1 = uid$2;
  442. var NATIVE_SYMBOL = symbolConstructorDetection;
  443. var USE_SYMBOL_AS_UID = useSymbolAsUid;
  444. var Symbol$3 = global$f.Symbol;
  445. var WellKnownSymbolsStore = shared$3('wks');
  446. var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$3['for'] || Symbol$3 : Symbol$3 && Symbol$3.withoutSetter || uid$1;
  447. var wellKnownSymbol$j = function (name) {
  448. if (!hasOwn$b(WellKnownSymbolsStore, name)) {
  449. WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn$b(Symbol$3, name)
  450. ? Symbol$3[name]
  451. : createWellKnownSymbol('Symbol.' + name);
  452. } return WellKnownSymbolsStore[name];
  453. };
  454. var call$c = functionCall;
  455. var isObject$a = isObject$c;
  456. var isSymbol$2 = isSymbol$3;
  457. var getMethod$4 = getMethod$5;
  458. var ordinaryToPrimitive = ordinaryToPrimitive$1;
  459. var wellKnownSymbol$i = wellKnownSymbol$j;
  460. var $TypeError$9 = TypeError;
  461. var TO_PRIMITIVE = wellKnownSymbol$i('toPrimitive');
  462. // `ToPrimitive` abstract operation
  463. // https://tc39.es/ecma262/#sec-toprimitive
  464. var toPrimitive$2 = function (input, pref) {
  465. if (!isObject$a(input) || isSymbol$2(input)) return input;
  466. var exoticToPrim = getMethod$4(input, TO_PRIMITIVE);
  467. var result;
  468. if (exoticToPrim) {
  469. if (pref === undefined) pref = 'default';
  470. result = call$c(exoticToPrim, input, pref);
  471. if (!isObject$a(result) || isSymbol$2(result)) return result;
  472. throw new $TypeError$9("Can't convert object to primitive value");
  473. }
  474. if (pref === undefined) pref = 'number';
  475. return ordinaryToPrimitive(input, pref);
  476. };
  477. var toPrimitive$1 = toPrimitive$2;
  478. var isSymbol$1 = isSymbol$3;
  479. // `ToPropertyKey` abstract operation
  480. // https://tc39.es/ecma262/#sec-topropertykey
  481. var toPropertyKey$2 = function (argument) {
  482. var key = toPrimitive$1(argument, 'string');
  483. return isSymbol$1(key) ? key : key + '';
  484. };
  485. var global$e = global$k;
  486. var isObject$9 = isObject$c;
  487. var document$1 = global$e.document;
  488. // typeof document.createElement is 'object' in old IE
  489. var EXISTS$1 = isObject$9(document$1) && isObject$9(document$1.createElement);
  490. var documentCreateElement$2 = function (it) {
  491. return EXISTS$1 ? document$1.createElement(it) : {};
  492. };
  493. var DESCRIPTORS$f = descriptors;
  494. var fails$r = fails$w;
  495. var createElement = documentCreateElement$2;
  496. // Thanks to IE8 for its funny defineProperty
  497. var ie8DomDefine = !DESCRIPTORS$f && !fails$r(function () {
  498. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  499. return Object.defineProperty(createElement('div'), 'a', {
  500. get: function () { return 7; }
  501. }).a !== 7;
  502. });
  503. var DESCRIPTORS$e = descriptors;
  504. var call$b = functionCall;
  505. var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
  506. var createPropertyDescriptor$3 = createPropertyDescriptor$4;
  507. var toIndexedObject$7 = toIndexedObject$8;
  508. var toPropertyKey$1 = toPropertyKey$2;
  509. var hasOwn$a = hasOwnProperty_1;
  510. var IE8_DOM_DEFINE$1 = ie8DomDefine;
  511. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  512. var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
  513. // `Object.getOwnPropertyDescriptor` method
  514. // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
  515. objectGetOwnPropertyDescriptor.f = DESCRIPTORS$e ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
  516. O = toIndexedObject$7(O);
  517. P = toPropertyKey$1(P);
  518. if (IE8_DOM_DEFINE$1) try {
  519. return $getOwnPropertyDescriptor$1(O, P);
  520. } catch (error) { /* empty */ }
  521. if (hasOwn$a(O, P)) return createPropertyDescriptor$3(!call$b(propertyIsEnumerableModule$1.f, O, P), O[P]);
  522. };
  523. var objectDefineProperty = {};
  524. var DESCRIPTORS$d = descriptors;
  525. var fails$q = fails$w;
  526. // V8 ~ Chrome 36-
  527. // https://bugs.chromium.org/p/v8/issues/detail?id=3334
  528. var v8PrototypeDefineBug = DESCRIPTORS$d && fails$q(function () {
  529. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  530. return Object.defineProperty(function () { /* empty */ }, 'prototype', {
  531. value: 42,
  532. writable: false
  533. }).prototype !== 42;
  534. });
  535. var isObject$8 = isObject$c;
  536. var $String$3 = String;
  537. var $TypeError$8 = TypeError;
  538. // `Assert: Type(argument) is Object`
  539. var anObject$d = function (argument) {
  540. if (isObject$8(argument)) return argument;
  541. throw new $TypeError$8($String$3(argument) + ' is not an object');
  542. };
  543. var DESCRIPTORS$c = descriptors;
  544. var IE8_DOM_DEFINE = ie8DomDefine;
  545. var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
  546. var anObject$c = anObject$d;
  547. var toPropertyKey = toPropertyKey$2;
  548. var $TypeError$7 = TypeError;
  549. // eslint-disable-next-line es/no-object-defineproperty -- safe
  550. var $defineProperty = Object.defineProperty;
  551. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  552. var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  553. var ENUMERABLE = 'enumerable';
  554. var CONFIGURABLE$1 = 'configurable';
  555. var WRITABLE = 'writable';
  556. // `Object.defineProperty` method
  557. // https://tc39.es/ecma262/#sec-object.defineproperty
  558. objectDefineProperty.f = DESCRIPTORS$c ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
  559. anObject$c(O);
  560. P = toPropertyKey(P);
  561. anObject$c(Attributes);
  562. if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
  563. var current = $getOwnPropertyDescriptor(O, P);
  564. if (current && current[WRITABLE]) {
  565. O[P] = Attributes.value;
  566. Attributes = {
  567. configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
  568. enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
  569. writable: false
  570. };
  571. }
  572. } return $defineProperty(O, P, Attributes);
  573. } : $defineProperty : function defineProperty(O, P, Attributes) {
  574. anObject$c(O);
  575. P = toPropertyKey(P);
  576. anObject$c(Attributes);
  577. if (IE8_DOM_DEFINE) try {
  578. return $defineProperty(O, P, Attributes);
  579. } catch (error) { /* empty */ }
  580. if ('get' in Attributes || 'set' in Attributes) throw new $TypeError$7('Accessors not supported');
  581. if ('value' in Attributes) O[P] = Attributes.value;
  582. return O;
  583. };
  584. var DESCRIPTORS$b = descriptors;
  585. var definePropertyModule$4 = objectDefineProperty;
  586. var createPropertyDescriptor$2 = createPropertyDescriptor$4;
  587. var createNonEnumerableProperty$7 = DESCRIPTORS$b ? function (object, key, value) {
  588. return definePropertyModule$4.f(object, key, createPropertyDescriptor$2(1, value));
  589. } : function (object, key, value) {
  590. object[key] = value;
  591. return object;
  592. };
  593. var makeBuiltIn$3 = {exports: {}};
  594. var DESCRIPTORS$a = descriptors;
  595. var hasOwn$9 = hasOwnProperty_1;
  596. var FunctionPrototype$1 = Function.prototype;
  597. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  598. var getDescriptor = DESCRIPTORS$a && Object.getOwnPropertyDescriptor;
  599. var EXISTS = hasOwn$9(FunctionPrototype$1, 'name');
  600. // additional protection from minified / mangled / dropped function names
  601. var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
  602. var CONFIGURABLE = EXISTS && (!DESCRIPTORS$a || (DESCRIPTORS$a && getDescriptor(FunctionPrototype$1, 'name').configurable));
  603. var functionName = {
  604. EXISTS: EXISTS,
  605. PROPER: PROPER,
  606. CONFIGURABLE: CONFIGURABLE
  607. };
  608. var uncurryThis$t = functionUncurryThis;
  609. var isCallable$c = isCallable$i;
  610. var store$1 = sharedStoreExports;
  611. var functionToString = uncurryThis$t(Function.toString);
  612. // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
  613. if (!isCallable$c(store$1.inspectSource)) {
  614. store$1.inspectSource = function (it) {
  615. return functionToString(it);
  616. };
  617. }
  618. var inspectSource$2 = store$1.inspectSource;
  619. var global$d = global$k;
  620. var isCallable$b = isCallable$i;
  621. var WeakMap$1 = global$d.WeakMap;
  622. var weakMapBasicDetection = isCallable$b(WeakMap$1) && /native code/.test(String(WeakMap$1));
  623. var shared$2 = shared$4;
  624. var uid = uid$2;
  625. var keys$1 = shared$2('keys');
  626. var sharedKey$3 = function (key) {
  627. return keys$1[key] || (keys$1[key] = uid(key));
  628. };
  629. var hiddenKeys$4 = {};
  630. var NATIVE_WEAK_MAP = weakMapBasicDetection;
  631. var global$c = global$k;
  632. var isObject$7 = isObject$c;
  633. var createNonEnumerableProperty$6 = createNonEnumerableProperty$7;
  634. var hasOwn$8 = hasOwnProperty_1;
  635. var shared$1 = sharedStoreExports;
  636. var sharedKey$2 = sharedKey$3;
  637. var hiddenKeys$3 = hiddenKeys$4;
  638. var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
  639. var TypeError$2 = global$c.TypeError;
  640. var WeakMap = global$c.WeakMap;
  641. var set, get, has;
  642. var enforce = function (it) {
  643. return has(it) ? get(it) : set(it, {});
  644. };
  645. var getterFor = function (TYPE) {
  646. return function (it) {
  647. var state;
  648. if (!isObject$7(it) || (state = get(it)).type !== TYPE) {
  649. throw new TypeError$2('Incompatible receiver, ' + TYPE + ' required');
  650. } return state;
  651. };
  652. };
  653. if (NATIVE_WEAK_MAP || shared$1.state) {
  654. var store = shared$1.state || (shared$1.state = new WeakMap());
  655. /* eslint-disable no-self-assign -- prototype methods protection */
  656. store.get = store.get;
  657. store.has = store.has;
  658. store.set = store.set;
  659. /* eslint-enable no-self-assign -- prototype methods protection */
  660. set = function (it, metadata) {
  661. if (store.has(it)) throw new TypeError$2(OBJECT_ALREADY_INITIALIZED);
  662. metadata.facade = it;
  663. store.set(it, metadata);
  664. return metadata;
  665. };
  666. get = function (it) {
  667. return store.get(it) || {};
  668. };
  669. has = function (it) {
  670. return store.has(it);
  671. };
  672. } else {
  673. var STATE = sharedKey$2('state');
  674. hiddenKeys$3[STATE] = true;
  675. set = function (it, metadata) {
  676. if (hasOwn$8(it, STATE)) throw new TypeError$2(OBJECT_ALREADY_INITIALIZED);
  677. metadata.facade = it;
  678. createNonEnumerableProperty$6(it, STATE, metadata);
  679. return metadata;
  680. };
  681. get = function (it) {
  682. return hasOwn$8(it, STATE) ? it[STATE] : {};
  683. };
  684. has = function (it) {
  685. return hasOwn$8(it, STATE);
  686. };
  687. }
  688. var internalState = {
  689. set: set,
  690. get: get,
  691. has: has,
  692. enforce: enforce,
  693. getterFor: getterFor
  694. };
  695. var uncurryThis$s = functionUncurryThis;
  696. var fails$p = fails$w;
  697. var isCallable$a = isCallable$i;
  698. var hasOwn$7 = hasOwnProperty_1;
  699. var DESCRIPTORS$9 = descriptors;
  700. var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE;
  701. var inspectSource$1 = inspectSource$2;
  702. var InternalStateModule$1 = internalState;
  703. var enforceInternalState$1 = InternalStateModule$1.enforce;
  704. var getInternalState$2 = InternalStateModule$1.get;
  705. var $String$2 = String;
  706. // eslint-disable-next-line es/no-object-defineproperty -- safe
  707. var defineProperty$7 = Object.defineProperty;
  708. var stringSlice$8 = uncurryThis$s(''.slice);
  709. var replace$4 = uncurryThis$s(''.replace);
  710. var join = uncurryThis$s([].join);
  711. var CONFIGURABLE_LENGTH = DESCRIPTORS$9 && !fails$p(function () {
  712. return defineProperty$7(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
  713. });
  714. var TEMPLATE = String(String).split('String');
  715. var makeBuiltIn$2 = makeBuiltIn$3.exports = function (value, name, options) {
  716. if (stringSlice$8($String$2(name), 0, 7) === 'Symbol(') {
  717. name = '[' + replace$4($String$2(name), /^Symbol\(([^)]*)\).*$/, '$1') + ']';
  718. }
  719. if (options && options.getter) name = 'get ' + name;
  720. if (options && options.setter) name = 'set ' + name;
  721. if (!hasOwn$7(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) {
  722. if (DESCRIPTORS$9) defineProperty$7(value, 'name', { value: name, configurable: true });
  723. else value.name = name;
  724. }
  725. if (CONFIGURABLE_LENGTH && options && hasOwn$7(options, 'arity') && value.length !== options.arity) {
  726. defineProperty$7(value, 'length', { value: options.arity });
  727. }
  728. try {
  729. if (options && hasOwn$7(options, 'constructor') && options.constructor) {
  730. if (DESCRIPTORS$9) defineProperty$7(value, 'prototype', { writable: false });
  731. // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
  732. } else if (value.prototype) value.prototype = undefined;
  733. } catch (error) { /* empty */ }
  734. var state = enforceInternalState$1(value);
  735. if (!hasOwn$7(state, 'source')) {
  736. state.source = join(TEMPLATE, typeof name == 'string' ? name : '');
  737. } return value;
  738. };
  739. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  740. // eslint-disable-next-line no-extend-native -- required
  741. Function.prototype.toString = makeBuiltIn$2(function toString() {
  742. return isCallable$a(this) && getInternalState$2(this).source || inspectSource$1(this);
  743. }, 'toString');
  744. var makeBuiltInExports = makeBuiltIn$3.exports;
  745. var isCallable$9 = isCallable$i;
  746. var definePropertyModule$3 = objectDefineProperty;
  747. var makeBuiltIn$1 = makeBuiltInExports;
  748. var defineGlobalProperty$1 = defineGlobalProperty$3;
  749. var defineBuiltIn$7 = function (O, key, value, options) {
  750. if (!options) options = {};
  751. var simple = options.enumerable;
  752. var name = options.name !== undefined ? options.name : key;
  753. if (isCallable$9(value)) makeBuiltIn$1(value, name, options);
  754. if (options.global) {
  755. if (simple) O[key] = value;
  756. else defineGlobalProperty$1(key, value);
  757. } else {
  758. try {
  759. if (!options.unsafe) delete O[key];
  760. else if (O[key]) simple = true;
  761. } catch (error) { /* empty */ }
  762. if (simple) O[key] = value;
  763. else definePropertyModule$3.f(O, key, {
  764. value: value,
  765. enumerable: false,
  766. configurable: !options.nonConfigurable,
  767. writable: !options.nonWritable
  768. });
  769. } return O;
  770. };
  771. var objectGetOwnPropertyNames = {};
  772. var ceil = Math.ceil;
  773. var floor$2 = Math.floor;
  774. // `Math.trunc` method
  775. // https://tc39.es/ecma262/#sec-math.trunc
  776. // eslint-disable-next-line es/no-math-trunc -- safe
  777. var mathTrunc = Math.trunc || function trunc(x) {
  778. var n = +x;
  779. return (n > 0 ? floor$2 : ceil)(n);
  780. };
  781. var trunc = mathTrunc;
  782. // `ToIntegerOrInfinity` abstract operation
  783. // https://tc39.es/ecma262/#sec-tointegerorinfinity
  784. var toIntegerOrInfinity$5 = function (argument) {
  785. var number = +argument;
  786. // eslint-disable-next-line no-self-compare -- NaN check
  787. return number !== number || number === 0 ? 0 : trunc(number);
  788. };
  789. var toIntegerOrInfinity$4 = toIntegerOrInfinity$5;
  790. var max$3 = Math.max;
  791. var min$6 = Math.min;
  792. // Helper for a popular repeating case of the spec:
  793. // Let integer be ? ToInteger(index).
  794. // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
  795. var toAbsoluteIndex$3 = function (index, length) {
  796. var integer = toIntegerOrInfinity$4(index);
  797. return integer < 0 ? max$3(integer + length, 0) : min$6(integer, length);
  798. };
  799. var toIntegerOrInfinity$3 = toIntegerOrInfinity$5;
  800. var min$5 = Math.min;
  801. // `ToLength` abstract operation
  802. // https://tc39.es/ecma262/#sec-tolength
  803. var toLength$6 = function (argument) {
  804. var len = toIntegerOrInfinity$3(argument);
  805. return len > 0 ? min$5(len, 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  806. };
  807. var toLength$5 = toLength$6;
  808. // `LengthOfArrayLike` abstract operation
  809. // https://tc39.es/ecma262/#sec-lengthofarraylike
  810. var lengthOfArrayLike$6 = function (obj) {
  811. return toLength$5(obj.length);
  812. };
  813. var toIndexedObject$6 = toIndexedObject$8;
  814. var toAbsoluteIndex$2 = toAbsoluteIndex$3;
  815. var lengthOfArrayLike$5 = lengthOfArrayLike$6;
  816. // `Array.prototype.{ indexOf, includes }` methods implementation
  817. var createMethod$4 = function (IS_INCLUDES) {
  818. return function ($this, el, fromIndex) {
  819. var O = toIndexedObject$6($this);
  820. var length = lengthOfArrayLike$5(O);
  821. if (length === 0) return !IS_INCLUDES && -1;
  822. var index = toAbsoluteIndex$2(fromIndex, length);
  823. var value;
  824. // Array#includes uses SameValueZero equality algorithm
  825. // eslint-disable-next-line no-self-compare -- NaN check
  826. if (IS_INCLUDES && el !== el) while (length > index) {
  827. value = O[index++];
  828. // eslint-disable-next-line no-self-compare -- NaN check
  829. if (value !== value) return true;
  830. // Array#indexOf ignores holes, Array#includes - not
  831. } else for (;length > index; index++) {
  832. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  833. } return !IS_INCLUDES && -1;
  834. };
  835. };
  836. var arrayIncludes = {
  837. // `Array.prototype.includes` method
  838. // https://tc39.es/ecma262/#sec-array.prototype.includes
  839. includes: createMethod$4(true),
  840. // `Array.prototype.indexOf` method
  841. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  842. indexOf: createMethod$4(false)
  843. };
  844. var uncurryThis$r = functionUncurryThis;
  845. var hasOwn$6 = hasOwnProperty_1;
  846. var toIndexedObject$5 = toIndexedObject$8;
  847. var indexOf$1 = arrayIncludes.indexOf;
  848. var hiddenKeys$2 = hiddenKeys$4;
  849. var push$5 = uncurryThis$r([].push);
  850. var objectKeysInternal = function (object, names) {
  851. var O = toIndexedObject$5(object);
  852. var i = 0;
  853. var result = [];
  854. var key;
  855. for (key in O) !hasOwn$6(hiddenKeys$2, key) && hasOwn$6(O, key) && push$5(result, key);
  856. // Don't enum bug & hidden keys
  857. while (names.length > i) if (hasOwn$6(O, key = names[i++])) {
  858. ~indexOf$1(result, key) || push$5(result, key);
  859. }
  860. return result;
  861. };
  862. // IE8- don't enum bug keys
  863. var enumBugKeys$3 = [
  864. 'constructor',
  865. 'hasOwnProperty',
  866. 'isPrototypeOf',
  867. 'propertyIsEnumerable',
  868. 'toLocaleString',
  869. 'toString',
  870. 'valueOf'
  871. ];
  872. var internalObjectKeys$1 = objectKeysInternal;
  873. var enumBugKeys$2 = enumBugKeys$3;
  874. var hiddenKeys$1 = enumBugKeys$2.concat('length', 'prototype');
  875. // `Object.getOwnPropertyNames` method
  876. // https://tc39.es/ecma262/#sec-object.getownpropertynames
  877. // eslint-disable-next-line es/no-object-getownpropertynames -- safe
  878. objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  879. return internalObjectKeys$1(O, hiddenKeys$1);
  880. };
  881. var objectGetOwnPropertySymbols = {};
  882. // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
  883. objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
  884. var getBuiltIn$3 = getBuiltIn$5;
  885. var uncurryThis$q = functionUncurryThis;
  886. var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
  887. var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
  888. var anObject$b = anObject$d;
  889. var concat$2 = uncurryThis$q([].concat);
  890. // all object keys, includes non-enumerable and symbols
  891. var ownKeys$1 = getBuiltIn$3('Reflect', 'ownKeys') || function ownKeys(it) {
  892. var keys = getOwnPropertyNamesModule.f(anObject$b(it));
  893. var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
  894. return getOwnPropertySymbols ? concat$2(keys, getOwnPropertySymbols(it)) : keys;
  895. };
  896. var hasOwn$5 = hasOwnProperty_1;
  897. var ownKeys = ownKeys$1;
  898. var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
  899. var definePropertyModule$2 = objectDefineProperty;
  900. var copyConstructorProperties$2 = function (target, source, exceptions) {
  901. var keys = ownKeys(source);
  902. var defineProperty = definePropertyModule$2.f;
  903. var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
  904. for (var i = 0; i < keys.length; i++) {
  905. var key = keys[i];
  906. if (!hasOwn$5(target, key) && !(exceptions && hasOwn$5(exceptions, key))) {
  907. defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  908. }
  909. }
  910. };
  911. var fails$o = fails$w;
  912. var isCallable$8 = isCallable$i;
  913. var replacement = /#|\.prototype\./;
  914. var isForced$3 = function (feature, detection) {
  915. var value = data[normalize(feature)];
  916. return value === POLYFILL ? true
  917. : value === NATIVE ? false
  918. : isCallable$8(detection) ? fails$o(detection)
  919. : !!detection;
  920. };
  921. var normalize = isForced$3.normalize = function (string) {
  922. return String(string).replace(replacement, '.').toLowerCase();
  923. };
  924. var data = isForced$3.data = {};
  925. var NATIVE = isForced$3.NATIVE = 'N';
  926. var POLYFILL = isForced$3.POLYFILL = 'P';
  927. var isForced_1 = isForced$3;
  928. var global$b = global$k;
  929. var getOwnPropertyDescriptor$4 = objectGetOwnPropertyDescriptor.f;
  930. var createNonEnumerableProperty$5 = createNonEnumerableProperty$7;
  931. var defineBuiltIn$6 = defineBuiltIn$7;
  932. var defineGlobalProperty = defineGlobalProperty$3;
  933. var copyConstructorProperties$1 = copyConstructorProperties$2;
  934. var isForced$2 = isForced_1;
  935. /*
  936. options.target - name of the target object
  937. options.global - target is the global object
  938. options.stat - export as static methods of target
  939. options.proto - export as prototype methods of target
  940. options.real - real prototype method for the `pure` version
  941. options.forced - export even if the native feature is available
  942. options.bind - bind methods to the target, required for the `pure` version
  943. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  944. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  945. options.sham - add a flag to not completely full polyfills
  946. options.enumerable - export as enumerable property
  947. options.dontCallGetSet - prevent calling a getter on target
  948. options.name - the .name of the function if it does not match the key
  949. */
  950. var _export = function (options, source) {
  951. var TARGET = options.target;
  952. var GLOBAL = options.global;
  953. var STATIC = options.stat;
  954. var FORCED, target, key, targetProperty, sourceProperty, descriptor;
  955. if (GLOBAL) {
  956. target = global$b;
  957. } else if (STATIC) {
  958. target = global$b[TARGET] || defineGlobalProperty(TARGET, {});
  959. } else {
  960. target = global$b[TARGET] && global$b[TARGET].prototype;
  961. }
  962. if (target) for (key in source) {
  963. sourceProperty = source[key];
  964. if (options.dontCallGetSet) {
  965. descriptor = getOwnPropertyDescriptor$4(target, key);
  966. targetProperty = descriptor && descriptor.value;
  967. } else targetProperty = target[key];
  968. FORCED = isForced$2(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  969. // contained in target
  970. if (!FORCED && targetProperty !== undefined) {
  971. if (typeof sourceProperty == typeof targetProperty) continue;
  972. copyConstructorProperties$1(sourceProperty, targetProperty);
  973. }
  974. // add a flag to not completely full polyfills
  975. if (options.sham || (targetProperty && targetProperty.sham)) {
  976. createNonEnumerableProperty$5(sourceProperty, 'sham', true);
  977. }
  978. defineBuiltIn$6(target, key, sourceProperty, options);
  979. }
  980. };
  981. var classof$6 = classofRaw$2;
  982. // `IsArray` abstract operation
  983. // https://tc39.es/ecma262/#sec-isarray
  984. // eslint-disable-next-line es/no-array-isarray -- safe
  985. var isArray$5 = Array.isArray || function isArray(argument) {
  986. return classof$6(argument) === 'Array';
  987. };
  988. var $TypeError$6 = TypeError;
  989. var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991
  990. var doesNotExceedSafeInteger$2 = function (it) {
  991. if (it > MAX_SAFE_INTEGER) throw $TypeError$6('Maximum allowed index exceeded');
  992. return it;
  993. };
  994. var DESCRIPTORS$8 = descriptors;
  995. var definePropertyModule$1 = objectDefineProperty;
  996. var createPropertyDescriptor$1 = createPropertyDescriptor$4;
  997. var createProperty$3 = function (object, key, value) {
  998. if (DESCRIPTORS$8) definePropertyModule$1.f(object, key, createPropertyDescriptor$1(0, value));
  999. else object[key] = value;
  1000. };
  1001. var wellKnownSymbol$h = wellKnownSymbol$j;
  1002. var TO_STRING_TAG$2 = wellKnownSymbol$h('toStringTag');
  1003. var test$2 = {};
  1004. test$2[TO_STRING_TAG$2] = 'z';
  1005. var toStringTagSupport = String(test$2) === '[object z]';
  1006. var TO_STRING_TAG_SUPPORT$2 = toStringTagSupport;
  1007. var isCallable$7 = isCallable$i;
  1008. var classofRaw$1 = classofRaw$2;
  1009. var wellKnownSymbol$g = wellKnownSymbol$j;
  1010. var TO_STRING_TAG$1 = wellKnownSymbol$g('toStringTag');
  1011. var $Object$1 = Object;
  1012. // ES3 wrong here
  1013. var CORRECT_ARGUMENTS = classofRaw$1(function () { return arguments; }()) === 'Arguments';
  1014. // fallback for IE11 Script Access Denied error
  1015. var tryGet = function (it, key) {
  1016. try {
  1017. return it[key];
  1018. } catch (error) { /* empty */ }
  1019. };
  1020. // getting tag from ES6+ `Object.prototype.toString`
  1021. var classof$5 = TO_STRING_TAG_SUPPORT$2 ? classofRaw$1 : function (it) {
  1022. var O, tag, result;
  1023. return it === undefined ? 'Undefined' : it === null ? 'Null'
  1024. // @@toStringTag case
  1025. : typeof (tag = tryGet(O = $Object$1(it), TO_STRING_TAG$1)) == 'string' ? tag
  1026. // builtinTag case
  1027. : CORRECT_ARGUMENTS ? classofRaw$1(O)
  1028. // ES3 arguments fallback
  1029. : (result = classofRaw$1(O)) === 'Object' && isCallable$7(O.callee) ? 'Arguments' : result;
  1030. };
  1031. var uncurryThis$p = functionUncurryThis;
  1032. var fails$n = fails$w;
  1033. var isCallable$6 = isCallable$i;
  1034. var classof$4 = classof$5;
  1035. var getBuiltIn$2 = getBuiltIn$5;
  1036. var inspectSource = inspectSource$2;
  1037. var noop = function () { /* empty */ };
  1038. var construct = getBuiltIn$2('Reflect', 'construct');
  1039. var constructorRegExp = /^\s*(?:class|function)\b/;
  1040. var exec$3 = uncurryThis$p(constructorRegExp.exec);
  1041. var INCORRECT_TO_STRING = !constructorRegExp.test(noop);
  1042. var isConstructorModern = function isConstructor(argument) {
  1043. if (!isCallable$6(argument)) return false;
  1044. try {
  1045. construct(noop, [], argument);
  1046. return true;
  1047. } catch (error) {
  1048. return false;
  1049. }
  1050. };
  1051. var isConstructorLegacy = function isConstructor(argument) {
  1052. if (!isCallable$6(argument)) return false;
  1053. switch (classof$4(argument)) {
  1054. case 'AsyncFunction':
  1055. case 'GeneratorFunction':
  1056. case 'AsyncGeneratorFunction': return false;
  1057. }
  1058. try {
  1059. // we can't check .prototype since constructors produced by .bind haven't it
  1060. // `Function#toString` throws on some built-it function in some legacy engines
  1061. // (for example, `DOMQuad` and similar in FF41-)
  1062. return INCORRECT_TO_STRING || !!exec$3(constructorRegExp, inspectSource(argument));
  1063. } catch (error) {
  1064. return true;
  1065. }
  1066. };
  1067. isConstructorLegacy.sham = true;
  1068. // `IsConstructor` abstract operation
  1069. // https://tc39.es/ecma262/#sec-isconstructor
  1070. var isConstructor$3 = !construct || fails$n(function () {
  1071. var called;
  1072. return isConstructorModern(isConstructorModern.call)
  1073. || !isConstructorModern(Object)
  1074. || !isConstructorModern(function () { called = true; })
  1075. || called;
  1076. }) ? isConstructorLegacy : isConstructorModern;
  1077. var isArray$4 = isArray$5;
  1078. var isConstructor$2 = isConstructor$3;
  1079. var isObject$6 = isObject$c;
  1080. var wellKnownSymbol$f = wellKnownSymbol$j;
  1081. var SPECIES$5 = wellKnownSymbol$f('species');
  1082. var $Array$1 = Array;
  1083. // a part of `ArraySpeciesCreate` abstract operation
  1084. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  1085. var arraySpeciesConstructor$1 = function (originalArray) {
  1086. var C;
  1087. if (isArray$4(originalArray)) {
  1088. C = originalArray.constructor;
  1089. // cross-realm fallback
  1090. if (isConstructor$2(C) && (C === $Array$1 || isArray$4(C.prototype))) C = undefined;
  1091. else if (isObject$6(C)) {
  1092. C = C[SPECIES$5];
  1093. if (C === null) C = undefined;
  1094. }
  1095. } return C === undefined ? $Array$1 : C;
  1096. };
  1097. var arraySpeciesConstructor = arraySpeciesConstructor$1;
  1098. // `ArraySpeciesCreate` abstract operation
  1099. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  1100. var arraySpeciesCreate$3 = function (originalArray, length) {
  1101. return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
  1102. };
  1103. var fails$m = fails$w;
  1104. var wellKnownSymbol$e = wellKnownSymbol$j;
  1105. var V8_VERSION$1 = engineV8Version;
  1106. var SPECIES$4 = wellKnownSymbol$e('species');
  1107. var arrayMethodHasSpeciesSupport$5 = function (METHOD_NAME) {
  1108. // We can't use this feature detection in V8 since it causes
  1109. // deoptimization and serious performance degradation
  1110. // https://github.com/zloirock/core-js/issues/677
  1111. return V8_VERSION$1 >= 51 || !fails$m(function () {
  1112. var array = [];
  1113. var constructor = array.constructor = {};
  1114. constructor[SPECIES$4] = function () {
  1115. return { foo: 1 };
  1116. };
  1117. return array[METHOD_NAME](Boolean).foo !== 1;
  1118. });
  1119. };
  1120. var $$o = _export;
  1121. var fails$l = fails$w;
  1122. var isArray$3 = isArray$5;
  1123. var isObject$5 = isObject$c;
  1124. var toObject$8 = toObject$a;
  1125. var lengthOfArrayLike$4 = lengthOfArrayLike$6;
  1126. var doesNotExceedSafeInteger$1 = doesNotExceedSafeInteger$2;
  1127. var createProperty$2 = createProperty$3;
  1128. var arraySpeciesCreate$2 = arraySpeciesCreate$3;
  1129. var arrayMethodHasSpeciesSupport$4 = arrayMethodHasSpeciesSupport$5;
  1130. var wellKnownSymbol$d = wellKnownSymbol$j;
  1131. var V8_VERSION = engineV8Version;
  1132. var IS_CONCAT_SPREADABLE = wellKnownSymbol$d('isConcatSpreadable');
  1133. // We can't use this feature detection in V8 since it causes
  1134. // deoptimization and serious performance degradation
  1135. // https://github.com/zloirock/core-js/issues/679
  1136. var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails$l(function () {
  1137. var array = [];
  1138. array[IS_CONCAT_SPREADABLE] = false;
  1139. return array.concat()[0] !== array;
  1140. });
  1141. var isConcatSpreadable = function (O) {
  1142. if (!isObject$5(O)) return false;
  1143. var spreadable = O[IS_CONCAT_SPREADABLE];
  1144. return spreadable !== undefined ? !!spreadable : isArray$3(O);
  1145. };
  1146. var FORCED$6 = !IS_CONCAT_SPREADABLE_SUPPORT || !arrayMethodHasSpeciesSupport$4('concat');
  1147. // `Array.prototype.concat` method
  1148. // https://tc39.es/ecma262/#sec-array.prototype.concat
  1149. // with adding support of @@isConcatSpreadable and @@species
  1150. $$o({ target: 'Array', proto: true, arity: 1, forced: FORCED$6 }, {
  1151. // eslint-disable-next-line no-unused-vars -- required for `.length`
  1152. concat: function concat(arg) {
  1153. var O = toObject$8(this);
  1154. var A = arraySpeciesCreate$2(O, 0);
  1155. var n = 0;
  1156. var i, k, length, len, E;
  1157. for (i = -1, length = arguments.length; i < length; i++) {
  1158. E = i === -1 ? O : arguments[i];
  1159. if (isConcatSpreadable(E)) {
  1160. len = lengthOfArrayLike$4(E);
  1161. doesNotExceedSafeInteger$1(n + len);
  1162. for (k = 0; k < len; k++, n++) if (k in E) createProperty$2(A, n, E[k]);
  1163. } else {
  1164. doesNotExceedSafeInteger$1(n + 1);
  1165. createProperty$2(A, n++, E);
  1166. }
  1167. }
  1168. A.length = n;
  1169. return A;
  1170. }
  1171. });
  1172. var classofRaw = classofRaw$2;
  1173. var uncurryThis$o = functionUncurryThis;
  1174. var functionUncurryThisClause = function (fn) {
  1175. // Nashorn bug:
  1176. // https://github.com/zloirock/core-js/issues/1128
  1177. // https://github.com/zloirock/core-js/issues/1130
  1178. if (classofRaw(fn) === 'Function') return uncurryThis$o(fn);
  1179. };
  1180. var uncurryThis$n = functionUncurryThisClause;
  1181. var aCallable$2 = aCallable$4;
  1182. var NATIVE_BIND$1 = functionBindNative;
  1183. var bind$1 = uncurryThis$n(uncurryThis$n.bind);
  1184. // optional / simple context binding
  1185. var functionBindContext = function (fn, that) {
  1186. aCallable$2(fn);
  1187. return that === undefined ? fn : NATIVE_BIND$1 ? bind$1(fn, that) : function (/* ...args */) {
  1188. return fn.apply(that, arguments);
  1189. };
  1190. };
  1191. var bind = functionBindContext;
  1192. var uncurryThis$m = functionUncurryThis;
  1193. var IndexedObject$2 = indexedObject;
  1194. var toObject$7 = toObject$a;
  1195. var lengthOfArrayLike$3 = lengthOfArrayLike$6;
  1196. var arraySpeciesCreate$1 = arraySpeciesCreate$3;
  1197. var push$4 = uncurryThis$m([].push);
  1198. // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
  1199. var createMethod$3 = function (TYPE) {
  1200. var IS_MAP = TYPE === 1;
  1201. var IS_FILTER = TYPE === 2;
  1202. var IS_SOME = TYPE === 3;
  1203. var IS_EVERY = TYPE === 4;
  1204. var IS_FIND_INDEX = TYPE === 6;
  1205. var IS_FILTER_REJECT = TYPE === 7;
  1206. var NO_HOLES = TYPE === 5 || IS_FIND_INDEX;
  1207. return function ($this, callbackfn, that, specificCreate) {
  1208. var O = toObject$7($this);
  1209. var self = IndexedObject$2(O);
  1210. var length = lengthOfArrayLike$3(self);
  1211. var boundFunction = bind(callbackfn, that);
  1212. var index = 0;
  1213. var create = specificCreate || arraySpeciesCreate$1;
  1214. var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;
  1215. var value, result;
  1216. for (;length > index; index++) if (NO_HOLES || index in self) {
  1217. value = self[index];
  1218. result = boundFunction(value, index, O);
  1219. if (TYPE) {
  1220. if (IS_MAP) target[index] = result; // map
  1221. else if (result) switch (TYPE) {
  1222. case 3: return true; // some
  1223. case 5: return value; // find
  1224. case 6: return index; // findIndex
  1225. case 2: push$4(target, value); // filter
  1226. } else switch (TYPE) {
  1227. case 4: return false; // every
  1228. case 7: push$4(target, value); // filterReject
  1229. }
  1230. }
  1231. }
  1232. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
  1233. };
  1234. };
  1235. var arrayIteration = {
  1236. // `Array.prototype.forEach` method
  1237. // https://tc39.es/ecma262/#sec-array.prototype.foreach
  1238. forEach: createMethod$3(0),
  1239. // `Array.prototype.map` method
  1240. // https://tc39.es/ecma262/#sec-array.prototype.map
  1241. map: createMethod$3(1),
  1242. // `Array.prototype.filter` method
  1243. // https://tc39.es/ecma262/#sec-array.prototype.filter
  1244. filter: createMethod$3(2),
  1245. // `Array.prototype.some` method
  1246. // https://tc39.es/ecma262/#sec-array.prototype.some
  1247. some: createMethod$3(3),
  1248. // `Array.prototype.every` method
  1249. // https://tc39.es/ecma262/#sec-array.prototype.every
  1250. every: createMethod$3(4),
  1251. // `Array.prototype.find` method
  1252. // https://tc39.es/ecma262/#sec-array.prototype.find
  1253. find: createMethod$3(5),
  1254. // `Array.prototype.findIndex` method
  1255. // https://tc39.es/ecma262/#sec-array.prototype.findIndex
  1256. findIndex: createMethod$3(6),
  1257. // `Array.prototype.filterReject` method
  1258. // https://github.com/tc39/proposal-array-filtering
  1259. filterReject: createMethod$3(7)
  1260. };
  1261. var $$n = _export;
  1262. var $filter = arrayIteration.filter;
  1263. var arrayMethodHasSpeciesSupport$3 = arrayMethodHasSpeciesSupport$5;
  1264. var HAS_SPECIES_SUPPORT$3 = arrayMethodHasSpeciesSupport$3('filter');
  1265. // `Array.prototype.filter` method
  1266. // https://tc39.es/ecma262/#sec-array.prototype.filter
  1267. // with adding support of @@species
  1268. $$n({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$3 }, {
  1269. filter: function filter(callbackfn /* , thisArg */) {
  1270. return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1271. }
  1272. });
  1273. var objectDefineProperties = {};
  1274. var internalObjectKeys = objectKeysInternal;
  1275. var enumBugKeys$1 = enumBugKeys$3;
  1276. // `Object.keys` method
  1277. // https://tc39.es/ecma262/#sec-object.keys
  1278. // eslint-disable-next-line es/no-object-keys -- safe
  1279. var objectKeys$3 = Object.keys || function keys(O) {
  1280. return internalObjectKeys(O, enumBugKeys$1);
  1281. };
  1282. var DESCRIPTORS$7 = descriptors;
  1283. var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
  1284. var definePropertyModule = objectDefineProperty;
  1285. var anObject$a = anObject$d;
  1286. var toIndexedObject$4 = toIndexedObject$8;
  1287. var objectKeys$2 = objectKeys$3;
  1288. // `Object.defineProperties` method
  1289. // https://tc39.es/ecma262/#sec-object.defineproperties
  1290. // eslint-disable-next-line es/no-object-defineproperties -- safe
  1291. objectDefineProperties.f = DESCRIPTORS$7 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
  1292. anObject$a(O);
  1293. var props = toIndexedObject$4(Properties);
  1294. var keys = objectKeys$2(Properties);
  1295. var length = keys.length;
  1296. var index = 0;
  1297. var key;
  1298. while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);
  1299. return O;
  1300. };
  1301. var getBuiltIn$1 = getBuiltIn$5;
  1302. var html$1 = getBuiltIn$1('document', 'documentElement');
  1303. /* global ActiveXObject -- old IE, WSH */
  1304. var anObject$9 = anObject$d;
  1305. var definePropertiesModule = objectDefineProperties;
  1306. var enumBugKeys = enumBugKeys$3;
  1307. var hiddenKeys = hiddenKeys$4;
  1308. var html = html$1;
  1309. var documentCreateElement$1 = documentCreateElement$2;
  1310. var sharedKey$1 = sharedKey$3;
  1311. var GT = '>';
  1312. var LT = '<';
  1313. var PROTOTYPE = 'prototype';
  1314. var SCRIPT = 'script';
  1315. var IE_PROTO$1 = sharedKey$1('IE_PROTO');
  1316. var EmptyConstructor = function () { /* empty */ };
  1317. var scriptTag = function (content) {
  1318. return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
  1319. };
  1320. // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
  1321. var NullProtoObjectViaActiveX = function (activeXDocument) {
  1322. activeXDocument.write(scriptTag(''));
  1323. activeXDocument.close();
  1324. var temp = activeXDocument.parentWindow.Object;
  1325. activeXDocument = null; // avoid memory leak
  1326. return temp;
  1327. };
  1328. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  1329. var NullProtoObjectViaIFrame = function () {
  1330. // Thrash, waste and sodomy: IE GC bug
  1331. var iframe = documentCreateElement$1('iframe');
  1332. var JS = 'java' + SCRIPT + ':';
  1333. var iframeDocument;
  1334. iframe.style.display = 'none';
  1335. html.appendChild(iframe);
  1336. // https://github.com/zloirock/core-js/issues/475
  1337. iframe.src = String(JS);
  1338. iframeDocument = iframe.contentWindow.document;
  1339. iframeDocument.open();
  1340. iframeDocument.write(scriptTag('document.F=Object'));
  1341. iframeDocument.close();
  1342. return iframeDocument.F;
  1343. };
  1344. // Check for document.domain and active x support
  1345. // No need to use active x approach when document.domain is not set
  1346. // see https://github.com/es-shims/es5-shim/issues/150
  1347. // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
  1348. // avoid IE GC bug
  1349. var activeXDocument;
  1350. var NullProtoObject = function () {
  1351. try {
  1352. activeXDocument = new ActiveXObject('htmlfile');
  1353. } catch (error) { /* ignore */ }
  1354. NullProtoObject = typeof document != 'undefined'
  1355. ? document.domain && activeXDocument
  1356. ? NullProtoObjectViaActiveX(activeXDocument) // old IE
  1357. : NullProtoObjectViaIFrame()
  1358. : NullProtoObjectViaActiveX(activeXDocument); // WSH
  1359. var length = enumBugKeys.length;
  1360. while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
  1361. return NullProtoObject();
  1362. };
  1363. hiddenKeys[IE_PROTO$1] = true;
  1364. // `Object.create` method
  1365. // https://tc39.es/ecma262/#sec-object.create
  1366. // eslint-disable-next-line es/no-object-create -- safe
  1367. var objectCreate = Object.create || function create(O, Properties) {
  1368. var result;
  1369. if (O !== null) {
  1370. EmptyConstructor[PROTOTYPE] = anObject$9(O);
  1371. result = new EmptyConstructor();
  1372. EmptyConstructor[PROTOTYPE] = null;
  1373. // add "__proto__" for Object.getPrototypeOf polyfill
  1374. result[IE_PROTO$1] = O;
  1375. } else result = NullProtoObject();
  1376. return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
  1377. };
  1378. var wellKnownSymbol$c = wellKnownSymbol$j;
  1379. var create$3 = objectCreate;
  1380. var defineProperty$6 = objectDefineProperty.f;
  1381. var UNSCOPABLES = wellKnownSymbol$c('unscopables');
  1382. var ArrayPrototype = Array.prototype;
  1383. // Array.prototype[@@unscopables]
  1384. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  1385. if (ArrayPrototype[UNSCOPABLES] === undefined) {
  1386. defineProperty$6(ArrayPrototype, UNSCOPABLES, {
  1387. configurable: true,
  1388. value: create$3(null)
  1389. });
  1390. }
  1391. // add a key to Array.prototype[@@unscopables]
  1392. var addToUnscopables$4 = function (key) {
  1393. ArrayPrototype[UNSCOPABLES][key] = true;
  1394. };
  1395. var $$m = _export;
  1396. var $find = arrayIteration.find;
  1397. var addToUnscopables$3 = addToUnscopables$4;
  1398. var FIND = 'find';
  1399. var SKIPS_HOLES$1 = true;
  1400. // Shouldn't skip holes
  1401. // eslint-disable-next-line es/no-array-prototype-find -- testing
  1402. if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES$1 = false; });
  1403. // `Array.prototype.find` method
  1404. // https://tc39.es/ecma262/#sec-array.prototype.find
  1405. $$m({ target: 'Array', proto: true, forced: SKIPS_HOLES$1 }, {
  1406. find: function find(callbackfn /* , that = undefined */) {
  1407. return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1408. }
  1409. });
  1410. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  1411. addToUnscopables$3(FIND);
  1412. var $$l = _export;
  1413. var $findIndex = arrayIteration.findIndex;
  1414. var addToUnscopables$2 = addToUnscopables$4;
  1415. var FIND_INDEX = 'findIndex';
  1416. var SKIPS_HOLES = true;
  1417. // Shouldn't skip holes
  1418. // eslint-disable-next-line es/no-array-prototype-findindex -- testing
  1419. if (FIND_INDEX in []) Array(1)[FIND_INDEX](function () { SKIPS_HOLES = false; });
  1420. // `Array.prototype.findIndex` method
  1421. // https://tc39.es/ecma262/#sec-array.prototype.findindex
  1422. $$l({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
  1423. findIndex: function findIndex(callbackfn /* , that = undefined */) {
  1424. return $findIndex(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1425. }
  1426. });
  1427. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  1428. addToUnscopables$2(FIND_INDEX);
  1429. var $$k = _export;
  1430. var $includes = arrayIncludes.includes;
  1431. var fails$k = fails$w;
  1432. var addToUnscopables$1 = addToUnscopables$4;
  1433. // FF99+ bug
  1434. var BROKEN_ON_SPARSE = fails$k(function () {
  1435. // eslint-disable-next-line es/no-array-prototype-includes -- detection
  1436. return !Array(1).includes();
  1437. });
  1438. // `Array.prototype.includes` method
  1439. // https://tc39.es/ecma262/#sec-array.prototype.includes
  1440. $$k({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
  1441. includes: function includes(el /* , fromIndex = 0 */) {
  1442. return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
  1443. }
  1444. });
  1445. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  1446. addToUnscopables$1('includes');
  1447. var fails$j = fails$w;
  1448. var arrayMethodIsStrict$4 = function (METHOD_NAME, argument) {
  1449. var method = [][METHOD_NAME];
  1450. return !!method && fails$j(function () {
  1451. // eslint-disable-next-line no-useless-call -- required for testing
  1452. method.call(null, argument || function () { return 1; }, 1);
  1453. });
  1454. };
  1455. /* eslint-disable es/no-array-prototype-indexof -- required for testing */
  1456. var $$j = _export;
  1457. var uncurryThis$l = functionUncurryThisClause;
  1458. var $indexOf = arrayIncludes.indexOf;
  1459. var arrayMethodIsStrict$3 = arrayMethodIsStrict$4;
  1460. var nativeIndexOf = uncurryThis$l([].indexOf);
  1461. var NEGATIVE_ZERO = !!nativeIndexOf && 1 / nativeIndexOf([1], 1, -0) < 0;
  1462. var FORCED$5 = NEGATIVE_ZERO || !arrayMethodIsStrict$3('indexOf');
  1463. // `Array.prototype.indexOf` method
  1464. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  1465. $$j({ target: 'Array', proto: true, forced: FORCED$5 }, {
  1466. indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
  1467. var fromIndex = arguments.length > 1 ? arguments[1] : undefined;
  1468. return NEGATIVE_ZERO
  1469. // convert -0 to +0
  1470. ? nativeIndexOf(this, searchElement, fromIndex) || 0
  1471. : $indexOf(this, searchElement, fromIndex);
  1472. }
  1473. });
  1474. var iterators = {};
  1475. var fails$i = fails$w;
  1476. var correctPrototypeGetter = !fails$i(function () {
  1477. function F() { /* empty */ }
  1478. F.prototype.constructor = null;
  1479. // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
  1480. return Object.getPrototypeOf(new F()) !== F.prototype;
  1481. });
  1482. var hasOwn$4 = hasOwnProperty_1;
  1483. var isCallable$5 = isCallable$i;
  1484. var toObject$6 = toObject$a;
  1485. var sharedKey = sharedKey$3;
  1486. var CORRECT_PROTOTYPE_GETTER$1 = correctPrototypeGetter;
  1487. var IE_PROTO = sharedKey('IE_PROTO');
  1488. var $Object = Object;
  1489. var ObjectPrototype = $Object.prototype;
  1490. // `Object.getPrototypeOf` method
  1491. // https://tc39.es/ecma262/#sec-object.getprototypeof
  1492. // eslint-disable-next-line es/no-object-getprototypeof -- safe
  1493. var objectGetPrototypeOf$1 = CORRECT_PROTOTYPE_GETTER$1 ? $Object.getPrototypeOf : function (O) {
  1494. var object = toObject$6(O);
  1495. if (hasOwn$4(object, IE_PROTO)) return object[IE_PROTO];
  1496. var constructor = object.constructor;
  1497. if (isCallable$5(constructor) && object instanceof constructor) {
  1498. return constructor.prototype;
  1499. } return object instanceof $Object ? ObjectPrototype : null;
  1500. };
  1501. var fails$h = fails$w;
  1502. var isCallable$4 = isCallable$i;
  1503. var isObject$4 = isObject$c;
  1504. var getPrototypeOf$1 = objectGetPrototypeOf$1;
  1505. var defineBuiltIn$5 = defineBuiltIn$7;
  1506. var wellKnownSymbol$b = wellKnownSymbol$j;
  1507. var ITERATOR$4 = wellKnownSymbol$b('iterator');
  1508. var BUGGY_SAFARI_ITERATORS$1 = false;
  1509. // `%IteratorPrototype%` object
  1510. // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
  1511. var IteratorPrototype$2, PrototypeOfArrayIteratorPrototype, arrayIterator;
  1512. /* eslint-disable es/no-array-prototype-keys -- safe */
  1513. if ([].keys) {
  1514. arrayIterator = [].keys();
  1515. // Safari 8 has buggy iterators w/o `next`
  1516. if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;
  1517. else {
  1518. PrototypeOfArrayIteratorPrototype = getPrototypeOf$1(getPrototypeOf$1(arrayIterator));
  1519. if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$2 = PrototypeOfArrayIteratorPrototype;
  1520. }
  1521. }
  1522. var NEW_ITERATOR_PROTOTYPE = !isObject$4(IteratorPrototype$2) || fails$h(function () {
  1523. var test = {};
  1524. // FF44- legacy iterators case
  1525. return IteratorPrototype$2[ITERATOR$4].call(test) !== test;
  1526. });
  1527. if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
  1528. // `%IteratorPrototype%[@@iterator]()` method
  1529. // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
  1530. if (!isCallable$4(IteratorPrototype$2[ITERATOR$4])) {
  1531. defineBuiltIn$5(IteratorPrototype$2, ITERATOR$4, function () {
  1532. return this;
  1533. });
  1534. }
  1535. var iteratorsCore = {
  1536. IteratorPrototype: IteratorPrototype$2,
  1537. BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
  1538. };
  1539. var defineProperty$5 = objectDefineProperty.f;
  1540. var hasOwn$3 = hasOwnProperty_1;
  1541. var wellKnownSymbol$a = wellKnownSymbol$j;
  1542. var TO_STRING_TAG = wellKnownSymbol$a('toStringTag');
  1543. var setToStringTag$3 = function (target, TAG, STATIC) {
  1544. if (target && !STATIC) target = target.prototype;
  1545. if (target && !hasOwn$3(target, TO_STRING_TAG)) {
  1546. defineProperty$5(target, TO_STRING_TAG, { configurable: true, value: TAG });
  1547. }
  1548. };
  1549. var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
  1550. var create$2 = objectCreate;
  1551. var createPropertyDescriptor = createPropertyDescriptor$4;
  1552. var setToStringTag$2 = setToStringTag$3;
  1553. var Iterators$2 = iterators;
  1554. var returnThis$1 = function () { return this; };
  1555. var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
  1556. var TO_STRING_TAG = NAME + ' Iterator';
  1557. IteratorConstructor.prototype = create$2(IteratorPrototype$1, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
  1558. setToStringTag$2(IteratorConstructor, TO_STRING_TAG, false);
  1559. Iterators$2[TO_STRING_TAG] = returnThis$1;
  1560. return IteratorConstructor;
  1561. };
  1562. var uncurryThis$k = functionUncurryThis;
  1563. var aCallable$1 = aCallable$4;
  1564. var functionUncurryThisAccessor = function (object, key, method) {
  1565. try {
  1566. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  1567. return uncurryThis$k(aCallable$1(Object.getOwnPropertyDescriptor(object, key)[method]));
  1568. } catch (error) { /* empty */ }
  1569. };
  1570. var isObject$3 = isObject$c;
  1571. var isPossiblePrototype$1 = function (argument) {
  1572. return isObject$3(argument) || argument === null;
  1573. };
  1574. var isPossiblePrototype = isPossiblePrototype$1;
  1575. var $String$1 = String;
  1576. var $TypeError$5 = TypeError;
  1577. var aPossiblePrototype$1 = function (argument) {
  1578. if (isPossiblePrototype(argument)) return argument;
  1579. throw new $TypeError$5("Can't set " + $String$1(argument) + ' as a prototype');
  1580. };
  1581. /* eslint-disable no-proto -- safe */
  1582. var uncurryThisAccessor = functionUncurryThisAccessor;
  1583. var anObject$8 = anObject$d;
  1584. var aPossiblePrototype = aPossiblePrototype$1;
  1585. // `Object.setPrototypeOf` method
  1586. // https://tc39.es/ecma262/#sec-object.setprototypeof
  1587. // Works with __proto__ only. Old v8 can't work with null proto objects.
  1588. // eslint-disable-next-line es/no-object-setprototypeof -- safe
  1589. var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
  1590. var CORRECT_SETTER = false;
  1591. var test = {};
  1592. var setter;
  1593. try {
  1594. setter = uncurryThisAccessor(Object.prototype, '__proto__', 'set');
  1595. setter(test, []);
  1596. CORRECT_SETTER = test instanceof Array;
  1597. } catch (error) { /* empty */ }
  1598. return function setPrototypeOf(O, proto) {
  1599. anObject$8(O);
  1600. aPossiblePrototype(proto);
  1601. if (CORRECT_SETTER) setter(O, proto);
  1602. else O.__proto__ = proto;
  1603. return O;
  1604. };
  1605. }() : undefined);
  1606. var $$i = _export;
  1607. var call$a = functionCall;
  1608. var FunctionName = functionName;
  1609. var isCallable$3 = isCallable$i;
  1610. var createIteratorConstructor = iteratorCreateConstructor;
  1611. var getPrototypeOf = objectGetPrototypeOf$1;
  1612. var setPrototypeOf$1 = objectSetPrototypeOf;
  1613. var setToStringTag$1 = setToStringTag$3;
  1614. var createNonEnumerableProperty$4 = createNonEnumerableProperty$7;
  1615. var defineBuiltIn$4 = defineBuiltIn$7;
  1616. var wellKnownSymbol$9 = wellKnownSymbol$j;
  1617. var Iterators$1 = iterators;
  1618. var IteratorsCore = iteratorsCore;
  1619. var PROPER_FUNCTION_NAME$2 = FunctionName.PROPER;
  1620. var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
  1621. var IteratorPrototype = IteratorsCore.IteratorPrototype;
  1622. var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
  1623. var ITERATOR$3 = wellKnownSymbol$9('iterator');
  1624. var KEYS = 'keys';
  1625. var VALUES = 'values';
  1626. var ENTRIES = 'entries';
  1627. var returnThis = function () { return this; };
  1628. var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
  1629. createIteratorConstructor(IteratorConstructor, NAME, next);
  1630. var getIterationMethod = function (KIND) {
  1631. if (KIND === DEFAULT && defaultIterator) return defaultIterator;
  1632. if (!BUGGY_SAFARI_ITERATORS && KIND && KIND in IterablePrototype) return IterablePrototype[KIND];
  1633. switch (KIND) {
  1634. case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
  1635. case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
  1636. case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
  1637. }
  1638. return function () { return new IteratorConstructor(this); };
  1639. };
  1640. var TO_STRING_TAG = NAME + ' Iterator';
  1641. var INCORRECT_VALUES_NAME = false;
  1642. var IterablePrototype = Iterable.prototype;
  1643. var nativeIterator = IterablePrototype[ITERATOR$3]
  1644. || IterablePrototype['@@iterator']
  1645. || DEFAULT && IterablePrototype[DEFAULT];
  1646. var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
  1647. var anyNativeIterator = NAME === 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
  1648. var CurrentIteratorPrototype, methods, KEY;
  1649. // fix native
  1650. if (anyNativeIterator) {
  1651. CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
  1652. if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
  1653. if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
  1654. if (setPrototypeOf$1) {
  1655. setPrototypeOf$1(CurrentIteratorPrototype, IteratorPrototype);
  1656. } else if (!isCallable$3(CurrentIteratorPrototype[ITERATOR$3])) {
  1657. defineBuiltIn$4(CurrentIteratorPrototype, ITERATOR$3, returnThis);
  1658. }
  1659. }
  1660. // Set @@toStringTag to native iterators
  1661. setToStringTag$1(CurrentIteratorPrototype, TO_STRING_TAG, true);
  1662. }
  1663. }
  1664. // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
  1665. if (PROPER_FUNCTION_NAME$2 && DEFAULT === VALUES && nativeIterator && nativeIterator.name !== VALUES) {
  1666. if (CONFIGURABLE_FUNCTION_NAME) {
  1667. createNonEnumerableProperty$4(IterablePrototype, 'name', VALUES);
  1668. } else {
  1669. INCORRECT_VALUES_NAME = true;
  1670. defaultIterator = function values() { return call$a(nativeIterator, this); };
  1671. }
  1672. }
  1673. // export additional methods
  1674. if (DEFAULT) {
  1675. methods = {
  1676. values: getIterationMethod(VALUES),
  1677. keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
  1678. entries: getIterationMethod(ENTRIES)
  1679. };
  1680. if (FORCED) for (KEY in methods) {
  1681. if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
  1682. defineBuiltIn$4(IterablePrototype, KEY, methods[KEY]);
  1683. }
  1684. } else $$i({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
  1685. }
  1686. // define iterator
  1687. if (IterablePrototype[ITERATOR$3] !== defaultIterator) {
  1688. defineBuiltIn$4(IterablePrototype, ITERATOR$3, defaultIterator, { name: DEFAULT });
  1689. }
  1690. Iterators$1[NAME] = defaultIterator;
  1691. return methods;
  1692. };
  1693. // `CreateIterResultObject` abstract operation
  1694. // https://tc39.es/ecma262/#sec-createiterresultobject
  1695. var createIterResultObject$1 = function (value, done) {
  1696. return { value: value, done: done };
  1697. };
  1698. var toIndexedObject$3 = toIndexedObject$8;
  1699. var addToUnscopables = addToUnscopables$4;
  1700. var Iterators = iterators;
  1701. var InternalStateModule = internalState;
  1702. var defineProperty$4 = objectDefineProperty.f;
  1703. var defineIterator = iteratorDefine;
  1704. var createIterResultObject = createIterResultObject$1;
  1705. var DESCRIPTORS$6 = descriptors;
  1706. var ARRAY_ITERATOR = 'Array Iterator';
  1707. var setInternalState = InternalStateModule.set;
  1708. var getInternalState$1 = InternalStateModule.getterFor(ARRAY_ITERATOR);
  1709. // `Array.prototype.entries` method
  1710. // https://tc39.es/ecma262/#sec-array.prototype.entries
  1711. // `Array.prototype.keys` method
  1712. // https://tc39.es/ecma262/#sec-array.prototype.keys
  1713. // `Array.prototype.values` method
  1714. // https://tc39.es/ecma262/#sec-array.prototype.values
  1715. // `Array.prototype[@@iterator]` method
  1716. // https://tc39.es/ecma262/#sec-array.prototype-@@iterator
  1717. // `CreateArrayIterator` internal method
  1718. // https://tc39.es/ecma262/#sec-createarrayiterator
  1719. var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
  1720. setInternalState(this, {
  1721. type: ARRAY_ITERATOR,
  1722. target: toIndexedObject$3(iterated), // target
  1723. index: 0, // next index
  1724. kind: kind // kind
  1725. });
  1726. // `%ArrayIteratorPrototype%.next` method
  1727. // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
  1728. }, function () {
  1729. var state = getInternalState$1(this);
  1730. var target = state.target;
  1731. var index = state.index++;
  1732. if (!target || index >= target.length) {
  1733. state.target = undefined;
  1734. return createIterResultObject(undefined, true);
  1735. }
  1736. switch (state.kind) {
  1737. case 'keys': return createIterResultObject(index, false);
  1738. case 'values': return createIterResultObject(target[index], false);
  1739. } return createIterResultObject([index, target[index]], false);
  1740. }, 'values');
  1741. // argumentsList[@@iterator] is %ArrayProto_values%
  1742. // https://tc39.es/ecma262/#sec-createunmappedargumentsobject
  1743. // https://tc39.es/ecma262/#sec-createmappedargumentsobject
  1744. var values = Iterators.Arguments = Iterators.Array;
  1745. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  1746. addToUnscopables('keys');
  1747. addToUnscopables('values');
  1748. addToUnscopables('entries');
  1749. // V8 ~ Chrome 45- bug
  1750. if (DESCRIPTORS$6 && values.name !== 'values') try {
  1751. defineProperty$4(values, 'name', { value: 'values' });
  1752. } catch (error) { /* empty */ }
  1753. var $$h = _export;
  1754. var uncurryThis$j = functionUncurryThis;
  1755. var IndexedObject$1 = indexedObject;
  1756. var toIndexedObject$2 = toIndexedObject$8;
  1757. var arrayMethodIsStrict$2 = arrayMethodIsStrict$4;
  1758. var nativeJoin = uncurryThis$j([].join);
  1759. var ES3_STRINGS = IndexedObject$1 !== Object;
  1760. var FORCED$4 = ES3_STRINGS || !arrayMethodIsStrict$2('join', ',');
  1761. // `Array.prototype.join` method
  1762. // https://tc39.es/ecma262/#sec-array.prototype.join
  1763. $$h({ target: 'Array', proto: true, forced: FORCED$4 }, {
  1764. join: function join(separator) {
  1765. return nativeJoin(toIndexedObject$2(this), separator === undefined ? ',' : separator);
  1766. }
  1767. });
  1768. var $$g = _export;
  1769. var $map = arrayIteration.map;
  1770. var arrayMethodHasSpeciesSupport$2 = arrayMethodHasSpeciesSupport$5;
  1771. var HAS_SPECIES_SUPPORT$2 = arrayMethodHasSpeciesSupport$2('map');
  1772. // `Array.prototype.map` method
  1773. // https://tc39.es/ecma262/#sec-array.prototype.map
  1774. // with adding support of @@species
  1775. $$g({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$2 }, {
  1776. map: function map(callbackfn /* , thisArg */) {
  1777. return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  1778. }
  1779. });
  1780. var $$f = _export;
  1781. var uncurryThis$i = functionUncurryThis;
  1782. var isArray$2 = isArray$5;
  1783. var nativeReverse = uncurryThis$i([].reverse);
  1784. var test$1 = [1, 2];
  1785. // `Array.prototype.reverse` method
  1786. // https://tc39.es/ecma262/#sec-array.prototype.reverse
  1787. // fix for Safari 12.0 bug
  1788. // https://bugs.webkit.org/show_bug.cgi?id=188794
  1789. $$f({ target: 'Array', proto: true, forced: String(test$1) === String(test$1.reverse()) }, {
  1790. reverse: function reverse() {
  1791. // eslint-disable-next-line no-self-assign -- dirty hack
  1792. if (isArray$2(this)) this.length = this.length;
  1793. return nativeReverse(this);
  1794. }
  1795. });
  1796. var uncurryThis$h = functionUncurryThis;
  1797. var arraySlice$1 = uncurryThis$h([].slice);
  1798. var $$e = _export;
  1799. var isArray$1 = isArray$5;
  1800. var isConstructor$1 = isConstructor$3;
  1801. var isObject$2 = isObject$c;
  1802. var toAbsoluteIndex$1 = toAbsoluteIndex$3;
  1803. var lengthOfArrayLike$2 = lengthOfArrayLike$6;
  1804. var toIndexedObject$1 = toIndexedObject$8;
  1805. var createProperty$1 = createProperty$3;
  1806. var wellKnownSymbol$8 = wellKnownSymbol$j;
  1807. var arrayMethodHasSpeciesSupport$1 = arrayMethodHasSpeciesSupport$5;
  1808. var nativeSlice = arraySlice$1;
  1809. var HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport$1('slice');
  1810. var SPECIES$3 = wellKnownSymbol$8('species');
  1811. var $Array = Array;
  1812. var max$2 = Math.max;
  1813. // `Array.prototype.slice` method
  1814. // https://tc39.es/ecma262/#sec-array.prototype.slice
  1815. // fallback for not array-like ES3 strings and DOM objects
  1816. $$e({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 }, {
  1817. slice: function slice(start, end) {
  1818. var O = toIndexedObject$1(this);
  1819. var length = lengthOfArrayLike$2(O);
  1820. var k = toAbsoluteIndex$1(start, length);
  1821. var fin = toAbsoluteIndex$1(end === undefined ? length : end, length);
  1822. // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
  1823. var Constructor, result, n;
  1824. if (isArray$1(O)) {
  1825. Constructor = O.constructor;
  1826. // cross-realm fallback
  1827. if (isConstructor$1(Constructor) && (Constructor === $Array || isArray$1(Constructor.prototype))) {
  1828. Constructor = undefined;
  1829. } else if (isObject$2(Constructor)) {
  1830. Constructor = Constructor[SPECIES$3];
  1831. if (Constructor === null) Constructor = undefined;
  1832. }
  1833. if (Constructor === $Array || Constructor === undefined) {
  1834. return nativeSlice(O, k, fin);
  1835. }
  1836. }
  1837. result = new (Constructor === undefined ? $Array : Constructor)(max$2(fin - k, 0));
  1838. for (n = 0; k < fin; k++, n++) if (k in O) createProperty$1(result, n, O[k]);
  1839. result.length = n;
  1840. return result;
  1841. }
  1842. });
  1843. var tryToString$1 = tryToString$3;
  1844. var $TypeError$4 = TypeError;
  1845. var deletePropertyOrThrow$2 = function (O, P) {
  1846. if (!delete O[P]) throw new $TypeError$4('Cannot delete property ' + tryToString$1(P) + ' of ' + tryToString$1(O));
  1847. };
  1848. var classof$3 = classof$5;
  1849. var $String = String;
  1850. var toString$f = function (argument) {
  1851. if (classof$3(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string');
  1852. return $String(argument);
  1853. };
  1854. var arraySlice = arraySlice$1;
  1855. var floor$1 = Math.floor;
  1856. var sort = function (array, comparefn) {
  1857. var length = array.length;
  1858. if (length < 8) {
  1859. // insertion sort
  1860. var i = 1;
  1861. var element, j;
  1862. while (i < length) {
  1863. j = i;
  1864. element = array[i];
  1865. while (j && comparefn(array[j - 1], element) > 0) {
  1866. array[j] = array[--j];
  1867. }
  1868. if (j !== i++) array[j] = element;
  1869. }
  1870. } else {
  1871. // merge sort
  1872. var middle = floor$1(length / 2);
  1873. var left = sort(arraySlice(array, 0, middle), comparefn);
  1874. var right = sort(arraySlice(array, middle), comparefn);
  1875. var llength = left.length;
  1876. var rlength = right.length;
  1877. var lindex = 0;
  1878. var rindex = 0;
  1879. while (lindex < llength || rindex < rlength) {
  1880. array[lindex + rindex] = (lindex < llength && rindex < rlength)
  1881. ? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++]
  1882. : lindex < llength ? left[lindex++] : right[rindex++];
  1883. }
  1884. }
  1885. return array;
  1886. };
  1887. var arraySort = sort;
  1888. var userAgent$1 = engineUserAgent;
  1889. var firefox = userAgent$1.match(/firefox\/(\d+)/i);
  1890. var engineFfVersion = !!firefox && +firefox[1];
  1891. var UA = engineUserAgent;
  1892. var engineIsIeOrEdge = /MSIE|Trident/.test(UA);
  1893. var userAgent = engineUserAgent;
  1894. var webkit = userAgent.match(/AppleWebKit\/(\d+)\./);
  1895. var engineWebkitVersion = !!webkit && +webkit[1];
  1896. var $$d = _export;
  1897. var uncurryThis$g = functionUncurryThis;
  1898. var aCallable = aCallable$4;
  1899. var toObject$5 = toObject$a;
  1900. var lengthOfArrayLike$1 = lengthOfArrayLike$6;
  1901. var deletePropertyOrThrow$1 = deletePropertyOrThrow$2;
  1902. var toString$e = toString$f;
  1903. var fails$g = fails$w;
  1904. var internalSort = arraySort;
  1905. var arrayMethodIsStrict$1 = arrayMethodIsStrict$4;
  1906. var FF = engineFfVersion;
  1907. var IE_OR_EDGE = engineIsIeOrEdge;
  1908. var V8 = engineV8Version;
  1909. var WEBKIT = engineWebkitVersion;
  1910. var test = [];
  1911. var nativeSort = uncurryThis$g(test.sort);
  1912. var push$3 = uncurryThis$g(test.push);
  1913. // IE8-
  1914. var FAILS_ON_UNDEFINED = fails$g(function () {
  1915. test.sort(undefined);
  1916. });
  1917. // V8 bug
  1918. var FAILS_ON_NULL = fails$g(function () {
  1919. test.sort(null);
  1920. });
  1921. // Old WebKit
  1922. var STRICT_METHOD$1 = arrayMethodIsStrict$1('sort');
  1923. var STABLE_SORT = !fails$g(function () {
  1924. // feature detection can be too slow, so check engines versions
  1925. if (V8) return V8 < 70;
  1926. if (FF && FF > 3) return;
  1927. if (IE_OR_EDGE) return true;
  1928. if (WEBKIT) return WEBKIT < 603;
  1929. var result = '';
  1930. var code, chr, value, index;
  1931. // generate an array with more 512 elements (Chakra and old V8 fails only in this case)
  1932. for (code = 65; code < 76; code++) {
  1933. chr = String.fromCharCode(code);
  1934. switch (code) {
  1935. case 66: case 69: case 70: case 72: value = 3; break;
  1936. case 68: case 71: value = 4; break;
  1937. default: value = 2;
  1938. }
  1939. for (index = 0; index < 47; index++) {
  1940. test.push({ k: chr + index, v: value });
  1941. }
  1942. }
  1943. test.sort(function (a, b) { return b.v - a.v; });
  1944. for (index = 0; index < test.length; index++) {
  1945. chr = test[index].k.charAt(0);
  1946. if (result.charAt(result.length - 1) !== chr) result += chr;
  1947. }
  1948. return result !== 'DGBEFHACIJK';
  1949. });
  1950. var FORCED$3 = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD$1 || !STABLE_SORT;
  1951. var getSortCompare = function (comparefn) {
  1952. return function (x, y) {
  1953. if (y === undefined) return -1;
  1954. if (x === undefined) return 1;
  1955. if (comparefn !== undefined) return +comparefn(x, y) || 0;
  1956. return toString$e(x) > toString$e(y) ? 1 : -1;
  1957. };
  1958. };
  1959. // `Array.prototype.sort` method
  1960. // https://tc39.es/ecma262/#sec-array.prototype.sort
  1961. $$d({ target: 'Array', proto: true, forced: FORCED$3 }, {
  1962. sort: function sort(comparefn) {
  1963. if (comparefn !== undefined) aCallable(comparefn);
  1964. var array = toObject$5(this);
  1965. if (STABLE_SORT) return comparefn === undefined ? nativeSort(array) : nativeSort(array, comparefn);
  1966. var items = [];
  1967. var arrayLength = lengthOfArrayLike$1(array);
  1968. var itemsLength, index;
  1969. for (index = 0; index < arrayLength; index++) {
  1970. if (index in array) push$3(items, array[index]);
  1971. }
  1972. internalSort(items, getSortCompare(comparefn));
  1973. itemsLength = lengthOfArrayLike$1(items);
  1974. index = 0;
  1975. while (index < itemsLength) array[index] = items[index++];
  1976. while (index < arrayLength) deletePropertyOrThrow$1(array, index++);
  1977. return array;
  1978. }
  1979. });
  1980. var DESCRIPTORS$5 = descriptors;
  1981. var isArray = isArray$5;
  1982. var $TypeError$3 = TypeError;
  1983. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  1984. var getOwnPropertyDescriptor$3 = Object.getOwnPropertyDescriptor;
  1985. // Safari < 13 does not throw an error in this case
  1986. var SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS$5 && !function () {
  1987. // makes no sense without proper strict mode support
  1988. if (this !== undefined) return true;
  1989. try {
  1990. // eslint-disable-next-line es/no-object-defineproperty -- safe
  1991. Object.defineProperty([], 'length', { writable: false }).length = 1;
  1992. } catch (error) {
  1993. return error instanceof TypeError;
  1994. }
  1995. }();
  1996. var arraySetLength = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function (O, length) {
  1997. if (isArray(O) && !getOwnPropertyDescriptor$3(O, 'length').writable) {
  1998. throw new $TypeError$3('Cannot set read only .length');
  1999. } return O.length = length;
  2000. } : function (O, length) {
  2001. return O.length = length;
  2002. };
  2003. var $$c = _export;
  2004. var toObject$4 = toObject$a;
  2005. var toAbsoluteIndex = toAbsoluteIndex$3;
  2006. var toIntegerOrInfinity$2 = toIntegerOrInfinity$5;
  2007. var lengthOfArrayLike = lengthOfArrayLike$6;
  2008. var setArrayLength = arraySetLength;
  2009. var doesNotExceedSafeInteger = doesNotExceedSafeInteger$2;
  2010. var arraySpeciesCreate = arraySpeciesCreate$3;
  2011. var createProperty = createProperty$3;
  2012. var deletePropertyOrThrow = deletePropertyOrThrow$2;
  2013. var arrayMethodHasSpeciesSupport = arrayMethodHasSpeciesSupport$5;
  2014. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice');
  2015. var max$1 = Math.max;
  2016. var min$4 = Math.min;
  2017. // `Array.prototype.splice` method
  2018. // https://tc39.es/ecma262/#sec-array.prototype.splice
  2019. // with adding support of @@species
  2020. $$c({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
  2021. splice: function splice(start, deleteCount /* , ...items */) {
  2022. var O = toObject$4(this);
  2023. var len = lengthOfArrayLike(O);
  2024. var actualStart = toAbsoluteIndex(start, len);
  2025. var argumentsLength = arguments.length;
  2026. var insertCount, actualDeleteCount, A, k, from, to;
  2027. if (argumentsLength === 0) {
  2028. insertCount = actualDeleteCount = 0;
  2029. } else if (argumentsLength === 1) {
  2030. insertCount = 0;
  2031. actualDeleteCount = len - actualStart;
  2032. } else {
  2033. insertCount = argumentsLength - 2;
  2034. actualDeleteCount = min$4(max$1(toIntegerOrInfinity$2(deleteCount), 0), len - actualStart);
  2035. }
  2036. doesNotExceedSafeInteger(len + insertCount - actualDeleteCount);
  2037. A = arraySpeciesCreate(O, actualDeleteCount);
  2038. for (k = 0; k < actualDeleteCount; k++) {
  2039. from = actualStart + k;
  2040. if (from in O) createProperty(A, k, O[from]);
  2041. }
  2042. A.length = actualDeleteCount;
  2043. if (insertCount < actualDeleteCount) {
  2044. for (k = actualStart; k < len - actualDeleteCount; k++) {
  2045. from = k + actualDeleteCount;
  2046. to = k + insertCount;
  2047. if (from in O) O[to] = O[from];
  2048. else deletePropertyOrThrow(O, to);
  2049. }
  2050. for (k = len; k > len - actualDeleteCount + insertCount; k--) deletePropertyOrThrow(O, k - 1);
  2051. } else if (insertCount > actualDeleteCount) {
  2052. for (k = len - actualDeleteCount; k > actualStart; k--) {
  2053. from = k + actualDeleteCount - 1;
  2054. to = k + insertCount - 1;
  2055. if (from in O) O[to] = O[from];
  2056. else deletePropertyOrThrow(O, to);
  2057. }
  2058. }
  2059. for (k = 0; k < insertCount; k++) {
  2060. O[k + actualStart] = arguments[k + 2];
  2061. }
  2062. setArrayLength(O, len - actualDeleteCount + insertCount);
  2063. return A;
  2064. }
  2065. });
  2066. var global$a = global$k;
  2067. var path$1 = global$a;
  2068. var isCallable$2 = isCallable$i;
  2069. var isObject$1 = isObject$c;
  2070. var setPrototypeOf = objectSetPrototypeOf;
  2071. // makes subclassing work correct for wrapped built-ins
  2072. var inheritIfRequired$2 = function ($this, dummy, Wrapper) {
  2073. var NewTarget, NewTargetPrototype;
  2074. if (
  2075. // it can work only with native `setPrototypeOf`
  2076. setPrototypeOf &&
  2077. // we haven't completely correct pre-ES6 way for getting `new.target`, so use this
  2078. isCallable$2(NewTarget = dummy.constructor) &&
  2079. NewTarget !== Wrapper &&
  2080. isObject$1(NewTargetPrototype = NewTarget.prototype) &&
  2081. NewTargetPrototype !== Wrapper.prototype
  2082. ) setPrototypeOf($this, NewTargetPrototype);
  2083. return $this;
  2084. };
  2085. var uncurryThis$f = functionUncurryThis;
  2086. // `thisNumberValue` abstract operation
  2087. // https://tc39.es/ecma262/#sec-thisnumbervalue
  2088. var thisNumberValue$1 = uncurryThis$f(1.0.valueOf);
  2089. // a string of all valid unicode whitespaces
  2090. var whitespaces$4 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
  2091. '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
  2092. var uncurryThis$e = functionUncurryThis;
  2093. var requireObjectCoercible$8 = requireObjectCoercible$b;
  2094. var toString$d = toString$f;
  2095. var whitespaces$3 = whitespaces$4;
  2096. var replace$3 = uncurryThis$e(''.replace);
  2097. var ltrim = RegExp('^[' + whitespaces$3 + ']+');
  2098. var rtrim = RegExp('(^|[^' + whitespaces$3 + '])[' + whitespaces$3 + ']+$');
  2099. // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
  2100. var createMethod$2 = function (TYPE) {
  2101. return function ($this) {
  2102. var string = toString$d(requireObjectCoercible$8($this));
  2103. if (TYPE & 1) string = replace$3(string, ltrim, '');
  2104. if (TYPE & 2) string = replace$3(string, rtrim, '$1');
  2105. return string;
  2106. };
  2107. };
  2108. var stringTrim = {
  2109. // `String.prototype.{ trimLeft, trimStart }` methods
  2110. // https://tc39.es/ecma262/#sec-string.prototype.trimstart
  2111. start: createMethod$2(1),
  2112. // `String.prototype.{ trimRight, trimEnd }` methods
  2113. // https://tc39.es/ecma262/#sec-string.prototype.trimend
  2114. end: createMethod$2(2),
  2115. // `String.prototype.trim` method
  2116. // https://tc39.es/ecma262/#sec-string.prototype.trim
  2117. trim: createMethod$2(3)
  2118. };
  2119. var $$b = _export;
  2120. var IS_PURE = isPure;
  2121. var DESCRIPTORS$4 = descriptors;
  2122. var global$9 = global$k;
  2123. var path = path$1;
  2124. var uncurryThis$d = functionUncurryThis;
  2125. var isForced$1 = isForced_1;
  2126. var hasOwn$2 = hasOwnProperty_1;
  2127. var inheritIfRequired$1 = inheritIfRequired$2;
  2128. var isPrototypeOf$2 = objectIsPrototypeOf;
  2129. var isSymbol = isSymbol$3;
  2130. var toPrimitive = toPrimitive$2;
  2131. var fails$f = fails$w;
  2132. var getOwnPropertyNames$1 = objectGetOwnPropertyNames.f;
  2133. var getOwnPropertyDescriptor$2 = objectGetOwnPropertyDescriptor.f;
  2134. var defineProperty$3 = objectDefineProperty.f;
  2135. var thisNumberValue = thisNumberValue$1;
  2136. var trim$2 = stringTrim.trim;
  2137. var NUMBER = 'Number';
  2138. var NativeNumber = global$9[NUMBER];
  2139. path[NUMBER];
  2140. var NumberPrototype = NativeNumber.prototype;
  2141. var TypeError$1 = global$9.TypeError;
  2142. var stringSlice$7 = uncurryThis$d(''.slice);
  2143. var charCodeAt$1 = uncurryThis$d(''.charCodeAt);
  2144. // `ToNumeric` abstract operation
  2145. // https://tc39.es/ecma262/#sec-tonumeric
  2146. var toNumeric = function (value) {
  2147. var primValue = toPrimitive(value, 'number');
  2148. return typeof primValue == 'bigint' ? primValue : toNumber(primValue);
  2149. };
  2150. // `ToNumber` abstract operation
  2151. // https://tc39.es/ecma262/#sec-tonumber
  2152. var toNumber = function (argument) {
  2153. var it = toPrimitive(argument, 'number');
  2154. var first, third, radix, maxCode, digits, length, index, code;
  2155. if (isSymbol(it)) throw new TypeError$1('Cannot convert a Symbol value to a number');
  2156. if (typeof it == 'string' && it.length > 2) {
  2157. it = trim$2(it);
  2158. first = charCodeAt$1(it, 0);
  2159. if (first === 43 || first === 45) {
  2160. third = charCodeAt$1(it, 2);
  2161. if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix
  2162. } else if (first === 48) {
  2163. switch (charCodeAt$1(it, 1)) {
  2164. // fast equal of /^0b[01]+$/i
  2165. case 66:
  2166. case 98:
  2167. radix = 2;
  2168. maxCode = 49;
  2169. break;
  2170. // fast equal of /^0o[0-7]+$/i
  2171. case 79:
  2172. case 111:
  2173. radix = 8;
  2174. maxCode = 55;
  2175. break;
  2176. default:
  2177. return +it;
  2178. }
  2179. digits = stringSlice$7(it, 2);
  2180. length = digits.length;
  2181. for (index = 0; index < length; index++) {
  2182. code = charCodeAt$1(digits, index);
  2183. // parseInt parses a string to a first unavailable symbol
  2184. // but ToNumber should return NaN if a string contains unavailable symbols
  2185. if (code < 48 || code > maxCode) return NaN;
  2186. } return parseInt(digits, radix);
  2187. }
  2188. } return +it;
  2189. };
  2190. var FORCED$2 = isForced$1(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumber('+0x1'));
  2191. var calledWithNew = function (dummy) {
  2192. // includes check on 1..constructor(foo) case
  2193. return isPrototypeOf$2(NumberPrototype, dummy) && fails$f(function () { thisNumberValue(dummy); });
  2194. };
  2195. // `Number` constructor
  2196. // https://tc39.es/ecma262/#sec-number-constructor
  2197. var NumberWrapper = function Number(value) {
  2198. var n = arguments.length < 1 ? 0 : NativeNumber(toNumeric(value));
  2199. return calledWithNew(this) ? inheritIfRequired$1(Object(n), this, NumberWrapper) : n;
  2200. };
  2201. NumberWrapper.prototype = NumberPrototype;
  2202. if (FORCED$2 && !IS_PURE) NumberPrototype.constructor = NumberWrapper;
  2203. $$b({ global: true, constructor: true, wrap: true, forced: FORCED$2 }, {
  2204. Number: NumberWrapper
  2205. });
  2206. // Use `internal/copy-constructor-properties` helper in `core-js@4`
  2207. var copyConstructorProperties = function (target, source) {
  2208. for (var keys = DESCRIPTORS$4 ? getOwnPropertyNames$1(source) : (
  2209. // ES3:
  2210. 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +
  2211. // ES2015 (in case, if modules with ES2015 Number statics required before):
  2212. 'EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,' +
  2213. // ESNext
  2214. 'fromString,range'
  2215. ).split(','), j = 0, key; keys.length > j; j++) {
  2216. if (hasOwn$2(source, key = keys[j]) && !hasOwn$2(target, key)) {
  2217. defineProperty$3(target, key, getOwnPropertyDescriptor$2(source, key));
  2218. }
  2219. }
  2220. };
  2221. if (FORCED$2 || IS_PURE) copyConstructorProperties(path[NUMBER], NativeNumber);
  2222. var DESCRIPTORS$3 = descriptors;
  2223. var uncurryThis$c = functionUncurryThis;
  2224. var call$9 = functionCall;
  2225. var fails$e = fails$w;
  2226. var objectKeys$1 = objectKeys$3;
  2227. var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
  2228. var propertyIsEnumerableModule = objectPropertyIsEnumerable;
  2229. var toObject$3 = toObject$a;
  2230. var IndexedObject = indexedObject;
  2231. // eslint-disable-next-line es/no-object-assign -- safe
  2232. var $assign = Object.assign;
  2233. // eslint-disable-next-line es/no-object-defineproperty -- required for testing
  2234. var defineProperty$2 = Object.defineProperty;
  2235. var concat$1 = uncurryThis$c([].concat);
  2236. // `Object.assign` method
  2237. // https://tc39.es/ecma262/#sec-object.assign
  2238. var objectAssign = !$assign || fails$e(function () {
  2239. // should have correct order of operations (Edge bug)
  2240. if (DESCRIPTORS$3 && $assign({ b: 1 }, $assign(defineProperty$2({}, 'a', {
  2241. enumerable: true,
  2242. get: function () {
  2243. defineProperty$2(this, 'b', {
  2244. value: 3,
  2245. enumerable: false
  2246. });
  2247. }
  2248. }), { b: 2 })).b !== 1) return true;
  2249. // should work with symbols and should have deterministic property order (V8 bug)
  2250. var A = {};
  2251. var B = {};
  2252. // eslint-disable-next-line es/no-symbol -- safe
  2253. var symbol = Symbol('assign detection');
  2254. var alphabet = 'abcdefghijklmnopqrst';
  2255. A[symbol] = 7;
  2256. alphabet.split('').forEach(function (chr) { B[chr] = chr; });
  2257. return $assign({}, A)[symbol] !== 7 || objectKeys$1($assign({}, B)).join('') !== alphabet;
  2258. }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
  2259. var T = toObject$3(target);
  2260. var argumentsLength = arguments.length;
  2261. var index = 1;
  2262. var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
  2263. var propertyIsEnumerable = propertyIsEnumerableModule.f;
  2264. while (argumentsLength > index) {
  2265. var S = IndexedObject(arguments[index++]);
  2266. var keys = getOwnPropertySymbols ? concat$1(objectKeys$1(S), getOwnPropertySymbols(S)) : objectKeys$1(S);
  2267. var length = keys.length;
  2268. var j = 0;
  2269. var key;
  2270. while (length > j) {
  2271. key = keys[j++];
  2272. if (!DESCRIPTORS$3 || call$9(propertyIsEnumerable, S, key)) T[key] = S[key];
  2273. }
  2274. } return T;
  2275. } : $assign;
  2276. var $$a = _export;
  2277. var assign = objectAssign;
  2278. // `Object.assign` method
  2279. // https://tc39.es/ecma262/#sec-object.assign
  2280. // eslint-disable-next-line es/no-object-assign -- required for testing
  2281. $$a({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
  2282. assign: assign
  2283. });
  2284. var DESCRIPTORS$2 = descriptors;
  2285. var fails$d = fails$w;
  2286. var uncurryThis$b = functionUncurryThis;
  2287. var objectGetPrototypeOf = objectGetPrototypeOf$1;
  2288. var objectKeys = objectKeys$3;
  2289. var toIndexedObject = toIndexedObject$8;
  2290. var $propertyIsEnumerable = objectPropertyIsEnumerable.f;
  2291. var propertyIsEnumerable = uncurryThis$b($propertyIsEnumerable);
  2292. var push$2 = uncurryThis$b([].push);
  2293. // in some IE versions, `propertyIsEnumerable` returns incorrect result on integer keys
  2294. // of `null` prototype objects
  2295. var IE_BUG = DESCRIPTORS$2 && fails$d(function () {
  2296. // eslint-disable-next-line es/no-object-create -- safe
  2297. var O = Object.create(null);
  2298. O[2] = 2;
  2299. return !propertyIsEnumerable(O, 2);
  2300. });
  2301. // `Object.{ entries, values }` methods implementation
  2302. var createMethod$1 = function (TO_ENTRIES) {
  2303. return function (it) {
  2304. var O = toIndexedObject(it);
  2305. var keys = objectKeys(O);
  2306. var IE_WORKAROUND = IE_BUG && objectGetPrototypeOf(O) === null;
  2307. var length = keys.length;
  2308. var i = 0;
  2309. var result = [];
  2310. var key;
  2311. while (length > i) {
  2312. key = keys[i++];
  2313. if (!DESCRIPTORS$2 || (IE_WORKAROUND ? key in O : propertyIsEnumerable(O, key))) {
  2314. push$2(result, TO_ENTRIES ? [key, O[key]] : O[key]);
  2315. }
  2316. }
  2317. return result;
  2318. };
  2319. };
  2320. var objectToArray = {
  2321. // `Object.entries` method
  2322. // https://tc39.es/ecma262/#sec-object.entries
  2323. entries: createMethod$1(true),
  2324. // `Object.values` method
  2325. // https://tc39.es/ecma262/#sec-object.values
  2326. values: createMethod$1(false)
  2327. };
  2328. var $$9 = _export;
  2329. var $entries = objectToArray.entries;
  2330. // `Object.entries` method
  2331. // https://tc39.es/ecma262/#sec-object.entries
  2332. $$9({ target: 'Object', stat: true }, {
  2333. entries: function entries(O) {
  2334. return $entries(O);
  2335. }
  2336. });
  2337. var $$8 = _export;
  2338. var toObject$2 = toObject$a;
  2339. var nativeKeys = objectKeys$3;
  2340. var fails$c = fails$w;
  2341. var FAILS_ON_PRIMITIVES$1 = fails$c(function () { nativeKeys(1); });
  2342. // `Object.keys` method
  2343. // https://tc39.es/ecma262/#sec-object.keys
  2344. $$8({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$1 }, {
  2345. keys: function keys(it) {
  2346. return nativeKeys(toObject$2(it));
  2347. }
  2348. });
  2349. var TO_STRING_TAG_SUPPORT$1 = toStringTagSupport;
  2350. var classof$2 = classof$5;
  2351. // `Object.prototype.toString` method implementation
  2352. // https://tc39.es/ecma262/#sec-object.prototype.tostring
  2353. var objectToString = TO_STRING_TAG_SUPPORT$1 ? {}.toString : function toString() {
  2354. return '[object ' + classof$2(this) + ']';
  2355. };
  2356. var TO_STRING_TAG_SUPPORT = toStringTagSupport;
  2357. var defineBuiltIn$3 = defineBuiltIn$7;
  2358. var toString$c = objectToString;
  2359. // `Object.prototype.toString` method
  2360. // https://tc39.es/ecma262/#sec-object.prototype.tostring
  2361. if (!TO_STRING_TAG_SUPPORT) {
  2362. defineBuiltIn$3(Object.prototype, 'toString', toString$c, { unsafe: true });
  2363. }
  2364. var global$8 = global$k;
  2365. var fails$b = fails$w;
  2366. var uncurryThis$a = functionUncurryThis;
  2367. var toString$b = toString$f;
  2368. var trim$1 = stringTrim.trim;
  2369. var whitespaces$2 = whitespaces$4;
  2370. var charAt$5 = uncurryThis$a(''.charAt);
  2371. var $parseFloat$1 = global$8.parseFloat;
  2372. var Symbol$2 = global$8.Symbol;
  2373. var ITERATOR$2 = Symbol$2 && Symbol$2.iterator;
  2374. var FORCED$1 = 1 / $parseFloat$1(whitespaces$2 + '-0') !== -Infinity
  2375. // MS Edge 18- broken with boxed symbols
  2376. || (ITERATOR$2 && !fails$b(function () { $parseFloat$1(Object(ITERATOR$2)); }));
  2377. // `parseFloat` method
  2378. // https://tc39.es/ecma262/#sec-parsefloat-string
  2379. var numberParseFloat = FORCED$1 ? function parseFloat(string) {
  2380. var trimmedString = trim$1(toString$b(string));
  2381. var result = $parseFloat$1(trimmedString);
  2382. return result === 0 && charAt$5(trimmedString, 0) === '-' ? -0 : result;
  2383. } : $parseFloat$1;
  2384. var $$7 = _export;
  2385. var $parseFloat = numberParseFloat;
  2386. // `parseFloat` method
  2387. // https://tc39.es/ecma262/#sec-parsefloat-string
  2388. $$7({ global: true, forced: parseFloat !== $parseFloat }, {
  2389. parseFloat: $parseFloat
  2390. });
  2391. var global$7 = global$k;
  2392. var fails$a = fails$w;
  2393. var uncurryThis$9 = functionUncurryThis;
  2394. var toString$a = toString$f;
  2395. var trim = stringTrim.trim;
  2396. var whitespaces$1 = whitespaces$4;
  2397. var $parseInt$1 = global$7.parseInt;
  2398. var Symbol$1 = global$7.Symbol;
  2399. var ITERATOR$1 = Symbol$1 && Symbol$1.iterator;
  2400. var hex = /^[+-]?0x/i;
  2401. var exec$2 = uncurryThis$9(hex.exec);
  2402. var FORCED = $parseInt$1(whitespaces$1 + '08') !== 8 || $parseInt$1(whitespaces$1 + '0x16') !== 22
  2403. // MS Edge 18- broken with boxed symbols
  2404. || (ITERATOR$1 && !fails$a(function () { $parseInt$1(Object(ITERATOR$1)); }));
  2405. // `parseInt` method
  2406. // https://tc39.es/ecma262/#sec-parseint-string-radix
  2407. var numberParseInt = FORCED ? function parseInt(string, radix) {
  2408. var S = trim(toString$a(string));
  2409. return $parseInt$1(S, (radix >>> 0) || (exec$2(hex, S) ? 16 : 10));
  2410. } : $parseInt$1;
  2411. var $$6 = _export;
  2412. var $parseInt = numberParseInt;
  2413. // `parseInt` method
  2414. // https://tc39.es/ecma262/#sec-parseint-string-radix
  2415. $$6({ global: true, forced: parseInt !== $parseInt }, {
  2416. parseInt: $parseInt
  2417. });
  2418. var isObject = isObject$c;
  2419. var classof$1 = classofRaw$2;
  2420. var wellKnownSymbol$7 = wellKnownSymbol$j;
  2421. var MATCH$2 = wellKnownSymbol$7('match');
  2422. // `IsRegExp` abstract operation
  2423. // https://tc39.es/ecma262/#sec-isregexp
  2424. var isRegexp = function (it) {
  2425. var isRegExp;
  2426. return isObject(it) && ((isRegExp = it[MATCH$2]) !== undefined ? !!isRegExp : classof$1(it) === 'RegExp');
  2427. };
  2428. var anObject$7 = anObject$d;
  2429. // `RegExp.prototype.flags` getter implementation
  2430. // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
  2431. var regexpFlags$1 = function () {
  2432. var that = anObject$7(this);
  2433. var result = '';
  2434. if (that.hasIndices) result += 'd';
  2435. if (that.global) result += 'g';
  2436. if (that.ignoreCase) result += 'i';
  2437. if (that.multiline) result += 'm';
  2438. if (that.dotAll) result += 's';
  2439. if (that.unicode) result += 'u';
  2440. if (that.unicodeSets) result += 'v';
  2441. if (that.sticky) result += 'y';
  2442. return result;
  2443. };
  2444. var call$8 = functionCall;
  2445. var hasOwn$1 = hasOwnProperty_1;
  2446. var isPrototypeOf$1 = objectIsPrototypeOf;
  2447. var regExpFlags = regexpFlags$1;
  2448. var RegExpPrototype$3 = RegExp.prototype;
  2449. var regexpGetFlags = function (R) {
  2450. var flags = R.flags;
  2451. return flags === undefined && !('flags' in RegExpPrototype$3) && !hasOwn$1(R, 'flags') && isPrototypeOf$1(RegExpPrototype$3, R)
  2452. ? call$8(regExpFlags, R) : flags;
  2453. };
  2454. var fails$9 = fails$w;
  2455. var global$6 = global$k;
  2456. // babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
  2457. var $RegExp$2 = global$6.RegExp;
  2458. var UNSUPPORTED_Y$3 = fails$9(function () {
  2459. var re = $RegExp$2('a', 'y');
  2460. re.lastIndex = 2;
  2461. return re.exec('abcd') !== null;
  2462. });
  2463. // UC Browser bug
  2464. // https://github.com/zloirock/core-js/issues/1008
  2465. var MISSED_STICKY$1 = UNSUPPORTED_Y$3 || fails$9(function () {
  2466. return !$RegExp$2('a', 'y').sticky;
  2467. });
  2468. var BROKEN_CARET = UNSUPPORTED_Y$3 || fails$9(function () {
  2469. // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
  2470. var re = $RegExp$2('^r', 'gy');
  2471. re.lastIndex = 2;
  2472. return re.exec('str') !== null;
  2473. });
  2474. var regexpStickyHelpers = {
  2475. BROKEN_CARET: BROKEN_CARET,
  2476. MISSED_STICKY: MISSED_STICKY$1,
  2477. UNSUPPORTED_Y: UNSUPPORTED_Y$3
  2478. };
  2479. var defineProperty$1 = objectDefineProperty.f;
  2480. var proxyAccessor$1 = function (Target, Source, key) {
  2481. key in Target || defineProperty$1(Target, key, {
  2482. configurable: true,
  2483. get: function () { return Source[key]; },
  2484. set: function (it) { Source[key] = it; }
  2485. });
  2486. };
  2487. var makeBuiltIn = makeBuiltInExports;
  2488. var defineProperty = objectDefineProperty;
  2489. var defineBuiltInAccessor$1 = function (target, name, descriptor) {
  2490. if (descriptor.get) makeBuiltIn(descriptor.get, name, { getter: true });
  2491. if (descriptor.set) makeBuiltIn(descriptor.set, name, { setter: true });
  2492. return defineProperty.f(target, name, descriptor);
  2493. };
  2494. var getBuiltIn = getBuiltIn$5;
  2495. var defineBuiltInAccessor = defineBuiltInAccessor$1;
  2496. var wellKnownSymbol$6 = wellKnownSymbol$j;
  2497. var DESCRIPTORS$1 = descriptors;
  2498. var SPECIES$2 = wellKnownSymbol$6('species');
  2499. var setSpecies$1 = function (CONSTRUCTOR_NAME) {
  2500. var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
  2501. if (DESCRIPTORS$1 && Constructor && !Constructor[SPECIES$2]) {
  2502. defineBuiltInAccessor(Constructor, SPECIES$2, {
  2503. configurable: true,
  2504. get: function () { return this; }
  2505. });
  2506. }
  2507. };
  2508. var fails$8 = fails$w;
  2509. var global$5 = global$k;
  2510. // babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
  2511. var $RegExp$1 = global$5.RegExp;
  2512. var regexpUnsupportedDotAll = fails$8(function () {
  2513. var re = $RegExp$1('.', 's');
  2514. return !(re.dotAll && re.test('\n') && re.flags === 's');
  2515. });
  2516. var fails$7 = fails$w;
  2517. var global$4 = global$k;
  2518. // babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
  2519. var $RegExp = global$4.RegExp;
  2520. var regexpUnsupportedNcg = fails$7(function () {
  2521. var re = $RegExp('(?<a>b)', 'g');
  2522. return re.exec('b').groups.a !== 'b' ||
  2523. 'b'.replace(re, '$<a>c') !== 'bc';
  2524. });
  2525. var DESCRIPTORS = descriptors;
  2526. var global$3 = global$k;
  2527. var uncurryThis$8 = functionUncurryThis;
  2528. var isForced = isForced_1;
  2529. var inheritIfRequired = inheritIfRequired$2;
  2530. var createNonEnumerableProperty$3 = createNonEnumerableProperty$7;
  2531. var create$1 = objectCreate;
  2532. var getOwnPropertyNames = objectGetOwnPropertyNames.f;
  2533. var isPrototypeOf = objectIsPrototypeOf;
  2534. var isRegExp$1 = isRegexp;
  2535. var toString$9 = toString$f;
  2536. var getRegExpFlags$1 = regexpGetFlags;
  2537. var stickyHelpers$2 = regexpStickyHelpers;
  2538. var proxyAccessor = proxyAccessor$1;
  2539. var defineBuiltIn$2 = defineBuiltIn$7;
  2540. var fails$6 = fails$w;
  2541. var hasOwn = hasOwnProperty_1;
  2542. var enforceInternalState = internalState.enforce;
  2543. var setSpecies = setSpecies$1;
  2544. var wellKnownSymbol$5 = wellKnownSymbol$j;
  2545. var UNSUPPORTED_DOT_ALL$1 = regexpUnsupportedDotAll;
  2546. var UNSUPPORTED_NCG$1 = regexpUnsupportedNcg;
  2547. var MATCH$1 = wellKnownSymbol$5('match');
  2548. var NativeRegExp = global$3.RegExp;
  2549. var RegExpPrototype$2 = NativeRegExp.prototype;
  2550. var SyntaxError = global$3.SyntaxError;
  2551. var exec$1 = uncurryThis$8(RegExpPrototype$2.exec);
  2552. var charAt$4 = uncurryThis$8(''.charAt);
  2553. var replace$2 = uncurryThis$8(''.replace);
  2554. var stringIndexOf$2 = uncurryThis$8(''.indexOf);
  2555. var stringSlice$6 = uncurryThis$8(''.slice);
  2556. // TODO: Use only proper RegExpIdentifierName
  2557. var IS_NCG = /^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/;
  2558. var re1 = /a/g;
  2559. var re2 = /a/g;
  2560. // "new" should create a new object, old webkit bug
  2561. var CORRECT_NEW = new NativeRegExp(re1) !== re1;
  2562. var MISSED_STICKY = stickyHelpers$2.MISSED_STICKY;
  2563. var UNSUPPORTED_Y$2 = stickyHelpers$2.UNSUPPORTED_Y;
  2564. var BASE_FORCED = DESCRIPTORS &&
  2565. (!CORRECT_NEW || MISSED_STICKY || UNSUPPORTED_DOT_ALL$1 || UNSUPPORTED_NCG$1 || fails$6(function () {
  2566. re2[MATCH$1] = false;
  2567. // RegExp constructor can alter flags and IsRegExp works correct with @@match
  2568. return NativeRegExp(re1) !== re1 || NativeRegExp(re2) === re2 || String(NativeRegExp(re1, 'i')) !== '/a/i';
  2569. }));
  2570. var handleDotAll = function (string) {
  2571. var length = string.length;
  2572. var index = 0;
  2573. var result = '';
  2574. var brackets = false;
  2575. var chr;
  2576. for (; index <= length; index++) {
  2577. chr = charAt$4(string, index);
  2578. if (chr === '\\') {
  2579. result += chr + charAt$4(string, ++index);
  2580. continue;
  2581. }
  2582. if (!brackets && chr === '.') {
  2583. result += '[\\s\\S]';
  2584. } else {
  2585. if (chr === '[') {
  2586. brackets = true;
  2587. } else if (chr === ']') {
  2588. brackets = false;
  2589. } result += chr;
  2590. }
  2591. } return result;
  2592. };
  2593. var handleNCG = function (string) {
  2594. var length = string.length;
  2595. var index = 0;
  2596. var result = '';
  2597. var named = [];
  2598. var names = create$1(null);
  2599. var brackets = false;
  2600. var ncg = false;
  2601. var groupid = 0;
  2602. var groupname = '';
  2603. var chr;
  2604. for (; index <= length; index++) {
  2605. chr = charAt$4(string, index);
  2606. if (chr === '\\') {
  2607. chr += charAt$4(string, ++index);
  2608. } else if (chr === ']') {
  2609. brackets = false;
  2610. } else if (!brackets) switch (true) {
  2611. case chr === '[':
  2612. brackets = true;
  2613. break;
  2614. case chr === '(':
  2615. if (exec$1(IS_NCG, stringSlice$6(string, index + 1))) {
  2616. index += 2;
  2617. ncg = true;
  2618. }
  2619. result += chr;
  2620. groupid++;
  2621. continue;
  2622. case chr === '>' && ncg:
  2623. if (groupname === '' || hasOwn(names, groupname)) {
  2624. throw new SyntaxError('Invalid capture group name');
  2625. }
  2626. names[groupname] = true;
  2627. named[named.length] = [groupname, groupid];
  2628. ncg = false;
  2629. groupname = '';
  2630. continue;
  2631. }
  2632. if (ncg) groupname += chr;
  2633. else result += chr;
  2634. } return [result, named];
  2635. };
  2636. // `RegExp` constructor
  2637. // https://tc39.es/ecma262/#sec-regexp-constructor
  2638. if (isForced('RegExp', BASE_FORCED)) {
  2639. var RegExpWrapper = function RegExp(pattern, flags) {
  2640. var thisIsRegExp = isPrototypeOf(RegExpPrototype$2, this);
  2641. var patternIsRegExp = isRegExp$1(pattern);
  2642. var flagsAreUndefined = flags === undefined;
  2643. var groups = [];
  2644. var rawPattern = pattern;
  2645. var rawFlags, dotAll, sticky, handled, result, state;
  2646. if (!thisIsRegExp && patternIsRegExp && flagsAreUndefined && pattern.constructor === RegExpWrapper) {
  2647. return pattern;
  2648. }
  2649. if (patternIsRegExp || isPrototypeOf(RegExpPrototype$2, pattern)) {
  2650. pattern = pattern.source;
  2651. if (flagsAreUndefined) flags = getRegExpFlags$1(rawPattern);
  2652. }
  2653. pattern = pattern === undefined ? '' : toString$9(pattern);
  2654. flags = flags === undefined ? '' : toString$9(flags);
  2655. rawPattern = pattern;
  2656. if (UNSUPPORTED_DOT_ALL$1 && 'dotAll' in re1) {
  2657. dotAll = !!flags && stringIndexOf$2(flags, 's') > -1;
  2658. if (dotAll) flags = replace$2(flags, /s/g, '');
  2659. }
  2660. rawFlags = flags;
  2661. if (MISSED_STICKY && 'sticky' in re1) {
  2662. sticky = !!flags && stringIndexOf$2(flags, 'y') > -1;
  2663. if (sticky && UNSUPPORTED_Y$2) flags = replace$2(flags, /y/g, '');
  2664. }
  2665. if (UNSUPPORTED_NCG$1) {
  2666. handled = handleNCG(pattern);
  2667. pattern = handled[0];
  2668. groups = handled[1];
  2669. }
  2670. result = inheritIfRequired(NativeRegExp(pattern, flags), thisIsRegExp ? this : RegExpPrototype$2, RegExpWrapper);
  2671. if (dotAll || sticky || groups.length) {
  2672. state = enforceInternalState(result);
  2673. if (dotAll) {
  2674. state.dotAll = true;
  2675. state.raw = RegExpWrapper(handleDotAll(pattern), rawFlags);
  2676. }
  2677. if (sticky) state.sticky = true;
  2678. if (groups.length) state.groups = groups;
  2679. }
  2680. if (pattern !== rawPattern) try {
  2681. // fails in old engines, but we have no alternatives for unsupported regex syntax
  2682. createNonEnumerableProperty$3(result, 'source', rawPattern === '' ? '(?:)' : rawPattern);
  2683. } catch (error) { /* empty */ }
  2684. return result;
  2685. };
  2686. for (var keys = getOwnPropertyNames(NativeRegExp), index = 0; keys.length > index;) {
  2687. proxyAccessor(RegExpWrapper, NativeRegExp, keys[index++]);
  2688. }
  2689. RegExpPrototype$2.constructor = RegExpWrapper;
  2690. RegExpWrapper.prototype = RegExpPrototype$2;
  2691. defineBuiltIn$2(global$3, 'RegExp', RegExpWrapper, { constructor: true });
  2692. }
  2693. // https://tc39.es/ecma262/#sec-get-regexp-@@species
  2694. setSpecies('RegExp');
  2695. /* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
  2696. /* eslint-disable regexp/no-useless-quantifier -- testing */
  2697. var call$7 = functionCall;
  2698. var uncurryThis$7 = functionUncurryThis;
  2699. var toString$8 = toString$f;
  2700. var regexpFlags = regexpFlags$1;
  2701. var stickyHelpers$1 = regexpStickyHelpers;
  2702. var shared = shared$4;
  2703. var create = objectCreate;
  2704. var getInternalState = internalState.get;
  2705. var UNSUPPORTED_DOT_ALL = regexpUnsupportedDotAll;
  2706. var UNSUPPORTED_NCG = regexpUnsupportedNcg;
  2707. var nativeReplace = shared('native-string-replace', String.prototype.replace);
  2708. var nativeExec = RegExp.prototype.exec;
  2709. var patchedExec = nativeExec;
  2710. var charAt$3 = uncurryThis$7(''.charAt);
  2711. var indexOf = uncurryThis$7(''.indexOf);
  2712. var replace$1 = uncurryThis$7(''.replace);
  2713. var stringSlice$5 = uncurryThis$7(''.slice);
  2714. var UPDATES_LAST_INDEX_WRONG = (function () {
  2715. var re1 = /a/;
  2716. var re2 = /b*/g;
  2717. call$7(nativeExec, re1, 'a');
  2718. call$7(nativeExec, re2, 'a');
  2719. return re1.lastIndex !== 0 || re2.lastIndex !== 0;
  2720. })();
  2721. var UNSUPPORTED_Y$1 = stickyHelpers$1.BROKEN_CARET;
  2722. // nonparticipating capturing group, copied from es5-shim's String#split patch.
  2723. var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
  2724. var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$1 || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;
  2725. if (PATCH) {
  2726. patchedExec = function exec(string) {
  2727. var re = this;
  2728. var state = getInternalState(re);
  2729. var str = toString$8(string);
  2730. var raw = state.raw;
  2731. var result, reCopy, lastIndex, match, i, object, group;
  2732. if (raw) {
  2733. raw.lastIndex = re.lastIndex;
  2734. result = call$7(patchedExec, raw, str);
  2735. re.lastIndex = raw.lastIndex;
  2736. return result;
  2737. }
  2738. var groups = state.groups;
  2739. var sticky = UNSUPPORTED_Y$1 && re.sticky;
  2740. var flags = call$7(regexpFlags, re);
  2741. var source = re.source;
  2742. var charsAdded = 0;
  2743. var strCopy = str;
  2744. if (sticky) {
  2745. flags = replace$1(flags, 'y', '');
  2746. if (indexOf(flags, 'g') === -1) {
  2747. flags += 'g';
  2748. }
  2749. strCopy = stringSlice$5(str, re.lastIndex);
  2750. // Support anchored sticky behavior.
  2751. if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$3(str, re.lastIndex - 1) !== '\n')) {
  2752. source = '(?: ' + source + ')';
  2753. strCopy = ' ' + strCopy;
  2754. charsAdded++;
  2755. }
  2756. // ^(? + rx + ) is needed, in combination with some str slicing, to
  2757. // simulate the 'y' flag.
  2758. reCopy = new RegExp('^(?:' + source + ')', flags);
  2759. }
  2760. if (NPCG_INCLUDED) {
  2761. reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
  2762. }
  2763. if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
  2764. match = call$7(nativeExec, sticky ? reCopy : re, strCopy);
  2765. if (sticky) {
  2766. if (match) {
  2767. match.input = stringSlice$5(match.input, charsAdded);
  2768. match[0] = stringSlice$5(match[0], charsAdded);
  2769. match.index = re.lastIndex;
  2770. re.lastIndex += match[0].length;
  2771. } else re.lastIndex = 0;
  2772. } else if (UPDATES_LAST_INDEX_WRONG && match) {
  2773. re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
  2774. }
  2775. if (NPCG_INCLUDED && match && match.length > 1) {
  2776. // Fix browsers whose `exec` methods don't consistently return `undefined`
  2777. // for NPCG, like IE8. NOTE: This doesn't work for /(.?)?/
  2778. call$7(nativeReplace, match[0], reCopy, function () {
  2779. for (i = 1; i < arguments.length - 2; i++) {
  2780. if (arguments[i] === undefined) match[i] = undefined;
  2781. }
  2782. });
  2783. }
  2784. if (match && groups) {
  2785. match.groups = object = create(null);
  2786. for (i = 0; i < groups.length; i++) {
  2787. group = groups[i];
  2788. object[group[0]] = match[group[1]];
  2789. }
  2790. }
  2791. return match;
  2792. };
  2793. }
  2794. var regexpExec$2 = patchedExec;
  2795. var $$5 = _export;
  2796. var exec = regexpExec$2;
  2797. // `RegExp.prototype.exec` method
  2798. // https://tc39.es/ecma262/#sec-regexp.prototype.exec
  2799. $$5({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, {
  2800. exec: exec
  2801. });
  2802. var PROPER_FUNCTION_NAME$1 = functionName.PROPER;
  2803. var defineBuiltIn$1 = defineBuiltIn$7;
  2804. var anObject$6 = anObject$d;
  2805. var $toString = toString$f;
  2806. var fails$5 = fails$w;
  2807. var getRegExpFlags = regexpGetFlags;
  2808. var TO_STRING = 'toString';
  2809. var RegExpPrototype$1 = RegExp.prototype;
  2810. var nativeToString = RegExpPrototype$1[TO_STRING];
  2811. var NOT_GENERIC = fails$5(function () { return nativeToString.call({ source: 'a', flags: 'b' }) !== '/a/b'; });
  2812. // FF44- RegExp#toString has a wrong name
  2813. var INCORRECT_NAME = PROPER_FUNCTION_NAME$1 && nativeToString.name !== TO_STRING;
  2814. // `RegExp.prototype.toString` method
  2815. // https://tc39.es/ecma262/#sec-regexp.prototype.tostring
  2816. if (NOT_GENERIC || INCORRECT_NAME) {
  2817. defineBuiltIn$1(RegExpPrototype$1, TO_STRING, function toString() {
  2818. var R = anObject$6(this);
  2819. var pattern = $toString(R.source);
  2820. var flags = $toString(getRegExpFlags(R));
  2821. return '/' + pattern + '/' + flags;
  2822. }, { unsafe: true });
  2823. }
  2824. var isRegExp = isRegexp;
  2825. var $TypeError$2 = TypeError;
  2826. var notARegexp = function (it) {
  2827. if (isRegExp(it)) {
  2828. throw new $TypeError$2("The method doesn't accept regular expressions");
  2829. } return it;
  2830. };
  2831. var wellKnownSymbol$4 = wellKnownSymbol$j;
  2832. var MATCH = wellKnownSymbol$4('match');
  2833. var correctIsRegexpLogic = function (METHOD_NAME) {
  2834. var regexp = /./;
  2835. try {
  2836. '/./'[METHOD_NAME](regexp);
  2837. } catch (error1) {
  2838. try {
  2839. regexp[MATCH] = false;
  2840. return '/./'[METHOD_NAME](regexp);
  2841. } catch (error2) { /* empty */ }
  2842. } return false;
  2843. };
  2844. var $$4 = _export;
  2845. var uncurryThis$6 = functionUncurryThis;
  2846. var notARegExp$2 = notARegexp;
  2847. var requireObjectCoercible$7 = requireObjectCoercible$b;
  2848. var toString$7 = toString$f;
  2849. var correctIsRegExpLogic$2 = correctIsRegexpLogic;
  2850. var stringIndexOf$1 = uncurryThis$6(''.indexOf);
  2851. // `String.prototype.includes` method
  2852. // https://tc39.es/ecma262/#sec-string.prototype.includes
  2853. $$4({ target: 'String', proto: true, forced: !correctIsRegExpLogic$2('includes') }, {
  2854. includes: function includes(searchString /* , position = 0 */) {
  2855. return !!~stringIndexOf$1(
  2856. toString$7(requireObjectCoercible$7(this)),
  2857. toString$7(notARegExp$2(searchString)),
  2858. arguments.length > 1 ? arguments[1] : undefined
  2859. );
  2860. }
  2861. });
  2862. var NATIVE_BIND = functionBindNative;
  2863. var FunctionPrototype = Function.prototype;
  2864. var apply$1 = FunctionPrototype.apply;
  2865. var call$6 = FunctionPrototype.call;
  2866. // eslint-disable-next-line es/no-reflect -- safe
  2867. var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call$6.bind(apply$1) : function () {
  2868. return call$6.apply(apply$1, arguments);
  2869. });
  2870. // TODO: Remove from `core-js@4` since it's moved to entry points
  2871. var call$5 = functionCall;
  2872. var defineBuiltIn = defineBuiltIn$7;
  2873. var regexpExec$1 = regexpExec$2;
  2874. var fails$4 = fails$w;
  2875. var wellKnownSymbol$3 = wellKnownSymbol$j;
  2876. var createNonEnumerableProperty$2 = createNonEnumerableProperty$7;
  2877. var SPECIES$1 = wellKnownSymbol$3('species');
  2878. var RegExpPrototype = RegExp.prototype;
  2879. var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
  2880. var SYMBOL = wellKnownSymbol$3(KEY);
  2881. var DELEGATES_TO_SYMBOL = !fails$4(function () {
  2882. // String methods call symbol-named RegExp methods
  2883. var O = {};
  2884. O[SYMBOL] = function () { return 7; };
  2885. return ''[KEY](O) !== 7;
  2886. });
  2887. var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails$4(function () {
  2888. // Symbol-named RegExp methods call .exec
  2889. var execCalled = false;
  2890. var re = /a/;
  2891. if (KEY === 'split') {
  2892. // We can't use real regex here since it causes deoptimization
  2893. // and serious performance degradation in V8
  2894. // https://github.com/zloirock/core-js/issues/306
  2895. re = {};
  2896. // RegExp[@@split] doesn't call the regex's exec method, but first creates
  2897. // a new one. We need to return the patched regex when creating the new one.
  2898. re.constructor = {};
  2899. re.constructor[SPECIES$1] = function () { return re; };
  2900. re.flags = '';
  2901. re[SYMBOL] = /./[SYMBOL];
  2902. }
  2903. re.exec = function () {
  2904. execCalled = true;
  2905. return null;
  2906. };
  2907. re[SYMBOL]('');
  2908. return !execCalled;
  2909. });
  2910. if (
  2911. !DELEGATES_TO_SYMBOL ||
  2912. !DELEGATES_TO_EXEC ||
  2913. FORCED
  2914. ) {
  2915. var nativeRegExpMethod = /./[SYMBOL];
  2916. var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
  2917. var $exec = regexp.exec;
  2918. if ($exec === regexpExec$1 || $exec === RegExpPrototype.exec) {
  2919. if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
  2920. // The native String method already delegates to @@method (this
  2921. // polyfilled function), leasing to infinite recursion.
  2922. // We avoid it by directly calling the native @@method method.
  2923. return { done: true, value: call$5(nativeRegExpMethod, regexp, str, arg2) };
  2924. }
  2925. return { done: true, value: call$5(nativeMethod, str, regexp, arg2) };
  2926. }
  2927. return { done: false };
  2928. });
  2929. defineBuiltIn(String.prototype, KEY, methods[0]);
  2930. defineBuiltIn(RegExpPrototype, SYMBOL, methods[1]);
  2931. }
  2932. if (SHAM) createNonEnumerableProperty$2(RegExpPrototype[SYMBOL], 'sham', true);
  2933. };
  2934. var uncurryThis$5 = functionUncurryThis;
  2935. var toIntegerOrInfinity$1 = toIntegerOrInfinity$5;
  2936. var toString$6 = toString$f;
  2937. var requireObjectCoercible$6 = requireObjectCoercible$b;
  2938. var charAt$2 = uncurryThis$5(''.charAt);
  2939. var charCodeAt = uncurryThis$5(''.charCodeAt);
  2940. var stringSlice$4 = uncurryThis$5(''.slice);
  2941. var createMethod = function (CONVERT_TO_STRING) {
  2942. return function ($this, pos) {
  2943. var S = toString$6(requireObjectCoercible$6($this));
  2944. var position = toIntegerOrInfinity$1(pos);
  2945. var size = S.length;
  2946. var first, second;
  2947. if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
  2948. first = charCodeAt(S, position);
  2949. return first < 0xD800 || first > 0xDBFF || position + 1 === size
  2950. || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF
  2951. ? CONVERT_TO_STRING
  2952. ? charAt$2(S, position)
  2953. : first
  2954. : CONVERT_TO_STRING
  2955. ? stringSlice$4(S, position, position + 2)
  2956. : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
  2957. };
  2958. };
  2959. var stringMultibyte = {
  2960. // `String.prototype.codePointAt` method
  2961. // https://tc39.es/ecma262/#sec-string.prototype.codepointat
  2962. codeAt: createMethod(false),
  2963. // `String.prototype.at` method
  2964. // https://github.com/mathiasbynens/String.prototype.at
  2965. charAt: createMethod(true)
  2966. };
  2967. var charAt$1 = stringMultibyte.charAt;
  2968. // `AdvanceStringIndex` abstract operation
  2969. // https://tc39.es/ecma262/#sec-advancestringindex
  2970. var advanceStringIndex$3 = function (S, index, unicode) {
  2971. return index + (unicode ? charAt$1(S, index).length : 1);
  2972. };
  2973. var uncurryThis$4 = functionUncurryThis;
  2974. var toObject$1 = toObject$a;
  2975. var floor = Math.floor;
  2976. var charAt = uncurryThis$4(''.charAt);
  2977. var replace = uncurryThis$4(''.replace);
  2978. var stringSlice$3 = uncurryThis$4(''.slice);
  2979. // eslint-disable-next-line redos/no-vulnerable -- safe
  2980. var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
  2981. var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
  2982. // `GetSubstitution` abstract operation
  2983. // https://tc39.es/ecma262/#sec-getsubstitution
  2984. var getSubstitution$1 = function (matched, str, position, captures, namedCaptures, replacement) {
  2985. var tailPos = position + matched.length;
  2986. var m = captures.length;
  2987. var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
  2988. if (namedCaptures !== undefined) {
  2989. namedCaptures = toObject$1(namedCaptures);
  2990. symbols = SUBSTITUTION_SYMBOLS;
  2991. }
  2992. return replace(replacement, symbols, function (match, ch) {
  2993. var capture;
  2994. switch (charAt(ch, 0)) {
  2995. case '$': return '$';
  2996. case '&': return matched;
  2997. case '`': return stringSlice$3(str, 0, position);
  2998. case "'": return stringSlice$3(str, tailPos);
  2999. case '<':
  3000. capture = namedCaptures[stringSlice$3(ch, 1, -1)];
  3001. break;
  3002. default: // \d\d?
  3003. var n = +ch;
  3004. if (n === 0) return match;
  3005. if (n > m) {
  3006. var f = floor(n / 10);
  3007. if (f === 0) return match;
  3008. if (f <= m) return captures[f - 1] === undefined ? charAt(ch, 1) : captures[f - 1] + charAt(ch, 1);
  3009. return match;
  3010. }
  3011. capture = captures[n - 1];
  3012. }
  3013. return capture === undefined ? '' : capture;
  3014. });
  3015. };
  3016. var call$4 = functionCall;
  3017. var anObject$5 = anObject$d;
  3018. var isCallable$1 = isCallable$i;
  3019. var classof = classofRaw$2;
  3020. var regexpExec = regexpExec$2;
  3021. var $TypeError$1 = TypeError;
  3022. // `RegExpExec` abstract operation
  3023. // https://tc39.es/ecma262/#sec-regexpexec
  3024. var regexpExecAbstract = function (R, S) {
  3025. var exec = R.exec;
  3026. if (isCallable$1(exec)) {
  3027. var result = call$4(exec, R, S);
  3028. if (result !== null) anObject$5(result);
  3029. return result;
  3030. }
  3031. if (classof(R) === 'RegExp') return call$4(regexpExec, R, S);
  3032. throw new $TypeError$1('RegExp#exec called on incompatible receiver');
  3033. };
  3034. var apply = functionApply;
  3035. var call$3 = functionCall;
  3036. var uncurryThis$3 = functionUncurryThis;
  3037. var fixRegExpWellKnownSymbolLogic$3 = fixRegexpWellKnownSymbolLogic;
  3038. var fails$3 = fails$w;
  3039. var anObject$4 = anObject$d;
  3040. var isCallable = isCallable$i;
  3041. var isNullOrUndefined$4 = isNullOrUndefined$7;
  3042. var toIntegerOrInfinity = toIntegerOrInfinity$5;
  3043. var toLength$4 = toLength$6;
  3044. var toString$5 = toString$f;
  3045. var requireObjectCoercible$5 = requireObjectCoercible$b;
  3046. var advanceStringIndex$2 = advanceStringIndex$3;
  3047. var getMethod$3 = getMethod$5;
  3048. var getSubstitution = getSubstitution$1;
  3049. var regExpExec$3 = regexpExecAbstract;
  3050. var wellKnownSymbol$2 = wellKnownSymbol$j;
  3051. var REPLACE = wellKnownSymbol$2('replace');
  3052. var max = Math.max;
  3053. var min$3 = Math.min;
  3054. var concat = uncurryThis$3([].concat);
  3055. var push$1 = uncurryThis$3([].push);
  3056. var stringIndexOf = uncurryThis$3(''.indexOf);
  3057. var stringSlice$2 = uncurryThis$3(''.slice);
  3058. var maybeToString = function (it) {
  3059. return it === undefined ? it : String(it);
  3060. };
  3061. // IE <= 11 replaces $0 with the whole match, as if it was $&
  3062. // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
  3063. var REPLACE_KEEPS_$0 = (function () {
  3064. // eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing
  3065. return 'a'.replace(/./, '$0') === '$0';
  3066. })();
  3067. // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
  3068. var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
  3069. if (/./[REPLACE]) {
  3070. return /./[REPLACE]('a', '$0') === '';
  3071. }
  3072. return false;
  3073. })();
  3074. var REPLACE_SUPPORTS_NAMED_GROUPS = !fails$3(function () {
  3075. var re = /./;
  3076. re.exec = function () {
  3077. var result = [];
  3078. result.groups = { a: '7' };
  3079. return result;
  3080. };
  3081. // eslint-disable-next-line regexp/no-useless-dollar-replacements -- false positive
  3082. return ''.replace(re, '$<a>') !== '7';
  3083. });
  3084. // @@replace logic
  3085. fixRegExpWellKnownSymbolLogic$3('replace', function (_, nativeReplace, maybeCallNative) {
  3086. var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
  3087. return [
  3088. // `String.prototype.replace` method
  3089. // https://tc39.es/ecma262/#sec-string.prototype.replace
  3090. function replace(searchValue, replaceValue) {
  3091. var O = requireObjectCoercible$5(this);
  3092. var replacer = isNullOrUndefined$4(searchValue) ? undefined : getMethod$3(searchValue, REPLACE);
  3093. return replacer
  3094. ? call$3(replacer, searchValue, O, replaceValue)
  3095. : call$3(nativeReplace, toString$5(O), searchValue, replaceValue);
  3096. },
  3097. // `RegExp.prototype[@@replace]` method
  3098. // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
  3099. function (string, replaceValue) {
  3100. var rx = anObject$4(this);
  3101. var S = toString$5(string);
  3102. if (
  3103. typeof replaceValue == 'string' &&
  3104. stringIndexOf(replaceValue, UNSAFE_SUBSTITUTE) === -1 &&
  3105. stringIndexOf(replaceValue, '$<') === -1
  3106. ) {
  3107. var res = maybeCallNative(nativeReplace, rx, S, replaceValue);
  3108. if (res.done) return res.value;
  3109. }
  3110. var functionalReplace = isCallable(replaceValue);
  3111. if (!functionalReplace) replaceValue = toString$5(replaceValue);
  3112. var global = rx.global;
  3113. var fullUnicode;
  3114. if (global) {
  3115. fullUnicode = rx.unicode;
  3116. rx.lastIndex = 0;
  3117. }
  3118. var results = [];
  3119. var result;
  3120. while (true) {
  3121. result = regExpExec$3(rx, S);
  3122. if (result === null) break;
  3123. push$1(results, result);
  3124. if (!global) break;
  3125. var matchStr = toString$5(result[0]);
  3126. if (matchStr === '') rx.lastIndex = advanceStringIndex$2(S, toLength$4(rx.lastIndex), fullUnicode);
  3127. }
  3128. var accumulatedResult = '';
  3129. var nextSourcePosition = 0;
  3130. for (var i = 0; i < results.length; i++) {
  3131. result = results[i];
  3132. var matched = toString$5(result[0]);
  3133. var position = max(min$3(toIntegerOrInfinity(result.index), S.length), 0);
  3134. var captures = [];
  3135. var replacement;
  3136. // NOTE: This is equivalent to
  3137. // captures = result.slice(1).map(maybeToString)
  3138. // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
  3139. // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
  3140. // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
  3141. for (var j = 1; j < result.length; j++) push$1(captures, maybeToString(result[j]));
  3142. var namedCaptures = result.groups;
  3143. if (functionalReplace) {
  3144. var replacerArgs = concat([matched], captures, position, S);
  3145. if (namedCaptures !== undefined) push$1(replacerArgs, namedCaptures);
  3146. replacement = toString$5(apply(replaceValue, undefined, replacerArgs));
  3147. } else {
  3148. replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
  3149. }
  3150. if (position >= nextSourcePosition) {
  3151. accumulatedResult += stringSlice$2(S, nextSourcePosition, position) + replacement;
  3152. nextSourcePosition = position + matched.length;
  3153. }
  3154. }
  3155. return accumulatedResult + stringSlice$2(S, nextSourcePosition);
  3156. }
  3157. ];
  3158. }, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
  3159. // `SameValue` abstract operation
  3160. // https://tc39.es/ecma262/#sec-samevalue
  3161. // eslint-disable-next-line es/no-object-is -- safe
  3162. var sameValue$1 = Object.is || function is(x, y) {
  3163. // eslint-disable-next-line no-self-compare -- NaN check
  3164. return x === y ? x !== 0 || 1 / x === 1 / y : x !== x && y !== y;
  3165. };
  3166. var call$2 = functionCall;
  3167. var fixRegExpWellKnownSymbolLogic$2 = fixRegexpWellKnownSymbolLogic;
  3168. var anObject$3 = anObject$d;
  3169. var isNullOrUndefined$3 = isNullOrUndefined$7;
  3170. var requireObjectCoercible$4 = requireObjectCoercible$b;
  3171. var sameValue = sameValue$1;
  3172. var toString$4 = toString$f;
  3173. var getMethod$2 = getMethod$5;
  3174. var regExpExec$2 = regexpExecAbstract;
  3175. // @@search logic
  3176. fixRegExpWellKnownSymbolLogic$2('search', function (SEARCH, nativeSearch, maybeCallNative) {
  3177. return [
  3178. // `String.prototype.search` method
  3179. // https://tc39.es/ecma262/#sec-string.prototype.search
  3180. function search(regexp) {
  3181. var O = requireObjectCoercible$4(this);
  3182. var searcher = isNullOrUndefined$3(regexp) ? undefined : getMethod$2(regexp, SEARCH);
  3183. return searcher ? call$2(searcher, regexp, O) : new RegExp(regexp)[SEARCH](toString$4(O));
  3184. },
  3185. // `RegExp.prototype[@@search]` method
  3186. // https://tc39.es/ecma262/#sec-regexp.prototype-@@search
  3187. function (string) {
  3188. var rx = anObject$3(this);
  3189. var S = toString$4(string);
  3190. var res = maybeCallNative(nativeSearch, rx, S);
  3191. if (res.done) return res.value;
  3192. var previousLastIndex = rx.lastIndex;
  3193. if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;
  3194. var result = regExpExec$2(rx, S);
  3195. if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
  3196. return result === null ? -1 : result.index;
  3197. }
  3198. ];
  3199. });
  3200. var isConstructor = isConstructor$3;
  3201. var tryToString = tryToString$3;
  3202. var $TypeError = TypeError;
  3203. // `Assert: IsConstructor(argument) is true`
  3204. var aConstructor$1 = function (argument) {
  3205. if (isConstructor(argument)) return argument;
  3206. throw new $TypeError(tryToString(argument) + ' is not a constructor');
  3207. };
  3208. var anObject$2 = anObject$d;
  3209. var aConstructor = aConstructor$1;
  3210. var isNullOrUndefined$2 = isNullOrUndefined$7;
  3211. var wellKnownSymbol$1 = wellKnownSymbol$j;
  3212. var SPECIES = wellKnownSymbol$1('species');
  3213. // `SpeciesConstructor` abstract operation
  3214. // https://tc39.es/ecma262/#sec-speciesconstructor
  3215. var speciesConstructor$1 = function (O, defaultConstructor) {
  3216. var C = anObject$2(O).constructor;
  3217. var S;
  3218. return C === undefined || isNullOrUndefined$2(S = anObject$2(C)[SPECIES]) ? defaultConstructor : aConstructor(S);
  3219. };
  3220. var call$1 = functionCall;
  3221. var uncurryThis$2 = functionUncurryThis;
  3222. var fixRegExpWellKnownSymbolLogic$1 = fixRegexpWellKnownSymbolLogic;
  3223. var anObject$1 = anObject$d;
  3224. var isNullOrUndefined$1 = isNullOrUndefined$7;
  3225. var requireObjectCoercible$3 = requireObjectCoercible$b;
  3226. var speciesConstructor = speciesConstructor$1;
  3227. var advanceStringIndex$1 = advanceStringIndex$3;
  3228. var toLength$3 = toLength$6;
  3229. var toString$3 = toString$f;
  3230. var getMethod$1 = getMethod$5;
  3231. var regExpExec$1 = regexpExecAbstract;
  3232. var stickyHelpers = regexpStickyHelpers;
  3233. var fails$2 = fails$w;
  3234. var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;
  3235. var MAX_UINT32 = 0xFFFFFFFF;
  3236. var min$2 = Math.min;
  3237. var push = uncurryThis$2([].push);
  3238. var stringSlice$1 = uncurryThis$2(''.slice);
  3239. // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
  3240. // Weex JS has frozen built-in prototypes, so use try / catch wrapper
  3241. var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails$2(function () {
  3242. // eslint-disable-next-line regexp/no-empty-group -- required for testing
  3243. var re = /(?:)/;
  3244. var originalExec = re.exec;
  3245. re.exec = function () { return originalExec.apply(this, arguments); };
  3246. var result = 'ab'.split(re);
  3247. return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
  3248. });
  3249. var BUGGY = 'abbc'.split(/(b)*/)[1] === 'c' ||
  3250. // eslint-disable-next-line regexp/no-empty-group -- required for testing
  3251. 'test'.split(/(?:)/, -1).length !== 4 ||
  3252. 'ab'.split(/(?:ab)*/).length !== 2 ||
  3253. '.'.split(/(.?)(.?)/).length !== 4 ||
  3254. // eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing
  3255. '.'.split(/()()/).length > 1 ||
  3256. ''.split(/.?/).length;
  3257. // @@split logic
  3258. fixRegExpWellKnownSymbolLogic$1('split', function (SPLIT, nativeSplit, maybeCallNative) {
  3259. var internalSplit = '0'.split(undefined, 0).length ? function (separator, limit) {
  3260. return separator === undefined && limit === 0 ? [] : call$1(nativeSplit, this, separator, limit);
  3261. } : nativeSplit;
  3262. return [
  3263. // `String.prototype.split` method
  3264. // https://tc39.es/ecma262/#sec-string.prototype.split
  3265. function split(separator, limit) {
  3266. var O = requireObjectCoercible$3(this);
  3267. var splitter = isNullOrUndefined$1(separator) ? undefined : getMethod$1(separator, SPLIT);
  3268. return splitter
  3269. ? call$1(splitter, separator, O, limit)
  3270. : call$1(internalSplit, toString$3(O), separator, limit);
  3271. },
  3272. // `RegExp.prototype[@@split]` method
  3273. // https://tc39.es/ecma262/#sec-regexp.prototype-@@split
  3274. //
  3275. // NOTE: This cannot be properly polyfilled in engines that don't support
  3276. // the 'y' flag.
  3277. function (string, limit) {
  3278. var rx = anObject$1(this);
  3279. var S = toString$3(string);
  3280. if (!BUGGY) {
  3281. var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit);
  3282. if (res.done) return res.value;
  3283. }
  3284. var C = speciesConstructor(rx, RegExp);
  3285. var unicodeMatching = rx.unicode;
  3286. var flags = (rx.ignoreCase ? 'i' : '') +
  3287. (rx.multiline ? 'm' : '') +
  3288. (rx.unicode ? 'u' : '') +
  3289. (UNSUPPORTED_Y ? 'g' : 'y');
  3290. // ^(? + rx + ) is needed, in combination with some S slicing, to
  3291. // simulate the 'y' flag.
  3292. var splitter = new C(UNSUPPORTED_Y ? '^(?:' + rx.source + ')' : rx, flags);
  3293. var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
  3294. if (lim === 0) return [];
  3295. if (S.length === 0) return regExpExec$1(splitter, S) === null ? [S] : [];
  3296. var p = 0;
  3297. var q = 0;
  3298. var A = [];
  3299. while (q < S.length) {
  3300. splitter.lastIndex = UNSUPPORTED_Y ? 0 : q;
  3301. var z = regExpExec$1(splitter, UNSUPPORTED_Y ? stringSlice$1(S, q) : S);
  3302. var e;
  3303. if (
  3304. z === null ||
  3305. (e = min$2(toLength$3(splitter.lastIndex + (UNSUPPORTED_Y ? q : 0)), S.length)) === p
  3306. ) {
  3307. q = advanceStringIndex$1(S, q, unicodeMatching);
  3308. } else {
  3309. push(A, stringSlice$1(S, p, q));
  3310. if (A.length === lim) return A;
  3311. for (var i = 1; i <= z.length - 1; i++) {
  3312. push(A, z[i]);
  3313. if (A.length === lim) return A;
  3314. }
  3315. q = p = e;
  3316. }
  3317. }
  3318. push(A, stringSlice$1(S, p));
  3319. return A;
  3320. }
  3321. ];
  3322. }, BUGGY || !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y);
  3323. var PROPER_FUNCTION_NAME = functionName.PROPER;
  3324. var fails$1 = fails$w;
  3325. var whitespaces = whitespaces$4;
  3326. var non = '\u200B\u0085\u180E';
  3327. // check that a method works with the correct list
  3328. // of whitespaces and has a correct name
  3329. var stringTrimForced = function (METHOD_NAME) {
  3330. return fails$1(function () {
  3331. return !!whitespaces[METHOD_NAME]()
  3332. || non[METHOD_NAME]() !== non
  3333. || (PROPER_FUNCTION_NAME && whitespaces[METHOD_NAME].name !== METHOD_NAME);
  3334. });
  3335. };
  3336. var $$3 = _export;
  3337. var $trim = stringTrim.trim;
  3338. var forcedStringTrimMethod = stringTrimForced;
  3339. // `String.prototype.trim` method
  3340. // https://tc39.es/ecma262/#sec-string.prototype.trim
  3341. $$3({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
  3342. trim: function trim() {
  3343. return $trim(this);
  3344. }
  3345. });
  3346. // iterable DOM collections
  3347. // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
  3348. var domIterables = {
  3349. CSSRuleList: 0,
  3350. CSSStyleDeclaration: 0,
  3351. CSSValueList: 0,
  3352. ClientRectList: 0,
  3353. DOMRectList: 0,
  3354. DOMStringList: 0,
  3355. DOMTokenList: 1,
  3356. DataTransferItemList: 0,
  3357. FileList: 0,
  3358. HTMLAllCollection: 0,
  3359. HTMLCollection: 0,
  3360. HTMLFormElement: 0,
  3361. HTMLSelectElement: 0,
  3362. MediaList: 0,
  3363. MimeTypeArray: 0,
  3364. NamedNodeMap: 0,
  3365. NodeList: 1,
  3366. PaintRequestList: 0,
  3367. Plugin: 0,
  3368. PluginArray: 0,
  3369. SVGLengthList: 0,
  3370. SVGNumberList: 0,
  3371. SVGPathSegList: 0,
  3372. SVGPointList: 0,
  3373. SVGStringList: 0,
  3374. SVGTransformList: 0,
  3375. SourceBufferList: 0,
  3376. StyleSheetList: 0,
  3377. TextTrackCueList: 0,
  3378. TextTrackList: 0,
  3379. TouchList: 0
  3380. };
  3381. // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
  3382. var documentCreateElement = documentCreateElement$2;
  3383. var classList = documentCreateElement('span').classList;
  3384. var DOMTokenListPrototype$2 = classList && classList.constructor && classList.constructor.prototype;
  3385. var domTokenListPrototype = DOMTokenListPrototype$2 === Object.prototype ? undefined : DOMTokenListPrototype$2;
  3386. var $forEach = arrayIteration.forEach;
  3387. var arrayMethodIsStrict = arrayMethodIsStrict$4;
  3388. var STRICT_METHOD = arrayMethodIsStrict('forEach');
  3389. // `Array.prototype.forEach` method implementation
  3390. // https://tc39.es/ecma262/#sec-array.prototype.foreach
  3391. var arrayForEach = !STRICT_METHOD ? function forEach(callbackfn /* , thisArg */) {
  3392. return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  3393. // eslint-disable-next-line es/no-array-prototype-foreach -- safe
  3394. } : [].forEach;
  3395. var global$2 = global$k;
  3396. var DOMIterables$1 = domIterables;
  3397. var DOMTokenListPrototype$1 = domTokenListPrototype;
  3398. var forEach = arrayForEach;
  3399. var createNonEnumerableProperty$1 = createNonEnumerableProperty$7;
  3400. var handlePrototype$1 = function (CollectionPrototype) {
  3401. // some Chrome versions have non-configurable methods on DOMTokenList
  3402. if (CollectionPrototype && CollectionPrototype.forEach !== forEach) try {
  3403. createNonEnumerableProperty$1(CollectionPrototype, 'forEach', forEach);
  3404. } catch (error) {
  3405. CollectionPrototype.forEach = forEach;
  3406. }
  3407. };
  3408. for (var COLLECTION_NAME$1 in DOMIterables$1) {
  3409. if (DOMIterables$1[COLLECTION_NAME$1]) {
  3410. handlePrototype$1(global$2[COLLECTION_NAME$1] && global$2[COLLECTION_NAME$1].prototype);
  3411. }
  3412. }
  3413. handlePrototype$1(DOMTokenListPrototype$1);
  3414. var global$1 = global$k;
  3415. var DOMIterables = domIterables;
  3416. var DOMTokenListPrototype = domTokenListPrototype;
  3417. var ArrayIteratorMethods = es_array_iterator;
  3418. var createNonEnumerableProperty = createNonEnumerableProperty$7;
  3419. var setToStringTag = setToStringTag$3;
  3420. var wellKnownSymbol = wellKnownSymbol$j;
  3421. var ITERATOR = wellKnownSymbol('iterator');
  3422. var ArrayValues = ArrayIteratorMethods.values;
  3423. var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
  3424. if (CollectionPrototype) {
  3425. // some Chrome versions have non-configurable methods on DOMTokenList
  3426. if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
  3427. createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
  3428. } catch (error) {
  3429. CollectionPrototype[ITERATOR] = ArrayValues;
  3430. }
  3431. setToStringTag(CollectionPrototype, COLLECTION_NAME, true);
  3432. if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
  3433. // some Chrome versions have non-configurable methods on DOMTokenList
  3434. if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
  3435. createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
  3436. } catch (error) {
  3437. CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
  3438. }
  3439. }
  3440. }
  3441. };
  3442. for (var COLLECTION_NAME in DOMIterables) {
  3443. handlePrototype(global$1[COLLECTION_NAME] && global$1[COLLECTION_NAME].prototype, COLLECTION_NAME);
  3444. }
  3445. handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
  3446. var $$2 = _export;
  3447. var fails = fails$w;
  3448. var toObject = toObject$a;
  3449. var nativeGetPrototypeOf = objectGetPrototypeOf$1;
  3450. var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
  3451. var FAILS_ON_PRIMITIVES = fails(function () { nativeGetPrototypeOf(1); });
  3452. // `Object.getPrototypeOf` method
  3453. // https://tc39.es/ecma262/#sec-object.getprototypeof
  3454. $$2({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !CORRECT_PROTOTYPE_GETTER }, {
  3455. getPrototypeOf: function getPrototypeOf(it) {
  3456. return nativeGetPrototypeOf(toObject(it));
  3457. }
  3458. });
  3459. var $$1 = _export;
  3460. var uncurryThis$1 = functionUncurryThisClause;
  3461. var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
  3462. var toLength$2 = toLength$6;
  3463. var toString$2 = toString$f;
  3464. var notARegExp$1 = notARegexp;
  3465. var requireObjectCoercible$2 = requireObjectCoercible$b;
  3466. var correctIsRegExpLogic$1 = correctIsRegexpLogic;
  3467. var slice = uncurryThis$1(''.slice);
  3468. var min$1 = Math.min;
  3469. var CORRECT_IS_REGEXP_LOGIC$1 = correctIsRegExpLogic$1('endsWith');
  3470. // https://github.com/zloirock/core-js/pull/702
  3471. var MDN_POLYFILL_BUG$1 = !CORRECT_IS_REGEXP_LOGIC$1 && !!function () {
  3472. var descriptor = getOwnPropertyDescriptor$1(String.prototype, 'endsWith');
  3473. return descriptor && !descriptor.writable;
  3474. }();
  3475. // `String.prototype.endsWith` method
  3476. // https://tc39.es/ecma262/#sec-string.prototype.endswith
  3477. $$1({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG$1 && !CORRECT_IS_REGEXP_LOGIC$1 }, {
  3478. endsWith: function endsWith(searchString /* , endPosition = @length */) {
  3479. var that = toString$2(requireObjectCoercible$2(this));
  3480. notARegExp$1(searchString);
  3481. var endPosition = arguments.length > 1 ? arguments[1] : undefined;
  3482. var len = that.length;
  3483. var end = endPosition === undefined ? len : min$1(toLength$2(endPosition), len);
  3484. var search = toString$2(searchString);
  3485. return slice(that, end - search.length, end) === search;
  3486. }
  3487. });
  3488. var call = functionCall;
  3489. var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
  3490. var anObject = anObject$d;
  3491. var isNullOrUndefined = isNullOrUndefined$7;
  3492. var toLength$1 = toLength$6;
  3493. var toString$1 = toString$f;
  3494. var requireObjectCoercible$1 = requireObjectCoercible$b;
  3495. var getMethod = getMethod$5;
  3496. var advanceStringIndex = advanceStringIndex$3;
  3497. var regExpExec = regexpExecAbstract;
  3498. // @@match logic
  3499. fixRegExpWellKnownSymbolLogic('match', function (MATCH, nativeMatch, maybeCallNative) {
  3500. return [
  3501. // `String.prototype.match` method
  3502. // https://tc39.es/ecma262/#sec-string.prototype.match
  3503. function match(regexp) {
  3504. var O = requireObjectCoercible$1(this);
  3505. var matcher = isNullOrUndefined(regexp) ? undefined : getMethod(regexp, MATCH);
  3506. return matcher ? call(matcher, regexp, O) : new RegExp(regexp)[MATCH](toString$1(O));
  3507. },
  3508. // `RegExp.prototype[@@match]` method
  3509. // https://tc39.es/ecma262/#sec-regexp.prototype-@@match
  3510. function (string) {
  3511. var rx = anObject(this);
  3512. var S = toString$1(string);
  3513. var res = maybeCallNative(nativeMatch, rx, S);
  3514. if (res.done) return res.value;
  3515. if (!rx.global) return regExpExec(rx, S);
  3516. var fullUnicode = rx.unicode;
  3517. rx.lastIndex = 0;
  3518. var A = [];
  3519. var n = 0;
  3520. var result;
  3521. while ((result = regExpExec(rx, S)) !== null) {
  3522. var matchStr = toString$1(result[0]);
  3523. A[n] = matchStr;
  3524. if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength$1(rx.lastIndex), fullUnicode);
  3525. n++;
  3526. }
  3527. return n === 0 ? null : A;
  3528. }
  3529. ];
  3530. });
  3531. var $ = _export;
  3532. var uncurryThis = functionUncurryThisClause;
  3533. var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
  3534. var toLength = toLength$6;
  3535. var toString = toString$f;
  3536. var notARegExp = notARegexp;
  3537. var requireObjectCoercible = requireObjectCoercible$b;
  3538. var correctIsRegExpLogic = correctIsRegexpLogic;
  3539. var stringSlice = uncurryThis(''.slice);
  3540. var min = Math.min;
  3541. var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('startsWith');
  3542. // https://github.com/zloirock/core-js/pull/702
  3543. var MDN_POLYFILL_BUG = !CORRECT_IS_REGEXP_LOGIC && !!function () {
  3544. var descriptor = getOwnPropertyDescriptor(String.prototype, 'startsWith');
  3545. return descriptor && !descriptor.writable;
  3546. }();
  3547. // `String.prototype.startsWith` method
  3548. // https://tc39.es/ecma262/#sec-string.prototype.startswith
  3549. $({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {
  3550. startsWith: function startsWith(searchString /* , position = 0 */) {
  3551. var that = toString(requireObjectCoercible(this));
  3552. notARegExp(searchString);
  3553. var index = toLength(min(arguments.length > 1 ? arguments[1] : undefined, that.length));
  3554. var search = toString(searchString);
  3555. return stringSlice(that, index, index + search.length) === search;
  3556. }
  3557. });
  3558. var Utils = {
  3559. getBootstrapVersion: function getBootstrapVersion() {
  3560. var bootstrapVersion = 5;
  3561. try {
  3562. var rawVersion = $$p.fn.dropdown.Constructor.VERSION;
  3563. // Only try to parse VERSION if it is defined.
  3564. // It is undefined in older versions of Bootstrap (tested with 3.1.1).
  3565. if (rawVersion !== undefined) {
  3566. bootstrapVersion = parseInt(rawVersion, 10);
  3567. }
  3568. } catch (e) {
  3569. // ignore
  3570. }
  3571. try {
  3572. // eslint-disable-next-line no-undef
  3573. var _rawVersion = bootstrap.Tooltip.VERSION;
  3574. if (_rawVersion !== undefined) {
  3575. bootstrapVersion = parseInt(_rawVersion, 10);
  3576. }
  3577. } catch (e) {
  3578. // ignore
  3579. }
  3580. return bootstrapVersion;
  3581. },
  3582. getIconsPrefix: function getIconsPrefix(theme) {
  3583. return {
  3584. bootstrap3: 'glyphicon',
  3585. bootstrap4: 'fa',
  3586. bootstrap5: 'bi',
  3587. 'bootstrap-table': 'icon',
  3588. bulma: 'fa',
  3589. foundation: 'fa',
  3590. materialize: 'material-icons',
  3591. semantic: 'fa'
  3592. }[theme] || 'fa';
  3593. },
  3594. getIcons: function getIcons(prefix) {
  3595. return {
  3596. glyphicon: {
  3597. paginationSwitchDown: 'glyphicon-collapse-down icon-chevron-down',
  3598. paginationSwitchUp: 'glyphicon-collapse-up icon-chevron-up',
  3599. refresh: 'glyphicon-refresh icon-refresh',
  3600. toggleOff: 'glyphicon-list-alt icon-list-alt',
  3601. toggleOn: 'glyphicon-list-alt icon-list-alt',
  3602. columns: 'glyphicon-th icon-th',
  3603. detailOpen: 'glyphicon-plus icon-plus',
  3604. detailClose: 'glyphicon-minus icon-minus',
  3605. fullscreen: 'glyphicon-fullscreen',
  3606. search: 'glyphicon-search',
  3607. clearSearch: 'glyphicon-trash'
  3608. },
  3609. fa: {
  3610. paginationSwitchDown: 'fa-caret-square-down',
  3611. paginationSwitchUp: 'fa-caret-square-up',
  3612. refresh: 'fa-sync',
  3613. toggleOff: 'fa-toggle-off',
  3614. toggleOn: 'fa-toggle-on',
  3615. columns: 'fa-th-list',
  3616. detailOpen: 'fa-plus',
  3617. detailClose: 'fa-minus',
  3618. fullscreen: 'fa-arrows-alt',
  3619. search: 'fa-search',
  3620. clearSearch: 'fa-trash'
  3621. },
  3622. bi: {
  3623. paginationSwitchDown: 'bi-caret-down-square',
  3624. paginationSwitchUp: 'bi-caret-up-square',
  3625. refresh: 'bi-arrow-clockwise',
  3626. toggleOff: 'bi-toggle-off',
  3627. toggleOn: 'bi-toggle-on',
  3628. columns: 'bi-list-ul',
  3629. detailOpen: 'bi-plus',
  3630. detailClose: 'bi-dash',
  3631. fullscreen: 'bi-arrows-move',
  3632. search: 'bi-search',
  3633. clearSearch: 'bi-trash'
  3634. },
  3635. icon: {
  3636. paginationSwitchDown: 'icon-arrow-up-circle',
  3637. paginationSwitchUp: 'icon-arrow-down-circle',
  3638. refresh: 'icon-refresh-cw',
  3639. toggleOff: 'icon-toggle-right',
  3640. toggleOn: 'icon-toggle-right',
  3641. columns: 'icon-list',
  3642. detailOpen: 'icon-plus',
  3643. detailClose: 'icon-minus',
  3644. fullscreen: 'icon-maximize',
  3645. search: 'icon-search',
  3646. clearSearch: 'icon-trash-2'
  3647. },
  3648. 'material-icons': {
  3649. paginationSwitchDown: 'grid_on',
  3650. paginationSwitchUp: 'grid_off',
  3651. refresh: 'refresh',
  3652. toggleOff: 'tablet',
  3653. toggleOn: 'tablet_android',
  3654. columns: 'view_list',
  3655. detailOpen: 'add',
  3656. detailClose: 'remove',
  3657. fullscreen: 'fullscreen',
  3658. sort: 'sort',
  3659. search: 'search',
  3660. clearSearch: 'delete'
  3661. }
  3662. }[prefix];
  3663. },
  3664. getSearchInput: function getSearchInput(that) {
  3665. if (typeof that.options.searchSelector === 'string') {
  3666. return $$p(that.options.searchSelector);
  3667. }
  3668. return that.$toolbar.find('.search input');
  3669. },
  3670. // $.extend: https://github.com/jquery/jquery/blob/3.6.2/src/core.js#L132
  3671. extend: function extend() {
  3672. var _this = this;
  3673. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  3674. args[_key] = arguments[_key];
  3675. }
  3676. var target = args[0] || {};
  3677. var i = 1;
  3678. var deep = false;
  3679. var clone;
  3680. // Handle a deep copy situation
  3681. if (typeof target === 'boolean') {
  3682. deep = target;
  3683. // Skip the boolean and the target
  3684. target = args[i] || {};
  3685. i++;
  3686. }
  3687. // Handle case when target is a string or something (possible in deep copy)
  3688. if (_typeof(target) !== 'object' && typeof target !== 'function') {
  3689. target = {};
  3690. }
  3691. for (; i < args.length; i++) {
  3692. var options = args[i];
  3693. // Ignore undefined/null values
  3694. if (typeof options === 'undefined' || options === null) {
  3695. continue;
  3696. }
  3697. // Extend the base object
  3698. // eslint-disable-next-line guard-for-in
  3699. for (var name in options) {
  3700. var copy = options[name];
  3701. // Prevent Object.prototype pollution
  3702. // Prevent never-ending loop
  3703. if (name === '__proto__' || target === copy) {
  3704. continue;
  3705. }
  3706. var copyIsArray = Array.isArray(copy);
  3707. // Recurse if we're merging plain objects or arrays
  3708. if (deep && copy && (this.isObject(copy) || copyIsArray)) {
  3709. var src = target[name];
  3710. if (copyIsArray && Array.isArray(src)) {
  3711. if (src.every(function (it) {
  3712. return !_this.isObject(it) && !Array.isArray(it);
  3713. })) {
  3714. target[name] = copy;
  3715. continue;
  3716. }
  3717. }
  3718. if (copyIsArray && !Array.isArray(src)) {
  3719. clone = [];
  3720. } else if (!copyIsArray && !this.isObject(src)) {
  3721. clone = {};
  3722. } else {
  3723. clone = src;
  3724. }
  3725. // Never move original objects, clone them
  3726. target[name] = this.extend(deep, clone, copy);
  3727. // Don't bring in undefined values
  3728. } else if (copy !== undefined) {
  3729. target[name] = copy;
  3730. }
  3731. }
  3732. }
  3733. return target;
  3734. },
  3735. // it only does '%s', and return '' when arguments are undefined
  3736. sprintf: function sprintf(_str) {
  3737. for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  3738. args[_key2 - 1] = arguments[_key2];
  3739. }
  3740. var flag = true;
  3741. var i = 0;
  3742. var str = _str.replace(/%s/g, function () {
  3743. var arg = args[i++];
  3744. if (typeof arg === 'undefined') {
  3745. flag = false;
  3746. return '';
  3747. }
  3748. return arg;
  3749. });
  3750. return flag ? str : '';
  3751. },
  3752. isObject: function isObject(obj) {
  3753. if (_typeof(obj) !== 'object' || obj === null) {
  3754. return false;
  3755. }
  3756. var proto = obj;
  3757. while (Object.getPrototypeOf(proto) !== null) {
  3758. proto = Object.getPrototypeOf(proto);
  3759. }
  3760. return Object.getPrototypeOf(obj) === proto;
  3761. },
  3762. isEmptyObject: function isEmptyObject() {
  3763. var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  3764. return Object.entries(obj).length === 0 && obj.constructor === Object;
  3765. },
  3766. isNumeric: function isNumeric(n) {
  3767. return !isNaN(parseFloat(n)) && isFinite(n);
  3768. },
  3769. getFieldTitle: function getFieldTitle(list, value) {
  3770. var _iterator = _createForOfIteratorHelper(list),
  3771. _step;
  3772. try {
  3773. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  3774. var item = _step.value;
  3775. if (item.field === value) {
  3776. return item.title;
  3777. }
  3778. }
  3779. } catch (err) {
  3780. _iterator.e(err);
  3781. } finally {
  3782. _iterator.f();
  3783. }
  3784. return '';
  3785. },
  3786. setFieldIndex: function setFieldIndex(columns) {
  3787. var totalCol = 0;
  3788. var flag = [];
  3789. var _iterator2 = _createForOfIteratorHelper(columns[0]),
  3790. _step2;
  3791. try {
  3792. for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
  3793. var column = _step2.value;
  3794. totalCol += column.colspan || 1;
  3795. }
  3796. } catch (err) {
  3797. _iterator2.e(err);
  3798. } finally {
  3799. _iterator2.f();
  3800. }
  3801. for (var i = 0; i < columns.length; i++) {
  3802. flag[i] = [];
  3803. for (var j = 0; j < totalCol; j++) {
  3804. flag[i][j] = false;
  3805. }
  3806. }
  3807. for (var _i = 0; _i < columns.length; _i++) {
  3808. var _iterator3 = _createForOfIteratorHelper(columns[_i]),
  3809. _step3;
  3810. try {
  3811. for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
  3812. var r = _step3.value;
  3813. var rowspan = r.rowspan || 1;
  3814. var colspan = r.colspan || 1;
  3815. var index = flag[_i].indexOf(false);
  3816. r.colspanIndex = index;
  3817. if (colspan === 1) {
  3818. r.fieldIndex = index;
  3819. // when field is undefined, use index instead
  3820. if (typeof r.field === 'undefined') {
  3821. r.field = index;
  3822. }
  3823. } else {
  3824. r.colspanGroup = r.colspan;
  3825. }
  3826. for (var _j = 0; _j < rowspan; _j++) {
  3827. for (var k = 0; k < colspan; k++) {
  3828. flag[_i + _j][index + k] = true;
  3829. }
  3830. }
  3831. }
  3832. } catch (err) {
  3833. _iterator3.e(err);
  3834. } finally {
  3835. _iterator3.f();
  3836. }
  3837. }
  3838. },
  3839. normalizeAccent: function normalizeAccent(value) {
  3840. if (typeof value !== 'string') {
  3841. return value;
  3842. }
  3843. return value.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
  3844. },
  3845. updateFieldGroup: function updateFieldGroup(columns, fieldColumns) {
  3846. var _ref;
  3847. var allColumns = (_ref = []).concat.apply(_ref, _toConsumableArray(columns));
  3848. var _iterator4 = _createForOfIteratorHelper(columns),
  3849. _step4;
  3850. try {
  3851. for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
  3852. var c = _step4.value;
  3853. var _iterator6 = _createForOfIteratorHelper(c),
  3854. _step6;
  3855. try {
  3856. for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
  3857. var r = _step6.value;
  3858. if (r.colspanGroup > 1) {
  3859. var colspan = 0;
  3860. var _loop = function _loop(i) {
  3861. var column = allColumns.find(function (col) {
  3862. return col.fieldIndex === i;
  3863. });
  3864. if (column.visible) {
  3865. colspan++;
  3866. }
  3867. };
  3868. for (var i = r.colspanIndex; i < r.colspanIndex + r.colspanGroup; i++) {
  3869. _loop(i);
  3870. }
  3871. r.colspan = colspan;
  3872. r.visible = colspan > 0;
  3873. }
  3874. }
  3875. } catch (err) {
  3876. _iterator6.e(err);
  3877. } finally {
  3878. _iterator6.f();
  3879. }
  3880. }
  3881. } catch (err) {
  3882. _iterator4.e(err);
  3883. } finally {
  3884. _iterator4.f();
  3885. }
  3886. if (columns.length < 2) {
  3887. return;
  3888. }
  3889. var _iterator5 = _createForOfIteratorHelper(fieldColumns),
  3890. _step5;
  3891. try {
  3892. var _loop2 = function _loop2() {
  3893. var column = _step5.value;
  3894. var sameColumns = allColumns.filter(function (col) {
  3895. return col.fieldIndex === column.fieldIndex;
  3896. });
  3897. if (sameColumns.length > 1) {
  3898. var _iterator7 = _createForOfIteratorHelper(sameColumns),
  3899. _step7;
  3900. try {
  3901. for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
  3902. var _c = _step7.value;
  3903. _c.visible = column.visible;
  3904. }
  3905. } catch (err) {
  3906. _iterator7.e(err);
  3907. } finally {
  3908. _iterator7.f();
  3909. }
  3910. }
  3911. };
  3912. for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
  3913. _loop2();
  3914. }
  3915. } catch (err) {
  3916. _iterator5.e(err);
  3917. } finally {
  3918. _iterator5.f();
  3919. }
  3920. },
  3921. getScrollBarWidth: function getScrollBarWidth() {
  3922. if (this.cachedWidth === undefined) {
  3923. var $inner = $$p('<div/>').addClass('fixed-table-scroll-inner');
  3924. var $outer = $$p('<div/>').addClass('fixed-table-scroll-outer');
  3925. $outer.append($inner);
  3926. $$p('body').append($outer);
  3927. var w1 = $inner[0].offsetWidth;
  3928. $outer.css('overflow', 'scroll');
  3929. var w2 = $inner[0].offsetWidth;
  3930. if (w1 === w2) {
  3931. w2 = $outer[0].clientWidth;
  3932. }
  3933. $outer.remove();
  3934. this.cachedWidth = w1 - w2;
  3935. }
  3936. return this.cachedWidth;
  3937. },
  3938. calculateObjectValue: function calculateObjectValue(self, name, args, defaultValue) {
  3939. var func = name;
  3940. if (typeof name === 'string') {
  3941. // support obj.func1.func2
  3942. var names = name.split('.');
  3943. if (names.length > 1) {
  3944. func = window;
  3945. var _iterator8 = _createForOfIteratorHelper(names),
  3946. _step8;
  3947. try {
  3948. for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
  3949. var f = _step8.value;
  3950. func = func[f];
  3951. }
  3952. } catch (err) {
  3953. _iterator8.e(err);
  3954. } finally {
  3955. _iterator8.f();
  3956. }
  3957. } else {
  3958. func = window[name];
  3959. }
  3960. }
  3961. if (func !== null && _typeof(func) === 'object') {
  3962. return func;
  3963. }
  3964. if (typeof func === 'function') {
  3965. return func.apply(self, args || []);
  3966. }
  3967. if (!func && typeof name === 'string' && args && this.sprintf.apply(this, [name].concat(_toConsumableArray(args)))) {
  3968. return this.sprintf.apply(this, [name].concat(_toConsumableArray(args)));
  3969. }
  3970. return defaultValue;
  3971. },
  3972. compareObjects: function compareObjects(objectA, objectB, compareLength) {
  3973. var aKeys = Object.keys(objectA);
  3974. var bKeys = Object.keys(objectB);
  3975. if (compareLength && aKeys.length !== bKeys.length) {
  3976. return false;
  3977. }
  3978. for (var _i2 = 0, _aKeys = aKeys; _i2 < _aKeys.length; _i2++) {
  3979. var key = _aKeys[_i2];
  3980. if (bKeys.includes(key) && objectA[key] !== objectB[key]) {
  3981. return false;
  3982. }
  3983. }
  3984. return true;
  3985. },
  3986. regexCompare: function regexCompare(value, search) {
  3987. try {
  3988. var regexpParts = search.match(/^\/(.*?)\/([gim]*)$/);
  3989. if (value.toString().search(regexpParts ? new RegExp(regexpParts[1], regexpParts[2]) : new RegExp(search, 'gim')) !== -1) {
  3990. return true;
  3991. }
  3992. } catch (e) {
  3993. return false;
  3994. }
  3995. return false;
  3996. },
  3997. escapeApostrophe: function escapeApostrophe(value) {
  3998. return value.toString().replace(/'/g, '&#39;');
  3999. },
  4000. escapeHTML: function escapeHTML(text) {
  4001. if (!text) {
  4002. return text;
  4003. }
  4004. return text.toString().replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;').replace(/'/g, '&#39;');
  4005. },
  4006. unescapeHTML: function unescapeHTML(text) {
  4007. if (typeof text !== 'string' || !text) {
  4008. return text;
  4009. }
  4010. return text.toString().replace(/&amp;/g, '&').replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&quot;/g, '"').replace(/&#39;/g, '\'');
  4011. },
  4012. removeHTML: function removeHTML(text) {
  4013. if (!text) {
  4014. return text;
  4015. }
  4016. return text.toString().replace(/(<([^>]+)>)/ig, '').replace(/&[#A-Za-z0-9]+;/gi, '').trim();
  4017. },
  4018. getRealDataAttr: function getRealDataAttr(dataAttr) {
  4019. for (var _i3 = 0, _Object$entries = Object.entries(dataAttr); _i3 < _Object$entries.length; _i3++) {
  4020. var _Object$entries$_i = _slicedToArray(_Object$entries[_i3], 2),
  4021. attr = _Object$entries$_i[0],
  4022. value = _Object$entries$_i[1];
  4023. var auxAttr = attr.split(/(?=[A-Z])/).join('-').toLowerCase();
  4024. if (auxAttr !== attr) {
  4025. dataAttr[auxAttr] = value;
  4026. delete dataAttr[attr];
  4027. }
  4028. }
  4029. return dataAttr;
  4030. },
  4031. getItemField: function getItemField(item, field, escape) {
  4032. var columnEscape = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined;
  4033. var value = item;
  4034. // use column escape if it is defined
  4035. if (typeof columnEscape !== 'undefined') {
  4036. escape = columnEscape;
  4037. }
  4038. if (typeof field !== 'string' || item.hasOwnProperty(field)) {
  4039. return escape ? this.escapeHTML(item[field]) : item[field];
  4040. }
  4041. var props = field.split('.');
  4042. var _iterator9 = _createForOfIteratorHelper(props),
  4043. _step9;
  4044. try {
  4045. for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
  4046. var p = _step9.value;
  4047. value = value && value[p];
  4048. }
  4049. } catch (err) {
  4050. _iterator9.e(err);
  4051. } finally {
  4052. _iterator9.f();
  4053. }
  4054. return escape ? this.escapeHTML(value) : value;
  4055. },
  4056. isIEBrowser: function isIEBrowser() {
  4057. return navigator.userAgent.includes('MSIE ') || /Trident.*rv:11\./.test(navigator.userAgent);
  4058. },
  4059. findIndex: function findIndex(items, item) {
  4060. var _iterator10 = _createForOfIteratorHelper(items),
  4061. _step10;
  4062. try {
  4063. for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
  4064. var it = _step10.value;
  4065. if (JSON.stringify(it) === JSON.stringify(item)) {
  4066. return items.indexOf(it);
  4067. }
  4068. }
  4069. } catch (err) {
  4070. _iterator10.e(err);
  4071. } finally {
  4072. _iterator10.f();
  4073. }
  4074. return -1;
  4075. },
  4076. trToData: function trToData(columns, $els) {
  4077. var _this2 = this;
  4078. var data = [];
  4079. var m = [];
  4080. $els.each(function (y, el) {
  4081. var $el = $$p(el);
  4082. var row = {};
  4083. // save tr's id, class and data-* attributes
  4084. row._id = $el.attr('id');
  4085. row._class = $el.attr('class');
  4086. row._data = _this2.getRealDataAttr($el.data());
  4087. row._style = $el.attr('style');
  4088. $el.find('>td,>th').each(function (_x, el) {
  4089. var $el = $$p(el);
  4090. var colspan = +$el.attr('colspan') || 1;
  4091. var rowspan = +$el.attr('rowspan') || 1;
  4092. var x = _x;
  4093. // skip already occupied cells in current row
  4094. for (; m[y] && m[y][x]; x++) {
  4095. // ignore
  4096. }
  4097. // mark matrix elements occupied by current cell with true
  4098. for (var tx = x; tx < x + colspan; tx++) {
  4099. for (var ty = y; ty < y + rowspan; ty++) {
  4100. if (!m[ty]) {
  4101. // fill missing rows
  4102. m[ty] = [];
  4103. }
  4104. m[ty][tx] = true;
  4105. }
  4106. }
  4107. var field = columns[x].field;
  4108. row[field] = _this2.escapeApostrophe($el.html().trim());
  4109. // save td's id, class and data-* attributes
  4110. row["_".concat(field, "_id")] = $el.attr('id');
  4111. row["_".concat(field, "_class")] = $el.attr('class');
  4112. row["_".concat(field, "_rowspan")] = $el.attr('rowspan');
  4113. row["_".concat(field, "_colspan")] = $el.attr('colspan');
  4114. row["_".concat(field, "_title")] = $el.attr('title');
  4115. row["_".concat(field, "_data")] = _this2.getRealDataAttr($el.data());
  4116. row["_".concat(field, "_style")] = $el.attr('style');
  4117. });
  4118. data.push(row);
  4119. });
  4120. return data;
  4121. },
  4122. sort: function sort(a, b, order, options, aPosition, bPosition) {
  4123. if (a === undefined || a === null) {
  4124. a = '';
  4125. }
  4126. if (b === undefined || b === null) {
  4127. b = '';
  4128. }
  4129. if (options.sortStable && a === b) {
  4130. a = aPosition;
  4131. b = bPosition;
  4132. }
  4133. // If both values are numeric, do a numeric comparison
  4134. if (this.isNumeric(a) && this.isNumeric(b)) {
  4135. // Convert numerical values form string to float.
  4136. a = parseFloat(a);
  4137. b = parseFloat(b);
  4138. if (a < b) {
  4139. return order * -1;
  4140. }
  4141. if (a > b) {
  4142. return order;
  4143. }
  4144. return 0;
  4145. }
  4146. if (options.sortEmptyLast) {
  4147. if (a === '') {
  4148. return 1;
  4149. }
  4150. if (b === '') {
  4151. return -1;
  4152. }
  4153. }
  4154. if (a === b) {
  4155. return 0;
  4156. }
  4157. // If value is not a string, convert to string
  4158. if (typeof a !== 'string') {
  4159. a = a.toString();
  4160. }
  4161. if (a.localeCompare(b) === -1) {
  4162. return order * -1;
  4163. }
  4164. return order;
  4165. },
  4166. getEventName: function getEventName(eventPrefix) {
  4167. var id = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
  4168. id = id || "".concat(+new Date()).concat(~~(Math.random() * 1000000));
  4169. return "".concat(eventPrefix, "-").concat(id);
  4170. },
  4171. hasDetailViewIcon: function hasDetailViewIcon(options) {
  4172. return options.detailView && options.detailViewIcon && !options.cardView;
  4173. },
  4174. getDetailViewIndexOffset: function getDetailViewIndexOffset(options) {
  4175. return this.hasDetailViewIcon(options) && options.detailViewAlign !== 'right' ? 1 : 0;
  4176. },
  4177. checkAutoMergeCells: function checkAutoMergeCells(data) {
  4178. var _iterator11 = _createForOfIteratorHelper(data),
  4179. _step11;
  4180. try {
  4181. for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
  4182. var row = _step11.value;
  4183. for (var _i4 = 0, _Object$keys = Object.keys(row); _i4 < _Object$keys.length; _i4++) {
  4184. var key = _Object$keys[_i4];
  4185. if (key.startsWith('_') && (key.endsWith('_rowspan') || key.endsWith('_colspan'))) {
  4186. return true;
  4187. }
  4188. }
  4189. }
  4190. } catch (err) {
  4191. _iterator11.e(err);
  4192. } finally {
  4193. _iterator11.f();
  4194. }
  4195. return false;
  4196. },
  4197. deepCopy: function deepCopy(arg) {
  4198. if (arg === undefined) {
  4199. return arg;
  4200. }
  4201. return this.extend(true, Array.isArray(arg) ? [] : {}, arg);
  4202. },
  4203. debounce: function debounce(func, wait, immediate) {
  4204. var timeout;
  4205. return function executedFunction() {
  4206. var context = this;
  4207. var args = arguments;
  4208. var later = function later() {
  4209. timeout = null;
  4210. if (!immediate) func.apply(context, args);
  4211. };
  4212. var callNow = immediate && !timeout;
  4213. clearTimeout(timeout);
  4214. timeout = setTimeout(later, wait);
  4215. if (callNow) func.apply(context, args);
  4216. };
  4217. }
  4218. };
  4219. var VERSION = '1.22.3';
  4220. var bootstrapVersion = Utils.getBootstrapVersion();
  4221. var CONSTANTS = {
  4222. 3: {
  4223. classes: {
  4224. buttonsPrefix: 'btn',
  4225. buttons: 'default',
  4226. buttonsGroup: 'btn-group',
  4227. buttonsDropdown: 'btn-group',
  4228. pull: 'pull',
  4229. inputGroup: 'input-group',
  4230. inputPrefix: 'input-',
  4231. input: 'form-control',
  4232. select: 'form-control',
  4233. paginationDropdown: 'btn-group dropdown',
  4234. dropup: 'dropup',
  4235. dropdownActive: 'active',
  4236. paginationActive: 'active',
  4237. buttonActive: 'active'
  4238. },
  4239. html: {
  4240. toolbarDropdown: ['<ul class="dropdown-menu" role="menu">', '</ul>'],
  4241. toolbarDropdownItem: '<li class="dropdown-item-marker" role="menuitem"><label>%s</label></li>',
  4242. toolbarDropdownSeparator: '<li class="divider"></li>',
  4243. pageDropdown: ['<ul class="dropdown-menu" role="menu">', '</ul>'],
  4244. pageDropdownItem: '<li role="menuitem" class="%s"><a href="#">%s</a></li>',
  4245. dropdownCaret: '<span class="caret"></span>',
  4246. pagination: ['<ul class="pagination%s">', '</ul>'],
  4247. paginationItem: '<li class="page-item%s"><a class="page-link" aria-label="%s" href="javascript:void(0)">%s</a></li>',
  4248. icon: '<i class="%s %s"></i>',
  4249. inputGroup: '<div class="input-group">%s<span class="input-group-btn">%s</span></div>',
  4250. searchInput: '<input class="%s%s" type="text" placeholder="%s">',
  4251. searchButton: '<button class="%s" type="button" name="search" title="%s">%s %s</button>',
  4252. searchClearButton: '<button class="%s" type="button" name="clearSearch" title="%s">%s %s</button>'
  4253. }
  4254. },
  4255. 4: {
  4256. classes: {
  4257. buttonsPrefix: 'btn',
  4258. buttons: 'secondary',
  4259. buttonsGroup: 'btn-group',
  4260. buttonsDropdown: 'btn-group',
  4261. pull: 'float',
  4262. inputGroup: 'btn-group',
  4263. inputPrefix: 'form-control-',
  4264. input: 'form-control',
  4265. select: 'form-control',
  4266. paginationDropdown: 'btn-group dropdown',
  4267. dropup: 'dropup',
  4268. dropdownActive: 'active',
  4269. paginationActive: 'active',
  4270. buttonActive: 'active'
  4271. },
  4272. html: {
  4273. toolbarDropdown: ['<div class="dropdown-menu dropdown-menu-right">', '</div>'],
  4274. toolbarDropdownItem: '<label class="dropdown-item dropdown-item-marker">%s</label>',
  4275. pageDropdown: ['<div class="dropdown-menu">', '</div>'],
  4276. pageDropdownItem: '<a class="dropdown-item %s" href="#">%s</a>',
  4277. toolbarDropdownSeparator: '<div class="dropdown-divider"></div>',
  4278. dropdownCaret: '<span class="caret"></span>',
  4279. pagination: ['<ul class="pagination%s">', '</ul>'],
  4280. paginationItem: '<li class="page-item%s"><a class="page-link" aria-label="%s" href="javascript:void(0)">%s</a></li>',
  4281. icon: '<i class="%s %s"></i>',
  4282. inputGroup: '<div class="input-group">%s<div class="input-group-append">%s</div></div>',
  4283. searchInput: '<input class="%s%s" type="text" placeholder="%s">',
  4284. searchButton: '<button class="%s" type="button" name="search" title="%s">%s %s</button>',
  4285. searchClearButton: '<button class="%s" type="button" name="clearSearch" title="%s">%s %s</button>'
  4286. }
  4287. },
  4288. 5: {
  4289. classes: {
  4290. buttonsPrefix: 'btn',
  4291. buttons: 'secondary',
  4292. buttonsGroup: 'btn-group',
  4293. buttonsDropdown: 'btn-group',
  4294. pull: 'float',
  4295. inputGroup: 'btn-group',
  4296. inputPrefix: 'form-control-',
  4297. input: 'form-control',
  4298. select: 'form-select',
  4299. paginationDropdown: 'btn-group dropdown',
  4300. dropup: 'dropup',
  4301. dropdownActive: 'active',
  4302. paginationActive: 'active',
  4303. buttonActive: 'active'
  4304. },
  4305. html: {
  4306. dataToggle: 'data-bs-toggle',
  4307. toolbarDropdown: ['<div class="dropdown-menu dropdown-menu-end">', '</div>'],
  4308. toolbarDropdownItem: '<label class="dropdown-item dropdown-item-marker">%s</label>',
  4309. pageDropdown: ['<div class="dropdown-menu">', '</div>'],
  4310. pageDropdownItem: '<a class="dropdown-item %s" href="#">%s</a>',
  4311. toolbarDropdownSeparator: '<div class="dropdown-divider"></div>',
  4312. dropdownCaret: '<span class="caret"></span>',
  4313. pagination: ['<ul class="pagination%s">', '</ul>'],
  4314. paginationItem: '<li class="page-item%s"><a class="page-link" aria-label="%s" href="javascript:void(0)">%s</a></li>',
  4315. icon: '<i class="%s %s"></i>',
  4316. inputGroup: '<div class="input-group">%s%s</div>',
  4317. searchInput: '<input class="%s%s" type="text" placeholder="%s">',
  4318. searchButton: '<button class="%s" type="button" name="search" title="%s">%s %s</button>',
  4319. searchClearButton: '<button class="%s" type="button" name="clearSearch" title="%s">%s %s</button>'
  4320. }
  4321. }
  4322. }[bootstrapVersion];
  4323. var DEFAULTS = {
  4324. height: undefined,
  4325. classes: 'table table-bordered table-hover',
  4326. buttons: {},
  4327. theadClasses: '',
  4328. headerStyle: function headerStyle(column) {
  4329. return {};
  4330. },
  4331. rowStyle: function rowStyle(row, index) {
  4332. return {};
  4333. },
  4334. rowAttributes: function rowAttributes(row, index) {
  4335. return {};
  4336. },
  4337. undefinedText: '-',
  4338. locale: undefined,
  4339. virtualScroll: false,
  4340. virtualScrollItemHeight: undefined,
  4341. sortable: true,
  4342. sortClass: undefined,
  4343. silentSort: true,
  4344. sortEmptyLast: false,
  4345. sortName: undefined,
  4346. sortOrder: undefined,
  4347. sortReset: false,
  4348. sortStable: false,
  4349. sortResetPage: false,
  4350. rememberOrder: false,
  4351. serverSort: true,
  4352. customSort: undefined,
  4353. columns: [[]],
  4354. data: [],
  4355. url: undefined,
  4356. method: 'get',
  4357. cache: true,
  4358. contentType: 'application/json',
  4359. dataType: 'json',
  4360. ajax: undefined,
  4361. ajaxOptions: {},
  4362. queryParams: function queryParams(params) {
  4363. return params;
  4364. },
  4365. queryParamsType: 'limit',
  4366. // 'limit', undefined
  4367. responseHandler: function responseHandler(res) {
  4368. return res;
  4369. },
  4370. totalField: 'total',
  4371. totalNotFilteredField: 'totalNotFiltered',
  4372. dataField: 'rows',
  4373. footerField: 'footer',
  4374. pagination: false,
  4375. paginationParts: ['pageInfo', 'pageSize', 'pageList'],
  4376. showExtendedPagination: false,
  4377. paginationLoop: true,
  4378. sidePagination: 'client',
  4379. // client or server
  4380. totalRows: 0,
  4381. totalNotFiltered: 0,
  4382. pageNumber: 1,
  4383. pageSize: 10,
  4384. pageList: [10, 25, 50, 100],
  4385. paginationHAlign: 'right',
  4386. // right, left
  4387. paginationVAlign: 'bottom',
  4388. // bottom, top, both
  4389. paginationDetailHAlign: 'left',
  4390. // right, left
  4391. paginationPreText: '&lsaquo;',
  4392. paginationNextText: '&rsaquo;',
  4393. paginationSuccessivelySize: 5,
  4394. // Maximum successively number of pages in a row
  4395. paginationPagesBySide: 1,
  4396. // Number of pages on each side (right, left) of the current page.
  4397. paginationUseIntermediate: false,
  4398. // Calculate intermediate pages for quick access
  4399. search: false,
  4400. searchable: false,
  4401. searchHighlight: false,
  4402. searchOnEnterKey: false,
  4403. strictSearch: false,
  4404. regexSearch: false,
  4405. searchSelector: false,
  4406. visibleSearch: false,
  4407. showButtonIcons: true,
  4408. showButtonText: false,
  4409. showSearchButton: false,
  4410. showSearchClearButton: false,
  4411. trimOnSearch: true,
  4412. searchAlign: 'right',
  4413. searchTimeOut: 500,
  4414. searchText: '',
  4415. customSearch: undefined,
  4416. showHeader: true,
  4417. showFooter: false,
  4418. footerStyle: function footerStyle(column) {
  4419. return {};
  4420. },
  4421. searchAccentNeutralise: false,
  4422. showColumns: false,
  4423. showColumnsToggleAll: false,
  4424. showColumnsSearch: false,
  4425. minimumCountColumns: 1,
  4426. showPaginationSwitch: false,
  4427. showRefresh: false,
  4428. showToggle: false,
  4429. showFullscreen: false,
  4430. smartDisplay: true,
  4431. escape: false,
  4432. escapeTitle: true,
  4433. filterOptions: {
  4434. filterAlgorithm: 'and'
  4435. },
  4436. idField: undefined,
  4437. selectItemName: 'btSelectItem',
  4438. clickToSelect: false,
  4439. ignoreClickToSelectOn: function ignoreClickToSelectOn(_ref) {
  4440. var tagName = _ref.tagName;
  4441. return ['A', 'BUTTON'].includes(tagName);
  4442. },
  4443. singleSelect: false,
  4444. checkboxHeader: true,
  4445. maintainMetaData: false,
  4446. multipleSelectRow: false,
  4447. uniqueId: undefined,
  4448. cardView: false,
  4449. detailView: false,
  4450. detailViewIcon: true,
  4451. detailViewByClick: false,
  4452. detailViewAlign: 'left',
  4453. detailFormatter: function detailFormatter(index, row) {
  4454. return '';
  4455. },
  4456. detailFilter: function detailFilter(index, row) {
  4457. return true;
  4458. },
  4459. toolbar: undefined,
  4460. toolbarAlign: 'left',
  4461. buttonsToolbar: undefined,
  4462. buttonsAlign: 'right',
  4463. buttonsOrder: ['paginationSwitch', 'refresh', 'toggle', 'fullscreen', 'columns'],
  4464. buttonsPrefix: CONSTANTS.classes.buttonsPrefix,
  4465. buttonsClass: CONSTANTS.classes.buttons,
  4466. iconsPrefix: undefined,
  4467. // init in initConstants
  4468. icons: {},
  4469. // init in initConstants
  4470. iconSize: undefined,
  4471. fixedScroll: false,
  4472. loadingFontSize: 'auto',
  4473. loadingTemplate: function loadingTemplate(loadingMessage) {
  4474. return "<span class=\"loading-wrap\">\n <span class=\"loading-text\">".concat(loadingMessage, "</span>\n <span class=\"animation-wrap\"><span class=\"animation-dot\"></span></span>\n </span>\n ");
  4475. },
  4476. onAll: function onAll(name, args) {
  4477. return false;
  4478. },
  4479. onClickCell: function onClickCell(field, value, row, $element) {
  4480. return false;
  4481. },
  4482. onDblClickCell: function onDblClickCell(field, value, row, $element) {
  4483. return false;
  4484. },
  4485. onClickRow: function onClickRow(item, $element) {
  4486. return false;
  4487. },
  4488. onDblClickRow: function onDblClickRow(item, $element) {
  4489. return false;
  4490. },
  4491. onSort: function onSort(name, order) {
  4492. return false;
  4493. },
  4494. onCheck: function onCheck(row) {
  4495. return false;
  4496. },
  4497. onUncheck: function onUncheck(row) {
  4498. return false;
  4499. },
  4500. onCheckAll: function onCheckAll(rows) {
  4501. return false;
  4502. },
  4503. onUncheckAll: function onUncheckAll(rows) {
  4504. return false;
  4505. },
  4506. onCheckSome: function onCheckSome(rows) {
  4507. return false;
  4508. },
  4509. onUncheckSome: function onUncheckSome(rows) {
  4510. return false;
  4511. },
  4512. onLoadSuccess: function onLoadSuccess(data) {
  4513. return false;
  4514. },
  4515. onLoadError: function onLoadError(status) {
  4516. return false;
  4517. },
  4518. onColumnSwitch: function onColumnSwitch(field, checked) {
  4519. return false;
  4520. },
  4521. onColumnSwitchAll: function onColumnSwitchAll(checked) {
  4522. return false;
  4523. },
  4524. onPageChange: function onPageChange(number, size) {
  4525. return false;
  4526. },
  4527. onSearch: function onSearch(text) {
  4528. return false;
  4529. },
  4530. onToggle: function onToggle(cardView) {
  4531. return false;
  4532. },
  4533. onPreBody: function onPreBody(data) {
  4534. return false;
  4535. },
  4536. onPostBody: function onPostBody() {
  4537. return false;
  4538. },
  4539. onPostHeader: function onPostHeader() {
  4540. return false;
  4541. },
  4542. onPostFooter: function onPostFooter() {
  4543. return false;
  4544. },
  4545. onExpandRow: function onExpandRow(index, row, $detail) {
  4546. return false;
  4547. },
  4548. onCollapseRow: function onCollapseRow(index, row) {
  4549. return false;
  4550. },
  4551. onRefreshOptions: function onRefreshOptions(options) {
  4552. return false;
  4553. },
  4554. onRefresh: function onRefresh(params) {
  4555. return false;
  4556. },
  4557. onResetView: function onResetView() {
  4558. return false;
  4559. },
  4560. onScrollBody: function onScrollBody() {
  4561. return false;
  4562. },
  4563. onTogglePagination: function onTogglePagination(newState) {
  4564. return false;
  4565. },
  4566. onVirtualScroll: function onVirtualScroll(startIndex, endIndex) {
  4567. return false;
  4568. }
  4569. };
  4570. var EN = {
  4571. formatLoadingMessage: function formatLoadingMessage() {
  4572. return 'Loading, please wait';
  4573. },
  4574. formatRecordsPerPage: function formatRecordsPerPage(pageNumber) {
  4575. return "".concat(pageNumber, " rows per page");
  4576. },
  4577. formatShowingRows: function formatShowingRows(pageFrom, pageTo, totalRows, totalNotFiltered) {
  4578. if (totalNotFiltered !== undefined && totalNotFiltered > 0 && totalNotFiltered > totalRows) {
  4579. return "Showing ".concat(pageFrom, " to ").concat(pageTo, " of ").concat(totalRows, " rows (filtered from ").concat(totalNotFiltered, " total rows)");
  4580. }
  4581. return "Showing ".concat(pageFrom, " to ").concat(pageTo, " of ").concat(totalRows, " rows");
  4582. },
  4583. formatSRPaginationPreText: function formatSRPaginationPreText() {
  4584. return 'previous page';
  4585. },
  4586. formatSRPaginationPageText: function formatSRPaginationPageText(page) {
  4587. return "to page ".concat(page);
  4588. },
  4589. formatSRPaginationNextText: function formatSRPaginationNextText() {
  4590. return 'next page';
  4591. },
  4592. formatDetailPagination: function formatDetailPagination(totalRows) {
  4593. return "Showing ".concat(totalRows, " rows");
  4594. },
  4595. formatSearch: function formatSearch() {
  4596. return 'Search';
  4597. },
  4598. formatClearSearch: function formatClearSearch() {
  4599. return 'Clear Search';
  4600. },
  4601. formatNoMatches: function formatNoMatches() {
  4602. return 'No matching records found';
  4603. },
  4604. formatPaginationSwitch: function formatPaginationSwitch() {
  4605. return 'Hide/Show pagination';
  4606. },
  4607. formatPaginationSwitchDown: function formatPaginationSwitchDown() {
  4608. return 'Show pagination';
  4609. },
  4610. formatPaginationSwitchUp: function formatPaginationSwitchUp() {
  4611. return 'Hide pagination';
  4612. },
  4613. formatRefresh: function formatRefresh() {
  4614. return 'Refresh';
  4615. },
  4616. formatToggleOn: function formatToggleOn() {
  4617. return 'Show card view';
  4618. },
  4619. formatToggleOff: function formatToggleOff() {
  4620. return 'Hide card view';
  4621. },
  4622. formatColumns: function formatColumns() {
  4623. return 'Columns';
  4624. },
  4625. formatColumnsToggleAll: function formatColumnsToggleAll() {
  4626. return 'Toggle all';
  4627. },
  4628. formatFullscreen: function formatFullscreen() {
  4629. return 'Fullscreen';
  4630. },
  4631. formatAllRows: function formatAllRows() {
  4632. return 'All';
  4633. }
  4634. };
  4635. var COLUMN_DEFAULTS = {
  4636. field: undefined,
  4637. title: undefined,
  4638. titleTooltip: undefined,
  4639. class: undefined,
  4640. width: undefined,
  4641. widthUnit: 'px',
  4642. rowspan: undefined,
  4643. colspan: undefined,
  4644. align: undefined,
  4645. // left, right, center
  4646. halign: undefined,
  4647. // left, right, center
  4648. falign: undefined,
  4649. // left, right, center
  4650. valign: undefined,
  4651. // top, middle, bottom
  4652. cellStyle: undefined,
  4653. radio: false,
  4654. checkbox: false,
  4655. checkboxEnabled: true,
  4656. clickToSelect: true,
  4657. showSelectTitle: false,
  4658. sortable: false,
  4659. sortName: undefined,
  4660. order: 'asc',
  4661. // asc, desc
  4662. sorter: undefined,
  4663. visible: true,
  4664. switchable: true,
  4665. switchableLabel: undefined,
  4666. cardVisible: true,
  4667. searchable: true,
  4668. formatter: undefined,
  4669. footerFormatter: undefined,
  4670. footerStyle: undefined,
  4671. detailFormatter: undefined,
  4672. searchFormatter: true,
  4673. searchHighlightFormatter: false,
  4674. escape: undefined,
  4675. events: undefined
  4676. };
  4677. var METHODS = ['getOptions', 'refreshOptions', 'getData', 'getSelections', 'load', 'append', 'prepend', 'remove', 'removeAll', 'insertRow', 'updateRow', 'getRowByUniqueId', 'updateByUniqueId', 'removeByUniqueId', 'updateCell', 'updateCellByUniqueId', 'showRow', 'hideRow', 'getHiddenRows', 'showColumn', 'hideColumn', 'getVisibleColumns', 'getHiddenColumns', 'showAllColumns', 'hideAllColumns', 'mergeCells', 'checkAll', 'uncheckAll', 'checkInvert', 'check', 'uncheck', 'checkBy', 'uncheckBy', 'refresh', 'destroy', 'resetView', 'showLoading', 'hideLoading', 'togglePagination', 'toggleFullscreen', 'toggleView', 'resetSearch', 'filterBy', 'sortBy', 'scrollTo', 'getScrollPosition', 'selectPage', 'prevPage', 'nextPage', 'toggleDetailView', 'expandRow', 'collapseRow', 'expandRowByUniqueId', 'collapseRowByUniqueId', 'expandAllRows', 'collapseAllRows', 'updateColumnTitle', 'updateFormatText'];
  4678. var EVENTS = {
  4679. 'all.bs.table': 'onAll',
  4680. 'click-row.bs.table': 'onClickRow',
  4681. 'dbl-click-row.bs.table': 'onDblClickRow',
  4682. 'click-cell.bs.table': 'onClickCell',
  4683. 'dbl-click-cell.bs.table': 'onDblClickCell',
  4684. 'sort.bs.table': 'onSort',
  4685. 'check.bs.table': 'onCheck',
  4686. 'uncheck.bs.table': 'onUncheck',
  4687. 'check-all.bs.table': 'onCheckAll',
  4688. 'uncheck-all.bs.table': 'onUncheckAll',
  4689. 'check-some.bs.table': 'onCheckSome',
  4690. 'uncheck-some.bs.table': 'onUncheckSome',
  4691. 'load-success.bs.table': 'onLoadSuccess',
  4692. 'load-error.bs.table': 'onLoadError',
  4693. 'column-switch.bs.table': 'onColumnSwitch',
  4694. 'column-switch-all.bs.table': 'onColumnSwitchAll',
  4695. 'page-change.bs.table': 'onPageChange',
  4696. 'search.bs.table': 'onSearch',
  4697. 'toggle.bs.table': 'onToggle',
  4698. 'pre-body.bs.table': 'onPreBody',
  4699. 'post-body.bs.table': 'onPostBody',
  4700. 'post-header.bs.table': 'onPostHeader',
  4701. 'post-footer.bs.table': 'onPostFooter',
  4702. 'expand-row.bs.table': 'onExpandRow',
  4703. 'collapse-row.bs.table': 'onCollapseRow',
  4704. 'refresh-options.bs.table': 'onRefreshOptions',
  4705. 'reset-view.bs.table': 'onResetView',
  4706. 'refresh.bs.table': 'onRefresh',
  4707. 'scroll-body.bs.table': 'onScrollBody',
  4708. 'toggle-pagination.bs.table': 'onTogglePagination',
  4709. 'virtual-scroll.bs.table': 'onVirtualScroll'
  4710. };
  4711. Object.assign(DEFAULTS, EN);
  4712. var Constants = {
  4713. VERSION: VERSION,
  4714. THEME: "bootstrap".concat(bootstrapVersion),
  4715. CONSTANTS: CONSTANTS,
  4716. DEFAULTS: DEFAULTS,
  4717. COLUMN_DEFAULTS: COLUMN_DEFAULTS,
  4718. METHODS: METHODS,
  4719. EVENTS: EVENTS,
  4720. LOCALES: {
  4721. en: EN,
  4722. 'en-US': EN
  4723. }
  4724. };
  4725. var BLOCK_ROWS = 50;
  4726. var CLUSTER_BLOCKS = 4;
  4727. var VirtualScroll = /*#__PURE__*/function () {
  4728. function VirtualScroll(options) {
  4729. var _this = this;
  4730. _classCallCheck(this, VirtualScroll);
  4731. this.rows = options.rows;
  4732. this.scrollEl = options.scrollEl;
  4733. this.contentEl = options.contentEl;
  4734. this.callback = options.callback;
  4735. this.itemHeight = options.itemHeight;
  4736. this.cache = {};
  4737. this.scrollTop = this.scrollEl.scrollTop;
  4738. this.initDOM(this.rows, options.fixedScroll);
  4739. this.scrollEl.scrollTop = this.scrollTop;
  4740. this.lastCluster = 0;
  4741. var onScroll = function onScroll() {
  4742. if (_this.lastCluster !== (_this.lastCluster = _this.getNum())) {
  4743. _this.initDOM(_this.rows);
  4744. _this.callback(_this.startIndex, _this.endIndex);
  4745. }
  4746. };
  4747. this.scrollEl.addEventListener('scroll', onScroll, false);
  4748. this.destroy = function () {
  4749. _this.contentEl.innerHtml = '';
  4750. _this.scrollEl.removeEventListener('scroll', onScroll, false);
  4751. };
  4752. }
  4753. _createClass(VirtualScroll, [{
  4754. key: "initDOM",
  4755. value: function initDOM(rows, fixedScroll) {
  4756. if (typeof this.clusterHeight === 'undefined') {
  4757. this.cache.scrollTop = this.scrollEl.scrollTop;
  4758. this.cache.data = this.contentEl.innerHTML = rows[0] + rows[0] + rows[0];
  4759. this.getRowsHeight(rows);
  4760. }
  4761. var data = this.initData(rows, this.getNum(fixedScroll));
  4762. var thisRows = data.rows.join('');
  4763. var dataChanged = this.checkChanges('data', thisRows);
  4764. var topOffsetChanged = this.checkChanges('top', data.topOffset);
  4765. var bottomOffsetChanged = this.checkChanges('bottom', data.bottomOffset);
  4766. var html = [];
  4767. if (dataChanged && topOffsetChanged) {
  4768. if (data.topOffset) {
  4769. html.push(this.getExtra('top', data.topOffset));
  4770. }
  4771. html.push(thisRows);
  4772. if (data.bottomOffset) {
  4773. html.push(this.getExtra('bottom', data.bottomOffset));
  4774. }
  4775. this.startIndex = data.start;
  4776. this.endIndex = data.end;
  4777. this.contentEl.innerHTML = html.join('');
  4778. if (fixedScroll) {
  4779. this.contentEl.scrollTop = this.cache.scrollTop;
  4780. }
  4781. } else if (bottomOffsetChanged) {
  4782. this.contentEl.lastChild.style.height = "".concat(data.bottomOffset, "px");
  4783. }
  4784. }
  4785. }, {
  4786. key: "getRowsHeight",
  4787. value: function getRowsHeight() {
  4788. if (typeof this.itemHeight === 'undefined') {
  4789. var nodes = this.contentEl.children;
  4790. var node = nodes[Math.floor(nodes.length / 2)];
  4791. this.itemHeight = node.offsetHeight;
  4792. }
  4793. this.blockHeight = this.itemHeight * BLOCK_ROWS;
  4794. this.clusterRows = BLOCK_ROWS * CLUSTER_BLOCKS;
  4795. this.clusterHeight = this.blockHeight * CLUSTER_BLOCKS;
  4796. }
  4797. }, {
  4798. key: "getNum",
  4799. value: function getNum(fixedScroll) {
  4800. this.scrollTop = fixedScroll ? this.cache.scrollTop : this.scrollEl.scrollTop;
  4801. return Math.floor(this.scrollTop / (this.clusterHeight - this.blockHeight)) || 0;
  4802. }
  4803. }, {
  4804. key: "initData",
  4805. value: function initData(rows, num) {
  4806. if (rows.length < BLOCK_ROWS) {
  4807. return {
  4808. topOffset: 0,
  4809. bottomOffset: 0,
  4810. rowsAbove: 0,
  4811. rows: rows
  4812. };
  4813. }
  4814. var start = Math.max((this.clusterRows - BLOCK_ROWS) * num, 0);
  4815. var end = start + this.clusterRows;
  4816. var topOffset = Math.max(start * this.itemHeight, 0);
  4817. var bottomOffset = Math.max((rows.length - end) * this.itemHeight, 0);
  4818. var thisRows = [];
  4819. var rowsAbove = start;
  4820. if (topOffset < 1) {
  4821. rowsAbove++;
  4822. }
  4823. for (var i = start; i < end; i++) {
  4824. rows[i] && thisRows.push(rows[i]);
  4825. }
  4826. return {
  4827. start: start,
  4828. end: end,
  4829. topOffset: topOffset,
  4830. bottomOffset: bottomOffset,
  4831. rowsAbove: rowsAbove,
  4832. rows: thisRows
  4833. };
  4834. }
  4835. }, {
  4836. key: "checkChanges",
  4837. value: function checkChanges(type, value) {
  4838. var changed = value !== this.cache[type];
  4839. this.cache[type] = value;
  4840. return changed;
  4841. }
  4842. }, {
  4843. key: "getExtra",
  4844. value: function getExtra(className, height) {
  4845. var tag = document.createElement('tr');
  4846. tag.className = "virtual-scroll-".concat(className);
  4847. if (height) {
  4848. tag.style.height = "".concat(height, "px");
  4849. }
  4850. return tag.outerHTML;
  4851. }
  4852. }]);
  4853. return VirtualScroll;
  4854. }();
  4855. var BootstrapTable = /*#__PURE__*/function () {
  4856. function BootstrapTable(el, options) {
  4857. _classCallCheck(this, BootstrapTable);
  4858. this.options = options;
  4859. this.$el = $$p(el);
  4860. this.$el_ = this.$el.clone();
  4861. this.timeoutId_ = 0;
  4862. this.timeoutFooter_ = 0;
  4863. }
  4864. _createClass(BootstrapTable, [{
  4865. key: "init",
  4866. value: function init() {
  4867. this.initConstants();
  4868. this.initLocale();
  4869. this.initContainer();
  4870. this.initTable();
  4871. this.initHeader();
  4872. this.initData();
  4873. this.initHiddenRows();
  4874. this.initToolbar();
  4875. this.initPagination();
  4876. this.initBody();
  4877. this.initSearchText();
  4878. this.initServer();
  4879. }
  4880. }, {
  4881. key: "initConstants",
  4882. value: function initConstants() {
  4883. var opts = this.options;
  4884. this.constants = Constants.CONSTANTS;
  4885. this.constants.theme = $$p.fn.bootstrapTable.theme;
  4886. this.constants.dataToggle = this.constants.html.dataToggle || 'data-toggle';
  4887. // init iconsPrefix and icons
  4888. var iconsPrefix = Utils.getIconsPrefix($$p.fn.bootstrapTable.theme);
  4889. if (typeof opts.icons === 'string') {
  4890. opts.icons = Utils.calculateObjectValue(null, opts.icons);
  4891. }
  4892. opts.iconsPrefix = opts.iconsPrefix || $$p.fn.bootstrapTable.defaults.iconsPrefix || iconsPrefix;
  4893. opts.icons = Object.assign(Utils.getIcons(opts.iconsPrefix), $$p.fn.bootstrapTable.defaults.icons, opts.icons);
  4894. // init buttons class
  4895. var buttonsPrefix = opts.buttonsPrefix ? "".concat(opts.buttonsPrefix, "-") : '';
  4896. this.constants.buttonsClass = [opts.buttonsPrefix, buttonsPrefix + opts.buttonsClass, Utils.sprintf("".concat(buttonsPrefix, "%s"), opts.iconSize)].join(' ').trim();
  4897. this.buttons = Utils.calculateObjectValue(this, opts.buttons, [], {});
  4898. if (_typeof(this.buttons) !== 'object') {
  4899. this.buttons = {};
  4900. }
  4901. }
  4902. }, {
  4903. key: "initLocale",
  4904. value: function initLocale() {
  4905. if (this.options.locale) {
  4906. var locales = $$p.fn.bootstrapTable.locales;
  4907. var parts = this.options.locale.split(/-|_/);
  4908. parts[0] = parts[0].toLowerCase();
  4909. if (parts[1]) {
  4910. parts[1] = parts[1].toUpperCase();
  4911. }
  4912. var localesToExtend = {};
  4913. if (locales[this.options.locale]) {
  4914. localesToExtend = locales[this.options.locale];
  4915. } else if (locales[parts.join('-')]) {
  4916. localesToExtend = locales[parts.join('-')];
  4917. } else if (locales[parts[0]]) {
  4918. localesToExtend = locales[parts[0]];
  4919. }
  4920. for (var _i = 0, _Object$entries = Object.entries(localesToExtend); _i < _Object$entries.length; _i++) {
  4921. var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
  4922. formatName = _Object$entries$_i[0],
  4923. func = _Object$entries$_i[1];
  4924. if (this.options[formatName] !== BootstrapTable.DEFAULTS[formatName]) {
  4925. continue;
  4926. }
  4927. this.options[formatName] = func;
  4928. }
  4929. }
  4930. }
  4931. }, {
  4932. key: "initContainer",
  4933. value: function initContainer() {
  4934. var topPagination = ['top', 'both'].includes(this.options.paginationVAlign) ? '<div class="fixed-table-pagination clearfix"></div>' : '';
  4935. var bottomPagination = ['bottom', 'both'].includes(this.options.paginationVAlign) ? '<div class="fixed-table-pagination"></div>' : '';
  4936. var loadingTemplate = Utils.calculateObjectValue(this.options, this.options.loadingTemplate, [this.options.formatLoadingMessage()]);
  4937. this.$container = $$p("\n <div class=\"bootstrap-table ".concat(this.constants.theme, "\">\n <div class=\"fixed-table-toolbar\"></div>\n ").concat(topPagination, "\n <div class=\"fixed-table-container\">\n <div class=\"fixed-table-header\"><table></table></div>\n <div class=\"fixed-table-body\">\n <div class=\"fixed-table-loading\">\n ").concat(loadingTemplate, "\n </div>\n </div>\n <div class=\"fixed-table-footer\"></div>\n </div>\n ").concat(bottomPagination, "\n </div>\n "));
  4938. this.$container.insertAfter(this.$el);
  4939. this.$tableContainer = this.$container.find('.fixed-table-container');
  4940. this.$tableHeader = this.$container.find('.fixed-table-header');
  4941. this.$tableBody = this.$container.find('.fixed-table-body');
  4942. this.$tableLoading = this.$container.find('.fixed-table-loading');
  4943. this.$tableFooter = this.$el.find('tfoot');
  4944. // checking if custom table-toolbar exists or not
  4945. if (this.options.buttonsToolbar) {
  4946. this.$toolbar = $$p('body').find(this.options.buttonsToolbar);
  4947. } else {
  4948. this.$toolbar = this.$container.find('.fixed-table-toolbar');
  4949. }
  4950. this.$pagination = this.$container.find('.fixed-table-pagination');
  4951. this.$tableBody.append(this.$el);
  4952. this.$container.after('<div class="clearfix"></div>');
  4953. this.$el.addClass(this.options.classes);
  4954. this.$tableLoading.addClass(this.options.classes);
  4955. if (this.options.height) {
  4956. this.$tableContainer.addClass('fixed-height');
  4957. if (this.options.showFooter) {
  4958. this.$tableContainer.addClass('has-footer');
  4959. }
  4960. if (this.options.classes.split(' ').includes('table-bordered')) {
  4961. this.$tableBody.append('<div class="fixed-table-border"></div>');
  4962. this.$tableBorder = this.$tableBody.find('.fixed-table-border');
  4963. this.$tableLoading.addClass('fixed-table-border');
  4964. }
  4965. this.$tableFooter = this.$container.find('.fixed-table-footer');
  4966. }
  4967. }
  4968. }, {
  4969. key: "initTable",
  4970. value: function initTable() {
  4971. var _this = this;
  4972. var columns = [];
  4973. this.$header = this.$el.find('>thead');
  4974. if (!this.$header.length) {
  4975. this.$header = $$p("<thead class=\"".concat(this.options.theadClasses, "\"></thead>")).appendTo(this.$el);
  4976. } else if (this.options.theadClasses) {
  4977. this.$header.addClass(this.options.theadClasses);
  4978. }
  4979. this._headerTrClasses = [];
  4980. this._headerTrStyles = [];
  4981. this.$header.find('tr').each(function (i, el) {
  4982. var $tr = $$p(el);
  4983. var column = [];
  4984. $tr.find('th').each(function (i, el) {
  4985. var $th = $$p(el);
  4986. // #2014: getFieldIndex and elsewhere assume this is string, causes issues if not
  4987. if (typeof $th.data('field') !== 'undefined') {
  4988. $th.data('field', "".concat($th.data('field')));
  4989. }
  4990. var _data = Object.assign({}, $th.data());
  4991. for (var key in _data) {
  4992. if ($$p.fn.bootstrapTable.columnDefaults.hasOwnProperty(key)) {
  4993. delete _data[key];
  4994. }
  4995. }
  4996. column.push(Utils.extend({}, {
  4997. _data: Utils.getRealDataAttr(_data),
  4998. title: $th.html(),
  4999. class: $th.attr('class'),
  5000. titleTooltip: $th.attr('title'),
  5001. rowspan: $th.attr('rowspan') ? +$th.attr('rowspan') : undefined,
  5002. colspan: $th.attr('colspan') ? +$th.attr('colspan') : undefined
  5003. }, $th.data()));
  5004. });
  5005. columns.push(column);
  5006. if ($tr.attr('class')) {
  5007. _this._headerTrClasses.push($tr.attr('class'));
  5008. }
  5009. if ($tr.attr('style')) {
  5010. _this._headerTrStyles.push($tr.attr('style'));
  5011. }
  5012. });
  5013. if (!Array.isArray(this.options.columns[0])) {
  5014. this.options.columns = [this.options.columns];
  5015. }
  5016. this.options.columns = Utils.extend(true, [], columns, this.options.columns);
  5017. this.columns = [];
  5018. this.fieldsColumnsIndex = [];
  5019. Utils.setFieldIndex(this.options.columns);
  5020. this.options.columns.forEach(function (columns, i) {
  5021. columns.forEach(function (_column, j) {
  5022. var column = Utils.extend({}, BootstrapTable.COLUMN_DEFAULTS, _column, {
  5023. passed: _column
  5024. });
  5025. if (typeof column.fieldIndex !== 'undefined') {
  5026. _this.columns[column.fieldIndex] = column;
  5027. _this.fieldsColumnsIndex[column.field] = column.fieldIndex;
  5028. }
  5029. _this.options.columns[i][j] = column;
  5030. });
  5031. });
  5032. // if options.data is setting, do not process tbody and tfoot data
  5033. if (!this.options.data.length) {
  5034. var htmlData = Utils.trToData(this.columns, this.$el.find('>tbody>tr'));
  5035. if (htmlData.length) {
  5036. this.options.data = htmlData;
  5037. this.fromHtml = true;
  5038. }
  5039. }
  5040. if (!(this.options.pagination && this.options.sidePagination !== 'server')) {
  5041. this.footerData = Utils.trToData(this.columns, this.$el.find('>tfoot>tr'));
  5042. }
  5043. if (this.footerData) {
  5044. this.$el.find('tfoot').html('<tr></tr>');
  5045. }
  5046. if (!this.options.showFooter || this.options.cardView) {
  5047. this.$tableFooter.hide();
  5048. } else {
  5049. this.$tableFooter.show();
  5050. }
  5051. }
  5052. }, {
  5053. key: "initHeader",
  5054. value: function initHeader() {
  5055. var _this2 = this;
  5056. var visibleColumns = {};
  5057. var headerHtml = [];
  5058. this.header = {
  5059. fields: [],
  5060. styles: [],
  5061. classes: [],
  5062. formatters: [],
  5063. detailFormatters: [],
  5064. events: [],
  5065. sorters: [],
  5066. sortNames: [],
  5067. cellStyles: [],
  5068. searchables: []
  5069. };
  5070. Utils.updateFieldGroup(this.options.columns, this.columns);
  5071. this.options.columns.forEach(function (columns, i) {
  5072. var html = [];
  5073. html.push("<tr".concat(Utils.sprintf(' class="%s"', _this2._headerTrClasses[i]), " ").concat(Utils.sprintf(' style="%s"', _this2._headerTrStyles[i]), ">"));
  5074. var detailViewTemplate = '';
  5075. if (i === 0 && Utils.hasDetailViewIcon(_this2.options)) {
  5076. var rowspan = _this2.options.columns.length > 1 ? " rowspan=\"".concat(_this2.options.columns.length, "\"") : '';
  5077. detailViewTemplate = "<th class=\"detail\"".concat(rowspan, ">\n <div class=\"fht-cell\"></div>\n </th>");
  5078. }
  5079. if (detailViewTemplate && _this2.options.detailViewAlign !== 'right') {
  5080. html.push(detailViewTemplate);
  5081. }
  5082. columns.forEach(function (column, j) {
  5083. var class_ = Utils.sprintf(' class="%s"', column['class']);
  5084. var unitWidth = column.widthUnit;
  5085. var width = parseFloat(column.width);
  5086. var columnHalign = column.halign ? column.halign : column.align;
  5087. var halign = Utils.sprintf('text-align: %s; ', columnHalign);
  5088. var align = Utils.sprintf('text-align: %s; ', column.align);
  5089. var style = Utils.sprintf('vertical-align: %s; ', column.valign);
  5090. style += Utils.sprintf('width: %s; ', (column.checkbox || column.radio) && !width ? !column.showSelectTitle ? '36px' : undefined : width ? width + unitWidth : undefined);
  5091. if (typeof column.fieldIndex === 'undefined' && !column.visible) {
  5092. return;
  5093. }
  5094. var headerStyle = Utils.calculateObjectValue(null, _this2.options.headerStyle, [column]);
  5095. var csses = [];
  5096. var data_ = [];
  5097. var classes = '';
  5098. if (headerStyle && headerStyle.css) {
  5099. for (var _i2 = 0, _Object$entries2 = Object.entries(headerStyle.css); _i2 < _Object$entries2.length; _i2++) {
  5100. var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i2], 2),
  5101. key = _Object$entries2$_i[0],
  5102. value = _Object$entries2$_i[1];
  5103. csses.push("".concat(key, ": ").concat(value));
  5104. }
  5105. }
  5106. if (headerStyle && headerStyle.classes) {
  5107. classes = Utils.sprintf(' class="%s"', column['class'] ? [column['class'], headerStyle.classes].join(' ') : headerStyle.classes);
  5108. }
  5109. if (typeof column.fieldIndex !== 'undefined') {
  5110. _this2.header.fields[column.fieldIndex] = column.field;
  5111. _this2.header.styles[column.fieldIndex] = align + style;
  5112. _this2.header.classes[column.fieldIndex] = class_;
  5113. _this2.header.formatters[column.fieldIndex] = column.formatter;
  5114. _this2.header.detailFormatters[column.fieldIndex] = column.detailFormatter;
  5115. _this2.header.events[column.fieldIndex] = column.events;
  5116. _this2.header.sorters[column.fieldIndex] = column.sorter;
  5117. _this2.header.sortNames[column.fieldIndex] = column.sortName;
  5118. _this2.header.cellStyles[column.fieldIndex] = column.cellStyle;
  5119. _this2.header.searchables[column.fieldIndex] = column.searchable;
  5120. if (!column.visible) {
  5121. return;
  5122. }
  5123. if (_this2.options.cardView && !column.cardVisible) {
  5124. return;
  5125. }
  5126. visibleColumns[column.field] = column;
  5127. }
  5128. if (Object.keys(column._data || {}).length > 0) {
  5129. for (var _i3 = 0, _Object$entries3 = Object.entries(column._data); _i3 < _Object$entries3.length; _i3++) {
  5130. var _Object$entries3$_i = _slicedToArray(_Object$entries3[_i3], 2),
  5131. k = _Object$entries3$_i[0],
  5132. v = _Object$entries3$_i[1];
  5133. data_.push("data-".concat(k, "='").concat(_typeof(v) === 'object' ? JSON.stringify(v) : v, "'"));
  5134. }
  5135. }
  5136. html.push("<th".concat(Utils.sprintf(' title="%s"', column.titleTooltip)), column.checkbox || column.radio ? Utils.sprintf(' class="bs-checkbox %s"', column['class'] || '') : classes || class_, Utils.sprintf(' style="%s"', halign + style + csses.join('; ') || undefined), Utils.sprintf(' rowspan="%s"', column.rowspan), Utils.sprintf(' colspan="%s"', column.colspan), Utils.sprintf(' data-field="%s"', column.field),
  5137. // If `column` is not the first element of `this.options.columns[0]`, then className 'data-not-first-th' should be added.
  5138. j === 0 && i > 0 ? ' data-not-first-th' : '', data_.length > 0 ? data_.join(' ') : '', '>');
  5139. html.push(Utils.sprintf('<div class="th-inner %s">', _this2.options.sortable && column.sortable ? "sortable".concat(columnHalign === 'center' ? ' sortable-center' : '', " both") : ''));
  5140. var text = _this2.options.escape && _this2.options.escapeTitle ? Utils.escapeHTML(column.title) : column.title;
  5141. var title = text;
  5142. if (column.checkbox) {
  5143. text = '';
  5144. if (!_this2.options.singleSelect && _this2.options.checkboxHeader) {
  5145. text = '<label><input name="btSelectAll" type="checkbox" /><span></span></label>';
  5146. }
  5147. _this2.header.stateField = column.field;
  5148. }
  5149. if (column.radio) {
  5150. text = '';
  5151. _this2.header.stateField = column.field;
  5152. }
  5153. if (!text && column.showSelectTitle) {
  5154. text += title;
  5155. }
  5156. html.push(text);
  5157. html.push('</div>');
  5158. html.push('<div class="fht-cell"></div>');
  5159. html.push('</div>');
  5160. html.push('</th>');
  5161. });
  5162. if (detailViewTemplate && _this2.options.detailViewAlign === 'right') {
  5163. html.push(detailViewTemplate);
  5164. }
  5165. html.push('</tr>');
  5166. if (html.length > 3) {
  5167. headerHtml.push(html.join(''));
  5168. }
  5169. });
  5170. this.$header.html(headerHtml.join(''));
  5171. this.$header.find('th[data-field]').each(function (i, el) {
  5172. $$p(el).data(visibleColumns[$$p(el).data('field')]);
  5173. });
  5174. this.$container.off('click', '.th-inner').on('click', '.th-inner', function (e) {
  5175. var $this = $$p(e.currentTarget);
  5176. if (_this2.options.detailView && !$this.parent().hasClass('bs-checkbox')) {
  5177. if ($this.closest('.bootstrap-table')[0] !== _this2.$container[0]) {
  5178. return false;
  5179. }
  5180. }
  5181. if (_this2.options.sortable && $this.parent().data().sortable) {
  5182. _this2.onSort(e);
  5183. }
  5184. });
  5185. var resizeEvent = Utils.getEventName('resize.bootstrap-table', this.$el.attr('id'));
  5186. $$p(window).off(resizeEvent);
  5187. if (!this.options.showHeader || this.options.cardView) {
  5188. this.$header.hide();
  5189. this.$tableHeader.hide();
  5190. this.$tableLoading.css('top', 0);
  5191. } else {
  5192. this.$header.show();
  5193. this.$tableHeader.show();
  5194. this.$tableLoading.css('top', this.$header.outerHeight() + 1);
  5195. // Assign the correct sortable arrow
  5196. this.getCaret();
  5197. $$p(window).on(resizeEvent, function () {
  5198. return _this2.resetView();
  5199. });
  5200. }
  5201. this.$selectAll = this.$header.find('[name="btSelectAll"]');
  5202. this.$selectAll.off('click').on('click', function (e) {
  5203. e.stopPropagation();
  5204. var checked = $$p(e.currentTarget).prop('checked');
  5205. _this2[checked ? 'checkAll' : 'uncheckAll']();
  5206. _this2.updateSelected();
  5207. });
  5208. }
  5209. }, {
  5210. key: "initData",
  5211. value: function initData(data, type) {
  5212. if (type === 'append') {
  5213. this.options.data = this.options.data.concat(data);
  5214. } else if (type === 'prepend') {
  5215. this.options.data = [].concat(data).concat(this.options.data);
  5216. } else {
  5217. data = data || Utils.deepCopy(this.options.data);
  5218. this.options.data = Array.isArray(data) ? data : data[this.options.dataField];
  5219. }
  5220. this.data = _toConsumableArray(this.options.data);
  5221. if (this.options.sortReset) {
  5222. this.unsortedData = _toConsumableArray(this.data);
  5223. }
  5224. if (this.options.sidePagination === 'server') {
  5225. return;
  5226. }
  5227. this.initSort();
  5228. }
  5229. }, {
  5230. key: "initSort",
  5231. value: function initSort() {
  5232. var _this3 = this;
  5233. var name = this.options.sortName;
  5234. var order = this.options.sortOrder === 'desc' ? -1 : 1;
  5235. var index = this.header.fields.indexOf(this.options.sortName);
  5236. var timeoutId = 0;
  5237. if (index !== -1) {
  5238. if (this.options.sortStable) {
  5239. this.data.forEach(function (row, i) {
  5240. if (!row.hasOwnProperty('_position')) {
  5241. row._position = i;
  5242. }
  5243. });
  5244. }
  5245. if (this.options.customSort) {
  5246. Utils.calculateObjectValue(this.options, this.options.customSort, [this.options.sortName, this.options.sortOrder, this.data]);
  5247. } else {
  5248. this.data.sort(function (a, b) {
  5249. if (_this3.header.sortNames[index]) {
  5250. name = _this3.header.sortNames[index];
  5251. }
  5252. var aa = Utils.getItemField(a, name, _this3.options.escape);
  5253. var bb = Utils.getItemField(b, name, _this3.options.escape);
  5254. var value = Utils.calculateObjectValue(_this3.header, _this3.header.sorters[index], [aa, bb, a, b]);
  5255. if (value !== undefined) {
  5256. if (_this3.options.sortStable && value === 0) {
  5257. return order * (a._position - b._position);
  5258. }
  5259. return order * value;
  5260. }
  5261. return Utils.sort(aa, bb, order, _this3.options, a._position, b._position);
  5262. });
  5263. }
  5264. if (this.options.sortClass !== undefined) {
  5265. clearTimeout(timeoutId);
  5266. timeoutId = setTimeout(function () {
  5267. _this3.$el.removeClass(_this3.options.sortClass);
  5268. var index = _this3.$header.find("[data-field=\"".concat(_this3.options.sortName, "\"]")).index();
  5269. _this3.$el.find("tr td:nth-child(".concat(index + 1, ")")).addClass(_this3.options.sortClass);
  5270. }, 250);
  5271. }
  5272. } else if (this.options.sortReset) {
  5273. this.data = _toConsumableArray(this.unsortedData);
  5274. }
  5275. }
  5276. }, {
  5277. key: "sortBy",
  5278. value: function sortBy(params) {
  5279. this.options.sortName = params.field;
  5280. this.options.sortOrder = params.hasOwnProperty('sortOrder') ? params.sortOrder : 'asc';
  5281. this._sort();
  5282. }
  5283. }, {
  5284. key: "onSort",
  5285. value: function onSort(_ref) {
  5286. var type = _ref.type,
  5287. currentTarget = _ref.currentTarget;
  5288. var $this = type === 'keypress' ? $$p(currentTarget) : $$p(currentTarget).parent();
  5289. var $this_ = this.$header.find('th').eq($this.index());
  5290. this.$header.add(this.$header_).find('span.order').remove();
  5291. if (this.options.sortName === $this.data('field')) {
  5292. var currentSortOrder = this.options.sortOrder;
  5293. var initialSortOrder = this.columns[this.fieldsColumnsIndex[$this.data('field')]].sortOrder || this.columns[this.fieldsColumnsIndex[$this.data('field')]].order;
  5294. if (currentSortOrder === undefined) {
  5295. this.options.sortOrder = 'asc';
  5296. } else if (currentSortOrder === 'asc') {
  5297. this.options.sortOrder = this.options.sortReset ? initialSortOrder === 'asc' ? 'desc' : undefined : 'desc';
  5298. } else if (this.options.sortOrder === 'desc') {
  5299. this.options.sortOrder = this.options.sortReset ? initialSortOrder === 'desc' ? 'asc' : undefined : 'asc';
  5300. }
  5301. if (this.options.sortOrder === undefined) {
  5302. this.options.sortName = undefined;
  5303. }
  5304. } else {
  5305. this.options.sortName = $this.data('field');
  5306. if (this.options.rememberOrder) {
  5307. this.options.sortOrder = $this.data('order') === 'asc' ? 'desc' : 'asc';
  5308. } else {
  5309. this.options.sortOrder = this.columns[this.fieldsColumnsIndex[$this.data('field')]].sortOrder || this.columns[this.fieldsColumnsIndex[$this.data('field')]].order;
  5310. }
  5311. }
  5312. $this.add($this_).data('order', this.options.sortOrder);
  5313. // Assign the correct sortable arrow
  5314. this.getCaret();
  5315. this._sort();
  5316. }
  5317. }, {
  5318. key: "_sort",
  5319. value: function _sort() {
  5320. if (this.options.sidePagination === 'server' && this.options.serverSort) {
  5321. this.options.pageNumber = 1;
  5322. this.initServer(this.options.silentSort);
  5323. return;
  5324. }
  5325. if (this.options.pagination && this.options.sortResetPage) {
  5326. this.options.pageNumber = 1;
  5327. this.initPagination();
  5328. }
  5329. this.trigger('sort', this.options.sortName, this.options.sortOrder);
  5330. this.initSort();
  5331. this.initBody();
  5332. }
  5333. }, {
  5334. key: "initToolbar",
  5335. value: function initToolbar() {
  5336. var _this4 = this;
  5337. var opts = this.options;
  5338. var html = [];
  5339. var timeoutId = 0;
  5340. var $keepOpen;
  5341. var switchableCount = 0;
  5342. if (this.$toolbar.find('.bs-bars').children().length) {
  5343. $$p('body').append($$p(opts.toolbar));
  5344. }
  5345. this.$toolbar.html('');
  5346. if (typeof opts.toolbar === 'string' || _typeof(opts.toolbar) === 'object') {
  5347. $$p(Utils.sprintf('<div class="bs-bars %s-%s"></div>', this.constants.classes.pull, opts.toolbarAlign)).appendTo(this.$toolbar).append($$p(opts.toolbar));
  5348. }
  5349. // showColumns, showToggle, showRefresh
  5350. html = ["<div class=\"".concat(['columns', "columns-".concat(opts.buttonsAlign), this.constants.classes.buttonsGroup, "".concat(this.constants.classes.pull, "-").concat(opts.buttonsAlign)].join(' '), "\">")];
  5351. if (typeof opts.buttonsOrder === 'string') {
  5352. opts.buttonsOrder = opts.buttonsOrder.replace(/\[|\]| |'/g, '').split(',');
  5353. }
  5354. this.buttons = Object.assign(this.buttons, {
  5355. paginationSwitch: {
  5356. text: opts.pagination ? opts.formatPaginationSwitchUp() : opts.formatPaginationSwitchDown(),
  5357. icon: opts.pagination ? opts.icons.paginationSwitchDown : opts.icons.paginationSwitchUp,
  5358. render: false,
  5359. event: this.togglePagination,
  5360. attributes: {
  5361. 'aria-label': opts.formatPaginationSwitch(),
  5362. title: opts.formatPaginationSwitch()
  5363. }
  5364. },
  5365. refresh: {
  5366. text: opts.formatRefresh(),
  5367. icon: opts.icons.refresh,
  5368. render: false,
  5369. event: this.refresh,
  5370. attributes: {
  5371. 'aria-label': opts.formatRefresh(),
  5372. title: opts.formatRefresh()
  5373. }
  5374. },
  5375. toggle: {
  5376. text: opts.formatToggleOn(),
  5377. icon: opts.icons.toggleOff,
  5378. render: false,
  5379. event: this.toggleView,
  5380. attributes: {
  5381. 'aria-label': opts.formatToggleOn(),
  5382. title: opts.formatToggleOn()
  5383. }
  5384. },
  5385. fullscreen: {
  5386. text: opts.formatFullscreen(),
  5387. icon: opts.icons.fullscreen,
  5388. render: false,
  5389. event: this.toggleFullscreen,
  5390. attributes: {
  5391. 'aria-label': opts.formatFullscreen(),
  5392. title: opts.formatFullscreen()
  5393. }
  5394. },
  5395. columns: {
  5396. render: false,
  5397. html: function html() {
  5398. var html = [];
  5399. html.push("<div class=\"keep-open ".concat(_this4.constants.classes.buttonsDropdown, "\">\n <button class=\"").concat(_this4.constants.buttonsClass, " dropdown-toggle\" type=\"button\" ").concat(_this4.constants.dataToggle, "=\"dropdown\"\n aria-label=\"").concat(opts.formatColumns(), "\" title=\"").concat(opts.formatColumns(), "\">\n ").concat(opts.showButtonIcons ? Utils.sprintf(_this4.constants.html.icon, opts.iconsPrefix, opts.icons.columns) : '', "\n ").concat(opts.showButtonText ? opts.formatColumns() : '', "\n ").concat(_this4.constants.html.dropdownCaret, "\n </button>\n ").concat(_this4.constants.html.toolbarDropdown[0]));
  5400. if (opts.showColumnsSearch) {
  5401. html.push(Utils.sprintf(_this4.constants.html.toolbarDropdownItem, Utils.sprintf('<input type="text" class="%s" name="columnsSearch" placeholder="%s" autocomplete="off">', _this4.constants.classes.input, opts.formatSearch())));
  5402. html.push(_this4.constants.html.toolbarDropdownSeparator);
  5403. }
  5404. if (opts.showColumnsToggleAll) {
  5405. var allFieldsVisible = _this4.getVisibleColumns().length === _this4.columns.filter(function (column) {
  5406. return !_this4.isSelectionColumn(column);
  5407. }).length;
  5408. html.push(Utils.sprintf(_this4.constants.html.toolbarDropdownItem, Utils.sprintf('<input type="checkbox" class="toggle-all" %s> <span>%s</span>', allFieldsVisible ? 'checked="checked"' : '', opts.formatColumnsToggleAll())));
  5409. html.push(_this4.constants.html.toolbarDropdownSeparator);
  5410. }
  5411. var visibleColumns = 0;
  5412. _this4.columns.forEach(function (column) {
  5413. if (column.visible) {
  5414. visibleColumns++;
  5415. }
  5416. });
  5417. _this4.columns.forEach(function (column, i) {
  5418. if (_this4.isSelectionColumn(column)) {
  5419. return;
  5420. }
  5421. if (opts.cardView && !column.cardVisible) {
  5422. return;
  5423. }
  5424. var checked = column.visible ? ' checked="checked"' : '';
  5425. var disabled = visibleColumns <= opts.minimumCountColumns && checked ? ' disabled="disabled"' : '';
  5426. if (column.switchable) {
  5427. html.push(Utils.sprintf(_this4.constants.html.toolbarDropdownItem, Utils.sprintf('<input type="checkbox" data-field="%s" value="%s"%s%s> <span>%s</span>', column.field, i, checked, disabled, column.switchableLabel ? column.switchableLabel : column.title)));
  5428. switchableCount++;
  5429. }
  5430. });
  5431. html.push(_this4.constants.html.toolbarDropdown[1], '</div>');
  5432. return html.join('');
  5433. }
  5434. }
  5435. });
  5436. var buttonsHtml = {};
  5437. for (var _i4 = 0, _Object$entries4 = Object.entries(this.buttons); _i4 < _Object$entries4.length; _i4++) {
  5438. var _Object$entries4$_i = _slicedToArray(_Object$entries4[_i4], 2),
  5439. buttonName = _Object$entries4$_i[0],
  5440. buttonConfig = _Object$entries4$_i[1];
  5441. var buttonHtml = void 0;
  5442. if (buttonConfig.hasOwnProperty('html')) {
  5443. if (typeof buttonConfig.html === 'function') {
  5444. buttonHtml = buttonConfig.html();
  5445. } else if (typeof buttonConfig.html === 'string') {
  5446. buttonHtml = buttonConfig.html;
  5447. }
  5448. } else {
  5449. var buttonClass = this.constants.buttonsClass;
  5450. if (buttonConfig.hasOwnProperty('attributes') && buttonConfig.attributes.class) {
  5451. buttonClass += " ".concat(buttonConfig.attributes.class);
  5452. }
  5453. buttonHtml = "<button class=\"".concat(buttonClass, "\" type=\"button\" name=\"").concat(buttonName, "\"");
  5454. if (buttonConfig.hasOwnProperty('attributes')) {
  5455. for (var _i5 = 0, _Object$entries5 = Object.entries(buttonConfig.attributes); _i5 < _Object$entries5.length; _i5++) {
  5456. var _Object$entries5$_i = _slicedToArray(_Object$entries5[_i5], 2),
  5457. attributeName = _Object$entries5$_i[0],
  5458. value = _Object$entries5$_i[1];
  5459. if (attributeName === 'class') {
  5460. continue;
  5461. }
  5462. buttonHtml += " ".concat(attributeName, "=\"").concat(value, "\"");
  5463. }
  5464. }
  5465. buttonHtml += '>';
  5466. if (opts.showButtonIcons && buttonConfig.hasOwnProperty('icon')) {
  5467. buttonHtml += "".concat(Utils.sprintf(this.constants.html.icon, opts.iconsPrefix, buttonConfig.icon), " ");
  5468. }
  5469. if (opts.showButtonText && buttonConfig.hasOwnProperty('text')) {
  5470. buttonHtml += buttonConfig.text;
  5471. }
  5472. buttonHtml += '</button>';
  5473. }
  5474. buttonsHtml[buttonName] = buttonHtml;
  5475. var optionName = "show".concat(buttonName.charAt(0).toUpperCase()).concat(buttonName.substring(1));
  5476. var showOption = opts[optionName];
  5477. if ((!buttonConfig.hasOwnProperty('render') || buttonConfig.hasOwnProperty('render') && buttonConfig.render) && (showOption === undefined || showOption === true)) {
  5478. opts[optionName] = true;
  5479. }
  5480. if (!opts.buttonsOrder.includes(buttonName)) {
  5481. opts.buttonsOrder.push(buttonName);
  5482. }
  5483. }
  5484. // Adding the button html to the final toolbar html when the showOption is true
  5485. var _iterator = _createForOfIteratorHelper(opts.buttonsOrder),
  5486. _step;
  5487. try {
  5488. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  5489. var button = _step.value;
  5490. var _showOption = opts["show".concat(button.charAt(0).toUpperCase()).concat(button.substring(1))];
  5491. if (_showOption) {
  5492. html.push(buttonsHtml[button]);
  5493. }
  5494. }
  5495. } catch (err) {
  5496. _iterator.e(err);
  5497. } finally {
  5498. _iterator.f();
  5499. }
  5500. html.push('</div>');
  5501. // Fix #188: this.showToolbar is for extensions
  5502. if (this.showToolbar || html.length > 2) {
  5503. this.$toolbar.append(html.join(''));
  5504. }
  5505. var _loop = function _loop() {
  5506. var _Object$entries6$_i = _slicedToArray(_Object$entries6[_i6], 2),
  5507. buttonName = _Object$entries6$_i[0],
  5508. buttonConfig = _Object$entries6$_i[1];
  5509. if (buttonConfig.hasOwnProperty('event')) {
  5510. if (typeof buttonConfig.event === 'function' || typeof buttonConfig.event === 'string') {
  5511. var event = typeof buttonConfig.event === 'string' ? window[buttonConfig.event] : buttonConfig.event;
  5512. _this4.$toolbar.find("button[name=\"".concat(buttonName, "\"]")).off('click').on('click', function () {
  5513. return event.call(_this4);
  5514. });
  5515. return 1; // continue
  5516. }
  5517. var _loop2 = function _loop2() {
  5518. var _Object$entries7$_i = _slicedToArray(_Object$entries7[_i7], 2),
  5519. eventType = _Object$entries7$_i[0],
  5520. eventFunction = _Object$entries7$_i[1];
  5521. var event = typeof eventFunction === 'string' ? window[eventFunction] : eventFunction;
  5522. _this4.$toolbar.find("button[name=\"".concat(buttonName, "\"]")).off(eventType).on(eventType, function () {
  5523. return event.call(_this4);
  5524. });
  5525. };
  5526. for (var _i7 = 0, _Object$entries7 = Object.entries(buttonConfig.event); _i7 < _Object$entries7.length; _i7++) {
  5527. _loop2();
  5528. }
  5529. }
  5530. };
  5531. for (var _i6 = 0, _Object$entries6 = Object.entries(this.buttons); _i6 < _Object$entries6.length; _i6++) {
  5532. if (_loop()) continue;
  5533. }
  5534. if (opts.showColumns) {
  5535. $keepOpen = this.$toolbar.find('.keep-open');
  5536. var $checkboxes = $keepOpen.find('input[type="checkbox"]:not(".toggle-all")');
  5537. var $toggleAll = $keepOpen.find('input[type="checkbox"].toggle-all');
  5538. if (switchableCount <= opts.minimumCountColumns) {
  5539. $keepOpen.find('input').prop('disabled', true);
  5540. }
  5541. $keepOpen.find('li, label').off('click').on('click', function (e) {
  5542. e.stopImmediatePropagation();
  5543. });
  5544. $checkboxes.off('click').on('click', function (_ref2) {
  5545. var currentTarget = _ref2.currentTarget;
  5546. var $this = $$p(currentTarget);
  5547. _this4._toggleColumn($this.val(), $this.prop('checked'), false);
  5548. _this4.trigger('column-switch', $this.data('field'), $this.prop('checked'));
  5549. $toggleAll.prop('checked', $checkboxes.filter(':checked').length === _this4.columns.filter(function (column) {
  5550. return !_this4.isSelectionColumn(column);
  5551. }).length);
  5552. });
  5553. $toggleAll.off('click').on('click', function (_ref3) {
  5554. var currentTarget = _ref3.currentTarget;
  5555. _this4._toggleAllColumns($$p(currentTarget).prop('checked'));
  5556. _this4.trigger('column-switch-all', $$p(currentTarget).prop('checked'));
  5557. });
  5558. if (opts.showColumnsSearch) {
  5559. var $columnsSearch = $keepOpen.find('[name="columnsSearch"]');
  5560. var $listItems = $keepOpen.find('.dropdown-item-marker');
  5561. $columnsSearch.on('keyup paste change', function (_ref4) {
  5562. var currentTarget = _ref4.currentTarget;
  5563. var $this = $$p(currentTarget);
  5564. var searchValue = $this.val().toLowerCase();
  5565. $listItems.show();
  5566. $checkboxes.each(function (i, el) {
  5567. var $checkbox = $$p(el);
  5568. var $listItem = $checkbox.parents('.dropdown-item-marker');
  5569. var text = $listItem.text().toLowerCase();
  5570. if (!text.includes(searchValue)) {
  5571. $listItem.hide();
  5572. }
  5573. });
  5574. });
  5575. }
  5576. }
  5577. var handleInputEvent = function handleInputEvent($searchInput) {
  5578. var eventTriggers = $searchInput.is('select') ? 'change' : 'keyup drop blur mouseup';
  5579. $searchInput.off(eventTriggers).on(eventTriggers, function (event) {
  5580. if (opts.searchOnEnterKey && event.keyCode !== 13) {
  5581. return;
  5582. }
  5583. if ([37, 38, 39, 40].includes(event.keyCode)) {
  5584. return;
  5585. }
  5586. clearTimeout(timeoutId); // doesn't matter if it's 0
  5587. timeoutId = setTimeout(function () {
  5588. _this4.onSearch({
  5589. currentTarget: event.currentTarget
  5590. });
  5591. }, opts.searchTimeOut);
  5592. });
  5593. };
  5594. // Fix #4516: this.showSearchClearButton is for extensions
  5595. if ((opts.search || this.showSearchClearButton) && typeof opts.searchSelector !== 'string') {
  5596. html = [];
  5597. var showSearchButton = Utils.sprintf(this.constants.html.searchButton, this.constants.buttonsClass, opts.formatSearch(), opts.showButtonIcons ? Utils.sprintf(this.constants.html.icon, opts.iconsPrefix, opts.icons.search) : '', opts.showButtonText ? opts.formatSearch() : '');
  5598. var showSearchClearButton = Utils.sprintf(this.constants.html.searchClearButton, this.constants.buttonsClass, opts.formatClearSearch(), opts.showButtonIcons ? Utils.sprintf(this.constants.html.icon, opts.iconsPrefix, opts.icons.clearSearch) : '', opts.showButtonText ? opts.formatClearSearch() : '');
  5599. var searchInputHtml = "<input class=\"".concat(this.constants.classes.input, "\n ").concat(Utils.sprintf(' %s%s', this.constants.classes.inputPrefix, opts.iconSize), "\n search-input\" type=\"search\" aria-label=\"").concat(opts.formatSearch(), "\" placeholder=\"").concat(opts.formatSearch(), "\" autocomplete=\"off\">");
  5600. var searchInputFinalHtml = searchInputHtml;
  5601. if (opts.showSearchButton || opts.showSearchClearButton) {
  5602. var _buttonsHtml = (opts.showSearchButton ? showSearchButton : '') + (opts.showSearchClearButton ? showSearchClearButton : '');
  5603. searchInputFinalHtml = opts.search ? Utils.sprintf(this.constants.html.inputGroup, searchInputHtml, _buttonsHtml) : _buttonsHtml;
  5604. }
  5605. html.push(Utils.sprintf("\n <div class=\"".concat(this.constants.classes.pull, "-").concat(opts.searchAlign, " search ").concat(this.constants.classes.inputGroup, "\">\n %s\n </div>\n "), searchInputFinalHtml));
  5606. this.$toolbar.append(html.join(''));
  5607. var $searchInput = Utils.getSearchInput(this);
  5608. if (opts.showSearchButton) {
  5609. this.$toolbar.find('.search button[name=search]').off('click').on('click', function () {
  5610. clearTimeout(timeoutId); // doesn't matter if it's 0
  5611. timeoutId = setTimeout(function () {
  5612. _this4.onSearch({
  5613. currentTarget: $searchInput
  5614. });
  5615. }, opts.searchTimeOut);
  5616. });
  5617. if (opts.searchOnEnterKey) {
  5618. handleInputEvent($searchInput);
  5619. }
  5620. } else {
  5621. handleInputEvent($searchInput);
  5622. }
  5623. if (opts.showSearchClearButton) {
  5624. this.$toolbar.find('.search button[name=clearSearch]').click(function () {
  5625. _this4.resetSearch();
  5626. });
  5627. }
  5628. } else if (typeof opts.searchSelector === 'string') {
  5629. handleInputEvent(Utils.getSearchInput(this));
  5630. }
  5631. }
  5632. }, {
  5633. key: "onSearch",
  5634. value: function onSearch() {
  5635. var _ref5 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  5636. currentTarget = _ref5.currentTarget,
  5637. firedByInitSearchText = _ref5.firedByInitSearchText;
  5638. var overwriteSearchText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  5639. if (currentTarget !== undefined && $$p(currentTarget).length && overwriteSearchText) {
  5640. var text = $$p(currentTarget).val().trim();
  5641. if (this.options.trimOnSearch && $$p(currentTarget).val() !== text) {
  5642. $$p(currentTarget).val(text);
  5643. }
  5644. if (this.searchText === text) {
  5645. return;
  5646. }
  5647. var $searchInput = Utils.getSearchInput(this);
  5648. var $currentTarget = currentTarget instanceof jQuery ? currentTarget : $$p(currentTarget);
  5649. if ($currentTarget.is($searchInput) || $currentTarget.hasClass('search-input')) {
  5650. this.searchText = text;
  5651. this.options.searchText = text;
  5652. }
  5653. }
  5654. if (!firedByInitSearchText) {
  5655. this.options.pageNumber = 1;
  5656. }
  5657. this.initSearch();
  5658. if (firedByInitSearchText) {
  5659. if (this.options.sidePagination === 'client') {
  5660. this.updatePagination();
  5661. }
  5662. } else {
  5663. this.updatePagination();
  5664. }
  5665. this.trigger('search', this.searchText);
  5666. }
  5667. }, {
  5668. key: "initSearch",
  5669. value: function initSearch() {
  5670. var _this5 = this;
  5671. this.filterOptions = this.filterOptions || this.options.filterOptions;
  5672. if (this.options.sidePagination !== 'server') {
  5673. if (this.options.customSearch) {
  5674. this.data = Utils.calculateObjectValue(this.options, this.options.customSearch, [this.options.data, this.searchText, this.filterColumns]);
  5675. if (this.options.sortReset) {
  5676. this.unsortedData = _toConsumableArray(this.data);
  5677. }
  5678. this.initSort();
  5679. return;
  5680. }
  5681. var rawSearchText = this.searchText && (this.fromHtml ? Utils.escapeHTML(this.searchText) : this.searchText);
  5682. var searchText = rawSearchText ? rawSearchText.toLowerCase() : '';
  5683. var f = Utils.isEmptyObject(this.filterColumns) ? null : this.filterColumns;
  5684. if (this.options.searchAccentNeutralise) {
  5685. searchText = Utils.normalizeAccent(searchText);
  5686. }
  5687. // Check filter
  5688. if (typeof this.filterOptions.filterAlgorithm === 'function') {
  5689. this.data = this.options.data.filter(function (item) {
  5690. return _this5.filterOptions.filterAlgorithm.apply(null, [item, f]);
  5691. });
  5692. } else if (typeof this.filterOptions.filterAlgorithm === 'string') {
  5693. this.data = f ? this.options.data.filter(function (item) {
  5694. var filterAlgorithm = _this5.filterOptions.filterAlgorithm;
  5695. if (filterAlgorithm === 'and') {
  5696. for (var key in f) {
  5697. if (Array.isArray(f[key]) && !f[key].includes(item[key]) || !Array.isArray(f[key]) && item[key] !== f[key]) {
  5698. return false;
  5699. }
  5700. }
  5701. } else if (filterAlgorithm === 'or') {
  5702. var match = false;
  5703. for (var _key in f) {
  5704. if (Array.isArray(f[_key]) && f[_key].includes(item[_key]) || !Array.isArray(f[_key]) && item[_key] === f[_key]) {
  5705. match = true;
  5706. }
  5707. }
  5708. return match;
  5709. }
  5710. return true;
  5711. }) : _toConsumableArray(this.options.data);
  5712. }
  5713. var visibleFields = this.getVisibleFields();
  5714. this.data = searchText ? this.data.filter(function (item, i) {
  5715. for (var j = 0; j < _this5.header.fields.length; j++) {
  5716. if (!_this5.header.searchables[j] || _this5.options.visibleSearch && visibleFields.indexOf(_this5.header.fields[j]) === -1) {
  5717. continue;
  5718. }
  5719. var key = Utils.isNumeric(_this5.header.fields[j]) ? parseInt(_this5.header.fields[j], 10) : _this5.header.fields[j];
  5720. var column = _this5.columns[_this5.fieldsColumnsIndex[key]];
  5721. var value = void 0;
  5722. if (typeof key === 'string' && !item.hasOwnProperty(key)) {
  5723. value = item;
  5724. var props = key.split('.');
  5725. for (var _i8 = 0; _i8 < props.length; _i8++) {
  5726. if (value[props[_i8]] !== null) {
  5727. value = value[props[_i8]];
  5728. } else {
  5729. value = null;
  5730. break;
  5731. }
  5732. }
  5733. } else {
  5734. value = item[key];
  5735. }
  5736. if (_this5.options.searchAccentNeutralise) {
  5737. value = Utils.normalizeAccent(value);
  5738. }
  5739. // Fix #142: respect searchFormatter boolean
  5740. if (column && column.searchFormatter) {
  5741. value = Utils.calculateObjectValue(column, _this5.header.formatters[j], [value, item, i, column.field], value);
  5742. }
  5743. if (typeof value === 'string' || typeof value === 'number') {
  5744. if (_this5.options.strictSearch && "".concat(value).toLowerCase() === searchText || _this5.options.regexSearch && Utils.regexCompare(value, rawSearchText)) {
  5745. return true;
  5746. }
  5747. var largerSmallerEqualsRegex = /(?:(<=|=>|=<|>=|>|<)(?:\s+)?(-?\d+)?|(-?\d+)?(\s+)?(<=|=>|=<|>=|>|<))/gm;
  5748. var matches = largerSmallerEqualsRegex.exec(_this5.searchText);
  5749. var comparisonCheck = false;
  5750. if (matches) {
  5751. var operator = matches[1] || "".concat(matches[5], "l");
  5752. var comparisonValue = matches[2] || matches[3];
  5753. var int = parseInt(value, 10);
  5754. var comparisonInt = parseInt(comparisonValue, 10);
  5755. switch (operator) {
  5756. case '>':
  5757. case '<l':
  5758. comparisonCheck = int > comparisonInt;
  5759. break;
  5760. case '<':
  5761. case '>l':
  5762. comparisonCheck = int < comparisonInt;
  5763. break;
  5764. case '<=':
  5765. case '=<':
  5766. case '>=l':
  5767. case '=>l':
  5768. comparisonCheck = int <= comparisonInt;
  5769. break;
  5770. case '>=':
  5771. case '=>':
  5772. case '<=l':
  5773. case '=<l':
  5774. comparisonCheck = int >= comparisonInt;
  5775. break;
  5776. }
  5777. }
  5778. if (comparisonCheck || "".concat(value).toLowerCase().includes(searchText)) {
  5779. return true;
  5780. }
  5781. }
  5782. }
  5783. return false;
  5784. }) : this.data;
  5785. if (this.options.sortReset) {
  5786. this.unsortedData = _toConsumableArray(this.data);
  5787. }
  5788. this.initSort();
  5789. }
  5790. }
  5791. }, {
  5792. key: "initPagination",
  5793. value: function initPagination() {
  5794. var _this6 = this;
  5795. var opts = this.options;
  5796. if (!opts.pagination) {
  5797. this.$pagination.hide();
  5798. return;
  5799. }
  5800. this.$pagination.show();
  5801. var html = [];
  5802. var allSelected = false;
  5803. var i;
  5804. var from;
  5805. var to;
  5806. var $pageList;
  5807. var $pre;
  5808. var $next;
  5809. var $number;
  5810. var data = this.getData({
  5811. includeHiddenRows: false
  5812. });
  5813. var pageList = opts.pageList;
  5814. if (typeof pageList === 'string') {
  5815. pageList = pageList.replace(/\[|\]| /g, '').toLowerCase().split(',');
  5816. }
  5817. pageList = pageList.map(function (value) {
  5818. if (typeof value === 'string') {
  5819. return value.toLowerCase() === opts.formatAllRows().toLowerCase() || ['all', 'unlimited'].includes(value.toLowerCase()) ? opts.formatAllRows() : +value;
  5820. }
  5821. return value;
  5822. });
  5823. this.paginationParts = opts.paginationParts;
  5824. if (typeof this.paginationParts === 'string') {
  5825. this.paginationParts = this.paginationParts.replace(/\[|\]| |'/g, '').split(',');
  5826. }
  5827. if (opts.sidePagination !== 'server') {
  5828. opts.totalRows = data.length;
  5829. }
  5830. this.totalPages = 0;
  5831. if (opts.totalRows) {
  5832. if (opts.pageSize === opts.formatAllRows()) {
  5833. opts.pageSize = opts.totalRows;
  5834. allSelected = true;
  5835. }
  5836. this.totalPages = ~~((opts.totalRows - 1) / opts.pageSize) + 1;
  5837. opts.totalPages = this.totalPages;
  5838. }
  5839. if (this.totalPages > 0 && opts.pageNumber > this.totalPages) {
  5840. opts.pageNumber = this.totalPages;
  5841. }
  5842. this.pageFrom = (opts.pageNumber - 1) * opts.pageSize + 1;
  5843. this.pageTo = opts.pageNumber * opts.pageSize;
  5844. if (this.pageTo > opts.totalRows) {
  5845. this.pageTo = opts.totalRows;
  5846. }
  5847. if (this.options.pagination && this.options.sidePagination !== 'server') {
  5848. this.options.totalNotFiltered = this.options.data.length;
  5849. }
  5850. if (!this.options.showExtendedPagination) {
  5851. this.options.totalNotFiltered = undefined;
  5852. }
  5853. if (this.paginationParts.includes('pageInfo') || this.paginationParts.includes('pageInfoShort') || this.paginationParts.includes('pageSize')) {
  5854. html.push("<div class=\"".concat(this.constants.classes.pull, "-").concat(opts.paginationDetailHAlign, " pagination-detail\">"));
  5855. }
  5856. if (this.paginationParts.includes('pageInfo') || this.paginationParts.includes('pageInfoShort')) {
  5857. var paginationInfo = this.paginationParts.includes('pageInfoShort') ? opts.formatDetailPagination(opts.totalRows) : opts.formatShowingRows(this.pageFrom, this.pageTo, opts.totalRows, opts.totalNotFiltered);
  5858. html.push("<span class=\"pagination-info\">\n ".concat(paginationInfo, "\n </span>"));
  5859. }
  5860. if (this.paginationParts.includes('pageSize')) {
  5861. html.push('<div class="page-list">');
  5862. var pageNumber = ["<div class=\"".concat(this.constants.classes.paginationDropdown, "\">\n <button class=\"").concat(this.constants.buttonsClass, " dropdown-toggle\" type=\"button\" ").concat(this.constants.dataToggle, "=\"dropdown\">\n <span class=\"page-size\">\n ").concat(allSelected ? opts.formatAllRows() : opts.pageSize, "\n </span>\n ").concat(this.constants.html.dropdownCaret, "\n </button>\n ").concat(this.constants.html.pageDropdown[0])];
  5863. pageList.forEach(function (page, i) {
  5864. if (!opts.smartDisplay || i === 0 || pageList[i - 1] < opts.totalRows || page === opts.formatAllRows()) {
  5865. var active;
  5866. if (allSelected) {
  5867. active = page === opts.formatAllRows() ? _this6.constants.classes.dropdownActive : '';
  5868. } else {
  5869. active = page === opts.pageSize ? _this6.constants.classes.dropdownActive : '';
  5870. }
  5871. pageNumber.push(Utils.sprintf(_this6.constants.html.pageDropdownItem, active, page));
  5872. }
  5873. });
  5874. pageNumber.push("".concat(this.constants.html.pageDropdown[1], "</div>"));
  5875. html.push(opts.formatRecordsPerPage(pageNumber.join('')));
  5876. }
  5877. if (this.paginationParts.includes('pageInfo') || this.paginationParts.includes('pageInfoShort') || this.paginationParts.includes('pageSize')) {
  5878. html.push('</div></div>');
  5879. }
  5880. if (this.paginationParts.includes('pageList')) {
  5881. html.push("<div class=\"".concat(this.constants.classes.pull, "-").concat(opts.paginationHAlign, " pagination\">"), Utils.sprintf(this.constants.html.pagination[0], Utils.sprintf(' pagination-%s', opts.iconSize)), Utils.sprintf(this.constants.html.paginationItem, ' page-pre', opts.formatSRPaginationPreText(), opts.paginationPreText));
  5882. if (this.totalPages < opts.paginationSuccessivelySize) {
  5883. from = 1;
  5884. to = this.totalPages;
  5885. } else {
  5886. from = opts.pageNumber - opts.paginationPagesBySide;
  5887. to = from + opts.paginationPagesBySide * 2;
  5888. }
  5889. if (opts.pageNumber < opts.paginationSuccessivelySize - 1) {
  5890. to = opts.paginationSuccessivelySize;
  5891. }
  5892. if (opts.paginationSuccessivelySize > this.totalPages - from) {
  5893. from = from - (opts.paginationSuccessivelySize - (this.totalPages - from)) + 1;
  5894. }
  5895. if (from < 1) {
  5896. from = 1;
  5897. }
  5898. if (to > this.totalPages) {
  5899. to = this.totalPages;
  5900. }
  5901. var middleSize = Math.round(opts.paginationPagesBySide / 2);
  5902. var pageItem = function pageItem(i) {
  5903. var classes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
  5904. return Utils.sprintf(_this6.constants.html.paginationItem, classes + (i === opts.pageNumber ? " ".concat(_this6.constants.classes.paginationActive) : ''), opts.formatSRPaginationPageText(i), i);
  5905. };
  5906. if (from > 1) {
  5907. var max = opts.paginationPagesBySide;
  5908. if (max >= from) max = from - 1;
  5909. for (i = 1; i <= max; i++) {
  5910. html.push(pageItem(i));
  5911. }
  5912. if (from - 1 === max + 1) {
  5913. i = from - 1;
  5914. html.push(pageItem(i));
  5915. } else if (from - 1 > max) {
  5916. if (from - opts.paginationPagesBySide * 2 > opts.paginationPagesBySide && opts.paginationUseIntermediate) {
  5917. i = Math.round((from - middleSize) / 2 + middleSize);
  5918. html.push(pageItem(i, ' page-intermediate'));
  5919. } else {
  5920. html.push(Utils.sprintf(this.constants.html.paginationItem, ' page-first-separator disabled', '', '...'));
  5921. }
  5922. }
  5923. }
  5924. for (i = from; i <= to; i++) {
  5925. html.push(pageItem(i));
  5926. }
  5927. if (this.totalPages > to) {
  5928. var min = this.totalPages - (opts.paginationPagesBySide - 1);
  5929. if (to >= min) min = to + 1;
  5930. if (to + 1 === min - 1) {
  5931. i = to + 1;
  5932. html.push(pageItem(i));
  5933. } else if (min > to + 1) {
  5934. if (this.totalPages - to > opts.paginationPagesBySide * 2 && opts.paginationUseIntermediate) {
  5935. i = Math.round((this.totalPages - middleSize - to) / 2 + to);
  5936. html.push(pageItem(i, ' page-intermediate'));
  5937. } else {
  5938. html.push(Utils.sprintf(this.constants.html.paginationItem, ' page-last-separator disabled', '', '...'));
  5939. }
  5940. }
  5941. for (i = min; i <= this.totalPages; i++) {
  5942. html.push(pageItem(i));
  5943. }
  5944. }
  5945. html.push(Utils.sprintf(this.constants.html.paginationItem, ' page-next', opts.formatSRPaginationNextText(), opts.paginationNextText));
  5946. html.push(this.constants.html.pagination[1], '</div>');
  5947. }
  5948. this.$pagination.html(html.join(''));
  5949. var dropupClass = ['bottom', 'both'].includes(opts.paginationVAlign) ? " ".concat(this.constants.classes.dropup) : '';
  5950. this.$pagination.last().find('.page-list > div').addClass(dropupClass);
  5951. if (!opts.onlyInfoPagination) {
  5952. $pageList = this.$pagination.find('.page-list a');
  5953. $pre = this.$pagination.find('.page-pre');
  5954. $next = this.$pagination.find('.page-next');
  5955. $number = this.$pagination.find('.page-item').not('.page-next, .page-pre, .page-last-separator, .page-first-separator');
  5956. if (this.totalPages <= 1) {
  5957. this.$pagination.find('div.pagination').hide();
  5958. }
  5959. if (opts.smartDisplay) {
  5960. if (pageList.length < 2 || opts.totalRows <= pageList[0]) {
  5961. this.$pagination.find('div.page-list').hide();
  5962. }
  5963. }
  5964. // when data is empty, hide the pagination
  5965. this.$pagination[this.getData().length ? 'show' : 'hide']();
  5966. if (!opts.paginationLoop) {
  5967. if (opts.pageNumber === 1) {
  5968. $pre.addClass('disabled');
  5969. }
  5970. if (opts.pageNumber === this.totalPages) {
  5971. $next.addClass('disabled');
  5972. }
  5973. }
  5974. if (allSelected) {
  5975. opts.pageSize = opts.formatAllRows();
  5976. }
  5977. $pageList.off('click').on('click', function (e) {
  5978. return _this6.onPageListChange(e);
  5979. });
  5980. $pre.off('click').on('click', function (e) {
  5981. return _this6.onPagePre(e);
  5982. });
  5983. $next.off('click').on('click', function (e) {
  5984. return _this6.onPageNext(e);
  5985. });
  5986. $number.off('click').on('click', function (e) {
  5987. return _this6.onPageNumber(e);
  5988. });
  5989. }
  5990. }
  5991. }, {
  5992. key: "updatePagination",
  5993. value: function updatePagination(event) {
  5994. // Fix #171: IE disabled button can be clicked bug.
  5995. if (event && $$p(event.currentTarget).hasClass('disabled')) {
  5996. return;
  5997. }
  5998. if (!this.options.maintainMetaData) {
  5999. this.resetRows();
  6000. }
  6001. this.initPagination();
  6002. this.trigger('page-change', this.options.pageNumber, this.options.pageSize);
  6003. if (this.options.sidePagination === 'server') {
  6004. this.initServer();
  6005. } else {
  6006. this.initBody();
  6007. }
  6008. }
  6009. }, {
  6010. key: "onPageListChange",
  6011. value: function onPageListChange(event) {
  6012. event.preventDefault();
  6013. var $this = $$p(event.currentTarget);
  6014. $this.parent().addClass(this.constants.classes.dropdownActive).siblings().removeClass(this.constants.classes.dropdownActive);
  6015. this.options.pageSize = $this.text().toUpperCase() === this.options.formatAllRows().toUpperCase() ? this.options.formatAllRows() : +$this.text();
  6016. this.$toolbar.find('.page-size').text(this.options.pageSize);
  6017. this.updatePagination(event);
  6018. return false;
  6019. }
  6020. }, {
  6021. key: "onPagePre",
  6022. value: function onPagePre(event) {
  6023. if ($$p(event.target).hasClass('disabled')) {
  6024. return;
  6025. }
  6026. event.preventDefault();
  6027. if (this.options.pageNumber - 1 === 0) {
  6028. this.options.pageNumber = this.options.totalPages;
  6029. } else {
  6030. this.options.pageNumber--;
  6031. }
  6032. this.updatePagination(event);
  6033. return false;
  6034. }
  6035. }, {
  6036. key: "onPageNext",
  6037. value: function onPageNext(event) {
  6038. if ($$p(event.target).hasClass('disabled')) {
  6039. return;
  6040. }
  6041. event.preventDefault();
  6042. if (this.options.pageNumber + 1 > this.options.totalPages) {
  6043. this.options.pageNumber = 1;
  6044. } else {
  6045. this.options.pageNumber++;
  6046. }
  6047. this.updatePagination(event);
  6048. return false;
  6049. }
  6050. }, {
  6051. key: "onPageNumber",
  6052. value: function onPageNumber(event) {
  6053. event.preventDefault();
  6054. if (this.options.pageNumber === +$$p(event.currentTarget).text()) {
  6055. return;
  6056. }
  6057. this.options.pageNumber = +$$p(event.currentTarget).text();
  6058. this.updatePagination(event);
  6059. return false;
  6060. }
  6061. // eslint-disable-next-line no-unused-vars
  6062. }, {
  6063. key: "initRow",
  6064. value: function initRow(item, i, data, trFragments) {
  6065. var _this7 = this;
  6066. var html = [];
  6067. var style = {};
  6068. var csses = [];
  6069. var data_ = '';
  6070. var attributes = {};
  6071. var htmlAttributes = [];
  6072. if (Utils.findIndex(this.hiddenRows, item) > -1) {
  6073. return;
  6074. }
  6075. style = Utils.calculateObjectValue(this.options, this.options.rowStyle, [item, i], style);
  6076. if (style && style.css) {
  6077. for (var _i9 = 0, _Object$entries8 = Object.entries(style.css); _i9 < _Object$entries8.length; _i9++) {
  6078. var _Object$entries8$_i = _slicedToArray(_Object$entries8[_i9], 2),
  6079. key = _Object$entries8$_i[0],
  6080. value = _Object$entries8$_i[1];
  6081. csses.push("".concat(key, ": ").concat(value));
  6082. }
  6083. }
  6084. attributes = Utils.calculateObjectValue(this.options, this.options.rowAttributes, [item, i], attributes);
  6085. if (attributes) {
  6086. for (var _i10 = 0, _Object$entries9 = Object.entries(attributes); _i10 < _Object$entries9.length; _i10++) {
  6087. var _Object$entries9$_i = _slicedToArray(_Object$entries9[_i10], 2),
  6088. _key2 = _Object$entries9$_i[0],
  6089. _value = _Object$entries9$_i[1];
  6090. htmlAttributes.push("".concat(_key2, "=\"").concat(Utils.escapeHTML(_value), "\""));
  6091. }
  6092. }
  6093. if (item._data && !Utils.isEmptyObject(item._data)) {
  6094. for (var _i11 = 0, _Object$entries10 = Object.entries(item._data); _i11 < _Object$entries10.length; _i11++) {
  6095. var _Object$entries10$_i = _slicedToArray(_Object$entries10[_i11], 2),
  6096. k = _Object$entries10$_i[0],
  6097. v = _Object$entries10$_i[1];
  6098. // ignore data-index
  6099. if (k === 'index') {
  6100. return;
  6101. }
  6102. data_ += " data-".concat(k, "='").concat(_typeof(v) === 'object' ? JSON.stringify(v) : v, "'");
  6103. }
  6104. }
  6105. html.push('<tr', Utils.sprintf(' %s', htmlAttributes.length ? htmlAttributes.join(' ') : undefined), Utils.sprintf(' id="%s"', Array.isArray(item) ? undefined : item._id), Utils.sprintf(' class="%s"', style.classes || (Array.isArray(item) ? undefined : item._class)), Utils.sprintf(' style="%s"', Array.isArray(item) ? undefined : item._style), " data-index=\"".concat(i, "\""), Utils.sprintf(' data-uniqueid="%s"', Utils.getItemField(item, this.options.uniqueId, false)), Utils.sprintf(' data-has-detail-view="%s"', this.options.detailView && Utils.calculateObjectValue(null, this.options.detailFilter, [i, item]) ? 'true' : undefined), Utils.sprintf('%s', data_), '>');
  6106. if (this.options.cardView) {
  6107. html.push("<td colspan=\"".concat(this.header.fields.length, "\"><div class=\"card-views\">"));
  6108. }
  6109. var detailViewTemplate = '';
  6110. if (Utils.hasDetailViewIcon(this.options)) {
  6111. detailViewTemplate = '<td>';
  6112. if (Utils.calculateObjectValue(null, this.options.detailFilter, [i, item])) {
  6113. detailViewTemplate += "\n <a class=\"detail-icon\" href=\"#\">\n ".concat(Utils.sprintf(this.constants.html.icon, this.options.iconsPrefix, this.options.icons.detailOpen), "\n </a>\n ");
  6114. }
  6115. detailViewTemplate += '</td>';
  6116. }
  6117. if (detailViewTemplate && this.options.detailViewAlign !== 'right') {
  6118. html.push(detailViewTemplate);
  6119. }
  6120. this.header.fields.forEach(function (field, j) {
  6121. var column = _this7.columns[j];
  6122. var text = '';
  6123. var value_ = Utils.getItemField(item, field, _this7.options.escape, column.escape);
  6124. var value = '';
  6125. var type = '';
  6126. var cellStyle = {};
  6127. var id_ = '';
  6128. var class_ = _this7.header.classes[j];
  6129. var style_ = '';
  6130. var styleToAdd_ = '';
  6131. var data_ = '';
  6132. var rowspan_ = '';
  6133. var colspan_ = '';
  6134. var title_ = '';
  6135. if ((_this7.fromHtml || _this7.autoMergeCells) && typeof value_ === 'undefined') {
  6136. if (!column.checkbox && !column.radio) {
  6137. return;
  6138. }
  6139. }
  6140. if (!column.visible) {
  6141. return;
  6142. }
  6143. if (_this7.options.cardView && !column.cardVisible) {
  6144. return;
  6145. }
  6146. // Style concat
  6147. if (csses.concat([_this7.header.styles[j]]).length) {
  6148. styleToAdd_ += "".concat(csses.concat([_this7.header.styles[j]]).join('; '));
  6149. }
  6150. if (item["_".concat(field, "_style")]) {
  6151. styleToAdd_ += "".concat(item["_".concat(field, "_style")]);
  6152. }
  6153. if (styleToAdd_) {
  6154. style_ = " style=\"".concat(styleToAdd_, "\"");
  6155. }
  6156. // Style concat
  6157. // handle id and class of td
  6158. if (item["_".concat(field, "_id")]) {
  6159. id_ = Utils.sprintf(' id="%s"', item["_".concat(field, "_id")]);
  6160. }
  6161. if (item["_".concat(field, "_class")]) {
  6162. class_ = Utils.sprintf(' class="%s"', item["_".concat(field, "_class")]);
  6163. }
  6164. if (item["_".concat(field, "_rowspan")]) {
  6165. rowspan_ = Utils.sprintf(' rowspan="%s"', item["_".concat(field, "_rowspan")]);
  6166. }
  6167. if (item["_".concat(field, "_colspan")]) {
  6168. colspan_ = Utils.sprintf(' colspan="%s"', item["_".concat(field, "_colspan")]);
  6169. }
  6170. if (item["_".concat(field, "_title")]) {
  6171. title_ = Utils.sprintf(' title="%s"', item["_".concat(field, "_title")]);
  6172. }
  6173. cellStyle = Utils.calculateObjectValue(_this7.header, _this7.header.cellStyles[j], [value_, item, i, field], cellStyle);
  6174. if (cellStyle.classes) {
  6175. class_ = " class=\"".concat(cellStyle.classes, "\"");
  6176. }
  6177. if (cellStyle.css) {
  6178. var csses_ = [];
  6179. for (var _i12 = 0, _Object$entries11 = Object.entries(cellStyle.css); _i12 < _Object$entries11.length; _i12++) {
  6180. var _Object$entries11$_i = _slicedToArray(_Object$entries11[_i12], 2),
  6181. _key3 = _Object$entries11$_i[0],
  6182. _value2 = _Object$entries11$_i[1];
  6183. csses_.push("".concat(_key3, ": ").concat(_value2));
  6184. }
  6185. style_ = " style=\"".concat(csses_.concat(_this7.header.styles[j]).join('; '), "\"");
  6186. }
  6187. value = Utils.calculateObjectValue(column, _this7.header.formatters[j], [value_, item, i, field], value_);
  6188. if (!(column.checkbox || column.radio)) {
  6189. value = typeof value === 'undefined' || value === null ? _this7.options.undefinedText : value;
  6190. }
  6191. if (column.searchable && _this7.searchText && _this7.options.searchHighlight && !(column.checkbox || column.radio)) {
  6192. var defValue = '';
  6193. var searchText = _this7.searchText.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
  6194. if (_this7.options.searchAccentNeutralise) {
  6195. var indexRegex = new RegExp("".concat(Utils.normalizeAccent(searchText)), 'gmi');
  6196. var match = indexRegex.exec(Utils.normalizeAccent(value));
  6197. if (match) {
  6198. searchText = value.substring(match.index, match.index + searchText.length);
  6199. }
  6200. }
  6201. var regExp = new RegExp("(".concat(searchText, ")"), 'gim');
  6202. var marker = '<mark>$1</mark>';
  6203. var isHTML = value && /<(?=.*? .*?\/ ?>|br|hr|input|!--|wbr)[a-z]+.*?>|<([a-z]+).*?<\/\1>/i.test(value);
  6204. if (isHTML) {
  6205. // value can contains a HTML tags
  6206. var textContent = new DOMParser().parseFromString(value.toString(), 'text/html').documentElement.textContent;
  6207. var textReplaced = textContent.replace(regExp, marker);
  6208. textContent = textContent.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
  6209. defValue = value.replace(new RegExp("(>\\s*)(".concat(textContent, ")(\\s*)"), 'gm'), "$1".concat(textReplaced, "$3"));
  6210. } else {
  6211. // but usually not
  6212. defValue = value.toString().replace(regExp, marker);
  6213. }
  6214. value = Utils.calculateObjectValue(column, column.searchHighlightFormatter, [value, _this7.searchText], defValue);
  6215. }
  6216. if (item["_".concat(field, "_data")] && !Utils.isEmptyObject(item["_".concat(field, "_data")])) {
  6217. for (var _i13 = 0, _Object$entries12 = Object.entries(item["_".concat(field, "_data")]); _i13 < _Object$entries12.length; _i13++) {
  6218. var _Object$entries12$_i = _slicedToArray(_Object$entries12[_i13], 2),
  6219. _k = _Object$entries12$_i[0],
  6220. _v = _Object$entries12$_i[1];
  6221. // ignore data-index
  6222. if (_k === 'index') {
  6223. return;
  6224. }
  6225. data_ += " data-".concat(_k, "=\"").concat(_v, "\"");
  6226. }
  6227. }
  6228. if (column.checkbox || column.radio) {
  6229. type = column.checkbox ? 'checkbox' : type;
  6230. type = column.radio ? 'radio' : type;
  6231. var c = column['class'] || '';
  6232. var isChecked = Utils.isObject(value) && value.hasOwnProperty('checked') ? value.checked : (value === true || value_) && value !== false;
  6233. var isDisabled = !column.checkboxEnabled || value && value.disabled;
  6234. text = [_this7.options.cardView ? "<div class=\"card-view ".concat(c, "\">") : "<td class=\"bs-checkbox ".concat(c, "\"").concat(class_).concat(style_, ">"), "<label>\n <input\n data-index=\"".concat(i, "\"\n name=\"").concat(_this7.options.selectItemName, "\"\n type=\"").concat(type, "\"\n ").concat(Utils.sprintf('value="%s"', item[_this7.options.idField]), "\n ").concat(Utils.sprintf('checked="%s"', isChecked ? 'checked' : undefined), "\n ").concat(Utils.sprintf('disabled="%s"', isDisabled ? 'disabled' : undefined), " />\n <span></span>\n </label>"), _this7.header.formatters[j] && typeof value === 'string' ? value : '', _this7.options.cardView ? '</div>' : '</td>'].join('');
  6235. item[_this7.header.stateField] = value === true || !!value_ || value && value.checked;
  6236. } else if (_this7.options.cardView) {
  6237. var cardTitle = _this7.options.showHeader ? "<span class=\"card-view-title ".concat(cellStyle.classes || '', "\"").concat(style_, ">").concat(Utils.getFieldTitle(_this7.columns, field), "</span>") : '';
  6238. text = "<div class=\"card-view\">".concat(cardTitle, "<span class=\"card-view-value ").concat(cellStyle.classes || '', "\"").concat(style_, ">").concat(value, "</span></div>");
  6239. if (_this7.options.smartDisplay && value === '') {
  6240. text = '<div class="card-view"></div>';
  6241. }
  6242. } else {
  6243. text = "<td".concat(id_).concat(class_).concat(style_).concat(data_).concat(rowspan_).concat(colspan_).concat(title_, ">").concat(value, "</td>");
  6244. }
  6245. html.push(text);
  6246. });
  6247. if (detailViewTemplate && this.options.detailViewAlign === 'right') {
  6248. html.push(detailViewTemplate);
  6249. }
  6250. if (this.options.cardView) {
  6251. html.push('</div></td>');
  6252. }
  6253. html.push('</tr>');
  6254. return html.join('');
  6255. }
  6256. }, {
  6257. key: "initBody",
  6258. value: function initBody(fixedScroll, updatedUid) {
  6259. var _this8 = this;
  6260. var data = this.getData();
  6261. this.trigger('pre-body', data);
  6262. this.$body = this.$el.find('>tbody');
  6263. if (!this.$body.length) {
  6264. this.$body = $$p('<tbody></tbody>').appendTo(this.$el);
  6265. }
  6266. // Fix #389 Bootstrap-table-flatJSON is not working
  6267. if (!this.options.pagination || this.options.sidePagination === 'server') {
  6268. this.pageFrom = 1;
  6269. this.pageTo = data.length;
  6270. }
  6271. var rows = [];
  6272. var trFragments = $$p(document.createDocumentFragment());
  6273. var hasTr = false;
  6274. var toExpand = [];
  6275. this.autoMergeCells = Utils.checkAutoMergeCells(data.slice(this.pageFrom - 1, this.pageTo));
  6276. for (var i = this.pageFrom - 1; i < this.pageTo; i++) {
  6277. var item = data[i];
  6278. var tr = this.initRow(item, i, data, trFragments);
  6279. hasTr = hasTr || !!tr;
  6280. if (tr && typeof tr === 'string') {
  6281. var uniqueId = this.options.uniqueId;
  6282. if (uniqueId && item.hasOwnProperty(uniqueId)) {
  6283. var itemUniqueId = item[uniqueId];
  6284. var oldTr = this.$body.find(Utils.sprintf('> tr[data-uniqueid="%s"][data-has-detail-view]', itemUniqueId));
  6285. var oldTrNext = oldTr.next();
  6286. if (oldTrNext.is('tr.detail-view')) {
  6287. toExpand.push(i);
  6288. if (!updatedUid || itemUniqueId !== updatedUid) {
  6289. tr += oldTrNext[0].outerHTML;
  6290. }
  6291. }
  6292. }
  6293. if (!this.options.virtualScroll) {
  6294. trFragments.append(tr);
  6295. } else {
  6296. rows.push(tr);
  6297. }
  6298. }
  6299. }
  6300. // show no records
  6301. if (!hasTr) {
  6302. this.$body.html("<tr class=\"no-records-found\">".concat(Utils.sprintf('<td colspan="%s">%s</td>', this.getVisibleFields().length + Utils.getDetailViewIndexOffset(this.options), this.options.formatNoMatches()), "</tr>"));
  6303. } else if (!this.options.virtualScroll) {
  6304. this.$body.html(trFragments);
  6305. } else {
  6306. if (this.virtualScroll) {
  6307. this.virtualScroll.destroy();
  6308. }
  6309. this.virtualScroll = new VirtualScroll({
  6310. rows: rows,
  6311. fixedScroll: fixedScroll,
  6312. scrollEl: this.$tableBody[0],
  6313. contentEl: this.$body[0],
  6314. itemHeight: this.options.virtualScrollItemHeight,
  6315. callback: function callback(startIndex, endIndex) {
  6316. _this8.fitHeader();
  6317. _this8.initBodyEvent();
  6318. _this8.trigger('virtual-scroll', startIndex, endIndex);
  6319. }
  6320. });
  6321. }
  6322. toExpand.forEach(function (index) {
  6323. _this8.expandRow(index);
  6324. });
  6325. if (!fixedScroll) {
  6326. this.scrollTo(0);
  6327. }
  6328. this.initBodyEvent();
  6329. this.initFooter();
  6330. this.resetView();
  6331. this.updateSelected();
  6332. if (this.options.sidePagination !== 'server') {
  6333. this.options.totalRows = data.length;
  6334. }
  6335. this.trigger('post-body', data);
  6336. }
  6337. }, {
  6338. key: "initBodyEvent",
  6339. value: function initBodyEvent() {
  6340. var _this9 = this;
  6341. // click to select by column
  6342. this.$body.find('> tr[data-index] > td').off('click dblclick').on('click dblclick', function (e) {
  6343. var $td = $$p(e.currentTarget);
  6344. if ($td.find('.detail-icon').length || $td.index() - Utils.getDetailViewIndexOffset(_this9.options) < 0) {
  6345. return;
  6346. }
  6347. var $tr = $td.parent();
  6348. var $cardViewArr = $$p(e.target).parents('.card-views').children();
  6349. var $cardViewTarget = $$p(e.target).parents('.card-view');
  6350. var rowIndex = $tr.data('index');
  6351. var item = _this9.data[rowIndex];
  6352. var index = _this9.options.cardView ? $cardViewArr.index($cardViewTarget) : $td[0].cellIndex;
  6353. var fields = _this9.getVisibleFields();
  6354. var field = fields[index - Utils.getDetailViewIndexOffset(_this9.options)];
  6355. var column = _this9.columns[_this9.fieldsColumnsIndex[field]];
  6356. var value = Utils.getItemField(item, field, _this9.options.escape, column.escape);
  6357. _this9.trigger(e.type === 'click' ? 'click-cell' : 'dbl-click-cell', field, value, item, $td);
  6358. _this9.trigger(e.type === 'click' ? 'click-row' : 'dbl-click-row', item, $tr, field);
  6359. // if click to select - then trigger the checkbox/radio click
  6360. if (e.type === 'click' && _this9.options.clickToSelect && column.clickToSelect && !Utils.calculateObjectValue(_this9.options, _this9.options.ignoreClickToSelectOn, [e.target])) {
  6361. var $selectItem = $tr.find(Utils.sprintf('[name="%s"]', _this9.options.selectItemName));
  6362. if ($selectItem.length) {
  6363. $selectItem[0].click();
  6364. }
  6365. }
  6366. if (e.type === 'click' && _this9.options.detailViewByClick) {
  6367. _this9.toggleDetailView(rowIndex, _this9.header.detailFormatters[_this9.fieldsColumnsIndex[field]]);
  6368. }
  6369. }).off('mousedown').on('mousedown', function (e) {
  6370. // https://github.com/jquery/jquery/issues/1741
  6371. _this9.multipleSelectRowCtrlKey = e.ctrlKey || e.metaKey;
  6372. _this9.multipleSelectRowShiftKey = e.shiftKey;
  6373. });
  6374. this.$body.find('> tr[data-index] > td > .detail-icon').off('click').on('click', function (e) {
  6375. e.preventDefault();
  6376. _this9.toggleDetailView($$p(e.currentTarget).parent().parent().data('index'));
  6377. return false;
  6378. });
  6379. this.$selectItem = this.$body.find(Utils.sprintf('[name="%s"]', this.options.selectItemName));
  6380. this.$selectItem.off('click').on('click', function (e) {
  6381. e.stopImmediatePropagation();
  6382. var $this = $$p(e.currentTarget);
  6383. _this9._toggleCheck($this.prop('checked'), $this.data('index'));
  6384. });
  6385. this.header.events.forEach(function (_events, i) {
  6386. var events = _events;
  6387. if (!events) {
  6388. return;
  6389. }
  6390. // fix bug, if events is defined with namespace
  6391. if (typeof events === 'string') {
  6392. events = Utils.calculateObjectValue(null, events);
  6393. }
  6394. if (!events) {
  6395. throw new Error("Unknown event in the scope: ".concat(_events));
  6396. }
  6397. var field = _this9.header.fields[i];
  6398. var fieldIndex = _this9.getVisibleFields().indexOf(field);
  6399. if (fieldIndex === -1) {
  6400. return;
  6401. }
  6402. fieldIndex += Utils.getDetailViewIndexOffset(_this9.options);
  6403. var _loop3 = function _loop3(key) {
  6404. if (!events.hasOwnProperty(key)) {
  6405. return 1; // continue
  6406. }
  6407. var event = events[key];
  6408. _this9.$body.find('>tr:not(.no-records-found)').each(function (i, tr) {
  6409. var $tr = $$p(tr);
  6410. var $td = $tr.find(_this9.options.cardView ? '.card-views>.card-view' : '>td').eq(fieldIndex);
  6411. var index = key.indexOf(' ');
  6412. var name = key.substring(0, index);
  6413. var el = key.substring(index + 1);
  6414. $td.find(el).off(name).on(name, function (e) {
  6415. var index = $tr.data('index');
  6416. var row = _this9.data[index];
  6417. var value = row[field];
  6418. event.apply(_this9, [e, value, row, index]);
  6419. });
  6420. });
  6421. };
  6422. for (var key in events) {
  6423. if (_loop3(key)) continue;
  6424. }
  6425. });
  6426. }
  6427. }, {
  6428. key: "initServer",
  6429. value: function initServer(silent, query, url) {
  6430. var _this10 = this;
  6431. var data = {};
  6432. var index = this.header.fields.indexOf(this.options.sortName);
  6433. var params = {
  6434. searchText: this.searchText,
  6435. sortName: this.options.sortName,
  6436. sortOrder: this.options.sortOrder
  6437. };
  6438. if (this.header.sortNames[index]) {
  6439. params.sortName = this.header.sortNames[index];
  6440. }
  6441. if (this.options.pagination && this.options.sidePagination === 'server') {
  6442. params.pageSize = this.options.pageSize === this.options.formatAllRows() ? this.options.totalRows : this.options.pageSize;
  6443. params.pageNumber = this.options.pageNumber;
  6444. }
  6445. if (!(url || this.options.url) && !this.options.ajax) {
  6446. return;
  6447. }
  6448. if (this.options.queryParamsType === 'limit') {
  6449. params = {
  6450. search: params.searchText,
  6451. sort: params.sortName,
  6452. order: params.sortOrder
  6453. };
  6454. if (this.options.pagination && this.options.sidePagination === 'server') {
  6455. params.offset = this.options.pageSize === this.options.formatAllRows() ? 0 : this.options.pageSize * (this.options.pageNumber - 1);
  6456. params.limit = this.options.pageSize;
  6457. if (params.limit === 0 || this.options.pageSize === this.options.formatAllRows()) {
  6458. delete params.limit;
  6459. }
  6460. }
  6461. }
  6462. if (this.options.search && this.options.sidePagination === 'server' && this.options.searchable && this.columns.filter(function (column) {
  6463. return column.searchable;
  6464. }).length) {
  6465. params.searchable = [];
  6466. var _iterator2 = _createForOfIteratorHelper(this.columns),
  6467. _step2;
  6468. try {
  6469. for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
  6470. var column = _step2.value;
  6471. if (!column.checkbox && column.searchable && (this.options.visibleSearch && column.visible || !this.options.visibleSearch)) {
  6472. params.searchable.push(column.field);
  6473. }
  6474. }
  6475. } catch (err) {
  6476. _iterator2.e(err);
  6477. } finally {
  6478. _iterator2.f();
  6479. }
  6480. }
  6481. if (!Utils.isEmptyObject(this.filterColumnsPartial)) {
  6482. params.filter = JSON.stringify(this.filterColumnsPartial, null);
  6483. }
  6484. Utils.extend(params, query || {});
  6485. data = Utils.calculateObjectValue(this.options, this.options.queryParams, [params], data);
  6486. // false to stop request
  6487. if (data === false) {
  6488. return;
  6489. }
  6490. if (!silent) {
  6491. this.showLoading();
  6492. }
  6493. var request = Utils.extend({}, Utils.calculateObjectValue(null, this.options.ajaxOptions), {
  6494. type: this.options.method,
  6495. url: url || this.options.url,
  6496. data: this.options.contentType === 'application/json' && this.options.method === 'post' ? JSON.stringify(data) : data,
  6497. cache: this.options.cache,
  6498. contentType: this.options.contentType,
  6499. dataType: this.options.dataType,
  6500. success: function success(_res, textStatus, jqXHR) {
  6501. var res = Utils.calculateObjectValue(_this10.options, _this10.options.responseHandler, [_res, jqXHR], _res);
  6502. _this10.load(res);
  6503. _this10.trigger('load-success', res, jqXHR && jqXHR.status, jqXHR);
  6504. if (!silent) {
  6505. _this10.hideLoading();
  6506. }
  6507. if (_this10.options.sidePagination === 'server' && _this10.options.pageNumber > 1 && res[_this10.options.totalField] > 0 && !res[_this10.options.dataField].length) {
  6508. _this10.updatePagination();
  6509. }
  6510. },
  6511. error: function error(jqXHR) {
  6512. // abort ajax by multiple request
  6513. if (jqXHR && jqXHR.status === 0 && _this10._xhrAbort) {
  6514. _this10._xhrAbort = false;
  6515. return;
  6516. }
  6517. var data = [];
  6518. if (_this10.options.sidePagination === 'server') {
  6519. data = {};
  6520. data[_this10.options.totalField] = 0;
  6521. data[_this10.options.dataField] = [];
  6522. }
  6523. _this10.load(data);
  6524. _this10.trigger('load-error', jqXHR && jqXHR.status, jqXHR);
  6525. if (!silent) {
  6526. _this10.hideLoading();
  6527. }
  6528. }
  6529. });
  6530. if (this.options.ajax) {
  6531. Utils.calculateObjectValue(this, this.options.ajax, [request], null);
  6532. } else {
  6533. if (this._xhr && this._xhr.readyState !== 4) {
  6534. this._xhrAbort = true;
  6535. this._xhr.abort();
  6536. }
  6537. this._xhr = $$p.ajax(request);
  6538. }
  6539. return data;
  6540. }
  6541. }, {
  6542. key: "initSearchText",
  6543. value: function initSearchText() {
  6544. if (this.options.search) {
  6545. this.searchText = '';
  6546. if (this.options.searchText !== '') {
  6547. var $search = Utils.getSearchInput(this);
  6548. $search.val(this.options.searchText);
  6549. this.onSearch({
  6550. currentTarget: $search,
  6551. firedByInitSearchText: true
  6552. });
  6553. }
  6554. }
  6555. }
  6556. }, {
  6557. key: "getCaret",
  6558. value: function getCaret() {
  6559. var _this11 = this;
  6560. this.$header.find('th').each(function (i, th) {
  6561. $$p(th).find('.sortable').removeClass('desc asc').addClass($$p(th).data('field') === _this11.options.sortName ? _this11.options.sortOrder : 'both');
  6562. });
  6563. }
  6564. }, {
  6565. key: "updateSelected",
  6566. value: function updateSelected() {
  6567. var checkAll = this.$selectItem.filter(':enabled').length && this.$selectItem.filter(':enabled').length === this.$selectItem.filter(':enabled').filter(':checked').length;
  6568. this.$selectAll.add(this.$selectAll_).prop('checked', checkAll);
  6569. this.$selectItem.each(function (i, el) {
  6570. $$p(el).closest('tr')[$$p(el).prop('checked') ? 'addClass' : 'removeClass']('selected');
  6571. });
  6572. }
  6573. }, {
  6574. key: "updateRows",
  6575. value: function updateRows() {
  6576. var _this12 = this;
  6577. this.$selectItem.each(function (i, el) {
  6578. _this12.data[$$p(el).data('index')][_this12.header.stateField] = $$p(el).prop('checked');
  6579. });
  6580. }
  6581. }, {
  6582. key: "resetRows",
  6583. value: function resetRows() {
  6584. var _iterator3 = _createForOfIteratorHelper(this.data),
  6585. _step3;
  6586. try {
  6587. for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
  6588. var row = _step3.value;
  6589. this.$selectAll.prop('checked', false);
  6590. this.$selectItem.prop('checked', false);
  6591. if (this.header.stateField) {
  6592. row[this.header.stateField] = false;
  6593. }
  6594. }
  6595. } catch (err) {
  6596. _iterator3.e(err);
  6597. } finally {
  6598. _iterator3.f();
  6599. }
  6600. this.initHiddenRows();
  6601. }
  6602. }, {
  6603. key: "trigger",
  6604. value: function trigger(_name) {
  6605. var _this$options, _this$options2;
  6606. var name = "".concat(_name, ".bs.table");
  6607. for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key4 = 1; _key4 < _len; _key4++) {
  6608. args[_key4 - 1] = arguments[_key4];
  6609. }
  6610. (_this$options = this.options)[BootstrapTable.EVENTS[name]].apply(_this$options, [].concat(args, [this]));
  6611. this.$el.trigger($$p.Event(name, {
  6612. sender: this
  6613. }), args);
  6614. (_this$options2 = this.options).onAll.apply(_this$options2, [name].concat([].concat(args, [this])));
  6615. this.$el.trigger($$p.Event('all.bs.table', {
  6616. sender: this
  6617. }), [name, args]);
  6618. }
  6619. }, {
  6620. key: "resetHeader",
  6621. value: function resetHeader() {
  6622. var _this13 = this;
  6623. // fix #61: the hidden table reset header bug.
  6624. // fix bug: get $el.css('width') error sometime (height = 500)
  6625. clearTimeout(this.timeoutId_);
  6626. this.timeoutId_ = setTimeout(function () {
  6627. return _this13.fitHeader();
  6628. }, this.$el.is(':hidden') ? 100 : 0);
  6629. }
  6630. }, {
  6631. key: "fitHeader",
  6632. value: function fitHeader() {
  6633. var _this14 = this;
  6634. if (this.$el.is(':hidden')) {
  6635. this.timeoutId_ = setTimeout(function () {
  6636. return _this14.fitHeader();
  6637. }, 100);
  6638. return;
  6639. }
  6640. var fixedBody = this.$tableBody.get(0);
  6641. var scrollWidth = this.hasScrollBar && fixedBody.scrollHeight > fixedBody.clientHeight + this.$header.outerHeight() ? Utils.getScrollBarWidth() : 0;
  6642. this.$el.css('margin-top', -this.$header.outerHeight());
  6643. var focused = this.$tableHeader.find(':focus');
  6644. if (focused.length > 0) {
  6645. var $th = focused.parents('th');
  6646. if ($th.length > 0) {
  6647. var dataField = $th.attr('data-field');
  6648. if (dataField !== undefined) {
  6649. var $headerTh = this.$header.find("[data-field='".concat(dataField, "']"));
  6650. if ($headerTh.length > 0) {
  6651. $headerTh.find(':input').addClass('focus-temp');
  6652. }
  6653. }
  6654. }
  6655. }
  6656. this.$header_ = this.$header.clone(true, true);
  6657. this.$selectAll_ = this.$header_.find('[name="btSelectAll"]');
  6658. this.$tableHeader.css('margin-right', scrollWidth).find('table').css('width', this.$el.outerWidth()).html('').attr('class', this.$el.attr('class')).append(this.$header_);
  6659. this.$tableLoading.css('width', this.$el.outerWidth());
  6660. var focusedTemp = $$p('.focus-temp:visible:eq(0)');
  6661. if (focusedTemp.length > 0) {
  6662. focusedTemp.focus();
  6663. this.$header.find('.focus-temp').removeClass('focus-temp');
  6664. }
  6665. // fix bug: $.data() is not working as expected after $.append()
  6666. this.$header.find('th[data-field]').each(function (i, el) {
  6667. _this14.$header_.find(Utils.sprintf('th[data-field="%s"]', $$p(el).data('field'))).data($$p(el).data());
  6668. });
  6669. var visibleFields = this.getVisibleFields();
  6670. var $ths = this.$header_.find('th');
  6671. var $tr = this.$body.find('>tr:not(.no-records-found,.virtual-scroll-top)').eq(0);
  6672. while ($tr.length && $tr.find('>td[colspan]:not([colspan="1"])').length) {
  6673. $tr = $tr.next();
  6674. }
  6675. var trLength = $tr.find('> *').length;
  6676. $tr.find('> *').each(function (i, el) {
  6677. var $this = $$p(el);
  6678. if (Utils.hasDetailViewIcon(_this14.options)) {
  6679. if (i === 0 && _this14.options.detailViewAlign !== 'right' || i === trLength - 1 && _this14.options.detailViewAlign === 'right') {
  6680. var $thDetail = $ths.filter('.detail');
  6681. var _zoomWidth = $thDetail.innerWidth() - $thDetail.find('.fht-cell').width();
  6682. $thDetail.find('.fht-cell').width($this.innerWidth() - _zoomWidth);
  6683. return;
  6684. }
  6685. }
  6686. var index = i - Utils.getDetailViewIndexOffset(_this14.options);
  6687. var $th = _this14.$header_.find(Utils.sprintf('th[data-field="%s"]', visibleFields[index]));
  6688. if ($th.length > 1) {
  6689. $th = $$p($ths[$this[0].cellIndex]);
  6690. }
  6691. var zoomWidth = $th.innerWidth() - $th.find('.fht-cell').width();
  6692. $th.find('.fht-cell').width($this.innerWidth() - zoomWidth);
  6693. });
  6694. this.horizontalScroll();
  6695. this.trigger('post-header');
  6696. }
  6697. }, {
  6698. key: "initFooter",
  6699. value: function initFooter() {
  6700. if (!this.options.showFooter || this.options.cardView) {
  6701. // do nothing
  6702. return;
  6703. }
  6704. var data = this.getData();
  6705. var html = [];
  6706. var detailTemplate = '';
  6707. if (Utils.hasDetailViewIcon(this.options)) {
  6708. detailTemplate = '<th class="detail"><div class="th-inner"></div><div class="fht-cell"></div></th>';
  6709. }
  6710. if (detailTemplate && this.options.detailViewAlign !== 'right') {
  6711. html.push(detailTemplate);
  6712. }
  6713. var _iterator4 = _createForOfIteratorHelper(this.columns),
  6714. _step4;
  6715. try {
  6716. for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
  6717. var column = _step4.value;
  6718. var falign = '';
  6719. var valign = '';
  6720. var csses = [];
  6721. var style = {};
  6722. var class_ = Utils.sprintf(' class="%s"', column['class']);
  6723. if (!column.visible || this.footerData && this.footerData.length > 0 && !(column.field in this.footerData[0])) {
  6724. continue;
  6725. }
  6726. if (this.options.cardView && !column.cardVisible) {
  6727. return;
  6728. }
  6729. falign = Utils.sprintf('text-align: %s; ', column.falign ? column.falign : column.align);
  6730. valign = Utils.sprintf('vertical-align: %s; ', column.valign);
  6731. style = Utils.calculateObjectValue(null, column.footerStyle || this.options.footerStyle, [column]);
  6732. if (style && style.css) {
  6733. for (var _i14 = 0, _Object$entries13 = Object.entries(style.css); _i14 < _Object$entries13.length; _i14++) {
  6734. var _Object$entries13$_i = _slicedToArray(_Object$entries13[_i14], 2),
  6735. key = _Object$entries13$_i[0],
  6736. _value3 = _Object$entries13$_i[1];
  6737. csses.push("".concat(key, ": ").concat(_value3));
  6738. }
  6739. }
  6740. if (style && style.classes) {
  6741. class_ = Utils.sprintf(' class="%s"', column['class'] ? [column['class'], style.classes].join(' ') : style.classes);
  6742. }
  6743. html.push('<th', class_, Utils.sprintf(' style="%s"', falign + valign + csses.concat().join('; ') || undefined));
  6744. var colspan = 0;
  6745. if (this.footerData && this.footerData.length > 0) {
  6746. colspan = this.footerData[0]["_".concat(column.field, "_colspan")] || 0;
  6747. }
  6748. if (colspan) {
  6749. html.push(" colspan=\"".concat(colspan, "\" "));
  6750. }
  6751. html.push('>');
  6752. html.push('<div class="th-inner">');
  6753. var value = '';
  6754. if (this.footerData && this.footerData.length > 0) {
  6755. value = this.footerData[0][column.field] || '';
  6756. }
  6757. html.push(Utils.calculateObjectValue(column, column.footerFormatter, [data, value], value));
  6758. html.push('</div>');
  6759. html.push('<div class="fht-cell"></div>');
  6760. html.push('</div>');
  6761. html.push('</th>');
  6762. }
  6763. } catch (err) {
  6764. _iterator4.e(err);
  6765. } finally {
  6766. _iterator4.f();
  6767. }
  6768. if (detailTemplate && this.options.detailViewAlign === 'right') {
  6769. html.push(detailTemplate);
  6770. }
  6771. if (!this.options.height && !this.$tableFooter.length) {
  6772. this.$el.append('<tfoot><tr></tr></tfoot>');
  6773. this.$tableFooter = this.$el.find('tfoot');
  6774. }
  6775. if (!this.$tableFooter.find('tr').length) {
  6776. this.$tableFooter.html('<table><thead><tr></tr></thead></table>');
  6777. }
  6778. this.$tableFooter.find('tr').html(html.join(''));
  6779. this.trigger('post-footer', this.$tableFooter);
  6780. }
  6781. }, {
  6782. key: "fitFooter",
  6783. value: function fitFooter() {
  6784. var _this15 = this;
  6785. if (this.$el.is(':hidden')) {
  6786. setTimeout(function () {
  6787. return _this15.fitFooter();
  6788. }, 100);
  6789. return;
  6790. }
  6791. var fixedBody = this.$tableBody.get(0);
  6792. var scrollWidth = this.hasScrollBar && fixedBody.scrollHeight > fixedBody.clientHeight + this.$header.outerHeight() ? Utils.getScrollBarWidth() : 0;
  6793. this.$tableFooter.css('margin-right', scrollWidth).find('table').css('width', this.$el.outerWidth()).attr('class', this.$el.attr('class'));
  6794. var $ths = this.$tableFooter.find('th');
  6795. var $tr = this.$body.find('>tr:first-child:not(.no-records-found)');
  6796. $ths.find('.fht-cell').width('auto');
  6797. while ($tr.length && $tr.find('>td[colspan]:not([colspan="1"])').length) {
  6798. $tr = $tr.next();
  6799. }
  6800. var trLength = $tr.find('> *').length;
  6801. $tr.find('> *').each(function (i, el) {
  6802. var $this = $$p(el);
  6803. if (Utils.hasDetailViewIcon(_this15.options)) {
  6804. if (i === 0 && _this15.options.detailViewAlign === 'left' || i === trLength - 1 && _this15.options.detailViewAlign === 'right') {
  6805. var $thDetail = $ths.filter('.detail');
  6806. var _zoomWidth2 = $thDetail.innerWidth() - $thDetail.find('.fht-cell').width();
  6807. $thDetail.find('.fht-cell').width($this.innerWidth() - _zoomWidth2);
  6808. return;
  6809. }
  6810. }
  6811. var $th = $ths.eq(i);
  6812. var zoomWidth = $th.innerWidth() - $th.find('.fht-cell').width();
  6813. $th.find('.fht-cell').width($this.innerWidth() - zoomWidth);
  6814. });
  6815. this.horizontalScroll();
  6816. }
  6817. }, {
  6818. key: "horizontalScroll",
  6819. value: function horizontalScroll() {
  6820. var _this16 = this;
  6821. // horizontal scroll event
  6822. // TODO: it's probably better improving the layout than binding to scroll event
  6823. this.$tableBody.off('scroll').on('scroll', function () {
  6824. var scrollLeft = _this16.$tableBody.scrollLeft();
  6825. if (_this16.options.showHeader && _this16.options.height) {
  6826. _this16.$tableHeader.scrollLeft(scrollLeft);
  6827. }
  6828. if (_this16.options.showFooter && !_this16.options.cardView) {
  6829. _this16.$tableFooter.scrollLeft(scrollLeft);
  6830. }
  6831. _this16.trigger('scroll-body', _this16.$tableBody);
  6832. });
  6833. }
  6834. }, {
  6835. key: "getVisibleFields",
  6836. value: function getVisibleFields() {
  6837. var visibleFields = [];
  6838. var _iterator5 = _createForOfIteratorHelper(this.header.fields),
  6839. _step5;
  6840. try {
  6841. for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
  6842. var field = _step5.value;
  6843. var column = this.columns[this.fieldsColumnsIndex[field]];
  6844. if (!column || !column.visible || this.options.cardView && !column.cardVisible) {
  6845. continue;
  6846. }
  6847. visibleFields.push(field);
  6848. }
  6849. } catch (err) {
  6850. _iterator5.e(err);
  6851. } finally {
  6852. _iterator5.f();
  6853. }
  6854. return visibleFields;
  6855. }
  6856. }, {
  6857. key: "initHiddenRows",
  6858. value: function initHiddenRows() {
  6859. this.hiddenRows = [];
  6860. }
  6861. // PUBLIC FUNCTION DEFINITION
  6862. // =======================
  6863. }, {
  6864. key: "getOptions",
  6865. value: function getOptions() {
  6866. // deep copy and remove data
  6867. var options = Utils.extend({}, this.options);
  6868. delete options.data;
  6869. return Utils.extend(true, {}, options);
  6870. }
  6871. }, {
  6872. key: "refreshOptions",
  6873. value: function refreshOptions(options) {
  6874. // If the objects are equivalent then avoid the call of destroy / init methods
  6875. if (Utils.compareObjects(this.options, options, true)) {
  6876. return;
  6877. }
  6878. this.options = Utils.extend(this.options, options);
  6879. this.trigger('refresh-options', this.options);
  6880. this.destroy();
  6881. this.init();
  6882. }
  6883. }, {
  6884. key: "getData",
  6885. value: function getData(params) {
  6886. var _this17 = this;
  6887. var data = this.options.data;
  6888. if ((this.searchText || this.options.customSearch || this.options.sortName !== undefined || this.enableCustomSort ||
  6889. // Fix #4616: this.enableCustomSort is for extensions
  6890. !Utils.isEmptyObject(this.filterColumns) || typeof this.options.filterOptions.filterAlgorithm === 'function' || !Utils.isEmptyObject(this.filterColumnsPartial)) && (!params || !params.unfiltered)) {
  6891. data = this.data;
  6892. }
  6893. if (params && !params.includeHiddenRows) {
  6894. var hiddenRows = this.getHiddenRows();
  6895. data = data.filter(function (row) {
  6896. return Utils.findIndex(hiddenRows, row) === -1;
  6897. });
  6898. }
  6899. if (params && params.useCurrentPage) {
  6900. data = data.slice(this.pageFrom - 1, this.pageTo);
  6901. }
  6902. if (params && params.formatted) {
  6903. data.forEach(function (row) {
  6904. for (var _i15 = 0, _Object$entries14 = Object.entries(row); _i15 < _Object$entries14.length; _i15++) {
  6905. var _Object$entries14$_i = _slicedToArray(_Object$entries14[_i15], 2),
  6906. key = _Object$entries14$_i[0],
  6907. value = _Object$entries14$_i[1];
  6908. var column = _this17.columns[_this17.fieldsColumnsIndex[key]];
  6909. if (!column) {
  6910. return;
  6911. }
  6912. row[key] = Utils.calculateObjectValue(column, _this17.header.formatters[column.fieldIndex], [value, row, row.index, column.field], value);
  6913. }
  6914. });
  6915. }
  6916. return data;
  6917. }
  6918. }, {
  6919. key: "getSelections",
  6920. value: function getSelections() {
  6921. var _this18 = this;
  6922. return (this.options.maintainMetaData ? this.options.data : this.data).filter(function (row) {
  6923. return row[_this18.header.stateField] === true;
  6924. });
  6925. }
  6926. }, {
  6927. key: "load",
  6928. value: function load(_data) {
  6929. var fixedScroll = false;
  6930. var data = _data;
  6931. // #431: support pagination
  6932. if (this.options.pagination && this.options.sidePagination === 'server') {
  6933. this.options.totalRows = data[this.options.totalField];
  6934. this.options.totalNotFiltered = data[this.options.totalNotFilteredField];
  6935. this.footerData = data[this.options.footerField] ? [data[this.options.footerField]] : undefined;
  6936. }
  6937. fixedScroll = this.options.fixedScroll || data.fixedScroll;
  6938. data = Array.isArray(data) ? data : data[this.options.dataField];
  6939. this.initData(data);
  6940. this.initSearch();
  6941. this.initPagination();
  6942. this.initBody(fixedScroll);
  6943. }
  6944. }, {
  6945. key: "append",
  6946. value: function append(data) {
  6947. this.initData(data, 'append');
  6948. this.initSearch();
  6949. this.initPagination();
  6950. this.initSort();
  6951. this.initBody(true);
  6952. }
  6953. }, {
  6954. key: "prepend",
  6955. value: function prepend(data) {
  6956. this.initData(data, 'prepend');
  6957. this.initSearch();
  6958. this.initPagination();
  6959. this.initSort();
  6960. this.initBody(true);
  6961. }
  6962. }, {
  6963. key: "remove",
  6964. value: function remove(params) {
  6965. var removed = 0;
  6966. for (var i = this.options.data.length - 1; i >= 0; i--) {
  6967. var row = this.options.data[i];
  6968. var value = Utils.getItemField(row, params.field, this.options.escape, row.escape);
  6969. if (value === undefined && params.field !== '$index') {
  6970. continue;
  6971. }
  6972. if (!row.hasOwnProperty(params.field) && params.field === '$index' && params.values.includes(i) || params.values.includes(value)) {
  6973. removed++;
  6974. this.options.data.splice(i, 1);
  6975. }
  6976. }
  6977. if (!removed) {
  6978. return;
  6979. }
  6980. if (this.options.sidePagination === 'server') {
  6981. this.options.totalRows -= removed;
  6982. this.data = _toConsumableArray(this.options.data);
  6983. }
  6984. this.initSearch();
  6985. this.initPagination();
  6986. this.initSort();
  6987. this.initBody(true);
  6988. }
  6989. }, {
  6990. key: "removeAll",
  6991. value: function removeAll() {
  6992. if (this.options.data.length > 0) {
  6993. this.options.data.splice(0, this.options.data.length);
  6994. this.initSearch();
  6995. this.initPagination();
  6996. this.initBody(true);
  6997. }
  6998. }
  6999. }, {
  7000. key: "insertRow",
  7001. value: function insertRow(params) {
  7002. if (!params.hasOwnProperty('index') || !params.hasOwnProperty('row')) {
  7003. return;
  7004. }
  7005. this.options.data.splice(params.index, 0, params.row);
  7006. this.initSearch();
  7007. this.initPagination();
  7008. this.initSort();
  7009. this.initBody(true);
  7010. }
  7011. }, {
  7012. key: "updateRow",
  7013. value: function updateRow(params) {
  7014. var allParams = Array.isArray(params) ? params : [params];
  7015. var _iterator6 = _createForOfIteratorHelper(allParams),
  7016. _step6;
  7017. try {
  7018. for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
  7019. var _params = _step6.value;
  7020. if (!_params.hasOwnProperty('index') || !_params.hasOwnProperty('row')) {
  7021. continue;
  7022. }
  7023. if (_params.hasOwnProperty('replace') && _params.replace) {
  7024. this.options.data[_params.index] = _params.row;
  7025. } else {
  7026. Utils.extend(this.options.data[_params.index], _params.row);
  7027. }
  7028. }
  7029. } catch (err) {
  7030. _iterator6.e(err);
  7031. } finally {
  7032. _iterator6.f();
  7033. }
  7034. this.initSearch();
  7035. this.initPagination();
  7036. this.initSort();
  7037. this.initBody(true);
  7038. }
  7039. }, {
  7040. key: "getRowByUniqueId",
  7041. value: function getRowByUniqueId(_id) {
  7042. var uniqueId = this.options.uniqueId;
  7043. var len = this.options.data.length;
  7044. var id = _id;
  7045. var dataRow = null;
  7046. var i;
  7047. var row;
  7048. for (i = len - 1; i >= 0; i--) {
  7049. row = this.options.data[i];
  7050. var rowUniqueId = Utils.getItemField(row, uniqueId, this.options.escape, row.escape);
  7051. if (rowUniqueId === undefined) {
  7052. continue;
  7053. }
  7054. if (typeof rowUniqueId === 'string') {
  7055. id = id.toString();
  7056. } else if (typeof rowUniqueId === 'number') {
  7057. if (Number(rowUniqueId) === rowUniqueId && rowUniqueId % 1 === 0) {
  7058. id = parseInt(id, 10);
  7059. } else if (rowUniqueId === Number(rowUniqueId) && rowUniqueId !== 0) {
  7060. id = parseFloat(id);
  7061. }
  7062. }
  7063. if (rowUniqueId === id) {
  7064. dataRow = row;
  7065. break;
  7066. }
  7067. }
  7068. return dataRow;
  7069. }
  7070. }, {
  7071. key: "updateByUniqueId",
  7072. value: function updateByUniqueId(params) {
  7073. var allParams = Array.isArray(params) ? params : [params];
  7074. var updatedUid = null;
  7075. var _iterator7 = _createForOfIteratorHelper(allParams),
  7076. _step7;
  7077. try {
  7078. for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
  7079. var _params2 = _step7.value;
  7080. if (!_params2.hasOwnProperty('id') || !_params2.hasOwnProperty('row')) {
  7081. continue;
  7082. }
  7083. var rowId = this.options.data.indexOf(this.getRowByUniqueId(_params2.id));
  7084. if (rowId === -1) {
  7085. continue;
  7086. }
  7087. if (_params2.hasOwnProperty('replace') && _params2.replace) {
  7088. this.options.data[rowId] = _params2.row;
  7089. } else {
  7090. Utils.extend(this.options.data[rowId], _params2.row);
  7091. }
  7092. updatedUid = _params2.id;
  7093. }
  7094. } catch (err) {
  7095. _iterator7.e(err);
  7096. } finally {
  7097. _iterator7.f();
  7098. }
  7099. this.initSearch();
  7100. this.initPagination();
  7101. this.initSort();
  7102. this.initBody(true, updatedUid);
  7103. }
  7104. }, {
  7105. key: "removeByUniqueId",
  7106. value: function removeByUniqueId(id) {
  7107. var len = this.options.data.length;
  7108. var row = this.getRowByUniqueId(id);
  7109. if (row) {
  7110. this.options.data.splice(this.options.data.indexOf(row), 1);
  7111. }
  7112. if (len === this.options.data.length) {
  7113. return;
  7114. }
  7115. if (this.options.sidePagination === 'server') {
  7116. this.options.totalRows -= 1;
  7117. this.data = _toConsumableArray(this.options.data);
  7118. }
  7119. this.initSearch();
  7120. this.initPagination();
  7121. this.initBody(true);
  7122. }
  7123. }, {
  7124. key: "_updateCellOnly",
  7125. value: function _updateCellOnly(field, index) {
  7126. var rowHtml = this.initRow(this.options.data[index], index);
  7127. var fieldIndex = this.getVisibleFields().indexOf(field);
  7128. if (fieldIndex === -1) {
  7129. return;
  7130. }
  7131. fieldIndex += Utils.getDetailViewIndexOffset(this.options);
  7132. this.$body.find(">tr[data-index=".concat(index, "]")).find(">td:eq(".concat(fieldIndex, ")")).replaceWith($$p(rowHtml).find(">td:eq(".concat(fieldIndex, ")")));
  7133. this.initBodyEvent();
  7134. this.initFooter();
  7135. this.resetView();
  7136. this.updateSelected();
  7137. }
  7138. }, {
  7139. key: "updateCell",
  7140. value: function updateCell(params) {
  7141. if (!params.hasOwnProperty('index') || !params.hasOwnProperty('field') || !params.hasOwnProperty('value')) {
  7142. return;
  7143. }
  7144. this.options.data[params.index][params.field] = params.value;
  7145. if (params.reinit === false) {
  7146. this._updateCellOnly(params.field, params.index);
  7147. return;
  7148. }
  7149. this.initSort();
  7150. this.initBody(true);
  7151. }
  7152. }, {
  7153. key: "updateCellByUniqueId",
  7154. value: function updateCellByUniqueId(params) {
  7155. var _this19 = this;
  7156. var allParams = Array.isArray(params) ? params : [params];
  7157. allParams.forEach(function (_ref6) {
  7158. var id = _ref6.id,
  7159. field = _ref6.field,
  7160. value = _ref6.value;
  7161. var index = _this19.options.data.indexOf(_this19.getRowByUniqueId(id));
  7162. if (index === -1) {
  7163. return;
  7164. }
  7165. _this19.options.data[index][field] = value;
  7166. });
  7167. if (params.reinit === false) {
  7168. this._updateCellOnly(params.field, this.options.data.indexOf(this.getRowByUniqueId(params.id)));
  7169. return;
  7170. }
  7171. this.initSort();
  7172. this.initBody(true);
  7173. }
  7174. }, {
  7175. key: "showRow",
  7176. value: function showRow(params) {
  7177. this._toggleRow(params, true);
  7178. }
  7179. }, {
  7180. key: "hideRow",
  7181. value: function hideRow(params) {
  7182. this._toggleRow(params, false);
  7183. }
  7184. }, {
  7185. key: "_toggleRow",
  7186. value: function _toggleRow(params, visible) {
  7187. var row;
  7188. if (params.hasOwnProperty('index')) {
  7189. row = this.getData()[params.index];
  7190. } else if (params.hasOwnProperty('uniqueId')) {
  7191. row = this.getRowByUniqueId(params.uniqueId);
  7192. }
  7193. if (!row) {
  7194. return;
  7195. }
  7196. var index = Utils.findIndex(this.hiddenRows, row);
  7197. if (!visible && index === -1) {
  7198. this.hiddenRows.push(row);
  7199. } else if (visible && index > -1) {
  7200. this.hiddenRows.splice(index, 1);
  7201. }
  7202. this.initBody(true);
  7203. this.initPagination();
  7204. }
  7205. }, {
  7206. key: "getHiddenRows",
  7207. value: function getHiddenRows(show) {
  7208. if (show) {
  7209. this.initHiddenRows();
  7210. this.initBody(true);
  7211. this.initPagination();
  7212. return;
  7213. }
  7214. var data = this.getData();
  7215. var rows = [];
  7216. var _iterator8 = _createForOfIteratorHelper(data),
  7217. _step8;
  7218. try {
  7219. for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
  7220. var row = _step8.value;
  7221. if (this.hiddenRows.includes(row)) {
  7222. rows.push(row);
  7223. }
  7224. }
  7225. } catch (err) {
  7226. _iterator8.e(err);
  7227. } finally {
  7228. _iterator8.f();
  7229. }
  7230. this.hiddenRows = rows;
  7231. return rows;
  7232. }
  7233. }, {
  7234. key: "showColumn",
  7235. value: function showColumn(field) {
  7236. var _this20 = this;
  7237. var fields = Array.isArray(field) ? field : [field];
  7238. fields.forEach(function (field) {
  7239. _this20._toggleColumn(_this20.fieldsColumnsIndex[field], true, true);
  7240. });
  7241. }
  7242. }, {
  7243. key: "hideColumn",
  7244. value: function hideColumn(field) {
  7245. var _this21 = this;
  7246. var fields = Array.isArray(field) ? field : [field];
  7247. fields.forEach(function (field) {
  7248. _this21._toggleColumn(_this21.fieldsColumnsIndex[field], false, true);
  7249. });
  7250. }
  7251. }, {
  7252. key: "_toggleColumn",
  7253. value: function _toggleColumn(index, checked, needUpdate) {
  7254. if (index === -1 || this.columns[index].visible === checked) {
  7255. return;
  7256. }
  7257. this.columns[index].visible = checked;
  7258. this.initHeader();
  7259. this.initSearch();
  7260. this.initPagination();
  7261. this.initBody();
  7262. if (this.options.showColumns) {
  7263. var $items = this.$toolbar.find('.keep-open input:not(".toggle-all")').prop('disabled', false);
  7264. if (needUpdate) {
  7265. $items.filter(Utils.sprintf('[value="%s"]', index)).prop('checked', checked);
  7266. }
  7267. if ($items.filter(':checked').length <= this.options.minimumCountColumns) {
  7268. $items.filter(':checked').prop('disabled', true);
  7269. }
  7270. }
  7271. }
  7272. }, {
  7273. key: "getVisibleColumns",
  7274. value: function getVisibleColumns() {
  7275. var _this22 = this;
  7276. return this.columns.filter(function (column) {
  7277. return column.visible && !_this22.isSelectionColumn(column);
  7278. });
  7279. }
  7280. }, {
  7281. key: "getHiddenColumns",
  7282. value: function getHiddenColumns() {
  7283. return this.columns.filter(function (_ref7) {
  7284. var visible = _ref7.visible;
  7285. return !visible;
  7286. });
  7287. }
  7288. }, {
  7289. key: "isSelectionColumn",
  7290. value: function isSelectionColumn(column) {
  7291. return column.radio || column.checkbox;
  7292. }
  7293. }, {
  7294. key: "showAllColumns",
  7295. value: function showAllColumns() {
  7296. this._toggleAllColumns(true);
  7297. }
  7298. }, {
  7299. key: "hideAllColumns",
  7300. value: function hideAllColumns() {
  7301. this._toggleAllColumns(false);
  7302. }
  7303. }, {
  7304. key: "_toggleAllColumns",
  7305. value: function _toggleAllColumns(visible) {
  7306. var _this23 = this;
  7307. var _iterator9 = _createForOfIteratorHelper(this.columns.slice().reverse()),
  7308. _step9;
  7309. try {
  7310. for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
  7311. var column = _step9.value;
  7312. if (column.switchable) {
  7313. if (!visible && this.options.showColumns && this.getVisibleColumns().filter(function (it) {
  7314. return it.switchable;
  7315. }).length === this.options.minimumCountColumns) {
  7316. continue;
  7317. }
  7318. column.visible = visible;
  7319. }
  7320. }
  7321. } catch (err) {
  7322. _iterator9.e(err);
  7323. } finally {
  7324. _iterator9.f();
  7325. }
  7326. this.initHeader();
  7327. this.initSearch();
  7328. this.initPagination();
  7329. this.initBody();
  7330. if (this.options.showColumns) {
  7331. var $items = this.$toolbar.find('.keep-open input[type="checkbox"]:not(".toggle-all")').prop('disabled', false);
  7332. if (visible) {
  7333. $items.prop('checked', visible);
  7334. } else {
  7335. $items.get().reverse().forEach(function (item) {
  7336. if ($items.filter(':checked').length > _this23.options.minimumCountColumns) {
  7337. $$p(item).prop('checked', visible);
  7338. }
  7339. });
  7340. }
  7341. if ($items.filter(':checked').length <= this.options.minimumCountColumns) {
  7342. $items.filter(':checked').prop('disabled', true);
  7343. }
  7344. }
  7345. }
  7346. }, {
  7347. key: "mergeCells",
  7348. value: function mergeCells(options) {
  7349. var row = options.index;
  7350. var col = this.getVisibleFields().indexOf(options.field);
  7351. var rowspan = options.rowspan || 1;
  7352. var colspan = options.colspan || 1;
  7353. var i;
  7354. var j;
  7355. var $tr = this.$body.find('>tr[data-index]');
  7356. col += Utils.getDetailViewIndexOffset(this.options);
  7357. var $td = $tr.eq(row).find('>td').eq(col);
  7358. if (row < 0 || col < 0 || row >= this.data.length) {
  7359. return;
  7360. }
  7361. for (i = row; i < row + rowspan; i++) {
  7362. for (j = col; j < col + colspan; j++) {
  7363. $tr.eq(i).find('>td').eq(j).hide();
  7364. }
  7365. }
  7366. $td.attr('rowspan', rowspan).attr('colspan', colspan).show();
  7367. }
  7368. }, {
  7369. key: "checkAll",
  7370. value: function checkAll() {
  7371. this._toggleCheckAll(true);
  7372. }
  7373. }, {
  7374. key: "uncheckAll",
  7375. value: function uncheckAll() {
  7376. this._toggleCheckAll(false);
  7377. }
  7378. }, {
  7379. key: "_toggleCheckAll",
  7380. value: function _toggleCheckAll(checked) {
  7381. var rowsBefore = this.getSelections();
  7382. this.$selectAll.add(this.$selectAll_).prop('checked', checked);
  7383. this.$selectItem.filter(':enabled').prop('checked', checked);
  7384. this.updateRows();
  7385. this.updateSelected();
  7386. var rowsAfter = this.getSelections();
  7387. if (checked) {
  7388. this.trigger('check-all', rowsAfter, rowsBefore);
  7389. return;
  7390. }
  7391. this.trigger('uncheck-all', rowsAfter, rowsBefore);
  7392. }
  7393. }, {
  7394. key: "checkInvert",
  7395. value: function checkInvert() {
  7396. var $items = this.$selectItem.filter(':enabled');
  7397. var checked = $items.filter(':checked');
  7398. $items.each(function (i, el) {
  7399. $$p(el).prop('checked', !$$p(el).prop('checked'));
  7400. });
  7401. this.updateRows();
  7402. this.updateSelected();
  7403. this.trigger('uncheck-some', checked);
  7404. checked = this.getSelections();
  7405. this.trigger('check-some', checked);
  7406. }
  7407. }, {
  7408. key: "check",
  7409. value: function check(index) {
  7410. this._toggleCheck(true, index);
  7411. }
  7412. }, {
  7413. key: "uncheck",
  7414. value: function uncheck(index) {
  7415. this._toggleCheck(false, index);
  7416. }
  7417. }, {
  7418. key: "_toggleCheck",
  7419. value: function _toggleCheck(checked, index) {
  7420. var $el = this.$selectItem.filter("[data-index=\"".concat(index, "\"]"));
  7421. var row = this.data[index];
  7422. if ($el.is(':radio') || this.options.singleSelect || this.options.multipleSelectRow && !this.multipleSelectRowCtrlKey && !this.multipleSelectRowShiftKey) {
  7423. var _iterator10 = _createForOfIteratorHelper(this.options.data),
  7424. _step10;
  7425. try {
  7426. for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
  7427. var r = _step10.value;
  7428. r[this.header.stateField] = false;
  7429. }
  7430. } catch (err) {
  7431. _iterator10.e(err);
  7432. } finally {
  7433. _iterator10.f();
  7434. }
  7435. this.$selectItem.filter(':checked').not($el).prop('checked', false);
  7436. }
  7437. row[this.header.stateField] = checked;
  7438. if (this.options.multipleSelectRow) {
  7439. if (this.multipleSelectRowShiftKey && this.multipleSelectRowLastSelectedIndex >= 0) {
  7440. var _ref8 = this.multipleSelectRowLastSelectedIndex < index ? [this.multipleSelectRowLastSelectedIndex, index] : [index, this.multipleSelectRowLastSelectedIndex],
  7441. _ref9 = _slicedToArray(_ref8, 2),
  7442. fromIndex = _ref9[0],
  7443. toIndex = _ref9[1];
  7444. for (var i = fromIndex + 1; i < toIndex; i++) {
  7445. this.data[i][this.header.stateField] = true;
  7446. this.$selectItem.filter("[data-index=\"".concat(i, "\"]")).prop('checked', true);
  7447. }
  7448. }
  7449. this.multipleSelectRowCtrlKey = false;
  7450. this.multipleSelectRowShiftKey = false;
  7451. this.multipleSelectRowLastSelectedIndex = checked ? index : -1;
  7452. }
  7453. $el.prop('checked', checked);
  7454. this.updateSelected();
  7455. this.trigger(checked ? 'check' : 'uncheck', this.data[index], $el);
  7456. }
  7457. }, {
  7458. key: "checkBy",
  7459. value: function checkBy(obj) {
  7460. this._toggleCheckBy(true, obj);
  7461. }
  7462. }, {
  7463. key: "uncheckBy",
  7464. value: function uncheckBy(obj) {
  7465. this._toggleCheckBy(false, obj);
  7466. }
  7467. }, {
  7468. key: "_toggleCheckBy",
  7469. value: function _toggleCheckBy(checked, obj) {
  7470. var _this24 = this;
  7471. if (!obj.hasOwnProperty('field') || !obj.hasOwnProperty('values')) {
  7472. return;
  7473. }
  7474. var rows = [];
  7475. this.data.forEach(function (row, i) {
  7476. if (!row.hasOwnProperty(obj.field)) {
  7477. return false;
  7478. }
  7479. if (obj.values.includes(row[obj.field])) {
  7480. var $el = _this24.$selectItem.filter(':enabled').filter(Utils.sprintf('[data-index="%s"]', i));
  7481. var onlyCurrentPage = obj.hasOwnProperty('onlyCurrentPage') ? obj.onlyCurrentPage : false;
  7482. $el = checked ? $el.not(':checked') : $el.filter(':checked');
  7483. if (!$el.length && onlyCurrentPage) {
  7484. return;
  7485. }
  7486. $el.prop('checked', checked);
  7487. row[_this24.header.stateField] = checked;
  7488. rows.push(row);
  7489. _this24.trigger(checked ? 'check' : 'uncheck', row, $el);
  7490. }
  7491. });
  7492. this.updateSelected();
  7493. this.trigger(checked ? 'check-some' : 'uncheck-some', rows);
  7494. }
  7495. }, {
  7496. key: "refresh",
  7497. value: function refresh(params) {
  7498. if (params && params.url) {
  7499. this.options.url = params.url;
  7500. }
  7501. if (params && params.pageNumber) {
  7502. this.options.pageNumber = params.pageNumber;
  7503. }
  7504. if (params && params.pageSize) {
  7505. this.options.pageSize = params.pageSize;
  7506. }
  7507. this.trigger('refresh', this.initServer(params && params.silent, params && params.query, params && params.url));
  7508. }
  7509. }, {
  7510. key: "destroy",
  7511. value: function destroy() {
  7512. this.$el.insertBefore(this.$container);
  7513. $$p(this.options.toolbar).insertBefore(this.$el);
  7514. this.$container.next().remove();
  7515. this.$container.remove();
  7516. this.$el.html(this.$el_.html()).css('margin-top', '0').attr('class', this.$el_.attr('class') || ''); // reset the class
  7517. var resizeEvent = Utils.getEventName('resize.bootstrap-table', this.$el.attr('id'));
  7518. $$p(window).off(resizeEvent);
  7519. }
  7520. }, {
  7521. key: "resetView",
  7522. value: function resetView(params) {
  7523. var padding = 0;
  7524. if (params && params.height) {
  7525. this.options.height = params.height;
  7526. }
  7527. this.$tableContainer.toggleClass('has-card-view', this.options.cardView);
  7528. if (this.options.height) {
  7529. var fixedBody = this.$tableBody.get(0);
  7530. this.hasScrollBar = fixedBody.scrollWidth > fixedBody.clientWidth;
  7531. }
  7532. if (!this.options.cardView && this.options.showHeader && this.options.height) {
  7533. this.$tableHeader.show();
  7534. this.resetHeader();
  7535. padding += this.$header.outerHeight(true) + 1;
  7536. } else {
  7537. this.$tableHeader.hide();
  7538. this.trigger('post-header');
  7539. }
  7540. if (!this.options.cardView && this.options.showFooter) {
  7541. this.$tableFooter.show();
  7542. this.fitFooter();
  7543. if (this.options.height) {
  7544. padding += this.$tableFooter.outerHeight(true);
  7545. }
  7546. }
  7547. if (this.$container.hasClass('fullscreen')) {
  7548. this.$tableContainer.css('height', '');
  7549. this.$tableContainer.css('width', '');
  7550. } else if (this.options.height) {
  7551. if (this.$tableBorder) {
  7552. this.$tableBorder.css('width', '');
  7553. this.$tableBorder.css('height', '');
  7554. }
  7555. var toolbarHeight = this.$toolbar.outerHeight(true);
  7556. var paginationHeight = this.$pagination.outerHeight(true);
  7557. var height = this.options.height - toolbarHeight - paginationHeight;
  7558. var $bodyTable = this.$tableBody.find('>table');
  7559. var tableHeight = $bodyTable.outerHeight();
  7560. this.$tableContainer.css('height', "".concat(height, "px"));
  7561. if (this.$tableBorder && $bodyTable.is(':visible')) {
  7562. var tableBorderHeight = height - tableHeight - 2;
  7563. if (this.hasScrollBar) {
  7564. tableBorderHeight -= Utils.getScrollBarWidth();
  7565. }
  7566. this.$tableBorder.css('width', "".concat($bodyTable.outerWidth(), "px"));
  7567. this.$tableBorder.css('height', "".concat(tableBorderHeight, "px"));
  7568. }
  7569. }
  7570. if (this.options.cardView) {
  7571. // remove the element css
  7572. this.$el.css('margin-top', '0');
  7573. this.$tableContainer.css('padding-bottom', '0');
  7574. this.$tableFooter.hide();
  7575. } else {
  7576. // Assign the correct sortable arrow
  7577. this.getCaret();
  7578. this.$tableContainer.css('padding-bottom', "".concat(padding, "px"));
  7579. }
  7580. this.trigger('reset-view');
  7581. }
  7582. }, {
  7583. key: "showLoading",
  7584. value: function showLoading() {
  7585. this.$tableLoading.toggleClass('open', true);
  7586. var fontSize = this.options.loadingFontSize;
  7587. if (this.options.loadingFontSize === 'auto') {
  7588. fontSize = this.$tableLoading.width() * 0.04;
  7589. fontSize = Math.max(12, fontSize);
  7590. fontSize = Math.min(32, fontSize);
  7591. fontSize = "".concat(fontSize, "px");
  7592. }
  7593. this.$tableLoading.find('.loading-text').css('font-size', fontSize);
  7594. }
  7595. }, {
  7596. key: "hideLoading",
  7597. value: function hideLoading() {
  7598. this.$tableLoading.toggleClass('open', false);
  7599. }
  7600. }, {
  7601. key: "togglePagination",
  7602. value: function togglePagination() {
  7603. this.options.pagination = !this.options.pagination;
  7604. var icon = this.options.showButtonIcons ? this.options.pagination ? this.options.icons.paginationSwitchDown : this.options.icons.paginationSwitchUp : '';
  7605. var text = this.options.showButtonText ? this.options.pagination ? this.options.formatPaginationSwitchUp() : this.options.formatPaginationSwitchDown() : '';
  7606. this.$toolbar.find('button[name="paginationSwitch"]').html("".concat(Utils.sprintf(this.constants.html.icon, this.options.iconsPrefix, icon), " ").concat(text));
  7607. this.updatePagination();
  7608. this.trigger('toggle-pagination', this.options.pagination);
  7609. }
  7610. }, {
  7611. key: "toggleFullscreen",
  7612. value: function toggleFullscreen() {
  7613. this.$el.closest('.bootstrap-table').toggleClass('fullscreen');
  7614. this.resetView();
  7615. }
  7616. }, {
  7617. key: "toggleView",
  7618. value: function toggleView() {
  7619. this.options.cardView = !this.options.cardView;
  7620. this.initHeader();
  7621. var icon = this.options.showButtonIcons ? this.options.cardView ? this.options.icons.toggleOn : this.options.icons.toggleOff : '';
  7622. var text = this.options.showButtonText ? this.options.cardView ? this.options.formatToggleOff() : this.options.formatToggleOn() : '';
  7623. this.$toolbar.find('button[name="toggle"]').html("".concat(Utils.sprintf(this.constants.html.icon, this.options.iconsPrefix, icon), " ").concat(text)).attr('aria-label', text).attr('title', text);
  7624. this.initBody();
  7625. this.trigger('toggle', this.options.cardView);
  7626. }
  7627. }, {
  7628. key: "resetSearch",
  7629. value: function resetSearch(text) {
  7630. var $search = Utils.getSearchInput(this);
  7631. var textToUse = text || '';
  7632. $search.val(textToUse);
  7633. this.searchText = textToUse;
  7634. this.onSearch({
  7635. currentTarget: $search
  7636. }, false);
  7637. }
  7638. }, {
  7639. key: "filterBy",
  7640. value: function filterBy(columns, options) {
  7641. this.filterOptions = Utils.isEmptyObject(options) ? this.options.filterOptions : Utils.extend(this.options.filterOptions, options);
  7642. this.filterColumns = Utils.isEmptyObject(columns) ? {} : columns;
  7643. this.options.pageNumber = 1;
  7644. this.initSearch();
  7645. this.updatePagination();
  7646. }
  7647. }, {
  7648. key: "scrollTo",
  7649. value: function scrollTo(params) {
  7650. var options = {
  7651. unit: 'px',
  7652. value: 0
  7653. };
  7654. if (_typeof(params) === 'object') {
  7655. options = Object.assign(options, params);
  7656. } else if (typeof params === 'string' && params === 'bottom') {
  7657. options.value = this.$tableBody[0].scrollHeight;
  7658. } else if (typeof params === 'string' || typeof params === 'number') {
  7659. options.value = params;
  7660. }
  7661. var scrollTo = options.value;
  7662. if (options.unit === 'rows') {
  7663. scrollTo = 0;
  7664. this.$body.find("> tr:lt(".concat(options.value, ")")).each(function (i, el) {
  7665. scrollTo += $$p(el).outerHeight(true);
  7666. });
  7667. }
  7668. this.$tableBody.scrollTop(scrollTo);
  7669. }
  7670. }, {
  7671. key: "getScrollPosition",
  7672. value: function getScrollPosition() {
  7673. return this.$tableBody.scrollTop();
  7674. }
  7675. }, {
  7676. key: "selectPage",
  7677. value: function selectPage(page) {
  7678. if (page > 0 && page <= this.options.totalPages) {
  7679. this.options.pageNumber = page;
  7680. this.updatePagination();
  7681. }
  7682. }
  7683. }, {
  7684. key: "prevPage",
  7685. value: function prevPage() {
  7686. if (this.options.pageNumber > 1) {
  7687. this.options.pageNumber--;
  7688. this.updatePagination();
  7689. }
  7690. }
  7691. }, {
  7692. key: "nextPage",
  7693. value: function nextPage() {
  7694. if (this.options.pageNumber < this.options.totalPages) {
  7695. this.options.pageNumber++;
  7696. this.updatePagination();
  7697. }
  7698. }
  7699. }, {
  7700. key: "toggleDetailView",
  7701. value: function toggleDetailView(index, _columnDetailFormatter) {
  7702. var $tr = this.$body.find(Utils.sprintf('> tr[data-index="%s"]', index));
  7703. if ($tr.next().is('tr.detail-view')) {
  7704. this.collapseRow(index);
  7705. } else {
  7706. this.expandRow(index, _columnDetailFormatter);
  7707. }
  7708. this.resetView();
  7709. }
  7710. }, {
  7711. key: "expandRow",
  7712. value: function expandRow(index, _columnDetailFormatter) {
  7713. var row = this.data[index];
  7714. var $tr = this.$body.find(Utils.sprintf('> tr[data-index="%s"][data-has-detail-view]', index));
  7715. if (this.options.detailViewIcon) {
  7716. $tr.find('a.detail-icon').html(Utils.sprintf(this.constants.html.icon, this.options.iconsPrefix, this.options.icons.detailClose));
  7717. }
  7718. if ($tr.next().is('tr.detail-view')) {
  7719. return;
  7720. }
  7721. $tr.after(Utils.sprintf('<tr class="detail-view"><td colspan="%s"></td></tr>', $tr.children('td').length));
  7722. var $element = $tr.next().find('td');
  7723. var detailFormatter = _columnDetailFormatter || this.options.detailFormatter;
  7724. var content = Utils.calculateObjectValue(this.options, detailFormatter, [index, row, $element], '');
  7725. if ($element.length === 1) {
  7726. $element.append(content);
  7727. }
  7728. this.trigger('expand-row', index, row, $element);
  7729. }
  7730. }, {
  7731. key: "expandRowByUniqueId",
  7732. value: function expandRowByUniqueId(uniqueId) {
  7733. var row = this.getRowByUniqueId(uniqueId);
  7734. if (!row) {
  7735. return;
  7736. }
  7737. this.expandRow(this.data.indexOf(row));
  7738. }
  7739. }, {
  7740. key: "collapseRow",
  7741. value: function collapseRow(index) {
  7742. var row = this.data[index];
  7743. var $tr = this.$body.find(Utils.sprintf('> tr[data-index="%s"][data-has-detail-view]', index));
  7744. if (!$tr.next().is('tr.detail-view')) {
  7745. return;
  7746. }
  7747. if (this.options.detailViewIcon) {
  7748. $tr.find('a.detail-icon').html(Utils.sprintf(this.constants.html.icon, this.options.iconsPrefix, this.options.icons.detailOpen));
  7749. }
  7750. this.trigger('collapse-row', index, row, $tr.next());
  7751. $tr.next().remove();
  7752. }
  7753. }, {
  7754. key: "collapseRowByUniqueId",
  7755. value: function collapseRowByUniqueId(uniqueId) {
  7756. var row = this.getRowByUniqueId(uniqueId);
  7757. if (!row) {
  7758. return;
  7759. }
  7760. this.collapseRow(this.data.indexOf(row));
  7761. }
  7762. }, {
  7763. key: "expandAllRows",
  7764. value: function expandAllRows() {
  7765. var trs = this.$body.find('> tr[data-index][data-has-detail-view]');
  7766. for (var i = 0; i < trs.length; i++) {
  7767. this.expandRow($$p(trs[i]).data('index'));
  7768. }
  7769. }
  7770. }, {
  7771. key: "collapseAllRows",
  7772. value: function collapseAllRows() {
  7773. var trs = this.$body.find('> tr[data-index][data-has-detail-view]');
  7774. for (var i = 0; i < trs.length; i++) {
  7775. this.collapseRow($$p(trs[i]).data('index'));
  7776. }
  7777. }
  7778. }, {
  7779. key: "updateColumnTitle",
  7780. value: function updateColumnTitle(params) {
  7781. if (!params.hasOwnProperty('field') || !params.hasOwnProperty('title')) {
  7782. return;
  7783. }
  7784. this.columns[this.fieldsColumnsIndex[params.field]].title = this.options.escape && this.options.escapeTitle ? Utils.escapeHTML(params.title) : params.title;
  7785. if (this.columns[this.fieldsColumnsIndex[params.field]].visible) {
  7786. this.$header.find('th[data-field]').each(function (i, el) {
  7787. if ($$p(el).data('field') === params.field) {
  7788. $$p($$p(el).find('.th-inner')[0]).text(params.title);
  7789. return false;
  7790. }
  7791. });
  7792. this.resetView();
  7793. }
  7794. }
  7795. }, {
  7796. key: "updateFormatText",
  7797. value: function updateFormatText(formatName, text) {
  7798. if (!/^format/.test(formatName) || !this.options[formatName]) {
  7799. return;
  7800. }
  7801. if (typeof text === 'string') {
  7802. this.options[formatName] = function () {
  7803. return text;
  7804. };
  7805. } else if (typeof text === 'function') {
  7806. this.options[formatName] = text;
  7807. }
  7808. this.initToolbar();
  7809. this.initPagination();
  7810. this.initBody();
  7811. }
  7812. }]);
  7813. return BootstrapTable;
  7814. }();
  7815. BootstrapTable.VERSION = Constants.VERSION;
  7816. BootstrapTable.DEFAULTS = Constants.DEFAULTS;
  7817. BootstrapTable.LOCALES = Constants.LOCALES;
  7818. BootstrapTable.COLUMN_DEFAULTS = Constants.COLUMN_DEFAULTS;
  7819. BootstrapTable.METHODS = Constants.METHODS;
  7820. BootstrapTable.EVENTS = Constants.EVENTS;
  7821. // BOOTSTRAP TABLE PLUGIN DEFINITION
  7822. // =======================
  7823. $$p.BootstrapTable = BootstrapTable;
  7824. $$p.fn.bootstrapTable = function (option) {
  7825. for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key5 = 1; _key5 < _len2; _key5++) {
  7826. args[_key5 - 1] = arguments[_key5];
  7827. }
  7828. var value;
  7829. this.each(function (i, el) {
  7830. var data = $$p(el).data('bootstrap.table');
  7831. if (typeof option === 'string') {
  7832. var _data2;
  7833. if (!Constants.METHODS.includes(option)) {
  7834. throw new Error("Unknown method: ".concat(option));
  7835. }
  7836. if (!data) {
  7837. return;
  7838. }
  7839. value = (_data2 = data)[option].apply(_data2, args);
  7840. if (option === 'destroy') {
  7841. $$p(el).removeData('bootstrap.table');
  7842. }
  7843. return;
  7844. }
  7845. if (data) {
  7846. console.warn('You cannot initialize the table more than once!');
  7847. return;
  7848. }
  7849. var options = Utils.extend(true, {}, BootstrapTable.DEFAULTS, $$p(el).data(), _typeof(option) === 'object' && option);
  7850. data = new $$p.BootstrapTable(el, options);
  7851. $$p(el).data('bootstrap.table', data);
  7852. data.init();
  7853. });
  7854. return typeof value === 'undefined' ? this : value;
  7855. };
  7856. $$p.fn.bootstrapTable.Constructor = BootstrapTable;
  7857. $$p.fn.bootstrapTable.theme = Constants.THEME;
  7858. $$p.fn.bootstrapTable.VERSION = Constants.VERSION;
  7859. $$p.fn.bootstrapTable.defaults = BootstrapTable.DEFAULTS;
  7860. $$p.fn.bootstrapTable.columnDefaults = BootstrapTable.COLUMN_DEFAULTS;
  7861. $$p.fn.bootstrapTable.events = BootstrapTable.EVENTS;
  7862. $$p.fn.bootstrapTable.locales = BootstrapTable.LOCALES;
  7863. $$p.fn.bootstrapTable.methods = BootstrapTable.METHODS;
  7864. $$p.fn.bootstrapTable.utils = Utils;
  7865. // BOOTSTRAP TABLE INIT
  7866. // =======================
  7867. $$p(function () {
  7868. $$p('[data-toggle="table"]').bootstrapTable();
  7869. });
  7870. return BootstrapTable;
  7871. }));