bootstrap-table.js 321 KB

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