bootstrap-table.js 321 KB

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