vue-grid-layout.js 388 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968
  1. import {
  2. require_vue
  3. } from "./chunk-IND6KQVK.js";
  4. import "./chunk-S6VK5PVK.js";
  5. import "./chunk-YVHZHMSQ.js";
  6. import "./chunk-VNBICN6T.js";
  7. import {
  8. __commonJS
  9. } from "./chunk-2LSFTFF7.js";
  10. // node_modules/.pnpm/vue-grid-layout@3.0.0-beta1_@interactjs+core@1.10.27_@interactjs+utils@1.10.27_typescript@5.4.5/node_modules/vue-grid-layout/dist/vue-grid-layout.common.js
  11. var require_vue_grid_layout_common = __commonJS({
  12. "node_modules/.pnpm/vue-grid-layout@3.0.0-beta1_@interactjs+core@1.10.27_@interactjs+utils@1.10.27_typescript@5.4.5/node_modules/vue-grid-layout/dist/vue-grid-layout.common.js"(exports, module) {
  13. module.exports = /******/
  14. function(modules) {
  15. var installedModules = {};
  16. function __webpack_require__(moduleId) {
  17. if (installedModules[moduleId]) {
  18. return installedModules[moduleId].exports;
  19. }
  20. var module2 = installedModules[moduleId] = {
  21. /******/
  22. i: moduleId,
  23. /******/
  24. l: false,
  25. /******/
  26. exports: {}
  27. /******/
  28. };
  29. modules[moduleId].call(module2.exports, module2, module2.exports, __webpack_require__);
  30. module2.l = true;
  31. return module2.exports;
  32. }
  33. __webpack_require__.m = modules;
  34. __webpack_require__.c = installedModules;
  35. __webpack_require__.d = function(exports2, name, getter) {
  36. if (!__webpack_require__.o(exports2, name)) {
  37. Object.defineProperty(exports2, name, { enumerable: true, get: getter });
  38. }
  39. };
  40. __webpack_require__.r = function(exports2) {
  41. if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
  42. Object.defineProperty(exports2, Symbol.toStringTag, { value: "Module" });
  43. }
  44. Object.defineProperty(exports2, "__esModule", { value: true });
  45. };
  46. __webpack_require__.t = function(value, mode) {
  47. if (mode & 1)
  48. value = __webpack_require__(value);
  49. if (mode & 8)
  50. return value;
  51. if (mode & 4 && typeof value === "object" && value && value.__esModule)
  52. return value;
  53. var ns = /* @__PURE__ */ Object.create(null);
  54. __webpack_require__.r(ns);
  55. Object.defineProperty(ns, "default", { enumerable: true, value });
  56. if (mode & 2 && typeof value != "string")
  57. for (var key in value)
  58. __webpack_require__.d(ns, key, function(key2) {
  59. return value[key2];
  60. }.bind(null, key));
  61. return ns;
  62. };
  63. __webpack_require__.n = function(module2) {
  64. var getter = module2 && module2.__esModule ? (
  65. /******/
  66. function getDefault() {
  67. return module2["default"];
  68. }
  69. ) : (
  70. /******/
  71. function getModuleExports() {
  72. return module2;
  73. }
  74. );
  75. __webpack_require__.d(getter, "a", getter);
  76. return getter;
  77. };
  78. __webpack_require__.o = function(object, property) {
  79. return Object.prototype.hasOwnProperty.call(object, property);
  80. };
  81. __webpack_require__.p = "";
  82. return __webpack_require__(__webpack_require__.s = "fb15");
  83. }({
  84. /***/
  85. "01f9": (
  86. /***/
  87. function(module2, exports2, __webpack_require__) {
  88. "use strict";
  89. var LIBRARY = __webpack_require__("2d00");
  90. var $export = __webpack_require__("5ca1");
  91. var redefine = __webpack_require__("2aba");
  92. var hide = __webpack_require__("32e9");
  93. var Iterators = __webpack_require__("84f2");
  94. var $iterCreate = __webpack_require__("41a0");
  95. var setToStringTag = __webpack_require__("7f20");
  96. var getPrototypeOf = __webpack_require__("38fd");
  97. var ITERATOR = __webpack_require__("2b4c")("iterator");
  98. var BUGGY = !([].keys && "next" in [].keys());
  99. var FF_ITERATOR = "@@iterator";
  100. var KEYS = "keys";
  101. var VALUES = "values";
  102. var returnThis = function() {
  103. return this;
  104. };
  105. module2.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
  106. $iterCreate(Constructor, NAME, next);
  107. var getMethod = function(kind) {
  108. if (!BUGGY && kind in proto)
  109. return proto[kind];
  110. switch (kind) {
  111. case KEYS:
  112. return function keys() {
  113. return new Constructor(this, kind);
  114. };
  115. case VALUES:
  116. return function values() {
  117. return new Constructor(this, kind);
  118. };
  119. }
  120. return function entries() {
  121. return new Constructor(this, kind);
  122. };
  123. };
  124. var TAG = NAME + " Iterator";
  125. var DEF_VALUES = DEFAULT == VALUES;
  126. var VALUES_BUG = false;
  127. var proto = Base.prototype;
  128. var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
  129. var $default = $native || getMethod(DEFAULT);
  130. var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod("entries") : void 0;
  131. var $anyNative = NAME == "Array" ? proto.entries || $native : $native;
  132. var methods, key, IteratorPrototype;
  133. if ($anyNative) {
  134. IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));
  135. if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
  136. setToStringTag(IteratorPrototype, TAG, true);
  137. if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != "function")
  138. hide(IteratorPrototype, ITERATOR, returnThis);
  139. }
  140. }
  141. if (DEF_VALUES && $native && $native.name !== VALUES) {
  142. VALUES_BUG = true;
  143. $default = function values() {
  144. return $native.call(this);
  145. };
  146. }
  147. if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
  148. hide(proto, ITERATOR, $default);
  149. }
  150. Iterators[NAME] = $default;
  151. Iterators[TAG] = returnThis;
  152. if (DEFAULT) {
  153. methods = {
  154. values: DEF_VALUES ? $default : getMethod(VALUES),
  155. keys: IS_SET ? $default : getMethod(KEYS),
  156. entries: $entries
  157. };
  158. if (FORCED)
  159. for (key in methods) {
  160. if (!(key in proto))
  161. redefine(proto, key, methods[key]);
  162. }
  163. else
  164. $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
  165. }
  166. return methods;
  167. };
  168. }
  169. ),
  170. /***/
  171. "02f4": (
  172. /***/
  173. function(module2, exports2, __webpack_require__) {
  174. var toInteger = __webpack_require__("4588");
  175. var defined = __webpack_require__("be13");
  176. module2.exports = function(TO_STRING) {
  177. return function(that, pos) {
  178. var s = String(defined(that));
  179. var i = toInteger(pos);
  180. var l = s.length;
  181. var a, b;
  182. if (i < 0 || i >= l)
  183. return TO_STRING ? "" : void 0;
  184. a = s.charCodeAt(i);
  185. return a < 55296 || a > 56319 || i + 1 === l || (b = s.charCodeAt(i + 1)) < 56320 || b > 57343 ? TO_STRING ? s.charAt(i) : a : TO_STRING ? s.slice(i, i + 2) : (a - 55296 << 10) + (b - 56320) + 65536;
  186. };
  187. };
  188. }
  189. ),
  190. /***/
  191. "0390": (
  192. /***/
  193. function(module2, exports2, __webpack_require__) {
  194. "use strict";
  195. var at = __webpack_require__("02f4")(true);
  196. module2.exports = function(S, index, unicode) {
  197. return index + (unicode ? at(S, index).length : 1);
  198. };
  199. }
  200. ),
  201. /***/
  202. "083e": (
  203. /***/
  204. function(module2, __webpack_exports__, __webpack_require__) {
  205. "use strict";
  206. var _node_modules_vue_style_loader_index_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_v16_dist_index_js_ref_0_1_GridItem_vue_vue_type_style_index_0_id_46ff2fc8_lang_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("c541");
  207. var _node_modules_vue_style_loader_index_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_v16_dist_index_js_ref_0_1_GridItem_vue_vue_type_style_index_0_id_46ff2fc8_lang_css__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_node_modules_vue_style_loader_index_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_v16_dist_index_js_ref_0_1_GridItem_vue_vue_type_style_index_0_id_46ff2fc8_lang_css__WEBPACK_IMPORTED_MODULE_0__);
  208. }
  209. ),
  210. /***/
  211. "0bfb": (
  212. /***/
  213. function(module2, exports2, __webpack_require__) {
  214. "use strict";
  215. var anObject = __webpack_require__("cb7c");
  216. module2.exports = function() {
  217. var that = anObject(this);
  218. var result = "";
  219. if (that.global)
  220. result += "g";
  221. if (that.ignoreCase)
  222. result += "i";
  223. if (that.multiline)
  224. result += "m";
  225. if (that.unicode)
  226. result += "u";
  227. if (that.sticky)
  228. result += "y";
  229. return result;
  230. };
  231. }
  232. ),
  233. /***/
  234. "0d58": (
  235. /***/
  236. function(module2, exports2, __webpack_require__) {
  237. var $keys = __webpack_require__("ce10");
  238. var enumBugKeys = __webpack_require__("e11e");
  239. module2.exports = Object.keys || function keys(O) {
  240. return $keys(O, enumBugKeys);
  241. };
  242. }
  243. ),
  244. /***/
  245. "11e9": (
  246. /***/
  247. function(module2, exports2, __webpack_require__) {
  248. var pIE = __webpack_require__("52a7");
  249. var createDesc = __webpack_require__("4630");
  250. var toIObject = __webpack_require__("6821");
  251. var toPrimitive = __webpack_require__("6a99");
  252. var has = __webpack_require__("69a8");
  253. var IE8_DOM_DEFINE = __webpack_require__("c69a");
  254. var gOPD = Object.getOwnPropertyDescriptor;
  255. exports2.f = __webpack_require__("9e1e") ? gOPD : function getOwnPropertyDescriptor(O, P) {
  256. O = toIObject(O);
  257. P = toPrimitive(P, true);
  258. if (IE8_DOM_DEFINE)
  259. try {
  260. return gOPD(O, P);
  261. } catch (e) {
  262. }
  263. if (has(O, P))
  264. return createDesc(!pIE.f.call(O, P), O[P]);
  265. };
  266. }
  267. ),
  268. /***/
  269. "1495": (
  270. /***/
  271. function(module2, exports2, __webpack_require__) {
  272. var dP = __webpack_require__("86cc");
  273. var anObject = __webpack_require__("cb7c");
  274. var getKeys = __webpack_require__("0d58");
  275. module2.exports = __webpack_require__("9e1e") ? Object.defineProperties : function defineProperties(O, Properties) {
  276. anObject(O);
  277. var keys = getKeys(Properties);
  278. var length = keys.length;
  279. var i = 0;
  280. var P;
  281. while (length > i)
  282. dP.f(O, P = keys[i++], Properties[P]);
  283. return O;
  284. };
  285. }
  286. ),
  287. /***/
  288. "18d2": (
  289. /***/
  290. function(module2, exports2, __webpack_require__) {
  291. "use strict";
  292. var browserDetector = __webpack_require__("18e9");
  293. module2.exports = function(options) {
  294. options = options || {};
  295. var reporter = options.reporter;
  296. var batchProcessor = options.batchProcessor;
  297. var getState = options.stateHandler.getState;
  298. if (!reporter) {
  299. throw new Error("Missing required dependency: reporter.");
  300. }
  301. function addListener(element, listener) {
  302. function listenerProxy() {
  303. listener(element);
  304. }
  305. if (browserDetector.isIE(8)) {
  306. getState(element).object = {
  307. proxy: listenerProxy
  308. };
  309. element.attachEvent("onresize", listenerProxy);
  310. } else {
  311. var object = getObject(element);
  312. if (!object) {
  313. throw new Error("Element is not detectable by this strategy.");
  314. }
  315. object.contentDocument.defaultView.addEventListener("resize", listenerProxy);
  316. }
  317. }
  318. function buildCssTextString(rules) {
  319. var seperator = options.important ? " !important; " : "; ";
  320. return (rules.join(seperator) + seperator).trim();
  321. }
  322. function makeDetectable(options2, element, callback) {
  323. if (!callback) {
  324. callback = element;
  325. element = options2;
  326. options2 = null;
  327. }
  328. options2 = options2 || {};
  329. var debug = options2.debug;
  330. function injectObject(element2, callback2) {
  331. var OBJECT_STYLE = buildCssTextString(["display: block", "position: absolute", "top: 0", "left: 0", "width: 100%", "height: 100%", "border: none", "padding: 0", "margin: 0", "opacity: 0", "z-index: -1000", "pointer-events: none"]);
  332. var positionCheckPerformed = false;
  333. var style = window.getComputedStyle(element2);
  334. var width = element2.offsetWidth;
  335. var height = element2.offsetHeight;
  336. getState(element2).startSize = {
  337. width,
  338. height
  339. };
  340. function mutateDom() {
  341. function alterPositionStyles() {
  342. if (style.position === "static") {
  343. element2.style.setProperty("position", "relative", options2.important ? "important" : "");
  344. var removeRelativeStyles = function(reporter2, element3, style2, property) {
  345. function getNumericalValue(value2) {
  346. return value2.replace(/[^-\d\.]/g, "");
  347. }
  348. var value = style2[property];
  349. if (value !== "auto" && getNumericalValue(value) !== "0") {
  350. reporter2.warn("An element that is positioned static has style." + property + "=" + value + " which is ignored due to the static positioning. The element will need to be positioned relative, so the style." + property + " will be set to 0. Element: ", element3);
  351. element3.style.setProperty(property, "0", options2.important ? "important" : "");
  352. }
  353. };
  354. removeRelativeStyles(reporter, element2, style, "top");
  355. removeRelativeStyles(reporter, element2, style, "right");
  356. removeRelativeStyles(reporter, element2, style, "bottom");
  357. removeRelativeStyles(reporter, element2, style, "left");
  358. }
  359. }
  360. function onObjectLoad() {
  361. if (!positionCheckPerformed) {
  362. alterPositionStyles();
  363. }
  364. function getDocument(element3, callback3) {
  365. if (!element3.contentDocument) {
  366. var state = getState(element3);
  367. if (state.checkForObjectDocumentTimeoutId) {
  368. window.clearTimeout(state.checkForObjectDocumentTimeoutId);
  369. }
  370. state.checkForObjectDocumentTimeoutId = setTimeout(function checkForObjectDocument() {
  371. state.checkForObjectDocumentTimeoutId = 0;
  372. getDocument(element3, callback3);
  373. }, 100);
  374. return;
  375. }
  376. callback3(element3.contentDocument);
  377. }
  378. var objectElement = this;
  379. getDocument(objectElement, function onObjectDocumentReady(objectDocument) {
  380. callback2(element2);
  381. });
  382. }
  383. if (style.position !== "") {
  384. alterPositionStyles(style);
  385. positionCheckPerformed = true;
  386. }
  387. var object = document.createElement("object");
  388. object.style.cssText = OBJECT_STYLE;
  389. object.tabIndex = -1;
  390. object.type = "text/html";
  391. object.setAttribute("aria-hidden", "true");
  392. object.onload = onObjectLoad;
  393. if (!browserDetector.isIE()) {
  394. object.data = "about:blank";
  395. }
  396. if (!getState(element2)) {
  397. return;
  398. }
  399. element2.appendChild(object);
  400. getState(element2).object = object;
  401. if (browserDetector.isIE()) {
  402. object.data = "about:blank";
  403. }
  404. }
  405. if (batchProcessor) {
  406. batchProcessor.add(mutateDom);
  407. } else {
  408. mutateDom();
  409. }
  410. }
  411. if (browserDetector.isIE(8)) {
  412. callback(element);
  413. } else {
  414. injectObject(element, callback);
  415. }
  416. }
  417. function getObject(element) {
  418. return getState(element).object;
  419. }
  420. function uninstall(element) {
  421. if (!getState(element)) {
  422. return;
  423. }
  424. var object = getObject(element);
  425. if (!object) {
  426. return;
  427. }
  428. if (browserDetector.isIE(8)) {
  429. element.detachEvent("onresize", object.proxy);
  430. } else {
  431. element.removeChild(object);
  432. }
  433. if (getState(element).checkForObjectDocumentTimeoutId) {
  434. window.clearTimeout(getState(element).checkForObjectDocumentTimeoutId);
  435. }
  436. delete getState(element).object;
  437. }
  438. return {
  439. makeDetectable,
  440. addListener,
  441. uninstall
  442. };
  443. };
  444. }
  445. ),
  446. /***/
  447. "18e9": (
  448. /***/
  449. function(module2, exports2, __webpack_require__) {
  450. "use strict";
  451. var detector = module2.exports = {};
  452. detector.isIE = function(version) {
  453. function isAnyIeVersion() {
  454. var agent = navigator.userAgent.toLowerCase();
  455. return agent.indexOf("msie") !== -1 || agent.indexOf("trident") !== -1 || agent.indexOf(" edge/") !== -1;
  456. }
  457. if (!isAnyIeVersion()) {
  458. return false;
  459. }
  460. if (!version) {
  461. return true;
  462. }
  463. var ieVersion = function() {
  464. var undef, v = 3, div = document.createElement("div"), all = div.getElementsByTagName("i");
  465. do {
  466. div.innerHTML = "<!--[if gt IE " + ++v + "]><i></i><![endif]-->";
  467. } while (all[0]);
  468. return v > 4 ? v : undef;
  469. }();
  470. return version === ieVersion;
  471. };
  472. detector.isLegacyOpera = function() {
  473. return !!window.opera;
  474. };
  475. }
  476. ),
  477. /***/
  478. "214f": (
  479. /***/
  480. function(module2, exports2, __webpack_require__) {
  481. "use strict";
  482. __webpack_require__("b0c5");
  483. var redefine = __webpack_require__("2aba");
  484. var hide = __webpack_require__("32e9");
  485. var fails = __webpack_require__("79e5");
  486. var defined = __webpack_require__("be13");
  487. var wks = __webpack_require__("2b4c");
  488. var regexpExec = __webpack_require__("520a");
  489. var SPECIES = wks("species");
  490. var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function() {
  491. var re = /./;
  492. re.exec = function() {
  493. var result = [];
  494. result.groups = { a: "7" };
  495. return result;
  496. };
  497. return "".replace(re, "$<a>") !== "7";
  498. });
  499. var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = function() {
  500. var re = /(?:)/;
  501. var originalExec = re.exec;
  502. re.exec = function() {
  503. return originalExec.apply(this, arguments);
  504. };
  505. var result = "ab".split(re);
  506. return result.length === 2 && result[0] === "a" && result[1] === "b";
  507. }();
  508. module2.exports = function(KEY, length, exec) {
  509. var SYMBOL = wks(KEY);
  510. var DELEGATES_TO_SYMBOL = !fails(function() {
  511. var O = {};
  512. O[SYMBOL] = function() {
  513. return 7;
  514. };
  515. return ""[KEY](O) != 7;
  516. });
  517. var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL ? !fails(function() {
  518. var execCalled = false;
  519. var re = /a/;
  520. re.exec = function() {
  521. execCalled = true;
  522. return null;
  523. };
  524. if (KEY === "split") {
  525. re.constructor = {};
  526. re.constructor[SPECIES] = function() {
  527. return re;
  528. };
  529. }
  530. re[SYMBOL]("");
  531. return !execCalled;
  532. }) : void 0;
  533. if (!DELEGATES_TO_SYMBOL || !DELEGATES_TO_EXEC || KEY === "replace" && !REPLACE_SUPPORTS_NAMED_GROUPS || KEY === "split" && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC) {
  534. var nativeRegExpMethod = /./[SYMBOL];
  535. var fns = exec(
  536. defined,
  537. SYMBOL,
  538. ""[KEY],
  539. function maybeCallNative(nativeMethod, regexp, str, arg2, forceStringMethod) {
  540. if (regexp.exec === regexpExec) {
  541. if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
  542. return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
  543. }
  544. return { done: true, value: nativeMethod.call(str, regexp, arg2) };
  545. }
  546. return { done: false };
  547. }
  548. );
  549. var strfn = fns[0];
  550. var rxfn = fns[1];
  551. redefine(String.prototype, KEY, strfn);
  552. hide(
  553. RegExp.prototype,
  554. SYMBOL,
  555. length == 2 ? function(string, arg) {
  556. return rxfn.call(string, this, arg);
  557. } : function(string) {
  558. return rxfn.call(string, this);
  559. }
  560. );
  561. }
  562. };
  563. }
  564. ),
  565. /***/
  566. "230e": (
  567. /***/
  568. function(module2, exports2, __webpack_require__) {
  569. var isObject = __webpack_require__("d3f4");
  570. var document2 = __webpack_require__("7726").document;
  571. var is = isObject(document2) && isObject(document2.createElement);
  572. module2.exports = function(it) {
  573. return is ? document2.createElement(it) : {};
  574. };
  575. }
  576. ),
  577. /***/
  578. "23c6": (
  579. /***/
  580. function(module2, exports2, __webpack_require__) {
  581. var cof = __webpack_require__("2d95");
  582. var TAG = __webpack_require__("2b4c")("toStringTag");
  583. var ARG = cof(function() {
  584. return arguments;
  585. }()) == "Arguments";
  586. var tryGet = function(it, key) {
  587. try {
  588. return it[key];
  589. } catch (e) {
  590. }
  591. };
  592. module2.exports = function(it) {
  593. var O, T, B;
  594. return it === void 0 ? "Undefined" : it === null ? "Null" : typeof (T = tryGet(O = Object(it), TAG)) == "string" ? T : ARG ? cof(O) : (B = cof(O)) == "Object" && typeof O.callee == "function" ? "Arguments" : B;
  595. };
  596. }
  597. ),
  598. /***/
  599. "24fb": (
  600. /***/
  601. function(module2, exports2, __webpack_require__) {
  602. "use strict";
  603. module2.exports = function(useSourceMap) {
  604. var list = [];
  605. list.toString = function toString() {
  606. return this.map(function(item) {
  607. var content = cssWithMappingToString(item, useSourceMap);
  608. if (item[2]) {
  609. return "@media ".concat(item[2], " {").concat(content, "}");
  610. }
  611. return content;
  612. }).join("");
  613. };
  614. list.i = function(modules, mediaQuery, dedupe) {
  615. if (typeof modules === "string") {
  616. modules = [[null, modules, ""]];
  617. }
  618. var alreadyImportedModules = {};
  619. if (dedupe) {
  620. for (var i = 0; i < this.length; i++) {
  621. var id = this[i][0];
  622. if (id != null) {
  623. alreadyImportedModules[id] = true;
  624. }
  625. }
  626. }
  627. for (var _i = 0; _i < modules.length; _i++) {
  628. var item = [].concat(modules[_i]);
  629. if (dedupe && alreadyImportedModules[item[0]]) {
  630. continue;
  631. }
  632. if (mediaQuery) {
  633. if (!item[2]) {
  634. item[2] = mediaQuery;
  635. } else {
  636. item[2] = "".concat(mediaQuery, " and ").concat(item[2]);
  637. }
  638. }
  639. list.push(item);
  640. }
  641. };
  642. return list;
  643. };
  644. function cssWithMappingToString(item, useSourceMap) {
  645. var content = item[1] || "";
  646. var cssMapping = item[3];
  647. if (!cssMapping) {
  648. return content;
  649. }
  650. if (useSourceMap && typeof btoa === "function") {
  651. var sourceMapping = toComment(cssMapping);
  652. var sourceURLs = cssMapping.sources.map(function(source) {
  653. return "/*# sourceURL=".concat(cssMapping.sourceRoot || "").concat(source, " */");
  654. });
  655. return [content].concat(sourceURLs).concat([sourceMapping]).join("\n");
  656. }
  657. return [content].join("\n");
  658. }
  659. function toComment(sourceMap) {
  660. var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
  661. var data = "sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(base64);
  662. return "/*# ".concat(data, " */");
  663. }
  664. }
  665. ),
  666. /***/
  667. "2621": (
  668. /***/
  669. function(module2, exports2) {
  670. exports2.f = Object.getOwnPropertySymbols;
  671. }
  672. ),
  673. /***/
  674. "2aba": (
  675. /***/
  676. function(module2, exports2, __webpack_require__) {
  677. var global = __webpack_require__("7726");
  678. var hide = __webpack_require__("32e9");
  679. var has = __webpack_require__("69a8");
  680. var SRC = __webpack_require__("ca5a")("src");
  681. var $toString = __webpack_require__("fa5b");
  682. var TO_STRING = "toString";
  683. var TPL = ("" + $toString).split(TO_STRING);
  684. __webpack_require__("8378").inspectSource = function(it) {
  685. return $toString.call(it);
  686. };
  687. (module2.exports = function(O, key, val, safe) {
  688. var isFunction = typeof val == "function";
  689. if (isFunction)
  690. has(val, "name") || hide(val, "name", key);
  691. if (O[key] === val)
  692. return;
  693. if (isFunction)
  694. has(val, SRC) || hide(val, SRC, O[key] ? "" + O[key] : TPL.join(String(key)));
  695. if (O === global) {
  696. O[key] = val;
  697. } else if (!safe) {
  698. delete O[key];
  699. hide(O, key, val);
  700. } else if (O[key]) {
  701. O[key] = val;
  702. } else {
  703. hide(O, key, val);
  704. }
  705. })(Function.prototype, TO_STRING, function toString() {
  706. return typeof this == "function" && this[SRC] || $toString.call(this);
  707. });
  708. }
  709. ),
  710. /***/
  711. "2aeb": (
  712. /***/
  713. function(module2, exports2, __webpack_require__) {
  714. var anObject = __webpack_require__("cb7c");
  715. var dPs = __webpack_require__("1495");
  716. var enumBugKeys = __webpack_require__("e11e");
  717. var IE_PROTO = __webpack_require__("613b")("IE_PROTO");
  718. var Empty = function() {
  719. };
  720. var PROTOTYPE = "prototype";
  721. var createDict = function() {
  722. var iframe = __webpack_require__("230e")("iframe");
  723. var i = enumBugKeys.length;
  724. var lt = "<";
  725. var gt = ">";
  726. var iframeDocument;
  727. iframe.style.display = "none";
  728. __webpack_require__("fab2").appendChild(iframe);
  729. iframe.src = "javascript:";
  730. iframeDocument = iframe.contentWindow.document;
  731. iframeDocument.open();
  732. iframeDocument.write(lt + "script" + gt + "document.F=Object" + lt + "/script" + gt);
  733. iframeDocument.close();
  734. createDict = iframeDocument.F;
  735. while (i--)
  736. delete createDict[PROTOTYPE][enumBugKeys[i]];
  737. return createDict();
  738. };
  739. module2.exports = Object.create || function create(O, Properties) {
  740. var result;
  741. if (O !== null) {
  742. Empty[PROTOTYPE] = anObject(O);
  743. result = new Empty();
  744. Empty[PROTOTYPE] = null;
  745. result[IE_PROTO] = O;
  746. } else
  747. result = createDict();
  748. return Properties === void 0 ? result : dPs(result, Properties);
  749. };
  750. }
  751. ),
  752. /***/
  753. "2b4c": (
  754. /***/
  755. function(module2, exports2, __webpack_require__) {
  756. var store = __webpack_require__("5537")("wks");
  757. var uid = __webpack_require__("ca5a");
  758. var Symbol2 = __webpack_require__("7726").Symbol;
  759. var USE_SYMBOL = typeof Symbol2 == "function";
  760. var $exports = module2.exports = function(name) {
  761. return store[name] || (store[name] = USE_SYMBOL && Symbol2[name] || (USE_SYMBOL ? Symbol2 : uid)("Symbol." + name));
  762. };
  763. $exports.store = store;
  764. }
  765. ),
  766. /***/
  767. "2cef": (
  768. /***/
  769. function(module2, exports2, __webpack_require__) {
  770. "use strict";
  771. module2.exports = function() {
  772. var idCount = 1;
  773. function generate() {
  774. return idCount++;
  775. }
  776. return {
  777. generate
  778. };
  779. };
  780. }
  781. ),
  782. /***/
  783. "2d00": (
  784. /***/
  785. function(module2, exports2) {
  786. module2.exports = false;
  787. }
  788. ),
  789. /***/
  790. "2d95": (
  791. /***/
  792. function(module2, exports2) {
  793. var toString = {}.toString;
  794. module2.exports = function(it) {
  795. return toString.call(it).slice(8, -1);
  796. };
  797. }
  798. ),
  799. /***/
  800. "2f21": (
  801. /***/
  802. function(module2, exports2, __webpack_require__) {
  803. "use strict";
  804. var fails = __webpack_require__("79e5");
  805. module2.exports = function(method, arg) {
  806. return !!method && fails(function() {
  807. arg ? method.call(null, function() {
  808. }, 1) : method.call(null);
  809. });
  810. };
  811. }
  812. ),
  813. /***/
  814. "32e9": (
  815. /***/
  816. function(module2, exports2, __webpack_require__) {
  817. var dP = __webpack_require__("86cc");
  818. var createDesc = __webpack_require__("4630");
  819. module2.exports = __webpack_require__("9e1e") ? function(object, key, value) {
  820. return dP.f(object, key, createDesc(1, value));
  821. } : function(object, key, value) {
  822. object[key] = value;
  823. return object;
  824. };
  825. }
  826. ),
  827. /***/
  828. "38fd": (
  829. /***/
  830. function(module2, exports2, __webpack_require__) {
  831. var has = __webpack_require__("69a8");
  832. var toObject = __webpack_require__("4bf8");
  833. var IE_PROTO = __webpack_require__("613b")("IE_PROTO");
  834. var ObjectProto = Object.prototype;
  835. module2.exports = Object.getPrototypeOf || function(O) {
  836. O = toObject(O);
  837. if (has(O, IE_PROTO))
  838. return O[IE_PROTO];
  839. if (typeof O.constructor == "function" && O instanceof O.constructor) {
  840. return O.constructor.prototype;
  841. }
  842. return O instanceof Object ? ObjectProto : null;
  843. };
  844. }
  845. ),
  846. /***/
  847. "41a0": (
  848. /***/
  849. function(module2, exports2, __webpack_require__) {
  850. "use strict";
  851. var create = __webpack_require__("2aeb");
  852. var descriptor = __webpack_require__("4630");
  853. var setToStringTag = __webpack_require__("7f20");
  854. var IteratorPrototype = {};
  855. __webpack_require__("32e9")(IteratorPrototype, __webpack_require__("2b4c")("iterator"), function() {
  856. return this;
  857. });
  858. module2.exports = function(Constructor, NAME, next) {
  859. Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });
  860. setToStringTag(Constructor, NAME + " Iterator");
  861. };
  862. }
  863. ),
  864. /***/
  865. "456d": (
  866. /***/
  867. function(module2, exports2, __webpack_require__) {
  868. var toObject = __webpack_require__("4bf8");
  869. var $keys = __webpack_require__("0d58");
  870. __webpack_require__("5eda")("keys", function() {
  871. return function keys(it) {
  872. return $keys(toObject(it));
  873. };
  874. });
  875. }
  876. ),
  877. /***/
  878. "4588": (
  879. /***/
  880. function(module2, exports2) {
  881. var ceil = Math.ceil;
  882. var floor = Math.floor;
  883. module2.exports = function(it) {
  884. return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
  885. };
  886. }
  887. ),
  888. /***/
  889. "4630": (
  890. /***/
  891. function(module2, exports2) {
  892. module2.exports = function(bitmap, value) {
  893. return {
  894. enumerable: !(bitmap & 1),
  895. configurable: !(bitmap & 2),
  896. writable: !(bitmap & 4),
  897. value
  898. };
  899. };
  900. }
  901. ),
  902. /***/
  903. "4917": (
  904. /***/
  905. function(module2, exports2, __webpack_require__) {
  906. "use strict";
  907. var anObject = __webpack_require__("cb7c");
  908. var toLength = __webpack_require__("9def");
  909. var advanceStringIndex = __webpack_require__("0390");
  910. var regExpExec = __webpack_require__("5f1b");
  911. __webpack_require__("214f")("match", 1, function(defined, MATCH, $match, maybeCallNative) {
  912. return [
  913. // `String.prototype.match` method
  914. // https://tc39.github.io/ecma262/#sec-string.prototype.match
  915. function match(regexp) {
  916. var O = defined(this);
  917. var fn = regexp == void 0 ? void 0 : regexp[MATCH];
  918. return fn !== void 0 ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));
  919. },
  920. // `RegExp.prototype[@@match]` method
  921. // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match
  922. function(regexp) {
  923. var res = maybeCallNative($match, regexp, this);
  924. if (res.done)
  925. return res.value;
  926. var rx = anObject(regexp);
  927. var S = String(this);
  928. if (!rx.global)
  929. return regExpExec(rx, S);
  930. var fullUnicode = rx.unicode;
  931. rx.lastIndex = 0;
  932. var A = [];
  933. var n = 0;
  934. var result;
  935. while ((result = regExpExec(rx, S)) !== null) {
  936. var matchStr = String(result[0]);
  937. A[n] = matchStr;
  938. if (matchStr === "")
  939. rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
  940. n++;
  941. }
  942. return n === 0 ? null : A;
  943. }
  944. ];
  945. });
  946. }
  947. ),
  948. /***/
  949. "493e": (
  950. /***/
  951. function(module2, exports2, __webpack_require__) {
  952. var ___CSS_LOADER_API_IMPORT___ = __webpack_require__("24fb");
  953. exports2 = ___CSS_LOADER_API_IMPORT___(false);
  954. exports2.push([module2.i, '.vue-grid-item{-webkit-transition:all .2s ease;transition:all .2s ease;-webkit-transition-property:left,top,right;transition-property:left,top,right}.vue-grid-item,.vue-grid-item.no-touch{-ms-touch-action:none;touch-action:none}.vue-grid-item.cssTransforms{-webkit-transition-property:-webkit-transform;transition-property:-webkit-transform;transition-property:transform;transition-property:transform,-webkit-transform;left:0;right:auto}.vue-grid-item.cssTransforms.render-rtl{left:auto;right:0}.vue-grid-item.resizing{opacity:.6;z-index:3}.vue-grid-item.vue-draggable-dragging{-webkit-transition:none;transition:none;z-index:3}.vue-grid-item.vue-grid-placeholder{background:red;opacity:.2;-webkit-transition-duration:.1s;transition-duration:.1s;z-index:2;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.vue-grid-item>.vue-resizable-handle{position:absolute;width:20px;height:20px;bottom:0;right:0;background:url("data:image/svg+xml;base64,PHN2ZyBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjojZmZmZmZmMDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjYiIGhlaWdodD0iNiI+PHBhdGggZD0iTTYgNkgwVjQuMmg0LjJWMEg2djZ6IiBvcGFjaXR5PSIuMzAyIi8+PC9zdmc+");background-position:100% 100%;padding:0 3px 3px 0;background-repeat:no-repeat;background-origin:content-box;-webkit-box-sizing:border-box;box-sizing:border-box;cursor:se-resize}.vue-grid-item>.vue-rtl-resizable-handle{bottom:0;left:0;background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAiIGhlaWdodD0iMTAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTS0xLTFoMTJ2MTJILTF6Ii8+PGc+PHBhdGggc3Ryb2tlLWxpbmVjYXA9InVuZGVmaW5lZCIgc3Ryb2tlLWxpbmVqb2luPSJ1bmRlZmluZWQiIHN0cm9rZS13aWR0aD0iMS41IiBzdHJva2U9IiMwMDAiIGZpbGw9Im5vbmUiIGQ9Ik0xNDQuODIxLTM4LjM5M2wtMjAuMzU3LTMxLjc4NSIvPjxwYXRoIHN0cm9rZT0iIzY2NiIgc3Ryb2tlLWxpbmVjYXA9InVuZGVmaW5lZCIgc3Ryb2tlLWxpbmVqb2luPSJ1bmRlZmluZWQiIHN0cm9rZS13aWR0aD0iMiIgZmlsbD0ibm9uZSIgZD0iTS45NDctLjAxOHY5LjEyNU0tLjY1NiA5aDEwLjczIi8+PC9nPjwvc3ZnPg==);background-position:0 100%;padding-left:3px;background-repeat:no-repeat;background-origin:content-box;cursor:sw-resize;right:auto}.vue-grid-item.disable-userselect{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}', ""]);
  955. module2.exports = exports2;
  956. }
  957. ),
  958. /***/
  959. "499e": (
  960. /***/
  961. function(module2, __webpack_exports__, __webpack_require__) {
  962. "use strict";
  963. __webpack_require__.r(__webpack_exports__);
  964. __webpack_require__.d(__webpack_exports__, "default", function() {
  965. return (
  966. /* binding */
  967. addStylesClient
  968. );
  969. });
  970. function listToStyles(parentId, list) {
  971. var styles = [];
  972. var newStyles = {};
  973. for (var i = 0; i < list.length; i++) {
  974. var item = list[i];
  975. var id = item[0];
  976. var css = item[1];
  977. var media = item[2];
  978. var sourceMap = item[3];
  979. var part = {
  980. id: parentId + ":" + i,
  981. css,
  982. media,
  983. sourceMap
  984. };
  985. if (!newStyles[id]) {
  986. styles.push(newStyles[id] = { id, parts: [part] });
  987. } else {
  988. newStyles[id].parts.push(part);
  989. }
  990. }
  991. return styles;
  992. }
  993. var hasDocument = typeof document !== "undefined";
  994. if (typeof DEBUG !== "undefined" && DEBUG) {
  995. if (!hasDocument) {
  996. throw new Error(
  997. "vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment."
  998. );
  999. }
  1000. }
  1001. var stylesInDom = {
  1002. /*
  1003. [id: number]: {
  1004. id: number,
  1005. refs: number,
  1006. parts: Array<(obj?: StyleObjectPart) => void>
  1007. }
  1008. */
  1009. };
  1010. var head = hasDocument && (document.head || document.getElementsByTagName("head")[0]);
  1011. var singletonElement = null;
  1012. var singletonCounter = 0;
  1013. var isProduction = false;
  1014. var noop = function() {
  1015. };
  1016. var options = null;
  1017. var ssrIdKey = "data-vue-ssr-id";
  1018. var isOldIE = typeof navigator !== "undefined" && /msie [6-9]\b/.test(navigator.userAgent.toLowerCase());
  1019. function addStylesClient(parentId, list, _isProduction, _options) {
  1020. isProduction = _isProduction;
  1021. options = _options || {};
  1022. var styles = listToStyles(parentId, list);
  1023. addStylesToDom(styles);
  1024. return function update(newList) {
  1025. var mayRemove = [];
  1026. for (var i = 0; i < styles.length; i++) {
  1027. var item = styles[i];
  1028. var domStyle = stylesInDom[item.id];
  1029. domStyle.refs--;
  1030. mayRemove.push(domStyle);
  1031. }
  1032. if (newList) {
  1033. styles = listToStyles(parentId, newList);
  1034. addStylesToDom(styles);
  1035. } else {
  1036. styles = [];
  1037. }
  1038. for (var i = 0; i < mayRemove.length; i++) {
  1039. var domStyle = mayRemove[i];
  1040. if (domStyle.refs === 0) {
  1041. for (var j = 0; j < domStyle.parts.length; j++) {
  1042. domStyle.parts[j]();
  1043. }
  1044. delete stylesInDom[domStyle.id];
  1045. }
  1046. }
  1047. };
  1048. }
  1049. function addStylesToDom(styles) {
  1050. for (var i = 0; i < styles.length; i++) {
  1051. var item = styles[i];
  1052. var domStyle = stylesInDom[item.id];
  1053. if (domStyle) {
  1054. domStyle.refs++;
  1055. for (var j = 0; j < domStyle.parts.length; j++) {
  1056. domStyle.parts[j](item.parts[j]);
  1057. }
  1058. for (; j < item.parts.length; j++) {
  1059. domStyle.parts.push(addStyle(item.parts[j]));
  1060. }
  1061. if (domStyle.parts.length > item.parts.length) {
  1062. domStyle.parts.length = item.parts.length;
  1063. }
  1064. } else {
  1065. var parts = [];
  1066. for (var j = 0; j < item.parts.length; j++) {
  1067. parts.push(addStyle(item.parts[j]));
  1068. }
  1069. stylesInDom[item.id] = { id: item.id, refs: 1, parts };
  1070. }
  1071. }
  1072. }
  1073. function createStyleElement() {
  1074. var styleElement = document.createElement("style");
  1075. styleElement.type = "text/css";
  1076. head.appendChild(styleElement);
  1077. return styleElement;
  1078. }
  1079. function addStyle(obj) {
  1080. var update, remove;
  1081. var styleElement = document.querySelector("style[" + ssrIdKey + '~="' + obj.id + '"]');
  1082. if (styleElement) {
  1083. if (isProduction) {
  1084. return noop;
  1085. } else {
  1086. styleElement.parentNode.removeChild(styleElement);
  1087. }
  1088. }
  1089. if (isOldIE) {
  1090. var styleIndex = singletonCounter++;
  1091. styleElement = singletonElement || (singletonElement = createStyleElement());
  1092. update = applyToSingletonTag.bind(null, styleElement, styleIndex, false);
  1093. remove = applyToSingletonTag.bind(null, styleElement, styleIndex, true);
  1094. } else {
  1095. styleElement = createStyleElement();
  1096. update = applyToTag.bind(null, styleElement);
  1097. remove = function() {
  1098. styleElement.parentNode.removeChild(styleElement);
  1099. };
  1100. }
  1101. update(obj);
  1102. return function updateStyle(newObj) {
  1103. if (newObj) {
  1104. if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {
  1105. return;
  1106. }
  1107. update(obj = newObj);
  1108. } else {
  1109. remove();
  1110. }
  1111. };
  1112. }
  1113. var replaceText = function() {
  1114. var textStore = [];
  1115. return function(index, replacement) {
  1116. textStore[index] = replacement;
  1117. return textStore.filter(Boolean).join("\n");
  1118. };
  1119. }();
  1120. function applyToSingletonTag(styleElement, index, remove, obj) {
  1121. var css = remove ? "" : obj.css;
  1122. if (styleElement.styleSheet) {
  1123. styleElement.styleSheet.cssText = replaceText(index, css);
  1124. } else {
  1125. var cssNode = document.createTextNode(css);
  1126. var childNodes = styleElement.childNodes;
  1127. if (childNodes[index])
  1128. styleElement.removeChild(childNodes[index]);
  1129. if (childNodes.length) {
  1130. styleElement.insertBefore(cssNode, childNodes[index]);
  1131. } else {
  1132. styleElement.appendChild(cssNode);
  1133. }
  1134. }
  1135. }
  1136. function applyToTag(styleElement, obj) {
  1137. var css = obj.css;
  1138. var media = obj.media;
  1139. var sourceMap = obj.sourceMap;
  1140. if (media) {
  1141. styleElement.setAttribute("media", media);
  1142. }
  1143. if (options.ssrId) {
  1144. styleElement.setAttribute(ssrIdKey, obj.id);
  1145. }
  1146. if (sourceMap) {
  1147. css += "\n/*# sourceURL=" + sourceMap.sources[0] + " */";
  1148. css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */";
  1149. }
  1150. if (styleElement.styleSheet) {
  1151. styleElement.styleSheet.cssText = css;
  1152. } else {
  1153. while (styleElement.firstChild) {
  1154. styleElement.removeChild(styleElement.firstChild);
  1155. }
  1156. styleElement.appendChild(document.createTextNode(css));
  1157. }
  1158. }
  1159. }
  1160. ),
  1161. /***/
  1162. "49ad": (
  1163. /***/
  1164. function(module2, exports2, __webpack_require__) {
  1165. "use strict";
  1166. module2.exports = function(idHandler) {
  1167. var eventListeners = {};
  1168. function getListeners(element) {
  1169. var id = idHandler.get(element);
  1170. if (id === void 0) {
  1171. return [];
  1172. }
  1173. return eventListeners[id] || [];
  1174. }
  1175. function addListener(element, listener) {
  1176. var id = idHandler.get(element);
  1177. if (!eventListeners[id]) {
  1178. eventListeners[id] = [];
  1179. }
  1180. eventListeners[id].push(listener);
  1181. }
  1182. function removeListener(element, listener) {
  1183. var listeners = getListeners(element);
  1184. for (var i = 0, len = listeners.length; i < len; ++i) {
  1185. if (listeners[i] === listener) {
  1186. listeners.splice(i, 1);
  1187. break;
  1188. }
  1189. }
  1190. }
  1191. function removeAllListeners(element) {
  1192. var listeners = getListeners(element);
  1193. if (!listeners) {
  1194. return;
  1195. }
  1196. listeners.length = 0;
  1197. }
  1198. return {
  1199. get: getListeners,
  1200. add: addListener,
  1201. removeListener,
  1202. removeAllListeners
  1203. };
  1204. };
  1205. }
  1206. ),
  1207. /***/
  1208. "4bf8": (
  1209. /***/
  1210. function(module2, exports2, __webpack_require__) {
  1211. var defined = __webpack_require__("be13");
  1212. module2.exports = function(it) {
  1213. return Object(defined(it));
  1214. };
  1215. }
  1216. ),
  1217. /***/
  1218. "5058": (
  1219. /***/
  1220. function(module2, exports2, __webpack_require__) {
  1221. "use strict";
  1222. module2.exports = function(options) {
  1223. var idGenerator = options.idGenerator;
  1224. var getState = options.stateHandler.getState;
  1225. function getId(element) {
  1226. var state = getState(element);
  1227. if (state && state.id !== void 0) {
  1228. return state.id;
  1229. }
  1230. return null;
  1231. }
  1232. function setId(element) {
  1233. var state = getState(element);
  1234. if (!state) {
  1235. throw new Error("setId required the element to have a resize detection state.");
  1236. }
  1237. var id = idGenerator.generate();
  1238. state.id = id;
  1239. return id;
  1240. }
  1241. return {
  1242. get: getId,
  1243. set: setId
  1244. };
  1245. };
  1246. }
  1247. ),
  1248. /***/
  1249. "50bf": (
  1250. /***/
  1251. function(module2, exports2, __webpack_require__) {
  1252. "use strict";
  1253. var utils = module2.exports = {};
  1254. utils.getOption = getOption;
  1255. function getOption(options, name, defaultValue) {
  1256. var value = options[name];
  1257. if ((value === void 0 || value === null) && defaultValue !== void 0) {
  1258. return defaultValue;
  1259. }
  1260. return value;
  1261. }
  1262. }
  1263. ),
  1264. /***/
  1265. "520a": (
  1266. /***/
  1267. function(module2, exports2, __webpack_require__) {
  1268. "use strict";
  1269. var regexpFlags = __webpack_require__("0bfb");
  1270. var nativeExec = RegExp.prototype.exec;
  1271. var nativeReplace = String.prototype.replace;
  1272. var patchedExec = nativeExec;
  1273. var LAST_INDEX = "lastIndex";
  1274. var UPDATES_LAST_INDEX_WRONG = function() {
  1275. var re1 = /a/, re2 = /b*/g;
  1276. nativeExec.call(re1, "a");
  1277. nativeExec.call(re2, "a");
  1278. return re1[LAST_INDEX] !== 0 || re2[LAST_INDEX] !== 0;
  1279. }();
  1280. var NPCG_INCLUDED = /()??/.exec("")[1] !== void 0;
  1281. var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED;
  1282. if (PATCH) {
  1283. patchedExec = function exec(str) {
  1284. var re = this;
  1285. var lastIndex, reCopy, match, i;
  1286. if (NPCG_INCLUDED) {
  1287. reCopy = new RegExp("^" + re.source + "$(?!\\s)", regexpFlags.call(re));
  1288. }
  1289. if (UPDATES_LAST_INDEX_WRONG)
  1290. lastIndex = re[LAST_INDEX];
  1291. match = nativeExec.call(re, str);
  1292. if (UPDATES_LAST_INDEX_WRONG && match) {
  1293. re[LAST_INDEX] = re.global ? match.index + match[0].length : lastIndex;
  1294. }
  1295. if (NPCG_INCLUDED && match && match.length > 1) {
  1296. nativeReplace.call(match[0], reCopy, function() {
  1297. for (i = 1; i < arguments.length - 2; i++) {
  1298. if (arguments[i] === void 0)
  1299. match[i] = void 0;
  1300. }
  1301. });
  1302. }
  1303. return match;
  1304. };
  1305. }
  1306. module2.exports = patchedExec;
  1307. }
  1308. ),
  1309. /***/
  1310. "52a7": (
  1311. /***/
  1312. function(module2, exports2) {
  1313. exports2.f = {}.propertyIsEnumerable;
  1314. }
  1315. ),
  1316. /***/
  1317. "5537": (
  1318. /***/
  1319. function(module2, exports2, __webpack_require__) {
  1320. var core = __webpack_require__("8378");
  1321. var global = __webpack_require__("7726");
  1322. var SHARED = "__core-js_shared__";
  1323. var store = global[SHARED] || (global[SHARED] = {});
  1324. (module2.exports = function(key, value) {
  1325. return store[key] || (store[key] = value !== void 0 ? value : {});
  1326. })("versions", []).push({
  1327. version: core.version,
  1328. mode: __webpack_require__("2d00") ? "pure" : "global",
  1329. copyright: "© 2020 Denis Pushkarev (zloirock.ru)"
  1330. });
  1331. }
  1332. ),
  1333. /***/
  1334. "55dd": (
  1335. /***/
  1336. function(module2, exports2, __webpack_require__) {
  1337. "use strict";
  1338. var $export = __webpack_require__("5ca1");
  1339. var aFunction = __webpack_require__("d8e8");
  1340. var toObject = __webpack_require__("4bf8");
  1341. var fails = __webpack_require__("79e5");
  1342. var $sort = [].sort;
  1343. var test = [1, 2, 3];
  1344. $export($export.P + $export.F * (fails(function() {
  1345. test.sort(void 0);
  1346. }) || !fails(function() {
  1347. test.sort(null);
  1348. }) || !__webpack_require__("2f21")($sort)), "Array", {
  1349. // 22.1.3.25 Array.prototype.sort(comparefn)
  1350. sort: function sort(comparefn) {
  1351. return comparefn === void 0 ? $sort.call(toObject(this)) : $sort.call(toObject(this), aFunction(comparefn));
  1352. }
  1353. });
  1354. }
  1355. ),
  1356. /***/
  1357. "5be5": (
  1358. /***/
  1359. function(module2, exports2, __webpack_require__) {
  1360. "use strict";
  1361. module2.exports = function(options) {
  1362. var getState = options.stateHandler.getState;
  1363. function isDetectable(element) {
  1364. var state = getState(element);
  1365. return state && !!state.isDetectable;
  1366. }
  1367. function markAsDetectable(element) {
  1368. getState(element).isDetectable = true;
  1369. }
  1370. function isBusy(element) {
  1371. return !!getState(element).busy;
  1372. }
  1373. function markBusy(element, busy) {
  1374. getState(element).busy = !!busy;
  1375. }
  1376. return {
  1377. isDetectable,
  1378. markAsDetectable,
  1379. isBusy,
  1380. markBusy
  1381. };
  1382. };
  1383. }
  1384. ),
  1385. /***/
  1386. "5ca1": (
  1387. /***/
  1388. function(module2, exports2, __webpack_require__) {
  1389. var global = __webpack_require__("7726");
  1390. var core = __webpack_require__("8378");
  1391. var hide = __webpack_require__("32e9");
  1392. var redefine = __webpack_require__("2aba");
  1393. var ctx = __webpack_require__("9b43");
  1394. var PROTOTYPE = "prototype";
  1395. var $export = function(type, name, source) {
  1396. var IS_FORCED = type & $export.F;
  1397. var IS_GLOBAL = type & $export.G;
  1398. var IS_STATIC = type & $export.S;
  1399. var IS_PROTO = type & $export.P;
  1400. var IS_BIND = type & $export.B;
  1401. var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE];
  1402. var exports3 = IS_GLOBAL ? core : core[name] || (core[name] = {});
  1403. var expProto = exports3[PROTOTYPE] || (exports3[PROTOTYPE] = {});
  1404. var key, own, out, exp;
  1405. if (IS_GLOBAL)
  1406. source = name;
  1407. for (key in source) {
  1408. own = !IS_FORCED && target && target[key] !== void 0;
  1409. out = (own ? target : source)[key];
  1410. exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == "function" ? ctx(Function.call, out) : out;
  1411. if (target)
  1412. redefine(target, key, out, type & $export.U);
  1413. if (exports3[key] != out)
  1414. hide(exports3, key, exp);
  1415. if (IS_PROTO && expProto[key] != out)
  1416. expProto[key] = out;
  1417. }
  1418. };
  1419. global.core = core;
  1420. $export.F = 1;
  1421. $export.G = 2;
  1422. $export.S = 4;
  1423. $export.P = 8;
  1424. $export.B = 16;
  1425. $export.W = 32;
  1426. $export.U = 64;
  1427. $export.R = 128;
  1428. module2.exports = $export;
  1429. }
  1430. ),
  1431. /***/
  1432. "5dbc": (
  1433. /***/
  1434. function(module2, exports2, __webpack_require__) {
  1435. var isObject = __webpack_require__("d3f4");
  1436. var setPrototypeOf = __webpack_require__("8b97").set;
  1437. module2.exports = function(that, target, C) {
  1438. var S = target.constructor;
  1439. var P;
  1440. if (S !== C && typeof S == "function" && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) {
  1441. setPrototypeOf(that, P);
  1442. }
  1443. return that;
  1444. };
  1445. }
  1446. ),
  1447. /***/
  1448. "5eda": (
  1449. /***/
  1450. function(module2, exports2, __webpack_require__) {
  1451. var $export = __webpack_require__("5ca1");
  1452. var core = __webpack_require__("8378");
  1453. var fails = __webpack_require__("79e5");
  1454. module2.exports = function(KEY, exec) {
  1455. var fn = (core.Object || {})[KEY] || Object[KEY];
  1456. var exp = {};
  1457. exp[KEY] = exec(fn);
  1458. $export($export.S + $export.F * fails(function() {
  1459. fn(1);
  1460. }), "Object", exp);
  1461. };
  1462. }
  1463. ),
  1464. /***/
  1465. "5f1b": (
  1466. /***/
  1467. function(module2, exports2, __webpack_require__) {
  1468. "use strict";
  1469. var classof = __webpack_require__("23c6");
  1470. var builtinExec = RegExp.prototype.exec;
  1471. module2.exports = function(R, S) {
  1472. var exec = R.exec;
  1473. if (typeof exec === "function") {
  1474. var result = exec.call(R, S);
  1475. if (typeof result !== "object") {
  1476. throw new TypeError("RegExp exec method returned something other than an Object or null");
  1477. }
  1478. return result;
  1479. }
  1480. if (classof(R) !== "RegExp") {
  1481. throw new TypeError("RegExp#exec called on incompatible receiver");
  1482. }
  1483. return builtinExec.call(R, S);
  1484. };
  1485. }
  1486. ),
  1487. /***/
  1488. "613b": (
  1489. /***/
  1490. function(module2, exports2, __webpack_require__) {
  1491. var shared = __webpack_require__("5537")("keys");
  1492. var uid = __webpack_require__("ca5a");
  1493. module2.exports = function(key) {
  1494. return shared[key] || (shared[key] = uid(key));
  1495. };
  1496. }
  1497. ),
  1498. /***/
  1499. "626a": (
  1500. /***/
  1501. function(module2, exports2, __webpack_require__) {
  1502. var cof = __webpack_require__("2d95");
  1503. module2.exports = Object("z").propertyIsEnumerable(0) ? Object : function(it) {
  1504. return cof(it) == "String" ? it.split("") : Object(it);
  1505. };
  1506. }
  1507. ),
  1508. /***/
  1509. "6521": (
  1510. /***/
  1511. function(module2, __webpack_exports__, __webpack_require__) {
  1512. "use strict";
  1513. var _node_modules_vue_style_loader_index_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_v16_dist_index_js_ref_0_1_GridLayout_vue_vue_type_style_index_0_id_fc5948f6_lang_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("92bf");
  1514. var _node_modules_vue_style_loader_index_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_v16_dist_index_js_ref_0_1_GridLayout_vue_vue_type_style_index_0_id_fc5948f6_lang_css__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_node_modules_vue_style_loader_index_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_v16_dist_index_js_ref_0_1_GridLayout_vue_vue_type_style_index_0_id_fc5948f6_lang_css__WEBPACK_IMPORTED_MODULE_0__);
  1515. }
  1516. ),
  1517. /***/
  1518. "6821": (
  1519. /***/
  1520. function(module2, exports2, __webpack_require__) {
  1521. var IObject = __webpack_require__("626a");
  1522. var defined = __webpack_require__("be13");
  1523. module2.exports = function(it) {
  1524. return IObject(defined(it));
  1525. };
  1526. }
  1527. ),
  1528. /***/
  1529. "69a8": (
  1530. /***/
  1531. function(module2, exports2) {
  1532. var hasOwnProperty = {}.hasOwnProperty;
  1533. module2.exports = function(it, key) {
  1534. return hasOwnProperty.call(it, key);
  1535. };
  1536. }
  1537. ),
  1538. /***/
  1539. "6a99": (
  1540. /***/
  1541. function(module2, exports2, __webpack_require__) {
  1542. var isObject = __webpack_require__("d3f4");
  1543. module2.exports = function(it, S) {
  1544. if (!isObject(it))
  1545. return it;
  1546. var fn, val;
  1547. if (S && typeof (fn = it.toString) == "function" && !isObject(val = fn.call(it)))
  1548. return val;
  1549. if (typeof (fn = it.valueOf) == "function" && !isObject(val = fn.call(it)))
  1550. return val;
  1551. if (!S && typeof (fn = it.toString) == "function" && !isObject(val = fn.call(it)))
  1552. return val;
  1553. throw TypeError("Can't convert object to primitive value");
  1554. };
  1555. }
  1556. ),
  1557. /***/
  1558. "7333": (
  1559. /***/
  1560. function(module2, exports2, __webpack_require__) {
  1561. "use strict";
  1562. var DESCRIPTORS = __webpack_require__("9e1e");
  1563. var getKeys = __webpack_require__("0d58");
  1564. var gOPS = __webpack_require__("2621");
  1565. var pIE = __webpack_require__("52a7");
  1566. var toObject = __webpack_require__("4bf8");
  1567. var IObject = __webpack_require__("626a");
  1568. var $assign = Object.assign;
  1569. module2.exports = !$assign || __webpack_require__("79e5")(function() {
  1570. var A = {};
  1571. var B = {};
  1572. var S = Symbol();
  1573. var K = "abcdefghijklmnopqrst";
  1574. A[S] = 7;
  1575. K.split("").forEach(function(k) {
  1576. B[k] = k;
  1577. });
  1578. return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join("") != K;
  1579. }) ? function assign(target, source) {
  1580. var T = toObject(target);
  1581. var aLen = arguments.length;
  1582. var index = 1;
  1583. var getSymbols = gOPS.f;
  1584. var isEnum = pIE.f;
  1585. while (aLen > index) {
  1586. var S = IObject(arguments[index++]);
  1587. var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);
  1588. var length = keys.length;
  1589. var j = 0;
  1590. var key;
  1591. while (length > j) {
  1592. key = keys[j++];
  1593. if (!DESCRIPTORS || isEnum.call(S, key))
  1594. T[key] = S[key];
  1595. }
  1596. }
  1597. return T;
  1598. } : $assign;
  1599. }
  1600. ),
  1601. /***/
  1602. "7726": (
  1603. /***/
  1604. function(module2, exports2) {
  1605. var global = module2.exports = typeof window != "undefined" && window.Math == Math ? window : typeof self != "undefined" && self.Math == Math ? self : Function("return this")();
  1606. if (typeof __g == "number")
  1607. __g = global;
  1608. }
  1609. ),
  1610. /***/
  1611. "77f1": (
  1612. /***/
  1613. function(module2, exports2, __webpack_require__) {
  1614. var toInteger = __webpack_require__("4588");
  1615. var max = Math.max;
  1616. var min = Math.min;
  1617. module2.exports = function(index, length) {
  1618. index = toInteger(index);
  1619. return index < 0 ? max(index + length, 0) : min(index, length);
  1620. };
  1621. }
  1622. ),
  1623. /***/
  1624. "79e5": (
  1625. /***/
  1626. function(module2, exports2) {
  1627. module2.exports = function(exec) {
  1628. try {
  1629. return !!exec();
  1630. } catch (e) {
  1631. return true;
  1632. }
  1633. };
  1634. }
  1635. ),
  1636. /***/
  1637. "7f20": (
  1638. /***/
  1639. function(module2, exports2, __webpack_require__) {
  1640. var def = __webpack_require__("86cc").f;
  1641. var has = __webpack_require__("69a8");
  1642. var TAG = __webpack_require__("2b4c")("toStringTag");
  1643. module2.exports = function(it, tag, stat) {
  1644. if (it && !has(it = stat ? it : it.prototype, TAG))
  1645. def(it, TAG, { configurable: true, value: tag });
  1646. };
  1647. }
  1648. ),
  1649. /***/
  1650. "8378": (
  1651. /***/
  1652. function(module2, exports2) {
  1653. var core = module2.exports = { version: "2.6.12" };
  1654. if (typeof __e == "number")
  1655. __e = core;
  1656. }
  1657. ),
  1658. /***/
  1659. "848e": (
  1660. /***/
  1661. function(module2, exports2, __webpack_require__) {
  1662. var ___CSS_LOADER_API_IMPORT___ = __webpack_require__("24fb");
  1663. exports2 = ___CSS_LOADER_API_IMPORT___(false);
  1664. exports2.push([module2.i, ".vue-grid-layout{position:relative;-webkit-transition:height .2s ease;transition:height .2s ease}", ""]);
  1665. module2.exports = exports2;
  1666. }
  1667. ),
  1668. /***/
  1669. "84f2": (
  1670. /***/
  1671. function(module2, exports2) {
  1672. module2.exports = {};
  1673. }
  1674. ),
  1675. /***/
  1676. "86cc": (
  1677. /***/
  1678. function(module2, exports2, __webpack_require__) {
  1679. var anObject = __webpack_require__("cb7c");
  1680. var IE8_DOM_DEFINE = __webpack_require__("c69a");
  1681. var toPrimitive = __webpack_require__("6a99");
  1682. var dP = Object.defineProperty;
  1683. exports2.f = __webpack_require__("9e1e") ? Object.defineProperty : function defineProperty(O, P, Attributes) {
  1684. anObject(O);
  1685. P = toPrimitive(P, true);
  1686. anObject(Attributes);
  1687. if (IE8_DOM_DEFINE)
  1688. try {
  1689. return dP(O, P, Attributes);
  1690. } catch (e) {
  1691. }
  1692. if ("get" in Attributes || "set" in Attributes)
  1693. throw TypeError("Accessors not supported!");
  1694. if ("value" in Attributes)
  1695. O[P] = Attributes.value;
  1696. return O;
  1697. };
  1698. }
  1699. ),
  1700. /***/
  1701. "8875": (
  1702. /***/
  1703. function(module2, exports2, __webpack_require__) {
  1704. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;
  1705. (function(root, factory) {
  1706. if (true) {
  1707. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = factory, __WEBPACK_AMD_DEFINE_RESULT__ = typeof __WEBPACK_AMD_DEFINE_FACTORY__ === "function" ? __WEBPACK_AMD_DEFINE_FACTORY__.apply(exports2, __WEBPACK_AMD_DEFINE_ARRAY__) : __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__ !== void 0 && (module2.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  1708. } else {
  1709. }
  1710. })(typeof self !== "undefined" ? self : this, function() {
  1711. function getCurrentScript() {
  1712. var descriptor = Object.getOwnPropertyDescriptor(document, "currentScript");
  1713. if (!descriptor && "currentScript" in document && document.currentScript) {
  1714. return document.currentScript;
  1715. }
  1716. if (descriptor && descriptor.get !== getCurrentScript && document.currentScript) {
  1717. return document.currentScript;
  1718. }
  1719. try {
  1720. throw new Error();
  1721. } catch (err) {
  1722. var ieStackRegExp = /.*at [^(]*\((.*):(.+):(.+)\)$/ig, ffStackRegExp = /@([^@]*):(\d+):(\d+)\s*$/ig, stackDetails = ieStackRegExp.exec(err.stack) || ffStackRegExp.exec(err.stack), scriptLocation = stackDetails && stackDetails[1] || false, line = stackDetails && stackDetails[2] || false, currentLocation = document.location.href.replace(document.location.hash, ""), pageSource, inlineScriptSourceRegExp, inlineScriptSource, scripts = document.getElementsByTagName("script");
  1723. if (scriptLocation === currentLocation) {
  1724. pageSource = document.documentElement.outerHTML;
  1725. inlineScriptSourceRegExp = new RegExp("(?:[^\\n]+?\\n){0," + (line - 2) + "}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*", "i");
  1726. inlineScriptSource = pageSource.replace(inlineScriptSourceRegExp, "$1").trim();
  1727. }
  1728. for (var i = 0; i < scripts.length; i++) {
  1729. if (scripts[i].readyState === "interactive") {
  1730. return scripts[i];
  1731. }
  1732. if (scripts[i].src === scriptLocation) {
  1733. return scripts[i];
  1734. }
  1735. if (scriptLocation === currentLocation && scripts[i].innerHTML && scripts[i].innerHTML.trim() === inlineScriptSource) {
  1736. return scripts[i];
  1737. }
  1738. }
  1739. return null;
  1740. }
  1741. }
  1742. ;
  1743. return getCurrentScript;
  1744. });
  1745. }
  1746. ),
  1747. /***/
  1748. "8b97": (
  1749. /***/
  1750. function(module2, exports2, __webpack_require__) {
  1751. var isObject = __webpack_require__("d3f4");
  1752. var anObject = __webpack_require__("cb7c");
  1753. var check = function(O, proto) {
  1754. anObject(O);
  1755. if (!isObject(proto) && proto !== null)
  1756. throw TypeError(proto + ": can't set as prototype!");
  1757. };
  1758. module2.exports = {
  1759. set: Object.setPrototypeOf || ("__proto__" in {} ? (
  1760. // eslint-disable-line
  1761. function(test, buggy, set) {
  1762. try {
  1763. set = __webpack_require__("9b43")(Function.call, __webpack_require__("11e9").f(Object.prototype, "__proto__").set, 2);
  1764. set(test, []);
  1765. buggy = !(test instanceof Array);
  1766. } catch (e) {
  1767. buggy = true;
  1768. }
  1769. return function setPrototypeOf(O, proto) {
  1770. check(O, proto);
  1771. if (buggy)
  1772. O.__proto__ = proto;
  1773. else
  1774. set(O, proto);
  1775. return O;
  1776. };
  1777. }({}, false)
  1778. ) : void 0),
  1779. check
  1780. };
  1781. }
  1782. ),
  1783. /***/
  1784. "8bbf": (
  1785. /***/
  1786. function(module2, exports2) {
  1787. module2.exports = require_vue();
  1788. }
  1789. ),
  1790. /***/
  1791. "8e6e": (
  1792. /***/
  1793. function(module2, exports2, __webpack_require__) {
  1794. var $export = __webpack_require__("5ca1");
  1795. var ownKeys = __webpack_require__("990b");
  1796. var toIObject = __webpack_require__("6821");
  1797. var gOPD = __webpack_require__("11e9");
  1798. var createProperty = __webpack_require__("f1ae");
  1799. $export($export.S, "Object", {
  1800. getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {
  1801. var O = toIObject(object);
  1802. var getDesc = gOPD.f;
  1803. var keys = ownKeys(O);
  1804. var result = {};
  1805. var i = 0;
  1806. var key, desc;
  1807. while (keys.length > i) {
  1808. desc = getDesc(O, key = keys[i++]);
  1809. if (desc !== void 0)
  1810. createProperty(result, key, desc);
  1811. }
  1812. return result;
  1813. }
  1814. });
  1815. }
  1816. ),
  1817. /***/
  1818. "9093": (
  1819. /***/
  1820. function(module2, exports2, __webpack_require__) {
  1821. var $keys = __webpack_require__("ce10");
  1822. var hiddenKeys = __webpack_require__("e11e").concat("length", "prototype");
  1823. exports2.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  1824. return $keys(O, hiddenKeys);
  1825. };
  1826. }
  1827. ),
  1828. /***/
  1829. "92bf": (
  1830. /***/
  1831. function(module2, exports2, __webpack_require__) {
  1832. var content = __webpack_require__("848e");
  1833. if (typeof content === "string")
  1834. content = [[module2.i, content, ""]];
  1835. if (content.locals)
  1836. module2.exports = content.locals;
  1837. var add = __webpack_require__("499e").default;
  1838. var update = add("ff1827d0", content, true, { "sourceMap": false, "shadowMode": false });
  1839. }
  1840. ),
  1841. /***/
  1842. "990b": (
  1843. /***/
  1844. function(module2, exports2, __webpack_require__) {
  1845. var gOPN = __webpack_require__("9093");
  1846. var gOPS = __webpack_require__("2621");
  1847. var anObject = __webpack_require__("cb7c");
  1848. var Reflect = __webpack_require__("7726").Reflect;
  1849. module2.exports = Reflect && Reflect.ownKeys || function ownKeys(it) {
  1850. var keys = gOPN.f(anObject(it));
  1851. var getSymbols = gOPS.f;
  1852. return getSymbols ? keys.concat(getSymbols(it)) : keys;
  1853. };
  1854. }
  1855. ),
  1856. /***/
  1857. "9b43": (
  1858. /***/
  1859. function(module2, exports2, __webpack_require__) {
  1860. var aFunction = __webpack_require__("d8e8");
  1861. module2.exports = function(fn, that, length) {
  1862. aFunction(fn);
  1863. if (that === void 0)
  1864. return fn;
  1865. switch (length) {
  1866. case 1:
  1867. return function(a) {
  1868. return fn.call(that, a);
  1869. };
  1870. case 2:
  1871. return function(a, b) {
  1872. return fn.call(that, a, b);
  1873. };
  1874. case 3:
  1875. return function(a, b, c) {
  1876. return fn.call(that, a, b, c);
  1877. };
  1878. }
  1879. return function() {
  1880. return fn.apply(that, arguments);
  1881. };
  1882. };
  1883. }
  1884. ),
  1885. /***/
  1886. "9c6c": (
  1887. /***/
  1888. function(module2, exports2, __webpack_require__) {
  1889. var UNSCOPABLES = __webpack_require__("2b4c")("unscopables");
  1890. var ArrayProto = Array.prototype;
  1891. if (ArrayProto[UNSCOPABLES] == void 0)
  1892. __webpack_require__("32e9")(ArrayProto, UNSCOPABLES, {});
  1893. module2.exports = function(key) {
  1894. ArrayProto[UNSCOPABLES][key] = true;
  1895. };
  1896. }
  1897. ),
  1898. /***/
  1899. "9def": (
  1900. /***/
  1901. function(module2, exports2, __webpack_require__) {
  1902. var toInteger = __webpack_require__("4588");
  1903. var min = Math.min;
  1904. module2.exports = function(it) {
  1905. return it > 0 ? min(toInteger(it), 9007199254740991) : 0;
  1906. };
  1907. }
  1908. ),
  1909. /***/
  1910. "9e1e": (
  1911. /***/
  1912. function(module2, exports2, __webpack_require__) {
  1913. module2.exports = !__webpack_require__("79e5")(function() {
  1914. return Object.defineProperty({}, "a", { get: function() {
  1915. return 7;
  1916. } }).a != 7;
  1917. });
  1918. }
  1919. ),
  1920. /***/
  1921. "a481": (
  1922. /***/
  1923. function(module2, exports2, __webpack_require__) {
  1924. "use strict";
  1925. var anObject = __webpack_require__("cb7c");
  1926. var toObject = __webpack_require__("4bf8");
  1927. var toLength = __webpack_require__("9def");
  1928. var toInteger = __webpack_require__("4588");
  1929. var advanceStringIndex = __webpack_require__("0390");
  1930. var regExpExec = __webpack_require__("5f1b");
  1931. var max = Math.max;
  1932. var min = Math.min;
  1933. var floor = Math.floor;
  1934. var SUBSTITUTION_SYMBOLS = /\$([$&`']|\d\d?|<[^>]*>)/g;
  1935. var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&`']|\d\d?)/g;
  1936. var maybeToString = function(it) {
  1937. return it === void 0 ? it : String(it);
  1938. };
  1939. __webpack_require__("214f")("replace", 2, function(defined, REPLACE, $replace, maybeCallNative) {
  1940. return [
  1941. // `String.prototype.replace` method
  1942. // https://tc39.github.io/ecma262/#sec-string.prototype.replace
  1943. function replace(searchValue, replaceValue) {
  1944. var O = defined(this);
  1945. var fn = searchValue == void 0 ? void 0 : searchValue[REPLACE];
  1946. return fn !== void 0 ? fn.call(searchValue, O, replaceValue) : $replace.call(String(O), searchValue, replaceValue);
  1947. },
  1948. // `RegExp.prototype[@@replace]` method
  1949. // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace
  1950. function(regexp, replaceValue) {
  1951. var res = maybeCallNative($replace, regexp, this, replaceValue);
  1952. if (res.done)
  1953. return res.value;
  1954. var rx = anObject(regexp);
  1955. var S = String(this);
  1956. var functionalReplace = typeof replaceValue === "function";
  1957. if (!functionalReplace)
  1958. replaceValue = String(replaceValue);
  1959. var global = rx.global;
  1960. if (global) {
  1961. var fullUnicode = rx.unicode;
  1962. rx.lastIndex = 0;
  1963. }
  1964. var results = [];
  1965. while (true) {
  1966. var result = regExpExec(rx, S);
  1967. if (result === null)
  1968. break;
  1969. results.push(result);
  1970. if (!global)
  1971. break;
  1972. var matchStr = String(result[0]);
  1973. if (matchStr === "")
  1974. rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
  1975. }
  1976. var accumulatedResult = "";
  1977. var nextSourcePosition = 0;
  1978. for (var i = 0; i < results.length; i++) {
  1979. result = results[i];
  1980. var matched = String(result[0]);
  1981. var position = max(min(toInteger(result.index), S.length), 0);
  1982. var captures = [];
  1983. for (var j = 1; j < result.length; j++)
  1984. captures.push(maybeToString(result[j]));
  1985. var namedCaptures = result.groups;
  1986. if (functionalReplace) {
  1987. var replacerArgs = [matched].concat(captures, position, S);
  1988. if (namedCaptures !== void 0)
  1989. replacerArgs.push(namedCaptures);
  1990. var replacement = String(replaceValue.apply(void 0, replacerArgs));
  1991. } else {
  1992. replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
  1993. }
  1994. if (position >= nextSourcePosition) {
  1995. accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
  1996. nextSourcePosition = position + matched.length;
  1997. }
  1998. }
  1999. return accumulatedResult + S.slice(nextSourcePosition);
  2000. }
  2001. ];
  2002. function getSubstitution(matched, str, position, captures, namedCaptures, replacement) {
  2003. var tailPos = position + matched.length;
  2004. var m = captures.length;
  2005. var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
  2006. if (namedCaptures !== void 0) {
  2007. namedCaptures = toObject(namedCaptures);
  2008. symbols = SUBSTITUTION_SYMBOLS;
  2009. }
  2010. return $replace.call(replacement, symbols, function(match, ch) {
  2011. var capture;
  2012. switch (ch.charAt(0)) {
  2013. case "$":
  2014. return "$";
  2015. case "&":
  2016. return matched;
  2017. case "`":
  2018. return str.slice(0, position);
  2019. case "'":
  2020. return str.slice(tailPos);
  2021. case "<":
  2022. capture = namedCaptures[ch.slice(1, -1)];
  2023. break;
  2024. default:
  2025. var n = +ch;
  2026. if (n === 0)
  2027. return match;
  2028. if (n > m) {
  2029. var f = floor(n / 10);
  2030. if (f === 0)
  2031. return match;
  2032. if (f <= m)
  2033. return captures[f - 1] === void 0 ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
  2034. return match;
  2035. }
  2036. capture = captures[n - 1];
  2037. }
  2038. return capture === void 0 ? "" : capture;
  2039. });
  2040. }
  2041. });
  2042. }
  2043. ),
  2044. /***/
  2045. "aa77": (
  2046. /***/
  2047. function(module2, exports2, __webpack_require__) {
  2048. var $export = __webpack_require__("5ca1");
  2049. var defined = __webpack_require__("be13");
  2050. var fails = __webpack_require__("79e5");
  2051. var spaces = __webpack_require__("fdef");
  2052. var space = "[" + spaces + "]";
  2053. var non = "​…";
  2054. var ltrim = RegExp("^" + space + space + "*");
  2055. var rtrim = RegExp(space + space + "*$");
  2056. var exporter = function(KEY, exec, ALIAS) {
  2057. var exp = {};
  2058. var FORCE = fails(function() {
  2059. return !!spaces[KEY]() || non[KEY]() != non;
  2060. });
  2061. var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY];
  2062. if (ALIAS)
  2063. exp[ALIAS] = fn;
  2064. $export($export.P + $export.F * FORCE, "String", exp);
  2065. };
  2066. var trim = exporter.trim = function(string, TYPE) {
  2067. string = String(defined(string));
  2068. if (TYPE & 1)
  2069. string = string.replace(ltrim, "");
  2070. if (TYPE & 2)
  2071. string = string.replace(rtrim, "");
  2072. return string;
  2073. };
  2074. module2.exports = exporter;
  2075. }
  2076. ),
  2077. /***/
  2078. "abb4": (
  2079. /***/
  2080. function(module2, exports2, __webpack_require__) {
  2081. "use strict";
  2082. module2.exports = function(quiet) {
  2083. function noop() {
  2084. }
  2085. var reporter = {
  2086. log: noop,
  2087. warn: noop,
  2088. error: noop
  2089. };
  2090. if (!quiet && window.console) {
  2091. var attachFunction = function(reporter2, name) {
  2092. reporter2[name] = function reporterProxy() {
  2093. var f = console[name];
  2094. if (f.apply) {
  2095. f.apply(console, arguments);
  2096. } else {
  2097. for (var i = 0; i < arguments.length; i++) {
  2098. f(arguments[i]);
  2099. }
  2100. }
  2101. };
  2102. };
  2103. attachFunction(reporter, "log");
  2104. attachFunction(reporter, "warn");
  2105. attachFunction(reporter, "error");
  2106. }
  2107. return reporter;
  2108. };
  2109. }
  2110. ),
  2111. /***/
  2112. "ac6a": (
  2113. /***/
  2114. function(module2, exports2, __webpack_require__) {
  2115. var $iterators = __webpack_require__("cadf");
  2116. var getKeys = __webpack_require__("0d58");
  2117. var redefine = __webpack_require__("2aba");
  2118. var global = __webpack_require__("7726");
  2119. var hide = __webpack_require__("32e9");
  2120. var Iterators = __webpack_require__("84f2");
  2121. var wks = __webpack_require__("2b4c");
  2122. var ITERATOR = wks("iterator");
  2123. var TO_STRING_TAG = wks("toStringTag");
  2124. var ArrayValues = Iterators.Array;
  2125. var DOMIterables = {
  2126. CSSRuleList: true,
  2127. // TODO: Not spec compliant, should be false.
  2128. CSSStyleDeclaration: false,
  2129. CSSValueList: false,
  2130. ClientRectList: false,
  2131. DOMRectList: false,
  2132. DOMStringList: false,
  2133. DOMTokenList: true,
  2134. DataTransferItemList: false,
  2135. FileList: false,
  2136. HTMLAllCollection: false,
  2137. HTMLCollection: false,
  2138. HTMLFormElement: false,
  2139. HTMLSelectElement: false,
  2140. MediaList: true,
  2141. // TODO: Not spec compliant, should be false.
  2142. MimeTypeArray: false,
  2143. NamedNodeMap: false,
  2144. NodeList: true,
  2145. PaintRequestList: false,
  2146. Plugin: false,
  2147. PluginArray: false,
  2148. SVGLengthList: false,
  2149. SVGNumberList: false,
  2150. SVGPathSegList: false,
  2151. SVGPointList: false,
  2152. SVGStringList: false,
  2153. SVGTransformList: false,
  2154. SourceBufferList: false,
  2155. StyleSheetList: true,
  2156. // TODO: Not spec compliant, should be false.
  2157. TextTrackCueList: false,
  2158. TextTrackList: false,
  2159. TouchList: false
  2160. };
  2161. for (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) {
  2162. var NAME = collections[i];
  2163. var explicit = DOMIterables[NAME];
  2164. var Collection = global[NAME];
  2165. var proto = Collection && Collection.prototype;
  2166. var key;
  2167. if (proto) {
  2168. if (!proto[ITERATOR])
  2169. hide(proto, ITERATOR, ArrayValues);
  2170. if (!proto[TO_STRING_TAG])
  2171. hide(proto, TO_STRING_TAG, NAME);
  2172. Iterators[NAME] = ArrayValues;
  2173. if (explicit) {
  2174. for (key in $iterators)
  2175. if (!proto[key])
  2176. redefine(proto, key, $iterators[key], true);
  2177. }
  2178. }
  2179. }
  2180. }
  2181. ),
  2182. /***/
  2183. "b0c5": (
  2184. /***/
  2185. function(module2, exports2, __webpack_require__) {
  2186. "use strict";
  2187. var regexpExec = __webpack_require__("520a");
  2188. __webpack_require__("5ca1")({
  2189. target: "RegExp",
  2190. proto: true,
  2191. forced: regexpExec !== /./.exec
  2192. }, {
  2193. exec: regexpExec
  2194. });
  2195. }
  2196. ),
  2197. /***/
  2198. "b770": (
  2199. /***/
  2200. function(module2, exports2, __webpack_require__) {
  2201. "use strict";
  2202. var utils = module2.exports = {};
  2203. utils.forEach = function(collection, callback) {
  2204. for (var i = 0; i < collection.length; i++) {
  2205. var result = callback(collection[i]);
  2206. if (result) {
  2207. return result;
  2208. }
  2209. }
  2210. };
  2211. }
  2212. ),
  2213. /***/
  2214. "be13": (
  2215. /***/
  2216. function(module2, exports2) {
  2217. module2.exports = function(it) {
  2218. if (it == void 0)
  2219. throw TypeError("Can't call method on " + it);
  2220. return it;
  2221. };
  2222. }
  2223. ),
  2224. /***/
  2225. "c274": (
  2226. /***/
  2227. function(module2, exports2, __webpack_require__) {
  2228. "use strict";
  2229. var utils = __webpack_require__("50bf");
  2230. module2.exports = function batchProcessorMaker(options) {
  2231. options = options || {};
  2232. var reporter = options.reporter;
  2233. var asyncProcess = utils.getOption(options, "async", true);
  2234. var autoProcess = utils.getOption(options, "auto", true);
  2235. if (autoProcess && !asyncProcess) {
  2236. reporter && reporter.warn("Invalid options combination. auto=true and async=false is invalid. Setting async=true.");
  2237. asyncProcess = true;
  2238. }
  2239. var batch = Batch();
  2240. var asyncFrameHandler;
  2241. var isProcessing = false;
  2242. function addFunction(level, fn) {
  2243. if (!isProcessing && autoProcess && asyncProcess && batch.size() === 0) {
  2244. processBatchAsync();
  2245. }
  2246. batch.add(level, fn);
  2247. }
  2248. function processBatch() {
  2249. isProcessing = true;
  2250. while (batch.size()) {
  2251. var processingBatch = batch;
  2252. batch = Batch();
  2253. processingBatch.process();
  2254. }
  2255. isProcessing = false;
  2256. }
  2257. function forceProcessBatch(localAsyncProcess) {
  2258. if (isProcessing) {
  2259. return;
  2260. }
  2261. if (localAsyncProcess === void 0) {
  2262. localAsyncProcess = asyncProcess;
  2263. }
  2264. if (asyncFrameHandler) {
  2265. cancelFrame(asyncFrameHandler);
  2266. asyncFrameHandler = null;
  2267. }
  2268. if (localAsyncProcess) {
  2269. processBatchAsync();
  2270. } else {
  2271. processBatch();
  2272. }
  2273. }
  2274. function processBatchAsync() {
  2275. asyncFrameHandler = requestFrame(processBatch);
  2276. }
  2277. function clearBatch() {
  2278. batch = {};
  2279. batchSize = 0;
  2280. topLevel = 0;
  2281. bottomLevel = 0;
  2282. }
  2283. function cancelFrame(listener) {
  2284. var cancel = clearTimeout;
  2285. return cancel(listener);
  2286. }
  2287. function requestFrame(callback) {
  2288. var raf = function(fn) {
  2289. return setTimeout(fn, 0);
  2290. };
  2291. return raf(callback);
  2292. }
  2293. return {
  2294. add: addFunction,
  2295. force: forceProcessBatch
  2296. };
  2297. };
  2298. function Batch() {
  2299. var batch = {};
  2300. var size = 0;
  2301. var topLevel2 = 0;
  2302. var bottomLevel2 = 0;
  2303. function add(level, fn) {
  2304. if (!fn) {
  2305. fn = level;
  2306. level = 0;
  2307. }
  2308. if (level > topLevel2) {
  2309. topLevel2 = level;
  2310. } else if (level < bottomLevel2) {
  2311. bottomLevel2 = level;
  2312. }
  2313. if (!batch[level]) {
  2314. batch[level] = [];
  2315. }
  2316. batch[level].push(fn);
  2317. size++;
  2318. }
  2319. function process() {
  2320. for (var level = bottomLevel2; level <= topLevel2; level++) {
  2321. var fns = batch[level];
  2322. for (var i = 0; i < fns.length; i++) {
  2323. var fn = fns[i];
  2324. fn();
  2325. }
  2326. }
  2327. }
  2328. function getSize() {
  2329. return size;
  2330. }
  2331. return {
  2332. add,
  2333. process,
  2334. size: getSize
  2335. };
  2336. }
  2337. }
  2338. ),
  2339. /***/
  2340. "c366": (
  2341. /***/
  2342. function(module2, exports2, __webpack_require__) {
  2343. var toIObject = __webpack_require__("6821");
  2344. var toLength = __webpack_require__("9def");
  2345. var toAbsoluteIndex = __webpack_require__("77f1");
  2346. module2.exports = function(IS_INCLUDES) {
  2347. return function($this, el, fromIndex) {
  2348. var O = toIObject($this);
  2349. var length = toLength(O.length);
  2350. var index = toAbsoluteIndex(fromIndex, length);
  2351. var value;
  2352. if (IS_INCLUDES && el != el)
  2353. while (length > index) {
  2354. value = O[index++];
  2355. if (value != value)
  2356. return true;
  2357. }
  2358. else
  2359. for (; length > index; index++)
  2360. if (IS_INCLUDES || index in O) {
  2361. if (O[index] === el)
  2362. return IS_INCLUDES || index || 0;
  2363. }
  2364. return !IS_INCLUDES && -1;
  2365. };
  2366. };
  2367. }
  2368. ),
  2369. /***/
  2370. "c541": (
  2371. /***/
  2372. function(module2, exports2, __webpack_require__) {
  2373. var content = __webpack_require__("493e");
  2374. if (typeof content === "string")
  2375. content = [[module2.i, content, ""]];
  2376. if (content.locals)
  2377. module2.exports = content.locals;
  2378. var add = __webpack_require__("499e").default;
  2379. var update = add("40158674", content, true, { "sourceMap": false, "shadowMode": false });
  2380. }
  2381. ),
  2382. /***/
  2383. "c5f6": (
  2384. /***/
  2385. function(module2, exports2, __webpack_require__) {
  2386. "use strict";
  2387. var global = __webpack_require__("7726");
  2388. var has = __webpack_require__("69a8");
  2389. var cof = __webpack_require__("2d95");
  2390. var inheritIfRequired = __webpack_require__("5dbc");
  2391. var toPrimitive = __webpack_require__("6a99");
  2392. var fails = __webpack_require__("79e5");
  2393. var gOPN = __webpack_require__("9093").f;
  2394. var gOPD = __webpack_require__("11e9").f;
  2395. var dP = __webpack_require__("86cc").f;
  2396. var $trim = __webpack_require__("aa77").trim;
  2397. var NUMBER = "Number";
  2398. var $Number = global[NUMBER];
  2399. var Base = $Number;
  2400. var proto = $Number.prototype;
  2401. var BROKEN_COF = cof(__webpack_require__("2aeb")(proto)) == NUMBER;
  2402. var TRIM = "trim" in String.prototype;
  2403. var toNumber = function(argument) {
  2404. var it = toPrimitive(argument, false);
  2405. if (typeof it == "string" && it.length > 2) {
  2406. it = TRIM ? it.trim() : $trim(it, 3);
  2407. var first = it.charCodeAt(0);
  2408. var third, radix, maxCode;
  2409. if (first === 43 || first === 45) {
  2410. third = it.charCodeAt(2);
  2411. if (third === 88 || third === 120)
  2412. return NaN;
  2413. } else if (first === 48) {
  2414. switch (it.charCodeAt(1)) {
  2415. case 66:
  2416. case 98:
  2417. radix = 2;
  2418. maxCode = 49;
  2419. break;
  2420. case 79:
  2421. case 111:
  2422. radix = 8;
  2423. maxCode = 55;
  2424. break;
  2425. default:
  2426. return +it;
  2427. }
  2428. for (var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++) {
  2429. code = digits.charCodeAt(i);
  2430. if (code < 48 || code > maxCode)
  2431. return NaN;
  2432. }
  2433. return parseInt(digits, radix);
  2434. }
  2435. }
  2436. return +it;
  2437. };
  2438. if (!$Number(" 0o1") || !$Number("0b1") || $Number("+0x1")) {
  2439. $Number = function Number2(value) {
  2440. var it = arguments.length < 1 ? 0 : value;
  2441. var that = this;
  2442. return that instanceof $Number && (BROKEN_COF ? fails(function() {
  2443. proto.valueOf.call(that);
  2444. }) : cof(that) != NUMBER) ? inheritIfRequired(new Base(toNumber(it)), that, $Number) : toNumber(it);
  2445. };
  2446. for (var keys = __webpack_require__("9e1e") ? gOPN(Base) : (
  2447. // ES3:
  2448. "MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(",")
  2449. ), j = 0, key; keys.length > j; j++) {
  2450. if (has(Base, key = keys[j]) && !has($Number, key)) {
  2451. dP($Number, key, gOPD(Base, key));
  2452. }
  2453. }
  2454. $Number.prototype = proto;
  2455. proto.constructor = $Number;
  2456. __webpack_require__("2aba")(global, NUMBER, $Number);
  2457. }
  2458. }
  2459. ),
  2460. /***/
  2461. "c69a": (
  2462. /***/
  2463. function(module2, exports2, __webpack_require__) {
  2464. module2.exports = !__webpack_require__("9e1e") && !__webpack_require__("79e5")(function() {
  2465. return Object.defineProperty(__webpack_require__("230e")("div"), "a", { get: function() {
  2466. return 7;
  2467. } }).a != 7;
  2468. });
  2469. }
  2470. ),
  2471. /***/
  2472. "c946": (
  2473. /***/
  2474. function(module2, exports2, __webpack_require__) {
  2475. "use strict";
  2476. var forEach = __webpack_require__("b770").forEach;
  2477. module2.exports = function(options) {
  2478. options = options || {};
  2479. var reporter = options.reporter;
  2480. var batchProcessor = options.batchProcessor;
  2481. var getState = options.stateHandler.getState;
  2482. var hasState = options.stateHandler.hasState;
  2483. var idHandler = options.idHandler;
  2484. if (!batchProcessor) {
  2485. throw new Error("Missing required dependency: batchProcessor");
  2486. }
  2487. if (!reporter) {
  2488. throw new Error("Missing required dependency: reporter.");
  2489. }
  2490. var scrollbarSizes = getScrollbarSizes();
  2491. var styleId = "erd_scroll_detection_scrollbar_style";
  2492. var detectionContainerClass = "erd_scroll_detection_container";
  2493. function initDocument(targetDocument) {
  2494. injectScrollStyle(targetDocument, styleId, detectionContainerClass);
  2495. }
  2496. initDocument(window.document);
  2497. function buildCssTextString(rules) {
  2498. var seperator = options.important ? " !important; " : "; ";
  2499. return (rules.join(seperator) + seperator).trim();
  2500. }
  2501. function getScrollbarSizes() {
  2502. var width = 500;
  2503. var height = 500;
  2504. var child = document.createElement("div");
  2505. child.style.cssText = buildCssTextString(["position: absolute", "width: " + width * 2 + "px", "height: " + height * 2 + "px", "visibility: hidden", "margin: 0", "padding: 0"]);
  2506. var container = document.createElement("div");
  2507. container.style.cssText = buildCssTextString(["position: absolute", "width: " + width + "px", "height: " + height + "px", "overflow: scroll", "visibility: none", "top: " + -width * 3 + "px", "left: " + -height * 3 + "px", "visibility: hidden", "margin: 0", "padding: 0"]);
  2508. container.appendChild(child);
  2509. document.body.insertBefore(container, document.body.firstChild);
  2510. var widthSize = width - container.clientWidth;
  2511. var heightSize = height - container.clientHeight;
  2512. document.body.removeChild(container);
  2513. return {
  2514. width: widthSize,
  2515. height: heightSize
  2516. };
  2517. }
  2518. function injectScrollStyle(targetDocument, styleId2, containerClass) {
  2519. function injectStyle(style2, method) {
  2520. method = method || function(element) {
  2521. targetDocument.head.appendChild(element);
  2522. };
  2523. var styleElement = targetDocument.createElement("style");
  2524. styleElement.innerHTML = style2;
  2525. styleElement.id = styleId2;
  2526. method(styleElement);
  2527. return styleElement;
  2528. }
  2529. if (!targetDocument.getElementById(styleId2)) {
  2530. var containerAnimationClass = containerClass + "_animation";
  2531. var containerAnimationActiveClass = containerClass + "_animation_active";
  2532. var style = "/* Created by the element-resize-detector library. */\n";
  2533. style += "." + containerClass + " > div::-webkit-scrollbar { " + buildCssTextString(["display: none"]) + " }\n\n";
  2534. style += "." + containerAnimationActiveClass + " { " + buildCssTextString(["-webkit-animation-duration: 0.1s", "animation-duration: 0.1s", "-webkit-animation-name: " + containerAnimationClass, "animation-name: " + containerAnimationClass]) + " }\n";
  2535. style += "@-webkit-keyframes " + containerAnimationClass + " { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }\n";
  2536. style += "@keyframes " + containerAnimationClass + " { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }";
  2537. injectStyle(style);
  2538. }
  2539. }
  2540. function addAnimationClass(element) {
  2541. element.className += " " + detectionContainerClass + "_animation_active";
  2542. }
  2543. function addEvent(el, name, cb) {
  2544. if (el.addEventListener) {
  2545. el.addEventListener(name, cb);
  2546. } else if (el.attachEvent) {
  2547. el.attachEvent("on" + name, cb);
  2548. } else {
  2549. return reporter.error("[scroll] Don't know how to add event listeners.");
  2550. }
  2551. }
  2552. function removeEvent(el, name, cb) {
  2553. if (el.removeEventListener) {
  2554. el.removeEventListener(name, cb);
  2555. } else if (el.detachEvent) {
  2556. el.detachEvent("on" + name, cb);
  2557. } else {
  2558. return reporter.error("[scroll] Don't know how to remove event listeners.");
  2559. }
  2560. }
  2561. function getExpandElement(element) {
  2562. return getState(element).container.childNodes[0].childNodes[0].childNodes[0];
  2563. }
  2564. function getShrinkElement(element) {
  2565. return getState(element).container.childNodes[0].childNodes[0].childNodes[1];
  2566. }
  2567. function addListener(element, listener) {
  2568. var listeners = getState(element).listeners;
  2569. if (!listeners.push) {
  2570. throw new Error("Cannot add listener to an element that is not detectable.");
  2571. }
  2572. getState(element).listeners.push(listener);
  2573. }
  2574. function makeDetectable(options2, element, callback) {
  2575. if (!callback) {
  2576. callback = element;
  2577. element = options2;
  2578. options2 = null;
  2579. }
  2580. options2 = options2 || {};
  2581. function debug() {
  2582. if (options2.debug) {
  2583. var args = Array.prototype.slice.call(arguments);
  2584. args.unshift(idHandler.get(element), "Scroll: ");
  2585. if (reporter.log.apply) {
  2586. reporter.log.apply(null, args);
  2587. } else {
  2588. for (var i = 0; i < args.length; i++) {
  2589. reporter.log(args[i]);
  2590. }
  2591. }
  2592. }
  2593. }
  2594. function isDetached(element2) {
  2595. function isInDocument(element3) {
  2596. return element3 === element3.ownerDocument.body || element3.ownerDocument.body.contains(element3);
  2597. }
  2598. if (!isInDocument(element2)) {
  2599. return true;
  2600. }
  2601. if (window.getComputedStyle(element2) === null) {
  2602. return true;
  2603. }
  2604. return false;
  2605. }
  2606. function isUnrendered(element2) {
  2607. var container = getState(element2).container.childNodes[0];
  2608. var style = window.getComputedStyle(container);
  2609. return !style.width || style.width.indexOf("px") === -1;
  2610. }
  2611. function getStyle() {
  2612. var elementStyle = window.getComputedStyle(element);
  2613. var style = {};
  2614. style.position = elementStyle.position;
  2615. style.width = element.offsetWidth;
  2616. style.height = element.offsetHeight;
  2617. style.top = elementStyle.top;
  2618. style.right = elementStyle.right;
  2619. style.bottom = elementStyle.bottom;
  2620. style.left = elementStyle.left;
  2621. style.widthCSS = elementStyle.width;
  2622. style.heightCSS = elementStyle.height;
  2623. return style;
  2624. }
  2625. function storeStartSize() {
  2626. var style = getStyle();
  2627. getState(element).startSize = {
  2628. width: style.width,
  2629. height: style.height
  2630. };
  2631. debug("Element start size", getState(element).startSize);
  2632. }
  2633. function initListeners() {
  2634. getState(element).listeners = [];
  2635. }
  2636. function storeStyle() {
  2637. debug("storeStyle invoked.");
  2638. if (!getState(element)) {
  2639. debug("Aborting because element has been uninstalled");
  2640. return;
  2641. }
  2642. var style = getStyle();
  2643. getState(element).style = style;
  2644. }
  2645. function storeCurrentSize(element2, width, height) {
  2646. getState(element2).lastWidth = width;
  2647. getState(element2).lastHeight = height;
  2648. }
  2649. function getExpandChildElement(element2) {
  2650. return getExpandElement(element2).childNodes[0];
  2651. }
  2652. function getWidthOffset() {
  2653. return 2 * scrollbarSizes.width + 1;
  2654. }
  2655. function getHeightOffset() {
  2656. return 2 * scrollbarSizes.height + 1;
  2657. }
  2658. function getExpandWidth(width) {
  2659. return width + 10 + getWidthOffset();
  2660. }
  2661. function getExpandHeight(height) {
  2662. return height + 10 + getHeightOffset();
  2663. }
  2664. function getShrinkWidth(width) {
  2665. return width * 2 + getWidthOffset();
  2666. }
  2667. function getShrinkHeight(height) {
  2668. return height * 2 + getHeightOffset();
  2669. }
  2670. function positionScrollbars(element2, width, height) {
  2671. var expand = getExpandElement(element2);
  2672. var shrink = getShrinkElement(element2);
  2673. var expandWidth = getExpandWidth(width);
  2674. var expandHeight = getExpandHeight(height);
  2675. var shrinkWidth = getShrinkWidth(width);
  2676. var shrinkHeight = getShrinkHeight(height);
  2677. expand.scrollLeft = expandWidth;
  2678. expand.scrollTop = expandHeight;
  2679. shrink.scrollLeft = shrinkWidth;
  2680. shrink.scrollTop = shrinkHeight;
  2681. }
  2682. function injectContainerElement() {
  2683. var container = getState(element).container;
  2684. if (!container) {
  2685. container = document.createElement("div");
  2686. container.className = detectionContainerClass;
  2687. container.style.cssText = buildCssTextString(["visibility: hidden", "display: inline", "width: 0px", "height: 0px", "z-index: -1", "overflow: hidden", "margin: 0", "padding: 0"]);
  2688. getState(element).container = container;
  2689. addAnimationClass(container);
  2690. element.appendChild(container);
  2691. var onAnimationStart = function() {
  2692. getState(element).onRendered && getState(element).onRendered();
  2693. };
  2694. addEvent(container, "animationstart", onAnimationStart);
  2695. getState(element).onAnimationStart = onAnimationStart;
  2696. }
  2697. return container;
  2698. }
  2699. function injectScrollElements() {
  2700. function alterPositionStyles() {
  2701. var style = getState(element).style;
  2702. if (style.position === "static") {
  2703. element.style.setProperty("position", "relative", options2.important ? "important" : "");
  2704. var removeRelativeStyles = function(reporter2, element2, style2, property) {
  2705. function getNumericalValue(value2) {
  2706. return value2.replace(/[^-\d\.]/g, "");
  2707. }
  2708. var value = style2[property];
  2709. if (value !== "auto" && getNumericalValue(value) !== "0") {
  2710. reporter2.warn("An element that is positioned static has style." + property + "=" + value + " which is ignored due to the static positioning. The element will need to be positioned relative, so the style." + property + " will be set to 0. Element: ", element2);
  2711. element2.style[property] = 0;
  2712. }
  2713. };
  2714. removeRelativeStyles(reporter, element, style, "top");
  2715. removeRelativeStyles(reporter, element, style, "right");
  2716. removeRelativeStyles(reporter, element, style, "bottom");
  2717. removeRelativeStyles(reporter, element, style, "left");
  2718. }
  2719. }
  2720. function getLeftTopBottomRightCssText(left, top, bottom, right) {
  2721. left = !left ? "0" : left + "px";
  2722. top = !top ? "0" : top + "px";
  2723. bottom = !bottom ? "0" : bottom + "px";
  2724. right = !right ? "0" : right + "px";
  2725. return ["left: " + left, "top: " + top, "right: " + right, "bottom: " + bottom];
  2726. }
  2727. debug("Injecting elements");
  2728. if (!getState(element)) {
  2729. debug("Aborting because element has been uninstalled");
  2730. return;
  2731. }
  2732. alterPositionStyles();
  2733. var rootContainer = getState(element).container;
  2734. if (!rootContainer) {
  2735. rootContainer = injectContainerElement();
  2736. }
  2737. var scrollbarWidth = scrollbarSizes.width;
  2738. var scrollbarHeight = scrollbarSizes.height;
  2739. var containerContainerStyle = buildCssTextString(["position: absolute", "flex: none", "overflow: hidden", "z-index: -1", "visibility: hidden", "width: 100%", "height: 100%", "left: 0px", "top: 0px"]);
  2740. var containerStyle = buildCssTextString(["position: absolute", "flex: none", "overflow: hidden", "z-index: -1", "visibility: hidden"].concat(getLeftTopBottomRightCssText(-(1 + scrollbarWidth), -(1 + scrollbarHeight), -scrollbarHeight, -scrollbarWidth)));
  2741. var expandStyle = buildCssTextString(["position: absolute", "flex: none", "overflow: scroll", "z-index: -1", "visibility: hidden", "width: 100%", "height: 100%"]);
  2742. var shrinkStyle = buildCssTextString(["position: absolute", "flex: none", "overflow: scroll", "z-index: -1", "visibility: hidden", "width: 100%", "height: 100%"]);
  2743. var expandChildStyle = buildCssTextString(["position: absolute", "left: 0", "top: 0"]);
  2744. var shrinkChildStyle = buildCssTextString(["position: absolute", "width: 200%", "height: 200%"]);
  2745. var containerContainer = document.createElement("div");
  2746. var container = document.createElement("div");
  2747. var expand = document.createElement("div");
  2748. var expandChild = document.createElement("div");
  2749. var shrink = document.createElement("div");
  2750. var shrinkChild = document.createElement("div");
  2751. containerContainer.dir = "ltr";
  2752. containerContainer.style.cssText = containerContainerStyle;
  2753. containerContainer.className = detectionContainerClass;
  2754. container.className = detectionContainerClass;
  2755. container.style.cssText = containerStyle;
  2756. expand.style.cssText = expandStyle;
  2757. expandChild.style.cssText = expandChildStyle;
  2758. shrink.style.cssText = shrinkStyle;
  2759. shrinkChild.style.cssText = shrinkChildStyle;
  2760. expand.appendChild(expandChild);
  2761. shrink.appendChild(shrinkChild);
  2762. container.appendChild(expand);
  2763. container.appendChild(shrink);
  2764. containerContainer.appendChild(container);
  2765. rootContainer.appendChild(containerContainer);
  2766. function onExpandScroll() {
  2767. getState(element).onExpand && getState(element).onExpand();
  2768. }
  2769. function onShrinkScroll() {
  2770. getState(element).onShrink && getState(element).onShrink();
  2771. }
  2772. addEvent(expand, "scroll", onExpandScroll);
  2773. addEvent(shrink, "scroll", onShrinkScroll);
  2774. getState(element).onExpandScroll = onExpandScroll;
  2775. getState(element).onShrinkScroll = onShrinkScroll;
  2776. }
  2777. function registerListenersAndPositionElements() {
  2778. function updateChildSizes(element2, width, height) {
  2779. var expandChild = getExpandChildElement(element2);
  2780. var expandWidth = getExpandWidth(width);
  2781. var expandHeight = getExpandHeight(height);
  2782. expandChild.style.setProperty("width", expandWidth + "px", options2.important ? "important" : "");
  2783. expandChild.style.setProperty("height", expandHeight + "px", options2.important ? "important" : "");
  2784. }
  2785. function updateDetectorElements(done) {
  2786. var width = element.offsetWidth;
  2787. var height = element.offsetHeight;
  2788. var sizeChanged = width !== getState(element).lastWidth || height !== getState(element).lastHeight;
  2789. debug("Storing current size", width, height);
  2790. storeCurrentSize(element, width, height);
  2791. batchProcessor.add(0, function performUpdateChildSizes() {
  2792. if (!sizeChanged) {
  2793. return;
  2794. }
  2795. if (!getState(element)) {
  2796. debug("Aborting because element has been uninstalled");
  2797. return;
  2798. }
  2799. if (!areElementsInjected()) {
  2800. debug("Aborting because element container has not been initialized");
  2801. return;
  2802. }
  2803. if (options2.debug) {
  2804. var w = element.offsetWidth;
  2805. var h = element.offsetHeight;
  2806. if (w !== width || h !== height) {
  2807. reporter.warn(idHandler.get(element), "Scroll: Size changed before updating detector elements.");
  2808. }
  2809. }
  2810. updateChildSizes(element, width, height);
  2811. });
  2812. batchProcessor.add(1, function updateScrollbars() {
  2813. if (!getState(element)) {
  2814. debug("Aborting because element has been uninstalled");
  2815. return;
  2816. }
  2817. if (!areElementsInjected()) {
  2818. debug("Aborting because element container has not been initialized");
  2819. return;
  2820. }
  2821. positionScrollbars(element, width, height);
  2822. });
  2823. if (sizeChanged && done) {
  2824. batchProcessor.add(2, function() {
  2825. if (!getState(element)) {
  2826. debug("Aborting because element has been uninstalled");
  2827. return;
  2828. }
  2829. if (!areElementsInjected()) {
  2830. debug("Aborting because element container has not been initialized");
  2831. return;
  2832. }
  2833. done();
  2834. });
  2835. }
  2836. }
  2837. function areElementsInjected() {
  2838. return !!getState(element).container;
  2839. }
  2840. function notifyListenersIfNeeded() {
  2841. function isFirstNotify() {
  2842. return getState(element).lastNotifiedWidth === void 0;
  2843. }
  2844. debug("notifyListenersIfNeeded invoked");
  2845. var state = getState(element);
  2846. if (isFirstNotify() && state.lastWidth === state.startSize.width && state.lastHeight === state.startSize.height) {
  2847. return debug("Not notifying: Size is the same as the start size, and there has been no notification yet.");
  2848. }
  2849. if (state.lastWidth === state.lastNotifiedWidth && state.lastHeight === state.lastNotifiedHeight) {
  2850. return debug("Not notifying: Size already notified");
  2851. }
  2852. debug("Current size not notified, notifying...");
  2853. state.lastNotifiedWidth = state.lastWidth;
  2854. state.lastNotifiedHeight = state.lastHeight;
  2855. forEach(getState(element).listeners, function(listener) {
  2856. listener(element);
  2857. });
  2858. }
  2859. function handleRender() {
  2860. debug("startanimation triggered.");
  2861. if (isUnrendered(element)) {
  2862. debug("Ignoring since element is still unrendered...");
  2863. return;
  2864. }
  2865. debug("Element rendered.");
  2866. var expand = getExpandElement(element);
  2867. var shrink = getShrinkElement(element);
  2868. if (expand.scrollLeft === 0 || expand.scrollTop === 0 || shrink.scrollLeft === 0 || shrink.scrollTop === 0) {
  2869. debug("Scrollbars out of sync. Updating detector elements...");
  2870. updateDetectorElements(notifyListenersIfNeeded);
  2871. }
  2872. }
  2873. function handleScroll() {
  2874. debug("Scroll detected.");
  2875. if (isUnrendered(element)) {
  2876. debug("Scroll event fired while unrendered. Ignoring...");
  2877. return;
  2878. }
  2879. updateDetectorElements(notifyListenersIfNeeded);
  2880. }
  2881. debug("registerListenersAndPositionElements invoked.");
  2882. if (!getState(element)) {
  2883. debug("Aborting because element has been uninstalled");
  2884. return;
  2885. }
  2886. getState(element).onRendered = handleRender;
  2887. getState(element).onExpand = handleScroll;
  2888. getState(element).onShrink = handleScroll;
  2889. var style = getState(element).style;
  2890. updateChildSizes(element, style.width, style.height);
  2891. }
  2892. function finalizeDomMutation() {
  2893. debug("finalizeDomMutation invoked.");
  2894. if (!getState(element)) {
  2895. debug("Aborting because element has been uninstalled");
  2896. return;
  2897. }
  2898. var style = getState(element).style;
  2899. storeCurrentSize(element, style.width, style.height);
  2900. positionScrollbars(element, style.width, style.height);
  2901. }
  2902. function ready() {
  2903. callback(element);
  2904. }
  2905. function install() {
  2906. debug("Installing...");
  2907. initListeners();
  2908. storeStartSize();
  2909. batchProcessor.add(0, storeStyle);
  2910. batchProcessor.add(1, injectScrollElements);
  2911. batchProcessor.add(2, registerListenersAndPositionElements);
  2912. batchProcessor.add(3, finalizeDomMutation);
  2913. batchProcessor.add(4, ready);
  2914. }
  2915. debug("Making detectable...");
  2916. if (isDetached(element)) {
  2917. debug("Element is detached");
  2918. injectContainerElement();
  2919. debug("Waiting until element is attached...");
  2920. getState(element).onRendered = function() {
  2921. debug("Element is now attached");
  2922. install();
  2923. };
  2924. } else {
  2925. install();
  2926. }
  2927. }
  2928. function uninstall(element) {
  2929. var state = getState(element);
  2930. if (!state) {
  2931. return;
  2932. }
  2933. state.onExpandScroll && removeEvent(getExpandElement(element), "scroll", state.onExpandScroll);
  2934. state.onShrinkScroll && removeEvent(getShrinkElement(element), "scroll", state.onShrinkScroll);
  2935. state.onAnimationStart && removeEvent(state.container, "animationstart", state.onAnimationStart);
  2936. state.container && element.removeChild(state.container);
  2937. }
  2938. return {
  2939. makeDetectable,
  2940. addListener,
  2941. uninstall,
  2942. initDocument
  2943. };
  2944. };
  2945. }
  2946. ),
  2947. /***/
  2948. "ca5a": (
  2949. /***/
  2950. function(module2, exports2) {
  2951. var id = 0;
  2952. var px = Math.random();
  2953. module2.exports = function(key) {
  2954. return "Symbol(".concat(key === void 0 ? "" : key, ")_", (++id + px).toString(36));
  2955. };
  2956. }
  2957. ),
  2958. /***/
  2959. "cadf": (
  2960. /***/
  2961. function(module2, exports2, __webpack_require__) {
  2962. "use strict";
  2963. var addToUnscopables = __webpack_require__("9c6c");
  2964. var step = __webpack_require__("d53b");
  2965. var Iterators = __webpack_require__("84f2");
  2966. var toIObject = __webpack_require__("6821");
  2967. module2.exports = __webpack_require__("01f9")(Array, "Array", function(iterated, kind) {
  2968. this._t = toIObject(iterated);
  2969. this._i = 0;
  2970. this._k = kind;
  2971. }, function() {
  2972. var O = this._t;
  2973. var kind = this._k;
  2974. var index = this._i++;
  2975. if (!O || index >= O.length) {
  2976. this._t = void 0;
  2977. return step(1);
  2978. }
  2979. if (kind == "keys")
  2980. return step(0, index);
  2981. if (kind == "values")
  2982. return step(0, O[index]);
  2983. return step(0, [index, O[index]]);
  2984. }, "values");
  2985. Iterators.Arguments = Iterators.Array;
  2986. addToUnscopables("keys");
  2987. addToUnscopables("values");
  2988. addToUnscopables("entries");
  2989. }
  2990. ),
  2991. /***/
  2992. "cb7c": (
  2993. /***/
  2994. function(module2, exports2, __webpack_require__) {
  2995. var isObject = __webpack_require__("d3f4");
  2996. module2.exports = function(it) {
  2997. if (!isObject(it))
  2998. throw TypeError(it + " is not an object!");
  2999. return it;
  3000. };
  3001. }
  3002. ),
  3003. /***/
  3004. "ce10": (
  3005. /***/
  3006. function(module2, exports2, __webpack_require__) {
  3007. var has = __webpack_require__("69a8");
  3008. var toIObject = __webpack_require__("6821");
  3009. var arrayIndexOf = __webpack_require__("c366")(false);
  3010. var IE_PROTO = __webpack_require__("613b")("IE_PROTO");
  3011. module2.exports = function(object, names) {
  3012. var O = toIObject(object);
  3013. var i = 0;
  3014. var result = [];
  3015. var key;
  3016. for (key in O)
  3017. if (key != IE_PROTO)
  3018. has(O, key) && result.push(key);
  3019. while (names.length > i)
  3020. if (has(O, key = names[i++])) {
  3021. ~arrayIndexOf(result, key) || result.push(key);
  3022. }
  3023. return result;
  3024. };
  3025. }
  3026. ),
  3027. /***/
  3028. "d3f4": (
  3029. /***/
  3030. function(module2, exports2) {
  3031. module2.exports = function(it) {
  3032. return typeof it === "object" ? it !== null : typeof it === "function";
  3033. };
  3034. }
  3035. ),
  3036. /***/
  3037. "d53b": (
  3038. /***/
  3039. function(module2, exports2) {
  3040. module2.exports = function(done, value) {
  3041. return { value, done: !!done };
  3042. };
  3043. }
  3044. ),
  3045. /***/
  3046. "d6eb": (
  3047. /***/
  3048. function(module2, exports2, __webpack_require__) {
  3049. "use strict";
  3050. var prop = "_erd";
  3051. function initState(element) {
  3052. element[prop] = {};
  3053. return getState(element);
  3054. }
  3055. function getState(element) {
  3056. return element[prop];
  3057. }
  3058. function cleanState(element) {
  3059. delete element[prop];
  3060. }
  3061. module2.exports = {
  3062. initState,
  3063. getState,
  3064. cleanState
  3065. };
  3066. }
  3067. ),
  3068. /***/
  3069. "d8e8": (
  3070. /***/
  3071. function(module2, exports2) {
  3072. module2.exports = function(it) {
  3073. if (typeof it != "function")
  3074. throw TypeError(it + " is not a function!");
  3075. return it;
  3076. };
  3077. }
  3078. ),
  3079. /***/
  3080. "e11e": (
  3081. /***/
  3082. function(module2, exports2) {
  3083. module2.exports = "constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",");
  3084. }
  3085. ),
  3086. /***/
  3087. "eec4": (
  3088. /***/
  3089. function(module2, exports2, __webpack_require__) {
  3090. "use strict";
  3091. var forEach = __webpack_require__("b770").forEach;
  3092. var elementUtilsMaker = __webpack_require__("5be5");
  3093. var listenerHandlerMaker = __webpack_require__("49ad");
  3094. var idGeneratorMaker = __webpack_require__("2cef");
  3095. var idHandlerMaker = __webpack_require__("5058");
  3096. var reporterMaker = __webpack_require__("abb4");
  3097. var browserDetector = __webpack_require__("18e9");
  3098. var batchProcessorMaker = __webpack_require__("c274");
  3099. var stateHandler = __webpack_require__("d6eb");
  3100. var objectStrategyMaker = __webpack_require__("18d2");
  3101. var scrollStrategyMaker = __webpack_require__("c946");
  3102. function isCollection(obj) {
  3103. return Array.isArray(obj) || obj.length !== void 0;
  3104. }
  3105. function toArray(collection) {
  3106. if (!Array.isArray(collection)) {
  3107. var array = [];
  3108. forEach(collection, function(obj) {
  3109. array.push(obj);
  3110. });
  3111. return array;
  3112. } else {
  3113. return collection;
  3114. }
  3115. }
  3116. function isElement(obj) {
  3117. return obj && obj.nodeType === 1;
  3118. }
  3119. module2.exports = function(options) {
  3120. options = options || {};
  3121. var idHandler;
  3122. if (options.idHandler) {
  3123. idHandler = {
  3124. get: function(element) {
  3125. return options.idHandler.get(element, true);
  3126. },
  3127. set: options.idHandler.set
  3128. };
  3129. } else {
  3130. var idGenerator = idGeneratorMaker();
  3131. var defaultIdHandler = idHandlerMaker({
  3132. idGenerator,
  3133. stateHandler
  3134. });
  3135. idHandler = defaultIdHandler;
  3136. }
  3137. var reporter = options.reporter;
  3138. if (!reporter) {
  3139. var quiet = reporter === false;
  3140. reporter = reporterMaker(quiet);
  3141. }
  3142. var batchProcessor = getOption(options, "batchProcessor", batchProcessorMaker({ reporter }));
  3143. var globalOptions = {};
  3144. globalOptions.callOnAdd = !!getOption(options, "callOnAdd", true);
  3145. globalOptions.debug = !!getOption(options, "debug", false);
  3146. var eventListenerHandler = listenerHandlerMaker(idHandler);
  3147. var elementUtils = elementUtilsMaker({
  3148. stateHandler
  3149. });
  3150. var detectionStrategy;
  3151. var desiredStrategy = getOption(options, "strategy", "object");
  3152. var importantCssRules = getOption(options, "important", false);
  3153. var strategyOptions = {
  3154. reporter,
  3155. batchProcessor,
  3156. stateHandler,
  3157. idHandler,
  3158. important: importantCssRules
  3159. };
  3160. if (desiredStrategy === "scroll") {
  3161. if (browserDetector.isLegacyOpera()) {
  3162. reporter.warn("Scroll strategy is not supported on legacy Opera. Changing to object strategy.");
  3163. desiredStrategy = "object";
  3164. } else if (browserDetector.isIE(9)) {
  3165. reporter.warn("Scroll strategy is not supported on IE9. Changing to object strategy.");
  3166. desiredStrategy = "object";
  3167. }
  3168. }
  3169. if (desiredStrategy === "scroll") {
  3170. detectionStrategy = scrollStrategyMaker(strategyOptions);
  3171. } else if (desiredStrategy === "object") {
  3172. detectionStrategy = objectStrategyMaker(strategyOptions);
  3173. } else {
  3174. throw new Error("Invalid strategy name: " + desiredStrategy);
  3175. }
  3176. var onReadyCallbacks = {};
  3177. function listenTo(options2, elements, listener) {
  3178. function onResizeCallback(element) {
  3179. var listeners = eventListenerHandler.get(element);
  3180. forEach(listeners, function callListenerProxy(listener2) {
  3181. listener2(element);
  3182. });
  3183. }
  3184. function addListener(callOnAdd2, element, listener2) {
  3185. eventListenerHandler.add(element, listener2);
  3186. if (callOnAdd2) {
  3187. listener2(element);
  3188. }
  3189. }
  3190. if (!listener) {
  3191. listener = elements;
  3192. elements = options2;
  3193. options2 = {};
  3194. }
  3195. if (!elements) {
  3196. throw new Error("At least one element required.");
  3197. }
  3198. if (!listener) {
  3199. throw new Error("Listener required.");
  3200. }
  3201. if (isElement(elements)) {
  3202. elements = [elements];
  3203. } else if (isCollection(elements)) {
  3204. elements = toArray(elements);
  3205. } else {
  3206. return reporter.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");
  3207. }
  3208. var elementsReady = 0;
  3209. var callOnAdd = getOption(options2, "callOnAdd", globalOptions.callOnAdd);
  3210. var onReadyCallback = getOption(options2, "onReady", function noop() {
  3211. });
  3212. var debug = getOption(options2, "debug", globalOptions.debug);
  3213. forEach(elements, function attachListenerToElement(element) {
  3214. if (!stateHandler.getState(element)) {
  3215. stateHandler.initState(element);
  3216. idHandler.set(element);
  3217. }
  3218. var id = idHandler.get(element);
  3219. debug && reporter.log("Attaching listener to element", id, element);
  3220. if (!elementUtils.isDetectable(element)) {
  3221. debug && reporter.log(id, "Not detectable.");
  3222. if (elementUtils.isBusy(element)) {
  3223. debug && reporter.log(id, "System busy making it detectable");
  3224. addListener(callOnAdd, element, listener);
  3225. onReadyCallbacks[id] = onReadyCallbacks[id] || [];
  3226. onReadyCallbacks[id].push(function onReady() {
  3227. elementsReady++;
  3228. if (elementsReady === elements.length) {
  3229. onReadyCallback();
  3230. }
  3231. });
  3232. return;
  3233. }
  3234. debug && reporter.log(id, "Making detectable...");
  3235. elementUtils.markBusy(element, true);
  3236. return detectionStrategy.makeDetectable({ debug, important: importantCssRules }, element, function onElementDetectable(element2) {
  3237. debug && reporter.log(id, "onElementDetectable");
  3238. if (stateHandler.getState(element2)) {
  3239. elementUtils.markAsDetectable(element2);
  3240. elementUtils.markBusy(element2, false);
  3241. detectionStrategy.addListener(element2, onResizeCallback);
  3242. addListener(callOnAdd, element2, listener);
  3243. var state = stateHandler.getState(element2);
  3244. if (state && state.startSize) {
  3245. var width = element2.offsetWidth;
  3246. var height = element2.offsetHeight;
  3247. if (state.startSize.width !== width || state.startSize.height !== height) {
  3248. onResizeCallback(element2);
  3249. }
  3250. }
  3251. if (onReadyCallbacks[id]) {
  3252. forEach(onReadyCallbacks[id], function(callback) {
  3253. callback();
  3254. });
  3255. }
  3256. } else {
  3257. debug && reporter.log(id, "Element uninstalled before being detectable.");
  3258. }
  3259. delete onReadyCallbacks[id];
  3260. elementsReady++;
  3261. if (elementsReady === elements.length) {
  3262. onReadyCallback();
  3263. }
  3264. });
  3265. }
  3266. debug && reporter.log(id, "Already detecable, adding listener.");
  3267. addListener(callOnAdd, element, listener);
  3268. elementsReady++;
  3269. });
  3270. if (elementsReady === elements.length) {
  3271. onReadyCallback();
  3272. }
  3273. }
  3274. function uninstall(elements) {
  3275. if (!elements) {
  3276. return reporter.error("At least one element is required.");
  3277. }
  3278. if (isElement(elements)) {
  3279. elements = [elements];
  3280. } else if (isCollection(elements)) {
  3281. elements = toArray(elements);
  3282. } else {
  3283. return reporter.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");
  3284. }
  3285. forEach(elements, function(element) {
  3286. eventListenerHandler.removeAllListeners(element);
  3287. detectionStrategy.uninstall(element);
  3288. stateHandler.cleanState(element);
  3289. });
  3290. }
  3291. function initDocument(targetDocument) {
  3292. detectionStrategy.initDocument && detectionStrategy.initDocument(targetDocument);
  3293. }
  3294. return {
  3295. listenTo,
  3296. removeListener: eventListenerHandler.removeListener,
  3297. removeAllListeners: eventListenerHandler.removeAllListeners,
  3298. uninstall,
  3299. initDocument
  3300. };
  3301. };
  3302. function getOption(options, name, defaultValue) {
  3303. var value = options[name];
  3304. if ((value === void 0 || value === null) && defaultValue !== void 0) {
  3305. return defaultValue;
  3306. }
  3307. return value;
  3308. }
  3309. }
  3310. ),
  3311. /***/
  3312. "f1ae": (
  3313. /***/
  3314. function(module2, exports2, __webpack_require__) {
  3315. "use strict";
  3316. var $defineProperty = __webpack_require__("86cc");
  3317. var createDesc = __webpack_require__("4630");
  3318. module2.exports = function(object, index, value) {
  3319. if (index in object)
  3320. $defineProperty.f(object, index, createDesc(0, value));
  3321. else
  3322. object[index] = value;
  3323. };
  3324. }
  3325. ),
  3326. /***/
  3327. "f751": (
  3328. /***/
  3329. function(module2, exports2, __webpack_require__) {
  3330. var $export = __webpack_require__("5ca1");
  3331. $export($export.S + $export.F, "Object", { assign: __webpack_require__("7333") });
  3332. }
  3333. ),
  3334. /***/
  3335. "fa5b": (
  3336. /***/
  3337. function(module2, exports2, __webpack_require__) {
  3338. module2.exports = __webpack_require__("5537")("native-function-to-string", Function.toString);
  3339. }
  3340. ),
  3341. /***/
  3342. "fab2": (
  3343. /***/
  3344. function(module2, exports2, __webpack_require__) {
  3345. var document2 = __webpack_require__("7726").document;
  3346. module2.exports = document2 && document2.documentElement;
  3347. }
  3348. ),
  3349. /***/
  3350. "fb15": (
  3351. /***/
  3352. function(module2, __webpack_exports__, __webpack_require__) {
  3353. "use strict";
  3354. __webpack_require__.r(__webpack_exports__);
  3355. __webpack_require__.d(__webpack_exports__, "GridLayout", function() {
  3356. return (
  3357. /* reexport */
  3358. GridLayout
  3359. );
  3360. });
  3361. __webpack_require__.d(__webpack_exports__, "GridItem", function() {
  3362. return (
  3363. /* reexport */
  3364. GridItem
  3365. );
  3366. });
  3367. var all_namespaceObject = {};
  3368. __webpack_require__.r(all_namespaceObject);
  3369. __webpack_require__.d(all_namespaceObject, "edgeTarget", function() {
  3370. return edgeTarget;
  3371. });
  3372. __webpack_require__.d(all_namespaceObject, "elements", function() {
  3373. return snappers_elements;
  3374. });
  3375. __webpack_require__.d(all_namespaceObject, "grid", function() {
  3376. return grid;
  3377. });
  3378. if (typeof window !== "undefined") {
  3379. var currentScript = window.document.currentScript;
  3380. if (true) {
  3381. var getCurrentScript = __webpack_require__("8875");
  3382. currentScript = getCurrentScript();
  3383. if (!("currentScript" in document)) {
  3384. Object.defineProperty(document, "currentScript", { get: getCurrentScript });
  3385. }
  3386. }
  3387. var src = currentScript && currentScript.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);
  3388. if (src) {
  3389. __webpack_require__.p = src[1];
  3390. }
  3391. }
  3392. var setPublicPath = null;
  3393. var external_commonjs_vue_commonjs2_vue_root_Vue_ = __webpack_require__("8bbf");
  3394. function render(_ctx, _cache, $props, $setup, $data, $options) {
  3395. return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])("div", {
  3396. ref: "item",
  3397. class: ["vue-grid-item", $options.classObj],
  3398. style: _ctx.style
  3399. }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderSlot"])(_ctx.$slots, "default"), $options.resizableAndNotStatic ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])("span", {
  3400. key: 0,
  3401. ref: "handle",
  3402. class: $options.resizableHandleClass
  3403. }, null, 2)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)], 6);
  3404. }
  3405. var es6_regexp_replace = __webpack_require__("a481");
  3406. var es6_regexp_match = __webpack_require__("4917");
  3407. var es6_number_constructor = __webpack_require__("c5f6");
  3408. var es6_array_iterator = __webpack_require__("cadf");
  3409. var es6_object_keys = __webpack_require__("456d");
  3410. var web_dom_iterable = __webpack_require__("ac6a");
  3411. var es6_array_sort = __webpack_require__("55dd");
  3412. function bottom(layout) {
  3413. var max = 0, bottomY;
  3414. for (var i = 0, len = layout.length; i < len; i++) {
  3415. bottomY = layout[i].y + layout[i].h;
  3416. if (bottomY > max)
  3417. max = bottomY;
  3418. }
  3419. return max;
  3420. }
  3421. function cloneLayout(layout) {
  3422. var newLayout = Array(layout.length);
  3423. for (var i = 0, len = layout.length; i < len; i++) {
  3424. newLayout[i] = cloneLayoutItem(layout[i]);
  3425. }
  3426. return newLayout;
  3427. }
  3428. function cloneLayoutItem(layoutItem) {
  3429. return JSON.parse(JSON.stringify(layoutItem));
  3430. }
  3431. function collides(l1, l2) {
  3432. if (l1 === l2)
  3433. return false;
  3434. if (l1.x + l1.w <= l2.x)
  3435. return false;
  3436. if (l1.x >= l2.x + l2.w)
  3437. return false;
  3438. if (l1.y + l1.h <= l2.y)
  3439. return false;
  3440. if (l1.y >= l2.y + l2.h)
  3441. return false;
  3442. return true;
  3443. }
  3444. function compact(layout, verticalCompact) {
  3445. var compareWith = getStatics(layout);
  3446. var sorted = sortLayoutItemsByRowCol(layout);
  3447. var out = Array(layout.length);
  3448. for (var i = 0, len = sorted.length; i < len; i++) {
  3449. var l = sorted[i];
  3450. if (!l.static) {
  3451. l = compactItem(compareWith, l, verticalCompact);
  3452. compareWith.push(l);
  3453. }
  3454. out[layout.indexOf(l)] = l;
  3455. l.moved = false;
  3456. }
  3457. return out;
  3458. }
  3459. function compactItem(compareWith, l, verticalCompact) {
  3460. if (verticalCompact) {
  3461. while (l.y > 0 && !getFirstCollision(compareWith, l)) {
  3462. l.y--;
  3463. }
  3464. }
  3465. var collides2;
  3466. while (collides2 = getFirstCollision(compareWith, l)) {
  3467. l.y = collides2.y + collides2.h;
  3468. }
  3469. return l;
  3470. }
  3471. function correctBounds(layout, bounds) {
  3472. var collidesWith = getStatics(layout);
  3473. for (var i = 0, len = layout.length; i < len; i++) {
  3474. var l = layout[i];
  3475. if (l.x + l.w > bounds.cols)
  3476. l.x = bounds.cols - l.w;
  3477. if (l.x < 0) {
  3478. l.x = 0;
  3479. l.w = bounds.cols;
  3480. }
  3481. if (!l.static)
  3482. collidesWith.push(l);
  3483. else {
  3484. while (getFirstCollision(collidesWith, l)) {
  3485. l.y++;
  3486. }
  3487. }
  3488. }
  3489. return layout;
  3490. }
  3491. function getLayoutItem(layout, id) {
  3492. for (var i = 0, len = layout.length; i < len; i++) {
  3493. if (layout[i].i === id)
  3494. return layout[i];
  3495. }
  3496. }
  3497. function getFirstCollision(layout, layoutItem) {
  3498. for (var i = 0, len = layout.length; i < len; i++) {
  3499. if (collides(layout[i], layoutItem))
  3500. return layout[i];
  3501. }
  3502. }
  3503. function getAllCollisions(layout, layoutItem) {
  3504. return layout.filter(function(l) {
  3505. return collides(l, layoutItem);
  3506. });
  3507. }
  3508. function getStatics(layout) {
  3509. return layout.filter(function(l) {
  3510. return l.static;
  3511. });
  3512. }
  3513. function moveElement(layout, l, x, y, isUserAction, preventCollision) {
  3514. if (l.static)
  3515. return layout;
  3516. var oldX = l.x;
  3517. var oldY = l.y;
  3518. var movingUp = y && l.y > y;
  3519. if (typeof x === "number")
  3520. l.x = x;
  3521. if (typeof y === "number")
  3522. l.y = y;
  3523. l.moved = true;
  3524. var sorted = sortLayoutItemsByRowCol(layout);
  3525. if (movingUp)
  3526. sorted = sorted.reverse();
  3527. var collisions = getAllCollisions(sorted, l);
  3528. if (preventCollision && collisions.length) {
  3529. l.x = oldX;
  3530. l.y = oldY;
  3531. l.moved = false;
  3532. return layout;
  3533. }
  3534. for (var i = 0, len = collisions.length; i < len; i++) {
  3535. var collision = collisions[i];
  3536. if (collision.moved)
  3537. continue;
  3538. if (l.y > collision.y && l.y - collision.y > collision.h / 4)
  3539. continue;
  3540. if (collision.static) {
  3541. layout = moveElementAwayFromCollision(layout, collision, l, isUserAction);
  3542. } else {
  3543. layout = moveElementAwayFromCollision(layout, l, collision, isUserAction);
  3544. }
  3545. }
  3546. return layout;
  3547. }
  3548. function moveElementAwayFromCollision(layout, collidesWith, itemToMove, isUserAction) {
  3549. var preventCollision = false;
  3550. if (isUserAction) {
  3551. var fakeItem = {
  3552. x: itemToMove.x,
  3553. y: itemToMove.y,
  3554. w: itemToMove.w,
  3555. h: itemToMove.h,
  3556. i: "-1"
  3557. };
  3558. fakeItem.y = Math.max(collidesWith.y - itemToMove.h, 0);
  3559. if (!getFirstCollision(layout, fakeItem)) {
  3560. return moveElement(layout, itemToMove, void 0, fakeItem.y, preventCollision);
  3561. }
  3562. }
  3563. return moveElement(layout, itemToMove, void 0, itemToMove.y + 1, preventCollision);
  3564. }
  3565. function perc(num) {
  3566. return num * 100 + "%";
  3567. }
  3568. function setTransform(top, left, width, height) {
  3569. var translate = "translate3d(" + left + "px," + top + "px, 0)";
  3570. return {
  3571. transform: translate,
  3572. WebkitTransform: translate,
  3573. MozTransform: translate,
  3574. msTransform: translate,
  3575. OTransform: translate,
  3576. width: width + "px",
  3577. height: height + "px",
  3578. position: "absolute"
  3579. };
  3580. }
  3581. function setTransformRtl(top, right, width, height) {
  3582. var translate = "translate3d(" + right * -1 + "px," + top + "px, 0)";
  3583. return {
  3584. transform: translate,
  3585. WebkitTransform: translate,
  3586. MozTransform: translate,
  3587. msTransform: translate,
  3588. OTransform: translate,
  3589. width: width + "px",
  3590. height: height + "px",
  3591. position: "absolute"
  3592. };
  3593. }
  3594. function setTopLeft(top, left, width, height) {
  3595. return {
  3596. top: top + "px",
  3597. left: left + "px",
  3598. width: width + "px",
  3599. height: height + "px",
  3600. position: "absolute"
  3601. };
  3602. }
  3603. function setTopRight(top, right, width, height) {
  3604. return {
  3605. top: top + "px",
  3606. right: right + "px",
  3607. width: width + "px",
  3608. height: height + "px",
  3609. position: "absolute"
  3610. };
  3611. }
  3612. function sortLayoutItemsByRowCol(layout) {
  3613. return [].concat(layout).sort(function(a, b) {
  3614. if (a.y === b.y && a.x === b.x) {
  3615. return 0;
  3616. }
  3617. if (a.y > b.y || a.y === b.y && a.x > b.x) {
  3618. return 1;
  3619. }
  3620. return -1;
  3621. });
  3622. }
  3623. function validateLayout(layout, contextName) {
  3624. contextName = contextName || "Layout";
  3625. var subProps = ["x", "y", "w", "h"];
  3626. var keyArr = [];
  3627. if (!Array.isArray(layout))
  3628. throw new Error(contextName + " must be an array!");
  3629. for (var i = 0, len = layout.length; i < len; i++) {
  3630. var item = layout[i];
  3631. for (var j = 0; j < subProps.length; j++) {
  3632. if (typeof item[subProps[j]] !== "number") {
  3633. throw new Error("VueGridLayout: " + contextName + "[" + i + "]." + subProps[j] + " must be a number!");
  3634. }
  3635. }
  3636. if (item.i === void 0 || item.i === null) {
  3637. throw new Error("VueGridLayout: " + contextName + "[" + i + "].i cannot be null!");
  3638. }
  3639. if (typeof item.i !== "number" && typeof item.i !== "string") {
  3640. throw new Error("VueGridLayout: " + contextName + "[" + i + "].i must be a string or number!");
  3641. }
  3642. if (keyArr.indexOf(item.i) >= 0) {
  3643. throw new Error("VueGridLayout: " + contextName + "[" + i + "].i must be unique!");
  3644. }
  3645. keyArr.push(item.i);
  3646. if (item.static !== void 0 && typeof item.static !== "boolean") {
  3647. throw new Error("VueGridLayout: " + contextName + "[" + i + "].static must be a boolean!");
  3648. }
  3649. }
  3650. }
  3651. function autoBindHandlers(el, fns) {
  3652. fns.forEach(function(key) {
  3653. return el[key] = el[key].bind(el);
  3654. });
  3655. }
  3656. function createMarkup(obj) {
  3657. var keys = Object.keys(obj);
  3658. if (!keys.length)
  3659. return "";
  3660. var i, len = keys.length;
  3661. var result = "";
  3662. for (i = 0; i < len; i++) {
  3663. var key = keys[i];
  3664. var val = obj[key];
  3665. result += hyphenate(key) + ":" + addPx(key, val) + ";";
  3666. }
  3667. return result;
  3668. }
  3669. var IS_UNITLESS = {
  3670. animationIterationCount: true,
  3671. boxFlex: true,
  3672. boxFlexGroup: true,
  3673. boxOrdinalGroup: true,
  3674. columnCount: true,
  3675. flex: true,
  3676. flexGrow: true,
  3677. flexPositive: true,
  3678. flexShrink: true,
  3679. flexNegative: true,
  3680. flexOrder: true,
  3681. gridRow: true,
  3682. gridColumn: true,
  3683. fontWeight: true,
  3684. lineClamp: true,
  3685. lineHeight: true,
  3686. opacity: true,
  3687. order: true,
  3688. orphans: true,
  3689. tabSize: true,
  3690. widows: true,
  3691. zIndex: true,
  3692. zoom: true,
  3693. // SVG-related properties
  3694. fillOpacity: true,
  3695. stopOpacity: true,
  3696. strokeDashoffset: true,
  3697. strokeOpacity: true,
  3698. strokeWidth: true
  3699. };
  3700. function addPx(name, value) {
  3701. if (typeof value === "number" && !IS_UNITLESS[name]) {
  3702. return value + "px";
  3703. } else {
  3704. return value;
  3705. }
  3706. }
  3707. var hyphenateRE = /([a-z\d])([A-Z])/g;
  3708. function hyphenate(str) {
  3709. return str.replace(hyphenateRE, "$1-$2").toLowerCase();
  3710. }
  3711. function findItemInArray(array2, property, value) {
  3712. for (var i = 0; i < array2.length; i++) {
  3713. if (array2[i][property] == value)
  3714. return true;
  3715. }
  3716. return false;
  3717. }
  3718. function findAndRemove(array2, property, value) {
  3719. array2.forEach(function(result, index) {
  3720. if (result[property] === value) {
  3721. array2.splice(index, 1);
  3722. }
  3723. });
  3724. }
  3725. function getControlPosition(e) {
  3726. return offsetXYFromParentOf(e);
  3727. }
  3728. function offsetXYFromParentOf(evt) {
  3729. var offsetParent = evt.target.offsetParent || document.body;
  3730. var offsetParentRect = evt.offsetParent === document.body ? {
  3731. left: 0,
  3732. top: 0
  3733. } : offsetParent.getBoundingClientRect();
  3734. var x = evt.clientX + offsetParent.scrollLeft - offsetParentRect.left;
  3735. var y = evt.clientY + offsetParent.scrollTop - offsetParentRect.top;
  3736. return {
  3737. x,
  3738. y
  3739. };
  3740. }
  3741. function createCoreData(lastX, lastY, x, y) {
  3742. var isStart = !isNum(lastX);
  3743. if (isStart) {
  3744. return {
  3745. deltaX: 0,
  3746. deltaY: 0,
  3747. lastX: x,
  3748. lastY: y,
  3749. x,
  3750. y
  3751. };
  3752. } else {
  3753. return {
  3754. deltaX: x - lastX,
  3755. deltaY: y - lastY,
  3756. lastX,
  3757. lastY,
  3758. x,
  3759. y
  3760. };
  3761. }
  3762. }
  3763. function isNum(num) {
  3764. return typeof num === "number" && !isNaN(num);
  3765. }
  3766. function getBreakpointFromWidth(breakpoints, width) {
  3767. var sorted = sortBreakpoints(breakpoints);
  3768. var matching = sorted[0];
  3769. for (var i = 1, len = sorted.length; i < len; i++) {
  3770. var breakpointName = sorted[i];
  3771. if (width > breakpoints[breakpointName])
  3772. matching = breakpointName;
  3773. }
  3774. return matching;
  3775. }
  3776. function getColsFromBreakpoint(breakpoint, cols) {
  3777. if (!cols[breakpoint]) {
  3778. throw new Error("ResponsiveGridLayout: `cols` entry for breakpoint " + breakpoint + " is missing!");
  3779. }
  3780. return cols[breakpoint];
  3781. }
  3782. function findOrGenerateResponsiveLayout(orgLayout, layouts, breakpoints, breakpoint, lastBreakpoint, cols, verticalCompact) {
  3783. if (layouts[breakpoint])
  3784. return cloneLayout(layouts[breakpoint]);
  3785. var layout = orgLayout;
  3786. var breakpointsSorted = sortBreakpoints(breakpoints);
  3787. var breakpointsAbove = breakpointsSorted.slice(breakpointsSorted.indexOf(breakpoint));
  3788. for (var i = 0, len = breakpointsAbove.length; i < len; i++) {
  3789. var b = breakpointsAbove[i];
  3790. if (layouts[b]) {
  3791. layout = layouts[b];
  3792. break;
  3793. }
  3794. }
  3795. layout = cloneLayout(layout || []);
  3796. return compact(correctBounds(layout, {
  3797. cols
  3798. }), verticalCompact);
  3799. }
  3800. function generateResponsiveLayout(layout, breakpoints, breakpoint, lastBreakpoint, cols, verticalCompact) {
  3801. layout = cloneLayout(layout || []);
  3802. return compact(correctBounds(layout, {
  3803. cols
  3804. }), verticalCompact);
  3805. }
  3806. function sortBreakpoints(breakpoints) {
  3807. var keys = Object.keys(breakpoints);
  3808. return keys.sort(function(a, b) {
  3809. return breakpoints[a] - breakpoints[b];
  3810. });
  3811. }
  3812. var currentDir = "auto";
  3813. function hasDocument() {
  3814. return typeof document !== "undefined";
  3815. }
  3816. function hasWindow() {
  3817. return typeof window !== "undefined";
  3818. }
  3819. function getDocumentDir() {
  3820. if (!hasDocument()) {
  3821. return currentDir;
  3822. }
  3823. var direction = typeof document.dir !== "undefined" ? document.dir : document.getElementsByTagName("html")[0].getAttribute("dir");
  3824. return direction;
  3825. }
  3826. function setDocumentDir(dir) {
  3827. if (!hasDocument) {
  3828. currentDir = dir;
  3829. return;
  3830. }
  3831. var html = document.getElementsByTagName("html")[0];
  3832. html.setAttribute("dir", dir);
  3833. }
  3834. function addWindowEventListener(event, callback) {
  3835. if (!hasWindow) {
  3836. callback();
  3837. return;
  3838. }
  3839. window.addEventListener(event, callback);
  3840. }
  3841. function removeWindowEventListener(event, callback) {
  3842. if (!hasWindow) {
  3843. return;
  3844. }
  3845. window.removeEventListener(event, callback);
  3846. }
  3847. const domObjects = {
  3848. init,
  3849. document: null,
  3850. DocumentFragment: null,
  3851. SVGElement: null,
  3852. SVGSVGElement: null,
  3853. SVGElementInstance: null,
  3854. Element: null,
  3855. HTMLElement: null,
  3856. Event: null,
  3857. Touch: null,
  3858. PointerEvent: null
  3859. };
  3860. function blank() {
  3861. }
  3862. var utils_domObjects = domObjects;
  3863. function init(window2) {
  3864. const win2 = window2;
  3865. domObjects.document = win2.document;
  3866. domObjects.DocumentFragment = win2.DocumentFragment || blank;
  3867. domObjects.SVGElement = win2.SVGElement || blank;
  3868. domObjects.SVGSVGElement = win2.SVGSVGElement || blank;
  3869. domObjects.SVGElementInstance = win2.SVGElementInstance || blank;
  3870. domObjects.Element = win2.Element || blank;
  3871. domObjects.HTMLElement = win2.HTMLElement || domObjects.Element;
  3872. domObjects.Event = win2.Event;
  3873. domObjects.Touch = win2.Touch || blank;
  3874. domObjects.PointerEvent = win2.PointerEvent || win2.MSPointerEvent;
  3875. }
  3876. var isWindow = (thing) => !!(thing && thing.Window) && thing instanceof thing.Window;
  3877. let realWindow = void 0;
  3878. let win = void 0;
  3879. function window_init(window2) {
  3880. realWindow = window2;
  3881. const el = window2.document.createTextNode("");
  3882. if (el.ownerDocument !== window2.document && typeof window2.wrap === "function" && window2.wrap(el) === el) {
  3883. window2 = window2.wrap(window2);
  3884. }
  3885. win = window2;
  3886. }
  3887. if (typeof window !== "undefined" && !!window) {
  3888. window_init(window);
  3889. }
  3890. function getWindow(node) {
  3891. if (isWindow(node)) {
  3892. return node;
  3893. }
  3894. const rootNode = node.ownerDocument || node;
  3895. return rootNode.defaultView || win.window;
  3896. }
  3897. const is_window = (thing) => thing === win || isWindow(thing);
  3898. const docFrag = (thing) => object(thing) && thing.nodeType === 11;
  3899. const object = (thing) => !!thing && typeof thing === "object";
  3900. const func = (thing) => typeof thing === "function";
  3901. const number = (thing) => typeof thing === "number";
  3902. const bool = (thing) => typeof thing === "boolean";
  3903. const string = (thing) => typeof thing === "string";
  3904. const is_element = (thing) => {
  3905. if (!thing || typeof thing !== "object") {
  3906. return false;
  3907. }
  3908. const _window = getWindow(thing) || win;
  3909. return /object|function/.test(typeof _window.Element) ? thing instanceof _window.Element : thing.nodeType === 1 && typeof thing.nodeName === "string";
  3910. };
  3911. const plainObject = (thing) => object(thing) && !!thing.constructor && /function Object\b/.test(thing.constructor.toString());
  3912. const array = (thing) => object(thing) && typeof thing.length !== "undefined" && func(thing.splice);
  3913. var is = {
  3914. window: is_window,
  3915. docFrag,
  3916. object,
  3917. func,
  3918. number,
  3919. bool,
  3920. string,
  3921. element: is_element,
  3922. plainObject,
  3923. array
  3924. };
  3925. const browser = {
  3926. init: browser_init,
  3927. supportsTouch: null,
  3928. supportsPointerEvent: null,
  3929. isIOS7: null,
  3930. isIOS: null,
  3931. isIe9: null,
  3932. isOperaMobile: null,
  3933. prefixedMatchesSelector: null,
  3934. pEventTypes: null,
  3935. wheelEvent: null
  3936. };
  3937. function browser_init(window2) {
  3938. const Element = utils_domObjects.Element;
  3939. const navigator2 = win.navigator;
  3940. browser.supportsTouch = "ontouchstart" in window2 || is.func(window2.DocumentTouch) && utils_domObjects.document instanceof window2.DocumentTouch;
  3941. browser.supportsPointerEvent = navigator2.pointerEnabled !== false && !!utils_domObjects.PointerEvent;
  3942. browser.isIOS = /iP(hone|od|ad)/.test(navigator2.platform);
  3943. browser.isIOS7 = /iP(hone|od|ad)/.test(navigator2.platform) && /OS 7[^\d]/.test(navigator2.appVersion);
  3944. browser.isIe9 = /MSIE 9/.test(navigator2.userAgent);
  3945. browser.isOperaMobile = navigator2.appName === "Opera" && browser.supportsTouch && /Presto/.test(navigator2.userAgent);
  3946. browser.prefixedMatchesSelector = "matches" in Element.prototype ? "matches" : "webkitMatchesSelector" in Element.prototype ? "webkitMatchesSelector" : "mozMatchesSelector" in Element.prototype ? "mozMatchesSelector" : "oMatchesSelector" in Element.prototype ? "oMatchesSelector" : "msMatchesSelector";
  3947. browser.pEventTypes = browser.supportsPointerEvent ? utils_domObjects.PointerEvent === window2.MSPointerEvent ? {
  3948. up: "MSPointerUp",
  3949. down: "MSPointerDown",
  3950. over: "mouseover",
  3951. out: "mouseout",
  3952. move: "MSPointerMove",
  3953. cancel: "MSPointerCancel"
  3954. } : {
  3955. up: "pointerup",
  3956. down: "pointerdown",
  3957. over: "pointerover",
  3958. out: "pointerout",
  3959. move: "pointermove",
  3960. cancel: "pointercancel"
  3961. } : null;
  3962. browser.wheelEvent = "onmousewheel" in utils_domObjects.document ? "mousewheel" : "wheel";
  3963. }
  3964. var utils_browser = browser;
  3965. const contains = (array2, target) => array2.indexOf(target) !== -1;
  3966. const arr_remove = (array2, target) => array2.splice(array2.indexOf(target), 1);
  3967. const merge = (target, source) => {
  3968. for (const item of source) {
  3969. target.push(item);
  3970. }
  3971. return target;
  3972. };
  3973. const from = (source) => merge([], source);
  3974. const findIndex = (array2, func2) => {
  3975. for (let i = 0; i < array2.length; i++) {
  3976. if (func2(array2[i], i, array2)) {
  3977. return i;
  3978. }
  3979. }
  3980. return -1;
  3981. };
  3982. const find = (array2, func2) => array2[findIndex(array2, func2)];
  3983. function clone(source) {
  3984. const dest = {};
  3985. for (const prop in source) {
  3986. const value = source[prop];
  3987. if (is.plainObject(value)) {
  3988. dest[prop] = clone(value);
  3989. } else if (is.array(value)) {
  3990. dest[prop] = from(value);
  3991. } else {
  3992. dest[prop] = value;
  3993. }
  3994. }
  3995. return dest;
  3996. }
  3997. function extend(dest, source) {
  3998. for (const prop in source) {
  3999. dest[prop] = source[prop];
  4000. }
  4001. const ret = dest;
  4002. return ret;
  4003. }
  4004. let lastTime = 0;
  4005. let request;
  4006. let cancel;
  4007. function raf_init(window2) {
  4008. request = window2.requestAnimationFrame;
  4009. cancel = window2.cancelAnimationFrame;
  4010. if (!request) {
  4011. const vendors = ["ms", "moz", "webkit", "o"];
  4012. for (const vendor of vendors) {
  4013. request = window2[`${vendor}RequestAnimationFrame`];
  4014. cancel = window2[`${vendor}CancelAnimationFrame`] || window2[`${vendor}CancelRequestAnimationFrame`];
  4015. }
  4016. }
  4017. request = request && request.bind(window2);
  4018. cancel = cancel && cancel.bind(window2);
  4019. if (!request) {
  4020. request = (callback) => {
  4021. const currTime = Date.now();
  4022. const timeToCall = Math.max(0, 16 - (currTime - lastTime));
  4023. const token = window2.setTimeout(() => {
  4024. callback(currTime + timeToCall);
  4025. }, timeToCall);
  4026. lastTime = currTime + timeToCall;
  4027. return token;
  4028. };
  4029. cancel = (token) => clearTimeout(token);
  4030. }
  4031. }
  4032. var raf = {
  4033. request: (callback) => request(callback),
  4034. cancel: (token) => cancel(token),
  4035. init: raf_init
  4036. };
  4037. function normalize(type, listeners, result) {
  4038. result = result || {};
  4039. if (is.string(type) && type.search(" ") !== -1) {
  4040. type = split(type);
  4041. }
  4042. if (is.array(type)) {
  4043. return type.reduce((acc, t) => extend(acc, normalize(t, listeners, result)), result);
  4044. }
  4045. if (is.object(type)) {
  4046. listeners = type;
  4047. type = "";
  4048. }
  4049. if (is.func(listeners)) {
  4050. result[type] = result[type] || [];
  4051. result[type].push(listeners);
  4052. } else if (is.array(listeners)) {
  4053. for (const l of listeners) {
  4054. normalize(type, l, result);
  4055. }
  4056. } else if (is.object(listeners)) {
  4057. for (const prefix2 in listeners) {
  4058. const combinedTypes = split(prefix2).map((p) => `${type}${p}`);
  4059. normalize(combinedTypes, listeners[prefix2], result);
  4060. }
  4061. }
  4062. return result;
  4063. }
  4064. function split(type) {
  4065. return type.trim().split(/ +/);
  4066. }
  4067. function fireUntilImmediateStopped(event, listeners) {
  4068. for (const listener of listeners) {
  4069. if (event.immediatePropagationStopped) {
  4070. break;
  4071. }
  4072. listener(event);
  4073. }
  4074. }
  4075. class Eventable_Eventable {
  4076. constructor(options) {
  4077. this.options = void 0;
  4078. this.types = {};
  4079. this.propagationStopped = false;
  4080. this.immediatePropagationStopped = false;
  4081. this.global = void 0;
  4082. this.options = extend({}, options || {});
  4083. }
  4084. fire(event) {
  4085. let listeners;
  4086. const global = this.global;
  4087. if (listeners = this.types[event.type]) {
  4088. fireUntilImmediateStopped(event, listeners);
  4089. }
  4090. if (!event.propagationStopped && global && (listeners = global[event.type])) {
  4091. fireUntilImmediateStopped(event, listeners);
  4092. }
  4093. }
  4094. on(type, listener) {
  4095. const listeners = normalize(type, listener);
  4096. for (type in listeners) {
  4097. this.types[type] = merge(this.types[type] || [], listeners[type]);
  4098. }
  4099. }
  4100. off(type, listener) {
  4101. const listeners = normalize(type, listener);
  4102. for (type in listeners) {
  4103. const eventList = this.types[type];
  4104. if (!eventList || !eventList.length) {
  4105. continue;
  4106. }
  4107. for (const subListener of listeners[type]) {
  4108. const index = eventList.indexOf(subListener);
  4109. if (index !== -1) {
  4110. eventList.splice(index, 1);
  4111. }
  4112. }
  4113. }
  4114. }
  4115. getRect(_element) {
  4116. return null;
  4117. }
  4118. }
  4119. function nodeContains(parent, child) {
  4120. if (parent.contains) {
  4121. return parent.contains(child);
  4122. }
  4123. while (child) {
  4124. if (child === parent) {
  4125. return true;
  4126. }
  4127. child = child.parentNode;
  4128. }
  4129. return false;
  4130. }
  4131. function domUtils_closest(element, selector) {
  4132. while (is.element(element)) {
  4133. if (matchesSelector(element, selector)) {
  4134. return element;
  4135. }
  4136. element = parentNode(element);
  4137. }
  4138. return null;
  4139. }
  4140. function parentNode(node) {
  4141. let parent = node.parentNode;
  4142. if (is.docFrag(parent)) {
  4143. while ((parent = parent.host) && is.docFrag(parent)) {
  4144. continue;
  4145. }
  4146. return parent;
  4147. }
  4148. return parent;
  4149. }
  4150. function matchesSelector(element, selector) {
  4151. if (win !== realWindow) {
  4152. selector = selector.replace(/\/deep\//g, " ");
  4153. }
  4154. return element[utils_browser.prefixedMatchesSelector](selector);
  4155. }
  4156. const getParent = (el) => el.parentNode || el.host;
  4157. function indexOfDeepestElement(elements) {
  4158. let deepestNodeParents = [];
  4159. let deepestNodeIndex;
  4160. for (let i = 0; i < elements.length; i++) {
  4161. const currentNode = elements[i];
  4162. const deepestNode = elements[deepestNodeIndex];
  4163. if (!currentNode || i === deepestNodeIndex) {
  4164. continue;
  4165. }
  4166. if (!deepestNode) {
  4167. deepestNodeIndex = i;
  4168. continue;
  4169. }
  4170. const currentNodeParent = getParent(currentNode);
  4171. const deepestNodeParent = getParent(deepestNode);
  4172. if (currentNodeParent === currentNode.ownerDocument) {
  4173. continue;
  4174. } else if (deepestNodeParent === currentNode.ownerDocument) {
  4175. deepestNodeIndex = i;
  4176. continue;
  4177. }
  4178. if (currentNodeParent === deepestNodeParent) {
  4179. if (zIndexIsHigherThan(currentNode, deepestNode)) {
  4180. deepestNodeIndex = i;
  4181. }
  4182. continue;
  4183. }
  4184. deepestNodeParents = deepestNodeParents.length ? deepestNodeParents : getNodeParents(deepestNode);
  4185. let ancestryStart;
  4186. if (deepestNode instanceof utils_domObjects.HTMLElement && currentNode instanceof utils_domObjects.SVGElement && !(currentNode instanceof utils_domObjects.SVGSVGElement)) {
  4187. if (currentNode === deepestNodeParent) {
  4188. continue;
  4189. }
  4190. ancestryStart = currentNode.ownerSVGElement;
  4191. } else {
  4192. ancestryStart = currentNode;
  4193. }
  4194. const currentNodeParents = getNodeParents(ancestryStart, deepestNode.ownerDocument);
  4195. let commonIndex = 0;
  4196. while (currentNodeParents[commonIndex] && currentNodeParents[commonIndex] === deepestNodeParents[commonIndex]) {
  4197. commonIndex++;
  4198. }
  4199. const parents = [currentNodeParents[commonIndex - 1], currentNodeParents[commonIndex], deepestNodeParents[commonIndex]];
  4200. let child = parents[0].lastChild;
  4201. while (child) {
  4202. if (child === parents[1]) {
  4203. deepestNodeIndex = i;
  4204. deepestNodeParents = currentNodeParents;
  4205. break;
  4206. } else if (child === parents[2]) {
  4207. break;
  4208. }
  4209. child = child.previousSibling;
  4210. }
  4211. }
  4212. return deepestNodeIndex;
  4213. }
  4214. function getNodeParents(node, limit) {
  4215. const parents = [];
  4216. let parent = node;
  4217. let parentParent;
  4218. while ((parentParent = getParent(parent)) && parent !== limit && parentParent !== parent.ownerDocument) {
  4219. parents.unshift(parent);
  4220. parent = parentParent;
  4221. }
  4222. return parents;
  4223. }
  4224. function zIndexIsHigherThan(higherNode, lowerNode) {
  4225. const higherIndex = parseInt(getWindow(higherNode).getComputedStyle(higherNode).zIndex, 10) || 0;
  4226. const lowerIndex = parseInt(getWindow(lowerNode).getComputedStyle(lowerNode).zIndex, 10) || 0;
  4227. return higherIndex >= lowerIndex;
  4228. }
  4229. function matchesUpTo(element, selector, limit) {
  4230. while (is.element(element)) {
  4231. if (matchesSelector(element, selector)) {
  4232. return true;
  4233. }
  4234. element = parentNode(element);
  4235. if (element === limit) {
  4236. return matchesSelector(element, selector);
  4237. }
  4238. }
  4239. return false;
  4240. }
  4241. function getActualElement(element) {
  4242. return element.correspondingUseElement || element;
  4243. }
  4244. function getScrollXY(relevantWindow) {
  4245. relevantWindow = relevantWindow || win;
  4246. return {
  4247. x: relevantWindow.scrollX || relevantWindow.document.documentElement.scrollLeft,
  4248. y: relevantWindow.scrollY || relevantWindow.document.documentElement.scrollTop
  4249. };
  4250. }
  4251. function getElementClientRect(element) {
  4252. const clientRect = element instanceof utils_domObjects.SVGElement ? element.getBoundingClientRect() : element.getClientRects()[0];
  4253. return clientRect && {
  4254. left: clientRect.left,
  4255. right: clientRect.right,
  4256. top: clientRect.top,
  4257. bottom: clientRect.bottom,
  4258. width: clientRect.width || clientRect.right - clientRect.left,
  4259. height: clientRect.height || clientRect.bottom - clientRect.top
  4260. };
  4261. }
  4262. function getElementRect(element) {
  4263. const clientRect = getElementClientRect(element);
  4264. if (!utils_browser.isIOS7 && clientRect) {
  4265. const scroll = getScrollXY(getWindow(element));
  4266. clientRect.left += scroll.x;
  4267. clientRect.right += scroll.x;
  4268. clientRect.top += scroll.y;
  4269. clientRect.bottom += scroll.y;
  4270. }
  4271. return clientRect;
  4272. }
  4273. function getPath(node) {
  4274. const path = [];
  4275. while (node) {
  4276. path.push(node);
  4277. node = parentNode(node);
  4278. }
  4279. return path;
  4280. }
  4281. function trySelector(value) {
  4282. if (!is.string(value)) {
  4283. return false;
  4284. }
  4285. utils_domObjects.document.querySelector(value);
  4286. return true;
  4287. }
  4288. function getStringOptionResult(value, target, element) {
  4289. if (value === "parent") {
  4290. return parentNode(element);
  4291. }
  4292. if (value === "self") {
  4293. return target.getRect(element);
  4294. }
  4295. return domUtils_closest(element, value);
  4296. }
  4297. function resolveRectLike(value, target, element, functionArgs) {
  4298. let returnValue = value;
  4299. if (is.string(returnValue)) {
  4300. returnValue = getStringOptionResult(returnValue, target, element);
  4301. } else if (is.func(returnValue)) {
  4302. returnValue = returnValue(...functionArgs);
  4303. }
  4304. if (is.element(returnValue)) {
  4305. returnValue = getElementRect(returnValue);
  4306. }
  4307. return returnValue;
  4308. }
  4309. function rectToXY(rect) {
  4310. return rect && {
  4311. x: "x" in rect ? rect.x : rect.left,
  4312. y: "y" in rect ? rect.y : rect.top
  4313. };
  4314. }
  4315. function xywhToTlbr(rect) {
  4316. if (rect && !("left" in rect && "top" in rect)) {
  4317. rect = extend({}, rect);
  4318. rect.left = rect.x || 0;
  4319. rect.top = rect.y || 0;
  4320. rect.right = rect.right || rect.left + rect.width;
  4321. rect.bottom = rect.bottom || rect.top + rect.height;
  4322. }
  4323. return rect;
  4324. }
  4325. function tlbrToXywh(rect) {
  4326. if (rect && !("x" in rect && "y" in rect)) {
  4327. rect = extend({}, rect);
  4328. rect.x = rect.left || 0;
  4329. rect.y = rect.top || 0;
  4330. rect.width = rect.width || (rect.right || 0) - rect.x;
  4331. rect.height = rect.height || (rect.bottom || 0) - rect.y;
  4332. }
  4333. return rect;
  4334. }
  4335. function addEdges(edges, rect, delta) {
  4336. if (edges.left) {
  4337. rect.left += delta.x;
  4338. }
  4339. if (edges.right) {
  4340. rect.right += delta.x;
  4341. }
  4342. if (edges.top) {
  4343. rect.top += delta.y;
  4344. }
  4345. if (edges.bottom) {
  4346. rect.bottom += delta.y;
  4347. }
  4348. rect.width = rect.right - rect.left;
  4349. rect.height = rect.bottom - rect.top;
  4350. }
  4351. var getOriginXY = function(target, element, actionName) {
  4352. const actionOptions = target.options[actionName];
  4353. const actionOrigin = actionOptions && actionOptions.origin;
  4354. const origin = actionOrigin || target.options.origin;
  4355. const originRect = resolveRectLike(origin, target, element, [target && element]);
  4356. return rectToXY(originRect) || {
  4357. x: 0,
  4358. y: 0
  4359. };
  4360. };
  4361. var hypot = (x, y) => Math.sqrt(x * x + y * y);
  4362. class BaseEvent {
  4363. constructor(interaction) {
  4364. this.type = void 0;
  4365. this.target = void 0;
  4366. this.currentTarget = void 0;
  4367. this.interactable = void 0;
  4368. this._interaction = void 0;
  4369. this.timeStamp = void 0;
  4370. this.immediatePropagationStopped = false;
  4371. this.propagationStopped = false;
  4372. this._interaction = interaction;
  4373. }
  4374. preventDefault() {
  4375. }
  4376. /**
  4377. * Don't call any other listeners (even on the current target)
  4378. */
  4379. stopPropagation() {
  4380. this.propagationStopped = true;
  4381. }
  4382. /**
  4383. * Don't call listeners on the remaining targets
  4384. */
  4385. stopImmediatePropagation() {
  4386. this.immediatePropagationStopped = this.propagationStopped = true;
  4387. }
  4388. }
  4389. Object.defineProperty(BaseEvent.prototype, "interaction", {
  4390. get() {
  4391. return this._interaction._proxy;
  4392. },
  4393. set() {
  4394. }
  4395. });
  4396. const defaultOptions_defaults = {
  4397. base: {
  4398. preventDefault: "auto",
  4399. deltaSource: "page"
  4400. },
  4401. perAction: {
  4402. enabled: false,
  4403. origin: {
  4404. x: 0,
  4405. y: 0
  4406. }
  4407. },
  4408. actions: {}
  4409. };
  4410. class InteractEvent_InteractEvent extends BaseEvent {
  4411. // resize
  4412. /** */
  4413. constructor(interaction, event, actionName, phase, element, preEnd, type) {
  4414. super(interaction);
  4415. this.target = void 0;
  4416. this.currentTarget = void 0;
  4417. this.relatedTarget = null;
  4418. this.screenX = void 0;
  4419. this.screenY = void 0;
  4420. this.button = void 0;
  4421. this.buttons = void 0;
  4422. this.ctrlKey = void 0;
  4423. this.shiftKey = void 0;
  4424. this.altKey = void 0;
  4425. this.metaKey = void 0;
  4426. this.page = void 0;
  4427. this.client = void 0;
  4428. this.delta = void 0;
  4429. this.rect = void 0;
  4430. this.x0 = void 0;
  4431. this.y0 = void 0;
  4432. this.t0 = void 0;
  4433. this.dt = void 0;
  4434. this.duration = void 0;
  4435. this.clientX0 = void 0;
  4436. this.clientY0 = void 0;
  4437. this.velocity = void 0;
  4438. this.speed = void 0;
  4439. this.swipe = void 0;
  4440. this.timeStamp = void 0;
  4441. this.axes = void 0;
  4442. this.preEnd = void 0;
  4443. element = element || interaction.element;
  4444. const target = interaction.interactable;
  4445. const deltaSource = (target && target.options || defaultOptions_defaults).deltaSource;
  4446. const origin = getOriginXY(target, element, actionName);
  4447. const starting = phase === "start";
  4448. const ending = phase === "end";
  4449. const prevEvent = starting ? this : interaction.prevEvent;
  4450. const coords = starting ? interaction.coords.start : ending ? {
  4451. page: prevEvent.page,
  4452. client: prevEvent.client,
  4453. timeStamp: interaction.coords.cur.timeStamp
  4454. } : interaction.coords.cur;
  4455. this.page = extend({}, coords.page);
  4456. this.client = extend({}, coords.client);
  4457. this.rect = extend({}, interaction.rect);
  4458. this.timeStamp = coords.timeStamp;
  4459. if (!ending) {
  4460. this.page.x -= origin.x;
  4461. this.page.y -= origin.y;
  4462. this.client.x -= origin.x;
  4463. this.client.y -= origin.y;
  4464. }
  4465. this.ctrlKey = event.ctrlKey;
  4466. this.altKey = event.altKey;
  4467. this.shiftKey = event.shiftKey;
  4468. this.metaKey = event.metaKey;
  4469. this.button = event.button;
  4470. this.buttons = event.buttons;
  4471. this.target = element;
  4472. this.currentTarget = element;
  4473. this.preEnd = preEnd;
  4474. this.type = type || actionName + (phase || "");
  4475. this.interactable = target;
  4476. this.t0 = starting ? interaction.pointers[interaction.pointers.length - 1].downTime : prevEvent.t0;
  4477. this.x0 = interaction.coords.start.page.x - origin.x;
  4478. this.y0 = interaction.coords.start.page.y - origin.y;
  4479. this.clientX0 = interaction.coords.start.client.x - origin.x;
  4480. this.clientY0 = interaction.coords.start.client.y - origin.y;
  4481. if (starting || ending) {
  4482. this.delta = {
  4483. x: 0,
  4484. y: 0
  4485. };
  4486. } else {
  4487. this.delta = {
  4488. x: this[deltaSource].x - prevEvent[deltaSource].x,
  4489. y: this[deltaSource].y - prevEvent[deltaSource].y
  4490. };
  4491. }
  4492. this.dt = interaction.coords.delta.timeStamp;
  4493. this.duration = this.timeStamp - this.t0;
  4494. this.velocity = extend({}, interaction.coords.velocity[deltaSource]);
  4495. this.speed = hypot(this.velocity.x, this.velocity.y);
  4496. this.swipe = ending || phase === "inertiastart" ? this.getSwipe() : null;
  4497. }
  4498. getSwipe() {
  4499. const interaction = this._interaction;
  4500. if (interaction.prevEvent.speed < 600 || this.timeStamp - interaction.prevEvent.timeStamp > 150) {
  4501. return null;
  4502. }
  4503. let angle = 180 * Math.atan2(interaction.prevEvent.velocityY, interaction.prevEvent.velocityX) / Math.PI;
  4504. const overlap = 22.5;
  4505. if (angle < 0) {
  4506. angle += 360;
  4507. }
  4508. const left = 135 - overlap <= angle && angle < 225 + overlap;
  4509. const up = 225 - overlap <= angle && angle < 315 + overlap;
  4510. const right = !left && (315 - overlap <= angle || angle < 45 + overlap);
  4511. const down = !up && 45 - overlap <= angle && angle < 135 + overlap;
  4512. return {
  4513. up,
  4514. down,
  4515. left,
  4516. right,
  4517. angle,
  4518. speed: interaction.prevEvent.speed,
  4519. velocity: {
  4520. x: interaction.prevEvent.velocityX,
  4521. y: interaction.prevEvent.velocityY
  4522. }
  4523. };
  4524. }
  4525. preventDefault() {
  4526. }
  4527. /**
  4528. * Don't call listeners on the remaining targets
  4529. */
  4530. stopImmediatePropagation() {
  4531. this.immediatePropagationStopped = this.propagationStopped = true;
  4532. }
  4533. /**
  4534. * Don't call any other listeners (even on the current target)
  4535. */
  4536. stopPropagation() {
  4537. this.propagationStopped = true;
  4538. }
  4539. }
  4540. Object.defineProperties(InteractEvent_InteractEvent.prototype, {
  4541. pageX: {
  4542. get() {
  4543. return this.page.x;
  4544. },
  4545. set(value) {
  4546. this.page.x = value;
  4547. }
  4548. },
  4549. pageY: {
  4550. get() {
  4551. return this.page.y;
  4552. },
  4553. set(value) {
  4554. this.page.y = value;
  4555. }
  4556. },
  4557. clientX: {
  4558. get() {
  4559. return this.client.x;
  4560. },
  4561. set(value) {
  4562. this.client.x = value;
  4563. }
  4564. },
  4565. clientY: {
  4566. get() {
  4567. return this.client.y;
  4568. },
  4569. set(value) {
  4570. this.client.y = value;
  4571. }
  4572. },
  4573. dx: {
  4574. get() {
  4575. return this.delta.x;
  4576. },
  4577. set(value) {
  4578. this.delta.x = value;
  4579. }
  4580. },
  4581. dy: {
  4582. get() {
  4583. return this.delta.y;
  4584. },
  4585. set(value) {
  4586. this.delta.y = value;
  4587. }
  4588. },
  4589. velocityX: {
  4590. get() {
  4591. return this.velocity.x;
  4592. },
  4593. set(value) {
  4594. this.velocity.x = value;
  4595. }
  4596. },
  4597. velocityY: {
  4598. get() {
  4599. return this.velocity.y;
  4600. },
  4601. set(value) {
  4602. this.velocity.y = value;
  4603. }
  4604. }
  4605. });
  4606. function isNonNativeEvent(type, actions) {
  4607. if (actions.phaselessTypes[type]) {
  4608. return true;
  4609. }
  4610. for (const name in actions.map) {
  4611. if (type.indexOf(name) === 0 && type.substr(name.length) in actions.phases) {
  4612. return true;
  4613. }
  4614. }
  4615. return false;
  4616. }
  4617. class Interactable_Interactable {
  4618. /** @internal */
  4619. get _defaults() {
  4620. return {
  4621. base: {},
  4622. perAction: {},
  4623. actions: {}
  4624. };
  4625. }
  4626. /** */
  4627. constructor(target, options, defaultContext, scopeEvents) {
  4628. this.options = void 0;
  4629. this._actions = void 0;
  4630. this.target = void 0;
  4631. this.events = new Eventable_Eventable();
  4632. this._context = void 0;
  4633. this._win = void 0;
  4634. this._doc = void 0;
  4635. this._scopeEvents = void 0;
  4636. this._rectChecker = void 0;
  4637. this._actions = options.actions;
  4638. this.target = target;
  4639. this._context = options.context || defaultContext;
  4640. this._win = getWindow(trySelector(target) ? this._context : target);
  4641. this._doc = this._win.document;
  4642. this._scopeEvents = scopeEvents;
  4643. this.set(options);
  4644. }
  4645. setOnEvents(actionName, phases) {
  4646. if (is.func(phases.onstart)) {
  4647. this.on(`${actionName}start`, phases.onstart);
  4648. }
  4649. if (is.func(phases.onmove)) {
  4650. this.on(`${actionName}move`, phases.onmove);
  4651. }
  4652. if (is.func(phases.onend)) {
  4653. this.on(`${actionName}end`, phases.onend);
  4654. }
  4655. if (is.func(phases.oninertiastart)) {
  4656. this.on(`${actionName}inertiastart`, phases.oninertiastart);
  4657. }
  4658. return this;
  4659. }
  4660. updatePerActionListeners(actionName, prev, cur) {
  4661. if (is.array(prev) || is.object(prev)) {
  4662. this.off(actionName, prev);
  4663. }
  4664. if (is.array(cur) || is.object(cur)) {
  4665. this.on(actionName, cur);
  4666. }
  4667. }
  4668. setPerAction(actionName, options) {
  4669. const defaults = this._defaults;
  4670. for (const optionName_ in options) {
  4671. const optionName = optionName_;
  4672. const actionOptions = this.options[actionName];
  4673. const optionValue = options[optionName];
  4674. if (optionName === "listeners") {
  4675. this.updatePerActionListeners(actionName, actionOptions.listeners, optionValue);
  4676. }
  4677. if (is.array(optionValue)) {
  4678. actionOptions[optionName] = from(optionValue);
  4679. } else if (is.plainObject(optionValue)) {
  4680. actionOptions[optionName] = extend(actionOptions[optionName] || {}, clone(optionValue));
  4681. if (is.object(defaults.perAction[optionName]) && "enabled" in defaults.perAction[optionName]) {
  4682. actionOptions[optionName].enabled = optionValue.enabled !== false;
  4683. }
  4684. } else if (is.bool(optionValue) && is.object(defaults.perAction[optionName])) {
  4685. actionOptions[optionName].enabled = optionValue;
  4686. } else {
  4687. actionOptions[optionName] = optionValue;
  4688. }
  4689. }
  4690. }
  4691. /**
  4692. * The default function to get an Interactables bounding rect. Can be
  4693. * overridden using {@link Interactable.rectChecker}.
  4694. *
  4695. * @param {Element} [element] The element to measure.
  4696. * @return {Rect} The object's bounding rectangle.
  4697. */
  4698. getRect(element) {
  4699. element = element || (is.element(this.target) ? this.target : null);
  4700. if (is.string(this.target)) {
  4701. element = element || this._context.querySelector(this.target);
  4702. }
  4703. return getElementRect(element);
  4704. }
  4705. /**
  4706. * Returns or sets the function used to calculate the interactable's
  4707. * element's rectangle
  4708. *
  4709. * @param {function} [checker] A function which returns this Interactable's
  4710. * bounding rectangle. See {@link Interactable.getRect}
  4711. * @return {function | object} The checker function or this Interactable
  4712. */
  4713. rectChecker(checker) {
  4714. if (is.func(checker)) {
  4715. this._rectChecker = checker;
  4716. this.getRect = (element) => {
  4717. const rect = extend({}, this._rectChecker(element));
  4718. if (!("width" in rect)) {
  4719. rect.width = rect.right - rect.left;
  4720. rect.height = rect.bottom - rect.top;
  4721. }
  4722. return rect;
  4723. };
  4724. return this;
  4725. }
  4726. if (checker === null) {
  4727. delete this.getRect;
  4728. delete this._rectChecker;
  4729. return this;
  4730. }
  4731. return this.getRect;
  4732. }
  4733. _backCompatOption(optionName, newValue) {
  4734. if (trySelector(newValue) || is.object(newValue)) {
  4735. this.options[optionName] = newValue;
  4736. for (const action in this._actions.map) {
  4737. this.options[action][optionName] = newValue;
  4738. }
  4739. return this;
  4740. }
  4741. return this.options[optionName];
  4742. }
  4743. /**
  4744. * Gets or sets the origin of the Interactable's element. The x and y
  4745. * of the origin will be subtracted from action event coordinates.
  4746. *
  4747. * @param {Element | object | string} [origin] An HTML or SVG Element whose
  4748. * rect will be used, an object eg. { x: 0, y: 0 } or string 'parent', 'self'
  4749. * or any CSS selector
  4750. *
  4751. * @return {object} The current origin or this Interactable
  4752. */
  4753. origin(newValue) {
  4754. return this._backCompatOption("origin", newValue);
  4755. }
  4756. /**
  4757. * Returns or sets the mouse coordinate types used to calculate the
  4758. * movement of the pointer.
  4759. *
  4760. * @param {string} [newValue] Use 'client' if you will be scrolling while
  4761. * interacting; Use 'page' if you want autoScroll to work
  4762. * @return {string | object} The current deltaSource or this Interactable
  4763. */
  4764. deltaSource(newValue) {
  4765. if (newValue === "page" || newValue === "client") {
  4766. this.options.deltaSource = newValue;
  4767. return this;
  4768. }
  4769. return this.options.deltaSource;
  4770. }
  4771. /**
  4772. * Gets the selector context Node of the Interactable. The default is
  4773. * `window.document`.
  4774. *
  4775. * @return {Node} The context Node of this Interactable
  4776. */
  4777. context() {
  4778. return this._context;
  4779. }
  4780. inContext(element) {
  4781. return this._context === element.ownerDocument || nodeContains(this._context, element);
  4782. }
  4783. testIgnoreAllow(options, targetNode, eventTarget) {
  4784. return !this.testIgnore(options.ignoreFrom, targetNode, eventTarget) && this.testAllow(options.allowFrom, targetNode, eventTarget);
  4785. }
  4786. testAllow(allowFrom, targetNode, element) {
  4787. if (!allowFrom) {
  4788. return true;
  4789. }
  4790. if (!is.element(element)) {
  4791. return false;
  4792. }
  4793. if (is.string(allowFrom)) {
  4794. return matchesUpTo(element, allowFrom, targetNode);
  4795. } else if (is.element(allowFrom)) {
  4796. return nodeContains(allowFrom, element);
  4797. }
  4798. return false;
  4799. }
  4800. testIgnore(ignoreFrom, targetNode, element) {
  4801. if (!ignoreFrom || !is.element(element)) {
  4802. return false;
  4803. }
  4804. if (is.string(ignoreFrom)) {
  4805. return matchesUpTo(element, ignoreFrom, targetNode);
  4806. } else if (is.element(ignoreFrom)) {
  4807. return nodeContains(ignoreFrom, element);
  4808. }
  4809. return false;
  4810. }
  4811. /**
  4812. * Calls listeners for the given InteractEvent type bound globally
  4813. * and directly to this Interactable
  4814. *
  4815. * @param {InteractEvent} iEvent The InteractEvent object to be fired on this
  4816. * Interactable
  4817. * @return {Interactable} this Interactable
  4818. */
  4819. fire(iEvent) {
  4820. this.events.fire(iEvent);
  4821. return this;
  4822. }
  4823. _onOff(method, typeArg, listenerArg, options) {
  4824. if (is.object(typeArg) && !is.array(typeArg)) {
  4825. options = listenerArg;
  4826. listenerArg = null;
  4827. }
  4828. const addRemove = method === "on" ? "add" : "remove";
  4829. const listeners = normalize(typeArg, listenerArg);
  4830. for (let type in listeners) {
  4831. if (type === "wheel") {
  4832. type = utils_browser.wheelEvent;
  4833. }
  4834. for (const listener of listeners[type]) {
  4835. if (isNonNativeEvent(type, this._actions)) {
  4836. this.events[method](type, listener);
  4837. } else if (is.string(this.target)) {
  4838. this._scopeEvents[`${addRemove}Delegate`](this.target, this._context, type, listener, options);
  4839. } else {
  4840. this._scopeEvents[addRemove](this.target, type, listener, options);
  4841. }
  4842. }
  4843. }
  4844. return this;
  4845. }
  4846. /**
  4847. * Binds a listener for an InteractEvent, pointerEvent or DOM event.
  4848. *
  4849. * @param {string | array | object} types The types of events to listen
  4850. * for
  4851. * @param {function | array | object} [listener] The event listener function(s)
  4852. * @param {object | boolean} [options] options object or useCapture flag for
  4853. * addEventListener
  4854. * @return {Interactable} This Interactable
  4855. */
  4856. on(types, listener, options) {
  4857. return this._onOff("on", types, listener, options);
  4858. }
  4859. /**
  4860. * Removes an InteractEvent, pointerEvent or DOM event listener.
  4861. *
  4862. * @param {string | array | object} types The types of events that were
  4863. * listened for
  4864. * @param {function | array | object} [listener] The event listener function(s)
  4865. * @param {object | boolean} [options] options object or useCapture flag for
  4866. * removeEventListener
  4867. * @return {Interactable} This Interactable
  4868. */
  4869. off(types, listener, options) {
  4870. return this._onOff("off", types, listener, options);
  4871. }
  4872. /**
  4873. * Reset the options of this Interactable
  4874. *
  4875. * @param {object} options The new settings to apply
  4876. * @return {object} This Interactable
  4877. */
  4878. set(options) {
  4879. const defaults = this._defaults;
  4880. if (!is.object(options)) {
  4881. options = {};
  4882. }
  4883. this.options = clone(defaults.base);
  4884. for (const actionName_ in this._actions.methodDict) {
  4885. const actionName = actionName_;
  4886. const methodName = this._actions.methodDict[actionName];
  4887. this.options[actionName] = {};
  4888. this.setPerAction(actionName, extend(extend({}, defaults.perAction), defaults.actions[actionName]));
  4889. this[methodName](options[actionName]);
  4890. }
  4891. for (const setting in options) {
  4892. if (is.func(this[setting])) {
  4893. this[setting](options[setting]);
  4894. }
  4895. }
  4896. return this;
  4897. }
  4898. /**
  4899. * Remove this interactable from the list of interactables and remove it's
  4900. * action capabilities and event listeners
  4901. */
  4902. unset() {
  4903. if (is.string(this.target)) {
  4904. for (const type in this._scopeEvents.delegatedEvents) {
  4905. const delegated = this._scopeEvents.delegatedEvents[type];
  4906. for (let i = delegated.length - 1; i >= 0; i--) {
  4907. const {
  4908. selector,
  4909. context,
  4910. listeners
  4911. } = delegated[i];
  4912. if (selector === this.target && context === this._context) {
  4913. delegated.splice(i, 1);
  4914. }
  4915. for (let l = listeners.length - 1; l >= 0; l--) {
  4916. this._scopeEvents.removeDelegate(this.target, this._context, type, listeners[l][0], listeners[l][1]);
  4917. }
  4918. }
  4919. }
  4920. } else {
  4921. this._scopeEvents.remove(this.target, "all");
  4922. }
  4923. }
  4924. }
  4925. class InteractableSet_InteractableSet {
  4926. // all set interactables
  4927. constructor(scope) {
  4928. this.list = [];
  4929. this.selectorMap = {};
  4930. this.scope = void 0;
  4931. this.scope = scope;
  4932. scope.addListeners({
  4933. "interactable:unset": ({
  4934. interactable
  4935. }) => {
  4936. const {
  4937. target,
  4938. _context: context
  4939. } = interactable;
  4940. const targetMappings = is.string(target) ? this.selectorMap[target] : target[this.scope.id];
  4941. const targetIndex = findIndex(targetMappings, (m) => m.context === context);
  4942. if (targetMappings[targetIndex]) {
  4943. targetMappings[targetIndex].context = null;
  4944. targetMappings[targetIndex].interactable = null;
  4945. }
  4946. targetMappings.splice(targetIndex, 1);
  4947. }
  4948. });
  4949. }
  4950. new(target, options) {
  4951. options = extend(options || {}, {
  4952. actions: this.scope.actions
  4953. });
  4954. const interactable = new this.scope.Interactable(target, options, this.scope.document, this.scope.events);
  4955. const mappingInfo = {
  4956. context: interactable._context,
  4957. interactable
  4958. };
  4959. this.scope.addDocument(interactable._doc);
  4960. this.list.push(interactable);
  4961. if (is.string(target)) {
  4962. if (!this.selectorMap[target]) {
  4963. this.selectorMap[target] = [];
  4964. }
  4965. this.selectorMap[target].push(mappingInfo);
  4966. } else {
  4967. if (!interactable.target[this.scope.id]) {
  4968. Object.defineProperty(target, this.scope.id, {
  4969. value: [],
  4970. configurable: true
  4971. });
  4972. }
  4973. target[this.scope.id].push(mappingInfo);
  4974. }
  4975. this.scope.fire("interactable:new", {
  4976. target,
  4977. options,
  4978. interactable,
  4979. win: this.scope._win
  4980. });
  4981. return interactable;
  4982. }
  4983. get(target, options) {
  4984. const context = options && options.context || this.scope.document;
  4985. const isSelector = is.string(target);
  4986. const targetMappings = isSelector ? this.selectorMap[target] : target[this.scope.id];
  4987. if (!targetMappings) {
  4988. return null;
  4989. }
  4990. const found = find(targetMappings, (m) => m.context === context && (isSelector || m.interactable.inContext(target)));
  4991. return found && found.interactable;
  4992. }
  4993. forEachMatch(node, callback) {
  4994. for (const interactable of this.list) {
  4995. let ret;
  4996. if ((is.string(interactable.target) ? is.element(node) && matchesSelector(node, interactable.target) : (
  4997. // target is the element
  4998. node === interactable.target
  4999. )) && // the element is in context
  5000. interactable.inContext(node)) {
  5001. ret = callback(interactable);
  5002. }
  5003. if (ret !== void 0) {
  5004. return ret;
  5005. }
  5006. }
  5007. }
  5008. }
  5009. function pointerExtend(dest, source) {
  5010. for (const prop in source) {
  5011. const prefixedPropREs = pointerExtend.prefixedPropREs;
  5012. let deprecated = false;
  5013. for (const vendor in prefixedPropREs) {
  5014. if (prop.indexOf(vendor) === 0 && prefixedPropREs[vendor].test(prop)) {
  5015. deprecated = true;
  5016. break;
  5017. }
  5018. }
  5019. if (!deprecated && typeof source[prop] !== "function") {
  5020. dest[prop] = source[prop];
  5021. }
  5022. }
  5023. return dest;
  5024. }
  5025. pointerExtend.prefixedPropREs = {
  5026. webkit: /(Movement[XY]|Radius[XY]|RotationAngle|Force)$/,
  5027. moz: /(Pressure)$/
  5028. };
  5029. var utils_pointerExtend = pointerExtend;
  5030. function copyCoords(dest, src2) {
  5031. dest.page = dest.page || {};
  5032. dest.page.x = src2.page.x;
  5033. dest.page.y = src2.page.y;
  5034. dest.client = dest.client || {};
  5035. dest.client.x = src2.client.x;
  5036. dest.client.y = src2.client.y;
  5037. dest.timeStamp = src2.timeStamp;
  5038. }
  5039. function setCoordDeltas(targetObj, prev, cur) {
  5040. targetObj.page.x = cur.page.x - prev.page.x;
  5041. targetObj.page.y = cur.page.y - prev.page.y;
  5042. targetObj.client.x = cur.client.x - prev.client.x;
  5043. targetObj.client.y = cur.client.y - prev.client.y;
  5044. targetObj.timeStamp = cur.timeStamp - prev.timeStamp;
  5045. }
  5046. function setCoordVelocity(targetObj, delta) {
  5047. const dt = Math.max(delta.timeStamp / 1e3, 1e-3);
  5048. targetObj.page.x = delta.page.x / dt;
  5049. targetObj.page.y = delta.page.y / dt;
  5050. targetObj.client.x = delta.client.x / dt;
  5051. targetObj.client.y = delta.client.y / dt;
  5052. targetObj.timeStamp = dt;
  5053. }
  5054. function setZeroCoords(targetObj) {
  5055. targetObj.page.x = 0;
  5056. targetObj.page.y = 0;
  5057. targetObj.client.x = 0;
  5058. targetObj.client.y = 0;
  5059. }
  5060. function isNativePointer(pointer) {
  5061. return pointer instanceof utils_domObjects.Event || pointer instanceof utils_domObjects.Touch;
  5062. }
  5063. function getXY(type, pointer, xy) {
  5064. xy = xy || {};
  5065. type = type || "page";
  5066. xy.x = pointer[type + "X"];
  5067. xy.y = pointer[type + "Y"];
  5068. return xy;
  5069. }
  5070. function getPageXY(pointer, page) {
  5071. page = page || {
  5072. x: 0,
  5073. y: 0
  5074. };
  5075. if (utils_browser.isOperaMobile && isNativePointer(pointer)) {
  5076. getXY("screen", pointer, page);
  5077. page.x += window.scrollX;
  5078. page.y += window.scrollY;
  5079. } else {
  5080. getXY("page", pointer, page);
  5081. }
  5082. return page;
  5083. }
  5084. function getClientXY(pointer, client) {
  5085. client = client || {};
  5086. if (utils_browser.isOperaMobile && isNativePointer(pointer)) {
  5087. getXY("screen", pointer, client);
  5088. } else {
  5089. getXY("client", pointer, client);
  5090. }
  5091. return client;
  5092. }
  5093. function getPointerId(pointer) {
  5094. return is.number(pointer.pointerId) ? pointer.pointerId : pointer.identifier;
  5095. }
  5096. function setCoords(dest, pointers, timeStamp) {
  5097. const pointer = pointers.length > 1 ? pointerAverage(pointers) : pointers[0];
  5098. getPageXY(pointer, dest.page);
  5099. getClientXY(pointer, dest.client);
  5100. dest.timeStamp = timeStamp;
  5101. }
  5102. function getTouchPair(event) {
  5103. const touches = [];
  5104. if (is.array(event)) {
  5105. touches[0] = event[0];
  5106. touches[1] = event[1];
  5107. } else {
  5108. if (event.type === "touchend") {
  5109. if (event.touches.length === 1) {
  5110. touches[0] = event.touches[0];
  5111. touches[1] = event.changedTouches[0];
  5112. } else if (event.touches.length === 0) {
  5113. touches[0] = event.changedTouches[0];
  5114. touches[1] = event.changedTouches[1];
  5115. }
  5116. } else {
  5117. touches[0] = event.touches[0];
  5118. touches[1] = event.touches[1];
  5119. }
  5120. }
  5121. return touches;
  5122. }
  5123. function pointerAverage(pointers) {
  5124. const average = {
  5125. pageX: 0,
  5126. pageY: 0,
  5127. clientX: 0,
  5128. clientY: 0,
  5129. screenX: 0,
  5130. screenY: 0
  5131. };
  5132. for (const pointer of pointers) {
  5133. for (const prop in average) {
  5134. average[prop] += pointer[prop];
  5135. }
  5136. }
  5137. for (const prop in average) {
  5138. average[prop] /= pointers.length;
  5139. }
  5140. return average;
  5141. }
  5142. function touchBBox(event) {
  5143. if (!event.length) {
  5144. return null;
  5145. }
  5146. const touches = getTouchPair(event);
  5147. const minX = Math.min(touches[0].pageX, touches[1].pageX);
  5148. const minY = Math.min(touches[0].pageY, touches[1].pageY);
  5149. const maxX = Math.max(touches[0].pageX, touches[1].pageX);
  5150. const maxY = Math.max(touches[0].pageY, touches[1].pageY);
  5151. return {
  5152. x: minX,
  5153. y: minY,
  5154. left: minX,
  5155. top: minY,
  5156. right: maxX,
  5157. bottom: maxY,
  5158. width: maxX - minX,
  5159. height: maxY - minY
  5160. };
  5161. }
  5162. function touchDistance(event, deltaSource) {
  5163. const sourceX = deltaSource + "X";
  5164. const sourceY = deltaSource + "Y";
  5165. const touches = getTouchPair(event);
  5166. const dx = touches[0][sourceX] - touches[1][sourceX];
  5167. const dy = touches[0][sourceY] - touches[1][sourceY];
  5168. return hypot(dx, dy);
  5169. }
  5170. function touchAngle(event, deltaSource) {
  5171. const sourceX = deltaSource + "X";
  5172. const sourceY = deltaSource + "Y";
  5173. const touches = getTouchPair(event);
  5174. const dx = touches[1][sourceX] - touches[0][sourceX];
  5175. const dy = touches[1][sourceY] - touches[0][sourceY];
  5176. const angle = 180 * Math.atan2(dy, dx) / Math.PI;
  5177. return angle;
  5178. }
  5179. function getPointerType(pointer) {
  5180. return is.string(pointer.pointerType) ? pointer.pointerType : is.number(pointer.pointerType) ? [void 0, void 0, "touch", "pen", "mouse"][pointer.pointerType] : /touch/.test(pointer.type) || pointer instanceof utils_domObjects.Touch ? "touch" : "mouse";
  5181. }
  5182. function getEventTargets(event) {
  5183. const path = is.func(event.composedPath) ? event.composedPath() : event.path;
  5184. return [getActualElement(path ? path[0] : event.target), getActualElement(event.currentTarget)];
  5185. }
  5186. function newCoords() {
  5187. return {
  5188. page: {
  5189. x: 0,
  5190. y: 0
  5191. },
  5192. client: {
  5193. x: 0,
  5194. y: 0
  5195. },
  5196. timeStamp: 0
  5197. };
  5198. }
  5199. function coordsToEvent(coords) {
  5200. const event = {
  5201. coords,
  5202. get page() {
  5203. return this.coords.page;
  5204. },
  5205. get client() {
  5206. return this.coords.client;
  5207. },
  5208. get timeStamp() {
  5209. return this.coords.timeStamp;
  5210. },
  5211. get pageX() {
  5212. return this.coords.page.x;
  5213. },
  5214. get pageY() {
  5215. return this.coords.page.y;
  5216. },
  5217. get clientX() {
  5218. return this.coords.client.x;
  5219. },
  5220. get clientY() {
  5221. return this.coords.client.y;
  5222. },
  5223. get pointerId() {
  5224. return this.coords.pointerId;
  5225. },
  5226. get target() {
  5227. return this.coords.target;
  5228. },
  5229. get type() {
  5230. return this.coords.type;
  5231. },
  5232. get pointerType() {
  5233. return this.coords.pointerType;
  5234. },
  5235. get buttons() {
  5236. return this.coords.buttons;
  5237. },
  5238. preventDefault() {
  5239. }
  5240. };
  5241. return event;
  5242. }
  5243. function events_install(scope) {
  5244. const targets = [];
  5245. const delegatedEvents = {};
  5246. const documents = [];
  5247. const eventsMethods = {
  5248. add,
  5249. remove,
  5250. addDelegate,
  5251. removeDelegate,
  5252. delegateListener,
  5253. delegateUseCapture,
  5254. delegatedEvents,
  5255. documents,
  5256. targets,
  5257. supportsOptions: false,
  5258. supportsPassive: false
  5259. };
  5260. scope.document.createElement("div").addEventListener("test", null, {
  5261. get capture() {
  5262. return eventsMethods.supportsOptions = true;
  5263. },
  5264. get passive() {
  5265. return eventsMethods.supportsPassive = true;
  5266. }
  5267. });
  5268. scope.events = eventsMethods;
  5269. function add(eventTarget, type, listener, optionalArg) {
  5270. const options = getOptions(optionalArg);
  5271. let target = find(targets, (t) => t.eventTarget === eventTarget);
  5272. if (!target) {
  5273. target = {
  5274. eventTarget,
  5275. events: {}
  5276. };
  5277. targets.push(target);
  5278. }
  5279. if (!target.events[type]) {
  5280. target.events[type] = [];
  5281. }
  5282. if (eventTarget.addEventListener && !contains(target.events[type], listener)) {
  5283. eventTarget.addEventListener(type, listener, eventsMethods.supportsOptions ? options : options.capture);
  5284. target.events[type].push(listener);
  5285. }
  5286. }
  5287. function remove(eventTarget, type, listener, optionalArg) {
  5288. const options = getOptions(optionalArg);
  5289. const targetIndex = findIndex(targets, (t) => t.eventTarget === eventTarget);
  5290. const target = targets[targetIndex];
  5291. if (!target || !target.events) {
  5292. return;
  5293. }
  5294. if (type === "all") {
  5295. for (type in target.events) {
  5296. if (target.events.hasOwnProperty(type)) {
  5297. remove(eventTarget, type, "all");
  5298. }
  5299. }
  5300. return;
  5301. }
  5302. let typeIsEmpty = false;
  5303. const typeListeners = target.events[type];
  5304. if (typeListeners) {
  5305. if (listener === "all") {
  5306. for (let i = typeListeners.length - 1; i >= 0; i--) {
  5307. remove(eventTarget, type, typeListeners[i], options);
  5308. }
  5309. return;
  5310. } else {
  5311. for (let i = 0; i < typeListeners.length; i++) {
  5312. if (typeListeners[i] === listener) {
  5313. eventTarget.removeEventListener(type, listener, eventsMethods.supportsOptions ? options : options.capture);
  5314. typeListeners.splice(i, 1);
  5315. if (typeListeners.length === 0) {
  5316. delete target.events[type];
  5317. typeIsEmpty = true;
  5318. }
  5319. break;
  5320. }
  5321. }
  5322. }
  5323. }
  5324. if (typeIsEmpty && !Object.keys(target.events).length) {
  5325. targets.splice(targetIndex, 1);
  5326. }
  5327. }
  5328. function addDelegate(selector, context, type, listener, optionalArg) {
  5329. const options = getOptions(optionalArg);
  5330. if (!delegatedEvents[type]) {
  5331. delegatedEvents[type] = [];
  5332. for (const doc of documents) {
  5333. add(doc, type, delegateListener);
  5334. add(doc, type, delegateUseCapture, true);
  5335. }
  5336. }
  5337. const delegates = delegatedEvents[type];
  5338. let delegate = find(delegates, (d) => d.selector === selector && d.context === context);
  5339. if (!delegate) {
  5340. delegate = {
  5341. selector,
  5342. context,
  5343. listeners: []
  5344. };
  5345. delegates.push(delegate);
  5346. }
  5347. delegate.listeners.push([listener, options]);
  5348. }
  5349. function removeDelegate(selector, context, type, listener, optionalArg) {
  5350. const options = getOptions(optionalArg);
  5351. const delegates = delegatedEvents[type];
  5352. let matchFound = false;
  5353. let index;
  5354. if (!delegates) {
  5355. return;
  5356. }
  5357. for (index = delegates.length - 1; index >= 0; index--) {
  5358. const cur = delegates[index];
  5359. if (cur.selector === selector && cur.context === context) {
  5360. const {
  5361. listeners
  5362. } = cur;
  5363. for (let i = listeners.length - 1; i >= 0; i--) {
  5364. const [fn, {
  5365. capture,
  5366. passive
  5367. }] = listeners[i];
  5368. if (fn === listener && capture === options.capture && passive === options.passive) {
  5369. listeners.splice(i, 1);
  5370. if (!listeners.length) {
  5371. delegates.splice(index, 1);
  5372. remove(context, type, delegateListener);
  5373. remove(context, type, delegateUseCapture, true);
  5374. }
  5375. matchFound = true;
  5376. break;
  5377. }
  5378. }
  5379. if (matchFound) {
  5380. break;
  5381. }
  5382. }
  5383. }
  5384. }
  5385. function delegateListener(event, optionalArg) {
  5386. const options = getOptions(optionalArg);
  5387. const fakeEvent = new events_FakeEvent(event);
  5388. const delegates = delegatedEvents[event.type];
  5389. const [eventTarget] = getEventTargets(event);
  5390. let element = eventTarget;
  5391. while (is.element(element)) {
  5392. for (let i = 0; i < delegates.length; i++) {
  5393. const cur = delegates[i];
  5394. const {
  5395. selector,
  5396. context
  5397. } = cur;
  5398. if (matchesSelector(element, selector) && nodeContains(context, eventTarget) && nodeContains(context, element)) {
  5399. const {
  5400. listeners
  5401. } = cur;
  5402. fakeEvent.currentTarget = element;
  5403. for (const [fn, {
  5404. capture,
  5405. passive
  5406. }] of listeners) {
  5407. if (capture === options.capture && passive === options.passive) {
  5408. fn(fakeEvent);
  5409. }
  5410. }
  5411. }
  5412. }
  5413. element = parentNode(element);
  5414. }
  5415. }
  5416. function delegateUseCapture(event) {
  5417. return delegateListener.call(this, event, true);
  5418. }
  5419. return eventsMethods;
  5420. }
  5421. class events_FakeEvent {
  5422. constructor(originalEvent) {
  5423. this.currentTarget = void 0;
  5424. this.originalEvent = void 0;
  5425. this.type = void 0;
  5426. this.originalEvent = originalEvent;
  5427. utils_pointerExtend(this, originalEvent);
  5428. }
  5429. preventOriginalDefault() {
  5430. this.originalEvent.preventDefault();
  5431. }
  5432. stopPropagation() {
  5433. this.originalEvent.stopPropagation();
  5434. }
  5435. stopImmediatePropagation() {
  5436. this.originalEvent.stopImmediatePropagation();
  5437. }
  5438. }
  5439. function getOptions(param) {
  5440. if (!is.object(param)) {
  5441. return {
  5442. capture: !!param,
  5443. passive: false
  5444. };
  5445. }
  5446. const options = extend({}, param);
  5447. options.capture = !!param.capture;
  5448. options.passive = !!param.passive;
  5449. return options;
  5450. }
  5451. var events = {
  5452. id: "events",
  5453. install: events_install
  5454. };
  5455. function warnOnce(method, message) {
  5456. let warned = false;
  5457. return function() {
  5458. if (!warned) {
  5459. win.console.warn(message);
  5460. warned = true;
  5461. }
  5462. return method.apply(this, arguments);
  5463. };
  5464. }
  5465. function copyAction(dest, src2) {
  5466. dest.name = src2.name;
  5467. dest.axis = src2.axis;
  5468. dest.edges = src2.edges;
  5469. return dest;
  5470. }
  5471. function createInteractStatic(scope) {
  5472. const interact = (target, options) => {
  5473. let interactable = scope.interactables.get(target, options);
  5474. if (!interactable) {
  5475. interactable = scope.interactables.new(target, options);
  5476. interactable.events.global = interact.globalEvents;
  5477. }
  5478. return interactable;
  5479. };
  5480. interact.getPointerAverage = pointerAverage;
  5481. interact.getTouchBBox = touchBBox;
  5482. interact.getTouchDistance = touchDistance;
  5483. interact.getTouchAngle = touchAngle;
  5484. interact.getElementRect = getElementRect;
  5485. interact.getElementClientRect = getElementClientRect;
  5486. interact.matchesSelector = matchesSelector;
  5487. interact.closest = domUtils_closest;
  5488. interact.globalEvents = {};
  5489. interact.version = "1.10.2";
  5490. interact.scope = scope;
  5491. interact.use = function(plugin, options) {
  5492. this.scope.usePlugin(plugin, options);
  5493. return this;
  5494. };
  5495. interact.isSet = function(target, options) {
  5496. return !!this.scope.interactables.get(target, options && options.context);
  5497. };
  5498. interact.on = warnOnce(function on(type, listener, options) {
  5499. if (is.string(type) && type.search(" ") !== -1) {
  5500. type = type.trim().split(/ +/);
  5501. }
  5502. if (is.array(type)) {
  5503. for (const eventType of type) {
  5504. this.on(eventType, listener, options);
  5505. }
  5506. return this;
  5507. }
  5508. if (is.object(type)) {
  5509. for (const prop in type) {
  5510. this.on(prop, type[prop], listener);
  5511. }
  5512. return this;
  5513. }
  5514. if (isNonNativeEvent(type, this.scope.actions)) {
  5515. if (!this.globalEvents[type]) {
  5516. this.globalEvents[type] = [listener];
  5517. } else {
  5518. this.globalEvents[type].push(listener);
  5519. }
  5520. } else {
  5521. this.scope.events.add(this.scope.document, type, listener, {
  5522. options
  5523. });
  5524. }
  5525. return this;
  5526. }, "The interact.on() method is being deprecated");
  5527. interact.off = warnOnce(function off(type, listener, options) {
  5528. if (is.string(type) && type.search(" ") !== -1) {
  5529. type = type.trim().split(/ +/);
  5530. }
  5531. if (is.array(type)) {
  5532. for (const eventType of type) {
  5533. this.off(eventType, listener, options);
  5534. }
  5535. return this;
  5536. }
  5537. if (is.object(type)) {
  5538. for (const prop in type) {
  5539. this.off(prop, type[prop], listener);
  5540. }
  5541. return this;
  5542. }
  5543. if (isNonNativeEvent(type, this.scope.actions)) {
  5544. let index;
  5545. if (type in this.globalEvents && (index = this.globalEvents[type].indexOf(listener)) !== -1) {
  5546. this.globalEvents[type].splice(index, 1);
  5547. }
  5548. } else {
  5549. this.scope.events.remove(this.scope.document, type, listener, options);
  5550. }
  5551. return this;
  5552. }, "The interact.off() method is being deprecated");
  5553. interact.debug = function() {
  5554. return this.scope;
  5555. };
  5556. interact.supportsTouch = function() {
  5557. return utils_browser.supportsTouch;
  5558. };
  5559. interact.supportsPointerEvent = function() {
  5560. return utils_browser.supportsPointerEvent;
  5561. };
  5562. interact.stop = function() {
  5563. for (const interaction of this.scope.interactions.list) {
  5564. interaction.stop();
  5565. }
  5566. return this;
  5567. };
  5568. interact.pointerMoveTolerance = function(newValue) {
  5569. if (is.number(newValue)) {
  5570. this.scope.interactions.pointerMoveTolerance = newValue;
  5571. return this;
  5572. }
  5573. return this.scope.interactions.pointerMoveTolerance;
  5574. };
  5575. interact.addDocument = function(doc, options) {
  5576. this.scope.addDocument(doc, options);
  5577. };
  5578. interact.removeDocument = function(doc) {
  5579. this.scope.removeDocument(doc);
  5580. };
  5581. return interact;
  5582. }
  5583. class PointerInfo {
  5584. constructor(id, pointer, event, downTime, downTarget) {
  5585. this.id = void 0;
  5586. this.pointer = void 0;
  5587. this.event = void 0;
  5588. this.downTime = void 0;
  5589. this.downTarget = void 0;
  5590. this.id = id;
  5591. this.pointer = pointer;
  5592. this.event = event;
  5593. this.downTime = downTime;
  5594. this.downTarget = downTarget;
  5595. }
  5596. }
  5597. let _ProxyValues;
  5598. (function(_ProxyValues2) {
  5599. _ProxyValues2["interactable"] = "";
  5600. _ProxyValues2["element"] = "";
  5601. _ProxyValues2["prepared"] = "";
  5602. _ProxyValues2["pointerIsDown"] = "";
  5603. _ProxyValues2["pointerWasMoved"] = "";
  5604. _ProxyValues2["_proxy"] = "";
  5605. })(_ProxyValues || (_ProxyValues = {}));
  5606. let _ProxyMethods;
  5607. (function(_ProxyMethods2) {
  5608. _ProxyMethods2["start"] = "";
  5609. _ProxyMethods2["move"] = "";
  5610. _ProxyMethods2["end"] = "";
  5611. _ProxyMethods2["stop"] = "";
  5612. _ProxyMethods2["interacting"] = "";
  5613. })(_ProxyMethods || (_ProxyMethods = {}));
  5614. let idCounter = 0;
  5615. class Interaction_Interaction {
  5616. // current interactable being interacted with
  5617. // the target element of the interactable
  5618. // action that's ready to be fired on next move event
  5619. // keep track of added pointers
  5620. // pointerdown/mousedown/touchstart event
  5621. // previous action event
  5622. /** @internal */
  5623. get pointerMoveTolerance() {
  5624. return 1;
  5625. }
  5626. /**
  5627. * @alias Interaction.prototype.move
  5628. */
  5629. /** */
  5630. constructor({
  5631. pointerType,
  5632. scopeFire
  5633. }) {
  5634. this.interactable = null;
  5635. this.element = null;
  5636. this.rect = void 0;
  5637. this._rects = void 0;
  5638. this.edges = void 0;
  5639. this._scopeFire = void 0;
  5640. this.prepared = {
  5641. name: null,
  5642. axis: null,
  5643. edges: null
  5644. };
  5645. this.pointerType = void 0;
  5646. this.pointers = [];
  5647. this.downEvent = null;
  5648. this.downPointer = {};
  5649. this._latestPointer = {
  5650. pointer: null,
  5651. event: null,
  5652. eventTarget: null
  5653. };
  5654. this.prevEvent = null;
  5655. this.pointerIsDown = false;
  5656. this.pointerWasMoved = false;
  5657. this._interacting = false;
  5658. this._ending = false;
  5659. this._stopped = true;
  5660. this._proxy = null;
  5661. this.simulation = null;
  5662. this.doMove = warnOnce(function(signalArg) {
  5663. this.move(signalArg);
  5664. }, "The interaction.doMove() method has been renamed to interaction.move()");
  5665. this.coords = {
  5666. // Starting InteractEvent pointer coordinates
  5667. start: newCoords(),
  5668. // Previous native pointer move event coordinates
  5669. prev: newCoords(),
  5670. // current native pointer move event coordinates
  5671. cur: newCoords(),
  5672. // Change in coordinates and time of the pointer
  5673. delta: newCoords(),
  5674. // pointer velocity
  5675. velocity: newCoords()
  5676. };
  5677. this._id = idCounter++;
  5678. this._scopeFire = scopeFire;
  5679. this.pointerType = pointerType;
  5680. const that = this;
  5681. this._proxy = {};
  5682. for (const key in _ProxyValues) {
  5683. Object.defineProperty(this._proxy, key, {
  5684. get() {
  5685. return that[key];
  5686. }
  5687. });
  5688. }
  5689. for (const key in _ProxyMethods) {
  5690. Object.defineProperty(this._proxy, key, {
  5691. value: (...args) => that[key](...args)
  5692. });
  5693. }
  5694. this._scopeFire("interactions:new", {
  5695. interaction: this
  5696. });
  5697. }
  5698. pointerDown(pointer, event, eventTarget) {
  5699. const pointerIndex = this.updatePointer(pointer, event, eventTarget, true);
  5700. const pointerInfo = this.pointers[pointerIndex];
  5701. this._scopeFire("interactions:down", {
  5702. pointer,
  5703. event,
  5704. eventTarget,
  5705. pointerIndex,
  5706. pointerInfo,
  5707. type: "down",
  5708. interaction: this
  5709. });
  5710. }
  5711. /**
  5712. * ```js
  5713. * interact(target)
  5714. * .draggable({
  5715. * // disable the default drag start by down->move
  5716. * manualStart: true
  5717. * })
  5718. * // start dragging after the user holds the pointer down
  5719. * .on('hold', function (event) {
  5720. * var interaction = event.interaction
  5721. *
  5722. * if (!interaction.interacting()) {
  5723. * interaction.start({ name: 'drag' },
  5724. * event.interactable,
  5725. * event.currentTarget)
  5726. * }
  5727. * })
  5728. * ```
  5729. *
  5730. * Start an action with the given Interactable and Element as tartgets. The
  5731. * action must be enabled for the target Interactable and an appropriate
  5732. * number of pointers must be held down - 1 for drag/resize, 2 for gesture.
  5733. *
  5734. * Use it with `interactable.<action>able({ manualStart: false })` to always
  5735. * [start actions manually](https://github.com/taye/interact.js/issues/114)
  5736. *
  5737. * @param {object} action The action to be performed - drag, resize, etc.
  5738. * @param {Interactable} target The Interactable to target
  5739. * @param {Element} element The DOM Element to target
  5740. * @return {Boolean} Whether the interaction was successfully started
  5741. */
  5742. start(action, interactable, element) {
  5743. if (this.interacting() || !this.pointerIsDown || this.pointers.length < (action.name === "gesture" ? 2 : 1) || !interactable.options[action.name].enabled) {
  5744. return false;
  5745. }
  5746. copyAction(this.prepared, action);
  5747. this.interactable = interactable;
  5748. this.element = element;
  5749. this.rect = interactable.getRect(element);
  5750. this.edges = this.prepared.edges ? extend({}, this.prepared.edges) : {
  5751. left: true,
  5752. right: true,
  5753. top: true,
  5754. bottom: true
  5755. };
  5756. this._stopped = false;
  5757. this._interacting = this._doPhase({
  5758. interaction: this,
  5759. event: this.downEvent,
  5760. phase: "start"
  5761. }) && !this._stopped;
  5762. return this._interacting;
  5763. }
  5764. pointerMove(pointer, event, eventTarget) {
  5765. if (!this.simulation && !(this.modification && this.modification.endResult)) {
  5766. this.updatePointer(pointer, event, eventTarget, false);
  5767. }
  5768. const duplicateMove = this.coords.cur.page.x === this.coords.prev.page.x && this.coords.cur.page.y === this.coords.prev.page.y && this.coords.cur.client.x === this.coords.prev.client.x && this.coords.cur.client.y === this.coords.prev.client.y;
  5769. let dx;
  5770. let dy;
  5771. if (this.pointerIsDown && !this.pointerWasMoved) {
  5772. dx = this.coords.cur.client.x - this.coords.start.client.x;
  5773. dy = this.coords.cur.client.y - this.coords.start.client.y;
  5774. this.pointerWasMoved = hypot(dx, dy) > this.pointerMoveTolerance;
  5775. }
  5776. const pointerIndex = this.getPointerIndex(pointer);
  5777. const signalArg = {
  5778. pointer,
  5779. pointerIndex,
  5780. pointerInfo: this.pointers[pointerIndex],
  5781. event,
  5782. type: "move",
  5783. eventTarget,
  5784. dx,
  5785. dy,
  5786. duplicate: duplicateMove,
  5787. interaction: this
  5788. };
  5789. if (!duplicateMove) {
  5790. setCoordVelocity(this.coords.velocity, this.coords.delta);
  5791. }
  5792. this._scopeFire("interactions:move", signalArg);
  5793. if (!duplicateMove && !this.simulation) {
  5794. if (this.interacting()) {
  5795. signalArg.type = null;
  5796. this.move(signalArg);
  5797. }
  5798. if (this.pointerWasMoved) {
  5799. copyCoords(this.coords.prev, this.coords.cur);
  5800. }
  5801. }
  5802. }
  5803. /**
  5804. * ```js
  5805. * interact(target)
  5806. * .draggable(true)
  5807. * .on('dragmove', function (event) {
  5808. * if (someCondition) {
  5809. * // change the snap settings
  5810. * event.interactable.draggable({ snap: { targets: [] }})
  5811. * // fire another move event with re-calculated snap
  5812. * event.interaction.move()
  5813. * }
  5814. * })
  5815. * ```
  5816. *
  5817. * Force a move of the current action at the same coordinates. Useful if
  5818. * snap/restrict has been changed and you want a movement with the new
  5819. * settings.
  5820. */
  5821. move(signalArg) {
  5822. if (!signalArg || !signalArg.event) {
  5823. setZeroCoords(this.coords.delta);
  5824. }
  5825. signalArg = extend({
  5826. pointer: this._latestPointer.pointer,
  5827. event: this._latestPointer.event,
  5828. eventTarget: this._latestPointer.eventTarget,
  5829. interaction: this
  5830. }, signalArg || {});
  5831. signalArg.phase = "move";
  5832. this._doPhase(signalArg);
  5833. }
  5834. // End interact move events and stop auto-scroll unless simulation is running
  5835. pointerUp(pointer, event, eventTarget, curEventTarget) {
  5836. let pointerIndex = this.getPointerIndex(pointer);
  5837. if (pointerIndex === -1) {
  5838. pointerIndex = this.updatePointer(pointer, event, eventTarget, false);
  5839. }
  5840. const type = /cancel$/i.test(event.type) ? "cancel" : "up";
  5841. this._scopeFire(`interactions:${type}`, {
  5842. pointer,
  5843. pointerIndex,
  5844. pointerInfo: this.pointers[pointerIndex],
  5845. event,
  5846. eventTarget,
  5847. type,
  5848. curEventTarget,
  5849. interaction: this
  5850. });
  5851. if (!this.simulation) {
  5852. this.end(event);
  5853. }
  5854. this.removePointer(pointer, event);
  5855. }
  5856. documentBlur(event) {
  5857. this.end(event);
  5858. this._scopeFire("interactions:blur", {
  5859. event,
  5860. type: "blur",
  5861. interaction: this
  5862. });
  5863. }
  5864. /**
  5865. * ```js
  5866. * interact(target)
  5867. * .draggable(true)
  5868. * .on('move', function (event) {
  5869. * if (event.pageX > 1000) {
  5870. * // end the current action
  5871. * event.interaction.end()
  5872. * // stop all further listeners from being called
  5873. * event.stopImmediatePropagation()
  5874. * }
  5875. * })
  5876. * ```
  5877. *
  5878. * @param {PointerEvent} [event]
  5879. */
  5880. end(event) {
  5881. this._ending = true;
  5882. event = event || this._latestPointer.event;
  5883. let endPhaseResult;
  5884. if (this.interacting()) {
  5885. endPhaseResult = this._doPhase({
  5886. event,
  5887. interaction: this,
  5888. phase: "end"
  5889. });
  5890. }
  5891. this._ending = false;
  5892. if (endPhaseResult === true) {
  5893. this.stop();
  5894. }
  5895. }
  5896. currentAction() {
  5897. return this._interacting ? this.prepared.name : null;
  5898. }
  5899. interacting() {
  5900. return this._interacting;
  5901. }
  5902. /** */
  5903. stop() {
  5904. this._scopeFire("interactions:stop", {
  5905. interaction: this
  5906. });
  5907. this.interactable = this.element = null;
  5908. this._interacting = false;
  5909. this._stopped = true;
  5910. this.prepared.name = this.prevEvent = null;
  5911. }
  5912. getPointerIndex(pointer) {
  5913. const pointerId = getPointerId(pointer);
  5914. return this.pointerType === "mouse" || this.pointerType === "pen" ? this.pointers.length - 1 : findIndex(this.pointers, (curPointer) => curPointer.id === pointerId);
  5915. }
  5916. getPointerInfo(pointer) {
  5917. return this.pointers[this.getPointerIndex(pointer)];
  5918. }
  5919. updatePointer(pointer, event, eventTarget, down) {
  5920. const id = getPointerId(pointer);
  5921. let pointerIndex = this.getPointerIndex(pointer);
  5922. let pointerInfo = this.pointers[pointerIndex];
  5923. down = down === false ? false : down || /(down|start)$/i.test(event.type);
  5924. if (!pointerInfo) {
  5925. pointerInfo = new PointerInfo(id, pointer, event, null, null);
  5926. pointerIndex = this.pointers.length;
  5927. this.pointers.push(pointerInfo);
  5928. } else {
  5929. pointerInfo.pointer = pointer;
  5930. }
  5931. setCoords(this.coords.cur, this.pointers.map((p) => p.pointer), this._now());
  5932. setCoordDeltas(this.coords.delta, this.coords.prev, this.coords.cur);
  5933. if (down) {
  5934. this.pointerIsDown = true;
  5935. pointerInfo.downTime = this.coords.cur.timeStamp;
  5936. pointerInfo.downTarget = eventTarget;
  5937. utils_pointerExtend(this.downPointer, pointer);
  5938. if (!this.interacting()) {
  5939. copyCoords(this.coords.start, this.coords.cur);
  5940. copyCoords(this.coords.prev, this.coords.cur);
  5941. this.downEvent = event;
  5942. this.pointerWasMoved = false;
  5943. }
  5944. }
  5945. this._updateLatestPointer(pointer, event, eventTarget);
  5946. this._scopeFire("interactions:update-pointer", {
  5947. pointer,
  5948. event,
  5949. eventTarget,
  5950. down,
  5951. pointerInfo,
  5952. pointerIndex,
  5953. interaction: this
  5954. });
  5955. return pointerIndex;
  5956. }
  5957. removePointer(pointer, event) {
  5958. const pointerIndex = this.getPointerIndex(pointer);
  5959. if (pointerIndex === -1) {
  5960. return;
  5961. }
  5962. const pointerInfo = this.pointers[pointerIndex];
  5963. this._scopeFire("interactions:remove-pointer", {
  5964. pointer,
  5965. event,
  5966. eventTarget: null,
  5967. pointerIndex,
  5968. pointerInfo,
  5969. interaction: this
  5970. });
  5971. this.pointers.splice(pointerIndex, 1);
  5972. this.pointerIsDown = false;
  5973. }
  5974. _updateLatestPointer(pointer, event, eventTarget) {
  5975. this._latestPointer.pointer = pointer;
  5976. this._latestPointer.event = event;
  5977. this._latestPointer.eventTarget = eventTarget;
  5978. }
  5979. destroy() {
  5980. this._latestPointer.pointer = null;
  5981. this._latestPointer.event = null;
  5982. this._latestPointer.eventTarget = null;
  5983. }
  5984. _createPreparedEvent(event, phase, preEnd, type) {
  5985. return new InteractEvent_InteractEvent(this, event, this.prepared.name, phase, this.element, preEnd, type);
  5986. }
  5987. _fireEvent(iEvent) {
  5988. this.interactable.fire(iEvent);
  5989. if (!this.prevEvent || iEvent.timeStamp >= this.prevEvent.timeStamp) {
  5990. this.prevEvent = iEvent;
  5991. }
  5992. }
  5993. _doPhase(signalArg) {
  5994. const {
  5995. event,
  5996. phase,
  5997. preEnd,
  5998. type
  5999. } = signalArg;
  6000. const {
  6001. rect
  6002. } = this;
  6003. if (rect && phase === "move") {
  6004. addEdges(this.edges, rect, this.coords.delta[this.interactable.options.deltaSource]);
  6005. rect.width = rect.right - rect.left;
  6006. rect.height = rect.bottom - rect.top;
  6007. }
  6008. const beforeResult = this._scopeFire(`interactions:before-action-${phase}`, signalArg);
  6009. if (beforeResult === false) {
  6010. return false;
  6011. }
  6012. const iEvent = signalArg.iEvent = this._createPreparedEvent(event, phase, preEnd, type);
  6013. this._scopeFire(`interactions:action-${phase}`, signalArg);
  6014. if (phase === "start") {
  6015. this.prevEvent = iEvent;
  6016. }
  6017. this._fireEvent(iEvent);
  6018. this._scopeFire(`interactions:after-action-${phase}`, signalArg);
  6019. return true;
  6020. }
  6021. _now() {
  6022. return Date.now();
  6023. }
  6024. }
  6025. var core_Interaction = Interaction_Interaction;
  6026. function preventDefault(newValue) {
  6027. if (/^(always|never|auto)$/.test(newValue)) {
  6028. this.options.preventDefault = newValue;
  6029. return this;
  6030. }
  6031. if (is.bool(newValue)) {
  6032. this.options.preventDefault = newValue ? "always" : "never";
  6033. return this;
  6034. }
  6035. return this.options.preventDefault;
  6036. }
  6037. function checkAndPreventDefault(interactable, scope, event) {
  6038. const setting = interactable.options.preventDefault;
  6039. if (setting === "never") {
  6040. return;
  6041. }
  6042. if (setting === "always") {
  6043. event.preventDefault();
  6044. return;
  6045. }
  6046. if (scope.events.supportsPassive && /^touch(start|move)$/.test(event.type)) {
  6047. const doc = getWindow(event.target).document;
  6048. const docOptions = scope.getDocOptions(doc);
  6049. if (!(docOptions && docOptions.events) || docOptions.events.passive !== false) {
  6050. return;
  6051. }
  6052. }
  6053. if (/^(mouse|pointer|touch)*(down|start)/i.test(event.type)) {
  6054. return;
  6055. }
  6056. if (is.element(event.target) && matchesSelector(event.target, "input,select,textarea,[contenteditable=true],[contenteditable=true] *")) {
  6057. return;
  6058. }
  6059. event.preventDefault();
  6060. }
  6061. function onInteractionEvent({
  6062. interaction,
  6063. event
  6064. }) {
  6065. if (interaction.interactable) {
  6066. interaction.interactable.checkAndPreventDefault(event);
  6067. }
  6068. }
  6069. function interactablePreventDefault_install(scope) {
  6070. const {
  6071. Interactable
  6072. } = scope;
  6073. Interactable.prototype.preventDefault = preventDefault;
  6074. Interactable.prototype.checkAndPreventDefault = function(event) {
  6075. return checkAndPreventDefault(this, scope, event);
  6076. };
  6077. scope.interactions.docEvents.push({
  6078. type: "dragstart",
  6079. listener(event) {
  6080. for (const interaction of scope.interactions.list) {
  6081. if (interaction.element && (interaction.element === event.target || nodeContains(interaction.element, event.target))) {
  6082. interaction.interactable.checkAndPreventDefault(event);
  6083. return;
  6084. }
  6085. }
  6086. }
  6087. });
  6088. }
  6089. var interactablePreventDefault = {
  6090. id: "core/interactablePreventDefault",
  6091. install: interactablePreventDefault_install,
  6092. listeners: ["down", "move", "up", "cancel"].reduce((acc, eventType) => {
  6093. acc[`interactions:${eventType}`] = onInteractionEvent;
  6094. return acc;
  6095. }, {})
  6096. };
  6097. const finder = {
  6098. methodOrder: ["simulationResume", "mouseOrPen", "hasPointer", "idle"],
  6099. search(details) {
  6100. for (const method of finder.methodOrder) {
  6101. const interaction = finder[method](details);
  6102. if (interaction) {
  6103. return interaction;
  6104. }
  6105. }
  6106. return null;
  6107. },
  6108. // try to resume simulation with a new pointer
  6109. simulationResume({
  6110. pointerType,
  6111. eventType,
  6112. eventTarget,
  6113. scope
  6114. }) {
  6115. if (!/down|start/i.test(eventType)) {
  6116. return null;
  6117. }
  6118. for (const interaction of scope.interactions.list) {
  6119. let element = eventTarget;
  6120. if (interaction.simulation && interaction.simulation.allowResume && interaction.pointerType === pointerType) {
  6121. while (element) {
  6122. if (element === interaction.element) {
  6123. return interaction;
  6124. }
  6125. element = parentNode(element);
  6126. }
  6127. }
  6128. }
  6129. return null;
  6130. },
  6131. // if it's a mouse or pen interaction
  6132. mouseOrPen({
  6133. pointerId,
  6134. pointerType,
  6135. eventType,
  6136. scope
  6137. }) {
  6138. if (pointerType !== "mouse" && pointerType !== "pen") {
  6139. return null;
  6140. }
  6141. let firstNonActive;
  6142. for (const interaction of scope.interactions.list) {
  6143. if (interaction.pointerType === pointerType) {
  6144. if (interaction.simulation && !hasPointerId(interaction, pointerId)) {
  6145. continue;
  6146. }
  6147. if (interaction.interacting()) {
  6148. return interaction;
  6149. } else if (!firstNonActive) {
  6150. firstNonActive = interaction;
  6151. }
  6152. }
  6153. }
  6154. if (firstNonActive) {
  6155. return firstNonActive;
  6156. }
  6157. for (const interaction of scope.interactions.list) {
  6158. if (interaction.pointerType === pointerType && !(/down/i.test(eventType) && interaction.simulation)) {
  6159. return interaction;
  6160. }
  6161. }
  6162. return null;
  6163. },
  6164. // get interaction that has this pointer
  6165. hasPointer({
  6166. pointerId,
  6167. scope
  6168. }) {
  6169. for (const interaction of scope.interactions.list) {
  6170. if (hasPointerId(interaction, pointerId)) {
  6171. return interaction;
  6172. }
  6173. }
  6174. return null;
  6175. },
  6176. // get first idle interaction with a matching pointerType
  6177. idle({
  6178. pointerType,
  6179. scope
  6180. }) {
  6181. for (const interaction of scope.interactions.list) {
  6182. if (interaction.pointers.length === 1) {
  6183. const target = interaction.interactable;
  6184. if (target && !(target.options.gesture && target.options.gesture.enabled)) {
  6185. continue;
  6186. }
  6187. } else if (interaction.pointers.length >= 2) {
  6188. continue;
  6189. }
  6190. if (!interaction.interacting() && pointerType === interaction.pointerType) {
  6191. return interaction;
  6192. }
  6193. }
  6194. return null;
  6195. }
  6196. };
  6197. function hasPointerId(interaction, pointerId) {
  6198. return interaction.pointers.some(({
  6199. id
  6200. }) => id === pointerId);
  6201. }
  6202. var interactionFinder = finder;
  6203. const methodNames = ["pointerDown", "pointerMove", "pointerUp", "updatePointer", "removePointer", "windowBlur"];
  6204. function interactions_install(scope) {
  6205. const listeners = {};
  6206. for (const method of methodNames) {
  6207. listeners[method] = doOnInteractions(method, scope);
  6208. }
  6209. const pEventTypes = utils_browser.pEventTypes;
  6210. let docEvents;
  6211. if (utils_domObjects.PointerEvent) {
  6212. docEvents = [{
  6213. type: pEventTypes.down,
  6214. listener: releasePointersOnRemovedEls
  6215. }, {
  6216. type: pEventTypes.down,
  6217. listener: listeners.pointerDown
  6218. }, {
  6219. type: pEventTypes.move,
  6220. listener: listeners.pointerMove
  6221. }, {
  6222. type: pEventTypes.up,
  6223. listener: listeners.pointerUp
  6224. }, {
  6225. type: pEventTypes.cancel,
  6226. listener: listeners.pointerUp
  6227. }];
  6228. } else {
  6229. docEvents = [{
  6230. type: "mousedown",
  6231. listener: listeners.pointerDown
  6232. }, {
  6233. type: "mousemove",
  6234. listener: listeners.pointerMove
  6235. }, {
  6236. type: "mouseup",
  6237. listener: listeners.pointerUp
  6238. }, {
  6239. type: "touchstart",
  6240. listener: releasePointersOnRemovedEls
  6241. }, {
  6242. type: "touchstart",
  6243. listener: listeners.pointerDown
  6244. }, {
  6245. type: "touchmove",
  6246. listener: listeners.pointerMove
  6247. }, {
  6248. type: "touchend",
  6249. listener: listeners.pointerUp
  6250. }, {
  6251. type: "touchcancel",
  6252. listener: listeners.pointerUp
  6253. }];
  6254. }
  6255. docEvents.push({
  6256. type: "blur",
  6257. listener(event) {
  6258. for (const interaction of scope.interactions.list) {
  6259. interaction.documentBlur(event);
  6260. }
  6261. }
  6262. });
  6263. scope.prevTouchTime = 0;
  6264. scope.Interaction = class extends core_Interaction {
  6265. get pointerMoveTolerance() {
  6266. return scope.interactions.pointerMoveTolerance;
  6267. }
  6268. set pointerMoveTolerance(value) {
  6269. scope.interactions.pointerMoveTolerance = value;
  6270. }
  6271. _now() {
  6272. return scope.now();
  6273. }
  6274. };
  6275. scope.interactions = {
  6276. // all active and idle interactions
  6277. list: [],
  6278. new(options) {
  6279. options.scopeFire = (name, arg) => scope.fire(name, arg);
  6280. const interaction = new scope.Interaction(options);
  6281. scope.interactions.list.push(interaction);
  6282. return interaction;
  6283. },
  6284. listeners,
  6285. docEvents,
  6286. pointerMoveTolerance: 1
  6287. };
  6288. function releasePointersOnRemovedEls() {
  6289. for (const interaction of scope.interactions.list) {
  6290. if (!interaction.pointerIsDown || interaction.pointerType !== "touch" || interaction._interacting) {
  6291. continue;
  6292. }
  6293. for (const pointer of interaction.pointers) {
  6294. if (!scope.documents.some(({
  6295. doc
  6296. }) => nodeContains(doc, pointer.downTarget))) {
  6297. interaction.removePointer(pointer.pointer, pointer.event);
  6298. }
  6299. }
  6300. }
  6301. }
  6302. scope.usePlugin(interactablePreventDefault);
  6303. }
  6304. function doOnInteractions(method, scope) {
  6305. return function(event) {
  6306. const interactions = scope.interactions.list;
  6307. const pointerType = getPointerType(event);
  6308. const [eventTarget, curEventTarget] = getEventTargets(event);
  6309. const matches = [];
  6310. if (/^touch/.test(event.type)) {
  6311. scope.prevTouchTime = scope.now();
  6312. for (const changedTouch of event.changedTouches) {
  6313. const pointer = changedTouch;
  6314. const pointerId = getPointerId(pointer);
  6315. const searchDetails = {
  6316. pointer,
  6317. pointerId,
  6318. pointerType,
  6319. eventType: event.type,
  6320. eventTarget,
  6321. curEventTarget,
  6322. scope
  6323. };
  6324. const interaction = getInteraction(searchDetails);
  6325. matches.push([searchDetails.pointer, searchDetails.eventTarget, searchDetails.curEventTarget, interaction]);
  6326. }
  6327. } else {
  6328. let invalidPointer = false;
  6329. if (!utils_browser.supportsPointerEvent && /mouse/.test(event.type)) {
  6330. for (let i = 0; i < interactions.length && !invalidPointer; i++) {
  6331. invalidPointer = interactions[i].pointerType !== "mouse" && interactions[i].pointerIsDown;
  6332. }
  6333. invalidPointer = invalidPointer || scope.now() - scope.prevTouchTime < 500 || // on iOS and Firefox Mobile, MouseEvent.timeStamp is zero if simulated
  6334. event.timeStamp === 0;
  6335. }
  6336. if (!invalidPointer) {
  6337. const searchDetails = {
  6338. pointer: event,
  6339. pointerId: getPointerId(event),
  6340. pointerType,
  6341. eventType: event.type,
  6342. curEventTarget,
  6343. eventTarget,
  6344. scope
  6345. };
  6346. const interaction = getInteraction(searchDetails);
  6347. matches.push([searchDetails.pointer, searchDetails.eventTarget, searchDetails.curEventTarget, interaction]);
  6348. }
  6349. }
  6350. for (const [pointer, eventTarget2, curEventTarget2, interaction] of matches) {
  6351. interaction[method](pointer, event, eventTarget2, curEventTarget2);
  6352. }
  6353. };
  6354. }
  6355. function getInteraction(searchDetails) {
  6356. const {
  6357. pointerType,
  6358. scope
  6359. } = searchDetails;
  6360. const foundInteraction = interactionFinder.search(searchDetails);
  6361. const signalArg = {
  6362. interaction: foundInteraction,
  6363. searchDetails
  6364. };
  6365. scope.fire("interactions:find", signalArg);
  6366. return signalArg.interaction || scope.interactions.new({
  6367. pointerType
  6368. });
  6369. }
  6370. function onDocSignal({
  6371. doc,
  6372. scope,
  6373. options
  6374. }, eventMethodName) {
  6375. const {
  6376. interactions: {
  6377. docEvents
  6378. },
  6379. events: events2
  6380. } = scope;
  6381. const eventMethod = events2[eventMethodName];
  6382. if (scope.browser.isIOS && !options.events) {
  6383. options.events = {
  6384. passive: false
  6385. };
  6386. }
  6387. for (const eventType in events2.delegatedEvents) {
  6388. eventMethod(doc, eventType, events2.delegateListener);
  6389. eventMethod(doc, eventType, events2.delegateUseCapture, true);
  6390. }
  6391. const eventOptions = options && options.events;
  6392. for (const {
  6393. type,
  6394. listener
  6395. } of docEvents) {
  6396. eventMethod(doc, type, listener, eventOptions);
  6397. }
  6398. }
  6399. const interactions_interactions = {
  6400. id: "core/interactions",
  6401. install: interactions_install,
  6402. listeners: {
  6403. "scope:add-document": (arg) => onDocSignal(arg, "add"),
  6404. "scope:remove-document": (arg) => onDocSignal(arg, "remove"),
  6405. "interactable:unset": ({
  6406. interactable
  6407. }, scope) => {
  6408. for (let i = scope.interactions.list.length - 1; i >= 0; i--) {
  6409. const interaction = scope.interactions.list[i];
  6410. if (interaction.interactable !== interactable) {
  6411. continue;
  6412. }
  6413. interaction.stop();
  6414. scope.fire("interactions:destroy", {
  6415. interaction
  6416. });
  6417. interaction.destroy();
  6418. if (scope.interactions.list.length > 2) {
  6419. scope.interactions.list.splice(i, 1);
  6420. }
  6421. }
  6422. }
  6423. },
  6424. onDocSignal,
  6425. doOnInteractions,
  6426. methodNames
  6427. };
  6428. var core_interactions = interactions_interactions;
  6429. class scope_Scope {
  6430. // main window
  6431. // main document
  6432. // main window
  6433. // all documents being listened to
  6434. constructor() {
  6435. this.id = `__interact_scope_${Math.floor(Math.random() * 100)}`;
  6436. this.isInitialized = false;
  6437. this.listenerMaps = [];
  6438. this.browser = utils_browser;
  6439. this.defaults = clone(defaultOptions_defaults);
  6440. this.Eventable = Eventable_Eventable;
  6441. this.actions = {
  6442. map: {},
  6443. phases: {
  6444. start: true,
  6445. move: true,
  6446. end: true
  6447. },
  6448. methodDict: {},
  6449. phaselessTypes: {}
  6450. };
  6451. this.interactStatic = createInteractStatic(this);
  6452. this.InteractEvent = InteractEvent_InteractEvent;
  6453. this.Interactable = void 0;
  6454. this.interactables = new InteractableSet_InteractableSet(this);
  6455. this._win = void 0;
  6456. this.document = void 0;
  6457. this.window = void 0;
  6458. this.documents = [];
  6459. this._plugins = {
  6460. list: [],
  6461. map: {}
  6462. };
  6463. this.onWindowUnload = (event) => this.removeDocument(event.target);
  6464. const scope = this;
  6465. this.Interactable = class extends Interactable_Interactable {
  6466. get _defaults() {
  6467. return scope.defaults;
  6468. }
  6469. set(options) {
  6470. super.set(options);
  6471. scope.fire("interactable:set", {
  6472. options,
  6473. interactable: this
  6474. });
  6475. return this;
  6476. }
  6477. unset() {
  6478. super.unset();
  6479. scope.interactables.list.splice(scope.interactables.list.indexOf(this), 1);
  6480. scope.fire("interactable:unset", {
  6481. interactable: this
  6482. });
  6483. }
  6484. };
  6485. }
  6486. addListeners(map, id) {
  6487. this.listenerMaps.push({
  6488. id,
  6489. map
  6490. });
  6491. }
  6492. fire(name, arg) {
  6493. for (const {
  6494. map: {
  6495. [name]: listener
  6496. }
  6497. } of this.listenerMaps) {
  6498. if (!!listener && listener(arg, this, name) === false) {
  6499. return false;
  6500. }
  6501. }
  6502. }
  6503. init(window2) {
  6504. return this.isInitialized ? this : initScope(this, window2);
  6505. }
  6506. pluginIsInstalled(plugin) {
  6507. return this._plugins.map[plugin.id] || this._plugins.list.indexOf(plugin) !== -1;
  6508. }
  6509. usePlugin(plugin, options) {
  6510. if (!this.isInitialized) {
  6511. return this;
  6512. }
  6513. if (this.pluginIsInstalled(plugin)) {
  6514. return this;
  6515. }
  6516. if (plugin.id) {
  6517. this._plugins.map[plugin.id] = plugin;
  6518. }
  6519. this._plugins.list.push(plugin);
  6520. if (plugin.install) {
  6521. plugin.install(this, options);
  6522. }
  6523. if (plugin.listeners && plugin.before) {
  6524. let index = 0;
  6525. const len = this.listenerMaps.length;
  6526. const before = plugin.before.reduce((acc, id) => {
  6527. acc[id] = true;
  6528. acc[pluginIdRoot(id)] = true;
  6529. return acc;
  6530. }, {});
  6531. for (; index < len; index++) {
  6532. const otherId = this.listenerMaps[index].id;
  6533. if (before[otherId] || before[pluginIdRoot(otherId)]) {
  6534. break;
  6535. }
  6536. }
  6537. this.listenerMaps.splice(index, 0, {
  6538. id: plugin.id,
  6539. map: plugin.listeners
  6540. });
  6541. } else if (plugin.listeners) {
  6542. this.listenerMaps.push({
  6543. id: plugin.id,
  6544. map: plugin.listeners
  6545. });
  6546. }
  6547. return this;
  6548. }
  6549. addDocument(doc, options) {
  6550. if (this.getDocIndex(doc) !== -1) {
  6551. return false;
  6552. }
  6553. const window2 = getWindow(doc);
  6554. options = options ? extend({}, options) : {};
  6555. this.documents.push({
  6556. doc,
  6557. options
  6558. });
  6559. this.events.documents.push(doc);
  6560. if (doc !== this.document) {
  6561. this.events.add(window2, "unload", this.onWindowUnload);
  6562. }
  6563. this.fire("scope:add-document", {
  6564. doc,
  6565. window: window2,
  6566. scope: this,
  6567. options
  6568. });
  6569. }
  6570. removeDocument(doc) {
  6571. const index = this.getDocIndex(doc);
  6572. const window2 = getWindow(doc);
  6573. const options = this.documents[index].options;
  6574. this.events.remove(window2, "unload", this.onWindowUnload);
  6575. this.documents.splice(index, 1);
  6576. this.events.documents.splice(index, 1);
  6577. this.fire("scope:remove-document", {
  6578. doc,
  6579. window: window2,
  6580. scope: this,
  6581. options
  6582. });
  6583. }
  6584. getDocIndex(doc) {
  6585. for (let i = 0; i < this.documents.length; i++) {
  6586. if (this.documents[i].doc === doc) {
  6587. return i;
  6588. }
  6589. }
  6590. return -1;
  6591. }
  6592. getDocOptions(doc) {
  6593. const docIndex = this.getDocIndex(doc);
  6594. return docIndex === -1 ? null : this.documents[docIndex].options;
  6595. }
  6596. now() {
  6597. return (this.window.Date || Date).now();
  6598. }
  6599. }
  6600. function initScope(scope, window2) {
  6601. scope.isInitialized = true;
  6602. window_init(window2);
  6603. utils_domObjects.init(window2);
  6604. utils_browser.init(window2);
  6605. raf.init(window2);
  6606. scope.window = window2;
  6607. scope.document = window2.document;
  6608. scope.usePlugin(core_interactions);
  6609. scope.usePlugin(events);
  6610. return scope;
  6611. }
  6612. function pluginIdRoot(id) {
  6613. return id && id.replace(/\/.*$/, "");
  6614. }
  6615. const interact_scope = new scope_Scope();
  6616. const interact_interact = interact_scope.interactStatic;
  6617. var _interactjs_interact = interact_interact;
  6618. const interact_init = (win2) => interact_scope.init(win2);
  6619. if (typeof window === "object" && !!window) {
  6620. interact_init(window);
  6621. }
  6622. function InteractableMethods_install(scope) {
  6623. const {
  6624. /** @lends Interactable */
  6625. Interactable
  6626. // tslint:disable-line no-shadowed-variable
  6627. } = scope;
  6628. Interactable.prototype.getAction = function getAction(pointer, event, interaction, element) {
  6629. const action = defaultActionChecker(this, event, interaction, element, scope);
  6630. if (this.options.actionChecker) {
  6631. return this.options.actionChecker(pointer, event, action, this, element, interaction);
  6632. }
  6633. return action;
  6634. };
  6635. Interactable.prototype.ignoreFrom = warnOnce(function(newValue) {
  6636. return this._backCompatOption("ignoreFrom", newValue);
  6637. }, "Interactable.ignoreFrom() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue}).");
  6638. Interactable.prototype.allowFrom = warnOnce(function(newValue) {
  6639. return this._backCompatOption("allowFrom", newValue);
  6640. }, "Interactable.allowFrom() has been deprecated. Use Interactble.draggable({allowFrom: newValue}).");
  6641. Interactable.prototype.actionChecker = actionChecker;
  6642. Interactable.prototype.styleCursor = styleCursor;
  6643. }
  6644. function defaultActionChecker(interactable, event, interaction, element, scope) {
  6645. const rect = interactable.getRect(element);
  6646. const buttons = event.buttons || {
  6647. 0: 1,
  6648. 1: 4,
  6649. 3: 8,
  6650. 4: 16
  6651. }[event.button];
  6652. const arg = {
  6653. action: null,
  6654. interactable,
  6655. interaction,
  6656. element,
  6657. rect,
  6658. buttons
  6659. };
  6660. scope.fire("auto-start:check", arg);
  6661. return arg.action;
  6662. }
  6663. function styleCursor(newValue) {
  6664. if (is.bool(newValue)) {
  6665. this.options.styleCursor = newValue;
  6666. return this;
  6667. }
  6668. if (newValue === null) {
  6669. delete this.options.styleCursor;
  6670. return this;
  6671. }
  6672. return this.options.styleCursor;
  6673. }
  6674. function actionChecker(checker) {
  6675. if (is.func(checker)) {
  6676. this.options.actionChecker = checker;
  6677. return this;
  6678. }
  6679. if (checker === null) {
  6680. delete this.options.actionChecker;
  6681. return this;
  6682. }
  6683. return this.options.actionChecker;
  6684. }
  6685. var InteractableMethods = {
  6686. id: "auto-start/interactableMethods",
  6687. install: InteractableMethods_install
  6688. };
  6689. function base_install(scope) {
  6690. const {
  6691. interactStatic: interact,
  6692. defaults
  6693. } = scope;
  6694. scope.usePlugin(InteractableMethods);
  6695. defaults.base.actionChecker = null;
  6696. defaults.base.styleCursor = true;
  6697. extend(defaults.perAction, {
  6698. manualStart: false,
  6699. max: Infinity,
  6700. maxPerElement: 1,
  6701. allowFrom: null,
  6702. ignoreFrom: null,
  6703. // only allow left button by default
  6704. // see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons#Return_value
  6705. mouseButtons: 1
  6706. });
  6707. interact.maxInteractions = (newValue) => maxInteractions(newValue, scope);
  6708. scope.autoStart = {
  6709. // Allow this many interactions to happen simultaneously
  6710. maxInteractions: Infinity,
  6711. withinInteractionLimit,
  6712. cursorElement: null
  6713. };
  6714. }
  6715. function prepareOnDown({
  6716. interaction,
  6717. pointer,
  6718. event,
  6719. eventTarget
  6720. }, scope) {
  6721. if (interaction.interacting()) {
  6722. return;
  6723. }
  6724. const actionInfo = getActionInfo(interaction, pointer, event, eventTarget, scope);
  6725. prepare(interaction, actionInfo, scope);
  6726. }
  6727. function prepareOnMove({
  6728. interaction,
  6729. pointer,
  6730. event,
  6731. eventTarget
  6732. }, scope) {
  6733. if (interaction.pointerType !== "mouse" || interaction.pointerIsDown || interaction.interacting()) {
  6734. return;
  6735. }
  6736. const actionInfo = getActionInfo(interaction, pointer, event, eventTarget, scope);
  6737. prepare(interaction, actionInfo, scope);
  6738. }
  6739. function startOnMove(arg, scope) {
  6740. const {
  6741. interaction
  6742. } = arg;
  6743. if (!interaction.pointerIsDown || interaction.interacting() || !interaction.pointerWasMoved || !interaction.prepared.name) {
  6744. return;
  6745. }
  6746. scope.fire("autoStart:before-start", arg);
  6747. const {
  6748. interactable
  6749. } = interaction;
  6750. const actionName = interaction.prepared.name;
  6751. if (actionName && interactable) {
  6752. if (interactable.options[actionName].manualStart || !withinInteractionLimit(interactable, interaction.element, interaction.prepared, scope)) {
  6753. interaction.stop();
  6754. } else {
  6755. interaction.start(interaction.prepared, interactable, interaction.element);
  6756. setInteractionCursor(interaction, scope);
  6757. }
  6758. }
  6759. }
  6760. function clearCursorOnStop({
  6761. interaction
  6762. }, scope) {
  6763. const {
  6764. interactable
  6765. } = interaction;
  6766. if (interactable && interactable.options.styleCursor) {
  6767. setCursor(interaction.element, "", scope);
  6768. }
  6769. }
  6770. function validateAction(action, interactable, element, eventTarget, scope) {
  6771. if (interactable.testIgnoreAllow(interactable.options[action.name], element, eventTarget) && interactable.options[action.name].enabled && withinInteractionLimit(interactable, element, action, scope)) {
  6772. return action;
  6773. }
  6774. return null;
  6775. }
  6776. function validateMatches(interaction, pointer, event, matches, matchElements, eventTarget, scope) {
  6777. for (let i = 0, len = matches.length; i < len; i++) {
  6778. const match = matches[i];
  6779. const matchElement = matchElements[i];
  6780. const matchAction = match.getAction(pointer, event, interaction, matchElement);
  6781. if (!matchAction) {
  6782. continue;
  6783. }
  6784. const action = validateAction(matchAction, match, matchElement, eventTarget, scope);
  6785. if (action) {
  6786. return {
  6787. action,
  6788. interactable: match,
  6789. element: matchElement
  6790. };
  6791. }
  6792. }
  6793. return {
  6794. action: null,
  6795. interactable: null,
  6796. element: null
  6797. };
  6798. }
  6799. function getActionInfo(interaction, pointer, event, eventTarget, scope) {
  6800. let matches = [];
  6801. let matchElements = [];
  6802. let element = eventTarget;
  6803. function pushMatches(interactable) {
  6804. matches.push(interactable);
  6805. matchElements.push(element);
  6806. }
  6807. while (is.element(element)) {
  6808. matches = [];
  6809. matchElements = [];
  6810. scope.interactables.forEachMatch(element, pushMatches);
  6811. const actionInfo = validateMatches(interaction, pointer, event, matches, matchElements, eventTarget, scope);
  6812. if (actionInfo.action && !actionInfo.interactable.options[actionInfo.action.name].manualStart) {
  6813. return actionInfo;
  6814. }
  6815. element = parentNode(element);
  6816. }
  6817. return {
  6818. action: null,
  6819. interactable: null,
  6820. element: null
  6821. };
  6822. }
  6823. function prepare(interaction, {
  6824. action,
  6825. interactable,
  6826. element
  6827. }, scope) {
  6828. action = action || {
  6829. name: null
  6830. };
  6831. interaction.interactable = interactable;
  6832. interaction.element = element;
  6833. copyAction(interaction.prepared, action);
  6834. interaction.rect = interactable && action.name ? interactable.getRect(element) : null;
  6835. setInteractionCursor(interaction, scope);
  6836. scope.fire("autoStart:prepared", {
  6837. interaction
  6838. });
  6839. }
  6840. function withinInteractionLimit(interactable, element, action, scope) {
  6841. const options = interactable.options;
  6842. const maxActions = options[action.name].max;
  6843. const maxPerElement = options[action.name].maxPerElement;
  6844. const autoStartMax = scope.autoStart.maxInteractions;
  6845. let activeInteractions = 0;
  6846. let interactableCount = 0;
  6847. let elementCount = 0;
  6848. if (!(maxActions && maxPerElement && autoStartMax)) {
  6849. return false;
  6850. }
  6851. for (const interaction of scope.interactions.list) {
  6852. const otherAction = interaction.prepared.name;
  6853. if (!interaction.interacting()) {
  6854. continue;
  6855. }
  6856. activeInteractions++;
  6857. if (activeInteractions >= autoStartMax) {
  6858. return false;
  6859. }
  6860. if (interaction.interactable !== interactable) {
  6861. continue;
  6862. }
  6863. interactableCount += otherAction === action.name ? 1 : 0;
  6864. if (interactableCount >= maxActions) {
  6865. return false;
  6866. }
  6867. if (interaction.element === element) {
  6868. elementCount++;
  6869. if (otherAction === action.name && elementCount >= maxPerElement) {
  6870. return false;
  6871. }
  6872. }
  6873. }
  6874. return autoStartMax > 0;
  6875. }
  6876. function maxInteractions(newValue, scope) {
  6877. if (is.number(newValue)) {
  6878. scope.autoStart.maxInteractions = newValue;
  6879. return this;
  6880. }
  6881. return scope.autoStart.maxInteractions;
  6882. }
  6883. function setCursor(element, cursor, scope) {
  6884. const {
  6885. cursorElement: prevCursorElement
  6886. } = scope.autoStart;
  6887. if (prevCursorElement && prevCursorElement !== element) {
  6888. prevCursorElement.style.cursor = "";
  6889. }
  6890. element.ownerDocument.documentElement.style.cursor = cursor;
  6891. element.style.cursor = cursor;
  6892. scope.autoStart.cursorElement = cursor ? element : null;
  6893. }
  6894. function setInteractionCursor(interaction, scope) {
  6895. const {
  6896. interactable,
  6897. element,
  6898. prepared
  6899. } = interaction;
  6900. if (!(interaction.pointerType === "mouse" && interactable && interactable.options.styleCursor)) {
  6901. if (scope.autoStart.cursorElement) {
  6902. setCursor(scope.autoStart.cursorElement, "", scope);
  6903. }
  6904. return;
  6905. }
  6906. let cursor = "";
  6907. if (prepared.name) {
  6908. const cursorChecker = interactable.options[prepared.name].cursorChecker;
  6909. if (is.func(cursorChecker)) {
  6910. cursor = cursorChecker(prepared, interactable, element, interaction._interacting);
  6911. } else {
  6912. cursor = scope.actions.map[prepared.name].getCursor(prepared);
  6913. }
  6914. }
  6915. setCursor(interaction.element, cursor || "", scope);
  6916. }
  6917. const autoStart = {
  6918. id: "auto-start/base",
  6919. before: ["actions"],
  6920. install: base_install,
  6921. listeners: {
  6922. "interactions:down": prepareOnDown,
  6923. "interactions:move": (arg, scope) => {
  6924. prepareOnMove(arg, scope);
  6925. startOnMove(arg, scope);
  6926. },
  6927. "interactions:stop": clearCursorOnStop
  6928. },
  6929. maxInteractions,
  6930. withinInteractionLimit,
  6931. validateAction
  6932. };
  6933. var base = autoStart;
  6934. function beforeStart({
  6935. interaction,
  6936. eventTarget,
  6937. dx,
  6938. dy
  6939. }, scope) {
  6940. if (interaction.prepared.name !== "drag") {
  6941. return;
  6942. }
  6943. const absX = Math.abs(dx);
  6944. const absY = Math.abs(dy);
  6945. const targetOptions = interaction.interactable.options.drag;
  6946. const startAxis = targetOptions.startAxis;
  6947. const currentAxis = absX > absY ? "x" : absX < absY ? "y" : "xy";
  6948. interaction.prepared.axis = targetOptions.lockAxis === "start" ? currentAxis[0] : targetOptions.lockAxis;
  6949. if (currentAxis !== "xy" && startAxis !== "xy" && startAxis !== currentAxis) {
  6950. interaction.prepared.name = null;
  6951. let element = eventTarget;
  6952. const getDraggable = function(interactable) {
  6953. if (interactable === interaction.interactable) {
  6954. return;
  6955. }
  6956. const options = interaction.interactable.options.drag;
  6957. if (!options.manualStart && interactable.testIgnoreAllow(options, element, eventTarget)) {
  6958. const action = interactable.getAction(interaction.downPointer, interaction.downEvent, interaction, element);
  6959. if (action && action.name === "drag" && checkStartAxis(currentAxis, interactable) && base.validateAction(action, interactable, element, eventTarget, scope)) {
  6960. return interactable;
  6961. }
  6962. }
  6963. };
  6964. while (is.element(element)) {
  6965. const interactable = scope.interactables.forEachMatch(element, getDraggable);
  6966. if (interactable) {
  6967. interaction.prepared.name = "drag";
  6968. interaction.interactable = interactable;
  6969. interaction.element = element;
  6970. break;
  6971. }
  6972. element = parentNode(element);
  6973. }
  6974. }
  6975. }
  6976. function checkStartAxis(startAxis, interactable) {
  6977. if (!interactable) {
  6978. return false;
  6979. }
  6980. const thisAxis = interactable.options.drag.startAxis;
  6981. return startAxis === "xy" || thisAxis === "xy" || thisAxis === startAxis;
  6982. }
  6983. var dragAxis = {
  6984. id: "auto-start/dragAxis",
  6985. listeners: {
  6986. "autoStart:before-start": beforeStart
  6987. }
  6988. };
  6989. function hold_install(scope) {
  6990. const {
  6991. defaults
  6992. } = scope;
  6993. scope.usePlugin(base);
  6994. defaults.perAction.hold = 0;
  6995. defaults.perAction.delay = 0;
  6996. }
  6997. function getHoldDuration(interaction) {
  6998. const actionName = interaction.prepared && interaction.prepared.name;
  6999. if (!actionName) {
  7000. return null;
  7001. }
  7002. const options = interaction.interactable.options;
  7003. return options[actionName].hold || options[actionName].delay;
  7004. }
  7005. const hold = {
  7006. id: "auto-start/hold",
  7007. install: hold_install,
  7008. listeners: {
  7009. "interactions:new": ({
  7010. interaction
  7011. }) => {
  7012. interaction.autoStartHoldTimer = null;
  7013. },
  7014. "autoStart:prepared": ({
  7015. interaction
  7016. }) => {
  7017. const hold2 = getHoldDuration(interaction);
  7018. if (hold2 > 0) {
  7019. interaction.autoStartHoldTimer = setTimeout(() => {
  7020. interaction.start(interaction.prepared, interaction.interactable, interaction.element);
  7021. }, hold2);
  7022. }
  7023. },
  7024. "interactions:move": ({
  7025. interaction,
  7026. duplicate
  7027. }) => {
  7028. if (interaction.autoStartHoldTimer && interaction.pointerWasMoved && !duplicate) {
  7029. clearTimeout(interaction.autoStartHoldTimer);
  7030. interaction.autoStartHoldTimer = null;
  7031. }
  7032. },
  7033. // prevent regular down->move autoStart
  7034. "autoStart:before-start": ({
  7035. interaction
  7036. }) => {
  7037. const holdDuration = getHoldDuration(interaction);
  7038. if (holdDuration > 0) {
  7039. interaction.prepared.name = null;
  7040. }
  7041. }
  7042. },
  7043. getHoldDuration
  7044. };
  7045. var auto_start_hold = hold;
  7046. var auto_start_plugin = {
  7047. id: "auto-start",
  7048. install(scope) {
  7049. scope.usePlugin(base);
  7050. scope.usePlugin(auto_start_hold);
  7051. scope.usePlugin(dragAxis);
  7052. }
  7053. };
  7054. if (typeof window === "object" && !!window) {
  7055. interact_init(window);
  7056. }
  7057. _interactjs_interact.use(auto_start_plugin);
  7058. function plugin_install(scope) {
  7059. const {
  7060. actions,
  7061. Interactable,
  7062. defaults
  7063. } = scope;
  7064. Interactable.prototype.draggable = drag.draggable;
  7065. actions.map.drag = drag;
  7066. actions.methodDict.drag = "draggable";
  7067. defaults.actions.drag = drag.defaults;
  7068. }
  7069. function beforeMove({
  7070. interaction
  7071. }) {
  7072. if (interaction.prepared.name !== "drag") {
  7073. return;
  7074. }
  7075. const axis = interaction.prepared.axis;
  7076. if (axis === "x") {
  7077. interaction.coords.cur.page.y = interaction.coords.start.page.y;
  7078. interaction.coords.cur.client.y = interaction.coords.start.client.y;
  7079. interaction.coords.velocity.client.y = 0;
  7080. interaction.coords.velocity.page.y = 0;
  7081. } else if (axis === "y") {
  7082. interaction.coords.cur.page.x = interaction.coords.start.page.x;
  7083. interaction.coords.cur.client.x = interaction.coords.start.client.x;
  7084. interaction.coords.velocity.client.x = 0;
  7085. interaction.coords.velocity.page.x = 0;
  7086. }
  7087. }
  7088. function move({
  7089. iEvent,
  7090. interaction
  7091. }) {
  7092. if (interaction.prepared.name !== "drag") {
  7093. return;
  7094. }
  7095. const axis = interaction.prepared.axis;
  7096. if (axis === "x" || axis === "y") {
  7097. const opposite = axis === "x" ? "y" : "x";
  7098. iEvent.page[opposite] = interaction.coords.start.page[opposite];
  7099. iEvent.client[opposite] = interaction.coords.start.client[opposite];
  7100. iEvent.delta[opposite] = 0;
  7101. }
  7102. }
  7103. const plugin_draggable = function draggable(options) {
  7104. if (is.object(options)) {
  7105. this.options.drag.enabled = options.enabled !== false;
  7106. this.setPerAction("drag", options);
  7107. this.setOnEvents("drag", options);
  7108. if (/^(xy|x|y|start)$/.test(options.lockAxis)) {
  7109. this.options.drag.lockAxis = options.lockAxis;
  7110. }
  7111. if (/^(xy|x|y)$/.test(options.startAxis)) {
  7112. this.options.drag.startAxis = options.startAxis;
  7113. }
  7114. return this;
  7115. }
  7116. if (is.bool(options)) {
  7117. this.options.drag.enabled = options;
  7118. return this;
  7119. }
  7120. return this.options.drag;
  7121. };
  7122. const drag = {
  7123. id: "actions/drag",
  7124. install: plugin_install,
  7125. listeners: {
  7126. "interactions:before-action-move": beforeMove,
  7127. "interactions:action-resume": beforeMove,
  7128. // dragmove
  7129. "interactions:action-move": move,
  7130. "auto-start:check": (arg) => {
  7131. const {
  7132. interaction,
  7133. interactable,
  7134. buttons
  7135. } = arg;
  7136. const dragOptions = interactable.options.drag;
  7137. if (!(dragOptions && dragOptions.enabled) || // check mouseButton setting if the pointer is down
  7138. interaction.pointerIsDown && /mouse|pointer/.test(interaction.pointerType) && (buttons & interactable.options.drag.mouseButtons) === 0) {
  7139. return void 0;
  7140. }
  7141. arg.action = {
  7142. name: "drag",
  7143. axis: dragOptions.lockAxis === "start" ? dragOptions.startAxis : dragOptions.lockAxis
  7144. };
  7145. return false;
  7146. }
  7147. },
  7148. draggable: plugin_draggable,
  7149. beforeMove,
  7150. move,
  7151. defaults: {
  7152. startAxis: "xy",
  7153. lockAxis: "xy"
  7154. },
  7155. getCursor() {
  7156. return "move";
  7157. }
  7158. };
  7159. var drag_plugin = drag;
  7160. if (typeof window === "object" && !!window) {
  7161. interact_init(window);
  7162. }
  7163. _interactjs_interact.use(drag_plugin);
  7164. function resize_plugin_install(scope) {
  7165. const {
  7166. actions,
  7167. browser: browser2,
  7168. /** @lends Interactable */
  7169. Interactable,
  7170. // tslint:disable-line no-shadowed-variable
  7171. defaults
  7172. } = scope;
  7173. resize.cursors = initCursors(browser2);
  7174. resize.defaultMargin = browser2.supportsTouch || browser2.supportsPointerEvent ? 20 : 10;
  7175. Interactable.prototype.resizable = function(options) {
  7176. return resizable(this, options, scope);
  7177. };
  7178. actions.map.resize = resize;
  7179. actions.methodDict.resize = "resizable";
  7180. defaults.actions.resize = resize.defaults;
  7181. }
  7182. function resizeChecker(arg) {
  7183. const {
  7184. interaction,
  7185. interactable,
  7186. element,
  7187. rect,
  7188. buttons
  7189. } = arg;
  7190. if (!rect) {
  7191. return void 0;
  7192. }
  7193. const page = extend({}, interaction.coords.cur.page);
  7194. const resizeOptions = interactable.options.resize;
  7195. if (!(resizeOptions && resizeOptions.enabled) || // check mouseButton setting if the pointer is down
  7196. interaction.pointerIsDown && /mouse|pointer/.test(interaction.pointerType) && (buttons & resizeOptions.mouseButtons) === 0) {
  7197. return void 0;
  7198. }
  7199. if (is.object(resizeOptions.edges)) {
  7200. const resizeEdges = {
  7201. left: false,
  7202. right: false,
  7203. top: false,
  7204. bottom: false
  7205. };
  7206. for (const edge in resizeEdges) {
  7207. resizeEdges[edge] = checkResizeEdge(edge, resizeOptions.edges[edge], page, interaction._latestPointer.eventTarget, element, rect, resizeOptions.margin || resize.defaultMargin);
  7208. }
  7209. resizeEdges.left = resizeEdges.left && !resizeEdges.right;
  7210. resizeEdges.top = resizeEdges.top && !resizeEdges.bottom;
  7211. if (resizeEdges.left || resizeEdges.right || resizeEdges.top || resizeEdges.bottom) {
  7212. arg.action = {
  7213. name: "resize",
  7214. edges: resizeEdges
  7215. };
  7216. }
  7217. } else {
  7218. const right = resizeOptions.axis !== "y" && page.x > rect.right - resize.defaultMargin;
  7219. const bottom2 = resizeOptions.axis !== "x" && page.y > rect.bottom - resize.defaultMargin;
  7220. if (right || bottom2) {
  7221. arg.action = {
  7222. name: "resize",
  7223. axes: (right ? "x" : "") + (bottom2 ? "y" : "")
  7224. };
  7225. }
  7226. }
  7227. return arg.action ? false : void 0;
  7228. }
  7229. function resizable(interactable, options, scope) {
  7230. if (is.object(options)) {
  7231. interactable.options.resize.enabled = options.enabled !== false;
  7232. interactable.setPerAction("resize", options);
  7233. interactable.setOnEvents("resize", options);
  7234. if (is.string(options.axis) && /^x$|^y$|^xy$/.test(options.axis)) {
  7235. interactable.options.resize.axis = options.axis;
  7236. } else if (options.axis === null) {
  7237. interactable.options.resize.axis = scope.defaults.actions.resize.axis;
  7238. }
  7239. if (is.bool(options.preserveAspectRatio)) {
  7240. interactable.options.resize.preserveAspectRatio = options.preserveAspectRatio;
  7241. } else if (is.bool(options.square)) {
  7242. interactable.options.resize.square = options.square;
  7243. }
  7244. return interactable;
  7245. }
  7246. if (is.bool(options)) {
  7247. interactable.options.resize.enabled = options;
  7248. return interactable;
  7249. }
  7250. return interactable.options.resize;
  7251. }
  7252. function checkResizeEdge(name, value, page, element, interactableElement, rect, margin) {
  7253. if (!value) {
  7254. return false;
  7255. }
  7256. if (value === true) {
  7257. const width = is.number(rect.width) ? rect.width : rect.right - rect.left;
  7258. const height = is.number(rect.height) ? rect.height : rect.bottom - rect.top;
  7259. margin = Math.min(margin, Math.abs((name === "left" || name === "right" ? width : height) / 2));
  7260. if (width < 0) {
  7261. if (name === "left") {
  7262. name = "right";
  7263. } else if (name === "right") {
  7264. name = "left";
  7265. }
  7266. }
  7267. if (height < 0) {
  7268. if (name === "top") {
  7269. name = "bottom";
  7270. } else if (name === "bottom") {
  7271. name = "top";
  7272. }
  7273. }
  7274. if (name === "left") {
  7275. return page.x < (width >= 0 ? rect.left : rect.right) + margin;
  7276. }
  7277. if (name === "top") {
  7278. return page.y < (height >= 0 ? rect.top : rect.bottom) + margin;
  7279. }
  7280. if (name === "right") {
  7281. return page.x > (width >= 0 ? rect.right : rect.left) - margin;
  7282. }
  7283. if (name === "bottom") {
  7284. return page.y > (height >= 0 ? rect.bottom : rect.top) - margin;
  7285. }
  7286. }
  7287. if (!is.element(element)) {
  7288. return false;
  7289. }
  7290. return is.element(value) ? value === element : matchesUpTo(element, value, interactableElement);
  7291. }
  7292. function initCursors(browser2) {
  7293. return browser2.isIe9 ? {
  7294. x: "e-resize",
  7295. y: "s-resize",
  7296. xy: "se-resize",
  7297. top: "n-resize",
  7298. left: "w-resize",
  7299. bottom: "s-resize",
  7300. right: "e-resize",
  7301. topleft: "se-resize",
  7302. bottomright: "se-resize",
  7303. topright: "ne-resize",
  7304. bottomleft: "ne-resize"
  7305. } : {
  7306. x: "ew-resize",
  7307. y: "ns-resize",
  7308. xy: "nwse-resize",
  7309. top: "ns-resize",
  7310. left: "ew-resize",
  7311. bottom: "ns-resize",
  7312. right: "ew-resize",
  7313. topleft: "nwse-resize",
  7314. bottomright: "nwse-resize",
  7315. topright: "nesw-resize",
  7316. bottomleft: "nesw-resize"
  7317. };
  7318. }
  7319. function start({
  7320. iEvent,
  7321. interaction
  7322. }) {
  7323. if (interaction.prepared.name !== "resize" || !interaction.prepared.edges) {
  7324. return;
  7325. }
  7326. const resizeEvent = iEvent;
  7327. const rect = interaction.rect;
  7328. interaction._rects = {
  7329. start: extend({}, rect),
  7330. corrected: extend({}, rect),
  7331. previous: extend({}, rect),
  7332. delta: {
  7333. left: 0,
  7334. right: 0,
  7335. width: 0,
  7336. top: 0,
  7337. bottom: 0,
  7338. height: 0
  7339. }
  7340. };
  7341. resizeEvent.edges = interaction.prepared.edges;
  7342. resizeEvent.rect = interaction._rects.corrected;
  7343. resizeEvent.deltaRect = interaction._rects.delta;
  7344. }
  7345. function plugin_move({
  7346. iEvent,
  7347. interaction
  7348. }) {
  7349. if (interaction.prepared.name !== "resize" || !interaction.prepared.edges) {
  7350. return;
  7351. }
  7352. const resizeEvent = iEvent;
  7353. const resizeOptions = interaction.interactable.options.resize;
  7354. const invert = resizeOptions.invert;
  7355. const invertible = invert === "reposition" || invert === "negate";
  7356. const current = interaction.rect;
  7357. const {
  7358. start: startRect,
  7359. corrected,
  7360. delta: deltaRect,
  7361. previous
  7362. } = interaction._rects;
  7363. extend(previous, corrected);
  7364. if (invertible) {
  7365. extend(corrected, current);
  7366. if (invert === "reposition") {
  7367. if (corrected.top > corrected.bottom) {
  7368. const swap = corrected.top;
  7369. corrected.top = corrected.bottom;
  7370. corrected.bottom = swap;
  7371. }
  7372. if (corrected.left > corrected.right) {
  7373. const swap = corrected.left;
  7374. corrected.left = corrected.right;
  7375. corrected.right = swap;
  7376. }
  7377. }
  7378. } else {
  7379. corrected.top = Math.min(current.top, startRect.bottom);
  7380. corrected.bottom = Math.max(current.bottom, startRect.top);
  7381. corrected.left = Math.min(current.left, startRect.right);
  7382. corrected.right = Math.max(current.right, startRect.left);
  7383. }
  7384. corrected.width = corrected.right - corrected.left;
  7385. corrected.height = corrected.bottom - corrected.top;
  7386. for (const edge in corrected) {
  7387. deltaRect[edge] = corrected[edge] - previous[edge];
  7388. }
  7389. resizeEvent.edges = interaction.prepared.edges;
  7390. resizeEvent.rect = corrected;
  7391. resizeEvent.deltaRect = deltaRect;
  7392. }
  7393. function end({
  7394. iEvent,
  7395. interaction
  7396. }) {
  7397. if (interaction.prepared.name !== "resize" || !interaction.prepared.edges) {
  7398. return;
  7399. }
  7400. const resizeEvent = iEvent;
  7401. resizeEvent.edges = interaction.prepared.edges;
  7402. resizeEvent.rect = interaction._rects.corrected;
  7403. resizeEvent.deltaRect = interaction._rects.delta;
  7404. }
  7405. function updateEventAxes({
  7406. iEvent,
  7407. interaction
  7408. }) {
  7409. if (interaction.prepared.name !== "resize" || !interaction.resizeAxes) {
  7410. return;
  7411. }
  7412. const options = interaction.interactable.options;
  7413. const resizeEvent = iEvent;
  7414. if (options.resize.square) {
  7415. if (interaction.resizeAxes === "y") {
  7416. resizeEvent.delta.x = resizeEvent.delta.y;
  7417. } else {
  7418. resizeEvent.delta.y = resizeEvent.delta.x;
  7419. }
  7420. resizeEvent.axes = "xy";
  7421. } else {
  7422. resizeEvent.axes = interaction.resizeAxes;
  7423. if (interaction.resizeAxes === "x") {
  7424. resizeEvent.delta.y = 0;
  7425. } else if (interaction.resizeAxes === "y") {
  7426. resizeEvent.delta.x = 0;
  7427. }
  7428. }
  7429. }
  7430. const resize = {
  7431. id: "actions/resize",
  7432. before: ["actions/drag"],
  7433. install: resize_plugin_install,
  7434. listeners: {
  7435. "interactions:new": ({
  7436. interaction
  7437. }) => {
  7438. interaction.resizeAxes = "xy";
  7439. },
  7440. "interactions:action-start": (arg) => {
  7441. start(arg);
  7442. updateEventAxes(arg);
  7443. },
  7444. "interactions:action-move": (arg) => {
  7445. plugin_move(arg);
  7446. updateEventAxes(arg);
  7447. },
  7448. "interactions:action-end": end,
  7449. "auto-start:check": resizeChecker
  7450. },
  7451. defaults: {
  7452. square: false,
  7453. preserveAspectRatio: false,
  7454. axis: "xy",
  7455. // use default margin
  7456. margin: NaN,
  7457. // object with props left, right, top, bottom which are
  7458. // true/false values to resize when the pointer is over that edge,
  7459. // CSS selectors to match the handles for each direction
  7460. // or the Elements for each handle
  7461. edges: null,
  7462. // a value of 'none' will limit the resize rect to a minimum of 0x0
  7463. // 'negate' will alow the rect to have negative width/height
  7464. // 'reposition' will keep the width/height positive by swapping
  7465. // the top and bottom edges and/or swapping the left and right edges
  7466. invert: "none"
  7467. },
  7468. cursors: null,
  7469. getCursor({
  7470. edges,
  7471. axis,
  7472. name
  7473. }) {
  7474. const cursors = resize.cursors;
  7475. let result = null;
  7476. if (axis) {
  7477. result = cursors[name + axis];
  7478. } else if (edges) {
  7479. let cursorKey = "";
  7480. for (const edge of ["top", "bottom", "left", "right"]) {
  7481. if (edges[edge]) {
  7482. cursorKey += edge;
  7483. }
  7484. }
  7485. result = cursors[cursorKey];
  7486. }
  7487. return result;
  7488. },
  7489. defaultMargin: null
  7490. };
  7491. var resize_plugin = resize;
  7492. if (typeof window === "object" && !!window) {
  7493. interact_init(window);
  7494. }
  7495. _interactjs_interact.use(resize_plugin);
  7496. var edgeTarget = () => {
  7497. };
  7498. var snappers_elements = () => {
  7499. };
  7500. var grid = (grid2) => {
  7501. const coordFields = [["x", "y"], ["left", "top"], ["right", "bottom"], ["width", "height"]].filter(([xField, yField]) => xField in grid2 || yField in grid2);
  7502. const gridFunc = (x, y) => {
  7503. const {
  7504. range,
  7505. limits = {
  7506. left: -Infinity,
  7507. right: Infinity,
  7508. top: -Infinity,
  7509. bottom: Infinity
  7510. },
  7511. offset = {
  7512. x: 0,
  7513. y: 0
  7514. }
  7515. } = grid2;
  7516. const result = {
  7517. range,
  7518. grid: grid2,
  7519. x: null,
  7520. y: null
  7521. };
  7522. for (const [xField, yField] of coordFields) {
  7523. const gridx = Math.round((x - offset.x) / grid2[xField]);
  7524. const gridy = Math.round((y - offset.y) / grid2[yField]);
  7525. result[xField] = Math.max(limits.left, Math.min(limits.right, gridx * grid2[xField] + offset.x));
  7526. result[yField] = Math.max(limits.top, Math.min(limits.bottom, gridy * grid2[yField] + offset.y));
  7527. }
  7528. return result;
  7529. };
  7530. gridFunc.grid = grid2;
  7531. gridFunc.coordFields = coordFields;
  7532. return gridFunc;
  7533. };
  7534. const snappersPlugin = {
  7535. id: "snappers",
  7536. install(scope) {
  7537. const {
  7538. interactStatic: interact
  7539. } = scope;
  7540. interact.snappers = extend(interact.snappers || {}, all_namespaceObject);
  7541. interact.createSnapGrid = interact.snappers.grid;
  7542. }
  7543. };
  7544. var snappers_plugin = snappersPlugin;
  7545. class Modification_Modification {
  7546. constructor(interaction) {
  7547. this.states = [];
  7548. this.startOffset = {
  7549. left: 0,
  7550. right: 0,
  7551. top: 0,
  7552. bottom: 0
  7553. };
  7554. this.startDelta = null;
  7555. this.result = null;
  7556. this.endResult = null;
  7557. this.edges = void 0;
  7558. this.interaction = void 0;
  7559. this.interaction = interaction;
  7560. this.result = createResult();
  7561. }
  7562. start({
  7563. phase
  7564. }, pageCoords) {
  7565. const {
  7566. interaction
  7567. } = this;
  7568. const modifierList = getModifierList(interaction);
  7569. this.prepareStates(modifierList);
  7570. this.edges = extend({}, interaction.edges);
  7571. this.startOffset = getRectOffset(interaction.rect, pageCoords);
  7572. this.startDelta = {
  7573. x: 0,
  7574. y: 0
  7575. };
  7576. const arg = {
  7577. phase,
  7578. pageCoords,
  7579. preEnd: false
  7580. };
  7581. this.result = createResult();
  7582. this.startAll(arg);
  7583. const result = this.result = this.setAll(arg);
  7584. return result;
  7585. }
  7586. fillArg(arg) {
  7587. const {
  7588. interaction
  7589. } = this;
  7590. arg.interaction = interaction;
  7591. arg.interactable = interaction.interactable;
  7592. arg.element = interaction.element;
  7593. arg.rect = arg.rect || interaction.rect;
  7594. arg.edges = this.edges;
  7595. arg.startOffset = this.startOffset;
  7596. }
  7597. startAll(arg) {
  7598. this.fillArg(arg);
  7599. for (const state of this.states) {
  7600. if (state.methods.start) {
  7601. arg.state = state;
  7602. state.methods.start(arg);
  7603. }
  7604. }
  7605. }
  7606. setAll(arg) {
  7607. this.fillArg(arg);
  7608. const {
  7609. phase,
  7610. preEnd,
  7611. skipModifiers,
  7612. rect: unmodifiedRect
  7613. } = arg;
  7614. arg.coords = extend({}, arg.pageCoords);
  7615. arg.rect = extend({}, unmodifiedRect);
  7616. const states = skipModifiers ? this.states.slice(skipModifiers) : this.states;
  7617. const newResult = createResult(arg.coords, arg.rect);
  7618. for (const state of states) {
  7619. const {
  7620. options
  7621. } = state;
  7622. const lastModifierCoords = extend({}, arg.coords);
  7623. let returnValue = null;
  7624. if (state.methods.set && this.shouldDo(options, preEnd, phase)) {
  7625. arg.state = state;
  7626. returnValue = state.methods.set(arg);
  7627. addEdges(this.interaction.edges, arg.rect, {
  7628. x: arg.coords.x - lastModifierCoords.x,
  7629. y: arg.coords.y - lastModifierCoords.y
  7630. });
  7631. }
  7632. newResult.eventProps.push(returnValue);
  7633. }
  7634. newResult.delta.x = arg.coords.x - arg.pageCoords.x;
  7635. newResult.delta.y = arg.coords.y - arg.pageCoords.y;
  7636. newResult.rectDelta.left = arg.rect.left - unmodifiedRect.left;
  7637. newResult.rectDelta.right = arg.rect.right - unmodifiedRect.right;
  7638. newResult.rectDelta.top = arg.rect.top - unmodifiedRect.top;
  7639. newResult.rectDelta.bottom = arg.rect.bottom - unmodifiedRect.bottom;
  7640. const prevCoords = this.result.coords;
  7641. const prevRect = this.result.rect;
  7642. if (prevCoords && prevRect) {
  7643. const rectChanged = newResult.rect.left !== prevRect.left || newResult.rect.right !== prevRect.right || newResult.rect.top !== prevRect.top || newResult.rect.bottom !== prevRect.bottom;
  7644. newResult.changed = rectChanged || prevCoords.x !== newResult.coords.x || prevCoords.y !== newResult.coords.y;
  7645. }
  7646. return newResult;
  7647. }
  7648. applyToInteraction(arg) {
  7649. const {
  7650. interaction
  7651. } = this;
  7652. const {
  7653. phase
  7654. } = arg;
  7655. const curCoords = interaction.coords.cur;
  7656. const startCoords = interaction.coords.start;
  7657. const {
  7658. result,
  7659. startDelta
  7660. } = this;
  7661. const curDelta = result.delta;
  7662. if (phase === "start") {
  7663. extend(this.startDelta, result.delta);
  7664. }
  7665. for (const [coordsSet, delta] of [[startCoords, startDelta], [curCoords, curDelta]]) {
  7666. coordsSet.page.x += delta.x;
  7667. coordsSet.page.y += delta.y;
  7668. coordsSet.client.x += delta.x;
  7669. coordsSet.client.y += delta.y;
  7670. }
  7671. const {
  7672. rectDelta
  7673. } = this.result;
  7674. const rect = arg.rect || interaction.rect;
  7675. rect.left += rectDelta.left;
  7676. rect.right += rectDelta.right;
  7677. rect.top += rectDelta.top;
  7678. rect.bottom += rectDelta.bottom;
  7679. rect.width = rect.right - rect.left;
  7680. rect.height = rect.bottom - rect.top;
  7681. }
  7682. setAndApply(arg) {
  7683. const {
  7684. interaction
  7685. } = this;
  7686. const {
  7687. phase,
  7688. preEnd,
  7689. skipModifiers
  7690. } = arg;
  7691. const result = this.setAll({
  7692. preEnd,
  7693. phase,
  7694. pageCoords: arg.modifiedCoords || interaction.coords.cur.page
  7695. });
  7696. this.result = result;
  7697. if (!result.changed && (!skipModifiers || skipModifiers < this.states.length) && interaction.interacting()) {
  7698. return false;
  7699. }
  7700. if (arg.modifiedCoords) {
  7701. const {
  7702. page
  7703. } = interaction.coords.cur;
  7704. const adjustment = {
  7705. x: arg.modifiedCoords.x - page.x,
  7706. y: arg.modifiedCoords.y - page.y
  7707. };
  7708. result.coords.x += adjustment.x;
  7709. result.coords.y += adjustment.y;
  7710. result.delta.x += adjustment.x;
  7711. result.delta.y += adjustment.y;
  7712. }
  7713. this.applyToInteraction(arg);
  7714. }
  7715. beforeEnd(arg) {
  7716. const {
  7717. interaction,
  7718. event
  7719. } = arg;
  7720. const states = this.states;
  7721. if (!states || !states.length) {
  7722. return;
  7723. }
  7724. let doPreend = false;
  7725. for (const state of states) {
  7726. arg.state = state;
  7727. const {
  7728. options,
  7729. methods
  7730. } = state;
  7731. const endPosition = methods.beforeEnd && methods.beforeEnd(arg);
  7732. if (endPosition) {
  7733. this.endResult = endPosition;
  7734. return false;
  7735. }
  7736. doPreend = doPreend || !doPreend && this.shouldDo(options, true, arg.phase, true);
  7737. }
  7738. if (doPreend) {
  7739. interaction.move({
  7740. event,
  7741. preEnd: true
  7742. });
  7743. }
  7744. }
  7745. stop(arg) {
  7746. const {
  7747. interaction
  7748. } = arg;
  7749. if (!this.states || !this.states.length) {
  7750. return;
  7751. }
  7752. const modifierArg = extend({
  7753. states: this.states,
  7754. interactable: interaction.interactable,
  7755. element: interaction.element,
  7756. rect: null
  7757. }, arg);
  7758. this.fillArg(modifierArg);
  7759. for (const state of this.states) {
  7760. modifierArg.state = state;
  7761. if (state.methods.stop) {
  7762. state.methods.stop(modifierArg);
  7763. }
  7764. }
  7765. this.states = null;
  7766. this.endResult = null;
  7767. }
  7768. prepareStates(modifierList) {
  7769. this.states = [];
  7770. for (let index = 0; index < modifierList.length; index++) {
  7771. const {
  7772. options,
  7773. methods,
  7774. name
  7775. } = modifierList[index];
  7776. this.states.push({
  7777. options,
  7778. methods,
  7779. index,
  7780. name
  7781. });
  7782. }
  7783. return this.states;
  7784. }
  7785. restoreInteractionCoords({
  7786. interaction: {
  7787. coords,
  7788. rect,
  7789. modification
  7790. }
  7791. }) {
  7792. if (!modification.result) {
  7793. return;
  7794. }
  7795. const {
  7796. startDelta
  7797. } = modification;
  7798. const {
  7799. delta: curDelta,
  7800. rectDelta
  7801. } = modification.result;
  7802. const coordsAndDeltas = [[coords.start, startDelta], [coords.cur, curDelta]];
  7803. for (const [coordsSet, delta] of coordsAndDeltas) {
  7804. coordsSet.page.x -= delta.x;
  7805. coordsSet.page.y -= delta.y;
  7806. coordsSet.client.x -= delta.x;
  7807. coordsSet.client.y -= delta.y;
  7808. }
  7809. rect.left -= rectDelta.left;
  7810. rect.right -= rectDelta.right;
  7811. rect.top -= rectDelta.top;
  7812. rect.bottom -= rectDelta.bottom;
  7813. }
  7814. shouldDo(options, preEnd, phase, requireEndOnly) {
  7815. if (
  7816. // ignore disabled modifiers
  7817. !options || options.enabled === false || // check if we require endOnly option to fire move before end
  7818. requireEndOnly && !options.endOnly || // don't apply endOnly modifiers when not ending
  7819. options.endOnly && !preEnd || // check if modifier should run be applied on start
  7820. phase === "start" && !options.setStart
  7821. ) {
  7822. return false;
  7823. }
  7824. return true;
  7825. }
  7826. copyFrom(other) {
  7827. this.startOffset = other.startOffset;
  7828. this.startDelta = other.startDelta;
  7829. this.edges = other.edges;
  7830. this.states = other.states.map((s) => clone(s));
  7831. this.result = createResult(extend({}, other.result.coords), extend({}, other.result.rect));
  7832. }
  7833. destroy() {
  7834. for (const prop in this) {
  7835. this[prop] = null;
  7836. }
  7837. }
  7838. }
  7839. function createResult(coords, rect) {
  7840. return {
  7841. rect,
  7842. coords,
  7843. delta: {
  7844. x: 0,
  7845. y: 0
  7846. },
  7847. rectDelta: {
  7848. left: 0,
  7849. right: 0,
  7850. top: 0,
  7851. bottom: 0
  7852. },
  7853. eventProps: [],
  7854. changed: true
  7855. };
  7856. }
  7857. function getModifierList(interaction) {
  7858. const actionOptions = interaction.interactable.options[interaction.prepared.name];
  7859. const actionModifiers = actionOptions.modifiers;
  7860. if (actionModifiers && actionModifiers.length) {
  7861. return actionModifiers;
  7862. }
  7863. return ["snap", "snapSize", "snapEdges", "restrict", "restrictEdges", "restrictSize"].map((type) => {
  7864. const options = actionOptions[type];
  7865. return options && options.enabled && {
  7866. options,
  7867. methods: options._methods
  7868. };
  7869. }).filter((m) => !!m);
  7870. }
  7871. function getRectOffset(rect, coords) {
  7872. return rect ? {
  7873. left: coords.x - rect.left,
  7874. top: coords.y - rect.top,
  7875. right: rect.right - coords.x,
  7876. bottom: rect.bottom - coords.y
  7877. } : {
  7878. left: 0,
  7879. top: 0,
  7880. right: 0,
  7881. bottom: 0
  7882. };
  7883. }
  7884. function makeModifier(module3, name) {
  7885. const {
  7886. defaults
  7887. } = module3;
  7888. const methods = {
  7889. start: module3.start,
  7890. set: module3.set,
  7891. beforeEnd: module3.beforeEnd,
  7892. stop: module3.stop
  7893. };
  7894. const modifier = (_options) => {
  7895. const options = _options || {};
  7896. options.enabled = options.enabled !== false;
  7897. for (const prop in defaults) {
  7898. if (!(prop in options)) {
  7899. options[prop] = defaults[prop];
  7900. }
  7901. }
  7902. const m = {
  7903. options,
  7904. methods,
  7905. name,
  7906. enable: () => {
  7907. options.enabled = true;
  7908. return m;
  7909. },
  7910. disable: () => {
  7911. options.enabled = false;
  7912. return m;
  7913. }
  7914. };
  7915. return m;
  7916. };
  7917. if (name && typeof name === "string") {
  7918. modifier._defaults = defaults;
  7919. modifier._methods = methods;
  7920. }
  7921. return modifier;
  7922. }
  7923. function addEventModifiers({
  7924. iEvent,
  7925. interaction: {
  7926. modification: {
  7927. result
  7928. }
  7929. }
  7930. }) {
  7931. if (result) {
  7932. iEvent.modifiers = result.eventProps;
  7933. }
  7934. }
  7935. const modifiersBase = {
  7936. id: "modifiers/base",
  7937. before: ["actions"],
  7938. install: (scope) => {
  7939. scope.defaults.perAction.modifiers = [];
  7940. },
  7941. listeners: {
  7942. "interactions:new": ({
  7943. interaction
  7944. }) => {
  7945. interaction.modification = new Modification_Modification(interaction);
  7946. },
  7947. "interactions:before-action-start": (arg) => {
  7948. const {
  7949. modification
  7950. } = arg.interaction;
  7951. modification.start(arg, arg.interaction.coords.start.page);
  7952. arg.interaction.edges = modification.edges;
  7953. modification.applyToInteraction(arg);
  7954. },
  7955. "interactions:before-action-move": (arg) => arg.interaction.modification.setAndApply(arg),
  7956. "interactions:before-action-end": (arg) => arg.interaction.modification.beforeEnd(arg),
  7957. "interactions:action-start": addEventModifiers,
  7958. "interactions:action-move": addEventModifiers,
  7959. "interactions:action-end": addEventModifiers,
  7960. "interactions:after-action-start": (arg) => arg.interaction.modification.restoreInteractionCoords(arg),
  7961. "interactions:after-action-move": (arg) => arg.interaction.modification.restoreInteractionCoords(arg),
  7962. "interactions:stop": (arg) => arg.interaction.modification.stop(arg)
  7963. }
  7964. };
  7965. var modifiers_base = modifiersBase;
  7966. const aspectRatio = {
  7967. start(arg) {
  7968. const {
  7969. state,
  7970. rect,
  7971. edges: originalEdges,
  7972. pageCoords: coords
  7973. } = arg;
  7974. let {
  7975. ratio
  7976. } = state.options;
  7977. const {
  7978. equalDelta,
  7979. modifiers
  7980. } = state.options;
  7981. if (ratio === "preserve") {
  7982. ratio = rect.width / rect.height;
  7983. }
  7984. state.startCoords = extend({}, coords);
  7985. state.startRect = extend({}, rect);
  7986. state.ratio = ratio;
  7987. state.equalDelta = equalDelta;
  7988. const linkedEdges = state.linkedEdges = {
  7989. top: originalEdges.top || originalEdges.left && !originalEdges.bottom,
  7990. left: originalEdges.left || originalEdges.top && !originalEdges.right,
  7991. bottom: originalEdges.bottom || originalEdges.right && !originalEdges.top,
  7992. right: originalEdges.right || originalEdges.bottom && !originalEdges.left
  7993. };
  7994. state.xIsPrimaryAxis = !!(originalEdges.left || originalEdges.right);
  7995. if (state.equalDelta) {
  7996. state.edgeSign = (linkedEdges.left ? 1 : -1) * (linkedEdges.top ? 1 : -1);
  7997. } else {
  7998. const negativeSecondaryEdge = state.xIsPrimaryAxis ? linkedEdges.top : linkedEdges.left;
  7999. state.edgeSign = negativeSecondaryEdge ? -1 : 1;
  8000. }
  8001. extend(arg.edges, linkedEdges);
  8002. if (!modifiers || !modifiers.length) {
  8003. return;
  8004. }
  8005. const subModification = new Modification_Modification(arg.interaction);
  8006. subModification.copyFrom(arg.interaction.modification);
  8007. subModification.prepareStates(modifiers);
  8008. state.subModification = subModification;
  8009. subModification.startAll({
  8010. ...arg
  8011. });
  8012. },
  8013. set(arg) {
  8014. const {
  8015. state,
  8016. rect,
  8017. coords
  8018. } = arg;
  8019. const initialCoords = extend({}, coords);
  8020. const aspectMethod = state.equalDelta ? setEqualDelta : setRatio;
  8021. aspectMethod(state, state.xIsPrimaryAxis, coords, rect);
  8022. if (!state.subModification) {
  8023. return null;
  8024. }
  8025. const correctedRect = extend({}, rect);
  8026. addEdges(state.linkedEdges, correctedRect, {
  8027. x: coords.x - initialCoords.x,
  8028. y: coords.y - initialCoords.y
  8029. });
  8030. const result = state.subModification.setAll({
  8031. ...arg,
  8032. rect: correctedRect,
  8033. edges: state.linkedEdges,
  8034. pageCoords: coords,
  8035. prevCoords: coords,
  8036. prevRect: correctedRect
  8037. });
  8038. const {
  8039. delta
  8040. } = result;
  8041. if (result.changed) {
  8042. const xIsCriticalAxis = Math.abs(delta.x) > Math.abs(delta.y);
  8043. aspectMethod(state, xIsCriticalAxis, result.coords, result.rect);
  8044. extend(coords, result.coords);
  8045. }
  8046. return result.eventProps;
  8047. },
  8048. defaults: {
  8049. ratio: "preserve",
  8050. equalDelta: false,
  8051. modifiers: [],
  8052. enabled: false
  8053. }
  8054. };
  8055. function setEqualDelta({
  8056. startCoords,
  8057. edgeSign
  8058. }, xIsPrimaryAxis, coords) {
  8059. if (xIsPrimaryAxis) {
  8060. coords.y = startCoords.y + (coords.x - startCoords.x) * edgeSign;
  8061. } else {
  8062. coords.x = startCoords.x + (coords.y - startCoords.y) * edgeSign;
  8063. }
  8064. }
  8065. function setRatio({
  8066. startRect,
  8067. startCoords,
  8068. ratio,
  8069. edgeSign
  8070. }, xIsPrimaryAxis, coords, rect) {
  8071. if (xIsPrimaryAxis) {
  8072. const newHeight = rect.width / ratio;
  8073. coords.y = startCoords.y + (newHeight - startRect.height) * edgeSign;
  8074. } else {
  8075. const newWidth = rect.height * ratio;
  8076. coords.x = startCoords.x + (newWidth - startRect.width) * edgeSign;
  8077. }
  8078. }
  8079. var modifiers_aspectRatio = makeModifier(aspectRatio, "aspectRatio");
  8080. const noop = () => {
  8081. };
  8082. noop._defaults = {};
  8083. var modifiers_noop = noop;
  8084. function pointer_start({
  8085. rect,
  8086. startOffset,
  8087. state,
  8088. interaction,
  8089. pageCoords
  8090. }) {
  8091. const {
  8092. options
  8093. } = state;
  8094. const {
  8095. elementRect
  8096. } = options;
  8097. const offset = extend({
  8098. left: 0,
  8099. top: 0,
  8100. right: 0,
  8101. bottom: 0
  8102. }, options.offset || {});
  8103. if (rect && elementRect) {
  8104. const restriction = getRestrictionRect(options.restriction, interaction, pageCoords);
  8105. if (restriction) {
  8106. const widthDiff = restriction.right - restriction.left - rect.width;
  8107. const heightDiff = restriction.bottom - restriction.top - rect.height;
  8108. if (widthDiff < 0) {
  8109. offset.left += widthDiff;
  8110. offset.right += widthDiff;
  8111. }
  8112. if (heightDiff < 0) {
  8113. offset.top += heightDiff;
  8114. offset.bottom += heightDiff;
  8115. }
  8116. }
  8117. offset.left += startOffset.left - rect.width * elementRect.left;
  8118. offset.top += startOffset.top - rect.height * elementRect.top;
  8119. offset.right += startOffset.right - rect.width * (1 - elementRect.right);
  8120. offset.bottom += startOffset.bottom - rect.height * (1 - elementRect.bottom);
  8121. }
  8122. state.offset = offset;
  8123. }
  8124. function set({
  8125. coords,
  8126. interaction,
  8127. state
  8128. }) {
  8129. const {
  8130. options,
  8131. offset
  8132. } = state;
  8133. const restriction = getRestrictionRect(options.restriction, interaction, coords);
  8134. if (!restriction) {
  8135. return;
  8136. }
  8137. const rect = xywhToTlbr(restriction);
  8138. coords.x = Math.max(Math.min(rect.right - offset.right, coords.x), rect.left + offset.left);
  8139. coords.y = Math.max(Math.min(rect.bottom - offset.bottom, coords.y), rect.top + offset.top);
  8140. }
  8141. function getRestrictionRect(value, interaction, coords) {
  8142. if (is.func(value)) {
  8143. return resolveRectLike(value, interaction.interactable, interaction.element, [coords.x, coords.y, interaction]);
  8144. } else {
  8145. return resolveRectLike(value, interaction.interactable, interaction.element);
  8146. }
  8147. }
  8148. const pointer_defaults = {
  8149. restriction: null,
  8150. elementRect: null,
  8151. offset: null,
  8152. endOnly: false,
  8153. enabled: false
  8154. };
  8155. const restrict = {
  8156. start: pointer_start,
  8157. set,
  8158. defaults: pointer_defaults
  8159. };
  8160. var restrict_pointer = makeModifier(restrict, "restrict");
  8161. const noInner = {
  8162. top: Infinity,
  8163. left: Infinity,
  8164. bottom: -Infinity,
  8165. right: -Infinity
  8166. };
  8167. const noOuter = {
  8168. top: -Infinity,
  8169. left: -Infinity,
  8170. bottom: Infinity,
  8171. right: Infinity
  8172. };
  8173. function edges_start({
  8174. interaction,
  8175. startOffset,
  8176. state
  8177. }) {
  8178. const {
  8179. options
  8180. } = state;
  8181. let offset;
  8182. if (options) {
  8183. const offsetRect = getRestrictionRect(options.offset, interaction, interaction.coords.start.page);
  8184. offset = rectToXY(offsetRect);
  8185. }
  8186. offset = offset || {
  8187. x: 0,
  8188. y: 0
  8189. };
  8190. state.offset = {
  8191. top: offset.y + startOffset.top,
  8192. left: offset.x + startOffset.left,
  8193. bottom: offset.y - startOffset.bottom,
  8194. right: offset.x - startOffset.right
  8195. };
  8196. }
  8197. function edges_set({
  8198. coords,
  8199. edges,
  8200. interaction,
  8201. state
  8202. }) {
  8203. const {
  8204. offset,
  8205. options
  8206. } = state;
  8207. if (!edges) {
  8208. return;
  8209. }
  8210. const page = extend({}, coords);
  8211. const inner = getRestrictionRect(options.inner, interaction, page) || {};
  8212. const outer = getRestrictionRect(options.outer, interaction, page) || {};
  8213. fixRect(inner, noInner);
  8214. fixRect(outer, noOuter);
  8215. if (edges.top) {
  8216. coords.y = Math.min(Math.max(outer.top + offset.top, page.y), inner.top + offset.top);
  8217. } else if (edges.bottom) {
  8218. coords.y = Math.max(Math.min(outer.bottom + offset.bottom, page.y), inner.bottom + offset.bottom);
  8219. }
  8220. if (edges.left) {
  8221. coords.x = Math.min(Math.max(outer.left + offset.left, page.x), inner.left + offset.left);
  8222. } else if (edges.right) {
  8223. coords.x = Math.max(Math.min(outer.right + offset.right, page.x), inner.right + offset.right);
  8224. }
  8225. }
  8226. function fixRect(rect, defaults) {
  8227. for (const edge of ["top", "left", "bottom", "right"]) {
  8228. if (!(edge in rect)) {
  8229. rect[edge] = defaults[edge];
  8230. }
  8231. }
  8232. return rect;
  8233. }
  8234. const edges_defaults = {
  8235. inner: null,
  8236. outer: null,
  8237. offset: null,
  8238. endOnly: false,
  8239. enabled: false
  8240. };
  8241. const restrictEdges = {
  8242. noInner,
  8243. noOuter,
  8244. start: edges_start,
  8245. set: edges_set,
  8246. defaults: edges_defaults
  8247. };
  8248. var restrict_edges = makeModifier(restrictEdges, "restrictEdges");
  8249. const rect_defaults = extend({
  8250. get elementRect() {
  8251. return {
  8252. top: 0,
  8253. left: 0,
  8254. bottom: 1,
  8255. right: 1
  8256. };
  8257. },
  8258. set elementRect(_) {
  8259. }
  8260. }, restrict.defaults);
  8261. const restrictRect = {
  8262. start: restrict.start,
  8263. set: restrict.set,
  8264. defaults: rect_defaults
  8265. };
  8266. var restrict_rect = makeModifier(restrictRect, "restrictRect");
  8267. const noMin = {
  8268. width: -Infinity,
  8269. height: -Infinity
  8270. };
  8271. const noMax = {
  8272. width: Infinity,
  8273. height: Infinity
  8274. };
  8275. function size_start(arg) {
  8276. return restrictEdges.start(arg);
  8277. }
  8278. function size_set(arg) {
  8279. const {
  8280. interaction,
  8281. state,
  8282. rect,
  8283. edges
  8284. } = arg;
  8285. const {
  8286. options
  8287. } = state;
  8288. if (!edges) {
  8289. return;
  8290. }
  8291. const minSize = tlbrToXywh(getRestrictionRect(options.min, interaction, arg.coords)) || noMin;
  8292. const maxSize = tlbrToXywh(getRestrictionRect(options.max, interaction, arg.coords)) || noMax;
  8293. state.options = {
  8294. endOnly: options.endOnly,
  8295. inner: extend({}, restrictEdges.noInner),
  8296. outer: extend({}, restrictEdges.noOuter)
  8297. };
  8298. if (edges.top) {
  8299. state.options.inner.top = rect.bottom - minSize.height;
  8300. state.options.outer.top = rect.bottom - maxSize.height;
  8301. } else if (edges.bottom) {
  8302. state.options.inner.bottom = rect.top + minSize.height;
  8303. state.options.outer.bottom = rect.top + maxSize.height;
  8304. }
  8305. if (edges.left) {
  8306. state.options.inner.left = rect.right - minSize.width;
  8307. state.options.outer.left = rect.right - maxSize.width;
  8308. } else if (edges.right) {
  8309. state.options.inner.right = rect.left + minSize.width;
  8310. state.options.outer.right = rect.left + maxSize.width;
  8311. }
  8312. restrictEdges.set(arg);
  8313. state.options = options;
  8314. }
  8315. const size_defaults = {
  8316. min: null,
  8317. max: null,
  8318. endOnly: false,
  8319. enabled: false
  8320. };
  8321. const restrictSize = {
  8322. start: size_start,
  8323. set: size_set,
  8324. defaults: size_defaults
  8325. };
  8326. var size = makeModifier(restrictSize, "restrictSize");
  8327. function snap_pointer_start(arg) {
  8328. const {
  8329. interaction,
  8330. interactable,
  8331. element,
  8332. rect,
  8333. state,
  8334. startOffset
  8335. } = arg;
  8336. const {
  8337. options
  8338. } = state;
  8339. const origin = options.offsetWithOrigin ? getOrigin(arg) : {
  8340. x: 0,
  8341. y: 0
  8342. };
  8343. let snapOffset;
  8344. if (options.offset === "startCoords") {
  8345. snapOffset = {
  8346. x: interaction.coords.start.page.x,
  8347. y: interaction.coords.start.page.y
  8348. };
  8349. } else {
  8350. const offsetRect = resolveRectLike(options.offset, interactable, element, [interaction]);
  8351. snapOffset = rectToXY(offsetRect) || {
  8352. x: 0,
  8353. y: 0
  8354. };
  8355. snapOffset.x += origin.x;
  8356. snapOffset.y += origin.y;
  8357. }
  8358. const {
  8359. relativePoints
  8360. } = options;
  8361. state.offsets = rect && relativePoints && relativePoints.length ? relativePoints.map((relativePoint, index) => ({
  8362. index,
  8363. relativePoint,
  8364. x: startOffset.left - rect.width * relativePoint.x + snapOffset.x,
  8365. y: startOffset.top - rect.height * relativePoint.y + snapOffset.y
  8366. })) : [extend({
  8367. index: 0,
  8368. relativePoint: null
  8369. }, snapOffset)];
  8370. }
  8371. function pointer_set(arg) {
  8372. const {
  8373. interaction,
  8374. coords,
  8375. state
  8376. } = arg;
  8377. const {
  8378. options,
  8379. offsets
  8380. } = state;
  8381. const origin = getOriginXY(interaction.interactable, interaction.element, interaction.prepared.name);
  8382. const page = extend({}, coords);
  8383. const targets = [];
  8384. if (!options.offsetWithOrigin) {
  8385. page.x -= origin.x;
  8386. page.y -= origin.y;
  8387. }
  8388. for (const offset of offsets) {
  8389. const relativeX = page.x - offset.x;
  8390. const relativeY = page.y - offset.y;
  8391. for (let index = 0, len = options.targets.length; index < len; index++) {
  8392. const snapTarget = options.targets[index];
  8393. let target;
  8394. if (is.func(snapTarget)) {
  8395. target = snapTarget(relativeX, relativeY, interaction._proxy, offset, index);
  8396. } else {
  8397. target = snapTarget;
  8398. }
  8399. if (!target) {
  8400. continue;
  8401. }
  8402. targets.push({
  8403. x: (is.number(target.x) ? target.x : relativeX) + offset.x,
  8404. y: (is.number(target.y) ? target.y : relativeY) + offset.y,
  8405. range: is.number(target.range) ? target.range : options.range,
  8406. source: snapTarget,
  8407. index,
  8408. offset
  8409. });
  8410. }
  8411. }
  8412. const closest = {
  8413. target: null,
  8414. inRange: false,
  8415. distance: 0,
  8416. range: 0,
  8417. delta: {
  8418. x: 0,
  8419. y: 0
  8420. }
  8421. };
  8422. for (const target of targets) {
  8423. const range = target.range;
  8424. const dx = target.x - page.x;
  8425. const dy = target.y - page.y;
  8426. const distance = hypot(dx, dy);
  8427. let inRange = distance <= range;
  8428. if (range === Infinity && closest.inRange && closest.range !== Infinity) {
  8429. inRange = false;
  8430. }
  8431. if (!closest.target || (inRange ? closest.inRange && range !== Infinity ? distance / range < closest.distance / closest.range : range === Infinity && closest.range !== Infinity || // OR this target is closer that the previous closest
  8432. distance < closest.distance : (
  8433. // The other is not in range and the pointer is closer to this target
  8434. !closest.inRange && distance < closest.distance
  8435. ))) {
  8436. closest.target = target;
  8437. closest.distance = distance;
  8438. closest.range = range;
  8439. closest.inRange = inRange;
  8440. closest.delta.x = dx;
  8441. closest.delta.y = dy;
  8442. }
  8443. }
  8444. if (closest.inRange) {
  8445. coords.x = closest.target.x;
  8446. coords.y = closest.target.y;
  8447. }
  8448. state.closest = closest;
  8449. return closest;
  8450. }
  8451. function getOrigin(arg) {
  8452. const {
  8453. element
  8454. } = arg.interaction;
  8455. const optionsOrigin = rectToXY(resolveRectLike(arg.state.options.origin, null, null, [element]));
  8456. const origin = optionsOrigin || getOriginXY(arg.interactable, element, arg.interaction.prepared.name);
  8457. return origin;
  8458. }
  8459. const snap_pointer_defaults = {
  8460. range: Infinity,
  8461. targets: null,
  8462. offset: null,
  8463. offsetWithOrigin: true,
  8464. origin: null,
  8465. relativePoints: null,
  8466. endOnly: false,
  8467. enabled: false
  8468. };
  8469. const snap = {
  8470. start: snap_pointer_start,
  8471. set: pointer_set,
  8472. defaults: snap_pointer_defaults
  8473. };
  8474. var snap_pointer = makeModifier(snap, "snap");
  8475. function snap_size_start(arg) {
  8476. const {
  8477. state,
  8478. edges
  8479. } = arg;
  8480. const {
  8481. options
  8482. } = state;
  8483. if (!edges) {
  8484. return null;
  8485. }
  8486. arg.state = {
  8487. options: {
  8488. targets: null,
  8489. relativePoints: [{
  8490. x: edges.left ? 0 : 1,
  8491. y: edges.top ? 0 : 1
  8492. }],
  8493. offset: options.offset || "self",
  8494. origin: {
  8495. x: 0,
  8496. y: 0
  8497. },
  8498. range: options.range
  8499. }
  8500. };
  8501. state.targetFields = state.targetFields || [["width", "height"], ["x", "y"]];
  8502. snap.start(arg);
  8503. state.offsets = arg.state.offsets;
  8504. arg.state = state;
  8505. }
  8506. function snap_size_set(arg) {
  8507. const {
  8508. interaction,
  8509. state,
  8510. coords
  8511. } = arg;
  8512. const {
  8513. options,
  8514. offsets
  8515. } = state;
  8516. const relative = {
  8517. x: coords.x - offsets[0].x,
  8518. y: coords.y - offsets[0].y
  8519. };
  8520. state.options = extend({}, options);
  8521. state.options.targets = [];
  8522. for (const snapTarget of options.targets || []) {
  8523. let target;
  8524. if (is.func(snapTarget)) {
  8525. target = snapTarget(relative.x, relative.y, interaction);
  8526. } else {
  8527. target = snapTarget;
  8528. }
  8529. if (!target) {
  8530. continue;
  8531. }
  8532. for (const [xField, yField] of state.targetFields) {
  8533. if (xField in target || yField in target) {
  8534. target.x = target[xField];
  8535. target.y = target[yField];
  8536. break;
  8537. }
  8538. }
  8539. state.options.targets.push(target);
  8540. }
  8541. const returnValue = snap.set(arg);
  8542. state.options = options;
  8543. return returnValue;
  8544. }
  8545. const snap_size_defaults = {
  8546. range: Infinity,
  8547. targets: null,
  8548. offset: null,
  8549. endOnly: false,
  8550. enabled: false
  8551. };
  8552. const snapSize = {
  8553. start: snap_size_start,
  8554. set: snap_size_set,
  8555. defaults: snap_size_defaults
  8556. };
  8557. var snap_size = makeModifier(snapSize, "snapSize");
  8558. function snap_edges_start(arg) {
  8559. const {
  8560. edges
  8561. } = arg;
  8562. if (!edges) {
  8563. return null;
  8564. }
  8565. arg.state.targetFields = arg.state.targetFields || [[edges.left ? "left" : "right", edges.top ? "top" : "bottom"]];
  8566. return snapSize.start(arg);
  8567. }
  8568. const snapEdges = {
  8569. start: snap_edges_start,
  8570. set: snapSize.set,
  8571. defaults: extend(clone(snapSize.defaults), {
  8572. targets: null,
  8573. range: null,
  8574. offset: {
  8575. x: 0,
  8576. y: 0
  8577. }
  8578. })
  8579. };
  8580. var snap_edges = makeModifier(snapEdges, "snapEdges");
  8581. var modifiers_all = {
  8582. aspectRatio: modifiers_aspectRatio,
  8583. restrictEdges: restrict_edges,
  8584. restrict: restrict_pointer,
  8585. restrictRect: restrict_rect,
  8586. restrictSize: size,
  8587. snapEdges: snap_edges,
  8588. snap: snap_pointer,
  8589. snapSize: snap_size,
  8590. spring: modifiers_noop,
  8591. avoid: modifiers_noop,
  8592. transform: modifiers_noop,
  8593. rubberband: modifiers_noop
  8594. };
  8595. const plugin_modifiers = {
  8596. id: "modifiers",
  8597. install(scope) {
  8598. const {
  8599. interactStatic: interact
  8600. } = scope;
  8601. scope.usePlugin(modifiers_base);
  8602. scope.usePlugin(snappers_plugin);
  8603. interact.modifiers = modifiers_all;
  8604. for (const type in modifiers_all) {
  8605. const {
  8606. _defaults,
  8607. _methods
  8608. } = modifiers_all[type];
  8609. _defaults._methods = _methods;
  8610. scope.defaults.perAction[type] = _defaults;
  8611. }
  8612. }
  8613. };
  8614. var modifiers_plugin = plugin_modifiers;
  8615. if (typeof window === "object" && !!window) {
  8616. interact_init(window);
  8617. }
  8618. _interactjs_interact.use(modifiers_plugin);
  8619. var CheckName;
  8620. (function(CheckName2) {
  8621. CheckName2["touchAction"] = "touchAction";
  8622. CheckName2["boxSizing"] = "boxSizing";
  8623. CheckName2["noListeners"] = "noListeners";
  8624. })(CheckName || (CheckName = {}));
  8625. const prefix = "[interact.js] ";
  8626. const links = {
  8627. touchAction: "https://developer.mozilla.org/en-US/docs/Web/CSS/touch-action",
  8628. boxSizing: "https://developer.mozilla.org/en-US/docs/Web/CSS/box-sizing"
  8629. };
  8630. const isProduction = false;
  8631. function dev_tools_plugin_install(scope, {
  8632. logger
  8633. } = {}) {
  8634. const {
  8635. Interactable,
  8636. defaults
  8637. } = scope;
  8638. scope.logger = logger || console;
  8639. defaults.base.devTools = {
  8640. ignore: {}
  8641. };
  8642. Interactable.prototype.devTools = function(options) {
  8643. if (options) {
  8644. extend(this.options.devTools, options);
  8645. return this;
  8646. }
  8647. return this.options.devTools;
  8648. };
  8649. }
  8650. const checks = [{
  8651. name: CheckName.touchAction,
  8652. perform({
  8653. element
  8654. }) {
  8655. return !parentHasStyle(element, "touchAction", /pan-|pinch|none/);
  8656. },
  8657. getInfo({
  8658. element
  8659. }) {
  8660. return [element, links.touchAction];
  8661. },
  8662. text: 'Consider adding CSS "touch-action: none" to this element\n'
  8663. }, {
  8664. name: CheckName.boxSizing,
  8665. perform(interaction) {
  8666. const {
  8667. element
  8668. } = interaction;
  8669. return interaction.prepared.name === "resize" && element instanceof utils_domObjects.HTMLElement && !hasStyle(element, "boxSizing", /border-box/);
  8670. },
  8671. text: 'Consider adding CSS "box-sizing: border-box" to this resizable element',
  8672. getInfo({
  8673. element
  8674. }) {
  8675. return [element, links.boxSizing];
  8676. }
  8677. }, {
  8678. name: CheckName.noListeners,
  8679. perform(interaction) {
  8680. const actionName = interaction.prepared.name;
  8681. const moveListeners = interaction.interactable.events.types[`${actionName}move`] || [];
  8682. return !moveListeners.length;
  8683. },
  8684. getInfo(interaction) {
  8685. return [interaction.prepared.name, interaction.interactable];
  8686. },
  8687. text: "There are no listeners set for this action"
  8688. }];
  8689. function hasStyle(element, prop, styleRe) {
  8690. const value = element.style[prop] || win.getComputedStyle(element)[prop];
  8691. return styleRe.test((value || "").toString());
  8692. }
  8693. function parentHasStyle(element, prop, styleRe) {
  8694. let parent = element;
  8695. while (is.element(parent)) {
  8696. if (hasStyle(parent, prop, styleRe)) {
  8697. return true;
  8698. }
  8699. parent = parentNode(parent);
  8700. }
  8701. return false;
  8702. }
  8703. const plugin_id = "dev-tools";
  8704. const defaultExport = isProduction ? {
  8705. id: plugin_id,
  8706. install: () => {
  8707. }
  8708. } : {
  8709. id: plugin_id,
  8710. install: dev_tools_plugin_install,
  8711. listeners: {
  8712. "interactions:action-start": ({
  8713. interaction
  8714. }, scope) => {
  8715. for (const check of checks) {
  8716. const options = interaction.interactable && interaction.interactable.options;
  8717. if (!(options && options.devTools && options.devTools.ignore[check.name]) && check.perform(interaction)) {
  8718. scope.logger.warn(prefix + check.text, ...check.getInfo(interaction));
  8719. }
  8720. }
  8721. }
  8722. },
  8723. checks,
  8724. CheckName,
  8725. links,
  8726. prefix
  8727. };
  8728. var dev_tools_plugin = defaultExport;
  8729. if (typeof window === "object" && !!window) {
  8730. interact_init(window);
  8731. }
  8732. _interactjs_interact.use(dev_tools_plugin);
  8733. var GridItemvue_type_script_lang_js = {
  8734. name: "GridItem",
  8735. props: {
  8736. /*cols: {
  8737. type: Number,
  8738. required: true
  8739. },*/
  8740. /*containerWidth: {
  8741. type: Number,
  8742. required: true
  8743. },
  8744. rowHeight: {
  8745. type: Number,
  8746. required: true
  8747. },
  8748. margin: {
  8749. type: Array,
  8750. required: true
  8751. },
  8752. maxRows: {
  8753. type: Number,
  8754. required: true
  8755. },*/
  8756. isDraggable: {
  8757. type: Boolean,
  8758. required: false,
  8759. default: null
  8760. },
  8761. isResizable: {
  8762. type: Boolean,
  8763. required: false,
  8764. default: null
  8765. },
  8766. /*useCssTransforms: {
  8767. type: Boolean,
  8768. required: true
  8769. },
  8770. */
  8771. static: {
  8772. type: Boolean,
  8773. required: false,
  8774. default: false
  8775. },
  8776. minH: {
  8777. type: Number,
  8778. required: false,
  8779. default: 1
  8780. },
  8781. minW: {
  8782. type: Number,
  8783. required: false,
  8784. default: 1
  8785. },
  8786. maxH: {
  8787. type: Number,
  8788. required: false,
  8789. default: Infinity
  8790. },
  8791. maxW: {
  8792. type: Number,
  8793. required: false,
  8794. default: Infinity
  8795. },
  8796. x: {
  8797. type: Number,
  8798. required: true
  8799. },
  8800. y: {
  8801. type: Number,
  8802. required: true
  8803. },
  8804. w: {
  8805. type: Number,
  8806. required: true
  8807. },
  8808. h: {
  8809. type: Number,
  8810. required: true
  8811. },
  8812. i: {
  8813. required: true
  8814. },
  8815. dragIgnoreFrom: {
  8816. type: String,
  8817. required: false,
  8818. default: "a, button"
  8819. },
  8820. dragAllowFrom: {
  8821. type: String,
  8822. required: false,
  8823. default: null
  8824. },
  8825. resizeIgnoreFrom: {
  8826. type: String,
  8827. required: false,
  8828. default: "a, button"
  8829. },
  8830. preserveAspectRatio: {
  8831. type: Boolean,
  8832. required: false,
  8833. default: false
  8834. }
  8835. },
  8836. inject: ["eventBus", "layout"],
  8837. data: function data() {
  8838. return {
  8839. cols: 1,
  8840. containerWidth: 100,
  8841. rowHeight: 30,
  8842. margin: [10, 10],
  8843. maxRows: Infinity,
  8844. draggable: null,
  8845. resizable: null,
  8846. useCssTransforms: true,
  8847. useStyleCursor: true,
  8848. isDragging: false,
  8849. dragging: null,
  8850. isResizing: false,
  8851. resizing: null,
  8852. lastX: NaN,
  8853. lastY: NaN,
  8854. lastW: NaN,
  8855. lastH: NaN,
  8856. style: {},
  8857. rtl: false,
  8858. dragEventSet: false,
  8859. resizeEventSet: false,
  8860. previousW: null,
  8861. previousH: null,
  8862. previousX: null,
  8863. previousY: null,
  8864. innerX: this.x,
  8865. innerY: this.y,
  8866. innerW: this.w,
  8867. innerH: this.h
  8868. };
  8869. },
  8870. created: function created() {
  8871. var _this = this;
  8872. var self2 = this;
  8873. self2.updateWidthHandler = function(width) {
  8874. self2.updateWidth(width);
  8875. };
  8876. self2.compactHandler = function(layout) {
  8877. self2.compact(layout);
  8878. };
  8879. self2.setDraggableHandler = function(isDraggable) {
  8880. if (self2.isDraggable === null) {
  8881. self2.draggable = isDraggable;
  8882. }
  8883. };
  8884. self2.setResizableHandler = function(isResizable) {
  8885. if (self2.isResizable === null) {
  8886. self2.resizable = isResizable;
  8887. }
  8888. };
  8889. self2.setRowHeightHandler = function(rowHeight) {
  8890. self2.rowHeight = rowHeight;
  8891. };
  8892. self2.setMaxRowsHandler = function(maxRows) {
  8893. self2.maxRows = maxRows;
  8894. };
  8895. self2.directionchangeHandler = function() {
  8896. _this.rtl = getDocumentDir() === "rtl";
  8897. _this.compact();
  8898. };
  8899. self2.setColNum = function(colNum) {
  8900. self2.cols = parseInt(colNum);
  8901. };
  8902. this.eventBus.on("updateWidth", self2.updateWidthHandler);
  8903. this.eventBus.on("compact", self2.compactHandler);
  8904. this.eventBus.on("setDraggable", self2.setDraggableHandler);
  8905. this.eventBus.on("setResizable", self2.setResizableHandler);
  8906. this.eventBus.on("setRowHeight", self2.setRowHeightHandler);
  8907. this.eventBus.on("setMaxRows", self2.setMaxRowsHandler);
  8908. this.eventBus.on("directionchange", self2.directionchangeHandler);
  8909. this.eventBus.on("setColNum", self2.setColNum);
  8910. this.rtl = getDocumentDir() === "rtl";
  8911. },
  8912. beforeUnmount: function beforeUnmount() {
  8913. var self2 = this;
  8914. this.eventBus.off("updateWidth", self2.updateWidthHandler);
  8915. this.eventBus.off("compact", self2.compactHandler);
  8916. this.eventBus.off("setDraggable", self2.setDraggableHandler);
  8917. this.eventBus.off("setResizable", self2.setResizableHandler);
  8918. this.eventBus.off("setRowHeight", self2.setRowHeightHandler);
  8919. this.eventBus.off("setMaxRows", self2.setMaxRowsHandler);
  8920. this.eventBus.off("directionchange", self2.directionchangeHandler);
  8921. this.eventBus.off("setColNum", self2.setColNum);
  8922. if (this.interactObj) {
  8923. this.interactObj.unset();
  8924. }
  8925. },
  8926. mounted: function mounted() {
  8927. if (this.layout.responsive && this.layout.lastBreakpoint) {
  8928. this.cols = getColsFromBreakpoint(this.layout.lastBreakpoint, this.layout.cols);
  8929. } else {
  8930. this.cols = this.layout.colNum;
  8931. }
  8932. this.rowHeight = this.layout.rowHeight;
  8933. this.containerWidth = this.layout.width !== null ? this.layout.width : 100;
  8934. this.margin = this.layout.margin !== void 0 ? this.layout.margin : [10, 10];
  8935. this.maxRows = this.layout.maxRows;
  8936. if (this.isDraggable === null) {
  8937. this.draggable = this.layout.isDraggable;
  8938. } else {
  8939. this.draggable = this.isDraggable;
  8940. }
  8941. if (this.isResizable === null) {
  8942. this.resizable = this.layout.isResizable;
  8943. } else {
  8944. this.resizable = this.isResizable;
  8945. }
  8946. this.useCssTransforms = this.layout.useCssTransforms;
  8947. this.useStyleCursor = this.layout.useStyleCursor;
  8948. this.createStyle();
  8949. },
  8950. watch: {
  8951. isDraggable: function isDraggable() {
  8952. this.draggable = this.isDraggable;
  8953. },
  8954. static: function _static() {
  8955. this.tryMakeDraggable();
  8956. this.tryMakeResizable();
  8957. },
  8958. draggable: function draggable() {
  8959. this.tryMakeDraggable();
  8960. },
  8961. isResizable: function isResizable() {
  8962. this.resizable = this.isResizable;
  8963. },
  8964. resizable: function resizable2() {
  8965. this.tryMakeResizable();
  8966. },
  8967. rowHeight: function rowHeight() {
  8968. this.createStyle();
  8969. this.emitContainerResized();
  8970. },
  8971. cols: function cols() {
  8972. this.tryMakeResizable();
  8973. this.createStyle();
  8974. this.emitContainerResized();
  8975. },
  8976. containerWidth: function containerWidth() {
  8977. this.tryMakeResizable();
  8978. this.createStyle();
  8979. this.emitContainerResized();
  8980. },
  8981. x: function x(newVal) {
  8982. this.innerX = newVal;
  8983. this.createStyle();
  8984. },
  8985. y: function y(newVal) {
  8986. this.innerY = newVal;
  8987. this.createStyle();
  8988. },
  8989. h: function h(newVal) {
  8990. this.innerH = newVal;
  8991. this.createStyle();
  8992. },
  8993. w: function w(newVal) {
  8994. this.innerW = newVal;
  8995. this.createStyle();
  8996. },
  8997. renderRtl: function renderRtl() {
  8998. this.tryMakeResizable();
  8999. this.createStyle();
  9000. },
  9001. minH: function minH() {
  9002. this.tryMakeResizable();
  9003. },
  9004. maxH: function maxH() {
  9005. this.tryMakeResizable();
  9006. },
  9007. minW: function minW() {
  9008. this.tryMakeResizable();
  9009. },
  9010. maxW: function maxW() {
  9011. this.tryMakeResizable();
  9012. },
  9013. "$parent.margin": function $parentMargin(margin) {
  9014. if (!margin || margin[0] == this.margin[0] && margin[1] == this.margin[1]) {
  9015. return;
  9016. }
  9017. this.margin = margin.map(function(m) {
  9018. return Number(m);
  9019. });
  9020. this.createStyle();
  9021. this.emitContainerResized();
  9022. }
  9023. },
  9024. computed: {
  9025. classObj: function classObj() {
  9026. return {
  9027. "vue-resizable": this.resizableAndNotStatic,
  9028. "static": this.static,
  9029. "resizing": this.isResizing,
  9030. "vue-draggable-dragging": this.isDragging,
  9031. "cssTransforms": this.useCssTransforms,
  9032. "render-rtl": this.renderRtl,
  9033. "disable-userselect": this.isDragging,
  9034. "no-touch": this.isAndroid && this.draggableOrResizableAndNotStatic
  9035. };
  9036. },
  9037. resizableAndNotStatic: function resizableAndNotStatic() {
  9038. return this.resizable && !this.static;
  9039. },
  9040. draggableOrResizableAndNotStatic: function draggableOrResizableAndNotStatic() {
  9041. return (this.draggable || this.resizable) && !this.static;
  9042. },
  9043. isAndroid: function isAndroid() {
  9044. return navigator.userAgent.toLowerCase().indexOf("android") !== -1;
  9045. },
  9046. renderRtl: function renderRtl() {
  9047. return this.layout.isMirrored ? !this.rtl : this.rtl;
  9048. },
  9049. resizableHandleClass: function resizableHandleClass() {
  9050. if (this.renderRtl) {
  9051. return "vue-resizable-handle vue-rtl-resizable-handle";
  9052. } else {
  9053. return "vue-resizable-handle";
  9054. }
  9055. }
  9056. },
  9057. methods: {
  9058. createStyle: function createStyle() {
  9059. if (this.x + this.w > this.cols) {
  9060. this.innerX = 0;
  9061. this.innerW = this.w > this.cols ? this.cols : this.w;
  9062. } else {
  9063. this.innerX = this.x;
  9064. this.innerW = this.w;
  9065. }
  9066. var pos = this.calcPosition(this.innerX, this.innerY, this.innerW, this.innerH);
  9067. if (this.isDragging) {
  9068. pos.top = this.dragging.top;
  9069. if (this.renderRtl) {
  9070. pos.right = this.dragging.left;
  9071. } else {
  9072. pos.left = this.dragging.left;
  9073. }
  9074. }
  9075. if (this.isResizing) {
  9076. pos.width = this.resizing.width;
  9077. pos.height = this.resizing.height;
  9078. }
  9079. var style;
  9080. if (this.useCssTransforms) {
  9081. if (this.renderRtl) {
  9082. style = setTransformRtl(pos.top, pos.right, pos.width, pos.height);
  9083. } else {
  9084. style = setTransform(pos.top, pos.left, pos.width, pos.height);
  9085. }
  9086. } else {
  9087. if (this.renderRtl) {
  9088. style = setTopRight(pos.top, pos.right, pos.width, pos.height);
  9089. } else {
  9090. style = setTopLeft(pos.top, pos.left, pos.width, pos.height);
  9091. }
  9092. }
  9093. this.style = style;
  9094. },
  9095. emitContainerResized: function emitContainerResized() {
  9096. var styleProps = {};
  9097. for (var _i = 0, _arr = ["width", "height"]; _i < _arr.length; _i++) {
  9098. var prop = _arr[_i];
  9099. var val = this.style[prop];
  9100. var matches = val.match(/^(\d+)px$/);
  9101. if (!matches)
  9102. return;
  9103. styleProps[prop] = matches[1];
  9104. }
  9105. this.$emit("container-resized", this.i, this.h, this.w, styleProps.height, styleProps.width);
  9106. },
  9107. handleResize: function handleResize(event) {
  9108. if (this.static)
  9109. return;
  9110. var position = getControlPosition(event);
  9111. if (position == null)
  9112. return;
  9113. var x = position.x, y = position.y;
  9114. var newSize = {
  9115. width: 0,
  9116. height: 0
  9117. };
  9118. var pos;
  9119. switch (event.type) {
  9120. case "resizestart": {
  9121. this.previousW = this.innerW;
  9122. this.previousH = this.innerH;
  9123. pos = this.calcPosition(this.innerX, this.innerY, this.innerW, this.innerH);
  9124. newSize.width = pos.width;
  9125. newSize.height = pos.height;
  9126. this.resizing = newSize;
  9127. this.isResizing = true;
  9128. break;
  9129. }
  9130. case "resizemove": {
  9131. var coreEvent = createCoreData(this.lastW, this.lastH, x, y);
  9132. if (this.renderRtl) {
  9133. newSize.width = this.resizing.width - coreEvent.deltaX;
  9134. } else {
  9135. newSize.width = this.resizing.width + coreEvent.deltaX;
  9136. }
  9137. newSize.height = this.resizing.height + coreEvent.deltaY;
  9138. this.resizing = newSize;
  9139. break;
  9140. }
  9141. case "resizeend": {
  9142. pos = this.calcPosition(this.innerX, this.innerY, this.innerW, this.innerH);
  9143. newSize.width = pos.width;
  9144. newSize.height = pos.height;
  9145. this.resizing = null;
  9146. this.isResizing = false;
  9147. break;
  9148. }
  9149. }
  9150. pos = this.calcWH(newSize.height, newSize.width);
  9151. if (pos.w < this.minW) {
  9152. pos.w = this.minW;
  9153. }
  9154. if (pos.w > this.maxW) {
  9155. pos.w = this.maxW;
  9156. }
  9157. if (pos.h < this.minH) {
  9158. pos.h = this.minH;
  9159. }
  9160. if (pos.h > this.maxH) {
  9161. pos.h = this.maxH;
  9162. }
  9163. if (pos.h < 1) {
  9164. pos.h = 1;
  9165. }
  9166. if (pos.w < 1) {
  9167. pos.w = 1;
  9168. }
  9169. this.lastW = x;
  9170. this.lastH = y;
  9171. if (this.innerW !== pos.w || this.innerH !== pos.h) {
  9172. this.$emit("resize", this.i, pos.h, pos.w, newSize.height, newSize.width);
  9173. }
  9174. if (event.type === "resizeend" && (this.previousW !== this.innerW || this.previousH !== this.innerH)) {
  9175. this.$emit("resized", this.i, pos.h, pos.w, newSize.height, newSize.width);
  9176. }
  9177. this.eventBus.emit("resizeEvent", {
  9178. eventType: event.type,
  9179. i: this.i,
  9180. x: this.innerX,
  9181. y: this.innerY,
  9182. h: pos.h,
  9183. w: pos.w
  9184. });
  9185. },
  9186. handleDrag: function handleDrag(event) {
  9187. if (this.static)
  9188. return;
  9189. if (this.isResizing)
  9190. return;
  9191. var position = getControlPosition(event);
  9192. if (position === null)
  9193. return;
  9194. var x = position.x, y = position.y;
  9195. var newPosition = {
  9196. top: 0,
  9197. left: 0
  9198. };
  9199. switch (event.type) {
  9200. case "dragstart": {
  9201. this.previousX = this.innerX;
  9202. this.previousY = this.innerY;
  9203. var parentRect = event.target.offsetParent.getBoundingClientRect();
  9204. var clientRect = event.target.getBoundingClientRect();
  9205. if (this.renderRtl) {
  9206. newPosition.left = (clientRect.right - parentRect.right) * -1;
  9207. } else {
  9208. newPosition.left = clientRect.left - parentRect.left;
  9209. }
  9210. newPosition.top = clientRect.top - parentRect.top;
  9211. this.dragging = newPosition;
  9212. this.isDragging = true;
  9213. break;
  9214. }
  9215. case "dragend": {
  9216. if (!this.isDragging)
  9217. return;
  9218. var _parentRect = event.target.offsetParent.getBoundingClientRect();
  9219. var _clientRect = event.target.getBoundingClientRect();
  9220. if (this.renderRtl) {
  9221. newPosition.left = (_clientRect.right - _parentRect.right) * -1;
  9222. } else {
  9223. newPosition.left = _clientRect.left - _parentRect.left;
  9224. }
  9225. newPosition.top = _clientRect.top - _parentRect.top;
  9226. this.dragging = null;
  9227. this.isDragging = false;
  9228. break;
  9229. }
  9230. case "dragmove": {
  9231. var coreEvent = createCoreData(this.lastX, this.lastY, x, y);
  9232. if (this.renderRtl) {
  9233. newPosition.left = this.dragging.left - coreEvent.deltaX;
  9234. } else {
  9235. newPosition.left = this.dragging.left + coreEvent.deltaX;
  9236. }
  9237. newPosition.top = this.dragging.top + coreEvent.deltaY;
  9238. this.dragging = newPosition;
  9239. break;
  9240. }
  9241. }
  9242. var pos;
  9243. if (this.renderRtl) {
  9244. pos = this.calcXY(newPosition.top, newPosition.left);
  9245. } else {
  9246. pos = this.calcXY(newPosition.top, newPosition.left);
  9247. }
  9248. this.lastX = x;
  9249. this.lastY = y;
  9250. if (this.innerX !== pos.x || this.innerY !== pos.y) {
  9251. this.$emit("move", this.i, pos.x, pos.y);
  9252. }
  9253. if (event.type === "dragend" && (this.previousX !== this.innerX || this.previousY !== this.innerY)) {
  9254. this.$emit("moved", this.i, pos.x, pos.y);
  9255. }
  9256. this.eventBus.emit("dragEvent", {
  9257. eventType: event.type,
  9258. i: this.i,
  9259. x: pos.x,
  9260. y: pos.y,
  9261. h: this.innerH,
  9262. w: this.innerW
  9263. });
  9264. },
  9265. calcPosition: function calcPosition(x, y, w, h) {
  9266. var colWidth = this.calcColWidth();
  9267. var out;
  9268. if (this.renderRtl) {
  9269. out = {
  9270. right: Math.round(colWidth * x + (x + 1) * this.margin[0]),
  9271. top: Math.round(this.rowHeight * y + (y + 1) * this.margin[1]),
  9272. // 0 * Infinity === NaN, which causes problems with resize constriants;
  9273. // Fix this if it occurs.
  9274. // Note we do it here rather than later because Math.round(Infinity) causes deopt
  9275. width: w === Infinity ? w : Math.round(colWidth * w + Math.max(0, w - 1) * this.margin[0]),
  9276. height: h === Infinity ? h : Math.round(this.rowHeight * h + Math.max(0, h - 1) * this.margin[1])
  9277. };
  9278. } else {
  9279. out = {
  9280. left: Math.round(colWidth * x + (x + 1) * this.margin[0]),
  9281. top: Math.round(this.rowHeight * y + (y + 1) * this.margin[1]),
  9282. // 0 * Infinity === NaN, which causes problems with resize constriants;
  9283. // Fix this if it occurs.
  9284. // Note we do it here rather than later because Math.round(Infinity) causes deopt
  9285. width: w === Infinity ? w : Math.round(colWidth * w + Math.max(0, w - 1) * this.margin[0]),
  9286. height: h === Infinity ? h : Math.round(this.rowHeight * h + Math.max(0, h - 1) * this.margin[1])
  9287. };
  9288. }
  9289. return out;
  9290. },
  9291. /**
  9292. * Translate x and y coordinates from pixels to grid units.
  9293. * @param {Number} top Top position (relative to parent) in pixels.
  9294. * @param {Number} left Left position (relative to parent) in pixels.
  9295. * @return {Object} x and y in grid units.
  9296. */
  9297. // TODO check if this function needs change in order to support rtl.
  9298. calcXY: function calcXY(top, left) {
  9299. var colWidth = this.calcColWidth();
  9300. var x = Math.round((left - this.margin[0]) / (colWidth + this.margin[0]));
  9301. var y = Math.round((top - this.margin[1]) / (this.rowHeight + this.margin[1]));
  9302. x = Math.max(Math.min(x, this.cols - this.innerW), 0);
  9303. y = Math.max(Math.min(y, this.maxRows - this.innerH), 0);
  9304. return {
  9305. x,
  9306. y
  9307. };
  9308. },
  9309. // Helper for generating column width
  9310. calcColWidth: function calcColWidth() {
  9311. var colWidth = (this.containerWidth - this.margin[0] * (this.cols + 1)) / this.cols;
  9312. return colWidth;
  9313. },
  9314. /**
  9315. * Given a height and width in pixel values, calculate grid units.
  9316. * @param {Number} height Height in pixels.
  9317. * @param {Number} width Width in pixels.
  9318. * @param {Boolean} autoSizeFlag function autoSize identifier.
  9319. * @return {Object} w, h as grid units.
  9320. */
  9321. calcWH: function calcWH(height, width) {
  9322. var autoSizeFlag = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
  9323. var colWidth = this.calcColWidth();
  9324. var w = Math.round((width + this.margin[0]) / (colWidth + this.margin[0]));
  9325. var h = 0;
  9326. if (!autoSizeFlag) {
  9327. h = Math.round((height + this.margin[1]) / (this.rowHeight + this.margin[1]));
  9328. } else {
  9329. h = Math.ceil((height + this.margin[1]) / (this.rowHeight + this.margin[1]));
  9330. }
  9331. w = Math.max(Math.min(w, this.cols - this.innerX), 0);
  9332. h = Math.max(Math.min(h, this.maxRows - this.innerY), 0);
  9333. return {
  9334. w,
  9335. h
  9336. };
  9337. },
  9338. updateWidth: function updateWidth(width, colNum) {
  9339. this.containerWidth = width;
  9340. if (colNum !== void 0 && colNum !== null) {
  9341. this.cols = colNum;
  9342. }
  9343. },
  9344. compact: function compact2() {
  9345. this.createStyle();
  9346. },
  9347. tryMakeDraggable: function tryMakeDraggable() {
  9348. var self2 = this;
  9349. if (this.interactObj === null || this.interactObj === void 0) {
  9350. this.interactObj = _interactjs_interact(this.$refs.item);
  9351. if (!this.useStyleCursor) {
  9352. this.interactObj.styleCursor(false);
  9353. }
  9354. }
  9355. if (this.draggable && !this.static) {
  9356. var opts = {
  9357. ignoreFrom: this.dragIgnoreFrom,
  9358. allowFrom: this.dragAllowFrom
  9359. };
  9360. this.interactObj.draggable(opts);
  9361. if (!this.dragEventSet) {
  9362. this.dragEventSet = true;
  9363. this.interactObj.on("dragstart dragmove dragend", function(event) {
  9364. self2.handleDrag(event);
  9365. });
  9366. }
  9367. } else {
  9368. this.interactObj.draggable({
  9369. enabled: false
  9370. });
  9371. }
  9372. },
  9373. tryMakeResizable: function tryMakeResizable() {
  9374. var self2 = this;
  9375. if (this.interactObj === null || this.interactObj === void 0) {
  9376. this.interactObj = _interactjs_interact(this.$refs.item);
  9377. if (!this.useStyleCursor) {
  9378. this.interactObj.styleCursor(false);
  9379. }
  9380. }
  9381. if (this.resizable && !this.static) {
  9382. var maximum = this.calcPosition(0, 0, this.maxW, this.maxH);
  9383. var minimum = this.calcPosition(0, 0, this.minW, this.minH);
  9384. var opts = {
  9385. // allowFrom: "." + this.resizableHandleClass.trim().replace(" ", "."),
  9386. edges: {
  9387. left: false,
  9388. right: "." + this.resizableHandleClass.trim().replace(" ", "."),
  9389. bottom: "." + this.resizableHandleClass.trim().replace(" ", "."),
  9390. top: false
  9391. },
  9392. ignoreFrom: this.resizeIgnoreFrom,
  9393. restrictSize: {
  9394. min: {
  9395. height: minimum.height,
  9396. width: minimum.width
  9397. },
  9398. max: {
  9399. height: maximum.height,
  9400. width: maximum.width
  9401. }
  9402. }
  9403. };
  9404. if (this.preserveAspectRatio) {
  9405. opts.modifiers = [_interactjs_interact.modifiers.aspectRatio({
  9406. ratio: "preserve"
  9407. })];
  9408. }
  9409. this.interactObj.resizable(opts);
  9410. if (!this.resizeEventSet) {
  9411. this.resizeEventSet = true;
  9412. this.interactObj.on("resizestart resizemove resizeend", function(event) {
  9413. self2.handleResize(event);
  9414. });
  9415. }
  9416. } else {
  9417. this.interactObj.resizable({
  9418. enabled: false
  9419. });
  9420. }
  9421. },
  9422. autoSize: function autoSize() {
  9423. this.previousW = this.innerW;
  9424. this.previousH = this.innerH;
  9425. var newSize = this.$slots().default[0].elm.getBoundingClientRect();
  9426. var pos = this.calcWH(newSize.height, newSize.width, true);
  9427. if (pos.w < this.minW) {
  9428. pos.w = this.minW;
  9429. }
  9430. if (pos.w > this.maxW) {
  9431. pos.w = this.maxW;
  9432. }
  9433. if (pos.h < this.minH) {
  9434. pos.h = this.minH;
  9435. }
  9436. if (pos.h > this.maxH) {
  9437. pos.h = this.maxH;
  9438. }
  9439. if (pos.h < 1) {
  9440. pos.h = 1;
  9441. }
  9442. if (pos.w < 1) {
  9443. pos.w = 1;
  9444. }
  9445. if (this.innerW !== pos.w || this.innerH !== pos.h) {
  9446. this.$emit("resize", this.i, pos.h, pos.w, newSize.height, newSize.width);
  9447. }
  9448. if (this.previousW !== pos.w || this.previousH !== pos.h) {
  9449. this.$emit("resized", this.i, pos.h, pos.w, newSize.height, newSize.width);
  9450. this.eventBus.emit("resizeEvent", {
  9451. eventType: "resizeend",
  9452. i: this.i,
  9453. x: this.innerX,
  9454. y: this.innerY,
  9455. h: pos.h,
  9456. w: pos.w
  9457. });
  9458. }
  9459. }
  9460. }
  9461. };
  9462. var GridItemvue_type_style_index_0_id_46ff2fc8_lang_css = __webpack_require__("083e");
  9463. GridItemvue_type_script_lang_js.render = render;
  9464. var GridItem = GridItemvue_type_script_lang_js;
  9465. function GridLayoutvue_type_template_id_fc5948f6_render(_ctx, _cache, $props, $setup, $data, $options) {
  9466. var _component_grid_item = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("grid-item");
  9467. return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])("div", {
  9468. ref: "item",
  9469. class: "vue-grid-layout",
  9470. style: _ctx.mergedStyle
  9471. }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderSlot"])(_ctx.$slots, "default"), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_grid_item, {
  9472. class: "vue-grid-placeholder",
  9473. x: _ctx.placeholder.x,
  9474. y: _ctx.placeholder.y,
  9475. w: _ctx.placeholder.w,
  9476. h: _ctx.placeholder.h,
  9477. i: _ctx.placeholder.i
  9478. }, null, 8, ["x", "y", "w", "h", "i"]), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.isDragging]])], 4);
  9479. }
  9480. var es7_object_get_own_property_descriptors = __webpack_require__("8e6e");
  9481. var es6_object_assign = __webpack_require__("f751");
  9482. var es6_number_is_finite = __webpack_require__("fca0");
  9483. function _defineProperty(obj, key, value) {
  9484. if (key in obj) {
  9485. Object.defineProperty(obj, key, {
  9486. value,
  9487. enumerable: true,
  9488. configurable: true,
  9489. writable: true
  9490. });
  9491. } else {
  9492. obj[key] = value;
  9493. }
  9494. return obj;
  9495. }
  9496. var mitt_es = function(n) {
  9497. return { all: n = n || /* @__PURE__ */ new Map(), on: function(t, e) {
  9498. var i = n.get(t);
  9499. i && i.push(e) || n.set(t, [e]);
  9500. }, off: function(t, e) {
  9501. var i = n.get(t);
  9502. i && i.splice(i.indexOf(e) >>> 0, 1);
  9503. }, emit: function(t, e) {
  9504. (n.get(t) || []).slice().map(function(n2) {
  9505. n2(e);
  9506. }), (n.get("*") || []).slice().map(function(n2) {
  9507. n2(t, e);
  9508. });
  9509. } };
  9510. };
  9511. function ownKeys(object2, enumerableOnly) {
  9512. var keys = Object.keys(object2);
  9513. if (Object.getOwnPropertySymbols) {
  9514. var symbols = Object.getOwnPropertySymbols(object2);
  9515. if (enumerableOnly)
  9516. symbols = symbols.filter(function(sym) {
  9517. return Object.getOwnPropertyDescriptor(object2, sym).enumerable;
  9518. });
  9519. keys.push.apply(keys, symbols);
  9520. }
  9521. return keys;
  9522. }
  9523. function _objectSpread(target) {
  9524. for (var i = 1; i < arguments.length; i++) {
  9525. var source = arguments[i] != null ? arguments[i] : {};
  9526. if (i % 2) {
  9527. ownKeys(Object(source), true).forEach(function(key) {
  9528. _defineProperty(target, key, source[key]);
  9529. });
  9530. } else if (Object.getOwnPropertyDescriptors) {
  9531. Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
  9532. } else {
  9533. ownKeys(Object(source)).forEach(function(key) {
  9534. Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
  9535. });
  9536. }
  9537. }
  9538. return target;
  9539. }
  9540. var elementResizeDetectorMaker = __webpack_require__("eec4");
  9541. var GridLayoutvue_type_script_lang_js = {
  9542. name: "GridLayout",
  9543. provide: function provide() {
  9544. return {
  9545. eventBus: this.eventBus,
  9546. layout: this
  9547. };
  9548. },
  9549. components: {
  9550. GridItem
  9551. },
  9552. props: {
  9553. // If true, the container height swells and contracts to fit contents
  9554. autoSize: {
  9555. type: Boolean,
  9556. default: true
  9557. },
  9558. colNum: {
  9559. type: Number,
  9560. default: 12
  9561. },
  9562. rowHeight: {
  9563. type: Number,
  9564. default: 150
  9565. },
  9566. maxRows: {
  9567. type: Number,
  9568. default: Infinity
  9569. },
  9570. margin: {
  9571. type: Array,
  9572. default: function _default() {
  9573. return [10, 10];
  9574. }
  9575. },
  9576. isDraggable: {
  9577. type: Boolean,
  9578. default: true
  9579. },
  9580. isResizable: {
  9581. type: Boolean,
  9582. default: true
  9583. },
  9584. isMirrored: {
  9585. type: Boolean,
  9586. default: false
  9587. },
  9588. useCssTransforms: {
  9589. type: Boolean,
  9590. default: true
  9591. },
  9592. verticalCompact: {
  9593. type: Boolean,
  9594. default: true
  9595. },
  9596. layout: {
  9597. type: Array,
  9598. required: true
  9599. },
  9600. responsive: {
  9601. type: Boolean,
  9602. default: false
  9603. },
  9604. responsiveLayouts: {
  9605. type: Object,
  9606. default: function _default() {
  9607. return {};
  9608. }
  9609. },
  9610. breakpoints: {
  9611. type: Object,
  9612. default: function _default() {
  9613. return {
  9614. lg: 1200,
  9615. md: 996,
  9616. sm: 768,
  9617. xs: 480,
  9618. xxs: 0
  9619. };
  9620. }
  9621. },
  9622. cols: {
  9623. type: Object,
  9624. default: function _default() {
  9625. return {
  9626. lg: 12,
  9627. md: 10,
  9628. sm: 6,
  9629. xs: 4,
  9630. xxs: 2
  9631. };
  9632. }
  9633. },
  9634. preventCollision: {
  9635. type: Boolean,
  9636. default: false
  9637. },
  9638. useStyleCursor: {
  9639. type: Boolean,
  9640. default: true
  9641. }
  9642. },
  9643. data: function data() {
  9644. return {
  9645. eventBus: mitt_es(),
  9646. width: null,
  9647. mergedStyle: {},
  9648. lastLayoutLength: 0,
  9649. isDragging: false,
  9650. placeholder: {
  9651. x: 0,
  9652. y: 0,
  9653. w: 0,
  9654. h: 0,
  9655. i: -1
  9656. },
  9657. layouts: {},
  9658. // array to store all layouts from different breakpoints
  9659. lastBreakpoint: null,
  9660. // store last active breakpoint
  9661. originalLayout: null
  9662. // store original Layout
  9663. // layout: JSON.parse(JSON.stringify(this.value)),
  9664. };
  9665. },
  9666. created: function created() {
  9667. var self2 = this;
  9668. self2.resizeEventHandler = function(_ref) {
  9669. var eventType = _ref.eventType, i = _ref.i, x = _ref.x, y = _ref.y, h = _ref.h, w = _ref.w;
  9670. self2.resizeEvent(eventType, i, x, y, h, w);
  9671. };
  9672. self2.dragEventHandler = function(_ref2) {
  9673. var eventType = _ref2.eventType, i = _ref2.i, x = _ref2.x, y = _ref2.y, h = _ref2.h, w = _ref2.w;
  9674. self2.dragEvent(eventType, i, x, y, h, w);
  9675. };
  9676. self2.eventBus.on("resizeEvent", self2.resizeEventHandler);
  9677. self2.eventBus.on("dragEvent", self2.dragEventHandler);
  9678. self2.$emit("layout-created", self2.layout);
  9679. },
  9680. beforeUnmount: function beforeUnmount() {
  9681. this.eventBus.off("resizeEvent", this.resizeEventHandler);
  9682. this.eventBus.off("dragEvent", this.dragEventHandler);
  9683. removeWindowEventListener("resize", this.onWindowResize);
  9684. if (this.erd) {
  9685. this.erd.uninstall(this.$refs.item);
  9686. }
  9687. },
  9688. beforeMount: function beforeMount() {
  9689. this.$emit("layout-before-mount", this.layout);
  9690. },
  9691. mounted: function mounted() {
  9692. this.$emit("layout-mounted", this.layout);
  9693. this.$nextTick(function() {
  9694. validateLayout(this.layout);
  9695. this.originalLayout = this.layout;
  9696. var self2 = this;
  9697. this.$nextTick(function() {
  9698. self2.onWindowResize();
  9699. self2.initResponsiveFeatures();
  9700. addWindowEventListener("resize", self2.onWindowResize);
  9701. compact(self2.layout, self2.verticalCompact);
  9702. self2.$emit("layout-updated", self2.layout);
  9703. self2.updateHeight();
  9704. self2.$nextTick(function() {
  9705. this.erd = elementResizeDetectorMaker({
  9706. strategy: "scroll",
  9707. //<- For ultra performance.
  9708. // See https://github.com/wnr/element-resize-detector/issues/110 about callOnAdd.
  9709. callOnAdd: false
  9710. });
  9711. this.erd.listenTo(self2.$refs.item, function() {
  9712. self2.onWindowResize();
  9713. });
  9714. });
  9715. });
  9716. });
  9717. },
  9718. watch: {
  9719. width: function width(newval, oldval) {
  9720. var self2 = this;
  9721. this.$nextTick(function() {
  9722. var _this = this;
  9723. this.eventBus.emit("updateWidth", this.width);
  9724. if (oldval === null) {
  9725. this.$nextTick(function() {
  9726. _this.$emit("layout-ready", self2.layout);
  9727. });
  9728. }
  9729. this.updateHeight();
  9730. });
  9731. },
  9732. layout: function layout() {
  9733. this.layoutUpdate();
  9734. },
  9735. colNum: function colNum(val) {
  9736. this.eventBus.emit("setColNum", val);
  9737. },
  9738. rowHeight: function rowHeight() {
  9739. this.eventBus.emit("setRowHeight", this.rowHeight);
  9740. },
  9741. isDraggable: function isDraggable() {
  9742. this.eventBus.emit("setDraggable", this.isDraggable);
  9743. },
  9744. isResizable: function isResizable() {
  9745. this.eventBus.emit("setResizable", this.isResizable);
  9746. },
  9747. responsive: function responsive() {
  9748. if (!this.responsive) {
  9749. this.$emit("update:layout", this.originalLayout);
  9750. this.eventBus.emit("setColNum", this.colNum);
  9751. }
  9752. this.onWindowResize();
  9753. },
  9754. maxRows: function maxRows() {
  9755. this.eventBus.emit("setMaxRows", this.maxRows);
  9756. },
  9757. margin: function margin() {
  9758. this.updateHeight();
  9759. }
  9760. },
  9761. methods: {
  9762. layoutUpdate: function layoutUpdate() {
  9763. if (this.layout !== void 0 && this.originalLayout !== null) {
  9764. if (this.layout.length !== this.originalLayout.length) {
  9765. var diff = this.findDifference(this.layout, this.originalLayout);
  9766. if (diff.length > 0) {
  9767. if (this.layout.length > this.originalLayout.length) {
  9768. this.originalLayout = this.originalLayout.concat(diff);
  9769. } else {
  9770. this.originalLayout = this.originalLayout.filter(function(obj) {
  9771. return !diff.some(function(obj2) {
  9772. return obj.i === obj2.i;
  9773. });
  9774. });
  9775. }
  9776. }
  9777. this.lastLayoutLength = this.layout.length;
  9778. this.initResponsiveFeatures();
  9779. }
  9780. compact(this.layout, this.verticalCompact);
  9781. this.eventBus.emit("updateWidth", this.width);
  9782. this.updateHeight();
  9783. this.$emit("layout-updated", this.layout);
  9784. }
  9785. },
  9786. updateHeight: function updateHeight() {
  9787. this.mergedStyle = {
  9788. height: this.containerHeight()
  9789. };
  9790. },
  9791. onWindowResize: function onWindowResize() {
  9792. if (this.$refs !== null && this.$refs.item !== null && this.$refs.item !== void 0) {
  9793. this.width = this.$refs.item.offsetWidth;
  9794. }
  9795. this.eventBus.emit("resizeEvent", {});
  9796. },
  9797. containerHeight: function containerHeight() {
  9798. if (!this.autoSize)
  9799. return;
  9800. var containerHeight2 = bottom(this.layout) * (this.rowHeight + this.margin[1]) + this.margin[1] + "px";
  9801. return containerHeight2;
  9802. },
  9803. dragEvent: function dragEvent(eventName, id, x, y, h, w) {
  9804. var l = getLayoutItem(this.layout, id);
  9805. if (l === void 0 || l === null) {
  9806. l = {
  9807. x: 0,
  9808. y: 0
  9809. };
  9810. }
  9811. if (eventName === "dragmove" || eventName === "dragstart") {
  9812. this.placeholder.i = id;
  9813. this.placeholder.x = l.x;
  9814. this.placeholder.y = l.y;
  9815. this.placeholder.w = w;
  9816. this.placeholder.h = h;
  9817. this.$nextTick(function() {
  9818. this.isDragging = true;
  9819. });
  9820. this.eventBus.emit("updateWidth", this.width);
  9821. } else {
  9822. this.$nextTick(function() {
  9823. this.isDragging = false;
  9824. });
  9825. }
  9826. this.$emit("update:layout", moveElement(this.layout, l, x, y, true, this.preventCollision));
  9827. compact(this.layout, this.verticalCompact);
  9828. this.eventBus.emit("compact");
  9829. this.updateHeight();
  9830. if (eventName === "dragend")
  9831. this.$emit("layout-updated", this.layout);
  9832. },
  9833. resizeEvent: function resizeEvent(eventName, id, x, y, h, w) {
  9834. var l = getLayoutItem(this.layout, id);
  9835. if (l === void 0 || l === null) {
  9836. l = {
  9837. h: 0,
  9838. w: 0
  9839. };
  9840. }
  9841. var hasCollisions;
  9842. if (this.preventCollision) {
  9843. var collisions = getAllCollisions(this.layout, _objectSpread(_objectSpread({}, l), {}, {
  9844. w,
  9845. h
  9846. })).filter(function(layoutItem) {
  9847. return layoutItem.i !== l.i;
  9848. });
  9849. hasCollisions = collisions.length > 0;
  9850. if (hasCollisions) {
  9851. var leastX = Infinity, leastY = Infinity;
  9852. collisions.forEach(function(layoutItem) {
  9853. if (layoutItem.x > l.x)
  9854. leastX = Math.min(leastX, layoutItem.x);
  9855. if (layoutItem.y > l.y)
  9856. leastY = Math.min(leastY, layoutItem.y);
  9857. });
  9858. if (Number.isFinite(leastX))
  9859. l.w = leastX - l.x;
  9860. if (Number.isFinite(leastY))
  9861. l.h = leastY - l.y;
  9862. }
  9863. }
  9864. if (!hasCollisions) {
  9865. l.w = w;
  9866. l.h = h;
  9867. }
  9868. if (eventName === "resizestart" || eventName === "resizemove") {
  9869. this.placeholder.i = id;
  9870. this.placeholder.x = x;
  9871. this.placeholder.y = y;
  9872. this.placeholder.w = l.w;
  9873. this.placeholder.h = l.h;
  9874. this.$nextTick(function() {
  9875. this.isDragging = true;
  9876. });
  9877. this.eventBus.emit("updateWidth", this.width);
  9878. } else {
  9879. this.$nextTick(function() {
  9880. this.isDragging = false;
  9881. });
  9882. }
  9883. if (this.responsive)
  9884. this.responsiveGridLayout();
  9885. compact(this.layout, this.verticalCompact);
  9886. this.eventBus.emit("compact");
  9887. this.updateHeight();
  9888. if (eventName === "resizeend")
  9889. this.$emit("layout-updated", this.layout);
  9890. },
  9891. // finds or generates new layouts for set breakpoints
  9892. responsiveGridLayout: function responsiveGridLayout() {
  9893. var newBreakpoint = getBreakpointFromWidth(this.breakpoints, this.width);
  9894. var newCols = getColsFromBreakpoint(newBreakpoint, this.cols);
  9895. if (this.lastBreakpoint != null && !this.layouts[this.lastBreakpoint])
  9896. this.layouts[this.lastBreakpoint] = cloneLayout(this.layout);
  9897. var layout = findOrGenerateResponsiveLayout(this.originalLayout, this.layouts, this.breakpoints, newBreakpoint, this.lastBreakpoint, newCols, this.verticalCompact);
  9898. this.layouts[newBreakpoint] = layout;
  9899. if (this.lastBreakpoint !== newBreakpoint) {
  9900. this.$emit("breakpoint-changed", newBreakpoint, layout);
  9901. }
  9902. this.$emit("update:layout", layout);
  9903. this.lastBreakpoint = newBreakpoint;
  9904. this.eventBus.emit("setColNum", getColsFromBreakpoint(newBreakpoint, this.cols));
  9905. },
  9906. // clear all responsive layouts
  9907. initResponsiveFeatures: function initResponsiveFeatures() {
  9908. this.layouts = Object.assign({}, this.responsiveLayouts);
  9909. },
  9910. // find difference in layouts
  9911. findDifference: function findDifference(layout, originalLayout) {
  9912. var uniqueResultOne = layout.filter(function(obj) {
  9913. return !originalLayout.some(function(obj2) {
  9914. return obj.i === obj2.i;
  9915. });
  9916. });
  9917. var uniqueResultTwo = originalLayout.filter(function(obj) {
  9918. return !layout.some(function(obj2) {
  9919. return obj.i === obj2.i;
  9920. });
  9921. });
  9922. return uniqueResultOne.concat(uniqueResultTwo);
  9923. }
  9924. }
  9925. };
  9926. var GridLayoutvue_type_style_index_0_id_fc5948f6_lang_css = __webpack_require__("6521");
  9927. GridLayoutvue_type_script_lang_js.render = GridLayoutvue_type_template_id_fc5948f6_render;
  9928. var GridLayout = GridLayoutvue_type_script_lang_js;
  9929. var components_install = function install(app) {
  9930. app.component("grid-layout", GridLayout);
  9931. app.component("grid-item", GridItem);
  9932. };
  9933. var components = components_install;
  9934. var entry_lib = __webpack_exports__["default"] = components;
  9935. }
  9936. ),
  9937. /***/
  9938. "fca0": (
  9939. /***/
  9940. function(module2, exports2, __webpack_require__) {
  9941. var $export = __webpack_require__("5ca1");
  9942. var _isFinite = __webpack_require__("7726").isFinite;
  9943. $export($export.S, "Number", {
  9944. isFinite: function isFinite(it) {
  9945. return typeof it == "number" && _isFinite(it);
  9946. }
  9947. });
  9948. }
  9949. ),
  9950. /***/
  9951. "fdef": (
  9952. /***/
  9953. function(module2, exports2) {
  9954. module2.exports = " \n\v\f\r   ᠎              \u2028\u2029\uFEFF";
  9955. }
  9956. )
  9957. /******/
  9958. })["default"];
  9959. }
  9960. });
  9961. export default require_vue_grid_layout_common();
  9962. /*! Bundled license information:
  9963. vue-grid-layout/dist/vue-grid-layout.common.js:
  9964. (*! vue-grid-layout - 3.0.0-beta1 | (c) 2015, 2021 Gustavo Santos (JBay Solutions) <gustavo.santos@jbaysolutions.com> (http://www.jbaysolutions.com) | https://github.com/jbaysolutions/vue-grid-layout *)
  9965. */
  9966. //# sourceMappingURL=vue-grid-layout.js.map