bootstrap-table.js 315 KB

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