12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633 |
- (function webpackUniversalModuleDefinition(root, factory) {
- if(typeof exports === 'object' && typeof module === 'object')
- module.exports = factory();
- else if(typeof define === 'function' && define.amd)
- define([], factory);
- else {
- var a = factory();
- for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
- }
- })(window, function() {
- return /******/ (function(modules) { // webpackBootstrap
- /******/ // The module cache
- /******/ var installedModules = {};
- /******/
- /******/ // The require function
- /******/ function __webpack_require__(moduleId) {
- /******/
- /******/ // Check if module is in cache
- /******/ if(installedModules[moduleId]) {
- /******/ return installedModules[moduleId].exports;
- /******/ }
- /******/ // Create a new module (and put it into the cache)
- /******/ var module = installedModules[moduleId] = {
- /******/ i: moduleId,
- /******/ l: false,
- /******/ exports: {}
- /******/ };
- /******/
- /******/ // Execute the module function
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
- /******/
- /******/ // Flag the module as loaded
- /******/ module.l = true;
- /******/
- /******/ // Return the exports of the module
- /******/ return module.exports;
- /******/ }
- /******/
- /******/
- /******/ // expose the modules object (__webpack_modules__)
- /******/ __webpack_require__.m = modules;
- /******/
- /******/ // expose the module cache
- /******/ __webpack_require__.c = installedModules;
- /******/
- /******/ // define getter function for harmony exports
- /******/ __webpack_require__.d = function(exports, name, getter) {
- /******/ if(!__webpack_require__.o(exports, name)) {
- /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
- /******/ }
- /******/ };
- /******/
- /******/ // define __esModule on exports
- /******/ __webpack_require__.r = function(exports) {
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
- /******/ }
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
- /******/ };
- /******/
- /******/ // create a fake namespace object
- /******/ // mode & 1: value is a module id, require it
- /******/ // mode & 2: merge all properties of value into the ns
- /******/ // mode & 4: return value when already ns object
- /******/ // mode & 8|1: behave like require
- /******/ __webpack_require__.t = function(value, mode) {
- /******/ if(mode & 1) value = __webpack_require__(value);
- /******/ if(mode & 8) return value;
- /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
- /******/ var ns = Object.create(null);
- /******/ __webpack_require__.r(ns);
- /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
- /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
- /******/ return ns;
- /******/ };
- /******/
- /******/ // getDefaultExport function for compatibility with non-harmony modules
- /******/ __webpack_require__.n = function(module) {
- /******/ var getter = module && module.__esModule ?
- /******/ function getDefault() { return module['default']; } :
- /******/ function getModuleExports() { return module; };
- /******/ __webpack_require__.d(getter, 'a', getter);
- /******/ return getter;
- /******/ };
- /******/
- /******/ // Object.prototype.hasOwnProperty.call
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
- /******/
- /******/ // __webpack_public_path__
- /******/ __webpack_require__.p = "";
- /******/
- /******/
- /******/ // Load entry module and return exports
- /******/ return __webpack_require__(__webpack_require__.s = "./src/index.ts");
- /******/ })
- /************************************************************************/
- /******/ ({
-
- /***/ "./node_modules/css-loader/dist/cjs.js?!./node_modules/postcss-loader/src/index.js!./node_modules/less-loader/dist/cjs.js?!./src/drawboard/Drawboard/index.less":
- /*!*********************************************************************************************************************************************************************************!*\
- !*** ./node_modules/css-loader/dist/cjs.js??ref--11-1!./node_modules/postcss-loader/src!./node_modules/less-loader/dist/cjs.js??ref--11-3!./src/drawboard/Drawboard/index.less ***!
- \*********************************************************************************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- exports = module.exports = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js")(false);
- // Module
- exports.push([module.i, ".fc-whiteboard-logo {\n display: inline-block;\n margin: 0px;\n padding: 0px;\n fill: #333333;\n}\n.fc-whiteboard-logo a {\n display: grid;\n -ms-flex-align: center;\n align-items: center;\n justify-items: center;\n padding: 3px;\n width: 20px;\n height: 20px;\n}\n.fc-whiteboard-logo a:hover {\n fill: #ff8080;\n}\n.fc-whiteboard-text-editor {\n position: fixed;\n z-index: 20000;\n left: 0px;\n top: 0px;\n width: 100vw;\n height: 100vh;\n background-color: rgba(0, 0, 0, 0.9);\n display: -ms-flexbox;\n display: flex;\n -ms-flex-direction: column;\n flex-direction: column;\n -ms-flex-align: center;\n align-items: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n.fc-whiteboard-text-editor textarea {\n width: 50%;\n min-width: 50px;\n max-width: 500px;\n height: 50%;\n min-height: 50px;\n max-height: 500px;\n}\n.fc-whiteboard-text-editor .fc-whiteboard-text-editor-button-bar {\n display: -ms-flexbox;\n display: flex;\n -ms-flex-direction: row;\n flex-direction: row;\n -ms-flex-pack: end;\n justify-content: flex-end;\n width: 50%;\n min-width: 50px;\n max-width: 500px;\n padding-top: 10px;\n}\n.fc-whiteboard-text-editor .fc-whiteboard-text-editor-button {\n display: grid;\n -ms-flex-align: center;\n align-items: center;\n padding: 0px;\n margin-left: 15px;\n width: 20px;\n height: 20px;\n cursor: pointer;\n fill: #888888;\n}\n.fc-whiteboard-text-editor .fc-whiteboard-text-editor-button:hover {\n fill: #ff8080;\n}\n", ""]);
-
-
-
- /***/ }),
-
- /***/ "./node_modules/css-loader/dist/cjs.js?!./node_modules/postcss-loader/src/index.js!./node_modules/less-loader/dist/cjs.js?!./src/toolbar/index.less":
- /*!*********************************************************************************************************************************************************************!*\
- !*** ./node_modules/css-loader/dist/cjs.js??ref--11-1!./node_modules/postcss-loader/src!./node_modules/less-loader/dist/cjs.js??ref--11-3!./src/toolbar/index.less ***!
- \*********************************************************************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- exports = module.exports = __webpack_require__(/*! ../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js")(false);
- // Module
- exports.push([module.i, ".fc-whiteboard-toolbar {\n height: 36px;\n background: #ffffff;\n -webkit-box-shadow: 0px 2px 9px 0px rgba(194, 185, 187, 0.29);\n box-shadow: 0px 2px 9px 0px rgba(194, 185, 187, 0.29);\n border-radius: 13px;\n opacity: 0.9;\n border: 1px solid #e6ecf7;\n padding: 0 8px;\n display: -ms-flexbox;\n display: flex;\n -ms-flex-align: center;\n align-items: center;\n}\n.fc-whiteboard-toolbar-button,\n.fc-whiteboard-toolbar-logo a {\n display: inline-block;\n margin: 2px;\n padding: 3px;\n cursor: pointer;\n width: 20px;\n height: 20px;\n border-radius: 2px;\n border-bottom: transparent solid 1px;\n border-right: transparent solid 1px;\n fill: #333333;\n display: grid;\n -ms-flex-align: center;\n align-items: center;\n justify-items: center;\n}\n.fc-whiteboard-toolbar-separator {\n width: 0px;\n height: 20px;\n margin: 5px 5px;\n border: 1px solid #cad3df;\n}\n.fc-whiteboard-toolbar-button:hover,\n.fc-whiteboard-toolbar-logo a:hover {\n background-color: #eeeeee;\n background: -webkit-radial-gradient(#eeeeee, #cccccc);\n background: -o-radial-gradient(#eeeeee, #cccccc);\n background: radial-gradient(#eeeeee, #cccccc);\n fill: #ff8080;\n}\n.fc-whiteboard-toolbar-button svg {\n height: 16px;\n}\n.fc-whiteboard-indicator-container {\n font-size: 13px;\n line-height: 27px;\n height: 27px;\n width: 40px;\n display: -ms-flexbox;\n display: flex;\n -ms-flex-pack: center;\n justify-content: center;\n letter-spacing: 2;\n}\n", ""]);
-
-
-
- /***/ }),
-
- /***/ "./node_modules/css-loader/dist/cjs.js?!./node_modules/postcss-loader/src/index.js!./node_modules/less-loader/dist/cjs.js?!./src/whiteboard/AbstractWhiteboard/index.less":
- /*!*******************************************************************************************************************************************************************************************!*\
- !*** ./node_modules/css-loader/dist/cjs.js??ref--11-1!./node_modules/postcss-loader/src!./node_modules/less-loader/dist/cjs.js??ref--11-3!./src/whiteboard/AbstractWhiteboard/index.less ***!
- \*******************************************************************************************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- exports = module.exports = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js")(false);
- // Module
- exports.push([module.i, ".fcw-board {\n position: relative;\n}\n.fcw-board-imgs,\n.fcw-board-pages,\n.fcw-board .fcw-page {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n}\n.fcw-board-imgs > div,\n.fcw-board-imgs > div > div {\n height: 100%;\n}\n.fcw-board-img {\n width: 100%;\n height: 100%;\n}\n.fcw-board-img-wrapper {\n background-image: url(https://i.postimg.cc/RZwf0MRw/image.png);\n background-size: contain;\n background-position: center;\n height: 100%;\n width: 100%;\n background-repeat: no-repeat;\n}\n.fcw-board-flip-arrow {\n height: 20px;\n width: 20px;\n cursor: pointer;\n}\n.fcw-board-controller {\n position: absolute;\n display: -ms-flexbox;\n display: flex;\n width: 50px;\n height: 30px;\n -ms-flex-pack: justify;\n justify-content: space-between;\n -ms-flex-align: center;\n align-items: center;\n top: -30px;\n background-color: #cccccc;\n padding: 0px 5px;\n margin: 0px;\n border-top-left-radius: 10px;\n border-top-right-radius: 10px;\n}\n", ""]);
-
-
-
- /***/ }),
-
- /***/ "./node_modules/css-loader/dist/cjs.js?!./node_modules/postcss-loader/src/index.js!./node_modules/less-loader/dist/cjs.js?!./src/whiteboard/WhitePage/index.less":
- /*!**********************************************************************************************************************************************************************************!*\
- !*** ./node_modules/css-loader/dist/cjs.js??ref--11-1!./node_modules/postcss-loader/src!./node_modules/less-loader/dist/cjs.js??ref--11-3!./src/whiteboard/WhitePage/index.less ***!
- \**********************************************************************************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- exports = module.exports = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js")(false);
- // Module
- exports.push([module.i, ".fcw-page img {\n width: 100%;\n height: 100%;\n}\n", ""]);
-
-
-
- /***/ }),
-
- /***/ "./node_modules/css-loader/dist/runtime/api.js":
- /*!*****************************************************!*\
- !*** ./node_modules/css-loader/dist/runtime/api.js ***!
- \*****************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- /*
- MIT License http://www.opensource.org/licenses/mit-license.php
- Author Tobias Koppers @sokra
- */
- // css base code, injected by the css-loader
- module.exports = function (useSourceMap) {
- var list = []; // return the list of modules as css string
-
- list.toString = function toString() {
- return this.map(function (item) {
- var content = cssWithMappingToString(item, useSourceMap);
-
- if (item[2]) {
- return '@media ' + item[2] + '{' + content + '}';
- } else {
- return content;
- }
- }).join('');
- }; // import a list of modules into the list
-
-
- list.i = function (modules, mediaQuery) {
- if (typeof modules === 'string') {
- modules = [[null, modules, '']];
- }
-
- var alreadyImportedModules = {};
-
- for (var i = 0; i < this.length; i++) {
- var id = this[i][0];
-
- if (id != null) {
- alreadyImportedModules[id] = true;
- }
- }
-
- for (i = 0; i < modules.length; i++) {
- var item = modules[i]; // skip already imported module
- // this implementation is not 100% perfect for weird media query combinations
- // when a module is imported multiple times with different media queries.
- // I hope this will never occur (Hey this way we have smaller bundles)
-
- if (item[0] == null || !alreadyImportedModules[item[0]]) {
- if (mediaQuery && !item[2]) {
- item[2] = mediaQuery;
- } else if (mediaQuery) {
- item[2] = '(' + item[2] + ') and (' + mediaQuery + ')';
- }
-
- list.push(item);
- }
- }
- };
-
- return list;
- };
-
- function cssWithMappingToString(item, useSourceMap) {
- var content = item[1] || '';
- var cssMapping = item[3];
-
- if (!cssMapping) {
- return content;
- }
-
- if (useSourceMap && typeof btoa === 'function') {
- var sourceMapping = toComment(cssMapping);
- var sourceURLs = cssMapping.sources.map(function (source) {
- return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */';
- });
- return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
- }
-
- return [content].join('\n');
- } // Adapted from convert-source-map (MIT)
-
-
- function toComment(sourceMap) {
- // eslint-disable-next-line no-undef
- var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
- var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;
- return '/*# ' + data + ' */';
- }
-
- /***/ }),
-
- /***/ "./node_modules/eventemitter3/index.js":
- /*!*********************************************!*\
- !*** ./node_modules/eventemitter3/index.js ***!
- \*********************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var has = Object.prototype.hasOwnProperty
- , prefix = '~';
-
- /**
- * Constructor to create a storage for our `EE` objects.
- * An `Events` instance is a plain object whose properties are event names.
- *
- * @constructor
- * @private
- */
- function Events() {}
-
- //
- // We try to not inherit from `Object.prototype`. In some engines creating an
- // instance in this way is faster than calling `Object.create(null)` directly.
- // If `Object.create(null)` is not supported we prefix the event names with a
- // character to make sure that the built-in object properties are not
- // overridden or used as an attack vector.
- //
- if (Object.create) {
- Events.prototype = Object.create(null);
-
- //
- // This hack is needed because the `__proto__` property is still inherited in
- // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.
- //
- if (!new Events().__proto__) prefix = false;
- }
-
- /**
- * Representation of a single event listener.
- *
- * @param {Function} fn The listener function.
- * @param {*} context The context to invoke the listener with.
- * @param {Boolean} [once=false] Specify if the listener is a one-time listener.
- * @constructor
- * @private
- */
- function EE(fn, context, once) {
- this.fn = fn;
- this.context = context;
- this.once = once || false;
- }
-
- /**
- * Add a listener for a given event.
- *
- * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
- * @param {(String|Symbol)} event The event name.
- * @param {Function} fn The listener function.
- * @param {*} context The context to invoke the listener with.
- * @param {Boolean} once Specify if the listener is a one-time listener.
- * @returns {EventEmitter}
- * @private
- */
- function addListener(emitter, event, fn, context, once) {
- if (typeof fn !== 'function') {
- throw new TypeError('The listener must be a function');
- }
-
- var listener = new EE(fn, context || emitter, once)
- , evt = prefix ? prefix + event : event;
-
- if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;
- else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);
- else emitter._events[evt] = [emitter._events[evt], listener];
-
- return emitter;
- }
-
- /**
- * Clear event by name.
- *
- * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
- * @param {(String|Symbol)} evt The Event name.
- * @private
- */
- function clearEvent(emitter, evt) {
- if (--emitter._eventsCount === 0) emitter._events = new Events();
- else delete emitter._events[evt];
- }
-
- /**
- * Minimal `EventEmitter` interface that is molded against the Node.js
- * `EventEmitter` interface.
- *
- * @constructor
- * @public
- */
- function EventEmitter() {
- this._events = new Events();
- this._eventsCount = 0;
- }
-
- /**
- * Return an array listing the events for which the emitter has registered
- * listeners.
- *
- * @returns {Array}
- * @public
- */
- EventEmitter.prototype.eventNames = function eventNames() {
- var names = []
- , events
- , name;
-
- if (this._eventsCount === 0) return names;
-
- for (name in (events = this._events)) {
- if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);
- }
-
- if (Object.getOwnPropertySymbols) {
- return names.concat(Object.getOwnPropertySymbols(events));
- }
-
- return names;
- };
-
- /**
- * Return the listeners registered for a given event.
- *
- * @param {(String|Symbol)} event The event name.
- * @returns {Array} The registered listeners.
- * @public
- */
- EventEmitter.prototype.listeners = function listeners(event) {
- var evt = prefix ? prefix + event : event
- , handlers = this._events[evt];
-
- if (!handlers) return [];
- if (handlers.fn) return [handlers.fn];
-
- for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {
- ee[i] = handlers[i].fn;
- }
-
- return ee;
- };
-
- /**
- * Return the number of listeners listening to a given event.
- *
- * @param {(String|Symbol)} event The event name.
- * @returns {Number} The number of listeners.
- * @public
- */
- EventEmitter.prototype.listenerCount = function listenerCount(event) {
- var evt = prefix ? prefix + event : event
- , listeners = this._events[evt];
-
- if (!listeners) return 0;
- if (listeners.fn) return 1;
- return listeners.length;
- };
-
- /**
- * Calls each of the listeners registered for a given event.
- *
- * @param {(String|Symbol)} event The event name.
- * @returns {Boolean} `true` if the event had listeners, else `false`.
- * @public
- */
- EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
- var evt = prefix ? prefix + event : event;
-
- if (!this._events[evt]) return false;
-
- var listeners = this._events[evt]
- , len = arguments.length
- , args
- , i;
-
- if (listeners.fn) {
- if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);
-
- switch (len) {
- case 1: return listeners.fn.call(listeners.context), true;
- case 2: return listeners.fn.call(listeners.context, a1), true;
- case 3: return listeners.fn.call(listeners.context, a1, a2), true;
- case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;
- case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
- case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
- }
-
- for (i = 1, args = new Array(len -1); i < len; i++) {
- args[i - 1] = arguments[i];
- }
-
- listeners.fn.apply(listeners.context, args);
- } else {
- var length = listeners.length
- , j;
-
- for (i = 0; i < length; i++) {
- if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);
-
- switch (len) {
- case 1: listeners[i].fn.call(listeners[i].context); break;
- case 2: listeners[i].fn.call(listeners[i].context, a1); break;
- case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;
- case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;
- default:
- if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {
- args[j - 1] = arguments[j];
- }
-
- listeners[i].fn.apply(listeners[i].context, args);
- }
- }
- }
-
- return true;
- };
-
- /**
- * Add a listener for a given event.
- *
- * @param {(String|Symbol)} event The event name.
- * @param {Function} fn The listener function.
- * @param {*} [context=this] The context to invoke the listener with.
- * @returns {EventEmitter} `this`.
- * @public
- */
- EventEmitter.prototype.on = function on(event, fn, context) {
- return addListener(this, event, fn, context, false);
- };
-
- /**
- * Add a one-time listener for a given event.
- *
- * @param {(String|Symbol)} event The event name.
- * @param {Function} fn The listener function.
- * @param {*} [context=this] The context to invoke the listener with.
- * @returns {EventEmitter} `this`.
- * @public
- */
- EventEmitter.prototype.once = function once(event, fn, context) {
- return addListener(this, event, fn, context, true);
- };
-
- /**
- * Remove the listeners of a given event.
- *
- * @param {(String|Symbol)} event The event name.
- * @param {Function} fn Only remove the listeners that match this function.
- * @param {*} context Only remove the listeners that have this context.
- * @param {Boolean} once Only remove one-time listeners.
- * @returns {EventEmitter} `this`.
- * @public
- */
- EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
- var evt = prefix ? prefix + event : event;
-
- if (!this._events[evt]) return this;
- if (!fn) {
- clearEvent(this, evt);
- return this;
- }
-
- var listeners = this._events[evt];
-
- if (listeners.fn) {
- if (
- listeners.fn === fn &&
- (!once || listeners.once) &&
- (!context || listeners.context === context)
- ) {
- clearEvent(this, evt);
- }
- } else {
- for (var i = 0, events = [], length = listeners.length; i < length; i++) {
- if (
- listeners[i].fn !== fn ||
- (once && !listeners[i].once) ||
- (context && listeners[i].context !== context)
- ) {
- events.push(listeners[i]);
- }
- }
-
- //
- // Reset the array, or remove it completely if we have no more listeners.
- //
- if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;
- else clearEvent(this, evt);
- }
-
- return this;
- };
-
- /**
- * Remove all listeners, or those of the specified event.
- *
- * @param {(String|Symbol)} [event] The event name.
- * @returns {EventEmitter} `this`.
- * @public
- */
- EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
- var evt;
-
- if (event) {
- evt = prefix ? prefix + event : event;
- if (this._events[evt]) clearEvent(this, evt);
- } else {
- this._events = new Events();
- this._eventsCount = 0;
- }
-
- return this;
- };
-
- //
- // Alias methods names because people roll like that.
- //
- EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
- EventEmitter.prototype.addListener = EventEmitter.prototype.on;
-
- //
- // Expose the prefix.
- //
- EventEmitter.prefixed = prefix;
-
- //
- // Allow `EventEmitter` to be imported as module namespace.
- //
- EventEmitter.EventEmitter = EventEmitter;
-
- //
- // Expose the module.
- //
- if (true) {
- module.exports = EventEmitter;
- }
-
-
- /***/ }),
-
- /***/ "./node_modules/fc-hotkeys/dist/index.js":
- /*!***********************************************!*\
- !*** ./node_modules/fc-hotkeys/dist/index.js ***!
- \***********************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- !function(t,e){if(true)module.exports=e();else { var r, n; }}(window,function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=1)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.KEY_ESC="ESC",e.KEY_ALL="*",e.normalizeModifiersMap={ctrl:"Ctrl",control:"Ctrl",alt:"Alt",shift:"Shift",command:"Command",meta:"Command"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}(n(0));var r=n(2);e.HotkeysListener=r.default},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(3),a=n(0),s=n(4),c=function(){function t(t,e){var n=this;void 0===t&&(t=document.body),void 0===e&&(e=i),this.listeners={},this._notify=function(t,e,r){var o=n.listeners[a.KEY_ALL];o&&o.length>0&&o.forEach(function(t){!1===t(e,r)&&s.preventAndStopEvent(e)});var i=n.listeners[t];i&&i.length>0&&i.forEach(function(t){!1===t(e,r)&&s.preventAndStopEvent(e)})};var r=this._notify,c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.handleKey=function(t,e,n){var o=s.normalizeHotkeys(t,e);n&&"keyup"!==n.type&&r(o,n,{char:t,modifiers:e,hotkey:o})},e}(e);this.trapObj=new c(t)}return t.prototype.on=function(t,e){var n=this;if("string"==typeof t){var r=t,o=this.listeners[r]||[];o.push(e),this.listeners[r]=o}else{if(!Array.isArray(t))throw new Error("first param of on() must be a string or an array of string");t.forEach(function(t){n.on(t,e)})}},t.prototype.off=function(t,e){var n=this;if("string"==typeof t){var r=t,o=this.listeners[r]||[],i=o.indexOf(e);i>=0&&o.splice(i,1),this.listeners[r]=o}else{if(!Array.isArray(t))throw new Error("first param of off() must be a string or an array of string");t.forEach(function(t){n.off(t,e)})}},t.prototype.reset=function(){this.listeners={},this.trapObj.reset()},t}();e.default=c},function(t,e,n){var r;!function(o,i,a){if(o){for(var s,c={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},u={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},f={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},l={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},p=1;p<20;++p)c[111+p]="f"+p;for(p=0;p<=9;++p)c[p+96]=p.toString();b.prototype.bind=function(t,e,n){return t=t instanceof Array?t:[t],this._bindMultiple.call(this,t,e,n),this},b.prototype.unbind=function(t,e){return this.bind.call(this,t,function(){},e)},b.prototype.trigger=function(t,e){return this._directMap[t+":"+e]&&this._directMap[t+":"+e]({},t),this},b.prototype.reset=function(){return this._callbacks={},this._directMap={},this},b.prototype.stopCallback=function(t,e){if((" "+e.className+" ").indexOf(" mousetrap ")>-1)return!1;if(function t(e,n){return null!==e&&e!==i&&(e===n||t(e.parentNode,n))}(e,this.target))return!1;if("composedPath"in t&&"function"==typeof t.composedPath){var n=t.composedPath()[0];n!==t.target&&(e=n)}return"INPUT"==e.tagName||"SELECT"==e.tagName||"TEXTAREA"==e.tagName||e.isContentEditable},b.prototype.handleKey=function(){return this._handleKey.apply(this,arguments)},b.addKeycodes=function(t){for(var e in t)t.hasOwnProperty(e)&&(c[e]=t[e]);s=null},b.init=function(){var t=b(i);for(var e in t)"_"!==e.charAt(0)&&(b[e]=function(e){return function(){return t[e].apply(t,arguments)}}(e))},b.init(),o.Mousetrap=b,t.exports&&(t.exports=b),void 0===(r=function(){return b}.call(e,n,e,t))||(t.exports=r)}function h(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)}function d(t){if("keypress"==t.type){var e=String.fromCharCode(t.which);return t.shiftKey||(e=e.toLowerCase()),e}return c[t.which]?c[t.which]:u[t.which]?u[t.which]:String.fromCharCode(t.which).toLowerCase()}function y(t){return"shift"==t||"ctrl"==t||"alt"==t||"meta"==t}function v(t,e,n){return n||(n=function(){if(!s)for(var t in s={},c)t>95&&t<112||c.hasOwnProperty(t)&&(s[c[t]]=t);return s}()[t]?"keydown":"keypress"),"keypress"==n&&e.length&&(n="keydown"),n}function m(t,e){var n,r,o,i=[];for(n=function(t){return"+"===t?["+"]:(t=t.replace(/\+{2}/g,"+plus")).split("+")}(t),o=0;o<n.length;++o)r=n[o],l[r]&&(r=l[r]),e&&"keypress"!=e&&f[r]&&(r=f[r],i.push("shift")),y(r)&&i.push(r);return{key:r,modifiers:i,action:e=v(r,i,e)}}function b(t){var e=this;if(t=t||i,!(e instanceof b))return new b(t);e.target=t,e._callbacks={},e._directMap={};var n,r={},o=!1,a=!1,s=!1;function c(t){t=t||{};var e,n=!1;for(e in r)t[e]?n=!0:r[e]=0;n||(s=!1)}function u(t,n,o,i,a,s){var c,u,f,l,p=[],h=o.type;if(!e._callbacks[t])return[];for("keyup"==h&&y(t)&&(n=[t]),c=0;c<e._callbacks[t].length;++c)if(u=e._callbacks[t][c],(i||!u.seq||r[u.seq]==u.level)&&h==u.action&&("keypress"==h&&!o.metaKey&&!o.ctrlKey||(f=n,l=u.modifiers,f.sort().join(",")===l.sort().join(",")))){var d=!i&&u.combo==a,v=i&&u.seq==i&&u.level==s;(d||v)&&e._callbacks[t].splice(c,1),p.push(u)}return p}function f(t,n,r,o){e.stopCallback(n,n.target||n.srcElement,r,o)||!1===t(n,r)&&(function(t){t.preventDefault?t.preventDefault():t.returnValue=!1}(n),function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}(n))}function l(t){"number"!=typeof t.which&&(t.which=t.keyCode);var n=d(t);n&&("keyup"!=t.type||o!==n?e.handleKey(n,function(t){var e=[];return t.shiftKey&&e.push("shift"),t.altKey&&e.push("alt"),t.ctrlKey&&e.push("ctrl"),t.metaKey&&e.push("meta"),e}(t),t):o=!1)}function p(t,e,i,a){function u(e){return function(){s=e,++r[t],clearTimeout(n),n=setTimeout(c,1e3)}}function l(e){f(i,e,t),"keyup"!==a&&(o=d(e)),setTimeout(c,10)}r[t]=0;for(var p=0;p<e.length;++p){var h=p+1===e.length?l:u(a||m(e[p+1]).action);v(e[p],h,a,t,p)}}function v(t,n,r,o,i){e._directMap[t+":"+r]=n;var a,s=(t=t.replace(/\s+/g," ")).split(" ");s.length>1?p(t,s,n,r):(a=m(t,r),e._callbacks[a.key]=e._callbacks[a.key]||[],u(a.key,a.modifiers,{type:a.action},o,t,i),e._callbacks[a.key][o?"unshift":"push"]({callback:n,modifiers:a.modifiers,action:a.action,seq:o,level:i,combo:t}))}e._handleKey=function(t,e,n){var r,o=u(t,e,n),i={},l=0,p=!1;for(r=0;r<o.length;++r)o[r].seq&&(l=Math.max(l,o[r].level));for(r=0;r<o.length;++r)if(o[r].seq){if(o[r].level!=l)continue;p=!0,i[o[r].seq]=1,f(o[r].callback,n,o[r].combo,o[r].seq)}else p||f(o[r].callback,n,o[r].combo);var h="keypress"==n.type&&a;n.type!=s||y(t)||h||c(i),a=p&&"keydown"==n.type},e._bindMultiple=function(t,e,n){for(var r=0;r<t.length;++r)v(t[r],e,n)},h(t,"keypress",l),h(t,"keydown",l),h(t,"keyup",l)}}("undefined"!=typeof window?window:null,"undefined"!=typeof window?document:null)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0);e.normalizeHotkeys=function(t,e){var n=e.map(function(t){return r.normalizeModifiersMap[t]||t}).reverse();return e.indexOf(t)<0&&n.indexOf(t)<0&&n.push(t.toUpperCase()),n.join("+")},e.preventAndStopEvent=function(t){t.preventDefault(),t.stopPropagation()}}])});
-
- /***/ }),
-
- /***/ "./node_modules/interactjs/dist/interact.js":
- /*!**************************************************!*\
- !*** ./node_modules/interactjs/dist/interact.js ***!
- \**************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- /**
- * interact.js 1.4.9
- *
- * Copyright (c) 2012-2019 Taye Adeyemi <dev@taye.me>
- * Released under the MIT License.
- * https://raw.github.com/taye/interact.js/master/LICENSE
- */
- (function(f){if(true){module.exports=f()}else { var g; }})(function(){var define,module,exports;
- var createModuleFactory = function createModuleFactory(t){var e;return function(r){return e||t(e={exports:{},parent:r},e.exports),e.exports}};
- var _$scope_24 = createModuleFactory(function (module, exports) {
- "use strict";
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- /* common-shake removed: exports.createScope = */ void createScope;
- /* common-shake removed: exports.initScope = */ void initScope;
- exports.Scope = exports.ActionName = void 0;
-
- var utils = _interopRequireWildcard(_$utils_55);
-
- var _domObjects = _interopRequireDefault(_$domObjects_49);
-
- var _defaultOptions = _interopRequireDefault(_$defaultOptions_20);
-
- var _Eventable = _interopRequireDefault(_$Eventable_14);
-
- var _Interactable = _interopRequireDefault(_$Interactable_16);
-
- var _InteractableSet = _interopRequireDefault(_$InteractableSet_17);
-
- var _InteractEvent = _interopRequireDefault(_$InteractEvent_15);
-
- var _interactions = _interopRequireDefault(_$interactions_23({}));
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
-
- function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
-
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
-
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
-
- function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }
-
- function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
-
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
-
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
-
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
-
- var win = utils.win,
- browser = utils.browser,
- raf = utils.raf,
- Signals = utils.Signals,
- events = utils.events;
- var ActionName;
- exports.ActionName = ActionName;
-
- (function (ActionName) {})(ActionName || (exports.ActionName = ActionName = {}));
-
- function createScope() {
- return new Scope();
- }
-
- var Scope =
- /*#__PURE__*/
- function () {
- function Scope() {
- var _this = this;
-
- _classCallCheck(this, Scope);
-
- this.id = "__interact_scope_".concat(Math.floor(Math.random() * 100));
- this.signals = new Signals();
- this.browser = browser;
- this.events = events;
- this.utils = utils;
- this.defaults = utils.clone(_defaultOptions["default"]);
- this.Eventable = _Eventable["default"];
- this.actions = {
- names: [],
- methodDict: {},
- eventTypes: []
- };
- this.InteractEvent = _InteractEvent["default"];
- this.interactables = new _InteractableSet["default"](this); // all documents being listened to
-
- this.documents = [];
- this._plugins = [];
- this._pluginMap = {};
-
- this.onWindowUnload = function (event) {
- return _this.removeDocument(event.target);
- };
-
- var scope = this;
-
- this.Interactable =
- /*#__PURE__*/
- function (_InteractableBase) {
- _inherits(Interactable, _InteractableBase);
-
- function Interactable() {
- _classCallCheck(this, Interactable);
-
- return _possibleConstructorReturn(this, _getPrototypeOf(Interactable).apply(this, arguments));
- }
-
- _createClass(Interactable, [{
- key: "set",
- value: function set(options) {
- _get(_getPrototypeOf(Interactable.prototype), "set", this).call(this, options);
-
- scope.interactables.signals.fire('set', {
- options: options,
- interactable: this
- });
- return this;
- }
- }, {
- key: "unset",
- value: function unset() {
- _get(_getPrototypeOf(Interactable.prototype), "unset", this).call(this);
-
- for (var i = scope.interactions.list.length - 1; i >= 0; i--) {
- var interaction = scope.interactions.list[i];
-
- if (interaction.interactable === this) {
- interaction.stop();
- scope.interactions.signals.fire('destroy', {
- interaction: interaction
- });
- interaction.destroy();
-
- if (scope.interactions.list.length > 2) {
- scope.interactions.list.splice(i, 1);
- }
- }
- }
-
- scope.interactables.signals.fire('unset', {
- interactable: this
- });
- }
- }, {
- key: "_defaults",
- get: function get() {
- return scope.defaults;
- }
- }]);
-
- return Interactable;
- }(_Interactable["default"]);
- }
-
- _createClass(Scope, [{
- key: "init",
- value: function init(window) {
- return initScope(this, window);
- }
- }, {
- key: "pluginIsInstalled",
- value: function pluginIsInstalled(plugin) {
- return this._pluginMap[plugin.id] || this._plugins.indexOf(plugin) !== -1;
- }
- }, {
- key: "usePlugin",
- value: function usePlugin(plugin, options) {
- if (this.pluginIsInstalled(plugin)) {
- return this;
- }
-
- if (plugin.id) {
- this._pluginMap[plugin.id] = plugin;
- }
-
- plugin.install(this, options);
-
- this._plugins.push(plugin);
-
- return this;
- }
- }, {
- key: "addDocument",
- value: function addDocument(doc, options) {
- // do nothing if document is already known
- if (this.getDocIndex(doc) !== -1) {
- return false;
- }
-
- var window = win.getWindow(doc);
- options = options ? utils.extend({}, options) : {};
- this.documents.push({
- doc: doc,
- options: options
- });
- events.documents.push(doc); // don't add an unload event for the main document
- // so that the page may be cached in browser history
-
- if (doc !== this.document) {
- events.add(window, 'unload', this.onWindowUnload);
- }
-
- this.signals.fire('add-document', {
- doc: doc,
- window: window,
- scope: this,
- options: options
- });
- }
- }, {
- key: "removeDocument",
- value: function removeDocument(doc) {
- var index = this.getDocIndex(doc);
- var window = win.getWindow(doc);
- var options = this.documents[index].options;
- events.remove(window, 'unload', this.onWindowUnload);
- this.documents.splice(index, 1);
- events.documents.splice(index, 1);
- this.signals.fire('remove-document', {
- doc: doc,
- window: window,
- scope: this,
- options: options
- });
- }
- }, {
- key: "getDocIndex",
- value: function getDocIndex(doc) {
- for (var i = 0; i < this.documents.length; i++) {
- if (this.documents[i].doc === doc) {
- return i;
- }
- }
-
- return -1;
- }
- }, {
- key: "getDocOptions",
- value: function getDocOptions(doc) {
- var docIndex = this.getDocIndex(doc);
- return docIndex === -1 ? null : this.documents[docIndex].options;
- }
- }, {
- key: "now",
- value: function now() {
- return (this.window.Date || Date).now();
- }
- }]);
-
- return Scope;
- }();
-
- exports.Scope = Scope;
-
- function initScope(scope, window) {
- win.init(window);
-
- _domObjects["default"].init(window);
-
- browser.init(window);
- raf.init(window);
- events.init(window);
- scope.usePlugin(_interactions["default"]);
- scope.document = window.document;
- scope.window = window;
- return scope;
- }
-
- });
- var _$interactions_23 = createModuleFactory(function (module, exports) {
- "use strict";
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports["default"] = void 0;
-
- var _browser = _interopRequireDefault(_$browser_47);
-
- var _domObjects = _interopRequireDefault(_$domObjects_49);
-
- /* removed: var _$domUtils_50 = require("@interactjs/utils/domUtils"); */;
-
- var _events = _interopRequireDefault(_$events_51);
-
- var _pointerUtils = _interopRequireDefault(_$pointerUtils_60);
-
- var _Signals = _interopRequireDefault(_$Signals_45);
-
- var _Interaction = _interopRequireDefault(_$Interaction_18({}));
-
- var _interactionFinder = _interopRequireDefault(_$interactionFinder_22);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
-
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
-
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
-
- function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
-
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
-
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
-
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
-
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
-
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
-
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
-
- var methodNames = ['pointerDown', 'pointerMove', 'pointerUp', 'updatePointer', 'removePointer', 'windowBlur'];
-
- function install(scope) {
- var signals = new _Signals["default"]();
- var listeners = {};
-
- for (var _i = 0; _i < methodNames.length; _i++) {
- var method = methodNames[_i];
- listeners[method] = doOnInteractions(method, scope);
- }
-
- var pEventTypes = _browser["default"].pEventTypes;
- var eventMap;
-
- if (_domObjects["default"].PointerEvent) {
- eventMap = [{
- type: pEventTypes.down,
- listener: releasePointersOnRemovedEls
- }, {
- type: pEventTypes.down,
- listener: listeners.pointerDown
- }, {
- type: pEventTypes.move,
- listener: listeners.pointerMove
- }, {
- type: pEventTypes.up,
- listener: listeners.pointerUp
- }, {
- type: pEventTypes.cancel,
- listener: listeners.pointerUp
- }];
- } else {
- eventMap = [{
- type: 'mousedown',
- listener: listeners.pointerDown
- }, {
- type: 'mousemove',
- listener: listeners.pointerMove
- }, {
- type: 'mouseup',
- listener: listeners.pointerUp
- }, {
- type: 'touchstart',
- listener: releasePointersOnRemovedEls
- }, {
- type: 'touchstart',
- listener: listeners.pointerDown
- }, {
- type: 'touchmove',
- listener: listeners.pointerMove
- }, {
- type: 'touchend',
- listener: listeners.pointerUp
- }, {
- type: 'touchcancel',
- listener: listeners.pointerUp
- }];
- }
-
- eventMap.push({
- type: 'blur',
- listener: function listener(event) {
- for (var _i2 = 0; _i2 < scope.interactions.list.length; _i2++) {
- var _ref;
-
- _ref = scope.interactions.list[_i2];
- var interaction = _ref;
- interaction.documentBlur(event);
- }
- }
- });
- scope.signals.on('add-document', onDocSignal);
- scope.signals.on('remove-document', onDocSignal); // for ignoring browser's simulated mouse events
-
- scope.prevTouchTime = 0;
-
- scope.Interaction =
- /*#__PURE__*/
- function (_InteractionBase) {
- _inherits(Interaction, _InteractionBase);
-
- function Interaction() {
- _classCallCheck(this, Interaction);
-
- return _possibleConstructorReturn(this, _getPrototypeOf(Interaction).apply(this, arguments));
- }
-
- _createClass(Interaction, [{
- key: "_now",
- value: function _now() {
- return scope.now();
- }
- }, {
- key: "pointerMoveTolerance",
- get: function get() {
- return scope.interactions.pointerMoveTolerance;
- },
- set: function set(value) {
- scope.interactions.pointerMoveTolerance = value;
- }
- }]);
-
- return Interaction;
- }(_Interaction["default"]);
-
- scope.interactions = {
- signals: signals,
- // all active and idle interactions
- list: [],
- "new": function _new(options) {
- options.signals = signals;
- var interaction = new scope.Interaction(options);
- scope.interactions.list.push(interaction);
- return interaction;
- },
- listeners: listeners,
- eventMap: eventMap,
- pointerMoveTolerance: 1
- };
-
- function releasePointersOnRemovedEls() {
- // for all inactive touch interactions with pointers down
- for (var _i3 = 0; _i3 < scope.interactions.list.length; _i3++) {
- var _ref2;
-
- _ref2 = scope.interactions.list[_i3];
- var interaction = _ref2;
-
- if (!interaction.pointerIsDown || interaction.pointerType !== 'touch' || interaction._interacting) {
- continue;
- } // if a pointer is down on an element that is no longer in the DOM tree
-
-
- var _loop = function _loop() {
- _ref3 = interaction.pointers[_i4];
- var pointer = _ref3;
-
- if (!scope.documents.some(function (_ref4) {
- var doc = _ref4.doc;
- return (0, _$domUtils_50.nodeContains)(doc, pointer.downTarget);
- })) {
- // remove the pointer from the interaction
- interaction.removePointer(pointer.pointer, pointer.event);
- }
- };
-
- for (var _i4 = 0; _i4 < interaction.pointers.length; _i4++) {
- var _ref3;
-
- _loop();
- }
- }
- }
- }
-
- function doOnInteractions(method, scope) {
- return function (event) {
- var interactions = scope.interactions.list;
-
- var pointerType = _pointerUtils["default"].getPointerType(event);
-
- var _pointerUtils$getEven = _pointerUtils["default"].getEventTargets(event),
- _pointerUtils$getEven2 = _slicedToArray(_pointerUtils$getEven, 2),
- eventTarget = _pointerUtils$getEven2[0],
- curEventTarget = _pointerUtils$getEven2[1];
-
- var matches = []; // [ [pointer, interaction], ...]
-
- if (/^touch/.test(event.type)) {
- scope.prevTouchTime = scope.now();
-
- for (var _i5 = 0; _i5 < event.changedTouches.length; _i5++) {
- var _ref5;
-
- _ref5 = event.changedTouches[_i5];
- var changedTouch = _ref5;
- var pointer = changedTouch;
-
- var pointerId = _pointerUtils["default"].getPointerId(pointer);
-
- var searchDetails = {
- pointer: pointer,
- pointerId: pointerId,
- pointerType: pointerType,
- eventType: event.type,
- eventTarget: eventTarget,
- curEventTarget: curEventTarget,
- scope: scope
- };
- var interaction = getInteraction(searchDetails);
- matches.push([searchDetails.pointer, searchDetails.eventTarget, searchDetails.curEventTarget, interaction]);
- }
- } else {
- var invalidPointer = false;
-
- if (!_browser["default"].supportsPointerEvent && /mouse/.test(event.type)) {
- // ignore mouse events while touch interactions are active
- for (var i = 0; i < interactions.length && !invalidPointer; i++) {
- invalidPointer = interactions[i].pointerType !== 'mouse' && interactions[i].pointerIsDown;
- } // try to ignore mouse events that are simulated by the browser
- // after a touch event
-
-
- invalidPointer = invalidPointer || scope.now() - scope.prevTouchTime < 500 || // on iOS and Firefox Mobile, MouseEvent.timeStamp is zero if simulated
- event.timeStamp === 0;
- }
-
- if (!invalidPointer) {
- var _searchDetails = {
- pointer: event,
- pointerId: _pointerUtils["default"].getPointerId(event),
- pointerType: pointerType,
- eventType: event.type,
- curEventTarget: curEventTarget,
- eventTarget: eventTarget,
- scope: scope
- };
-
- var _interaction = getInteraction(_searchDetails);
-
- matches.push([_searchDetails.pointer, _searchDetails.eventTarget, _searchDetails.curEventTarget, _interaction]);
- }
- } // eslint-disable-next-line no-shadow
-
-
- for (var _i6 = 0; _i6 < matches.length; _i6++) {
- var _matches$_i = _slicedToArray(matches[_i6], 4),
- _pointer = _matches$_i[0],
- _eventTarget = _matches$_i[1],
- _curEventTarget = _matches$_i[2],
- _interaction2 = _matches$_i[3];
-
- _interaction2[method](_pointer, event, _eventTarget, _curEventTarget);
- }
- };
- }
-
- function getInteraction(searchDetails) {
- var pointerType = searchDetails.pointerType,
- scope = searchDetails.scope;
-
- var foundInteraction = _interactionFinder["default"].search(searchDetails);
-
- var signalArg = {
- interaction: foundInteraction,
- searchDetails: searchDetails
- };
- scope.interactions.signals.fire('find', signalArg);
- return signalArg.interaction || scope.interactions["new"]({
- pointerType: pointerType
- });
- }
-
- function onDocSignal(_ref6, signalName) {
- var doc = _ref6.doc,
- scope = _ref6.scope,
- options = _ref6.options;
- var eventMap = scope.interactions.eventMap;
- var eventMethod = signalName.indexOf('add') === 0 ? _events["default"].add : _events["default"].remove;
-
- if (scope.browser.isIOS && !options.events) {
- options.events = {
- passive: false
- };
- } // delegate event listener
-
-
- for (var eventType in _events["default"].delegatedEvents) {
- eventMethod(doc, eventType, _events["default"].delegateListener);
- eventMethod(doc, eventType, _events["default"].delegateUseCapture, true);
- }
-
- var eventOptions = options && options.events;
-
- for (var _i7 = 0; _i7 < eventMap.length; _i7++) {
- var _ref7;
-
- _ref7 = eventMap[_i7];
- var _ref8 = _ref7,
- type = _ref8.type,
- listener = _ref8.listener;
- eventMethod(doc, type, listener, eventOptions);
- }
- }
-
- var _default = {
- id: 'core/interactions',
- install: install,
- onDocSignal: onDocSignal,
- doOnInteractions: doOnInteractions,
- methodNames: methodNames
- };
- exports["default"] = _default;
-
- });
- var _$Interaction_18 = createModuleFactory(function (module, exports) {
- "use strict";
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- Object.defineProperty(exports, "PointerInfo", {
- enumerable: true,
- get: function get() {
- return _PointerInfo["default"];
- }
- });
- exports["default"] = exports.Interaction = exports._ProxyMethods = exports._ProxyValues = void 0;
-
- var utils = _interopRequireWildcard(_$utils_55);
-
- var _InteractEvent = _interopRequireWildcard(_$InteractEvent_15);
-
- var _PointerInfo = _interopRequireDefault(_$PointerInfo_19);
-
- var _scope = _$scope_24({});
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
-
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
-
- var _ProxyValues;
-
- exports._ProxyValues = _ProxyValues;
-
- (function (_ProxyValues) {
- _ProxyValues["interactable"] = "";
- _ProxyValues["element"] = "";
- _ProxyValues["prepared"] = "";
- _ProxyValues["pointerIsDown"] = "";
- _ProxyValues["pointerWasMoved"] = "";
- _ProxyValues["_proxy"] = "";
- })(_ProxyValues || (exports._ProxyValues = _ProxyValues = {}));
-
- var _ProxyMethods;
-
- exports._ProxyMethods = _ProxyMethods;
-
- (function (_ProxyMethods) {
- _ProxyMethods["start"] = "";
- _ProxyMethods["move"] = "";
- _ProxyMethods["end"] = "";
- _ProxyMethods["stop"] = "";
- _ProxyMethods["interacting"] = "";
- })(_ProxyMethods || (exports._ProxyMethods = _ProxyMethods = {}));
-
- var Interaction =
- /*#__PURE__*/
- function () {
- /** */
- function Interaction(_ref) {
- var _this = this;
-
- var pointerType = _ref.pointerType,
- signals = _ref.signals;
-
- _classCallCheck(this, Interaction);
-
- // current interactable being interacted with
- this.interactable = null; // the target element of the interactable
-
- this.element = null; // action that's ready to be fired on next move event
-
- this.prepared = {
- name: null,
- axis: null,
- edges: null
- }; // keep track of added pointers
-
- this.pointers = []; // pointerdown/mousedown/touchstart event
-
- this.downEvent = null;
- this.downPointer = {};
- this._latestPointer = {
- pointer: null,
- event: null,
- eventTarget: null
- }; // previous action event
-
- this.prevEvent = null;
- this.pointerIsDown = false;
- this.pointerWasMoved = false;
- this._interacting = false;
- this._ending = false;
- this._proxy = null;
- this.simulation = null;
- /**
- * @alias Interaction.prototype.move
- */
-
- this.doMove = utils.warnOnce(function (signalArg) {
- this.move(signalArg);
- }, 'The interaction.doMove() method has been renamed to interaction.move()');
- this.coords = {
- // Starting InteractEvent pointer coordinates
- start: utils.pointer.newCoords(),
- // Previous native pointer move event coordinates
- prev: utils.pointer.newCoords(),
- // current native pointer move event coordinates
- cur: utils.pointer.newCoords(),
- // Change in coordinates and time of the pointer
- delta: utils.pointer.newCoords(),
- // pointer velocity
- velocity: utils.pointer.newCoords()
- };
- this._signals = signals;
- this.pointerType = pointerType;
- var that = this;
- this._proxy = {};
-
- var _loop = function _loop(key) {
- Object.defineProperty(_this._proxy, key, {
- get: function get() {
- return that[key];
- }
- });
- };
-
- for (var key in _ProxyValues) {
- _loop(key);
- }
-
- var _loop2 = function _loop2(key) {
- Object.defineProperty(_this._proxy, key, {
- value: function value() {
- return that[key].apply(that, arguments);
- }
- });
- };
-
- for (var key in _ProxyMethods) {
- _loop2(key);
- }
-
- this._signals.fire('new', {
- interaction: this
- });
- }
-
- _createClass(Interaction, [{
- key: "pointerDown",
- value: function pointerDown(pointer, event, eventTarget) {
- var pointerIndex = this.updatePointer(pointer, event, eventTarget, true);
-
- this._signals.fire('down', {
- pointer: pointer,
- event: event,
- eventTarget: eventTarget,
- pointerIndex: pointerIndex,
- interaction: this
- });
- }
- /**
- * ```js
- * interact(target)
- * .draggable({
- * // disable the default drag start by down->move
- * manualStart: true
- * })
- * // start dragging after the user holds the pointer down
- * .on('hold', function (event) {
- * var interaction = event.interaction
- *
- * if (!interaction.interacting()) {
- * interaction.start({ name: 'drag' },
- * event.interactable,
- * event.currentTarget)
- * }
- * })
- * ```
- *
- * Start an action with the given Interactable and Element as tartgets. The
- * action must be enabled for the target Interactable and an appropriate
- * number of pointers must be held down - 1 for drag/resize, 2 for gesture.
- *
- * Use it with `interactable.<action>able({ manualStart: false })` to always
- * [start actions manually](https://github.com/taye/interact.js/issues/114)
- *
- * @param {object} action The action to be performed - drag, resize, etc.
- * @param {Interactable} target The Interactable to target
- * @param {Element} element The DOM Element to target
- * @return {object} interact
- */
-
- }, {
- key: "start",
- value: function start(action, interactable, element) {
- if (this.interacting() || !this.pointerIsDown || this.pointers.length < (action.name === _scope.ActionName.Gesture ? 2 : 1) || !interactable.options[action.name].enabled) {
- return false;
- }
-
- utils.copyAction(this.prepared, action);
- this.interactable = interactable;
- this.element = element;
- this.rect = interactable.getRect(element);
- this.edges = this.prepared.edges;
- this._interacting = this._doPhase({
- interaction: this,
- event: this.downEvent,
- phase: _InteractEvent.EventPhase.Start
- });
- return this._interacting;
- }
- }, {
- key: "pointerMove",
- value: function pointerMove(pointer, event, eventTarget) {
- if (!this.simulation && !(this.modifiers && this.modifiers.endPrevented)) {
- this.updatePointer(pointer, event, eventTarget, false);
- utils.pointer.setCoords(this.coords.cur, this.pointers.map(function (p) {
- return p.pointer;
- }), this._now());
- }
-
- var 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;
- var dx;
- var dy; // register movement greater than pointerMoveTolerance
-
- if (this.pointerIsDown && !this.pointerWasMoved) {
- dx = this.coords.cur.client.x - this.coords.start.client.x;
- dy = this.coords.cur.client.y - this.coords.start.client.y;
- this.pointerWasMoved = utils.hypot(dx, dy) > this.pointerMoveTolerance;
- }
-
- var signalArg = {
- pointer: pointer,
- pointerIndex: this.getPointerIndex(pointer),
- event: event,
- eventTarget: eventTarget,
- dx: dx,
- dy: dy,
- duplicate: duplicateMove,
- interaction: this
- };
-
- if (!duplicateMove) {
- // set pointer coordinate, time changes and velocity
- utils.pointer.setCoordDeltas(this.coords.delta, this.coords.prev, this.coords.cur);
- utils.pointer.setCoordVelocity(this.coords.velocity, this.coords.delta);
- }
-
- this._signals.fire('move', signalArg);
-
- if (!duplicateMove) {
- // if interacting, fire an 'action-move' signal etc
- if (this.interacting()) {
- this.move(signalArg);
- }
-
- if (this.pointerWasMoved) {
- utils.pointer.copyCoords(this.coords.prev, this.coords.cur);
- }
- }
- }
- /**
- * ```js
- * interact(target)
- * .draggable(true)
- * .on('dragmove', function (event) {
- * if (someCondition) {
- * // change the snap settings
- * event.interactable.draggable({ snap: { targets: [] }})
- * // fire another move event with re-calculated snap
- * event.interaction.move()
- * }
- * })
- * ```
- *
- * Force a move of the current action at the same coordinates. Useful if
- * snap/restrict has been changed and you want a movement with the new
- * settings.
- */
-
- }, {
- key: "move",
- value: function move(signalArg) {
- signalArg = utils.extend({
- pointer: this._latestPointer.pointer,
- event: this._latestPointer.event,
- eventTarget: this._latestPointer.eventTarget,
- interaction: this
- }, signalArg || {});
- signalArg.phase = _InteractEvent.EventPhase.Move;
-
- this._doPhase(signalArg);
- } // End interact move events and stop auto-scroll unless simulation is running
-
- }, {
- key: "pointerUp",
- value: function pointerUp(pointer, event, eventTarget, curEventTarget) {
- var pointerIndex = this.getPointerIndex(pointer);
-
- if (pointerIndex === -1) {
- pointerIndex = this.updatePointer(pointer, event, eventTarget, false);
- }
-
- this._signals.fire(/cancel$/i.test(event.type) ? 'cancel' : 'up', {
- pointer: pointer,
- pointerIndex: pointerIndex,
- event: event,
- eventTarget: eventTarget,
- curEventTarget: curEventTarget,
- interaction: this
- });
-
- if (!this.simulation) {
- this.end(event);
- }
-
- this.pointerIsDown = false;
- this.removePointer(pointer, event);
- }
- }, {
- key: "documentBlur",
- value: function documentBlur(event) {
- this.end(event);
-
- this._signals.fire('blur', {
- event: event,
- interaction: this
- });
- }
- /**
- * ```js
- * interact(target)
- * .draggable(true)
- * .on('move', function (event) {
- * if (event.pageX > 1000) {
- * // end the current action
- * event.interaction.end()
- * // stop all further listeners from being called
- * event.stopImmediatePropagation()
- * }
- * })
- * ```
- *
- * @param {PointerEvent} [event]
- */
-
- }, {
- key: "end",
- value: function end(event) {
- this._ending = true;
- event = event || this._latestPointer.event;
- var endPhaseResult;
-
- if (this.interacting()) {
- endPhaseResult = this._doPhase({
- event: event,
- interaction: this,
- phase: _InteractEvent.EventPhase.End
- });
- }
-
- this._ending = false;
-
- if (endPhaseResult === true) {
- this.stop();
- }
- }
- }, {
- key: "currentAction",
- value: function currentAction() {
- return this._interacting ? this.prepared.name : null;
- }
- }, {
- key: "interacting",
- value: function interacting() {
- return this._interacting;
- }
- /** */
-
- }, {
- key: "stop",
- value: function stop() {
- this._signals.fire('stop', {
- interaction: this
- });
-
- this.interactable = this.element = null;
- this._interacting = false;
- this.prepared.name = this.prevEvent = null;
- }
- }, {
- key: "getPointerIndex",
- value: function getPointerIndex(pointer) {
- var pointerId = utils.pointer.getPointerId(pointer); // mouse and pen interactions may have only one pointer
-
- return this.pointerType === 'mouse' || this.pointerType === 'pen' ? this.pointers.length - 1 : utils.arr.findIndex(this.pointers, function (curPointer) {
- return curPointer.id === pointerId;
- });
- }
- }, {
- key: "getPointerInfo",
- value: function getPointerInfo(pointer) {
- return this.pointers[this.getPointerIndex(pointer)];
- }
- }, {
- key: "updatePointer",
- value: function updatePointer(pointer, event, eventTarget, down) {
- var id = utils.pointer.getPointerId(pointer);
- var pointerIndex = this.getPointerIndex(pointer);
- var pointerInfo = this.pointers[pointerIndex];
- down = down === false ? false : down || /(down|start)$/i.test(event.type);
-
- if (!pointerInfo) {
- pointerInfo = new _PointerInfo["default"](id, pointer, event, null, null);
- pointerIndex = this.pointers.length;
- this.pointers.push(pointerInfo);
- } else {
- pointerInfo.pointer = pointer;
- }
-
- if (down) {
- this.pointerIsDown = true;
-
- if (!this.interacting()) {
- utils.pointer.setCoords(this.coords.start, this.pointers.map(function (p) {
- return p.pointer;
- }), this._now());
- utils.pointer.copyCoords(this.coords.cur, this.coords.start);
- utils.pointer.copyCoords(this.coords.prev, this.coords.start);
- utils.pointer.pointerExtend(this.downPointer, pointer);
- this.downEvent = event;
- pointerInfo.downTime = this.coords.cur.timeStamp;
- pointerInfo.downTarget = eventTarget;
- this.pointerWasMoved = false;
- }
- }
-
- this._updateLatestPointer(pointer, event, eventTarget);
-
- this._signals.fire('update-pointer', {
- pointer: pointer,
- event: event,
- eventTarget: eventTarget,
- down: down,
- pointerInfo: pointerInfo,
- pointerIndex: pointerIndex,
- interaction: this
- });
-
- return pointerIndex;
- }
- }, {
- key: "removePointer",
- value: function removePointer(pointer, event) {
- var pointerIndex = this.getPointerIndex(pointer);
-
- if (pointerIndex === -1) {
- return;
- }
-
- var pointerInfo = this.pointers[pointerIndex];
-
- this._signals.fire('remove-pointer', {
- pointer: pointer,
- event: event,
- pointerIndex: pointerIndex,
- pointerInfo: pointerInfo,
- interaction: this
- });
-
- this.pointers.splice(pointerIndex, 1);
- }
- }, {
- key: "_updateLatestPointer",
- value: function _updateLatestPointer(pointer, event, eventTarget) {
- this._latestPointer.pointer = pointer;
- this._latestPointer.event = event;
- this._latestPointer.eventTarget = eventTarget;
- }
- }, {
- key: "destroy",
- value: function destroy() {
- this._latestPointer.pointer = null;
- this._latestPointer.event = null;
- this._latestPointer.eventTarget = null;
- }
- }, {
- key: "_createPreparedEvent",
- value: function _createPreparedEvent(event, phase, preEnd, type) {
- var actionName = this.prepared.name;
- return new _InteractEvent["default"](this, event, actionName, phase, this.element, null, preEnd, type);
- }
- }, {
- key: "_fireEvent",
- value: function _fireEvent(iEvent) {
- this.interactable.fire(iEvent);
-
- if (!this.prevEvent || iEvent.timeStamp >= this.prevEvent.timeStamp) {
- this.prevEvent = iEvent;
- }
- }
- }, {
- key: "_doPhase",
- value: function _doPhase(signalArg) {
- var event = signalArg.event,
- phase = signalArg.phase,
- preEnd = signalArg.preEnd,
- type = signalArg.type;
-
- var beforeResult = this._signals.fire("before-action-".concat(phase), signalArg);
-
- if (beforeResult === false) {
- return false;
- }
-
- var iEvent = signalArg.iEvent = this._createPreparedEvent(event, phase, preEnd, type);
-
- var rect = this.rect;
-
- if (rect) {
- // update the rect modifications
- var edges = this.edges || this.prepared.edges || {
- left: true,
- right: true,
- top: true,
- bottom: true
- };
-
- if (edges.top) {
- rect.top += iEvent.delta.y;
- }
-
- if (edges.bottom) {
- rect.bottom += iEvent.delta.y;
- }
-
- if (edges.left) {
- rect.left += iEvent.delta.x;
- }
-
- if (edges.right) {
- rect.right += iEvent.delta.x;
- }
-
- rect.width = rect.right - rect.left;
- rect.height = rect.bottom - rect.top;
- }
-
- this._signals.fire("action-".concat(phase), signalArg);
-
- this._fireEvent(iEvent);
-
- this._signals.fire("after-action-".concat(phase), signalArg);
-
- return true;
- }
- }, {
- key: "_now",
- value: function _now() {
- return Date.now();
- }
- }, {
- key: "pointerMoveTolerance",
- get: function get() {
- return 1;
- }
- }]);
-
- return Interaction;
- }();
-
- exports.Interaction = Interaction;
- var _default = Interaction;
- exports["default"] = _default;
-
- });
- var _$arr_46 = {};
- "use strict";
-
- Object.defineProperty(_$arr_46, "__esModule", {
- value: true
- });
- _$arr_46.contains = contains;
- _$arr_46.remove = remove;
- _$arr_46.merge = merge;
- _$arr_46.from = from;
- _$arr_46.findIndex = findIndex;
- _$arr_46.find = find;
-
- function contains(array, target) {
- return array.indexOf(target) !== -1;
- }
-
- function remove(array, target) {
- return array.splice(array.indexOf(target), 1);
- }
-
- function merge(target, source) {
- for (var _i = 0; _i < source.length; _i++) {
- var _ref;
-
- _ref = source[_i];
- var item = _ref;
- target.push(item);
- }
-
- return target;
- }
-
- function from(source) {
- return merge([], source);
- }
-
- function findIndex(array, func) {
- for (var i = 0; i < array.length; i++) {
- if (func(array[i], i, array)) {
- return i;
- }
- }
-
- return -1;
- }
-
- function find(array, func) {
- return array[findIndex(array, func)];
- }
-
- var _$domObjects_49 = {};
- "use strict";
-
- Object.defineProperty(_$domObjects_49, "__esModule", {
- value: true
- });
- _$domObjects_49["default"] = void 0;
- var domObjects = {
- init: init,
- document: null,
- DocumentFragment: null,
- SVGElement: null,
- SVGSVGElement: null,
- // eslint-disable-next-line no-undef
- SVGElementInstance: null,
- Element: null,
- HTMLElement: null,
- Event: null,
- Touch: null,
- PointerEvent: null
- };
-
- function blank() {}
-
- var _default = domObjects;
- _$domObjects_49["default"] = _default;
-
- function init(window) {
- var win = window;
- domObjects.document = win.document;
- domObjects.DocumentFragment = win.DocumentFragment || blank;
- domObjects.SVGElement = win.SVGElement || blank;
- domObjects.SVGSVGElement = win.SVGSVGElement || blank;
- domObjects.SVGElementInstance = win.SVGElementInstance || blank;
- domObjects.Element = win.Element || blank;
- domObjects.HTMLElement = win.HTMLElement || domObjects.Element;
- domObjects.Event = win.Event;
- domObjects.Touch = win.Touch || blank;
- domObjects.PointerEvent = win.PointerEvent || win.MSPointerEvent;
- }
-
- var _$isWindow_57 = {};
- "use strict";
-
- Object.defineProperty(_$isWindow_57, "__esModule", {
- value: true
- });
- _$isWindow_57["default"] = void 0;
-
- var ___default_57 = function _default(thing) {
- return !!(thing && thing.Window) && thing instanceof thing.Window;
- };
-
- _$isWindow_57["default"] = ___default_57;
-
- var _$window_65 = {};
- "use strict";
-
- Object.defineProperty(_$window_65, "__esModule", {
- value: true
- });
- _$window_65.init = __init_65;
- _$window_65.getWindow = getWindow;
- _$window_65["default"] = void 0;
-
- var _isWindow = _interopRequireDefault(_$isWindow_57);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- var win = {
- realWindow: undefined,
- window: undefined,
- getWindow: getWindow,
- init: __init_65
- };
-
- function __init_65(window) {
- // get wrapped window if using Shadow DOM polyfill
- win.realWindow = window; // create a TextNode
-
- var el = window.document.createTextNode(''); // check if it's wrapped by a polyfill
-
- if (el.ownerDocument !== window.document && typeof window.wrap === 'function' && window.wrap(el) === el) {
- // use wrapped window
- window = window.wrap(window);
- }
-
- win.window = window;
- }
-
- if (typeof window === 'undefined') {
- win.window = undefined;
- win.realWindow = undefined;
- } else {
- __init_65(window);
- }
-
- function getWindow(node) {
- if ((0, _isWindow["default"])(node)) {
- return node;
- }
-
- var rootNode = node.ownerDocument || node;
- return rootNode.defaultView || win.window;
- }
-
- win.init = __init_65;
- var ___default_65 = win;
- _$window_65["default"] = ___default_65;
-
- var _$is_56 = {};
- "use strict";
-
- Object.defineProperty(_$is_56, "__esModule", {
- value: true
- });
- _$is_56.array = _$is_56.plainObject = _$is_56.element = _$is_56.string = _$is_56.bool = _$is_56.number = _$is_56.func = _$is_56.object = _$is_56.docFrag = _$is_56.window = void 0;
-
- var ___isWindow_56 = ___interopRequireDefault_56(_$isWindow_57);
-
- var _window2 = ___interopRequireDefault_56(_$window_65);
-
- function ___interopRequireDefault_56(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
-
- var __window_56 = function window(thing) {
- return thing === _window2["default"].window || (0, ___isWindow_56["default"])(thing);
- };
-
- _$is_56.window = __window_56;
-
- var docFrag = function docFrag(thing) {
- return object(thing) && thing.nodeType === 11;
- };
-
- _$is_56.docFrag = docFrag;
-
- var object = function object(thing) {
- return !!thing && _typeof(thing) === 'object';
- };
-
- _$is_56.object = object;
-
- var func = function func(thing) {
- return typeof thing === 'function';
- };
-
- _$is_56.func = func;
-
- var number = function number(thing) {
- return typeof thing === 'number';
- };
-
- _$is_56.number = number;
-
- var bool = function bool(thing) {
- return typeof thing === 'boolean';
- };
-
- _$is_56.bool = bool;
-
- var string = function string(thing) {
- return typeof thing === 'string';
- };
-
- _$is_56.string = string;
-
- var element = function element(thing) {
- if (!thing || _typeof(thing) !== 'object') {
- return false;
- }
-
- var _window = _window2["default"].getWindow(thing) || _window2["default"].window;
-
- return /object|function/.test(_typeof(_window.Element)) ? thing instanceof _window.Element // DOM2
- : thing.nodeType === 1 && typeof thing.nodeName === 'string';
- };
-
- _$is_56.element = element;
-
- var plainObject = function plainObject(thing) {
- return object(thing) && !!thing.constructor && /function Object\b/.test(thing.constructor.toString());
- };
-
- _$is_56.plainObject = plainObject;
-
- var array = function array(thing) {
- return object(thing) && typeof thing.length !== 'undefined' && func(thing.splice);
- };
-
- _$is_56.array = array;
-
- var _$browser_47 = {};
- "use strict";
-
- Object.defineProperty(_$browser_47, "__esModule", {
- value: true
- });
- _$browser_47["default"] = void 0;
-
- var _domObjects = ___interopRequireDefault_47(_$domObjects_49);
-
- var is = _interopRequireWildcard(_$is_56);
-
- var _window = ___interopRequireDefault_47(_$window_65);
-
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
-
- function ___interopRequireDefault_47(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- var browser = {
- init: __init_47,
- supportsTouch: null,
- supportsPointerEvent: null,
- isIOS7: null,
- isIOS: null,
- isIe9: null,
- isOperaMobile: null,
- prefixedMatchesSelector: null,
- pEventTypes: null,
- wheelEvent: null
- };
-
- function __init_47(window) {
- var Element = _domObjects["default"].Element;
- var navigator = _window["default"].window.navigator; // Does the browser support touch input?
-
- browser.supportsTouch = 'ontouchstart' in window || is.func(window.DocumentTouch) && _domObjects["default"].document instanceof window.DocumentTouch; // Does the browser support PointerEvents
-
- browser.supportsPointerEvent = navigator.pointerEnabled !== false && !!_domObjects["default"].PointerEvent;
- browser.isIOS = /iP(hone|od|ad)/.test(navigator.platform); // scrolling doesn't change the result of getClientRects on iOS 7
-
- browser.isIOS7 = /iP(hone|od|ad)/.test(navigator.platform) && /OS 7[^\d]/.test(navigator.appVersion);
- browser.isIe9 = /MSIE 9/.test(navigator.userAgent); // Opera Mobile must be handled differently
-
- browser.isOperaMobile = navigator.appName === 'Opera' && browser.supportsTouch && /Presto/.test(navigator.userAgent); // prefix matchesSelector
-
- browser.prefixedMatchesSelector = 'matches' in Element.prototype ? 'matches' : 'webkitMatchesSelector' in Element.prototype ? 'webkitMatchesSelector' : 'mozMatchesSelector' in Element.prototype ? 'mozMatchesSelector' : 'oMatchesSelector' in Element.prototype ? 'oMatchesSelector' : 'msMatchesSelector';
- browser.pEventTypes = browser.supportsPointerEvent ? _domObjects["default"].PointerEvent === window.MSPointerEvent ? {
- up: 'MSPointerUp',
- down: 'MSPointerDown',
- over: 'mouseover',
- out: 'mouseout',
- move: 'MSPointerMove',
- cancel: 'MSPointerCancel'
- } : {
- up: 'pointerup',
- down: 'pointerdown',
- over: 'pointerover',
- out: 'pointerout',
- move: 'pointermove',
- cancel: 'pointercancel'
- } : null; // because Webkit and Opera still use 'mousewheel' event type
-
- browser.wheelEvent = 'onmousewheel' in _domObjects["default"].document ? 'mousewheel' : 'wheel';
- }
-
- var ___default_47 = browser;
- _$browser_47["default"] = ___default_47;
-
- var _$domUtils_50 = {};
- "use strict";
-
- Object.defineProperty(_$domUtils_50, "__esModule", {
- value: true
- });
- _$domUtils_50.nodeContains = nodeContains;
- _$domUtils_50.closest = closest;
- _$domUtils_50.parentNode = parentNode;
- _$domUtils_50.matchesSelector = matchesSelector;
- _$domUtils_50.indexOfDeepestElement = indexOfDeepestElement;
- _$domUtils_50.matchesUpTo = matchesUpTo;
- _$domUtils_50.getActualElement = getActualElement;
- _$domUtils_50.getScrollXY = getScrollXY;
- _$domUtils_50.getElementClientRect = getElementClientRect;
- _$domUtils_50.getElementRect = getElementRect;
- _$domUtils_50.getPath = getPath;
- _$domUtils_50.trySelector = trySelector;
-
- var _browser = ___interopRequireDefault_50(_$browser_47);
-
- var ___domObjects_50 = ___interopRequireDefault_50(_$domObjects_49);
-
- var __is_50 = ___interopRequireWildcard_50(_$is_56);
-
- var ___window_50 = ___interopRequireDefault_50(_$window_65);
-
- function ___interopRequireWildcard_50(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
-
- function ___interopRequireDefault_50(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- function nodeContains(parent, child) {
- while (child) {
- if (child === parent) {
- return true;
- }
-
- child = child.parentNode;
- }
-
- return false;
- }
-
- function closest(element, selector) {
- while (__is_50.element(element)) {
- if (matchesSelector(element, selector)) {
- return element;
- }
-
- element = parentNode(element);
- }
-
- return null;
- }
-
- function parentNode(node) {
- var parent = node.parentNode;
-
- if (__is_50.docFrag(parent)) {
- // skip past #shado-root fragments
- // tslint:disable-next-line
- while ((parent = parent.host) && __is_50.docFrag(parent)) {
- continue;
- }
-
- return parent;
- }
-
- return parent;
- }
-
- function matchesSelector(element, selector) {
- // remove /deep/ from selectors if shadowDOM polyfill is used
- if (___window_50["default"].window !== ___window_50["default"].realWindow) {
- selector = selector.replace(/\/deep\//g, ' ');
- }
-
- return element[_browser["default"].prefixedMatchesSelector](selector);
- }
-
- var getParent = function getParent(el) {
- return el.parentNode ? el.parentNode : el.host;
- }; // Test for the element that's "above" all other qualifiers
-
-
- function indexOfDeepestElement(elements) {
- var deepestZoneParents = [];
- var dropzoneParents = [];
- var dropzone;
- var deepestZone = elements[0];
- var index = deepestZone ? 0 : -1;
- var parent;
- var child;
- var i;
- var n;
-
- for (i = 1; i < elements.length; i++) {
- dropzone = elements[i]; // an element might belong to multiple selector dropzones
-
- if (!dropzone || dropzone === deepestZone) {
- continue;
- }
-
- if (!deepestZone) {
- deepestZone = dropzone;
- index = i;
- continue;
- } // check if the deepest or current are document.documentElement or document.rootElement
- // - if the current dropzone is, do nothing and continue
-
-
- if (dropzone.parentNode === dropzone.ownerDocument) {
- continue;
- } // - if deepest is, update with the current dropzone and continue to next
- else if (deepestZone.parentNode === dropzone.ownerDocument) {
- deepestZone = dropzone;
- index = i;
- continue;
- }
-
- if (!deepestZoneParents.length) {
- parent = deepestZone;
-
- while (getParent(parent) && getParent(parent) !== parent.ownerDocument) {
- deepestZoneParents.unshift(parent);
- parent = getParent(parent);
- }
- } // if this element is an svg element and the current deepest is
- // an HTMLElement
-
-
- if (deepestZone instanceof ___domObjects_50["default"].HTMLElement && dropzone instanceof ___domObjects_50["default"].SVGElement && !(dropzone instanceof ___domObjects_50["default"].SVGSVGElement)) {
- if (dropzone === deepestZone.parentNode) {
- continue;
- }
-
- parent = dropzone.ownerSVGElement;
- } else {
- parent = dropzone;
- }
-
- dropzoneParents = [];
-
- while (parent.parentNode !== parent.ownerDocument) {
- dropzoneParents.unshift(parent);
- parent = getParent(parent);
- }
-
- n = 0; // get (position of last common ancestor) + 1
-
- while (dropzoneParents[n] && dropzoneParents[n] === deepestZoneParents[n]) {
- n++;
- }
-
- var parents = [dropzoneParents[n - 1], dropzoneParents[n], deepestZoneParents[n]];
- child = parents[0].lastChild;
-
- while (child) {
- if (child === parents[1]) {
- deepestZone = dropzone;
- index = i;
- deepestZoneParents = [];
- break;
- } else if (child === parents[2]) {
- break;
- }
-
- child = child.previousSibling;
- }
- }
-
- return index;
- }
-
- function matchesUpTo(element, selector, limit) {
- while (__is_50.element(element)) {
- if (matchesSelector(element, selector)) {
- return true;
- }
-
- element = parentNode(element);
-
- if (element === limit) {
- return matchesSelector(element, selector);
- }
- }
-
- return false;
- }
-
- function getActualElement(element) {
- return element instanceof ___domObjects_50["default"].SVGElementInstance ? element.correspondingUseElement : element;
- }
-
- function getScrollXY(relevantWindow) {
- relevantWindow = relevantWindow || ___window_50["default"].window;
- return {
- x: relevantWindow.scrollX || relevantWindow.document.documentElement.scrollLeft,
- y: relevantWindow.scrollY || relevantWindow.document.documentElement.scrollTop
- };
- }
-
- function getElementClientRect(element) {
- var clientRect = element instanceof ___domObjects_50["default"].SVGElement ? element.getBoundingClientRect() : element.getClientRects()[0];
- return clientRect && {
- left: clientRect.left,
- right: clientRect.right,
- top: clientRect.top,
- bottom: clientRect.bottom,
- width: clientRect.width || clientRect.right - clientRect.left,
- height: clientRect.height || clientRect.bottom - clientRect.top
- };
- }
-
- function getElementRect(element) {
- var clientRect = getElementClientRect(element);
-
- if (!_browser["default"].isIOS7 && clientRect) {
- var scroll = getScrollXY(___window_50["default"].getWindow(element));
- clientRect.left += scroll.x;
- clientRect.right += scroll.x;
- clientRect.top += scroll.y;
- clientRect.bottom += scroll.y;
- }
-
- return clientRect;
- }
-
- function getPath(node) {
- var path = [];
-
- while (node) {
- path.push(node);
- node = parentNode(node);
- }
-
- return path;
- }
-
- function trySelector(value) {
- if (!__is_50.string(value)) {
- return false;
- } // an exception will be raised if it is invalid
-
-
- ___domObjects_50["default"].document.querySelector(value);
-
- return true;
- }
-
- var _$clone_48 = {};
- "use strict";
-
- Object.defineProperty(_$clone_48, "__esModule", {
- value: true
- });
- _$clone_48["default"] = clone;
-
- var arr = ___interopRequireWildcard_48(_$arr_46);
-
- var __is_48 = ___interopRequireWildcard_48(_$is_56);
-
- function ___interopRequireWildcard_48(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
-
- function clone(source) {
- var dest = {};
-
- for (var prop in source) {
- var value = source[prop];
-
- if (__is_48.plainObject(value)) {
- dest[prop] = clone(value);
- } else if (__is_48.array(value)) {
- dest[prop] = arr.from(value);
- } else {
- dest[prop] = value;
- }
- }
-
- return dest;
- }
-
- var _$pointerExtend_59 = {};
- "use strict";
-
- Object.defineProperty(_$pointerExtend_59, "__esModule", {
- value: true
- });
- _$pointerExtend_59["default"] = void 0;
-
- function pointerExtend(dest, source) {
- for (var prop in source) {
- var prefixedPropREs = pointerExtend.prefixedPropREs;
- var deprecated = false; // skip deprecated prefixed properties
-
- for (var vendor in prefixedPropREs) {
- if (prop.indexOf(vendor) === 0 && prefixedPropREs[vendor].test(prop)) {
- deprecated = true;
- break;
- }
- }
-
- if (!deprecated && typeof source[prop] !== 'function') {
- dest[prop] = source[prop];
- }
- }
-
- return dest;
- }
-
- pointerExtend.prefixedPropREs = {
- webkit: /(Movement[XY]|Radius[XY]|RotationAngle|Force)$/
- };
- var ___default_59 = pointerExtend;
- _$pointerExtend_59["default"] = ___default_59;
-
- var _$hypot_54 = {};
- "use strict";
-
- Object.defineProperty(_$hypot_54, "__esModule", {
- value: true
- });
- _$hypot_54["default"] = void 0;
-
- var ___default_54 = function _default(x, y) {
- return Math.sqrt(x * x + y * y);
- };
-
- _$hypot_54["default"] = ___default_54;
-
- var _$pointerUtils_60 = {};
- "use strict";
-
- Object.defineProperty(_$pointerUtils_60, "__esModule", {
- value: true
- });
- _$pointerUtils_60["default"] = void 0;
-
- var ___browser_60 = ___interopRequireDefault_60(_$browser_47);
-
- var ___domObjects_60 = ___interopRequireDefault_60(_$domObjects_49);
-
- var domUtils = ___interopRequireWildcard_60(_$domUtils_50);
-
- var _hypot = ___interopRequireDefault_60(_$hypot_54);
-
- var __is_60 = ___interopRequireWildcard_60(_$is_56);
-
- var _pointerExtend = ___interopRequireDefault_60(_$pointerExtend_59);
-
- function ___interopRequireWildcard_60(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
-
- function ___interopRequireDefault_60(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- var pointerUtils = {
- copyCoords: function copyCoords(dest, src) {
- dest.page = dest.page || {};
- dest.page.x = src.page.x;
- dest.page.y = src.page.y;
- dest.client = dest.client || {};
- dest.client.x = src.client.x;
- dest.client.y = src.client.y;
- dest.timeStamp = src.timeStamp;
- },
- setCoordDeltas: function setCoordDeltas(targetObj, prev, cur) {
- targetObj.page.x = cur.page.x - prev.page.x;
- targetObj.page.y = cur.page.y - prev.page.y;
- targetObj.client.x = cur.client.x - prev.client.x;
- targetObj.client.y = cur.client.y - prev.client.y;
- targetObj.timeStamp = cur.timeStamp - prev.timeStamp;
- },
- setCoordVelocity: function setCoordVelocity(targetObj, delta) {
- var dt = Math.max(delta.timeStamp / 1000, 0.001);
- targetObj.page.x = delta.page.x / dt;
- targetObj.page.y = delta.page.y / dt;
- targetObj.client.x = delta.client.x / dt;
- targetObj.client.y = delta.client.y / dt;
- targetObj.timeStamp = dt;
- },
- isNativePointer: function isNativePointer(pointer) {
- return pointer instanceof ___domObjects_60["default"].Event || pointer instanceof ___domObjects_60["default"].Touch;
- },
- // Get specified X/Y coords for mouse or event.touches[0]
- getXY: function getXY(type, pointer, xy) {
- xy = xy || {};
- type = type || 'page';
- xy.x = pointer[type + 'X'];
- xy.y = pointer[type + 'Y'];
- return xy;
- },
- getPageXY: function getPageXY(pointer, page) {
- page = page || {
- x: 0,
- y: 0
- }; // Opera Mobile handles the viewport and scrolling oddly
-
- if (___browser_60["default"].isOperaMobile && pointerUtils.isNativePointer(pointer)) {
- pointerUtils.getXY('screen', pointer, page);
- page.x += window.scrollX;
- page.y += window.scrollY;
- } else {
- pointerUtils.getXY('page', pointer, page);
- }
-
- return page;
- },
- getClientXY: function getClientXY(pointer, client) {
- client = client || {};
-
- if (___browser_60["default"].isOperaMobile && pointerUtils.isNativePointer(pointer)) {
- // Opera Mobile handles the viewport and scrolling oddly
- pointerUtils.getXY('screen', pointer, client);
- } else {
- pointerUtils.getXY('client', pointer, client);
- }
-
- return client;
- },
- getPointerId: function getPointerId(pointer) {
- return __is_60.number(pointer.pointerId) ? pointer.pointerId : pointer.identifier;
- },
- setCoords: function setCoords(targetObj, pointers, timeStamp) {
- var pointer = pointers.length > 1 ? pointerUtils.pointerAverage(pointers) : pointers[0];
- var tmpXY = {};
- pointerUtils.getPageXY(pointer, tmpXY);
- targetObj.page.x = tmpXY.x;
- targetObj.page.y = tmpXY.y;
- pointerUtils.getClientXY(pointer, tmpXY);
- targetObj.client.x = tmpXY.x;
- targetObj.client.y = tmpXY.y;
- targetObj.timeStamp = timeStamp;
- },
- pointerExtend: _pointerExtend["default"],
- getTouchPair: function getTouchPair(event) {
- var touches = []; // array of touches is supplied
-
- if (__is_60.array(event)) {
- touches[0] = event[0];
- touches[1] = event[1];
- } // an event
- else {
- if (event.type === 'touchend') {
- if (event.touches.length === 1) {
- touches[0] = event.touches[0];
- touches[1] = event.changedTouches[0];
- } else if (event.touches.length === 0) {
- touches[0] = event.changedTouches[0];
- touches[1] = event.changedTouches[1];
- }
- } else {
- touches[0] = event.touches[0];
- touches[1] = event.touches[1];
- }
- }
-
- return touches;
- },
- pointerAverage: function pointerAverage(pointers) {
- var average = {
- pageX: 0,
- pageY: 0,
- clientX: 0,
- clientY: 0,
- screenX: 0,
- screenY: 0
- };
-
- for (var _i = 0; _i < pointers.length; _i++) {
- var _ref;
-
- _ref = pointers[_i];
- var pointer = _ref;
-
- for (var _prop in average) {
- average[_prop] += pointer[_prop];
- }
- }
-
- for (var prop in average) {
- average[prop] /= pointers.length;
- }
-
- return average;
- },
- touchBBox: function touchBBox(event) {
- if (!event.length && !(event.touches && event.touches.length > 1)) {
- return null;
- }
-
- var touches = pointerUtils.getTouchPair(event);
- var minX = Math.min(touches[0].pageX, touches[1].pageX);
- var minY = Math.min(touches[0].pageY, touches[1].pageY);
- var maxX = Math.max(touches[0].pageX, touches[1].pageX);
- var maxY = Math.max(touches[0].pageY, touches[1].pageY);
- return {
- x: minX,
- y: minY,
- left: minX,
- top: minY,
- right: maxX,
- bottom: maxY,
- width: maxX - minX,
- height: maxY - minY
- };
- },
- touchDistance: function touchDistance(event, deltaSource) {
- var sourceX = deltaSource + 'X';
- var sourceY = deltaSource + 'Y';
- var touches = pointerUtils.getTouchPair(event);
- var dx = touches[0][sourceX] - touches[1][sourceX];
- var dy = touches[0][sourceY] - touches[1][sourceY];
- return (0, _hypot["default"])(dx, dy);
- },
- touchAngle: function touchAngle(event, deltaSource) {
- var sourceX = deltaSource + 'X';
- var sourceY = deltaSource + 'Y';
- var touches = pointerUtils.getTouchPair(event);
- var dx = touches[1][sourceX] - touches[0][sourceX];
- var dy = touches[1][sourceY] - touches[0][sourceY];
- var angle = 180 * Math.atan2(dy, dx) / Math.PI;
- return angle;
- },
- getPointerType: function getPointerType(pointer) {
- return __is_60.string(pointer.pointerType) ? pointer.pointerType : __is_60.number(pointer.pointerType) ? [undefined, undefined, 'touch', 'pen', 'mouse'][pointer.pointerType] // if the PointerEvent API isn't available, then the "pointer" must
- // be either a MouseEvent, TouchEvent, or Touch object
- : /touch/.test(pointer.type) || pointer instanceof ___domObjects_60["default"].Touch ? 'touch' : 'mouse';
- },
- // [ event.target, event.currentTarget ]
- getEventTargets: function getEventTargets(event) {
- var path = __is_60.func(event.composedPath) ? event.composedPath() : event.path;
- return [domUtils.getActualElement(path ? path[0] : event.target), domUtils.getActualElement(event.currentTarget)];
- },
- newCoords: function newCoords() {
- return {
- page: {
- x: 0,
- y: 0
- },
- client: {
- x: 0,
- y: 0
- },
- timeStamp: 0
- };
- },
- coordsToEvent: function coordsToEvent(coords) {
- var event = {
- coords: coords,
-
- get page() {
- return this.coords.page;
- },
-
- get client() {
- return this.coords.client;
- },
-
- get timeStamp() {
- return this.coords.timeStamp;
- },
-
- get pageX() {
- return this.coords.page.x;
- },
-
- get pageY() {
- return this.coords.page.y;
- },
-
- get clientX() {
- return this.coords.client.x;
- },
-
- get clientY() {
- return this.coords.client.y;
- },
-
- get pointerId() {
- return this.coords.pointerId;
- },
-
- get target() {
- return this.coords.target;
- },
-
- get type() {
- return this.coords.type;
- },
-
- get pointerType() {
- return this.coords.pointerType;
- }
-
- };
- return event;
- }
- };
- var ___default_60 = pointerUtils;
- _$pointerUtils_60["default"] = ___default_60;
-
- var _$events_51 = {};
- "use strict";
-
- Object.defineProperty(_$events_51, "__esModule", {
- value: true
- });
- _$events_51["default"] = _$events_51.FakeEvent = void 0;
-
- /* removed: var _$arr_46 = require("./arr"); */;
-
- var __domUtils_51 = ___interopRequireWildcard_51(_$domUtils_50);
-
- var __is_51 = ___interopRequireWildcard_51(_$is_56);
-
- var ___pointerExtend_51 = ___interopRequireDefault_51(_$pointerExtend_59);
-
- var _pointerUtils = ___interopRequireDefault_51(_$pointerUtils_60);
-
- function ___interopRequireDefault_51(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- function ___interopRequireWildcard_51(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
-
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
-
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
-
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
-
- function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
-
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
-
- var elements = [];
- var targets = [];
- var delegatedEvents = {};
- var documents = [];
-
- function add(element, type, listener, optionalArg) {
- var options = getOptions(optionalArg);
- var elementIndex = elements.indexOf(element);
- var target = targets[elementIndex];
-
- if (!target) {
- target = {
- events: {},
- typeCount: 0
- };
- elementIndex = elements.push(element) - 1;
- targets.push(target);
- }
-
- if (!target.events[type]) {
- target.events[type] = [];
- target.typeCount++;
- }
-
- if (!(0, _$arr_46.contains)(target.events[type], listener)) {
- element.addEventListener(type, listener, events.supportsOptions ? options : !!options.capture);
- target.events[type].push(listener);
- }
- }
-
- function __remove_51(element, type, listener, optionalArg) {
- var options = getOptions(optionalArg);
- var elementIndex = elements.indexOf(element);
- var target = targets[elementIndex];
-
- if (!target || !target.events) {
- return;
- }
-
- if (type === 'all') {
- for (type in target.events) {
- if (target.events.hasOwnProperty(type)) {
- __remove_51(element, type, 'all');
- }
- }
-
- return;
- }
-
- if (target.events[type]) {
- var len = target.events[type].length;
-
- if (listener === 'all') {
- for (var i = 0; i < len; i++) {
- __remove_51(element, type, target.events[type][i], options);
- }
-
- return;
- } else {
- for (var _i = 0; _i < len; _i++) {
- if (target.events[type][_i] === listener) {
- element.removeEventListener(type, listener, events.supportsOptions ? options : !!options.capture);
- target.events[type].splice(_i, 1);
- break;
- }
- }
- }
-
- if (target.events[type] && target.events[type].length === 0) {
- target.events[type] = null;
- target.typeCount--;
- }
- }
-
- if (!target.typeCount) {
- targets.splice(elementIndex, 1);
- elements.splice(elementIndex, 1);
- }
- }
-
- function addDelegate(selector, context, type, listener, optionalArg) {
- var options = getOptions(optionalArg);
-
- if (!delegatedEvents[type]) {
- delegatedEvents[type] = {
- contexts: [],
- listeners: [],
- selectors: []
- }; // add delegate listener functions
-
- for (var _i2 = 0; _i2 < documents.length; _i2++) {
- var doc = documents[_i2];
- add(doc, type, delegateListener);
- add(doc, type, delegateUseCapture, true);
- }
- }
-
- var delegated = delegatedEvents[type];
- var index;
-
- for (index = delegated.selectors.length - 1; index >= 0; index--) {
- if (delegated.selectors[index] === selector && delegated.contexts[index] === context) {
- break;
- }
- }
-
- if (index === -1) {
- index = delegated.selectors.length;
- delegated.selectors.push(selector);
- delegated.contexts.push(context);
- delegated.listeners.push([]);
- } // keep listener and capture and passive flags
-
-
- delegated.listeners[index].push([listener, !!options.capture, options.passive]);
- }
-
- function removeDelegate(selector, context, type, listener, optionalArg) {
- var options = getOptions(optionalArg);
- var delegated = delegatedEvents[type];
- var matchFound = false;
- var index;
-
- if (!delegated) {
- return;
- } // count from last index of delegated to 0
-
-
- for (index = delegated.selectors.length - 1; index >= 0; index--) {
- // look for matching selector and context Node
- if (delegated.selectors[index] === selector && delegated.contexts[index] === context) {
- var listeners = delegated.listeners[index]; // each item of the listeners array is an array: [function, capture, passive]
-
- for (var i = listeners.length - 1; i >= 0; i--) {
- var _listeners$i = _slicedToArray(listeners[i], 3),
- fn = _listeners$i[0],
- capture = _listeners$i[1],
- passive = _listeners$i[2]; // check if the listener functions and capture and passive flags match
-
-
- if (fn === listener && capture === !!options.capture && passive === options.passive) {
- // remove the listener from the array of listeners
- listeners.splice(i, 1); // if all listeners for this interactable have been removed
- // remove the interactable from the delegated arrays
-
- if (!listeners.length) {
- delegated.selectors.splice(index, 1);
- delegated.contexts.splice(index, 1);
- delegated.listeners.splice(index, 1); // remove delegate function from context
-
- __remove_51(context, type, delegateListener);
- __remove_51(context, type, delegateUseCapture, true); // remove the arrays if they are empty
-
- if (!delegated.selectors.length) {
- delegatedEvents[type] = null;
- }
- } // only remove one listener
-
-
- matchFound = true;
- break;
- }
- }
-
- if (matchFound) {
- break;
- }
- }
- }
- } // bound to the interactable context when a DOM event
- // listener is added to a selector interactable
-
-
- function delegateListener(event, optionalArg) {
- var options = getOptions(optionalArg);
- var fakeEvent = new FakeEvent(event);
- var delegated = delegatedEvents[event.type];
-
- var _pointerUtils$getEven = _pointerUtils["default"].getEventTargets(event),
- _pointerUtils$getEven2 = _slicedToArray(_pointerUtils$getEven, 1),
- eventTarget = _pointerUtils$getEven2[0];
-
- var element = eventTarget; // climb up document tree looking for selector matches
-
- while (__is_51.element(element)) {
- for (var i = 0; i < delegated.selectors.length; i++) {
- var selector = delegated.selectors[i];
- var context = delegated.contexts[i];
-
- if (__domUtils_51.matchesSelector(element, selector) && __domUtils_51.nodeContains(context, eventTarget) && __domUtils_51.nodeContains(context, element)) {
- var listeners = delegated.listeners[i];
- fakeEvent.currentTarget = element;
-
- for (var _i3 = 0; _i3 < listeners.length; _i3++) {
- var _ref;
-
- _ref = listeners[_i3];
-
- var _ref2 = _ref,
- _ref3 = _slicedToArray(_ref2, 3),
- fn = _ref3[0],
- capture = _ref3[1],
- passive = _ref3[2];
-
- if (capture === !!options.capture && passive === options.passive) {
- fn(fakeEvent);
- }
- }
- }
- }
-
- element = __domUtils_51.parentNode(element);
- }
- }
-
- function delegateUseCapture(event) {
- return delegateListener.call(this, event, true);
- }
-
- function getOptions(param) {
- return __is_51.object(param) ? param : {
- capture: param
- };
- }
-
- var FakeEvent =
- /*#__PURE__*/
- function () {
- function FakeEvent(originalEvent) {
- _classCallCheck(this, FakeEvent);
-
- this.originalEvent = originalEvent; // duplicate the event so that currentTarget can be changed
-
- (0, ___pointerExtend_51["default"])(this, originalEvent);
- }
-
- _createClass(FakeEvent, [{
- key: "preventOriginalDefault",
- value: function preventOriginalDefault() {
- this.originalEvent.preventDefault();
- }
- }, {
- key: "stopPropagation",
- value: function stopPropagation() {
- this.originalEvent.stopPropagation();
- }
- }, {
- key: "stopImmediatePropagation",
- value: function stopImmediatePropagation() {
- this.originalEvent.stopImmediatePropagation();
- }
- }]);
-
- return FakeEvent;
- }();
-
- _$events_51.FakeEvent = FakeEvent;
- var events = {
- add: add,
- remove: __remove_51,
- addDelegate: addDelegate,
- removeDelegate: removeDelegate,
- delegateListener: delegateListener,
- delegateUseCapture: delegateUseCapture,
- delegatedEvents: delegatedEvents,
- documents: documents,
- supportsOptions: false,
- supportsPassive: false,
- _elements: elements,
- _targets: targets,
- init: function init(window) {
- window.document.createElement('div').addEventListener('test', null, {
- get capture() {
- return events.supportsOptions = true;
- },
-
- get passive() {
- return events.supportsPassive = true;
- }
-
- });
- }
- };
- var ___default_51 = events;
- _$events_51["default"] = ___default_51;
-
- var _$extend_52 = {};
- "use strict";
-
- Object.defineProperty(_$extend_52, "__esModule", {
- value: true
- });
- _$extend_52["default"] = extend;
-
- function extend(dest, source) {
- for (var prop in source) {
- dest[prop] = source[prop];
- }
-
- return dest;
- }
-
- var _$rect_62 = {};
- "use strict";
-
- Object.defineProperty(_$rect_62, "__esModule", {
- value: true
- });
- _$rect_62.getStringOptionResult = getStringOptionResult;
- _$rect_62.resolveRectLike = resolveRectLike;
- _$rect_62.rectToXY = rectToXY;
- _$rect_62.xywhToTlbr = xywhToTlbr;
- _$rect_62.tlbrToXywh = tlbrToXywh;
- _$rect_62["default"] = void 0;
-
- /* removed: var _$domUtils_50 = require("./domUtils"); */;
-
- var _extend = ___interopRequireDefault_62(_$extend_52);
-
- var __is_62 = ___interopRequireWildcard_62(_$is_56);
-
- function ___interopRequireWildcard_62(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
-
- function ___interopRequireDefault_62(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- function getStringOptionResult(value, interactable, element) {
- if (!__is_62.string(value)) {
- return null;
- }
-
- if (value === 'parent') {
- value = (0, _$domUtils_50.parentNode)(element);
- } else if (value === 'self') {
- value = interactable.getRect(element);
- } else {
- value = (0, _$domUtils_50.closest)(element, value);
- }
-
- return value;
- }
-
- function resolveRectLike(value, interactable, element, functionArgs) {
- value = getStringOptionResult(value, interactable, element) || value;
-
- if (__is_62.func(value)) {
- value = value.apply(null, functionArgs);
- }
-
- if (__is_62.element(value)) {
- value = (0, _$domUtils_50.getElementRect)(value);
- }
-
- return value;
- }
-
- function rectToXY(rect) {
- return rect && {
- x: 'x' in rect ? rect.x : rect.left,
- y: 'y' in rect ? rect.y : rect.top
- };
- }
-
- function xywhToTlbr(rect) {
- if (rect && !('left' in rect && 'top' in rect)) {
- rect = (0, _extend["default"])({}, rect);
- rect.left = rect.x || 0;
- rect.top = rect.y || 0;
- rect.right = rect.right || rect.left + rect.width;
- rect.bottom = rect.bottom || rect.top + rect.height;
- }
-
- return rect;
- }
-
- function tlbrToXywh(rect) {
- if (rect && !('x' in rect && 'y' in rect)) {
- rect = (0, _extend["default"])({}, rect);
- rect.x = rect.left || 0;
- rect.y = rect.top || 0;
- rect.width = rect.width || rect.right - rect.x;
- rect.height = rect.height || rect.bottom - rect.y;
- }
-
- return rect;
- }
-
- var ___default_62 = {
- getStringOptionResult: getStringOptionResult,
- resolveRectLike: resolveRectLike,
- rectToXY: rectToXY,
- xywhToTlbr: xywhToTlbr,
- tlbrToXywh: tlbrToXywh
- };
- _$rect_62["default"] = ___default_62;
-
- var _$getOriginXY_53 = {};
- "use strict";
-
- Object.defineProperty(_$getOriginXY_53, "__esModule", {
- value: true
- });
- _$getOriginXY_53["default"] = ___default_53;
-
- /* removed: var _$rect_62 = require("./rect"); */;
-
- function ___default_53(target, element, action) {
- var actionOptions = target.options[action];
- var actionOrigin = actionOptions && actionOptions.origin;
- var origin = actionOrigin || target.options.origin;
- var originRect = (0, _$rect_62.resolveRectLike)(origin, target, element, [target && element]);
- return (0, _$rect_62.rectToXY)(originRect) || {
- x: 0,
- y: 0
- };
- }
-
- var _$normalizeListeners_58 = {};
- "use strict";
-
- Object.defineProperty(_$normalizeListeners_58, "__esModule", {
- value: true
- });
- _$normalizeListeners_58["default"] = normalize;
-
- var ___extend_58 = ___interopRequireDefault_58(_$extend_52);
-
- var __is_58 = ___interopRequireWildcard_58(_$is_56);
-
- function ___interopRequireWildcard_58(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
-
- function ___interopRequireDefault_58(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- function normalize(type, listeners, result) {
- result = result || {};
-
- if (__is_58.string(type) && type.search(' ') !== -1) {
- type = split(type);
- }
-
- if (__is_58.array(type)) {
- return type.reduce(function (acc, t) {
- return (0, ___extend_58["default"])(acc, normalize(t, listeners, result));
- }, result);
- } // ({ type: fn }) -> ('', { type: fn })
-
-
- if (__is_58.object(type)) {
- listeners = type;
- type = '';
- }
-
- if (__is_58.func(listeners)) {
- result[type] = result[type] || [];
- result[type].push(listeners);
- } else if (__is_58.array(listeners)) {
- for (var _i = 0; _i < listeners.length; _i++) {
- var _ref;
-
- _ref = listeners[_i];
- var l = _ref;
- normalize(type, l, result);
- }
- } else if (__is_58.object(listeners)) {
- for (var prefix in listeners) {
- var combinedTypes = split(prefix).map(function (p) {
- return "".concat(type).concat(p);
- });
- normalize(combinedTypes, listeners[prefix], result);
- }
- }
-
- return result;
- }
-
- function split(type) {
- return type.trim().split(/ +/);
- }
-
- var _$raf_61 = {};
- "use strict";
-
- Object.defineProperty(_$raf_61, "__esModule", {
- value: true
- });
- _$raf_61["default"] = void 0;
- var lastTime = 0;
-
- var _request;
-
- var _cancel;
-
- function __init_61(window) {
- _request = window.requestAnimationFrame;
- _cancel = window.cancelAnimationFrame;
-
- if (!_request) {
- var vendors = ['ms', 'moz', 'webkit', 'o'];
-
- for (var _i = 0; _i < vendors.length; _i++) {
- var vendor = vendors[_i];
- _request = window["".concat(vendor, "RequestAnimationFrame")];
- _cancel = window["".concat(vendor, "CancelAnimationFrame")] || window["".concat(vendor, "CancelRequestAnimationFrame")];
- }
- }
-
- if (!_request) {
- _request = function request(callback) {
- var currTime = Date.now();
- var timeToCall = Math.max(0, 16 - (currTime - lastTime)); // eslint-disable-next-line standard/no-callback-literal
-
- var token = setTimeout(function () {
- callback(currTime + timeToCall);
- }, timeToCall);
- lastTime = currTime + timeToCall;
- return token;
- };
-
- _cancel = function cancel(token) {
- return clearTimeout(token);
- };
- }
- }
-
- var ___default_61 = {
- request: function request(callback) {
- return _request(callback);
- },
- cancel: function cancel(token) {
- return _cancel(token);
- },
- init: __init_61
- };
- _$raf_61["default"] = ___default_61;
-
- var _$Signals_45 = {};
- "use strict";
-
- Object.defineProperty(_$Signals_45, "__esModule", {
- value: true
- });
- _$Signals_45["default"] = void 0;
-
- function ___classCallCheck_45(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function ___defineProperties_45(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
-
- function ___createClass_45(Constructor, protoProps, staticProps) { if (protoProps) ___defineProperties_45(Constructor.prototype, protoProps); if (staticProps) ___defineProperties_45(Constructor, staticProps); return Constructor; }
-
- var Signals =
- /*#__PURE__*/
- function () {
- function Signals() {
- ___classCallCheck_45(this, Signals);
-
- this.listeners = {};
- }
-
- ___createClass_45(Signals, [{
- key: "on",
- value: function on(name, listener) {
- if (!this.listeners[name]) {
- this.listeners[name] = [listener];
- return;
- }
-
- this.listeners[name].push(listener);
- }
- }, {
- key: "off",
- value: function off(name, listener) {
- if (!this.listeners[name]) {
- return;
- }
-
- var index = this.listeners[name].indexOf(listener);
-
- if (index !== -1) {
- this.listeners[name].splice(index, 1);
- }
- }
- }, {
- key: "fire",
- value: function fire(name, arg) {
- var targetListeners = this.listeners[name];
-
- if (!targetListeners) {
- return;
- }
-
- for (var _i = 0; _i < targetListeners.length; _i++) {
- var _ref;
-
- _ref = targetListeners[_i];
- var listener = _ref;
-
- if (listener(arg, name) === false) {
- return false;
- }
- }
- }
- }]);
-
- return Signals;
- }();
-
- var ___default_45 = Signals;
- _$Signals_45["default"] = ___default_45;
-
- var _$utils_55 = {};
- "use strict";
-
- Object.defineProperty(_$utils_55, "__esModule", {
- value: true
- });
- _$utils_55.warnOnce = warnOnce;
- _$utils_55._getQBezierValue = _getQBezierValue;
- _$utils_55.getQuadraticCurvePoint = getQuadraticCurvePoint;
- _$utils_55.easeOutQuad = easeOutQuad;
- _$utils_55.copyAction = copyAction;
- Object.defineProperty(_$utils_55, "win", {
- enumerable: true,
- get: function get() {
- return ___window_55["default"];
- }
- });
- Object.defineProperty(_$utils_55, "browser", {
- enumerable: true,
- get: function get() {
- return ___browser_55["default"];
- }
- });
- Object.defineProperty(_$utils_55, "clone", {
- enumerable: true,
- get: function get() {
- return _clone["default"];
- }
- });
- Object.defineProperty(_$utils_55, "events", {
- enumerable: true,
- get: function get() {
- return _events["default"];
- }
- });
- Object.defineProperty(_$utils_55, "extend", {
- enumerable: true,
- get: function get() {
- return ___extend_55["default"];
- }
- });
- Object.defineProperty(_$utils_55, "getOriginXY", {
- enumerable: true,
- get: function get() {
- return _getOriginXY["default"];
- }
- });
- Object.defineProperty(_$utils_55, "hypot", {
- enumerable: true,
- get: function get() {
- return ___hypot_55["default"];
- }
- });
- Object.defineProperty(_$utils_55, "normalizeListeners", {
- enumerable: true,
- get: function get() {
- return _normalizeListeners["default"];
- }
- });
- Object.defineProperty(_$utils_55, "pointer", {
- enumerable: true,
- get: function get() {
- return ___pointerUtils_55["default"];
- }
- });
- Object.defineProperty(_$utils_55, "raf", {
- enumerable: true,
- get: function get() {
- return _raf["default"];
- }
- });
- Object.defineProperty(_$utils_55, "rect", {
- enumerable: true,
- get: function get() {
- return ___rect_55["default"];
- }
- });
- Object.defineProperty(_$utils_55, "Signals", {
- enumerable: true,
- get: function get() {
- return _Signals["default"];
- }
- });
- _$utils_55.is = _$utils_55.dom = _$utils_55.arr = void 0;
-
- var __arr_55 = ___interopRequireWildcard_55(_$arr_46);
-
- _$utils_55.arr = __arr_55;
-
- var dom = ___interopRequireWildcard_55(_$domUtils_50);
-
- _$utils_55.dom = dom;
-
- var __is_55 = ___interopRequireWildcard_55(_$is_56);
-
- _$utils_55.is = __is_55;
-
- var ___window_55 = ___interopRequireDefault_55(_$window_65);
-
- var ___browser_55 = ___interopRequireDefault_55(_$browser_47);
-
- var _clone = ___interopRequireDefault_55(_$clone_48);
-
- var _events = ___interopRequireDefault_55(_$events_51);
-
- var ___extend_55 = ___interopRequireDefault_55(_$extend_52);
-
- var _getOriginXY = ___interopRequireDefault_55(_$getOriginXY_53);
-
- var ___hypot_55 = ___interopRequireDefault_55(_$hypot_54);
-
- var _normalizeListeners = ___interopRequireDefault_55(_$normalizeListeners_58);
-
- var ___pointerUtils_55 = ___interopRequireDefault_55(_$pointerUtils_60);
-
- var _raf = ___interopRequireDefault_55(_$raf_61);
-
- var ___rect_55 = ___interopRequireDefault_55(_$rect_62);
-
- var _Signals = ___interopRequireDefault_55(_$Signals_45);
-
- function ___interopRequireDefault_55(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- function ___interopRequireWildcard_55(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
-
- function warnOnce(method, message) {
- var warned = false; // eslint-disable-next-line no-shadow
-
- return function () {
- if (!warned) {
- ___window_55["default"].window.console.warn(message);
-
- warned = true;
- }
-
- return method.apply(this, arguments);
- };
- } // http://stackoverflow.com/a/5634528/2280888
-
-
- function _getQBezierValue(t, p1, p2, p3) {
- var iT = 1 - t;
- return iT * iT * p1 + 2 * iT * t * p2 + t * t * p3;
- }
-
- function getQuadraticCurvePoint(startX, startY, cpX, cpY, endX, endY, position) {
- return {
- x: _getQBezierValue(position, startX, cpX, endX),
- y: _getQBezierValue(position, startY, cpY, endY)
- };
- } // http://gizma.com/easing/
-
-
- function easeOutQuad(t, b, c, d) {
- t /= d;
- return -c * t * (t - 2) + b;
- }
-
- function copyAction(dest, src) {
- dest.name = src.name;
- dest.axis = src.axis;
- dest.edges = src.edges;
- return dest;
- }
-
- var _$defaultOptions_20 = {};
- "use strict";
-
- Object.defineProperty(_$defaultOptions_20, "__esModule", {
- value: true
- });
- _$defaultOptions_20["default"] = _$defaultOptions_20.defaults = void 0;
- // tslint:disable no-empty-interface
- var defaults = {
- base: {
- preventDefault: 'auto',
- deltaSource: 'page'
- },
- perAction: {
- enabled: false,
- origin: {
- x: 0,
- y: 0
- }
- },
- actions: {}
- };
- _$defaultOptions_20.defaults = defaults;
- var ___default_20 = defaults;
- _$defaultOptions_20["default"] = ___default_20;
-
- var _$Eventable_14 = {};
- "use strict";
-
- Object.defineProperty(_$Eventable_14, "__esModule", {
- value: true
- });
- _$Eventable_14["default"] = void 0;
-
- var __arr_14 = ___interopRequireWildcard_14(_$arr_46);
-
- var ___extend_14 = ___interopRequireDefault_14(_$extend_52);
-
- var ___normalizeListeners_14 = ___interopRequireDefault_14(_$normalizeListeners_58);
-
- function ___interopRequireDefault_14(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- function ___interopRequireWildcard_14(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
-
- function ___classCallCheck_14(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function ___defineProperties_14(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
-
- function ___createClass_14(Constructor, protoProps, staticProps) { if (protoProps) ___defineProperties_14(Constructor.prototype, protoProps); if (staticProps) ___defineProperties_14(Constructor, staticProps); return Constructor; }
-
- function fireUntilImmediateStopped(event, listeners) {
- for (var _i = 0; _i < listeners.length; _i++) {
- var _ref;
-
- _ref = listeners[_i];
- var listener = _ref;
-
- if (event.immediatePropagationStopped) {
- break;
- }
-
- listener(event);
- }
- }
-
- var Eventable =
- /*#__PURE__*/
- function () {
- function Eventable(options) {
- ___classCallCheck_14(this, Eventable);
-
- this.types = {};
- this.propagationStopped = false;
- this.immediatePropagationStopped = false;
- this.options = (0, ___extend_14["default"])({}, options || {});
- }
-
- ___createClass_14(Eventable, [{
- key: "fire",
- value: function fire(event) {
- var listeners;
- var global = this.global; // Interactable#on() listeners
- // tslint:disable no-conditional-assignment
-
- if (listeners = this.types[event.type]) {
- fireUntilImmediateStopped(event, listeners);
- } // interact.on() listeners
-
-
- if (!event.propagationStopped && global && (listeners = global[event.type])) {
- fireUntilImmediateStopped(event, listeners);
- }
- }
- }, {
- key: "on",
- value: function on(type, listener) {
- var listeners = (0, ___normalizeListeners_14["default"])(type, listener);
-
- for (type in listeners) {
- this.types[type] = __arr_14.merge(this.types[type] || [], listeners[type]);
- }
- }
- }, {
- key: "off",
- value: function off(type, listener) {
- var listeners = (0, ___normalizeListeners_14["default"])(type, listener);
-
- for (type in listeners) {
- var eventList = this.types[type];
-
- if (!eventList || !eventList.length) {
- continue;
- }
-
- for (var _i2 = 0; _i2 < listeners[type].length; _i2++) {
- var _ref2;
-
- _ref2 = listeners[type][_i2];
- var subListener = _ref2;
- var index = eventList.indexOf(subListener);
-
- if (index !== -1) {
- eventList.splice(index, 1);
- }
- }
- }
- }
- }]);
-
- return Eventable;
- }();
-
- var ___default_14 = Eventable;
- _$Eventable_14["default"] = ___default_14;
-
- var _$Interactable_16 = {};
- "use strict";
-
- Object.defineProperty(_$Interactable_16, "__esModule", {
- value: true
- });
- _$Interactable_16["default"] = _$Interactable_16.Interactable = void 0;
-
- var __arr_16 = ___interopRequireWildcard_16(_$arr_46);
-
- var ___browser_16 = ___interopRequireDefault_16(_$browser_47);
-
- var ___clone_16 = ___interopRequireDefault_16(_$clone_48);
-
- /* removed: var _$domUtils_50 = require("@interactjs/utils/domUtils"); */;
-
- var ___events_16 = ___interopRequireDefault_16(_$events_51);
-
- var ___extend_16 = ___interopRequireDefault_16(_$extend_52);
-
- var __is_16 = ___interopRequireWildcard_16(_$is_56);
-
- var ___normalizeListeners_16 = ___interopRequireDefault_16(_$normalizeListeners_58);
-
- /* removed: var _$window_65 = require("@interactjs/utils/window"); */;
-
- var _Eventable = ___interopRequireDefault_16(_$Eventable_14);
-
- function ___interopRequireDefault_16(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- function ___interopRequireWildcard_16(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
-
- function ___classCallCheck_16(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function ___defineProperties_16(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
-
- function ___createClass_16(Constructor, protoProps, staticProps) { if (protoProps) ___defineProperties_16(Constructor.prototype, protoProps); if (staticProps) ___defineProperties_16(Constructor, staticProps); return Constructor; }
-
- /** */
- var Interactable =
- /*#__PURE__*/
- function () {
- /** */
- function Interactable(target, options, defaultContext) {
- ___classCallCheck_16(this, Interactable);
-
- this.events = new _Eventable["default"]();
- this._actions = options.actions;
- this.target = target;
- this._context = options.context || defaultContext;
- this._win = (0, _$window_65.getWindow)((0, _$domUtils_50.trySelector)(target) ? this._context : target);
- this._doc = this._win.document;
- this.set(options);
- }
-
- ___createClass_16(Interactable, [{
- key: "setOnEvents",
- value: function setOnEvents(actionName, phases) {
- if (__is_16.func(phases.onstart)) {
- this.on("".concat(actionName, "start"), phases.onstart);
- }
-
- if (__is_16.func(phases.onmove)) {
- this.on("".concat(actionName, "move"), phases.onmove);
- }
-
- if (__is_16.func(phases.onend)) {
- this.on("".concat(actionName, "end"), phases.onend);
- }
-
- if (__is_16.func(phases.oninertiastart)) {
- this.on("".concat(actionName, "inertiastart"), phases.oninertiastart);
- }
-
- return this;
- }
- }, {
- key: "updatePerActionListeners",
- value: function updatePerActionListeners(actionName, prev, cur) {
- if (__is_16.array(prev) || __is_16.object(prev)) {
- this.off(actionName, prev);
- }
-
- if (__is_16.array(cur) || __is_16.object(cur)) {
- this.on(actionName, cur);
- }
- }
- }, {
- key: "setPerAction",
- value: function setPerAction(actionName, options) {
- var defaults = this._defaults; // for all the default per-action options
-
- for (var optionName in options) {
- var actionOptions = this.options[actionName];
- var optionValue = options[optionName];
- var isArray = __is_16.array(optionValue); // remove old event listeners and add new ones
-
- if (optionName === 'listeners') {
- this.updatePerActionListeners(actionName, actionOptions.listeners, optionValue);
- } // if the option value is an array
-
-
- if (isArray) {
- actionOptions[optionName] = __arr_16.from(optionValue);
- } // if the option value is an object
- else if (!isArray && __is_16.plainObject(optionValue)) {
- // copy the object
- actionOptions[optionName] = (0, ___extend_16["default"])(actionOptions[optionName] || {}, (0, ___clone_16["default"])(optionValue)); // set anabled field to true if it exists in the defaults
-
- if (__is_16.object(defaults.perAction[optionName]) && 'enabled' in defaults.perAction[optionName]) {
- actionOptions[optionName].enabled = optionValue.enabled !== false;
- }
- } // if the option value is a boolean and the default is an object
- else if (__is_16.bool(optionValue) && __is_16.object(defaults.perAction[optionName])) {
- actionOptions[optionName].enabled = optionValue;
- } // if it's anything else, do a plain assignment
- else {
- actionOptions[optionName] = optionValue;
- }
- }
- }
- /**
- * The default function to get an Interactables bounding rect. Can be
- * overridden using {@link Interactable.rectChecker}.
- *
- * @param {Element} [element] The element to measure.
- * @return {object} The object's bounding rectangle.
- */
-
- }, {
- key: "getRect",
- value: function getRect(element) {
- element = element || (__is_16.element(this.target) ? this.target : null);
-
- if (__is_16.string(this.target)) {
- element = element || this._context.querySelector(this.target);
- }
-
- return (0, _$domUtils_50.getElementRect)(element);
- }
- /**
- * Returns or sets the function used to calculate the interactable's
- * element's rectangle
- *
- * @param {function} [checker] A function which returns this Interactable's
- * bounding rectangle. See {@link Interactable.getRect}
- * @return {function | object} The checker function or this Interactable
- */
-
- }, {
- key: "rectChecker",
- value: function rectChecker(checker) {
- if (__is_16.func(checker)) {
- this.getRect = checker;
- return this;
- }
-
- if (checker === null) {
- delete this.getRect;
- return this;
- }
-
- return this.getRect;
- }
- }, {
- key: "_backCompatOption",
- value: function _backCompatOption(optionName, newValue) {
- if ((0, _$domUtils_50.trySelector)(newValue) || __is_16.object(newValue)) {
- this.options[optionName] = newValue;
-
- for (var _i = 0; _i < this._actions.names.length; _i++) {
- var _ref;
-
- _ref = this._actions.names[_i];
- var action = _ref;
- this.options[action][optionName] = newValue;
- }
-
- return this;
- }
-
- return this.options[optionName];
- }
- /**
- * Gets or sets the origin of the Interactable's element. The x and y
- * of the origin will be subtracted from action event coordinates.
- *
- * @param {Element | object | string} [origin] An HTML or SVG Element whose
- * rect will be used, an object eg. { x: 0, y: 0 } or string 'parent', 'self'
- * or any CSS selector
- *
- * @return {object} The current origin or this Interactable
- */
-
- }, {
- key: "origin",
- value: function origin(newValue) {
- return this._backCompatOption('origin', newValue);
- }
- /**
- * Returns or sets the mouse coordinate types used to calculate the
- * movement of the pointer.
- *
- * @param {string} [newValue] Use 'client' if you will be scrolling while
- * interacting; Use 'page' if you want autoScroll to work
- * @return {string | object} The current deltaSource or this Interactable
- */
-
- }, {
- key: "deltaSource",
- value: function deltaSource(newValue) {
- if (newValue === 'page' || newValue === 'client') {
- this.options.deltaSource = newValue;
- return this;
- }
-
- return this.options.deltaSource;
- }
- /**
- * Gets the selector context Node of the Interactable. The default is
- * `window.document`.
- *
- * @return {Node} The context Node of this Interactable
- */
-
- }, {
- key: "context",
- value: function context() {
- return this._context;
- }
- }, {
- key: "inContext",
- value: function inContext(element) {
- return this._context === element.ownerDocument || (0, _$domUtils_50.nodeContains)(this._context, element);
- }
- }, {
- key: "testIgnoreAllow",
- value: function testIgnoreAllow(options, targetNode, eventTarget) {
- return !this.testIgnore(options.ignoreFrom, targetNode, eventTarget) && this.testAllow(options.allowFrom, targetNode, eventTarget);
- }
- }, {
- key: "testAllow",
- value: function testAllow(allowFrom, targetNode, element) {
- if (!allowFrom) {
- return true;
- }
-
- if (!__is_16.element(element)) {
- return false;
- }
-
- if (__is_16.string(allowFrom)) {
- return (0, _$domUtils_50.matchesUpTo)(element, allowFrom, targetNode);
- } else if (__is_16.element(allowFrom)) {
- return (0, _$domUtils_50.nodeContains)(allowFrom, element);
- }
-
- return false;
- }
- }, {
- key: "testIgnore",
- value: function testIgnore(ignoreFrom, targetNode, element) {
- if (!ignoreFrom || !__is_16.element(element)) {
- return false;
- }
-
- if (__is_16.string(ignoreFrom)) {
- return (0, _$domUtils_50.matchesUpTo)(element, ignoreFrom, targetNode);
- } else if (__is_16.element(ignoreFrom)) {
- return (0, _$domUtils_50.nodeContains)(ignoreFrom, element);
- }
-
- return false;
- }
- /**
- * Calls listeners for the given InteractEvent type bound globally
- * and directly to this Interactable
- *
- * @param {InteractEvent} iEvent The InteractEvent object to be fired on this
- * Interactable
- * @return {Interactable} this Interactable
- */
-
- }, {
- key: "fire",
- value: function fire(iEvent) {
- this.events.fire(iEvent);
- return this;
- }
- }, {
- key: "_onOff",
- value: function _onOff(method, typeArg, listenerArg, options) {
- if (__is_16.object(typeArg) && !__is_16.array(typeArg)) {
- options = listenerArg;
- listenerArg = null;
- }
-
- var addRemove = method === 'on' ? 'add' : 'remove';
- var listeners = (0, ___normalizeListeners_16["default"])(typeArg, listenerArg);
-
- for (var type in listeners) {
- if (type === 'wheel') {
- type = ___browser_16["default"].wheelEvent;
- }
-
- for (var _i2 = 0; _i2 < listeners[type].length; _i2++) {
- var _ref2;
-
- _ref2 = listeners[type][_i2];
- var listener = _ref2;
-
- // if it is an action event type
- if (__arr_16.contains(this._actions.eventTypes, type)) {
- this.events[method](type, listener);
- } // delegated event
- else if (__is_16.string(this.target)) {
- ___events_16["default"]["".concat(addRemove, "Delegate")](this.target, this._context, type, listener, options);
- } // remove listener from this Interatable's element
- else {
- ___events_16["default"][addRemove](this.target, type, listener, options);
- }
- }
- }
-
- return this;
- }
- /**
- * Binds a listener for an InteractEvent, pointerEvent or DOM event.
- *
- * @param {string | array | object} types The types of events to listen
- * for
- * @param {function | array | object} [listener] The event listener function(s)
- * @param {object | boolean} [options] options object or useCapture flag for
- * addEventListener
- * @return {Interactable} This Interactable
- */
-
- }, {
- key: "on",
- value: function on(types, listener, options) {
- return this._onOff('on', types, listener, options);
- }
- /**
- * Removes an InteractEvent, pointerEvent or DOM event listener.
- *
- * @param {string | array | object} types The types of events that were
- * listened for
- * @param {function | array | object} [listener] The event listener function(s)
- * @param {object | boolean} [options] options object or useCapture flag for
- * removeEventListener
- * @return {Interactable} This Interactable
- */
-
- }, {
- key: "off",
- value: function off(types, listener, options) {
- return this._onOff('off', types, listener, options);
- }
- /**
- * Reset the options of this Interactable
- *
- * @param {object} options The new settings to apply
- * @return {object} This Interactable
- */
-
- }, {
- key: "set",
- value: function set(options) {
- var defaults = this._defaults;
-
- if (!__is_16.object(options)) {
- options = {};
- }
-
- this.options = (0, ___clone_16["default"])(defaults.base);
-
- for (var actionName in this._actions.methodDict) {
- var methodName = this._actions.methodDict[actionName];
- this.options[actionName] = {};
- this.setPerAction(actionName, (0, ___extend_16["default"])((0, ___extend_16["default"])({}, defaults.perAction), defaults.actions[actionName]));
- this[methodName](options[actionName]);
- }
-
- for (var setting in options) {
- if (__is_16.func(this[setting])) {
- this[setting](options[setting]);
- }
- }
-
- return this;
- }
- /**
- * Remove this interactable from the list of interactables and remove it's
- * action capabilities and event listeners
- *
- * @return {interact}
- */
-
- }, {
- key: "unset",
- value: function unset() {
- ___events_16["default"].remove(this.target, 'all');
-
- if (__is_16.string(this.target)) {
- // remove delegated events
- for (var type in ___events_16["default"].delegatedEvents) {
- var delegated = ___events_16["default"].delegatedEvents[type];
-
- if (delegated.selectors[0] === this.target && delegated.contexts[0] === this._context) {
- delegated.selectors.splice(0, 1);
- delegated.contexts.splice(0, 1);
- delegated.listeners.splice(0, 1); // remove the arrays if they are empty
-
- if (!delegated.selectors.length) {
- delegated[type] = null;
- }
- }
-
- ___events_16["default"].remove(this._context, type, ___events_16["default"].delegateListener);
-
- ___events_16["default"].remove(this._context, type, ___events_16["default"].delegateUseCapture, true);
- }
- } else {
- ___events_16["default"].remove(this.target, 'all');
- }
- }
- }, {
- key: "_defaults",
- get: function get() {
- return {
- base: {},
- perAction: {},
- actions: {}
- };
- }
- }]);
-
- return Interactable;
- }();
-
- _$Interactable_16.Interactable = Interactable;
- var ___default_16 = Interactable;
- _$Interactable_16["default"] = ___default_16;
-
- var _$InteractableSet_17 = {};
- "use strict";
-
- Object.defineProperty(_$InteractableSet_17, "__esModule", {
- value: true
- });
- _$InteractableSet_17["default"] = void 0;
-
- var __arr_17 = ___interopRequireWildcard_17(_$arr_46);
-
- var __domUtils_17 = ___interopRequireWildcard_17(_$domUtils_50);
-
- var ___extend_17 = ___interopRequireDefault_17(_$extend_52);
-
- var __is_17 = ___interopRequireWildcard_17(_$is_56);
-
- var ___Signals_17 = ___interopRequireDefault_17(_$Signals_45);
-
- function ___interopRequireDefault_17(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- function ___interopRequireWildcard_17(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
-
- function ___classCallCheck_17(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function ___defineProperties_17(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
-
- function ___createClass_17(Constructor, protoProps, staticProps) { if (protoProps) ___defineProperties_17(Constructor.prototype, protoProps); if (staticProps) ___defineProperties_17(Constructor, staticProps); return Constructor; }
-
- var InteractableSet =
- /*#__PURE__*/
- function () {
- function InteractableSet(scope) {
- var _this = this;
-
- ___classCallCheck_17(this, InteractableSet);
-
- this.scope = scope;
- this.signals = new ___Signals_17["default"](); // all set interactables
-
- this.list = [];
- this.selectorMap = {};
- this.signals.on('unset', function (_ref) {
- var interactable = _ref.interactable;
- var target = interactable.target,
- context = interactable._context;
- var targetMappings = __is_17.string(target) ? _this.selectorMap[target] : target[_this.scope.id];
- var targetIndex = targetMappings.findIndex(function (m) {
- return m.context === context;
- });
-
- if (targetMappings[targetIndex]) {
- // Destroying mappingInfo's context and interactable
- targetMappings[targetIndex].context = null;
- targetMappings[targetIndex].interactable = null;
- }
-
- targetMappings.splice(targetIndex, 1);
- });
- }
-
- ___createClass_17(InteractableSet, [{
- key: "new",
- value: function _new(target, options) {
- options = (0, ___extend_17["default"])(options || {}, {
- actions: this.scope.actions
- });
- var interactable = new this.scope.Interactable(target, options, this.scope.document);
- var mappingInfo = {
- context: interactable._context,
- interactable: interactable
- };
- this.scope.addDocument(interactable._doc);
- this.list.push(interactable);
-
- if (__is_17.string(target)) {
- if (!this.selectorMap[target]) {
- this.selectorMap[target] = [];
- }
-
- this.selectorMap[target].push(mappingInfo);
- } else {
- if (!interactable.target[this.scope.id]) {
- Object.defineProperty(target, this.scope.id, {
- value: [],
- configurable: true
- });
- }
-
- target[this.scope.id].push(mappingInfo);
- }
-
- this.signals.fire('new', {
- target: target,
- options: options,
- interactable: interactable,
- win: this.scope._win
- });
- return interactable;
- }
- }, {
- key: "get",
- value: function get(target, options) {
- var context = options && options.context || this.scope.document;
- var isSelector = __is_17.string(target);
- var targetMappings = isSelector ? this.selectorMap[target] : target[this.scope.id];
-
- if (!targetMappings) {
- return null;
- }
-
- var found = __arr_17.find(targetMappings, function (m) {
- return m.context === context && (isSelector || m.interactable.inContext(target));
- });
- return found && found.interactable;
- }
- }, {
- key: "forEachMatch",
- value: function forEachMatch(node, callback) {
- for (var _i = 0; _i < this.list.length; _i++) {
- var _ref2;
-
- _ref2 = this.list[_i];
- var interactable = _ref2;
- var ret = void 0;
-
- if ((__is_17.string(interactable.target) // target is a selector and the element matches
- ? __is_17.element(node) && __domUtils_17.matchesSelector(node, interactable.target) : // target is the element
- node === interactable.target) && // the element is in context
- interactable.inContext(node)) {
- ret = callback(interactable);
- }
-
- if (ret !== undefined) {
- return ret;
- }
- }
- }
- }]);
-
- return InteractableSet;
- }();
-
- _$InteractableSet_17["default"] = InteractableSet;
-
- var _$BaseEvent_13 = {};
- "use strict";
-
- Object.defineProperty(_$BaseEvent_13, "__esModule", {
- value: true
- });
- _$BaseEvent_13["default"] = _$BaseEvent_13.BaseEvent = _$BaseEvent_13.EventPhase = void 0;
-
- function ___classCallCheck_13(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function ___defineProperties_13(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
-
- function ___createClass_13(Constructor, protoProps, staticProps) { if (protoProps) ___defineProperties_13(Constructor.prototype, protoProps); if (staticProps) ___defineProperties_13(Constructor, staticProps); return Constructor; }
-
- var EventPhase;
- _$BaseEvent_13.EventPhase = EventPhase;
-
- (function (EventPhase) {
- EventPhase["Start"] = "start";
- EventPhase["Move"] = "move";
- EventPhase["End"] = "end";
- EventPhase["_NONE"] = "";
- })(EventPhase || (_$BaseEvent_13.EventPhase = EventPhase = {}));
-
- var BaseEvent =
- /*#__PURE__*/
- function () {
- function BaseEvent(interaction) {
- ___classCallCheck_13(this, BaseEvent);
-
- this.immediatePropagationStopped = false;
- this.propagationStopped = false;
- this._interaction = interaction;
- }
-
- ___createClass_13(BaseEvent, [{
- key: "preventDefault",
- value: function preventDefault() {}
- /**
- * Don't call any other listeners (even on the current target)
- */
-
- }, {
- key: "stopPropagation",
- value: function stopPropagation() {
- this.propagationStopped = true;
- }
- /**
- * Don't call listeners on the remaining targets
- */
-
- }, {
- key: "stopImmediatePropagation",
- value: function stopImmediatePropagation() {
- this.immediatePropagationStopped = this.propagationStopped = true;
- }
- }, {
- key: "interaction",
- get: function get() {
- return this._interaction._proxy;
- }
- }]);
-
- return BaseEvent;
- }();
-
- _$BaseEvent_13.BaseEvent = BaseEvent;
- var ___default_13 = BaseEvent;
- _$BaseEvent_13["default"] = ___default_13;
-
- var _$InteractEvent_15 = {};
- "use strict";
-
- Object.defineProperty(_$InteractEvent_15, "__esModule", {
- value: true
- });
- _$InteractEvent_15["default"] = _$InteractEvent_15.InteractEvent = _$InteractEvent_15.EventPhase = void 0;
-
- var ___extend_15 = ___interopRequireDefault_15(_$extend_52);
-
- var ___getOriginXY_15 = ___interopRequireDefault_15(_$getOriginXY_53);
-
- var ___hypot_15 = ___interopRequireDefault_15(_$hypot_54);
-
- var _BaseEvent2 = ___interopRequireDefault_15(_$BaseEvent_13);
-
- var _defaultOptions = ___interopRequireDefault_15(_$defaultOptions_20);
-
- function ___interopRequireDefault_15(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- function ___typeof_15(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ___typeof_15 = function _typeof(obj) { return typeof obj; }; } else { ___typeof_15 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ___typeof_15(obj); }
-
- function ___classCallCheck_15(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function ___defineProperties_15(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
-
- function ___createClass_15(Constructor, protoProps, staticProps) { if (protoProps) ___defineProperties_15(Constructor.prototype, protoProps); if (staticProps) ___defineProperties_15(Constructor, staticProps); return Constructor; }
-
- function _possibleConstructorReturn(self, call) { if (call && (___typeof_15(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
-
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
-
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
-
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
-
- var __EventPhase_15;
- _$InteractEvent_15.EventPhase = __EventPhase_15;
-
- (function (EventPhase) {
- EventPhase["Start"] = "start";
- EventPhase["Move"] = "move";
- EventPhase["End"] = "end";
- EventPhase["_NONE"] = "";
- })(__EventPhase_15 || (_$InteractEvent_15.EventPhase = __EventPhase_15 = {}));
-
- var InteractEvent =
- /*#__PURE__*/
- function (_BaseEvent) {
- _inherits(InteractEvent, _BaseEvent);
-
- /** */
- function InteractEvent(interaction, event, actionName, phase, element, related, preEnd, type) {
- var _this;
-
- ___classCallCheck_15(this, InteractEvent);
-
- _this = _possibleConstructorReturn(this, _getPrototypeOf(InteractEvent).call(this, interaction));
- element = element || interaction.element;
- var target = interaction.interactable; // FIXME: add deltaSource to defaults
-
- var deltaSource = (target && target.options || _defaultOptions["default"]).deltaSource;
- var origin = (0, ___getOriginXY_15["default"])(target, element, actionName);
- var starting = phase === 'start';
- var ending = phase === 'end';
- var prevEvent = starting ? _assertThisInitialized(_this) : interaction.prevEvent;
- var coords = starting ? interaction.coords.start : ending ? {
- page: prevEvent.page,
- client: prevEvent.client,
- timeStamp: interaction.coords.cur.timeStamp
- } : interaction.coords.cur;
- _this.page = (0, ___extend_15["default"])({}, coords.page);
- _this.client = (0, ___extend_15["default"])({}, coords.client);
- _this.rect = (0, ___extend_15["default"])({}, interaction.rect);
- _this.timeStamp = coords.timeStamp;
-
- if (!ending) {
- _this.page.x -= origin.x;
- _this.page.y -= origin.y;
- _this.client.x -= origin.x;
- _this.client.y -= origin.y;
- }
-
- _this.ctrlKey = event.ctrlKey;
- _this.altKey = event.altKey;
- _this.shiftKey = event.shiftKey;
- _this.metaKey = event.metaKey;
- _this.button = event.button;
- _this.buttons = event.buttons;
- _this.target = element;
- _this.currentTarget = element;
- _this.relatedTarget = related || null;
- _this.preEnd = preEnd;
- _this.type = type || actionName + (phase || '');
- _this.interactable = target;
- _this.t0 = starting ? interaction.pointers[interaction.pointers.length - 1].downTime : prevEvent.t0;
- _this.x0 = interaction.coords.start.page.x - origin.x;
- _this.y0 = interaction.coords.start.page.y - origin.y;
- _this.clientX0 = interaction.coords.start.client.x - origin.x;
- _this.clientY0 = interaction.coords.start.client.y - origin.y;
-
- if (starting || ending) {
- _this.delta = {
- x: 0,
- y: 0
- };
- } else {
- _this.delta = {
- x: _this[deltaSource].x - prevEvent[deltaSource].x,
- y: _this[deltaSource].y - prevEvent[deltaSource].y
- };
- }
-
- _this.dt = interaction.coords.delta.timeStamp;
- _this.duration = _this.timeStamp - _this.t0; // velocity and speed in pixels per second
-
- _this.velocity = (0, ___extend_15["default"])({}, interaction.coords.velocity[deltaSource]);
- _this.speed = (0, ___hypot_15["default"])(_this.velocity.x, _this.velocity.y);
- _this.swipe = ending || phase === 'inertiastart' ? _this.getSwipe() : null;
- return _this;
- }
-
- ___createClass_15(InteractEvent, [{
- key: "getSwipe",
- value: function getSwipe() {
- var interaction = this._interaction;
-
- if (interaction.prevEvent.speed < 600 || this.timeStamp - interaction.prevEvent.timeStamp > 150) {
- return null;
- }
-
- var angle = 180 * Math.atan2(interaction.prevEvent.velocityY, interaction.prevEvent.velocityX) / Math.PI;
- var overlap = 22.5;
-
- if (angle < 0) {
- angle += 360;
- }
-
- var left = 135 - overlap <= angle && angle < 225 + overlap;
- var up = 225 - overlap <= angle && angle < 315 + overlap;
- var right = !left && (315 - overlap <= angle || angle < 45 + overlap);
- var down = !up && 45 - overlap <= angle && angle < 135 + overlap;
- return {
- up: up,
- down: down,
- left: left,
- right: right,
- angle: angle,
- speed: interaction.prevEvent.speed,
- velocity: {
- x: interaction.prevEvent.velocityX,
- y: interaction.prevEvent.velocityY
- }
- };
- }
- }, {
- key: "preventDefault",
- value: function preventDefault() {}
- /**
- * Don't call listeners on the remaining targets
- */
-
- }, {
- key: "stopImmediatePropagation",
- value: function stopImmediatePropagation() {
- this.immediatePropagationStopped = this.propagationStopped = true;
- }
- /**
- * Don't call any other listeners (even on the current target)
- */
-
- }, {
- key: "stopPropagation",
- value: function stopPropagation() {
- this.propagationStopped = true;
- }
- }, {
- key: "pageX",
- get: function get() {
- return this.page.x;
- },
- set: function set(value) {
- this.page.x = value;
- }
- }, {
- key: "pageY",
- get: function get() {
- return this.page.y;
- },
- set: function set(value) {
- this.page.y = value;
- }
- }, {
- key: "clientX",
- get: function get() {
- return this.client.x;
- },
- set: function set(value) {
- this.client.x = value;
- }
- }, {
- key: "clientY",
- get: function get() {
- return this.client.y;
- },
- set: function set(value) {
- this.client.y = value;
- }
- }, {
- key: "dx",
- get: function get() {
- return this.delta.x;
- },
- set: function set(value) {
- this.delta.x = value;
- }
- }, {
- key: "dy",
- get: function get() {
- return this.delta.y;
- },
- set: function set(value) {
- this.delta.y = value;
- }
- }, {
- key: "velocityX",
- get: function get() {
- return this.velocity.x;
- },
- set: function set(value) {
- this.velocity.x = value;
- }
- }, {
- key: "velocityY",
- get: function get() {
- return this.velocity.y;
- },
- set: function set(value) {
- this.velocity.y = value;
- }
- }]);
-
- return InteractEvent;
- }(_BaseEvent2["default"]);
-
- _$InteractEvent_15.InteractEvent = InteractEvent;
- var ___default_15 = InteractEvent;
- _$InteractEvent_15["default"] = ___default_15;
-
- var _$PointerInfo_19 = {};
- "use strict";
-
- Object.defineProperty(_$PointerInfo_19, "__esModule", {
- value: true
- });
- _$PointerInfo_19["default"] = _$PointerInfo_19.PointerInfo = void 0;
-
- function ___classCallCheck_19(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- var PointerInfo = function PointerInfo(id, pointer, event, downTime, downTarget) {
- ___classCallCheck_19(this, PointerInfo);
-
- this.id = id;
- this.pointer = pointer;
- this.event = event;
- this.downTime = downTime;
- this.downTarget = downTarget;
- };
-
- _$PointerInfo_19.PointerInfo = PointerInfo;
- var ___default_19 = PointerInfo;
- _$PointerInfo_19["default"] = ___default_19;
-
- var _$interactionFinder_22 = {};
- "use strict";
-
- Object.defineProperty(_$interactionFinder_22, "__esModule", {
- value: true
- });
- _$interactionFinder_22["default"] = void 0;
-
- var __dom_22 = ___interopRequireWildcard_22(_$domUtils_50);
-
- function ___interopRequireWildcard_22(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
-
- var finder = {
- methodOrder: ['simulationResume', 'mouseOrPen', 'hasPointer', 'idle'],
- search: function search(details) {
- for (var _i = 0; _i < finder.methodOrder.length; _i++) {
- var _ref;
-
- _ref = finder.methodOrder[_i];
- var method = _ref;
- var interaction = finder[method](details);
-
- if (interaction) {
- return interaction;
- }
- }
- },
- // try to resume simulation with a new pointer
- simulationResume: function simulationResume(_ref2) {
- var pointerType = _ref2.pointerType,
- eventType = _ref2.eventType,
- eventTarget = _ref2.eventTarget,
- scope = _ref2.scope;
-
- if (!/down|start/i.test(eventType)) {
- return null;
- }
-
- for (var _i2 = 0; _i2 < scope.interactions.list.length; _i2++) {
- var _ref3;
-
- _ref3 = scope.interactions.list[_i2];
- var interaction = _ref3;
- var element = eventTarget;
-
- if (interaction.simulation && interaction.simulation.allowResume && interaction.pointerType === pointerType) {
- while (element) {
- // if the element is the interaction element
- if (element === interaction.element) {
- return interaction;
- }
-
- element = __dom_22.parentNode(element);
- }
- }
- }
-
- return null;
- },
- // if it's a mouse or pen interaction
- mouseOrPen: function mouseOrPen(_ref4) {
- var pointerId = _ref4.pointerId,
- pointerType = _ref4.pointerType,
- eventType = _ref4.eventType,
- scope = _ref4.scope;
-
- if (pointerType !== 'mouse' && pointerType !== 'pen') {
- return null;
- }
-
- var firstNonActive;
-
- for (var _i3 = 0; _i3 < scope.interactions.list.length; _i3++) {
- var _ref5;
-
- _ref5 = scope.interactions.list[_i3];
- var interaction = _ref5;
-
- if (interaction.pointerType === pointerType) {
- // if it's a down event, skip interactions with running simulations
- if (interaction.simulation && !hasPointerId(interaction, pointerId)) {
- continue;
- } // if the interaction is active, return it immediately
-
-
- if (interaction.interacting()) {
- return interaction;
- } // otherwise save it and look for another active interaction
- else if (!firstNonActive) {
- firstNonActive = interaction;
- }
- }
- } // if no active mouse interaction was found use the first inactive mouse
- // interaction
-
-
- if (firstNonActive) {
- return firstNonActive;
- } // find any mouse or pen interaction.
- // ignore the interaction if the eventType is a *down, and a simulation
- // is active
-
-
- for (var _i4 = 0; _i4 < scope.interactions.list.length; _i4++) {
- var _ref6;
-
- _ref6 = scope.interactions.list[_i4];
- var _interaction = _ref6;
-
- if (_interaction.pointerType === pointerType && !(/down/i.test(eventType) && _interaction.simulation)) {
- return _interaction;
- }
- }
-
- return null;
- },
- // get interaction that has this pointer
- hasPointer: function hasPointer(_ref7) {
- var pointerId = _ref7.pointerId,
- scope = _ref7.scope;
-
- for (var _i5 = 0; _i5 < scope.interactions.list.length; _i5++) {
- var _ref8;
-
- _ref8 = scope.interactions.list[_i5];
- var interaction = _ref8;
-
- if (hasPointerId(interaction, pointerId)) {
- return interaction;
- }
- }
-
- return null;
- },
- // get first idle interaction with a matching pointerType
- idle: function idle(_ref9) {
- var pointerType = _ref9.pointerType,
- scope = _ref9.scope;
-
- for (var _i6 = 0; _i6 < scope.interactions.list.length; _i6++) {
- var _ref10;
-
- _ref10 = scope.interactions.list[_i6];
- var interaction = _ref10;
-
- // if there's already a pointer held down
- if (interaction.pointers.length === 1) {
- var target = interaction.interactable; // don't add this pointer if there is a target interactable and it
- // isn't gesturable
-
- if (target && !target.options.gesture.enabled) {
- continue;
- }
- } // maximum of 2 pointers per interaction
- else if (interaction.pointers.length >= 2) {
- continue;
- }
-
- if (!interaction.interacting() && pointerType === interaction.pointerType) {
- return interaction;
- }
- }
-
- return null;
- }
- };
-
- function hasPointerId(interaction, pointerId) {
- return interaction.pointers.some(function (_ref11) {
- var id = _ref11.id;
- return id === pointerId;
- });
- }
-
- var ___default_22 = finder;
- _$interactionFinder_22["default"] = ___default_22;
-
- var _$drag_1 = {};
- "use strict";
-
- Object.defineProperty(_$drag_1, "__esModule", {
- value: true
- });
- _$drag_1["default"] = void 0;
-
- var ___scope_1 = _$scope_24({});
-
- var __arr_1 = ___interopRequireWildcard_1(_$arr_46);
-
- var __is_1 = ___interopRequireWildcard_1(_$is_56);
-
- function ___interopRequireWildcard_1(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
-
- ___scope_1.ActionName.Drag = 'drag';
-
- function __install_1(scope) {
- var actions = scope.actions,
- Interactable = scope.Interactable,
- interactions = scope.interactions,
- defaults = scope.defaults;
- interactions.signals.on('before-action-move', beforeMove);
- interactions.signals.on('action-resume', beforeMove); // dragmove
-
- interactions.signals.on('action-move', move);
- Interactable.prototype.draggable = drag.draggable;
- actions[___scope_1.ActionName.Drag] = drag;
- actions.names.push(___scope_1.ActionName.Drag);
- __arr_1.merge(actions.eventTypes, ['dragstart', 'dragmove', 'draginertiastart', 'dragresume', 'dragend']);
- actions.methodDict.drag = 'draggable';
- defaults.actions.drag = drag.defaults;
- }
-
- function beforeMove(_ref) {
- var interaction = _ref.interaction;
-
- if (interaction.prepared.name !== 'drag') {
- return;
- }
-
- var axis = interaction.prepared.axis;
-
- if (axis === 'x') {
- interaction.coords.cur.page.y = interaction.coords.start.page.y;
- interaction.coords.cur.client.y = interaction.coords.start.client.y;
- interaction.coords.velocity.client.y = 0;
- interaction.coords.velocity.page.y = 0;
- } else if (axis === 'y') {
- interaction.coords.cur.page.x = interaction.coords.start.page.x;
- interaction.coords.cur.client.x = interaction.coords.start.client.x;
- interaction.coords.velocity.client.x = 0;
- interaction.coords.velocity.page.x = 0;
- }
- }
-
- function move(_ref2) {
- var iEvent = _ref2.iEvent,
- interaction = _ref2.interaction;
-
- if (interaction.prepared.name !== 'drag') {
- return;
- }
-
- var axis = interaction.prepared.axis;
-
- if (axis === 'x' || axis === 'y') {
- var opposite = axis === 'x' ? 'y' : 'x';
- iEvent.page[opposite] = interaction.coords.start.page[opposite];
- iEvent.client[opposite] = interaction.coords.start.client[opposite];
- iEvent.delta[opposite] = 0;
- }
- }
- /**
- * ```js
- * interact(element).draggable({
- * onstart: function (event) {},
- * onmove : function (event) {},
- * onend : function (event) {},
- *
- * // the axis in which the first movement must be
- * // for the drag sequence to start
- * // 'xy' by default - any direction
- * startAxis: 'x' || 'y' || 'xy',
- *
- * // 'xy' by default - don't restrict to one axis (move in any direction)
- * // 'x' or 'y' to restrict movement to either axis
- * // 'start' to restrict movement to the axis the drag started in
- * lockAxis: 'x' || 'y' || 'xy' || 'start',
- *
- * // max number of drags that can happen concurrently
- * // with elements of this Interactable. Infinity by default
- * max: Infinity,
- *
- * // max number of drags that can target the same element+Interactable
- * // 1 by default
- * maxPerElement: 2
- * })
- *
- * var isDraggable = interact('element').draggable(); // true
- * ```
- *
- * Get or set whether drag actions can be performed on the target
- *
- * @alias Interactable.prototype.draggable
- *
- * @param {boolean | object} [options] true/false or An object with event
- * listeners to be fired on drag events (object makes the Interactable
- * draggable)
- * @return {boolean | Interactable} boolean indicating if this can be the
- * target of drag events, or this Interctable
- */
-
-
- var draggable = function draggable(options) {
- if (__is_1.object(options)) {
- this.options.drag.enabled = options.enabled !== false;
- this.setPerAction('drag', options);
- this.setOnEvents('drag', options);
-
- if (/^(xy|x|y|start)$/.test(options.lockAxis)) {
- this.options.drag.lockAxis = options.lockAxis;
- }
-
- if (/^(xy|x|y)$/.test(options.startAxis)) {
- this.options.drag.startAxis = options.startAxis;
- }
-
- return this;
- }
-
- if (__is_1.bool(options)) {
- this.options.drag.enabled = options;
- return this;
- }
-
- return this.options.drag;
- };
-
- var drag = {
- id: 'actions/drag',
- install: __install_1,
- draggable: draggable,
- beforeMove: beforeMove,
- move: move,
- defaults: {
- startAxis: 'xy',
- lockAxis: 'xy'
- },
- checker: function checker(_pointer, _event, interactable) {
- var dragOptions = interactable.options.drag;
- return dragOptions.enabled ? {
- name: 'drag',
- axis: dragOptions.lockAxis === 'start' ? dragOptions.startAxis : dragOptions.lockAxis
- } : null;
- },
- getCursor: function getCursor() {
- return 'move';
- }
- };
- var ___default_1 = drag;
- _$drag_1["default"] = ___default_1;
-
- var _$DropEvent_2 = {};
- "use strict";
-
- Object.defineProperty(_$DropEvent_2, "__esModule", {
- value: true
- });
- _$DropEvent_2["default"] = void 0;
-
- var ___BaseEvent2_2 = ___interopRequireDefault_2(_$BaseEvent_13);
-
- var __arr_2 = ___interopRequireWildcard_2(_$arr_46);
-
- function ___interopRequireWildcard_2(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
-
- function ___interopRequireDefault_2(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- function ___typeof_2(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ___typeof_2 = function _typeof(obj) { return typeof obj; }; } else { ___typeof_2 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ___typeof_2(obj); }
-
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
-
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
-
- function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
-
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
-
- function ___classCallCheck_2(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function ___defineProperties_2(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
-
- function ___createClass_2(Constructor, protoProps, staticProps) { if (protoProps) ___defineProperties_2(Constructor.prototype, protoProps); if (staticProps) ___defineProperties_2(Constructor, staticProps); return Constructor; }
-
- function ___possibleConstructorReturn_2(self, call) { if (call && (___typeof_2(call) === "object" || typeof call === "function")) { return call; } return ___assertThisInitialized_2(self); }
-
- function ___assertThisInitialized_2(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
-
- function ___getPrototypeOf_2(o) { ___getPrototypeOf_2 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ___getPrototypeOf_2(o); }
-
- function ___inherits_2(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) ___setPrototypeOf_2(subClass, superClass); }
-
- function ___setPrototypeOf_2(o, p) { ___setPrototypeOf_2 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ___setPrototypeOf_2(o, p); }
-
- var DropEvent =
- /*#__PURE__*/
- function (_BaseEvent) {
- ___inherits_2(DropEvent, _BaseEvent);
-
- /**
- * Class of events fired on dropzones during drags with acceptable targets.
- */
- function DropEvent(dropState, dragEvent, type) {
- var _this;
-
- ___classCallCheck_2(this, DropEvent);
-
- _this = ___possibleConstructorReturn_2(this, ___getPrototypeOf_2(DropEvent).call(this, dragEvent._interaction));
- _this.propagationStopped = false;
- _this.immediatePropagationStopped = false;
-
- var _ref = type === 'dragleave' ? dropState.prev : dropState.cur,
- element = _ref.element,
- dropzone = _ref.dropzone;
-
- _this.type = type;
- _this.target = element;
- _this.currentTarget = element;
- _this.dropzone = dropzone;
- _this.dragEvent = dragEvent;
- _this.relatedTarget = dragEvent.target;
- _this.draggable = dragEvent.interactable;
- _this.timeStamp = dragEvent.timeStamp;
- return _this;
- }
- /**
- * If this is a `dropactivate` event, the dropzone element will be
- * deactivated.
- *
- * If this is a `dragmove` or `dragenter`, a `dragleave` will be fired on the
- * dropzone element and more.
- */
-
-
- ___createClass_2(DropEvent, [{
- key: "reject",
- value: function reject() {
- var _this2 = this;
-
- var dropState = this._interaction.dropState;
-
- if (this.type !== 'dropactivate' && (!this.dropzone || dropState.cur.dropzone !== this.dropzone || dropState.cur.element !== this.target)) {
- return;
- }
-
- dropState.prev.dropzone = this.dropzone;
- dropState.prev.element = this.target;
- dropState.rejected = true;
- dropState.events.enter = null;
- this.stopImmediatePropagation();
-
- if (this.type === 'dropactivate') {
- var activeDrops = dropState.activeDrops;
- var index = __arr_2.findIndex(activeDrops, function (_ref2) {
- var dropzone = _ref2.dropzone,
- element = _ref2.element;
- return dropzone === _this2.dropzone && element === _this2.target;
- });
- dropState.activeDrops = [].concat(_toConsumableArray(activeDrops.slice(0, index)), _toConsumableArray(activeDrops.slice(index + 1)));
- var deactivateEvent = new DropEvent(dropState, this.dragEvent, 'dropdeactivate');
- deactivateEvent.dropzone = this.dropzone;
- deactivateEvent.target = this.target;
- this.dropzone.fire(deactivateEvent);
- } else {
- this.dropzone.fire(new DropEvent(dropState, this.dragEvent, 'dragleave'));
- }
- }
- }, {
- key: "preventDefault",
- value: function preventDefault() {}
- }, {
- key: "stopPropagation",
- value: function stopPropagation() {
- this.propagationStopped = true;
- }
- }, {
- key: "stopImmediatePropagation",
- value: function stopImmediatePropagation() {
- this.immediatePropagationStopped = this.propagationStopped = true;
- }
- }]);
-
- return DropEvent;
- }(___BaseEvent2_2["default"]);
-
- var ___default_2 = DropEvent;
- _$DropEvent_2["default"] = ___default_2;
-
- var _$drop_3 = {};
- "use strict";
-
- Object.defineProperty(_$drop_3, "__esModule", {
- value: true
- });
- _$drop_3["default"] = void 0;
-
- var __utils_3 = ___interopRequireWildcard_3(_$utils_55);
-
- var _drag = ___interopRequireDefault_3(_$drag_1);
-
- var _DropEvent = ___interopRequireDefault_3(_$DropEvent_2);
-
- function ___interopRequireDefault_3(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- function ___interopRequireWildcard_3(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
-
- function __install_3(scope) {
- var actions = scope.actions,
- interact = scope.interact,
- Interactable = scope.Interactable,
- interactions = scope.interactions,
- defaults = scope.defaults;
- scope.usePlugin(_drag["default"]);
- interactions.signals.on('before-action-start', function (_ref) {
- var interaction = _ref.interaction;
-
- if (interaction.prepared.name !== 'drag') {
- return;
- }
-
- interaction.dropState = {
- cur: {
- dropzone: null,
- element: null
- },
- prev: {
- dropzone: null,
- element: null
- },
- rejected: null,
- events: null,
- activeDrops: null
- };
- });
- interactions.signals.on('after-action-start', function (_ref2) {
- var interaction = _ref2.interaction,
- event = _ref2.event,
- dragEvent = _ref2.iEvent;
-
- if (interaction.prepared.name !== 'drag') {
- return;
- }
-
- var dropState = interaction.dropState; // reset active dropzones
-
- dropState.activeDrops = null;
- dropState.events = null;
- dropState.activeDrops = getActiveDrops(scope, interaction.element);
- dropState.events = getDropEvents(interaction, event, dragEvent);
-
- if (dropState.events.activate) {
- fireActivationEvents(dropState.activeDrops, dropState.events.activate);
- }
- }); // FIXME proper signal types
-
- interactions.signals.on('action-move', function (arg) {
- return onEventCreated(arg, scope);
- });
- interactions.signals.on('action-end', function (arg) {
- return onEventCreated(arg, scope);
- });
- interactions.signals.on('after-action-move', function (_ref3) {
- var interaction = _ref3.interaction;
-
- if (interaction.prepared.name !== 'drag') {
- return;
- }
-
- fireDropEvents(interaction, interaction.dropState.events);
- interaction.dropState.events = {};
- });
- interactions.signals.on('after-action-end', function (_ref4) {
- var interaction = _ref4.interaction;
-
- if (interaction.prepared.name !== 'drag') {
- return;
- }
-
- fireDropEvents(interaction, interaction.dropState.events);
- });
- interactions.signals.on('stop', function (_ref5) {
- var interaction = _ref5.interaction;
-
- if (interaction.prepared.name !== 'drag') {
- return;
- }
-
- var dropState = interaction.dropState;
-
- if (dropState) {
- dropState.activeDrops = null;
- dropState.events = null;
- dropState.cur.dropzone = null;
- dropState.cur.element = null;
- dropState.prev.dropzone = null;
- dropState.prev.element = null;
- dropState.rejected = false;
- }
- });
- /**
- *
- * ```js
- * interact('.drop').dropzone({
- * accept: '.can-drop' || document.getElementById('single-drop'),
- * overlap: 'pointer' || 'center' || zeroToOne
- * }
- * ```
- *
- * Returns or sets whether draggables can be dropped onto this target to
- * trigger drop events
- *
- * Dropzones can receive the following events:
- * - `dropactivate` and `dropdeactivate` when an acceptable drag starts and ends
- * - `dragenter` and `dragleave` when a draggable enters and leaves the dropzone
- * - `dragmove` when a draggable that has entered the dropzone is moved
- * - `drop` when a draggable is dropped into this dropzone
- *
- * Use the `accept` option to allow only elements that match the given CSS
- * selector or element. The value can be:
- *
- * - **an Element** - only that element can be dropped into this dropzone.
- * - **a string**, - the element being dragged must match it as a CSS selector.
- * - **`null`** - accept options is cleared - it accepts any element.
- *
- * Use the `overlap` option to set how drops are checked for. The allowed
- * values are:
- *
- * - `'pointer'`, the pointer must be over the dropzone (default)
- * - `'center'`, the draggable element's center must be over the dropzone
- * - a number from 0-1 which is the `(intersection area) / (draggable area)`.
- * e.g. `0.5` for drop to happen when half of the area of the draggable is
- * over the dropzone
- *
- * Use the `checker` option to specify a function to check if a dragged element
- * is over this Interactable.
- *
- * @param {boolean | object | null} [options] The new options to be set.
- * @return {boolean | Interactable} The current setting or this Interactable
- */
-
- Interactable.prototype.dropzone = function (options) {
- return dropzoneMethod(this, options);
- };
- /**
- * ```js
- * interact(target)
- * .dropChecker(function(dragEvent, // related dragmove or dragend event
- * event, // TouchEvent/PointerEvent/MouseEvent
- * dropped, // bool result of the default checker
- * dropzone, // dropzone Interactable
- * dropElement, // dropzone elemnt
- * draggable, // draggable Interactable
- * draggableElement) {// draggable element
- *
- * return dropped && event.target.hasAttribute('allow-drop')
- * }
- * ```
- */
-
-
- Interactable.prototype.dropCheck = function (dragEvent, event, draggable, draggableElement, dropElement, rect) {
- return dropCheckMethod(this, dragEvent, event, draggable, draggableElement, dropElement, rect);
- };
- /**
- * Returns or sets whether the dimensions of dropzone elements are calculated
- * on every dragmove or only on dragstart for the default dropChecker
- *
- * @param {boolean} [newValue] True to check on each move. False to check only
- * before start
- * @return {boolean | interact} The current setting or interact
- */
-
-
- interact.dynamicDrop = function (newValue) {
- if (__utils_3.is.bool(newValue)) {
- // if (dragging && scope.dynamicDrop !== newValue && !newValue) {
- // calcRects(dropzones)
- // }
- scope.dynamicDrop = newValue;
- return interact;
- }
-
- return scope.dynamicDrop;
- };
-
- __utils_3.arr.merge(actions.eventTypes, ['dragenter', 'dragleave', 'dropactivate', 'dropdeactivate', 'dropmove', 'drop']);
- actions.methodDict.drop = 'dropzone';
- scope.dynamicDrop = false;
- defaults.actions.drop = drop.defaults;
- }
-
- function collectDrops(_ref6, draggableElement) {
- var interactables = _ref6.interactables;
- var drops = []; // collect all dropzones and their elements which qualify for a drop
-
- for (var _i = 0; _i < interactables.list.length; _i++) {
- var _ref7;
-
- _ref7 = interactables.list[_i];
- var dropzone = _ref7;
-
- if (!dropzone.options.drop.enabled) {
- continue;
- }
-
- var accept = dropzone.options.drop.accept; // test the draggable draggableElement against the dropzone's accept setting
-
- if (__utils_3.is.element(accept) && accept !== draggableElement || __utils_3.is.string(accept) && !__utils_3.dom.matchesSelector(draggableElement, accept) || __utils_3.is.func(accept) && !accept({
- dropzone: dropzone,
- draggableElement: draggableElement
- })) {
- continue;
- } // query for new elements if necessary
-
-
- var dropElements = __utils_3.is.string(dropzone.target) ? dropzone._context.querySelectorAll(dropzone.target) : __utils_3.is.array(dropzone.target) ? dropzone.target : [dropzone.target];
-
- for (var _i2 = 0; _i2 < dropElements.length; _i2++) {
- var _ref8;
-
- _ref8 = dropElements[_i2];
- var dropzoneElement = _ref8;
-
- if (dropzoneElement !== draggableElement) {
- drops.push({
- dropzone: dropzone,
- element: dropzoneElement
- });
- }
- }
- }
-
- return drops;
- }
-
- function fireActivationEvents(activeDrops, event) {
- // loop through all active dropzones and trigger event
- for (var _i3 = 0; _i3 < activeDrops.length; _i3++) {
- var _ref9;
-
- _ref9 = activeDrops[_i3];
- var _ref10 = _ref9,
- dropzone = _ref10.dropzone,
- element = _ref10.element;
- event.dropzone = dropzone; // set current element as event target
-
- event.target = element;
- dropzone.fire(event);
- event.propagationStopped = event.immediatePropagationStopped = false;
- }
- } // return a new array of possible drops. getActiveDrops should always be
- // called when a drag has just started or a drag event happens while
- // dynamicDrop is true
-
-
- function getActiveDrops(scope, dragElement) {
- // get dropzones and their elements that could receive the draggable
- var activeDrops = collectDrops(scope, dragElement);
-
- for (var _i4 = 0; _i4 < activeDrops.length; _i4++) {
- var _ref11;
-
- _ref11 = activeDrops[_i4];
- var activeDrop = _ref11;
- activeDrop.rect = activeDrop.dropzone.getRect(activeDrop.element);
- }
-
- return activeDrops;
- }
-
- function getDrop(_ref12, dragEvent, pointerEvent) {
- var dropState = _ref12.dropState,
- draggable = _ref12.interactable,
- dragElement = _ref12.element;
- var validDrops = []; // collect all dropzones and their elements which qualify for a drop
-
- for (var _i5 = 0; _i5 < dropState.activeDrops.length; _i5++) {
- var _ref13;
-
- _ref13 = dropState.activeDrops[_i5];
- var _ref14 = _ref13,
- dropzone = _ref14.dropzone,
- dropzoneElement = _ref14.element,
- rect = _ref14.rect;
- validDrops.push(dropzone.dropCheck(dragEvent, pointerEvent, draggable, dragElement, dropzoneElement, rect) ? dropzoneElement : null);
- } // get the most appropriate dropzone based on DOM depth and order
-
-
- var dropIndex = __utils_3.dom.indexOfDeepestElement(validDrops);
- return dropState.activeDrops[dropIndex] || null;
- }
-
- function getDropEvents(interaction, _pointerEvent, dragEvent) {
- var dropState = interaction.dropState;
- var dropEvents = {
- enter: null,
- leave: null,
- activate: null,
- deactivate: null,
- move: null,
- drop: null
- };
-
- if (dragEvent.type === 'dragstart') {
- dropEvents.activate = new _DropEvent["default"](dropState, dragEvent, 'dropactivate');
- dropEvents.activate.target = null;
- dropEvents.activate.dropzone = null;
- }
-
- if (dragEvent.type === 'dragend') {
- dropEvents.deactivate = new _DropEvent["default"](dropState, dragEvent, 'dropdeactivate');
- dropEvents.deactivate.target = null;
- dropEvents.deactivate.dropzone = null;
- }
-
- if (dropState.rejected) {
- return dropEvents;
- }
-
- if (dropState.cur.element !== dropState.prev.element) {
- // if there was a previous dropzone, create a dragleave event
- if (dropState.prev.dropzone) {
- dropEvents.leave = new _DropEvent["default"](dropState, dragEvent, 'dragleave');
- dragEvent.dragLeave = dropEvents.leave.target = dropState.prev.element;
- dragEvent.prevDropzone = dropEvents.leave.dropzone = dropState.prev.dropzone;
- } // if dropzone is not null, create a dragenter event
-
-
- if (dropState.cur.dropzone) {
- dropEvents.enter = new _DropEvent["default"](dropState, dragEvent, 'dragenter');
- dragEvent.dragEnter = dropState.cur.element;
- dragEvent.dropzone = dropState.cur.dropzone;
- }
- }
-
- if (dragEvent.type === 'dragend' && dropState.cur.dropzone) {
- dropEvents.drop = new _DropEvent["default"](dropState, dragEvent, 'drop');
- dragEvent.dropzone = dropState.cur.dropzone;
- dragEvent.relatedTarget = dropState.cur.element;
- }
-
- if (dragEvent.type === 'dragmove' && dropState.cur.dropzone) {
- dropEvents.move = new _DropEvent["default"](dropState, dragEvent, 'dropmove');
- dropEvents.move.dragmove = dragEvent;
- dragEvent.dropzone = dropState.cur.dropzone;
- }
-
- return dropEvents;
- }
-
- function fireDropEvents(interaction, events) {
- var dropState = interaction.dropState;
- var activeDrops = dropState.activeDrops,
- cur = dropState.cur,
- prev = dropState.prev;
-
- if (events.leave) {
- prev.dropzone.fire(events.leave);
- }
-
- if (events.move) {
- cur.dropzone.fire(events.move);
- }
-
- if (events.enter) {
- cur.dropzone.fire(events.enter);
- }
-
- if (events.drop) {
- cur.dropzone.fire(events.drop);
- }
-
- if (events.deactivate) {
- fireActivationEvents(activeDrops, events.deactivate);
- }
-
- dropState.prev.dropzone = cur.dropzone;
- dropState.prev.element = cur.element;
- }
-
- function onEventCreated(_ref15, scope) {
- var interaction = _ref15.interaction,
- iEvent = _ref15.iEvent,
- event = _ref15.event;
-
- if (iEvent.type !== 'dragmove' && iEvent.type !== 'dragend') {
- return;
- }
-
- var dropState = interaction.dropState;
-
- if (scope.dynamicDrop) {
- dropState.activeDrops = getActiveDrops(scope, interaction.element);
- }
-
- var dragEvent = iEvent;
- var dropResult = getDrop(interaction, dragEvent, event); // update rejected status
-
- dropState.rejected = dropState.rejected && !!dropResult && dropResult.dropzone === dropState.cur.dropzone && dropResult.element === dropState.cur.element;
- dropState.cur.dropzone = dropResult && dropResult.dropzone;
- dropState.cur.element = dropResult && dropResult.element;
- dropState.events = getDropEvents(interaction, event, dragEvent);
- }
-
- function dropzoneMethod(interactable, options) {
- if (__utils_3.is.object(options)) {
- interactable.options.drop.enabled = options.enabled !== false;
-
- if (options.listeners) {
- var normalized = __utils_3.normalizeListeners(options.listeners); // rename 'drop' to '' as it will be prefixed with 'drop'
-
- var corrected = Object.keys(normalized).reduce(function (acc, type) {
- var correctedType = /^(enter|leave)/.test(type) ? "drag".concat(type) : /^(activate|deactivate|move)/.test(type) ? "drop".concat(type) : type;
- acc[correctedType] = normalized[type];
- return acc;
- }, {});
- interactable.off(interactable.options.drop.listeners);
- interactable.on(corrected);
- interactable.options.drop.listeners = corrected;
- }
-
- if (__utils_3.is.func(options.ondrop)) {
- interactable.on('drop', options.ondrop);
- }
-
- if (__utils_3.is.func(options.ondropactivate)) {
- interactable.on('dropactivate', options.ondropactivate);
- }
-
- if (__utils_3.is.func(options.ondropdeactivate)) {
- interactable.on('dropdeactivate', options.ondropdeactivate);
- }
-
- if (__utils_3.is.func(options.ondragenter)) {
- interactable.on('dragenter', options.ondragenter);
- }
-
- if (__utils_3.is.func(options.ondragleave)) {
- interactable.on('dragleave', options.ondragleave);
- }
-
- if (__utils_3.is.func(options.ondropmove)) {
- interactable.on('dropmove', options.ondropmove);
- }
-
- if (/^(pointer|center)$/.test(options.overlap)) {
- interactable.options.drop.overlap = options.overlap;
- } else if (__utils_3.is.number(options.overlap)) {
- interactable.options.drop.overlap = Math.max(Math.min(1, options.overlap), 0);
- }
-
- if ('accept' in options) {
- interactable.options.drop.accept = options.accept;
- }
-
- if ('checker' in options) {
- interactable.options.drop.checker = options.checker;
- }
-
- return interactable;
- }
-
- if (__utils_3.is.bool(options)) {
- interactable.options.drop.enabled = options;
- return interactable;
- }
-
- return interactable.options.drop;
- }
-
- function dropCheckMethod(interactable, dragEvent, event, draggable, draggableElement, dropElement, rect) {
- var dropped = false; // if the dropzone has no rect (eg. display: none)
- // call the custom dropChecker or just return false
-
- if (!(rect = rect || interactable.getRect(dropElement))) {
- return interactable.options.drop.checker ? interactable.options.drop.checker(dragEvent, event, dropped, interactable, dropElement, draggable, draggableElement) : false;
- }
-
- var dropOverlap = interactable.options.drop.overlap;
-
- if (dropOverlap === 'pointer') {
- var origin = __utils_3.getOriginXY(draggable, draggableElement, 'drag');
- var page = __utils_3.pointer.getPageXY(dragEvent);
- page.x += origin.x;
- page.y += origin.y;
- var horizontal = page.x > rect.left && page.x < rect.right;
- var vertical = page.y > rect.top && page.y < rect.bottom;
- dropped = horizontal && vertical;
- }
-
- var dragRect = draggable.getRect(draggableElement);
-
- if (dragRect && dropOverlap === 'center') {
- var cx = dragRect.left + dragRect.width / 2;
- var cy = dragRect.top + dragRect.height / 2;
- dropped = cx >= rect.left && cx <= rect.right && cy >= rect.top && cy <= rect.bottom;
- }
-
- if (dragRect && __utils_3.is.number(dropOverlap)) {
- var overlapArea = Math.max(0, Math.min(rect.right, dragRect.right) - Math.max(rect.left, dragRect.left)) * Math.max(0, Math.min(rect.bottom, dragRect.bottom) - Math.max(rect.top, dragRect.top));
- var overlapRatio = overlapArea / (dragRect.width * dragRect.height);
- dropped = overlapRatio >= dropOverlap;
- }
-
- if (interactable.options.drop.checker) {
- dropped = interactable.options.drop.checker(dragEvent, event, dropped, interactable, dropElement, draggable, draggableElement);
- }
-
- return dropped;
- }
-
- var drop = {
- id: 'actions/drop',
- install: __install_3,
- getActiveDrops: getActiveDrops,
- getDrop: getDrop,
- getDropEvents: getDropEvents,
- fireDropEvents: fireDropEvents,
- defaults: {
- enabled: false,
- accept: null,
- overlap: 'pointer'
- }
- };
- var ___default_3 = drop;
- _$drop_3["default"] = ___default_3;
-
- var _$gesture_4 = {};
- "use strict";
-
- Object.defineProperty(_$gesture_4, "__esModule", {
- value: true
- });
- _$gesture_4["default"] = void 0;
-
- var ___InteractEvent_4 = ___interopRequireDefault_4(_$InteractEvent_15);
-
- var ___scope_4 = _$scope_24({});
-
- var __utils_4 = ___interopRequireWildcard_4(_$utils_55);
-
- function ___interopRequireWildcard_4(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
-
- function ___interopRequireDefault_4(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- ___scope_4.ActionName.Gesture = 'gesture';
-
- function __install_4(scope) {
- var actions = scope.actions,
- Interactable = scope.Interactable,
- interactions = scope.interactions,
- defaults = scope.defaults;
- /**
- * ```js
- * interact(element).gesturable({
- * onstart: function (event) {},
- * onmove : function (event) {},
- * onend : function (event) {},
- *
- * // limit multiple gestures.
- * // See the explanation in {@link Interactable.draggable} example
- * max: Infinity,
- * maxPerElement: 1,
- * })
- *
- * var isGestureable = interact(element).gesturable()
- * ```
- *
- * Gets or sets whether multitouch gestures can be performed on the target
- *
- * @param {boolean | object} [options] true/false or An object with event
- * listeners to be fired on gesture events (makes the Interactable gesturable)
- * @return {boolean | Interactable} A boolean indicating if this can be the
- * target of gesture events, or this Interactable
- */
-
- Interactable.prototype.gesturable = function (options) {
- if (__utils_4.is.object(options)) {
- this.options.gesture.enabled = options.enabled !== false;
- this.setPerAction('gesture', options);
- this.setOnEvents('gesture', options);
- return this;
- }
-
- if (__utils_4.is.bool(options)) {
- this.options.gesture.enabled = options;
- return this;
- }
-
- return this.options.gesture;
- };
-
- interactions.signals.on('action-start', updateGestureProps);
- interactions.signals.on('action-move', updateGestureProps);
- interactions.signals.on('action-end', updateGestureProps);
- interactions.signals.on('new', function (_ref) {
- var interaction = _ref.interaction;
- interaction.gesture = {
- angle: 0,
- distance: 0,
- scale: 1,
- startAngle: 0,
- startDistance: 0
- };
- });
- actions[___scope_4.ActionName.Gesture] = gesture;
- actions.names.push(___scope_4.ActionName.Gesture);
- __utils_4.arr.merge(actions.eventTypes, ['gesturestart', 'gesturemove', 'gestureend']);
- actions.methodDict.gesture = 'gesturable';
- defaults.actions.gesture = gesture.defaults;
- }
-
- var gesture = {
- id: 'actions/gesture',
- install: __install_4,
- defaults: {},
- checker: function checker(_pointer, _event, _interactable, _element, interaction) {
- if (interaction.pointers.length >= 2) {
- return {
- name: 'gesture'
- };
- }
-
- return null;
- },
- getCursor: function getCursor() {
- return '';
- }
- };
-
- function updateGestureProps(_ref2) {
- var interaction = _ref2.interaction,
- iEvent = _ref2.iEvent,
- event = _ref2.event,
- phase = _ref2.phase;
-
- if (interaction.prepared.name !== 'gesture') {
- return;
- }
-
- var pointers = interaction.pointers.map(function (p) {
- return p.pointer;
- });
- var starting = phase === 'start';
- var ending = phase === 'end';
- var deltaSource = interaction.interactable.options.deltaSource;
- iEvent.touches = [pointers[0], pointers[1]];
-
- if (starting) {
- iEvent.distance = __utils_4.pointer.touchDistance(pointers, deltaSource);
- iEvent.box = __utils_4.pointer.touchBBox(pointers);
- iEvent.scale = 1;
- iEvent.ds = 0;
- iEvent.angle = __utils_4.pointer.touchAngle(pointers, deltaSource);
- iEvent.da = 0;
- interaction.gesture.startDistance = iEvent.distance;
- interaction.gesture.startAngle = iEvent.angle;
- } else if (ending || event instanceof ___InteractEvent_4["default"]) {
- var prevEvent = interaction.prevEvent;
- iEvent.distance = prevEvent.distance;
- iEvent.box = prevEvent.box;
- iEvent.scale = prevEvent.scale;
- iEvent.ds = 0;
- iEvent.angle = prevEvent.angle;
- iEvent.da = 0;
- } else {
- iEvent.distance = __utils_4.pointer.touchDistance(pointers, deltaSource);
- iEvent.box = __utils_4.pointer.touchBBox(pointers);
- iEvent.scale = iEvent.distance / interaction.gesture.startDistance;
- iEvent.angle = __utils_4.pointer.touchAngle(pointers, deltaSource);
- iEvent.ds = iEvent.scale - interaction.gesture.scale;
- iEvent.da = iEvent.angle - interaction.gesture.angle;
- }
-
- interaction.gesture.distance = iEvent.distance;
- interaction.gesture.angle = iEvent.angle;
-
- if (__utils_4.is.number(iEvent.scale) && iEvent.scale !== Infinity && !isNaN(iEvent.scale)) {
- interaction.gesture.scale = iEvent.scale;
- }
- }
-
- var ___default_4 = gesture;
- _$gesture_4["default"] = ___default_4;
-
- var _$resize_6 = {};
- "use strict";
-
- Object.defineProperty(_$resize_6, "__esModule", {
- value: true
- });
- _$resize_6["default"] = void 0;
-
- var ___scope_6 = _$scope_24({});
-
- var __utils_6 = ___interopRequireWildcard_6(_$utils_55);
-
- function ___interopRequireWildcard_6(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
-
- ___scope_6.ActionName.Resize = 'resize';
-
- function __install_6(scope) {
- var actions = scope.actions,
- browser = scope.browser,
- Interactable = scope.Interactable,
- interactions = scope.interactions,
- defaults = scope.defaults; // Less Precision with touch input
-
- interactions.signals.on('new', function (interaction) {
- interaction.resizeAxes = 'xy';
- });
- interactions.signals.on('action-start', start);
- interactions.signals.on('action-move', __move_6);
- interactions.signals.on('action-start', updateEventAxes);
- interactions.signals.on('action-move', updateEventAxes);
- resize.cursors = initCursors(browser);
- resize.defaultMargin = browser.supportsTouch || browser.supportsPointerEvent ? 20 : 10;
- /**
- * ```js
- * interact(element).resizable({
- * onstart: function (event) {},
- * onmove : function (event) {},
- * onend : function (event) {},
- *
- * edges: {
- * top : true, // Use pointer coords to check for resize.
- * left : false, // Disable resizing from left edge.
- * bottom: '.resize-s',// Resize if pointer target matches selector
- * right : handleEl // Resize if pointer target is the given Element
- * },
- *
- * // Width and height can be adjusted independently. When `true`, width and
- * // height are adjusted at a 1:1 ratio.
- * square: false,
- *
- * // Width and height can be adjusted independently. When `true`, width and
- * // height maintain the aspect ratio they had when resizing started.
- * preserveAspectRatio: false,
- *
- * // a value of 'none' will limit the resize rect to a minimum of 0x0
- * // 'negate' will allow the rect to have negative width/height
- * // 'reposition' will keep the width/height positive by swapping
- * // the top and bottom edges and/or swapping the left and right edges
- * invert: 'none' || 'negate' || 'reposition'
- *
- * // limit multiple resizes.
- * // See the explanation in the {@link Interactable.draggable} example
- * max: Infinity,
- * maxPerElement: 1,
- * })
- *
- * var isResizeable = interact(element).resizable()
- * ```
- *
- * Gets or sets whether resize actions can be performed on the target
- *
- * @param {boolean | object} [options] true/false or An object with event
- * listeners to be fired on resize events (object makes the Interactable
- * resizable)
- * @return {boolean | Interactable} A boolean indicating if this can be the
- * target of resize elements, or this Interactable
- */
-
- Interactable.prototype.resizable = function (options) {
- return resizable(this, options, scope);
- };
-
- actions[___scope_6.ActionName.Resize] = resize;
- actions.names.push(___scope_6.ActionName.Resize);
- __utils_6.arr.merge(actions.eventTypes, ['resizestart', 'resizemove', 'resizeinertiastart', 'resizeresume', 'resizeend']);
- actions.methodDict.resize = 'resizable';
- defaults.actions.resize = resize.defaults;
- }
-
- var resize = {
- id: 'actions/resize',
- install: __install_6,
- defaults: {
- square: false,
- preserveAspectRatio: false,
- axis: 'xy',
- // use default margin
- margin: NaN,
- // object with props left, right, top, bottom which are
- // true/false values to resize when the pointer is over that edge,
- // CSS selectors to match the handles for each direction
- // or the Elements for each handle
- edges: null,
- // a value of 'none' will limit the resize rect to a minimum of 0x0
- // 'negate' will alow the rect to have negative width/height
- // 'reposition' will keep the width/height positive by swapping
- // the top and bottom edges and/or swapping the left and right edges
- invert: 'none'
- },
- checker: function checker(_pointer, _event, interactable, element, interaction, rect) {
- if (!rect) {
- return null;
- }
-
- var page = __utils_6.extend({}, interaction.coords.cur.page);
- var options = interactable.options;
-
- if (options.resize.enabled) {
- var resizeOptions = options.resize;
- var resizeEdges = {
- left: false,
- right: false,
- top: false,
- bottom: false
- }; // if using resize.edges
-
- if (__utils_6.is.object(resizeOptions.edges)) {
- for (var edge in resizeEdges) {
- resizeEdges[edge] = checkResizeEdge(edge, resizeOptions.edges[edge], page, interaction._latestPointer.eventTarget, element, rect, resizeOptions.margin || this.defaultMargin);
- }
-
- resizeEdges.left = resizeEdges.left && !resizeEdges.right;
- resizeEdges.top = resizeEdges.top && !resizeEdges.bottom;
-
- if (resizeEdges.left || resizeEdges.right || resizeEdges.top || resizeEdges.bottom) {
- return {
- name: 'resize',
- edges: resizeEdges
- };
- }
- } else {
- var right = options.resize.axis !== 'y' && page.x > rect.right - this.defaultMargin;
- var bottom = options.resize.axis !== 'x' && page.y > rect.bottom - this.defaultMargin;
-
- if (right || bottom) {
- return {
- name: 'resize',
- axes: (right ? 'x' : '') + (bottom ? 'y' : '')
- };
- }
- }
- }
-
- return null;
- },
- cursors: null,
- getCursor: function getCursor(action) {
- var cursors = resize.cursors;
-
- if (action.axis) {
- return cursors[action.name + action.axis];
- } else if (action.edges) {
- var cursorKey = '';
- var edgeNames = ['top', 'bottom', 'left', 'right'];
-
- for (var i = 0; i < 4; i++) {
- if (action.edges[edgeNames[i]]) {
- cursorKey += edgeNames[i];
- }
- }
-
- return cursors[cursorKey];
- }
-
- return null;
- },
- defaultMargin: null
- };
-
- function resizable(interactable, options, scope) {
- if (__utils_6.is.object(options)) {
- interactable.options.resize.enabled = options.enabled !== false;
- interactable.setPerAction('resize', options);
- interactable.setOnEvents('resize', options);
-
- if (__utils_6.is.string(options.axis) && /^x$|^y$|^xy$/.test(options.axis)) {
- interactable.options.resize.axis = options.axis;
- } else if (options.axis === null) {
- interactable.options.resize.axis = scope.defaults.actions.resize.axis;
- }
-
- if (__utils_6.is.bool(options.preserveAspectRatio)) {
- interactable.options.resize.preserveAspectRatio = options.preserveAspectRatio;
- } else if (__utils_6.is.bool(options.square)) {
- interactable.options.resize.square = options.square;
- }
-
- return interactable;
- }
-
- if (__utils_6.is.bool(options)) {
- interactable.options.resize.enabled = options;
- return interactable;
- }
-
- return interactable.options.resize;
- }
-
- function checkResizeEdge(name, value, page, element, interactableElement, rect, margin) {
- // false, '', undefined, null
- if (!value) {
- return false;
- } // true value, use pointer coords and element rect
-
-
- if (value === true) {
- // if dimensions are negative, "switch" edges
- var width = __utils_6.is.number(rect.width) ? rect.width : rect.right - rect.left;
- var height = __utils_6.is.number(rect.height) ? rect.height : rect.bottom - rect.top; // don't use margin greater than half the relevent dimension
-
- margin = Math.min(margin, (name === 'left' || name === 'right' ? width : height) / 2);
-
- if (width < 0) {
- if (name === 'left') {
- name = 'right';
- } else if (name === 'right') {
- name = 'left';
- }
- }
-
- if (height < 0) {
- if (name === 'top') {
- name = 'bottom';
- } else if (name === 'bottom') {
- name = 'top';
- }
- }
-
- if (name === 'left') {
- return page.x < (width >= 0 ? rect.left : rect.right) + margin;
- }
-
- if (name === 'top') {
- return page.y < (height >= 0 ? rect.top : rect.bottom) + margin;
- }
-
- if (name === 'right') {
- return page.x > (width >= 0 ? rect.right : rect.left) - margin;
- }
-
- if (name === 'bottom') {
- return page.y > (height >= 0 ? rect.bottom : rect.top) - margin;
- }
- } // the remaining checks require an element
-
-
- if (!__utils_6.is.element(element)) {
- return false;
- }
-
- return __utils_6.is.element(value) // the value is an element to use as a resize handle
- ? value === element // otherwise check if element matches value as selector
- : __utils_6.dom.matchesUpTo(element, value, interactableElement);
- }
-
- function initCursors(browser) {
- return browser.isIe9 ? {
- x: 'e-resize',
- y: 's-resize',
- xy: 'se-resize',
- top: 'n-resize',
- left: 'w-resize',
- bottom: 's-resize',
- right: 'e-resize',
- topleft: 'se-resize',
- bottomright: 'se-resize',
- topright: 'ne-resize',
- bottomleft: 'ne-resize'
- } : {
- x: 'ew-resize',
- y: 'ns-resize',
- xy: 'nwse-resize',
- top: 'ns-resize',
- left: 'ew-resize',
- bottom: 'ns-resize',
- right: 'ew-resize',
- topleft: 'nwse-resize',
- bottomright: 'nwse-resize',
- topright: 'nesw-resize',
- bottomleft: 'nesw-resize'
- };
- }
-
- function start(_ref) {
- var iEvent = _ref.iEvent,
- interaction = _ref.interaction;
-
- if (interaction.prepared.name !== 'resize' || !interaction.prepared.edges) {
- return;
- }
-
- var startRect = interaction.rect;
- var resizeOptions = interaction.interactable.options.resize;
- /*
- * When using the `resizable.square` or `resizable.preserveAspectRatio` options, resizing from one edge
- * will affect another. E.g. with `resizable.square`, resizing to make the right edge larger will make
- * the bottom edge larger by the same amount. We call these 'linked' edges. Any linked edges will depend
- * on the active edges and the edge being interacted with.
- */
-
- if (resizeOptions.square || resizeOptions.preserveAspectRatio) {
- var linkedEdges = __utils_6.extend({}, interaction.prepared.edges);
- linkedEdges.top = linkedEdges.top || linkedEdges.left && !linkedEdges.bottom;
- linkedEdges.left = linkedEdges.left || linkedEdges.top && !linkedEdges.right;
- linkedEdges.bottom = linkedEdges.bottom || linkedEdges.right && !linkedEdges.top;
- linkedEdges.right = linkedEdges.right || linkedEdges.bottom && !linkedEdges.left;
- interaction.prepared._linkedEdges = linkedEdges;
- } else {
- interaction.prepared._linkedEdges = null;
- } // if using `resizable.preserveAspectRatio` option, record aspect ratio at the start of the resize
-
-
- if (resizeOptions.preserveAspectRatio) {
- interaction.resizeStartAspectRatio = startRect.width / startRect.height;
- }
-
- interaction.resizeRects = {
- start: startRect,
- current: __utils_6.extend({}, startRect),
- inverted: __utils_6.extend({}, startRect),
- previous: __utils_6.extend({}, startRect),
- delta: {
- left: 0,
- right: 0,
- width: 0,
- top: 0,
- bottom: 0,
- height: 0
- }
- };
- iEvent.rect = interaction.resizeRects.inverted;
- iEvent.deltaRect = interaction.resizeRects.delta;
- }
-
- function __move_6(_ref2) {
- var iEvent = _ref2.iEvent,
- interaction = _ref2.interaction;
-
- if (interaction.prepared.name !== 'resize' || !interaction.prepared.edges) {
- return;
- }
-
- var resizeOptions = interaction.interactable.options.resize;
- var invert = resizeOptions.invert;
- var invertible = invert === 'reposition' || invert === 'negate';
- var edges = interaction.prepared.edges; // eslint-disable-next-line no-shadow
-
- var start = interaction.resizeRects.start;
- var current = interaction.resizeRects.current;
- var inverted = interaction.resizeRects.inverted;
- var deltaRect = interaction.resizeRects.delta;
- var previous = __utils_6.extend(interaction.resizeRects.previous, inverted);
- var originalEdges = edges;
- var eventDelta = __utils_6.extend({}, iEvent.delta);
-
- if (resizeOptions.preserveAspectRatio || resizeOptions.square) {
- // `resize.preserveAspectRatio` takes precedence over `resize.square`
- var startAspectRatio = resizeOptions.preserveAspectRatio ? interaction.resizeStartAspectRatio : 1;
- edges = interaction.prepared._linkedEdges;
-
- if (originalEdges.left && originalEdges.bottom || originalEdges.right && originalEdges.top) {
- eventDelta.y = -eventDelta.x / startAspectRatio;
- } else if (originalEdges.left || originalEdges.right) {
- eventDelta.y = eventDelta.x / startAspectRatio;
- } else if (originalEdges.top || originalEdges.bottom) {
- eventDelta.x = eventDelta.y * startAspectRatio;
- }
- } // update the 'current' rect without modifications
-
-
- if (edges.top) {
- current.top += eventDelta.y;
- }
-
- if (edges.bottom) {
- current.bottom += eventDelta.y;
- }
-
- if (edges.left) {
- current.left += eventDelta.x;
- }
-
- if (edges.right) {
- current.right += eventDelta.x;
- }
-
- if (invertible) {
- // if invertible, copy the current rect
- __utils_6.extend(inverted, current);
-
- if (invert === 'reposition') {
- // swap edge values if necessary to keep width/height positive
- var swap;
-
- if (inverted.top > inverted.bottom) {
- swap = inverted.top;
- inverted.top = inverted.bottom;
- inverted.bottom = swap;
- }
-
- if (inverted.left > inverted.right) {
- swap = inverted.left;
- inverted.left = inverted.right;
- inverted.right = swap;
- }
- }
- } else {
- // if not invertible, restrict to minimum of 0x0 rect
- inverted.top = Math.min(current.top, start.bottom);
- inverted.bottom = Math.max(current.bottom, start.top);
- inverted.left = Math.min(current.left, start.right);
- inverted.right = Math.max(current.right, start.left);
- }
-
- inverted.width = inverted.right - inverted.left;
- inverted.height = inverted.bottom - inverted.top;
-
- for (var edge in inverted) {
- deltaRect[edge] = inverted[edge] - previous[edge];
- }
-
- iEvent.edges = interaction.prepared.edges;
- iEvent.rect = inverted;
- iEvent.deltaRect = deltaRect;
- }
-
- function updateEventAxes(_ref3) {
- var interaction = _ref3.interaction,
- iEvent = _ref3.iEvent,
- action = _ref3.action;
-
- if (action !== 'resize' || !interaction.resizeAxes) {
- return;
- }
-
- var options = interaction.interactable.options;
-
- if (options.resize.square) {
- if (interaction.resizeAxes === 'y') {
- iEvent.delta.x = iEvent.delta.y;
- } else {
- iEvent.delta.y = iEvent.delta.x;
- }
-
- iEvent.axes = 'xy';
- } else {
- iEvent.axes = interaction.resizeAxes;
-
- if (interaction.resizeAxes === 'x') {
- iEvent.delta.y = 0;
- } else if (interaction.resizeAxes === 'y') {
- iEvent.delta.x = 0;
- }
- }
- }
-
- var ___default_6 = resize;
- _$resize_6["default"] = ___default_6;
-
- var _$actions_5 = {};
- "use strict";
-
- Object.defineProperty(_$actions_5, "__esModule", {
- value: true
- });
- _$actions_5.install = __install_5;
- Object.defineProperty(_$actions_5, "drag", {
- enumerable: true,
- get: function get() {
- return ___drag_5["default"];
- }
- });
- Object.defineProperty(_$actions_5, "drop", {
- enumerable: true,
- get: function get() {
- return _drop["default"];
- }
- });
- Object.defineProperty(_$actions_5, "gesture", {
- enumerable: true,
- get: function get() {
- return _gesture["default"];
- }
- });
- Object.defineProperty(_$actions_5, "resize", {
- enumerable: true,
- get: function get() {
- return _resize["default"];
- }
- });
- _$actions_5.id = void 0;
-
- var ___drag_5 = ___interopRequireDefault_5(_$drag_1);
-
- var _drop = ___interopRequireDefault_5(_$drop_3);
-
- var _gesture = ___interopRequireDefault_5(_$gesture_4);
-
- var _resize = ___interopRequireDefault_5(_$resize_6);
-
- function ___interopRequireDefault_5(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- function __install_5(scope) {
- scope.usePlugin(_gesture["default"]);
- scope.usePlugin(_resize["default"]);
- scope.usePlugin(___drag_5["default"]);
- scope.usePlugin(_drop["default"]);
- }
-
- var id = 'actions';
- _$actions_5.id = id;
-
- var _$autoScroll_7 = {};
- "use strict";
-
- Object.defineProperty(_$autoScroll_7, "__esModule", {
- value: true
- });
- _$autoScroll_7.getContainer = getContainer;
- _$autoScroll_7.getScroll = getScroll;
- _$autoScroll_7.getScrollSize = getScrollSize;
- _$autoScroll_7.getScrollSizeDelta = getScrollSizeDelta;
- _$autoScroll_7["default"] = void 0;
-
- var __domUtils_7 = ___interopRequireWildcard_7(_$domUtils_50);
-
- var __is_7 = ___interopRequireWildcard_7(_$is_56);
-
- var ___raf_7 = ___interopRequireDefault_7(_$raf_61);
-
- /* removed: var _$rect_62 = require("@interactjs/utils/rect"); */;
-
- /* removed: var _$window_65 = require("@interactjs/utils/window"); */;
-
- function ___interopRequireDefault_7(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- function ___interopRequireWildcard_7(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
-
- function __install_7(scope) {
- var interactions = scope.interactions,
- defaults = scope.defaults,
- actions = scope.actions;
- scope.autoScroll = autoScroll;
-
- autoScroll.now = function () {
- return scope.now();
- };
-
- interactions.signals.on('new', function (_ref) {
- var interaction = _ref.interaction;
- interaction.autoScroll = null;
- });
- interactions.signals.on('destroy', function (_ref2) {
- var interaction = _ref2.interaction;
- interaction.autoScroll = null;
- autoScroll.stop();
-
- if (autoScroll.interaction) {
- autoScroll.interaction = null;
- }
- });
- interactions.signals.on('stop', autoScroll.stop);
- interactions.signals.on('action-move', function (arg) {
- return autoScroll.onInteractionMove(arg);
- });
- actions.eventTypes.push('autoscroll');
- defaults.perAction.autoScroll = autoScroll.defaults;
- }
-
- var autoScroll = {
- defaults: {
- enabled: false,
- margin: 60,
- // the item that is scrolled (Window or HTMLElement)
- container: null,
- // the scroll speed in pixels per second
- speed: 300
- },
- now: Date.now,
- interaction: null,
- i: null,
- x: 0,
- y: 0,
- isScrolling: false,
- prevTime: 0,
- margin: 0,
- speed: 0,
- start: function start(interaction) {
- autoScroll.isScrolling = true;
-
- ___raf_7["default"].cancel(autoScroll.i);
-
- interaction.autoScroll = autoScroll;
- autoScroll.interaction = interaction;
- autoScroll.prevTime = autoScroll.now();
- autoScroll.i = ___raf_7["default"].request(autoScroll.scroll);
- },
- stop: function stop() {
- autoScroll.isScrolling = false;
-
- if (autoScroll.interaction) {
- autoScroll.interaction.autoScroll = null;
- }
-
- ___raf_7["default"].cancel(autoScroll.i);
- },
- // scroll the window by the values in scroll.x/y
- scroll: function scroll() {
- var interaction = autoScroll.interaction;
- var interactable = interaction.interactable,
- element = interaction.element;
- var options = interactable.options[autoScroll.interaction.prepared.name].autoScroll;
- var container = getContainer(options.container, interactable, element);
- var now = autoScroll.now(); // change in time in seconds
-
- var dt = (now - autoScroll.prevTime) / 1000; // displacement
-
- var s = options.speed * dt;
-
- if (s >= 1) {
- var scrollBy = {
- x: autoScroll.x * s,
- y: autoScroll.y * s
- };
-
- if (scrollBy.x || scrollBy.y) {
- var prevScroll = getScroll(container);
-
- if (__is_7.window(container)) {
- container.scrollBy(scrollBy.x, scrollBy.y);
- } else if (container) {
- container.scrollLeft += scrollBy.x;
- container.scrollTop += scrollBy.y;
- }
-
- var curScroll = getScroll(container);
- var delta = {
- x: curScroll.x - prevScroll.x,
- y: curScroll.y - prevScroll.y
- };
-
- if (delta.x || delta.y) {
- interactable.fire({
- type: 'autoscroll',
- target: element,
- interactable: interactable,
- delta: delta,
- interaction: interaction,
- container: container
- });
- }
- }
-
- autoScroll.prevTime = now;
- }
-
- if (autoScroll.isScrolling) {
- ___raf_7["default"].cancel(autoScroll.i);
-
- autoScroll.i = ___raf_7["default"].request(autoScroll.scroll);
- }
- },
- check: function check(interactable, actionName) {
- var options = interactable.options;
- return options[actionName].autoScroll && options[actionName].autoScroll.enabled;
- },
- onInteractionMove: function onInteractionMove(_ref3) {
- var interaction = _ref3.interaction,
- pointer = _ref3.pointer;
-
- if (!(interaction.interacting() && autoScroll.check(interaction.interactable, interaction.prepared.name))) {
- return;
- }
-
- if (interaction.simulation) {
- autoScroll.x = autoScroll.y = 0;
- return;
- }
-
- var top;
- var right;
- var bottom;
- var left;
- var interactable = interaction.interactable,
- element = interaction.element;
- var options = interactable.options[interaction.prepared.name].autoScroll;
- var container = getContainer(options.container, interactable, element);
-
- if (__is_7.window(container)) {
- left = pointer.clientX < autoScroll.margin;
- top = pointer.clientY < autoScroll.margin;
- right = pointer.clientX > container.innerWidth - autoScroll.margin;
- bottom = pointer.clientY > container.innerHeight - autoScroll.margin;
- } else {
- var rect = __domUtils_7.getElementClientRect(container);
- left = pointer.clientX < rect.left + autoScroll.margin;
- top = pointer.clientY < rect.top + autoScroll.margin;
- right = pointer.clientX > rect.right - autoScroll.margin;
- bottom = pointer.clientY > rect.bottom - autoScroll.margin;
- }
-
- autoScroll.x = right ? 1 : left ? -1 : 0;
- autoScroll.y = bottom ? 1 : top ? -1 : 0;
-
- if (!autoScroll.isScrolling) {
- // set the autoScroll properties to those of the target
- autoScroll.margin = options.margin;
- autoScroll.speed = options.speed;
- autoScroll.start(interaction);
- }
- }
- };
-
- function getContainer(value, interactable, element) {
- return (__is_7.string(value) ? (0, _$rect_62.getStringOptionResult)(value, interactable, element) : value) || (0, _$window_65.getWindow)(element);
- }
-
- function getScroll(container) {
- if (__is_7.window(container)) {
- container = window.document.body;
- }
-
- return {
- x: container.scrollLeft,
- y: container.scrollTop
- };
- }
-
- function getScrollSize(container) {
- if (__is_7.window(container)) {
- container = window.document.body;
- }
-
- return {
- x: container.scrollWidth,
- y: container.scrollHeight
- };
- }
-
- function getScrollSizeDelta(_ref4, func) {
- var interaction = _ref4.interaction,
- element = _ref4.element;
- var scrollOptions = interaction && interaction.interactable.options[interaction.prepared.name].autoScroll;
-
- if (!scrollOptions || !scrollOptions.enabled) {
- func();
- return {
- x: 0,
- y: 0
- };
- }
-
- var scrollContainer = getContainer(scrollOptions.container, interaction.interactable, element);
- var prevSize = getScroll(scrollContainer);
- func();
- var curSize = getScroll(scrollContainer);
- return {
- x: curSize.x - prevSize.x,
- y: curSize.y - prevSize.y
- };
- }
-
- var ___default_7 = {
- id: 'auto-scroll',
- install: __install_7
- };
- _$autoScroll_7["default"] = ___default_7;
-
- var _$InteractableMethods_8 = {};
- "use strict";
-
- Object.defineProperty(_$InteractableMethods_8, "__esModule", {
- value: true
- });
- _$InteractableMethods_8["default"] = void 0;
-
- /* removed: var _$utils_55 = require("@interactjs/utils"); */;
-
- var __is_8 = ___interopRequireWildcard_8(_$is_56);
-
- function ___interopRequireWildcard_8(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
-
- function __install_8(scope) {
- var Interactable = scope.Interactable,
- actions = scope.actions;
- Interactable.prototype.getAction = getAction;
- /**
- * ```js
- * interact(element, { ignoreFrom: document.getElementById('no-action') })
- * // or
- * interact(element).ignoreFrom('input, textarea, a')
- * ```
- * @deprecated
- * If the target of the `mousedown`, `pointerdown` or `touchstart` event or any
- * of it's parents match the given CSS selector or Element, no
- * drag/resize/gesture is started.
- *
- * Don't use this method. Instead set the `ignoreFrom` option for each action
- * or for `pointerEvents`
- *
- * @example
- * interact(targett)
- * .draggable({
- * ignoreFrom: 'input, textarea, a[href]'',
- * })
- * .pointerEvents({
- * ignoreFrom: '[no-pointer]',
- * })
- *
- * @param {string | Element | null} [newValue] a CSS selector string, an
- * Element or `null` to not ignore any elements
- * @return {string | Element | object} The current ignoreFrom value or this
- * Interactable
- */
-
- Interactable.prototype.ignoreFrom = (0, _$utils_55.warnOnce)(function (newValue) {
- return this._backCompatOption('ignoreFrom', newValue);
- }, 'Interactable.ignoreFrom() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue}).');
- /**
- * @deprecated
- *
- * A drag/resize/gesture is started only If the target of the `mousedown`,
- * `pointerdown` or `touchstart` event or any of it's parents match the given
- * CSS selector or Element.
- *
- * Don't use this method. Instead set the `allowFrom` option for each action
- * or for `pointerEvents`
- *
- * @example
- * interact(targett)
- * .resizable({
- * allowFrom: '.resize-handle',
- * .pointerEvents({
- * allowFrom: '.handle',,
- * })
- *
- * @param {string | Element | null} [newValue] a CSS selector string, an
- * Element or `null` to allow from any element
- * @return {string | Element | object} The current allowFrom value or this
- * Interactable
- */
-
- Interactable.prototype.allowFrom = (0, _$utils_55.warnOnce)(function (newValue) {
- return this._backCompatOption('allowFrom', newValue);
- }, 'Interactable.allowFrom() has been deprecated. Use Interactble.draggable({allowFrom: newValue}).');
- /**
- * ```js
- * interact('.resize-drag')
- * .resizable(true)
- * .draggable(true)
- * .actionChecker(function (pointer, event, action, interactable, element, interaction) {
- *
- * if (interact.matchesSelector(event.target, '.drag-handle')) {
- * // force drag with handle target
- * action.name = drag
- * }
- * else {
- * // resize from the top and right edges
- * action.name = 'resize'
- * action.edges = { top: true, right: true }
- * }
- *
- * return action
- * })
- * ```
- *
- * Returns or sets the function used to check action to be performed on
- * pointerDown
- *
- * @param {function | null} [checker] A function which takes a pointer event,
- * defaultAction string, interactable, element and interaction as parameters
- * and returns an object with name property 'drag' 'resize' or 'gesture' and
- * optionally an `edges` object with boolean 'top', 'left', 'bottom' and right
- * props.
- * @return {Function | Interactable} The checker function or this Interactable
- */
-
- Interactable.prototype.actionChecker = actionChecker;
- /**
- * Returns or sets whether the the cursor should be changed depending on the
- * action that would be performed if the mouse were pressed and dragged.
- *
- * @param {boolean} [newValue]
- * @return {boolean | Interactable} The current setting or this Interactable
- */
-
- Interactable.prototype.styleCursor = styleCursor;
-
- Interactable.prototype.defaultActionChecker = function (pointer, event, interaction, element) {
- return defaultActionChecker(this, pointer, event, interaction, element, actions);
- };
- }
-
- function getAction(pointer, event, interaction, element) {
- var action = this.defaultActionChecker(pointer, event, interaction, element);
-
- if (this.options.actionChecker) {
- return this.options.actionChecker(pointer, event, action, this, element, interaction);
- }
-
- return action;
- }
-
- function defaultActionChecker(interactable, pointer, event, interaction, element, actions) {
- var rect = interactable.getRect(element);
- var buttons = event.buttons || {
- 0: 1,
- 1: 4,
- 3: 8,
- 4: 16
- }[event.button];
- var action = null;
-
- for (var _i = 0; _i < actions.names.length; _i++) {
- var _ref;
-
- _ref = actions.names[_i];
- var actionName = _ref;
-
- // check mouseButton setting if the pointer is down
- if (interaction.pointerIsDown && /mouse|pointer/.test(interaction.pointerType) && (buttons & interactable.options[actionName].mouseButtons) === 0) {
- continue;
- }
-
- action = actions[actionName].checker(pointer, event, interactable, element, interaction, rect);
-
- if (action) {
- return action;
- }
- }
- }
-
- function styleCursor(newValue) {
- if (__is_8.bool(newValue)) {
- this.options.styleCursor = newValue;
- return this;
- }
-
- if (newValue === null) {
- delete this.options.styleCursor;
- return this;
- }
-
- return this.options.styleCursor;
- }
-
- function actionChecker(checker) {
- if (__is_8.func(checker)) {
- this.options.actionChecker = checker;
- return this;
- }
-
- if (checker === null) {
- delete this.options.actionChecker;
- return this;
- }
-
- return this.options.actionChecker;
- }
-
- var ___default_8 = {
- id: 'auto-start/interactableMethods',
- install: __install_8
- };
- _$InteractableMethods_8["default"] = ___default_8;
-
- var _$base_9 = {};
- "use strict";
-
- Object.defineProperty(_$base_9, "__esModule", {
- value: true
- });
- _$base_9["default"] = void 0;
-
- var __utils_9 = ___interopRequireWildcard_9(_$utils_55);
-
- var _InteractableMethods = ___interopRequireDefault_9(_$InteractableMethods_8);
-
- function ___interopRequireDefault_9(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- function ___interopRequireWildcard_9(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
-
- function __install_9(scope) {
- var interact = scope.interact,
- interactions = scope.interactions,
- defaults = scope.defaults;
- scope.usePlugin(_InteractableMethods["default"]); // set cursor style on mousedown
-
- interactions.signals.on('down', function (_ref) {
- var interaction = _ref.interaction,
- pointer = _ref.pointer,
- event = _ref.event,
- eventTarget = _ref.eventTarget;
-
- if (interaction.interacting()) {
- return;
- }
-
- var actionInfo = getActionInfo(interaction, pointer, event, eventTarget, scope);
- prepare(interaction, actionInfo, scope);
- }); // set cursor style on mousemove
-
- interactions.signals.on('move', function (_ref2) {
- var interaction = _ref2.interaction,
- pointer = _ref2.pointer,
- event = _ref2.event,
- eventTarget = _ref2.eventTarget;
-
- if (interaction.pointerType !== 'mouse' || interaction.pointerIsDown || interaction.interacting()) {
- return;
- }
-
- var actionInfo = getActionInfo(interaction, pointer, event, eventTarget, scope);
- prepare(interaction, actionInfo, scope);
- });
- interactions.signals.on('move', function (arg) {
- var interaction = arg.interaction;
-
- if (!interaction.pointerIsDown || interaction.interacting() || !interaction.pointerWasMoved || !interaction.prepared.name) {
- return;
- }
-
- scope.autoStart.signals.fire('before-start', arg);
- var interactable = interaction.interactable;
-
- if (interaction.prepared.name && interactable) {
- // check manualStart and interaction limit
- if (interactable.options[interaction.prepared.name].manualStart || !withinInteractionLimit(interactable, interaction.element, interaction.prepared, scope)) {
- interaction.stop();
- } else {
- interaction.start(interaction.prepared, interactable, interaction.element);
- }
- }
- });
- interactions.signals.on('stop', function (_ref3) {
- var interaction = _ref3.interaction;
- var interactable = interaction.interactable;
-
- if (interactable && interactable.options.styleCursor) {
- setCursor(interaction.element, '', scope);
- }
- });
- defaults.base.actionChecker = null;
- defaults.base.styleCursor = true;
- __utils_9.extend(defaults.perAction, {
- manualStart: false,
- max: Infinity,
- maxPerElement: 1,
- allowFrom: null,
- ignoreFrom: null,
- // only allow left button by default
- // see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons#Return_value
- mouseButtons: 1
- });
- /**
- * Returns or sets the maximum number of concurrent interactions allowed. By
- * default only 1 interaction is allowed at a time (for backwards
- * compatibility). To allow multiple interactions on the same Interactables and
- * elements, you need to enable it in the draggable, resizable and gesturable
- * `'max'` and `'maxPerElement'` options.
- *
- * @alias module:interact.maxInteractions
- *
- * @param {number} [newValue] Any number. newValue <= 0 means no interactions.
- */
-
- interact.maxInteractions = function (newValue) {
- return maxInteractions(newValue, scope);
- };
-
- scope.autoStart = {
- // Allow this many interactions to happen simultaneously
- maxInteractions: Infinity,
- withinInteractionLimit: withinInteractionLimit,
- cursorElement: null,
- signals: new __utils_9.Signals()
- };
- } // Check if the current interactable supports the action.
- // If so, return the validated action. Otherwise, return null
-
-
- function validateAction(action, interactable, element, eventTarget, scope) {
- if (interactable.testIgnoreAllow(interactable.options[action.name], element, eventTarget) && interactable.options[action.name].enabled && withinInteractionLimit(interactable, element, action, scope)) {
- return action;
- }
-
- return null;
- }
-
- function validateMatches(interaction, pointer, event, matches, matchElements, eventTarget, scope) {
- for (var i = 0, len = matches.length; i < len; i++) {
- var match = matches[i];
- var matchElement = matchElements[i];
- var matchAction = match.getAction(pointer, event, interaction, matchElement);
-
- if (!matchAction) {
- continue;
- }
-
- var action = validateAction(matchAction, match, matchElement, eventTarget, scope);
-
- if (action) {
- return {
- action: action,
- interactable: match,
- element: matchElement
- };
- }
- }
-
- return {
- action: null,
- interactable: null,
- element: null
- };
- }
-
- function getActionInfo(interaction, pointer, event, eventTarget, scope) {
- var matches = [];
- var matchElements = [];
- var element = eventTarget;
-
- function pushMatches(interactable) {
- matches.push(interactable);
- matchElements.push(element);
- }
-
- while (__utils_9.is.element(element)) {
- matches = [];
- matchElements = [];
- scope.interactables.forEachMatch(element, pushMatches);
- var actionInfo = validateMatches(interaction, pointer, event, matches, matchElements, eventTarget, scope);
-
- if (actionInfo.action && !actionInfo.interactable.options[actionInfo.action.name].manualStart) {
- return actionInfo;
- }
-
- element = __utils_9.dom.parentNode(element);
- }
-
- return {
- action: null,
- interactable: null,
- element: null
- };
- }
-
- function prepare(interaction, _ref4, scope) {
- var action = _ref4.action,
- interactable = _ref4.interactable,
- element = _ref4.element;
- action = action || {};
-
- if (interaction.interactable && interaction.interactable.options.styleCursor) {
- setCursor(interaction.element, '', scope);
- }
-
- interaction.interactable = interactable;
- interaction.element = element;
- __utils_9.copyAction(interaction.prepared, action);
- interaction.rect = interactable && action.name ? interactable.getRect(element) : null;
-
- if (interactable && interactable.options.styleCursor) {
- var cursor = action ? scope.actions[action.name].getCursor(action) : '';
- setCursor(interaction.element, cursor, scope);
- }
-
- scope.autoStart.signals.fire('prepared', {
- interaction: interaction
- });
- }
-
- function withinInteractionLimit(interactable, element, action, scope) {
- var options = interactable.options;
- var maxActions = options[action.name].max;
- var maxPerElement = options[action.name].maxPerElement;
- var autoStartMax = scope.autoStart.maxInteractions;
- var activeInteractions = 0;
- var interactableCount = 0;
- var elementCount = 0; // no actions if any of these values == 0
-
- if (!(maxActions && maxPerElement && autoStartMax)) {
- return false;
- }
-
- for (var _i = 0; _i < scope.interactions.list.length; _i++) {
- var _ref5;
-
- _ref5 = scope.interactions.list[_i];
- var interaction = _ref5;
- var otherAction = interaction.prepared.name;
-
- if (!interaction.interacting()) {
- continue;
- }
-
- activeInteractions++;
-
- if (activeInteractions >= autoStartMax) {
- return false;
- }
-
- if (interaction.interactable !== interactable) {
- continue;
- }
-
- interactableCount += otherAction === action.name ? 1 : 0;
-
- if (interactableCount >= maxActions) {
- return false;
- }
-
- if (interaction.element === element) {
- elementCount++;
-
- if (otherAction === action.name && elementCount >= maxPerElement) {
- return false;
- }
- }
- }
-
- return autoStartMax > 0;
- }
-
- function maxInteractions(newValue, scope) {
- if (__utils_9.is.number(newValue)) {
- scope.autoStart.maxInteractions = newValue;
- return this;
- }
-
- return scope.autoStart.maxInteractions;
- }
-
- function setCursor(element, cursor, scope) {
- if (scope.autoStart.cursorElement) {
- scope.autoStart.cursorElement.style.cursor = '';
- }
-
- element.ownerDocument.documentElement.style.cursor = cursor;
- element.style.cursor = cursor;
- scope.autoStart.cursorElement = cursor ? element : null;
- }
-
- var ___default_9 = {
- id: 'auto-start/base',
- install: __install_9,
- maxInteractions: maxInteractions,
- withinInteractionLimit: withinInteractionLimit,
- validateAction: validateAction
- };
- _$base_9["default"] = ___default_9;
-
- var _$dragAxis_10 = {};
- "use strict";
-
- Object.defineProperty(_$dragAxis_10, "__esModule", {
- value: true
- });
- _$dragAxis_10["default"] = void 0;
-
- var ___scope_10 = _$scope_24({});
-
- /* removed: var _$domUtils_50 = require("@interactjs/utils/domUtils"); */;
-
- var __is_10 = ___interopRequireWildcard_10(_$is_56);
-
- var _base = ___interopRequireDefault_10(_$base_9);
-
- function ___interopRequireDefault_10(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- function ___interopRequireWildcard_10(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
-
- function __install_10(scope) {
- scope.autoStart.signals.on('before-start', function (_ref) {
- var interaction = _ref.interaction,
- eventTarget = _ref.eventTarget,
- dx = _ref.dx,
- dy = _ref.dy;
-
- if (interaction.prepared.name !== 'drag') {
- return;
- } // check if a drag is in the correct axis
-
-
- var absX = Math.abs(dx);
- var absY = Math.abs(dy);
- var targetOptions = interaction.interactable.options.drag;
- var startAxis = targetOptions.startAxis;
- var currentAxis = absX > absY ? 'x' : absX < absY ? 'y' : 'xy';
- interaction.prepared.axis = targetOptions.lockAxis === 'start' ? currentAxis[0] // always lock to one axis even if currentAxis === 'xy'
- : targetOptions.lockAxis; // if the movement isn't in the startAxis of the interactable
-
- if (currentAxis !== 'xy' && startAxis !== 'xy' && startAxis !== currentAxis) {
- // cancel the prepared action
- interaction.prepared.name = null; // then try to get a drag from another ineractable
-
- var element = eventTarget;
-
- var getDraggable = function getDraggable(interactable) {
- if (interactable === interaction.interactable) {
- return;
- }
-
- var options = interaction.interactable.options.drag;
-
- if (!options.manualStart && interactable.testIgnoreAllow(options, element, eventTarget)) {
- var action = interactable.getAction(interaction.downPointer, interaction.downEvent, interaction, element);
-
- if (action && action.name === ___scope_10.ActionName.Drag && checkStartAxis(currentAxis, interactable) && _base["default"].validateAction(action, interactable, element, eventTarget, scope)) {
- return interactable;
- }
- }
- }; // check all interactables
-
-
- while (__is_10.element(element)) {
- var interactable = scope.interactables.forEachMatch(element, getDraggable);
-
- if (interactable) {
- interaction.prepared.name = ___scope_10.ActionName.Drag;
- interaction.interactable = interactable;
- interaction.element = element;
- break;
- }
-
- element = (0, _$domUtils_50.parentNode)(element);
- }
- }
- });
-
- function checkStartAxis(startAxis, interactable) {
- if (!interactable) {
- return false;
- }
-
- var thisAxis = interactable.options[___scope_10.ActionName.Drag].startAxis;
- return startAxis === 'xy' || thisAxis === 'xy' || thisAxis === startAxis;
- }
- }
-
- var ___default_10 = {
- id: 'auto-start/dragAxis',
- install: __install_10
- };
- _$dragAxis_10["default"] = ___default_10;
-
- var _$hold_11 = {};
- "use strict";
-
- Object.defineProperty(_$hold_11, "__esModule", {
- value: true
- });
- _$hold_11["default"] = void 0;
-
- var ___base_11 = ___interopRequireDefault_11(_$base_9);
-
- function ___interopRequireDefault_11(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- function __install_11(scope) {
- var autoStart = scope.autoStart,
- interactions = scope.interactions,
- defaults = scope.defaults;
- scope.usePlugin(___base_11["default"]);
- defaults.perAction.hold = 0;
- defaults.perAction.delay = 0;
- interactions.signals.on('new', function (interaction) {
- interaction.autoStartHoldTimer = null;
- });
- autoStart.signals.on('prepared', function (_ref) {
- var interaction = _ref.interaction;
- var hold = getHoldDuration(interaction);
-
- if (hold > 0) {
- interaction.autoStartHoldTimer = setTimeout(function () {
- interaction.start(interaction.prepared, interaction.interactable, interaction.element);
- }, hold);
- }
- });
- interactions.signals.on('move', function (_ref2) {
- var interaction = _ref2.interaction,
- duplicate = _ref2.duplicate;
-
- if (interaction.pointerWasMoved && !duplicate) {
- clearTimeout(interaction.autoStartHoldTimer);
- }
- }); // prevent regular down->move autoStart
-
- autoStart.signals.on('before-start', function (_ref3) {
- var interaction = _ref3.interaction;
- var hold = getHoldDuration(interaction);
-
- if (hold > 0) {
- interaction.prepared.name = null;
- }
- });
- }
-
- function getHoldDuration(interaction) {
- var actionName = interaction.prepared && interaction.prepared.name;
-
- if (!actionName) {
- return null;
- }
-
- var options = interaction.interactable.options;
- return options[actionName].hold || options[actionName].delay;
- }
-
- var ___default_11 = {
- id: 'auto-start/hold',
- install: __install_11,
- getHoldDuration: getHoldDuration
- };
- _$hold_11["default"] = ___default_11;
-
- var _$autoStart_12 = {};
- "use strict";
-
- Object.defineProperty(_$autoStart_12, "__esModule", {
- value: true
- });
- _$autoStart_12.install = __install_12;
- Object.defineProperty(_$autoStart_12, "autoStart", {
- enumerable: true,
- get: function get() {
- return ___base_12["default"];
- }
- });
- Object.defineProperty(_$autoStart_12, "dragAxis", {
- enumerable: true,
- get: function get() {
- return _dragAxis["default"];
- }
- });
- Object.defineProperty(_$autoStart_12, "hold", {
- enumerable: true,
- get: function get() {
- return _hold["default"];
- }
- });
- _$autoStart_12.id = void 0;
-
- var ___base_12 = ___interopRequireDefault_12(_$base_9);
-
- var _dragAxis = ___interopRequireDefault_12(_$dragAxis_10);
-
- var _hold = ___interopRequireDefault_12(_$hold_11);
-
- function ___interopRequireDefault_12(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- function __install_12(scope) {
- scope.usePlugin(___base_12["default"]);
- scope.usePlugin(_hold["default"]);
- scope.usePlugin(_dragAxis["default"]);
- }
-
- var __id_12 = 'auto-start';
- _$autoStart_12.id = __id_12;
-
- var _$interactablePreventDefault_21 = {};
- "use strict";
-
- Object.defineProperty(_$interactablePreventDefault_21, "__esModule", {
- value: true
- });
- _$interactablePreventDefault_21.install = __install_21;
- _$interactablePreventDefault_21["default"] = void 0;
-
- /* removed: var _$domUtils_50 = require("@interactjs/utils/domUtils"); */;
-
- var ___events_21 = ___interopRequireDefault_21(_$events_51);
-
- var __is_21 = ___interopRequireWildcard_21(_$is_56);
-
- /* removed: var _$window_65 = require("@interactjs/utils/window"); */;
-
- function ___interopRequireWildcard_21(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
-
- function ___interopRequireDefault_21(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- function preventDefault(interactable, newValue) {
- if (/^(always|never|auto)$/.test(newValue)) {
- interactable.options.preventDefault = newValue;
- return interactable;
- }
-
- if (__is_21.bool(newValue)) {
- interactable.options.preventDefault = newValue ? 'always' : 'never';
- return interactable;
- }
-
- return interactable.options.preventDefault;
- }
-
- function checkAndPreventDefault(interactable, scope, event) {
- var setting = interactable.options.preventDefault;
-
- if (setting === 'never') {
- return;
- }
-
- if (setting === 'always') {
- event.preventDefault();
- return;
- } // setting === 'auto'
- // if the browser supports passive event listeners and isn't running on iOS,
- // don't preventDefault of touch{start,move} events. CSS touch-action and
- // user-select should be used instead of calling event.preventDefault().
-
-
- if (___events_21["default"].supportsPassive && /^touch(start|move)$/.test(event.type)) {
- var doc = (0, _$window_65.getWindow)(event.target).document;
- var docOptions = scope.getDocOptions(doc);
-
- if (!(docOptions && docOptions.events) || docOptions.events.passive !== false) {
- return;
- }
- } // don't preventDefault of pointerdown events
-
-
- if (/^(mouse|pointer|touch)*(down|start)/i.test(event.type)) {
- return;
- } // don't preventDefault on editable elements
-
-
- if (__is_21.element(event.target) && (0, _$domUtils_50.matchesSelector)(event.target, 'input,select,textarea,[contenteditable=true],[contenteditable=true] *')) {
- return;
- }
-
- event.preventDefault();
- }
-
- function onInteractionEvent(_ref) {
- var interaction = _ref.interaction,
- event = _ref.event;
-
- if (interaction.interactable) {
- interaction.interactable.checkAndPreventDefault(event);
- }
- }
-
- function __install_21(scope) {
- /** @lends Interactable */
- var Interactable = scope.Interactable;
- /**
- * Returns or sets whether to prevent the browser's default behaviour in
- * response to pointer events. Can be set to:
- * - `'always'` to always prevent
- * - `'never'` to never prevent
- * - `'auto'` to let interact.js try to determine what would be best
- *
- * @param {string} [newValue] `'always'`, `'never'` or `'auto'`
- * @return {string | Interactable} The current setting or this Interactable
- */
-
- Interactable.prototype.preventDefault = function (newValue) {
- return preventDefault(this, newValue);
- };
-
- Interactable.prototype.checkAndPreventDefault = function (event) {
- return checkAndPreventDefault(this, scope, event);
- };
-
- var _arr = ['down', 'move', 'up', 'cancel'];
-
- for (var _i = 0; _i < _arr.length; _i++) {
- var eventSignal = _arr[_i];
- scope.interactions.signals.on(eventSignal, onInteractionEvent);
- } // prevent native HTML5 drag on interact.js target elements
-
-
- scope.interactions.eventMap.dragstart = function preventNativeDrag(event) {
- for (var _i2 = 0; _i2 < scope.interactions.list.length; _i2++) {
- var _ref2;
-
- _ref2 = scope.interactions.list[_i2];
- var interaction = _ref2;
-
- if (interaction.element && (interaction.element === event.target || (0, _$domUtils_50.nodeContains)(interaction.element, event.target))) {
- interaction.interactable.checkAndPreventDefault(event);
- return;
- }
- }
- };
- }
-
- var ___default_21 = {
- id: 'core/interactablePreventDefault',
- install: __install_21
- };
- _$interactablePreventDefault_21["default"] = ___default_21;
-
- var _$devTools_25 = {};
- "use strict";
-
- Object.defineProperty(_$devTools_25, "__esModule", {
- value: true
- });
- _$devTools_25["default"] = void 0;
-
- var ___domObjects_25 = ___interopRequireDefault_25(_$domObjects_49);
-
- /* removed: var _$domUtils_50 = require("@interactjs/utils/domUtils"); */;
-
- var ___extend_25 = ___interopRequireDefault_25(_$extend_52);
-
- var __is_25 = ___interopRequireWildcard_25(_$is_56);
-
- var ___window_25 = ___interopRequireDefault_25(_$window_65);
-
- function ___interopRequireWildcard_25(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
-
- function ___interopRequireDefault_25(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- function ___toConsumableArray_25(arr) { return ___arrayWithoutHoles_25(arr) || ___iterableToArray_25(arr) || ___nonIterableSpread_25(); }
-
- function ___nonIterableSpread_25() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
-
- function ___iterableToArray_25(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
-
- function ___arrayWithoutHoles_25(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
-
- var CheckName;
-
- (function (CheckName) {
- CheckName["touchAction"] = "";
- CheckName["boxSizing"] = "";
- CheckName["noListeners"] = "";
- })(CheckName || (CheckName = {}));
-
- var prefix = '[interact.js] ';
- var links = {
- touchAction: 'https://developer.mozilla.org/en-US/docs/Web/CSS/touch-action',
- boxSizing: 'https://developer.mozilla.org/en-US/docs/Web/CSS/box-sizing'
- };
- var isProduction = "production" === 'production'; // eslint-disable-next-line no-restricted-syntax
-
- function __install_25(scope) {
- var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
- logger = _ref.logger;
-
- var interactions = scope.interactions,
- Interactable = scope.Interactable,
- defaults = scope.defaults;
- logger = logger || console;
- interactions.signals.on('action-start', function (_ref2) {
- var interaction = _ref2.interaction;
-
- for (var _i = 0; _i < checks.length; _i++) {
- var _ref3;
-
- _ref3 = checks[_i];
- var check = _ref3;
- var options = interaction.interactable && interaction.interactable.options[interaction.prepared.name];
-
- if (!(options && options.devTools && options.devTools.ignore[check.name]) && check.perform(interaction)) {
- var _logger;
-
- (_logger = logger).warn.apply(_logger, [prefix + check.text].concat(___toConsumableArray_25(check.getInfo(interaction))));
- }
- }
- });
- defaults.base.devTools = {
- ignore: {}
- };
-
- Interactable.prototype.devTools = function (options) {
- if (options) {
- (0, ___extend_25["default"])(this.options.devTools, options);
- return this;
- }
-
- return this.options.devTools;
- };
- }
-
- var checks = [{
- name: 'touchAction',
- perform: function perform(_ref4) {
- var element = _ref4.element;
- return !parentHasStyle(element, 'touchAction', /pan-|pinch|none/);
- },
- getInfo: function getInfo(_ref5) {
- var element = _ref5.element;
- return [element, links.touchAction];
- },
- text: 'Consider adding CSS "touch-action: none" to this element\n'
- }, {
- name: 'boxSizing',
- perform: function perform(interaction) {
- var element = interaction.element;
- return interaction.prepared.name === 'resize' && element instanceof ___domObjects_25["default"].HTMLElement && !hasStyle(element, 'boxSizing', /border-box/);
- },
- text: 'Consider adding CSS "box-sizing: border-box" to this resizable element',
- getInfo: function getInfo(_ref6) {
- var element = _ref6.element;
- return [element, links.boxSizing];
- }
- }, {
- name: 'noListeners',
- perform: function perform(interaction) {
- var actionName = interaction.prepared.name;
- var moveListeners = interaction.interactable.events.types["".concat(actionName, "move")] || [];
- return !moveListeners.length;
- },
- getInfo: function getInfo(interaction) {
- return [interaction.prepared.name, interaction.interactable];
- },
- text: 'There are no listeners set for this action'
- }];
-
- function hasStyle(element, prop, styleRe) {
- return styleRe.test(element.style[prop] || ___window_25["default"].window.getComputedStyle(element)[prop]);
- }
-
- function parentHasStyle(element, prop, styleRe) {
- var parent = element;
-
- while (__is_25.element(parent)) {
- if (hasStyle(parent, prop, styleRe)) {
- return true;
- }
-
- parent = (0, _$domUtils_50.parentNode)(parent);
- }
-
- return false;
- }
-
- var __id_25 = 'dev-tools';
- var defaultExport = isProduction ? {
- id: __id_25,
- install: function install() {}
- } : {
- id: __id_25,
- install: __install_25,
- checks: checks,
- CheckName: CheckName,
- links: links,
- prefix: prefix
- };
- var ___default_25 = defaultExport;
- _$devTools_25["default"] = ___default_25;
-
- var _$base_30 = {};
- "use strict";
-
- Object.defineProperty(_$base_30, "__esModule", {
- value: true
- });
- _$base_30.startAll = startAll;
- _$base_30.setAll = setAll;
- _$base_30.prepareStates = prepareStates;
- _$base_30.makeModifier = makeModifier;
- _$base_30["default"] = void 0;
-
- var ___extend_30 = ___interopRequireDefault_30(_$extend_52);
-
- function ___interopRequireDefault_30(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- function ___slicedToArray_30(arr, i) { return ___arrayWithHoles_30(arr) || ___iterableToArrayLimit_30(arr, i) || ___nonIterableRest_30(); }
-
- function ___nonIterableRest_30() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
-
- function ___iterableToArrayLimit_30(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
-
- function ___arrayWithHoles_30(arr) { if (Array.isArray(arr)) return arr; }
-
- function __install_30(scope) {
- var interactions = scope.interactions;
- scope.defaults.perAction.modifiers = [];
- scope.modifiers = {};
- interactions.signals.on('new', function (_ref) {
- var interaction = _ref.interaction;
- interaction.modifiers = {
- startOffset: {
- left: 0,
- right: 0,
- top: 0,
- bottom: 0
- },
- offsets: {},
- states: null,
- result: null,
- endPrevented: false,
- startDelta: null
- };
- });
- interactions.signals.on('before-action-start', function (arg) {
- __start_30(arg, arg.interaction.coords.start.page, scope.modifiers);
- });
- interactions.signals.on('action-resume', function (arg) {
- stop(arg);
- __start_30(arg, arg.interaction.coords.cur.page, scope.modifiers);
- __beforeMove_30(arg);
- });
- interactions.signals.on('after-action-move', restoreCoords);
- interactions.signals.on('before-action-move', __beforeMove_30);
- interactions.signals.on('before-action-start', setCoords);
- interactions.signals.on('after-action-start', restoreCoords);
- interactions.signals.on('before-action-end', beforeEnd);
- interactions.signals.on('stop', stop);
- }
-
- function __start_30(_ref2, pageCoords, registeredModifiers) {
- var interaction = _ref2.interaction,
- phase = _ref2.phase;
- var interactable = interaction.interactable,
- element = interaction.element;
- var modifierList = getModifierList(interaction, registeredModifiers);
- var states = prepareStates(modifierList);
- var rect = (0, ___extend_30["default"])({}, interaction.rect);
-
- if (!('width' in rect)) {
- rect.width = rect.right - rect.left;
- }
-
- if (!('height' in rect)) {
- rect.height = rect.bottom - rect.top;
- }
-
- var startOffset = getRectOffset(rect, pageCoords);
- interaction.modifiers.startOffset = startOffset;
- interaction.modifiers.startDelta = {
- x: 0,
- y: 0
- };
- var arg = {
- interaction: interaction,
- interactable: interactable,
- element: element,
- pageCoords: pageCoords,
- phase: phase,
- rect: rect,
- startOffset: startOffset,
- states: states,
- preEnd: false,
- requireEndOnly: false
- };
- interaction.modifiers.states = states;
- interaction.modifiers.result = null;
- startAll(arg);
- arg.pageCoords = (0, ___extend_30["default"])({}, interaction.coords.start.page);
- var result = interaction.modifiers.result = setAll(arg);
- return result;
- }
-
- function startAll(arg) {
- for (var _i = 0; _i < arg.states.length; _i++) {
- var _ref3;
-
- _ref3 = arg.states[_i];
- var state = _ref3;
-
- if (state.methods.start) {
- arg.state = state;
- state.methods.start(arg);
- }
- }
- }
-
- function setAll(arg) {
- var interaction = arg.interaction,
- _arg$modifiersState = arg.modifiersState,
- modifiersState = _arg$modifiersState === void 0 ? interaction.modifiers : _arg$modifiersState,
- _arg$prevCoords = arg.prevCoords,
- prevCoords = _arg$prevCoords === void 0 ? modifiersState.result ? modifiersState.result.coords : interaction.coords.prev.page : _arg$prevCoords,
- phase = arg.phase,
- preEnd = arg.preEnd,
- requireEndOnly = arg.requireEndOnly,
- rect = arg.rect,
- skipModifiers = arg.skipModifiers;
- var states = skipModifiers ? arg.states.slice(skipModifiers) : arg.states;
- arg.coords = (0, ___extend_30["default"])({}, arg.pageCoords);
- arg.rect = (0, ___extend_30["default"])({}, rect);
- var result = {
- delta: {
- x: 0,
- y: 0
- },
- rectDelta: {
- left: 0,
- right: 0,
- top: 0,
- bottom: 0
- },
- coords: arg.coords,
- changed: true
- };
-
- for (var _i2 = 0; _i2 < states.length; _i2++) {
- var _ref4;
-
- _ref4 = states[_i2];
- var state = _ref4;
- var options = state.options;
-
- if (!state.methods.set || !shouldDo(options, preEnd, requireEndOnly, phase)) {
- continue;
- }
-
- arg.state = state;
- state.methods.set(arg);
- }
-
- result.delta.x = arg.coords.x - arg.pageCoords.x;
- result.delta.y = arg.coords.y - arg.pageCoords.y;
- var rectChanged = false;
-
- if (rect) {
- result.rectDelta.left = arg.rect.left - rect.left;
- result.rectDelta.right = arg.rect.right - rect.right;
- result.rectDelta.top = arg.rect.top - rect.top;
- result.rectDelta.bottom = arg.rect.bottom - rect.bottom;
- rectChanged = result.rectDelta.left !== 0 || result.rectDelta.right !== 0 || result.rectDelta.top !== 0 || result.rectDelta.bottom !== 0;
- }
-
- result.changed = prevCoords.x !== result.coords.x || prevCoords.y !== result.coords.y || rectChanged;
- return result;
- }
-
- function __beforeMove_30(arg) {
- var interaction = arg.interaction,
- phase = arg.phase,
- preEnd = arg.preEnd,
- skipModifiers = arg.skipModifiers;
- var interactable = interaction.interactable,
- element = interaction.element;
- var modifierResult = setAll({
- interaction: interaction,
- interactable: interactable,
- element: element,
- preEnd: preEnd,
- phase: phase,
- pageCoords: interaction.coords.cur.page,
- rect: interaction.rect,
- states: interaction.modifiers.states,
- requireEndOnly: false,
- skipModifiers: skipModifiers
- });
- interaction.modifiers.result = modifierResult; // don't fire an action move if a modifier would keep the event in the same
- // cordinates as before
-
- if (!modifierResult.changed && interaction.interacting()) {
- return false;
- }
-
- setCoords(arg);
- }
-
- function beforeEnd(arg) {
- var interaction = arg.interaction,
- event = arg.event,
- noPreEnd = arg.noPreEnd;
- var states = interaction.modifiers.states;
-
- if (noPreEnd || !states || !states.length) {
- return;
- }
-
- var didPreEnd = false;
-
- for (var _i3 = 0; _i3 < states.length; _i3++) {
- var _ref5;
-
- _ref5 = states[_i3];
- var state = _ref5;
- arg.state = state;
- var options = state.options,
- methods = state.methods;
- var endResult = methods.beforeEnd && methods.beforeEnd(arg);
-
- if (endResult === false) {
- interaction.modifiers.endPrevented = true;
- return false;
- } // if the endOnly option is true for any modifier
-
-
- if (!didPreEnd && shouldDo(options, true, true)) {
- // fire a move event at the modified coordinates
- interaction.move({
- event: event,
- preEnd: true
- });
- didPreEnd = true;
- }
- }
- }
-
- function stop(arg) {
- var interaction = arg.interaction;
- var states = interaction.modifiers.states;
-
- if (!states || !states.length) {
- return;
- }
-
- var modifierArg = (0, ___extend_30["default"])({
- states: states,
- interactable: interaction.interactable,
- element: interaction.element
- }, arg);
- restoreCoords(arg);
-
- for (var _i4 = 0; _i4 < states.length; _i4++) {
- var _ref6;
-
- _ref6 = states[_i4];
- var state = _ref6;
- modifierArg.state = state;
-
- if (state.methods.stop) {
- state.methods.stop(modifierArg);
- }
- }
-
- arg.interaction.modifiers.states = null;
- arg.interaction.modifiers.endPrevented = false;
- }
-
- function getModifierList(interaction, registeredModifiers) {
- var actionOptions = interaction.interactable.options[interaction.prepared.name];
- var actionModifiers = actionOptions.modifiers;
-
- if (actionModifiers && actionModifiers.length) {
- return actionModifiers.filter(function (modifier) {
- return !modifier.options || modifier.options.enabled !== false;
- }).map(function (modifier) {
- if (!modifier.methods && modifier.type) {
- return registeredModifiers[modifier.type](modifier);
- }
-
- return modifier;
- });
- }
-
- return ['snap', 'snapSize', 'snapEdges', 'restrict', 'restrictEdges', 'restrictSize'].map(function (type) {
- var options = actionOptions[type];
- return options && options.enabled && {
- options: options,
- methods: options._methods
- };
- }).filter(function (m) {
- return !!m;
- });
- }
-
- function prepareStates(modifierList) {
- var states = [];
-
- for (var index = 0; index < modifierList.length; index++) {
- var _modifierList$index = modifierList[index],
- options = _modifierList$index.options,
- methods = _modifierList$index.methods,
- name = _modifierList$index.name;
-
- if (options && options.enabled === false) {
- continue;
- }
-
- var state = {
- options: options,
- methods: methods,
- index: index,
- name: name
- };
- states.push(state);
- }
-
- return states;
- }
-
- function setCoords(arg) {
- var interaction = arg.interaction,
- phase = arg.phase;
- var curCoords = arg.curCoords || interaction.coords.cur;
- var startCoords = arg.startCoords || interaction.coords.start;
- var _interaction$modifier = interaction.modifiers,
- result = _interaction$modifier.result,
- startDelta = _interaction$modifier.startDelta;
- var curDelta = result.delta;
-
- if (phase === 'start') {
- (0, ___extend_30["default"])(interaction.modifiers.startDelta, result.delta);
- }
-
- var _arr = [[startCoords, startDelta], [curCoords, curDelta]];
-
- for (var _i5 = 0; _i5 < _arr.length; _i5++) {
- var _arr$_i = ___slicedToArray_30(_arr[_i5], 2),
- coordsSet = _arr$_i[0],
- delta = _arr$_i[1];
-
- coordsSet.page.x += delta.x;
- coordsSet.page.y += delta.y;
- coordsSet.client.x += delta.x;
- coordsSet.client.y += delta.y;
- }
-
- var rectDelta = interaction.modifiers.result.rectDelta;
- var rect = arg.rect || interaction.rect;
- rect.left += rectDelta.left;
- rect.right += rectDelta.right;
- rect.top += rectDelta.top;
- rect.bottom += rectDelta.bottom;
- rect.width = rect.right - rect.left;
- rect.height = rect.bottom - rect.top;
- }
-
- function restoreCoords(_ref7) {
- var _ref7$interaction = _ref7.interaction,
- coords = _ref7$interaction.coords,
- rect = _ref7$interaction.rect,
- modifiers = _ref7$interaction.modifiers;
-
- if (!modifiers.result) {
- return;
- }
-
- var startDelta = modifiers.startDelta;
- var _modifiers$result = modifiers.result,
- curDelta = _modifiers$result.delta,
- rectDelta = _modifiers$result.rectDelta;
- var coordsAndDeltas = [[coords.start, startDelta], [coords.cur, curDelta]];
-
- for (var _i6 = 0; _i6 < coordsAndDeltas.length; _i6++) {
- var _coordsAndDeltas$_i = ___slicedToArray_30(coordsAndDeltas[_i6], 2),
- coordsSet = _coordsAndDeltas$_i[0],
- delta = _coordsAndDeltas$_i[1];
-
- coordsSet.page.x -= delta.x;
- coordsSet.page.y -= delta.y;
- coordsSet.client.x -= delta.x;
- coordsSet.client.y -= delta.y;
- }
-
- rect.left -= rectDelta.left;
- rect.right -= rectDelta.right;
- rect.top -= rectDelta.top;
- rect.bottom -= rectDelta.bottom;
- }
-
- function shouldDo(options, preEnd, requireEndOnly, phase) {
- return options ? options.enabled !== false && (preEnd || !options.endOnly) && (!requireEndOnly || options.endOnly || options.alwaysOnEnd) && (options.setStart || phase !== 'start') : !requireEndOnly;
- }
-
- function getRectOffset(rect, coords) {
- return rect ? {
- left: coords.x - rect.left,
- top: coords.y - rect.top,
- right: rect.right - coords.x,
- bottom: rect.bottom - coords.y
- } : {
- left: 0,
- top: 0,
- right: 0,
- bottom: 0
- };
- }
-
- function makeModifier(module, name) {
- var defaults = module.defaults;
- var methods = {
- start: module.start,
- set: module.set,
- beforeEnd: module.beforeEnd,
- stop: module.stop
- };
-
- var modifier = function modifier(options) {
- options = options || {};
- options.enabled = options.enabled !== false; // add missing defaults to options
-
- for (var prop in defaults) {
- if (!(prop in options)) {
- options[prop] = defaults[prop];
- }
- }
-
- return {
- options: options,
- methods: methods,
- name: name
- };
- };
-
- if (typeof name === 'string') {
- // for backwrads compatibility
- modifier._defaults = defaults;
- modifier._methods = methods;
- }
-
- return modifier;
- }
-
- var ___default_30 = {
- id: 'modifiers/base',
- install: __install_30,
- startAll: startAll,
- setAll: setAll,
- prepareStates: prepareStates,
- start: __start_30,
- beforeMove: __beforeMove_30,
- beforeEnd: beforeEnd,
- stop: stop,
- shouldDo: shouldDo,
- getModifierList: getModifierList,
- getRectOffset: getRectOffset,
- makeModifier: makeModifier
- };
- _$base_30["default"] = ___default_30;
-
- var _$inertia_26 = {};
- "use strict";
-
- Object.defineProperty(_$inertia_26, "__esModule", {
- value: true
- });
- _$inertia_26["default"] = void 0;
-
- /* removed: var _$InteractEvent_15 = require("@interactjs/core/InteractEvent"); */;
-
- var ___base_26 = ___interopRequireDefault_26(_$base_30);
-
- var __utils_26 = ___interopRequireWildcard_26(_$utils_55);
-
- var ___raf_26 = ___interopRequireDefault_26(_$raf_61);
-
- function ___interopRequireWildcard_26(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
-
- function ___interopRequireDefault_26(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- _$InteractEvent_15.EventPhase.Resume = 'resume';
- _$InteractEvent_15.EventPhase.InertiaStart = 'inertiastart';
-
- function __install_26(scope) {
- var interactions = scope.interactions,
- defaults = scope.defaults;
- interactions.signals.on('new', function (_ref) {
- var interaction = _ref.interaction;
- interaction.inertia = {
- active: false,
- smoothEnd: false,
- allowResume: false,
- upCoords: {},
- timeout: null
- };
- }); // FIXME proper signal typing
-
- interactions.signals.on('before-action-end', function (arg) {
- return release(arg, scope);
- });
- interactions.signals.on('down', function (arg) {
- return resume(arg, scope);
- });
- interactions.signals.on('stop', function (arg) {
- return __stop_26(arg);
- });
- defaults.perAction.inertia = {
- enabled: false,
- resistance: 10,
- minSpeed: 100,
- endSpeed: 10,
- allowResume: true,
- smoothEndDuration: 300
- };
- scope.usePlugin(___base_26["default"]);
- }
-
- function resume(_ref2, scope) {
- var interaction = _ref2.interaction,
- event = _ref2.event,
- pointer = _ref2.pointer,
- eventTarget = _ref2.eventTarget;
- var state = interaction.inertia; // Check if the down event hits the current inertia target
-
- if (state.active) {
- var element = eventTarget; // climb up the DOM tree from the event target
-
- while (__utils_26.is.element(element)) {
- // if interaction element is the current inertia target element
- if (element === interaction.element) {
- // stop inertia
- ___raf_26["default"].cancel(state.timeout);
-
- state.active = false;
- interaction.simulation = null; // update pointers to the down event's coordinates
-
- interaction.updatePointer(pointer, event, eventTarget, true);
- __utils_26.pointer.setCoords(interaction.coords.cur, interaction.pointers.map(function (p) {
- return p.pointer;
- }), interaction._now()); // fire appropriate signals
-
- var signalArg = {
- interaction: interaction
- };
- scope.interactions.signals.fire('action-resume', signalArg); // fire a reume event
-
- var resumeEvent = new scope.InteractEvent(interaction, event, interaction.prepared.name, _$InteractEvent_15.EventPhase.Resume, interaction.element);
-
- interaction._fireEvent(resumeEvent);
-
- __utils_26.pointer.copyCoords(interaction.coords.prev, interaction.coords.cur);
- break;
- }
-
- element = __utils_26.dom.parentNode(element);
- }
- }
- }
-
- function release(_ref3, scope) {
- var interaction = _ref3.interaction,
- event = _ref3.event,
- noPreEnd = _ref3.noPreEnd;
- var state = interaction.inertia;
-
- if (!interaction.interacting() || interaction.simulation && interaction.simulation.active || noPreEnd) {
- return null;
- }
-
- var options = __getOptions_26(interaction);
-
- var now = interaction._now();
-
- var velocityClient = interaction.coords.velocity.client;
- var pointerSpeed = __utils_26.hypot(velocityClient.x, velocityClient.y);
- var smoothEnd = false;
- var modifierResult; // check if inertia should be started
-
- var inertiaPossible = options && options.enabled && interaction.prepared.name !== 'gesture' && event !== state.startEvent;
- var inertia = inertiaPossible && now - interaction.coords.cur.timeStamp < 50 && pointerSpeed > options.minSpeed && pointerSpeed > options.endSpeed;
- var modifierArg = {
- interaction: interaction,
- pageCoords: __utils_26.extend({}, interaction.coords.cur.page),
- states: inertiaPossible && interaction.modifiers.states.map(function (modifierStatus) {
- return __utils_26.extend({}, modifierStatus);
- }),
- preEnd: true,
- prevCoords: undefined,
- requireEndOnly: null
- }; // smoothEnd
-
- if (inertiaPossible && !inertia) {
- modifierArg.prevCoords = interaction.prevEvent.page;
- modifierArg.requireEndOnly = false;
- modifierResult = ___base_26["default"].setAll(modifierArg);
-
- if (modifierResult.changed) {
- smoothEnd = true;
- }
- }
-
- if (!(inertia || smoothEnd)) {
- return null;
- }
-
- __utils_26.pointer.copyCoords(state.upCoords, interaction.coords.cur);
- interaction.pointers[0].pointer = state.startEvent = new scope.InteractEvent(interaction, event, // FIXME add proper typing Action.name
- interaction.prepared.name, _$InteractEvent_15.EventPhase.InertiaStart, interaction.element);
- state.t0 = now;
- state.active = true;
- state.allowResume = options.allowResume;
- interaction.simulation = state;
- interaction.interactable.fire(state.startEvent);
-
- if (inertia) {
- state.vx0 = interaction.coords.velocity.client.x;
- state.vy0 = interaction.coords.velocity.client.y;
- state.v0 = pointerSpeed;
- calcInertia(interaction, state);
- __utils_26.extend(modifierArg.pageCoords, interaction.coords.cur.page);
- modifierArg.pageCoords.x += state.xe;
- modifierArg.pageCoords.y += state.ye;
- modifierArg.prevCoords = undefined;
- modifierArg.requireEndOnly = true;
- modifierResult = ___base_26["default"].setAll(modifierArg);
- state.modifiedXe += modifierResult.delta.x;
- state.modifiedYe += modifierResult.delta.y;
- state.timeout = ___raf_26["default"].request(function () {
- return inertiaTick(interaction);
- });
- } else {
- state.smoothEnd = true;
- state.xe = modifierResult.delta.x;
- state.ye = modifierResult.delta.y;
- state.sx = state.sy = 0;
- state.timeout = ___raf_26["default"].request(function () {
- return smothEndTick(interaction);
- });
- }
-
- return false;
- }
-
- function __stop_26(_ref4) {
- var interaction = _ref4.interaction;
- var state = interaction.inertia;
-
- if (state.active) {
- ___raf_26["default"].cancel(state.timeout);
-
- state.active = false;
- interaction.simulation = null;
- }
- }
-
- function calcInertia(interaction, state) {
- var options = __getOptions_26(interaction);
- var lambda = options.resistance;
- var inertiaDur = -Math.log(options.endSpeed / state.v0) / lambda;
- state.x0 = interaction.prevEvent.page.x;
- state.y0 = interaction.prevEvent.page.y;
- state.t0 = state.startEvent.timeStamp / 1000;
- state.sx = state.sy = 0;
- state.modifiedXe = state.xe = (state.vx0 - inertiaDur) / lambda;
- state.modifiedYe = state.ye = (state.vy0 - inertiaDur) / lambda;
- state.te = inertiaDur;
- state.lambda_v0 = lambda / state.v0;
- state.one_ve_v0 = 1 - options.endSpeed / state.v0;
- }
-
- function inertiaTick(interaction) {
- updateInertiaCoords(interaction);
- __utils_26.pointer.setCoordDeltas(interaction.coords.delta, interaction.coords.prev, interaction.coords.cur);
- __utils_26.pointer.setCoordVelocity(interaction.coords.velocity, interaction.coords.delta);
- var state = interaction.inertia;
- var options = __getOptions_26(interaction);
- var lambda = options.resistance;
- var t = interaction._now() / 1000 - state.t0;
-
- if (t < state.te) {
- var progress = 1 - (Math.exp(-lambda * t) - state.lambda_v0) / state.one_ve_v0;
-
- if (state.modifiedXe === state.xe && state.modifiedYe === state.ye) {
- state.sx = state.xe * progress;
- state.sy = state.ye * progress;
- } else {
- var quadPoint = __utils_26.getQuadraticCurvePoint(0, 0, state.xe, state.ye, state.modifiedXe, state.modifiedYe, progress);
- state.sx = quadPoint.x;
- state.sy = quadPoint.y;
- }
-
- interaction.move();
- state.timeout = ___raf_26["default"].request(function () {
- return inertiaTick(interaction);
- });
- } else {
- state.sx = state.modifiedXe;
- state.sy = state.modifiedYe;
- interaction.move();
- interaction.end(state.startEvent);
- state.active = false;
- interaction.simulation = null;
- }
-
- __utils_26.pointer.copyCoords(interaction.coords.prev, interaction.coords.cur);
- }
-
- function smothEndTick(interaction) {
- updateInertiaCoords(interaction);
- var state = interaction.inertia;
- var t = interaction._now() - state.t0;
-
- var _getOptions = __getOptions_26(interaction),
- duration = _getOptions.smoothEndDuration;
-
- if (t < duration) {
- state.sx = __utils_26.easeOutQuad(t, 0, state.xe, duration);
- state.sy = __utils_26.easeOutQuad(t, 0, state.ye, duration);
- interaction.move();
- state.timeout = ___raf_26["default"].request(function () {
- return smothEndTick(interaction);
- });
- } else {
- state.sx = state.xe;
- state.sy = state.ye;
- interaction.move();
- interaction.end(state.startEvent);
- state.smoothEnd = state.active = false;
- interaction.simulation = null;
- }
- }
-
- function updateInertiaCoords(interaction) {
- var state = interaction.inertia; // return if inertia isn't running
-
- if (!state.active) {
- return;
- }
-
- var pageUp = state.upCoords.page;
- var clientUp = state.upCoords.client;
- __utils_26.pointer.setCoords(interaction.coords.cur, [{
- pageX: pageUp.x + state.sx,
- pageY: pageUp.y + state.sy,
- clientX: clientUp.x + state.sx,
- clientY: clientUp.y + state.sy
- }], interaction._now());
- }
-
- function __getOptions_26(_ref5) {
- var interactable = _ref5.interactable,
- prepared = _ref5.prepared;
- return interactable && interactable.options && prepared.name && interactable.options[prepared.name].inertia;
- }
-
- var ___default_26 = {
- id: 'inertia',
- install: __install_26,
- calcInertia: calcInertia,
- inertiaTick: inertiaTick,
- smothEndTick: smothEndTick,
- updateInertiaCoords: updateInertiaCoords
- };
- _$inertia_26["default"] = ___default_26;
-
- var _$pointer_33 = {};
- "use strict";
-
- Object.defineProperty(_$pointer_33, "__esModule", {
- value: true
- });
- _$pointer_33["default"] = void 0;
-
- var __is_33 = ___interopRequireWildcard_33(_$is_56);
-
- var ___rect_33 = ___interopRequireDefault_33(_$rect_62);
-
- function ___interopRequireDefault_33(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- function ___interopRequireWildcard_33(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
-
- function __start_33(_ref) {
- var rect = _ref.rect,
- startOffset = _ref.startOffset,
- state = _ref.state;
- var options = state.options;
- var elementRect = options.elementRect;
- var offset = {};
-
- if (rect && elementRect) {
- offset.left = startOffset.left - rect.width * elementRect.left;
- offset.top = startOffset.top - rect.height * elementRect.top;
- offset.right = startOffset.right - rect.width * (1 - elementRect.right);
- offset.bottom = startOffset.bottom - rect.height * (1 - elementRect.bottom);
- } else {
- offset.left = offset.top = offset.right = offset.bottom = 0;
- }
-
- state.offset = offset;
- }
-
- function set(_ref2) {
- var coords = _ref2.coords,
- interaction = _ref2.interaction,
- state = _ref2.state;
- var options = state.options,
- offset = state.offset;
- var restriction = getRestrictionRect(options.restriction, interaction, coords);
-
- if (!restriction) {
- return state;
- }
-
- var rect = restriction; // object is assumed to have
- // x, y, width, height or
- // left, top, right, bottom
-
- if ('x' in restriction && 'y' in restriction) {
- coords.x = Math.max(Math.min(rect.x + rect.width - offset.right, coords.x), rect.x + offset.left);
- coords.y = Math.max(Math.min(rect.y + rect.height - offset.bottom, coords.y), rect.y + offset.top);
- } else {
- coords.x = Math.max(Math.min(rect.right - offset.right, coords.x), rect.left + offset.left);
- coords.y = Math.max(Math.min(rect.bottom - offset.bottom, coords.y), rect.top + offset.top);
- }
- }
-
- function getRestrictionRect(value, interaction, coords) {
- if (__is_33.func(value)) {
- return ___rect_33["default"].resolveRectLike(value, interaction.interactable, interaction.element, [coords.x, coords.y, interaction]);
- } else {
- return ___rect_33["default"].resolveRectLike(value, interaction.interactable, interaction.element);
- }
- }
-
- var restrict = {
- start: __start_33,
- set: set,
- getRestrictionRect: getRestrictionRect,
- defaults: {
- enabled: false,
- restriction: null,
- elementRect: null
- }
- };
- var ___default_33 = restrict;
- _$pointer_33["default"] = ___default_33;
-
- var _$edges_32 = {};
- "use strict";
-
- Object.defineProperty(_$edges_32, "__esModule", {
- value: true
- });
- _$edges_32["default"] = void 0;
-
- var ___extend_32 = ___interopRequireDefault_32(_$extend_52);
-
- var ___rect_32 = ___interopRequireDefault_32(_$rect_62);
-
- var _pointer = ___interopRequireDefault_32(_$pointer_33);
-
- function ___interopRequireDefault_32(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- // This module adds the options.resize.restrictEdges setting which sets min and
- // max for the top, left, bottom and right edges of the target being resized.
- //
- // interact(target).resize({
- // edges: { top: true, left: true },
- // restrictEdges: {
- // inner: { top: 200, left: 200, right: 400, bottom: 400 },
- // outer: { top: 0, left: 0, right: 600, bottom: 600 },
- // },
- // })
- var __getRestrictionRect_32 = _pointer["default"].getRestrictionRect;
- var noInner = {
- top: +Infinity,
- left: +Infinity,
- bottom: -Infinity,
- right: -Infinity
- };
- var noOuter = {
- top: -Infinity,
- left: -Infinity,
- bottom: +Infinity,
- right: +Infinity
- };
-
- function __start_32(_ref) {
- var interaction = _ref.interaction,
- state = _ref.state;
- var options = state.options;
- var startOffset = interaction.modifiers.startOffset;
- var offset;
-
- if (options) {
- var offsetRect = __getRestrictionRect_32(options.offset, interaction, interaction.coords.start.page);
- offset = ___rect_32["default"].rectToXY(offsetRect);
- }
-
- offset = offset || {
- x: 0,
- y: 0
- };
- state.offset = {
- top: offset.y + startOffset.top,
- left: offset.x + startOffset.left,
- bottom: offset.y - startOffset.bottom,
- right: offset.x - startOffset.right
- };
- }
-
- function __set_32(_ref2) {
- var coords = _ref2.coords,
- interaction = _ref2.interaction,
- state = _ref2.state;
- var offset = state.offset,
- options = state.options;
- var edges = interaction.prepared._linkedEdges || interaction.prepared.edges;
-
- if (!edges) {
- return;
- }
-
- var page = (0, ___extend_32["default"])({}, coords);
- var inner = __getRestrictionRect_32(options.inner, interaction, page) || {};
- var outer = __getRestrictionRect_32(options.outer, interaction, page) || {};
- fixRect(inner, noInner);
- fixRect(outer, noOuter);
-
- if (edges.top) {
- coords.y = Math.min(Math.max(outer.top + offset.top, page.y), inner.top + offset.top);
- } else if (edges.bottom) {
- coords.y = Math.max(Math.min(outer.bottom + offset.bottom, page.y), inner.bottom + offset.bottom);
- }
-
- if (edges.left) {
- coords.x = Math.min(Math.max(outer.left + offset.left, page.x), inner.left + offset.left);
- } else if (edges.right) {
- coords.x = Math.max(Math.min(outer.right + offset.right, page.x), inner.right + offset.right);
- }
- }
-
- function fixRect(rect, defaults) {
- var _arr = ['top', 'left', 'bottom', 'right'];
-
- for (var _i = 0; _i < _arr.length; _i++) {
- var edge = _arr[_i];
-
- if (!(edge in rect)) {
- rect[edge] = defaults[edge];
- }
- }
-
- return rect;
- }
-
- var restrictEdges = {
- noInner: noInner,
- noOuter: noOuter,
- getRestrictionRect: __getRestrictionRect_32,
- start: __start_32,
- set: __set_32,
- defaults: {
- enabled: false,
- inner: null,
- outer: null,
- offset: null
- }
- };
- var ___default_32 = restrictEdges;
- _$edges_32["default"] = ___default_32;
-
- var _$size_34 = {};
- "use strict";
-
- Object.defineProperty(_$size_34, "__esModule", {
- value: true
- });
- _$size_34["default"] = void 0;
-
- var ___extend_34 = ___interopRequireDefault_34(_$extend_52);
-
- var ___rect_34 = ___interopRequireDefault_34(_$rect_62);
-
- var _edges = ___interopRequireDefault_34(_$edges_32);
-
- function ___interopRequireDefault_34(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- // This module adds the options.resize.restrictSize setting which sets min and
- // max width and height for the target being resized.
- //
- // interact(target).resize({
- // edges: { top: true, left: true },
- // restrictSize: {
- // min: { width: -600, height: -600 },
- // max: { width: 600, height: 600 },
- // },
- // })
- var noMin = {
- width: -Infinity,
- height: -Infinity
- };
- var noMax = {
- width: +Infinity,
- height: +Infinity
- };
-
- function __start_34(arg) {
- return _edges["default"].start(arg);
- }
-
- function __set_34(arg) {
- var interaction = arg.interaction,
- state = arg.state;
- var options = state.options;
- var edges = interaction.prepared.linkedEdges || interaction.prepared.edges;
-
- if (!edges) {
- return;
- }
-
- var rect = ___rect_34["default"].xywhToTlbr(interaction.resizeRects.inverted);
-
- var minSize = ___rect_34["default"].tlbrToXywh(_edges["default"].getRestrictionRect(options.min, interaction)) || noMin;
- var maxSize = ___rect_34["default"].tlbrToXywh(_edges["default"].getRestrictionRect(options.max, interaction)) || noMax;
- state.options = {
- enabled: options.enabled,
- endOnly: options.endOnly,
- inner: (0, ___extend_34["default"])({}, _edges["default"].noInner),
- outer: (0, ___extend_34["default"])({}, _edges["default"].noOuter)
- };
-
- if (edges.top) {
- state.options.inner.top = rect.bottom - minSize.height;
- state.options.outer.top = rect.bottom - maxSize.height;
- } else if (edges.bottom) {
- state.options.inner.bottom = rect.top + minSize.height;
- state.options.outer.bottom = rect.top + maxSize.height;
- }
-
- if (edges.left) {
- state.options.inner.left = rect.right - minSize.width;
- state.options.outer.left = rect.right - maxSize.width;
- } else if (edges.right) {
- state.options.inner.right = rect.left + minSize.width;
- state.options.outer.right = rect.left + maxSize.width;
- }
-
- _edges["default"].set(arg);
-
- state.options = options;
- }
-
- var restrictSize = {
- start: __start_34,
- set: __set_34,
- defaults: {
- enabled: false,
- min: null,
- max: null
- }
- };
- var ___default_34 = restrictSize;
- _$size_34["default"] = ___default_34;
-
- var _$pointer_36 = {};
- "use strict";
-
- Object.defineProperty(_$pointer_36, "__esModule", {
- value: true
- });
- _$pointer_36["default"] = void 0;
-
- var __utils_36 = ___interopRequireWildcard_36(_$utils_55);
-
- function ___interopRequireWildcard_36(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
-
- function __start_36(arg) {
- var interaction = arg.interaction,
- interactable = arg.interactable,
- element = arg.element,
- rect = arg.rect,
- state = arg.state,
- startOffset = arg.startOffset;
- var options = state.options;
- var offsets = [];
- var origin = options.offsetWithOrigin ? getOrigin(arg) : {
- x: 0,
- y: 0
- };
- var snapOffset;
-
- if (options.offset === 'startCoords') {
- snapOffset = {
- x: interaction.coords.start.page.x,
- y: interaction.coords.start.page.y
- };
- } else {
- var offsetRect = __utils_36.rect.resolveRectLike(options.offset, interactable, element, [interaction]);
- snapOffset = __utils_36.rect.rectToXY(offsetRect) || {
- x: 0,
- y: 0
- };
- snapOffset.x += origin.x;
- snapOffset.y += origin.y;
- }
-
- var relativePoints = options.relativePoints || [];
-
- if (rect && options.relativePoints && options.relativePoints.length) {
- for (var index = 0; index < relativePoints.length; index++) {
- var relativePoint = relativePoints[index];
- offsets.push({
- index: index,
- relativePoint: relativePoint,
- x: startOffset.left - rect.width * relativePoint.x + snapOffset.x,
- y: startOffset.top - rect.height * relativePoint.y + snapOffset.y
- });
- }
- } else {
- offsets.push(__utils_36.extend({
- index: 0,
- relativePoint: null
- }, snapOffset));
- }
-
- state.offsets = offsets;
- }
-
- function __set_36(arg) {
- var interaction = arg.interaction,
- coords = arg.coords,
- state = arg.state;
- var options = state.options,
- offsets = state.offsets;
- var origin = __utils_36.getOriginXY(interaction.interactable, interaction.element, interaction.prepared.name);
- var page = __utils_36.extend({}, coords);
- var targets = [];
- var target;
-
- if (!options.offsetWithOrigin) {
- page.x -= origin.x;
- page.y -= origin.y;
- }
-
- state.realX = page.x;
- state.realY = page.y;
-
- for (var _i = 0; _i < offsets.length; _i++) {
- var _ref;
-
- _ref = offsets[_i];
- var offset = _ref;
- var relativeX = page.x - offset.x;
- var relativeY = page.y - offset.y;
-
- for (var index = 0, _len = options.targets.length; index < _len; index++) {
- var snapTarget = options.targets[index];
-
- if (__utils_36.is.func(snapTarget)) {
- target = snapTarget(relativeX, relativeY, interaction, offset, index);
- } else {
- target = snapTarget;
- }
-
- if (!target) {
- continue;
- }
-
- targets.push({
- x: (__utils_36.is.number(target.x) ? target.x : relativeX) + offset.x,
- y: (__utils_36.is.number(target.y) ? target.y : relativeY) + offset.y,
- range: __utils_36.is.number(target.range) ? target.range : options.range
- });
- }
- }
-
- var closest = {
- target: null,
- inRange: false,
- distance: 0,
- range: 0,
- dx: 0,
- dy: 0
- };
-
- for (var i = 0, len = targets.length; i < len; i++) {
- target = targets[i];
- var range = target.range;
- var dx = target.x - page.x;
- var dy = target.y - page.y;
- var distance = __utils_36.hypot(dx, dy);
- var inRange = distance <= range; // Infinite targets count as being out of range
- // compared to non infinite ones that are in range
-
- if (range === Infinity && closest.inRange && closest.range !== Infinity) {
- inRange = false;
- }
-
- if (!closest.target || (inRange // is the closest target in range?
- ? closest.inRange && range !== Infinity // the pointer is relatively deeper in this target
- ? distance / range < closest.distance / closest.range // this target has Infinite range and the closest doesn't
- : range === Infinity && closest.range !== Infinity || // OR this target is closer that the previous closest
- distance < closest.distance : // The other is not in range and the pointer is closer to this target
- !closest.inRange && distance < closest.distance)) {
- closest.target = target;
- closest.distance = distance;
- closest.range = range;
- closest.inRange = inRange;
- closest.dx = dx;
- closest.dy = dy;
- state.range = range;
- }
- }
-
- if (closest.inRange) {
- coords.x = closest.target.x;
- coords.y = closest.target.y;
- }
-
- state.closest = closest;
- }
-
- function getOrigin(arg) {
- var optionsOrigin = __utils_36.rect.rectToXY(__utils_36.rect.resolveRectLike(arg.state.options.origin));
- var origin = optionsOrigin || __utils_36.getOriginXY(arg.interactable, arg.interaction.element, arg.interaction.prepared.name);
- return origin;
- }
-
- var snap = {
- start: __start_36,
- set: __set_36,
- defaults: {
- enabled: false,
- range: Infinity,
- targets: null,
- offset: null,
- offsetWithOrigin: true,
- relativePoints: null
- }
- };
- var ___default_36 = snap;
- _$pointer_36["default"] = ___default_36;
-
- var _$size_37 = {};
- "use strict";
-
- Object.defineProperty(_$size_37, "__esModule", {
- value: true
- });
- _$size_37["default"] = void 0;
-
- var ___extend_37 = ___interopRequireDefault_37(_$extend_52);
-
- var __is_37 = ___interopRequireWildcard_37(_$is_56);
-
- var ___pointer_37 = ___interopRequireDefault_37(_$pointer_36);
-
- function ___interopRequireWildcard_37(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
-
- function ___interopRequireDefault_37(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- function ___slicedToArray_37(arr, i) { return ___arrayWithHoles_37(arr) || ___iterableToArrayLimit_37(arr, i) || ___nonIterableRest_37(); }
-
- function ___nonIterableRest_37() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
-
- function ___iterableToArrayLimit_37(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
-
- function ___arrayWithHoles_37(arr) { if (Array.isArray(arr)) return arr; }
-
- function __start_37(arg) {
- var interaction = arg.interaction,
- state = arg.state;
- var options = state.options;
- var edges = interaction.prepared.edges;
-
- if (!edges) {
- return null;
- }
-
- arg.state = {
- options: {
- relativePoints: [{
- x: edges.left ? 0 : 1,
- y: edges.top ? 0 : 1
- }],
- origin: {
- x: 0,
- y: 0
- },
- offset: options.offset || 'self',
- range: options.range
- }
- };
- state.targetFields = state.targetFields || [['width', 'height'], ['x', 'y']];
-
- ___pointer_37["default"].start(arg);
-
- state.offsets = arg.state.offsets;
- arg.state = state;
- }
-
- function __set_37(arg) {
- var interaction = arg.interaction,
- state = arg.state,
- coords = arg.coords;
- var options = state.options,
- offsets = state.offsets;
- var relative = {
- x: coords.x - offsets[0].x,
- y: coords.y - offsets[0].y
- };
- state.options = (0, ___extend_37["default"])({}, options);
- state.options.targets = [];
-
- for (var _i = 0; _i < (options.targets || []).length; _i++) {
- var _ref;
-
- _ref = (options.targets || [])[_i];
- var snapTarget = _ref;
- var target = void 0;
-
- if (__is_37.func(snapTarget)) {
- target = snapTarget(relative.x, relative.y, interaction);
- } else {
- target = snapTarget;
- }
-
- if (!target) {
- continue;
- }
-
- for (var _i2 = 0; _i2 < state.targetFields.length; _i2++) {
- var _ref2;
-
- _ref2 = state.targetFields[_i2];
-
- var _ref3 = _ref2,
- _ref4 = ___slicedToArray_37(_ref3, 2),
- xField = _ref4[0],
- yField = _ref4[1];
-
- if (xField in target || yField in target) {
- target.x = target[xField];
- target.y = target[yField];
- break;
- }
- }
-
- state.options.targets.push(target);
- }
-
- ___pointer_37["default"].set(arg);
-
- state.options = options;
- }
-
- var snapSize = {
- start: __start_37,
- set: __set_37,
- defaults: {
- enabled: false,
- range: Infinity,
- targets: null,
- offset: null
- }
- };
- var ___default_37 = snapSize;
- _$size_37["default"] = ___default_37;
-
- var _$edges_35 = {};
- "use strict";
-
- Object.defineProperty(_$edges_35, "__esModule", {
- value: true
- });
- _$edges_35["default"] = void 0;
-
- var ___clone_35 = ___interopRequireDefault_35(_$clone_48);
-
- var ___extend_35 = ___interopRequireDefault_35(_$extend_52);
-
- var _size = ___interopRequireDefault_35(_$size_37);
-
- function ___interopRequireDefault_35(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- /**
- * @module modifiers/snapEdges
- *
- * @description
- * This module allows snapping of the edges of targets during resize
- * interactions.
- *
- * @example
- * interact(target).resizable({
- * snapEdges: {
- * targets: [interact.snappers.grid({ x: 100, y: 50 })],
- * },
- * })
- *
- * interact(target).resizable({
- * snapEdges: {
- * targets: [
- * interact.snappers.grid({
- * top: 50,
- * left: 50,
- * bottom: 100,
- * right: 100,
- * }),
- * ],
- * },
- * })
- */
- function __start_35(arg) {
- var edges = arg.interaction.prepared.edges;
-
- if (!edges) {
- return null;
- }
-
- arg.state.targetFields = arg.state.targetFields || [[edges.left ? 'left' : 'right', edges.top ? 'top' : 'bottom']];
- return _size["default"].start(arg);
- }
-
- function __set_35(arg) {
- return _size["default"].set(arg);
- }
-
- var snapEdges = {
- start: __start_35,
- set: __set_35,
- defaults: (0, ___extend_35["default"])((0, ___clone_35["default"])(_size["default"].defaults), {
- offset: {
- x: 0,
- y: 0
- }
- })
- };
- var ___default_35 = snapEdges;
- _$edges_35["default"] = ___default_35;
-
- var _$modifiers_31 = {};
- "use strict";
-
- Object.defineProperty(_$modifiers_31, "__esModule", {
- value: true
- });
- _$modifiers_31.restrictSize = _$modifiers_31.restrictEdges = _$modifiers_31.restrict = _$modifiers_31.snapEdges = _$modifiers_31.snapSize = _$modifiers_31.snap = void 0;
-
- var ___base_31 = ___interopRequireDefault_31(_$base_30);
-
- var ___edges_31 = ___interopRequireDefault_31(_$edges_32);
-
- var ___pointer_31 = ___interopRequireDefault_31(_$pointer_33);
-
- var ___size_31 = ___interopRequireDefault_31(_$size_34);
-
- var _edges2 = ___interopRequireDefault_31(_$edges_35);
-
- var _pointer2 = ___interopRequireDefault_31(_$pointer_36);
-
- var _size2 = ___interopRequireDefault_31(_$size_37);
-
- function ___interopRequireDefault_31(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- var __makeModifier_31 = ___base_31["default"].makeModifier;
- var __snap_31 = __makeModifier_31(_pointer2["default"], 'snap');
- _$modifiers_31.snap = __snap_31;
- var __snapSize_31 = __makeModifier_31(_size2["default"], 'snapSize');
- _$modifiers_31.snapSize = __snapSize_31;
- var __snapEdges_31 = __makeModifier_31(_edges2["default"], 'snapEdges');
- _$modifiers_31.snapEdges = __snapEdges_31;
- var __restrict_31 = __makeModifier_31(___pointer_31["default"], 'restrict');
- _$modifiers_31.restrict = __restrict_31;
- var __restrictEdges_31 = __makeModifier_31(___edges_31["default"], 'restrictEdges');
- _$modifiers_31.restrictEdges = __restrictEdges_31;
- var __restrictSize_31 = __makeModifier_31(___size_31["default"], 'restrictSize');
- _$modifiers_31.restrictSize = __restrictSize_31;
-
- var _$PointerEvent_38 = {};
- "use strict";
-
- Object.defineProperty(_$PointerEvent_38, "__esModule", {
- value: true
- });
- _$PointerEvent_38["default"] = void 0;
-
- var ___BaseEvent2_38 = ___interopRequireDefault_38(_$BaseEvent_13);
-
- var ___pointerUtils_38 = ___interopRequireDefault_38(_$pointerUtils_60);
-
- function ___interopRequireDefault_38(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- function ___typeof_38(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ___typeof_38 = function _typeof(obj) { return typeof obj; }; } else { ___typeof_38 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ___typeof_38(obj); }
-
- function ___classCallCheck_38(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- function ___defineProperties_38(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
-
- function ___createClass_38(Constructor, protoProps, staticProps) { if (protoProps) ___defineProperties_38(Constructor.prototype, protoProps); if (staticProps) ___defineProperties_38(Constructor, staticProps); return Constructor; }
-
- function ___possibleConstructorReturn_38(self, call) { if (call && (___typeof_38(call) === "object" || typeof call === "function")) { return call; } return ___assertThisInitialized_38(self); }
-
- function ___getPrototypeOf_38(o) { ___getPrototypeOf_38 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ___getPrototypeOf_38(o); }
-
- function ___assertThisInitialized_38(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
-
- function ___inherits_38(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) ___setPrototypeOf_38(subClass, superClass); }
-
- function ___setPrototypeOf_38(o, p) { ___setPrototypeOf_38 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ___setPrototypeOf_38(o, p); }
-
- /** */
- var PointerEvent =
- /*#__PURE__*/
- function (_BaseEvent) {
- ___inherits_38(PointerEvent, _BaseEvent);
-
- /** */
- function PointerEvent(type, pointer, event, eventTarget, interaction, timeStamp) {
- var _this;
-
- ___classCallCheck_38(this, PointerEvent);
-
- _this = ___possibleConstructorReturn_38(this, ___getPrototypeOf_38(PointerEvent).call(this, interaction));
-
- ___pointerUtils_38["default"].pointerExtend(___assertThisInitialized_38(_this), event);
-
- if (event !== pointer) {
- ___pointerUtils_38["default"].pointerExtend(___assertThisInitialized_38(_this), pointer);
- }
-
- _this.timeStamp = timeStamp;
- _this.originalEvent = event;
- _this.type = type;
- _this.pointerId = ___pointerUtils_38["default"].getPointerId(pointer);
- _this.pointerType = ___pointerUtils_38["default"].getPointerType(pointer);
- _this.target = eventTarget;
- _this.currentTarget = null;
-
- if (type === 'tap') {
- var pointerIndex = interaction.getPointerIndex(pointer);
- _this.dt = _this.timeStamp - interaction.pointers[pointerIndex].downTime;
- var interval = _this.timeStamp - interaction.tapTime;
- _this["double"] = !!(interaction.prevTap && interaction.prevTap.type !== 'doubletap' && interaction.prevTap.target === _this.target && interval < 500);
- } else if (type === 'doubletap') {
- _this.dt = pointer.timeStamp - interaction.tapTime;
- }
-
- return _this;
- }
-
- ___createClass_38(PointerEvent, [{
- key: "_subtractOrigin",
- value: function _subtractOrigin(_ref) {
- var originX = _ref.x,
- originY = _ref.y;
- this.pageX -= originX;
- this.pageY -= originY;
- this.clientX -= originX;
- this.clientY -= originY;
- return this;
- }
- }, {
- key: "_addOrigin",
- value: function _addOrigin(_ref2) {
- var originX = _ref2.x,
- originY = _ref2.y;
- this.pageX += originX;
- this.pageY += originY;
- this.clientX += originX;
- this.clientY += originY;
- return this;
- }
- /**
- * Prevent the default behaviour of the original Event
- */
-
- }, {
- key: "preventDefault",
- value: function preventDefault() {
- this.originalEvent.preventDefault();
- }
- }]);
-
- return PointerEvent;
- }(___BaseEvent2_38["default"]);
-
- _$PointerEvent_38["default"] = PointerEvent;
-
- var _$base_39 = {};
- "use strict";
-
- Object.defineProperty(_$base_39, "__esModule", {
- value: true
- });
- _$base_39["default"] = void 0;
-
- var __utils_39 = ___interopRequireWildcard_39(_$utils_55);
-
- var _PointerEvent = ___interopRequireDefault_39(_$PointerEvent_38);
-
- function ___interopRequireDefault_39(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- function ___interopRequireWildcard_39(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
-
- var signals = new __utils_39.Signals();
- var simpleSignals = ['down', 'up', 'cancel'];
- var simpleEvents = ['down', 'up', 'cancel'];
- var __defaults_39 = {
- holdDuration: 600,
- ignoreFrom: null,
- allowFrom: null,
- origin: {
- x: 0,
- y: 0
- }
- };
- var pointerEvents = {
- id: 'pointer-events/base',
- install: __install_39,
- signals: signals,
- PointerEvent: _PointerEvent["default"],
- fire: fire,
- collectEventTargets: collectEventTargets,
- createSignalListener: createSignalListener,
- defaults: __defaults_39,
- types: ['down', 'move', 'up', 'cancel', 'tap', 'doubletap', 'hold']
- };
-
- function fire(arg, scope) {
- var interaction = arg.interaction,
- pointer = arg.pointer,
- event = arg.event,
- eventTarget = arg.eventTarget,
- _arg$type = arg.type,
- type = _arg$type === void 0 ? arg.pointerEvent.type : _arg$type,
- _arg$targets = arg.targets,
- targets = _arg$targets === void 0 ? collectEventTargets(arg) : _arg$targets;
- var _arg$pointerEvent = arg.pointerEvent,
- pointerEvent = _arg$pointerEvent === void 0 ? new _PointerEvent["default"](type, pointer, event, eventTarget, interaction, scope.now()) : _arg$pointerEvent;
- var signalArg = {
- interaction: interaction,
- pointer: pointer,
- event: event,
- eventTarget: eventTarget,
- targets: targets,
- type: type,
- pointerEvent: pointerEvent
- };
-
- for (var i = 0; i < targets.length; i++) {
- var target = targets[i];
-
- for (var prop in target.props || {}) {
- pointerEvent[prop] = target.props[prop];
- }
-
- var origin = __utils_39.getOriginXY(target.eventable, target.node);
-
- pointerEvent._subtractOrigin(origin);
-
- pointerEvent.eventable = target.eventable;
- pointerEvent.currentTarget = target.node;
- target.eventable.fire(pointerEvent);
-
- pointerEvent._addOrigin(origin);
-
- if (pointerEvent.immediatePropagationStopped || pointerEvent.propagationStopped && i + 1 < targets.length && targets[i + 1].node !== pointerEvent.currentTarget) {
- break;
- }
- }
-
- signals.fire('fired', signalArg);
-
- if (type === 'tap') {
- // if pointerEvent should make a double tap, create and fire a doubletap
- // PointerEvent and use that as the prevTap
- var prevTap = pointerEvent["double"] ? fire({
- interaction: interaction,
- pointer: pointer,
- event: event,
- eventTarget: eventTarget,
- type: 'doubletap'
- }, scope) : pointerEvent;
- interaction.prevTap = prevTap;
- interaction.tapTime = prevTap.timeStamp;
- }
-
- return pointerEvent;
- }
-
- function collectEventTargets(_ref) {
- var interaction = _ref.interaction,
- pointer = _ref.pointer,
- event = _ref.event,
- eventTarget = _ref.eventTarget,
- type = _ref.type;
- var pointerIndex = interaction.getPointerIndex(pointer);
- var pointerInfo = interaction.pointers[pointerIndex]; // do not fire a tap event if the pointer was moved before being lifted
-
- if (type === 'tap' && (interaction.pointerWasMoved || // or if the pointerup target is different to the pointerdown target
- !(pointerInfo && pointerInfo.downTarget === eventTarget))) {
- return [];
- }
-
- var path = __utils_39.dom.getPath(eventTarget);
- var signalArg = {
- interaction: interaction,
- pointer: pointer,
- event: event,
- eventTarget: eventTarget,
- type: type,
- path: path,
- targets: [],
- node: null
- };
-
- for (var _i = 0; _i < path.length; _i++) {
- var _ref2;
-
- _ref2 = path[_i];
- var node = _ref2;
- signalArg.node = node;
- signals.fire('collect-targets', signalArg);
- }
-
- if (type === 'hold') {
- signalArg.targets = signalArg.targets.filter(function (target) {
- return target.eventable.options.holdDuration === interaction.pointers[pointerIndex].hold.duration;
- });
- }
-
- return signalArg.targets;
- }
-
- function __install_39(scope) {
- var interactions = scope.interactions;
- scope.pointerEvents = pointerEvents;
- scope.defaults.actions.pointerEvents = pointerEvents.defaults;
- interactions.signals.on('new', function (_ref3) {
- var interaction = _ref3.interaction;
- interaction.prevTap = null; // the most recent tap event on this interaction
-
- interaction.tapTime = 0; // time of the most recent tap event
- });
- interactions.signals.on('update-pointer', function (_ref4) {
- var down = _ref4.down,
- pointerInfo = _ref4.pointerInfo;
-
- if (!down && pointerInfo.hold) {
- return;
- }
-
- pointerInfo.hold = {
- duration: Infinity,
- timeout: null
- };
- });
- interactions.signals.on('move', function (_ref5) {
- var interaction = _ref5.interaction,
- pointer = _ref5.pointer,
- event = _ref5.event,
- eventTarget = _ref5.eventTarget,
- duplicateMove = _ref5.duplicateMove;
- var pointerIndex = interaction.getPointerIndex(pointer);
-
- if (!duplicateMove && (!interaction.pointerIsDown || interaction.pointerWasMoved)) {
- if (interaction.pointerIsDown) {
- clearTimeout(interaction.pointers[pointerIndex].hold.timeout);
- }
-
- fire({
- interaction: interaction,
- pointer: pointer,
- event: event,
- eventTarget: eventTarget,
- type: 'move'
- }, scope);
- }
- });
- interactions.signals.on('down', function (_ref6) {
- var interaction = _ref6.interaction,
- pointer = _ref6.pointer,
- event = _ref6.event,
- eventTarget = _ref6.eventTarget,
- pointerIndex = _ref6.pointerIndex;
- var timer = interaction.pointers[pointerIndex].hold;
- var path = __utils_39.dom.getPath(eventTarget);
- var signalArg = {
- interaction: interaction,
- pointer: pointer,
- event: event,
- eventTarget: eventTarget,
- type: 'hold',
- targets: [],
- path: path,
- element: null
- };
-
- for (var _i2 = 0; _i2 < path.length; _i2++) {
- var _ref7;
-
- _ref7 = path[_i2];
- var element = _ref7;
- signalArg.element = element;
- signals.fire('collect-targets', signalArg);
- }
-
- if (!signalArg.targets.length) {
- return;
- }
-
- var minDuration = Infinity;
-
- for (var _i3 = 0; _i3 < signalArg.targets.length; _i3++) {
- var _ref8;
-
- _ref8 = signalArg.targets[_i3];
- var target = _ref8;
- var holdDuration = target.eventable.options.holdDuration;
-
- if (holdDuration < minDuration) {
- minDuration = holdDuration;
- }
- }
-
- timer.duration = minDuration;
- timer.timeout = setTimeout(function () {
- fire({
- interaction: interaction,
- eventTarget: eventTarget,
- pointer: pointer,
- event: event,
- type: 'hold'
- }, scope);
- }, minDuration);
- });
- var _arr = ['up', 'cancel'];
-
- for (var _i4 = 0; _i4 < _arr.length; _i4++) {
- var signalName = _arr[_i4];
- interactions.signals.on(signalName, function (_ref10) {
- var interaction = _ref10.interaction,
- pointerIndex = _ref10.pointerIndex;
-
- if (interaction.pointers[pointerIndex].hold) {
- clearTimeout(interaction.pointers[pointerIndex].hold.timeout);
- }
- });
- }
-
- for (var i = 0; i < simpleSignals.length; i++) {
- interactions.signals.on(simpleSignals[i], createSignalListener(simpleEvents[i], scope));
- }
-
- interactions.signals.on('up', function (_ref9) {
- var interaction = _ref9.interaction,
- pointer = _ref9.pointer,
- event = _ref9.event,
- eventTarget = _ref9.eventTarget;
-
- if (!interaction.pointerWasMoved) {
- fire({
- interaction: interaction,
- eventTarget: eventTarget,
- pointer: pointer,
- event: event,
- type: 'tap'
- }, scope);
- }
- });
- }
-
- function createSignalListener(type, scope) {
- return function (_ref11) {
- var interaction = _ref11.interaction,
- pointer = _ref11.pointer,
- event = _ref11.event,
- eventTarget = _ref11.eventTarget;
- fire({
- interaction: interaction,
- eventTarget: eventTarget,
- pointer: pointer,
- event: event,
- type: type
- }, scope);
- };
- }
-
- var ___default_39 = pointerEvents;
- _$base_39["default"] = ___default_39;
-
- var _$holdRepeat_40 = {};
- "use strict";
-
- Object.defineProperty(_$holdRepeat_40, "__esModule", {
- value: true
- });
- _$holdRepeat_40["default"] = void 0;
-
- var ___base_40 = ___interopRequireDefault_40(_$base_39);
-
- function ___interopRequireDefault_40(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- function __install_40(scope) {
- var pointerEvents = scope.pointerEvents,
- interactions = scope.interactions;
- scope.usePlugin(___base_40["default"]);
- pointerEvents.signals.on('new', onNew);
- pointerEvents.signals.on('fired', function (arg) {
- return onFired(arg, scope);
- });
- var _arr = ['move', 'up', 'cancel', 'endall'];
-
- for (var _i = 0; _i < _arr.length; _i++) {
- var signal = _arr[_i];
- interactions.signals.on(signal, endHoldRepeat);
- } // don't repeat by default
-
-
- pointerEvents.defaults.holdRepeatInterval = 0;
- pointerEvents.types.push('holdrepeat');
- }
-
- function onNew(_ref) {
- var pointerEvent = _ref.pointerEvent;
-
- if (pointerEvent.type !== 'hold') {
- return;
- }
-
- pointerEvent.count = (pointerEvent.count || 0) + 1;
- }
-
- function onFired(_ref2, scope) {
- var interaction = _ref2.interaction,
- pointerEvent = _ref2.pointerEvent,
- eventTarget = _ref2.eventTarget,
- targets = _ref2.targets;
-
- if (pointerEvent.type !== 'hold' || !targets.length) {
- return;
- } // get the repeat interval from the first eventable
-
-
- var interval = targets[0].eventable.options.holdRepeatInterval; // don't repeat if the interval is 0 or less
-
- if (interval <= 0) {
- return;
- } // set a timeout to fire the holdrepeat event
-
-
- interaction.holdIntervalHandle = setTimeout(function () {
- scope.pointerEvents.fire({
- interaction: interaction,
- eventTarget: eventTarget,
- type: 'hold',
- pointer: pointerEvent,
- event: pointerEvent
- }, scope);
- }, interval);
- }
-
- function endHoldRepeat(_ref3) {
- var interaction = _ref3.interaction;
-
- // set the interaction's holdStopTime property
- // to stop further holdRepeat events
- if (interaction.holdIntervalHandle) {
- clearInterval(interaction.holdIntervalHandle);
- interaction.holdIntervalHandle = null;
- }
- }
-
- var ___default_40 = {
- id: 'pointer-events/holdRepeat',
- install: __install_40
- };
- _$holdRepeat_40["default"] = ___default_40;
-
- var _$interactableTargets_42 = {};
- "use strict";
-
- Object.defineProperty(_$interactableTargets_42, "__esModule", {
- value: true
- });
- _$interactableTargets_42["default"] = void 0;
-
- /* removed: var _$arr_46 = require("@interactjs/utils/arr"); */;
-
- var ___extend_42 = ___interopRequireDefault_42(_$extend_52);
-
- function ___interopRequireDefault_42(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- function __install_42(scope) {
- var pointerEvents = scope.pointerEvents,
- actions = scope.actions,
- Interactable = scope.Interactable,
- interactables = scope.interactables;
- pointerEvents.signals.on('collect-targets', function (_ref) {
- var targets = _ref.targets,
- node = _ref.node,
- type = _ref.type,
- eventTarget = _ref.eventTarget;
- scope.interactables.forEachMatch(node, function (interactable) {
- var eventable = interactable.events;
- var options = eventable.options;
-
- if (eventable.types[type] && eventable.types[type].length && interactable.testIgnoreAllow(options, node, eventTarget)) {
- targets.push({
- node: node,
- eventable: eventable,
- props: {
- interactable: interactable
- }
- });
- }
- });
- });
- interactables.signals.on('new', function (_ref2) {
- var interactable = _ref2.interactable;
-
- interactable.events.getRect = function (element) {
- return interactable.getRect(element);
- };
- });
- interactables.signals.on('set', function (_ref3) {
- var interactable = _ref3.interactable,
- options = _ref3.options;
- (0, ___extend_42["default"])(interactable.events.options, pointerEvents.defaults);
- (0, ___extend_42["default"])(interactable.events.options, options.pointerEvents || {});
- });
- (0, _$arr_46.merge)(actions.eventTypes, pointerEvents.types);
- Interactable.prototype.pointerEvents = pointerEventsMethod;
- var __backCompatOption = Interactable.prototype._backCompatOption;
-
- Interactable.prototype._backCompatOption = function (optionName, newValue) {
- var ret = __backCompatOption.call(this, optionName, newValue);
-
- if (ret === this) {
- this.events.options[optionName] = newValue;
- }
-
- return ret;
- };
- }
-
- function pointerEventsMethod(options) {
- (0, ___extend_42["default"])(this.events.options, options);
- return this;
- }
-
- var ___default_42 = {
- id: 'pointer-events/interactableTargets',
- install: __install_42
- };
- _$interactableTargets_42["default"] = ___default_42;
-
- var _$pointerEvents_41 = {};
- "use strict";
-
- Object.defineProperty(_$pointerEvents_41, "__esModule", {
- value: true
- });
- _$pointerEvents_41.install = __install_41;
- Object.defineProperty(_$pointerEvents_41, "pointerEvents", {
- enumerable: true,
- get: function get() {
- return ___base_41["default"];
- }
- });
- Object.defineProperty(_$pointerEvents_41, "holdRepeat", {
- enumerable: true,
- get: function get() {
- return _holdRepeat["default"];
- }
- });
- Object.defineProperty(_$pointerEvents_41, "interactableTargets", {
- enumerable: true,
- get: function get() {
- return _interactableTargets["default"];
- }
- });
- _$pointerEvents_41.id = void 0;
-
- var ___base_41 = ___interopRequireDefault_41(_$base_39);
-
- var _holdRepeat = ___interopRequireDefault_41(_$holdRepeat_40);
-
- var _interactableTargets = ___interopRequireDefault_41(_$interactableTargets_42);
-
- function ___interopRequireDefault_41(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- function __install_41(scope) {
- scope.usePlugin(___base_41["default"]);
- scope.usePlugin(_holdRepeat["default"]);
- scope.usePlugin(_interactableTargets["default"]);
- }
-
- var __id_41 = 'pointer-events';
- _$pointerEvents_41.id = __id_41;
-
- var _$reflow_43 = {};
- "use strict";
-
- Object.defineProperty(_$reflow_43, "__esModule", {
- value: true
- });
- _$reflow_43.install = __install_43;
- _$reflow_43["default"] = void 0;
-
- /* removed: var _$InteractEvent_15 = require("@interactjs/core/InteractEvent"); */;
-
- /* removed: var _$utils_55 = require("@interactjs/utils"); */;
-
- _$InteractEvent_15.EventPhase.Reflow = 'reflow';
-
- function __install_43(scope) {
- var actions = scope.actions,
- interactions = scope.interactions,
- Interactable = scope.Interactable; // add action reflow event types
-
- for (var _i = 0; _i < actions.names.length; _i++) {
- var _ref;
-
- _ref = actions.names[_i];
- var actionName = _ref;
- actions.eventTypes.push("".concat(actionName, "reflow"));
- } // remove completed reflow interactions
-
-
- interactions.signals.on('stop', function (_ref2) {
- var interaction = _ref2.interaction;
-
- if (interaction.pointerType === _$InteractEvent_15.EventPhase.Reflow) {
- if (interaction._reflowResolve) {
- interaction._reflowResolve();
- }
-
- _$utils_55.arr.remove(scope.interactions.list, interaction);
- }
- });
- /**
- * ```js
- * const interactable = interact(target)
- * const drag = { name: drag, axis: 'x' }
- * const resize = { name: resize, edges: { left: true, bottom: true }
- *
- * interactable.reflow(drag)
- * interactable.reflow(resize)
- * ```
- *
- * Start an action sequence to re-apply modifiers, check drops, etc.
- *
- * @param { Object } action The action to begin
- * @param { string } action.name The name of the action
- * @returns { Promise<Interactable> }
- */
-
- Interactable.prototype.reflow = function (action) {
- return reflow(this, action, scope);
- };
- }
-
- function reflow(interactable, action, scope) {
- var elements = _$utils_55.is.string(interactable.target) ? _$utils_55.arr.from(interactable._context.querySelectorAll(interactable.target)) : [interactable.target]; // tslint:disable-next-line variable-name
-
- var Promise = _$utils_55.win.window.Promise;
- var promises = Promise ? [] : null;
-
- var _loop = function _loop() {
- _ref3 = elements[_i2];
- var element = _ref3;
- var rect = interactable.getRect(element);
-
- if (!rect) {
- return "break";
- }
-
- var runningInteraction = _$utils_55.arr.find(scope.interactions.list, function (interaction) {
- return interaction.interacting() && interaction.interactable === interactable && interaction.element === element && interaction.prepared.name === action.name;
- });
-
- var reflowPromise = void 0;
-
- if (runningInteraction) {
- runningInteraction.move();
-
- if (promises) {
- reflowPromise = runningInteraction._reflowPromise || new Promise(function (resolve) {
- runningInteraction._reflowResolve = resolve;
- });
- }
- } else {
- var xywh = _$utils_55.rect.tlbrToXywh(rect);
-
- var coords = {
- page: {
- x: xywh.x,
- y: xywh.y
- },
- client: {
- x: xywh.x,
- y: xywh.y
- },
- timeStamp: scope.now()
- };
-
- var event = _$utils_55.pointer.coordsToEvent(coords);
-
- reflowPromise = startReflow(scope, interactable, element, action, event);
- }
-
- if (promises) {
- promises.push(reflowPromise);
- }
- };
-
- for (var _i2 = 0; _i2 < elements.length; _i2++) {
- var _ref3;
-
- var _ret = _loop();
-
- if (_ret === "break") break;
- }
-
- return promises && Promise.all(promises).then(function () {
- return interactable;
- });
- }
-
- function startReflow(scope, interactable, element, action, event) {
- var interaction = scope.interactions["new"]({
- pointerType: 'reflow'
- });
- var signalArg = {
- interaction: interaction,
- event: event,
- pointer: event,
- eventTarget: element,
- phase: _$InteractEvent_15.EventPhase.Reflow
- };
- interaction.interactable = interactable;
- interaction.element = element;
- interaction.prepared = (0, _$utils_55.extend)({}, action);
- interaction.prevEvent = event;
- interaction.updatePointer(event, event, element, true);
-
- interaction._doPhase(signalArg);
-
- var reflowPromise = _$utils_55.win.window.Promise ? new _$utils_55.win.window.Promise(function (resolve) {
- interaction._reflowResolve = resolve;
- }) : null;
- interaction._reflowPromise = reflowPromise;
- interaction.start(action, interactable, element);
-
- if (interaction._interacting) {
- interaction.move(signalArg);
- interaction.end(event);
- } else {
- interaction.stop();
- }
-
- interaction.removePointer(event, event);
- interaction.pointerIsDown = false;
- return reflowPromise;
- }
-
- var ___default_43 = {
- id: 'reflow',
- install: __install_43
- };
- _$reflow_43["default"] = ___default_43;
-
- var _$interact_28 = {};
- "use strict";
-
- Object.defineProperty(_$interact_28, "__esModule", {
- value: true
- });
- _$interact_28["default"] = _$interact_28.scope = _$interact_28.interact = void 0;
-
- var ___scope_28 = _$scope_24({});
-
- var __utils_28 = ___interopRequireWildcard_28(_$utils_55);
-
- var ___browser_28 = ___interopRequireDefault_28(_$browser_47);
-
- var ___events_28 = ___interopRequireDefault_28(_$events_51);
-
- function ___interopRequireDefault_28(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- function ___interopRequireWildcard_28(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
-
- /** @module interact */
- var globalEvents = {};
- var scope = new ___scope_28.Scope();
- /**
- * ```js
- * interact('#draggable').draggable(true)
- *
- * var rectables = interact('rect')
- * rectables
- * .gesturable(true)
- * .on('gesturemove', function (event) {
- * // ...
- * })
- * ```
- *
- * The methods of this variable can be used to set elements as interactables
- * and also to change various default settings.
- *
- * Calling it as a function and passing an element or a valid CSS selector
- * string returns an Interactable object which has various methods to configure
- * it.
- *
- * @global
- *
- * @param {Element | string} target The HTML or SVG Element to interact with
- * or CSS selector
- * @return {Interactable}
- */
-
- _$interact_28.scope = scope;
-
- var interact = function interact(target, options) {
- var interactable = scope.interactables.get(target, options);
-
- if (!interactable) {
- interactable = scope.interactables["new"](target, options);
- interactable.events.global = globalEvents;
- }
-
- return interactable;
- };
- /**
- * Use a plugin
- *
- * @alias module:interact.use
- *
- * @param {Object} plugin
- * @param {function} plugin.install
- * @return {interact}
- */
-
-
- _$interact_28.interact = interact;
- interact.use = use;
-
- function use(plugin, options) {
- scope.usePlugin(plugin, options);
- return interact;
- }
- /**
- * Check if an element or selector has been set with the {@link interact}
- * function
- *
- * @alias module:interact.isSet
- *
- * @param {Element} element The Element being searched for
- * @return {boolean} Indicates if the element or CSS selector was previously
- * passed to interact
- */
-
-
- interact.isSet = isSet;
-
- function isSet(target, options) {
- return !!scope.interactables.get(target, options && options.context);
- }
- /**
- * Add a global listener for an InteractEvent or adds a DOM event to `document`
- *
- * @alias module:interact.on
- *
- * @param {string | array | object} type The types of events to listen for
- * @param {function} listener The function event (s)
- * @param {object | boolean} [options] object or useCapture flag for
- * addEventListener
- * @return {object} interact
- */
-
-
- interact.on = on;
-
- function on(type, listener, options) {
- if (__utils_28.is.string(type) && type.search(' ') !== -1) {
- type = type.trim().split(/ +/);
- }
-
- if (__utils_28.is.array(type)) {
- for (var _i = 0; _i < type.length; _i++) {
- var _ref;
-
- _ref = type[_i];
- var eventType = _ref;
- interact.on(eventType, listener, options);
- }
-
- return interact;
- }
-
- if (__utils_28.is.object(type)) {
- for (var prop in type) {
- interact.on(prop, type[prop], listener);
- }
-
- return interact;
- } // if it is an InteractEvent type, add listener to globalEvents
-
-
- if (__utils_28.arr.contains(scope.actions.eventTypes, type)) {
- // if this type of event was never bound
- if (!globalEvents[type]) {
- globalEvents[type] = [listener];
- } else {
- globalEvents[type].push(listener);
- }
- } // If non InteractEvent type, addEventListener to document
- else {
- ___events_28["default"].add(scope.document, type, listener, {
- options: options
- });
- }
-
- return interact;
- }
- /**
- * Removes a global InteractEvent listener or DOM event from `document`
- *
- * @alias module:interact.off
- *
- * @param {string | array | object} type The types of events that were listened
- * for
- * @param {function} listener The listener function to be removed
- * @param {object | boolean} options [options] object or useCapture flag for
- * removeEventListener
- * @return {object} interact
- */
-
-
- interact.off = off;
-
- function off(type, listener, options) {
- if (__utils_28.is.string(type) && type.search(' ') !== -1) {
- type = type.trim().split(/ +/);
- }
-
- if (__utils_28.is.array(type)) {
- for (var _i2 = 0; _i2 < type.length; _i2++) {
- var _ref2;
-
- _ref2 = type[_i2];
- var eventType = _ref2;
- interact.off(eventType, listener, options);
- }
-
- return interact;
- }
-
- if (__utils_28.is.object(type)) {
- for (var prop in type) {
- interact.off(prop, type[prop], listener);
- }
-
- return interact;
- }
-
- if (!__utils_28.arr.contains(scope.actions.eventTypes, type)) {
- ___events_28["default"].remove(scope.document, type, listener, options);
- } else {
- var index;
-
- if (type in globalEvents && (index = globalEvents[type].indexOf(listener)) !== -1) {
- globalEvents[type].splice(index, 1);
- }
- }
-
- return interact;
- }
- /**
- * Returns an object which exposes internal data
- * @alias module:interact.debug
- *
- * @return {object} An object with properties that outline the current state
- * and expose internal functions and variables
- */
-
-
- interact.debug = debug;
-
- function debug() {
- return scope;
- } // expose the functions used to calculate multi-touch properties
-
-
- interact.getPointerAverage = __utils_28.pointer.pointerAverage;
- interact.getTouchBBox = __utils_28.pointer.touchBBox;
- interact.getTouchDistance = __utils_28.pointer.touchDistance;
- interact.getTouchAngle = __utils_28.pointer.touchAngle;
- interact.getElementRect = __utils_28.dom.getElementRect;
- interact.getElementClientRect = __utils_28.dom.getElementClientRect;
- interact.matchesSelector = __utils_28.dom.matchesSelector;
- interact.closest = __utils_28.dom.closest;
- /**
- * @alias module:interact.supportsTouch
- *
- * @return {boolean} Whether or not the browser supports touch input
- */
-
- interact.supportsTouch = supportsTouch;
-
- function supportsTouch() {
- return ___browser_28["default"].supportsTouch;
- }
- /**
- * @alias module:interact.supportsPointerEvent
- *
- * @return {boolean} Whether or not the browser supports PointerEvents
- */
-
-
- interact.supportsPointerEvent = supportsPointerEvent;
-
- function supportsPointerEvent() {
- return ___browser_28["default"].supportsPointerEvent;
- }
- /**
- * Cancels all interactions (end events are not fired)
- *
- * @alias module:interact.stop
- *
- * @return {object} interact
- */
-
-
- interact.stop = __stop_28;
-
- function __stop_28() {
- for (var _i3 = 0; _i3 < scope.interactions.list.length; _i3++) {
- var _ref3;
-
- _ref3 = scope.interactions.list[_i3];
- var interaction = _ref3;
- interaction.stop();
- }
-
- return interact;
- }
- /**
- * Returns or sets the distance the pointer must be moved before an action
- * sequence occurs. This also affects tolerance for tap events.
- *
- * @alias module:interact.pointerMoveTolerance
- *
- * @param {number} [newValue] The movement from the start position must be greater than this value
- * @return {interact | number}
- */
-
-
- interact.pointerMoveTolerance = pointerMoveTolerance;
-
- function pointerMoveTolerance(newValue) {
- if (__utils_28.is.number(newValue)) {
- scope.interactions.pointerMoveTolerance = newValue;
- return interact;
- }
-
- return scope.interactions.pointerMoveTolerance;
- }
-
- scope.interactables.signals.on('unset', function (_ref4) {
- var interactable = _ref4.interactable;
- scope.interactables.list.splice(scope.interactables.list.indexOf(interactable), 1); // Stop related interactions when an Interactable is unset
-
- for (var _i4 = 0; _i4 < scope.interactions.list.length; _i4++) {
- var _ref5;
-
- _ref5 = scope.interactions.list[_i4];
- var interaction = _ref5;
-
- if (interaction.interactable === interactable && interaction.interacting() && !interaction._ending) {
- interaction.stop();
- }
- }
- });
-
- interact.addDocument = function (doc, options) {
- return scope.addDocument(doc, options);
- };
-
- interact.removeDocument = function (doc) {
- return scope.removeDocument(doc);
- };
-
- scope.interact = interact;
- var ___default_28 = interact;
- _$interact_28["default"] = ___default_28;
-
- var _$interact_27 = {};
- "use strict";
-
- Object.defineProperty(_$interact_27, "__esModule", {
- value: true
- });
- _$interact_27.init = __init_27;
- Object.defineProperty(_$interact_27, "autoScroll", {
- enumerable: true,
- get: function get() {
- return _autoScroll["default"];
- }
- });
- Object.defineProperty(_$interact_27, "interactablePreventDefault", {
- enumerable: true,
- get: function get() {
- return _interactablePreventDefault["default"];
- }
- });
- Object.defineProperty(_$interact_27, "inertia", {
- enumerable: true,
- get: function get() {
- return _inertia["default"];
- }
- });
- Object.defineProperty(_$interact_27, "modifiers", {
- enumerable: true,
- get: function get() {
- return ___base_27["default"];
- }
- });
- Object.defineProperty(_$interact_27, "reflow", {
- enumerable: true,
- get: function get() {
- return _reflow["default"];
- }
- });
- Object.defineProperty(_$interact_27, "interact", {
- enumerable: true,
- get: function get() {
- return _interact["default"];
- }
- });
- _$interact_27.pointerEvents = _$interact_27.actions = _$interact_27["default"] = void 0;
-
- var actions = ___interopRequireWildcard_27(_$actions_5);
-
- _$interact_27.actions = actions;
-
- var _autoScroll = ___interopRequireDefault_27(_$autoScroll_7);
-
- var autoStart = ___interopRequireWildcard_27(_$autoStart_12);
-
- var _interactablePreventDefault = ___interopRequireDefault_27(_$interactablePreventDefault_21);
-
- var _devTools = ___interopRequireDefault_27(_$devTools_25);
-
- var _inertia = ___interopRequireDefault_27(_$inertia_26);
-
- var modifiers = ___interopRequireWildcard_27(_$modifiers_31);
-
- var ___base_27 = ___interopRequireDefault_27(_$base_30);
-
- var __pointerEvents_27 = ___interopRequireWildcard_27(_$pointerEvents_41);
-
- _$interact_27.pointerEvents = __pointerEvents_27;
-
- var _reflow = ___interopRequireDefault_27(_$reflow_43);
-
- var _interact = ___interopRequireWildcard_27(_$interact_28);
-
- function ___interopRequireDefault_27(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- function ___interopRequireWildcard_27(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
-
- function __init_27(window) {
- _interact.scope.init(window);
-
- _interact["default"].use(_interactablePreventDefault["default"]); // inertia
-
-
- _interact["default"].use(_inertia["default"]); // pointerEvents
-
-
- _interact["default"].use(__pointerEvents_27); // autoStart, hold
-
-
- _interact["default"].use(autoStart); // drag and drop, resize, gesture
-
-
- _interact["default"].use(actions); // snap, resize, etc.
-
-
- _interact["default"].use(___base_27["default"]); // for backwrads compatibility
-
-
- for (var type in modifiers) {
- var _modifiers$type = modifiers[type],
- _defaults = _modifiers$type._defaults,
- _methods = _modifiers$type._methods;
- _defaults._methods = _methods;
- _interact.scope.defaults.perAction[type] = _defaults;
- } // autoScroll
-
-
- _interact["default"].use(_autoScroll["default"]); // reflow
-
-
- _interact["default"].use(_reflow["default"]); // eslint-disable-next-line no-undef
-
-
- if (false) {}
-
- return _interact["default"];
- } // eslint-disable-next-line no-undef
-
-
- _interact["default"].version = "1.4.9";
- var ___default_27 = _interact["default"];
- _$interact_27["default"] = ___default_27;
-
- var _$types_44 = {};
- /// <reference path="./types.d.ts" />
- "use strict";
-
- var _$grid_63 = {};
- "use strict";
-
- Object.defineProperty(_$grid_63, "__esModule", {
- value: true
- });
- _$grid_63["default"] = void 0;
-
- function ___slicedToArray_63(arr, i) { return ___arrayWithHoles_63(arr) || ___iterableToArrayLimit_63(arr, i) || ___nonIterableRest_63(); }
-
- function ___nonIterableRest_63() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
-
- function ___iterableToArrayLimit_63(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
-
- function ___arrayWithHoles_63(arr) { if (Array.isArray(arr)) return arr; }
-
- function createGrid(grid) {
- var coordFields = [['x', 'y'], ['left', 'top'], ['right', 'bottom'], ['width', 'height']].filter(function (_ref) {
- var _ref2 = ___slicedToArray_63(_ref, 2),
- xField = _ref2[0],
- yField = _ref2[1];
-
- return xField in grid || yField in grid;
- });
- return function (x, y) {
- var range = grid.range,
- _grid$limits = grid.limits,
- limits = _grid$limits === void 0 ? {
- left: -Infinity,
- right: Infinity,
- top: -Infinity,
- bottom: Infinity
- } : _grid$limits,
- _grid$offset = grid.offset,
- offset = _grid$offset === void 0 ? {
- x: 0,
- y: 0
- } : _grid$offset;
- var result = {
- range: range
- };
-
- for (var _i2 = 0; _i2 < coordFields.length; _i2++) {
- var _ref3;
-
- _ref3 = coordFields[_i2];
-
- var _ref4 = _ref3,
- _ref5 = ___slicedToArray_63(_ref4, 2),
- xField = _ref5[0],
- yField = _ref5[1];
-
- var gridx = Math.round((x - offset.x) / grid[xField]);
- var gridy = Math.round((y - offset.y) / grid[yField]);
- result[xField] = Math.max(limits.left, Math.min(limits.right, gridx * grid[xField] + offset.x));
- result[yField] = Math.max(limits.top, Math.min(limits.bottom, gridy * grid[yField] + offset.y));
- }
-
- return result;
- };
- }
-
- var ___default_63 = createGrid;
- _$grid_63["default"] = ___default_63;
-
- var _$snappers_64 = {};
- "use strict";
-
- Object.defineProperty(_$snappers_64, "__esModule", {
- value: true
- });
- Object.defineProperty(_$snappers_64, "grid", {
- enumerable: true,
- get: function get() {
- return _grid["default"];
- }
- });
-
- var _grid = ___interopRequireDefault_64(_$grid_63);
-
- function ___interopRequireDefault_64(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- var _$index_29 = { exports: {} };
- "use strict";
-
- Object.defineProperty(_$index_29.exports, "__esModule", {
- value: true
- });
- _$index_29.exports.init = __init_29;
- _$index_29.exports["default"] = void 0;
-
- var ___interact_29 = ___interopRequireWildcard_29(_$interact_27);
-
- var __modifiers_29 = ___interopRequireWildcard_29(_$modifiers_31);
-
- _$types_44;
-
- var ___extend_29 = ___interopRequireDefault_29(_$extend_52);
-
- var snappers = ___interopRequireWildcard_29(_$snappers_64);
-
- function ___interopRequireDefault_29(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
-
- function ___interopRequireWildcard_29(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }
-
- function ___typeof_29(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ___typeof_29 = function _typeof(obj) { return typeof obj; }; } else { ___typeof_29 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ___typeof_29(obj); }
-
- if ((typeof window === "undefined" ? "undefined" : ___typeof_29(window)) === 'object' && !!window) {
- __init_29(window);
- }
-
- function __init_29(win) {
- (0, ___interact_29.init)(win);
- return ___interact_29["default"].use({
- id: 'interactjs',
- install: function install(scope) {
- ___interact_29["default"].modifiers = (0, ___extend_29["default"])(scope.modifiers, __modifiers_29);
- ___interact_29["default"].snappers = snappers;
- ___interact_29["default"].createSnapGrid = ___interact_29["default"].snappers.grid;
- }
- });
- }
-
- var ___default_29 = ___interact_29["default"];
- _$index_29.exports["default"] = ___default_29;
- ___interact_29["default"]['default'] = ___interact_29["default"]; // tslint:disable-line no-string-literal
-
- ___interact_29["default"]['init'] = __init_29; // tslint:disable-line no-string-literal
-
- if (( false ? undefined : ___typeof_29(_$index_29)) === 'object' && !!_$index_29) {
- _$index_29.exports = ___interact_29["default"];
- }
-
- _$index_29 = _$index_29.exports
- return _$index_29;
-
- });
-
-
- //# sourceMappingURL=interact.js.map
-
-
- /***/ }),
-
- /***/ "./node_modules/lodash.debounce/index.js":
- /*!***********************************************!*\
- !*** ./node_modules/lodash.debounce/index.js ***!
- \***********************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- /* WEBPACK VAR INJECTION */(function(global) {/**
- * lodash (Custom Build) <https://lodash.com/>
- * Build: `lodash modularize exports="npm" -o ./`
- * Copyright jQuery Foundation and other contributors <https://jquery.org/>
- * Released under MIT license <https://lodash.com/license>
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
- */
-
- /** Used as the `TypeError` message for "Functions" methods. */
- var FUNC_ERROR_TEXT = 'Expected a function';
-
- /** Used as references for various `Number` constants. */
- var NAN = 0 / 0;
-
- /** `Object#toString` result references. */
- var symbolTag = '[object Symbol]';
-
- /** Used to match leading and trailing whitespace. */
- var reTrim = /^\s+|\s+$/g;
-
- /** Used to detect bad signed hexadecimal string values. */
- var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
-
- /** Used to detect binary string values. */
- var reIsBinary = /^0b[01]+$/i;
-
- /** Used to detect octal string values. */
- var reIsOctal = /^0o[0-7]+$/i;
-
- /** Built-in method references without a dependency on `root`. */
- var freeParseInt = parseInt;
-
- /** Detect free variable `global` from Node.js. */
- var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
-
- /** Detect free variable `self`. */
- var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
-
- /** Used as a reference to the global object. */
- var root = freeGlobal || freeSelf || Function('return this')();
-
- /** Used for built-in method references. */
- var objectProto = Object.prototype;
-
- /**
- * Used to resolve the
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
- * of values.
- */
- var objectToString = objectProto.toString;
-
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeMax = Math.max,
- nativeMin = Math.min;
-
- /**
- * Gets the timestamp of the number of milliseconds that have elapsed since
- * the Unix epoch (1 January 1970 00:00:00 UTC).
- *
- * @static
- * @memberOf _
- * @since 2.4.0
- * @category Date
- * @returns {number} Returns the timestamp.
- * @example
- *
- * _.defer(function(stamp) {
- * console.log(_.now() - stamp);
- * }, _.now());
- * // => Logs the number of milliseconds it took for the deferred invocation.
- */
- var now = function() {
- return root.Date.now();
- };
-
- /**
- * Creates a debounced function that delays invoking `func` until after `wait`
- * milliseconds have elapsed since the last time the debounced function was
- * invoked. The debounced function comes with a `cancel` method to cancel
- * delayed `func` invocations and a `flush` method to immediately invoke them.
- * Provide `options` to indicate whether `func` should be invoked on the
- * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
- * with the last arguments provided to the debounced function. Subsequent
- * calls to the debounced function return the result of the last `func`
- * invocation.
- *
- * **Note:** If `leading` and `trailing` options are `true`, `func` is
- * invoked on the trailing edge of the timeout only if the debounced function
- * is invoked more than once during the `wait` timeout.
- *
- * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
- * until to the next tick, similar to `setTimeout` with a timeout of `0`.
- *
- * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
- * for details over the differences between `_.debounce` and `_.throttle`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Function
- * @param {Function} func The function to debounce.
- * @param {number} [wait=0] The number of milliseconds to delay.
- * @param {Object} [options={}] The options object.
- * @param {boolean} [options.leading=false]
- * Specify invoking on the leading edge of the timeout.
- * @param {number} [options.maxWait]
- * The maximum time `func` is allowed to be delayed before it's invoked.
- * @param {boolean} [options.trailing=true]
- * Specify invoking on the trailing edge of the timeout.
- * @returns {Function} Returns the new debounced function.
- * @example
- *
- * // Avoid costly calculations while the window size is in flux.
- * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
- *
- * // Invoke `sendMail` when clicked, debouncing subsequent calls.
- * jQuery(element).on('click', _.debounce(sendMail, 300, {
- * 'leading': true,
- * 'trailing': false
- * }));
- *
- * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
- * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
- * var source = new EventSource('/stream');
- * jQuery(source).on('message', debounced);
- *
- * // Cancel the trailing debounced invocation.
- * jQuery(window).on('popstate', debounced.cancel);
- */
- function debounce(func, wait, options) {
- var lastArgs,
- lastThis,
- maxWait,
- result,
- timerId,
- lastCallTime,
- lastInvokeTime = 0,
- leading = false,
- maxing = false,
- trailing = true;
-
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- wait = toNumber(wait) || 0;
- if (isObject(options)) {
- leading = !!options.leading;
- maxing = 'maxWait' in options;
- maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
- trailing = 'trailing' in options ? !!options.trailing : trailing;
- }
-
- function invokeFunc(time) {
- var args = lastArgs,
- thisArg = lastThis;
-
- lastArgs = lastThis = undefined;
- lastInvokeTime = time;
- result = func.apply(thisArg, args);
- return result;
- }
-
- function leadingEdge(time) {
- // Reset any `maxWait` timer.
- lastInvokeTime = time;
- // Start the timer for the trailing edge.
- timerId = setTimeout(timerExpired, wait);
- // Invoke the leading edge.
- return leading ? invokeFunc(time) : result;
- }
-
- function remainingWait(time) {
- var timeSinceLastCall = time - lastCallTime,
- timeSinceLastInvoke = time - lastInvokeTime,
- result = wait - timeSinceLastCall;
-
- return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;
- }
-
- function shouldInvoke(time) {
- var timeSinceLastCall = time - lastCallTime,
- timeSinceLastInvoke = time - lastInvokeTime;
-
- // Either this is the first call, activity has stopped and we're at the
- // trailing edge, the system time has gone backwards and we're treating
- // it as the trailing edge, or we've hit the `maxWait` limit.
- return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
- (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
- }
-
- function timerExpired() {
- var time = now();
- if (shouldInvoke(time)) {
- return trailingEdge(time);
- }
- // Restart the timer.
- timerId = setTimeout(timerExpired, remainingWait(time));
- }
-
- function trailingEdge(time) {
- timerId = undefined;
-
- // Only invoke if we have `lastArgs` which means `func` has been
- // debounced at least once.
- if (trailing && lastArgs) {
- return invokeFunc(time);
- }
- lastArgs = lastThis = undefined;
- return result;
- }
-
- function cancel() {
- if (timerId !== undefined) {
- clearTimeout(timerId);
- }
- lastInvokeTime = 0;
- lastArgs = lastCallTime = lastThis = timerId = undefined;
- }
-
- function flush() {
- return timerId === undefined ? result : trailingEdge(now());
- }
-
- function debounced() {
- var time = now(),
- isInvoking = shouldInvoke(time);
-
- lastArgs = arguments;
- lastThis = this;
- lastCallTime = time;
-
- if (isInvoking) {
- if (timerId === undefined) {
- return leadingEdge(lastCallTime);
- }
- if (maxing) {
- // Handle invocations in a tight loop.
- timerId = setTimeout(timerExpired, wait);
- return invokeFunc(lastCallTime);
- }
- }
- if (timerId === undefined) {
- timerId = setTimeout(timerExpired, wait);
- }
- return result;
- }
- debounced.cancel = cancel;
- debounced.flush = flush;
- return debounced;
- }
-
- /**
- * Checks if `value` is the
- * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
- * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
- * @example
- *
- * _.isObject({});
- * // => true
- *
- * _.isObject([1, 2, 3]);
- * // => true
- *
- * _.isObject(_.noop);
- * // => true
- *
- * _.isObject(null);
- * // => false
- */
- function isObject(value) {
- var type = typeof value;
- return !!value && (type == 'object' || type == 'function');
- }
-
- /**
- * Checks if `value` is object-like. A value is object-like if it's not `null`
- * and has a `typeof` result of "object".
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
- * @example
- *
- * _.isObjectLike({});
- * // => true
- *
- * _.isObjectLike([1, 2, 3]);
- * // => true
- *
- * _.isObjectLike(_.noop);
- * // => false
- *
- * _.isObjectLike(null);
- * // => false
- */
- function isObjectLike(value) {
- return !!value && typeof value == 'object';
- }
-
- /**
- * Checks if `value` is classified as a `Symbol` primitive or object.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
- * @example
- *
- * _.isSymbol(Symbol.iterator);
- * // => true
- *
- * _.isSymbol('abc');
- * // => false
- */
- function isSymbol(value) {
- return typeof value == 'symbol' ||
- (isObjectLike(value) && objectToString.call(value) == symbolTag);
- }
-
- /**
- * Converts `value` to a number.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to process.
- * @returns {number} Returns the number.
- * @example
- *
- * _.toNumber(3.2);
- * // => 3.2
- *
- * _.toNumber(Number.MIN_VALUE);
- * // => 5e-324
- *
- * _.toNumber(Infinity);
- * // => Infinity
- *
- * _.toNumber('3.2');
- * // => 3.2
- */
- function toNumber(value) {
- if (typeof value == 'number') {
- return value;
- }
- if (isSymbol(value)) {
- return NAN;
- }
- if (isObject(value)) {
- var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
- value = isObject(other) ? (other + '') : other;
- }
- if (typeof value != 'string') {
- return value === 0 ? value : +value;
- }
- value = value.replace(reTrim, '');
- var isBinary = reIsBinary.test(value);
- return (isBinary || reIsOctal.test(value))
- ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
- : (reIsBadHex.test(value) ? NAN : +value);
- }
-
- module.exports = debounce;
-
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
-
- /***/ }),
-
- /***/ "./node_modules/popper.js/dist/esm/popper.js":
- /*!***************************************************!*\
- !*** ./node_modules/popper.js/dist/esm/popper.js ***!
- \***************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* WEBPACK VAR INJECTION */(function(global) {/**!
- * @fileOverview Kickass library to create and place poppers near their reference elements.
- * @version 1.15.0
- * @license
- * Copyright (c) 2016 Federico Zivolo and contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
- var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';
-
- var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];
- var timeoutDuration = 0;
- for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) {
- if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {
- timeoutDuration = 1;
- break;
- }
- }
-
- function microtaskDebounce(fn) {
- var called = false;
- return function () {
- if (called) {
- return;
- }
- called = true;
- window.Promise.resolve().then(function () {
- called = false;
- fn();
- });
- };
- }
-
- function taskDebounce(fn) {
- var scheduled = false;
- return function () {
- if (!scheduled) {
- scheduled = true;
- setTimeout(function () {
- scheduled = false;
- fn();
- }, timeoutDuration);
- }
- };
- }
-
- var supportsMicroTasks = isBrowser && window.Promise;
-
- /**
- * Create a debounced version of a method, that's asynchronously deferred
- * but called in the minimum time possible.
- *
- * @method
- * @memberof Popper.Utils
- * @argument {Function} fn
- * @returns {Function}
- */
- var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce;
-
- /**
- * Check if the given variable is a function
- * @method
- * @memberof Popper.Utils
- * @argument {Any} functionToCheck - variable to check
- * @returns {Boolean} answer to: is a function?
- */
- function isFunction(functionToCheck) {
- var getType = {};
- return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
- }
-
- /**
- * Get CSS computed property of the given element
- * @method
- * @memberof Popper.Utils
- * @argument {Eement} element
- * @argument {String} property
- */
- function getStyleComputedProperty(element, property) {
- if (element.nodeType !== 1) {
- return [];
- }
- // NOTE: 1 DOM access here
- var window = element.ownerDocument.defaultView;
- var css = window.getComputedStyle(element, null);
- return property ? css[property] : css;
- }
-
- /**
- * Returns the parentNode or the host of the element
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element
- * @returns {Element} parent
- */
- function getParentNode(element) {
- if (element.nodeName === 'HTML') {
- return element;
- }
- return element.parentNode || element.host;
- }
-
- /**
- * Returns the scrolling parent of the given element
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element
- * @returns {Element} scroll parent
- */
- function getScrollParent(element) {
- // Return body, `getScroll` will take care to get the correct `scrollTop` from it
- if (!element) {
- return document.body;
- }
-
- switch (element.nodeName) {
- case 'HTML':
- case 'BODY':
- return element.ownerDocument.body;
- case '#document':
- return element.body;
- }
-
- // Firefox want us to check `-x` and `-y` variations as well
-
- var _getStyleComputedProp = getStyleComputedProperty(element),
- overflow = _getStyleComputedProp.overflow,
- overflowX = _getStyleComputedProp.overflowX,
- overflowY = _getStyleComputedProp.overflowY;
-
- if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {
- return element;
- }
-
- return getScrollParent(getParentNode(element));
- }
-
- var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode);
- var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent);
-
- /**
- * Determines if the browser is Internet Explorer
- * @method
- * @memberof Popper.Utils
- * @param {Number} version to check
- * @returns {Boolean} isIE
- */
- function isIE(version) {
- if (version === 11) {
- return isIE11;
- }
- if (version === 10) {
- return isIE10;
- }
- return isIE11 || isIE10;
- }
-
- /**
- * Returns the offset parent of the given element
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element
- * @returns {Element} offset parent
- */
- function getOffsetParent(element) {
- if (!element) {
- return document.documentElement;
- }
-
- var noOffsetParent = isIE(10) ? document.body : null;
-
- // NOTE: 1 DOM access here
- var offsetParent = element.offsetParent || null;
- // Skip hidden elements which don't have an offsetParent
- while (offsetParent === noOffsetParent && element.nextElementSibling) {
- offsetParent = (element = element.nextElementSibling).offsetParent;
- }
-
- var nodeName = offsetParent && offsetParent.nodeName;
-
- if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {
- return element ? element.ownerDocument.documentElement : document.documentElement;
- }
-
- // .offsetParent will return the closest TH, TD or TABLE in case
- // no offsetParent is present, I hate this job...
- if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') {
- return getOffsetParent(offsetParent);
- }
-
- return offsetParent;
- }
-
- function isOffsetContainer(element) {
- var nodeName = element.nodeName;
-
- if (nodeName === 'BODY') {
- return false;
- }
- return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element;
- }
-
- /**
- * Finds the root node (document, shadowDOM root) of the given element
- * @method
- * @memberof Popper.Utils
- * @argument {Element} node
- * @returns {Element} root node
- */
- function getRoot(node) {
- if (node.parentNode !== null) {
- return getRoot(node.parentNode);
- }
-
- return node;
- }
-
- /**
- * Finds the offset parent common to the two provided nodes
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element1
- * @argument {Element} element2
- * @returns {Element} common offset parent
- */
- function findCommonOffsetParent(element1, element2) {
- // This check is needed to avoid errors in case one of the elements isn't defined for any reason
- if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {
- return document.documentElement;
- }
-
- // Here we make sure to give as "start" the element that comes first in the DOM
- var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING;
- var start = order ? element1 : element2;
- var end = order ? element2 : element1;
-
- // Get common ancestor container
- var range = document.createRange();
- range.setStart(start, 0);
- range.setEnd(end, 0);
- var commonAncestorContainer = range.commonAncestorContainer;
-
- // Both nodes are inside #document
-
- if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) {
- if (isOffsetContainer(commonAncestorContainer)) {
- return commonAncestorContainer;
- }
-
- return getOffsetParent(commonAncestorContainer);
- }
-
- // one of the nodes is inside shadowDOM, find which one
- var element1root = getRoot(element1);
- if (element1root.host) {
- return findCommonOffsetParent(element1root.host, element2);
- } else {
- return findCommonOffsetParent(element1, getRoot(element2).host);
- }
- }
-
- /**
- * Gets the scroll value of the given element in the given side (top and left)
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element
- * @argument {String} side `top` or `left`
- * @returns {number} amount of scrolled pixels
- */
- function getScroll(element) {
- var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top';
-
- var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';
- var nodeName = element.nodeName;
-
- if (nodeName === 'BODY' || nodeName === 'HTML') {
- var html = element.ownerDocument.documentElement;
- var scrollingElement = element.ownerDocument.scrollingElement || html;
- return scrollingElement[upperSide];
- }
-
- return element[upperSide];
- }
-
- /*
- * Sum or subtract the element scroll values (left and top) from a given rect object
- * @method
- * @memberof Popper.Utils
- * @param {Object} rect - Rect object you want to change
- * @param {HTMLElement} element - The element from the function reads the scroll values
- * @param {Boolean} subtract - set to true if you want to subtract the scroll values
- * @return {Object} rect - The modifier rect object
- */
- function includeScroll(rect, element) {
- var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
-
- var scrollTop = getScroll(element, 'top');
- var scrollLeft = getScroll(element, 'left');
- var modifier = subtract ? -1 : 1;
- rect.top += scrollTop * modifier;
- rect.bottom += scrollTop * modifier;
- rect.left += scrollLeft * modifier;
- rect.right += scrollLeft * modifier;
- return rect;
- }
-
- /*
- * Helper to detect borders of a given element
- * @method
- * @memberof Popper.Utils
- * @param {CSSStyleDeclaration} styles
- * Result of `getStyleComputedProperty` on the given element
- * @param {String} axis - `x` or `y`
- * @return {number} borders - The borders size of the given axis
- */
-
- function getBordersSize(styles, axis) {
- var sideA = axis === 'x' ? 'Left' : 'Top';
- var sideB = sideA === 'Left' ? 'Right' : 'Bottom';
-
- return parseFloat(styles['border' + sideA + 'Width'], 10) + parseFloat(styles['border' + sideB + 'Width'], 10);
- }
-
- function getSize(axis, body, html, computedStyle) {
- return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0);
- }
-
- function getWindowSizes(document) {
- var body = document.body;
- var html = document.documentElement;
- var computedStyle = isIE(10) && getComputedStyle(html);
-
- return {
- height: getSize('Height', body, html, computedStyle),
- width: getSize('Width', body, html, computedStyle)
- };
- }
-
- var classCallCheck = function (instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- };
-
- var createClass = function () {
- function defineProperties(target, props) {
- for (var i = 0; i < props.length; i++) {
- var descriptor = props[i];
- descriptor.enumerable = descriptor.enumerable || false;
- descriptor.configurable = true;
- if ("value" in descriptor) descriptor.writable = true;
- Object.defineProperty(target, descriptor.key, descriptor);
- }
- }
-
- return function (Constructor, protoProps, staticProps) {
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
- if (staticProps) defineProperties(Constructor, staticProps);
- return Constructor;
- };
- }();
-
-
-
-
-
- var defineProperty = function (obj, key, value) {
- if (key in obj) {
- Object.defineProperty(obj, key, {
- value: value,
- enumerable: true,
- configurable: true,
- writable: true
- });
- } else {
- obj[key] = value;
- }
-
- return obj;
- };
-
- var _extends = Object.assign || function (target) {
- for (var i = 1; i < arguments.length; i++) {
- var source = arguments[i];
-
- for (var key in source) {
- if (Object.prototype.hasOwnProperty.call(source, key)) {
- target[key] = source[key];
- }
- }
- }
-
- return target;
- };
-
- /**
- * Given element offsets, generate an output similar to getBoundingClientRect
- * @method
- * @memberof Popper.Utils
- * @argument {Object} offsets
- * @returns {Object} ClientRect like output
- */
- function getClientRect(offsets) {
- return _extends({}, offsets, {
- right: offsets.left + offsets.width,
- bottom: offsets.top + offsets.height
- });
- }
-
- /**
- * Get bounding client rect of given element
- * @method
- * @memberof Popper.Utils
- * @param {HTMLElement} element
- * @return {Object} client rect
- */
- function getBoundingClientRect(element) {
- var rect = {};
-
- // IE10 10 FIX: Please, don't ask, the element isn't
- // considered in DOM in some circumstances...
- // This isn't reproducible in IE10 compatibility mode of IE11
- try {
- if (isIE(10)) {
- rect = element.getBoundingClientRect();
- var scrollTop = getScroll(element, 'top');
- var scrollLeft = getScroll(element, 'left');
- rect.top += scrollTop;
- rect.left += scrollLeft;
- rect.bottom += scrollTop;
- rect.right += scrollLeft;
- } else {
- rect = element.getBoundingClientRect();
- }
- } catch (e) {}
-
- var result = {
- left: rect.left,
- top: rect.top,
- width: rect.right - rect.left,
- height: rect.bottom - rect.top
- };
-
- // subtract scrollbar size from sizes
- var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {};
- var width = sizes.width || element.clientWidth || result.right - result.left;
- var height = sizes.height || element.clientHeight || result.bottom - result.top;
-
- var horizScrollbar = element.offsetWidth - width;
- var vertScrollbar = element.offsetHeight - height;
-
- // if an hypothetical scrollbar is detected, we must be sure it's not a `border`
- // we make this check conditional for performance reasons
- if (horizScrollbar || vertScrollbar) {
- var styles = getStyleComputedProperty(element);
- horizScrollbar -= getBordersSize(styles, 'x');
- vertScrollbar -= getBordersSize(styles, 'y');
-
- result.width -= horizScrollbar;
- result.height -= vertScrollbar;
- }
-
- return getClientRect(result);
- }
-
- function getOffsetRectRelativeToArbitraryNode(children, parent) {
- var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
-
- var isIE10 = isIE(10);
- var isHTML = parent.nodeName === 'HTML';
- var childrenRect = getBoundingClientRect(children);
- var parentRect = getBoundingClientRect(parent);
- var scrollParent = getScrollParent(children);
-
- var styles = getStyleComputedProperty(parent);
- var borderTopWidth = parseFloat(styles.borderTopWidth, 10);
- var borderLeftWidth = parseFloat(styles.borderLeftWidth, 10);
-
- // In cases where the parent is fixed, we must ignore negative scroll in offset calc
- if (fixedPosition && isHTML) {
- parentRect.top = Math.max(parentRect.top, 0);
- parentRect.left = Math.max(parentRect.left, 0);
- }
- var offsets = getClientRect({
- top: childrenRect.top - parentRect.top - borderTopWidth,
- left: childrenRect.left - parentRect.left - borderLeftWidth,
- width: childrenRect.width,
- height: childrenRect.height
- });
- offsets.marginTop = 0;
- offsets.marginLeft = 0;
-
- // Subtract margins of documentElement in case it's being used as parent
- // we do this only on HTML because it's the only element that behaves
- // differently when margins are applied to it. The margins are included in
- // the box of the documentElement, in the other cases not.
- if (!isIE10 && isHTML) {
- var marginTop = parseFloat(styles.marginTop, 10);
- var marginLeft = parseFloat(styles.marginLeft, 10);
-
- offsets.top -= borderTopWidth - marginTop;
- offsets.bottom -= borderTopWidth - marginTop;
- offsets.left -= borderLeftWidth - marginLeft;
- offsets.right -= borderLeftWidth - marginLeft;
-
- // Attach marginTop and marginLeft because in some circumstances we may need them
- offsets.marginTop = marginTop;
- offsets.marginLeft = marginLeft;
- }
-
- if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') {
- offsets = includeScroll(offsets, parent);
- }
-
- return offsets;
- }
-
- function getViewportOffsetRectRelativeToArtbitraryNode(element) {
- var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
-
- var html = element.ownerDocument.documentElement;
- var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);
- var width = Math.max(html.clientWidth, window.innerWidth || 0);
- var height = Math.max(html.clientHeight, window.innerHeight || 0);
-
- var scrollTop = !excludeScroll ? getScroll(html) : 0;
- var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0;
-
- var offset = {
- top: scrollTop - relativeOffset.top + relativeOffset.marginTop,
- left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,
- width: width,
- height: height
- };
-
- return getClientRect(offset);
- }
-
- /**
- * Check if the given element is fixed or is inside a fixed parent
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element
- * @argument {Element} customContainer
- * @returns {Boolean} answer to "isFixed?"
- */
- function isFixed(element) {
- var nodeName = element.nodeName;
- if (nodeName === 'BODY' || nodeName === 'HTML') {
- return false;
- }
- if (getStyleComputedProperty(element, 'position') === 'fixed') {
- return true;
- }
- var parentNode = getParentNode(element);
- if (!parentNode) {
- return false;
- }
- return isFixed(parentNode);
- }
-
- /**
- * Finds the first parent of an element that has a transformed property defined
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element
- * @returns {Element} first transformed parent or documentElement
- */
-
- function getFixedPositionOffsetParent(element) {
- // This check is needed to avoid errors in case one of the elements isn't defined for any reason
- if (!element || !element.parentElement || isIE()) {
- return document.documentElement;
- }
- var el = element.parentElement;
- while (el && getStyleComputedProperty(el, 'transform') === 'none') {
- el = el.parentElement;
- }
- return el || document.documentElement;
- }
-
- /**
- * Computed the boundaries limits and return them
- * @method
- * @memberof Popper.Utils
- * @param {HTMLElement} popper
- * @param {HTMLElement} reference
- * @param {number} padding
- * @param {HTMLElement} boundariesElement - Element used to define the boundaries
- * @param {Boolean} fixedPosition - Is in fixed position mode
- * @returns {Object} Coordinates of the boundaries
- */
- function getBoundaries(popper, reference, padding, boundariesElement) {
- var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
-
- // NOTE: 1 DOM access here
-
- var boundaries = { top: 0, left: 0 };
- var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference);
-
- // Handle viewport case
- if (boundariesElement === 'viewport') {
- boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition);
- } else {
- // Handle other cases based on DOM element used as boundaries
- var boundariesNode = void 0;
- if (boundariesElement === 'scrollParent') {
- boundariesNode = getScrollParent(getParentNode(reference));
- if (boundariesNode.nodeName === 'BODY') {
- boundariesNode = popper.ownerDocument.documentElement;
- }
- } else if (boundariesElement === 'window') {
- boundariesNode = popper.ownerDocument.documentElement;
- } else {
- boundariesNode = boundariesElement;
- }
-
- var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition);
-
- // In case of HTML, we need a different computation
- if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {
- var _getWindowSizes = getWindowSizes(popper.ownerDocument),
- height = _getWindowSizes.height,
- width = _getWindowSizes.width;
-
- boundaries.top += offsets.top - offsets.marginTop;
- boundaries.bottom = height + offsets.top;
- boundaries.left += offsets.left - offsets.marginLeft;
- boundaries.right = width + offsets.left;
- } else {
- // for all the other DOM elements, this one is good
- boundaries = offsets;
- }
- }
-
- // Add paddings
- padding = padding || 0;
- var isPaddingNumber = typeof padding === 'number';
- boundaries.left += isPaddingNumber ? padding : padding.left || 0;
- boundaries.top += isPaddingNumber ? padding : padding.top || 0;
- boundaries.right -= isPaddingNumber ? padding : padding.right || 0;
- boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0;
-
- return boundaries;
- }
-
- function getArea(_ref) {
- var width = _ref.width,
- height = _ref.height;
-
- return width * height;
- }
-
- /**
- * Utility used to transform the `auto` placement to the placement with more
- * available space.
- * @method
- * @memberof Popper.Utils
- * @argument {Object} data - The data object generated by update method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The data object, properly modified
- */
- function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) {
- var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
-
- if (placement.indexOf('auto') === -1) {
- return placement;
- }
-
- var boundaries = getBoundaries(popper, reference, padding, boundariesElement);
-
- var rects = {
- top: {
- width: boundaries.width,
- height: refRect.top - boundaries.top
- },
- right: {
- width: boundaries.right - refRect.right,
- height: boundaries.height
- },
- bottom: {
- width: boundaries.width,
- height: boundaries.bottom - refRect.bottom
- },
- left: {
- width: refRect.left - boundaries.left,
- height: boundaries.height
- }
- };
-
- var sortedAreas = Object.keys(rects).map(function (key) {
- return _extends({
- key: key
- }, rects[key], {
- area: getArea(rects[key])
- });
- }).sort(function (a, b) {
- return b.area - a.area;
- });
-
- var filteredAreas = sortedAreas.filter(function (_ref2) {
- var width = _ref2.width,
- height = _ref2.height;
- return width >= popper.clientWidth && height >= popper.clientHeight;
- });
-
- var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key;
-
- var variation = placement.split('-')[1];
-
- return computedPlacement + (variation ? '-' + variation : '');
- }
-
- /**
- * Get offsets to the reference element
- * @method
- * @memberof Popper.Utils
- * @param {Object} state
- * @param {Element} popper - the popper element
- * @param {Element} reference - the reference element (the popper will be relative to this)
- * @param {Element} fixedPosition - is in fixed position mode
- * @returns {Object} An object containing the offsets which will be applied to the popper
- */
- function getReferenceOffsets(state, popper, reference) {
- var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
-
- var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference);
- return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition);
- }
-
- /**
- * Get the outer sizes of the given element (offset size + margins)
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element
- * @returns {Object} object containing width and height properties
- */
- function getOuterSizes(element) {
- var window = element.ownerDocument.defaultView;
- var styles = window.getComputedStyle(element);
- var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0);
- var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0);
- var result = {
- width: element.offsetWidth + y,
- height: element.offsetHeight + x
- };
- return result;
- }
-
- /**
- * Get the opposite placement of the given one
- * @method
- * @memberof Popper.Utils
- * @argument {String} placement
- * @returns {String} flipped placement
- */
- function getOppositePlacement(placement) {
- var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };
- return placement.replace(/left|right|bottom|top/g, function (matched) {
- return hash[matched];
- });
- }
-
- /**
- * Get offsets to the popper
- * @method
- * @memberof Popper.Utils
- * @param {Object} position - CSS position the Popper will get applied
- * @param {HTMLElement} popper - the popper element
- * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)
- * @param {String} placement - one of the valid placement options
- * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper
- */
- function getPopperOffsets(popper, referenceOffsets, placement) {
- placement = placement.split('-')[0];
-
- // Get popper node sizes
- var popperRect = getOuterSizes(popper);
-
- // Add position, width and height to our offsets object
- var popperOffsets = {
- width: popperRect.width,
- height: popperRect.height
- };
-
- // depending by the popper placement we have to compute its offsets slightly differently
- var isHoriz = ['right', 'left'].indexOf(placement) !== -1;
- var mainSide = isHoriz ? 'top' : 'left';
- var secondarySide = isHoriz ? 'left' : 'top';
- var measurement = isHoriz ? 'height' : 'width';
- var secondaryMeasurement = !isHoriz ? 'height' : 'width';
-
- popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2;
- if (placement === secondarySide) {
- popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];
- } else {
- popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)];
- }
-
- return popperOffsets;
- }
-
- /**
- * Mimics the `find` method of Array
- * @method
- * @memberof Popper.Utils
- * @argument {Array} arr
- * @argument prop
- * @argument value
- * @returns index or -1
- */
- function find(arr, check) {
- // use native find if supported
- if (Array.prototype.find) {
- return arr.find(check);
- }
-
- // use `filter` to obtain the same behavior of `find`
- return arr.filter(check)[0];
- }
-
- /**
- * Return the index of the matching object
- * @method
- * @memberof Popper.Utils
- * @argument {Array} arr
- * @argument prop
- * @argument value
- * @returns index or -1
- */
- function findIndex(arr, prop, value) {
- // use native findIndex if supported
- if (Array.prototype.findIndex) {
- return arr.findIndex(function (cur) {
- return cur[prop] === value;
- });
- }
-
- // use `find` + `indexOf` if `findIndex` isn't supported
- var match = find(arr, function (obj) {
- return obj[prop] === value;
- });
- return arr.indexOf(match);
- }
-
- /**
- * Loop trough the list of modifiers and run them in order,
- * each of them will then edit the data object.
- * @method
- * @memberof Popper.Utils
- * @param {dataObject} data
- * @param {Array} modifiers
- * @param {String} ends - Optional modifier name used as stopper
- * @returns {dataObject}
- */
- function runModifiers(modifiers, data, ends) {
- var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends));
-
- modifiersToRun.forEach(function (modifier) {
- if (modifier['function']) {
- // eslint-disable-line dot-notation
- console.warn('`modifier.function` is deprecated, use `modifier.fn`!');
- }
- var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation
- if (modifier.enabled && isFunction(fn)) {
- // Add properties to offsets to make them a complete clientRect object
- // we do this before each modifier to make sure the previous one doesn't
- // mess with these values
- data.offsets.popper = getClientRect(data.offsets.popper);
- data.offsets.reference = getClientRect(data.offsets.reference);
-
- data = fn(data, modifier);
- }
- });
-
- return data;
- }
-
- /**
- * Updates the position of the popper, computing the new offsets and applying
- * the new style.<br />
- * Prefer `scheduleUpdate` over `update` because of performance reasons.
- * @method
- * @memberof Popper
- */
- function update() {
- // if popper is destroyed, don't perform any further update
- if (this.state.isDestroyed) {
- return;
- }
-
- var data = {
- instance: this,
- styles: {},
- arrowStyles: {},
- attributes: {},
- flipped: false,
- offsets: {}
- };
-
- // compute reference element offsets
- data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);
-
- // compute auto placement, store placement inside the data object,
- // modifiers will be able to edit `placement` if needed
- // and refer to originalPlacement to know the original value
- data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);
-
- // store the computed placement inside `originalPlacement`
- data.originalPlacement = data.placement;
-
- data.positionFixed = this.options.positionFixed;
-
- // compute the popper offsets
- data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);
-
- data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';
-
- // run the modifiers
- data = runModifiers(this.modifiers, data);
-
- // the first `update` will call `onCreate` callback
- // the other ones will call `onUpdate` callback
- if (!this.state.isCreated) {
- this.state.isCreated = true;
- this.options.onCreate(data);
- } else {
- this.options.onUpdate(data);
- }
- }
-
- /**
- * Helper used to know if the given modifier is enabled.
- * @method
- * @memberof Popper.Utils
- * @returns {Boolean}
- */
- function isModifierEnabled(modifiers, modifierName) {
- return modifiers.some(function (_ref) {
- var name = _ref.name,
- enabled = _ref.enabled;
- return enabled && name === modifierName;
- });
- }
-
- /**
- * Get the prefixed supported property name
- * @method
- * @memberof Popper.Utils
- * @argument {String} property (camelCase)
- * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix)
- */
- function getSupportedPropertyName(property) {
- var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];
- var upperProp = property.charAt(0).toUpperCase() + property.slice(1);
-
- for (var i = 0; i < prefixes.length; i++) {
- var prefix = prefixes[i];
- var toCheck = prefix ? '' + prefix + upperProp : property;
- if (typeof document.body.style[toCheck] !== 'undefined') {
- return toCheck;
- }
- }
- return null;
- }
-
- /**
- * Destroys the popper.
- * @method
- * @memberof Popper
- */
- function destroy() {
- this.state.isDestroyed = true;
-
- // touch DOM only if `applyStyle` modifier is enabled
- if (isModifierEnabled(this.modifiers, 'applyStyle')) {
- this.popper.removeAttribute('x-placement');
- this.popper.style.position = '';
- this.popper.style.top = '';
- this.popper.style.left = '';
- this.popper.style.right = '';
- this.popper.style.bottom = '';
- this.popper.style.willChange = '';
- this.popper.style[getSupportedPropertyName('transform')] = '';
- }
-
- this.disableEventListeners();
-
- // remove the popper if user explicity asked for the deletion on destroy
- // do not use `remove` because IE11 doesn't support it
- if (this.options.removeOnDestroy) {
- this.popper.parentNode.removeChild(this.popper);
- }
- return this;
- }
-
- /**
- * Get the window associated with the element
- * @argument {Element} element
- * @returns {Window}
- */
- function getWindow(element) {
- var ownerDocument = element.ownerDocument;
- return ownerDocument ? ownerDocument.defaultView : window;
- }
-
- function attachToScrollParents(scrollParent, event, callback, scrollParents) {
- var isBody = scrollParent.nodeName === 'BODY';
- var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;
- target.addEventListener(event, callback, { passive: true });
-
- if (!isBody) {
- attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents);
- }
- scrollParents.push(target);
- }
-
- /**
- * Setup needed event listeners used to update the popper position
- * @method
- * @memberof Popper.Utils
- * @private
- */
- function setupEventListeners(reference, options, state, updateBound) {
- // Resize event listener on window
- state.updateBound = updateBound;
- getWindow(reference).addEventListener('resize', state.updateBound, { passive: true });
-
- // Scroll event listener on scroll parents
- var scrollElement = getScrollParent(reference);
- attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents);
- state.scrollElement = scrollElement;
- state.eventsEnabled = true;
-
- return state;
- }
-
- /**
- * It will add resize/scroll events and start recalculating
- * position of the popper element when they are triggered.
- * @method
- * @memberof Popper
- */
- function enableEventListeners() {
- if (!this.state.eventsEnabled) {
- this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate);
- }
- }
-
- /**
- * Remove event listeners used to update the popper position
- * @method
- * @memberof Popper.Utils
- * @private
- */
- function removeEventListeners(reference, state) {
- // Remove resize event listener on window
- getWindow(reference).removeEventListener('resize', state.updateBound);
-
- // Remove scroll event listener on scroll parents
- state.scrollParents.forEach(function (target) {
- target.removeEventListener('scroll', state.updateBound);
- });
-
- // Reset state
- state.updateBound = null;
- state.scrollParents = [];
- state.scrollElement = null;
- state.eventsEnabled = false;
- return state;
- }
-
- /**
- * It will remove resize/scroll events and won't recalculate popper position
- * when they are triggered. It also won't trigger `onUpdate` callback anymore,
- * unless you call `update` method manually.
- * @method
- * @memberof Popper
- */
- function disableEventListeners() {
- if (this.state.eventsEnabled) {
- cancelAnimationFrame(this.scheduleUpdate);
- this.state = removeEventListeners(this.reference, this.state);
- }
- }
-
- /**
- * Tells if a given input is a number
- * @method
- * @memberof Popper.Utils
- * @param {*} input to check
- * @return {Boolean}
- */
- function isNumeric(n) {
- return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);
- }
-
- /**
- * Set the style to the given popper
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element - Element to apply the style to
- * @argument {Object} styles
- * Object with a list of properties and values which will be applied to the element
- */
- function setStyles(element, styles) {
- Object.keys(styles).forEach(function (prop) {
- var unit = '';
- // add unit if the value is numeric and is one of the following
- if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) {
- unit = 'px';
- }
- element.style[prop] = styles[prop] + unit;
- });
- }
-
- /**
- * Set the attributes to the given popper
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element - Element to apply the attributes to
- * @argument {Object} styles
- * Object with a list of properties and values which will be applied to the element
- */
- function setAttributes(element, attributes) {
- Object.keys(attributes).forEach(function (prop) {
- var value = attributes[prop];
- if (value !== false) {
- element.setAttribute(prop, attributes[prop]);
- } else {
- element.removeAttribute(prop);
- }
- });
- }
-
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by `update` method
- * @argument {Object} data.styles - List of style properties - values to apply to popper element
- * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The same data object
- */
- function applyStyle(data) {
- // any property present in `data.styles` will be applied to the popper,
- // in this way we can make the 3rd party modifiers add custom styles to it
- // Be aware, modifiers could override the properties defined in the previous
- // lines of this modifier!
- setStyles(data.instance.popper, data.styles);
-
- // any property present in `data.attributes` will be applied to the popper,
- // they will be set as HTML attributes of the element
- setAttributes(data.instance.popper, data.attributes);
-
- // if arrowElement is defined and arrowStyles has some properties
- if (data.arrowElement && Object.keys(data.arrowStyles).length) {
- setStyles(data.arrowElement, data.arrowStyles);
- }
-
- return data;
- }
-
- /**
- * Set the x-placement attribute before everything else because it could be used
- * to add margins to the popper margins needs to be calculated to get the
- * correct popper offsets.
- * @method
- * @memberof Popper.modifiers
- * @param {HTMLElement} reference - The reference element used to position the popper
- * @param {HTMLElement} popper - The HTML element used as popper
- * @param {Object} options - Popper.js options
- */
- function applyStyleOnLoad(reference, popper, options, modifierOptions, state) {
- // compute reference element offsets
- var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed);
-
- // compute auto placement, store placement inside the data object,
- // modifiers will be able to edit `placement` if needed
- // and refer to originalPlacement to know the original value
- var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding);
-
- popper.setAttribute('x-placement', placement);
-
- // Apply `position` to popper before anything else because
- // without the position applied we can't guarantee correct computations
- setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' });
-
- return options;
- }
-
- /**
- * @function
- * @memberof Popper.Utils
- * @argument {Object} data - The data object generated by `update` method
- * @argument {Boolean} shouldRound - If the offsets should be rounded at all
- * @returns {Object} The popper's position offsets rounded
- *
- * The tale of pixel-perfect positioning. It's still not 100% perfect, but as
- * good as it can be within reason.
- * Discussion here: https://github.com/FezVrasta/popper.js/pull/715
- *
- * Low DPI screens cause a popper to be blurry if not using full pixels (Safari
- * as well on High DPI screens).
- *
- * Firefox prefers no rounding for positioning and does not have blurriness on
- * high DPI screens.
- *
- * Only horizontal placement and left/right values need to be considered.
- */
- function getRoundedOffsets(data, shouldRound) {
- var _data$offsets = data.offsets,
- popper = _data$offsets.popper,
- reference = _data$offsets.reference;
- var round = Math.round,
- floor = Math.floor;
-
- var noRound = function noRound(v) {
- return v;
- };
-
- var referenceWidth = round(reference.width);
- var popperWidth = round(popper.width);
-
- var isVertical = ['left', 'right'].indexOf(data.placement) !== -1;
- var isVariation = data.placement.indexOf('-') !== -1;
- var sameWidthParity = referenceWidth % 2 === popperWidth % 2;
- var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1;
-
- var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor;
- var verticalToInteger = !shouldRound ? noRound : round;
-
- return {
- left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left),
- top: verticalToInteger(popper.top),
- bottom: verticalToInteger(popper.bottom),
- right: horizontalToInteger(popper.right)
- };
- }
-
- var isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent);
-
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by `update` method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The data object, properly modified
- */
- function computeStyle(data, options) {
- var x = options.x,
- y = options.y;
- var popper = data.offsets.popper;
-
- // Remove this legacy support in Popper.js v2
-
- var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) {
- return modifier.name === 'applyStyle';
- }).gpuAcceleration;
- if (legacyGpuAccelerationOption !== undefined) {
- console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');
- }
- var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration;
-
- var offsetParent = getOffsetParent(data.instance.popper);
- var offsetParentRect = getBoundingClientRect(offsetParent);
-
- // Styles
- var styles = {
- position: popper.position
- };
-
- var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox);
-
- var sideA = x === 'bottom' ? 'top' : 'bottom';
- var sideB = y === 'right' ? 'left' : 'right';
-
- // if gpuAcceleration is set to `true` and transform is supported,
- // we use `translate3d` to apply the position to the popper we
- // automatically use the supported prefixed version if needed
- var prefixedProperty = getSupportedPropertyName('transform');
-
- // now, let's make a step back and look at this code closely (wtf?)
- // If the content of the popper grows once it's been positioned, it
- // may happen that the popper gets misplaced because of the new content
- // overflowing its reference element
- // To avoid this problem, we provide two options (x and y), which allow
- // the consumer to define the offset origin.
- // If we position a popper on top of a reference element, we can set
- // `x` to `top` to make the popper grow towards its top instead of
- // its bottom.
- var left = void 0,
- top = void 0;
- if (sideA === 'bottom') {
- // when offsetParent is <html> the positioning is relative to the bottom of the screen (excluding the scrollbar)
- // and not the bottom of the html element
- if (offsetParent.nodeName === 'HTML') {
- top = -offsetParent.clientHeight + offsets.bottom;
- } else {
- top = -offsetParentRect.height + offsets.bottom;
- }
- } else {
- top = offsets.top;
- }
- if (sideB === 'right') {
- if (offsetParent.nodeName === 'HTML') {
- left = -offsetParent.clientWidth + offsets.right;
- } else {
- left = -offsetParentRect.width + offsets.right;
- }
- } else {
- left = offsets.left;
- }
- if (gpuAcceleration && prefixedProperty) {
- styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';
- styles[sideA] = 0;
- styles[sideB] = 0;
- styles.willChange = 'transform';
- } else {
- // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties
- var invertTop = sideA === 'bottom' ? -1 : 1;
- var invertLeft = sideB === 'right' ? -1 : 1;
- styles[sideA] = top * invertTop;
- styles[sideB] = left * invertLeft;
- styles.willChange = sideA + ', ' + sideB;
- }
-
- // Attributes
- var attributes = {
- 'x-placement': data.placement
- };
-
- // Update `data` attributes, styles and arrowStyles
- data.attributes = _extends({}, attributes, data.attributes);
- data.styles = _extends({}, styles, data.styles);
- data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles);
-
- return data;
- }
-
- /**
- * Helper used to know if the given modifier depends from another one.<br />
- * It checks if the needed modifier is listed and enabled.
- * @method
- * @memberof Popper.Utils
- * @param {Array} modifiers - list of modifiers
- * @param {String} requestingName - name of requesting modifier
- * @param {String} requestedName - name of requested modifier
- * @returns {Boolean}
- */
- function isModifierRequired(modifiers, requestingName, requestedName) {
- var requesting = find(modifiers, function (_ref) {
- var name = _ref.name;
- return name === requestingName;
- });
-
- var isRequired = !!requesting && modifiers.some(function (modifier) {
- return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order;
- });
-
- if (!isRequired) {
- var _requesting = '`' + requestingName + '`';
- var requested = '`' + requestedName + '`';
- console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!');
- }
- return isRequired;
- }
-
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by update method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The data object, properly modified
- */
- function arrow(data, options) {
- var _data$offsets$arrow;
-
- // arrow depends on keepTogether in order to work
- if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {
- return data;
- }
-
- var arrowElement = options.element;
-
- // if arrowElement is a string, suppose it's a CSS selector
- if (typeof arrowElement === 'string') {
- arrowElement = data.instance.popper.querySelector(arrowElement);
-
- // if arrowElement is not found, don't run the modifier
- if (!arrowElement) {
- return data;
- }
- } else {
- // if the arrowElement isn't a query selector we must check that the
- // provided DOM node is child of its popper node
- if (!data.instance.popper.contains(arrowElement)) {
- console.warn('WARNING: `arrow.element` must be child of its popper element!');
- return data;
- }
- }
-
- var placement = data.placement.split('-')[0];
- var _data$offsets = data.offsets,
- popper = _data$offsets.popper,
- reference = _data$offsets.reference;
-
- var isVertical = ['left', 'right'].indexOf(placement) !== -1;
-
- var len = isVertical ? 'height' : 'width';
- var sideCapitalized = isVertical ? 'Top' : 'Left';
- var side = sideCapitalized.toLowerCase();
- var altSide = isVertical ? 'left' : 'top';
- var opSide = isVertical ? 'bottom' : 'right';
- var arrowElementSize = getOuterSizes(arrowElement)[len];
-
- //
- // extends keepTogether behavior making sure the popper and its
- // reference have enough pixels in conjunction
- //
-
- // top/left side
- if (reference[opSide] - arrowElementSize < popper[side]) {
- data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize);
- }
- // bottom/right side
- if (reference[side] + arrowElementSize > popper[opSide]) {
- data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide];
- }
- data.offsets.popper = getClientRect(data.offsets.popper);
-
- // compute center of the popper
- var center = reference[side] + reference[len] / 2 - arrowElementSize / 2;
-
- // Compute the sideValue using the updated popper offsets
- // take popper margin in account because we don't have this info available
- var css = getStyleComputedProperty(data.instance.popper);
- var popperMarginSide = parseFloat(css['margin' + sideCapitalized], 10);
- var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width'], 10);
- var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide;
-
- // prevent arrowElement from being placed not contiguously to its popper
- sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);
-
- data.arrowElement = arrowElement;
- data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow);
-
- return data;
- }
-
- /**
- * Get the opposite placement variation of the given one
- * @method
- * @memberof Popper.Utils
- * @argument {String} placement variation
- * @returns {String} flipped placement variation
- */
- function getOppositeVariation(variation) {
- if (variation === 'end') {
- return 'start';
- } else if (variation === 'start') {
- return 'end';
- }
- return variation;
- }
-
- /**
- * List of accepted placements to use as values of the `placement` option.<br />
- * Valid placements are:
- * - `auto`
- * - `top`
- * - `right`
- * - `bottom`
- * - `left`
- *
- * Each placement can have a variation from this list:
- * - `-start`
- * - `-end`
- *
- * Variations are interpreted easily if you think of them as the left to right
- * written languages. Horizontally (`top` and `bottom`), `start` is left and `end`
- * is right.<br />
- * Vertically (`left` and `right`), `start` is top and `end` is bottom.
- *
- * Some valid examples are:
- * - `top-end` (on top of reference, right aligned)
- * - `right-start` (on right of reference, top aligned)
- * - `bottom` (on bottom, centered)
- * - `auto-end` (on the side with more space available, alignment depends by placement)
- *
- * @static
- * @type {Array}
- * @enum {String}
- * @readonly
- * @method placements
- * @memberof Popper
- */
- var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start'];
-
- // Get rid of `auto` `auto-start` and `auto-end`
- var validPlacements = placements.slice(3);
-
- /**
- * Given an initial placement, returns all the subsequent placements
- * clockwise (or counter-clockwise).
- *
- * @method
- * @memberof Popper.Utils
- * @argument {String} placement - A valid placement (it accepts variations)
- * @argument {Boolean} counter - Set to true to walk the placements counterclockwise
- * @returns {Array} placements including their variations
- */
- function clockwise(placement) {
- var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
-
- var index = validPlacements.indexOf(placement);
- var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));
- return counter ? arr.reverse() : arr;
- }
-
- var BEHAVIORS = {
- FLIP: 'flip',
- CLOCKWISE: 'clockwise',
- COUNTERCLOCKWISE: 'counterclockwise'
- };
-
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by update method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The data object, properly modified
- */
- function flip(data, options) {
- // if `inner` modifier is enabled, we can't use the `flip` modifier
- if (isModifierEnabled(data.instance.modifiers, 'inner')) {
- return data;
- }
-
- if (data.flipped && data.placement === data.originalPlacement) {
- // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides
- return data;
- }
-
- var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed);
-
- var placement = data.placement.split('-')[0];
- var placementOpposite = getOppositePlacement(placement);
- var variation = data.placement.split('-')[1] || '';
-
- var flipOrder = [];
-
- switch (options.behavior) {
- case BEHAVIORS.FLIP:
- flipOrder = [placement, placementOpposite];
- break;
- case BEHAVIORS.CLOCKWISE:
- flipOrder = clockwise(placement);
- break;
- case BEHAVIORS.COUNTERCLOCKWISE:
- flipOrder = clockwise(placement, true);
- break;
- default:
- flipOrder = options.behavior;
- }
-
- flipOrder.forEach(function (step, index) {
- if (placement !== step || flipOrder.length === index + 1) {
- return data;
- }
-
- placement = data.placement.split('-')[0];
- placementOpposite = getOppositePlacement(placement);
-
- var popperOffsets = data.offsets.popper;
- var refOffsets = data.offsets.reference;
-
- // using floor because the reference offsets may contain decimals we are not going to consider here
- var floor = Math.floor;
- var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom);
-
- var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);
- var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);
- var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);
- var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom);
-
- var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom;
-
- // flip the variation if required
- var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
-
- // flips variation if reference element overflows boundaries
- var flippedVariationByRef = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom);
-
- // flips variation if popper content overflows boundaries
- var flippedVariationByContent = !!options.flipVariationsByContent && (isVertical && variation === 'start' && overflowsRight || isVertical && variation === 'end' && overflowsLeft || !isVertical && variation === 'start' && overflowsBottom || !isVertical && variation === 'end' && overflowsTop);
-
- var flippedVariation = flippedVariationByRef || flippedVariationByContent;
-
- if (overlapsRef || overflowsBoundaries || flippedVariation) {
- // this boolean to detect any flip loop
- data.flipped = true;
-
- if (overlapsRef || overflowsBoundaries) {
- placement = flipOrder[index + 1];
- }
-
- if (flippedVariation) {
- variation = getOppositeVariation(variation);
- }
-
- data.placement = placement + (variation ? '-' + variation : '');
-
- // this object contains `position`, we want to preserve it along with
- // any additional property we may add in the future
- data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));
-
- data = runModifiers(data.instance.modifiers, data, 'flip');
- }
- });
- return data;
- }
-
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by update method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The data object, properly modified
- */
- function keepTogether(data) {
- var _data$offsets = data.offsets,
- popper = _data$offsets.popper,
- reference = _data$offsets.reference;
-
- var placement = data.placement.split('-')[0];
- var floor = Math.floor;
- var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
- var side = isVertical ? 'right' : 'bottom';
- var opSide = isVertical ? 'left' : 'top';
- var measurement = isVertical ? 'width' : 'height';
-
- if (popper[side] < floor(reference[opSide])) {
- data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement];
- }
- if (popper[opSide] > floor(reference[side])) {
- data.offsets.popper[opSide] = floor(reference[side]);
- }
-
- return data;
- }
-
- /**
- * Converts a string containing value + unit into a px value number
- * @function
- * @memberof {modifiers~offset}
- * @private
- * @argument {String} str - Value + unit string
- * @argument {String} measurement - `height` or `width`
- * @argument {Object} popperOffsets
- * @argument {Object} referenceOffsets
- * @returns {Number|String}
- * Value in pixels, or original string if no values were extracted
- */
- function toValue(str, measurement, popperOffsets, referenceOffsets) {
- // separate value from unit
- var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/);
- var value = +split[1];
- var unit = split[2];
-
- // If it's not a number it's an operator, I guess
- if (!value) {
- return str;
- }
-
- if (unit.indexOf('%') === 0) {
- var element = void 0;
- switch (unit) {
- case '%p':
- element = popperOffsets;
- break;
- case '%':
- case '%r':
- default:
- element = referenceOffsets;
- }
-
- var rect = getClientRect(element);
- return rect[measurement] / 100 * value;
- } else if (unit === 'vh' || unit === 'vw') {
- // if is a vh or vw, we calculate the size based on the viewport
- var size = void 0;
- if (unit === 'vh') {
- size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
- } else {
- size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
- }
- return size / 100 * value;
- } else {
- // if is an explicit pixel unit, we get rid of the unit and keep the value
- // if is an implicit unit, it's px, and we return just the value
- return value;
- }
- }
-
- /**
- * Parse an `offset` string to extrapolate `x` and `y` numeric offsets.
- * @function
- * @memberof {modifiers~offset}
- * @private
- * @argument {String} offset
- * @argument {Object} popperOffsets
- * @argument {Object} referenceOffsets
- * @argument {String} basePlacement
- * @returns {Array} a two cells array with x and y offsets in numbers
- */
- function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) {
- var offsets = [0, 0];
-
- // Use height if placement is left or right and index is 0 otherwise use width
- // in this way the first offset will use an axis and the second one
- // will use the other one
- var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1;
-
- // Split the offset string to obtain a list of values and operands
- // The regex addresses values with the plus or minus sign in front (+10, -20, etc)
- var fragments = offset.split(/(\+|\-)/).map(function (frag) {
- return frag.trim();
- });
-
- // Detect if the offset string contains a pair of values or a single one
- // they could be separated by comma or space
- var divider = fragments.indexOf(find(fragments, function (frag) {
- return frag.search(/,|\s/) !== -1;
- }));
-
- if (fragments[divider] && fragments[divider].indexOf(',') === -1) {
- console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');
- }
-
- // If divider is found, we divide the list of values and operands to divide
- // them by ofset X and Y.
- var splitRegex = /\s*,\s*|\s+/;
- var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments];
-
- // Convert the values with units to absolute pixels to allow our computations
- ops = ops.map(function (op, index) {
- // Most of the units rely on the orientation of the popper
- var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width';
- var mergeWithPrevious = false;
- return op
- // This aggregates any `+` or `-` sign that aren't considered operators
- // e.g.: 10 + +5 => [10, +, +5]
- .reduce(function (a, b) {
- if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {
- a[a.length - 1] = b;
- mergeWithPrevious = true;
- return a;
- } else if (mergeWithPrevious) {
- a[a.length - 1] += b;
- mergeWithPrevious = false;
- return a;
- } else {
- return a.concat(b);
- }
- }, [])
- // Here we convert the string values into number values (in px)
- .map(function (str) {
- return toValue(str, measurement, popperOffsets, referenceOffsets);
- });
- });
-
- // Loop trough the offsets arrays and execute the operations
- ops.forEach(function (op, index) {
- op.forEach(function (frag, index2) {
- if (isNumeric(frag)) {
- offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);
- }
- });
- });
- return offsets;
- }
-
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by update method
- * @argument {Object} options - Modifiers configuration and options
- * @argument {Number|String} options.offset=0
- * The offset value as described in the modifier description
- * @returns {Object} The data object, properly modified
- */
- function offset(data, _ref) {
- var offset = _ref.offset;
- var placement = data.placement,
- _data$offsets = data.offsets,
- popper = _data$offsets.popper,
- reference = _data$offsets.reference;
-
- var basePlacement = placement.split('-')[0];
-
- var offsets = void 0;
- if (isNumeric(+offset)) {
- offsets = [+offset, 0];
- } else {
- offsets = parseOffset(offset, popper, reference, basePlacement);
- }
-
- if (basePlacement === 'left') {
- popper.top += offsets[0];
- popper.left -= offsets[1];
- } else if (basePlacement === 'right') {
- popper.top += offsets[0];
- popper.left += offsets[1];
- } else if (basePlacement === 'top') {
- popper.left += offsets[0];
- popper.top -= offsets[1];
- } else if (basePlacement === 'bottom') {
- popper.left += offsets[0];
- popper.top += offsets[1];
- }
-
- data.popper = popper;
- return data;
- }
-
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by `update` method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The data object, properly modified
- */
- function preventOverflow(data, options) {
- var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper);
-
- // If offsetParent is the reference element, we really want to
- // go one step up and use the next offsetParent as reference to
- // avoid to make this modifier completely useless and look like broken
- if (data.instance.reference === boundariesElement) {
- boundariesElement = getOffsetParent(boundariesElement);
- }
-
- // NOTE: DOM access here
- // resets the popper's position so that the document size can be calculated excluding
- // the size of the popper element itself
- var transformProp = getSupportedPropertyName('transform');
- var popperStyles = data.instance.popper.style; // assignment to help minification
- var top = popperStyles.top,
- left = popperStyles.left,
- transform = popperStyles[transformProp];
-
- popperStyles.top = '';
- popperStyles.left = '';
- popperStyles[transformProp] = '';
-
- var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed);
-
- // NOTE: DOM access here
- // restores the original style properties after the offsets have been computed
- popperStyles.top = top;
- popperStyles.left = left;
- popperStyles[transformProp] = transform;
-
- options.boundaries = boundaries;
-
- var order = options.priority;
- var popper = data.offsets.popper;
-
- var check = {
- primary: function primary(placement) {
- var value = popper[placement];
- if (popper[placement] < boundaries[placement] && !options.escapeWithReference) {
- value = Math.max(popper[placement], boundaries[placement]);
- }
- return defineProperty({}, placement, value);
- },
- secondary: function secondary(placement) {
- var mainSide = placement === 'right' ? 'left' : 'top';
- var value = popper[mainSide];
- if (popper[placement] > boundaries[placement] && !options.escapeWithReference) {
- value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height));
- }
- return defineProperty({}, mainSide, value);
- }
- };
-
- order.forEach(function (placement) {
- var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';
- popper = _extends({}, popper, check[side](placement));
- });
-
- data.offsets.popper = popper;
-
- return data;
- }
-
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by `update` method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The data object, properly modified
- */
- function shift(data) {
- var placement = data.placement;
- var basePlacement = placement.split('-')[0];
- var shiftvariation = placement.split('-')[1];
-
- // if shift shiftvariation is specified, run the modifier
- if (shiftvariation) {
- var _data$offsets = data.offsets,
- reference = _data$offsets.reference,
- popper = _data$offsets.popper;
-
- var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;
- var side = isVertical ? 'left' : 'top';
- var measurement = isVertical ? 'width' : 'height';
-
- var shiftOffsets = {
- start: defineProperty({}, side, reference[side]),
- end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement])
- };
-
- data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]);
- }
-
- return data;
- }
-
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by update method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The data object, properly modified
- */
- function hide(data) {
- if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {
- return data;
- }
-
- var refRect = data.offsets.reference;
- var bound = find(data.instance.modifiers, function (modifier) {
- return modifier.name === 'preventOverflow';
- }).boundaries;
-
- if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) {
- // Avoid unnecessary DOM access if visibility hasn't changed
- if (data.hide === true) {
- return data;
- }
-
- data.hide = true;
- data.attributes['x-out-of-boundaries'] = '';
- } else {
- // Avoid unnecessary DOM access if visibility hasn't changed
- if (data.hide === false) {
- return data;
- }
-
- data.hide = false;
- data.attributes['x-out-of-boundaries'] = false;
- }
-
- return data;
- }
-
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by `update` method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The data object, properly modified
- */
- function inner(data) {
- var placement = data.placement;
- var basePlacement = placement.split('-')[0];
- var _data$offsets = data.offsets,
- popper = _data$offsets.popper,
- reference = _data$offsets.reference;
-
- var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;
-
- var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;
-
- popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);
-
- data.placement = getOppositePlacement(placement);
- data.offsets.popper = getClientRect(popper);
-
- return data;
- }
-
- /**
- * Modifier function, each modifier can have a function of this type assigned
- * to its `fn` property.<br />
- * These functions will be called on each update, this means that you must
- * make sure they are performant enough to avoid performance bottlenecks.
- *
- * @function ModifierFn
- * @argument {dataObject} data - The data object generated by `update` method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {dataObject} The data object, properly modified
- */
-
- /**
- * Modifiers are plugins used to alter the behavior of your poppers.<br />
- * Popper.js uses a set of 9 modifiers to provide all the basic functionalities
- * needed by the library.
- *
- * Usually you don't want to override the `order`, `fn` and `onLoad` props.
- * All the other properties are configurations that could be tweaked.
- * @namespace modifiers
- */
- var modifiers = {
- /**
- * Modifier used to shift the popper on the start or end of its reference
- * element.<br />
- * It will read the variation of the `placement` property.<br />
- * It can be one either `-end` or `-start`.
- * @memberof modifiers
- * @inner
- */
- shift: {
- /** @prop {number} order=100 - Index used to define the order of execution */
- order: 100,
- /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
- enabled: true,
- /** @prop {ModifierFn} */
- fn: shift
- },
-
- /**
- * The `offset` modifier can shift your popper on both its axis.
- *
- * It accepts the following units:
- * - `px` or unit-less, interpreted as pixels
- * - `%` or `%r`, percentage relative to the length of the reference element
- * - `%p`, percentage relative to the length of the popper element
- * - `vw`, CSS viewport width unit
- * - `vh`, CSS viewport height unit
- *
- * For length is intended the main axis relative to the placement of the popper.<br />
- * This means that if the placement is `top` or `bottom`, the length will be the
- * `width`. In case of `left` or `right`, it will be the `height`.
- *
- * You can provide a single value (as `Number` or `String`), or a pair of values
- * as `String` divided by a comma or one (or more) white spaces.<br />
- * The latter is a deprecated method because it leads to confusion and will be
- * removed in v2.<br />
- * Additionally, it accepts additions and subtractions between different units.
- * Note that multiplications and divisions aren't supported.
- *
- * Valid examples are:
- * ```
- * 10
- * '10%'
- * '10, 10'
- * '10%, 10'
- * '10 + 10%'
- * '10 - 5vh + 3%'
- * '-10px + 5vh, 5px - 6%'
- * ```
- * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap
- * > with their reference element, unfortunately, you will have to disable the `flip` modifier.
- * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373).
- *
- * @memberof modifiers
- * @inner
- */
- offset: {
- /** @prop {number} order=200 - Index used to define the order of execution */
- order: 200,
- /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
- enabled: true,
- /** @prop {ModifierFn} */
- fn: offset,
- /** @prop {Number|String} offset=0
- * The offset value as described in the modifier description
- */
- offset: 0
- },
-
- /**
- * Modifier used to prevent the popper from being positioned outside the boundary.
- *
- * A scenario exists where the reference itself is not within the boundaries.<br />
- * We can say it has "escaped the boundaries" — or just "escaped".<br />
- * In this case we need to decide whether the popper should either:
- *
- * - detach from the reference and remain "trapped" in the boundaries, or
- * - if it should ignore the boundary and "escape with its reference"
- *
- * When `escapeWithReference` is set to`true` and reference is completely
- * outside its boundaries, the popper will overflow (or completely leave)
- * the boundaries in order to remain attached to the edge of the reference.
- *
- * @memberof modifiers
- * @inner
- */
- preventOverflow: {
- /** @prop {number} order=300 - Index used to define the order of execution */
- order: 300,
- /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
- enabled: true,
- /** @prop {ModifierFn} */
- fn: preventOverflow,
- /**
- * @prop {Array} [priority=['left','right','top','bottom']]
- * Popper will try to prevent overflow following these priorities by default,
- * then, it could overflow on the left and on top of the `boundariesElement`
- */
- priority: ['left', 'right', 'top', 'bottom'],
- /**
- * @prop {number} padding=5
- * Amount of pixel used to define a minimum distance between the boundaries
- * and the popper. This makes sure the popper always has a little padding
- * between the edges of its container
- */
- padding: 5,
- /**
- * @prop {String|HTMLElement} boundariesElement='scrollParent'
- * Boundaries used by the modifier. Can be `scrollParent`, `window`,
- * `viewport` or any DOM element.
- */
- boundariesElement: 'scrollParent'
- },
-
- /**
- * Modifier used to make sure the reference and its popper stay near each other
- * without leaving any gap between the two. Especially useful when the arrow is
- * enabled and you want to ensure that it points to its reference element.
- * It cares only about the first axis. You can still have poppers with margin
- * between the popper and its reference element.
- * @memberof modifiers
- * @inner
- */
- keepTogether: {
- /** @prop {number} order=400 - Index used to define the order of execution */
- order: 400,
- /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
- enabled: true,
- /** @prop {ModifierFn} */
- fn: keepTogether
- },
-
- /**
- * This modifier is used to move the `arrowElement` of the popper to make
- * sure it is positioned between the reference element and its popper element.
- * It will read the outer size of the `arrowElement` node to detect how many
- * pixels of conjunction are needed.
- *
- * It has no effect if no `arrowElement` is provided.
- * @memberof modifiers
- * @inner
- */
- arrow: {
- /** @prop {number} order=500 - Index used to define the order of execution */
- order: 500,
- /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
- enabled: true,
- /** @prop {ModifierFn} */
- fn: arrow,
- /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */
- element: '[x-arrow]'
- },
-
- /**
- * Modifier used to flip the popper's placement when it starts to overlap its
- * reference element.
- *
- * Requires the `preventOverflow` modifier before it in order to work.
- *
- * **NOTE:** this modifier will interrupt the current update cycle and will
- * restart it if it detects the need to flip the placement.
- * @memberof modifiers
- * @inner
- */
- flip: {
- /** @prop {number} order=600 - Index used to define the order of execution */
- order: 600,
- /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
- enabled: true,
- /** @prop {ModifierFn} */
- fn: flip,
- /**
- * @prop {String|Array} behavior='flip'
- * The behavior used to change the popper's placement. It can be one of
- * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid
- * placements (with optional variations)
- */
- behavior: 'flip',
- /**
- * @prop {number} padding=5
- * The popper will flip if it hits the edges of the `boundariesElement`
- */
- padding: 5,
- /**
- * @prop {String|HTMLElement} boundariesElement='viewport'
- * The element which will define the boundaries of the popper position.
- * The popper will never be placed outside of the defined boundaries
- * (except if `keepTogether` is enabled)
- */
- boundariesElement: 'viewport',
- /**
- * @prop {Boolean} flipVariations=false
- * The popper will switch placement variation between `-start` and `-end` when
- * the reference element overlaps its boundaries.
- *
- * The original placement should have a set variation.
- */
- flipVariations: false,
- /**
- * @prop {Boolean} flipVariationsByContent=false
- * The popper will switch placement variation between `-start` and `-end` when
- * the popper element overlaps its reference boundaries.
- *
- * The original placement should have a set variation.
- */
- flipVariationsByContent: false
- },
-
- /**
- * Modifier used to make the popper flow toward the inner of the reference element.
- * By default, when this modifier is disabled, the popper will be placed outside
- * the reference element.
- * @memberof modifiers
- * @inner
- */
- inner: {
- /** @prop {number} order=700 - Index used to define the order of execution */
- order: 700,
- /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */
- enabled: false,
- /** @prop {ModifierFn} */
- fn: inner
- },
-
- /**
- * Modifier used to hide the popper when its reference element is outside of the
- * popper boundaries. It will set a `x-out-of-boundaries` attribute which can
- * be used to hide with a CSS selector the popper when its reference is
- * out of boundaries.
- *
- * Requires the `preventOverflow` modifier before it in order to work.
- * @memberof modifiers
- * @inner
- */
- hide: {
- /** @prop {number} order=800 - Index used to define the order of execution */
- order: 800,
- /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
- enabled: true,
- /** @prop {ModifierFn} */
- fn: hide
- },
-
- /**
- * Computes the style that will be applied to the popper element to gets
- * properly positioned.
- *
- * Note that this modifier will not touch the DOM, it just prepares the styles
- * so that `applyStyle` modifier can apply it. This separation is useful
- * in case you need to replace `applyStyle` with a custom implementation.
- *
- * This modifier has `850` as `order` value to maintain backward compatibility
- * with previous versions of Popper.js. Expect the modifiers ordering method
- * to change in future major versions of the library.
- *
- * @memberof modifiers
- * @inner
- */
- computeStyle: {
- /** @prop {number} order=850 - Index used to define the order of execution */
- order: 850,
- /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
- enabled: true,
- /** @prop {ModifierFn} */
- fn: computeStyle,
- /**
- * @prop {Boolean} gpuAcceleration=true
- * If true, it uses the CSS 3D transformation to position the popper.
- * Otherwise, it will use the `top` and `left` properties
- */
- gpuAcceleration: true,
- /**
- * @prop {string} [x='bottom']
- * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.
- * Change this if your popper should grow in a direction different from `bottom`
- */
- x: 'bottom',
- /**
- * @prop {string} [x='left']
- * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.
- * Change this if your popper should grow in a direction different from `right`
- */
- y: 'right'
- },
-
- /**
- * Applies the computed styles to the popper element.
- *
- * All the DOM manipulations are limited to this modifier. This is useful in case
- * you want to integrate Popper.js inside a framework or view library and you
- * want to delegate all the DOM manipulations to it.
- *
- * Note that if you disable this modifier, you must make sure the popper element
- * has its position set to `absolute` before Popper.js can do its work!
- *
- * Just disable this modifier and define your own to achieve the desired effect.
- *
- * @memberof modifiers
- * @inner
- */
- applyStyle: {
- /** @prop {number} order=900 - Index used to define the order of execution */
- order: 900,
- /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
- enabled: true,
- /** @prop {ModifierFn} */
- fn: applyStyle,
- /** @prop {Function} */
- onLoad: applyStyleOnLoad,
- /**
- * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier
- * @prop {Boolean} gpuAcceleration=true
- * If true, it uses the CSS 3D transformation to position the popper.
- * Otherwise, it will use the `top` and `left` properties
- */
- gpuAcceleration: undefined
- }
- };
-
- /**
- * The `dataObject` is an object containing all the information used by Popper.js.
- * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks.
- * @name dataObject
- * @property {Object} data.instance The Popper.js instance
- * @property {String} data.placement Placement applied to popper
- * @property {String} data.originalPlacement Placement originally defined on init
- * @property {Boolean} data.flipped True if popper has been flipped by flip modifier
- * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper
- * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier
- * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`)
- * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`)
- * @property {Object} data.boundaries Offsets of the popper boundaries
- * @property {Object} data.offsets The measurements of popper, reference and arrow elements
- * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values
- * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values
- * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0
- */
-
- /**
- * Default options provided to Popper.js constructor.<br />
- * These can be overridden using the `options` argument of Popper.js.<br />
- * To override an option, simply pass an object with the same
- * structure of the `options` object, as the 3rd argument. For example:
- * ```
- * new Popper(ref, pop, {
- * modifiers: {
- * preventOverflow: { enabled: false }
- * }
- * })
- * ```
- * @type {Object}
- * @static
- * @memberof Popper
- */
- var Defaults = {
- /**
- * Popper's placement.
- * @prop {Popper.placements} placement='bottom'
- */
- placement: 'bottom',
-
- /**
- * Set this to true if you want popper to position it self in 'fixed' mode
- * @prop {Boolean} positionFixed=false
- */
- positionFixed: false,
-
- /**
- * Whether events (resize, scroll) are initially enabled.
- * @prop {Boolean} eventsEnabled=true
- */
- eventsEnabled: true,
-
- /**
- * Set to true if you want to automatically remove the popper when
- * you call the `destroy` method.
- * @prop {Boolean} removeOnDestroy=false
- */
- removeOnDestroy: false,
-
- /**
- * Callback called when the popper is created.<br />
- * By default, it is set to no-op.<br />
- * Access Popper.js instance with `data.instance`.
- * @prop {onCreate}
- */
- onCreate: function onCreate() {},
-
- /**
- * Callback called when the popper is updated. This callback is not called
- * on the initialization/creation of the popper, but only on subsequent
- * updates.<br />
- * By default, it is set to no-op.<br />
- * Access Popper.js instance with `data.instance`.
- * @prop {onUpdate}
- */
- onUpdate: function onUpdate() {},
-
- /**
- * List of modifiers used to modify the offsets before they are applied to the popper.
- * They provide most of the functionalities of Popper.js.
- * @prop {modifiers}
- */
- modifiers: modifiers
- };
-
- /**
- * @callback onCreate
- * @param {dataObject} data
- */
-
- /**
- * @callback onUpdate
- * @param {dataObject} data
- */
-
- // Utils
- // Methods
- var Popper = function () {
- /**
- * Creates a new Popper.js instance.
- * @class Popper
- * @param {Element|referenceObject} reference - The reference element used to position the popper
- * @param {Element} popper - The HTML / XML element used as the popper
- * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults)
- * @return {Object} instance - The generated Popper.js instance
- */
- function Popper(reference, popper) {
- var _this = this;
-
- var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
- classCallCheck(this, Popper);
-
- this.scheduleUpdate = function () {
- return requestAnimationFrame(_this.update);
- };
-
- // make update() debounced, so that it only runs at most once-per-tick
- this.update = debounce(this.update.bind(this));
-
- // with {} we create a new object with the options inside it
- this.options = _extends({}, Popper.Defaults, options);
-
- // init state
- this.state = {
- isDestroyed: false,
- isCreated: false,
- scrollParents: []
- };
-
- // get reference and popper elements (allow jQuery wrappers)
- this.reference = reference && reference.jquery ? reference[0] : reference;
- this.popper = popper && popper.jquery ? popper[0] : popper;
-
- // Deep merge modifiers options
- this.options.modifiers = {};
- Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) {
- _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});
- });
-
- // Refactoring modifiers' list (Object => Array)
- this.modifiers = Object.keys(this.options.modifiers).map(function (name) {
- return _extends({
- name: name
- }, _this.options.modifiers[name]);
- })
- // sort the modifiers by order
- .sort(function (a, b) {
- return a.order - b.order;
- });
-
- // modifiers have the ability to execute arbitrary code when Popper.js get inited
- // such code is executed in the same order of its modifier
- // they could add new properties to their options configuration
- // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`!
- this.modifiers.forEach(function (modifierOptions) {
- if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) {
- modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state);
- }
- });
-
- // fire the first update to position the popper in the right place
- this.update();
-
- var eventsEnabled = this.options.eventsEnabled;
- if (eventsEnabled) {
- // setup event listeners, they will take care of update the position in specific situations
- this.enableEventListeners();
- }
-
- this.state.eventsEnabled = eventsEnabled;
- }
-
- // We can't use class properties because they don't get listed in the
- // class prototype and break stuff like Sinon stubs
-
-
- createClass(Popper, [{
- key: 'update',
- value: function update$$1() {
- return update.call(this);
- }
- }, {
- key: 'destroy',
- value: function destroy$$1() {
- return destroy.call(this);
- }
- }, {
- key: 'enableEventListeners',
- value: function enableEventListeners$$1() {
- return enableEventListeners.call(this);
- }
- }, {
- key: 'disableEventListeners',
- value: function disableEventListeners$$1() {
- return disableEventListeners.call(this);
- }
-
- /**
- * Schedules an update. It will run on the next UI update available.
- * @method scheduleUpdate
- * @memberof Popper
- */
-
-
- /**
- * Collection of utilities useful when writing custom modifiers.
- * Starting from version 1.7, this method is available only if you
- * include `popper-utils.js` before `popper.js`.
- *
- * **DEPRECATION**: This way to access PopperUtils is deprecated
- * and will be removed in v2! Use the PopperUtils module directly instead.
- * Due to the high instability of the methods contained in Utils, we can't
- * guarantee them to follow semver. Use them at your own risk!
- * @static
- * @private
- * @type {Object}
- * @deprecated since version 1.8
- * @member Utils
- * @memberof Popper
- */
-
- }]);
- return Popper;
- }();
-
- /**
- * The `referenceObject` is an object that provides an interface compatible with Popper.js
- * and lets you use it as replacement of a real DOM node.<br />
- * You can use this method to position a popper relatively to a set of coordinates
- * in case you don't have a DOM node to use as reference.
- *
- * ```
- * new Popper(referenceObject, popperNode);
- * ```
- *
- * NB: This feature isn't supported in Internet Explorer 10.
- * @name referenceObject
- * @property {Function} data.getBoundingClientRect
- * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method.
- * @property {number} data.clientWidth
- * An ES6 getter that will return the width of the virtual reference element.
- * @property {number} data.clientHeight
- * An ES6 getter that will return the height of the virtual reference element.
- */
-
-
- Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils;
- Popper.placements = placements;
- Popper.Defaults = Defaults;
-
- /* harmony default export */ __webpack_exports__["default"] = (Popper);
- //# sourceMappingURL=popper.js.map
-
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
-
- /***/ }),
-
- /***/ "./node_modules/siema/dist/siema.min.js":
- /*!**********************************************!*\
- !*** ./node_modules/siema/dist/siema.min.js ***!
- \**********************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- !function(e,t){ true?module.exports=t():undefined}("undefined"!=typeof self?self:this,function(){return function(e){function t(r){if(i[r])return i[r].exports;var n=i[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var i={};return t.m=e,t.c=i,t.d=function(e,i,r){t.o(e,i)||Object.defineProperty(e,i,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(i,"a",i),i},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,i){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s=function(){function e(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,i,r){return i&&e(t.prototype,i),r&&e(t,r),t}}(),l=function(){function e(t){var i=this;if(r(this,e),this.config=e.mergeSettings(t),this.selector="string"==typeof this.config.selector?document.querySelector(this.config.selector):this.config.selector,null===this.selector)throw new Error("Something wrong with your selector 😭");this.resolveSlidesNumber(),this.selectorWidth=this.selector.offsetWidth,this.innerElements=[].slice.call(this.selector.children),this.currentSlide=this.config.loop?this.config.startIndex%this.innerElements.length:Math.max(0,Math.min(this.config.startIndex,this.innerElements.length-this.perPage)),this.transformProperty=e.webkitOrNot(),["resizeHandler","touchstartHandler","touchendHandler","touchmoveHandler","mousedownHandler","mouseupHandler","mouseleaveHandler","mousemoveHandler","clickHandler"].forEach(function(e){i[e]=i[e].bind(i)}),this.init()}return s(e,[{key:"attachEvents",value:function(){window.addEventListener("resize",this.resizeHandler),this.config.draggable&&(this.pointerDown=!1,this.drag={startX:0,endX:0,startY:0,letItGo:null,preventClick:!1},this.selector.addEventListener("touchstart",this.touchstartHandler),this.selector.addEventListener("touchend",this.touchendHandler),this.selector.addEventListener("touchmove",this.touchmoveHandler),this.selector.addEventListener("mousedown",this.mousedownHandler),this.selector.addEventListener("mouseup",this.mouseupHandler),this.selector.addEventListener("mouseleave",this.mouseleaveHandler),this.selector.addEventListener("mousemove",this.mousemoveHandler),this.selector.addEventListener("click",this.clickHandler))}},{key:"detachEvents",value:function(){window.removeEventListener("resize",this.resizeHandler),this.selector.removeEventListener("touchstart",this.touchstartHandler),this.selector.removeEventListener("touchend",this.touchendHandler),this.selector.removeEventListener("touchmove",this.touchmoveHandler),this.selector.removeEventListener("mousedown",this.mousedownHandler),this.selector.removeEventListener("mouseup",this.mouseupHandler),this.selector.removeEventListener("mouseleave",this.mouseleaveHandler),this.selector.removeEventListener("mousemove",this.mousemoveHandler),this.selector.removeEventListener("click",this.clickHandler)}},{key:"init",value:function(){this.attachEvents(),this.selector.style.overflow="hidden",this.selector.style.direction=this.config.rtl?"rtl":"ltr",this.buildSliderFrame(),this.config.onInit.call(this)}},{key:"buildSliderFrame",value:function(){var e=this.selectorWidth/this.perPage,t=this.config.loop?this.innerElements.length+2*this.perPage:this.innerElements.length;this.sliderFrame=document.createElement("div"),this.sliderFrame.style.width=e*t+"px",this.enableTransition(),this.config.draggable&&(this.selector.style.cursor="-webkit-grab");var i=document.createDocumentFragment();if(this.config.loop)for(var r=this.innerElements.length-this.perPage;r<this.innerElements.length;r++){var n=this.buildSliderFrameItem(this.innerElements[r].cloneNode(!0));i.appendChild(n)}for(var s=0;s<this.innerElements.length;s++){var l=this.buildSliderFrameItem(this.innerElements[s]);i.appendChild(l)}if(this.config.loop)for(var o=0;o<this.perPage;o++){var a=this.buildSliderFrameItem(this.innerElements[o].cloneNode(!0));i.appendChild(a)}this.sliderFrame.appendChild(i),this.selector.innerHTML="",this.selector.appendChild(this.sliderFrame),this.slideToCurrent()}},{key:"buildSliderFrameItem",value:function(e){var t=document.createElement("div");return t.style.cssFloat=this.config.rtl?"right":"left",t.style.float=this.config.rtl?"right":"left",t.style.width=(this.config.loop?100/(this.innerElements.length+2*this.perPage):100/this.innerElements.length)+"%",t.appendChild(e),t}},{key:"resolveSlidesNumber",value:function(){if("number"==typeof this.config.perPage)this.perPage=this.config.perPage;else if("object"===n(this.config.perPage)){this.perPage=1;for(var e in this.config.perPage)window.innerWidth>=e&&(this.perPage=this.config.perPage[e])}}},{key:"prev",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments[1];if(!(this.innerElements.length<=this.perPage)){var i=this.currentSlide;if(this.config.loop){if(this.currentSlide-e<0){this.disableTransition();var r=this.currentSlide+this.innerElements.length,n=this.perPage,s=r+n,l=(this.config.rtl?1:-1)*s*(this.selectorWidth/this.perPage),o=this.config.draggable?this.drag.endX-this.drag.startX:0;this.sliderFrame.style[this.transformProperty]="translate3d("+(l+o)+"px, 0, 0)",this.currentSlide=r-e}else this.currentSlide=this.currentSlide-e}else this.currentSlide=Math.max(this.currentSlide-e,0);i!==this.currentSlide&&(this.slideToCurrent(this.config.loop),this.config.onChange.call(this),t&&t.call(this))}}},{key:"next",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments[1];if(!(this.innerElements.length<=this.perPage)){var i=this.currentSlide;if(this.config.loop){if(this.currentSlide+e>this.innerElements.length-this.perPage){this.disableTransition();var r=this.currentSlide-this.innerElements.length,n=this.perPage,s=r+n,l=(this.config.rtl?1:-1)*s*(this.selectorWidth/this.perPage),o=this.config.draggable?this.drag.endX-this.drag.startX:0;this.sliderFrame.style[this.transformProperty]="translate3d("+(l+o)+"px, 0, 0)",this.currentSlide=r+e}else this.currentSlide=this.currentSlide+e}else this.currentSlide=Math.min(this.currentSlide+e,this.innerElements.length-this.perPage);i!==this.currentSlide&&(this.slideToCurrent(this.config.loop),this.config.onChange.call(this),t&&t.call(this))}}},{key:"disableTransition",value:function(){this.sliderFrame.style.webkitTransition="all 0ms "+this.config.easing,this.sliderFrame.style.transition="all 0ms "+this.config.easing}},{key:"enableTransition",value:function(){this.sliderFrame.style.webkitTransition="all "+this.config.duration+"ms "+this.config.easing,this.sliderFrame.style.transition="all "+this.config.duration+"ms "+this.config.easing}},{key:"goTo",value:function(e,t){if(!(this.innerElements.length<=this.perPage)){var i=this.currentSlide;this.currentSlide=this.config.loop?e%this.innerElements.length:Math.min(Math.max(e,0),this.innerElements.length-this.perPage),i!==this.currentSlide&&(this.slideToCurrent(),this.config.onChange.call(this),t&&t.call(this))}}},{key:"slideToCurrent",value:function(e){var t=this,i=this.config.loop?this.currentSlide+this.perPage:this.currentSlide,r=(this.config.rtl?1:-1)*i*(this.selectorWidth/this.perPage);e?requestAnimationFrame(function(){requestAnimationFrame(function(){t.enableTransition(),t.sliderFrame.style[t.transformProperty]="translate3d("+r+"px, 0, 0)"})}):this.sliderFrame.style[this.transformProperty]="translate3d("+r+"px, 0, 0)"}},{key:"updateAfterDrag",value:function(){var e=(this.config.rtl?-1:1)*(this.drag.endX-this.drag.startX),t=Math.abs(e),i=this.config.multipleDrag?Math.ceil(t/(this.selectorWidth/this.perPage)):1,r=e>0&&this.currentSlide-i<0,n=e<0&&this.currentSlide+i>this.innerElements.length-this.perPage;e>0&&t>this.config.threshold&&this.innerElements.length>this.perPage?this.prev(i):e<0&&t>this.config.threshold&&this.innerElements.length>this.perPage&&this.next(i),this.slideToCurrent(r||n)}},{key:"resizeHandler",value:function(){this.resolveSlidesNumber(),this.currentSlide+this.perPage>this.innerElements.length&&(this.currentSlide=this.innerElements.length<=this.perPage?0:this.innerElements.length-this.perPage),this.selectorWidth=this.selector.offsetWidth,this.buildSliderFrame()}},{key:"clearDrag",value:function(){this.drag={startX:0,endX:0,startY:0,letItGo:null,preventClick:this.drag.preventClick}}},{key:"touchstartHandler",value:function(e){-1!==["TEXTAREA","OPTION","INPUT","SELECT"].indexOf(e.target.nodeName)||(e.stopPropagation(),this.pointerDown=!0,this.drag.startX=e.touches[0].pageX,this.drag.startY=e.touches[0].pageY)}},{key:"touchendHandler",value:function(e){e.stopPropagation(),this.pointerDown=!1,this.enableTransition(),this.drag.endX&&this.updateAfterDrag(),this.clearDrag()}},{key:"touchmoveHandler",value:function(e){if(e.stopPropagation(),null===this.drag.letItGo&&(this.drag.letItGo=Math.abs(this.drag.startY-e.touches[0].pageY)<Math.abs(this.drag.startX-e.touches[0].pageX)),this.pointerDown&&this.drag.letItGo){e.preventDefault(),this.drag.endX=e.touches[0].pageX,this.sliderFrame.style.webkitTransition="all 0ms "+this.config.easing,this.sliderFrame.style.transition="all 0ms "+this.config.easing;var t=this.config.loop?this.currentSlide+this.perPage:this.currentSlide,i=t*(this.selectorWidth/this.perPage),r=this.drag.endX-this.drag.startX,n=this.config.rtl?i+r:i-r;this.sliderFrame.style[this.transformProperty]="translate3d("+(this.config.rtl?1:-1)*n+"px, 0, 0)"}}},{key:"mousedownHandler",value:function(e){-1!==["TEXTAREA","OPTION","INPUT","SELECT"].indexOf(e.target.nodeName)||(e.preventDefault(),e.stopPropagation(),this.pointerDown=!0,this.drag.startX=e.pageX)}},{key:"mouseupHandler",value:function(e){e.stopPropagation(),this.pointerDown=!1,this.selector.style.cursor="-webkit-grab",this.enableTransition(),this.drag.endX&&this.updateAfterDrag(),this.clearDrag()}},{key:"mousemoveHandler",value:function(e){if(e.preventDefault(),this.pointerDown){"A"===e.target.nodeName&&(this.drag.preventClick=!0),this.drag.endX=e.pageX,this.selector.style.cursor="-webkit-grabbing",this.sliderFrame.style.webkitTransition="all 0ms "+this.config.easing,this.sliderFrame.style.transition="all 0ms "+this.config.easing;var t=this.config.loop?this.currentSlide+this.perPage:this.currentSlide,i=t*(this.selectorWidth/this.perPage),r=this.drag.endX-this.drag.startX,n=this.config.rtl?i+r:i-r;this.sliderFrame.style[this.transformProperty]="translate3d("+(this.config.rtl?1:-1)*n+"px, 0, 0)"}}},{key:"mouseleaveHandler",value:function(e){this.pointerDown&&(this.pointerDown=!1,this.selector.style.cursor="-webkit-grab",this.drag.endX=e.pageX,this.drag.preventClick=!1,this.enableTransition(),this.updateAfterDrag(),this.clearDrag())}},{key:"clickHandler",value:function(e){this.drag.preventClick&&e.preventDefault(),this.drag.preventClick=!1}},{key:"remove",value:function(e,t){if(e<0||e>=this.innerElements.length)throw new Error("Item to remove doesn't exist 😭");var i=e<this.currentSlide,r=this.currentSlide+this.perPage-1===e;(i||r)&&this.currentSlide--,this.innerElements.splice(e,1),this.buildSliderFrame(),t&&t.call(this)}},{key:"insert",value:function(e,t,i){if(t<0||t>this.innerElements.length+1)throw new Error("Unable to inset it at this index 😭");if(-1!==this.innerElements.indexOf(e))throw new Error("The same item in a carousel? Really? Nope 😭");var r=t<=this.currentSlide>0&&this.innerElements.length;this.currentSlide=r?this.currentSlide+1:this.currentSlide,this.innerElements.splice(t,0,e),this.buildSliderFrame(),i&&i.call(this)}},{key:"prepend",value:function(e,t){this.insert(e,0),t&&t.call(this)}},{key:"append",value:function(e,t){this.insert(e,this.innerElements.length+1),t&&t.call(this)}},{key:"destroy",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments[1];if(this.detachEvents(),this.selector.style.cursor="auto",e){for(var i=document.createDocumentFragment(),r=0;r<this.innerElements.length;r++)i.appendChild(this.innerElements[r]);this.selector.innerHTML="",this.selector.appendChild(i),this.selector.removeAttribute("style")}t&&t.call(this)}}],[{key:"mergeSettings",value:function(e){var t={selector:".siema",duration:200,easing:"ease-out",perPage:1,startIndex:0,draggable:!0,multipleDrag:!0,threshold:20,loop:!1,rtl:!1,onInit:function(){},onChange:function(){}},i=e;for(var r in i)t[r]=i[r];return t}},{key:"webkitOrNot",value:function(){return"string"==typeof document.documentElement.style.transform?"transform":"WebkitTransform"}}]),e}();t.default=l,e.exports=t.default}])});
-
- /***/ }),
-
- /***/ "./node_modules/style-loader/lib/addStyles.js":
- /*!****************************************************!*\
- !*** ./node_modules/style-loader/lib/addStyles.js ***!
- \****************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- /*
- MIT License http://www.opensource.org/licenses/mit-license.php
- Author Tobias Koppers @sokra
- */
-
- var stylesInDom = {};
-
- var memoize = function (fn) {
- var memo;
-
- return function () {
- if (typeof memo === "undefined") memo = fn.apply(this, arguments);
- return memo;
- };
- };
-
- var isOldIE = memoize(function () {
- // Test for IE <= 9 as proposed by Browserhacks
- // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805
- // Tests for existence of standard globals is to allow style-loader
- // to operate correctly into non-standard environments
- // @see https://github.com/webpack-contrib/style-loader/issues/177
- return window && document && document.all && !window.atob;
- });
-
- var getTarget = function (target, parent) {
- if (parent){
- return parent.querySelector(target);
- }
- return document.querySelector(target);
- };
-
- var getElement = (function (fn) {
- var memo = {};
-
- return function(target, parent) {
- // If passing function in options, then use it for resolve "head" element.
- // Useful for Shadow Root style i.e
- // {
- // insertInto: function () { return document.querySelector("#foo").shadowRoot }
- // }
- if (typeof target === 'function') {
- return target();
- }
- if (typeof memo[target] === "undefined") {
- var styleTarget = getTarget.call(this, target, parent);
- // Special case to return head of iframe instead of iframe itself
- if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
- try {
- // This will throw an exception if access to iframe is blocked
- // due to cross-origin restrictions
- styleTarget = styleTarget.contentDocument.head;
- } catch(e) {
- styleTarget = null;
- }
- }
- memo[target] = styleTarget;
- }
- return memo[target]
- };
- })();
-
- var singleton = null;
- var singletonCounter = 0;
- var stylesInsertedAtTop = [];
-
- var fixUrls = __webpack_require__(/*! ./urls */ "./node_modules/style-loader/lib/urls.js");
-
- module.exports = function(list, options) {
- if (typeof DEBUG !== "undefined" && DEBUG) {
- if (typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment");
- }
-
- options = options || {};
-
- options.attrs = typeof options.attrs === "object" ? options.attrs : {};
-
- // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
- // tags it will allow on a page
- if (!options.singleton && typeof options.singleton !== "boolean") options.singleton = isOldIE();
-
- // By default, add <style> tags to the <head> element
- if (!options.insertInto) options.insertInto = "head";
-
- // By default, add <style> tags to the bottom of the target
- if (!options.insertAt) options.insertAt = "bottom";
-
- var styles = listToStyles(list, options);
-
- addStylesToDom(styles, options);
-
- return function update (newList) {
- var mayRemove = [];
-
- for (var i = 0; i < styles.length; i++) {
- var item = styles[i];
- var domStyle = stylesInDom[item.id];
-
- domStyle.refs--;
- mayRemove.push(domStyle);
- }
-
- if(newList) {
- var newStyles = listToStyles(newList, options);
- addStylesToDom(newStyles, options);
- }
-
- for (var i = 0; i < mayRemove.length; i++) {
- var domStyle = mayRemove[i];
-
- if(domStyle.refs === 0) {
- for (var j = 0; j < domStyle.parts.length; j++) domStyle.parts[j]();
-
- delete stylesInDom[domStyle.id];
- }
- }
- };
- };
-
- function addStylesToDom (styles, options) {
- for (var i = 0; i < styles.length; i++) {
- var item = styles[i];
- var domStyle = stylesInDom[item.id];
-
- if(domStyle) {
- domStyle.refs++;
-
- for(var j = 0; j < domStyle.parts.length; j++) {
- domStyle.parts[j](item.parts[j]);
- }
-
- for(; j < item.parts.length; j++) {
- domStyle.parts.push(addStyle(item.parts[j], options));
- }
- } else {
- var parts = [];
-
- for(var j = 0; j < item.parts.length; j++) {
- parts.push(addStyle(item.parts[j], options));
- }
-
- stylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};
- }
- }
- }
-
- function listToStyles (list, options) {
- var styles = [];
- var newStyles = {};
-
- for (var i = 0; i < list.length; i++) {
- var item = list[i];
- var id = options.base ? item[0] + options.base : item[0];
- var css = item[1];
- var media = item[2];
- var sourceMap = item[3];
- var part = {css: css, media: media, sourceMap: sourceMap};
-
- if(!newStyles[id]) styles.push(newStyles[id] = {id: id, parts: [part]});
- else newStyles[id].parts.push(part);
- }
-
- return styles;
- }
-
- function insertStyleElement (options, style) {
- var target = getElement(options.insertInto)
-
- if (!target) {
- throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");
- }
-
- var lastStyleElementInsertedAtTop = stylesInsertedAtTop[stylesInsertedAtTop.length - 1];
-
- if (options.insertAt === "top") {
- if (!lastStyleElementInsertedAtTop) {
- target.insertBefore(style, target.firstChild);
- } else if (lastStyleElementInsertedAtTop.nextSibling) {
- target.insertBefore(style, lastStyleElementInsertedAtTop.nextSibling);
- } else {
- target.appendChild(style);
- }
- stylesInsertedAtTop.push(style);
- } else if (options.insertAt === "bottom") {
- target.appendChild(style);
- } else if (typeof options.insertAt === "object" && options.insertAt.before) {
- var nextSibling = getElement(options.insertAt.before, target);
- target.insertBefore(style, nextSibling);
- } else {
- throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");
- }
- }
-
- function removeStyleElement (style) {
- if (style.parentNode === null) return false;
- style.parentNode.removeChild(style);
-
- var idx = stylesInsertedAtTop.indexOf(style);
- if(idx >= 0) {
- stylesInsertedAtTop.splice(idx, 1);
- }
- }
-
- function createStyleElement (options) {
- var style = document.createElement("style");
-
- if(options.attrs.type === undefined) {
- options.attrs.type = "text/css";
- }
-
- if(options.attrs.nonce === undefined) {
- var nonce = getNonce();
- if (nonce) {
- options.attrs.nonce = nonce;
- }
- }
-
- addAttrs(style, options.attrs);
- insertStyleElement(options, style);
-
- return style;
- }
-
- function createLinkElement (options) {
- var link = document.createElement("link");
-
- if(options.attrs.type === undefined) {
- options.attrs.type = "text/css";
- }
- options.attrs.rel = "stylesheet";
-
- addAttrs(link, options.attrs);
- insertStyleElement(options, link);
-
- return link;
- }
-
- function addAttrs (el, attrs) {
- Object.keys(attrs).forEach(function (key) {
- el.setAttribute(key, attrs[key]);
- });
- }
-
- function getNonce() {
- if (false) {}
-
- return __webpack_require__.nc;
- }
-
- function addStyle (obj, options) {
- var style, update, remove, result;
-
- // If a transform function was defined, run it on the css
- if (options.transform && obj.css) {
- result = typeof options.transform === 'function'
- ? options.transform(obj.css)
- : options.transform.default(obj.css);
-
- if (result) {
- // If transform returns a value, use that instead of the original css.
- // This allows running runtime transformations on the css.
- obj.css = result;
- } else {
- // If the transform function returns a falsy value, don't add this css.
- // This allows conditional loading of css
- return function() {
- // noop
- };
- }
- }
-
- if (options.singleton) {
- var styleIndex = singletonCounter++;
-
- style = singleton || (singleton = createStyleElement(options));
-
- update = applyToSingletonTag.bind(null, style, styleIndex, false);
- remove = applyToSingletonTag.bind(null, style, styleIndex, true);
-
- } else if (
- obj.sourceMap &&
- typeof URL === "function" &&
- typeof URL.createObjectURL === "function" &&
- typeof URL.revokeObjectURL === "function" &&
- typeof Blob === "function" &&
- typeof btoa === "function"
- ) {
- style = createLinkElement(options);
- update = updateLink.bind(null, style, options);
- remove = function () {
- removeStyleElement(style);
-
- if(style.href) URL.revokeObjectURL(style.href);
- };
- } else {
- style = createStyleElement(options);
- update = applyToTag.bind(null, style);
- remove = function () {
- removeStyleElement(style);
- };
- }
-
- update(obj);
-
- return function updateStyle (newObj) {
- if (newObj) {
- if (
- newObj.css === obj.css &&
- newObj.media === obj.media &&
- newObj.sourceMap === obj.sourceMap
- ) {
- return;
- }
-
- update(obj = newObj);
- } else {
- remove();
- }
- };
- }
-
- var replaceText = (function () {
- var textStore = [];
-
- return function (index, replacement) {
- textStore[index] = replacement;
-
- return textStore.filter(Boolean).join('\n');
- };
- })();
-
- function applyToSingletonTag (style, index, remove, obj) {
- var css = remove ? "" : obj.css;
-
- if (style.styleSheet) {
- style.styleSheet.cssText = replaceText(index, css);
- } else {
- var cssNode = document.createTextNode(css);
- var childNodes = style.childNodes;
-
- if (childNodes[index]) style.removeChild(childNodes[index]);
-
- if (childNodes.length) {
- style.insertBefore(cssNode, childNodes[index]);
- } else {
- style.appendChild(cssNode);
- }
- }
- }
-
- function applyToTag (style, obj) {
- var css = obj.css;
- var media = obj.media;
-
- if(media) {
- style.setAttribute("media", media)
- }
-
- if(style.styleSheet) {
- style.styleSheet.cssText = css;
- } else {
- while(style.firstChild) {
- style.removeChild(style.firstChild);
- }
-
- style.appendChild(document.createTextNode(css));
- }
- }
-
- function updateLink (link, options, obj) {
- var css = obj.css;
- var sourceMap = obj.sourceMap;
-
- /*
- If convertToAbsoluteUrls isn't defined, but sourcemaps are enabled
- and there is no publicPath defined then lets turn convertToAbsoluteUrls
- on by default. Otherwise default to the convertToAbsoluteUrls option
- directly
- */
- var autoFixUrls = options.convertToAbsoluteUrls === undefined && sourceMap;
-
- if (options.convertToAbsoluteUrls || autoFixUrls) {
- css = fixUrls(css);
- }
-
- if (sourceMap) {
- // http://stackoverflow.com/a/26603875
- css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */";
- }
-
- var blob = new Blob([css], { type: "text/css" });
-
- var oldSrc = link.href;
-
- link.href = URL.createObjectURL(blob);
-
- if(oldSrc) URL.revokeObjectURL(oldSrc);
- }
-
-
- /***/ }),
-
- /***/ "./node_modules/style-loader/lib/urls.js":
- /*!***********************************************!*\
- !*** ./node_modules/style-loader/lib/urls.js ***!
- \***********************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
-
- /**
- * When source maps are enabled, `style-loader` uses a link element with a data-uri to
- * embed the css on the page. This breaks all relative urls because now they are relative to a
- * bundle instead of the current page.
- *
- * One solution is to only use full urls, but that may be impossible.
- *
- * Instead, this function "fixes" the relative urls to be absolute according to the current page location.
- *
- * A rudimentary test suite is located at `test/fixUrls.js` and can be run via the `npm test` command.
- *
- */
-
- module.exports = function (css) {
- // get current location
- var location = typeof window !== "undefined" && window.location;
-
- if (!location) {
- throw new Error("fixUrls requires window.location");
- }
-
- // blank or null?
- if (!css || typeof css !== "string") {
- return css;
- }
-
- var baseUrl = location.protocol + "//" + location.host;
- var currentDir = baseUrl + location.pathname.replace(/\/[^\/]*$/, "/");
-
- // convert each url(...)
- /*
- This regular expression is just a way to recursively match brackets within
- a string.
-
- /url\s*\( = Match on the word "url" with any whitespace after it and then a parens
- ( = Start a capturing group
- (?: = Start a non-capturing group
- [^)(] = Match anything that isn't a parentheses
- | = OR
- \( = Match a start parentheses
- (?: = Start another non-capturing groups
- [^)(]+ = Match anything that isn't a parentheses
- | = OR
- \( = Match a start parentheses
- [^)(]* = Match anything that isn't a parentheses
- \) = Match a end parentheses
- ) = End Group
- *\) = Match anything and then a close parens
- ) = Close non-capturing group
- * = Match anything
- ) = Close capturing group
- \) = Match a close parens
-
- /gi = Get all matches, not the first. Be case insensitive.
- */
- var fixedCss = css.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi, function(fullMatch, origUrl) {
- // strip quotes (if they exist)
- var unquotedOrigUrl = origUrl
- .trim()
- .replace(/^"(.*)"$/, function(o, $1){ return $1; })
- .replace(/^'(.*)'$/, function(o, $1){ return $1; });
-
- // already a full url? no change
- if (/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(unquotedOrigUrl)) {
- return fullMatch;
- }
-
- // convert the url to a full url
- var newUrl;
-
- if (unquotedOrigUrl.indexOf("//") === 0) {
- //TODO: should we add protocol?
- newUrl = unquotedOrigUrl;
- } else if (unquotedOrigUrl.indexOf("/") === 0) {
- // path should be relative to the base url
- newUrl = baseUrl + unquotedOrigUrl; // already starts with '/'
- } else {
- // path should be relative to current directory
- newUrl = currentDir + unquotedOrigUrl.replace(/^\.\//, ""); // Strip leading './'
- }
-
- // send back the fixed url(...)
- return "url(" + JSON.stringify(newUrl) + ")";
- });
-
- // send back the fixed css
- return fixedCss;
- };
-
-
- /***/ }),
-
- /***/ "./node_modules/tippy.js/esm/index.all.js":
- /*!************************************************!*\
- !*** ./node_modules/tippy.js/esm/index.all.js ***!
- \************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var popper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! popper.js */ "./node_modules/popper.js/dist/esm/popper.js");
- /**!
- * tippy.js v4.3.4
- * (c) 2017-2019 atomiks
- * MIT License
- */
-
-
- var css = ".tippy-iOS{cursor:pointer!important;-webkit-tap-highlight-color:transparent}.tippy-popper{transition-timing-function:cubic-bezier(.165,.84,.44,1);max-width:calc(100% - 8px);pointer-events:none;outline:0}.tippy-popper[x-placement^=top] .tippy-backdrop{border-radius:40% 40% 0 0}.tippy-popper[x-placement^=top] .tippy-roundarrow{bottom:-7px;bottom:-6.5px;-webkit-transform-origin:50% 0;transform-origin:50% 0;margin:0 3px}.tippy-popper[x-placement^=top] .tippy-roundarrow svg{position:absolute;left:0;-webkit-transform:rotate(180deg);transform:rotate(180deg)}.tippy-popper[x-placement^=top] .tippy-arrow{border-top:8px solid #333;border-right:8px solid transparent;border-left:8px solid transparent;bottom:-7px;margin:0 3px;-webkit-transform-origin:50% 0;transform-origin:50% 0}.tippy-popper[x-placement^=top] .tippy-backdrop{-webkit-transform-origin:0 25%;transform-origin:0 25%}.tippy-popper[x-placement^=top] .tippy-backdrop[data-state=visible]{-webkit-transform:scale(1) translate(-50%,-55%);transform:scale(1) translate(-50%,-55%)}.tippy-popper[x-placement^=top] .tippy-backdrop[data-state=hidden]{-webkit-transform:scale(.2) translate(-50%,-45%);transform:scale(.2) translate(-50%,-45%);opacity:0}.tippy-popper[x-placement^=top] [data-animation=shift-toward][data-state=visible]{-webkit-transform:translateY(-10px);transform:translateY(-10px)}.tippy-popper[x-placement^=top] [data-animation=shift-toward][data-state=hidden]{opacity:0;-webkit-transform:translateY(-20px);transform:translateY(-20px)}.tippy-popper[x-placement^=top] [data-animation=perspective]{-webkit-transform-origin:bottom;transform-origin:bottom}.tippy-popper[x-placement^=top] [data-animation=perspective][data-state=visible]{-webkit-transform:perspective(700px) translateY(-10px) rotateX(0);transform:perspective(700px) translateY(-10px) rotateX(0)}.tippy-popper[x-placement^=top] [data-animation=perspective][data-state=hidden]{opacity:0;-webkit-transform:perspective(700px) translateY(0) rotateX(60deg);transform:perspective(700px) translateY(0) rotateX(60deg)}.tippy-popper[x-placement^=top] [data-animation=fade][data-state=visible]{-webkit-transform:translateY(-10px);transform:translateY(-10px)}.tippy-popper[x-placement^=top] [data-animation=fade][data-state=hidden]{opacity:0;-webkit-transform:translateY(-10px);transform:translateY(-10px)}.tippy-popper[x-placement^=top] [data-animation=shift-away][data-state=visible]{-webkit-transform:translateY(-10px);transform:translateY(-10px)}.tippy-popper[x-placement^=top] [data-animation=shift-away][data-state=hidden]{opacity:0;-webkit-transform:translateY(0);transform:translateY(0)}.tippy-popper[x-placement^=top] [data-animation=scale]{-webkit-transform-origin:bottom;transform-origin:bottom}.tippy-popper[x-placement^=top] [data-animation=scale][data-state=visible]{-webkit-transform:translateY(-10px) scale(1);transform:translateY(-10px) scale(1)}.tippy-popper[x-placement^=top] [data-animation=scale][data-state=hidden]{opacity:0;-webkit-transform:translateY(-10px) scale(.5);transform:translateY(-10px) scale(.5)}.tippy-popper[x-placement^=bottom] .tippy-backdrop{border-radius:0 0 30% 30%}.tippy-popper[x-placement^=bottom] .tippy-roundarrow{top:-7px;-webkit-transform-origin:50% 100%;transform-origin:50% 100%;margin:0 3px}.tippy-popper[x-placement^=bottom] .tippy-roundarrow svg{position:absolute;left:0;-webkit-transform:rotate(0);transform:rotate(0)}.tippy-popper[x-placement^=bottom] .tippy-arrow{border-bottom:8px solid #333;border-right:8px solid transparent;border-left:8px solid transparent;top:-7px;margin:0 3px;-webkit-transform-origin:50% 100%;transform-origin:50% 100%}.tippy-popper[x-placement^=bottom] .tippy-backdrop{-webkit-transform-origin:0 -50%;transform-origin:0 -50%}.tippy-popper[x-placement^=bottom] .tippy-backdrop[data-state=visible]{-webkit-transform:scale(1) translate(-50%,-45%);transform:scale(1) translate(-50%,-45%)}.tippy-popper[x-placement^=bottom] .tippy-backdrop[data-state=hidden]{-webkit-transform:scale(.2) translate(-50%);transform:scale(.2) translate(-50%);opacity:0}.tippy-popper[x-placement^=bottom] [data-animation=shift-toward][data-state=visible]{-webkit-transform:translateY(10px);transform:translateY(10px)}.tippy-popper[x-placement^=bottom] [data-animation=shift-toward][data-state=hidden]{opacity:0;-webkit-transform:translateY(20px);transform:translateY(20px)}.tippy-popper[x-placement^=bottom] [data-animation=perspective]{-webkit-transform-origin:top;transform-origin:top}.tippy-popper[x-placement^=bottom] [data-animation=perspective][data-state=visible]{-webkit-transform:perspective(700px) translateY(10px) rotateX(0);transform:perspective(700px) translateY(10px) rotateX(0)}.tippy-popper[x-placement^=bottom] [data-animation=perspective][data-state=hidden]{opacity:0;-webkit-transform:perspective(700px) translateY(0) rotateX(-60deg);transform:perspective(700px) translateY(0) rotateX(-60deg)}.tippy-popper[x-placement^=bottom] [data-animation=fade][data-state=visible]{-webkit-transform:translateY(10px);transform:translateY(10px)}.tippy-popper[x-placement^=bottom] [data-animation=fade][data-state=hidden]{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}.tippy-popper[x-placement^=bottom] [data-animation=shift-away][data-state=visible]{-webkit-transform:translateY(10px);transform:translateY(10px)}.tippy-popper[x-placement^=bottom] [data-animation=shift-away][data-state=hidden]{opacity:0;-webkit-transform:translateY(0);transform:translateY(0)}.tippy-popper[x-placement^=bottom] [data-animation=scale]{-webkit-transform-origin:top;transform-origin:top}.tippy-popper[x-placement^=bottom] [data-animation=scale][data-state=visible]{-webkit-transform:translateY(10px) scale(1);transform:translateY(10px) scale(1)}.tippy-popper[x-placement^=bottom] [data-animation=scale][data-state=hidden]{opacity:0;-webkit-transform:translateY(10px) scale(.5);transform:translateY(10px) scale(.5)}.tippy-popper[x-placement^=left] .tippy-backdrop{border-radius:50% 0 0 50%}.tippy-popper[x-placement^=left] .tippy-roundarrow{right:-12px;-webkit-transform-origin:33.33333333% 50%;transform-origin:33.33333333% 50%;margin:3px 0}.tippy-popper[x-placement^=left] .tippy-roundarrow svg{position:absolute;left:0;-webkit-transform:rotate(90deg);transform:rotate(90deg)}.tippy-popper[x-placement^=left] .tippy-arrow{border-left:8px solid #333;border-top:8px solid transparent;border-bottom:8px solid transparent;right:-7px;margin:3px 0;-webkit-transform-origin:0 50%;transform-origin:0 50%}.tippy-popper[x-placement^=left] .tippy-backdrop{-webkit-transform-origin:50% 0;transform-origin:50% 0}.tippy-popper[x-placement^=left] .tippy-backdrop[data-state=visible]{-webkit-transform:scale(1) translate(-50%,-50%);transform:scale(1) translate(-50%,-50%)}.tippy-popper[x-placement^=left] .tippy-backdrop[data-state=hidden]{-webkit-transform:scale(.2) translate(-75%,-50%);transform:scale(.2) translate(-75%,-50%);opacity:0}.tippy-popper[x-placement^=left] [data-animation=shift-toward][data-state=visible]{-webkit-transform:translateX(-10px);transform:translateX(-10px)}.tippy-popper[x-placement^=left] [data-animation=shift-toward][data-state=hidden]{opacity:0;-webkit-transform:translateX(-20px);transform:translateX(-20px)}.tippy-popper[x-placement^=left] [data-animation=perspective]{-webkit-transform-origin:right;transform-origin:right}.tippy-popper[x-placement^=left] [data-animation=perspective][data-state=visible]{-webkit-transform:perspective(700px) translateX(-10px) rotateY(0);transform:perspective(700px) translateX(-10px) rotateY(0)}.tippy-popper[x-placement^=left] [data-animation=perspective][data-state=hidden]{opacity:0;-webkit-transform:perspective(700px) translateX(0) rotateY(-60deg);transform:perspective(700px) translateX(0) rotateY(-60deg)}.tippy-popper[x-placement^=left] [data-animation=fade][data-state=visible]{-webkit-transform:translateX(-10px);transform:translateX(-10px)}.tippy-popper[x-placement^=left] [data-animation=fade][data-state=hidden]{opacity:0;-webkit-transform:translateX(-10px);transform:translateX(-10px)}.tippy-popper[x-placement^=left] [data-animation=shift-away][data-state=visible]{-webkit-transform:translateX(-10px);transform:translateX(-10px)}.tippy-popper[x-placement^=left] [data-animation=shift-away][data-state=hidden]{opacity:0;-webkit-transform:translateX(0);transform:translateX(0)}.tippy-popper[x-placement^=left] [data-animation=scale]{-webkit-transform-origin:right;transform-origin:right}.tippy-popper[x-placement^=left] [data-animation=scale][data-state=visible]{-webkit-transform:translateX(-10px) scale(1);transform:translateX(-10px) scale(1)}.tippy-popper[x-placement^=left] [data-animation=scale][data-state=hidden]{opacity:0;-webkit-transform:translateX(-10px) scale(.5);transform:translateX(-10px) scale(.5)}.tippy-popper[x-placement^=right] .tippy-backdrop{border-radius:0 50% 50% 0}.tippy-popper[x-placement^=right] .tippy-roundarrow{left:-12px;-webkit-transform-origin:66.66666666% 50%;transform-origin:66.66666666% 50%;margin:3px 0}.tippy-popper[x-placement^=right] .tippy-roundarrow svg{position:absolute;left:0;-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.tippy-popper[x-placement^=right] .tippy-arrow{border-right:8px solid #333;border-top:8px solid transparent;border-bottom:8px solid transparent;left:-7px;margin:3px 0;-webkit-transform-origin:100% 50%;transform-origin:100% 50%}.tippy-popper[x-placement^=right] .tippy-backdrop{-webkit-transform-origin:-50% 0;transform-origin:-50% 0}.tippy-popper[x-placement^=right] .tippy-backdrop[data-state=visible]{-webkit-transform:scale(1) translate(-50%,-50%);transform:scale(1) translate(-50%,-50%)}.tippy-popper[x-placement^=right] .tippy-backdrop[data-state=hidden]{-webkit-transform:scale(.2) translate(-25%,-50%);transform:scale(.2) translate(-25%,-50%);opacity:0}.tippy-popper[x-placement^=right] [data-animation=shift-toward][data-state=visible]{-webkit-transform:translateX(10px);transform:translateX(10px)}.tippy-popper[x-placement^=right] [data-animation=shift-toward][data-state=hidden]{opacity:0;-webkit-transform:translateX(20px);transform:translateX(20px)}.tippy-popper[x-placement^=right] [data-animation=perspective]{-webkit-transform-origin:left;transform-origin:left}.tippy-popper[x-placement^=right] [data-animation=perspective][data-state=visible]{-webkit-transform:perspective(700px) translateX(10px) rotateY(0);transform:perspective(700px) translateX(10px) rotateY(0)}.tippy-popper[x-placement^=right] [data-animation=perspective][data-state=hidden]{opacity:0;-webkit-transform:perspective(700px) translateX(0) rotateY(60deg);transform:perspective(700px) translateX(0) rotateY(60deg)}.tippy-popper[x-placement^=right] [data-animation=fade][data-state=visible]{-webkit-transform:translateX(10px);transform:translateX(10px)}.tippy-popper[x-placement^=right] [data-animation=fade][data-state=hidden]{opacity:0;-webkit-transform:translateX(10px);transform:translateX(10px)}.tippy-popper[x-placement^=right] [data-animation=shift-away][data-state=visible]{-webkit-transform:translateX(10px);transform:translateX(10px)}.tippy-popper[x-placement^=right] [data-animation=shift-away][data-state=hidden]{opacity:0;-webkit-transform:translateX(0);transform:translateX(0)}.tippy-popper[x-placement^=right] [data-animation=scale]{-webkit-transform-origin:left;transform-origin:left}.tippy-popper[x-placement^=right] [data-animation=scale][data-state=visible]{-webkit-transform:translateX(10px) scale(1);transform:translateX(10px) scale(1)}.tippy-popper[x-placement^=right] [data-animation=scale][data-state=hidden]{opacity:0;-webkit-transform:translateX(10px) scale(.5);transform:translateX(10px) scale(.5)}.tippy-tooltip{position:relative;color:#fff;border-radius:.25rem;font-size:.875rem;padding:.3125rem .5625rem;line-height:1.4;text-align:center;background-color:#333}.tippy-tooltip[data-size=small]{padding:.1875rem .375rem;font-size:.75rem}.tippy-tooltip[data-size=large]{padding:.375rem .75rem;font-size:1rem}.tippy-tooltip[data-animatefill]{overflow:hidden;background-color:transparent}.tippy-tooltip[data-interactive],.tippy-tooltip[data-interactive] .tippy-roundarrow path{pointer-events:auto}.tippy-tooltip[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-tooltip[data-inertia][data-state=hidden]{transition-timing-function:ease}.tippy-arrow,.tippy-roundarrow{position:absolute;width:0;height:0}.tippy-roundarrow{width:18px;height:7px;fill:#333;pointer-events:none}.tippy-backdrop{position:absolute;background-color:#333;border-radius:50%;width:calc(110% + 2rem);left:50%;top:50%;z-index:-1;transition:all cubic-bezier(.46,.1,.52,.98);-webkit-backface-visibility:hidden;backface-visibility:hidden}.tippy-backdrop:after{content:\"\";float:left;padding-top:100%}.tippy-backdrop+.tippy-content{transition-property:opacity;will-change:opacity}.tippy-backdrop+.tippy-content[data-state=visible]{opacity:1}.tippy-backdrop+.tippy-content[data-state=hidden]{opacity:0}";
-
- function _extends() {
- _extends = Object.assign || function (target) {
- for (var i = 1; i < arguments.length; i++) {
- var source = arguments[i];
-
- for (var key in source) {
- if (Object.prototype.hasOwnProperty.call(source, key)) {
- target[key] = source[key];
- }
- }
- }
-
- return target;
- };
-
- return _extends.apply(this, arguments);
- }
-
- var version = "4.3.4";
-
- var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';
- var ua = isBrowser ? navigator.userAgent : '';
- var isIE = /MSIE |Trident\//.test(ua);
- var isUCBrowser = /UCBrowser\//.test(ua);
- var isIOS = isBrowser && /iPhone|iPad|iPod/.test(navigator.platform) && !window.MSStream;
-
- var defaultProps = {
- a11y: true,
- allowHTML: true,
- animateFill: true,
- animation: 'shift-away',
- appendTo: function appendTo() {
- return document.body;
- },
- aria: 'describedby',
- arrow: false,
- arrowType: 'sharp',
- boundary: 'scrollParent',
- content: '',
- delay: 0,
- distance: 10,
- duration: [325, 275],
- flip: true,
- flipBehavior: 'flip',
- flipOnUpdate: false,
- followCursor: false,
- hideOnClick: true,
- ignoreAttributes: false,
- inertia: false,
- interactive: false,
- interactiveBorder: 2,
- interactiveDebounce: 0,
- lazy: true,
- maxWidth: 350,
- multiple: false,
- offset: 0,
- onHidden: function onHidden() {},
- onHide: function onHide() {},
- onMount: function onMount() {},
- onShow: function onShow() {},
- onShown: function onShown() {},
- onTrigger: function onTrigger() {},
- placement: 'top',
- popperOptions: {},
- role: 'tooltip',
- showOnInit: false,
- size: 'regular',
- sticky: false,
- target: '',
- theme: 'dark',
- touch: true,
- touchHold: false,
- trigger: 'mouseenter focus',
- triggerTarget: null,
- updateDuration: 0,
- wait: null,
- zIndex: 9999
- /**
- * If the set() method encounters one of these, the popperInstance must be
- * recreated
- */
-
- };
- var POPPER_INSTANCE_DEPENDENCIES = ['arrow', 'arrowType', 'boundary', 'distance', 'flip', 'flipBehavior', 'flipOnUpdate', 'offset', 'placement', 'popperOptions'];
-
- var elementProto = isBrowser ? Element.prototype : {};
- var matches = elementProto.matches || elementProto.matchesSelector || elementProto.webkitMatchesSelector || elementProto.mozMatchesSelector || elementProto.msMatchesSelector;
- /**
- * Ponyfill for Array.from - converts iterable values to an array
- */
-
- function arrayFrom(value) {
- return [].slice.call(value);
- }
- /**
- * Ponyfill for Element.prototype.closest
- */
-
- function closest(element, selector) {
- return closestCallback(element, function (el) {
- return matches.call(el, selector);
- });
- }
- /**
- * Works like Element.prototype.closest, but uses a callback instead
- */
-
- function closestCallback(element, callback) {
- while (element) {
- if (callback(element)) {
- return element;
- }
-
- element = element.parentElement;
- }
-
- return null;
- }
-
- // Passive event listener config
- var PASSIVE = {
- passive: true // Popper `preventOverflow` padding
-
- };
- var PADDING = 4; // Popper attributes
- // In Popper v2 these will be `data-*` instead of `x-*` to adhere to HTML5 spec
-
- var PLACEMENT_ATTRIBUTE = 'x-placement';
- var OUT_OF_BOUNDARIES_ATTRIBUTE = 'x-out-of-boundaries'; // Classes
-
- var IOS_CLASS = "tippy-iOS";
- var ACTIVE_CLASS = "tippy-active";
- var POPPER_CLASS = "tippy-popper";
- var TOOLTIP_CLASS = "tippy-tooltip";
- var CONTENT_CLASS = "tippy-content";
- var BACKDROP_CLASS = "tippy-backdrop";
- var ARROW_CLASS = "tippy-arrow";
- var ROUND_ARROW_CLASS = "tippy-roundarrow"; // Selectors
-
- var POPPER_SELECTOR = ".".concat(POPPER_CLASS);
- var TOOLTIP_SELECTOR = ".".concat(TOOLTIP_CLASS);
- var CONTENT_SELECTOR = ".".concat(CONTENT_CLASS);
- var BACKDROP_SELECTOR = ".".concat(BACKDROP_CLASS);
- var ARROW_SELECTOR = ".".concat(ARROW_CLASS);
- var ROUND_ARROW_SELECTOR = ".".concat(ROUND_ARROW_CLASS);
-
- var isUsingTouch = false;
- function onDocumentTouch() {
- if (isUsingTouch) {
- return;
- }
-
- isUsingTouch = true;
-
- if (isIOS) {
- document.body.classList.add(IOS_CLASS);
- }
-
- if (window.performance) {
- document.addEventListener('mousemove', onDocumentMouseMove);
- }
- }
- var lastMouseMoveTime = 0;
- function onDocumentMouseMove() {
- var now = performance.now(); // Chrome 60+ is 1 mousemove per animation frame, use 20ms time difference
-
- if (now - lastMouseMoveTime < 20) {
- isUsingTouch = false;
- document.removeEventListener('mousemove', onDocumentMouseMove);
-
- if (!isIOS) {
- document.body.classList.remove(IOS_CLASS);
- }
- }
-
- lastMouseMoveTime = now;
- }
- function onWindowBlur() {
- var _document = document,
- activeElement = _document.activeElement;
-
- if (activeElement && activeElement.blur && activeElement._tippy) {
- activeElement.blur();
- }
- }
- /**
- * Adds the needed global event listeners
- */
-
- function bindGlobalEventListeners() {
- document.addEventListener('touchstart', onDocumentTouch, PASSIVE);
- window.addEventListener('blur', onWindowBlur);
- }
-
- var keys = Object.keys(defaultProps);
- /**
- * Returns an object of optional props from data-tippy-* attributes
- */
-
- function getDataAttributeOptions(reference) {
- return keys.reduce(function (acc, key) {
- var valueAsString = (reference.getAttribute("data-tippy-".concat(key)) || '').trim();
-
- if (!valueAsString) {
- return acc;
- }
-
- if (key === 'content') {
- acc[key] = valueAsString;
- } else {
- try {
- acc[key] = JSON.parse(valueAsString);
- } catch (e) {
- acc[key] = valueAsString;
- }
- }
-
- return acc;
- }, {});
- }
- /**
- * Polyfills the virtual reference (plain object) with Element.prototype props
- * Mutating because DOM elements are mutated, adds `_tippy` property
- */
-
- function polyfillElementPrototypeProperties(virtualReference) {
- var polyfills = {
- isVirtual: true,
- attributes: virtualReference.attributes || {},
- contains: function contains() {},
- setAttribute: function setAttribute(key, value) {
- virtualReference.attributes[key] = value;
- },
- getAttribute: function getAttribute(key) {
- return virtualReference.attributes[key];
- },
- removeAttribute: function removeAttribute(key) {
- delete virtualReference.attributes[key];
- },
- hasAttribute: function hasAttribute(key) {
- return key in virtualReference.attributes;
- },
- addEventListener: function addEventListener() {},
- removeEventListener: function removeEventListener() {},
- classList: {
- classNames: {},
- add: function add(key) {
- virtualReference.classList.classNames[key] = true;
- },
- remove: function remove(key) {
- delete virtualReference.classList.classNames[key];
- },
- contains: function contains(key) {
- return key in virtualReference.classList.classNames;
- }
- }
- };
-
- for (var key in polyfills) {
- virtualReference[key] = polyfills[key];
- }
- }
-
- /**
- * Determines if a value is a "bare" virtual element (before mutations done
- * by `polyfillElementPrototypeProperties()`). JSDOM elements show up as
- * [object Object], we can check if the value is "element-like" if it has
- * `addEventListener`
- */
-
- function isBareVirtualElement(value) {
- return {}.toString.call(value) === '[object Object]' && !value.addEventListener;
- }
- /**
- * Determines if the value is a reference element
- */
-
- function isReferenceElement(value) {
- return !!value._tippy && !matches.call(value, POPPER_SELECTOR);
- }
- /**
- * Safe .hasOwnProperty check, for prototype-less objects
- */
-
- function hasOwnProperty(obj, key) {
- return {}.hasOwnProperty.call(obj, key);
- }
- /**
- * Returns an array of elements based on the value
- */
-
- function getArrayOfElements(value) {
- if (isSingular(value)) {
- // TODO: VirtualReference is not compatible to type Element
- return [value];
- }
-
- if (value instanceof NodeList) {
- return arrayFrom(value);
- }
-
- if (Array.isArray(value)) {
- return value;
- }
-
- try {
- return arrayFrom(document.querySelectorAll(value));
- } catch (e) {
- return [];
- }
- }
- /**
- * Returns a value at a given index depending on if it's an array or number
- */
-
- function getValue(value, index, defaultValue) {
- if (Array.isArray(value)) {
- var v = value[index];
- return v == null ? defaultValue : v;
- }
-
- return value;
- }
- /**
- * Debounce utility. To avoid bloating bundle size, we're only passing 1
- * argument here, a more generic function would pass all arguments. Only
- * `onMouseMove` uses this which takes the event object for now.
- */
-
- function debounce(fn, ms) {
- // Avoid wrapping in `setTimeout` if ms is 0 anyway
- if (ms === 0) {
- return fn;
- }
-
- var timeout;
- return function (arg) {
- clearTimeout(timeout);
- timeout = setTimeout(function () {
- fn(arg);
- }, ms);
- };
- }
- /**
- * Prevents errors from being thrown while accessing nested modifier objects
- * in `popperOptions`
- */
-
- function getModifier(obj, key) {
- return obj && obj.modifiers && obj.modifiers[key];
- }
- /**
- * Determines if an array or string includes a value
- */
-
- function includes(a, b) {
- return a.indexOf(b) > -1;
- }
- /**
- * Determines if the value is a real element
- */
-
- function isRealElement(value) {
- return value instanceof Element;
- }
- /**
- * Determines if the value is singular-like
- */
-
- function isSingular(value) {
- return !!(value && hasOwnProperty(value, 'isVirtual')) || isRealElement(value);
- }
- /**
- * Firefox extensions don't allow setting .innerHTML directly, this will trick it
- */
-
- function innerHTML() {
- return 'innerHTML';
- }
- /**
- * Evaluates a function if one, or returns the value
- */
-
- function invokeWithArgsOrReturn(value, args) {
- return typeof value === 'function' ? value.apply(null, args) : value;
- }
- /**
- * Sets a popperInstance `flip` modifier's enabled state
- */
-
- function setFlipModifierEnabled(modifiers, value) {
- modifiers.filter(function (m) {
- return m.name === 'flip';
- })[0].enabled = value;
- }
- /**
- * Determines if an element can receive focus
- * Always returns true for virtual objects
- */
-
- function canReceiveFocus(element) {
- return isRealElement(element) ? matches.call(element, 'a[href],area[href],button,details,input,textarea,select,iframe,[tabindex]') && !element.hasAttribute('disabled') : true;
- }
- /**
- * Returns a new `div` element
- */
-
- function div() {
- return document.createElement('div');
- }
- /**
- * Applies a transition duration to a list of elements
- */
-
- function setTransitionDuration(els, value) {
- els.forEach(function (el) {
- if (el) {
- el.style.transitionDuration = "".concat(value, "ms");
- }
- });
- }
- /**
- * Sets the visibility state to elements so they can begin to transition
- */
-
- function setVisibilityState(els, state) {
- els.forEach(function (el) {
- if (el) {
- el.setAttribute('data-state', state);
- }
- });
- }
- /**
- * Evaluates the props object by merging data attributes and
- * disabling conflicting options where necessary
- */
-
- function evaluateProps(reference, props) {
- var out = _extends({}, props, {
- content: invokeWithArgsOrReturn(props.content, [reference])
- }, props.ignoreAttributes ? {} : getDataAttributeOptions(reference));
-
- if (out.arrow || isUCBrowser) {
- out.animateFill = false;
- }
-
- return out;
- }
- /**
- * Validates an object of options with the valid default props object
- */
-
- function validateOptions(options, defaultProps) {
- Object.keys(options).forEach(function (option) {
- if (!hasOwnProperty(defaultProps, option)) {
- throw new Error("[tippy]: `".concat(option, "` is not a valid option"));
- }
- });
- }
-
- /**
- * Sets the innerHTML of an element
- */
-
- function setInnerHTML(element, html) {
- element[innerHTML()] = isRealElement(html) ? html[innerHTML()] : html;
- }
- /**
- * Sets the content of a tooltip
- */
-
- function setContent(contentEl, props) {
- if (isRealElement(props.content)) {
- setInnerHTML(contentEl, '');
- contentEl.appendChild(props.content);
- } else if (typeof props.content !== 'function') {
- var key = props.allowHTML ? 'innerHTML' : 'textContent';
- contentEl[key] = props.content;
- }
- }
- /**
- * Returns the child elements of a popper element
- */
-
- function getChildren(popper) {
- return {
- tooltip: popper.querySelector(TOOLTIP_SELECTOR),
- backdrop: popper.querySelector(BACKDROP_SELECTOR),
- content: popper.querySelector(CONTENT_SELECTOR),
- arrow: popper.querySelector(ARROW_SELECTOR) || popper.querySelector(ROUND_ARROW_SELECTOR)
- };
- }
- /**
- * Adds `data-inertia` attribute
- */
-
- function addInertia(tooltip) {
- tooltip.setAttribute('data-inertia', '');
- }
- /**
- * Removes `data-inertia` attribute
- */
-
- function removeInertia(tooltip) {
- tooltip.removeAttribute('data-inertia');
- }
- /**
- * Creates an arrow element and returns it
- */
-
- function createArrowElement(arrowType) {
- var arrow = div();
-
- if (arrowType === 'round') {
- arrow.className = ROUND_ARROW_CLASS;
- setInnerHTML(arrow, '<svg viewBox="0 0 18 7" xmlns="http://www.w3.org/2000/svg"><path d="M0 7s2.021-.015 5.253-4.218C6.584 1.051 7.797.007 9 0c1.203-.007 2.416 1.035 3.761 2.782C16.012 7.005 18 7 18 7H0z"/></svg>');
- } else {
- arrow.className = ARROW_CLASS;
- }
-
- return arrow;
- }
- /**
- * Creates a backdrop element and returns it
- */
-
- function createBackdropElement() {
- var backdrop = div();
- backdrop.className = BACKDROP_CLASS;
- backdrop.setAttribute('data-state', 'hidden');
- return backdrop;
- }
- /**
- * Adds interactive-related attributes
- */
-
- function addInteractive(popper, tooltip) {
- popper.setAttribute('tabindex', '-1');
- tooltip.setAttribute('data-interactive', '');
- }
- /**
- * Removes interactive-related attributes
- */
-
- function removeInteractive(popper, tooltip) {
- popper.removeAttribute('tabindex');
- tooltip.removeAttribute('data-interactive');
- }
- /**
- * Add/remove transitionend listener from tooltip
- */
-
- function updateTransitionEndListener(tooltip, action, listener) {
- // UC Browser hasn't adopted the `transitionend` event despite supporting
- // unprefixed transitions...
- var eventName = isUCBrowser && document.body.style.webkitTransition !== undefined ? 'webkitTransitionEnd' : 'transitionend';
- tooltip[action + 'EventListener'](eventName, listener);
- }
- /**
- * Returns the popper's placement, ignoring shifting (top-start, etc)
- */
-
- function getBasicPlacement(popper) {
- var fullPlacement = popper.getAttribute(PLACEMENT_ATTRIBUTE);
- return fullPlacement ? fullPlacement.split('-')[0] : '';
- }
- /**
- * Triggers reflow
- */
-
- function reflow(popper) {
- void popper.offsetHeight;
- }
- /**
- * Adds/removes theme from tooltip's classList
- */
-
- function updateTheme(tooltip, action, theme) {
- theme.split(' ').forEach(function (themeName) {
- tooltip.classList[action](themeName + '-theme');
- });
- }
- /**
- * Constructs the popper element and returns it
- */
-
- function createPopperElement(id, props) {
- var popper = div();
- popper.className = POPPER_CLASS;
- popper.id = "tippy-".concat(id);
- popper.style.zIndex = '' + props.zIndex;
- popper.style.position = 'absolute';
- popper.style.top = '0';
- popper.style.left = '0';
-
- if (props.role) {
- popper.setAttribute('role', props.role);
- }
-
- var tooltip = div();
- tooltip.className = TOOLTIP_CLASS;
- tooltip.style.maxWidth = props.maxWidth + (typeof props.maxWidth === 'number' ? 'px' : '');
- tooltip.setAttribute('data-size', props.size);
- tooltip.setAttribute('data-animation', props.animation);
- tooltip.setAttribute('data-state', 'hidden');
- updateTheme(tooltip, 'add', props.theme);
- var content = div();
- content.className = CONTENT_CLASS;
- content.setAttribute('data-state', 'hidden');
-
- if (props.interactive) {
- addInteractive(popper, tooltip);
- }
-
- if (props.arrow) {
- tooltip.appendChild(createArrowElement(props.arrowType));
- }
-
- if (props.animateFill) {
- tooltip.appendChild(createBackdropElement());
- tooltip.setAttribute('data-animatefill', '');
- }
-
- if (props.inertia) {
- addInertia(tooltip);
- }
-
- setContent(content, props);
- tooltip.appendChild(content);
- popper.appendChild(tooltip);
- return popper;
- }
- /**
- * Updates the popper element based on the new props
- */
-
- function updatePopperElement(popper, prevProps, nextProps) {
- var _getChildren = getChildren(popper),
- tooltip = _getChildren.tooltip,
- content = _getChildren.content,
- backdrop = _getChildren.backdrop,
- arrow = _getChildren.arrow;
-
- popper.style.zIndex = '' + nextProps.zIndex;
- tooltip.setAttribute('data-size', nextProps.size);
- tooltip.setAttribute('data-animation', nextProps.animation);
- tooltip.style.maxWidth = nextProps.maxWidth + (typeof nextProps.maxWidth === 'number' ? 'px' : '');
-
- if (nextProps.role) {
- popper.setAttribute('role', nextProps.role);
- } else {
- popper.removeAttribute('role');
- }
-
- if (prevProps.content !== nextProps.content) {
- setContent(content, nextProps);
- } // animateFill
-
-
- if (!prevProps.animateFill && nextProps.animateFill) {
- tooltip.appendChild(createBackdropElement());
- tooltip.setAttribute('data-animatefill', '');
- } else if (prevProps.animateFill && !nextProps.animateFill) {
- tooltip.removeChild(backdrop);
- tooltip.removeAttribute('data-animatefill');
- } // arrow
-
-
- if (!prevProps.arrow && nextProps.arrow) {
- tooltip.appendChild(createArrowElement(nextProps.arrowType));
- } else if (prevProps.arrow && !nextProps.arrow) {
- tooltip.removeChild(arrow);
- } // arrowType
-
-
- if (prevProps.arrow && nextProps.arrow && prevProps.arrowType !== nextProps.arrowType) {
- tooltip.replaceChild(createArrowElement(nextProps.arrowType), arrow);
- } // interactive
-
-
- if (!prevProps.interactive && nextProps.interactive) {
- addInteractive(popper, tooltip);
- } else if (prevProps.interactive && !nextProps.interactive) {
- removeInteractive(popper, tooltip);
- } // inertia
-
-
- if (!prevProps.inertia && nextProps.inertia) {
- addInertia(tooltip);
- } else if (prevProps.inertia && !nextProps.inertia) {
- removeInertia(tooltip);
- } // theme
-
-
- if (prevProps.theme !== nextProps.theme) {
- updateTheme(tooltip, 'remove', prevProps.theme);
- updateTheme(tooltip, 'add', nextProps.theme);
- }
- }
- /**
- * Hides all visible poppers on the document
- */
-
- function hideAll() {
- var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
- excludedReferenceOrInstance = _ref.exclude,
- duration = _ref.duration;
-
- arrayFrom(document.querySelectorAll(POPPER_SELECTOR)).forEach(function (popper) {
- var instance = popper._tippy;
-
- if (instance) {
- var isExcluded = false;
-
- if (excludedReferenceOrInstance) {
- isExcluded = isReferenceElement(excludedReferenceOrInstance) ? instance.reference === excludedReferenceOrInstance : popper === excludedReferenceOrInstance.popper;
- }
-
- if (!isExcluded) {
- instance.hide(duration);
- }
- }
- });
- }
- /**
- * Determines if the mouse cursor is outside of the popper's interactive border
- * region
- */
-
- function isCursorOutsideInteractiveBorder(popperPlacement, popperRect, event, props) {
- if (!popperPlacement) {
- return true;
- }
-
- var x = event.clientX,
- y = event.clientY;
- var interactiveBorder = props.interactiveBorder,
- distance = props.distance;
- var exceedsTop = popperRect.top - y > (popperPlacement === 'top' ? interactiveBorder + distance : interactiveBorder);
- var exceedsBottom = y - popperRect.bottom > (popperPlacement === 'bottom' ? interactiveBorder + distance : interactiveBorder);
- var exceedsLeft = popperRect.left - x > (popperPlacement === 'left' ? interactiveBorder + distance : interactiveBorder);
- var exceedsRight = x - popperRect.right > (popperPlacement === 'right' ? interactiveBorder + distance : interactiveBorder);
- return exceedsTop || exceedsBottom || exceedsLeft || exceedsRight;
- }
- /**
- * Returns the distance offset, taking into account the default offset due to
- * the transform: translate() rule (10px) in CSS
- */
-
- function getOffsetDistanceInPx(distance) {
- return -(distance - 10) + 'px';
- }
-
- var idCounter = 1; // Workaround for IE11's lack of new MouseEvent constructor
-
- var mouseMoveListeners = [];
- /**
- * Creates and returns a Tippy object. We're using a closure pattern instead of
- * a class so that the exposed object API is clean without private members
- * prefixed with `_`.
- */
-
- function createTippy(reference, collectionProps) {
- var props = evaluateProps(reference, collectionProps); // If the reference shouldn't have multiple tippys, return null early
-
- if (!props.multiple && reference._tippy) {
- return null;
- }
- /* ======================= 🔒 Private members 🔒 ======================= */
-
-
- var lastTriggerEventType;
- var lastMouseMoveEvent;
- var showTimeoutId;
- var hideTimeoutId;
- var scheduleHideAnimationFrameId;
- var isScheduledToShow = false;
- var isBeingDestroyed = false;
- var previousPlacement;
- var wasVisibleDuringPreviousUpdate = false;
- var hasMountCallbackRun = false;
- var currentMountCallback;
- var currentTransitionEndListener;
- var listeners = [];
- var currentComputedPadding;
- var debouncedOnMouseMove = debounce(onMouseMove, props.interactiveDebounce);
- /* ======================= 🔑 Public members 🔑 ======================= */
-
- var id = idCounter++;
- var popper = createPopperElement(id, props);
- var popperChildren = getChildren(popper);
- var popperInstance = null;
- var state = {
- // Is the instance currently enabled?
- isEnabled: true,
- // Is the tippy currently showing and not transitioning out?
- isVisible: false,
- // Has the instance been destroyed?
- isDestroyed: false,
- // Is the tippy currently mounted to the DOM?
- isMounted: false,
- // Has the tippy finished transitioning in?
- isShown: false
- };
- var instance = {
- // properties
- id: id,
- reference: reference,
- popper: popper,
- popperChildren: popperChildren,
- popperInstance: popperInstance,
- props: props,
- state: state,
- // methods
- clearDelayTimeouts: clearDelayTimeouts,
- set: set,
- setContent: setContent,
- show: show,
- hide: hide,
- enable: enable,
- disable: disable,
- destroy: destroy
- /* ==================== Initial instance mutations =================== */
-
- };
- reference._tippy = instance;
- popper._tippy = instance;
- addTriggersToReference();
-
- if (!props.lazy) {
- createPopperInstance();
- }
-
- if (props.showOnInit) {
- scheduleShow();
- } // Ensure the event listeners target can receive focus
-
-
- if (props.a11y && !props.target && !canReceiveFocus(getEventListenersTarget())) {
- getEventListenersTarget().setAttribute('tabindex', '0');
- } // Prevent a tippy with a delay from hiding if the cursor left then returned
- // before it started hiding
-
-
- popper.addEventListener('mouseenter', function (event) {
- if (instance.props.interactive && instance.state.isVisible && lastTriggerEventType === 'mouseenter') {
- // We don't want props.onTrigger() to be called here, since the `event`
- // object is not related to the reference element
- scheduleShow(event, true);
- }
- });
- popper.addEventListener('mouseleave', function () {
- if (instance.props.interactive && lastTriggerEventType === 'mouseenter') {
- document.addEventListener('mousemove', debouncedOnMouseMove);
- }
- });
- return instance;
- /* ======================= 🔒 Private methods 🔒 ======================= */
-
- /**
- * Removes the follow cursor listener
- */
-
- function removeFollowCursorListener() {
- document.removeEventListener('mousemove', positionVirtualReferenceNearCursor);
- }
- /**
- * Cleans up interactive mouse listeners
- */
-
-
- function cleanupInteractiveMouseListeners() {
- document.body.removeEventListener('mouseleave', scheduleHide);
- document.removeEventListener('mousemove', debouncedOnMouseMove);
- mouseMoveListeners = mouseMoveListeners.filter(function (listener) {
- return listener !== debouncedOnMouseMove;
- });
- }
- /**
- * Returns correct target used for event listeners
- */
-
-
- function getEventListenersTarget() {
- return instance.props.triggerTarget || reference;
- }
- /**
- * Adds the document click event listener for the instance
- */
-
-
- function addDocumentClickListener() {
- document.addEventListener('click', onDocumentClick, true);
- }
- /**
- * Removes the document click event listener for the instance
- */
-
-
- function removeDocumentClickListener() {
- document.removeEventListener('click', onDocumentClick, true);
- }
- /**
- * Returns transitionable inner elements used in show/hide methods
- */
-
-
- function getTransitionableElements() {
- return [instance.popperChildren.tooltip, instance.popperChildren.backdrop, instance.popperChildren.content];
- }
- /**
- * Determines if the instance is in `followCursor` mode.
- * NOTE: in v5, touch devices will use `initial` behavior no matter the value.
- */
-
-
- function getIsInLooseFollowCursorMode() {
- var followCursor = instance.props.followCursor;
- return followCursor && lastTriggerEventType !== 'focus' || isUsingTouch && followCursor === 'initial';
- }
- /**
- * Updates the tooltip's position on each animation frame
- */
-
-
- function makeSticky() {
- setTransitionDuration([popper], isIE ? 0 : instance.props.updateDuration);
-
- function updatePosition() {
- instance.popperInstance.scheduleUpdate();
-
- if (instance.state.isMounted) {
- requestAnimationFrame(updatePosition);
- } else {
- setTransitionDuration([popper], 0);
- }
- }
-
- updatePosition();
- }
- /**
- * Invokes a callback once the tooltip has fully transitioned out
- */
-
-
- function onTransitionedOut(duration, callback) {
- onTransitionEnd(duration, function () {
- if (!instance.state.isVisible && popper.parentNode && popper.parentNode.contains(popper)) {
- callback();
- }
- });
- }
- /**
- * Invokes a callback once the tooltip has fully transitioned in
- */
-
-
- function onTransitionedIn(duration, callback) {
- onTransitionEnd(duration, callback);
- }
- /**
- * Invokes a callback once the tooltip's CSS transition ends
- */
-
-
- function onTransitionEnd(duration, callback) {
- var tooltip = instance.popperChildren.tooltip;
- /**
- * Listener added as the `transitionend` handler
- */
-
- function listener(event) {
- if (event.target === tooltip) {
- updateTransitionEndListener(tooltip, 'remove', listener);
- callback();
- }
- } // Make callback synchronous if duration is 0
- // `transitionend` won't fire otherwise
-
-
- if (duration === 0) {
- return callback();
- }
-
- updateTransitionEndListener(tooltip, 'remove', currentTransitionEndListener);
- updateTransitionEndListener(tooltip, 'add', listener);
- currentTransitionEndListener = listener;
- }
- /**
- * Adds an event listener to the reference and stores it in `listeners`
- */
-
-
- function on(eventType, handler) {
- var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
- getEventListenersTarget().addEventListener(eventType, handler, options);
- listeners.push({
- eventType: eventType,
- handler: handler,
- options: options
- });
- }
- /**
- * Adds event listeners to the reference based on the `trigger` prop
- */
-
-
- function addTriggersToReference() {
- if (instance.props.touchHold && !instance.props.target) {
- on('touchstart', onTrigger, PASSIVE);
- on('touchend', onMouseLeave, PASSIVE);
- }
-
- instance.props.trigger.trim().split(' ').forEach(function (eventType) {
- if (eventType === 'manual') {
- return;
- } // Non-delegates
-
-
- if (!instance.props.target) {
- on(eventType, onTrigger);
-
- switch (eventType) {
- case 'mouseenter':
- on('mouseleave', onMouseLeave);
- break;
-
- case 'focus':
- on(isIE ? 'focusout' : 'blur', onBlur);
- break;
- }
- } else {
- // Delegates
- switch (eventType) {
- case 'mouseenter':
- on('mouseover', onDelegateShow);
- on('mouseout', onDelegateHide);
- break;
-
- case 'focus':
- on('focusin', onDelegateShow);
- on('focusout', onDelegateHide);
- break;
-
- case 'click':
- on(eventType, onDelegateShow);
- break;
- }
- }
- });
- }
- /**
- * Removes event listeners from the reference
- */
-
-
- function removeTriggersFromReference() {
- listeners.forEach(function (_ref) {
- var eventType = _ref.eventType,
- handler = _ref.handler,
- options = _ref.options;
- getEventListenersTarget().removeEventListener(eventType, handler, options);
- });
- listeners = [];
- }
- /**
- * Positions the virtual reference near the cursor
- */
-
-
- function positionVirtualReferenceNearCursor(event) {
- var _lastMouseMoveEvent = lastMouseMoveEvent = event,
- x = _lastMouseMoveEvent.clientX,
- y = _lastMouseMoveEvent.clientY; // Gets set once popperInstance `onCreate` has been called
-
-
- if (!currentComputedPadding) {
- return;
- } // If the instance is interactive, avoid updating the position unless it's
- // over the reference element
-
-
- var isCursorOverReference = closestCallback(event.target, function (el) {
- return el === reference;
- });
- var rect = reference.getBoundingClientRect();
- var followCursor = instance.props.followCursor;
- var isHorizontal = followCursor === 'horizontal';
- var isVertical = followCursor === 'vertical'; // The virtual reference needs some size to prevent itself from overflowing
-
- var isVerticalPlacement = includes(['top', 'bottom'], getBasicPlacement(popper));
- var fullPlacement = popper.getAttribute(PLACEMENT_ATTRIBUTE);
- var isVariation = fullPlacement ? !!fullPlacement.split('-')[1] : false;
- var size = isVerticalPlacement ? popper.offsetWidth : popper.offsetHeight;
- var halfSize = size / 2;
- var verticalIncrease = isVerticalPlacement ? 0 : isVariation ? size : halfSize;
- var horizontalIncrease = isVerticalPlacement ? isVariation ? size : halfSize : 0;
-
- if (isCursorOverReference || !instance.props.interactive) {
- instance.popperInstance.reference = _extends({}, instance.popperInstance.reference, {
- // These `client` values don't get used by Popper.js if they are 0
- clientWidth: 0,
- clientHeight: 0,
- getBoundingClientRect: function getBoundingClientRect() {
- return {
- width: isVerticalPlacement ? size : 0,
- height: isVerticalPlacement ? 0 : size,
- top: (isHorizontal ? rect.top : y) - verticalIncrease,
- bottom: (isHorizontal ? rect.bottom : y) + verticalIncrease,
- left: (isVertical ? rect.left : x) - horizontalIncrease,
- right: (isVertical ? rect.right : x) + horizontalIncrease
- };
- }
- });
- instance.popperInstance.update();
- }
-
- if (followCursor === 'initial' && instance.state.isVisible) {
- removeFollowCursorListener();
- }
- }
- /**
- * Creates the tippy instance for a delegate when it's been triggered
- */
-
-
- function createDelegateChildTippy(event) {
- if (event) {
- var targetEl = closest(event.target, instance.props.target);
-
- if (targetEl && !targetEl._tippy) {
- createTippy(targetEl, _extends({}, instance.props, {
- content: invokeWithArgsOrReturn(collectionProps.content, [targetEl]),
- appendTo: collectionProps.appendTo,
- target: '',
- showOnInit: true
- }));
- }
- }
- }
- /**
- * Event listener invoked upon trigger
- */
-
-
- function onTrigger(event) {
- if (!instance.state.isEnabled || isEventListenerStopped(event)) {
- return;
- }
-
- if (!instance.state.isVisible) {
- lastTriggerEventType = event.type;
-
- if (event instanceof MouseEvent) {
- lastMouseMoveEvent = event; // If scrolling, `mouseenter` events can be fired if the cursor lands
- // over a new target, but `mousemove` events don't get fired. This
- // causes interactive tooltips to get stuck open until the cursor is
- // moved
-
- mouseMoveListeners.forEach(function (listener) {
- return listener(event);
- });
- }
- } // Toggle show/hide when clicking click-triggered tooltips
-
-
- if (event.type === 'click' && instance.props.hideOnClick !== false && instance.state.isVisible) {
- scheduleHide();
- } else {
- scheduleShow(event);
- }
- }
- /**
- * Event listener used for interactive tooltips to detect when they should
- * hide
- */
-
-
- function onMouseMove(event) {
- var isCursorOverPopper = closest(event.target, POPPER_SELECTOR) === popper;
- var isCursorOverReference = closestCallback(event.target, function (el) {
- return el === reference;
- });
-
- if (isCursorOverPopper || isCursorOverReference) {
- return;
- }
-
- if (isCursorOutsideInteractiveBorder(getBasicPlacement(popper), popper.getBoundingClientRect(), event, instance.props)) {
- cleanupInteractiveMouseListeners();
- scheduleHide();
- }
- }
- /**
- * Event listener invoked upon mouseleave
- */
-
-
- function onMouseLeave(event) {
- if (isEventListenerStopped(event)) {
- return;
- }
-
- if (instance.props.interactive) {
- document.body.addEventListener('mouseleave', scheduleHide);
- document.addEventListener('mousemove', debouncedOnMouseMove);
- mouseMoveListeners.push(debouncedOnMouseMove);
- return;
- }
-
- scheduleHide();
- }
- /**
- * Event listener invoked upon blur
- */
-
-
- function onBlur(event) {
- if (event.target !== getEventListenersTarget()) {
- return;
- }
-
- if (instance.props.interactive && event.relatedTarget && popper.contains(event.relatedTarget)) {
- return;
- }
-
- scheduleHide();
- }
- /**
- * Event listener invoked when a child target is triggered
- */
-
-
- function onDelegateShow(event) {
- if (closest(event.target, instance.props.target)) {
- scheduleShow(event);
- }
- }
- /**
- * Event listener invoked when a child target should hide
- */
-
-
- function onDelegateHide(event) {
- if (closest(event.target, instance.props.target)) {
- scheduleHide();
- }
- }
- /**
- * Determines if an event listener should stop further execution due to the
- * `touchHold` option
- */
-
-
- function isEventListenerStopped(event) {
- var supportsTouch = 'ontouchstart' in window;
- var isTouchEvent = includes(event.type, 'touch');
- var touchHold = instance.props.touchHold;
- return supportsTouch && isUsingTouch && touchHold && !isTouchEvent || isUsingTouch && !touchHold && isTouchEvent;
- }
- /**
- * Runs the mount callback
- */
-
-
- function runMountCallback() {
- if (!hasMountCallbackRun && currentMountCallback) {
- hasMountCallbackRun = true;
- reflow(popper);
- currentMountCallback();
- }
- }
- /**
- * Creates the popper instance for the instance
- */
-
-
- function createPopperInstance() {
- var popperOptions = instance.props.popperOptions;
- var _instance$popperChild = instance.popperChildren,
- tooltip = _instance$popperChild.tooltip,
- arrow = _instance$popperChild.arrow;
- var preventOverflowModifier = getModifier(popperOptions, 'preventOverflow');
-
- function applyMutations(data) {
- if (instance.props.flip && !instance.props.flipOnUpdate) {
- if (data.flipped) {
- instance.popperInstance.options.placement = data.placement;
- }
-
- setFlipModifierEnabled(instance.popperInstance.modifiers, false);
- } // Apply all of the popper's attributes to the tootip node as well.
- // Allows users to avoid using the .tippy-popper selector for themes.
-
-
- tooltip.setAttribute(PLACEMENT_ATTRIBUTE, data.placement);
-
- if (data.attributes[OUT_OF_BOUNDARIES_ATTRIBUTE] !== false) {
- tooltip.setAttribute(OUT_OF_BOUNDARIES_ATTRIBUTE, '');
- } else {
- tooltip.removeAttribute(OUT_OF_BOUNDARIES_ATTRIBUTE);
- } // Prevents a transition when changing placements (while tippy is visible)
- // for scroll/resize updates
-
-
- if (previousPlacement && previousPlacement !== data.placement && wasVisibleDuringPreviousUpdate) {
- tooltip.style.transition = 'none';
- requestAnimationFrame(function () {
- tooltip.style.transition = '';
- });
- }
-
- previousPlacement = data.placement;
- wasVisibleDuringPreviousUpdate = instance.state.isVisible;
- var basicPlacement = getBasicPlacement(popper);
- var styles = tooltip.style; // Account for the `distance` offset
-
- styles.top = styles.bottom = styles.left = styles.right = '';
- styles[basicPlacement] = getOffsetDistanceInPx(instance.props.distance);
- var padding = preventOverflowModifier && preventOverflowModifier.padding !== undefined ? preventOverflowModifier.padding : PADDING;
- var isPaddingNumber = typeof padding === 'number';
-
- var computedPadding = _extends({
- top: isPaddingNumber ? padding : padding.top,
- bottom: isPaddingNumber ? padding : padding.bottom,
- left: isPaddingNumber ? padding : padding.left,
- right: isPaddingNumber ? padding : padding.right
- }, !isPaddingNumber && padding);
-
- computedPadding[basicPlacement] = isPaddingNumber ? padding + instance.props.distance : (padding[basicPlacement] || 0) + instance.props.distance;
- instance.popperInstance.modifiers.filter(function (m) {
- return m.name === 'preventOverflow';
- })[0].padding = computedPadding;
- currentComputedPadding = computedPadding;
- }
-
- var config = _extends({
- eventsEnabled: false,
- placement: instance.props.placement
- }, popperOptions, {
- modifiers: _extends({}, popperOptions ? popperOptions.modifiers : {}, {
- preventOverflow: _extends({
- boundariesElement: instance.props.boundary,
- padding: PADDING
- }, preventOverflowModifier),
- arrow: _extends({
- element: arrow,
- enabled: !!arrow
- }, getModifier(popperOptions, 'arrow')),
- flip: _extends({
- enabled: instance.props.flip,
- // The tooltip is offset by 10px from the popper in CSS,
- // we need to account for its distance
- padding: instance.props.distance + PADDING,
- behavior: instance.props.flipBehavior
- }, getModifier(popperOptions, 'flip')),
- offset: _extends({
- offset: instance.props.offset
- }, getModifier(popperOptions, 'offset'))
- }),
- onCreate: function onCreate(data) {
- applyMutations(data);
- runMountCallback();
-
- if (popperOptions && popperOptions.onCreate) {
- popperOptions.onCreate(data);
- }
- },
- onUpdate: function onUpdate(data) {
- applyMutations(data);
- runMountCallback();
-
- if (popperOptions && popperOptions.onUpdate) {
- popperOptions.onUpdate(data);
- }
- }
- });
-
- instance.popperInstance = new popper_js__WEBPACK_IMPORTED_MODULE_0__["default"](reference, popper, config);
- }
- /**
- * Mounts the tooltip to the DOM
- */
-
-
- function mount() {
- hasMountCallbackRun = false;
- var isInLooseFollowCursorMode = getIsInLooseFollowCursorMode();
-
- if (instance.popperInstance) {
- setFlipModifierEnabled(instance.popperInstance.modifiers, instance.props.flip);
-
- if (!isInLooseFollowCursorMode) {
- instance.popperInstance.reference = reference;
- instance.popperInstance.enableEventListeners();
- }
-
- instance.popperInstance.scheduleUpdate();
- } else {
- createPopperInstance();
-
- if (!isInLooseFollowCursorMode) {
- instance.popperInstance.enableEventListeners();
- }
- }
-
- var appendTo = instance.props.appendTo;
- var parentNode = appendTo === 'parent' ? reference.parentNode : invokeWithArgsOrReturn(appendTo, [reference]);
-
- if (!parentNode.contains(popper)) {
- parentNode.appendChild(popper);
- instance.props.onMount(instance);
- instance.state.isMounted = true;
- }
- }
- /**
- * Setup before show() is invoked (delays, etc.)
- */
-
-
- function scheduleShow(event, shouldAvoidCallingOnTrigger) {
- clearDelayTimeouts();
-
- if (instance.state.isVisible) {
- return;
- } // Is a delegate, create an instance for the child target
-
-
- if (instance.props.target) {
- return createDelegateChildTippy(event);
- }
-
- isScheduledToShow = true;
-
- if (event && !shouldAvoidCallingOnTrigger) {
- instance.props.onTrigger(instance, event);
- }
-
- if (instance.props.wait) {
- return instance.props.wait(instance, event);
- } // If the tooltip has a delay, we need to be listening to the mousemove as
- // soon as the trigger event is fired, so that it's in the correct position
- // upon mount.
- // Edge case: if the tooltip is still mounted, but then scheduleShow() is
- // called, it causes a jump.
-
-
- if (getIsInLooseFollowCursorMode() && !instance.state.isMounted) {
- if (!instance.popperInstance) {
- createPopperInstance();
- }
-
- document.addEventListener('mousemove', positionVirtualReferenceNearCursor);
- }
-
- addDocumentClickListener();
- var delay = getValue(instance.props.delay, 0, defaultProps.delay);
-
- if (delay) {
- showTimeoutId = setTimeout(function () {
- show();
- }, delay);
- } else {
- show();
- }
- }
- /**
- * Setup before hide() is invoked (delays, etc.)
- */
-
-
- function scheduleHide() {
- clearDelayTimeouts();
-
- if (!instance.state.isVisible) {
- return removeFollowCursorListener();
- }
-
- isScheduledToShow = false;
- var delay = getValue(instance.props.delay, 1, defaultProps.delay);
-
- if (delay) {
- hideTimeoutId = setTimeout(function () {
- if (instance.state.isVisible) {
- hide();
- }
- }, delay);
- } else {
- // Fixes a `transitionend` problem when it fires 1 frame too
- // late sometimes, we don't want hide() to be called.
- scheduleHideAnimationFrameId = requestAnimationFrame(function () {
- hide();
- });
- }
- }
- /**
- * Listener to handle clicks on the document to determine if the
- * instance should hide
- */
-
-
- function onDocumentClick(event) {
- // Clicked on interactive popper
- if (instance.props.interactive && popper.contains(event.target)) {
- return;
- } // Clicked on the event listeners target
-
-
- if (getEventListenersTarget().contains(event.target)) {
- if (isUsingTouch) {
- return;
- }
-
- if (instance.state.isVisible && includes(instance.props.trigger, 'click')) {
- return;
- }
- }
-
- if (instance.props.hideOnClick === true) {
- clearDelayTimeouts();
- hide();
- }
- }
- /* ======================= 🔑 Public methods 🔑 ======================= */
-
- /**
- * Enables the instance to allow it to show or hide
- */
-
-
- function enable() {
- instance.state.isEnabled = true;
- }
- /**
- * Disables the instance to disallow it to show or hide
- */
-
-
- function disable() {
- instance.state.isEnabled = false;
- }
- /**
- * Clears pending timeouts related to the `delay` prop if any
- */
-
-
- function clearDelayTimeouts() {
- clearTimeout(showTimeoutId);
- clearTimeout(hideTimeoutId);
- cancelAnimationFrame(scheduleHideAnimationFrameId);
- }
- /**
- * Sets new props for the instance and redraws the tooltip
- */
-
-
- function set(options) {
- // Backwards-compatible after TypeScript change
- options = options || {};
- validateOptions(options, defaultProps);
- removeTriggersFromReference();
- var prevProps = instance.props;
- var nextProps = evaluateProps(reference, _extends({}, instance.props, options, {
- ignoreAttributes: true
- }));
- nextProps.ignoreAttributes = hasOwnProperty(options, 'ignoreAttributes') ? options.ignoreAttributes || false : prevProps.ignoreAttributes;
- instance.props = nextProps;
- addTriggersToReference();
- cleanupInteractiveMouseListeners();
- debouncedOnMouseMove = debounce(onMouseMove, nextProps.interactiveDebounce);
- updatePopperElement(popper, prevProps, nextProps);
- instance.popperChildren = getChildren(popper);
-
- if (instance.popperInstance) {
- if (POPPER_INSTANCE_DEPENDENCIES.some(function (prop) {
- return hasOwnProperty(options, prop) && options[prop] !== prevProps[prop];
- })) {
- instance.popperInstance.destroy();
- createPopperInstance();
-
- if (instance.state.isVisible) {
- instance.popperInstance.enableEventListeners();
- }
-
- if (instance.props.followCursor && lastMouseMoveEvent) {
- positionVirtualReferenceNearCursor(lastMouseMoveEvent);
- }
- } else {
- instance.popperInstance.update();
- }
- }
- }
- /**
- * Shortcut for .set({ content: newContent })
- */
-
-
- function setContent(content) {
- set({
- content: content
- });
- }
- /**
- * Shows the tooltip
- */
-
-
- function show() {
- var duration = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getValue(instance.props.duration, 0, defaultProps.duration[1]);
-
- if (instance.state.isDestroyed || !instance.state.isEnabled || isUsingTouch && !instance.props.touch) {
- return;
- } // Standardize `disabled` behavior across browsers.
- // Firefox allows events on disabled elements, but Chrome doesn't.
- // Using a wrapper element (i.e. <span>) is recommended.
-
-
- if (getEventListenersTarget().hasAttribute('disabled')) {
- return;
- }
-
- if (instance.props.onShow(instance) === false) {
- return;
- }
-
- addDocumentClickListener();
- popper.style.visibility = 'visible';
- instance.state.isVisible = true;
-
- if (instance.props.interactive) {
- getEventListenersTarget().classList.add(ACTIVE_CLASS);
- } // Prevent a transition if the popper is at the opposite placement
-
-
- var transitionableElements = getTransitionableElements();
- setTransitionDuration(transitionableElements.concat(popper), 0);
-
- currentMountCallback = function currentMountCallback() {
- if (!instance.state.isVisible) {
- return;
- }
-
- var isInLooseFollowCursorMode = getIsInLooseFollowCursorMode();
-
- if (isInLooseFollowCursorMode && lastMouseMoveEvent) {
- positionVirtualReferenceNearCursor(lastMouseMoveEvent);
- } else if (!isInLooseFollowCursorMode) {
- // Double update will apply correct mutations
- instance.popperInstance.update();
- }
-
- if (instance.popperChildren.backdrop) {
- instance.popperChildren.content.style.transitionDelay = Math.round(duration / 12) + 'ms';
- }
-
- if (instance.props.sticky) {
- makeSticky();
- }
-
- setTransitionDuration([popper], instance.props.updateDuration);
- setTransitionDuration(transitionableElements, duration);
- setVisibilityState(transitionableElements, 'visible');
- onTransitionedIn(duration, function () {
- if (instance.props.aria) {
- getEventListenersTarget().setAttribute("aria-".concat(instance.props.aria), popper.id);
- }
-
- instance.props.onShown(instance);
- instance.state.isShown = true;
- });
- };
-
- mount();
- }
- /**
- * Hides the tooltip
- */
-
-
- function hide() {
- var duration = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getValue(instance.props.duration, 1, defaultProps.duration[1]);
-
- if (instance.state.isDestroyed || !instance.state.isEnabled && !isBeingDestroyed) {
- return;
- }
-
- if (instance.props.onHide(instance) === false && !isBeingDestroyed) {
- return;
- }
-
- removeDocumentClickListener();
- popper.style.visibility = 'hidden';
- instance.state.isVisible = false;
- instance.state.isShown = false;
- wasVisibleDuringPreviousUpdate = false;
-
- if (instance.props.interactive) {
- getEventListenersTarget().classList.remove(ACTIVE_CLASS);
- }
-
- var transitionableElements = getTransitionableElements();
- setTransitionDuration(transitionableElements, duration);
- setVisibilityState(transitionableElements, 'hidden');
- onTransitionedOut(duration, function () {
- if (!isScheduledToShow) {
- removeFollowCursorListener();
- }
-
- if (instance.props.aria) {
- getEventListenersTarget().removeAttribute("aria-".concat(instance.props.aria));
- }
-
- instance.popperInstance.disableEventListeners();
- instance.popperInstance.options.placement = instance.props.placement;
- popper.parentNode.removeChild(popper);
- instance.props.onHidden(instance);
- instance.state.isMounted = false;
- });
- }
- /**
- * Destroys the tooltip
- */
-
-
- function destroy(destroyTargetInstances) {
- if (instance.state.isDestroyed) {
- return;
- }
-
- isBeingDestroyed = true; // If the popper is currently mounted to the DOM, we want to ensure it gets
- // hidden and unmounted instantly upon destruction
-
- if (instance.state.isMounted) {
- hide(0);
- }
-
- removeTriggersFromReference();
- delete reference._tippy;
- var target = instance.props.target;
-
- if (target && destroyTargetInstances && isRealElement(reference)) {
- arrayFrom(reference.querySelectorAll(target)).forEach(function (child) {
- if (child._tippy) {
- child._tippy.destroy();
- }
- });
- }
-
- if (instance.popperInstance) {
- instance.popperInstance.destroy();
- }
-
- isBeingDestroyed = false;
- instance.state.isDestroyed = true;
- }
- }
-
- /**
- * Groups an array of instances by taking control of their props during
- * certain lifecycles.
- */
- function group(instances) {
- var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
- _ref$delay = _ref.delay,
- delay = _ref$delay === void 0 ? instances[0].props.delay : _ref$delay,
- _ref$duration = _ref.duration,
- duration = _ref$duration === void 0 ? 0 : _ref$duration;
-
- var isAnyTippyOpen = false;
- instances.forEach(function (instance) {
- if (instance._originalProps) {
- instance.set(instance._originalProps);
- } else {
- instance._originalProps = _extends({}, instance.props);
- }
- });
-
- function setIsAnyTippyOpen(value) {
- isAnyTippyOpen = value;
- updateInstances();
- }
-
- function onShow(instance) {
- instance._originalProps.onShow(instance);
-
- instances.forEach(function (instance) {
- instance.set({
- duration: duration
- });
-
- if (instance.state.isVisible) {
- instance.hide();
- }
- });
- setIsAnyTippyOpen(true);
- }
-
- function onHide(instance) {
- instance._originalProps.onHide(instance);
-
- setIsAnyTippyOpen(false);
- }
-
- function onShown(instance) {
- instance._originalProps.onShown(instance);
-
- instance.set({
- duration: instance._originalProps.duration
- });
- }
-
- function updateInstances() {
- instances.forEach(function (instance) {
- instance.set({
- onShow: onShow,
- onShown: onShown,
- onHide: onHide,
- delay: isAnyTippyOpen ? [0, Array.isArray(delay) ? delay[1] : delay] : delay,
- duration: isAnyTippyOpen ? duration : instance._originalProps.duration
- });
- });
- }
-
- updateInstances();
- }
-
- var globalEventListenersBound = false;
- /**
- * Exported module
- */
-
- function tippy(targets, options) {
- validateOptions(options || {}, defaultProps);
-
- if (!globalEventListenersBound) {
- bindGlobalEventListeners();
- globalEventListenersBound = true;
- }
-
- var props = _extends({}, defaultProps, options); // If they are specifying a virtual positioning reference, we need to polyfill
- // some native DOM props
-
-
- if (isBareVirtualElement(targets)) {
- polyfillElementPrototypeProperties(targets);
- }
-
- var instances = getArrayOfElements(targets).reduce(function (acc, reference) {
- var instance = reference && createTippy(reference, props);
-
- if (instance) {
- acc.push(instance);
- }
-
- return acc;
- }, []);
- return isSingular(targets) ? instances[0] : instances;
- }
- /**
- * Static props
- */
-
-
- tippy.version = version;
- tippy.defaults = defaultProps;
- /**
- * Static methods
- */
-
- tippy.setDefaults = function (partialDefaults) {
- Object.keys(partialDefaults).forEach(function (key) {
- // @ts-ignore
- defaultProps[key] = partialDefaults[key];
- });
- };
-
- tippy.hideAll = hideAll;
- tippy.group = group;
- /**
- * Auto-init tooltips for elements with a `data-tippy="..."` attribute
- */
-
- function autoInit() {
- arrayFrom(document.querySelectorAll('[data-tippy]')).forEach(function (el) {
- var content = el.getAttribute('data-tippy');
-
- if (content) {
- tippy(el, {
- content: content
- });
- }
- });
- }
-
- if (isBrowser) {
- setTimeout(autoInit);
- }
-
- /**
- * Injects a string of CSS styles to a style node in <head>
- */
-
- function injectCSS(css) {
- if (isBrowser) {
- var style = document.createElement('style');
- style.type = 'text/css';
- style.textContent = css;
- style.setAttribute('data-tippy-stylesheet', '');
- var head = document.head;
- var firstChild = head.firstChild;
-
- if (firstChild) {
- head.insertBefore(style, firstChild);
- } else {
- head.appendChild(style);
- }
- }
- }
-
- injectCSS(css);
-
- /* harmony default export */ __webpack_exports__["default"] = (tippy);
- //# sourceMappingURL=index.all.js.map
-
-
- /***/ }),
-
- /***/ "./node_modules/uuid/lib/bytesToUuid.js":
- /*!**********************************************!*\
- !*** ./node_modules/uuid/lib/bytesToUuid.js ***!
- \**********************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
- /**
- * Convert array of 16 byte values to UUID string format of the form:
- * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
- */
- var byteToHex = [];
- for (var i = 0; i < 256; ++i) {
- byteToHex[i] = (i + 0x100).toString(16).substr(1);
- }
-
- function bytesToUuid(buf, offset) {
- var i = offset || 0;
- var bth = byteToHex;
- // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
- return ([bth[buf[i++]], bth[buf[i++]],
- bth[buf[i++]], bth[buf[i++]], '-',
- bth[buf[i++]], bth[buf[i++]], '-',
- bth[buf[i++]], bth[buf[i++]], '-',
- bth[buf[i++]], bth[buf[i++]], '-',
- bth[buf[i++]], bth[buf[i++]],
- bth[buf[i++]], bth[buf[i++]],
- bth[buf[i++]], bth[buf[i++]]]).join('');
- }
-
- module.exports = bytesToUuid;
-
-
- /***/ }),
-
- /***/ "./node_modules/uuid/lib/rng-browser.js":
- /*!**********************************************!*\
- !*** ./node_modules/uuid/lib/rng-browser.js ***!
- \**********************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
- // Unique ID creation requires a high quality random # generator. In the
- // browser this is a little complicated due to unknown quality of Math.random()
- // and inconsistent support for the `crypto` API. We do the best we can via
- // feature-detection
-
- // getRandomValues needs to be invoked in a context where "this" is a Crypto
- // implementation. Also, find the complete implementation of crypto on IE11.
- var getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||
- (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));
-
- if (getRandomValues) {
- // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto
- var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef
-
- module.exports = function whatwgRNG() {
- getRandomValues(rnds8);
- return rnds8;
- };
- } else {
- // Math.random()-based (RNG)
- //
- // If all else fails, use Math.random(). It's fast, but is of unspecified
- // quality.
- var rnds = new Array(16);
-
- module.exports = function mathRNG() {
- for (var i = 0, r; i < 16; i++) {
- if ((i & 0x03) === 0) r = Math.random() * 0x100000000;
- rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;
- }
-
- return rnds;
- };
- }
-
-
- /***/ }),
-
- /***/ "./node_modules/uuid/v1.js":
- /*!*********************************!*\
- !*** ./node_modules/uuid/v1.js ***!
- \*********************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- var rng = __webpack_require__(/*! ./lib/rng */ "./node_modules/uuid/lib/rng-browser.js");
- var bytesToUuid = __webpack_require__(/*! ./lib/bytesToUuid */ "./node_modules/uuid/lib/bytesToUuid.js");
-
- // **`v1()` - Generate time-based UUID**
- //
- // Inspired by https://github.com/LiosK/UUID.js
- // and http://docs.python.org/library/uuid.html
-
- var _nodeId;
- var _clockseq;
-
- // Previous uuid creation time
- var _lastMSecs = 0;
- var _lastNSecs = 0;
-
- // See https://github.com/broofa/node-uuid for API details
- function v1(options, buf, offset) {
- var i = buf && offset || 0;
- var b = buf || [];
-
- options = options || {};
- var node = options.node || _nodeId;
- var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;
-
- // node and clockseq need to be initialized to random values if they're not
- // specified. We do this lazily to minimize issues related to insufficient
- // system entropy. See #189
- if (node == null || clockseq == null) {
- var seedBytes = rng();
- if (node == null) {
- // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
- node = _nodeId = [
- seedBytes[0] | 0x01,
- seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]
- ];
- }
- if (clockseq == null) {
- // Per 4.2.2, randomize (14 bit) clockseq
- clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
- }
- }
-
- // UUID timestamps are 100 nano-second units since the Gregorian epoch,
- // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
- // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
- // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
- var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();
-
- // Per 4.2.1.2, use count of uuid's generated during the current clock
- // cycle to simulate higher resolution clock
- var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;
-
- // Time since last uuid creation (in msecs)
- var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;
-
- // Per 4.2.1.2, Bump clockseq on clock regression
- if (dt < 0 && options.clockseq === undefined) {
- clockseq = clockseq + 1 & 0x3fff;
- }
-
- // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
- // time interval
- if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
- nsecs = 0;
- }
-
- // Per 4.2.1.2 Throw error if too many uuids are requested
- if (nsecs >= 10000) {
- throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec');
- }
-
- _lastMSecs = msecs;
- _lastNSecs = nsecs;
- _clockseq = clockseq;
-
- // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
- msecs += 12219292800000;
-
- // `time_low`
- var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
- b[i++] = tl >>> 24 & 0xff;
- b[i++] = tl >>> 16 & 0xff;
- b[i++] = tl >>> 8 & 0xff;
- b[i++] = tl & 0xff;
-
- // `time_mid`
- var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;
- b[i++] = tmh >>> 8 & 0xff;
- b[i++] = tmh & 0xff;
-
- // `time_high_and_version`
- b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
- b[i++] = tmh >>> 16 & 0xff;
-
- // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
- b[i++] = clockseq >>> 8 | 0x80;
-
- // `clock_seq_low`
- b[i++] = clockseq & 0xff;
-
- // `node`
- for (var n = 0; n < 6; ++n) {
- b[i + n] = node[n];
- }
-
- return buf ? buf : bytesToUuid(b);
- }
-
- module.exports = v1;
-
-
- /***/ }),
-
- /***/ "./node_modules/webpack/buildin/global.js":
- /*!***********************************!*\
- !*** (webpack)/buildin/global.js ***!
- \***********************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
- var g;
-
- // This works in non-strict mode
- g = (function() {
- return this;
- })();
-
- try {
- // This works if eval is allowed (see CSP)
- g = g || new Function("return this")();
- } catch (e) {
- // This works if the window reference is available
- if (typeof window === "object") g = window;
- }
-
- // g can still be undefined, but nothing to do about it...
- // We return undefined, instead of nothing here, so it's
- // easier to handle this case. if(!global) { ...}
-
- module.exports = g;
-
-
- /***/ }),
-
- /***/ "./src/assets/arrow.svg":
- /*!******************************!*\
- !*** ./src/assets/arrow.svg ***!
- \******************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
- module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\"><path d=\"M313.941 216H12c-6.627 0-12 5.373-12 12v56c0 6.627 5.373 12 12 12h301.941v46.059c0 21.382 25.851 32.09 40.971 16.971l86.059-86.059c9.373-9.373 9.373-24.569 0-33.941l-86.059-86.059c-15.119-15.119-40.971-4.411-40.971 16.971V216z\"></path></svg><!-- Font Awesome Free 5.5.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) -->"
-
- /***/ }),
-
- /***/ "./src/assets/bx-left-arrow.svg":
- /*!**************************************!*\
- !*** ./src/assets/bx-left-arrow.svg ***!
- \**************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
- module.exports = "<svg t=\"1553418887330\" class=\"icon\" style viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"2264\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"><defs><style type=\"text/css\"></style></defs><path d=\"M787.797333 90.197333a42.581333 42.581333 0 0 0-44.074666 2.688l-554.666667 384a42.794667 42.794667 0 0 0 0 70.186667l554.666667 384A42.666667 42.666667 0 0 0 810.666667 896V128a42.666667 42.666667 0 0 0-22.869334-37.802667zM725.333333 814.549333L288.298667 512 725.333333 209.450667v605.098666z\" p-id=\"2265\"></path></svg>"
-
- /***/ }),
-
- /***/ "./src/assets/bx-right-arrow.svg":
- /*!***************************************!*\
- !*** ./src/assets/bx-right-arrow.svg ***!
- \***************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
- module.exports = "<svg t=\"1553418900235\" class=\"icon\" style viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"2709\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"><defs><style type=\"text/css\"></style></defs><path d=\"M236.202667 933.802667a42.837333 42.837333 0 0 0 44.074666-2.730667l554.666667-384a42.666667 42.666667 0 0 0 0-70.144l-554.666667-384A42.581333 42.581333 0 0 0 213.333333 128v768a42.666667 42.666667 0 0 0 22.869334 37.802667zM298.666667 209.450667L735.701333 512 298.666667 814.549333V209.450667z\" p-id=\"2710\"></path></svg>"
-
- /***/ }),
-
- /***/ "./src/assets/check.svg":
- /*!******************************!*\
- !*** ./src/assets/check.svg ***!
- \******************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
- module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><path d=\"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z\"></path></svg><!-- Font Awesome Free 5.5.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) -->"
-
- /***/ }),
-
- /***/ "./src/assets/cover.svg":
- /*!******************************!*\
- !*** ./src/assets/cover.svg ***!
- \******************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
- module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\"><path d=\"M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48z\"></path></svg><!-- Font Awesome Free 5.5.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) -->"
-
- /***/ }),
-
- /***/ "./src/assets/drag.svg":
- /*!*****************************!*\
- !*** ./src/assets/drag.svg ***!
- \*****************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
- module.exports = "<svg t=\"1555470391343\" class=\"icon\" style viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"2050\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" id=\"drag-handler\"><defs><style type=\"text/css\"></style></defs><path d=\"M298.666667 810.666667v-85.333334h85.333333v85.333334H298.666667m170.666666 0v-85.333334h85.333334v85.333334h-85.333334m170.666667 0v-85.333334h85.333333v85.333334h-85.333333m-341.333333-170.666667v-85.333333h85.333333v85.333333H298.666667m170.666666 0v-85.333333h85.333334v85.333333h-85.333334m170.666667 0v-85.333333h85.333333v85.333333h-85.333333m-341.333333-170.666667V384h85.333333v85.333333H298.666667m170.666666 0V384h85.333334v85.333333h-85.333334m170.666667 0V384h85.333333v85.333333h-85.333333M298.666667 298.666667V213.333333h85.333333v85.333334H298.666667m170.666666 0V213.333333h85.333334v85.333334h-85.333334m170.666667 0V213.333333h85.333333v85.333334h-85.333333z\" fill p-id=\"2051\"></path></svg>"
-
- /***/ }),
-
- /***/ "./src/assets/eraser.svg":
- /*!*******************************!*\
- !*** ./src/assets/eraser.svg ***!
- \*******************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
- module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><path d=\"M497.941 273.941c18.745-18.745 18.745-49.137 0-67.882l-160-160c-18.745-18.745-49.136-18.746-67.883 0l-256 256c-18.745 18.745-18.745 49.137 0 67.882l96 96A48.004 48.004 0 0 0 144 480h356c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12H355.883l142.058-142.059zm-302.627-62.627l137.373 137.373L265.373 416H150.628l-80-80 124.686-124.686z\"></path></svg><!-- Font Awesome Free 5.5.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) -->"
-
- /***/ }),
-
- /***/ "./src/assets/finish.svg":
- /*!*******************************!*\
- !*** ./src/assets/finish.svg ***!
- \*******************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
- module.exports = "<svg style=\"height:20px;\" viewBox=\"0 0 18 18\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"><title>teacher_ppt_bar_btn_finish</title><desc>Created with Sketch.</desc><g id=\"Demo\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" fill-opacity=\"0.776211504\"><g id=\"教师端_白板\" transform=\"translate(-957.000000, -578.000000)\" fill=\"#FF3366\"><g id=\"分组-6\" transform=\"translate(484.000000, 569.000000)\"><g id=\"Group-29\"><g id=\"teacher_ppt_bar_bj\"><g id=\"分组-10\" transform=\"translate(382.000000, 9.000000)\"><g id=\"分组-5\"><g id=\"teacher_ppt_bar_btn_finish\" transform=\"translate(91.000000, 0.000000)\"><g id=\"icon/ppt/结束\"><g id=\"结束\" transform=\"translate(3.000000, 3.000000)\"><path d=\"M6.13493151,13 C5.30684932,13 4.50547945,12.839726 3.77534247,12.5191781 C3.03630137,12.1986301 2.38630137,11.7534247 1.83424658,11.210274 C1.28219178,10.6671233 0.845890411,10.0082192 0.525342466,9.27808219 C0.204794521,8.5390411 0.0445205479,7.73767123 0.0445205479,6.90068493 C0.0445205479,6.41986301 0.0979452055,5.94794521 0.21369863,5.48493151 C0.329452055,5.02191781 0.489726027,4.57671233 0.694520548,4.15821918 C0.899315068,3.73972603 1.16643836,3.34794521 1.46917808,2.99178082 C1.78082192,2.62671233 2.12808219,2.29726027 2.5109589,2.00342466 C2.64452055,1.90547945 2.77808219,1.8609589 2.92945205,1.8609589 C2.96506849,1.8609589 3.00068493,1.8609589 3.04520548,1.86986301 C3.24109589,1.89657534 3.39246575,1.99452055 3.51712329,2.15479452 C3.64178082,2.31506849 3.67739726,2.48424658 3.65068493,2.68013699 C3.6239726,2.8760274 3.5260274,3.03630137 3.36575342,3.15205479 C2.76027397,3.58835616 2.27945205,4.14041096 1.95890411,4.79041096 C1.63835616,5.44041096 1.46917808,6.14383562 1.46917808,6.89178082 C1.46917808,7.53287671 1.59383562,8.13835616 1.83424658,8.70821918 C2.07465753,9.27808219 2.4130137,9.77671233 2.83150685,10.1952055 C3.25,10.6136986 3.74863014,10.9520548 4.31849315,11.2013699 C4.88835616,11.4506849 5.49383562,11.5753425 6.13493151,11.5753425 C6.7760274,11.5753425 7.39041096,11.4506849 7.95136986,11.2013699 C8.51232877,10.9520548 9.01986301,10.6136986 9.43835616,10.1952055 C9.85684932,9.77671233 10.1952055,9.27808219 10.4445205,8.70821918 C10.6938356,8.13835616 10.8184932,7.53287671 10.8184932,6.89178082 C10.8184932,6.13493151 10.640411,5.41369863 10.2931507,4.7369863 C9.94589041,4.06027397 9.44726027,3.49931507 8.81506849,3.0630137 C8.64589041,2.94726027 8.54794521,2.79589041 8.52123288,2.6 C8.48561644,2.40410959 8.53013699,2.2260274 8.6369863,2.05684932 C8.74383562,1.90547945 8.89520548,1.80753425 9.09109589,1.77191781 C9.13561644,1.7630137 9.18013699,1.7630137 9.22465753,1.7630137 C9.36712329,1.7630137 9.50068493,1.80753425 9.63424658,1.89657534 C10.0349315,2.18150685 10.4089041,2.51986301 10.7205479,2.88493151 C11.0410959,3.25 11.3171233,3.65068493 11.539726,4.07808219 C11.7623288,4.50547945 11.940411,4.95958904 12.0561644,5.43150685 C12.1719178,5.90342466 12.2342466,6.39315068 12.2342466,6.88287671 C12.2342466,7.71986301 12.0739726,8.52123288 11.7534247,9.26027397 C11.4328767,9.99931507 10.9876712,10.6493151 10.4445205,11.2013699 C9.90136986,11.7445205 9.24246575,12.189726 8.50342466,12.510274 C7.78219178,12.839726 6.98082192,13 6.13493151,13 Z M6.13493151,6.75821918 C5.9390411,6.75821918 5.77876712,6.6869863 5.63630137,6.55342466 C5.50273973,6.4109589 5.43150685,6.25068493 5.43150685,6.05479452 L5.43150685,0.721232877 C5.43150685,0.525342466 5.50273973,0.356164384 5.63630137,0.21369863 C5.77876712,0.0712328767 5.9390411,0 6.13493151,0 C6.33972603,0 6.50890411,0.0712328767 6.64246575,0.21369863 C6.78493151,0.356164384 6.84726027,0.525342466 6.84726027,0.721232877 L6.84726027,6.05479452 C6.84726027,6.25068493 6.7760274,6.4109589 6.64246575,6.55342466 C6.50890411,6.6869863 6.33972603,6.75821918 6.13493151,6.75821918 Z\" id=\"Shape\" fill-rule=\"nonzero\"></path></g></g></g></g></g></g></g></g></g></g></svg>"
-
- /***/ }),
-
- /***/ "./src/assets/highlight.svg":
- /*!**********************************!*\
- !*** ./src/assets/highlight.svg ***!
- \**********************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
- module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 544 512\"><path d=\"M0 479.98L99.92 512l35.45-35.45-67.04-67.04L0 479.98zm124.61-240.01a36.592 36.592 0 0 0-10.79 38.1l13.05 42.83-50.93 50.94 96.23 96.23 50.86-50.86 42.74 13.08c13.73 4.2 28.65-.01 38.15-10.78l35.55-41.64-173.34-173.34-41.52 35.44zm403.31-160.7l-63.2-63.2c-20.49-20.49-53.38-21.52-75.12-2.35L190.55 183.68l169.77 169.78L530.27 154.4c19.18-21.74 18.15-54.63-2.35-75.13z\"></path></svg><!-- Font Awesome Free 5.5.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) -->"
-
- /***/ }),
-
- /***/ "./src/assets/line.svg":
- /*!*****************************!*\
- !*** ./src/assets/line.svg ***!
- \*****************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
- module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 640 512\"><path d=\"M594.53 508.63L6.18 53.9c-6.97-5.42-8.23-15.47-2.81-22.45L23.01 6.18C28.43-.8 38.49-2.06 45.47 3.37L633.82 458.1c6.97 5.42 8.23 15.47 2.81 22.45l-19.64 25.27c-5.42 6.98-15.48 8.23-22.46 2.81z\"></path></svg><!-- Font Awesome Free 5.5.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) -->"
-
- /***/ }),
-
- /***/ "./src/assets/rect.svg":
- /*!*****************************!*\
- !*** ./src/assets/rect.svg ***!
- \*****************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
- module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\"><path d=\"M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zm-6 400H54c-3.3 0-6-2.7-6-6V86c0-3.3 2.7-6 6-6h340c3.3 0 6 2.7 6 6v340c0 3.3-2.7 6-6 6z\"></path></svg><!-- Font Awesome Free 5.5.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) -->"
-
- /***/ }),
-
- /***/ "./src/assets/rollback.svg":
- /*!*********************************!*\
- !*** ./src/assets/rollback.svg ***!
- \*********************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
- module.exports = "<svg t=\"1560078592996\" class=\"icon\" style viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"2653\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"><defs><style type=\"text/css\"></style></defs><path d=\"M811.488 424.512Q722.976 336 597.984 336h-336l114.016-114.016q12-12 12-28.512t-12-28-28.512-11.488-28.512 12l-183.008 183.008q-12 12-12 28.512t12 28.512l178.016 178.016q12 12 28.512 12t28-11.488 11.488-28-11.008-28.512l-112.992-112h340q92 0 156.992 64.992t64.992 156.992v192q0 16.992 12 28.512t28.512 11.488 28-11.488 11.488-28.512v-192q0-124.992-88.512-213.504z\" p-id=\"2654\" fill=\"#2c2c2c\"></path></svg>"
-
- /***/ }),
-
- /***/ "./src/assets/text.svg":
- /*!*****************************!*\
- !*** ./src/assets/text.svg ***!
- \*****************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
- module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\"><path d=\"M152 416h-24.013l26.586-80.782H292.8L319.386 416H296c-8.837 0-16 7.163-16 16v32c0 8.837 7.163 16 16 16h136c8.837 0 16-7.163 16-16v-32c0-8.837-7.163-16-16-16h-26.739L275.495 42.746A16 16 0 0 0 260.382 32h-72.766a16 16 0 0 0-15.113 10.746L42.739 416H16c-8.837 0-16 7.163-16 16v32c0 8.837 7.163 16 16 16h136c8.837 0 16-7.163 16-16v-32c0-8.837-7.163-16-16-16zm64.353-271.778c4.348-15.216 6.61-28.156 7.586-34.644.839 6.521 2.939 19.476 7.727 34.706l41.335 124.006h-98.619l41.971-124.068z\"></path></svg><!-- Font Awesome Free 5.5.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) -->"
-
- /***/ }),
-
- /***/ "./src/assets/times.svg":
- /*!******************************!*\
- !*** ./src/assets/times.svg ***!
- \******************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
- module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 352 512\"><path d=\"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z\"></path></svg><!-- Font Awesome Free 5.5.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) -->"
-
- /***/ }),
-
- /***/ "./src/drawboard/Baseboard/index.ts":
- /*!******************************************!*\
- !*** ./src/drawboard/Baseboard/index.ts ***!
- \******************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", { value: true });
- var uuid_1 = __webpack_require__(/*! ./../../utils/uuid */ "./src/utils/uuid.ts");
- var index_1 = __webpack_require__(/*! ./../../renderer/SvgHelper/index */ "./src/renderer/SvgHelper/index.ts");
- var Baseboard = function () {
- function Baseboard(source) {
- var _this = this;
- this.id = uuid_1.uuid();
- this.isFullscreen = false;
- this.initBoard = function (mountContainer) {
- _this.boardHolder = document.createElement('div');
- _this.boardHolder.id = "fcw-board-holder-" + _this.id;
- _this.boardHolder.className = "fcw-board-holder";
- _this.boardHolder.style.zIndex = '999';
- _this.boardHolder.style.setProperty('touch-action', 'none');
- _this.boardHolder.style.setProperty('-ms-touch-action', 'none');
- mountContainer.appendChild(_this.boardHolder);
- _this.boardCanvas = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
- _this.boardCanvas.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
- _this.boardCanvas.setAttribute('width', _this.width.toString());
- _this.boardCanvas.setAttribute('height', _this.height.toString());
- _this.boardCanvas.setAttribute('viewBox', '0 0 ' + _this.width.toString() + ' ' + _this.height.toString());
- _this.boardHolder.style.position = 'fixed';
- _this.boardHolder.style.width = _this.width + "px";
- _this.boardHolder.style.height = _this.height + "px";
- _this.boardHolder.style.transformOrigin = 'top left';
- _this.positionBoard();
- _this.defs = index_1.SvgHelper.createDefs();
- _this.boardCanvas.appendChild(_this.defs);
- _this.boardHolder.appendChild(_this.boardCanvas);
- };
- this.positionBoard = function () {
- _this.boardHolder.style.top = _this.targetRect.top + 'px';
- _this.boardHolder.style.left = _this.targetRect.left + 'px';
- };
- this.source = source;
- if (source.imgEle) {
- this.target = source.imgEle;
- this.width = this.target.clientWidth;
- this.height = this.target.clientHeight;
- }
- }
- return Baseboard;
- }();
- exports.Baseboard = Baseboard;
-
- /***/ }),
-
- /***/ "./src/drawboard/Drawboard/index.less":
- /*!********************************************!*\
- !*** ./src/drawboard/Drawboard/index.less ***!
- \********************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
-
- var content = __webpack_require__(/*! !../../../node_modules/css-loader/dist/cjs.js??ref--11-1!../../../node_modules/postcss-loader/src!../../../node_modules/less-loader/dist/cjs.js??ref--11-3!./index.less */ "./node_modules/css-loader/dist/cjs.js?!./node_modules/postcss-loader/src/index.js!./node_modules/less-loader/dist/cjs.js?!./src/drawboard/Drawboard/index.less");
-
- if(typeof content === 'string') content = [[module.i, content, '']];
-
- var transform;
- var insertInto;
-
-
-
- var options = {"hmr":true}
-
- options.transform = transform
- options.insertInto = undefined;
-
- var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options);
-
- if(content.locals) module.exports = content.locals;
-
- if(false) {}
-
- /***/ }),
-
- /***/ "./src/drawboard/Drawboard/index.ts":
- /*!******************************************!*\
- !*** ./src/drawboard/Drawboard/index.ts ***!
- \******************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var __extends = this && this.__extends || function () {
- var extendStatics = function (d, b) {
- extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
- d.__proto__ = b;
- } || function (d, b) {
- for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
- };
- return extendStatics(d, b);
- };
- return function (d, b) {
- extendStatics(d, b);
- function __() {
- this.constructor = d;
- }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- }();
- Object.defineProperty(exports, "__esModule", { value: true });
- var fc_hotkeys_1 = __webpack_require__(/*! fc-hotkeys */ "./node_modules/fc-hotkeys/dist/index.js");
- var debounce = __webpack_require__(/*! lodash.debounce */ "./node_modules/lodash.debounce/index.js");
- var index_1 = __webpack_require__(/*! ./../Baseboard/index */ "./src/drawboard/Baseboard/index.ts");
- var toolbar_items_1 = __webpack_require__(/*! ./../../toolbar/toolbar-items */ "./src/toolbar/toolbar-items.ts");
- var Synthetizer_1 = __webpack_require__(/*! ../../renderer/Synthetizer */ "./src/renderer/Synthetizer/index.ts");
- var Toolbar_1 = __webpack_require__(/*! ../../toolbar/Toolbar */ "./src/toolbar/Toolbar.ts");
- __webpack_require__(/*! ./index.less */ "./src/drawboard/Drawboard/index.less");
- var layout_1 = __webpack_require__(/*! ../../utils/layout */ "./src/utils/layout.ts");
- var index_2 = __webpack_require__(/*! ../../markers/RectMarker/index */ "./src/markers/RectMarker/index.ts");
- var index_3 = __webpack_require__(/*! ../../markers/HighlightMarker/index */ "./src/markers/HighlightMarker/index.ts");
- var index_4 = __webpack_require__(/*! ../../markers/CoverMarker/index */ "./src/markers/CoverMarker/index.ts");
- var index_5 = __webpack_require__(/*! ../../markers/LineMarker/index */ "./src/markers/LineMarker/index.ts");
- var index_6 = __webpack_require__(/*! ../../markers/ArrowMarker/index */ "./src/markers/ArrowMarker/index.ts");
- var index_7 = __webpack_require__(/*! ../../markers/TextMarker/index */ "./src/markers/TextMarker/index.ts");
- var Drawboard = function (_super) {
- __extends(Drawboard, _super);
- function Drawboard(source, _a) {
- var _b = _a === void 0 ? {} : _a,
- _c = _b.allowKeyboard,
- allowKeyboard = _c === void 0 ? true : _c,
- extraToolbarItems = _b.extraToolbarItems,
- mountContainer = _b.mountContainer,
- page = _b.page,
- zIndex = _b.zIndex,
- onChange = _b.onChange;
- var _this = _super.call(this, source) || this;
- _this.mountContainer = document.body;
- _this.scale = 1.0;
- _this.zIndex = 999;
- _this.allowKeyboard = true;
- _this.onComplete = function () {};
- _this.onChange = function () {};
- _this.open = function (onComplete, onCancel) {
- if (onComplete) {
- _this.onComplete = onComplete;
- }
- if (onCancel) {
- _this.onCancel = onCancel;
- }
- _this.setTargetRect();
- _this.initBoard(_this.mountContainer);
- _this.attachEvents();
- _this.setStyles();
- window.addEventListener('resize', _this.adjustUI);
- if (_this.page && _this.page.mode === 'master' || !_this.page) {
- _this.showUI();
- }
- };
- _this.hide = function () {
- if (_this.source.imgSrc) {
- _this.target.style.display = 'none';
- }
- _this.boardHolder.style.visibility = 'hidden';
- _this.boardHolder.style.zIndex = '-1';
- if (_this.toolbar) {
- _this.toolbar.hide();
- }
- };
- _this.show = function () {
- if (_this.source.imgSrc) {
- _this.target.style.display = 'block';
- }
- _this.boardHolder.style.visibility = 'visible';
- _this.boardHolder.style.zIndex = "" + _this.zIndex;
- if (_this.toolbar) {
- _this.toolbar.show();
- }
- };
- _this.destroy = function () {
- if (_this.toolbarUI) {
- _this.mountContainer.removeChild(_this.toolbarUI);
- }
- if (_this.boardCanvas) {
- _this.mountContainer.removeChild(_this.boardHolder);
- }
- if (_this.listener) {
- _this.listener.reset();
- }
- };
- _this.render = function (onComplete, onCancel) {
- _this.onComplete = onComplete;
- if (onCancel) {
- _this.onCancel = onCancel;
- }
- _this.selectMarker(null);
- _this.startRender(_this.renderFinished);
- };
- _this.addMarker = function (markerType, _a) {
- var _b = _a === void 0 ? {} : _a,
- id = _b.id,
- originX = _b.originX,
- originY = _b.originY;
- var marker = markerType.createMarker(_this.page);
- if (id) {
- marker.id = id;
- }
- marker.drawboard = _this;
- marker.onSelected = _this.selectMarker;
- marker.onChange = _this.onChange;
- if (marker.defs && marker.defs.length > 0) {
- for (var _i = 0, _c = marker.defs; _i < _c.length; _i++) {
- var d = _c[_i];
- if (d.id && !_this.boardCanvas.getElementById(d.id)) {
- _this.defs.appendChild(d);
- }
- }
- }
- _this.markers.push(marker);
- _this.selectMarker(marker);
- _this.boardCanvas.appendChild(marker.visual);
- var x;
- var y;
- if (originX && originY) {
- x = originX;
- y = originY;
- } else {
- var bbox = marker.visual.getBBox();
- x = _this.width / 2 / _this.scale - bbox.width / 2;
- y = _this.height / 2 / _this.scale - bbox.height / 2;
- }
- _this.onChange({
- target: 'marker',
- parentId: _this.page ? _this.page.id : _this.id,
- event: 'addMarker',
- marker: { type: marker.type, id: marker.id, dx: x, dy: y }
- });
- marker.moveTo(x, y);
- return marker;
- };
- _this.deleteActiveMarker = function () {
- _this.deleteMarkerWithEvent(_this.activeMarker);
- };
- _this.clearMarkers = function () {
- _this.markers.slice().forEach(function (marker) {
- _this.deleteMarkerWithEvent(marker);
- });
- };
- _this.deleteMarkerWithEvent = function (marker) {
- if (marker) {
- if (_this.onChange) {
- _this.onChange({
- event: 'removeMarker',
- id: marker.id,
- target: 'marker',
- marker: { id: marker.id }
- });
- }
- _this.deleteMarker(marker);
- }
- };
- _this.setTargetRect = function () {
- var targetRect = _this.target.getBoundingClientRect();
- var bodyRect = document.body.parentElement.getBoundingClientRect();
- _this.targetRect = {
- left: targetRect.left - bodyRect.left,
- top: targetRect.top - bodyRect.top
- };
- };
- _this.startRender = function (done) {
- var renderer = new Synthetizer_1.Synthetizer();
- renderer.rasterize(_this.target, _this.boardCanvas, done);
- };
- _this.attachEvents = function () {
- _this.boardCanvas.addEventListener('mousedown', _this.mouseDown);
- _this.boardCanvas.addEventListener('mousemove', _this.mouseMove);
- _this.boardCanvas.addEventListener('mouseup', _this.mouseUp);
- };
- _this.mouseDown = function (ev) {
- if (_this.activeMarker && (ev.buttons & 1) > 0) {
- _this.activeMarker.deselect();
- _this.activeMarker = null;
- }
- };
- _this.mouseMove = function (ev) {
- if (_this.activeMarker && (ev.buttons & 1) > 0) {
- _this.activeMarker.manipulate(ev);
- }
- };
- _this.mouseUp = function (ev) {
- if (_this.activeMarker) {
- _this.activeMarker.endManipulation();
- }
- };
- _this.onKeyboard = function (e, _a) {
- var hotkey = _a.hotkey;
- switch (hotkey) {
- case 'Shift+R':
- _this.addMarker(index_2.RectMarker);
- return;
- case 'Shift+H':
- _this.addMarker(index_3.HighlightMarker);
- return;
- case 'Shift+C':
- _this.addMarker(index_4.CoverMarker);
- return;
- case 'Shift+L':
- _this.addMarker(index_5.LineMarker);
- return;
- case 'Shift+A':
- _this.addMarker(index_6.ArrowMarker);
- return;
- case 'Shift+T':
- _this.addMarker(index_7.TextMarker);
- return;
- case 'ESC':
- _this.page.whiteboard.rollbackSnap();
- return;
- default:
- break;
- }
- if (!_this.activeMarker) {
- return;
- }
- switch (hotkey) {
- case 'UP':
- _this.activeMarker.move(0, -10);
- return;
- case 'LEFT':
- _this.activeMarker.move(-10, 0);
- return;
- case 'RIGHT':
- _this.activeMarker.move(10, 0);
- return;
- case 'DOWN':
- _this.activeMarker.move(0, 10);
- return;
- case 'BACKSPACE':
- _this.deleteActiveMarker();
- return;
- default:
- return;
- }
- };
- _this.adjustUI = function (ev) {
- _this.adjustSize();
- _this.positionUI();
- };
- _this.adjustSize = function () {
- _this.width = _this.target.clientWidth;
- _this.height = _this.target.clientHeight;
- var scale = _this.target.clientWidth / _this.boardHolder.clientWidth;
- if (scale !== 1.0) {
- _this.scale *= scale;
- _this.boardHolder.style.width = _this.width + "px";
- _this.boardHolder.style.height = _this.height + "px";
- _this.boardHolder.style.transform = "scale(" + _this.scale + ")";
- }
- };
- _this.positionUI = function () {
- _this.setTargetRect();
- _this.positionBoard();
- _this.positionToolbar();
- };
- _this.positionToolbar = function () {
- if (_this.toolbarUI && _this.targetRect) {
- _this.toolbarUI.style.left = _this.targetRect.left + _this.target.offsetWidth - _this.toolbarUI.clientWidth + "px";
- _this.toolbarUI.style.top = _this.targetRect.top - _this.toolbarUI.clientHeight + "px";
- }
- };
- _this.showUI = function () {
- _this.toolbar = new Toolbar_1.Toolbar(_this.toolbarItems, _this.toolbarClick);
- _this.toolbar.zIndex = _this.zIndex + 1;
- _this.toolbarUI = _this.toolbar.getUI(_this);
- _this.boardHolder.appendChild(_this.toolbarUI);
- _this.toolbarUI.style.position = 'absolute';
- _this.positionToolbar();
- _this.toolbar.show();
- _this.toolbar.toolbarButtons.forEach(function (button) {
- if (button.toolbarItem.draggable) {
- button.container.draggable = true;
- button.container.ondragstart = function (ev) {
- if (ev) {
- ev.dataTransfer.setData('id', button.id);
- }
- };
- }
- });
- _this.boardCanvas.ondragover = function (ev) {
- ev.preventDefault();
- };
- _this.boardCanvas.ondrop = function (ev) {
- var markerX = ev.x;
- var markerY = ev.y;
- var rect = _this.boardHolder.getBoundingClientRect();
- if (layout_1.rectContains(rect, { x: markerX, y: markerY })) {
- var buttonId = ev.dataTransfer.getData('id');
- var button = _this.toolbar.toolbarButtonMap[buttonId];
- if (button.toolbarItem && button.toolbarItem.markerType) {
- _this.addMarker(button.toolbarItem.markerType, {
- originX: markerX - rect.left,
- originY: markerY - rect.top
- });
- }
- }
- };
- };
- _this.setStyles = function () {
- var editorStyleSheet = document.createElementNS('http://www.w3.org/2000/svg', 'style');
- editorStyleSheet.innerHTML = "\n .rect-marker .render-visual {\n stroke: #ff0000;\n stroke-width: 3;\n fill: transparent;\n }\n .cover-marker .render-visual {\n stroke-width: 0;\n fill: #000000;\n }\n .highlight-marker .render-visual {\n stroke: transparent;\n stroke-width: 0;\n fill: #ffff00;\n fill-opacity: 0.4;\n }\n .line-marker .render-visual {\n stroke: #ff0000;\n stroke-width: 3;\n fill: transparent;\n }\n .arrow-marker .render-visual {\n stroke: #ff0000;\n stroke-width: 3;\n fill: transparent;\n }\n .arrow-marker-tip {\n stroke-width: 0;\n fill: #ff0000;\n }\n .text-marker text {\n fill: #ff0000;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\",\n Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\",\n \"Segoe UI Emoji\", \"Segoe UI Symbol\";\n }\n .fc-whiteboard-rect-control-box .fc-whiteboard-rect-control-rect {\n stroke: black;\n stroke-width: 1;\n stroke-opacity: 0.5;\n stroke-dasharray: 3, 2;\n fill: transparent;\n }\n .fc-whiteboard-control-grip {\n fill: #cccccc;\n stroke: #333333;\n stroke-width: 2;\n }\n ";
- _this.boardCanvas.appendChild(editorStyleSheet);
- };
- _this.toolbarClick = function (ev, toolbarItem) {
- if (toolbarItem.onClick) {
- toolbarItem.onClick();
- } else if (toolbarItem.markerType) {
- _this.addMarker(toolbarItem.markerType);
- } else {
- switch (toolbarItem.name) {
- case 'delete':
- {
- _this.deleteActiveMarker();
- break;
- }
- case 'pointer':
- {
- if (_this.activeMarker) {
- _this.selectMarker(null);
- }
- break;
- }
- case 'close':
- {
- _this.cancel();
- break;
- }
- case 'ok':
- {
- _this.complete();
- break;
- }
- default:
- break;
- }
- }
- };
- _this.selectMarker = function (marker) {
- if (_this.activeMarker && _this.activeMarker !== marker) {
- _this.activeMarker.deselect();
- }
- _this.activeMarker = marker;
- };
- _this.deleteMarker = function (marker) {
- _this.boardCanvas.removeChild(marker.visual);
- if (_this.activeMarker === marker) {
- _this.activeMarker = null;
- }
- _this.markers.splice(_this.markers.indexOf(marker), 1);
- };
- _this.complete = function () {
- _this.selectMarker(null);
- _this.startRender(_this.renderFinishedClose);
- };
- _this.cancel = function () {
- _this.destroy();
- if (_this.onCancel) {
- _this.onCancel();
- }
- };
- _this.renderFinished = function (dataUrl) {
- _this.onComplete(dataUrl);
- };
- _this.renderFinishedClose = function (dataUrl) {
- _this.destroy();
- _this.onComplete(dataUrl);
- };
- if (page) {
- _this.page = page;
- }
- if (zIndex) {
- _this.zIndex = zIndex;
- }
- _this.allowKeyboard = allowKeyboard;
- _this.markers = [];
- _this.activeMarker = null;
- var toolbarItems = toolbar_items_1.getToolbars(page);
- if (extraToolbarItems) {
- toolbarItems.push.apply(toolbarItems, extraToolbarItems);
- }
- _this.toolbarItems = toolbarItems;
- if (onChange) {
- _this.onChange = onChange;
- }
- if (allowKeyboard && _this.page && _this.page.mode === 'master') {
- _this.listener = new fc_hotkeys_1.HotkeysListener();
- _this.listener.on(fc_hotkeys_1.KEY_ALL, debounce(_this.onKeyboard, 150));
- }
- if (mountContainer) {
- _this.mountContainer = mountContainer;
- }
- return _this;
- }
- Object.defineProperty(Drawboard.prototype, "markerMap", {
- get: function () {
- var map = {};
- this.markers.forEach(function (marker) {
- map[marker.id] = marker;
- });
- return map;
- },
- enumerable: true,
- configurable: true
- });
- return Drawboard;
- }(index_1.Baseboard);
- exports.Drawboard = Drawboard;
-
- /***/ }),
-
- /***/ "./src/event/EventHub.ts":
- /*!*******************************!*\
- !*** ./src/event/EventHub.ts ***!
- \*******************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var __extends = this && this.__extends || function () {
- var extendStatics = function (d, b) {
- extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
- d.__proto__ = b;
- } || function (d, b) {
- for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
- };
- return extendStatics(d, b);
- };
- return function (d, b) {
- extendStatics(d, b);
- function __() {
- this.constructor = d;
- }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- }();
- Object.defineProperty(exports, "__esModule", { value: true });
- var EventEmitter = __webpack_require__(/*! eventemitter3 */ "./node_modules/eventemitter3/index.js");
- var EventHub = function (_super) {
- __extends(EventHub, _super);
- function EventHub() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- return EventHub;
- }(EventEmitter);
- exports.EventHub = EventHub;
-
- /***/ }),
-
- /***/ "./src/index.ts":
- /*!**********************!*\
- !*** ./src/index.ts ***!
- \**********************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", { value: true });
- var Drawboard_1 = __webpack_require__(/*! ./drawboard/Drawboard */ "./src/drawboard/Drawboard/index.ts");
- exports.Drawboard = Drawboard_1.Drawboard;
- var toolbar_items_1 = __webpack_require__(/*! ./toolbar/toolbar-items */ "./src/toolbar/toolbar-items.ts");
- exports.separatorToolbarItem = toolbar_items_1.separatorToolbarItem;
- exports.closeToolbarItem = toolbar_items_1.closeToolbarItem;
- var EventHub_1 = __webpack_require__(/*! ./event/EventHub */ "./src/event/EventHub.ts");
- exports.EventHub = EventHub_1.EventHub;
- var Whiteboard_1 = __webpack_require__(/*! ./whiteboard/Whiteboard */ "./src/whiteboard/Whiteboard/index.ts");
- exports.Whiteboard = Whiteboard_1.Whiteboard;
- var MirrorWhiteboard_1 = __webpack_require__(/*! ./whiteboard/MirrorWhiteboard */ "./src/whiteboard/MirrorWhiteboard/index.ts");
- exports.MirrorWhiteboard = MirrorWhiteboard_1.MirrorWhiteboard;
- var ReplayWhiteboard_1 = __webpack_require__(/*! ./whiteboard/ReplayWhiteboard */ "./src/whiteboard/ReplayWhiteboard/index.ts");
- exports.ReplayWhiteboard = ReplayWhiteboard_1.ReplayWhiteboard;
-
- /***/ }),
-
- /***/ "./src/markers/ArrowMarker/index.ts":
- /*!******************************************!*\
- !*** ./src/markers/ArrowMarker/index.ts ***!
- \******************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var __extends = this && this.__extends || function () {
- var extendStatics = function (d, b) {
- extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
- d.__proto__ = b;
- } || function (d, b) {
- for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
- };
- return extendStatics(d, b);
- };
- return function (d, b) {
- extendStatics(d, b);
- function __() {
- this.constructor = d;
- }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- }();
- Object.defineProperty(exports, "__esModule", { value: true });
- var LinearMarker_1 = __webpack_require__(/*! ../LinearMarker */ "./src/markers/LinearMarker/index.ts");
- var SvgHelper_1 = __webpack_require__(/*! ../../renderer/SvgHelper */ "./src/renderer/SvgHelper/index.ts");
- var ArrowMarker = function (_super) {
- __extends(ArrowMarker, _super);
- function ArrowMarker() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = 'arrow';
- _this.ARROW_SIZE = 6;
- return _this;
- }
- ArrowMarker.prototype.init = function () {
- _super.prototype.init.call(this);
- SvgHelper_1.SvgHelper.setAttributes(this.visual, [['class', 'arrow-marker']]);
- var tip = SvgHelper_1.SvgHelper.createPolygon("0,0 " + this.ARROW_SIZE + "," + this.ARROW_SIZE / 2 + " 0," + this.ARROW_SIZE, [['class', 'arrow-marker-tip']]);
- this.defs.push(SvgHelper_1.SvgHelper.createMarker('arrow-marker-head', 'auto', this.ARROW_SIZE, this.ARROW_SIZE, this.ARROW_SIZE - 1, this.ARROW_SIZE / 2, tip));
- this.markerLine.setAttribute('marker-end', 'url(#arrow-marker-head');
- };
- ArrowMarker.createMarker = function (page) {
- var marker = new ArrowMarker();
- marker.page = page;
- marker.init();
- return marker;
- };
- return ArrowMarker;
- }(LinearMarker_1.LinearMarker);
- exports.ArrowMarker = ArrowMarker;
-
- /***/ }),
-
- /***/ "./src/markers/BaseMarker/ResizeGrip.ts":
- /*!**********************************************!*\
- !*** ./src/markers/BaseMarker/ResizeGrip.ts ***!
- \**********************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", { value: true });
- var SvgHelper_1 = __webpack_require__(/*! ../../renderer/SvgHelper */ "./src/renderer/SvgHelper/index.ts");
- var ResizeGrip = function () {
- function ResizeGrip() {
- this.GRIP_SIZE = 10;
- this.visual = SvgHelper_1.SvgHelper.createCircle(this.GRIP_SIZE, [['class', 'fc-whiteboard-control-grip']]);
- }
- return ResizeGrip;
- }();
- exports.ResizeGrip = ResizeGrip;
-
- /***/ }),
-
- /***/ "./src/markers/BaseMarker/index.ts":
- /*!*****************************************!*\
- !*** ./src/markers/BaseMarker/index.ts ***!
- \*****************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var __extends = this && this.__extends || function () {
- var extendStatics = function (d, b) {
- extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
- d.__proto__ = b;
- } || function (d, b) {
- for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
- };
- return extendStatics(d, b);
- };
- return function (d, b) {
- extendStatics(d, b);
- function __() {
- this.constructor = d;
- }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- }();
- Object.defineProperty(exports, "__esModule", { value: true });
- var uuid = __webpack_require__(/*! uuid/v1 */ "./node_modules/uuid/v1.js");
- var SvgHelper_1 = __webpack_require__(/*! ../../renderer/SvgHelper */ "./src/renderer/SvgHelper/index.ts");
- var index_1 = __webpack_require__(/*! ../../renderer/DomEventAware/index */ "./src/renderer/DomEventAware/index.ts");
- var types_1 = __webpack_require__(/*! ../../utils/types */ "./src/utils/types.ts");
- var BaseMarker = function (_super) {
- __extends(BaseMarker, _super);
- function BaseMarker() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.id = uuid();
- _this.type = 'base';
- _this.onChange = function () {};
- _this.defs = [];
- _this.width = 200;
- _this.height = 50;
- _this.isActive = true;
- _this.isDragging = false;
- _this.isResizing = false;
- _this.manipulate = function (ev) {
- var scale = _this.visual.getScreenCTM().a;
- var dx = (ev.screenX - _this.previousMouseX) / scale;
- var dy = (ev.screenY - _this.previousMouseY) / scale;
- if (_this.isDragging) {
- _this.move(dx, dy);
- }
- if (_this.isResizing) {
- _this.resize(dx, dy, function (pos) {
- _this.onChange({
- target: 'marker',
- id: _this.id,
- event: 'resizeMarker',
- marker: { dx: dx, dy: dy, pos: pos }
- });
- });
- }
- _this.previousMouseX = ev.screenX;
- _this.previousMouseY = ev.screenY;
- };
- _this.move = function (dx, dy) {
- var translate = _this.visual.transform.baseVal.getItem(0);
- translate.setMatrix(translate.matrix.translate(dx, dy));
- _this.visual.transform.baseVal.replaceItem(translate, 0);
- _this.x += dx;
- _this.y += dy;
- _this.onChange({ target: 'marker', id: _this.id, event: 'moveMarker', marker: { dx: dx, dy: dy } });
- };
- _this.moveTo = function (x, y) {
- var translate = _this.visual.transform.baseVal.getItem(0);
- translate.setMatrix(translate.matrix.translate(x - _this.x, y - _this.y));
- _this.visual.transform.baseVal.replaceItem(translate, 0);
- _this.x = x;
- _this.y = y;
- };
- _this.addToVisual = function (el) {
- _this.visual.appendChild(el);
- };
- _this.addToRenderVisual = function (el) {
- _this.renderVisual.appendChild(el);
- };
- _this.onMouseDown = function (ev) {
- ev.stopPropagation();
- if (_this.page && _this.page.mode === 'mirror') {
- return;
- }
- _this.select();
- _this.isDragging = true;
- _this.previousMouseX = ev.screenX;
- _this.previousMouseY = ev.screenY;
- };
- _this.onMouseUp = function (ev) {
- ev.stopPropagation();
- _this.endManipulation();
- };
- _this.onMouseMove = function (ev) {
- ev.stopPropagation();
- _this.manipulate(ev);
- };
- return _this;
- }
- BaseMarker.prototype.reactToManipulation = function (type, _a) {
- var _b = _a === void 0 ? {} : _a,
- dx = _b.dx,
- dy = _b.dy,
- pos = _b.pos;
- if (type === 'moveMarker') {
- if (types_1.isNil(dx) || types_1.isNil(dy)) {
- return;
- }
- this.move(dx, dy);
- }
- if (type === 'resizeMarker') {
- if (types_1.isNil(dx) || types_1.isNil(dy)) {
- return;
- }
- this.resizeByEvent(dx, dy, pos);
- }
- };
- BaseMarker.prototype.endManipulation = function () {
- this.isDragging = false;
- this.isResizing = false;
- };
- BaseMarker.prototype.select = function () {
- this.isActive = true;
- if (this.onSelected) {
- this.onSelected(this);
- }
- return;
- };
- BaseMarker.prototype.deselect = function () {
- this.isActive = false;
- this.endManipulation();
- return;
- };
- BaseMarker.prototype.captureSnap = function () {
- return {
- id: this.id,
- type: this.type,
- isActive: this.isActive,
- x: this.x,
- y: this.y
- };
- };
- BaseMarker.prototype.applySnap = function (snap) {
- this.id = snap.id;
- this.type = snap.type;
- if (snap.x && snap.y) {
- this.moveTo(snap.x, snap.y);
- }
- if (this.isActive) {
- this.select();
- }
- };
- BaseMarker.prototype.destroy = function () {
- this.visual.style.display = 'none';
- };
- BaseMarker.prototype.resize = function (x, y, cb) {
- return;
- };
- BaseMarker.prototype.resizeByEvent = function (x, y, pos) {
- return;
- };
- BaseMarker.prototype.init = function () {
- this.visual = SvgHelper_1.SvgHelper.createGroup();
- this.visual.transform.baseVal.appendItem(SvgHelper_1.SvgHelper.createTransform());
- _super.prototype.init.call(this, this.visual);
- this.renderVisual = SvgHelper_1.SvgHelper.createGroup([['class', 'render-visual']]);
- this.visual.appendChild(this.renderVisual);
- };
- BaseMarker.createMarker = function (page) {
- var marker = new BaseMarker();
- marker.page = page;
- marker.init();
- return marker;
- };
- return BaseMarker;
- }(index_1.DomEventAware);
- exports.BaseMarker = BaseMarker;
-
- /***/ }),
-
- /***/ "./src/markers/CoverMarker/index.ts":
- /*!******************************************!*\
- !*** ./src/markers/CoverMarker/index.ts ***!
- \******************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var __extends = this && this.__extends || function () {
- var extendStatics = function (d, b) {
- extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
- d.__proto__ = b;
- } || function (d, b) {
- for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
- };
- return extendStatics(d, b);
- };
- return function (d, b) {
- extendStatics(d, b);
- function __() {
- this.constructor = d;
- }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- }();
- Object.defineProperty(exports, "__esModule", { value: true });
- var SvgHelper_1 = __webpack_require__(/*! ../../renderer/SvgHelper */ "./src/renderer/SvgHelper/index.ts");
- var RectBaseMarker_1 = __webpack_require__(/*! ../RectMarker/RectBaseMarker */ "./src/markers/RectMarker/RectBaseMarker.ts");
- var CoverMarker = function (_super) {
- __extends(CoverMarker, _super);
- function CoverMarker() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = 'cover';
- return _this;
- }
- CoverMarker.prototype.init = function () {
- _super.prototype.init.call(this);
- SvgHelper_1.SvgHelper.setAttributes(this.visual, [['class', 'cover-marker']]);
- };
- CoverMarker.createMarker = function (page) {
- var marker = new CoverMarker();
- marker.page = page;
- marker.init();
- return marker;
- };
- return CoverMarker;
- }(RectBaseMarker_1.RectBaseMarker);
- exports.CoverMarker = CoverMarker;
-
- /***/ }),
-
- /***/ "./src/markers/HighlightMarker/index.ts":
- /*!**********************************************!*\
- !*** ./src/markers/HighlightMarker/index.ts ***!
- \**********************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var __extends = this && this.__extends || function () {
- var extendStatics = function (d, b) {
- extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
- d.__proto__ = b;
- } || function (d, b) {
- for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
- };
- return extendStatics(d, b);
- };
- return function (d, b) {
- extendStatics(d, b);
- function __() {
- this.constructor = d;
- }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- }();
- Object.defineProperty(exports, "__esModule", { value: true });
- var SvgHelper_1 = __webpack_require__(/*! ../../renderer/SvgHelper */ "./src/renderer/SvgHelper/index.ts");
- var RectBaseMarker_1 = __webpack_require__(/*! ../RectMarker/RectBaseMarker */ "./src/markers/RectMarker/RectBaseMarker.ts");
- var HighlightMarker = function (_super) {
- __extends(HighlightMarker, _super);
- function HighlightMarker() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = 'highlight';
- return _this;
- }
- HighlightMarker.prototype.init = function () {
- _super.prototype.init.call(this);
- SvgHelper_1.SvgHelper.setAttributes(this.visual, [['class', 'highlight-marker']]);
- };
- HighlightMarker.createMarker = function (page) {
- var marker = new HighlightMarker();
- marker.page = page;
- marker.init();
- return marker;
- };
- return HighlightMarker;
- }(RectBaseMarker_1.RectBaseMarker);
- exports.HighlightMarker = HighlightMarker;
-
- /***/ }),
-
- /***/ "./src/markers/LineMarker/index.ts":
- /*!*****************************************!*\
- !*** ./src/markers/LineMarker/index.ts ***!
- \*****************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var __extends = this && this.__extends || function () {
- var extendStatics = function (d, b) {
- extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
- d.__proto__ = b;
- } || function (d, b) {
- for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
- };
- return extendStatics(d, b);
- };
- return function (d, b) {
- extendStatics(d, b);
- function __() {
- this.constructor = d;
- }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- }();
- Object.defineProperty(exports, "__esModule", { value: true });
- var LinearMarker_1 = __webpack_require__(/*! ../LinearMarker */ "./src/markers/LinearMarker/index.ts");
- var index_1 = __webpack_require__(/*! ./../../renderer/SvgHelper/index */ "./src/renderer/SvgHelper/index.ts");
- var LineMarker = function (_super) {
- __extends(LineMarker, _super);
- function LineMarker() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = 'line';
- return _this;
- }
- LineMarker.prototype.init = function () {
- _super.prototype.init.call(this);
- index_1.SvgHelper.setAttributes(this.visual, [['class', 'line-marker']]);
- };
- LineMarker.createMarker = function (page) {
- var marker = new LineMarker();
- marker.page = page;
- marker.init();
- return marker;
- };
- return LineMarker;
- }(LinearMarker_1.LinearMarker);
- exports.LineMarker = LineMarker;
-
- /***/ }),
-
- /***/ "./src/markers/LinearMarker/index.ts":
- /*!*******************************************!*\
- !*** ./src/markers/LinearMarker/index.ts ***!
- \*******************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var __extends = this && this.__extends || function () {
- var extendStatics = function (d, b) {
- extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
- d.__proto__ = b;
- } || function (d, b) {
- for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
- };
- return extendStatics(d, b);
- };
- return function (d, b) {
- extendStatics(d, b);
- function __() {
- this.constructor = d;
- }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- }();
- Object.defineProperty(exports, "__esModule", { value: true });
- var BaseMarker_1 = __webpack_require__(/*! ../BaseMarker */ "./src/markers/BaseMarker/index.ts");
- var ResizeGrip_1 = __webpack_require__(/*! ../BaseMarker/ResizeGrip */ "./src/markers/BaseMarker/ResizeGrip.ts");
- var SvgHelper_1 = __webpack_require__(/*! ../../renderer/SvgHelper */ "./src/renderer/SvgHelper/index.ts");
- var LinearMarker = function (_super) {
- __extends(LinearMarker, _super);
- function LinearMarker() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.MIN_LENGTH = 20;
- _this.x1 = 0;
- _this.y1 = 0;
- _this.x2 = _this.width;
- _this.y2 = 0;
- _this.getLineLength = function (x1, y1, x2, y2) {
- var dx = Math.abs(x1 - x2);
- var dy = Math.abs(y1 - y2);
- return Math.sqrt(Math.pow(dx, 2) + Math.pow(dy, 2));
- };
- _this.addControlBox = function () {
- _this.controlBox = SvgHelper_1.SvgHelper.createGroup([['class', 'fc-whiteboard-line-control-box']]);
- _this.addToVisual(_this.controlBox);
- _this.addControlGrips();
- };
- _this.adjustControlBox = function () {
- _this.positionGrips();
- };
- _this.addControlGrips = function () {
- _this.controlGrips = {
- left: _this.createGrip(),
- right: _this.createGrip()
- };
- _this.positionGrips();
- };
- _this.createGrip = function () {
- var grip = new ResizeGrip_1.ResizeGrip();
- grip.visual.transform.baseVal.appendItem(SvgHelper_1.SvgHelper.createTransform());
- _this.controlBox.appendChild(grip.visual);
- grip.visual.addEventListener('mousedown', _this.gripMouseDown);
- grip.visual.addEventListener('mousemove', _this.gripMouseMove);
- grip.visual.addEventListener('mouseup', _this.gripMouseUp);
- grip.visual.addEventListener('touchstart', _this.onTouch, { passive: false });
- grip.visual.addEventListener('touchend', _this.onTouch, { passive: false });
- grip.visual.addEventListener('touchmove', _this.onTouch, { passive: false });
- if (_this.page && _this.page.mode === 'mirror') {
- grip.visual.style.visibility = 'hidden';
- }
- return grip;
- };
- _this.gripMouseDown = function (ev) {
- _this.isResizing = true;
- _this.activeGrip = ev.target === _this.controlGrips.left.visual ? _this.controlGrips.left : _this.controlGrips.right;
- _this.previousMouseX = ev.screenX;
- _this.previousMouseY = ev.screenY;
- ev.stopPropagation();
- };
- _this.gripMouseUp = function (ev) {
- _this.isResizing = false;
- _this.activeGrip = null;
- ev.stopPropagation();
- };
- _this.gripMouseMove = function (ev) {
- if (_this.isResizing) {
- _this.resize(ev.movementX, ev.movementY);
- }
- };
- _this.positionLine = function (bound) {
- _this.x1 = bound.x1;
- _this.y1 = bound.y1;
- _this.x2 = bound.x2;
- _this.y2 = bound.y2;
- _this.markerBgLine.setAttribute('x1', _this.x1.toString());
- _this.markerBgLine.setAttribute('y1', _this.y1.toString());
- _this.markerLine.setAttribute('x2', _this.x2.toString());
- _this.markerLine.setAttribute('y2', _this.y2.toString());
- };
- _this.positionGrips = function () {
- var gripSize = _this.controlGrips.left.GRIP_SIZE;
- var x1 = _this.x1 - gripSize / 2;
- var y1 = _this.y1 - gripSize / 2;
- var x2 = _this.x2 - gripSize / 2;
- var y2 = _this.y2 - gripSize / 2;
- _this.positionGrip(_this.controlGrips.left.visual, x1, y1);
- _this.positionGrip(_this.controlGrips.right.visual, x2, y2);
- };
- _this.positionGrip = function (grip, x, y) {
- var translate = grip.transform.baseVal.getItem(0);
- translate.setTranslate(x, y);
- grip.transform.baseVal.replaceItem(translate, 0);
- };
- return _this;
- }
- LinearMarker.prototype.captureSnap = function () {
- var baseSnap = _super.prototype.captureSnap.call(this);
- baseSnap.linearSnap = {
- x1: this.x1,
- y1: this.y1,
- x2: this.x2,
- y2: this.y2
- };
- return baseSnap;
- };
- LinearMarker.prototype.applySnap = function (snap) {
- _super.prototype.applySnap.call(this, snap);
- if (snap.linearSnap) {
- this.positionLine(snap.linearSnap);
- }
- };
- LinearMarker.prototype.endManipulation = function () {
- _super.prototype.endManipulation.call(this);
- this.isResizing = false;
- this.activeGrip = null;
- };
- LinearMarker.prototype.select = function () {
- _super.prototype.select.call(this);
- this.controlBox.style.display = '';
- };
- LinearMarker.prototype.deselect = function () {
- _super.prototype.deselect.call(this);
- this.controlBox.style.display = 'none';
- };
- LinearMarker.prototype.init = function () {
- _super.prototype.init.call(this);
- this.markerBgLine = SvgHelper_1.SvgHelper.createLine(0, 0, this.x2, 0, [['stroke', 'transparent'], ['stroke-width', '30']]);
- this.addToRenderVisual(this.markerBgLine);
- this.markerLine = SvgHelper_1.SvgHelper.createLine(0, 0, this.x2, 0);
- this.addToRenderVisual(this.markerLine);
- this.addControlBox();
- if (this.page && this.page.mode === 'mirror') {
- this.controlBox.style.display = 'none';
- }
- };
- LinearMarker.prototype.resize = function (x, y, onPosition) {
- if (this.activeGrip) {
- if (this.activeGrip === this.controlGrips.left && this.getLineLength(this.x1 + x, this.y1 + 1, this.x2, this.y2) >= this.MIN_LENGTH) {
- this.x1 += x;
- this.y1 += y;
- this.markerBgLine.setAttribute('x1', this.x1.toString());
- this.markerBgLine.setAttribute('y1', this.y1.toString());
- this.markerLine.setAttribute('x1', this.x1.toString());
- this.markerLine.setAttribute('y1', this.y1.toString());
- if (onPosition) {
- onPosition('left');
- }
- } else if (this.activeGrip === this.controlGrips.right && this.getLineLength(this.x1, this.y1, this.x2 + x, this.y2 + y) >= this.MIN_LENGTH) {
- this.x2 += x;
- this.y2 += y;
- this.markerBgLine.setAttribute('x2', this.x2.toString());
- this.markerBgLine.setAttribute('y2', this.y2.toString());
- this.markerLine.setAttribute('x2', this.x2.toString());
- this.markerLine.setAttribute('y2', this.y2.toString());
- if (onPosition) {
- onPosition('right');
- }
- }
- }
- this.adjustControlBox();
- };
- LinearMarker.prototype.resizeByEvent = function (x, y, pos) {
- if (pos === 'left') {
- this.activeGrip = this.controlGrips.left;
- } else {
- this.activeGrip = this.controlGrips.right;
- }
- this.resize(x, y);
- };
- LinearMarker.createMarker = function (page) {
- var marker = new LinearMarker();
- marker.page = page;
- marker.init();
- return marker;
- };
- return LinearMarker;
- }(BaseMarker_1.BaseMarker);
- exports.LinearMarker = LinearMarker;
-
- /***/ }),
-
- /***/ "./src/markers/RectMarker/RectBaseMarker.ts":
- /*!**************************************************!*\
- !*** ./src/markers/RectMarker/RectBaseMarker.ts ***!
- \**************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var __extends = this && this.__extends || function () {
- var extendStatics = function (d, b) {
- extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
- d.__proto__ = b;
- } || function (d, b) {
- for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
- };
- return extendStatics(d, b);
- };
- return function (d, b) {
- extendStatics(d, b);
- function __() {
- this.constructor = d;
- }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- }();
- Object.defineProperty(exports, "__esModule", { value: true });
- var SvgHelper_1 = __webpack_require__(/*! ../../renderer/SvgHelper */ "./src/renderer/SvgHelper/index.ts");
- var RectangularMarker_1 = __webpack_require__(/*! ../RectangularMarker */ "./src/markers/RectangularMarker/index.ts");
- var RectBaseMarker = function (_super) {
- __extends(RectBaseMarker, _super);
- function RectBaseMarker() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- RectBaseMarker.prototype.applySnap = function (snap) {
- _super.prototype.applySnap.call(this, snap);
- if (snap.rectSnap) {
- this.markerRect.setAttribute('width', this.width.toString());
- this.markerRect.setAttribute('height', this.height.toString());
- }
- };
- RectBaseMarker.prototype.init = function () {
- _super.prototype.init.call(this);
- this.markerRect = SvgHelper_1.SvgHelper.createRect(this.width, this.height);
- this.addToRenderVisual(this.markerRect);
- };
- RectBaseMarker.prototype.resize = function (x, y, onPosition) {
- _super.prototype.resize.call(this, x, y, onPosition);
- this.markerRect.setAttribute('width', this.width.toString());
- this.markerRect.setAttribute('height', this.height.toString());
- };
- RectBaseMarker.createMarker = function (page) {
- var marker = new RectBaseMarker();
- marker.page = page;
- marker.init();
- return marker;
- };
- return RectBaseMarker;
- }(RectangularMarker_1.RectangularMarker);
- exports.RectBaseMarker = RectBaseMarker;
-
- /***/ }),
-
- /***/ "./src/markers/RectMarker/index.ts":
- /*!*****************************************!*\
- !*** ./src/markers/RectMarker/index.ts ***!
- \*****************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var __extends = this && this.__extends || function () {
- var extendStatics = function (d, b) {
- extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
- d.__proto__ = b;
- } || function (d, b) {
- for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
- };
- return extendStatics(d, b);
- };
- return function (d, b) {
- extendStatics(d, b);
- function __() {
- this.constructor = d;
- }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- }();
- Object.defineProperty(exports, "__esModule", { value: true });
- var RectBaseMarker_1 = __webpack_require__(/*! ./RectBaseMarker */ "./src/markers/RectMarker/RectBaseMarker.ts");
- var SvgHelper_1 = __webpack_require__(/*! ../../renderer/SvgHelper */ "./src/renderer/SvgHelper/index.ts");
- var RectMarker = function (_super) {
- __extends(RectMarker, _super);
- function RectMarker() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = 'rect';
- return _this;
- }
- RectMarker.prototype.init = function () {
- _super.prototype.init.call(this);
- SvgHelper_1.SvgHelper.setAttributes(this.visual, [['class', 'rect-marker']]);
- };
- RectMarker.createMarker = function (page) {
- var marker = new RectMarker();
- marker.page = page;
- marker.init();
- return marker;
- };
- return RectMarker;
- }(RectBaseMarker_1.RectBaseMarker);
- exports.RectMarker = RectMarker;
-
- /***/ }),
-
- /***/ "./src/markers/RectangularMarker/RectangularMarkerGrips.ts":
- /*!*****************************************************************!*\
- !*** ./src/markers/RectangularMarker/RectangularMarkerGrips.ts ***!
- \*****************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", { value: true });
- var RectangularMarkerGrips = function () {
- function RectangularMarkerGrips() {
- var _this = this;
- this.findGripByVisual = function (gripVisual) {
- switch (gripVisual) {
- case _this.topLeft.visual:
- return _this.topLeft;
- case _this.topCenter.visual:
- return _this.topCenter;
- case _this.topRight.visual:
- return _this.topRight;
- case _this.centerLeft.visual:
- return _this.centerLeft;
- case _this.centerRight.visual:
- return _this.centerRight;
- case _this.bottomLeft.visual:
- return _this.bottomLeft;
- case _this.bottomCenter.visual:
- return _this.bottomCenter;
- case _this.bottomRight.visual:
- return _this.bottomRight;
- default:
- return _this.topLeft;
- }
- };
- }
- return RectangularMarkerGrips;
- }();
- exports.RectangularMarkerGrips = RectangularMarkerGrips;
-
- /***/ }),
-
- /***/ "./src/markers/RectangularMarker/index.ts":
- /*!************************************************!*\
- !*** ./src/markers/RectangularMarker/index.ts ***!
- \************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var __extends = this && this.__extends || function () {
- var extendStatics = function (d, b) {
- extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
- d.__proto__ = b;
- } || function (d, b) {
- for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
- };
- return extendStatics(d, b);
- };
- return function (d, b) {
- extendStatics(d, b);
- function __() {
- this.constructor = d;
- }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- }();
- Object.defineProperty(exports, "__esModule", { value: true });
- var RectangularMarkerGrips_1 = __webpack_require__(/*! ./RectangularMarkerGrips */ "./src/markers/RectangularMarker/RectangularMarkerGrips.ts");
- var BaseMarker_1 = __webpack_require__(/*! ../BaseMarker */ "./src/markers/BaseMarker/index.ts");
- var ResizeGrip_1 = __webpack_require__(/*! ../BaseMarker/ResizeGrip */ "./src/markers/BaseMarker/ResizeGrip.ts");
- var SvgHelper_1 = __webpack_require__(/*! ../../renderer/SvgHelper */ "./src/renderer/SvgHelper/index.ts");
- var RectangularMarker = function (_super) {
- __extends(RectangularMarker, _super);
- function RectangularMarker() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.MIN_SIZE = 5;
- _this.CB_DISTANCE = 10;
- _this.addControlBox = function () {
- _this.controlBox = SvgHelper_1.SvgHelper.createGroup([['class', 'fc-whiteboard-rect-control-box']]);
- var translate = SvgHelper_1.SvgHelper.createTransform();
- translate.setTranslate(-_this.CB_DISTANCE / 2, -_this.CB_DISTANCE / 2);
- _this.controlBox.transform.baseVal.appendItem(translate);
- _this.addToVisual(_this.controlBox);
- _this.controlRect = SvgHelper_1.SvgHelper.createRect(_this.width + _this.CB_DISTANCE, _this.height + _this.CB_DISTANCE, [['class', 'fc-whiteboard-rect-control-rect']]);
- _this.controlBox.appendChild(_this.controlRect);
- _this.controlGrips = new RectangularMarkerGrips_1.RectangularMarkerGrips();
- _this.addControlGrips();
- };
- _this.adjustControlBox = function () {
- _this.controlRect.setAttribute('width', (_this.width + _this.CB_DISTANCE).toString());
- _this.controlRect.setAttribute('height', (_this.height + _this.CB_DISTANCE).toString());
- _this.positionGrips();
- };
- _this.addControlGrips = function () {
- _this.controlGrips.topLeft = _this.createGrip();
- _this.controlGrips.topCenter = _this.createGrip();
- _this.controlGrips.topRight = _this.createGrip();
- _this.controlGrips.centerLeft = _this.createGrip();
- _this.controlGrips.centerRight = _this.createGrip();
- _this.controlGrips.bottomLeft = _this.createGrip();
- _this.controlGrips.bottomCenter = _this.createGrip();
- _this.controlGrips.bottomRight = _this.createGrip();
- _this.positionGrips();
- };
- _this.createGrip = function () {
- var grip = new ResizeGrip_1.ResizeGrip();
- grip.visual.transform.baseVal.appendItem(SvgHelper_1.SvgHelper.createTransform());
- _this.controlBox.appendChild(grip.visual);
- grip.visual.addEventListener('mousedown', _this.gripMouseDown);
- grip.visual.addEventListener('mousemove', _this.gripMouseMove);
- grip.visual.addEventListener('mouseup', _this.gripMouseUp);
- grip.visual.addEventListener('touchstart', _this.onTouch, { passive: false });
- grip.visual.addEventListener('touchend', _this.onTouch, { passive: false });
- grip.visual.addEventListener('touchmove', _this.onTouch, { passive: false });
- return grip;
- };
- _this.gripMouseDown = function (ev) {
- _this.isResizing = true;
- _this.activeGrip = _this.controlGrips.findGripByVisual(ev.target) || null;
- _this.previousMouseX = ev.screenX;
- _this.previousMouseY = ev.screenY;
- ev.stopPropagation();
- };
- _this.gripMouseUp = function (ev) {
- _this.isResizing = false;
- _this.activeGrip = null;
- ev.stopPropagation();
- };
- _this.gripMouseMove = function (ev) {
- if (_this.isResizing) {
- _this.manipulate(ev);
- }
- };
- _this.positionGrips = function () {
- var gripSize = _this.controlGrips.topLeft.GRIP_SIZE;
- var left = -gripSize / 2;
- var top = left;
- var cx = (_this.width + _this.CB_DISTANCE) / 2 - gripSize / 2;
- var cy = (_this.height + _this.CB_DISTANCE) / 2 - gripSize / 2;
- var bottom = _this.height + _this.CB_DISTANCE - gripSize / 2;
- var right = _this.width + _this.CB_DISTANCE - gripSize / 2;
- _this.positionGrip(_this.controlGrips.topLeft.visual, left, top);
- _this.positionGrip(_this.controlGrips.topCenter.visual, cx, top);
- _this.positionGrip(_this.controlGrips.topRight.visual, right, top);
- _this.positionGrip(_this.controlGrips.centerLeft.visual, left, cy);
- _this.positionGrip(_this.controlGrips.centerRight.visual, right, cy);
- _this.positionGrip(_this.controlGrips.bottomLeft.visual, left, bottom);
- _this.positionGrip(_this.controlGrips.bottomCenter.visual, cx, bottom);
- _this.positionGrip(_this.controlGrips.bottomRight.visual, right, bottom);
- };
- _this.positionGrip = function (grip, x, y) {
- var translate = grip.transform.baseVal.getItem(0);
- translate.setTranslate(x, y);
- grip.transform.baseVal.replaceItem(translate, 0);
- };
- return _this;
- }
- RectangularMarker.prototype.captureSnap = function () {
- var snap = _super.prototype.captureSnap.call(this);
- snap.rectSnap = {
- width: this.width,
- height: this.height
- };
- return snap;
- };
- RectangularMarker.prototype.applySnap = function (snap) {
- _super.prototype.applySnap.call(this, snap);
- if (snap.rectSnap) {
- var _a = snap.rectSnap,
- width = _a.width,
- height = _a.height;
- if (width && height) {
- this.width = width;
- this.height = height;
- this.adjustControlBox();
- }
- }
- };
- RectangularMarker.prototype.endManipulation = function () {
- _super.prototype.endManipulation.call(this);
- this.isResizing = false;
- this.activeGrip = null;
- };
- RectangularMarker.prototype.select = function () {
- _super.prototype.select.call(this);
- this.controlBox.style.display = '';
- };
- RectangularMarker.prototype.deselect = function () {
- _super.prototype.deselect.call(this);
- this.controlBox.style.display = 'none';
- };
- RectangularMarker.prototype.init = function () {
- _super.prototype.init.call(this);
- this.addControlBox();
- if (this.page && this.page.mode === 'mirror') {
- this.controlBox.style.display = 'none';
- }
- };
- RectangularMarker.prototype.resizeByEvent = function (dx, dy, pos) {
- this.activeGrip = this.controlGrips[pos];
- this.resize(dx, dy);
- };
- RectangularMarker.prototype.resize = function (dx, dy, onPosition) {
- var translateX = 0;
- var translateY = 0;
- switch (this.activeGrip) {
- case this.controlGrips.topLeft:
- this.width -= dx;
- this.height -= dy;
- translateX += dx;
- translateY += dy;
- this.x += dx;
- this.y += dy;
- if (onPosition) {
- onPosition('topLeft');
- }
- break;
- case this.controlGrips.bottomLeft:
- this.width -= dx;
- this.height += dy;
- translateX += dx;
- this.x += dx;
- if (onPosition) {
- onPosition('bottomLeft');
- }
- break;
- case this.controlGrips.topRight:
- this.width += dx;
- this.height -= dy;
- translateY += dy;
- this.y += dy;
- if (onPosition) {
- onPosition('topRight');
- }
- break;
- case this.controlGrips.bottomRight:
- this.width += dx;
- this.height += dy;
- if (onPosition) {
- onPosition('bottomRight');
- }
- break;
- case this.controlGrips.centerLeft:
- this.width -= dx;
- translateX += dx;
- this.x += dx;
- if (onPosition) {
- onPosition('centerLeft');
- }
- break;
- case this.controlGrips.centerRight:
- this.width += dx;
- if (onPosition) {
- onPosition('centerRight');
- }
- break;
- case this.controlGrips.topCenter:
- this.height -= dy;
- translateY += dy;
- this.y += dy;
- if (onPosition) {
- onPosition('topCenter');
- }
- break;
- case this.controlGrips.bottomCenter:
- this.height += dy;
- if (onPosition) {
- onPosition('bottomCenter');
- }
- break;
- default:
- break;
- }
- if (this.width < this.MIN_SIZE) {
- var offset = this.MIN_SIZE - this.width;
- this.width = this.MIN_SIZE;
- if (translateX !== 0) {
- translateX -= offset;
- }
- }
- if (this.height < this.MIN_SIZE) {
- var offset = this.MIN_SIZE - this.height;
- this.height = this.MIN_SIZE;
- if (translateY !== 0) {
- translateY -= offset;
- }
- }
- if (translateX !== 0 || translateY !== 0) {
- var translate = this.visual.transform.baseVal.getItem(0);
- translate.setMatrix(translate.matrix.translate(translateX, translateY));
- this.visual.transform.baseVal.replaceItem(translate, 0);
- }
- this.adjustControlBox();
- };
- RectangularMarker.prototype.onTouch = function (ev) {
- _super.prototype.onTouch.call(this, ev);
- };
- RectangularMarker.createMarker = function (page) {
- var marker = new RectangularMarker();
- marker.page = page;
- marker.init();
- return marker;
- };
- return RectangularMarker;
- }(BaseMarker_1.BaseMarker);
- exports.RectangularMarker = RectangularMarker;
-
- /***/ }),
-
- /***/ "./src/markers/TextMarker/index.ts":
- /*!*****************************************!*\
- !*** ./src/markers/TextMarker/index.ts ***!
- \*****************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var __extends = this && this.__extends || function () {
- var extendStatics = function (d, b) {
- extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
- d.__proto__ = b;
- } || function (d, b) {
- for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
- };
- return extendStatics(d, b);
- };
- return function (d, b) {
- extendStatics(d, b);
- function __() {
- this.constructor = d;
- }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- }();
- Object.defineProperty(exports, "__esModule", { value: true });
- var RectangularMarker_1 = __webpack_require__(/*! ../RectangularMarker */ "./src/markers/RectangularMarker/index.ts");
- var SvgHelper_1 = __webpack_require__(/*! ../../renderer/SvgHelper */ "./src/renderer/SvgHelper/index.ts");
- var OkIcon = __webpack_require__(/*! ../../assets/check.svg */ "./src/assets/check.svg");
- var CancelIcon = __webpack_require__(/*! ../../assets/times.svg */ "./src/assets/times.svg");
- var TextMarker = function (_super) {
- __extends(TextMarker, _super);
- function TextMarker() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = 'text';
- _this.MIN_SIZE = 50;
- _this.DEFAULT_TEXT = 'Double-click to edit text';
- _this.text = _this.DEFAULT_TEXT;
- _this.inDoubleTap = false;
- _this.renderText = function () {
- var LINE_SIZE = '1.2em';
- while (_this.textElement.lastChild) {
- _this.textElement.removeChild(_this.textElement.lastChild);
- }
- var lines = _this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/);
- for (var _i = 0, lines_1 = lines; _i < lines_1.length; _i++) {
- var line = lines_1[_i];
- if (line.trim() === '') {
- line = ' ';
- }
- _this.textElement.appendChild(SvgHelper_1.SvgHelper.createTSpan(line, [['x', '0'], ['dy', LINE_SIZE]]));
- }
- setTimeout(_this.sizeText, 10);
- };
- _this.sizeText = function () {
- var textSize = _this.textElement.getBBox();
- var x = 0;
- var y = 0;
- var scale = 1.0;
- if (textSize.width > 0 && textSize.height > 0) {
- var xScale = _this.width * 1.0 / textSize.width;
- var yScale = _this.height * 1.0 / textSize.height;
- scale = Math.min(xScale, yScale);
- x = (_this.width - textSize.width * scale) / 2;
- y = (_this.height - textSize.height * scale) / 2;
- }
- _this.textElement.transform.baseVal.getItem(0).setTranslate(x, y);
- _this.textElement.transform.baseVal.getItem(1).setScale(scale, scale);
- };
- _this.onDblClick = function (ev) {
- _this.showEditor();
- };
- _this.onTap = function (ev) {
- if (_this.inDoubleTap) {
- _this.inDoubleTap = false;
- _this.showEditor();
- } else {
- _this.inDoubleTap = true;
- setTimeout(function () {
- _this.inDoubleTap = false;
- }, 300);
- }
- };
- _this.showEditor = function () {
- _this.editor = document.createElement('div');
- _this.editor.className = 'fc-whiteboard-text-editor';
- _this.editorTextArea = document.createElement('textarea');
- if (_this.text !== _this.DEFAULT_TEXT) {
- _this.editorTextArea.value = _this.text;
- }
- _this.editorTextArea.addEventListener('keydown', _this.onEditorKeyDown);
- _this.editor.appendChild(_this.editorTextArea);
- document.body.appendChild(_this.editor);
- var buttons = document.createElement('div');
- buttons.className = 'fc-whiteboard-text-editor-button-bar';
- _this.editor.appendChild(buttons);
- var okButton = document.createElement('div');
- okButton.className = 'fc-whiteboard-text-editor-button';
- okButton.innerHTML = OkIcon;
- okButton.addEventListener('click', _this.onEditorOkClick);
- buttons.appendChild(okButton);
- var cancelButton = document.createElement('div');
- cancelButton.className = 'fc-whiteboard-text-editor-button';
- cancelButton.innerHTML = CancelIcon;
- cancelButton.addEventListener('click', _this.closeEditor);
- buttons.appendChild(cancelButton);
- };
- _this.onEditorOkClick = function (ev) {
- if (_this.editorTextArea.value.trim()) {
- _this.text = _this.editorTextArea.value;
- } else {
- _this.text = _this.DEFAULT_TEXT;
- }
- _this.onChange({
- target: 'marker',
- id: _this.id,
- event: 'inputMarker',
- marker: { text: _this.text }
- });
- _this.renderText();
- _this.closeEditor();
- };
- _this.closeEditor = function () {
- document.body.removeChild(_this.editor);
- };
- _this.onEditorKeyDown = function (ev) {
- if (ev.key === 'Enter' && ev.ctrlKey) {
- ev.preventDefault();
- _this.onEditorOkClick(null);
- }
- };
- return _this;
- }
- TextMarker.prototype.setText = function (text) {
- this.text = text;
- this.renderText();
- };
- TextMarker.prototype.captureSnap = function () {
- var baseSnap = _super.prototype.captureSnap.call(this);
- baseSnap.textSnap = { text: this.text };
- return baseSnap;
- };
- TextMarker.prototype.applySnap = function (snap) {
- _super.prototype.applySnap.call(this, snap);
- if (snap.textSnap && snap.textSnap.text !== this.text) {
- this.setText(snap.textSnap.text);
- }
- };
- TextMarker.prototype.init = function () {
- _super.prototype.init.call(this);
- this.textElement = SvgHelper_1.SvgHelper.createText();
- this.addToRenderVisual(this.textElement);
- SvgHelper_1.SvgHelper.setAttributes(this.visual, [['class', 'text-marker']]);
- this.textElement.transform.baseVal.appendItem(SvgHelper_1.SvgHelper.createTransform());
- this.textElement.transform.baseVal.appendItem(SvgHelper_1.SvgHelper.createTransform());
- this.renderText();
- this.visual.addEventListener('dblclick', this.onDblClick);
- this.visual.addEventListener('touchstart', this.onTap);
- };
- TextMarker.prototype.resize = function (x, y, onPosition) {
- _super.prototype.resize.call(this, x, y, onPosition);
- this.sizeText();
- };
- TextMarker.createMarker = function (page) {
- var marker = new TextMarker();
- marker.page = page;
- marker.init();
- return marker;
- };
- return TextMarker;
- }(RectangularMarker_1.RectangularMarker);
- exports.TextMarker = TextMarker;
-
- /***/ }),
-
- /***/ "./src/markers/types.ts":
- /*!******************************!*\
- !*** ./src/markers/types.ts ***!
- \******************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", { value: true });
- var index_1 = __webpack_require__(/*! ./HighlightMarker/index */ "./src/markers/HighlightMarker/index.ts");
- var index_2 = __webpack_require__(/*! ./TextMarker/index */ "./src/markers/TextMarker/index.ts");
- var index_3 = __webpack_require__(/*! ./ArrowMarker/index */ "./src/markers/ArrowMarker/index.ts");
- var index_4 = __webpack_require__(/*! ./BaseMarker/index */ "./src/markers/BaseMarker/index.ts");
- var CoverMarker_1 = __webpack_require__(/*! ./CoverMarker */ "./src/markers/CoverMarker/index.ts");
- var LineMarker_1 = __webpack_require__(/*! ./LineMarker */ "./src/markers/LineMarker/index.ts");
- var RectMarker_1 = __webpack_require__(/*! ./RectMarker */ "./src/markers/RectMarker/index.ts");
- function getMarkerByType(type) {
- switch (type) {
- case 'arrow':
- return index_3.ArrowMarker;
- case 'base':
- return index_4.BaseMarker;
- case 'cover':
- return CoverMarker_1.CoverMarker;
- case 'highlight':
- return index_1.HighlightMarker;
- case 'line':
- return LineMarker_1.LineMarker;
- case 'rect':
- return RectMarker_1.RectMarker;
- case 'text':
- return index_2.TextMarker;
- default:
- return index_4.BaseMarker;
- }
- }
- exports.getMarkerByType = getMarkerByType;
-
- /***/ }),
-
- /***/ "./src/renderer/DomEventAware/index.ts":
- /*!*********************************************!*\
- !*** ./src/renderer/DomEventAware/index.ts ***!
- \*********************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", { value: true });
- var DomEventAware = function () {
- function DomEventAware() {
- this.x = 0;
- this.y = 0;
- this.previousMouseX = 0;
- this.previousMouseY = 0;
- }
- DomEventAware.prototype.init = function (ele) {
- ele.addEventListener('mousedown', this.onMouseDown);
- ele.addEventListener('mouseup', this.onMouseUp);
- ele.addEventListener('mousemove', this.onMouseMove);
- ele.addEventListener('touchstart', this.onTouch, { passive: false });
- ele.addEventListener('touchend', this.onTouch, { passive: false });
- ele.addEventListener('touchmove', this.onTouch, { passive: false });
- };
- DomEventAware.prototype.onTouch = function (ev) {
- ev.preventDefault();
- var newEvt = document.createEvent('MouseEvents');
- var touch = ev.changedTouches[0];
- var type = null;
- switch (ev.type) {
- case 'touchstart':
- type = 'mousedown';
- break;
- case 'touchmove':
- type = 'mousemove';
- break;
- case 'touchend':
- type = 'mouseup';
- break;
- default:
- break;
- }
- newEvt.initMouseEvent(type, true, true, window, 0, touch.screenX, touch.screenY, touch.clientX, touch.clientY, ev.ctrlKey, ev.altKey, ev.shiftKey, ev.metaKey, 0, null);
- ev.target.dispatchEvent(newEvt);
- };
- return DomEventAware;
- }();
- exports.DomEventAware = DomEventAware;
-
- /***/ }),
-
- /***/ "./src/renderer/SvgHelper/index.ts":
- /*!*****************************************!*\
- !*** ./src/renderer/SvgHelper/index.ts ***!
- \*****************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", { value: true });
- var SvgHelper = function () {
- function SvgHelper() {}
- SvgHelper.createRect = function (width, height, attributes) {
- var rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect');
- rect.setAttribute('width', width.toString());
- rect.setAttribute('height', height.toString());
- if (attributes) {
- SvgHelper.setAttributes(rect, attributes);
- }
- return rect;
- };
- SvgHelper.createLine = function (x1, y1, x2, y2, attributes) {
- var line = document.createElementNS('http://www.w3.org/2000/svg', 'line');
- line.setAttribute('x1', x1.toString());
- line.setAttribute('y1', y1.toString());
- line.setAttribute('x2', x2.toString());
- line.setAttribute('y2', y2.toString());
- if (attributes) {
- SvgHelper.setAttributes(line, attributes);
- }
- return line;
- };
- SvgHelper.createPolygon = function (points, attributes) {
- var polygon = document.createElementNS('http://www.w3.org/2000/svg', 'polygon');
- polygon.setAttribute('points', points);
- if (attributes) {
- SvgHelper.setAttributes(polygon, attributes);
- }
- return polygon;
- };
- SvgHelper.createCircle = function (radius, attributes) {
- var circle = document.createElementNS('http://www.w3.org/2000/svg', 'circle');
- circle.setAttribute('cx', (radius / 2).toString());
- circle.setAttribute('cy', (radius / 2).toString());
- circle.setAttribute('r', radius.toString());
- if (attributes) {
- SvgHelper.setAttributes(circle, attributes);
- }
- return circle;
- };
- SvgHelper.createGroup = function (attributes) {
- var g = document.createElementNS('http://www.w3.org/2000/svg', 'g');
- if (attributes) {
- SvgHelper.setAttributes(g, attributes);
- }
- return g;
- };
- SvgHelper.setAttributes = function (el, attributes) {
- for (var _i = 0, attributes_1 = attributes; _i < attributes_1.length; _i++) {
- var _a = attributes_1[_i],
- attr = _a[0],
- value = _a[1];
- el.setAttribute(attr, value);
- }
- };
- SvgHelper.createTransform = function () {
- var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
- return svg.createSVGTransform();
- };
- SvgHelper.createDefs = function () {
- var defs = document.createElementNS('http://www.w3.org/2000/svg', 'defs');
- return defs;
- };
- SvgHelper.createMarker = function (id, orient, markerWidth, markerHeight, refX, refY, markerElement) {
- var marker = document.createElementNS('http://www.w3.org/2000/svg', 'marker');
- SvgHelper.setAttributes(marker, [['id', id], ['orient', orient], ['markerWidth', markerWidth.toString()], ['markerHeight', markerHeight.toString()], ['refX', refX.toString()], ['refY', refY.toString()]]);
- marker.appendChild(markerElement);
- return marker;
- };
- SvgHelper.createText = function (attributes) {
- var text = document.createElementNS('http://www.w3.org/2000/svg', 'text');
- text.setAttribute('x', '0');
- text.setAttribute('y', '0');
- if (attributes) {
- SvgHelper.setAttributes(text, attributes);
- }
- return text;
- };
- SvgHelper.createTSpan = function (text, attributes) {
- var tspan = document.createElementNS('http://www.w3.org/2000/svg', 'tspan');
- tspan.textContent = text;
- if (attributes) {
- SvgHelper.setAttributes(tspan, attributes);
- }
- return tspan;
- };
- return SvgHelper;
- }();
- exports.SvgHelper = SvgHelper;
-
- /***/ }),
-
- /***/ "./src/renderer/Synthetizer/index.ts":
- /*!*******************************************!*\
- !*** ./src/renderer/Synthetizer/index.ts ***!
- \*******************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", { value: true });
- var validator_1 = __webpack_require__(/*! ../../utils/validator */ "./src/utils/validator.ts");
- var Synthetizer = function () {
- function Synthetizer() {}
- Synthetizer.prototype.rasterize = function (target, markerImage, done) {
- if (!validator_1.isHTMLImageElement(target)) {
- throw new Error('Error: only support export to HTMLImageElement');
- }
- var canvas = document.createElement('canvas');
- canvas.width = markerImage.width.baseVal.value;
- canvas.height = markerImage.height.baseVal.value;
- var data = markerImage.outerHTML;
- var ctx = canvas.getContext('2d');
- if (!ctx) {
- throw new Error('Invalid ctx');
- }
- ctx.drawImage(target, 0, 0, canvas.width, canvas.height);
- var DOMURL = window.URL;
- var img = new Image(canvas.width, canvas.height);
- img.setAttribute('crossOrigin', 'anonymous');
- var blob = new Blob([data], { type: 'image/svg+xml' });
- var url = DOMURL.createObjectURL(blob);
- img.onload = function () {
- ctx.drawImage(img, 0, 0);
- DOMURL.revokeObjectURL(url);
- done(canvas.toDataURL('image/png'));
- };
- img.src = url;
- };
- return Synthetizer;
- }();
- exports.Synthetizer = Synthetizer;
-
- /***/ }),
-
- /***/ "./src/toolbar/Toolbar.ts":
- /*!********************************!*\
- !*** ./src/toolbar/Toolbar.ts ***!
- \********************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var __extends = this && this.__extends || function () {
- var extendStatics = function (d, b) {
- extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
- d.__proto__ = b;
- } || function (d, b) {
- for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
- };
- return extendStatics(d, b);
- };
- return function (d, b) {
- extendStatics(d, b);
- function __() {
- this.constructor = d;
- }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- }();
- Object.defineProperty(exports, "__esModule", { value: true });
- var interactjs_1 = __webpack_require__(/*! interactjs */ "./node_modules/interactjs/dist/interact.js");
- var ToolbarButton_1 = __webpack_require__(/*! ./ToolbarButton */ "./src/toolbar/ToolbarButton.ts");
- var uuid_1 = __webpack_require__(/*! ../utils/uuid */ "./src/utils/uuid.ts");
- __webpack_require__(/*! ./index.less */ "./src/toolbar/index.less");
- var index_1 = __webpack_require__(/*! ../renderer/DomEventAware/index */ "./src/renderer/DomEventAware/index.ts");
- var toolbar_items_1 = __webpack_require__(/*! ./toolbar-items */ "./src/toolbar/toolbar-items.ts");
- var Toolbar = function (_super) {
- __extends(Toolbar, _super);
- function Toolbar(toolbarItems, clickHandler) {
- var _this = _super.call(this) || this;
- _this.id = uuid_1.uuid();
- _this.zIndex = 999;
- _this.toolbarButtons = [];
- _this.getUI = function (drawboard) {
- _this.toolbarUI = document.createElement('div');
- _this.toolbarUI.id = "fcw-toolbar-" + _this.id;
- _this.toolbarUI.className = 'fc-whiteboard-toolbar';
- for (var _i = 0, _a = _this.toolbarItems; _i < _a.length; _i++) {
- var toolbarItem = _a[_i];
- var toolbarButton = new ToolbarButton_1.ToolbarButton(toolbarItem, _this.clickHandler);
- toolbarButton.drawboard = drawboard;
- _this.toolbarUI.appendChild(toolbarButton.getElement());
- _this.toolbarButtons.push(toolbarButton);
- }
- _super.prototype.init.call(_this, _this.toolbarUI);
- interactjs_1.default('#drag-handler').draggable({
- onmove: _this.onDragMove
- });
- return _this.toolbarUI;
- };
- _this.onMouseDown = function (downEv) {};
- _this.onMouseUp = function (ev) {};
- _this.onMouseMove = function (ev) {};
- _this.onDragMove = function (event) {
- var target = _this.toolbarUI;
- var x = (parseFloat(target.getAttribute('data-x')) || 0) + event.dx;
- var y = (parseFloat(target.getAttribute('data-y')) || 0) + event.dy;
- target.style.webkitTransform = target.style.transform = 'translate(' + x + 'px, ' + y + 'px)';
- target.style.zIndex = "" + _this.zIndex;
- target.setAttribute('data-x', x);
- target.setAttribute('data-y', y);
- };
- _this.toolbarItems = [toolbar_items_1.dragToolbarItem].concat(toolbarItems);
- _this.clickHandler = clickHandler;
- return _this;
- }
- Object.defineProperty(Toolbar.prototype, "toolbarButtonMap", {
- get: function () {
- var buttonMap = {};
- this.toolbarButtons.forEach(function (b) {
- buttonMap[b.id] = b;
- });
- return buttonMap;
- },
- enumerable: true,
- configurable: true
- });
- Toolbar.prototype.hide = function () {
- this.toolbarUI.style.visibility = 'hidden';
- this.toolbarUI.style.zIndex = '-1';
- };
- Toolbar.prototype.show = function () {
- this.toolbarUI.style.visibility = 'visible';
- this.toolbarUI.style.zIndex = "" + this.zIndex;
- };
- return Toolbar;
- }(index_1.DomEventAware);
- exports.Toolbar = Toolbar;
-
- /***/ }),
-
- /***/ "./src/toolbar/ToolbarButton.ts":
- /*!**************************************!*\
- !*** ./src/toolbar/ToolbarButton.ts ***!
- \**************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", { value: true });
- var tippy_js_1 = __webpack_require__(/*! tippy.js */ "./node_modules/tippy.js/esm/index.all.js");
- var uuid_1 = __webpack_require__(/*! ../utils/uuid */ "./src/utils/uuid.ts");
- var ToolbarButton = function () {
- function ToolbarButton(toolbarItem, clickHandler) {
- var _this = this;
- this.id = uuid_1.uuid();
- this.getElement = function () {
- if (_this.toolbarItem.onRender) {
- _this.container = _this.toolbarItem.onRender().cloneNode(true);
- return _this.container;
- }
- var div = document.createElement('div');
- if (_this.toolbarItem.name !== 'separator') {
- div.className = 'fc-whiteboard-toolbar-button';
- if (_this.clickHandler) {
- div.addEventListener('click', function (ev) {
- if (_this.clickHandler) {
- _this.clickHandler(ev, _this.toolbarItem);
- }
- });
- }
- if (_this.toolbarItem.icon) {
- div.title = _this.toolbarItem.tooltipText || '';
- div.innerHTML = _this.toolbarItem.icon;
- } else {
- div.innerText = _this.toolbarItem.tooltipText || '';
- }
- if (_this.toolbarItem.tooltipText) {
- tippy_js_1.default(div, {
- content: _this.toolbarItem.shortcut ? _this.toolbarItem.tooltipText + " " + _this.toolbarItem.shortcut : _this.toolbarItem.tooltipText
- });
- }
- } else {
- div.className = 'fc-whiteboard-toolbar-separator';
- }
- div.id = "fc-whiteboard-toolbar-" + _this.toolbarItem.name;
- _this.container = div;
- return div;
- };
- this.toolbarItem = toolbarItem;
- if (clickHandler) {
- this.clickHandler = clickHandler;
- }
- }
- return ToolbarButton;
- }();
- exports.ToolbarButton = ToolbarButton;
-
- /***/ }),
-
- /***/ "./src/toolbar/ToolbarItem.ts":
- /*!************************************!*\
- !*** ./src/toolbar/ToolbarItem.ts ***!
- \************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", { value: true });
- var ToolbarItem = function () {
- function ToolbarItem(_a) {
- var name = _a.name,
- tooltipText = _a.tooltipText,
- shortcut = _a.shortcut,
- icon = _a.icon,
- draggable = _a.draggable,
- markerType = _a.markerType,
- onRender = _a.onRender,
- onClick = _a.onClick;
- if (!name) {
- throw new Error('Invalid params');
- }
- this.name = name;
- this.tooltipText = tooltipText;
- this.shortcut = shortcut;
- this.icon = icon;
- this.markerType = markerType;
- this.draggable = draggable;
- this.onClick = onClick;
- this.onRender = onRender;
- }
- return ToolbarItem;
- }();
- exports.ToolbarItem = ToolbarItem;
-
- /***/ }),
-
- /***/ "./src/toolbar/index.less":
- /*!********************************!*\
- !*** ./src/toolbar/index.less ***!
- \********************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
-
- var content = __webpack_require__(/*! !../../node_modules/css-loader/dist/cjs.js??ref--11-1!../../node_modules/postcss-loader/src!../../node_modules/less-loader/dist/cjs.js??ref--11-3!./index.less */ "./node_modules/css-loader/dist/cjs.js?!./node_modules/postcss-loader/src/index.js!./node_modules/less-loader/dist/cjs.js?!./src/toolbar/index.less");
-
- if(typeof content === 'string') content = [[module.i, content, '']];
-
- var transform;
- var insertInto;
-
-
-
- var options = {"hmr":true}
-
- options.transform = transform
- options.insertInto = undefined;
-
- var update = __webpack_require__(/*! ../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options);
-
- if(content.locals) module.exports = content.locals;
-
- if(false) {}
-
- /***/ }),
-
- /***/ "./src/toolbar/toolbar-items.ts":
- /*!**************************************!*\
- !*** ./src/toolbar/toolbar-items.ts ***!
- \**************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", { value: true });
- var index_1 = __webpack_require__(/*! ./../markers/RectMarker/index */ "./src/markers/RectMarker/index.ts");
- var index_2 = __webpack_require__(/*! ./../markers/CoverMarker/index */ "./src/markers/CoverMarker/index.ts");
- var index_3 = __webpack_require__(/*! ./../markers/TextMarker/index */ "./src/markers/TextMarker/index.ts");
- var index_4 = __webpack_require__(/*! ./../markers/ArrowMarker/index */ "./src/markers/ArrowMarker/index.ts");
- var index_5 = __webpack_require__(/*! ./../markers/HighlightMarker/index */ "./src/markers/HighlightMarker/index.ts");
- var ToolbarItem_1 = __webpack_require__(/*! ./ToolbarItem */ "./src/toolbar/ToolbarItem.ts");
- var LineMarker_1 = __webpack_require__(/*! ../markers/LineMarker */ "./src/markers/LineMarker/index.ts");
- var OkIcon = __webpack_require__(/*! ../assets/check.svg */ "./src/assets/check.svg");
- var DeleteIcon = __webpack_require__(/*! ../assets/eraser.svg */ "./src/assets/eraser.svg");
- var CloseIcon = __webpack_require__(/*! ../assets/times.svg */ "./src/assets/times.svg");
- exports.dragToolbarItem = new ToolbarItem_1.ToolbarItem({
- name: 'drag',
- tooltipText: 'Drag',
- icon: __webpack_require__(/*! ../assets/drag.svg */ "./src/assets/drag.svg")
- });
- exports.highlightMarkerToolbarItem = new ToolbarItem_1.ToolbarItem({
- name: 'cover-marker',
- tooltipText: 'Hightlight',
- shortcut: 'Shift+H',
- icon: __webpack_require__(/*! ../assets/highlight.svg */ "./src/assets/highlight.svg"),
- markerType: index_5.HighlightMarker,
- draggable: true
- });
- exports.arrowMarkerToolbarItem = new ToolbarItem_1.ToolbarItem({
- name: 'arrow-marker',
- tooltipText: 'Arrow',
- shortcut: 'Shift+A',
- icon: __webpack_require__(/*! ../assets/arrow.svg */ "./src/assets/arrow.svg"),
- markerType: index_4.ArrowMarker,
- draggable: true
- });
- exports.textMarkerToolbarItem = new ToolbarItem_1.ToolbarItem({
- name: 'text-marker',
- tooltipText: 'Text',
- shortcut: 'Shift+T',
- icon: __webpack_require__(/*! ../assets/text.svg */ "./src/assets/text.svg"),
- markerType: index_3.TextMarker,
- draggable: true
- });
- exports.coverMarkerToolbarItem = new ToolbarItem_1.ToolbarItem({
- name: 'cover-marker',
- tooltipText: 'Cover',
- shortcut: 'Shift+C',
- icon: __webpack_require__(/*! ../assets/cover.svg */ "./src/assets/cover.svg"),
- markerType: index_2.CoverMarker,
- draggable: true
- });
- exports.rectMarkerToolbarItem = new ToolbarItem_1.ToolbarItem({
- name: 'rect-marker',
- tooltipText: 'Rectangle',
- shortcut: 'Shift+R',
- icon: __webpack_require__(/*! ../assets/rect.svg */ "./src/assets/rect.svg"),
- markerType: index_1.RectMarker,
- draggable: true
- });
- exports.lineMarkerToolbarItem = new ToolbarItem_1.ToolbarItem({
- name: 'line-marker',
- tooltipText: 'Line',
- shortcut: 'Shift+L',
- icon: __webpack_require__(/*! ../assets/line.svg */ "./src/assets/line.svg"),
- markerType: LineMarker_1.LineMarker,
- draggable: true
- });
- exports.closeToolbarItem = new ToolbarItem_1.ToolbarItem({
- icon: CloseIcon,
- name: 'close',
- tooltipText: 'Close'
- });
- exports.separatorToolbarItem = new ToolbarItem_1.ToolbarItem({ name: 'separator', tooltipText: '' });
- function getToolbars(page) {
- var toolbars = [{
- icon: DeleteIcon,
- name: 'delete',
- tooltipText: 'Delete'
- }, exports.rectMarkerToolbarItem, exports.coverMarkerToolbarItem, exports.highlightMarkerToolbarItem, exports.lineMarkerToolbarItem, exports.arrowMarkerToolbarItem, exports.textMarkerToolbarItem];
- if (!page) {
- toolbars.push.apply(toolbars, [{
- icon: OkIcon,
- name: 'ok',
- tooltipText: 'OK'
- }]);
- }
- return toolbars;
- }
- exports.getToolbars = getToolbars;
-
- /***/ }),
-
- /***/ "./src/utils/dom.ts":
- /*!**************************!*\
- !*** ./src/utils/dom.ts ***!
- \**************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", { value: true });
- function createDivWithClassName(className, parent) {
- var ele = document.createElement('div');
- if (parent) {
- parent.appendChild(ele);
- }
- if (className) {
- addClassName(ele, className);
- }
- return ele;
- }
- exports.createDivWithClassName = createDivWithClassName;
- function addClassName(ele, className) {
- if (!ele) {
- return;
- }
- ele.className = ((ele.className || '') + " " + className).trim();
- }
- exports.addClassName = addClassName;
-
- /***/ }),
-
- /***/ "./src/utils/layout.ts":
- /*!*****************************!*\
- !*** ./src/utils/layout.ts ***!
- \*****************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", { value: true });
- function rectContains(rect, _a) {
- var x = _a.x,
- y = _a.y;
- if (x < rect.left || x > rect.left + rect.width || y < rect.top || y > rect.top + rect.height) {
- return false;
- }
- return true;
- }
- exports.rectContains = rectContains;
-
- /***/ }),
-
- /***/ "./src/utils/types.ts":
- /*!****************************!*\
- !*** ./src/utils/types.ts ***!
- \****************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", { value: true });
- function isNil(mayBeNil) {
- return mayBeNil === null || mayBeNil === undefined;
- }
- exports.isNil = isNil;
-
- /***/ }),
-
- /***/ "./src/utils/uuid.ts":
- /*!***************************!*\
- !*** ./src/utils/uuid.ts ***!
- \***************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", { value: true });
- var uuidV1 = __webpack_require__(/*! uuid/v1 */ "./node_modules/uuid/v1.js");
- exports.uuid = uuidV1;
-
- /***/ }),
-
- /***/ "./src/utils/validator.ts":
- /*!********************************!*\
- !*** ./src/utils/validator.ts ***!
- \********************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", { value: true });
- function isHTMLImageElement(ele) {
- if (typeof ele === 'object' && ele instanceof HTMLImageElement) {
- return true;
- }
- return false;
- }
- exports.isHTMLImageElement = isHTMLImageElement;
-
- /***/ }),
-
- /***/ "./src/whiteboard/AbstractWhiteboard/index.less":
- /*!******************************************************!*\
- !*** ./src/whiteboard/AbstractWhiteboard/index.less ***!
- \******************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
-
- var content = __webpack_require__(/*! !../../../node_modules/css-loader/dist/cjs.js??ref--11-1!../../../node_modules/postcss-loader/src!../../../node_modules/less-loader/dist/cjs.js??ref--11-3!./index.less */ "./node_modules/css-loader/dist/cjs.js?!./node_modules/postcss-loader/src/index.js!./node_modules/less-loader/dist/cjs.js?!./src/whiteboard/AbstractWhiteboard/index.less");
-
- if(typeof content === 'string') content = [[module.i, content, '']];
-
- var transform;
- var insertInto;
-
-
-
- var options = {"hmr":true}
-
- options.transform = transform
- options.insertInto = undefined;
-
- var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options);
-
- if(content.locals) module.exports = content.locals;
-
- if(false) {}
-
- /***/ }),
-
- /***/ "./src/whiteboard/AbstractWhiteboard/index.ts":
- /*!****************************************************!*\
- !*** ./src/whiteboard/AbstractWhiteboard/index.ts ***!
- \****************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", { value: true });
- var index_1 = __webpack_require__(/*! ../WhitePage/index */ "./src/whiteboard/WhitePage/index.ts");
- var uuid_1 = __webpack_require__(/*! ../../utils/uuid */ "./src/utils/uuid.ts");
- var dom_1 = __webpack_require__(/*! ../../utils/dom */ "./src/utils/dom.ts");
- __webpack_require__(/*! ./index.less */ "./src/whiteboard/AbstractWhiteboard/index.less");
- var Siema = __webpack_require__(/*! siema */ "./node_modules/siema/dist/siema.min.js");
- var prefix = 'fcw-board';
- var AbstractWhiteboard = function () {
- function AbstractWhiteboard(target, _a) {
- var _b = _a === void 0 ? {} : _a,
- sources = _b.sources,
- eventHub = _b.eventHub,
- visiblePageIndex = _b.visiblePageIndex,
- allowRollback = _b.allowRollback,
- onlyEmitSnap = _b.onlyEmitSnap;
- this.id = uuid_1.uuid();
- this.sources = [];
- this.imgEles = [];
- this.allowRollback = false;
- this.onlyEmitSnap = false;
- this.snapInterval = 15 * 1000;
- this.mode = 'master';
- this.isFullscreen = false;
- this.pages = [];
- this.snapHistory = [];
- this.isInitialized = false;
- this.isSyncing = false;
- this.visiblePageIndex = 0;
- if (target) {
- this.target = target;
- } else {
- this.target = document.createElement('div');
- document.body.appendChild(this.target);
- }
- if (!this.target.id) {
- this.target.id = this.id;
- }
- dom_1.addClassName(this.target, prefix);
- if (sources) {
- this.sources = sources;
- }
- this.eventHub = eventHub;
- if (typeof visiblePageIndex !== 'undefined') {
- this.visiblePageIndex = visiblePageIndex;
- }
- this.onlyEmitSnap = !!onlyEmitSnap;
- if (typeof allowRollback !== 'undefined') {
- this.allowRollback = !!allowRollback;
- }
- this.init();
- }
- Object.defineProperty(AbstractWhiteboard.prototype, "activePage", {
- get: function () {
- return this.pages[this.visiblePageIndex];
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(AbstractWhiteboard.prototype, "pageMap", {
- get: function () {
- var map = {};
- this.pages.forEach(function (p) {
- return map[p.id] = p;
- });
- return map;
- },
- enumerable: true,
- configurable: true
- });
- AbstractWhiteboard.prototype.open = function () {
- var _this = this;
- this.pages.forEach(function (page, i) {
- page.open();
- if (i !== _this.visiblePageIndex) {
- page.hide();
- }
- });
- };
- AbstractWhiteboard.prototype.close = function () {
- if (this.emitInterval) {
- clearInterval(this.emitInterval);
- }
- };
- AbstractWhiteboard.prototype.show = function () {
- if (this.activePage) {
- this.activePage.show();
- }
- };
- AbstractWhiteboard.prototype.hide = function () {
- if (this.activePage) {
- this.activePage.hide();
- }
- };
- AbstractWhiteboard.prototype.emit = function (borderEvent) {
- if (this.mode !== 'master' || !this.eventHub) {
- return;
- }
- if (this.onlyEmitSnap) {
- if (borderEvent.event !== 'borderSnap') {
- return;
- }
- }
- if (this.allowRollback && (borderEvent.event === 'addMarker' || borderEvent.event === 'removeMarker')) {
- if (this.snapHistory.length > 20) {
- this.snapHistory.shift();
- }
- this.snapHistory.push(this.captureSnap(false));
- }
- borderEvent.timestamp = Math.floor(Date.now() / 1000);
- this.eventHub.emit('sync', borderEvent);
- };
- AbstractWhiteboard.prototype.captureSnap = function (shadow) {
- if (shadow === void 0) {
- shadow = true;
- }
- if (shadow) {
- return {
- id: this.id,
- sources: this.sources,
- pageIds: this.pages.map(function (page) {
- return page.id;
- }),
- visiblePageIndex: this.visiblePageIndex
- };
- }
- return {
- id: this.id,
- sources: this.sources,
- pageIds: this.pages.map(function (page) {
- return page.id;
- }),
- visiblePageIndex: this.visiblePageIndex,
- pages: this.pages.map(function (p) {
- return p.captureSnap();
- })
- };
- };
- AbstractWhiteboard.prototype.rollbackSnap = function () {
- if (this.snapHistory.length === 0) {
- return;
- }
- this.snapHistory.pop();
- var snap = this.snapHistory[this.snapHistory.length - 1];
- if (snap) {
- this.applySnap(snap);
- }
- };
- AbstractWhiteboard.prototype.destroy = function () {
- if (this.emitInterval) {
- clearInterval(this.emitInterval);
- }
- if (this.eventHub) {
- this.eventHub.removeAllListeners();
- }
- if (this.siema) {
- this.siema.destroy();
- }
- this.imgsContainer.remove();
- this.pagesContainer.remove();
- this.pages.forEach(function (page) {
- page.destroy();
- });
- };
- AbstractWhiteboard.prototype.initSiema = function () {
- var _this = this;
- this.sources.forEach(function (source) {
- var imgEle = document.createElement('div');
- dom_1.addClassName(imgEle, prefix + "-img-wrapper");
- imgEle.style.backgroundImage = "url(" + source + ")";
- _this.imgEles.push(imgEle);
- _this.imgsContainer.appendChild(imgEle);
- });
- this.siema = new Siema({
- selector: this.imgsContainer,
- duration: 200,
- easing: 'ease-out',
- perPage: 1,
- startIndex: 0,
- draggable: false,
- multipleDrag: true,
- threshold: 20,
- loop: false,
- rtl: false
- });
- };
- AbstractWhiteboard.prototype.applySnap = function (snap) {
- var _this = this;
- var id = snap.id,
- sources = snap.sources,
- pageIds = snap.pageIds;
- if (!this.isInitialized && !this.isSyncing) {
- this.id = id;
- this.sources = sources;
- this.isSyncing = true;
- this.sources.forEach(function (source, i) {
- var page = new index_1.WhitePage({ imgSrc: source }, {
- mode: _this.mode,
- whiteboard: _this,
- parentContainer: _this.pagesContainer
- });
- page.id = pageIds[i];
- page.container.style.visibility = 'hidden';
- _this.pages.push(page);
- page.open();
- });
- this.initSiema();
- this.isInitialized = true;
- this.isSyncing = false;
- }
- this.onPageChange(snap.visiblePageIndex);
- (snap.pages || []).forEach(function (pageSnap) {
- var page = _this.pageMap[pageSnap.id];
- if (page) {
- page.applySnap(pageSnap);
- }
- });
- };
- return AbstractWhiteboard;
- }();
- exports.AbstractWhiteboard = AbstractWhiteboard;
-
- /***/ }),
-
- /***/ "./src/whiteboard/MirrorWhiteboard/index.ts":
- /*!**************************************************!*\
- !*** ./src/whiteboard/MirrorWhiteboard/index.ts ***!
- \**************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var __extends = this && this.__extends || function () {
- var extendStatics = function (d, b) {
- extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
- d.__proto__ = b;
- } || function (d, b) {
- for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
- };
- return extendStatics(d, b);
- };
- return function (d, b) {
- extendStatics(d, b);
- function __() {
- this.constructor = d;
- }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- }();
- Object.defineProperty(exports, "__esModule", { value: true });
- var dom_1 = __webpack_require__(/*! ../../utils/dom */ "./src/utils/dom.ts");
- var index_1 = __webpack_require__(/*! ../AbstractWhiteboard/index */ "./src/whiteboard/AbstractWhiteboard/index.ts");
- var prefix = 'fcw-board';
- var MirrorWhiteboard = function (_super) {
- __extends(MirrorWhiteboard, _super);
- function MirrorWhiteboard() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.mode = 'mirror';
- return _this;
- }
- MirrorWhiteboard.prototype.init = function () {
- var _this = this;
- this.imgsContainer = dom_1.createDivWithClassName(prefix + "-imgs", this.target);
- this.pagesContainer = dom_1.createDivWithClassName(prefix + "-pages", this.target);
- if (!this.eventHub) {
- throw new Error('Invalid eventHub');
- }
- this.eventHub.on('sync', function (ev) {
- if (ev.target !== 'whiteboard' || !ev.border) {
- return;
- }
- if (ev.event === 'borderSnap') {
- _this.applySnap(ev.border);
- }
- if (ev.event === 'borderChangePage' && ev.id === _this.id) {
- if (_this.isInitialized) {
- _this.onPageChange(ev.border.visiblePageIndex);
- }
- }
- if (ev.event === 'finish' && ev.id === _this.id) {
- _this.destroy();
- }
- });
- };
- MirrorWhiteboard.prototype.destroy = function () {
- _super.prototype.destroy.call(this);
- };
- MirrorWhiteboard.prototype.onPageChange = function (nextPageIndex) {
- if (this.visiblePageIndex === nextPageIndex) {
- return;
- }
- this.siema.goTo(nextPageIndex);
- this.visiblePageIndex = nextPageIndex;
- this.pages.forEach(function (page, i) {
- if (nextPageIndex === i) {
- page.show();
- } else {
- page.hide();
- }
- });
- this.emit({
- event: 'borderChangePage',
- id: this.id,
- target: 'whiteboard',
- border: this.captureSnap()
- });
- };
- return MirrorWhiteboard;
- }(index_1.AbstractWhiteboard);
- exports.MirrorWhiteboard = MirrorWhiteboard;
-
- /***/ }),
-
- /***/ "./src/whiteboard/ReplayWhiteboard/index.ts":
- /*!**************************************************!*\
- !*** ./src/whiteboard/ReplayWhiteboard/index.ts ***!
- \**************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var __extends = this && this.__extends || function () {
- var extendStatics = function (d, b) {
- extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
- d.__proto__ = b;
- } || function (d, b) {
- for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
- };
- return extendStatics(d, b);
- };
- return function (d, b) {
- extendStatics(d, b);
- function __() {
- this.constructor = d;
- }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- }();
- Object.defineProperty(exports, "__esModule", { value: true });
- var MirrorWhiteboard_1 = __webpack_require__(/*! ../MirrorWhiteboard */ "./src/whiteboard/MirrorWhiteboard/index.ts");
- var EventHub_1 = __webpack_require__(/*! ../../event/EventHub */ "./src/event/EventHub.ts");
- var windowSize = 60 * 1000;
- var duration = 0.05;
- var ReplayWhiteboard = function (_super) {
- __extends(ReplayWhiteboard, _super);
- function ReplayWhiteboard() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.leftEvents = [];
- _this.currentRelativeTime = 0;
- _this.loadedRelativeTime = -1;
- _this.loadingLock = false;
- _this.seekingLock = false;
- _this.seek = function () {
- if (_this.seekingLock) {
- return;
- }
- _this.seekingLock = true;
- if (_this.loadedRelativeTime < _this.currentRelativeTime) {
- _this.loadEvents();
- }
- var waitingEvents = [];
- var leftEvents = [];
- _this.leftEvents.forEach(function (e, i) {
- if (e.timestamp && e.timestamp < _this.currentRelativeTime + _this.recordStartTime) {
- waitingEvents.push(e);
- } else {
- leftEvents.push(e);
- }
- });
- _this.leftEvents = leftEvents;
- waitingEvents.forEach(function (e) {
- _this.perform(e);
- });
- _this.currentRelativeTime += duration;
- _this.seekingLock = false;
- };
- _this.perform = function (e) {
- _this.eventHub.emit('sync', e);
- };
- return _this;
- }
- ReplayWhiteboard.prototype.setContext = function (recordStartTime, onLoad) {
- var _this = this;
- this.recordStartTime = recordStartTime;
- this.onLoad = onLoad;
- if (this.interval) {
- clearInterval(this.interval);
- }
- this.interval = setInterval(function () {
- _this.seek();
- }, duration * 1000);
- };
- ReplayWhiteboard.prototype.setCurrentRelativeTime = function (time) {
- this.currentRelativeTime = time;
- this.loadedRelativeTime = this.currentRelativeTime - 1;
- };
- ReplayWhiteboard.prototype.close = function () {
- _super.prototype.close.call(this);
- if (this.interval) {
- clearInterval(this.interval);
- }
- };
- ReplayWhiteboard.prototype.init = function () {
- this.eventHub = new EventHub_1.EventHub();
- _super.prototype.init.call(this);
- };
- ReplayWhiteboard.prototype.loadEvents = function () {
- var _this = this;
- if (this.onLoad && !this.loadingLock) {
- this.loadingLock = true;
- var startTime = this.recordStartTime + this.currentRelativeTime;
- var endTime = startTime + windowSize;
- this.onLoad(startTime, endTime).then(function (events) {
- var _a;
- _this.loadedRelativeTime = _this.currentRelativeTime;
- (_a = _this.leftEvents).push.apply(_a, events || []);
- }).finally(function () {
- _this.loadingLock = false;
- });
- }
- };
- return ReplayWhiteboard;
- }(MirrorWhiteboard_1.MirrorWhiteboard);
- exports.ReplayWhiteboard = ReplayWhiteboard;
-
- /***/ }),
-
- /***/ "./src/whiteboard/WhitePage/index.less":
- /*!*********************************************!*\
- !*** ./src/whiteboard/WhitePage/index.less ***!
- \*********************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
-
- var content = __webpack_require__(/*! !../../../node_modules/css-loader/dist/cjs.js??ref--11-1!../../../node_modules/postcss-loader/src!../../../node_modules/less-loader/dist/cjs.js??ref--11-3!./index.less */ "./node_modules/css-loader/dist/cjs.js?!./node_modules/postcss-loader/src/index.js!./node_modules/less-loader/dist/cjs.js?!./src/whiteboard/WhitePage/index.less");
-
- if(typeof content === 'string') content = [[module.i, content, '']];
-
- var transform;
- var insertInto;
-
-
-
- var options = {"hmr":true}
-
- options.transform = transform
- options.insertInto = undefined;
-
- var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options);
-
- if(content.locals) module.exports = content.locals;
-
- if(false) {}
-
- /***/ }),
-
- /***/ "./src/whiteboard/WhitePage/index.ts":
- /*!*******************************************!*\
- !*** ./src/whiteboard/WhitePage/index.ts ***!
- \*******************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", { value: true });
- var index_1 = __webpack_require__(/*! ./../../drawboard/Drawboard/index */ "./src/drawboard/Drawboard/index.ts");
- var uuid_1 = __webpack_require__(/*! ../../utils/uuid */ "./src/utils/uuid.ts");
- var types_1 = __webpack_require__(/*! ../../markers/types */ "./src/markers/types.ts");
- var dom_1 = __webpack_require__(/*! ../../utils/dom */ "./src/utils/dom.ts");
- __webpack_require__(/*! ./index.less */ "./src/whiteboard/WhitePage/index.less");
- var prefix = 'fcw-page';
- var WhitePage = function () {
- function WhitePage(source, _a) {
- var _b = _a === void 0 ? {} : _a,
- mode = _b.mode,
- whiteboard = _b.whiteboard,
- parentContainer = _b.parentContainer,
- extraToolbarItems = _b.extraToolbarItems;
- this.id = uuid_1.uuid();
- this.mode = 'master';
- if (mode) {
- this.mode = mode;
- }
- this.parentContainer = parentContainer;
- this.whiteboard = whiteboard;
- this.initSource(source);
- if (this.mode === 'master') {
- this.initMaster(extraToolbarItems);
- }
- if (this.mode === 'mirror') {
- this.initMirror();
- }
- }
- WhitePage.prototype.open = function () {
- this.drawboard.open();
- };
- WhitePage.prototype.hide = function () {
- this.drawboard.hide();
- };
- WhitePage.prototype.show = function () {
- this.drawboard.show();
- };
- WhitePage.prototype.destroy = function () {
- this.drawboard.destroy();
- };
- WhitePage.prototype.captureSnap = function () {
- var markerSnaps = this.drawboard.markers.map(function (m) {
- return m.captureSnap();
- });
- return {
- id: this.id,
- markers: markerSnaps
- };
- };
- WhitePage.prototype.applySnap = function (snap) {
- var _this = this;
- var markerIdsSet = new Set();
- snap.markers.forEach(function (markerSnap) {
- var marker = _this.drawboard.markerMap[markerSnap.id];
- markerIdsSet.add(markerSnap.id);
- if (marker) {
- marker.applySnap(markerSnap);
- } else {
- var newMarker = _this.drawboard.addMarker(types_1.getMarkerByType(markerSnap.type), {
- id: markerSnap.id
- });
- newMarker.applySnap(markerSnap);
- }
- });
- this.drawboard.markers.forEach(function (marker) {
- if (!markerIdsSet.has(marker.id)) {
- _this.drawboard.deleteMarkerWithEvent(marker);
- }
- });
- };
- WhitePage.prototype.initSource = function (source) {
- if (typeof source.imgSrc === 'string' && !this.parentContainer) {
- throw new Error('Invalid source, If you set image url, you must also set parentContainer');
- }
- this.source = source;
- if (source.imgEle) {
- this.target = source.imgEle;
- }
- if (typeof source.imgSrc === 'string') {
- this.container = dom_1.createDivWithClassName(prefix, this.parentContainer);
- this.container.id = this.id;
- this.target = document.createElement('img');
- this.target.src = source.imgSrc;
- this.target.alt = 'Siema image';
- this.container.appendChild(this.target);
- }
- };
- WhitePage.prototype.initMaster = function (extraToolbarItems) {
- var _this = this;
- if (this.whiteboard) {
- this.drawboard = new index_1.Drawboard({ imgEle: this.target }, {
- extraToolbarItems: extraToolbarItems,
- mountContainer: this.whiteboard.target,
- page: this,
- onChange: function (ev) {
- return _this.whiteboard.emit(ev);
- }
- });
- } else {
- this.drawboard = new index_1.Drawboard({ imgEle: this.target }, { page: this, mountContainer: this.whiteboard.target });
- }
- };
- WhitePage.prototype.initMirror = function () {
- var _this = this;
- if (!this.whiteboard) {
- throw new Error('Invalid whiteboard');
- }
- this.drawboard = new index_1.Drawboard({ imgEle: this.target }, { page: this, mountContainer: this.whiteboard.target });
- this.whiteboard.eventHub.on('sync', function (ev) {
- try {
- if (ev.target === 'page' && ev.id === _this.id) {
- _this.onPageSync();
- }
- if (ev.target === 'marker') {
- _this.onMarkerSync(ev);
- }
- } catch (e) {
- console.warn(e);
- }
- });
- };
- WhitePage.prototype.onPageSync = function () {};
- WhitePage.prototype.onMarkerSync = function (ev) {
- if (!ev.marker) {
- return;
- }
- var id = ev.id;
- if (ev.event === 'addMarker' && ev.parentId === this.id) {
- var marker = this.drawboard.markerMap[id];
- if (!marker) {
- this.drawboard.addMarker(types_1.getMarkerByType(ev.marker.type), {
- id: ev.marker.id,
- originX: ev.marker.dx,
- originY: ev.marker.dy
- });
- }
- }
- if (!id) {
- return;
- }
- if (ev.event === 'removeMarker') {
- var marker = this.drawboard.markerMap[id];
- if (marker) {
- this.drawboard.deleteMarker(marker);
- }
- }
- if (ev.event === 'moveMarker' || ev.event === 'resizeMarker') {
- var marker = this.drawboard.markerMap[id];
- if (marker) {
- marker.reactToManipulation(ev.event, ev.marker);
- }
- }
- if (ev.event === 'inputMarker') {
- var marker = this.drawboard.markerMap[id];
- if (marker) {
- marker.setText(ev.marker.text);
- }
- }
- };
- return WhitePage;
- }();
- exports.WhitePage = WhitePage;
-
- /***/ }),
-
- /***/ "./src/whiteboard/Whiteboard/index.ts":
- /*!********************************************!*\
- !*** ./src/whiteboard/Whiteboard/index.ts ***!
- \********************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var __extends = this && this.__extends || function () {
- var extendStatics = function (d, b) {
- extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) {
- d.__proto__ = b;
- } || function (d, b) {
- for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
- };
- return extendStatics(d, b);
- };
- return function (d, b) {
- extendStatics(d, b);
- function __() {
- this.constructor = d;
- }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- }();
- Object.defineProperty(exports, "__esModule", { value: true });
- var index_1 = __webpack_require__(/*! ../WhitePage/index */ "./src/whiteboard/WhitePage/index.ts");
- var dom_1 = __webpack_require__(/*! ../../utils/dom */ "./src/utils/dom.ts");
- var index_2 = __webpack_require__(/*! ../AbstractWhiteboard/index */ "./src/whiteboard/AbstractWhiteboard/index.ts");
- var toolbar_items_1 = __webpack_require__(/*! ../../toolbar/toolbar-items */ "./src/toolbar/toolbar-items.ts");
- var LeftArrowIcon = __webpack_require__(/*! ../../assets/bx-left-arrow.svg */ "./src/assets/bx-left-arrow.svg");
- var RightArrowIcon = __webpack_require__(/*! ../../assets/bx-right-arrow.svg */ "./src/assets/bx-right-arrow.svg");
- var FinishIcon = __webpack_require__(/*! ../../assets/finish.svg */ "./src/assets/finish.svg");
- var RollbackIcon = __webpack_require__(/*! ../../assets/rollback.svg */ "./src/assets/rollback.svg");
- var prefix = 'fcw-board';
- var Whiteboard = function (_super) {
- __extends(Whiteboard, _super);
- function Whiteboard() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.mode = 'master';
- return _this;
- }
- Whiteboard.prototype.destroy = function () {
- _super.prototype.destroy.call(this);
- };
- Whiteboard.prototype.init = function () {
- this.imgsContainer = dom_1.createDivWithClassName(prefix + "-imgs", this.target);
- this.pagesContainer = dom_1.createDivWithClassName(prefix + "-pages", this.target);
- this.initMaster();
- this.snapHistory.push(this.captureSnap(false));
- this.emitSnapshot();
- };
- Whiteboard.prototype.initMaster = function () {
- var _this = this;
- this.isInitialized = true;
- var prevToolbarItem = {
- icon: LeftArrowIcon,
- name: 'prev-flip-arrow',
- tooltipText: 'Prev',
- onClick: function () {
- var nextPageIndex = _this.visiblePageIndex - 1 < 0 ? _this.pages.length - 1 : _this.visiblePageIndex - 1;
- document.querySelectorAll('.fc-whiteboard-indicator-current').forEach(function (e) {
- e.innerHTML = "" + (nextPageIndex + 1);
- });
- _this.onPageChange(nextPageIndex);
- }
- };
- var indicatorContainer = document.createElement('div');
- indicatorContainer.className = 'fc-whiteboard-indicator-container';
- var indicatorCurrent = document.createElement('span');
- indicatorCurrent.className = 'fc-whiteboard-indicator-current';
- indicatorCurrent.innerHTML = "" + (this.visiblePageIndex + 1);
- indicatorContainer.appendChild(indicatorCurrent);
- indicatorContainer.appendChild(document.createTextNode("/" + this.sources.length));
- var indicatorItem = {
- name: 'indicator',
- onRender: function () {
- return indicatorContainer;
- }
- };
- var nextToolbarItem = {
- icon: RightArrowIcon,
- name: 'next-flip-arrow',
- tooltipText: 'Next',
- onClick: function () {
- var nextPageIndex = _this.visiblePageIndex + 1 > _this.pages.length - 1 ? 0 : _this.visiblePageIndex + 1;
- document.querySelectorAll('.fc-whiteboard-indicator-current').forEach(function (e) {
- e.innerHTML = "" + (nextPageIndex + 1);
- });
- _this.onPageChange(nextPageIndex);
- }
- };
- var finishItem = {
- icon: FinishIcon,
- name: 'finish',
- tooltipText: 'Finish',
- onClick: function () {
- _this.emit({
- event: 'finish',
- id: _this.id,
- target: 'whiteboard'
- });
- }
- };
- var rollbackItem = {
- icon: RollbackIcon,
- name: 'rollback',
- tooltipText: 'Rollback',
- shortcut: 'ESC',
- onClick: function () {
- _this.rollbackSnap();
- }
- };
- this.sources.forEach(function (source) {
- var page = new index_1.WhitePage({ imgSrc: source }, {
- mode: _this.mode,
- whiteboard: _this,
- parentContainer: _this.pagesContainer,
- extraToolbarItems: [toolbar_items_1.separatorToolbarItem, prevToolbarItem, indicatorItem, nextToolbarItem, toolbar_items_1.separatorToolbarItem, finishItem, rollbackItem]
- });
- page.container.style.visibility = 'hidden';
- _this.pages.push(page);
- });
- this.initSiema();
- };
- Whiteboard.prototype.onPageChange = function (nextPageIndex) {
- if (this.visiblePageIndex === nextPageIndex) {
- return;
- }
- this.siema.goTo(nextPageIndex);
- this.visiblePageIndex = nextPageIndex;
- this.pages.forEach(function (page, i) {
- if (nextPageIndex === i) {
- page.show();
- } else {
- page.hide();
- }
- });
- this.emit({
- event: 'borderChangePage',
- id: this.id,
- target: 'whiteboard',
- border: this.captureSnap()
- });
- };
- Whiteboard.prototype.emitSnapshot = function () {
- var _this = this;
- var innerFunc = function () {
- _this.emit({
- event: 'borderSnap',
- id: _this.id,
- target: 'whiteboard',
- border: _this.captureSnap(false)
- });
- };
- this.emitInterval = setInterval(function () {
- innerFunc();
- }, this.snapInterval);
- setTimeout(innerFunc, 500);
- };
- return Whiteboard;
- }(index_2.AbstractWhiteboard);
- exports.Whiteboard = Whiteboard;
-
- /***/ })
-
- /******/ });
- });
- //# sourceMappingURL=index.js.map
|